@refraction-ui/react 0.4.2 → 0.6.0

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 (304) hide show
  1. package/README.md +9 -1
  2. package/dist/chunk-O4453CBF.js +137 -0
  3. package/dist/chunk-O4453CBF.js.map +1 -0
  4. package/dist/chunk-XWP763SH.js +76 -0
  5. package/dist/chunk-XWP763SH.js.map +1 -0
  6. package/dist/faro-engine-47HGRAQH-JKINJPMH.js +3 -0
  7. package/dist/faro-engine-47HGRAQH-JKINJPMH.js.map +1 -0
  8. package/dist/form.cjs +340 -0
  9. package/dist/form.cjs.map +1 -0
  10. package/dist/form.d.cts +1 -0
  11. package/dist/form.d.ts +1 -0
  12. package/dist/form.js +204 -0
  13. package/dist/form.js.map +1 -0
  14. package/dist/index.cjs +1438 -237
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +76 -76
  17. package/dist/index.d.ts +76 -76
  18. package/dist/index.js +1317 -312
  19. package/dist/index.js.map +1 -1
  20. package/dist/internal/analytics/index.d.cts +448 -0
  21. package/dist/internal/analytics/index.d.ts +448 -0
  22. package/dist/internal/animated-text/index.d.cts +47 -0
  23. package/dist/internal/animated-text/index.d.ts +47 -0
  24. package/dist/internal/app-shell/index.d.cts +128 -0
  25. package/dist/internal/app-shell/index.d.ts +128 -0
  26. package/dist/internal/auth/index.d.cts +74 -0
  27. package/dist/internal/auth/index.d.ts +74 -0
  28. package/dist/internal/avatar/index.d.cts +53 -0
  29. package/dist/internal/avatar/index.d.ts +53 -0
  30. package/dist/internal/avatar-group/index.d.cts +70 -0
  31. package/dist/internal/avatar-group/index.d.ts +70 -0
  32. package/dist/internal/badge/index.d.cts +26 -0
  33. package/dist/internal/badge/index.d.ts +26 -0
  34. package/dist/internal/bottom-nav/index.d.cts +29 -0
  35. package/dist/internal/bottom-nav/index.d.ts +29 -0
  36. package/dist/internal/breadcrumbs/index.d.cts +38 -0
  37. package/dist/internal/breadcrumbs/index.d.ts +38 -0
  38. package/dist/internal/button/index.d.cts +34 -0
  39. package/dist/internal/button/index.d.ts +34 -0
  40. package/dist/internal/calendar/index.d.cts +73 -0
  41. package/dist/internal/calendar/index.d.ts +73 -0
  42. package/dist/internal/card/index.d.cts +62 -0
  43. package/dist/internal/card/index.d.ts +62 -0
  44. package/dist/internal/card-grid/index.d.cts +10 -0
  45. package/dist/internal/card-grid/index.d.ts +10 -0
  46. package/dist/internal/checkbox/index.d.cts +40 -0
  47. package/dist/internal/checkbox/index.d.ts +40 -0
  48. package/dist/internal/code-editor/index.d.cts +47 -0
  49. package/dist/internal/code-editor/index.d.ts +47 -0
  50. package/dist/internal/collapsible/index.d.cts +43 -0
  51. package/dist/internal/collapsible/index.d.ts +43 -0
  52. package/dist/internal/command/index.d.cts +80 -0
  53. package/dist/internal/command/index.d.ts +80 -0
  54. package/dist/internal/content-protection/index.d.cts +47 -0
  55. package/dist/internal/content-protection/index.d.ts +47 -0
  56. package/dist/internal/data-table/index.d.cts +73 -0
  57. package/dist/internal/data-table/index.d.ts +73 -0
  58. package/dist/internal/date-picker/index.d.cts +98 -0
  59. package/dist/internal/date-picker/index.d.ts +98 -0
  60. package/dist/internal/device-frame/index.d.cts +40 -0
  61. package/dist/internal/device-frame/index.d.ts +40 -0
  62. package/dist/internal/dialog/index.d.cts +54 -0
  63. package/dist/internal/dialog/index.d.ts +54 -0
  64. package/dist/internal/dropdown-menu/index.d.cts +55 -0
  65. package/dist/internal/dropdown-menu/index.d.ts +55 -0
  66. package/dist/internal/emoji-picker/index.d.cts +77 -0
  67. package/dist/internal/emoji-picker/index.d.ts +77 -0
  68. package/dist/internal/feedback-dialog/index.d.cts +55 -0
  69. package/dist/internal/feedback-dialog/index.d.ts +55 -0
  70. package/dist/internal/file-upload/index.d.cts +91 -0
  71. package/dist/internal/file-upload/index.d.ts +91 -0
  72. package/dist/internal/footer/index.d.cts +30 -0
  73. package/dist/internal/footer/index.d.ts +30 -0
  74. package/dist/internal/inline-editor/index.d.cts +52 -0
  75. package/dist/internal/inline-editor/index.d.ts +52 -0
  76. package/dist/internal/input/index.d.cts +38 -0
  77. package/dist/internal/input/index.d.ts +38 -0
  78. package/dist/internal/input-group/index.d.cts +35 -0
  79. package/dist/internal/input-group/index.d.ts +35 -0
  80. package/dist/internal/install-prompt/index.d.cts +36 -0
  81. package/dist/internal/install-prompt/index.d.ts +36 -0
  82. package/dist/internal/keyboard-shortcut/index.d.cts +49 -0
  83. package/dist/internal/keyboard-shortcut/index.d.ts +49 -0
  84. package/dist/internal/language-selector/index.d.cts +63 -0
  85. package/dist/internal/language-selector/index.d.ts +63 -0
  86. package/dist/internal/logger/index.d.cts +229 -0
  87. package/dist/internal/logger/index.d.ts +229 -0
  88. package/dist/internal/markdown-renderer/index.d.cts +40 -0
  89. package/dist/internal/markdown-renderer/index.d.ts +40 -0
  90. package/dist/internal/mobile-nav/index.d.cts +45 -0
  91. package/dist/internal/mobile-nav/index.d.ts +45 -0
  92. package/dist/internal/navbar/index.d.cts +30 -0
  93. package/dist/internal/navbar/index.d.ts +30 -0
  94. package/dist/internal/otp-input/index.d.cts +66 -0
  95. package/dist/internal/otp-input/index.d.ts +66 -0
  96. package/dist/internal/payment/index.d.cts +9 -0
  97. package/dist/internal/payment/index.d.ts +9 -0
  98. package/dist/internal/popover/index.d.cts +46 -0
  99. package/dist/internal/popover/index.d.ts +46 -0
  100. package/dist/internal/presence-indicator/index.d.cts +38 -0
  101. package/dist/internal/presence-indicator/index.d.ts +38 -0
  102. package/dist/internal/progress-display/index.d.cts +60 -0
  103. package/dist/internal/progress-display/index.d.ts +60 -0
  104. package/dist/internal/radio/index.d.ts +43 -0
  105. package/dist/internal/react-accordion/index.d.ts +22 -0
  106. package/dist/internal/react-analytics/index.d.cts +44 -0
  107. package/dist/internal/react-analytics/index.d.ts +44 -0
  108. package/dist/internal/react-animated-text/index.d.cts +12 -0
  109. package/dist/internal/react-animated-text/index.d.ts +12 -0
  110. package/dist/internal/react-app-shell/index.d.cts +169 -0
  111. package/dist/internal/react-app-shell/index.d.ts +169 -0
  112. package/dist/internal/react-auth/index.d.cts +59 -0
  113. package/dist/internal/react-auth/index.d.ts +59 -0
  114. package/dist/internal/react-avatar/index.d.cts +20 -0
  115. package/dist/internal/react-avatar/index.d.ts +20 -0
  116. package/dist/internal/react-avatar-group/index.d.cts +33 -0
  117. package/dist/internal/react-avatar-group/index.d.ts +33 -0
  118. package/dist/internal/react-badge/index.d.cts +17 -0
  119. package/dist/internal/react-badge/index.d.ts +17 -0
  120. package/dist/internal/react-bottom-nav/index.d.cts +19 -0
  121. package/dist/internal/react-bottom-nav/index.d.ts +19 -0
  122. package/dist/internal/react-breadcrumbs/index.d.cts +24 -0
  123. package/dist/internal/react-breadcrumbs/index.d.ts +24 -0
  124. package/dist/internal/react-button/index.d.cts +21 -0
  125. package/dist/internal/react-button/index.d.ts +21 -0
  126. package/dist/internal/react-calendar/index.d.cts +44 -0
  127. package/dist/internal/react-calendar/index.d.ts +44 -0
  128. package/dist/internal/react-callout/index.d.cts +12 -0
  129. package/dist/internal/react-callout/index.d.ts +12 -0
  130. package/dist/internal/react-card/index.d.cts +29 -0
  131. package/dist/internal/react-card/index.d.ts +29 -0
  132. package/dist/internal/react-card-grid/index.d.cts +8 -0
  133. package/dist/internal/react-card-grid/index.d.ts +8 -0
  134. package/dist/internal/react-carousel/index.d.ts +22 -0
  135. package/dist/internal/react-checkbox/index.d.cts +18 -0
  136. package/dist/internal/react-checkbox/index.d.ts +18 -0
  137. package/dist/internal/react-code-block/index.d.cts +7 -0
  138. package/dist/internal/react-code-block/index.d.ts +7 -0
  139. package/dist/internal/react-code-editor/index.d.cts +28 -0
  140. package/dist/internal/react-code-editor/index.d.ts +28 -0
  141. package/dist/internal/react-collapsible/index.d.cts +29 -0
  142. package/dist/internal/react-collapsible/index.d.ts +29 -0
  143. package/dist/internal/react-combobox/index.d.cts +94 -0
  144. package/dist/internal/react-combobox/index.d.ts +94 -0
  145. package/dist/internal/react-command/index.d.cts +51 -0
  146. package/dist/internal/react-command/index.d.ts +51 -0
  147. package/dist/internal/react-content-protection/index.d.cts +22 -0
  148. package/dist/internal/react-content-protection/index.d.ts +22 -0
  149. package/dist/internal/react-data-table/index.d.cts +22 -0
  150. package/dist/internal/react-data-table/index.d.ts +22 -0
  151. package/dist/internal/react-date-picker/index.d.cts +23 -0
  152. package/dist/internal/react-date-picker/index.d.ts +23 -0
  153. package/dist/internal/react-device-frame/index.d.cts +37 -0
  154. package/dist/internal/react-device-frame/index.d.ts +37 -0
  155. package/dist/internal/react-dialog/index.d.cts +49 -0
  156. package/dist/internal/react-dialog/index.d.ts +49 -0
  157. package/dist/internal/react-dropdown-menu/index.d.cts +37 -0
  158. package/dist/internal/react-dropdown-menu/index.d.ts +37 -0
  159. package/dist/internal/react-emoji-picker/index.d.cts +32 -0
  160. package/dist/internal/react-emoji-picker/index.d.ts +32 -0
  161. package/dist/internal/react-feedback-dialog/index.d.cts +40 -0
  162. package/dist/internal/react-feedback-dialog/index.d.ts +40 -0
  163. package/dist/internal/react-file-tree/index.d.cts +5 -0
  164. package/dist/internal/react-file-tree/index.d.ts +5 -0
  165. package/dist/internal/react-file-upload/index.d.cts +22 -0
  166. package/dist/internal/react-file-upload/index.d.ts +22 -0
  167. package/dist/internal/react-footer/index.d.cts +20 -0
  168. package/dist/internal/react-footer/index.d.ts +20 -0
  169. package/dist/internal/react-form/index.d.cts +85 -0
  170. package/dist/internal/react-form/index.d.ts +85 -0
  171. package/dist/internal/react-icon-system/index.d.cts +5 -0
  172. package/dist/internal/react-icon-system/index.d.ts +5 -0
  173. package/dist/internal/react-inline-editor/index.d.cts +17 -0
  174. package/dist/internal/react-inline-editor/index.d.ts +17 -0
  175. package/dist/internal/react-input/index.d.cts +31 -0
  176. package/dist/internal/react-input/index.d.ts +31 -0
  177. package/dist/internal/react-input-group/index.d.cts +34 -0
  178. package/dist/internal/react-input-group/index.d.ts +34 -0
  179. package/dist/internal/react-install-prompt/index.d.cts +24 -0
  180. package/dist/internal/react-install-prompt/index.d.ts +24 -0
  181. package/dist/internal/react-keyboard-shortcut/index.d.cts +57 -0
  182. package/dist/internal/react-keyboard-shortcut/index.d.ts +57 -0
  183. package/dist/internal/react-language-selector/index.d.cts +26 -0
  184. package/dist/internal/react-language-selector/index.d.ts +26 -0
  185. package/dist/internal/react-link-card/index.d.cts +5 -0
  186. package/dist/internal/react-link-card/index.d.ts +5 -0
  187. package/dist/internal/react-logger/index.d.cts +107 -0
  188. package/dist/internal/react-logger/index.d.ts +107 -0
  189. package/dist/internal/react-markdown-renderer/index.d.cts +20 -0
  190. package/dist/internal/react-markdown-renderer/index.d.ts +20 -0
  191. package/dist/internal/react-mobile-nav/index.d.cts +33 -0
  192. package/dist/internal/react-mobile-nav/index.d.ts +33 -0
  193. package/dist/internal/react-navbar/index.d.cts +25 -0
  194. package/dist/internal/react-navbar/index.d.ts +25 -0
  195. package/dist/internal/react-otp-input/index.d.cts +21 -0
  196. package/dist/internal/react-otp-input/index.d.ts +21 -0
  197. package/dist/internal/react-pagination/index.d.ts +7 -0
  198. package/dist/internal/react-payment/index.d.cts +9 -0
  199. package/dist/internal/react-payment/index.d.ts +9 -0
  200. package/dist/internal/react-popover/index.d.cts +33 -0
  201. package/dist/internal/react-popover/index.d.ts +33 -0
  202. package/dist/internal/react-presence-indicator/index.d.cts +34 -0
  203. package/dist/internal/react-presence-indicator/index.d.ts +34 -0
  204. package/dist/internal/react-progress-display/index.d.cts +21 -0
  205. package/dist/internal/react-progress-display/index.d.ts +21 -0
  206. package/dist/internal/react-radio/index.d.ts +33 -0
  207. package/dist/internal/react-reaction-bar/index.d.cts +34 -0
  208. package/dist/internal/react-reaction-bar/index.d.ts +34 -0
  209. package/dist/internal/react-resizable-layout/index.d.cts +36 -0
  210. package/dist/internal/react-resizable-layout/index.d.ts +36 -0
  211. package/dist/internal/react-rich-editor/index.d.cts +2 -0
  212. package/dist/internal/react-rich-editor/index.d.ts +2 -0
  213. package/dist/internal/react-search-bar/index.d.cts +32 -0
  214. package/dist/internal/react-search-bar/index.d.ts +32 -0
  215. package/dist/internal/react-select/index.d.cts +30 -0
  216. package/dist/internal/react-select/index.d.ts +30 -0
  217. package/dist/internal/react-sheet/index.d.cts +67 -0
  218. package/dist/internal/react-sheet/index.d.ts +67 -0
  219. package/dist/internal/react-sidebar/index.d.cts +23 -0
  220. package/dist/internal/react-sidebar/index.d.ts +23 -0
  221. package/dist/internal/react-skeleton/index.d.cts +31 -0
  222. package/dist/internal/react-skeleton/index.d.ts +31 -0
  223. package/dist/internal/react-skip-to-content/index.d.cts +9 -0
  224. package/dist/internal/react-skip-to-content/index.d.ts +9 -0
  225. package/dist/internal/react-slide-viewer/index.d.cts +23 -0
  226. package/dist/internal/react-slide-viewer/index.d.ts +23 -0
  227. package/dist/internal/react-slider/index.d.cts +1 -0
  228. package/dist/internal/react-slider/index.d.ts +1 -0
  229. package/dist/internal/react-status-indicator/index.d.cts +34 -0
  230. package/dist/internal/react-status-indicator/index.d.ts +34 -0
  231. package/dist/internal/react-steps/index.d.cts +19 -0
  232. package/dist/internal/react-steps/index.d.ts +19 -0
  233. package/dist/internal/react-switch/index.d.cts +17 -0
  234. package/dist/internal/react-switch/index.d.ts +17 -0
  235. package/dist/internal/react-table-of-contents/index.d.ts +10 -0
  236. package/dist/internal/react-tabs/index.d.cts +31 -0
  237. package/dist/internal/react-tabs/index.d.ts +31 -0
  238. package/dist/internal/react-textarea/index.d.cts +16 -0
  239. package/dist/internal/react-textarea/index.d.ts +16 -0
  240. package/dist/internal/react-theme/index.d.cts +44 -0
  241. package/dist/internal/react-theme/index.d.ts +44 -0
  242. package/dist/internal/react-thread-view/index.d.cts +34 -0
  243. package/dist/internal/react-thread-view/index.d.ts +34 -0
  244. package/dist/internal/react-toast/index.d.cts +36 -0
  245. package/dist/internal/react-toast/index.d.ts +36 -0
  246. package/dist/internal/react-tooltip/index.d.cts +33 -0
  247. package/dist/internal/react-tooltip/index.d.ts +33 -0
  248. package/dist/internal/react-version-selector/index.d.cts +24 -0
  249. package/dist/internal/react-version-selector/index.d.ts +24 -0
  250. package/dist/internal/react-video-player/index.d.cts +9 -0
  251. package/dist/internal/react-video-player/index.d.ts +9 -0
  252. package/dist/internal/react-voice-pill/index.d.cts +10 -0
  253. package/dist/internal/react-voice-pill/index.d.ts +10 -0
  254. package/dist/internal/react-waveform/index.d.cts +9 -0
  255. package/dist/internal/react-waveform/index.d.ts +9 -0
  256. package/dist/internal/reaction-bar/index.d.cts +50 -0
  257. package/dist/internal/reaction-bar/index.d.ts +50 -0
  258. package/dist/internal/resizable-layout/index.d.cts +47 -0
  259. package/dist/internal/resizable-layout/index.d.ts +47 -0
  260. package/dist/internal/search-bar/index.d.cts +51 -0
  261. package/dist/internal/search-bar/index.d.ts +51 -0
  262. package/dist/internal/select/index.d.cts +69 -0
  263. package/dist/internal/select/index.d.ts +69 -0
  264. package/dist/internal/shared/index.d.cts +419 -0
  265. package/dist/internal/shared/index.d.ts +419 -0
  266. package/dist/internal/sidebar/index.d.cts +40 -0
  267. package/dist/internal/sidebar/index.d.ts +40 -0
  268. package/dist/internal/skeleton/index.d.cts +27 -0
  269. package/dist/internal/skeleton/index.d.ts +27 -0
  270. package/dist/internal/slide-viewer/index.d.cts +72 -0
  271. package/dist/internal/slide-viewer/index.d.ts +72 -0
  272. package/dist/internal/slider/index.d.cts +4 -0
  273. package/dist/internal/slider/index.d.ts +4 -0
  274. package/dist/internal/status-indicator/index.d.cts +42 -0
  275. package/dist/internal/status-indicator/index.d.ts +42 -0
  276. package/dist/internal/switch/index.d.cts +41 -0
  277. package/dist/internal/switch/index.d.ts +41 -0
  278. package/dist/internal/tabs/index.d.cts +45 -0
  279. package/dist/internal/tabs/index.d.ts +45 -0
  280. package/dist/internal/textarea/index.d.cts +28 -0
  281. package/dist/internal/textarea/index.d.ts +28 -0
  282. package/dist/internal/theme/index.d.cts +60 -0
  283. package/dist/internal/theme/index.d.ts +60 -0
  284. package/dist/internal/thread-view/index.d.cts +95 -0
  285. package/dist/internal/thread-view/index.d.ts +95 -0
  286. package/dist/internal/toast/index.d.cts +64 -0
  287. package/dist/internal/toast/index.d.ts +64 -0
  288. package/dist/internal/tooltip/index.d.cts +45 -0
  289. package/dist/internal/tooltip/index.d.ts +45 -0
  290. package/dist/internal/version-selector/index.d.cts +68 -0
  291. package/dist/internal/version-selector/index.d.ts +68 -0
  292. package/dist/internal/video-player/index.d.cts +50 -0
  293. package/dist/internal/video-player/index.d.ts +50 -0
  294. package/dist/internal/voice-pill/index.d.cts +86 -0
  295. package/dist/internal/voice-pill/index.d.ts +86 -0
  296. package/dist/internal/waveform/index.d.cts +83 -0
  297. package/dist/internal/waveform/index.d.ts +83 -0
  298. package/dist/theme.cjs +23 -0
  299. package/dist/theme.cjs.map +1 -1
  300. package/dist/theme.d.cts +1 -1
  301. package/dist/theme.d.ts +1 -1
  302. package/dist/theme.js +5 -2
  303. package/dist/theme.js.map +1 -1
  304. package/package.json +10 -7
package/dist/index.cjs CHANGED
@@ -3,7 +3,6 @@
3
3
  var React11 = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var ReactDOM = require('react-dom');
6
- var reactHookForm = require('react-hook-form');
7
6
 
8
7
  function _interopNamespace(e) {
9
8
  if (e && e.__esModule) return e;
@@ -26,7 +25,104 @@ function _interopNamespace(e) {
26
25
  var React11__namespace = /*#__PURE__*/_interopNamespace(React11);
27
26
  var ReactDOM__namespace = /*#__PURE__*/_interopNamespace(ReactDOM);
28
27
 
29
- // ../react-accordion/dist/index.js
28
+ var __defProp = Object.defineProperty;
29
+ var __getOwnPropNames = Object.getOwnPropertyNames;
30
+ var __esm = (fn, res) => function __init() {
31
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
32
+ };
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, { get: all[name], enumerable: true });
36
+ };
37
+
38
+ // ../logger/dist/chunk-57LG5ZUS.js
39
+ async function createFaroSink(opts) {
40
+ const transport = opts.transport ?? await loadFaroTransport(opts);
41
+ if (!transport) return null;
42
+ return {
43
+ name: "faro",
44
+ log(record) {
45
+ transport.push({ kind: "log", record });
46
+ },
47
+ span(record) {
48
+ transport.push({ kind: "span", record });
49
+ },
50
+ async flush() {
51
+ }
52
+ };
53
+ }
54
+ async function loadFaroTransport(opts) {
55
+ try {
56
+ const sdkName = "@grafana/faro-web-sdk";
57
+ const tracingName = "@grafana/faro-web-tracing";
58
+ const sdk = await import(
59
+ /* @vite-ignore */
60
+ sdkName
61
+ );
62
+ const tracing = await import(
63
+ /* @vite-ignore */
64
+ tracingName
65
+ );
66
+ const faro = sdk.initializeFaro({
67
+ url: opts.endpoint,
68
+ app: { name: opts.app },
69
+ instrumentations: [
70
+ ...sdk.getWebInstrumentations(),
71
+ new tracing.TracingInstrumentation()
72
+ ]
73
+ });
74
+ return {
75
+ push({ kind, record }) {
76
+ if (kind === "log") {
77
+ const r = record;
78
+ faro.api.pushLog([r.message], {
79
+ level: FARO_LEVEL[r.level],
80
+ context: flatten(r.context)
81
+ });
82
+ } else {
83
+ const r = record;
84
+ faro.api.pushEvent(`span:${r.name}`, {
85
+ durationMs: String(r.durationMs),
86
+ status: r.status,
87
+ ...flatten(r.context)
88
+ });
89
+ }
90
+ }
91
+ };
92
+ } catch {
93
+ return null;
94
+ }
95
+ }
96
+ function flatten(ctx) {
97
+ const out = {};
98
+ for (const [k, v] of Object.entries(ctx)) {
99
+ out[k] = typeof v === "string" ? v : JSON.stringify(v);
100
+ }
101
+ return out;
102
+ }
103
+ var FARO_LEVEL;
104
+ var init_chunk_57LG5ZUS = __esm({
105
+ "../logger/dist/chunk-57LG5ZUS.js"() {
106
+ FARO_LEVEL = {
107
+ debug: "debug",
108
+ info: "info",
109
+ warn: "warn",
110
+ error: "error",
111
+ fatal: "error"
112
+ };
113
+ }
114
+ });
115
+
116
+ // ../logger/dist/faro-engine-47HGRAQH.js
117
+ var faro_engine_47HGRAQH_exports = {};
118
+ __export(faro_engine_47HGRAQH_exports, {
119
+ createFaroSink: () => createFaroSink
120
+ });
121
+ var init_faro_engine_47HGRAQH = __esm({
122
+ "../logger/dist/faro-engine-47HGRAQH.js"() {
123
+ init_chunk_57LG5ZUS();
124
+ }
125
+ });
30
126
 
31
127
  // ../shared/dist/index.js
32
128
  var idCounter = 0;
@@ -139,6 +235,23 @@ function cva(config) {
139
235
  return classes.filter(Boolean).join(" ");
140
236
  };
141
237
  }
238
+ var seen = /* @__PURE__ */ new Set();
239
+ function isDev() {
240
+ return typeof process === "undefined" || process.env?.NODE_ENV !== "production";
241
+ }
242
+ function emit(level, code, message, detail) {
243
+ if (!isDev()) return;
244
+ const key = `${level}:${code}`;
245
+ if (seen.has(key)) return;
246
+ seen.add(key);
247
+ const text = `[refraction-ui] ${code}: ${message}`;
248
+ {
249
+ console.warn(text, "");
250
+ }
251
+ }
252
+ function devWarn(code, message, detail) {
253
+ emit("warn", code, message);
254
+ }
142
255
  var AccordionContext = React11__namespace.createContext(null);
143
256
  var Accordion = React11__namespace.forwardRef(
144
257
  ({ className, type = "single", collapsible, value: controlledValue, defaultValue, onValueChange, ...props }, ref) => {
@@ -169,7 +282,13 @@ var AccordionItemContext = React11__namespace.createContext(null);
169
282
  var AccordionItem = React11__namespace.forwardRef(
170
283
  ({ className, value, ...props }, ref) => {
171
284
  const context = React11__namespace.useContext(AccordionContext);
172
- if (!context) throw new Error("AccordionItem must be within Accordion");
285
+ if (!context) {
286
+ devWarn(
287
+ "react-accordion/item-outside-accordion",
288
+ "<AccordionItem> must be rendered inside an <Accordion>. The missing AccordionContext makes this throw."
289
+ );
290
+ throw new Error("AccordionItem must be within Accordion");
291
+ }
173
292
  const isOpen = context.type === "single" ? context.value === value : Array.isArray(context.value) && context.value.includes(value);
174
293
  return /* @__PURE__ */ jsxRuntime.jsx(AccordionItemContext.Provider, { value: { value, isOpen }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("border-b border-border", className), "data-state": isOpen ? "open" : "closed", ...props }) });
175
294
  }
@@ -179,7 +298,13 @@ var AccordionTrigger = React11__namespace.forwardRef(
179
298
  ({ className, children, ...props }, ref) => {
180
299
  const accordionContext = React11__namespace.useContext(AccordionContext);
181
300
  const itemContext = React11__namespace.useContext(AccordionItemContext);
182
- if (!accordionContext || !itemContext) throw new Error("AccordionTrigger missing context");
301
+ if (!accordionContext || !itemContext) {
302
+ devWarn(
303
+ "react-accordion/trigger-missing-context",
304
+ "<AccordionTrigger> must be rendered inside an <AccordionItem> within an <Accordion>. The missing AccordionContext/AccordionItemContext makes this throw."
305
+ );
306
+ throw new Error("AccordionTrigger missing context");
307
+ }
183
308
  return /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "flex m-0 p-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
184
309
  "button",
185
310
  {
@@ -220,7 +345,13 @@ AccordionTrigger.displayName = "AccordionTrigger";
220
345
  var AccordionContent = React11__namespace.forwardRef(
221
346
  ({ className, children, ...props }, ref) => {
222
347
  const itemContext = React11__namespace.useContext(AccordionItemContext);
223
- if (!itemContext) throw new Error("AccordionContent missing context");
348
+ if (!itemContext) {
349
+ devWarn(
350
+ "react-accordion/content-missing-context",
351
+ "<AccordionContent> must be rendered inside an <AccordionItem>. The missing AccordionItemContext makes this throw."
352
+ );
353
+ throw new Error("AccordionContent missing context");
354
+ }
224
355
  return /* @__PURE__ */ jsxRuntime.jsx(
225
356
  "div",
226
357
  {
@@ -518,6 +649,10 @@ function AuthProvider({ children, ...config }) {
518
649
  const authRef = React11__namespace.useRef(null);
519
650
  if (!authRef.current) {
520
651
  if (!config.adapter && !config.testMode) {
652
+ devWarn(
653
+ "react-auth/missing-adapter",
654
+ "<AuthProvider> was rendered without a required `adapter` prop (and not in `testMode`). Pass an auth adapter so the provider can create an auth instance."
655
+ );
521
656
  throw new Error("[refraction-ui/react-auth] You must provide an `adapter` to AuthProvider.");
522
657
  }
523
658
  authRef.current = createAuth(config.adapter, config);
@@ -549,6 +684,10 @@ function AuthProvider({ children, ...config }) {
549
684
  function useAuth() {
550
685
  const ctx = React11__namespace.useContext(AuthContext);
551
686
  if (!ctx) {
687
+ devWarn(
688
+ "react-auth/use-auth-outside-provider",
689
+ "useAuth() was called outside an <AuthProvider>. Wrap your app (or the consuming subtree) in <AuthProvider> so the auth context is available."
690
+ );
552
691
  throw new Error("useAuth must be used within an <AuthProvider>");
553
692
  }
554
693
  return ctx;
@@ -1745,6 +1884,10 @@ var CollapsibleContext = React11__namespace.createContext(null);
1745
1884
  function useCollapsibleContext() {
1746
1885
  const ctx = React11__namespace.useContext(CollapsibleContext);
1747
1886
  if (!ctx) {
1887
+ devWarn(
1888
+ "react-collapsible/context-outside-provider",
1889
+ "Collapsible compound components (CollapsibleTrigger/CollapsibleContent) must be rendered inside a <Collapsible>. The missing CollapsibleContext makes this throw."
1890
+ );
1748
1891
  throw new Error(
1749
1892
  "Collapsible compound components must be used within <Collapsible>"
1750
1893
  );
@@ -1892,6 +2035,10 @@ var ComboboxContext = React11__namespace.createContext(null);
1892
2035
  function useComboboxContext() {
1893
2036
  const ctx = React11__namespace.useContext(ComboboxContext);
1894
2037
  if (!ctx) {
2038
+ devWarn(
2039
+ "react-combobox/context-outside-provider",
2040
+ "Combobox compound components (ComboboxInput/ComboboxContent/ComboboxItem/etc.) must be rendered inside a <Combobox>. The missing ComboboxContext makes this throw."
2041
+ );
1895
2042
  throw new Error("Combobox compound components must be used within <Combobox>");
1896
2043
  }
1897
2044
  return ctx;
@@ -2564,6 +2711,10 @@ var CommandContext = React11__namespace.createContext(null);
2564
2711
  function useCommandContext() {
2565
2712
  const ctx = React11__namespace.useContext(CommandContext);
2566
2713
  if (!ctx) {
2714
+ devWarn(
2715
+ "react-command/context-outside-provider",
2716
+ "Command compound components (CommandInput/CommandList/CommandItem/CommandGroup/etc.) must be rendered inside a <Command>. The missing CommandContext makes this throw."
2717
+ );
2567
2718
  throw new Error("Command compound components must be used within <Command>");
2568
2719
  }
2569
2720
  return ctx;
@@ -3401,6 +3552,10 @@ var DialogContext = React11__namespace.createContext(null);
3401
3552
  function useDialogContext() {
3402
3553
  const ctx = React11__namespace.useContext(DialogContext);
3403
3554
  if (!ctx) {
3555
+ devWarn(
3556
+ "react-dialog/context-outside-provider",
3557
+ "Dialog compound components (DialogTrigger/DialogContent/DialogTitle/etc.) must be rendered inside a <Dialog>. The missing DialogContext makes this throw."
3558
+ );
3404
3559
  throw new Error("Dialog compound components must be used within <Dialog>");
3405
3560
  }
3406
3561
  return ctx;
@@ -3688,6 +3843,10 @@ var DropdownMenuContext = React11__namespace.createContext(null);
3688
3843
  function useDropdownMenuContext() {
3689
3844
  const ctx = React11__namespace.useContext(DropdownMenuContext);
3690
3845
  if (!ctx) {
3846
+ devWarn(
3847
+ "react-dropdown-menu/context-outside-provider",
3848
+ "DropdownMenu compound components (DropdownMenuTrigger/DropdownMenuContent/DropdownMenuItem/etc.) must be rendered inside a <DropdownMenu>. The missing DropdownMenuContext makes this throw."
3849
+ );
3691
3850
  throw new Error("DropdownMenu compound components must be used within <DropdownMenu>");
3692
3851
  }
3693
3852
  return ctx;
@@ -4127,192 +4286,6 @@ var Footer = React11__namespace.forwardRef(
4127
4286
  }
4128
4287
  );
4129
4288
  Footer.displayName = "Footer";
4130
- var Slot = React11__namespace.forwardRef(function Slot2(props, forwardedRef) {
4131
- const { children, ...slotProps } = props;
4132
- if (!React11__namespace.isValidElement(children)) {
4133
- return null;
4134
- }
4135
- const childProps = children.props ?? {};
4136
- const mergedProps = mergeProps(slotProps, childProps);
4137
- let childRef = childProps.ref;
4138
- if (childRef === void 0 && !("ref" in childProps)) {
4139
- childRef = children.ref;
4140
- }
4141
- const mergedRef = composeRefs(forwardedRef, childRef);
4142
- return React11__namespace.cloneElement(
4143
- children,
4144
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4145
- { ...mergedProps, ref: mergedRef }
4146
- );
4147
- });
4148
- Slot.displayName = "Slot";
4149
- function mergeProps(slotProps, childProps) {
4150
- const merged = { ...slotProps };
4151
- for (const key of Object.keys(childProps)) {
4152
- const slotValue = slotProps[key];
4153
- const childValue = childProps[key];
4154
- if (/^on[A-Z]/.test(key) && typeof slotValue === "function" && typeof childValue === "function") {
4155
- merged[key] = (...args) => {
4156
- const child = childValue;
4157
- const slot = slotValue;
4158
- child(...args);
4159
- slot(...args);
4160
- };
4161
- } else if (key === "className") {
4162
- merged[key] = [slotValue, childValue].filter(Boolean).join(" ");
4163
- } else if (key === "style") {
4164
- merged[key] = { ...slotValue, ...childValue };
4165
- } else if (childValue !== void 0) {
4166
- merged[key] = childValue;
4167
- }
4168
- }
4169
- return merged;
4170
- }
4171
- function composeRefs(...refs) {
4172
- return (node) => {
4173
- for (const ref of refs) {
4174
- if (typeof ref === "function") {
4175
- ref(node);
4176
- } else if (ref != null) {
4177
- const objectRef = ref;
4178
- objectRef.current = node;
4179
- }
4180
- }
4181
- };
4182
- }
4183
- var Form = reactHookForm.FormProvider;
4184
- var FormFieldContext = React11__namespace.createContext(
4185
- void 0
4186
- );
4187
- var FormItemContext = React11__namespace.createContext(
4188
- void 0
4189
- );
4190
- function FormField(props) {
4191
- return /* @__PURE__ */ jsxRuntime.jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsxRuntime.jsx(reactHookForm.Controller, { ...props }) });
4192
- }
4193
- function useFormField() {
4194
- const fieldContext = React11__namespace.useContext(FormFieldContext);
4195
- const itemContext = React11__namespace.useContext(FormItemContext);
4196
- const formContext = reactHookForm.useFormContext();
4197
- const { errors } = reactHookForm.useFormState({
4198
- control: formContext?.control,
4199
- name: fieldContext?.name,
4200
- exact: true
4201
- });
4202
- if (!fieldContext) {
4203
- throw new Error("useFormField must be used within a <FormField>");
4204
- }
4205
- if (!itemContext) {
4206
- throw new Error("useFormField must be used within a <FormItem>");
4207
- }
4208
- const { id } = itemContext;
4209
- const error = getNestedError(errors, fieldContext.name);
4210
- return {
4211
- id,
4212
- name: fieldContext.name,
4213
- formItemId: `${id}-form-item`,
4214
- formDescriptionId: `${id}-form-item-description`,
4215
- formMessageId: `${id}-form-item-message`,
4216
- error,
4217
- invalid: Boolean(error)
4218
- };
4219
- }
4220
- function getNestedError(errors, name) {
4221
- if (!errors) return void 0;
4222
- const segments = name.replace(/\[(\w+)\]/g, ".$1").split(".");
4223
- let cursor = errors;
4224
- for (const seg of segments) {
4225
- if (cursor && typeof cursor === "object" && seg in cursor) {
4226
- cursor = cursor[seg];
4227
- } else {
4228
- return void 0;
4229
- }
4230
- }
4231
- return cursor;
4232
- }
4233
- var formItemVariants = cva({ base: "space-y-2" });
4234
- var FormItem = React11__namespace.forwardRef(
4235
- ({ className, ...props }, ref) => {
4236
- const id = React11__namespace.useId();
4237
- return /* @__PURE__ */ jsxRuntime.jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(formItemVariants(), className), ...props }) });
4238
- }
4239
- );
4240
- FormItem.displayName = "FormItem";
4241
- var formLabelVariants = cva({
4242
- base: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
4243
- variants: {
4244
- invalid: {
4245
- true: "text-destructive",
4246
- false: ""
4247
- }
4248
- },
4249
- defaultVariants: {
4250
- invalid: "false"
4251
- }
4252
- });
4253
- var FormLabel = React11__namespace.forwardRef(
4254
- ({ className, ...props }, ref) => {
4255
- const { invalid, formItemId } = useFormField();
4256
- return /* @__PURE__ */ jsxRuntime.jsx(
4257
- "label",
4258
- {
4259
- ref,
4260
- htmlFor: formItemId,
4261
- "data-invalid": invalid ? "" : void 0,
4262
- className: cn(formLabelVariants({ invalid: invalid ? "true" : "false" }), className),
4263
- ...props
4264
- }
4265
- );
4266
- }
4267
- );
4268
- FormLabel.displayName = "FormLabel";
4269
- var FormControl = React11__namespace.forwardRef(
4270
- ({ ...props }, ref) => {
4271
- const { invalid, formItemId, formDescriptionId, formMessageId } = useFormField();
4272
- return /* @__PURE__ */ jsxRuntime.jsx(
4273
- Slot,
4274
- {
4275
- ref,
4276
- id: formItemId,
4277
- "aria-describedby": invalid ? `${formDescriptionId} ${formMessageId}` : formDescriptionId,
4278
- "aria-invalid": invalid || void 0,
4279
- ...props
4280
- }
4281
- );
4282
- }
4283
- );
4284
- FormControl.displayName = "FormControl";
4285
- var FormDescription = React11__namespace.forwardRef(({ className, ...props }, ref) => {
4286
- const { formDescriptionId } = useFormField();
4287
- return /* @__PURE__ */ jsxRuntime.jsx(
4288
- "p",
4289
- {
4290
- ref,
4291
- id: formDescriptionId,
4292
- className: cn("text-sm text-muted-foreground", className),
4293
- ...props
4294
- }
4295
- );
4296
- });
4297
- FormDescription.displayName = "FormDescription";
4298
- var FormMessage = React11__namespace.forwardRef(
4299
- ({ className, children, ...props }, ref) => {
4300
- const { error, formMessageId } = useFormField();
4301
- const body = error?.message ? String(error.message) : children;
4302
- if (!body) return null;
4303
- return /* @__PURE__ */ jsxRuntime.jsx(
4304
- "p",
4305
- {
4306
- ref,
4307
- id: formMessageId,
4308
- className: cn("text-sm font-medium text-destructive", className),
4309
- ...props,
4310
- children: body
4311
- }
4312
- );
4313
- }
4314
- );
4315
- FormMessage.displayName = "FormMessage";
4316
4289
 
4317
4290
  // ../inline-editor/dist/index.js
4318
4291
  function createInlineEditor(props) {
@@ -5124,6 +5097,10 @@ var MobileNavContext = React11__namespace.createContext(null);
5124
5097
  function useMobileNavContext() {
5125
5098
  const ctx = React11__namespace.useContext(MobileNavContext);
5126
5099
  if (!ctx) {
5100
+ devWarn(
5101
+ "react-mobile-nav/compound-outside-provider",
5102
+ "A MobileNav compound component was rendered outside of <MobileNav>. Wrap it in <MobileNav>."
5103
+ );
5127
5104
  throw new Error("MobileNav compound components must be used within <MobileNav>");
5128
5105
  }
5129
5106
  return ctx;
@@ -5382,6 +5359,10 @@ var PopoverContext = React11__namespace.createContext(null);
5382
5359
  function usePopoverContext() {
5383
5360
  const ctx = React11__namespace.useContext(PopoverContext);
5384
5361
  if (!ctx) {
5362
+ devWarn(
5363
+ "react-popover/context-outside-provider",
5364
+ "Popover compound components (PopoverTrigger/PopoverContent/etc.) must be rendered inside a <Popover>. The missing PopoverContext makes this throw."
5365
+ );
5385
5366
  throw new Error("Popover compound components must be used within <Popover>");
5386
5367
  }
5387
5368
  return ctx;
@@ -5587,6 +5568,10 @@ var SearchBarContext = React11__namespace.createContext(null);
5587
5568
  function useSearchBarContext() {
5588
5569
  const ctx = React11__namespace.useContext(SearchBarContext);
5589
5570
  if (!ctx) {
5571
+ devWarn(
5572
+ "react-search-bar/compound-outside-provider",
5573
+ "A SearchBar compound component was rendered outside of <SearchBar>. Wrap it in <SearchBar>."
5574
+ );
5590
5575
  throw new Error("SearchBar compound components must be used within <SearchBar>");
5591
5576
  }
5592
5577
  return ctx;
@@ -5850,6 +5835,10 @@ var SheetContext = React11__namespace.createContext(null);
5850
5835
  function useSheetContext() {
5851
5836
  const ctx = React11__namespace.useContext(SheetContext);
5852
5837
  if (!ctx) {
5838
+ devWarn(
5839
+ "react-sheet/sheet-compound-outside-provider",
5840
+ "A Sheet compound component was rendered outside of <Sheet>. Wrap it in <Sheet>."
5841
+ );
5853
5842
  throw new Error("Sheet compound components must be used within <Sheet>");
5854
5843
  }
5855
5844
  return ctx;
@@ -6301,6 +6290,10 @@ var TabsContext = React11__namespace.createContext(null);
6301
6290
  function useTabsContext() {
6302
6291
  const ctx = React11__namespace.useContext(TabsContext);
6303
6292
  if (!ctx) {
6293
+ devWarn(
6294
+ "react-tabs/context-outside-provider",
6295
+ "Tabs compound components (TabsList/TabsTrigger/TabsContent) must be rendered inside a <Tabs>. The missing TabsContext makes this throw."
6296
+ );
6304
6297
  throw new Error("Tabs compound components must be used within <Tabs>");
6305
6298
  }
6306
6299
  return ctx;
@@ -6625,6 +6618,10 @@ var ToastContext = React11__namespace.createContext(null);
6625
6618
  function useToastContext() {
6626
6619
  const ctx = React11__namespace.useContext(ToastContext);
6627
6620
  if (!ctx) {
6621
+ devWarn(
6622
+ "react-toast/use-toast-outside-provider",
6623
+ "useToast() was called outside a <ToastProvider>. Wrap your app (or the consuming subtree) in <ToastProvider> so the toast context is available."
6624
+ );
6628
6625
  throw new Error("useToast must be used within a <ToastProvider>");
6629
6626
  }
6630
6627
  return ctx;
@@ -6804,6 +6801,10 @@ var TooltipContext = React11__namespace.createContext(null);
6804
6801
  function useTooltipContext() {
6805
6802
  const ctx = React11__namespace.useContext(TooltipContext);
6806
6803
  if (!ctx) {
6804
+ devWarn(
6805
+ "react-tooltip/context-outside-provider",
6806
+ "Tooltip compound components (TooltipTrigger/TooltipContent/etc.) must be rendered inside a <Tooltip>. The missing TooltipContext makes this throw."
6807
+ );
6807
6808
  throw new Error("Tooltip compound components must be used within <Tooltip>");
6808
6809
  }
6809
6810
  return ctx;
@@ -9005,6 +9006,10 @@ var ResizableLayoutContext = React11__namespace.createContext(null);
9005
9006
  function useResizableLayoutContext() {
9006
9007
  const ctx = React11__namespace.useContext(ResizableLayoutContext);
9007
9008
  if (!ctx) {
9009
+ devWarn(
9010
+ "react-resizable-layout/compound-outside-provider",
9011
+ "A Resizable compound component was rendered outside of <ResizableLayout>. Wrap it in <ResizableLayout>."
9012
+ );
9008
9013
  throw new Error("Resizable compound components must be used within <ResizableLayout>");
9009
9014
  }
9010
9015
  return ctx;
@@ -9386,6 +9391,10 @@ var AppShellContext = React11__namespace.createContext(null);
9386
9391
  function useAppShell() {
9387
9392
  const ctx = React11__namespace.useContext(AppShellContext);
9388
9393
  if (!ctx) {
9394
+ devWarn(
9395
+ "react-app-shell/use-app-shell-outside-provider",
9396
+ "useAppShell() was called outside of <AppShell>. Wrap the consuming component tree in <AppShell>."
9397
+ );
9389
9398
  throw new Error("useAppShell must be used within <AppShell>");
9390
9399
  }
9391
9400
  return ctx;
@@ -9592,6 +9601,10 @@ var PageShellContext = React11__namespace.createContext(null);
9592
9601
  function usePageShell() {
9593
9602
  const ctx = React11__namespace.useContext(PageShellContext);
9594
9603
  if (!ctx) {
9604
+ devWarn(
9605
+ "react-app-shell/page-shell-compound-outside-provider",
9606
+ "A PageShell compound component was rendered outside of <PageShell>. Wrap it in <PageShell>."
9607
+ );
9595
9608
  throw new Error("PageShell compound components must be used within <PageShell>");
9596
9609
  }
9597
9610
  return ctx;
@@ -9694,6 +9707,10 @@ var AuthShellContext = React11__namespace.createContext(null);
9694
9707
  function useAuthShell() {
9695
9708
  const ctx = React11__namespace.useContext(AuthShellContext);
9696
9709
  if (!ctx) {
9710
+ devWarn(
9711
+ "react-app-shell/auth-shell-compound-outside-provider",
9712
+ "An AuthShell compound component was rendered outside of <AuthShell>. Wrap it in <AuthShell>."
9713
+ );
9697
9714
  throw new Error("AuthShell compound components must be used within <AuthShell>");
9698
9715
  }
9699
9716
  return ctx;
@@ -12091,7 +12108,13 @@ function RadioGroup({
12091
12108
  }
12092
12109
  function RadioItem({ value, children, disabled = false, className }) {
12093
12110
  const ctx = React11__namespace.useContext(RadioContext);
12094
- if (!ctx) throw new Error("RadioItem must be used within RadioGroup");
12111
+ if (!ctx) {
12112
+ devWarn(
12113
+ "react-radio/radio-item-outside-group",
12114
+ "RadioItem was rendered outside of <RadioGroup>. Wrap it in <RadioGroup>."
12115
+ );
12116
+ throw new Error("RadioItem must be used within RadioGroup");
12117
+ }
12095
12118
  const isChecked = ctx.value === value;
12096
12119
  const isDisabled = ctx.disabled || disabled;
12097
12120
  return React11__namespace.createElement(
@@ -12358,6 +12381,7 @@ var selectItemVariants = cva({
12358
12381
  }
12359
12382
  });
12360
12383
  var SelectContext = React11__namespace.createContext({
12384
+ __isDefault: true,
12361
12385
  value: void 0,
12362
12386
  onValueChange: () => {
12363
12387
  },
@@ -12370,6 +12394,16 @@ var SelectContext = React11__namespace.createContext({
12370
12394
  triggerId: "",
12371
12395
  contentId: ""
12372
12396
  });
12397
+ function useSelectContext(part) {
12398
+ const ctx = React11__namespace.useContext(SelectContext);
12399
+ if (ctx.__isDefault) {
12400
+ devWarn(
12401
+ "react-select/no-select-provider",
12402
+ `<${part}> was rendered without a <Select> ancestor. It is silently reading inert context defaults (clicks/keyboard do nothing, it never opens). Wrap it in <Select>\u2026</Select>.`
12403
+ );
12404
+ }
12405
+ return ctx;
12406
+ }
12373
12407
  function Select({
12374
12408
  value,
12375
12409
  onValueChange,
@@ -12402,7 +12436,7 @@ function Select({
12402
12436
  }
12403
12437
  var SelectTrigger = React11__namespace.forwardRef(
12404
12438
  ({ className, children, size = "default", ...props }, ref) => {
12405
- const { open, setOpen, disabled, triggerId, contentId } = React11__namespace.useContext(SelectContext);
12439
+ const { open, setOpen, disabled, triggerId, contentId } = useSelectContext("SelectTrigger");
12406
12440
  const api = createSelect({ disabled, open });
12407
12441
  const handleClick = () => {
12408
12442
  if (!disabled) {
@@ -12461,7 +12495,7 @@ var SelectTrigger = React11__namespace.forwardRef(
12461
12495
  SelectTrigger.displayName = "SelectTrigger";
12462
12496
  var SelectContent = React11__namespace.forwardRef(
12463
12497
  ({ className, children, ...props }, forwardedRef) => {
12464
- const { open, contentId, triggerId, setOpen } = React11__namespace.useContext(SelectContext);
12498
+ const { open, contentId, triggerId, setOpen } = useSelectContext("SelectContent");
12465
12499
  const containerRef = React11__namespace.useRef(null);
12466
12500
  const ref = React11__namespace.useCallback(
12467
12501
  (node) => {
@@ -12522,7 +12556,7 @@ var SelectContent = React11__namespace.forwardRef(
12522
12556
  SelectContent.displayName = "SelectContent";
12523
12557
  var SelectItem = React11__namespace.forwardRef(
12524
12558
  ({ className, children, value: itemValue, disabled: itemDisabled = false, ...props }, ref) => {
12525
- const { value, onValueChange, setOpen, triggerId } = React11__namespace.useContext(SelectContext);
12559
+ const { value, onValueChange, setOpen, triggerId } = useSelectContext("SelectItem");
12526
12560
  const isSelected = value === itemValue;
12527
12561
  const handleClick = () => {
12528
12562
  if (!itemDisabled) {
@@ -13089,7 +13123,13 @@ var CarouselItemContext = React11__namespace.createContext(null);
13089
13123
  var CarouselItem = React11__namespace.forwardRef(
13090
13124
  ({ className, value, ...props }, ref) => {
13091
13125
  const context = React11__namespace.useContext(CarouselContext);
13092
- if (!context) throw new Error("CarouselItem must be within Carousel");
13126
+ if (!context) {
13127
+ devWarn(
13128
+ "react-carousel/carousel-item-outside-carousel",
13129
+ "CarouselItem was rendered outside of <Carousel>. Wrap it in <Carousel>."
13130
+ );
13131
+ throw new Error("CarouselItem must be within Carousel");
13132
+ }
13093
13133
  const isOpen = context.type === "single" ? context.value === value : Array.isArray(context.value) && context.value.includes(value);
13094
13134
  return /* @__PURE__ */ jsxRuntime.jsx(CarouselItemContext.Provider, { value: { value, isOpen }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("border-b border-border", className), "data-state": isOpen ? "open" : "closed", ...props }) });
13095
13135
  }
@@ -13099,7 +13139,13 @@ var CarouselTrigger = React11__namespace.forwardRef(
13099
13139
  ({ className, children, ...props }, ref) => {
13100
13140
  const carouselContext = React11__namespace.useContext(CarouselContext);
13101
13141
  const itemContext = React11__namespace.useContext(CarouselItemContext);
13102
- if (!carouselContext || !itemContext) throw new Error("CarouselTrigger missing context");
13142
+ if (!carouselContext || !itemContext) {
13143
+ devWarn(
13144
+ "react-carousel/carousel-trigger-outside-item",
13145
+ "CarouselTrigger was rendered outside of a <CarouselItem> within <Carousel>. Nest it inside <CarouselItem>."
13146
+ );
13147
+ throw new Error("CarouselTrigger missing context");
13148
+ }
13103
13149
  return /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "flex m-0 p-0", children: /* @__PURE__ */ jsxRuntime.jsxs(
13104
13150
  "button",
13105
13151
  {
@@ -13140,7 +13186,13 @@ CarouselTrigger.displayName = "CarouselTrigger";
13140
13186
  var CarouselContent = React11__namespace.forwardRef(
13141
13187
  ({ className, children, ...props }, ref) => {
13142
13188
  const itemContext = React11__namespace.useContext(CarouselItemContext);
13143
- if (!itemContext) throw new Error("CarouselContent missing context");
13189
+ if (!itemContext) {
13190
+ devWarn(
13191
+ "react-carousel/carousel-content-outside-item",
13192
+ "CarouselContent was rendered outside of a <CarouselItem> within <Carousel>. Nest it inside <CarouselItem>."
13193
+ );
13194
+ throw new Error("CarouselContent missing context");
13195
+ }
13144
13196
  return /* @__PURE__ */ jsxRuntime.jsx(
13145
13197
  "div",
13146
13198
  {
@@ -13645,39 +13697,1191 @@ var PaymentButton = React11__namespace.forwardRef(
13645
13697
  );
13646
13698
  PaymentButton.displayName = "PaymentButton";
13647
13699
 
13648
- Object.defineProperty(exports, "Controller", {
13649
- enumerable: true,
13650
- get: function () { return reactHookForm.Controller; }
13651
- });
13652
- Object.defineProperty(exports, "FormProvider", {
13653
- enumerable: true,
13654
- get: function () { return reactHookForm.FormProvider; }
13655
- });
13656
- Object.defineProperty(exports, "useController", {
13657
- enumerable: true,
13658
- get: function () { return reactHookForm.useController; }
13659
- });
13660
- Object.defineProperty(exports, "useForm", {
13661
- enumerable: true,
13662
- get: function () { return reactHookForm.useForm; }
13663
- });
13664
- Object.defineProperty(exports, "useFormContext", {
13665
- enumerable: true,
13666
- get: function () { return reactHookForm.useFormContext; }
13667
- });
13668
- Object.defineProperty(exports, "useFormState", {
13669
- enumerable: true,
13670
- get: function () { return reactHookForm.useFormState; }
13671
- });
13672
- Object.defineProperty(exports, "useWatch", {
13673
- enumerable: true,
13674
- get: function () { return reactHookForm.useWatch; }
13675
- });
13700
+ // ../logger/dist/index.js
13701
+ var LEVEL_ORDER = {
13702
+ debug: 10,
13703
+ info: 20,
13704
+ warn: 30,
13705
+ error: 40,
13706
+ fatal: 50
13707
+ };
13708
+ var METHOD = {
13709
+ debug: "debug",
13710
+ info: "info",
13711
+ warn: "warn",
13712
+ error: "error",
13713
+ fatal: "error"
13714
+ };
13715
+ function createConsoleSink(opts) {
13716
+ const pretty = opts?.pretty ?? true;
13717
+ const out = opts?.console ?? console;
13718
+ function emit2(level, line, payload) {
13719
+ out[METHOD[level]](line, payload);
13720
+ }
13721
+ return {
13722
+ name: "console",
13723
+ log(record) {
13724
+ if (pretty) {
13725
+ const ts = new Date(record.timestamp).toISOString();
13726
+ emit2(
13727
+ record.level,
13728
+ `${ts} ${record.level.toUpperCase()} [${record.app}] ${record.message}`,
13729
+ record.context
13730
+ );
13731
+ } else {
13732
+ emit2(record.level, JSON.stringify({ type: "log", ...record }), record.context);
13733
+ }
13734
+ },
13735
+ span(record) {
13736
+ const level = record.status === "error" ? "error" : "debug";
13737
+ if (pretty) {
13738
+ emit2(
13739
+ level,
13740
+ `[span] ${record.name} ${record.durationMs.toFixed(2)}ms (${record.status})`,
13741
+ record.context
13742
+ );
13743
+ } else {
13744
+ emit2(level, JSON.stringify({ type: "span", ...record }), record.context);
13745
+ }
13746
+ },
13747
+ async flush() {
13748
+ }
13749
+ };
13750
+ }
13751
+ var NOOP_SPAN = {
13752
+ end() {
13753
+ }
13754
+ };
13755
+ function createNoopTelemetry() {
13756
+ const noop = {
13757
+ debug() {
13758
+ },
13759
+ info() {
13760
+ },
13761
+ warn() {
13762
+ },
13763
+ error() {
13764
+ },
13765
+ fatal() {
13766
+ },
13767
+ child() {
13768
+ return noop;
13769
+ },
13770
+ startSpan() {
13771
+ return NOOP_SPAN;
13772
+ },
13773
+ async flush() {
13774
+ },
13775
+ get sinks() {
13776
+ return [];
13777
+ },
13778
+ addSink() {
13779
+ },
13780
+ removeSink() {
13781
+ }
13782
+ };
13783
+ return noop;
13784
+ }
13785
+ var PRESETS = {
13786
+ development: {
13787
+ minLevel: "debug",
13788
+ batch: false,
13789
+ batchSize: 1,
13790
+ sampleRate: 1,
13791
+ pretty: true,
13792
+ beaconFlush: false
13793
+ },
13794
+ production: {
13795
+ minLevel: "warn",
13796
+ batch: true,
13797
+ batchSize: 20,
13798
+ sampleRate: 0.25,
13799
+ pretty: false,
13800
+ beaconFlush: true
13801
+ }
13802
+ };
13803
+ function resolvePreset(env) {
13804
+ return { ...PRESETS[env] };
13805
+ }
13806
+ function redact(value, keys) {
13807
+ if (keys.length === 0) return value;
13808
+ const lookup = new Set(keys.map((k) => k.toLowerCase()));
13809
+ return walk(value, lookup, /* @__PURE__ */ new WeakSet());
13810
+ }
13811
+ function walk(value, keys, seen2) {
13812
+ if (value === null || typeof value !== "object") return value;
13813
+ if (seen2.has(value)) return "[Circular]";
13814
+ seen2.add(value);
13815
+ if (Array.isArray(value)) {
13816
+ return value.map((item) => walk(item, keys, seen2));
13817
+ }
13818
+ const out = {};
13819
+ for (const [k, v] of Object.entries(value)) {
13820
+ if (keys.has(k.toLowerCase())) {
13821
+ out[k] = "[REDACTED]";
13822
+ continue;
13823
+ }
13824
+ out[k] = walk(v, keys, seen2);
13825
+ }
13826
+ return out;
13827
+ }
13828
+ function createTelemetry(config) {
13829
+ if (config.enabled === false) {
13830
+ return createNoopTelemetry();
13831
+ }
13832
+ const preset = resolvePreset(config.env);
13833
+ const sampleRate = config.sampleRate ?? preset.sampleRate;
13834
+ const redactKeys = config.redactKeys ?? [];
13835
+ const sinks = /* @__PURE__ */ new Map();
13836
+ const sinkOrder = [];
13837
+ const buffer = [];
13838
+ function addSinkInternal(sink) {
13839
+ if (sinks.has(sink.name)) {
13840
+ sinks.set(sink.name, sink);
13841
+ } else {
13842
+ sinks.set(sink.name, sink);
13843
+ sinkOrder.push(sink.name);
13844
+ }
13845
+ }
13846
+ addSinkInternal(createConsoleSink({ pretty: preset.pretty }));
13847
+ if (config.endpoint) {
13848
+ const endpoint = config.endpoint;
13849
+ void Promise.resolve().then(() => (init_faro_engine_47HGRAQH(), faro_engine_47HGRAQH_exports)).then(({ createFaroSink: createFaroSink2 }) => createFaroSink2({ app: config.app, endpoint })).then((faro) => {
13850
+ if (faro) addSinkInternal(faro);
13851
+ }).catch(() => {
13852
+ });
13853
+ }
13854
+ function shouldSample() {
13855
+ if (sampleRate >= 1) return true;
13856
+ if (sampleRate <= 0) return false;
13857
+ return Math.random() < sampleRate;
13858
+ }
13859
+ function dispatch(entry) {
13860
+ if (preset.batch) {
13861
+ buffer.push(entry);
13862
+ if (buffer.length >= preset.batchSize) {
13863
+ void flushBuffer();
13864
+ }
13865
+ return;
13866
+ }
13867
+ deliver(entry);
13868
+ }
13869
+ function deliver(entry) {
13870
+ for (const name of sinkOrder) {
13871
+ const sink = sinks.get(name);
13872
+ if (!sink) continue;
13873
+ if (entry.kind === "log") sink.log(entry.record);
13874
+ else sink.span(entry.record);
13875
+ }
13876
+ }
13877
+ async function flushBuffer() {
13878
+ if (buffer.length > 0) {
13879
+ const pending = buffer.splice(0, buffer.length);
13880
+ for (const entry of pending) deliver(entry);
13881
+ }
13882
+ await Promise.all(
13883
+ sinkOrder.map((name) => sinks.get(name)?.flush() ?? Promise.resolve())
13884
+ );
13885
+ }
13886
+ const root = globalThis;
13887
+ if (preset.beaconFlush && typeof root.addEventListener === "function") {
13888
+ const onExit = () => {
13889
+ void flushBuffer();
13890
+ };
13891
+ root.addEventListener("pagehide", onExit);
13892
+ root.addEventListener("visibilitychange", () => {
13893
+ if (root.document?.visibilityState === "hidden") onExit();
13894
+ });
13895
+ }
13896
+ function makeLogger(boundContext) {
13897
+ function emit2(level, message, context) {
13898
+ if (LEVEL_ORDER[level] < LEVEL_ORDER[preset.minLevel]) return;
13899
+ if (!shouldSample()) return;
13900
+ const merged = redact({ ...boundContext, ...context }, redactKeys);
13901
+ const record = {
13902
+ level,
13903
+ message,
13904
+ timestamp: Date.now(),
13905
+ app: config.app,
13906
+ env: config.env,
13907
+ context: merged
13908
+ };
13909
+ dispatch({ kind: "log", record });
13910
+ }
13911
+ const logger = {
13912
+ debug(message, context) {
13913
+ emit2("debug", message, context);
13914
+ },
13915
+ info(message, context) {
13916
+ emit2("info", message, context);
13917
+ },
13918
+ warn(message, context) {
13919
+ emit2("warn", message, context);
13920
+ },
13921
+ error(message, context) {
13922
+ emit2("error", message, context);
13923
+ },
13924
+ fatal(message, context) {
13925
+ emit2("fatal", message, context);
13926
+ },
13927
+ child(context) {
13928
+ return makeLogger({ ...boundContext, ...context });
13929
+ },
13930
+ startSpan(name, attributes) {
13931
+ const startTime = Date.now();
13932
+ let ended = false;
13933
+ return {
13934
+ end(opts) {
13935
+ if (ended) return;
13936
+ ended = true;
13937
+ const endTime = Date.now();
13938
+ const merged = redact(
13939
+ { ...boundContext, ...attributes, ...opts?.attributes },
13940
+ redactKeys
13941
+ );
13942
+ const err = opts?.error;
13943
+ const record = {
13944
+ name,
13945
+ startTime,
13946
+ endTime,
13947
+ durationMs: endTime - startTime,
13948
+ app: config.app,
13949
+ env: config.env,
13950
+ context: merged,
13951
+ status: err ? "error" : "ok",
13952
+ ...err ? {
13953
+ error: {
13954
+ name: err instanceof Error ? err.name : "Error",
13955
+ message: err instanceof Error ? err.message : String(err)
13956
+ }
13957
+ } : {}
13958
+ };
13959
+ dispatch({ kind: "span", record });
13960
+ }
13961
+ };
13962
+ },
13963
+ flush() {
13964
+ return flushBuffer();
13965
+ },
13966
+ get sinks() {
13967
+ return [...sinkOrder];
13968
+ },
13969
+ addSink(sink) {
13970
+ addSinkInternal(sink);
13971
+ },
13972
+ removeSink(name) {
13973
+ if (sinks.has(name)) {
13974
+ sinks.delete(name);
13975
+ const idx = sinkOrder.indexOf(name);
13976
+ if (idx !== -1) sinkOrder.splice(idx, 1);
13977
+ }
13978
+ }
13979
+ };
13980
+ return logger;
13981
+ }
13982
+ return makeLogger({});
13983
+ }
13984
+
13985
+ // ../react-logger/dist/index.js
13986
+ var TelemetryContext = React11__namespace.createContext(null);
13987
+ function TelemetryProvider({ children, ...config }) {
13988
+ const telemetryRef = React11__namespace.useRef(null);
13989
+ if (!telemetryRef.current) {
13990
+ telemetryRef.current = createTelemetry(config);
13991
+ }
13992
+ const value = React11__namespace.useMemo(
13993
+ () => ({ telemetry: telemetryRef.current }),
13994
+ []
13995
+ );
13996
+ return React11__namespace.createElement(TelemetryContext.Provider, { value }, children);
13997
+ }
13998
+ function useTelemetry() {
13999
+ const ctx = React11__namespace.useContext(TelemetryContext);
14000
+ if (!ctx) {
14001
+ devWarn(
14002
+ "react-logger/use-telemetry-outside-provider",
14003
+ "useTelemetry() (or useSpan(), which depends on it) was called outside a <TelemetryProvider>. Wrap your app (or the consuming subtree) in <TelemetryProvider> so the telemetry context is available."
14004
+ );
14005
+ throw new Error("useTelemetry must be used within a <TelemetryProvider>");
14006
+ }
14007
+ return ctx.telemetry;
14008
+ }
14009
+ function useLogger(scope) {
14010
+ const telemetry = useTelemetry();
14011
+ const scopeKey = scope ? JSON.stringify(scope) : "";
14012
+ return React11__namespace.useMemo(
14013
+ () => scope ? telemetry.child(scope) : telemetry,
14014
+ [telemetry, scope, scopeKey]
14015
+ );
14016
+ }
14017
+ function useSpan() {
14018
+ const telemetry = useTelemetry();
14019
+ const spanRef = React11__namespace.useRef(null);
14020
+ const [isActive, setIsActive] = React11__namespace.useState(false);
14021
+ const end = React11__namespace.useCallback(
14022
+ (opts) => {
14023
+ if (!spanRef.current) return;
14024
+ spanRef.current.end(opts);
14025
+ spanRef.current = null;
14026
+ setIsActive(false);
14027
+ },
14028
+ []
14029
+ );
14030
+ const start = React11__namespace.useCallback(
14031
+ (name, attributes) => {
14032
+ if (spanRef.current) {
14033
+ spanRef.current.end();
14034
+ }
14035
+ const span = telemetry.startSpan(name, attributes);
14036
+ spanRef.current = span;
14037
+ setIsActive(true);
14038
+ return span;
14039
+ },
14040
+ [telemetry]
14041
+ );
14042
+ React11__namespace.useEffect(() => {
14043
+ return () => {
14044
+ if (spanRef.current) {
14045
+ spanRef.current.end();
14046
+ spanRef.current = null;
14047
+ }
14048
+ };
14049
+ }, []);
14050
+ return React11__namespace.useMemo(
14051
+ () => ({ start, end, isActive }),
14052
+ [start, end, isActive]
14053
+ );
14054
+ }
14055
+ var TelemetryErrorBoundary = class extends React11__namespace.Component {
14056
+ static contextType = TelemetryContext;
14057
+ state = { error: null };
14058
+ static getDerivedStateFromError(error) {
14059
+ return { error };
14060
+ }
14061
+ componentDidCatch(error, info) {
14062
+ const telemetry = this.context?.telemetry;
14063
+ if (telemetry) {
14064
+ telemetry.error(error.message, {
14065
+ ...this.props.context,
14066
+ name: error.name,
14067
+ stack: error.stack,
14068
+ componentStack: info.componentStack
14069
+ });
14070
+ }
14071
+ this.props.onError?.(error, info);
14072
+ }
14073
+ reset = () => {
14074
+ this.setState({ error: null });
14075
+ };
14076
+ render() {
14077
+ const { error } = this.state;
14078
+ if (error) {
14079
+ const { fallback } = this.props;
14080
+ if (typeof fallback === "function") {
14081
+ return fallback(error, this.reset);
14082
+ }
14083
+ return fallback ?? null;
14084
+ }
14085
+ return this.props.children;
14086
+ }
14087
+ };
14088
+
14089
+ // ../analytics/dist/index.js
14090
+ var SCHEMA_VERSION = 1;
14091
+ function uuidv4() {
14092
+ const c = typeof globalThis !== "undefined" ? globalThis.crypto : void 0;
14093
+ if (c && typeof c.randomUUID === "function") {
14094
+ return c.randomUUID();
14095
+ }
14096
+ const bytes = new Uint8Array(16);
14097
+ if (c && typeof c.getRandomValues === "function") {
14098
+ c.getRandomValues(bytes);
14099
+ } else {
14100
+ for (let i = 0; i < 16; i++) bytes[i] = Math.floor(Math.random() * 256);
14101
+ }
14102
+ bytes[6] = bytes[6] & 15 | 64;
14103
+ bytes[8] = bytes[8] & 63 | 128;
14104
+ const hex = [];
14105
+ for (let i = 0; i < 256; i++) hex.push((i + 256).toString(16).slice(1));
14106
+ return hex[bytes[0]] + hex[bytes[1]] + hex[bytes[2]] + hex[bytes[3]] + "-" + hex[bytes[4]] + hex[bytes[5]] + "-" + hex[bytes[6]] + hex[bytes[7]] + "-" + hex[bytes[8]] + hex[bytes[9]] + "-" + hex[bytes[10]] + hex[bytes[11]] + hex[bytes[12]] + hex[bytes[13]] + hex[bytes[14]] + hex[bytes[15]];
14107
+ }
14108
+ var UUID_V4_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
14109
+ function isUuidV4(value) {
14110
+ return typeof value === "string" && UUID_V4_RE.test(value);
14111
+ }
14112
+ function createMemoryStorage() {
14113
+ const map = /* @__PURE__ */ new Map();
14114
+ return {
14115
+ get: (k) => map.has(k) ? map.get(k) : null,
14116
+ set: (k, v) => {
14117
+ map.set(k, v);
14118
+ },
14119
+ remove: (k) => {
14120
+ map.delete(k);
14121
+ }
14122
+ };
14123
+ }
14124
+ function createLocalStorageAdapter(ls) {
14125
+ return {
14126
+ get: (k) => {
14127
+ try {
14128
+ return ls.getItem(k);
14129
+ } catch {
14130
+ return null;
14131
+ }
14132
+ },
14133
+ set: (k, v) => {
14134
+ try {
14135
+ ls.setItem(k, v);
14136
+ } catch {
14137
+ }
14138
+ },
14139
+ remove: (k) => {
14140
+ try {
14141
+ ls.removeItem(k);
14142
+ } catch {
14143
+ }
14144
+ }
14145
+ };
14146
+ }
14147
+ function createCookieAdapter(doc, maxAgeSeconds = 60 * 60 * 24 * 365) {
14148
+ const read = (k) => {
14149
+ const target = encodeURIComponent(k) + "=";
14150
+ const parts = doc.cookie ? doc.cookie.split(";") : [];
14151
+ for (const part of parts) {
14152
+ const c = part.trim();
14153
+ if (c.startsWith(target)) {
14154
+ return decodeURIComponent(c.slice(target.length));
14155
+ }
14156
+ }
14157
+ return null;
14158
+ };
14159
+ return {
14160
+ get: read,
14161
+ set: (k, v) => {
14162
+ doc.cookie = `${encodeURIComponent(k)}=${encodeURIComponent(
14163
+ v
14164
+ )}; path=/; max-age=${maxAgeSeconds}; SameSite=Lax`;
14165
+ },
14166
+ remove: (k) => {
14167
+ doc.cookie = `${encodeURIComponent(k)}=; path=/; max-age=0; SameSite=Lax`;
14168
+ }
14169
+ };
14170
+ }
14171
+ function resolveStorage(override) {
14172
+ if (override) return override;
14173
+ const g = globalThis;
14174
+ if (g.localStorage) {
14175
+ try {
14176
+ const probe = "__rfx_a_probe__";
14177
+ g.localStorage.setItem(probe, "1");
14178
+ g.localStorage.removeItem(probe);
14179
+ return createLocalStorageAdapter(g.localStorage);
14180
+ } catch {
14181
+ }
14182
+ }
14183
+ if (g.document && typeof g.document.cookie === "string") {
14184
+ return createCookieAdapter(g.document);
14185
+ }
14186
+ return createMemoryStorage();
14187
+ }
14188
+ var DEFAULT_SESSION_TIMEOUT_MS = 30 * 60 * 1e3;
14189
+ var DEFAULT_KEY = "rfx:analytics:session";
14190
+ var CAMPAIGN_PARAMS = [
14191
+ "utm_source",
14192
+ "utm_medium",
14193
+ "utm_campaign",
14194
+ "utm_term",
14195
+ "utm_content",
14196
+ "gclid",
14197
+ "fbclid",
14198
+ "msclkid"
14199
+ ];
14200
+ function campaignFingerprint(search) {
14201
+ if (!search) return void 0;
14202
+ let qs = search;
14203
+ const q = qs.indexOf("?");
14204
+ if (q !== -1) qs = qs.slice(q + 1);
14205
+ let params;
14206
+ try {
14207
+ params = new URLSearchParams(qs);
14208
+ } catch {
14209
+ return void 0;
14210
+ }
14211
+ const pairs = [];
14212
+ for (const p of CAMPAIGN_PARAMS) {
14213
+ const v = params.get(p);
14214
+ if (v) pairs.push(`${p}=${v}`);
14215
+ }
14216
+ return pairs.length ? pairs.join("&") : void 0;
14217
+ }
14218
+ function createSession(config, now = () => Date.now()) {
14219
+ const storage = resolveStorage(config?.storage);
14220
+ const key = config?.storageKey ?? DEFAULT_KEY;
14221
+ const timeoutMs = config?.timeoutMs ?? DEFAULT_SESSION_TIMEOUT_MS;
14222
+ const resetOnCampaign = config?.resetOnCampaign ?? true;
14223
+ function read() {
14224
+ const raw = storage.get(key);
14225
+ if (!raw) return null;
14226
+ try {
14227
+ const parsed = JSON.parse(raw);
14228
+ if (parsed && typeof parsed.id === "string") return parsed;
14229
+ } catch {
14230
+ }
14231
+ return null;
14232
+ }
14233
+ function write(s) {
14234
+ storage.set(key, JSON.stringify(s));
14235
+ }
14236
+ function mint(campaign) {
14237
+ const s = {
14238
+ id: uuidv4(),
14239
+ lastActivity: now(),
14240
+ campaign
14241
+ };
14242
+ write(s);
14243
+ return s;
14244
+ }
14245
+ function ensure(campaign) {
14246
+ const existing = read();
14247
+ const t = now();
14248
+ if (!existing) return mint(campaign);
14249
+ if (t - existing.lastActivity > timeoutMs) {
14250
+ return mint(campaign);
14251
+ }
14252
+ if (resetOnCampaign && campaign !== void 0 && existing.campaign !== campaign) {
14253
+ return mint(campaign);
14254
+ }
14255
+ return existing;
14256
+ }
14257
+ return {
14258
+ /** Get the current session id, rotating if expired. */
14259
+ id(campaign) {
14260
+ return ensure(campaign).id;
14261
+ },
14262
+ /** Force a brand-new session. */
14263
+ start(campaign) {
14264
+ return mint(campaign).id;
14265
+ },
14266
+ /** End the current session (next id() mints a fresh one). */
14267
+ end() {
14268
+ storage.remove(key);
14269
+ },
14270
+ /** Touch activity so the inactivity window slides forward. */
14271
+ touch(campaign) {
14272
+ const s = ensure(campaign);
14273
+ s.lastActivity = now();
14274
+ write(s);
14275
+ return s.id;
14276
+ },
14277
+ /** Attach/merge session-scoped properties. */
14278
+ set(props) {
14279
+ const s = ensure();
14280
+ s.props = { ...s.props ?? {}, ...props };
14281
+ write(s);
14282
+ },
14283
+ /** Read session-scoped properties (undefined when none). */
14284
+ props() {
14285
+ return read()?.props;
14286
+ }
14287
+ };
14288
+ }
14289
+ var DEFAULT_KEY2 = "rfx:analytics:anon";
14290
+ function createIdentity(config) {
14291
+ const storage = resolveStorage(config?.storage);
14292
+ const key = config?.storageKey ?? DEFAULT_KEY2;
14293
+ let userId;
14294
+ function loadOrMintAnon() {
14295
+ const existing = storage.get(key);
14296
+ if (isUuidV4(existing)) return existing;
14297
+ const fresh = uuidv4();
14298
+ storage.set(key, fresh);
14299
+ return fresh;
14300
+ }
14301
+ let anonymousId = loadOrMintAnon();
14302
+ return {
14303
+ anonymousId() {
14304
+ return anonymousId;
14305
+ },
14306
+ userId() {
14307
+ return userId;
14308
+ },
14309
+ /** identify(): bind an opaque app user id (no validation, no persistence). */
14310
+ setUserId(id) {
14311
+ userId = id;
14312
+ },
14313
+ /**
14314
+ * alias(): returns the stitch pair for the envelope. `previousId`
14315
+ * defaults to the current user or anonymous id.
14316
+ */
14317
+ alias(nextUserId, previousId) {
14318
+ const prev = previousId ?? userId ?? anonymousId;
14319
+ userId = nextUserId;
14320
+ return { userId: nextUserId, previousId: prev };
14321
+ },
14322
+ /**
14323
+ * reset(): privacy-safe logout. Drops the user binding and mints a brand
14324
+ * new anonymousId so the next visitor is not stitched to the old one.
14325
+ */
14326
+ reset() {
14327
+ userId = void 0;
14328
+ anonymousId = uuidv4();
14329
+ storage.set(key, anonymousId);
14330
+ return anonymousId;
14331
+ }
14332
+ };
14333
+ }
14334
+ function createConsent(config) {
14335
+ const granted = new Set(config?.granted ?? []);
14336
+ return {
14337
+ strict: config?.strict ?? false,
14338
+ grant(...categories) {
14339
+ for (const c of categories) granted.add(c);
14340
+ },
14341
+ revoke(...categories) {
14342
+ for (const c of categories) granted.delete(c);
14343
+ },
14344
+ granted() {
14345
+ return [...granted];
14346
+ },
14347
+ isGranted(category) {
14348
+ return granted.has(category);
14349
+ },
14350
+ allows(required) {
14351
+ if (!required || required.length === 0) return true;
14352
+ return required.every((c) => granted.has(c));
14353
+ }
14354
+ };
14355
+ }
14356
+ var PII_DENY_LIST = [
14357
+ "email",
14358
+ "phone",
14359
+ "mobile",
14360
+ "firstname",
14361
+ "lastname",
14362
+ "fullname",
14363
+ "givenname",
14364
+ "surname",
14365
+ "password",
14366
+ "passwd",
14367
+ "ssn",
14368
+ "creditcard",
14369
+ "cardnumber",
14370
+ "cvv",
14371
+ "dob",
14372
+ "dateofbirth",
14373
+ "address"
14374
+ ];
14375
+ var PII_EXACT_KEYS = ["name"];
14376
+ var REDACTED = "[REDACTED]";
14377
+ function normalize(key) {
14378
+ return key.toLowerCase().replace(/[_\-\s]/g, "");
14379
+ }
14380
+ function createRedactor(extraKeys = []) {
14381
+ const exact = /* @__PURE__ */ new Set([
14382
+ ...extraKeys.map(normalize),
14383
+ ...PII_EXACT_KEYS.map(normalize)
14384
+ ]);
14385
+ const deny = PII_DENY_LIST.map(normalize);
14386
+ const shouldRedact = (key) => {
14387
+ const n = normalize(key);
14388
+ if (exact.has(n)) return true;
14389
+ return deny.some((d) => n.includes(d));
14390
+ };
14391
+ const walk2 = (value) => {
14392
+ if (Array.isArray(value)) return value.map(walk2);
14393
+ if (value && typeof value === "object") {
14394
+ const out = {};
14395
+ for (const [k, v] of Object.entries(value)) {
14396
+ out[k] = shouldRedact(k) ? REDACTED : walk2(v);
14397
+ }
14398
+ return out;
14399
+ }
14400
+ return value;
14401
+ };
14402
+ return {
14403
+ shouldRedact,
14404
+ /** Redact a properties/traits bag (returns a new object). */
14405
+ redact(props) {
14406
+ if (!props) return props;
14407
+ return walk2(props);
14408
+ }
14409
+ };
14410
+ }
14411
+ var NO_RETRY = /* @__PURE__ */ new Set([400, 401, 413]);
14412
+ function base64(input) {
14413
+ const g = globalThis;
14414
+ if (typeof g.btoa === "function") {
14415
+ return g.btoa(input);
14416
+ }
14417
+ if (g.Buffer) {
14418
+ return g.Buffer.from(input, "utf-8").toString("base64");
14419
+ }
14420
+ throw new Error("No base64 implementation available (btoa/Buffer)");
14421
+ }
14422
+ function byteLength(s) {
14423
+ const g = globalThis;
14424
+ if (g.TextEncoder) return new g.TextEncoder().encode(s).length;
14425
+ return unescape(encodeURIComponent(s)).length;
14426
+ }
14427
+ var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
14428
+ function splitBatch(batch, maxBatchBytes, maxEventBytes) {
14429
+ const batches = [];
14430
+ const dropped = [];
14431
+ let current = [];
14432
+ let currentBytes = 2;
14433
+ for (const ev of batch) {
14434
+ const evBytes = byteLength(JSON.stringify(ev));
14435
+ if (evBytes > maxEventBytes) {
14436
+ dropped.push(ev);
14437
+ continue;
14438
+ }
14439
+ if (current.length && currentBytes + evBytes + 1 > maxBatchBytes) {
14440
+ batches.push(current);
14441
+ current = [];
14442
+ currentBytes = 2;
14443
+ }
14444
+ current.push(ev);
14445
+ currentBytes += evBytes + 1;
14446
+ }
14447
+ if (current.length) batches.push(current);
14448
+ return { batches, dropped };
14449
+ }
14450
+ function createHttpSink(options) {
14451
+ const {
14452
+ endpoint,
14453
+ writeKey,
14454
+ maxRetries = 3,
14455
+ backoffBaseMs = 500,
14456
+ consentCategories = ["analytics"],
14457
+ maxBatchBytes = 5e5,
14458
+ maxEventBytes = 32e3
14459
+ } = options;
14460
+ const base = endpoint.replace(/\/+$/, "");
14461
+ const url = `${base}/v${SCHEMA_VERSION}/batch`;
14462
+ const authHeader = `Basic ${base64(`${writeKey}:`)}`;
14463
+ const resolveFetch = () => {
14464
+ if (options.fetchImpl) return options.fetchImpl;
14465
+ const f = globalThis.fetch;
14466
+ if (!f) throw new Error("No fetch implementation available");
14467
+ return f;
14468
+ };
14469
+ const resolveBeacon = () => {
14470
+ if (options.beaconImpl) return options.beaconImpl;
14471
+ const nav = globalThis.navigator;
14472
+ if (nav && typeof nav.sendBeacon === "function") {
14473
+ return (u, body) => nav.sendBeacon(u, body);
14474
+ }
14475
+ return void 0;
14476
+ };
14477
+ function envelope(batch) {
14478
+ return {
14479
+ batch,
14480
+ sentAt: (/* @__PURE__ */ new Date()).toISOString(),
14481
+ batchId: uuidv4()
14482
+ };
14483
+ }
14484
+ function sendViaBeacon(batch) {
14485
+ const beacon = resolveBeacon();
14486
+ if (!beacon) return false;
14487
+ const beaconUrl = `${url}?writeKey=${encodeURIComponent(writeKey)}`;
14488
+ return beacon(beaconUrl, JSON.stringify(envelope(batch)));
14489
+ }
14490
+ async function sendViaFetch(batch) {
14491
+ const doFetch = resolveFetch();
14492
+ const body = JSON.stringify(envelope(batch));
14493
+ for (let attempt = 0; ; attempt++) {
14494
+ let status;
14495
+ try {
14496
+ const res = await doFetch(url, {
14497
+ method: "POST",
14498
+ headers: {
14499
+ "Content-Type": "application/json",
14500
+ Authorization: authHeader
14501
+ },
14502
+ body,
14503
+ keepalive: true
14504
+ });
14505
+ status = res.status;
14506
+ } catch {
14507
+ status = 0;
14508
+ }
14509
+ if (status >= 200 && status < 300) return;
14510
+ if (NO_RETRY.has(status)) return;
14511
+ if (attempt >= maxRetries) return;
14512
+ const delay = backoffBaseMs * 2 ** attempt;
14513
+ await sleep(delay);
14514
+ }
14515
+ }
14516
+ return {
14517
+ name: "http",
14518
+ consentCategories,
14519
+ async deliver(batch, ctx) {
14520
+ if (batch.length === 0) return;
14521
+ const { batches } = splitBatch(
14522
+ batch,
14523
+ maxBatchBytes,
14524
+ maxEventBytes
14525
+ );
14526
+ for (const part of batches) {
14527
+ if (ctx.unload) {
14528
+ if (sendViaBeacon(part)) continue;
14529
+ void sendViaFetch(part);
14530
+ } else {
14531
+ await sendViaFetch(part);
14532
+ }
14533
+ }
14534
+ }
14535
+ };
14536
+ }
14537
+ function createConsoleSink2(options = {}) {
14538
+ const logger = options.logger ?? globalThis.console;
14539
+ return {
14540
+ name: "console",
14541
+ consentCategories: options.consentCategories,
14542
+ deliver(batch) {
14543
+ for (const ev of batch) {
14544
+ const label = `[analytics] ${ev.type}${ev.event ? ` ${ev.event}` : ""}`;
14545
+ if (typeof logger.groupCollapsed === "function") {
14546
+ logger.groupCollapsed(label);
14547
+ logger.log(ev);
14548
+ logger.groupEnd?.();
14549
+ } else {
14550
+ logger.log(label, ev);
14551
+ }
14552
+ }
14553
+ }
14554
+ };
14555
+ }
14556
+ function createNoopAnalytics() {
14557
+ const sessionId = "00000000-0000-4000-8000-000000000000";
14558
+ const noop = () => {
14559
+ };
14560
+ const api = {
14561
+ track: noop,
14562
+ identify: noop,
14563
+ page: noop,
14564
+ screen: noop,
14565
+ group: noop,
14566
+ alias: noop,
14567
+ session: {
14568
+ id: () => sessionId,
14569
+ start: () => sessionId,
14570
+ end: noop,
14571
+ set: noop
14572
+ },
14573
+ consent: {
14574
+ grant: noop,
14575
+ revoke: noop,
14576
+ granted: () => [],
14577
+ isGranted: () => false
14578
+ },
14579
+ anonymousId: () => sessionId,
14580
+ userId: () => void 0,
14581
+ with: () => api,
14582
+ addSink: noop,
14583
+ removeSink: noop,
14584
+ get sinks() {
14585
+ return [];
14586
+ },
14587
+ flush: async () => {
14588
+ },
14589
+ reset: noop,
14590
+ enabled: false
14591
+ };
14592
+ return api;
14593
+ }
14594
+ var LIBRARY = {
14595
+ name: "@refraction-ui/analytics",
14596
+ version: "0.1.0"
14597
+ };
14598
+ function readPage() {
14599
+ const g = globalThis;
14600
+ if (!g.location && !g.document) return void 0;
14601
+ return {
14602
+ path: g.location?.pathname,
14603
+ url: g.location?.href,
14604
+ search: g.location?.search,
14605
+ title: g.document?.title,
14606
+ referrer: g.document?.referrer
14607
+ };
14608
+ }
14609
+ function createAnalytics(config) {
14610
+ if (config.enabled === false) {
14611
+ return createNoopAnalytics();
14612
+ }
14613
+ const { app, env } = config;
14614
+ const preset = config.preset ?? (env === "production" ? "prod" : "dev");
14615
+ const sampleRate = config.sampleRate ?? 1;
14616
+ const batchSize = config.batchSize ?? 20;
14617
+ const flushIntervalMs = config.flushIntervalMs ?? 1e4;
14618
+ const session = createSession(config.session);
14619
+ const identity = createIdentity(config.identity);
14620
+ const consent = createConsent(config.consent);
14621
+ const redactor = createRedactor(config.redactKeys);
14622
+ const sinks = /* @__PURE__ */ new Map();
14623
+ const sinkOrder = [];
14624
+ const initialized = /* @__PURE__ */ new Set();
14625
+ function registerSink(sink) {
14626
+ if (!sinks.has(sink.name)) sinkOrder.push(sink.name);
14627
+ sinks.set(sink.name, sink);
14628
+ }
14629
+ if (config.endpoint) {
14630
+ registerSink(
14631
+ createHttpSink({
14632
+ endpoint: config.endpoint,
14633
+ writeKey: config.writeKey ?? ""
14634
+ })
14635
+ );
14636
+ }
14637
+ if (preset === "dev") {
14638
+ registerSink(createConsoleSink2());
14639
+ }
14640
+ for (const s of config.sinks ?? []) registerSink(s);
14641
+ function ensureInit(sink) {
14642
+ if (initialized.has(sink.name)) return;
14643
+ initialized.add(sink.name);
14644
+ if (sink.init) {
14645
+ return sink.init({ app, env, endpoint: config.endpoint });
14646
+ }
14647
+ }
14648
+ const buffer = [];
14649
+ let timer;
14650
+ function startTimer() {
14651
+ if (preset !== "prod" || timer) return;
14652
+ timer = setInterval(() => {
14653
+ void flush(false);
14654
+ }, flushIntervalMs);
14655
+ timer.unref?.();
14656
+ }
14657
+ function deliverToSinks(batch, unload) {
14658
+ if (batch.length === 0) return;
14659
+ const ctx = { unload };
14660
+ const pending = [];
14661
+ for (const name of sinkOrder) {
14662
+ const sink = sinks.get(name);
14663
+ if (!sink) continue;
14664
+ if (!consent.allows(sink.consentCategories)) continue;
14665
+ const inited = ensureInit(sink);
14666
+ if (inited && typeof inited.then === "function") {
14667
+ pending.push(
14668
+ inited.then(() => sink.deliver(batch, ctx))
14669
+ );
14670
+ } else {
14671
+ const r = sink.deliver(batch, ctx);
14672
+ if (r && typeof r.then === "function") {
14673
+ pending.push(r);
14674
+ }
14675
+ }
14676
+ }
14677
+ if (pending.length) return Promise.all(pending).then(() => void 0);
14678
+ }
14679
+ async function flush(unload = false) {
14680
+ const batch = buffer.splice(0, buffer.length);
14681
+ await deliverToSinks(batch, unload);
14682
+ for (const name of sinkOrder) {
14683
+ const sink = sinks.get(name);
14684
+ if (sink?.flush && consent.allows(sink.consentCategories)) {
14685
+ await sink.flush();
14686
+ }
14687
+ }
14688
+ }
14689
+ function bindUnload() {
14690
+ if (preset !== "prod") return;
14691
+ const g = globalThis;
14692
+ if (typeof g.addEventListener !== "function") return;
14693
+ const onUnload = () => {
14694
+ void deliverToSinks(buffer.splice(0, buffer.length), true);
14695
+ };
14696
+ g.addEventListener("pagehide", onUnload);
14697
+ g.addEventListener("visibilitychange", () => {
14698
+ if (g.document?.visibilityState === "hidden") onUnload();
14699
+ });
14700
+ }
14701
+ startTimer();
14702
+ bindUnload();
14703
+ function buildContext(extra, childCtx) {
14704
+ const page = readPage();
14705
+ return {
14706
+ app,
14707
+ env,
14708
+ ...page ? { page } : {},
14709
+ ...childCtx,
14710
+ ...extra,
14711
+ library: LIBRARY
14712
+ };
14713
+ }
14714
+ function sampled() {
14715
+ if (sampleRate >= 1) return true;
14716
+ if (sampleRate <= 0) return false;
14717
+ return Math.random() < sampleRate;
14718
+ }
14719
+ function enqueue(ev) {
14720
+ if (preset === "dev") {
14721
+ void deliverToSinks([ev], false);
14722
+ return;
14723
+ }
14724
+ buffer.push(ev);
14725
+ if (buffer.length >= batchSize) {
14726
+ void flush(false);
14727
+ }
14728
+ }
14729
+ function emit2(type, fields, childCtx, opts) {
14730
+ if (!sampled()) return;
14731
+ const page = readPage();
14732
+ const campaign = campaignFingerprint(page?.search);
14733
+ const sessionId = session.touch(campaign);
14734
+ const sessionProps = session.props();
14735
+ const ev = {
14736
+ type,
14737
+ messageId: uuidv4(),
14738
+ anonymousId: identity.anonymousId(),
14739
+ userId: identity.userId(),
14740
+ sessionId,
14741
+ context: buildContext(opts?.context, childCtx),
14742
+ timestamp: opts?.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
14743
+ schemaVersion: SCHEMA_VERSION,
14744
+ ...fields
14745
+ };
14746
+ if (sessionProps && (ev.properties || type === "track" || type === "page" || type === "screen")) {
14747
+ ev.properties = { ...sessionProps, ...ev.properties ?? {} };
14748
+ }
14749
+ enqueue(ev);
14750
+ }
14751
+ function makeApi(childCtx) {
14752
+ const api = {
14753
+ track(event, properties, opts) {
14754
+ emit2(
14755
+ "track",
14756
+ { event, properties: redactor.redact(properties) },
14757
+ childCtx,
14758
+ opts
14759
+ );
14760
+ },
14761
+ identify(userId, traits, opts) {
14762
+ identity.setUserId(userId);
14763
+ emit2("identify", { traits: redactor.redact(traits) }, childCtx, opts);
14764
+ },
14765
+ page(name, properties, opts) {
14766
+ emit2(
14767
+ "page",
14768
+ { event: name, properties: redactor.redact(properties) },
14769
+ childCtx,
14770
+ opts
14771
+ );
14772
+ },
14773
+ screen(name, properties, opts) {
14774
+ emit2(
14775
+ "screen",
14776
+ { event: name, properties: redactor.redact(properties) },
14777
+ childCtx,
14778
+ opts
14779
+ );
14780
+ },
14781
+ group(groupId, traits, opts) {
14782
+ emit2(
14783
+ "group",
14784
+ { groupId, traits: redactor.redact(traits) },
14785
+ childCtx,
14786
+ opts
14787
+ );
14788
+ },
14789
+ alias(userId, previousId, opts) {
14790
+ const stitch = identity.alias(userId, previousId);
14791
+ emit2(
14792
+ "alias",
14793
+ { userId: stitch.userId, previousId: stitch.previousId },
14794
+ childCtx,
14795
+ opts
14796
+ );
14797
+ },
14798
+ session: {
14799
+ id: () => session.id(),
14800
+ start: () => session.start(),
14801
+ end: () => session.end(),
14802
+ set: (props) => session.set(props)
14803
+ },
14804
+ consent: {
14805
+ grant: (...c) => consent.grant(...c),
14806
+ revoke: (...c) => consent.revoke(...c),
14807
+ granted: () => consent.granted(),
14808
+ isGranted: (c) => consent.isGranted(c)
14809
+ },
14810
+ anonymousId: () => identity.anonymousId(),
14811
+ userId: () => identity.userId(),
14812
+ with(extra) {
14813
+ return makeApi({ ...childCtx, ...extra });
14814
+ },
14815
+ addSink(sink) {
14816
+ registerSink(sink);
14817
+ },
14818
+ removeSink(name) {
14819
+ if (sinks.has(name)) {
14820
+ sinks.delete(name);
14821
+ const i = sinkOrder.indexOf(name);
14822
+ if (i !== -1) sinkOrder.splice(i, 1);
14823
+ initialized.delete(name);
14824
+ }
14825
+ },
14826
+ get sinks() {
14827
+ return [...sinkOrder];
14828
+ },
14829
+ async flush() {
14830
+ await flush(false);
14831
+ },
14832
+ reset() {
14833
+ identity.reset();
14834
+ session.end();
14835
+ },
14836
+ enabled: true
14837
+ };
14838
+ return api;
14839
+ }
14840
+ return makeApi();
14841
+ }
14842
+
14843
+ // ../react-analytics/dist/index.js
14844
+ var AnalyticsContext = React11__namespace.createContext(null);
14845
+ function AnalyticsProvider({ children, value }) {
14846
+ const analyticsRef = React11__namespace.useRef(null);
14847
+ if (!analyticsRef.current) {
14848
+ analyticsRef.current = value;
14849
+ }
14850
+ return React11__namespace.createElement(
14851
+ AnalyticsContext.Provider,
14852
+ { value: analyticsRef.current },
14853
+ children
14854
+ );
14855
+ }
14856
+ function useAnalytics(options) {
14857
+ const ctx = React11__namespace.useContext(AnalyticsContext);
14858
+ if (!ctx) {
14859
+ devWarn(
14860
+ "react-analytics/use-analytics-outside-provider",
14861
+ "useAnalytics() was called outside an <AnalyticsProvider>. Wrap your app (or the consuming subtree) in <AnalyticsProvider> so the analytics context is available."
14862
+ );
14863
+ throw new Error("useAnalytics must be used within an <AnalyticsProvider>");
14864
+ }
14865
+ const scope = options?.scope;
14866
+ return React11__namespace.useMemo(
14867
+ () => scope ? ctx.with(scope) : ctx,
14868
+ [ctx, scope]
14869
+ );
14870
+ }
14871
+ function useTrackEvent(options) {
14872
+ const analytics = useAnalytics(options);
14873
+ return React11__namespace.useCallback(
14874
+ (event, properties, opts) => analytics.track(event, properties, opts),
14875
+ [analytics]
14876
+ );
14877
+ }
14878
+
13676
14879
  exports.Accordion = Accordion;
13677
14880
  exports.AccordionContent = AccordionContent;
13678
14881
  exports.AccordionItem = AccordionItem;
13679
14882
  exports.AccordionTrigger = AccordionTrigger;
13680
14883
  exports.AltHintState = AltHintState;
14884
+ exports.AnalyticsProvider = AnalyticsProvider;
13681
14885
  exports.AnimatedText = AnimatedText;
13682
14886
  exports.AppShell = AppShell;
13683
14887
  exports.AuthGuard = AuthGuard;
@@ -13766,13 +14970,6 @@ exports.FeedbackDialog = FeedbackDialog;
13766
14970
  exports.FileTree = FileTree;
13767
14971
  exports.FileUpload = FileUpload;
13768
14972
  exports.Footer = Footer;
13769
- exports.Form = Form;
13770
- exports.FormControl = FormControl;
13771
- exports.FormDescription = FormDescription;
13772
- exports.FormField = FormField;
13773
- exports.FormItem = FormItem;
13774
- exports.FormLabel = FormLabel;
13775
- exports.FormMessage = FormMessage;
13776
14973
  exports.IconSystem = IconSystem;
13777
14974
  exports.InlineEditor = InlineEditor;
13778
14975
  exports.Input = Input;
@@ -13836,7 +15033,6 @@ exports.Skeleton = Skeleton;
13836
15033
  exports.SkeletonText = SkeletonText;
13837
15034
  exports.SkipToContent = SkipToContent;
13838
15035
  exports.SlideViewer = SlideViewer;
13839
- exports.Slot = Slot;
13840
15036
  exports.StatsGrid = StatsGrid;
13841
15037
  exports.StatusIndicator = StatusIndicator;
13842
15038
  exports.Step = Step;
@@ -13851,6 +15047,8 @@ exports.Tabs = Tabs;
13851
15047
  exports.TabsContent = TabsContent;
13852
15048
  exports.TabsList = TabsList;
13853
15049
  exports.TabsTrigger = TabsTrigger;
15050
+ exports.TelemetryErrorBoundary = TelemetryErrorBoundary;
15051
+ exports.TelemetryProvider = TelemetryProvider;
13854
15052
  exports.Textarea = Textarea;
13855
15053
  exports.ThreadView = ThreadView;
13856
15054
  exports.Toast = Toast;
@@ -13910,6 +15108,7 @@ exports.commandItemVariants = commandItemVariants;
13910
15108
  exports.commandVariants = commandVariants;
13911
15109
  exports.contentProtectionVariants = contentProtectionVariants;
13912
15110
  exports.controlsVariants = controlsVariants;
15111
+ exports.createAnalytics = createAnalytics;
13913
15112
  exports.createIntensitySamples = createIntensitySamples;
13914
15113
  exports.createSilentSamples = createSilentSamples;
13915
15114
  exports.createVoicePill = createVoicePill;
@@ -13927,8 +15126,6 @@ exports.fileUploadDropZoneVariants = fileUploadDropZoneVariants;
13927
15126
  exports.fileUploadFileItemStyles = fileUploadFileItemStyles;
13928
15127
  exports.fileUploadFileListStyles = fileUploadFileListStyles;
13929
15128
  exports.footerVariants = footerVariants;
13930
- exports.formItemVariants = formItemVariants;
13931
- exports.formLabelVariants = formLabelVariants;
13932
15129
  exports.formatFileSize = formatFileSize;
13933
15130
  exports.formatRelativeTime = formatRelativeTime;
13934
15131
  exports.formatShortcut = formatShortcut;
@@ -14045,10 +15242,14 @@ exports.toastVariants = toastVariants;
14045
15242
  exports.toolbarVariants = toolbarVariants;
14046
15243
  exports.tooltipContentVariants = tooltipContentVariants;
14047
15244
  exports.typewriterVariants = typewriterVariants;
15245
+ exports.useAnalytics = useAnalytics;
14048
15246
  exports.useAuth = useAuth;
14049
- exports.useFormField = useFormField;
15247
+ exports.useLogger = useLogger;
14050
15248
  exports.useShortcut = useShortcut;
15249
+ exports.useSpan = useSpan;
15250
+ exports.useTelemetry = useTelemetry;
14051
15251
  exports.useToast = useToast;
15252
+ exports.useTrackEvent = useTrackEvent;
14052
15253
  exports.versionSelectorOptionVariants = versionSelectorOptionVariants;
14053
15254
  exports.versionSelectorVariants = versionSelectorVariants;
14054
15255
  exports.voicePillAvatarStyles = voicePillAvatarStyles;