tempest-react-sdk 0.77.0 → 0.79.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 (1623) hide show
  1. package/README.md +6 -6
  2. package/bin/lib/alias/collect.mjs +20 -3
  3. package/bin/lib/alias/index.mjs +12 -1
  4. package/bin/lib/alias/index.test.mjs +24 -0
  5. package/bin/lib/css/analyze.test.mjs +21 -1
  6. package/bin/lib/css/collect.mjs +14 -0
  7. package/bin/lib/css/extract.mjs +63 -5
  8. package/bin/lib/css/extract.test.mjs +110 -1
  9. package/bin/lib/css/fix.e2e.test.mjs +50 -0
  10. package/bin/lib/css/index.mjs +6 -1
  11. package/bin/lib/fs/contain.mjs +50 -0
  12. package/bin/lib/icons/generate.mjs +28 -3
  13. package/bin/lib/icons/generate.test.mjs +57 -1
  14. package/bin/lib/openapi/escape.mjs +20 -6
  15. package/bin/lib/openapi/generate.encode.test.mjs +120 -0
  16. package/bin/lib/openapi/generate.hostile.test.mjs +38 -9
  17. package/bin/lib/openapi/generate.mjs +203 -64
  18. package/bin/lib/openapi/generate.pagination.test.mjs +3 -2
  19. package/bin/lib/openapi/generate.test.mjs +270 -3
  20. package/bin/lib/openapi/schema-to-zod.mjs +5 -3
  21. package/bin/tempest-gen.test.mjs +188 -0
  22. package/bin/tempest.mjs +120 -44
  23. package/dist/access/Can.cjs.map +1 -1
  24. package/dist/access/Can.js.map +1 -1
  25. package/dist/access/access-control-context.cjs.map +1 -1
  26. package/dist/access/access-control-context.js.map +1 -1
  27. package/dist/access/create-role-access-control.cjs.map +1 -1
  28. package/dist/access/create-role-access-control.js.map +1 -1
  29. package/dist/access/permissions-from-token.cjs.map +1 -1
  30. package/dist/access/permissions-from-token.js.map +1 -1
  31. package/dist/access/use-can.cjs.map +1 -1
  32. package/dist/access/use-can.js.map +1 -1
  33. package/dist/app/AppProviders.cjs.map +1 -1
  34. package/dist/app/AppProviders.js.map +1 -1
  35. package/dist/audio/audio-bus.cjs.map +1 -1
  36. package/dist/audio/audio-bus.js.map +1 -1
  37. package/dist/audio/audio-output.cjs.map +1 -1
  38. package/dist/audio/audio-output.js.map +1 -1
  39. package/dist/audio/audio-player.cjs.map +1 -1
  40. package/dist/audio/audio-player.js.map +1 -1
  41. package/dist/audio/audio-recorder.cjs.map +1 -1
  42. package/dist/audio/audio-recorder.js.map +1 -1
  43. package/dist/audio/duration.cjs.map +1 -1
  44. package/dist/audio/duration.js.map +1 -1
  45. package/dist/audio/level-meter.cjs.map +1 -1
  46. package/dist/audio/level-meter.js.map +1 -1
  47. package/dist/audio/media-access.cjs.map +1 -1
  48. package/dist/audio/media-access.js.map +1 -1
  49. package/dist/audio/noise-floor.cjs.map +1 -1
  50. package/dist/audio/noise-floor.js.map +1 -1
  51. package/dist/audio/sfx-pool.cjs.map +1 -1
  52. package/dist/audio/sfx-pool.js.map +1 -1
  53. package/dist/audio/use-audio-bus.cjs.map +1 -1
  54. package/dist/audio/use-audio-bus.js.map +1 -1
  55. package/dist/audio/use-audio-recorder.cjs.map +1 -1
  56. package/dist/audio/use-audio-recorder.js.map +1 -1
  57. package/dist/audio/use-audio.cjs.map +1 -1
  58. package/dist/audio/use-audio.js.map +1 -1
  59. package/dist/audio/use-microphone.cjs +1 -1
  60. package/dist/audio/use-microphone.cjs.map +1 -1
  61. package/dist/audio/use-microphone.js +1 -5
  62. package/dist/audio/use-microphone.js.map +1 -1
  63. package/dist/audio/use-sfx-pool.cjs.map +1 -1
  64. package/dist/audio/use-sfx-pool.js.map +1 -1
  65. package/dist/audio/voice-activity.cjs.map +1 -1
  66. package/dist/audio/voice-activity.js.map +1 -1
  67. package/dist/audio/voice-chain-stages.cjs.map +1 -1
  68. package/dist/audio/voice-chain-stages.js.map +1 -1
  69. package/dist/audio/voice-chain.cjs.map +1 -1
  70. package/dist/audio/voice-chain.js.map +1 -1
  71. package/dist/audio/wav.cjs.map +1 -1
  72. package/dist/audio/wav.js.map +1 -1
  73. package/dist/auth/AuthGuard.cjs.map +1 -1
  74. package/dist/auth/AuthGuard.js.map +1 -1
  75. package/dist/auth/create-auth-store.cjs.map +1 -1
  76. package/dist/auth/create-auth-store.js.map +1 -1
  77. package/dist/auth/create-tempest-auth.cjs +1 -1
  78. package/dist/auth/create-tempest-auth.cjs.map +1 -1
  79. package/dist/auth/create-tempest-auth.js +185 -114
  80. package/dist/auth/create-tempest-auth.js.map +1 -1
  81. package/dist/auth/jwt.cjs.map +1 -1
  82. package/dist/auth/jwt.js.map +1 -1
  83. package/dist/auth/lazy-with-retry.cjs.map +1 -1
  84. package/dist/auth/lazy-with-retry.js.map +1 -1
  85. package/dist/auth/passkey.cjs.map +1 -1
  86. package/dist/auth/passkey.js.map +1 -1
  87. package/dist/auth/refresh-queue.cjs.map +1 -1
  88. package/dist/auth/refresh-queue.js.map +1 -1
  89. package/dist/auth/use-passkey.cjs +1 -1
  90. package/dist/auth/use-passkey.cjs.map +1 -1
  91. package/dist/auth/use-passkey.js +1 -1
  92. package/dist/auth/use-passkey.js.map +1 -1
  93. package/dist/br/BrazilMap.cjs.map +1 -1
  94. package/dist/br/BrazilMap.js.map +1 -1
  95. package/dist/br/BrazilMap.module.cjs.map +1 -1
  96. package/dist/br/BrazilMap.module.js.map +1 -1
  97. package/dist/br/BrazilStateCitySelect.cjs.map +1 -1
  98. package/dist/br/BrazilStateCitySelect.js.map +1 -1
  99. package/dist/br/BrazilStateMap.cjs.map +1 -1
  100. package/dist/br/BrazilStateMap.js.map +1 -1
  101. package/dist/br/MapLegend.cjs.map +1 -1
  102. package/dist/br/MapLegend.js.map +1 -1
  103. package/dist/br/MapLegend.module.cjs.map +1 -1
  104. package/dist/br/MapLegend.module.js.map +1 -1
  105. package/dist/br/MapMarkers.cjs.map +1 -1
  106. package/dist/br/MapMarkers.js.map +1 -1
  107. package/dist/br/MapTooltip.cjs.map +1 -1
  108. package/dist/br/MapTooltip.js.map +1 -1
  109. package/dist/br/MunicipalitySearch.cjs +1 -1
  110. package/dist/br/MunicipalitySearch.cjs.map +1 -1
  111. package/dist/br/MunicipalitySearch.js +2 -5
  112. package/dist/br/MunicipalitySearch.js.map +1 -1
  113. package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
  114. package/dist/br/MunicipalitySearch.module.js.map +1 -1
  115. package/dist/br/PixQRCode.cjs.map +1 -1
  116. package/dist/br/PixQRCode.js.map +1 -1
  117. package/dist/br/PixQRCode.module.cjs.map +1 -1
  118. package/dist/br/PixQRCode.module.js.map +1 -1
  119. package/dist/br/boleto.cjs.map +1 -1
  120. package/dist/br/boleto.js.map +1 -1
  121. package/dist/br/br-geo.cjs.map +1 -1
  122. package/dist/br/br-geo.js.map +1 -1
  123. package/dist/br/data/br-centroids.cjs.map +1 -1
  124. package/dist/br/data/br-centroids.js.map +1 -1
  125. package/dist/br/data/br-locations.cjs.map +1 -1
  126. package/dist/br/data/br-locations.js.map +1 -1
  127. package/dist/br/data/br-uf-geo.cjs.map +1 -1
  128. package/dist/br/data/br-uf-geo.js.map +1 -1
  129. package/dist/br/data/mun/AC.cjs.map +1 -1
  130. package/dist/br/data/mun/AC.js.map +1 -1
  131. package/dist/br/data/mun/AL.cjs.map +1 -1
  132. package/dist/br/data/mun/AL.js.map +1 -1
  133. package/dist/br/data/mun/AM.cjs.map +1 -1
  134. package/dist/br/data/mun/AM.js.map +1 -1
  135. package/dist/br/data/mun/AP.cjs.map +1 -1
  136. package/dist/br/data/mun/AP.js.map +1 -1
  137. package/dist/br/data/mun/BA.cjs.map +1 -1
  138. package/dist/br/data/mun/BA.js.map +1 -1
  139. package/dist/br/data/mun/CE.cjs.map +1 -1
  140. package/dist/br/data/mun/CE.js.map +1 -1
  141. package/dist/br/data/mun/DF.cjs.map +1 -1
  142. package/dist/br/data/mun/DF.js.map +1 -1
  143. package/dist/br/data/mun/ES.cjs.map +1 -1
  144. package/dist/br/data/mun/ES.js.map +1 -1
  145. package/dist/br/data/mun/GO.cjs.map +1 -1
  146. package/dist/br/data/mun/GO.js.map +1 -1
  147. package/dist/br/data/mun/MA.cjs.map +1 -1
  148. package/dist/br/data/mun/MA.js.map +1 -1
  149. package/dist/br/data/mun/MG.cjs.map +1 -1
  150. package/dist/br/data/mun/MG.js.map +1 -1
  151. package/dist/br/data/mun/MS.cjs.map +1 -1
  152. package/dist/br/data/mun/MS.js.map +1 -1
  153. package/dist/br/data/mun/MT.cjs.map +1 -1
  154. package/dist/br/data/mun/MT.js.map +1 -1
  155. package/dist/br/data/mun/PA.cjs.map +1 -1
  156. package/dist/br/data/mun/PA.js.map +1 -1
  157. package/dist/br/data/mun/PB.cjs.map +1 -1
  158. package/dist/br/data/mun/PB.js.map +1 -1
  159. package/dist/br/data/mun/PE.cjs.map +1 -1
  160. package/dist/br/data/mun/PE.js.map +1 -1
  161. package/dist/br/data/mun/PI.cjs.map +1 -1
  162. package/dist/br/data/mun/PI.js.map +1 -1
  163. package/dist/br/data/mun/PR.cjs.map +1 -1
  164. package/dist/br/data/mun/PR.js.map +1 -1
  165. package/dist/br/data/mun/RJ.cjs.map +1 -1
  166. package/dist/br/data/mun/RJ.js.map +1 -1
  167. package/dist/br/data/mun/RN.cjs.map +1 -1
  168. package/dist/br/data/mun/RN.js.map +1 -1
  169. package/dist/br/data/mun/RO.cjs.map +1 -1
  170. package/dist/br/data/mun/RO.js.map +1 -1
  171. package/dist/br/data/mun/RR.cjs.map +1 -1
  172. package/dist/br/data/mun/RR.js.map +1 -1
  173. package/dist/br/data/mun/RS.cjs.map +1 -1
  174. package/dist/br/data/mun/RS.js.map +1 -1
  175. package/dist/br/data/mun/SC.cjs.map +1 -1
  176. package/dist/br/data/mun/SC.js.map +1 -1
  177. package/dist/br/data/mun/SE.cjs.map +1 -1
  178. package/dist/br/data/mun/SE.js.map +1 -1
  179. package/dist/br/data/mun/SP.cjs.map +1 -1
  180. package/dist/br/data/mun/SP.js.map +1 -1
  181. package/dist/br/data/mun/TO.cjs.map +1 -1
  182. package/dist/br/data/mun/TO.js.map +1 -1
  183. package/dist/br/geocode.cjs.map +1 -1
  184. package/dist/br/geocode.js.map +1 -1
  185. package/dist/br/holidays.cjs.map +1 -1
  186. package/dist/br/holidays.js.map +1 -1
  187. package/dist/br/locations.cjs.map +1 -1
  188. package/dist/br/locations.js.map +1 -1
  189. package/dist/br/nfe.cjs.map +1 -1
  190. package/dist/br/nfe.js.map +1 -1
  191. package/dist/br/pix.cjs +1 -1
  192. package/dist/br/pix.cjs.map +1 -1
  193. package/dist/br/pix.js +108 -71
  194. package/dist/br/pix.js.map +1 -1
  195. package/dist/br/regions.cjs.map +1 -1
  196. package/dist/br/regions.js.map +1 -1
  197. package/dist/br/scales.cjs.map +1 -1
  198. package/dist/br/scales.js.map +1 -1
  199. package/dist/br/state-geo.cjs.map +1 -1
  200. package/dist/br/state-geo.js.map +1 -1
  201. package/dist/br/svg-utils.cjs.map +1 -1
  202. package/dist/br/svg-utils.js.map +1 -1
  203. package/dist/br/use-map-hover.cjs.map +1 -1
  204. package/dist/br/use-map-hover.js.map +1 -1
  205. package/dist/br/use-map-zoom.cjs.map +1 -1
  206. package/dist/br/use-map-zoom.js.map +1 -1
  207. package/dist/br/whatsapp.cjs.map +1 -1
  208. package/dist/br/whatsapp.js.map +1 -1
  209. package/dist/br.cjs.map +1 -1
  210. package/dist/br.d.ts +16 -5
  211. package/dist/br.js.map +1 -1
  212. package/dist/capture/barcode.cjs.map +1 -1
  213. package/dist/capture/barcode.js.map +1 -1
  214. package/dist/capture/media-recorder.cjs.map +1 -1
  215. package/dist/capture/media-recorder.js.map +1 -1
  216. package/dist/capture/use-barcode-scanner.cjs.map +1 -1
  217. package/dist/capture/use-barcode-scanner.js.map +1 -1
  218. package/dist/capture/use-screen-capture.cjs +1 -1
  219. package/dist/capture/use-screen-capture.cjs.map +1 -1
  220. package/dist/capture/use-screen-capture.js +1 -7
  221. package/dist/capture/use-screen-capture.js.map +1 -1
  222. package/dist/capture/use-speech-recognition.cjs +1 -1
  223. package/dist/capture/use-speech-recognition.cjs.map +1 -1
  224. package/dist/capture/use-speech-recognition.js +35 -36
  225. package/dist/capture/use-speech-recognition.js.map +1 -1
  226. package/dist/capture/use-torch.cjs.map +1 -1
  227. package/dist/capture/use-torch.js.map +1 -1
  228. package/dist/capture/use-video-recorder.cjs.map +1 -1
  229. package/dist/capture/use-video-recorder.js.map +1 -1
  230. package/dist/capture/video-recorder.cjs.map +1 -1
  231. package/dist/capture/video-recorder.js.map +1 -1
  232. package/dist/charts/AreaChart.cjs.map +1 -1
  233. package/dist/charts/AreaChart.js.map +1 -1
  234. package/dist/charts/BarChart.cjs.map +1 -1
  235. package/dist/charts/BarChart.js.map +1 -1
  236. package/dist/charts/LineChart.cjs.map +1 -1
  237. package/dist/charts/LineChart.js.map +1 -1
  238. package/dist/charts/PieChart.cjs.map +1 -1
  239. package/dist/charts/PieChart.js.map +1 -1
  240. package/dist/charts/RadarChart.cjs.map +1 -1
  241. package/dist/charts/RadarChart.js.map +1 -1
  242. package/dist/charts/palette.cjs.map +1 -1
  243. package/dist/charts/palette.js.map +1 -1
  244. package/dist/charts/scales.cjs.map +1 -1
  245. package/dist/charts/scales.js.map +1 -1
  246. package/dist/charts/types.cjs.map +1 -1
  247. package/dist/charts/types.js.map +1 -1
  248. package/dist/charts/use-chart-colors.cjs.map +1 -1
  249. package/dist/charts/use-chart-colors.js.map +1 -1
  250. package/dist/components/AIChat/AIChat.cjs +1 -1
  251. package/dist/components/AIChat/AIChat.cjs.map +1 -1
  252. package/dist/components/AIChat/AIChat.js +1 -5
  253. package/dist/components/AIChat/AIChat.js.map +1 -1
  254. package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
  255. package/dist/components/AIChat/AIChat.module.js.map +1 -1
  256. package/dist/components/AIChat/AIChatComposer.cjs +1 -1
  257. package/dist/components/AIChat/AIChatComposer.cjs.map +1 -1
  258. package/dist/components/AIChat/AIChatComposer.js +1 -7
  259. package/dist/components/AIChat/AIChatComposer.js.map +1 -1
  260. package/dist/components/AIChat/AIChatTurn.cjs.map +1 -1
  261. package/dist/components/AIChat/AIChatTurn.js.map +1 -1
  262. package/dist/components/AIChat/ai-chat-turns.cjs.map +1 -1
  263. package/dist/components/AIChat/ai-chat-turns.js.map +1 -1
  264. package/dist/components/Accordion/Accordion.cjs.map +1 -1
  265. package/dist/components/Accordion/Accordion.js.map +1 -1
  266. package/dist/components/Accordion/Accordion.module.cjs.map +1 -1
  267. package/dist/components/Accordion/Accordion.module.js.map +1 -1
  268. package/dist/components/Alert/Alert.cjs.map +1 -1
  269. package/dist/components/Alert/Alert.js.map +1 -1
  270. package/dist/components/Alert/Alert.module.cjs.map +1 -1
  271. package/dist/components/Alert/Alert.module.js.map +1 -1
  272. package/dist/components/AppBar/AppBar.cjs.map +1 -1
  273. package/dist/components/AppBar/AppBar.js.map +1 -1
  274. package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
  275. package/dist/components/AppBar/AppBar.module.js.map +1 -1
  276. package/dist/components/AppBar/use-sticky-body-warning.cjs +1 -1
  277. package/dist/components/AppBar/use-sticky-body-warning.cjs.map +1 -1
  278. package/dist/components/AppBar/use-sticky-body-warning.js +1 -1
  279. package/dist/components/AppBar/use-sticky-body-warning.js.map +1 -1
  280. package/dist/components/AppShell/AppShell.cjs.map +1 -1
  281. package/dist/components/AppShell/AppShell.js.map +1 -1
  282. package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
  283. package/dist/components/AppShell/AppShell.module.js.map +1 -1
  284. package/dist/components/AspectRatio/AspectRatio.cjs.map +1 -1
  285. package/dist/components/AspectRatio/AspectRatio.js.map +1 -1
  286. package/dist/components/AspectRatio/AspectRatio.module.cjs.map +1 -1
  287. package/dist/components/AspectRatio/AspectRatio.module.js.map +1 -1
  288. package/dist/components/AudioPlayer/AudioPlayer.cjs +1 -1
  289. package/dist/components/AudioPlayer/AudioPlayer.cjs.map +1 -1
  290. package/dist/components/AudioPlayer/AudioPlayer.js +1 -7
  291. package/dist/components/AudioPlayer/AudioPlayer.js.map +1 -1
  292. package/dist/components/AudioPlayer/AudioPlayer.module.cjs.map +1 -1
  293. package/dist/components/AudioPlayer/AudioPlayer.module.js.map +1 -1
  294. package/dist/components/AudioRecorder/AudioRecorder.cjs +1 -1
  295. package/dist/components/AudioRecorder/AudioRecorder.cjs.map +1 -1
  296. package/dist/components/AudioRecorder/AudioRecorder.js +16 -21
  297. package/dist/components/AudioRecorder/AudioRecorder.js.map +1 -1
  298. package/dist/components/AudioRecorder/AudioRecorder.module.cjs.map +1 -1
  299. package/dist/components/AudioRecorder/AudioRecorder.module.js.map +1 -1
  300. package/dist/components/Avatar/Avatar.cjs.map +1 -1
  301. package/dist/components/Avatar/Avatar.js.map +1 -1
  302. package/dist/components/Avatar/Avatar.module.cjs.map +1 -1
  303. package/dist/components/Avatar/Avatar.module.js.map +1 -1
  304. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  305. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -1
  306. package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -1
  307. package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -1
  308. package/dist/components/Badge/Badge.cjs.map +1 -1
  309. package/dist/components/Badge/Badge.js.map +1 -1
  310. package/dist/components/Badge/Badge.module.cjs.map +1 -1
  311. package/dist/components/Badge/Badge.module.js.map +1 -1
  312. package/dist/components/Banner/Banner.cjs.map +1 -1
  313. package/dist/components/Banner/Banner.js.map +1 -1
  314. package/dist/components/Banner/Banner.module.cjs.map +1 -1
  315. package/dist/components/Banner/Banner.module.js.map +1 -1
  316. package/dist/components/BarList/BarList.cjs.map +1 -1
  317. package/dist/components/BarList/BarList.js.map +1 -1
  318. package/dist/components/BarList/BarList.module.cjs.map +1 -1
  319. package/dist/components/BarList/BarList.module.js.map +1 -1
  320. package/dist/components/BarList/bar-list-model.cjs.map +1 -1
  321. package/dist/components/BarList/bar-list-model.js.map +1 -1
  322. package/dist/components/BarcodeScanner/BarcodeScanner.cjs.map +1 -1
  323. package/dist/components/BarcodeScanner/BarcodeScanner.js.map +1 -1
  324. package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs.map +1 -1
  325. package/dist/components/BarcodeScanner/BarcodeScanner.module.js.map +1 -1
  326. package/dist/components/BottomNavigation/BottomNavigation.cjs.map +1 -1
  327. package/dist/components/BottomNavigation/BottomNavigation.js.map +1 -1
  328. package/dist/components/BottomNavigation/BottomNavigation.module.cjs.map +1 -1
  329. package/dist/components/BottomNavigation/BottomNavigation.module.js.map +1 -1
  330. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  331. package/dist/components/BottomSheet/BottomSheet.js.map +1 -1
  332. package/dist/components/BottomSheet/BottomSheet.module.cjs.map +1 -1
  333. package/dist/components/BottomSheet/BottomSheet.module.js.map +1 -1
  334. package/dist/components/Breadcrumbs/Breadcrumbs.cjs.map +1 -1
  335. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  336. package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs.map +1 -1
  337. package/dist/components/Breadcrumbs/Breadcrumbs.module.js.map +1 -1
  338. package/dist/components/Button/Button.cjs.map +1 -1
  339. package/dist/components/Button/Button.js.map +1 -1
  340. package/dist/components/Button/Button.module.cjs.map +1 -1
  341. package/dist/components/Button/Button.module.js.map +1 -1
  342. package/dist/components/Button/ButtonContent.cjs.map +1 -1
  343. package/dist/components/Button/ButtonContent.js.map +1 -1
  344. package/dist/components/Button/ButtonSlot.cjs.map +1 -1
  345. package/dist/components/Button/ButtonSlot.js.map +1 -1
  346. package/dist/components/Button/button-class.cjs.map +1 -1
  347. package/dist/components/Button/button-class.js.map +1 -1
  348. package/dist/components/Button/link-rel.cjs.map +1 -1
  349. package/dist/components/Button/link-rel.js.map +1 -1
  350. package/dist/components/Button/slot.cjs.map +1 -1
  351. package/dist/components/Button/slot.js.map +1 -1
  352. package/dist/components/Calendar/Calendar.cjs.map +1 -1
  353. package/dist/components/Calendar/Calendar.js.map +1 -1
  354. package/dist/components/Calendar/Calendar.module.cjs.map +1 -1
  355. package/dist/components/Calendar/Calendar.module.js.map +1 -1
  356. package/dist/components/Card/Card.cjs.map +1 -1
  357. package/dist/components/Card/Card.js.map +1 -1
  358. package/dist/components/Card/Card.module.cjs.map +1 -1
  359. package/dist/components/Card/Card.module.js.map +1 -1
  360. package/dist/components/Carousel/Carousel.cjs.map +1 -1
  361. package/dist/components/Carousel/Carousel.js.map +1 -1
  362. package/dist/components/Carousel/Carousel.module.cjs.map +1 -1
  363. package/dist/components/Carousel/Carousel.module.js.map +1 -1
  364. package/dist/components/Center/Center.cjs.map +1 -1
  365. package/dist/components/Center/Center.js.map +1 -1
  366. package/dist/components/Center/Center.module.cjs.map +1 -1
  367. package/dist/components/Center/Center.module.js.map +1 -1
  368. package/dist/components/Chat/Chat.cjs.map +1 -1
  369. package/dist/components/Chat/Chat.js.map +1 -1
  370. package/dist/components/Chat/Chat.module.cjs.map +1 -1
  371. package/dist/components/Chat/Chat.module.js.map +1 -1
  372. package/dist/components/Chat/ChatActionsMenu.cjs.map +1 -1
  373. package/dist/components/Chat/ChatActionsMenu.js.map +1 -1
  374. package/dist/components/Chat/ChatAttachments.cjs.map +1 -1
  375. package/dist/components/Chat/ChatAttachments.js.map +1 -1
  376. package/dist/components/Chat/ChatBubble.cjs.map +1 -1
  377. package/dist/components/Chat/ChatBubble.js.map +1 -1
  378. package/dist/components/Chat/ChatComposer.cjs.map +1 -1
  379. package/dist/components/Chat/ChatComposer.js.map +1 -1
  380. package/dist/components/Chat/chat-groups.cjs +1 -1
  381. package/dist/components/Chat/chat-groups.cjs.map +1 -1
  382. package/dist/components/Chat/chat-groups.js +2 -6
  383. package/dist/components/Chat/chat-groups.js.map +1 -1
  384. package/dist/components/Chat/chat-receipt.cjs.map +1 -1
  385. package/dist/components/Chat/chat-receipt.js.map +1 -1
  386. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  387. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  388. package/dist/components/Checkbox/Checkbox.module.cjs.map +1 -1
  389. package/dist/components/Checkbox/Checkbox.module.js.map +1 -1
  390. package/dist/components/ChipInput/ChipInput.cjs +1 -1
  391. package/dist/components/ChipInput/ChipInput.cjs.map +1 -1
  392. package/dist/components/ChipInput/ChipInput.js +2 -12
  393. package/dist/components/ChipInput/ChipInput.js.map +1 -1
  394. package/dist/components/ChipInput/ChipInput.module.cjs.map +1 -1
  395. package/dist/components/ChipInput/ChipInput.module.js.map +1 -1
  396. package/dist/components/ClickOutside/ClickOutside.cjs.map +1 -1
  397. package/dist/components/ClickOutside/ClickOutside.js.map +1 -1
  398. package/dist/components/CodeBlock/CodeBlock.cjs +1 -1
  399. package/dist/components/CodeBlock/CodeBlock.cjs.map +1 -1
  400. package/dist/components/CodeBlock/CodeBlock.js +1 -1
  401. package/dist/components/CodeBlock/CodeBlock.js.map +1 -1
  402. package/dist/components/CodeBlock/CodeBlock.module.cjs.map +1 -1
  403. package/dist/components/CodeBlock/CodeBlock.module.js.map +1 -1
  404. package/dist/components/CodeBlock/tokenize.cjs +1 -1
  405. package/dist/components/CodeBlock/tokenize.cjs.map +1 -1
  406. package/dist/components/CodeBlock/tokenize.js +54 -25
  407. package/dist/components/CodeBlock/tokenize.js.map +1 -1
  408. package/dist/components/Collapsible/Collapsible.cjs.map +1 -1
  409. package/dist/components/Collapsible/Collapsible.js.map +1 -1
  410. package/dist/components/Collapsible/Collapsible.module.cjs.map +1 -1
  411. package/dist/components/Collapsible/Collapsible.module.js.map +1 -1
  412. package/dist/components/Combobox/Combobox.cjs.map +1 -1
  413. package/dist/components/Combobox/Combobox.js.map +1 -1
  414. package/dist/components/Combobox/Combobox.module.cjs.map +1 -1
  415. package/dist/components/Combobox/Combobox.module.js.map +1 -1
  416. package/dist/components/Combobox/use-listbox-dismiss.cjs.map +1 -1
  417. package/dist/components/Combobox/use-listbox-dismiss.js.map +1 -1
  418. package/dist/components/Command/Command.cjs +1 -1
  419. package/dist/components/Command/Command.cjs.map +1 -1
  420. package/dist/components/Command/Command.js +4 -11
  421. package/dist/components/Command/Command.js.map +1 -1
  422. package/dist/components/Command/Command.module.cjs.map +1 -1
  423. package/dist/components/Command/Command.module.js.map +1 -1
  424. package/dist/components/ConditionalWrapper/ConditionalWrapper.cjs.map +1 -1
  425. package/dist/components/ConditionalWrapper/ConditionalWrapper.js.map +1 -1
  426. package/dist/components/ConfirmDialog/ConfirmDialog.cjs.map +1 -1
  427. package/dist/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
  428. package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
  429. package/dist/components/ContextMenu/ContextMenu.cjs.map +1 -1
  430. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  431. package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
  432. package/dist/components/ContextMenu/ContextMenu.module.cjs.map +1 -1
  433. package/dist/components/ContextMenu/ContextMenu.module.js.map +1 -1
  434. package/dist/components/CopyButton/CopyButton.cjs.map +1 -1
  435. package/dist/components/CopyButton/CopyButton.js.map +1 -1
  436. package/dist/components/CopyButton/CopyButton.module.cjs.map +1 -1
  437. package/dist/components/CopyButton/CopyButton.module.js.map +1 -1
  438. package/dist/components/DataList/DataList.cjs.map +1 -1
  439. package/dist/components/DataList/DataList.js.map +1 -1
  440. package/dist/components/DataList/DataList.module.cjs.map +1 -1
  441. package/dist/components/DataList/DataList.module.js.map +1 -1
  442. package/dist/components/DataTable/DataTable.cjs +1 -1
  443. package/dist/components/DataTable/DataTable.cjs.map +1 -1
  444. package/dist/components/DataTable/DataTable.js +6 -14
  445. package/dist/components/DataTable/DataTable.js.map +1 -1
  446. package/dist/components/DataTable/DataTable.module.cjs.map +1 -1
  447. package/dist/components/DataTable/DataTable.module.js.map +1 -1
  448. package/dist/components/DataTable/EditableCell.cjs +1 -1
  449. package/dist/components/DataTable/EditableCell.cjs.map +1 -1
  450. package/dist/components/DataTable/EditableCell.js +1 -9
  451. package/dist/components/DataTable/EditableCell.js.map +1 -1
  452. package/dist/components/DataTable/LoadingRows.cjs.map +1 -1
  453. package/dist/components/DataTable/LoadingRows.js.map +1 -1
  454. package/dist/components/DataTable/edit-labels.cjs.map +1 -1
  455. package/dist/components/DataTable/edit-labels.js.map +1 -1
  456. package/dist/components/DataTable/use-dev-warnings.cjs.map +1 -1
  457. package/dist/components/DataTable/use-dev-warnings.js.map +1 -1
  458. package/dist/components/DatePicker/DatePicker.cjs.map +1 -1
  459. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  460. package/dist/components/DateRangePicker/DateRangePicker.cjs.map +1 -1
  461. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  462. package/dist/components/DateRangePicker/DateRangePicker.module.cjs.map +1 -1
  463. package/dist/components/DateRangePicker/DateRangePicker.module.js.map +1 -1
  464. package/dist/components/DescriptionList/DescriptionList.cjs.map +1 -1
  465. package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
  466. package/dist/components/DescriptionList/DescriptionList.module.cjs.map +1 -1
  467. package/dist/components/DescriptionList/DescriptionList.module.js.map +1 -1
  468. package/dist/components/Divider/Divider.cjs.map +1 -1
  469. package/dist/components/Divider/Divider.js.map +1 -1
  470. package/dist/components/Divider/Divider.module.cjs.map +1 -1
  471. package/dist/components/Divider/Divider.module.js.map +1 -1
  472. package/dist/components/Drawer/Drawer.cjs.map +1 -1
  473. package/dist/components/Drawer/Drawer.js.map +1 -1
  474. package/dist/components/Drawer/Drawer.module.cjs.map +1 -1
  475. package/dist/components/Drawer/Drawer.module.js.map +1 -1
  476. package/dist/components/DropdownMenu/DropdownMenu.cjs +1 -1
  477. package/dist/components/DropdownMenu/DropdownMenu.cjs.map +1 -1
  478. package/dist/components/DropdownMenu/DropdownMenu.js +2 -14
  479. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
  480. package/dist/components/DropdownMenu/DropdownMenu.module.cjs.map +1 -1
  481. package/dist/components/DropdownMenu/DropdownMenu.module.js.map +1 -1
  482. package/dist/components/Dropzone/Dropzone.cjs.map +1 -1
  483. package/dist/components/Dropzone/Dropzone.js.map +1 -1
  484. package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
  485. package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
  486. package/dist/components/EmptyState/EmptyState.cjs.map +1 -1
  487. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  488. package/dist/components/EmptyState/EmptyState.module.cjs.map +1 -1
  489. package/dist/components/EmptyState/EmptyState.module.js.map +1 -1
  490. package/dist/components/ErrorState/ErrorState.cjs.map +1 -1
  491. package/dist/components/ErrorState/ErrorState.js.map +1 -1
  492. package/dist/components/ErrorState/ErrorState.module.cjs.map +1 -1
  493. package/dist/components/ErrorState/ErrorState.module.js.map +1 -1
  494. package/dist/components/ErrorText/ErrorText.cjs.map +1 -1
  495. package/dist/components/ErrorText/ErrorText.js.map +1 -1
  496. package/dist/components/ErrorText/ErrorText.module.cjs.map +1 -1
  497. package/dist/components/ErrorText/ErrorText.module.js.map +1 -1
  498. package/dist/components/FileUpload/FileUpload.cjs +1 -1
  499. package/dist/components/FileUpload/FileUpload.cjs.map +1 -1
  500. package/dist/components/FileUpload/FileUpload.js +7 -17
  501. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  502. package/dist/components/FileUpload/FileUpload.module.cjs.map +1 -1
  503. package/dist/components/FileUpload/FileUpload.module.js.map +1 -1
  504. package/dist/components/FilterBar/FilterBar.cjs.map +1 -1
  505. package/dist/components/FilterBar/FilterBar.js.map +1 -1
  506. package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
  507. package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
  508. package/dist/components/FilterBar/filter-apply.cjs.map +1 -1
  509. package/dist/components/FilterBar/filter-apply.js.map +1 -1
  510. package/dist/components/FilterBar/filter-model.cjs.map +1 -1
  511. package/dist/components/FilterBar/filter-model.js.map +1 -1
  512. package/dist/components/FilterBar/filter-query.cjs +1 -1
  513. package/dist/components/FilterBar/filter-query.cjs.map +1 -1
  514. package/dist/components/FilterBar/filter-query.js +2 -5
  515. package/dist/components/FilterBar/filter-query.js.map +1 -1
  516. package/dist/components/FilterPanel/FilterPanel.cjs.map +1 -1
  517. package/dist/components/FilterPanel/FilterPanel.js.map +1 -1
  518. package/dist/components/FilterPanel/FilterPanel.module.cjs.map +1 -1
  519. package/dist/components/FilterPanel/FilterPanel.module.js.map +1 -1
  520. package/dist/components/FloatingActionButton/FloatingActionButton.cjs.map +1 -1
  521. package/dist/components/FloatingActionButton/FloatingActionButton.js.map +1 -1
  522. package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
  523. package/dist/components/FloatingActionButton/FloatingActionButton.module.js.map +1 -1
  524. package/dist/components/For/For.cjs.map +1 -1
  525. package/dist/components/For/For.js.map +1 -1
  526. package/dist/components/Form/Form.cjs.map +1 -1
  527. package/dist/components/Form/Form.js.map +1 -1
  528. package/dist/components/Form/Form.module.cjs.map +1 -1
  529. package/dist/components/Form/Form.module.js.map +1 -1
  530. package/dist/components/HoverCard/HoverCard.cjs.map +1 -1
  531. package/dist/components/HoverCard/HoverCard.js.map +1 -1
  532. package/dist/components/HoverCard/HoverCard.module.cjs.map +1 -1
  533. package/dist/components/HoverCard/HoverCard.module.js.map +1 -1
  534. package/dist/components/Image/Image.cjs.map +1 -1
  535. package/dist/components/Image/Image.js.map +1 -1
  536. package/dist/components/Image/Image.module.cjs.map +1 -1
  537. package/dist/components/Image/Image.module.js.map +1 -1
  538. package/dist/components/ImageCropper/ImageCropper.cjs +1 -1
  539. package/dist/components/ImageCropper/ImageCropper.cjs.map +1 -1
  540. package/dist/components/ImageCropper/ImageCropper.js +4 -8
  541. package/dist/components/ImageCropper/ImageCropper.js.map +1 -1
  542. package/dist/components/ImageCropper/ImageCropper.module.cjs.map +1 -1
  543. package/dist/components/ImageCropper/ImageCropper.module.js.map +1 -1
  544. package/dist/components/ImageCropper/crop-geometry.cjs.map +1 -1
  545. package/dist/components/ImageCropper/crop-geometry.js.map +1 -1
  546. package/dist/components/Input/Input.cjs.map +1 -1
  547. package/dist/components/Input/Input.js.map +1 -1
  548. package/dist/components/Input/Input.module.cjs.map +1 -1
  549. package/dist/components/Input/Input.module.js.map +1 -1
  550. package/dist/components/InstallBanner/InstallBanner.cjs.map +1 -1
  551. package/dist/components/InstallBanner/InstallBanner.js.map +1 -1
  552. package/dist/components/InstallBanner/InstallBanner.module.cjs.map +1 -1
  553. package/dist/components/InstallBanner/InstallBanner.module.js.map +1 -1
  554. package/dist/components/InstallButton/InstallButton.cjs.map +1 -1
  555. package/dist/components/InstallButton/InstallButton.js.map +1 -1
  556. package/dist/components/InstallButton/InstallButton.module.cjs.map +1 -1
  557. package/dist/components/InstallButton/InstallButton.module.js.map +1 -1
  558. package/dist/components/InstallButton/install-hints.cjs.map +1 -1
  559. package/dist/components/InstallButton/install-hints.js.map +1 -1
  560. package/dist/components/Kanban/Kanban.cjs.map +1 -1
  561. package/dist/components/Kanban/Kanban.js.map +1 -1
  562. package/dist/components/Kanban/Kanban.module.cjs.map +1 -1
  563. package/dist/components/Kanban/Kanban.module.js.map +1 -1
  564. package/dist/components/Kbd/Kbd.cjs.map +1 -1
  565. package/dist/components/Kbd/Kbd.js.map +1 -1
  566. package/dist/components/Kbd/Kbd.module.cjs.map +1 -1
  567. package/dist/components/Kbd/Kbd.module.js.map +1 -1
  568. package/dist/components/Label/Label.cjs.map +1 -1
  569. package/dist/components/Label/Label.js.map +1 -1
  570. package/dist/components/Label/Label.module.cjs.map +1 -1
  571. package/dist/components/Label/Label.module.js.map +1 -1
  572. package/dist/components/Layout/Layout.cjs.map +1 -1
  573. package/dist/components/Layout/Layout.js.map +1 -1
  574. package/dist/components/Layout/Layout.module.cjs.map +1 -1
  575. package/dist/components/Layout/Layout.module.js.map +1 -1
  576. package/dist/components/Lightbox/Lightbox.cjs +1 -1
  577. package/dist/components/Lightbox/Lightbox.cjs.map +1 -1
  578. package/dist/components/Lightbox/Lightbox.js +1 -1
  579. package/dist/components/Lightbox/Lightbox.js.map +1 -1
  580. package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -1
  581. package/dist/components/Lightbox/Lightbox.module.js.map +1 -1
  582. package/dist/components/ListTile/ListTile.cjs.map +1 -1
  583. package/dist/components/ListTile/ListTile.js.map +1 -1
  584. package/dist/components/ListTile/ListTile.module.cjs.map +1 -1
  585. package/dist/components/ListTile/ListTile.module.js.map +1 -1
  586. package/dist/components/Markdown/Markdown.cjs.map +1 -1
  587. package/dist/components/Markdown/Markdown.js.map +1 -1
  588. package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
  589. package/dist/components/Markdown/Markdown.module.js.map +1 -1
  590. package/dist/components/Markdown/markdown-parse.cjs +6 -6
  591. package/dist/components/Markdown/markdown-parse.cjs.map +1 -1
  592. package/dist/components/Markdown/markdown-parse.js +94 -96
  593. package/dist/components/Markdown/markdown-parse.js.map +1 -1
  594. package/dist/components/Masonry/Masonry.cjs.map +1 -1
  595. package/dist/components/Masonry/Masonry.js.map +1 -1
  596. package/dist/components/Masonry/Masonry.module.cjs.map +1 -1
  597. package/dist/components/Masonry/Masonry.module.js.map +1 -1
  598. package/dist/components/Masonry/masonry-layout.cjs.map +1 -1
  599. package/dist/components/Masonry/masonry-layout.js.map +1 -1
  600. package/dist/components/Menubar/Menubar.cjs.map +1 -1
  601. package/dist/components/Menubar/Menubar.js.map +1 -1
  602. package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
  603. package/dist/components/Menubar/Menubar.module.js.map +1 -1
  604. package/dist/components/Modal/Modal.cjs.map +1 -1
  605. package/dist/components/Modal/Modal.js.map +1 -1
  606. package/dist/components/Modal/Modal.module.cjs.map +1 -1
  607. package/dist/components/Modal/Modal.module.js.map +1 -1
  608. package/dist/components/ModalsManager/ModalsManager.cjs.map +1 -1
  609. package/dist/components/ModalsManager/ModalsManager.js.map +1 -1
  610. package/dist/components/ModalsManager/ModalsManager.module.cjs.map +1 -1
  611. package/dist/components/ModalsManager/ModalsManager.module.js.map +1 -1
  612. package/dist/components/Money/Money.cjs.map +1 -1
  613. package/dist/components/Money/Money.js.map +1 -1
  614. package/dist/components/MultiSelect/MultiSelect.cjs.map +1 -1
  615. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  616. package/dist/components/MultiSelect/MultiSelect.module.cjs.map +1 -1
  617. package/dist/components/MultiSelect/MultiSelect.module.js.map +1 -1
  618. package/dist/components/NProgress/NProgress.cjs.map +1 -1
  619. package/dist/components/NProgress/NProgress.js.map +1 -1
  620. package/dist/components/NProgress/NProgress.module.cjs.map +1 -1
  621. package/dist/components/NProgress/NProgress.module.js.map +1 -1
  622. package/dist/components/Navbar/Navbar.cjs.map +1 -1
  623. package/dist/components/Navbar/Navbar.js.map +1 -1
  624. package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
  625. package/dist/components/Navbar/Navbar.module.js.map +1 -1
  626. package/dist/components/NavigationMenu/NavigationMenu.cjs.map +1 -1
  627. package/dist/components/NavigationMenu/NavigationMenu.js.map +1 -1
  628. package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
  629. package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
  630. package/dist/components/NavigationRail/NavigationRail.cjs.map +1 -1
  631. package/dist/components/NavigationRail/NavigationRail.js.map +1 -1
  632. package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
  633. package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
  634. package/dist/components/NotificationCenter/NotificationCenter.cjs.map +1 -1
  635. package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -1
  636. package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
  637. package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -1
  638. package/dist/components/NotificationCenter/use-notification-inbox.cjs.map +1 -1
  639. package/dist/components/NotificationCenter/use-notification-inbox.js.map +1 -1
  640. package/dist/components/OfflineIndicator/OfflineIndicator.cjs.map +1 -1
  641. package/dist/components/OfflineIndicator/OfflineIndicator.js.map +1 -1
  642. package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs.map +1 -1
  643. package/dist/components/OfflineIndicator/OfflineIndicator.module.js.map +1 -1
  644. package/dist/components/Page/Page.cjs.map +1 -1
  645. package/dist/components/Page/Page.js.map +1 -1
  646. package/dist/components/Page/Page.module.cjs.map +1 -1
  647. package/dist/components/Page/Page.module.js.map +1 -1
  648. package/dist/components/Pagination/Pagination.cjs.map +1 -1
  649. package/dist/components/Pagination/Pagination.js.map +1 -1
  650. package/dist/components/Pagination/Pagination.module.cjs.map +1 -1
  651. package/dist/components/Pagination/Pagination.module.js.map +1 -1
  652. package/dist/components/PasswordInput/PasswordInput.cjs.map +1 -1
  653. package/dist/components/PasswordInput/PasswordInput.js.map +1 -1
  654. package/dist/components/PasswordInput/PasswordInput.module.cjs.map +1 -1
  655. package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
  656. package/dist/components/PinInput/PinInput.cjs.map +1 -1
  657. package/dist/components/PinInput/PinInput.js.map +1 -1
  658. package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
  659. package/dist/components/PinInput/PinInput.module.js.map +1 -1
  660. package/dist/components/Popover/Popover.cjs.map +1 -1
  661. package/dist/components/Popover/Popover.js.map +1 -1
  662. package/dist/components/Popover/Popover.module.cjs.map +1 -1
  663. package/dist/components/Popover/Popover.module.js.map +1 -1
  664. package/dist/components/Portal/Portal.cjs.map +1 -1
  665. package/dist/components/Portal/Portal.js.map +1 -1
  666. package/dist/components/Portal/anchor-position.cjs.map +1 -1
  667. package/dist/components/Portal/anchor-position.js.map +1 -1
  668. package/dist/components/Portal/escape-layer.cjs.map +1 -1
  669. package/dist/components/Portal/escape-layer.js.map +1 -1
  670. package/dist/components/Portal/portal-host.cjs.map +1 -1
  671. package/dist/components/Portal/portal-host.js.map +1 -1
  672. package/dist/components/Portal/tab-bridge.cjs +1 -1
  673. package/dist/components/Portal/tab-bridge.cjs.map +1 -1
  674. package/dist/components/Portal/tab-bridge.js +1 -5
  675. package/dist/components/Portal/tab-bridge.js.map +1 -1
  676. package/dist/components/Progress/Progress.cjs.map +1 -1
  677. package/dist/components/Progress/Progress.js.map +1 -1
  678. package/dist/components/Progress/Progress.module.cjs.map +1 -1
  679. package/dist/components/Progress/Progress.module.js.map +1 -1
  680. package/dist/components/QRCode/QRCode.cjs.map +1 -1
  681. package/dist/components/QRCode/QRCode.js.map +1 -1
  682. package/dist/components/QRCode/QRCode.module.cjs.map +1 -1
  683. package/dist/components/QRCode/QRCode.module.js.map +1 -1
  684. package/dist/components/QRCode/qr-encode.cjs +1 -1
  685. package/dist/components/QRCode/qr-encode.cjs.map +1 -1
  686. package/dist/components/QRCode/qr-encode.js +7 -13
  687. package/dist/components/QRCode/qr-encode.js.map +1 -1
  688. package/dist/components/QRCode/qr-tables.cjs.map +1 -1
  689. package/dist/components/QRCode/qr-tables.js.map +1 -1
  690. package/dist/components/Radio/Radio.cjs.map +1 -1
  691. package/dist/components/Radio/Radio.js.map +1 -1
  692. package/dist/components/Radio/Radio.module.cjs.map +1 -1
  693. package/dist/components/Radio/Radio.module.js.map +1 -1
  694. package/dist/components/RangeSlider/RangeSlider.cjs.map +1 -1
  695. package/dist/components/RangeSlider/RangeSlider.js.map +1 -1
  696. package/dist/components/RangeSlider/RangeSlider.module.cjs.map +1 -1
  697. package/dist/components/RangeSlider/RangeSlider.module.js.map +1 -1
  698. package/dist/components/RatingStars/RatingStars.cjs.map +1 -1
  699. package/dist/components/RatingStars/RatingStars.js.map +1 -1
  700. package/dist/components/RatingStars/RatingStars.module.cjs.map +1 -1
  701. package/dist/components/RatingStars/RatingStars.module.js.map +1 -1
  702. package/dist/components/RefreshIndicator/RefreshIndicator.cjs +1 -1
  703. package/dist/components/RefreshIndicator/RefreshIndicator.cjs.map +1 -1
  704. package/dist/components/RefreshIndicator/RefreshIndicator.js +10 -18
  705. package/dist/components/RefreshIndicator/RefreshIndicator.js.map +1 -1
  706. package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs.map +1 -1
  707. package/dist/components/RefreshIndicator/RefreshIndicator.module.js.map +1 -1
  708. package/dist/components/RelativeTime/RelativeTime.cjs.map +1 -1
  709. package/dist/components/RelativeTime/RelativeTime.js.map +1 -1
  710. package/dist/components/Resizable/Resizable.cjs +1 -1
  711. package/dist/components/Resizable/Resizable.cjs.map +1 -1
  712. package/dist/components/Resizable/Resizable.js +1 -9
  713. package/dist/components/Resizable/Resizable.js.map +1 -1
  714. package/dist/components/Resizable/Resizable.module.cjs.map +1 -1
  715. package/dist/components/Resizable/Resizable.module.js.map +1 -1
  716. package/dist/components/Responsive/Responsive.cjs.map +1 -1
  717. package/dist/components/Responsive/Responsive.js.map +1 -1
  718. package/dist/components/Reveal/Reveal.cjs.map +1 -1
  719. package/dist/components/Reveal/Reveal.js.map +1 -1
  720. package/dist/components/Reveal/Reveal.module.cjs.map +1 -1
  721. package/dist/components/Reveal/Reveal.module.js.map +1 -1
  722. package/dist/components/Reveal/reveal-threshold.cjs.map +1 -1
  723. package/dist/components/Reveal/reveal-threshold.js.map +1 -1
  724. package/dist/components/SafeArea/SafeArea.cjs.map +1 -1
  725. package/dist/components/SafeArea/SafeArea.js.map +1 -1
  726. package/dist/components/SafeArea/SafeArea.module.cjs.map +1 -1
  727. package/dist/components/SafeArea/SafeArea.module.js.map +1 -1
  728. package/dist/components/Scheduler/Scheduler.cjs.map +1 -1
  729. package/dist/components/Scheduler/Scheduler.js.map +1 -1
  730. package/dist/components/Scheduler/Scheduler.module.cjs.map +1 -1
  731. package/dist/components/Scheduler/Scheduler.module.js.map +1 -1
  732. package/dist/components/Scheduler/scheduler-layout.cjs.map +1 -1
  733. package/dist/components/Scheduler/scheduler-layout.js.map +1 -1
  734. package/dist/components/ScrollArea/ScrollArea.cjs.map +1 -1
  735. package/dist/components/ScrollArea/ScrollArea.js.map +1 -1
  736. package/dist/components/ScrollArea/ScrollArea.module.cjs.map +1 -1
  737. package/dist/components/ScrollArea/ScrollArea.module.js.map +1 -1
  738. package/dist/components/SearchBar/SearchBar.cjs.map +1 -1
  739. package/dist/components/SearchBar/SearchBar.js.map +1 -1
  740. package/dist/components/SearchBar/SearchBar.module.cjs.map +1 -1
  741. package/dist/components/SearchBar/SearchBar.module.js.map +1 -1
  742. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  743. package/dist/components/SectionHeader/SectionHeader.js.map +1 -1
  744. package/dist/components/SectionHeader/SectionHeader.module.cjs.map +1 -1
  745. package/dist/components/SectionHeader/SectionHeader.module.js.map +1 -1
  746. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  747. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
  748. package/dist/components/SegmentedControl/SegmentedControl.module.cjs.map +1 -1
  749. package/dist/components/SegmentedControl/SegmentedControl.module.js.map +1 -1
  750. package/dist/components/Select/CaretIcon.cjs.map +1 -1
  751. package/dist/components/Select/CaretIcon.js.map +1 -1
  752. package/dist/components/Select/Select.cjs.map +1 -1
  753. package/dist/components/Select/Select.js.map +1 -1
  754. package/dist/components/Select/Select.module.cjs.map +1 -1
  755. package/dist/components/Select/Select.module.js.map +1 -1
  756. package/dist/components/Select/options.cjs.map +1 -1
  757. package/dist/components/Select/options.js.map +1 -1
  758. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  759. package/dist/components/Sidebar/Sidebar.cjs.map +1 -1
  760. package/dist/components/Sidebar/Sidebar.js +13 -23
  761. package/dist/components/Sidebar/Sidebar.js.map +1 -1
  762. package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
  763. package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
  764. package/dist/components/Sidebar/SidebarEntry.cjs.map +1 -1
  765. package/dist/components/Sidebar/SidebarEntry.js.map +1 -1
  766. package/dist/components/Sidebar/active-nav-key.cjs.map +1 -1
  767. package/dist/components/Sidebar/active-nav-key.js.map +1 -1
  768. package/dist/components/SignaturePad/SignaturePad.cjs +1 -1
  769. package/dist/components/SignaturePad/SignaturePad.cjs.map +1 -1
  770. package/dist/components/SignaturePad/SignaturePad.js +1 -5
  771. package/dist/components/SignaturePad/SignaturePad.js.map +1 -1
  772. package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -1
  773. package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -1
  774. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  775. package/dist/components/Skeleton/Skeleton.js.map +1 -1
  776. package/dist/components/Skeleton/Skeleton.module.cjs.map +1 -1
  777. package/dist/components/Skeleton/Skeleton.module.js.map +1 -1
  778. package/dist/components/Slider/Slider.cjs.map +1 -1
  779. package/dist/components/Slider/Slider.js.map +1 -1
  780. package/dist/components/Slider/Slider.module.cjs.map +1 -1
  781. package/dist/components/Slider/Slider.module.js.map +1 -1
  782. package/dist/components/Spacer/Spacer.cjs.map +1 -1
  783. package/dist/components/Spacer/Spacer.js.map +1 -1
  784. package/dist/components/Spacer/Spacer.module.cjs.map +1 -1
  785. package/dist/components/Spacer/Spacer.module.js.map +1 -1
  786. package/dist/components/Sparkline/Sparkline.cjs.map +1 -1
  787. package/dist/components/Sparkline/Sparkline.js.map +1 -1
  788. package/dist/components/Sparkline/Sparkline.module.cjs.map +1 -1
  789. package/dist/components/Sparkline/Sparkline.module.js.map +1 -1
  790. package/dist/components/Sparkline/sparkline-geometry.cjs.map +1 -1
  791. package/dist/components/Sparkline/sparkline-geometry.js.map +1 -1
  792. package/dist/components/Spinner/Spinner.cjs.map +1 -1
  793. package/dist/components/Spinner/Spinner.js.map +1 -1
  794. package/dist/components/Spinner/Spinner.module.cjs.map +1 -1
  795. package/dist/components/Spinner/Spinner.module.js.map +1 -1
  796. package/dist/components/Stat/Stat.cjs.map +1 -1
  797. package/dist/components/Stat/Stat.js.map +1 -1
  798. package/dist/components/Stat/Stat.module.cjs.map +1 -1
  799. package/dist/components/Stat/Stat.module.js.map +1 -1
  800. package/dist/components/Stepper/Stepper.cjs.map +1 -1
  801. package/dist/components/Stepper/Stepper.js.map +1 -1
  802. package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
  803. package/dist/components/Stepper/Stepper.module.js.map +1 -1
  804. package/dist/components/StepperInput/StepperInput.cjs.map +1 -1
  805. package/dist/components/StepperInput/StepperInput.js.map +1 -1
  806. package/dist/components/StepperInput/StepperInput.module.cjs.map +1 -1
  807. package/dist/components/StepperInput/StepperInput.module.js.map +1 -1
  808. package/dist/components/Switch/Switch.cjs.map +1 -1
  809. package/dist/components/Switch/Switch.js.map +1 -1
  810. package/dist/components/Switch/Switch.module.cjs.map +1 -1
  811. package/dist/components/Switch/Switch.module.js.map +1 -1
  812. package/dist/components/SyncStatusBadge/SyncStatusBadge.cjs.map +1 -1
  813. package/dist/components/SyncStatusBadge/SyncStatusBadge.js.map +1 -1
  814. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs.map +1 -1
  815. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js.map +1 -1
  816. package/dist/components/Table/Table.cjs.map +1 -1
  817. package/dist/components/Table/Table.js.map +1 -1
  818. package/dist/components/Table/Table.module.cjs.map +1 -1
  819. package/dist/components/Table/Table.module.js.map +1 -1
  820. package/dist/components/Tabs/Tabs.cjs.map +1 -1
  821. package/dist/components/Tabs/Tabs.js.map +1 -1
  822. package/dist/components/Tabs/Tabs.module.cjs.map +1 -1
  823. package/dist/components/Tabs/Tabs.module.js.map +1 -1
  824. package/dist/components/Tag/Tag.cjs.map +1 -1
  825. package/dist/components/Tag/Tag.js.map +1 -1
  826. package/dist/components/Tag/Tag.module.cjs.map +1 -1
  827. package/dist/components/Tag/Tag.module.js.map +1 -1
  828. package/dist/components/Textarea/Textarea.cjs.map +1 -1
  829. package/dist/components/Textarea/Textarea.js.map +1 -1
  830. package/dist/components/Textarea/Textarea.module.cjs.map +1 -1
  831. package/dist/components/Textarea/Textarea.module.js.map +1 -1
  832. package/dist/components/TimePicker/TimePicker.cjs.map +1 -1
  833. package/dist/components/TimePicker/TimePicker.js.map +1 -1
  834. package/dist/components/TimePicker/TimePicker.module.cjs.map +1 -1
  835. package/dist/components/TimePicker/TimePicker.module.js.map +1 -1
  836. package/dist/components/Timeline/Timeline.cjs.map +1 -1
  837. package/dist/components/Timeline/Timeline.js.map +1 -1
  838. package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
  839. package/dist/components/Timeline/Timeline.module.js.map +1 -1
  840. package/dist/components/Toast/Toast.module.cjs.map +1 -1
  841. package/dist/components/Toast/Toast.module.js.map +1 -1
  842. package/dist/components/Toast/ToastProvider.cjs.map +1 -1
  843. package/dist/components/Toast/ToastProvider.js.map +1 -1
  844. package/dist/components/Toggle/Toggle.cjs.map +1 -1
  845. package/dist/components/Toggle/Toggle.js.map +1 -1
  846. package/dist/components/Toggle/Toggle.module.cjs.map +1 -1
  847. package/dist/components/Toggle/Toggle.module.js.map +1 -1
  848. package/dist/components/ToggleGroup/ToggleGroup.cjs.map +1 -1
  849. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
  850. package/dist/components/ToggleGroup/ToggleGroup.module.cjs.map +1 -1
  851. package/dist/components/ToggleGroup/ToggleGroup.module.js.map +1 -1
  852. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  853. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  854. package/dist/components/Tooltip/Tooltip.module.cjs.map +1 -1
  855. package/dist/components/Tooltip/Tooltip.module.js.map +1 -1
  856. package/dist/components/Tour/Tour.cjs +1 -1
  857. package/dist/components/Tour/Tour.cjs.map +1 -1
  858. package/dist/components/Tour/Tour.js +1 -5
  859. package/dist/components/Tour/Tour.js.map +1 -1
  860. package/dist/components/Tour/Tour.module.cjs.map +1 -1
  861. package/dist/components/Tour/Tour.module.js.map +1 -1
  862. package/dist/components/Tour/tour-position.cjs.map +1 -1
  863. package/dist/components/Tour/tour-position.js.map +1 -1
  864. package/dist/components/Transfer/Transfer.cjs.map +1 -1
  865. package/dist/components/Transfer/Transfer.js.map +1 -1
  866. package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
  867. package/dist/components/Transfer/Transfer.module.js.map +1 -1
  868. package/dist/components/Transfer/transfer-state.cjs.map +1 -1
  869. package/dist/components/Transfer/transfer-state.js.map +1 -1
  870. package/dist/components/TreeView/TreeView.cjs.map +1 -1
  871. package/dist/components/TreeView/TreeView.js.map +1 -1
  872. package/dist/components/TreeView/TreeView.module.cjs.map +1 -1
  873. package/dist/components/TreeView/TreeView.module.js.map +1 -1
  874. package/dist/components/TruncateText/TruncateText.cjs.map +1 -1
  875. package/dist/components/TruncateText/TruncateText.js.map +1 -1
  876. package/dist/components/TruncateText/TruncateText.module.cjs.map +1 -1
  877. package/dist/components/TruncateText/TruncateText.module.js.map +1 -1
  878. package/dist/components/UpdatePrompt/UpdatePrompt.cjs.map +1 -1
  879. package/dist/components/UpdatePrompt/UpdatePrompt.js.map +1 -1
  880. package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs.map +1 -1
  881. package/dist/components/UpdatePrompt/UpdatePrompt.module.js.map +1 -1
  882. package/dist/components/VideoPlayer/VideoPlayer.cjs +1 -1
  883. package/dist/components/VideoPlayer/VideoPlayer.cjs.map +1 -1
  884. package/dist/components/VideoPlayer/VideoPlayer.js +1 -7
  885. package/dist/components/VideoPlayer/VideoPlayer.js.map +1 -1
  886. package/dist/components/VideoPlayer/VideoPlayer.module.cjs.map +1 -1
  887. package/dist/components/VideoPlayer/VideoPlayer.module.js.map +1 -1
  888. package/dist/components/VideoPlayer/playback-rates.cjs.map +1 -1
  889. package/dist/components/VideoPlayer/playback-rates.js.map +1 -1
  890. package/dist/components/VirtualList/VirtualList.cjs.map +1 -1
  891. package/dist/components/VirtualList/VirtualList.js.map +1 -1
  892. package/dist/components/VirtualList/VirtualList.module.cjs.map +1 -1
  893. package/dist/components/VirtualList/VirtualList.module.js.map +1 -1
  894. package/dist/components/VirtualTable/VirtualTable.cjs.map +1 -1
  895. package/dist/components/VirtualTable/VirtualTable.js.map +1 -1
  896. package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
  897. package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
  898. package/dist/components/VisuallyHidden/VisuallyHidden.cjs.map +1 -1
  899. package/dist/components/VisuallyHidden/VisuallyHidden.js.map +1 -1
  900. package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs.map +1 -1
  901. package/dist/components/VisuallyHidden/VisuallyHidden.module.js.map +1 -1
  902. package/dist/components/Wizard/Wizard.cjs +1 -1
  903. package/dist/components/Wizard/Wizard.cjs.map +1 -1
  904. package/dist/components/Wizard/Wizard.js +4 -11
  905. package/dist/components/Wizard/Wizard.js.map +1 -1
  906. package/dist/components/Wizard/Wizard.module.cjs.map +1 -1
  907. package/dist/components/Wizard/Wizard.module.js.map +1 -1
  908. package/dist/data/create-data-provider.cjs.map +1 -1
  909. package/dist/data/create-data-provider.js.map +1 -1
  910. package/dist/data/data-provider-context.cjs.map +1 -1
  911. package/dist/data/data-provider-context.js.map +1 -1
  912. package/dist/data/use-resource.cjs.map +1 -1
  913. package/dist/data/use-resource.js.map +1 -1
  914. package/dist/editor/RichTextEditor.cjs.map +1 -1
  915. package/dist/editor/RichTextEditor.js.map +1 -1
  916. package/dist/editor/RichTextEditor.module.cjs.map +1 -1
  917. package/dist/editor/RichTextEditor.module.js.map +1 -1
  918. package/dist/editor.js +1 -2
  919. package/dist/error-boundary/ErrorBoundary.cjs.map +1 -1
  920. package/dist/error-boundary/ErrorBoundary.js.map +1 -1
  921. package/dist/error-boundary/use-error-handler.cjs.map +1 -1
  922. package/dist/error-boundary/use-error-handler.js.map +1 -1
  923. package/dist/feature-flags/FeatureFlagsProvider.cjs.map +1 -1
  924. package/dist/feature-flags/FeatureFlagsProvider.js.map +1 -1
  925. package/dist/feature-flags/growthbook-adapter.cjs.map +1 -1
  926. package/dist/feature-flags/growthbook-adapter.js.map +1 -1
  927. package/dist/feature-flags/in-memory-adapter.cjs.map +1 -1
  928. package/dist/feature-flags/in-memory-adapter.js.map +1 -1
  929. package/dist/feature-flags/launchdarkly-adapter.cjs.map +1 -1
  930. package/dist/feature-flags/launchdarkly-adapter.js.map +1 -1
  931. package/dist/forms/FormField.cjs.map +1 -1
  932. package/dist/forms/FormField.js.map +1 -1
  933. package/dist/forms/br-validators.cjs.map +1 -1
  934. package/dist/forms/br-validators.js.map +1 -1
  935. package/dist/forms/masked-inputs.cjs.map +1 -1
  936. package/dist/forms/masked-inputs.js.map +1 -1
  937. package/dist/forms/use-viacep.cjs.map +1 -1
  938. package/dist/forms/use-viacep.js.map +1 -1
  939. package/dist/forms/use-zod-form.cjs.map +1 -1
  940. package/dist/forms/use-zod-form.js.map +1 -1
  941. package/dist/forms/validate-form.cjs.map +1 -1
  942. package/dist/forms/validate-form.js.map +1 -1
  943. package/dist/forms/zod-resolver.cjs.map +1 -1
  944. package/dist/forms/zod-resolver.js.map +1 -1
  945. package/dist/geo/TrajectoryMap.cjs.map +1 -1
  946. package/dist/geo/TrajectoryMap.js.map +1 -1
  947. package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
  948. package/dist/geo/TrajectoryMap.module.js.map +1 -1
  949. package/dist/geo/bounds.cjs.map +1 -1
  950. package/dist/geo/bounds.js.map +1 -1
  951. package/dist/geo/create-position-tracker.cjs +1 -1
  952. package/dist/geo/create-position-tracker.cjs.map +1 -1
  953. package/dist/geo/create-position-tracker.js +1 -7
  954. package/dist/geo/create-position-tracker.js.map +1 -1
  955. package/dist/geo/distance.cjs.map +1 -1
  956. package/dist/geo/distance.js.map +1 -1
  957. package/dist/geo/estimate.cjs.map +1 -1
  958. package/dist/geo/estimate.js.map +1 -1
  959. package/dist/geo/leaflet-map.cjs.map +1 -1
  960. package/dist/geo/leaflet-map.js.map +1 -1
  961. package/dist/geo/projection.cjs.map +1 -1
  962. package/dist/geo/projection.js.map +1 -1
  963. package/dist/geo/routing.cjs.map +1 -1
  964. package/dist/geo/routing.js.map +1 -1
  965. package/dist/geo/types.cjs.map +1 -1
  966. package/dist/geo/types.js.map +1 -1
  967. package/dist/geo/use-position-tracker.cjs.map +1 -1
  968. package/dist/geo/use-position-tracker.js.map +1 -1
  969. package/dist/hooks/pwa-env.cjs.map +1 -1
  970. package/dist/hooks/pwa-env.js.map +1 -1
  971. package/dist/hooks/tab-sequence.cjs.map +1 -1
  972. package/dist/hooks/tab-sequence.js.map +1 -1
  973. package/dist/hooks/use-announce.cjs +1 -1
  974. package/dist/hooks/use-announce.cjs.map +1 -1
  975. package/dist/hooks/use-announce.js +2 -2
  976. package/dist/hooks/use-announce.js.map +1 -1
  977. package/dist/hooks/use-async.cjs.map +1 -1
  978. package/dist/hooks/use-async.js.map +1 -1
  979. package/dist/hooks/use-before-install-prompt.cjs.map +1 -1
  980. package/dist/hooks/use-before-install-prompt.js.map +1 -1
  981. package/dist/hooks/use-breakpoint.cjs.map +1 -1
  982. package/dist/hooks/use-breakpoint.js.map +1 -1
  983. package/dist/hooks/use-click-outside.cjs.map +1 -1
  984. package/dist/hooks/use-click-outside.js.map +1 -1
  985. package/dist/hooks/use-client-filter.cjs.map +1 -1
  986. package/dist/hooks/use-client-filter.js.map +1 -1
  987. package/dist/hooks/use-clipboard.cjs.map +1 -1
  988. package/dist/hooks/use-clipboard.js.map +1 -1
  989. package/dist/hooks/use-countdown.cjs.map +1 -1
  990. package/dist/hooks/use-countdown.js.map +1 -1
  991. package/dist/hooks/use-counter.cjs.map +1 -1
  992. package/dist/hooks/use-counter.js.map +1 -1
  993. package/dist/hooks/use-debounce.cjs.map +1 -1
  994. package/dist/hooks/use-debounce.js.map +1 -1
  995. package/dist/hooks/use-deep-memo.cjs.map +1 -1
  996. package/dist/hooks/use-deep-memo.js.map +1 -1
  997. package/dist/hooks/use-disclosure.cjs.map +1 -1
  998. package/dist/hooks/use-disclosure.js.map +1 -1
  999. package/dist/hooks/use-document-title.cjs.map +1 -1
  1000. package/dist/hooks/use-document-title.js.map +1 -1
  1001. package/dist/hooks/use-document-visibility.cjs.map +1 -1
  1002. package/dist/hooks/use-document-visibility.js.map +1 -1
  1003. package/dist/hooks/use-draft-filters.cjs.map +1 -1
  1004. package/dist/hooks/use-draft-filters.js.map +1 -1
  1005. package/dist/hooks/use-event-listener.cjs.map +1 -1
  1006. package/dist/hooks/use-event-listener.js.map +1 -1
  1007. package/dist/hooks/use-favicon.cjs.map +1 -1
  1008. package/dist/hooks/use-favicon.js.map +1 -1
  1009. package/dist/hooks/use-focus-trap.cjs.map +1 -1
  1010. package/dist/hooks/use-focus-trap.js.map +1 -1
  1011. package/dist/hooks/use-fullscreen-element.cjs.map +1 -1
  1012. package/dist/hooks/use-fullscreen-element.js.map +1 -1
  1013. package/dist/hooks/use-fullscreen.cjs +1 -1
  1014. package/dist/hooks/use-fullscreen.cjs.map +1 -1
  1015. package/dist/hooks/use-fullscreen.js +7 -23
  1016. package/dist/hooks/use-fullscreen.js.map +1 -1
  1017. package/dist/hooks/use-geolocation.cjs.map +1 -1
  1018. package/dist/hooks/use-geolocation.js.map +1 -1
  1019. package/dist/hooks/use-hover.cjs.map +1 -1
  1020. package/dist/hooks/use-hover.js.map +1 -1
  1021. package/dist/hooks/use-idle.cjs.map +1 -1
  1022. package/dist/hooks/use-idle.js.map +1 -1
  1023. package/dist/hooks/use-install-prompt.cjs +1 -1
  1024. package/dist/hooks/use-install-prompt.cjs.map +1 -1
  1025. package/dist/hooks/use-install-prompt.js +1 -1
  1026. package/dist/hooks/use-install-prompt.js.map +1 -1
  1027. package/dist/hooks/use-intersection-observer.cjs.map +1 -1
  1028. package/dist/hooks/use-intersection-observer.js.map +1 -1
  1029. package/dist/hooks/use-interval.cjs.map +1 -1
  1030. package/dist/hooks/use-interval.js.map +1 -1
  1031. package/dist/hooks/use-is-first-render.cjs.map +1 -1
  1032. package/dist/hooks/use-is-first-render.js.map +1 -1
  1033. package/dist/hooks/use-keyboard-shortcut.cjs.map +1 -1
  1034. package/dist/hooks/use-keyboard-shortcut.js.map +1 -1
  1035. package/dist/hooks/use-latest-ref.cjs.map +1 -1
  1036. package/dist/hooks/use-latest-ref.js.map +1 -1
  1037. package/dist/hooks/use-list-state.cjs.map +1 -1
  1038. package/dist/hooks/use-list-state.js.map +1 -1
  1039. package/dist/hooks/use-local-storage.cjs +1 -1
  1040. package/dist/hooks/use-local-storage.cjs.map +1 -1
  1041. package/dist/hooks/use-local-storage.js +2 -5
  1042. package/dist/hooks/use-local-storage.js.map +1 -1
  1043. package/dist/hooks/use-long-press-handlers.cjs.map +1 -1
  1044. package/dist/hooks/use-long-press-handlers.js.map +1 -1
  1045. package/dist/hooks/use-long-press.cjs.map +1 -1
  1046. package/dist/hooks/use-long-press.js.map +1 -1
  1047. package/dist/hooks/use-map.cjs.map +1 -1
  1048. package/dist/hooks/use-map.js.map +1 -1
  1049. package/dist/hooks/use-media-devices.cjs.map +1 -1
  1050. package/dist/hooks/use-media-devices.js.map +1 -1
  1051. package/dist/hooks/use-media-permission.cjs +1 -1
  1052. package/dist/hooks/use-media-permission.cjs.map +1 -1
  1053. package/dist/hooks/use-media-permission.js +2 -5
  1054. package/dist/hooks/use-media-permission.js.map +1 -1
  1055. package/dist/hooks/use-media-query.cjs.map +1 -1
  1056. package/dist/hooks/use-media-query.js.map +1 -1
  1057. package/dist/hooks/use-object-url.cjs.map +1 -1
  1058. package/dist/hooks/use-object-url.js.map +1 -1
  1059. package/dist/hooks/use-online.cjs.map +1 -1
  1060. package/dist/hooks/use-online.js.map +1 -1
  1061. package/dist/hooks/use-pagination.cjs.map +1 -1
  1062. package/dist/hooks/use-pagination.js.map +1 -1
  1063. package/dist/hooks/use-previous.cjs.map +1 -1
  1064. package/dist/hooks/use-previous.js.map +1 -1
  1065. package/dist/hooks/use-push-to-talk.cjs.map +1 -1
  1066. package/dist/hooks/use-push-to-talk.js.map +1 -1
  1067. package/dist/hooks/use-queue.cjs.map +1 -1
  1068. package/dist/hooks/use-queue.js.map +1 -1
  1069. package/dist/hooks/use-resize-observer.cjs.map +1 -1
  1070. package/dist/hooks/use-resize-observer.js.map +1 -1
  1071. package/dist/hooks/use-scroll-lock.cjs.map +1 -1
  1072. package/dist/hooks/use-scroll-lock.js.map +1 -1
  1073. package/dist/hooks/use-scroll-overflow.cjs.map +1 -1
  1074. package/dist/hooks/use-scroll-overflow.js.map +1 -1
  1075. package/dist/hooks/use-service-worker-update.cjs.map +1 -1
  1076. package/dist/hooks/use-service-worker-update.js.map +1 -1
  1077. package/dist/hooks/use-set.cjs.map +1 -1
  1078. package/dist/hooks/use-set.js.map +1 -1
  1079. package/dist/hooks/use-sortable.cjs.map +1 -1
  1080. package/dist/hooks/use-sortable.js.map +1 -1
  1081. package/dist/hooks/use-stable-callback.cjs.map +1 -1
  1082. package/dist/hooks/use-stable-callback.js.map +1 -1
  1083. package/dist/hooks/use-storage-estimate.cjs.map +1 -1
  1084. package/dist/hooks/use-storage-estimate.js.map +1 -1
  1085. package/dist/hooks/use-throttle.cjs.map +1 -1
  1086. package/dist/hooks/use-throttle.js.map +1 -1
  1087. package/dist/hooks/use-timeout.cjs.map +1 -1
  1088. package/dist/hooks/use-timeout.js.map +1 -1
  1089. package/dist/hooks/use-toggle.cjs.map +1 -1
  1090. package/dist/hooks/use-toggle.js.map +1 -1
  1091. package/dist/hooks/use-typewriter.cjs.map +1 -1
  1092. package/dist/hooks/use-typewriter.js.map +1 -1
  1093. package/dist/hooks/use-window-size.cjs.map +1 -1
  1094. package/dist/hooks/use-window-size.js.map +1 -1
  1095. package/dist/http/api-client.cjs.map +1 -1
  1096. package/dist/http/api-client.js.map +1 -1
  1097. package/dist/http/build-url.cjs.map +1 -1
  1098. package/dist/http/build-url.js.map +1 -1
  1099. package/dist/http/credential-scope.cjs.map +1 -1
  1100. package/dist/http/credential-scope.js.map +1 -1
  1101. package/dist/http/csrf.cjs.map +1 -1
  1102. package/dist/http/csrf.js.map +1 -1
  1103. package/dist/http/decode-response.cjs.map +1 -1
  1104. package/dist/http/decode-response.js.map +1 -1
  1105. package/dist/http/describe-api-error.cjs.map +1 -1
  1106. package/dist/http/describe-api-error.js.map +1 -1
  1107. package/dist/http/errors.cjs.map +1 -1
  1108. package/dist/http/errors.js.map +1 -1
  1109. package/dist/http/idempotency.cjs.map +1 -1
  1110. package/dist/http/idempotency.js.map +1 -1
  1111. package/dist/http/parse-response.cjs.map +1 -1
  1112. package/dist/http/parse-response.js.map +1 -1
  1113. package/dist/http/resumable-upload.cjs +1 -1
  1114. package/dist/http/resumable-upload.cjs.map +1 -1
  1115. package/dist/http/resumable-upload.js +141 -105
  1116. package/dist/http/resumable-upload.js.map +1 -1
  1117. package/dist/http/retry.cjs +1 -1
  1118. package/dist/http/retry.cjs.map +1 -1
  1119. package/dist/http/retry.js +5 -6
  1120. package/dist/http/retry.js.map +1 -1
  1121. package/dist/http/timeout.cjs.map +1 -1
  1122. package/dist/http/timeout.js.map +1 -1
  1123. package/dist/http/upload-with-progress.cjs +1 -1
  1124. package/dist/http/upload-with-progress.cjs.map +1 -1
  1125. package/dist/http/upload-with-progress.js +2 -7
  1126. package/dist/http/upload-with-progress.js.map +1 -1
  1127. package/dist/http/use-describe-api-error.cjs.map +1 -1
  1128. package/dist/http/use-describe-api-error.js.map +1 -1
  1129. package/dist/http/use-poll.cjs +1 -1
  1130. package/dist/http/use-poll.cjs.map +1 -1
  1131. package/dist/http/use-poll.js +2 -5
  1132. package/dist/http/use-poll.js.map +1 -1
  1133. package/dist/i18n/I18nProvider.cjs.map +1 -1
  1134. package/dist/i18n/I18nProvider.js.map +1 -1
  1135. package/dist/i18n/create-i18n.cjs.map +1 -1
  1136. package/dist/i18n/create-i18n.js.map +1 -1
  1137. package/dist/icons/Icon.cjs.map +1 -1
  1138. package/dist/icons/Icon.js.map +1 -1
  1139. package/dist/icons/IconPicker.cjs.map +1 -1
  1140. package/dist/icons/IconPicker.js.map +1 -1
  1141. package/dist/icons/IconPicker.module.cjs.map +1 -1
  1142. package/dist/icons/IconPicker.module.js.map +1 -1
  1143. package/dist/icons/IconProvider.cjs.map +1 -1
  1144. package/dist/icons/IconProvider.js.map +1 -1
  1145. package/dist/icons/alias.cjs.map +1 -1
  1146. package/dist/icons/alias.js.map +1 -1
  1147. package/dist/icons/generated/aliases.cjs.map +1 -1
  1148. package/dist/icons/generated/aliases.js.map +1 -1
  1149. package/dist/icons/generated/icon-names.cjs.map +1 -1
  1150. package/dist/icons/generated/icon-names.js.map +1 -1
  1151. package/dist/icons/generated/loaders.cjs.map +1 -1
  1152. package/dist/icons/generated/loaders.js.map +1 -1
  1153. package/dist/icons/generated/shard-00.cjs.map +1 -1
  1154. package/dist/icons/generated/shard-00.js.map +1 -1
  1155. package/dist/icons/generated/shard-01.cjs.map +1 -1
  1156. package/dist/icons/generated/shard-01.js.map +1 -1
  1157. package/dist/icons/generated/shard-02.cjs.map +1 -1
  1158. package/dist/icons/generated/shard-02.js.map +1 -1
  1159. package/dist/icons/generated/shard-03.cjs.map +1 -1
  1160. package/dist/icons/generated/shard-03.js.map +1 -1
  1161. package/dist/icons/generated/shard-04.cjs.map +1 -1
  1162. package/dist/icons/generated/shard-04.js.map +1 -1
  1163. package/dist/icons/generated/shard-05.cjs.map +1 -1
  1164. package/dist/icons/generated/shard-05.js.map +1 -1
  1165. package/dist/icons/generated/shard-06.cjs.map +1 -1
  1166. package/dist/icons/generated/shard-06.js.map +1 -1
  1167. package/dist/icons/generated/shard-07.cjs.map +1 -1
  1168. package/dist/icons/generated/shard-07.js.map +1 -1
  1169. package/dist/icons/generated/shard-08.cjs.map +1 -1
  1170. package/dist/icons/generated/shard-08.js.map +1 -1
  1171. package/dist/icons/generated/shard-09.cjs.map +1 -1
  1172. package/dist/icons/generated/shard-09.js.map +1 -1
  1173. package/dist/icons/generated/shard-10.cjs.map +1 -1
  1174. package/dist/icons/generated/shard-10.js.map +1 -1
  1175. package/dist/icons/generated/shard-11.cjs.map +1 -1
  1176. package/dist/icons/generated/shard-11.js.map +1 -1
  1177. package/dist/icons/generated/shard-12.cjs.map +1 -1
  1178. package/dist/icons/generated/shard-12.js.map +1 -1
  1179. package/dist/icons/generated/shard-13.cjs.map +1 -1
  1180. package/dist/icons/generated/shard-13.js.map +1 -1
  1181. package/dist/icons/generated/shard-14.cjs.map +1 -1
  1182. package/dist/icons/generated/shard-14.js.map +1 -1
  1183. package/dist/icons/generated/shard-15.cjs.map +1 -1
  1184. package/dist/icons/generated/shard-15.js.map +1 -1
  1185. package/dist/icons/generated/shard-16.cjs.map +1 -1
  1186. package/dist/icons/generated/shard-16.js.map +1 -1
  1187. package/dist/icons/generated/shard-17.cjs.map +1 -1
  1188. package/dist/icons/generated/shard-17.js.map +1 -1
  1189. package/dist/icons/generated/shard-18.cjs.map +1 -1
  1190. package/dist/icons/generated/shard-18.js.map +1 -1
  1191. package/dist/icons/generated/shard-19.cjs.map +1 -1
  1192. package/dist/icons/generated/shard-19.js.map +1 -1
  1193. package/dist/icons/generated/shard-20.cjs.map +1 -1
  1194. package/dist/icons/generated/shard-20.js.map +1 -1
  1195. package/dist/icons/generated/shard-21.cjs.map +1 -1
  1196. package/dist/icons/generated/shard-21.js.map +1 -1
  1197. package/dist/icons/generated/shard-22.cjs.map +1 -1
  1198. package/dist/icons/generated/shard-22.js.map +1 -1
  1199. package/dist/icons/generated/shard-23.cjs.map +1 -1
  1200. package/dist/icons/generated/shard-23.js.map +1 -1
  1201. package/dist/icons/generated/shard-24.cjs.map +1 -1
  1202. package/dist/icons/generated/shard-24.js.map +1 -1
  1203. package/dist/icons/generated/shard-25.cjs.map +1 -1
  1204. package/dist/icons/generated/shard-25.js.map +1 -1
  1205. package/dist/icons/generated/shard-26.cjs.map +1 -1
  1206. package/dist/icons/generated/shard-26.js.map +1 -1
  1207. package/dist/icons/generated/shard-27.cjs.map +1 -1
  1208. package/dist/icons/generated/shard-27.js.map +1 -1
  1209. package/dist/icons/generated/shard-28.cjs.map +1 -1
  1210. package/dist/icons/generated/shard-28.js.map +1 -1
  1211. package/dist/icons/generated/shard-29.cjs.map +1 -1
  1212. package/dist/icons/generated/shard-29.js.map +1 -1
  1213. package/dist/icons/generated/shard-30.cjs.map +1 -1
  1214. package/dist/icons/generated/shard-30.js.map +1 -1
  1215. package/dist/icons/generated/shard-31.cjs.map +1 -1
  1216. package/dist/icons/generated/shard-31.js.map +1 -1
  1217. package/dist/icons/generated/shard-32.cjs.map +1 -1
  1218. package/dist/icons/generated/shard-32.js.map +1 -1
  1219. package/dist/icons/generated/shard-33.cjs.map +1 -1
  1220. package/dist/icons/generated/shard-33.js.map +1 -1
  1221. package/dist/icons/generated/shard-34.cjs.map +1 -1
  1222. package/dist/icons/generated/shard-34.js.map +1 -1
  1223. package/dist/icons/generated/shard-35.cjs.map +1 -1
  1224. package/dist/icons/generated/shard-35.js.map +1 -1
  1225. package/dist/icons/generated/shard-36.cjs.map +1 -1
  1226. package/dist/icons/generated/shard-36.js.map +1 -1
  1227. package/dist/icons/generated/shard-37.cjs.map +1 -1
  1228. package/dist/icons/generated/shard-37.js.map +1 -1
  1229. package/dist/icons/generated/shard-38.cjs.map +1 -1
  1230. package/dist/icons/generated/shard-38.js.map +1 -1
  1231. package/dist/icons/generated/shard-39.cjs.map +1 -1
  1232. package/dist/icons/generated/shard-39.js.map +1 -1
  1233. package/dist/icons/generated/shard-40.cjs.map +1 -1
  1234. package/dist/icons/generated/shard-40.js.map +1 -1
  1235. package/dist/icons/generated/shard-41.cjs.map +1 -1
  1236. package/dist/icons/generated/shard-41.js.map +1 -1
  1237. package/dist/icons/generated/shard-42.cjs.map +1 -1
  1238. package/dist/icons/generated/shard-42.js.map +1 -1
  1239. package/dist/icons/generated/shard-43.cjs.map +1 -1
  1240. package/dist/icons/generated/shard-43.js.map +1 -1
  1241. package/dist/icons/generated/shard-44.cjs.map +1 -1
  1242. package/dist/icons/generated/shard-44.js.map +1 -1
  1243. package/dist/icons/generated/shard-45.cjs.map +1 -1
  1244. package/dist/icons/generated/shard-45.js.map +1 -1
  1245. package/dist/icons/icon-context.cjs.map +1 -1
  1246. package/dist/icons/icon-context.js.map +1 -1
  1247. package/dist/icons/is-icon-name.cjs.map +1 -1
  1248. package/dist/icons/is-icon-name.js.map +1 -1
  1249. package/dist/icons/material-symbols.cjs.map +1 -1
  1250. package/dist/icons/material-symbols.js.map +1 -1
  1251. package/dist/icons/normalize-icon-name.cjs.map +1 -1
  1252. package/dist/icons/normalize-icon-name.js.map +1 -1
  1253. package/dist/icons/shard-cache.cjs +1 -1
  1254. package/dist/icons/shard-cache.cjs.map +1 -1
  1255. package/dist/icons/shard-cache.js +2 -5
  1256. package/dist/icons/shard-cache.js.map +1 -1
  1257. package/dist/icons/use-icon.cjs.map +1 -1
  1258. package/dist/icons/use-icon.js.map +1 -1
  1259. package/dist/icons/validate-icon-name.cjs.map +1 -1
  1260. package/dist/icons/validate-icon-name.js.map +1 -1
  1261. package/dist/icons-virtual.cjs.map +1 -1
  1262. package/dist/icons-virtual.js.map +1 -1
  1263. package/dist/imaging/canvas.cjs.map +1 -1
  1264. package/dist/imaging/canvas.js.map +1 -1
  1265. package/dist/imaging/compress.cjs.map +1 -1
  1266. package/dist/imaging/compress.js.map +1 -1
  1267. package/dist/imaging/decode.cjs.map +1 -1
  1268. package/dist/imaging/decode.js.map +1 -1
  1269. package/dist/imaging/encode.cjs.map +1 -1
  1270. package/dist/imaging/encode.js.map +1 -1
  1271. package/dist/imaging/exceptions.cjs.map +1 -1
  1272. package/dist/imaging/exceptions.js.map +1 -1
  1273. package/dist/imaging/frame.cjs.map +1 -1
  1274. package/dist/imaging/frame.js.map +1 -1
  1275. package/dist/imaging/thumbnails.cjs.map +1 -1
  1276. package/dist/imaging/thumbnails.js.map +1 -1
  1277. package/dist/imaging/transform.cjs.map +1 -1
  1278. package/dist/imaging/transform.js.map +1 -1
  1279. package/dist/imaging/use-image-processing.cjs.map +1 -1
  1280. package/dist/imaging/use-image-processing.js.map +1 -1
  1281. package/dist/logger/logger.cjs.map +1 -1
  1282. package/dist/logger/logger.js.map +1 -1
  1283. package/dist/neural.cjs.map +1 -1
  1284. package/dist/neural.js.map +1 -1
  1285. package/dist/oauth/GoogleSignIn.cjs +1 -1
  1286. package/dist/oauth/GoogleSignIn.cjs.map +1 -1
  1287. package/dist/oauth/GoogleSignIn.js +6 -9
  1288. package/dist/oauth/GoogleSignIn.js.map +1 -1
  1289. package/dist/oauth/callback.cjs.map +1 -1
  1290. package/dist/oauth/callback.js.map +1 -1
  1291. package/dist/oauth/use-oauth-callback.cjs.map +1 -1
  1292. package/dist/oauth/use-oauth-callback.js.map +1 -1
  1293. package/dist/offline/conflict.cjs.map +1 -1
  1294. package/dist/offline/conflict.js.map +1 -1
  1295. package/dist/offline/create-offline-database.cjs.map +1 -1
  1296. package/dist/offline/create-offline-database.js.map +1 -1
  1297. package/dist/offline/create-offline-store.cjs +1 -1
  1298. package/dist/offline/create-offline-store.cjs.map +1 -1
  1299. package/dist/offline/create-offline-store.js +1 -5
  1300. package/dist/offline/create-offline-store.js.map +1 -1
  1301. package/dist/offline/create-offline-sync.cjs +1 -1
  1302. package/dist/offline/create-offline-sync.cjs.map +1 -1
  1303. package/dist/offline/create-offline-sync.js +9 -14
  1304. package/dist/offline/create-offline-sync.js.map +1 -1
  1305. package/dist/offline/use-offline-sync.cjs.map +1 -1
  1306. package/dist/offline/use-offline-sync.js.map +1 -1
  1307. package/dist/perf/cache-size.cjs.map +1 -1
  1308. package/dist/perf/cache-size.js.map +1 -1
  1309. package/dist/perf/device.cjs.map +1 -1
  1310. package/dist/perf/device.js.map +1 -1
  1311. package/dist/perf/format.cjs.map +1 -1
  1312. package/dist/perf/format.js.map +1 -1
  1313. package/dist/perf/profiler.cjs.map +1 -1
  1314. package/dist/perf/profiler.js.map +1 -1
  1315. package/dist/push/use-push-subscription.cjs.map +1 -1
  1316. package/dist/push/use-push-subscription.js.map +1 -1
  1317. package/dist/push/utils.cjs.map +1 -1
  1318. package/dist/push/utils.js.map +1 -1
  1319. package/dist/push/web-push-client.cjs.map +1 -1
  1320. package/dist/push/web-push-client.js.map +1 -1
  1321. package/dist/query/QueryProvider.cjs.map +1 -1
  1322. package/dist/query/QueryProvider.js.map +1 -1
  1323. package/dist/query/constants.cjs.map +1 -1
  1324. package/dist/query/constants.js.map +1 -1
  1325. package/dist/query/create-query-keys.cjs.map +1 -1
  1326. package/dist/query/create-query-keys.js.map +1 -1
  1327. package/dist/query/foreign-client-warning.cjs.map +1 -1
  1328. package/dist/query/foreign-client-warning.js.map +1 -1
  1329. package/dist/query/offline-persistence.cjs +1 -1
  1330. package/dist/query/offline-persistence.cjs.map +1 -1
  1331. package/dist/query/offline-persistence.js +2 -10
  1332. package/dist/query/offline-persistence.js.map +1 -1
  1333. package/dist/query/optimistic.cjs.map +1 -1
  1334. package/dist/query/optimistic.js.map +1 -1
  1335. package/dist/query/pagination.cjs.map +1 -1
  1336. package/dist/query/pagination.js.map +1 -1
  1337. package/dist/query/retry-policy.cjs.map +1 -1
  1338. package/dist/query/retry-policy.js.map +1 -1
  1339. package/dist/query/use-cursor-query.cjs.map +1 -1
  1340. package/dist/query/use-cursor-query.js.map +1 -1
  1341. package/dist/query/use-offline-mutation.cjs.map +1 -1
  1342. package/dist/query/use-offline-mutation.js.map +1 -1
  1343. package/dist/query/use-paginated-query.cjs.map +1 -1
  1344. package/dist/query/use-paginated-query.js.map +1 -1
  1345. package/dist/router/AppRouter.cjs.map +1 -1
  1346. package/dist/router/AppRouter.js.map +1 -1
  1347. package/dist/router/RouteGuard.cjs.map +1 -1
  1348. package/dist/router/RouteGuard.js.map +1 -1
  1349. package/dist/router/index.js +2 -2
  1350. package/dist/share/share-or-download.cjs.map +1 -1
  1351. package/dist/share/share-or-download.js.map +1 -1
  1352. package/dist/share/share.cjs.map +1 -1
  1353. package/dist/share/share.js.map +1 -1
  1354. package/dist/sse/create-event-stream.cjs.map +1 -1
  1355. package/dist/sse/create-event-stream.js.map +1 -1
  1356. package/dist/sse/use-event-stream.cjs.map +1 -1
  1357. package/dist/sse/use-event-stream.js.map +1 -1
  1358. package/dist/store/create-selectors.cjs.map +1 -1
  1359. package/dist/store/create-selectors.js.map +1 -1
  1360. package/dist/store/create-store.cjs.map +1 -1
  1361. package/dist/store/create-store.js.map +1 -1
  1362. package/dist/sw/background-sync.cjs +1 -1
  1363. package/dist/sw/background-sync.cjs.map +1 -1
  1364. package/dist/sw/background-sync.js +32 -31
  1365. package/dist/sw/background-sync.js.map +1 -1
  1366. package/dist/sw/cache-inspect.cjs.map +1 -1
  1367. package/dist/sw/cache-inspect.js.map +1 -1
  1368. package/dist/sw/cache.cjs +1 -1
  1369. package/dist/sw/cache.cjs.map +1 -1
  1370. package/dist/sw/cache.js +2 -6
  1371. package/dist/sw/cache.js.map +1 -1
  1372. package/dist/sw/create-push-handler.cjs.map +1 -1
  1373. package/dist/sw/create-push-handler.js.map +1 -1
  1374. package/dist/sw/credential-headers.cjs.map +1 -1
  1375. package/dist/sw/credential-headers.js.map +1 -1
  1376. package/dist/sw/periodic-sync.cjs.map +1 -1
  1377. package/dist/sw/periodic-sync.js.map +1 -1
  1378. package/dist/sw/register-service-worker.cjs.map +1 -1
  1379. package/dist/sw/register-service-worker.js.map +1 -1
  1380. package/dist/sw/session-data.cjs.map +1 -1
  1381. package/dist/sw/session-data.js.map +1 -1
  1382. package/dist/sw.d.ts +46 -8
  1383. package/dist/tabular/assets.cjs.map +1 -1
  1384. package/dist/tabular/assets.js.map +1 -1
  1385. package/dist/tabular/cache.cjs.map +1 -1
  1386. package/dist/tabular/cache.js.map +1 -1
  1387. package/dist/tabular/compact.cjs.map +1 -1
  1388. package/dist/tabular/compact.js.map +1 -1
  1389. package/dist/tabular/exceptions.cjs.map +1 -1
  1390. package/dist/tabular/exceptions.js.map +1 -1
  1391. package/dist/tabular/manifest.cjs.map +1 -1
  1392. package/dist/tabular/manifest.js.map +1 -1
  1393. package/dist/tabular/predictor.cjs.map +1 -1
  1394. package/dist/tabular/predictor.js.map +1 -1
  1395. package/dist/tabular/use-tabular-predictor.cjs.map +1 -1
  1396. package/dist/tabular/use-tabular-predictor.js.map +1 -1
  1397. package/dist/telemetry/TelemetryProvider.cjs.map +1 -1
  1398. package/dist/telemetry/TelemetryProvider.js.map +1 -1
  1399. package/dist/telemetry/app-error-adapter.cjs.map +1 -1
  1400. package/dist/telemetry/app-error-adapter.js.map +1 -1
  1401. package/dist/telemetry/app-error-queue.cjs.map +1 -1
  1402. package/dist/telemetry/app-error-queue.js.map +1 -1
  1403. package/dist/telemetry/app-error-reporter.cjs +1 -1
  1404. package/dist/telemetry/app-error-reporter.cjs.map +1 -1
  1405. package/dist/telemetry/app-error-reporter.js +1 -1
  1406. package/dist/telemetry/app-error-reporter.js.map +1 -1
  1407. package/dist/telemetry/app-error-schema.cjs.map +1 -1
  1408. package/dist/telemetry/app-error-schema.js.map +1 -1
  1409. package/dist/telemetry/app-error-transport.cjs.map +1 -1
  1410. package/dist/telemetry/app-error-transport.js.map +1 -1
  1411. package/dist/telemetry/console-adapter.cjs.map +1 -1
  1412. package/dist/telemetry/console-adapter.js.map +1 -1
  1413. package/dist/telemetry/describe-app-error.cjs.map +1 -1
  1414. package/dist/telemetry/describe-app-error.js.map +1 -1
  1415. package/dist/telemetry/posthog-adapter.cjs +1 -1
  1416. package/dist/telemetry/posthog-adapter.cjs.map +1 -1
  1417. package/dist/telemetry/posthog-adapter.js +1 -5
  1418. package/dist/telemetry/posthog-adapter.js.map +1 -1
  1419. package/dist/telemetry/sentry-adapter.cjs.map +1 -1
  1420. package/dist/telemetry/sentry-adapter.js.map +1 -1
  1421. package/dist/tempest-react-sdk.cjs +1 -1
  1422. package/dist/tempest-react-sdk.d.ts +448 -15
  1423. package/dist/tempest-react-sdk.js +119 -119
  1424. package/dist/testing/create-mock-handlers.cjs.map +1 -1
  1425. package/dist/testing/create-mock-handlers.js.map +1 -1
  1426. package/dist/testing.js +1 -2
  1427. package/dist/theme/ThemeProvider.cjs.map +1 -1
  1428. package/dist/theme/ThemeProvider.js.map +1 -1
  1429. package/dist/theme/apply-theme.cjs.map +1 -1
  1430. package/dist/theme/apply-theme.js.map +1 -1
  1431. package/dist/theme/color.cjs.map +1 -1
  1432. package/dist/theme/color.js.map +1 -1
  1433. package/dist/theme/create-theme.cjs.map +1 -1
  1434. package/dist/theme/create-theme.js.map +1 -1
  1435. package/dist/theme/data-viz-ramps.cjs.map +1 -1
  1436. package/dist/theme/data-viz-ramps.js.map +1 -1
  1437. package/dist/theme/initial-theme.cjs.map +1 -1
  1438. package/dist/theme/initial-theme.js.map +1 -1
  1439. package/dist/theme/inverse-render.cjs.map +1 -1
  1440. package/dist/theme/inverse-render.js.map +1 -1
  1441. package/dist/theme/inverse-restore.cjs.map +1 -1
  1442. package/dist/theme/inverse-restore.js.map +1 -1
  1443. package/dist/theme/inverse-surface.cjs.map +1 -1
  1444. package/dist/theme/inverse-surface.js.map +1 -1
  1445. package/dist/theme/status-tokens.cjs.map +1 -1
  1446. package/dist/theme/status-tokens.js.map +1 -1
  1447. package/dist/theme/theme-presets.cjs.map +1 -1
  1448. package/dist/theme/theme-presets.js.map +1 -1
  1449. package/dist/utils/absent.cjs.map +1 -1
  1450. package/dist/utils/absent.js.map +1 -1
  1451. package/dist/utils/arrays.cjs.map +1 -1
  1452. package/dist/utils/arrays.js.map +1 -1
  1453. package/dist/utils/base64.cjs.map +1 -1
  1454. package/dist/utils/base64.js.map +1 -1
  1455. package/dist/utils/cn.cjs.map +1 -1
  1456. package/dist/utils/cn.js.map +1 -1
  1457. package/dist/utils/compare-values.cjs.map +1 -1
  1458. package/dist/utils/compare-values.js.map +1 -1
  1459. package/dist/utils/compressed-storage.cjs.map +1 -1
  1460. package/dist/utils/compressed-storage.js.map +1 -1
  1461. package/dist/utils/csv.cjs +3 -3
  1462. package/dist/utils/csv.cjs.map +1 -1
  1463. package/dist/utils/csv.js +11 -10
  1464. package/dist/utils/csv.js.map +1 -1
  1465. package/dist/utils/dev-mode.cjs.map +1 -1
  1466. package/dist/utils/dev-mode.js.map +1 -1
  1467. package/dist/utils/duplicate-instance.cjs.map +1 -1
  1468. package/dist/utils/duplicate-instance.js.map +1 -1
  1469. package/dist/utils/format.cjs.map +1 -1
  1470. package/dist/utils/format.js.map +1 -1
  1471. package/dist/utils/functions.cjs +1 -1
  1472. package/dist/utils/functions.cjs.map +1 -1
  1473. package/dist/utils/functions.js +1 -1
  1474. package/dist/utils/functions.js.map +1 -1
  1475. package/dist/utils/guards.cjs.map +1 -1
  1476. package/dist/utils/guards.js.map +1 -1
  1477. package/dist/utils/ids.cjs.map +1 -1
  1478. package/dist/utils/ids.js.map +1 -1
  1479. package/dist/utils/intl-cache.cjs.map +1 -1
  1480. package/dist/utils/intl-cache.js.map +1 -1
  1481. package/dist/utils/json-frame.cjs.map +1 -1
  1482. package/dist/utils/json-frame.js.map +1 -1
  1483. package/dist/utils/numbers.cjs.map +1 -1
  1484. package/dist/utils/numbers.js.map +1 -1
  1485. package/dist/utils/objects.cjs.map +1 -1
  1486. package/dist/utils/objects.js.map +1 -1
  1487. package/dist/{telemetry/app-error-owner.cjs → utils/owner-fingerprint.cjs} +2 -2
  1488. package/dist/utils/owner-fingerprint.cjs.map +1 -0
  1489. package/dist/{telemetry/app-error-owner.js → utils/owner-fingerprint.js} +3 -3
  1490. package/dist/utils/owner-fingerprint.js.map +1 -0
  1491. package/dist/utils/promises.cjs.map +1 -1
  1492. package/dist/utils/promises.js.map +1 -1
  1493. package/dist/utils/relative-time.cjs.map +1 -1
  1494. package/dist/utils/relative-time.js.map +1 -1
  1495. package/dist/utils/safe-url.cjs.map +1 -1
  1496. package/dist/utils/safe-url.js.map +1 -1
  1497. package/dist/utils/schema-like.cjs.map +1 -1
  1498. package/dist/utils/schema-like.js.map +1 -1
  1499. package/dist/utils/storage.cjs +1 -1
  1500. package/dist/utils/storage.cjs.map +1 -1
  1501. package/dist/utils/storage.js +2 -2
  1502. package/dist/utils/storage.js.map +1 -1
  1503. package/dist/utils/strings.cjs.map +1 -1
  1504. package/dist/utils/strings.js.map +1 -1
  1505. package/dist/utils/xlsx.cjs.map +1 -1
  1506. package/dist/utils/xlsx.js.map +1 -1
  1507. package/dist/vision/core/canvas.cjs.map +1 -1
  1508. package/dist/vision/core/canvas.js.map +1 -1
  1509. package/dist/vision/core/dtypes.cjs.map +1 -1
  1510. package/dist/vision/core/dtypes.js.map +1 -1
  1511. package/dist/vision/core/exceptions.cjs.map +1 -1
  1512. package/dist/vision/core/exceptions.js.map +1 -1
  1513. package/dist/vision/core/graph.cjs.map +1 -1
  1514. package/dist/vision/core/graph.js.map +1 -1
  1515. package/dist/vision/core/metadata.cjs +1 -1
  1516. package/dist/vision/core/metadata.cjs.map +1 -1
  1517. package/dist/vision/core/metadata.js +9 -26
  1518. package/dist/vision/core/metadata.js.map +1 -1
  1519. package/dist/vision/core/providers.cjs.map +1 -1
  1520. package/dist/vision/core/providers.js.map +1 -1
  1521. package/dist/vision/core/session.cjs.map +1 -1
  1522. package/dist/vision/core/session.js.map +1 -1
  1523. package/dist/vision/core/timing.cjs.map +1 -1
  1524. package/dist/vision/core/timing.js.map +1 -1
  1525. package/dist/vision/fusion.cjs.map +1 -1
  1526. package/dist/vision/fusion.js.map +1 -1
  1527. package/dist/vision/index.cjs.map +1 -1
  1528. package/dist/vision/index.js.map +1 -1
  1529. package/dist/vision/io/image.cjs.map +1 -1
  1530. package/dist/vision/io/image.js.map +1 -1
  1531. package/dist/vision/labels.cjs.map +1 -1
  1532. package/dist/vision/labels.js.map +1 -1
  1533. package/dist/vision/luminance.cjs.map +1 -1
  1534. package/dist/vision/luminance.js.map +1 -1
  1535. package/dist/vision/normalization.cjs.map +1 -1
  1536. package/dist/vision/normalization.js.map +1 -1
  1537. package/dist/vision/postprocess/classification.cjs.map +1 -1
  1538. package/dist/vision/postprocess/classification.js.map +1 -1
  1539. package/dist/vision/postprocess/detection.cjs.map +1 -1
  1540. package/dist/vision/postprocess/detection.js.map +1 -1
  1541. package/dist/vision/postprocess/segmentation.cjs.map +1 -1
  1542. package/dist/vision/postprocess/segmentation.js.map +1 -1
  1543. package/dist/vision/preprocess/image.cjs.map +1 -1
  1544. package/dist/vision/preprocess/image.js.map +1 -1
  1545. package/dist/vision/preprocess/pipeline.cjs.map +1 -1
  1546. package/dist/vision/preprocess/pipeline.js.map +1 -1
  1547. package/dist/vision/results.cjs.map +1 -1
  1548. package/dist/vision/results.js.map +1 -1
  1549. package/dist/vision/tasks/base.cjs.map +1 -1
  1550. package/dist/vision/tasks/base.js.map +1 -1
  1551. package/dist/vision/tasks/classifier.cjs.map +1 -1
  1552. package/dist/vision/tasks/classifier.js.map +1 -1
  1553. package/dist/vision/tasks/detectClassify.cjs.map +1 -1
  1554. package/dist/vision/tasks/detectClassify.js.map +1 -1
  1555. package/dist/vision/tasks/detector.cjs.map +1 -1
  1556. package/dist/vision/tasks/detector.js.map +1 -1
  1557. package/dist/vision/tasks/segmenter.cjs.map +1 -1
  1558. package/dist/vision/tasks/segmenter.js.map +1 -1
  1559. package/dist/vision/types.cjs.map +1 -1
  1560. package/dist/vision/types.js.map +1 -1
  1561. package/dist/vision/use-camera-stream.cjs +1 -1
  1562. package/dist/vision/use-camera-stream.cjs.map +1 -1
  1563. package/dist/vision/use-camera-stream.js +3 -9
  1564. package/dist/vision/use-camera-stream.js.map +1 -1
  1565. package/dist/vision/use-live-luminance.cjs +1 -1
  1566. package/dist/vision/use-live-luminance.cjs.map +1 -1
  1567. package/dist/vision/use-live-luminance.js +1 -5
  1568. package/dist/vision/use-live-luminance.js.map +1 -1
  1569. package/dist/vite/base-url.cjs.map +1 -1
  1570. package/dist/vite/base-url.js.map +1 -1
  1571. package/dist/vite/create-vite-config.cjs.map +1 -1
  1572. package/dist/vite/create-vite-config.js.map +1 -1
  1573. package/dist/vite/narrow-tokens.cjs.map +1 -1
  1574. package/dist/vite/narrow-tokens.js.map +1 -1
  1575. package/dist/vite/tempest-csp.cjs +2 -2
  1576. package/dist/vite/tempest-csp.cjs.map +1 -1
  1577. package/dist/vite/tempest-csp.js +69 -66
  1578. package/dist/vite/tempest-csp.js.map +1 -1
  1579. package/dist/vite/tempest-icons.cjs.map +1 -1
  1580. package/dist/vite/tempest-icons.js.map +1 -1
  1581. package/dist/vite/tempest-pwa-dev-sw.cjs +1 -1
  1582. package/dist/vite/tempest-pwa-dev-sw.cjs.map +1 -1
  1583. package/dist/vite/tempest-pwa-dev-sw.js +9 -16
  1584. package/dist/vite/tempest-pwa-dev-sw.js.map +1 -1
  1585. package/dist/vite/tempest-pwa-icons.cjs.map +1 -1
  1586. package/dist/vite/tempest-pwa-icons.js.map +1 -1
  1587. package/dist/vite/tempest-pwa-manifest.cjs.map +1 -1
  1588. package/dist/vite/tempest-pwa-manifest.js.map +1 -1
  1589. package/dist/vite/tempest-styles.cjs.map +1 -1
  1590. package/dist/vite/tempest-styles.js.map +1 -1
  1591. package/dist/vite/tempest-vitest.cjs.map +1 -1
  1592. package/dist/vite/tempest-vitest.js.map +1 -1
  1593. package/dist/vite.d.ts +5 -3
  1594. package/dist/webrtc/link-stats.cjs.map +1 -1
  1595. package/dist/webrtc/link-stats.js.map +1 -1
  1596. package/dist/webrtc/mesh-quality.cjs.map +1 -1
  1597. package/dist/webrtc/mesh-quality.js.map +1 -1
  1598. package/dist/webrtc/opus-sdp.cjs.map +1 -1
  1599. package/dist/webrtc/opus-sdp.js.map +1 -1
  1600. package/dist/webrtc/peer-link.cjs +1 -1
  1601. package/dist/webrtc/peer-link.cjs.map +1 -1
  1602. package/dist/webrtc/peer-link.js +2 -5
  1603. package/dist/webrtc/peer-link.js.map +1 -1
  1604. package/dist/webrtc/peer-mesh.cjs +1 -1
  1605. package/dist/webrtc/peer-mesh.cjs.map +1 -1
  1606. package/dist/webrtc/peer-mesh.js +8 -24
  1607. package/dist/webrtc/peer-mesh.js.map +1 -1
  1608. package/dist/webrtc/sender-bitrate.cjs.map +1 -1
  1609. package/dist/webrtc/sender-bitrate.js.map +1 -1
  1610. package/dist/webrtc/use-link-stats.cjs.map +1 -1
  1611. package/dist/webrtc/use-link-stats.js.map +1 -1
  1612. package/dist/ws/create-web-socket.cjs +1 -1
  1613. package/dist/ws/create-web-socket.cjs.map +1 -1
  1614. package/dist/ws/create-web-socket.js +4 -22
  1615. package/dist/ws/create-web-socket.js.map +1 -1
  1616. package/dist/ws/resilience.cjs.map +1 -1
  1617. package/dist/ws/resilience.js.map +1 -1
  1618. package/dist/ws/use-web-socket.cjs.map +1 -1
  1619. package/dist/ws/use-web-socket.js.map +1 -1
  1620. package/package.json +9 -6
  1621. package/template/package.json +1 -1
  1622. package/dist/telemetry/app-error-owner.cjs.map +0 -1
  1623. package/dist/telemetry/app-error-owner.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"device.cjs","names":[],"sources":["../../src/perf/device.ts"],"sourcesContent":["import type { DeviceProfile } from \"./types\";\n\n/**\n * What the browser will tell us about the machine it is running on.\n */\n\nconst BYTES_PER_MIB = 1024 * 1024;\n\n/** `navigator.deviceMemory` is Chromium-only and absent from the DOM lib. */\ninterface DeviceMemoryNavigator extends Navigator {\n deviceMemory?: number;\n}\n\n/** `performance.memory` is a non-standard Chromium extension. */\ninterface HeapPerformance extends Performance {\n memory?: { usedJSHeapSize: number };\n}\n\n/**\n * Used JS heap in MiB, rounded to one decimal.\n *\n * @returns The heap usage, or `null` outside Chromium.\n */\nfunction readHeapUsedMb(): number | null {\n if (typeof performance === \"undefined\") return null;\n const memory = (performance as HeapPerformance).memory;\n if (!memory) return null;\n return Math.round((memory.usedJSHeapSize / BYTES_PER_MIB) * 10) / 10;\n}\n\n/**\n * Sample the device capabilities the browser reports.\n *\n * Safe to call during SSR: without a `navigator` every field is `null`.\n *\n * @returns The profile, with `null` for anything this platform withholds.\n *\n * @example\n * ```typescript\n * const device = readDeviceProfile();\n * console.log(device.hardwareConcurrency); // 8\n * console.log(device.deviceMemoryGb); // 8 on Chromium, null on Safari\n * ```\n */\nexport function readDeviceProfile(): DeviceProfile {\n if (typeof navigator === \"undefined\") {\n return { hardwareConcurrency: null, deviceMemoryGb: null, jsHeapUsedMb: null };\n }\n const nav = navigator as DeviceMemoryNavigator;\n return {\n hardwareConcurrency: nav.hardwareConcurrency ?? null,\n deviceMemoryGb: nav.deviceMemory ?? null,\n jsHeapUsedMb: readHeapUsedMb(),\n };\n}\n"],"mappings":"AAuBA,SAAS,GAAgC,CACrC,GAAI,OAAO,YAAgB,IAAa,OAAO,KAC/C,IAAM,EAAU,YAAgC,OAEhD,OADK,EACE,KAAK,MAAO,EAAO,eAAiB,QAAiB,EAAE,EAAI,GAD9C,IAExB,CAgBA,SAAgB,GAAmC,CAC/C,GAAI,OAAO,UAAc,IACrB,MAAO,CAAE,oBAAqB,KAAM,eAAgB,KAAM,aAAc,IAAK,EAEjF,IAAM,EAAM,UACZ,MAAO,CACH,oBAAqB,EAAI,qBAAuB,KAChD,eAAgB,EAAI,cAAgB,KACpC,aAAc,EAAe,CACjC,CACJ"}
1
+ {"version":3,"file":"device.cjs","names":["readHeapUsedMb","memory","readDeviceProfile","nav"],"sources":["../../src/perf/device.ts"],"sourcesContent":["import type { DeviceProfile } from \"./types\";\n\n/**\n * What the browser will tell us about the machine it is running on.\n */\n\nconst BYTES_PER_MIB = 1024 * 1024;\n\n/** `navigator.deviceMemory` is Chromium-only and absent from the DOM lib. */\ninterface DeviceMemoryNavigator extends Navigator {\n deviceMemory?: number;\n}\n\n/** `performance.memory` is a non-standard Chromium extension. */\ninterface HeapPerformance extends Performance {\n memory?: { usedJSHeapSize: number };\n}\n\n/**\n * Used JS heap in MiB, rounded to one decimal.\n *\n * @returns The heap usage, or `null` outside Chromium.\n */\nfunction readHeapUsedMb(): number | null {\n if (typeof performance === \"undefined\") return null;\n const memory = (performance as HeapPerformance).memory;\n if (!memory) return null;\n return Math.round((memory.usedJSHeapSize / BYTES_PER_MIB) * 10) / 10;\n}\n\n/**\n * Sample the device capabilities the browser reports.\n *\n * Safe to call during SSR: without a `navigator` every field is `null`.\n *\n * @returns The profile, with `null` for anything this platform withholds.\n *\n * @example\n * ```typescript\n * const device = readDeviceProfile();\n * console.log(device.hardwareConcurrency); // 8\n * console.log(device.deviceMemoryGb); // 8 on Chromium, null on Safari\n * ```\n */\nexport function readDeviceProfile(): DeviceProfile {\n if (typeof navigator === \"undefined\") {\n return { hardwareConcurrency: null, deviceMemoryGb: null, jsHeapUsedMb: null };\n }\n const nav = navigator as DeviceMemoryNavigator;\n return {\n hardwareConcurrency: nav.hardwareConcurrency ?? null,\n deviceMemoryGb: nav.deviceMemory ?? null,\n jsHeapUsedMb: readHeapUsedMb(),\n };\n}\n"],"mappings":"AAuBA,SAASA,GAAgC,CACrC,GAAI,OAAO,YAAgB,IAAa,OAAO,KAC/C,IAAMC,EAAU,YAAgC,OAEhD,OADKA,EACE,KAAK,MAAOA,EAAO,eAAiB,QAAiB,EAAE,EAAI,GAD9C,IAExB,CAgBA,SAAgBC,GAAmC,CAC/C,GAAI,OAAO,UAAc,IACrB,MAAO,CAAE,oBAAqB,KAAM,eAAgB,KAAM,aAAc,IAAK,EAEjF,IAAMC,EAAM,UACZ,MAAO,CACH,oBAAqBA,EAAI,qBAAuB,KAChD,eAAgBA,EAAI,cAAgB,KACpC,aAAcH,EAAe,CACjC,CACJ,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"device.js","names":[],"sources":["../../src/perf/device.ts"],"sourcesContent":["import type { DeviceProfile } from \"./types\";\n\n/**\n * What the browser will tell us about the machine it is running on.\n */\n\nconst BYTES_PER_MIB = 1024 * 1024;\n\n/** `navigator.deviceMemory` is Chromium-only and absent from the DOM lib. */\ninterface DeviceMemoryNavigator extends Navigator {\n deviceMemory?: number;\n}\n\n/** `performance.memory` is a non-standard Chromium extension. */\ninterface HeapPerformance extends Performance {\n memory?: { usedJSHeapSize: number };\n}\n\n/**\n * Used JS heap in MiB, rounded to one decimal.\n *\n * @returns The heap usage, or `null` outside Chromium.\n */\nfunction readHeapUsedMb(): number | null {\n if (typeof performance === \"undefined\") return null;\n const memory = (performance as HeapPerformance).memory;\n if (!memory) return null;\n return Math.round((memory.usedJSHeapSize / BYTES_PER_MIB) * 10) / 10;\n}\n\n/**\n * Sample the device capabilities the browser reports.\n *\n * Safe to call during SSR: without a `navigator` every field is `null`.\n *\n * @returns The profile, with `null` for anything this platform withholds.\n *\n * @example\n * ```typescript\n * const device = readDeviceProfile();\n * console.log(device.hardwareConcurrency); // 8\n * console.log(device.deviceMemoryGb); // 8 on Chromium, null on Safari\n * ```\n */\nexport function readDeviceProfile(): DeviceProfile {\n if (typeof navigator === \"undefined\") {\n return { hardwareConcurrency: null, deviceMemoryGb: null, jsHeapUsedMb: null };\n }\n const nav = navigator as DeviceMemoryNavigator;\n return {\n hardwareConcurrency: nav.hardwareConcurrency ?? null,\n deviceMemoryGb: nav.deviceMemory ?? null,\n jsHeapUsedMb: readHeapUsedMb(),\n };\n}\n"],"mappings":"AAuBA,SAAS,IAAgC;CACrC,IAAI,OAAO,cAAgB,KAAa,OAAO;CAC/C,IAAM,IAAU,YAAgC;CAEhD,OADK,IACE,KAAK,MAAO,EAAO,iBAAiB,UAAiB,EAAE,IAAI,KAD9C;AAExB;AAgBA,SAAgB,IAAmC;CAC/C,IAAI,OAAO,YAAc,KACrB,OAAO;EAAE,qBAAqB;EAAM,gBAAgB;EAAM,cAAc;CAAK;CAEjF,IAAM,IAAM;CACZ,OAAO;EACH,qBAAqB,EAAI,uBAAuB;EAChD,gBAAgB,EAAI,gBAAgB;EACpC,cAAc,EAAe;CACjC;AACJ"}
1
+ {"version":3,"file":"device.js","names":["readHeapUsedMb","memory","readDeviceProfile","nav"],"sources":["../../src/perf/device.ts"],"sourcesContent":["import type { DeviceProfile } from \"./types\";\n\n/**\n * What the browser will tell us about the machine it is running on.\n */\n\nconst BYTES_PER_MIB = 1024 * 1024;\n\n/** `navigator.deviceMemory` is Chromium-only and absent from the DOM lib. */\ninterface DeviceMemoryNavigator extends Navigator {\n deviceMemory?: number;\n}\n\n/** `performance.memory` is a non-standard Chromium extension. */\ninterface HeapPerformance extends Performance {\n memory?: { usedJSHeapSize: number };\n}\n\n/**\n * Used JS heap in MiB, rounded to one decimal.\n *\n * @returns The heap usage, or `null` outside Chromium.\n */\nfunction readHeapUsedMb(): number | null {\n if (typeof performance === \"undefined\") return null;\n const memory = (performance as HeapPerformance).memory;\n if (!memory) return null;\n return Math.round((memory.usedJSHeapSize / BYTES_PER_MIB) * 10) / 10;\n}\n\n/**\n * Sample the device capabilities the browser reports.\n *\n * Safe to call during SSR: without a `navigator` every field is `null`.\n *\n * @returns The profile, with `null` for anything this platform withholds.\n *\n * @example\n * ```typescript\n * const device = readDeviceProfile();\n * console.log(device.hardwareConcurrency); // 8\n * console.log(device.deviceMemoryGb); // 8 on Chromium, null on Safari\n * ```\n */\nexport function readDeviceProfile(): DeviceProfile {\n if (typeof navigator === \"undefined\") {\n return { hardwareConcurrency: null, deviceMemoryGb: null, jsHeapUsedMb: null };\n }\n const nav = navigator as DeviceMemoryNavigator;\n return {\n hardwareConcurrency: nav.hardwareConcurrency ?? null,\n deviceMemoryGb: nav.deviceMemory ?? null,\n jsHeapUsedMb: readHeapUsedMb(),\n };\n}\n"],"mappings":"AAuBA,SAASA,IAAgC;CACrC,IAAI,OAAO,cAAgB,KAAa,OAAO;CAC/C,IAAMC,IAAU,YAAgC;CAEhD,OADKA,IACE,KAAK,MAAOA,EAAO,iBAAiB,UAAiB,EAAE,IAAI,KAD9C;AAExB;AAgBA,SAAgBC,IAAmC;CAC/C,IAAI,OAAO,YAAc,KACrB,OAAO;EAAE,qBAAqB;EAAM,gBAAgB;EAAM,cAAc;CAAK;CAEjF,IAAMC,IAAM;CACZ,OAAO;EACH,qBAAqBA,EAAI,uBAAuB;EAChD,gBAAgBA,EAAI,gBAAgB;EACpC,cAAcH,EAAe;CACjC;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"format.cjs","names":[],"sources":["../../src/perf/format.ts"],"sourcesContent":["/**\n * Rendering helpers for the numbers a profiler produces.\n */\n\n/**\n * Format a millisecond duration for display.\n *\n * Sub-second values keep millisecond resolution — the interesting range for a\n * single forward pass — and anything longer switches to seconds so a cold\n * start that pays a model download does not read as a five-digit number.\n * Durations under `1 ms` render as `\"<1 ms\"` rather than `\"0 ms\"`, which\n * would read as \"not measured\".\n *\n * @param value Duration in milliseconds.\n * @returns The formatted string, or `\"—\"` for a non-finite or negative input.\n *\n * @example\n * ```typescript\n * formatDurationMs(0.04); // \"<1 ms\"\n * formatDurationMs(142.6); // \"143 ms\"\n * formatDurationMs(4321); // \"4.32 s\"\n * formatDurationMs(NaN); // \"—\"\n * ```\n */\nexport function formatDurationMs(value: number): string {\n if (!Number.isFinite(value) || value < 0) return \"—\";\n if (value < 1) return \"<1 ms\";\n if (value < 1000) return `${Math.round(value)} ms`;\n return `${(value / 1000).toFixed(2)} s`;\n}\n"],"mappings":"AAwBA,SAAgB,EAAiB,EAAuB,CAIpD,MAHI,CAAC,OAAO,SAAS,CAAK,GAAK,EAAQ,EAAU,IAC7C,EAAQ,EAAU,QAClB,EAAQ,IAAa,GAAG,KAAK,MAAM,CAAK,EAAE,KACvC,IAAI,EAAQ,IAAA,CAAM,QAAQ,CAAC,EAAE,GACxC"}
1
+ {"version":3,"file":"format.cjs","names":["formatDurationMs","value"],"sources":["../../src/perf/format.ts"],"sourcesContent":["/**\n * Rendering helpers for the numbers a profiler produces.\n */\n\n/**\n * Format a millisecond duration for display.\n *\n * Sub-second values keep millisecond resolution — the interesting range for a\n * single forward pass — and anything longer switches to seconds so a cold\n * start that pays a model download does not read as a five-digit number.\n * Durations under `1 ms` render as `\"<1 ms\"` rather than `\"0 ms\"`, which\n * would read as \"not measured\".\n *\n * @param value Duration in milliseconds.\n * @returns The formatted string, or `\"—\"` for a non-finite or negative input.\n *\n * @example\n * ```typescript\n * formatDurationMs(0.04); // \"<1 ms\"\n * formatDurationMs(142.6); // \"143 ms\"\n * formatDurationMs(4321); // \"4.32 s\"\n * formatDurationMs(NaN); // \"—\"\n * ```\n */\nexport function formatDurationMs(value: number): string {\n if (!Number.isFinite(value) || value < 0) return \"—\";\n if (value < 1) return \"<1 ms\";\n if (value < 1000) return `${Math.round(value)} ms`;\n return `${(value / 1000).toFixed(2)} s`;\n}\n"],"mappings":"AAwBA,SAAgBA,EAAiB,EAAuB,CAIpD,MAHI,CAAC,OAAO,SAASC,CAAK,GAAKA,EAAQ,EAAU,IAC7CA,EAAQ,EAAU,QAClBA,EAAQ,IAAa,GAAG,KAAK,MAAMA,CAAK,EAAE,KACvC,IAAIA,EAAQ,IAAA,CAAM,QAAQ,CAAC,EAAE,GACxC,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","names":[],"sources":["../../src/perf/format.ts"],"sourcesContent":["/**\n * Rendering helpers for the numbers a profiler produces.\n */\n\n/**\n * Format a millisecond duration for display.\n *\n * Sub-second values keep millisecond resolution — the interesting range for a\n * single forward pass — and anything longer switches to seconds so a cold\n * start that pays a model download does not read as a five-digit number.\n * Durations under `1 ms` render as `\"<1 ms\"` rather than `\"0 ms\"`, which\n * would read as \"not measured\".\n *\n * @param value Duration in milliseconds.\n * @returns The formatted string, or `\"—\"` for a non-finite or negative input.\n *\n * @example\n * ```typescript\n * formatDurationMs(0.04); // \"<1 ms\"\n * formatDurationMs(142.6); // \"143 ms\"\n * formatDurationMs(4321); // \"4.32 s\"\n * formatDurationMs(NaN); // \"—\"\n * ```\n */\nexport function formatDurationMs(value: number): string {\n if (!Number.isFinite(value) || value < 0) return \"—\";\n if (value < 1) return \"<1 ms\";\n if (value < 1000) return `${Math.round(value)} ms`;\n return `${(value / 1000).toFixed(2)} s`;\n}\n"],"mappings":";AAwBA,SAAgB,EAAiB,GAAuB;CAIpD,OAHI,CAAC,OAAO,SAAS,CAAK,KAAK,IAAQ,IAAU,MAC7C,IAAQ,IAAU,UAClB,IAAQ,MAAa,GAAG,KAAK,MAAM,CAAK,EAAE,OACvC,IAAI,IAAQ,IAAA,CAAM,QAAQ,CAAC,EAAE;AACxC"}
1
+ {"version":3,"file":"format.js","names":["formatDurationMs","value"],"sources":["../../src/perf/format.ts"],"sourcesContent":["/**\n * Rendering helpers for the numbers a profiler produces.\n */\n\n/**\n * Format a millisecond duration for display.\n *\n * Sub-second values keep millisecond resolution — the interesting range for a\n * single forward pass — and anything longer switches to seconds so a cold\n * start that pays a model download does not read as a five-digit number.\n * Durations under `1 ms` render as `\"<1 ms\"` rather than `\"0 ms\"`, which\n * would read as \"not measured\".\n *\n * @param value Duration in milliseconds.\n * @returns The formatted string, or `\"—\"` for a non-finite or negative input.\n *\n * @example\n * ```typescript\n * formatDurationMs(0.04); // \"<1 ms\"\n * formatDurationMs(142.6); // \"143 ms\"\n * formatDurationMs(4321); // \"4.32 s\"\n * formatDurationMs(NaN); // \"—\"\n * ```\n */\nexport function formatDurationMs(value: number): string {\n if (!Number.isFinite(value) || value < 0) return \"—\";\n if (value < 1) return \"<1 ms\";\n if (value < 1000) return `${Math.round(value)} ms`;\n return `${(value / 1000).toFixed(2)} s`;\n}\n"],"mappings":";AAwBA,SAAgBA,EAAiB,GAAuB;CAIpD,OAHI,CAAC,OAAO,SAASC,CAAK,KAAKA,IAAQ,IAAU,MAC7CA,IAAQ,IAAU,UAClBA,IAAQ,MAAa,GAAG,KAAK,MAAMA,CAAK,EAAE,OACvC,IAAIA,IAAQ,IAAA,CAAM,QAAQ,CAAC,EAAE;AACxC"}
@@ -1 +1 @@
1
- {"version":3,"file":"profiler.cjs","names":[],"sources":["../../src/perf/profiler.ts"],"sourcesContent":["import { cachedResponseBytes } from \"./cache-size\";\nimport { readDeviceProfile } from \"./device\";\nimport type {\n InferenceProfiler,\n InferenceReport,\n InferenceReportOptions,\n ProfiledModelSize,\n} from \"./types\";\n\n/**\n * Timing and cost accounting for a pipeline that runs on the user's device.\n */\n\n/**\n * Create a profiler for one run of a pipeline.\n *\n * Wrap each step in {@link InferenceProfiler.stage}, fold in durations you\n * already have (an SDK `speed` breakdown, say) with\n * {@link InferenceProfiler.mark}, then call `report()` once the run finishes.\n *\n * Stages are timed independently rather than as a tiling of the run, so\n * concurrent work is charged its real wall-clock span to each stage and the\n * timings can sum to more than `totalMs`. Surface that to users when you\n * render the breakdown — a bar chart implying a partition of the total would\n * be wrong for a pipeline that overlaps stages.\n *\n * @returns A profiler bound to the moment it was created.\n *\n * @example\n * ```typescript\n * import { createInferenceProfiler } from \"tempest-react-sdk\";\n * import { Detector } from \"tempest-react-sdk/vision\";\n *\n * const profiler = createInferenceProfiler();\n * const detector = await profiler.stage(\"load-model\", () =>\n * Detector.create(\"/models/detect.onnx\"),\n * );\n * const results = await profiler.stage(\"detect\", () => detector.predict(blob));\n * profiler.mark(\"forward-pass\", results[0].speed.inference);\n *\n * const report = await profiler.report({\n * models: [\n * { name: \"detector\", cacheName: \"app-models\", url: \"/models/detect.onnx\" },\n * ],\n * });\n * console.log(report.timings, report.totalMs, report.device, report.models);\n * ```\n */\nexport function createInferenceProfiler(): InferenceProfiler {\n const startedAt = performance.now();\n const timings = new Map<string, number>();\n\n const add = (name: string, durationMs: number): void => {\n timings.set(name, (timings.get(name) ?? 0) + durationMs);\n };\n\n return {\n async stage<T>(name: string, run: () => Promise<T>): Promise<T> {\n const from = performance.now();\n try {\n return await run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n stageSync<T>(name: string, run: () => T): T {\n const from = performance.now();\n try {\n return run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n mark(name: string, durationMs: number): void {\n add(name, durationMs);\n },\n\n async report(options: InferenceReportOptions = {}): Promise<InferenceReport> {\n const totalMs = performance.now() - startedAt;\n const models: ProfiledModelSize[] = await Promise.all(\n (options.models ?? []).map(async (model) => ({\n name: model.name,\n bytes: await cachedResponseBytes(model.cacheName, model.url),\n })),\n );\n\n return {\n timings: Object.fromEntries(timings),\n totalMs,\n device: readDeviceProfile(),\n models,\n measuredAt: Date.now(),\n };\n },\n };\n}\n"],"mappings":"8DAgDA,SAAgB,GAA6C,CACzD,IAAM,EAAY,YAAY,IAAI,EAC5B,EAAU,IAAI,IAEd,GAAO,EAAc,IAA6B,CACpD,EAAQ,IAAI,GAAO,EAAQ,IAAI,CAAI,GAAK,GAAK,CAAU,CAC3D,EAEA,MAAO,CACH,MAAM,MAAS,EAAc,EAAmC,CAC5D,IAAM,EAAO,YAAY,IAAI,EAC7B,GAAI,CACA,OAAO,MAAM,EAAI,CACrB,QAAU,CACN,EAAI,EAAM,YAAY,IAAI,EAAI,CAAI,CACtC,CACJ,EAEA,UAAa,EAAc,EAAiB,CACxC,IAAM,EAAO,YAAY,IAAI,EAC7B,GAAI,CACA,OAAO,EAAI,CACf,QAAU,CACN,EAAI,EAAM,YAAY,IAAI,EAAI,CAAI,CACtC,CACJ,EAEA,KAAK,EAAc,EAA0B,CACzC,EAAI,EAAM,CAAU,CACxB,EAEA,MAAM,OAAO,EAAkC,CAAC,EAA6B,CACzE,IAAM,EAAU,YAAY,IAAI,EAAI,EAC9B,EAA8B,MAAM,QAAQ,KAC7C,EAAQ,QAAU,CAAC,EAAA,CAAG,IAAI,KAAO,KAAW,CACzC,KAAM,EAAM,KACZ,MAAO,MAAM,EAAA,oBAAoB,EAAM,UAAW,EAAM,GAAG,CAC/D,EAAE,CACN,EAEA,MAAO,CACH,QAAS,OAAO,YAAY,CAAO,EACnC,UACA,OAAQ,EAAA,kBAAkB,EAC1B,SACA,WAAY,KAAK,IAAI,CACzB,CACJ,CACJ,CACJ"}
1
+ {"version":3,"file":"profiler.cjs","names":["cachedResponseBytes","readDeviceProfile","require_cache_size","require_device","createInferenceProfiler","startedAt","timings","add","name","durationMs","from","run","totalMs","models","options","model"],"sources":["../../src/perf/profiler.ts"],"sourcesContent":["import { cachedResponseBytes } from \"./cache-size\";\nimport { readDeviceProfile } from \"./device\";\nimport type {\n InferenceProfiler,\n InferenceReport,\n InferenceReportOptions,\n ProfiledModelSize,\n} from \"./types\";\n\n/**\n * Timing and cost accounting for a pipeline that runs on the user's device.\n */\n\n/**\n * Create a profiler for one run of a pipeline.\n *\n * Wrap each step in {@link InferenceProfiler.stage}, fold in durations you\n * already have (an SDK `speed` breakdown, say) with\n * {@link InferenceProfiler.mark}, then call `report()` once the run finishes.\n *\n * Stages are timed independently rather than as a tiling of the run, so\n * concurrent work is charged its real wall-clock span to each stage and the\n * timings can sum to more than `totalMs`. Surface that to users when you\n * render the breakdown — a bar chart implying a partition of the total would\n * be wrong for a pipeline that overlaps stages.\n *\n * @returns A profiler bound to the moment it was created.\n *\n * @example\n * ```typescript\n * import { createInferenceProfiler } from \"tempest-react-sdk\";\n * import { Detector } from \"tempest-react-sdk/vision\";\n *\n * const profiler = createInferenceProfiler();\n * const detector = await profiler.stage(\"load-model\", () =>\n * Detector.create(\"/models/detect.onnx\"),\n * );\n * const results = await profiler.stage(\"detect\", () => detector.predict(blob));\n * profiler.mark(\"forward-pass\", results[0].speed.inference);\n *\n * const report = await profiler.report({\n * models: [\n * { name: \"detector\", cacheName: \"app-models\", url: \"/models/detect.onnx\" },\n * ],\n * });\n * console.log(report.timings, report.totalMs, report.device, report.models);\n * ```\n */\nexport function createInferenceProfiler(): InferenceProfiler {\n const startedAt = performance.now();\n const timings = new Map<string, number>();\n\n const add = (name: string, durationMs: number): void => {\n timings.set(name, (timings.get(name) ?? 0) + durationMs);\n };\n\n return {\n async stage<T>(name: string, run: () => Promise<T>): Promise<T> {\n const from = performance.now();\n try {\n return await run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n stageSync<T>(name: string, run: () => T): T {\n const from = performance.now();\n try {\n return run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n mark(name: string, durationMs: number): void {\n add(name, durationMs);\n },\n\n async report(options: InferenceReportOptions = {}): Promise<InferenceReport> {\n const totalMs = performance.now() - startedAt;\n const models: ProfiledModelSize[] = await Promise.all(\n (options.models ?? []).map(async (model) => ({\n name: model.name,\n bytes: await cachedResponseBytes(model.cacheName, model.url),\n })),\n );\n\n return {\n timings: Object.fromEntries(timings),\n totalMs,\n device: readDeviceProfile(),\n models,\n measuredAt: Date.now(),\n };\n },\n };\n}\n"],"mappings":"A,8DAgDA,SAAgBI,GAA6C,CACzD,IAAMC,EAAY,YAAY,IAAI,EAC5BC,EAAU,IAAI,IAEdC,GAAO,EAAc,IAA6B,CACpDD,EAAQ,IAAIE,GAAOF,EAAQ,IAAIE,CAAI,GAAK,GAAKC,CAAU,CAC3D,EAEA,MAAO,CACH,MAAM,MAAS,EAAc,EAAmC,CAC5D,IAAMC,EAAO,YAAY,IAAI,EAC7B,GAAI,CACA,OAAO,MAAMC,EAAI,CACrB,QAAU,CACNJ,EAAIC,EAAM,YAAY,IAAI,EAAIE,CAAI,CACtC,CACJ,EAEA,UAAa,EAAc,EAAiB,CACxC,IAAMA,EAAO,YAAY,IAAI,EAC7B,GAAI,CACA,OAAOC,EAAI,CACf,QAAU,CACNJ,EAAIC,EAAM,YAAY,IAAI,EAAIE,CAAI,CACtC,CACJ,EAEA,KAAK,EAAc,EAA0B,CACzCH,EAAIC,EAAMC,CAAU,CACxB,EAEA,MAAM,OAAO,EAAkC,CAAC,EAA6B,CACzE,IAAMG,EAAU,YAAY,IAAI,EAAIP,EAC9BQ,EAA8B,MAAM,QAAQ,KAC7CC,EAAQ,QAAU,CAAC,EAAA,CAAG,IAAI,KAAO,KAAW,CACzC,KAAMC,EAAM,KACZ,MAAO,MAAMf,EAAAA,oBAAoBe,EAAM,UAAWA,EAAM,GAAG,CAC/D,EAAE,CACN,EAEA,MAAO,CACH,QAAS,OAAO,YAAYT,CAAO,EACnC,UACA,OAAQL,EAAAA,kBAAkB,EAC1B,SACA,WAAY,KAAK,IAAI,CACzB,CACJ,CACJ,CACJ,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"profiler.js","names":[],"sources":["../../src/perf/profiler.ts"],"sourcesContent":["import { cachedResponseBytes } from \"./cache-size\";\nimport { readDeviceProfile } from \"./device\";\nimport type {\n InferenceProfiler,\n InferenceReport,\n InferenceReportOptions,\n ProfiledModelSize,\n} from \"./types\";\n\n/**\n * Timing and cost accounting for a pipeline that runs on the user's device.\n */\n\n/**\n * Create a profiler for one run of a pipeline.\n *\n * Wrap each step in {@link InferenceProfiler.stage}, fold in durations you\n * already have (an SDK `speed` breakdown, say) with\n * {@link InferenceProfiler.mark}, then call `report()` once the run finishes.\n *\n * Stages are timed independently rather than as a tiling of the run, so\n * concurrent work is charged its real wall-clock span to each stage and the\n * timings can sum to more than `totalMs`. Surface that to users when you\n * render the breakdown — a bar chart implying a partition of the total would\n * be wrong for a pipeline that overlaps stages.\n *\n * @returns A profiler bound to the moment it was created.\n *\n * @example\n * ```typescript\n * import { createInferenceProfiler } from \"tempest-react-sdk\";\n * import { Detector } from \"tempest-react-sdk/vision\";\n *\n * const profiler = createInferenceProfiler();\n * const detector = await profiler.stage(\"load-model\", () =>\n * Detector.create(\"/models/detect.onnx\"),\n * );\n * const results = await profiler.stage(\"detect\", () => detector.predict(blob));\n * profiler.mark(\"forward-pass\", results[0].speed.inference);\n *\n * const report = await profiler.report({\n * models: [\n * { name: \"detector\", cacheName: \"app-models\", url: \"/models/detect.onnx\" },\n * ],\n * });\n * console.log(report.timings, report.totalMs, report.device, report.models);\n * ```\n */\nexport function createInferenceProfiler(): InferenceProfiler {\n const startedAt = performance.now();\n const timings = new Map<string, number>();\n\n const add = (name: string, durationMs: number): void => {\n timings.set(name, (timings.get(name) ?? 0) + durationMs);\n };\n\n return {\n async stage<T>(name: string, run: () => Promise<T>): Promise<T> {\n const from = performance.now();\n try {\n return await run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n stageSync<T>(name: string, run: () => T): T {\n const from = performance.now();\n try {\n return run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n mark(name: string, durationMs: number): void {\n add(name, durationMs);\n },\n\n async report(options: InferenceReportOptions = {}): Promise<InferenceReport> {\n const totalMs = performance.now() - startedAt;\n const models: ProfiledModelSize[] = await Promise.all(\n (options.models ?? []).map(async (model) => ({\n name: model.name,\n bytes: await cachedResponseBytes(model.cacheName, model.url),\n })),\n );\n\n return {\n timings: Object.fromEntries(timings),\n totalMs,\n device: readDeviceProfile(),\n models,\n measuredAt: Date.now(),\n };\n },\n };\n}\n"],"mappings":";;;AAgDA,SAAgB,IAA6C;CACzD,IAAM,IAAY,YAAY,IAAI,GAC5B,oBAAU,IAAI,IAAoB,GAElC,KAAO,GAAc,MAA6B;EACpD,EAAQ,IAAI,IAAO,EAAQ,IAAI,CAAI,KAAK,KAAK,CAAU;CAC3D;CAEA,OAAO;EACH,MAAM,MAAS,GAAc,GAAmC;GAC5D,IAAM,IAAO,YAAY,IAAI;GAC7B,IAAI;IACA,OAAO,MAAM,EAAI;GACrB,UAAU;IACN,EAAI,GAAM,YAAY,IAAI,IAAI,CAAI;GACtC;EACJ;EAEA,UAAa,GAAc,GAAiB;GACxC,IAAM,IAAO,YAAY,IAAI;GAC7B,IAAI;IACA,OAAO,EAAI;GACf,UAAU;IACN,EAAI,GAAM,YAAY,IAAI,IAAI,CAAI;GACtC;EACJ;EAEA,KAAK,GAAc,GAA0B;GACzC,EAAI,GAAM,CAAU;EACxB;EAEA,MAAM,OAAO,IAAkC,CAAC,GAA6B;GACzE,IAAM,IAAU,YAAY,IAAI,IAAI,GAC9B,IAA8B,MAAM,QAAQ,KAC7C,EAAQ,UAAU,CAAC,EAAA,CAAG,IAAI,OAAO,OAAW;IACzC,MAAM,EAAM;IACZ,OAAO,MAAM,EAAoB,EAAM,WAAW,EAAM,GAAG;GAC/D,EAAE,CACN;GAEA,OAAO;IACH,SAAS,OAAO,YAAY,CAAO;IACnC;IACA,QAAQ,EAAkB;IAC1B;IACA,YAAY,KAAK,IAAI;GACzB;EACJ;CACJ;AACJ"}
1
+ {"version":3,"file":"profiler.js","names":["createInferenceProfiler","startedAt","timings","add","name","durationMs","from","run","totalMs","models","options","model","cachedResponseBytes","readDeviceProfile"],"sources":["../../src/perf/profiler.ts"],"sourcesContent":["import { cachedResponseBytes } from \"./cache-size\";\nimport { readDeviceProfile } from \"./device\";\nimport type {\n InferenceProfiler,\n InferenceReport,\n InferenceReportOptions,\n ProfiledModelSize,\n} from \"./types\";\n\n/**\n * Timing and cost accounting for a pipeline that runs on the user's device.\n */\n\n/**\n * Create a profiler for one run of a pipeline.\n *\n * Wrap each step in {@link InferenceProfiler.stage}, fold in durations you\n * already have (an SDK `speed` breakdown, say) with\n * {@link InferenceProfiler.mark}, then call `report()` once the run finishes.\n *\n * Stages are timed independently rather than as a tiling of the run, so\n * concurrent work is charged its real wall-clock span to each stage and the\n * timings can sum to more than `totalMs`. Surface that to users when you\n * render the breakdown — a bar chart implying a partition of the total would\n * be wrong for a pipeline that overlaps stages.\n *\n * @returns A profiler bound to the moment it was created.\n *\n * @example\n * ```typescript\n * import { createInferenceProfiler } from \"tempest-react-sdk\";\n * import { Detector } from \"tempest-react-sdk/vision\";\n *\n * const profiler = createInferenceProfiler();\n * const detector = await profiler.stage(\"load-model\", () =>\n * Detector.create(\"/models/detect.onnx\"),\n * );\n * const results = await profiler.stage(\"detect\", () => detector.predict(blob));\n * profiler.mark(\"forward-pass\", results[0].speed.inference);\n *\n * const report = await profiler.report({\n * models: [\n * { name: \"detector\", cacheName: \"app-models\", url: \"/models/detect.onnx\" },\n * ],\n * });\n * console.log(report.timings, report.totalMs, report.device, report.models);\n * ```\n */\nexport function createInferenceProfiler(): InferenceProfiler {\n const startedAt = performance.now();\n const timings = new Map<string, number>();\n\n const add = (name: string, durationMs: number): void => {\n timings.set(name, (timings.get(name) ?? 0) + durationMs);\n };\n\n return {\n async stage<T>(name: string, run: () => Promise<T>): Promise<T> {\n const from = performance.now();\n try {\n return await run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n stageSync<T>(name: string, run: () => T): T {\n const from = performance.now();\n try {\n return run();\n } finally {\n add(name, performance.now() - from);\n }\n },\n\n mark(name: string, durationMs: number): void {\n add(name, durationMs);\n },\n\n async report(options: InferenceReportOptions = {}): Promise<InferenceReport> {\n const totalMs = performance.now() - startedAt;\n const models: ProfiledModelSize[] = await Promise.all(\n (options.models ?? []).map(async (model) => ({\n name: model.name,\n bytes: await cachedResponseBytes(model.cacheName, model.url),\n })),\n );\n\n return {\n timings: Object.fromEntries(timings),\n totalMs,\n device: readDeviceProfile(),\n models,\n measuredAt: Date.now(),\n };\n },\n };\n}\n"],"mappings":";;;AAgDA,SAAgBA,IAA6C;CACzD,IAAMC,IAAY,YAAY,IAAI,GAC5BC,oBAAU,IAAI,IAAoB,GAElCC,KAAO,GAAc,MAA6B;EACpD,EAAQ,IAAIC,IAAOF,EAAQ,IAAIE,CAAI,KAAK,KAAKC,CAAU;CAC3D;CAEA,OAAO;EACH,MAAM,MAAS,GAAc,GAAmC;GAC5D,IAAMC,IAAO,YAAY,IAAI;GAC7B,IAAI;IACA,OAAO,MAAMC,EAAI;GACrB,UAAU;IACN,EAAIH,GAAM,YAAY,IAAI,IAAIE,CAAI;GACtC;EACJ;EAEA,UAAa,GAAc,GAAiB;GACxC,IAAMA,IAAO,YAAY,IAAI;GAC7B,IAAI;IACA,OAAOC,EAAI;GACf,UAAU;IACN,EAAIH,GAAM,YAAY,IAAI,IAAIE,CAAI;GACtC;EACJ;EAEA,KAAK,GAAc,GAA0B;GACzC,EAAIF,GAAMC,CAAU;EACxB;EAEA,MAAM,OAAO,IAAkC,CAAC,GAA6B;GACzE,IAAMG,IAAU,YAAY,IAAI,IAAIP,GAC9BQ,IAA8B,MAAM,QAAQ,KAC7CC,EAAQ,UAAU,CAAC,EAAA,CAAG,IAAI,OAAO,OAAW;IACzC,MAAMC,EAAM;IACZ,OAAO,MAAMC,EAAoBD,EAAM,WAAWA,EAAM,GAAG;GAC/D,EAAE,CACN;GAEA,OAAO;IACH,SAAS,OAAO,YAAYT,CAAO;IACnC;IACA,QAAQW,EAAkB;IAC1B;IACA,YAAY,KAAK,IAAI;GACzB;EACJ;CACJ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-push-subscription.cjs","names":[],"sources":["../../src/push/use-push-subscription.ts"],"sourcesContent":["/* eslint-disable react-hooks/refs -- the ref is read inside deferred callbacks, not during render */\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useLatestRef } from \"@/hooks/use-latest-ref\";\nimport {\n WebPushClient,\n WebPushUnsubscribeError,\n type WebPushClientConfig,\n} from \"./web-push-client\";\nimport { isPushSupported } from \"./utils\";\n\nexport interface UsePushSubscriptionResult {\n /** True when the browser exposes the Push + Notification APIs. */\n supported: boolean;\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission: NotificationPermission | \"unsupported\";\n /** True when a subscription is active on this device. */\n subscribed: boolean;\n /** True while a subscribe/unsubscribe call is in-flight. */\n loading: boolean;\n /** Last error thrown by subscribe/unsubscribe, if any. */\n error: Error | null;\n subscribe: () => Promise<void>;\n unsubscribe: () => Promise<void>;\n /** Re-read the current subscription/permission state from the browser. */\n refresh: () => Promise<void>;\n}\n\n/**\n * React hook around {@link WebPushClient}. Tracks subscription, permission and\n * loading state; exposes imperative `subscribe`/`unsubscribe` actions.\n *\n * The hook does NOT register the service worker — the host app must do that\n * (e.g. via `vite-plugin-pwa` or a manual `navigator.serviceWorker.register`).\n *\n * @example\n * const push = usePushSubscription({\n * vapidPublicKey: import.meta.env.VITE_VAPID_PUBLIC_KEY,\n * onSubscribe: (sub) => api.post(\"/webpush/subscribe\", { body: sub }),\n * onUnsubscribe: () => api.delete(\"/webpush/my\"),\n * });\n */\nexport function usePushSubscription(config: WebPushClientConfig): UsePushSubscriptionResult {\n const configRef = useLatestRef(config);\n\n const client = useMemo(\n () =>\n new WebPushClient({\n vapidPublicKey: config.vapidPublicKey,\n onSubscribe: (sub) => configRef.current.onSubscribe(sub),\n onUnsubscribe: (sub) => configRef.current.onUnsubscribe?.(sub),\n getRegistration: config.getRegistration,\n }),\n [config.vapidPublicKey, config.getRegistration, configRef],\n );\n\n const [supported] = useState<boolean>(() => isPushSupported());\n const [permission, setPermission] = useState<NotificationPermission | \"unsupported\">(() =>\n client.permission(),\n );\n const [subscribed, setSubscribed] = useState<boolean>(false);\n const [loading, setLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n const refresh = useCallback(async () => {\n if (!supported) return;\n setPermission(client.permission());\n try {\n const active = await client.isSubscribed();\n setSubscribed(active);\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n }\n }, [client, supported]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const subscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.subscribe();\n setSubscribed(true);\n setPermission(client.permission());\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n const unsubscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.unsubscribe();\n setSubscribed(false);\n } catch (err) {\n if (err instanceof WebPushUnsubscribeError) setSubscribed(!err.browserUnsubscribed);\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n return {\n supported,\n permission,\n subscribed,\n loading,\n error,\n subscribe,\n unsubscribe,\n refresh,\n };\n}\n"],"mappings":"kIAyCA,SAAgB,EAAoB,EAAwD,CACxF,IAAM,EAAY,EAAA,aAAa,CAAM,EAE/B,GAAA,EAAS,EAAA,QAAA,KAEP,IAAI,EAAA,cAAc,CACd,eAAgB,EAAO,eACvB,YAAc,GAAQ,EAAU,QAAQ,YAAY,CAAG,EACvD,cAAgB,GAAQ,EAAU,QAAQ,gBAAgB,CAAG,EAC7D,gBAAiB,EAAO,eAC5B,CAAC,EACL,CAAC,EAAO,eAAgB,EAAO,gBAAiB,CAAS,CAC7D,EAEM,CAAC,IAAA,EAAa,EAAA,SAAA,KAAwB,EAAA,gBAAgB,CAAC,EACvD,CAAC,EAAY,IAAA,EAAiB,EAAA,SAAA,KAChC,EAAO,WAAW,CACtB,EACM,CAAC,EAAY,IAAA,EAAiB,EAAA,SAAA,CAAkB,EAAK,EACrD,CAAC,EAAS,IAAA,EAAc,EAAA,SAAA,CAAkB,EAAK,EAC/C,CAAC,EAAO,IAAA,EAAY,EAAA,SAAA,CAAuB,IAAI,EAE/C,GAAA,EAAU,EAAA,YAAA,CAAY,SAAY,CAC/B,KACL,GAAc,EAAO,WAAW,CAAC,EACjC,GAAI,CACA,IAAM,EAAS,MAAM,EAAO,aAAa,EACzC,EAAc,CAAM,CACxB,OAAS,EAAK,CACV,EAAS,aAAe,MAAQ,EAAU,MAAM,OAAO,CAAG,CAAC,CAAC,CAChE,CANiC,CAOrC,EAAG,CAAC,EAAQ,CAAS,CAAC,EAsCtB,OApCA,EAAA,EAAA,UAAA,KAAgB,CACZ,EAAa,CACjB,EAAG,CAAC,CAAO,CAAC,EAkCL,CACH,YACA,aACA,aACA,UACA,QACA,WAAA,EAtCc,EAAA,YAAA,CAAY,SAAY,CACjC,KAEL,CADA,EAAW,EAAI,EACf,EAAS,IAAI,EACb,GAAI,CACA,MAAM,EAAO,UAAU,EACvB,EAAc,EAAI,EAClB,EAAc,EAAO,WAAW,CAAC,CACrC,OAAS,EAAK,CAEV,MADA,EAAS,aAAe,MAAQ,EAAU,MAAM,OAAO,CAAG,CAAC,CAAC,EACtD,CACV,QAAU,CACN,EAAW,EAAK,CACpB,CAVa,CAWjB,EAAG,CAAC,EAAQ,CAAS,CAwBjB,EACA,aAAA,EAvBgB,EAAA,YAAA,CAAY,SAAY,CACnC,KAEL,CADA,EAAW,EAAI,EACf,EAAS,IAAI,EACb,GAAI,CACA,MAAM,EAAO,YAAY,EACzB,EAAc,EAAK,CACvB,OAAS,EAAK,CAGV,MAFI,aAAe,EAAA,yBAAyB,EAAc,CAAC,EAAI,mBAAmB,EAClF,EAAS,aAAe,MAAQ,EAAU,MAAM,OAAO,CAAG,CAAC,CAAC,EACtD,CACV,QAAU,CACN,EAAW,EAAK,CACpB,CAVa,CAWjB,EAAG,CAAC,EAAQ,CAAS,CASjB,EACA,SACJ,CACJ"}
1
+ {"version":3,"file":"use-push-subscription.cjs","names":["useLatestRef","useMemo","WebPushClient","useState","isPushSupported","useCallback","WebPushUnsubscribeError","require_use_latest_ref","require_utils","require_web_push_client","react","usePushSubscription","configRef","config","client","sub","supported","permission","setPermission","subscribed","setSubscribed","loading","setLoading","error","setError","refresh","active","err"],"sources":["../../src/push/use-push-subscription.ts"],"sourcesContent":["/* eslint-disable react-hooks/refs -- the ref is read inside deferred callbacks, not during render */\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useLatestRef } from \"@/hooks/use-latest-ref\";\nimport {\n WebPushClient,\n WebPushUnsubscribeError,\n type WebPushClientConfig,\n} from \"./web-push-client\";\nimport { isPushSupported } from \"./utils\";\n\nexport interface UsePushSubscriptionResult {\n /** True when the browser exposes the Push + Notification APIs. */\n supported: boolean;\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission: NotificationPermission | \"unsupported\";\n /** True when a subscription is active on this device. */\n subscribed: boolean;\n /** True while a subscribe/unsubscribe call is in-flight. */\n loading: boolean;\n /** Last error thrown by subscribe/unsubscribe, if any. */\n error: Error | null;\n subscribe: () => Promise<void>;\n unsubscribe: () => Promise<void>;\n /** Re-read the current subscription/permission state from the browser. */\n refresh: () => Promise<void>;\n}\n\n/**\n * React hook around {@link WebPushClient}. Tracks subscription, permission and\n * loading state; exposes imperative `subscribe`/`unsubscribe` actions.\n *\n * The hook does NOT register the service worker — the host app must do that\n * (e.g. via `vite-plugin-pwa` or a manual `navigator.serviceWorker.register`).\n *\n * @example\n * const push = usePushSubscription({\n * vapidPublicKey: import.meta.env.VITE_VAPID_PUBLIC_KEY,\n * onSubscribe: (sub) => api.post(\"/webpush/subscribe\", { body: sub }),\n * onUnsubscribe: () => api.delete(\"/webpush/my\"),\n * });\n */\nexport function usePushSubscription(config: WebPushClientConfig): UsePushSubscriptionResult {\n const configRef = useLatestRef(config);\n\n const client = useMemo(\n () =>\n new WebPushClient({\n vapidPublicKey: config.vapidPublicKey,\n onSubscribe: (sub) => configRef.current.onSubscribe(sub),\n onUnsubscribe: (sub) => configRef.current.onUnsubscribe?.(sub),\n getRegistration: config.getRegistration,\n }),\n [config.vapidPublicKey, config.getRegistration, configRef],\n );\n\n const [supported] = useState<boolean>(() => isPushSupported());\n const [permission, setPermission] = useState<NotificationPermission | \"unsupported\">(() =>\n client.permission(),\n );\n const [subscribed, setSubscribed] = useState<boolean>(false);\n const [loading, setLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n const refresh = useCallback(async () => {\n if (!supported) return;\n setPermission(client.permission());\n try {\n const active = await client.isSubscribed();\n setSubscribed(active);\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n }\n }, [client, supported]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const subscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.subscribe();\n setSubscribed(true);\n setPermission(client.permission());\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n const unsubscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.unsubscribe();\n setSubscribed(false);\n } catch (err) {\n if (err instanceof WebPushUnsubscribeError) setSubscribed(!err.browserUnsubscribed);\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n return {\n supported,\n permission,\n subscribed,\n loading,\n error,\n subscribe,\n unsubscribe,\n refresh,\n };\n}\n"],"mappings":"A,kIAyCA,SAAgBW,EAAoB,EAAwD,CACxF,IAAMC,EAAYZ,EAAAA,aAAaa,CAAM,EAE/BC,GAAA,EAASb,EAAAA,QAAAA,KAEP,IAAIC,EAAAA,cAAc,CACd,eAAgBW,EAAO,eACvB,YAAc,GAAQD,EAAU,QAAQ,YAAYG,CAAG,EACvD,cAAgB,GAAQH,EAAU,QAAQ,gBAAgBG,CAAG,EAC7D,gBAAiBF,EAAO,eAC5B,CAAC,EACL,CAACA,EAAO,eAAgBA,EAAO,gBAAiBD,CAAS,CAC7D,EAEM,CAACI,IAAA,EAAab,EAAAA,SAAAA,KAAwBC,EAAAA,gBAAgB,CAAC,EACvD,CAACa,EAAYC,IAAA,EAAiBf,EAAAA,SAAAA,KAChCW,EAAO,WAAW,CACtB,EACM,CAACK,EAAYC,IAAA,EAAiBjB,EAAAA,SAAAA,CAAkB,EAAK,EACrD,CAACkB,EAASC,IAAA,EAAcnB,EAAAA,SAAAA,CAAkB,EAAK,EAC/C,CAACoB,EAAOC,IAAA,EAAYrB,EAAAA,SAAAA,CAAuB,IAAI,EAE/CsB,GAAA,EAAUpB,EAAAA,YAAAA,CAAY,SAAY,CACpC,GAAKW,EACL,GAAcF,EAAO,WAAW,CAAC,EACjC,GAAI,CACA,IAAMY,EAAS,MAAMZ,EAAO,aAAa,EACzCM,EAAcM,CAAM,CACxB,OAASC,EAAK,CACVH,EAASG,aAAe,MAAQA,EAAU,MAAM,OAAOA,CAAG,CAAC,CAAC,CAChE,CANiC,CAOrC,EAAG,CAACb,EAAQE,CAAS,CAAC,EAsCtB,OApCA,EAAAN,EAAA,UAAA,KAAgB,CACZe,EAAa,CACjB,EAAG,CAACA,CAAO,CAAC,EAkCL,CACH,YACA,aACA,aACA,UACA,QACA,WAAA,EAtCcpB,EAAAA,YAAAA,CAAY,SAAY,CACtC,GAAKW,EACL,GAAW,EAAI,EACfQ,EAAS,IAAI,EACb,GAAI,CACA,MAAMV,EAAO,UAAU,EACvBM,EAAc,EAAI,EAClBF,EAAcJ,EAAO,WAAW,CAAC,CACrC,OAASa,EAAK,CAEV,MADAH,EAASG,aAAe,MAAQA,EAAU,MAAM,OAAOA,CAAG,CAAC,CAAC,EACtDA,CACV,QAAU,CACNL,EAAW,EAAK,CACpB,CAXe,CAYnB,EAAG,CAACR,EAAQE,CAAS,CAwBjB,EACA,aAAA,EAvBgBX,EAAAA,YAAAA,CAAY,SAAY,CACxC,GAAKW,EACL,GAAW,EAAI,EACfQ,EAAS,IAAI,EACb,GAAI,CACA,MAAMV,EAAO,YAAY,EACzBM,EAAc,EAAK,CACvB,OAASO,EAAK,CAGV,MAFIA,aAAerB,EAAAA,yBAAyBc,EAAc,CAACO,EAAI,mBAAmB,EAClFH,EAASG,aAAe,MAAQA,EAAU,MAAM,OAAOA,CAAG,CAAC,CAAC,EACtDA,CACV,QAAU,CACNL,EAAW,EAAK,CACpB,CAXe,CAYnB,EAAG,CAACR,EAAQE,CAAS,CASjB,EACA,SACJ,CACJ,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-push-subscription.js","names":[],"sources":["../../src/push/use-push-subscription.ts"],"sourcesContent":["/* eslint-disable react-hooks/refs -- the ref is read inside deferred callbacks, not during render */\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useLatestRef } from \"@/hooks/use-latest-ref\";\nimport {\n WebPushClient,\n WebPushUnsubscribeError,\n type WebPushClientConfig,\n} from \"./web-push-client\";\nimport { isPushSupported } from \"./utils\";\n\nexport interface UsePushSubscriptionResult {\n /** True when the browser exposes the Push + Notification APIs. */\n supported: boolean;\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission: NotificationPermission | \"unsupported\";\n /** True when a subscription is active on this device. */\n subscribed: boolean;\n /** True while a subscribe/unsubscribe call is in-flight. */\n loading: boolean;\n /** Last error thrown by subscribe/unsubscribe, if any. */\n error: Error | null;\n subscribe: () => Promise<void>;\n unsubscribe: () => Promise<void>;\n /** Re-read the current subscription/permission state from the browser. */\n refresh: () => Promise<void>;\n}\n\n/**\n * React hook around {@link WebPushClient}. Tracks subscription, permission and\n * loading state; exposes imperative `subscribe`/`unsubscribe` actions.\n *\n * The hook does NOT register the service worker — the host app must do that\n * (e.g. via `vite-plugin-pwa` or a manual `navigator.serviceWorker.register`).\n *\n * @example\n * const push = usePushSubscription({\n * vapidPublicKey: import.meta.env.VITE_VAPID_PUBLIC_KEY,\n * onSubscribe: (sub) => api.post(\"/webpush/subscribe\", { body: sub }),\n * onUnsubscribe: () => api.delete(\"/webpush/my\"),\n * });\n */\nexport function usePushSubscription(config: WebPushClientConfig): UsePushSubscriptionResult {\n const configRef = useLatestRef(config);\n\n const client = useMemo(\n () =>\n new WebPushClient({\n vapidPublicKey: config.vapidPublicKey,\n onSubscribe: (sub) => configRef.current.onSubscribe(sub),\n onUnsubscribe: (sub) => configRef.current.onUnsubscribe?.(sub),\n getRegistration: config.getRegistration,\n }),\n [config.vapidPublicKey, config.getRegistration, configRef],\n );\n\n const [supported] = useState<boolean>(() => isPushSupported());\n const [permission, setPermission] = useState<NotificationPermission | \"unsupported\">(() =>\n client.permission(),\n );\n const [subscribed, setSubscribed] = useState<boolean>(false);\n const [loading, setLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n const refresh = useCallback(async () => {\n if (!supported) return;\n setPermission(client.permission());\n try {\n const active = await client.isSubscribed();\n setSubscribed(active);\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n }\n }, [client, supported]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const subscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.subscribe();\n setSubscribed(true);\n setPermission(client.permission());\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n const unsubscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.unsubscribe();\n setSubscribed(false);\n } catch (err) {\n if (err instanceof WebPushUnsubscribeError) setSubscribed(!err.browserUnsubscribed);\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n return {\n supported,\n permission,\n subscribed,\n loading,\n error,\n subscribe,\n unsubscribe,\n refresh,\n };\n}\n"],"mappings":";;;;;AAyCA,SAAgB,EAAoB,GAAwD;CACxF,IAAM,IAAY,EAAa,CAAM,GAE/B,IAAS,QAEP,IAAI,EAAc;EACd,gBAAgB,EAAO;EACvB,cAAc,MAAQ,EAAU,QAAQ,YAAY,CAAG;EACvD,gBAAgB,MAAQ,EAAU,QAAQ,gBAAgB,CAAG;EAC7D,iBAAiB,EAAO;CAC5B,CAAC,GACL;EAAC,EAAO;EAAgB,EAAO;EAAiB;CAAS,CAC7D,GAEM,CAAC,KAAa,QAAwB,EAAgB,CAAC,GACvD,CAAC,GAAY,KAAiB,QAChC,EAAO,WAAW,CACtB,GACM,CAAC,GAAY,KAAiB,EAAkB,EAAK,GACrD,CAAC,GAAS,KAAc,EAAkB,EAAK,GAC/C,CAAC,GAAO,KAAY,EAAuB,IAAI,GAE/C,IAAU,EAAY,YAAY;EAC/B,OACL;KAAc,EAAO,WAAW,CAAC;GACjC,IAAI;IACA,IAAM,IAAS,MAAM,EAAO,aAAa;IACzC,EAAc,CAAM;GACxB,SAAS,GAAK;IACV,EAAS,aAAe,QAAQ,IAAU,MAAM,OAAO,CAAG,CAAC,CAAC;GAChE;EANiC;CAOrC,GAAG,CAAC,GAAQ,CAAS,CAAC;CAsCtB,OApCA,QAAgB;EACZ,EAAa;CACjB,GAAG,CAAC,CAAO,CAAC,GAkCL;EACH;EACA;EACA;EACA;EACA;EACA,WAtCc,EAAY,YAAY;GACjC,OAEL;IADA,EAAW,EAAI,GACf,EAAS,IAAI;IACb,IAAI;KAGA,AAFA,MAAM,EAAO,UAAU,GACvB,EAAc,EAAI,GAClB,EAAc,EAAO,WAAW,CAAC;IACrC,SAAS,GAAK;KAEV,MADA,EAAS,aAAe,QAAQ,IAAU,MAAM,OAAO,CAAG,CAAC,CAAC,GACtD;IACV,UAAU;KACN,EAAW,EAAK;IACpB;GAVa;EAWjB,GAAG,CAAC,GAAQ,CAAS,CAwBjB;EACA,aAvBgB,EAAY,YAAY;GACnC,OAEL;IADA,EAAW,EAAI,GACf,EAAS,IAAI;IACb,IAAI;KAEA,AADA,MAAM,EAAO,YAAY,GACzB,EAAc,EAAK;IACvB,SAAS,GAAK;KAGV,MAFI,aAAe,KAAyB,EAAc,CAAC,EAAI,mBAAmB,GAClF,EAAS,aAAe,QAAQ,IAAU,MAAM,OAAO,CAAG,CAAC,CAAC,GACtD;IACV,UAAU;KACN,EAAW,EAAK;IACpB;GAVa;EAWjB,GAAG,CAAC,GAAQ,CAAS,CASjB;EACA;CACJ;AACJ"}
1
+ {"version":3,"file":"use-push-subscription.js","names":["usePushSubscription","configRef","useLatestRef","config","client","useMemo","WebPushClient","sub","supported","useState","isPushSupported","permission","setPermission","subscribed","setSubscribed","loading","setLoading","error","setError","refresh","useCallback","active","err","useEffect","WebPushUnsubscribeError"],"sources":["../../src/push/use-push-subscription.ts"],"sourcesContent":["/* eslint-disable react-hooks/refs -- the ref is read inside deferred callbacks, not during render */\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useLatestRef } from \"@/hooks/use-latest-ref\";\nimport {\n WebPushClient,\n WebPushUnsubscribeError,\n type WebPushClientConfig,\n} from \"./web-push-client\";\nimport { isPushSupported } from \"./utils\";\n\nexport interface UsePushSubscriptionResult {\n /** True when the browser exposes the Push + Notification APIs. */\n supported: boolean;\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission: NotificationPermission | \"unsupported\";\n /** True when a subscription is active on this device. */\n subscribed: boolean;\n /** True while a subscribe/unsubscribe call is in-flight. */\n loading: boolean;\n /** Last error thrown by subscribe/unsubscribe, if any. */\n error: Error | null;\n subscribe: () => Promise<void>;\n unsubscribe: () => Promise<void>;\n /** Re-read the current subscription/permission state from the browser. */\n refresh: () => Promise<void>;\n}\n\n/**\n * React hook around {@link WebPushClient}. Tracks subscription, permission and\n * loading state; exposes imperative `subscribe`/`unsubscribe` actions.\n *\n * The hook does NOT register the service worker — the host app must do that\n * (e.g. via `vite-plugin-pwa` or a manual `navigator.serviceWorker.register`).\n *\n * @example\n * const push = usePushSubscription({\n * vapidPublicKey: import.meta.env.VITE_VAPID_PUBLIC_KEY,\n * onSubscribe: (sub) => api.post(\"/webpush/subscribe\", { body: sub }),\n * onUnsubscribe: () => api.delete(\"/webpush/my\"),\n * });\n */\nexport function usePushSubscription(config: WebPushClientConfig): UsePushSubscriptionResult {\n const configRef = useLatestRef(config);\n\n const client = useMemo(\n () =>\n new WebPushClient({\n vapidPublicKey: config.vapidPublicKey,\n onSubscribe: (sub) => configRef.current.onSubscribe(sub),\n onUnsubscribe: (sub) => configRef.current.onUnsubscribe?.(sub),\n getRegistration: config.getRegistration,\n }),\n [config.vapidPublicKey, config.getRegistration, configRef],\n );\n\n const [supported] = useState<boolean>(() => isPushSupported());\n const [permission, setPermission] = useState<NotificationPermission | \"unsupported\">(() =>\n client.permission(),\n );\n const [subscribed, setSubscribed] = useState<boolean>(false);\n const [loading, setLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n const refresh = useCallback(async () => {\n if (!supported) return;\n setPermission(client.permission());\n try {\n const active = await client.isSubscribed();\n setSubscribed(active);\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n }\n }, [client, supported]);\n\n useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const subscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.subscribe();\n setSubscribed(true);\n setPermission(client.permission());\n } catch (err) {\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n const unsubscribe = useCallback(async () => {\n if (!supported) return;\n setLoading(true);\n setError(null);\n try {\n await client.unsubscribe();\n setSubscribed(false);\n } catch (err) {\n if (err instanceof WebPushUnsubscribeError) setSubscribed(!err.browserUnsubscribed);\n setError(err instanceof Error ? err : new Error(String(err)));\n throw err;\n } finally {\n setLoading(false);\n }\n }, [client, supported]);\n\n return {\n supported,\n permission,\n subscribed,\n loading,\n error,\n subscribe,\n unsubscribe,\n refresh,\n };\n}\n"],"mappings":";;;;;AAyCA,SAAgBA,EAAoB,GAAwD;CACxF,IAAMC,IAAYC,EAAaC,CAAM,GAE/BC,IAASC,QAEP,IAAIC,EAAc;EACd,gBAAgBH,EAAO;EACvB,cAAc,MAAQF,EAAU,QAAQ,YAAYM,CAAG;EACvD,gBAAgB,MAAQN,EAAU,QAAQ,gBAAgBM,CAAG;EAC7D,iBAAiBJ,EAAO;CAC5B,CAAC,GACL;EAACA,EAAO;EAAgBA,EAAO;EAAiBF;CAAS,CAC7D,GAEM,CAACO,KAAaC,QAAwBC,EAAgB,CAAC,GACvD,CAACC,GAAYC,KAAiBH,QAChCL,EAAO,WAAW,CACtB,GACM,CAACS,GAAYC,KAAiBL,EAAkB,EAAK,GACrD,CAACM,GAASC,KAAcP,EAAkB,EAAK,GAC/C,CAACQ,GAAOC,KAAYT,EAAuB,IAAI,GAE/CU,IAAUC,EAAY,YAAY;EACpC,IAAKZ,GACL;KAAcJ,EAAO,WAAW,CAAC;GACjC,IAAI;IACA,IAAMiB,IAAS,MAAMjB,EAAO,aAAa;IACzC,EAAciB,CAAM;GACxB,SAASC,GAAK;IACV,EAASA,aAAe,QAAQA,IAAU,MAAM,OAAOA,CAAG,CAAC,CAAC;GAChE;EANiC;CAOrC,GAAG,CAAClB,GAAQI,CAAS,CAAC;CAsCtB,OApCAe,QAAgB;EACZ,EAAa;CACjB,GAAG,CAACJ,CAAO,CAAC,GAkCL;EACH;EACA;EACA;EACA;EACA;EACA,WAtCcC,EAAY,YAAY;GACtC,IAAKZ,GACL;IACA,AADAQ,EAAW,EAAI,GACfE,EAAS,IAAI;IACb,IAAI;KAGA,AAFA,MAAMd,EAAO,UAAU,GACvBU,EAAc,EAAI,GAClBF,EAAcR,EAAO,WAAW,CAAC;IACrC,SAASkB,GAAK;KAEV,MADAJ,EAASI,aAAe,QAAQA,IAAU,MAAM,OAAOA,CAAG,CAAC,CAAC,GACtDA;IACV,UAAU;KACN,EAAW,EAAK;IACpB;GAXe;EAYnB,GAAG,CAAClB,GAAQI,CAAS,CAwBjB;EACA,aAvBgBY,EAAY,YAAY;GACxC,IAAKZ,GACL;IACA,AADAQ,EAAW,EAAI,GACfE,EAAS,IAAI;IACb,IAAI;KAEA,AADA,MAAMd,EAAO,YAAY,GACzBU,EAAc,EAAK;IACvB,SAASQ,GAAK;KAGV,MAFIA,aAAeE,KAAyBV,EAAc,CAACQ,EAAI,mBAAmB,GAClFJ,EAASI,aAAe,QAAQA,IAAU,MAAM,OAAOA,CAAG,CAAC,CAAC,GACtDA;IACV,UAAU;KACN,EAAW,EAAK;IACpB;GAXe;EAYnB,GAAG,CAAClB,GAAQI,CAAS,CASjB;EACA;CACJ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","names":[],"sources":["../../src/push/utils.ts"],"sourcesContent":["/**\n * Convert a base64url-encoded VAPID public key into the `Uint8Array` format\n * required by `PushManager.subscribe({ applicationServerKey })`.\n *\n * Calls `atob` as a bare global rather than `window.atob` because this runs in a\n * **service worker** too: re-subscribing from a `pushsubscriptionchange` handler\n * needs the same conversion, and there is no `window` in a worker scope — the\n * qualified call threw `ReferenceError` there while working fine on the page.\n *\n * @param base64String - VAPID public key (URL-safe base64).\n * @returns The decoded key as bytes.\n */\nexport function urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer> {\n const padding = \"=\".repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, \"+\").replace(/_/g, \"/\");\n const rawData = atob(base64);\n const buffer = new ArrayBuffer(rawData.length);\n const output = new Uint8Array(buffer);\n for (let i = 0; i < rawData.length; i++) {\n output[i] = rawData.charCodeAt(i);\n }\n return output;\n}\n\n/**\n * Convenience check for environments where the Push API is unavailable\n * (Safari iOS without PWA install, older browsers, SSR, etc.).\n */\nexport function isPushSupported(): boolean {\n return (\n typeof window !== \"undefined\" &&\n \"serviceWorker\" in navigator &&\n \"PushManager\" in window &&\n \"Notification\" in window\n );\n}\n"],"mappings":"AAYA,SAAgB,EAAsB,EAA+C,CAEjF,IAAM,GAAU,EADA,IAAI,QAAQ,EAAK,EAAa,OAAS,GAAM,CAC9B,EAAA,CAAS,QAAQ,KAAM,GAAG,CAAC,CAAC,QAAQ,KAAM,GAAG,EACtE,EAAU,KAAK,CAAM,EACrB,EAAS,IAAI,YAAY,EAAQ,MAAM,EACvC,EAAS,IAAI,WAAW,CAAM,EACpC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,OAAQ,IAChC,EAAO,GAAK,EAAQ,WAAW,CAAC,EAEpC,OAAO,CACX,CAMA,SAAgB,GAA2B,CACvC,OACI,OAAO,OAAW,KAClB,kBAAmB,WACnB,gBAAiB,QACjB,iBAAkB,MAE1B"}
1
+ {"version":3,"file":"utils.cjs","names":["urlBase64ToUint8Array","base64","base64String","rawData","buffer","output","i","isPushSupported"],"sources":["../../src/push/utils.ts"],"sourcesContent":["/**\n * Convert a base64url-encoded VAPID public key into the `Uint8Array` format\n * required by `PushManager.subscribe({ applicationServerKey })`.\n *\n * Calls `atob` as a bare global rather than `window.atob` because this runs in a\n * **service worker** too: re-subscribing from a `pushsubscriptionchange` handler\n * needs the same conversion, and there is no `window` in a worker scope — the\n * qualified call threw `ReferenceError` there while working fine on the page.\n *\n * @param base64String - VAPID public key (URL-safe base64).\n * @returns The decoded key as bytes.\n */\nexport function urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer> {\n const padding = \"=\".repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, \"+\").replace(/_/g, \"/\");\n const rawData = atob(base64);\n const buffer = new ArrayBuffer(rawData.length);\n const output = new Uint8Array(buffer);\n for (let i = 0; i < rawData.length; i++) {\n output[i] = rawData.charCodeAt(i);\n }\n return output;\n}\n\n/**\n * Convenience check for environments where the Push API is unavailable\n * (Safari iOS without PWA install, older browsers, SSR, etc.).\n */\nexport function isPushSupported(): boolean {\n return (\n typeof window !== \"undefined\" &&\n \"serviceWorker\" in navigator &&\n \"PushManager\" in window &&\n \"Notification\" in window\n );\n}\n"],"mappings":"AAYA,SAAgBA,EAAsB,EAA+C,CAEjF,IAAMC,GAAUC,EADA,IAAI,QAAQ,EAAKA,EAAa,OAAS,GAAM,CAC9B,EAAA,CAAS,QAAQ,KAAM,GAAG,CAAC,CAAC,QAAQ,KAAM,GAAG,EACtEC,EAAU,KAAKF,CAAM,EACrBG,EAAS,IAAI,YAAYD,EAAQ,MAAM,EACvCE,EAAS,IAAI,WAAWD,CAAM,EACpC,IAAK,IAAIE,EAAI,EAAGA,EAAIH,EAAQ,OAAQ,IAChC,EAAOG,GAAKH,EAAQ,WAAWG,CAAC,EAEpC,OAAOD,CACX,CAMA,SAAgBE,GAA2B,CACvC,OACI,OAAO,OAAW,KAClB,kBAAmB,WACnB,gBAAiB,QACjB,iBAAkB,MAE1B,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","names":[],"sources":["../../src/push/utils.ts"],"sourcesContent":["/**\n * Convert a base64url-encoded VAPID public key into the `Uint8Array` format\n * required by `PushManager.subscribe({ applicationServerKey })`.\n *\n * Calls `atob` as a bare global rather than `window.atob` because this runs in a\n * **service worker** too: re-subscribing from a `pushsubscriptionchange` handler\n * needs the same conversion, and there is no `window` in a worker scope — the\n * qualified call threw `ReferenceError` there while working fine on the page.\n *\n * @param base64String - VAPID public key (URL-safe base64).\n * @returns The decoded key as bytes.\n */\nexport function urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer> {\n const padding = \"=\".repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, \"+\").replace(/_/g, \"/\");\n const rawData = atob(base64);\n const buffer = new ArrayBuffer(rawData.length);\n const output = new Uint8Array(buffer);\n for (let i = 0; i < rawData.length; i++) {\n output[i] = rawData.charCodeAt(i);\n }\n return output;\n}\n\n/**\n * Convenience check for environments where the Push API is unavailable\n * (Safari iOS without PWA install, older browsers, SSR, etc.).\n */\nexport function isPushSupported(): boolean {\n return (\n typeof window !== \"undefined\" &&\n \"serviceWorker\" in navigator &&\n \"PushManager\" in window &&\n \"Notification\" in window\n );\n}\n"],"mappings":";AAYA,SAAgB,EAAsB,GAA+C;CAEjF,IAAM,KAAU,IADA,IAAI,QAAQ,IAAK,EAAa,SAAS,KAAM,CAC9B,EAAA,CAAS,QAAQ,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG,GACtE,IAAU,KAAK,CAAM,GACrB,IAAS,IAAI,YAAY,EAAQ,MAAM,GACvC,IAAS,IAAI,WAAW,CAAM;CACpC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAQ,QAAQ,KAChC,EAAO,KAAK,EAAQ,WAAW,CAAC;CAEpC,OAAO;AACX;AAMA,SAAgB,IAA2B;CACvC,OACI,OAAO,SAAW,OAClB,mBAAmB,aACnB,iBAAiB,UACjB,kBAAkB;AAE1B"}
1
+ {"version":3,"file":"utils.js","names":["urlBase64ToUint8Array","base64","base64String","rawData","buffer","output","i","isPushSupported"],"sources":["../../src/push/utils.ts"],"sourcesContent":["/**\n * Convert a base64url-encoded VAPID public key into the `Uint8Array` format\n * required by `PushManager.subscribe({ applicationServerKey })`.\n *\n * Calls `atob` as a bare global rather than `window.atob` because this runs in a\n * **service worker** too: re-subscribing from a `pushsubscriptionchange` handler\n * needs the same conversion, and there is no `window` in a worker scope — the\n * qualified call threw `ReferenceError` there while working fine on the page.\n *\n * @param base64String - VAPID public key (URL-safe base64).\n * @returns The decoded key as bytes.\n */\nexport function urlBase64ToUint8Array(base64String: string): Uint8Array<ArrayBuffer> {\n const padding = \"=\".repeat((4 - (base64String.length % 4)) % 4);\n const base64 = (base64String + padding).replace(/-/g, \"+\").replace(/_/g, \"/\");\n const rawData = atob(base64);\n const buffer = new ArrayBuffer(rawData.length);\n const output = new Uint8Array(buffer);\n for (let i = 0; i < rawData.length; i++) {\n output[i] = rawData.charCodeAt(i);\n }\n return output;\n}\n\n/**\n * Convenience check for environments where the Push API is unavailable\n * (Safari iOS without PWA install, older browsers, SSR, etc.).\n */\nexport function isPushSupported(): boolean {\n return (\n typeof window !== \"undefined\" &&\n \"serviceWorker\" in navigator &&\n \"PushManager\" in window &&\n \"Notification\" in window\n );\n}\n"],"mappings":";AAYA,SAAgBA,EAAsB,GAA+C;CAEjF,IAAMC,KAAUC,IADA,IAAI,QAAQ,IAAKA,EAAa,SAAS,KAAM,CAC9B,EAAA,CAAS,QAAQ,MAAM,GAAG,CAAC,CAAC,QAAQ,MAAM,GAAG,GACtEC,IAAU,KAAKF,CAAM,GACrBG,IAAS,IAAI,YAAYD,EAAQ,MAAM,GACvCE,IAAS,IAAI,WAAWD,CAAM;CACpC,KAAK,IAAIE,IAAI,GAAGA,IAAIH,EAAQ,QAAQ,KAChC,EAAOG,KAAKH,EAAQ,WAAWG,CAAC;CAEpC,OAAOD;AACX;AAMA,SAAgBE,IAA2B;CACvC,OACI,OAAO,SAAW,OAClB,mBAAmB,aACnB,iBAAiB,UACjB,kBAAkB;AAE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-push-client.cjs","names":[],"sources":["../../src/push/web-push-client.ts"],"sourcesContent":["import { isPushSupported, urlBase64ToUint8Array } from \"./utils\";\n\nexport interface WebPushClientConfig {\n /** VAPID public key (URL-safe base64). */\n vapidPublicKey: string;\n /**\n * Persist the subscription on the backend. The SDK does not own this call —\n * the host app decides the endpoint and how the payload is serialized.\n */\n onSubscribe: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Remove the subscription from the backend. Called before\n * `subscription.unsubscribe()`, with the subscription's JSON — key the\n * delete by its `endpoint`. A rejection no longer keeps the browser\n * subscribed: see {@link WebPushClient.unsubscribe}.\n */\n onUnsubscribe?: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Override how the service worker registration is obtained.\n * Defaults to `navigator.serviceWorker.ready` — provide this only when you\n * register the SW yourself and want to reuse the registration.\n */\n getRegistration?: () => Promise<ServiceWorkerRegistration>;\n}\n\nexport class WebPushUnsupportedError extends Error {\n constructor() {\n super(\"Web Push não suportado neste navegador.\");\n this.name = \"WebPushUnsupportedError\";\n }\n}\n\nexport class WebPushPermissionDeniedError extends Error {\n constructor() {\n super(\"Permissão de notificação negada pelo usuário.\");\n this.name = \"WebPushPermissionDeniedError\";\n }\n}\n\n/**\n * Thrown by {@link WebPushClient.unsubscribe} when `onUnsubscribe` failed. The\n * browser subscription was still released — `browserUnsubscribed` says whether\n * the browser confirmed it — so the only thing left behind is the backend row.\n *\n * Carries the `subscription` JSON so the app can retry the delete by\n * `endpoint` later; if it never does, the push service answers the next send\n * to that endpoint with `404`/`410`, which is the backend's cue to drop the row.\n */\nexport class WebPushUnsubscribeError extends Error {\n /** The subscription whose backend delete failed. */\n readonly subscription: PushSubscriptionJSON;\n /** Whether `PushSubscription.unsubscribe()` reported success. */\n readonly browserUnsubscribed: boolean;\n\n /**\n * @param subscription - The subscription whose backend delete failed.\n * @param browserUnsubscribed - What `PushSubscription.unsubscribe()` returned.\n * @param cause - What `onUnsubscribe` threw.\n */\n constructor(subscription: PushSubscriptionJSON, browserUnsubscribed: boolean, cause: unknown) {\n super(\"Falha ao remover a inscrição de push no backend.\", { cause });\n this.name = \"WebPushUnsubscribeError\";\n this.subscription = subscription;\n this.browserUnsubscribed = browserUnsubscribed;\n }\n}\n\n/**\n * Browser-side Web Push helper. Wraps `Notification.requestPermission`,\n * `pushManager.subscribe`, and the corresponding teardown. Transport is up to\n * the caller via `onSubscribe` / `onUnsubscribe` callbacks.\n */\nexport class WebPushClient {\n private readonly config: WebPushClientConfig;\n\n constructor(config: WebPushClientConfig) {\n this.config = config;\n }\n\n /** Whether the runtime supports the Push API. */\n static isSupported(): boolean {\n return isPushSupported();\n }\n\n private async registration(): Promise<ServiceWorkerRegistration> {\n if (!isPushSupported()) throw new WebPushUnsupportedError();\n return this.config.getRegistration\n ? await this.config.getRegistration()\n : await navigator.serviceWorker.ready;\n }\n\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission(): NotificationPermission | \"unsupported\" {\n if (typeof Notification === \"undefined\") return \"unsupported\";\n return Notification.permission;\n }\n\n /**\n * Ask the user for notification permission.\n *\n * @throws {WebPushUnsupportedError} If the runtime lacks the Notification API.\n * @returns The resulting `NotificationPermission` value.\n */\n async requestPermission(): Promise<NotificationPermission> {\n if (typeof Notification === \"undefined\") throw new WebPushUnsupportedError();\n return Notification.requestPermission();\n }\n\n /** Return the active push subscription, if any. */\n async getSubscription(): Promise<PushSubscription | null> {\n const registration = await this.registration();\n return registration.pushManager.getSubscription();\n }\n\n /** True when a subscription already exists for this browser. */\n async isSubscribed(): Promise<boolean> {\n if (!isPushSupported()) return false;\n const existing = await this.getSubscription();\n return existing !== null;\n }\n\n /**\n * Subscribe the current device. Requests permission, creates a push\n * subscription if none exists, and forwards the JSON payload to\n * `onSubscribe` for backend persistence.\n *\n * @returns The active `PushSubscription`.\n * @throws {WebPushUnsupportedError} If Web Push is unavailable.\n * @throws {WebPushPermissionDeniedError} If the user denies the prompt.\n */\n async subscribe(): Promise<PushSubscription> {\n const permission = await this.requestPermission();\n if (permission !== \"granted\") throw new WebPushPermissionDeniedError();\n\n const registration = await this.registration();\n const existing = await registration.pushManager.getSubscription();\n if (existing) {\n await this.config.onSubscribe(existing.toJSON());\n return existing;\n }\n\n const subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(this.config.vapidPublicKey),\n });\n await this.config.onSubscribe(subscription.toJSON());\n return subscription;\n }\n\n /**\n * Cancel the current subscription: `onUnsubscribe` first, so the backend\n * can purge the record while the endpoint is known, then\n * `subscription.unsubscribe()` — **always**, even when `onUnsubscribe`\n * failed.\n *\n * Why the browser is released anyway: the two failure modes are not\n * symmetric. A backend row left behind costs one send to a dead endpoint,\n * which the push service answers with `404`/`410` and the backend deletes.\n * A browser subscription left behind keeps delivering this account's\n * notifications to whoever uses the browser next — and the backend call\n * fails precisely when that matters, at the end of a session, when the\n * token that authenticates it is already gone. Before 0.77.0 a rejected\n * `onUnsubscribe` aborted here and the browser stayed subscribed (#445).\n * The endpoint is not lost either way: it is read before both calls and\n * travels in the error.\n *\n * @returns True when an active subscription was removed, false when there\n * was none or the browser refused.\n * @throws {WebPushUnsubscribeError} When `onUnsubscribe` failed — thrown\n * after the browser subscription was released. When the browser call also\n * threw, `browserUnsubscribed` is `false` and `cause` is an\n * `AggregateError` holding both errors, backend first, so the endpoint the\n * error carries is never traded for a bare `DOMException`.\n */\n async unsubscribe(): Promise<boolean> {\n const subscription = await this.getSubscription();\n if (!subscription) return false;\n const json = subscription.toJSON();\n let backendError: { cause: unknown } | null = null;\n if (this.config.onUnsubscribe) {\n try {\n await this.config.onUnsubscribe(json);\n } catch (cause) {\n backendError = { cause };\n }\n }\n if (!backendError) return subscription.unsubscribe();\n let released: boolean;\n try {\n released = await subscription.unsubscribe();\n } catch (browserError) {\n throw new WebPushUnsubscribeError(\n json,\n false,\n new AggregateError(\n [backendError.cause, browserError],\n \"Backend delete and browser unsubscribe both failed.\",\n ),\n );\n }\n throw new WebPushUnsubscribeError(json, released, backendError.cause);\n }\n}\n"],"mappings":"+BAyBA,IAAa,EAAb,cAA6C,KAAM,CAC/C,aAAc,CACV,MAAM,yCAAyC,EAC/C,KAAK,KAAO,yBAChB,CACJ,EAEa,EAAb,cAAkD,KAAM,CACpD,aAAc,CACV,MAAM,+CAA+C,EACrD,KAAK,KAAO,8BAChB,CACJ,EAWa,EAAb,cAA6C,KAAM,CAE/C,aAEA,oBAOA,YAAY,EAAoC,EAA8B,EAAgB,CAC1F,MAAM,mDAAoD,CAAE,OAAM,CAAC,EACnE,KAAK,KAAO,0BACZ,KAAK,aAAe,EACpB,KAAK,oBAAsB,CAC/B,CACJ,EAOa,EAAb,KAA2B,CACvB,OAEA,YAAY,EAA6B,CACrC,KAAK,OAAS,CAClB,CAGA,OAAO,aAAuB,CAC1B,OAAO,EAAA,gBAAgB,CAC3B,CAEA,MAAc,cAAmD,CAC7D,GAAI,CAAC,EAAA,gBAAgB,EAAG,MAAM,IAAI,EAClC,OAAO,KAAK,OAAO,gBACb,MAAM,KAAK,OAAO,gBAAgB,EAClC,MAAM,UAAU,cAAc,KACxC,CAGA,YAAqD,CAEjD,OADI,OAAO,aAAiB,IAAoB,cACzC,aAAa,UACxB,CAQA,MAAM,mBAAqD,CACvD,GAAI,OAAO,aAAiB,IAAa,MAAM,IAAI,EACnD,OAAO,aAAa,kBAAkB,CAC1C,CAGA,MAAM,iBAAoD,CAEtD,OAAO,MADoB,KAAK,aAAa,EAAA,CACzB,YAAY,gBAAgB,CACpD,CAGA,MAAM,cAAiC,CAGnC,OAFK,EAAA,gBAAgB,EAEd,MADgB,KAAK,gBAAgB,IACxB,KAFW,EAGnC,CAWA,MAAM,WAAuC,CAEzC,GAAI,MADqB,KAAK,kBAAkB,IAC7B,UAAW,MAAM,IAAI,EAExC,IAAM,EAAe,MAAM,KAAK,aAAa,EACvC,EAAW,MAAM,EAAa,YAAY,gBAAgB,EAChE,GAAI,EAEA,OADA,MAAM,KAAK,OAAO,YAAY,EAAS,OAAO,CAAC,EACxC,EAGX,IAAM,EAAe,MAAM,EAAa,YAAY,UAAU,CAC1D,gBAAiB,GACjB,qBAAsB,EAAA,sBAAsB,KAAK,OAAO,cAAc,CAC1E,CAAC,EAED,OADA,MAAM,KAAK,OAAO,YAAY,EAAa,OAAO,CAAC,EAC5C,CACX,CA2BA,MAAM,aAAgC,CAClC,IAAM,EAAe,MAAM,KAAK,gBAAgB,EAChD,GAAI,CAAC,EAAc,MAAO,GAC1B,IAAM,EAAO,EAAa,OAAO,EAC7B,EAA0C,KAC9C,GAAI,KAAK,OAAO,cACZ,GAAI,CACA,MAAM,KAAK,OAAO,cAAc,CAAI,CACxC,OAAS,EAAO,CACZ,EAAe,CAAE,OAAM,CAC3B,CAEJ,GAAI,CAAC,EAAc,OAAO,EAAa,YAAY,EACnD,IAAI,EACJ,GAAI,CACA,EAAW,MAAM,EAAa,YAAY,CAC9C,OAAS,EAAc,CACnB,MAAM,IAAI,EACN,EACA,GACI,eACA,CAAC,EAAa,MAAO,CAAY,EACjC,qDACJ,CACJ,CACJ,CACA,MAAM,IAAI,EAAwB,EAAM,EAAU,EAAa,KAAK,CACxE,CACJ"}
1
+ {"version":3,"file":"web-push-client.cjs","names":["isPushSupported","urlBase64ToUint8Array","require_utils","WebPushUnsupportedError","WebPushPermissionDeniedError","WebPushUnsubscribeError","subscription","browserUnsubscribed","WebPushClient","config","registration","existing","json","backendError","cause","released","browserError"],"sources":["../../src/push/web-push-client.ts"],"sourcesContent":["import { isPushSupported, urlBase64ToUint8Array } from \"./utils\";\n\nexport interface WebPushClientConfig {\n /** VAPID public key (URL-safe base64). */\n vapidPublicKey: string;\n /**\n * Persist the subscription on the backend. The SDK does not own this call —\n * the host app decides the endpoint and how the payload is serialized.\n */\n onSubscribe: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Remove the subscription from the backend. Called before\n * `subscription.unsubscribe()`, with the subscription's JSON — key the\n * delete by its `endpoint`. A rejection no longer keeps the browser\n * subscribed: see {@link WebPushClient.unsubscribe}.\n */\n onUnsubscribe?: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Override how the service worker registration is obtained.\n * Defaults to `navigator.serviceWorker.ready` — provide this only when you\n * register the SW yourself and want to reuse the registration.\n */\n getRegistration?: () => Promise<ServiceWorkerRegistration>;\n}\n\nexport class WebPushUnsupportedError extends Error {\n constructor() {\n super(\"Web Push não suportado neste navegador.\");\n this.name = \"WebPushUnsupportedError\";\n }\n}\n\nexport class WebPushPermissionDeniedError extends Error {\n constructor() {\n super(\"Permissão de notificação negada pelo usuário.\");\n this.name = \"WebPushPermissionDeniedError\";\n }\n}\n\n/**\n * Thrown by {@link WebPushClient.unsubscribe} when `onUnsubscribe` failed. The\n * browser subscription was still released — `browserUnsubscribed` says whether\n * the browser confirmed it — so the only thing left behind is the backend row.\n *\n * Carries the `subscription` JSON so the app can retry the delete by\n * `endpoint` later; if it never does, the push service answers the next send\n * to that endpoint with `404`/`410`, which is the backend's cue to drop the row.\n */\nexport class WebPushUnsubscribeError extends Error {\n /** The subscription whose backend delete failed. */\n readonly subscription: PushSubscriptionJSON;\n /** Whether `PushSubscription.unsubscribe()` reported success. */\n readonly browserUnsubscribed: boolean;\n\n /**\n * @param subscription - The subscription whose backend delete failed.\n * @param browserUnsubscribed - What `PushSubscription.unsubscribe()` returned.\n * @param cause - What `onUnsubscribe` threw.\n */\n constructor(subscription: PushSubscriptionJSON, browserUnsubscribed: boolean, cause: unknown) {\n super(\"Falha ao remover a inscrição de push no backend.\", { cause });\n this.name = \"WebPushUnsubscribeError\";\n this.subscription = subscription;\n this.browserUnsubscribed = browserUnsubscribed;\n }\n}\n\n/**\n * Browser-side Web Push helper. Wraps `Notification.requestPermission`,\n * `pushManager.subscribe`, and the corresponding teardown. Transport is up to\n * the caller via `onSubscribe` / `onUnsubscribe` callbacks.\n */\nexport class WebPushClient {\n private readonly config: WebPushClientConfig;\n\n constructor(config: WebPushClientConfig) {\n this.config = config;\n }\n\n /** Whether the runtime supports the Push API. */\n static isSupported(): boolean {\n return isPushSupported();\n }\n\n private async registration(): Promise<ServiceWorkerRegistration> {\n if (!isPushSupported()) throw new WebPushUnsupportedError();\n return this.config.getRegistration\n ? await this.config.getRegistration()\n : await navigator.serviceWorker.ready;\n }\n\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission(): NotificationPermission | \"unsupported\" {\n if (typeof Notification === \"undefined\") return \"unsupported\";\n return Notification.permission;\n }\n\n /**\n * Ask the user for notification permission.\n *\n * @throws {WebPushUnsupportedError} If the runtime lacks the Notification API.\n * @returns The resulting `NotificationPermission` value.\n */\n async requestPermission(): Promise<NotificationPermission> {\n if (typeof Notification === \"undefined\") throw new WebPushUnsupportedError();\n return Notification.requestPermission();\n }\n\n /** Return the active push subscription, if any. */\n async getSubscription(): Promise<PushSubscription | null> {\n const registration = await this.registration();\n return registration.pushManager.getSubscription();\n }\n\n /** True when a subscription already exists for this browser. */\n async isSubscribed(): Promise<boolean> {\n if (!isPushSupported()) return false;\n const existing = await this.getSubscription();\n return existing !== null;\n }\n\n /**\n * Subscribe the current device. Requests permission, creates a push\n * subscription if none exists, and forwards the JSON payload to\n * `onSubscribe` for backend persistence.\n *\n * @returns The active `PushSubscription`.\n * @throws {WebPushUnsupportedError} If Web Push is unavailable.\n * @throws {WebPushPermissionDeniedError} If the user denies the prompt.\n */\n async subscribe(): Promise<PushSubscription> {\n const permission = await this.requestPermission();\n if (permission !== \"granted\") throw new WebPushPermissionDeniedError();\n\n const registration = await this.registration();\n const existing = await registration.pushManager.getSubscription();\n if (existing) {\n await this.config.onSubscribe(existing.toJSON());\n return existing;\n }\n\n const subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(this.config.vapidPublicKey),\n });\n await this.config.onSubscribe(subscription.toJSON());\n return subscription;\n }\n\n /**\n * Cancel the current subscription: `onUnsubscribe` first, so the backend\n * can purge the record while the endpoint is known, then\n * `subscription.unsubscribe()` — **always**, even when `onUnsubscribe`\n * failed.\n *\n * Why the browser is released anyway: the two failure modes are not\n * symmetric. A backend row left behind costs one send to a dead endpoint,\n * which the push service answers with `404`/`410` and the backend deletes.\n * A browser subscription left behind keeps delivering this account's\n * notifications to whoever uses the browser next — and the backend call\n * fails precisely when that matters, at the end of a session, when the\n * token that authenticates it is already gone. Before 0.77.0 a rejected\n * `onUnsubscribe` aborted here and the browser stayed subscribed (#445).\n * The endpoint is not lost either way: it is read before both calls and\n * travels in the error.\n *\n * @returns True when an active subscription was removed, false when there\n * was none or the browser refused.\n * @throws {WebPushUnsubscribeError} When `onUnsubscribe` failed — thrown\n * after the browser subscription was released. When the browser call also\n * threw, `browserUnsubscribed` is `false` and `cause` is an\n * `AggregateError` holding both errors, backend first, so the endpoint the\n * error carries is never traded for a bare `DOMException`.\n */\n async unsubscribe(): Promise<boolean> {\n const subscription = await this.getSubscription();\n if (!subscription) return false;\n const json = subscription.toJSON();\n let backendError: { cause: unknown } | null = null;\n if (this.config.onUnsubscribe) {\n try {\n await this.config.onUnsubscribe(json);\n } catch (cause) {\n backendError = { cause };\n }\n }\n if (!backendError) return subscription.unsubscribe();\n let released: boolean;\n try {\n released = await subscription.unsubscribe();\n } catch (browserError) {\n throw new WebPushUnsubscribeError(\n json,\n false,\n new AggregateError(\n [backendError.cause, browserError],\n \"Backend delete and browser unsubscribe both failed.\",\n ),\n );\n }\n throw new WebPushUnsubscribeError(json, released, backendError.cause);\n }\n}\n"],"mappings":"A,+BAyBA,IAAaG,EAAb,cAA6C,KAAM,CAC/C,aAAc,CACV,MAAM,yCAAyC,EAC/C,KAAK,KAAO,yBAChB,CACJ,EAEaC,EAAb,cAAkD,KAAM,CACpD,aAAc,CACV,MAAM,+CAA+C,EACrD,KAAK,KAAO,8BAChB,CACJ,EAWaC,EAAb,cAA6C,KAAM,CAE/C,aAEA,oBAOA,YAAY,EAAoC,EAA8B,EAAgB,CAC1F,MAAM,mDAAoD,CAAE,OAAM,CAAC,EACnE,KAAK,KAAO,0BACZ,KAAK,aAAeC,EACpB,KAAK,oBAAsBC,CAC/B,CACJ,EAOaC,EAAb,KAA2B,CACvB,OAEA,YAAY,EAA6B,CACrC,KAAK,OAASC,CAClB,CAGA,OAAO,aAAuB,CAC1B,OAAOT,EAAAA,gBAAgB,CAC3B,CAEA,MAAc,cAAmD,CAC7D,GAAI,CAACA,EAAAA,gBAAgB,EAAG,MAAM,IAAIG,EAClC,OAAO,KAAK,OAAO,gBACb,MAAM,KAAK,OAAO,gBAAgB,EAClC,MAAM,UAAU,cAAc,KACxC,CAGA,YAAqD,CAEjD,OADI,OAAO,aAAiB,IAAoB,cACzC,aAAa,UACxB,CAQA,MAAM,mBAAqD,CACvD,GAAI,OAAO,aAAiB,IAAa,MAAM,IAAIA,EACnD,OAAO,aAAa,kBAAkB,CAC1C,CAGA,MAAM,iBAAoD,CAEtD,OAAO,MADoB,KAAK,aAAa,EAAA,CACzB,YAAY,gBAAgB,CACpD,CAGA,MAAM,cAAiC,CAGnC,OAFKH,EAAAA,gBAAgB,EAEd,MADgB,KAAK,gBAAgB,IACxB,KAFW,EAGnC,CAWA,MAAM,WAAuC,CAEzC,GAAI,MADqB,KAAK,kBAAkB,IAC7B,UAAW,MAAM,IAAII,EAExC,IAAMM,EAAe,MAAM,KAAK,aAAa,EACvCC,EAAW,MAAMD,EAAa,YAAY,gBAAgB,EAChE,GAAIC,EAEA,OADA,MAAM,KAAK,OAAO,YAAYA,EAAS,OAAO,CAAC,EACxCA,EAGX,IAAML,EAAe,MAAMI,EAAa,YAAY,UAAU,CAC1D,gBAAiB,GACjB,qBAAsBT,EAAAA,sBAAsB,KAAK,OAAO,cAAc,CAC1E,CAAC,EAED,OADA,MAAM,KAAK,OAAO,YAAYK,EAAa,OAAO,CAAC,EAC5CA,CACX,CA2BA,MAAM,aAAgC,CAClC,IAAMA,EAAe,MAAM,KAAK,gBAAgB,EAChD,GAAI,CAACA,EAAc,MAAO,GAC1B,IAAMM,EAAON,EAAa,OAAO,EAC7BO,EAA0C,KAC9C,GAAI,KAAK,OAAO,cACZ,GAAI,CACA,MAAM,KAAK,OAAO,cAAcD,CAAI,CACxC,OAASE,EAAO,CACZ,EAAe,CAAE,OAAM,CAC3B,CAEJ,GAAI,CAACD,EAAc,OAAOP,EAAa,YAAY,EACnD,IAAIS,EACJ,GAAI,CACA,EAAW,MAAMT,EAAa,YAAY,CAC9C,OAASU,EAAc,CACnB,MAAM,IAAIX,EACNO,EACA,GACI,eACA,CAACC,EAAa,MAAOG,CAAY,EACjC,qDACJ,CACJ,CACJ,CACA,MAAM,IAAIX,EAAwBO,EAAMG,EAAUF,EAAa,KAAK,CACxE,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"web-push-client.js","names":[],"sources":["../../src/push/web-push-client.ts"],"sourcesContent":["import { isPushSupported, urlBase64ToUint8Array } from \"./utils\";\n\nexport interface WebPushClientConfig {\n /** VAPID public key (URL-safe base64). */\n vapidPublicKey: string;\n /**\n * Persist the subscription on the backend. The SDK does not own this call —\n * the host app decides the endpoint and how the payload is serialized.\n */\n onSubscribe: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Remove the subscription from the backend. Called before\n * `subscription.unsubscribe()`, with the subscription's JSON — key the\n * delete by its `endpoint`. A rejection no longer keeps the browser\n * subscribed: see {@link WebPushClient.unsubscribe}.\n */\n onUnsubscribe?: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Override how the service worker registration is obtained.\n * Defaults to `navigator.serviceWorker.ready` — provide this only when you\n * register the SW yourself and want to reuse the registration.\n */\n getRegistration?: () => Promise<ServiceWorkerRegistration>;\n}\n\nexport class WebPushUnsupportedError extends Error {\n constructor() {\n super(\"Web Push não suportado neste navegador.\");\n this.name = \"WebPushUnsupportedError\";\n }\n}\n\nexport class WebPushPermissionDeniedError extends Error {\n constructor() {\n super(\"Permissão de notificação negada pelo usuário.\");\n this.name = \"WebPushPermissionDeniedError\";\n }\n}\n\n/**\n * Thrown by {@link WebPushClient.unsubscribe} when `onUnsubscribe` failed. The\n * browser subscription was still released — `browserUnsubscribed` says whether\n * the browser confirmed it — so the only thing left behind is the backend row.\n *\n * Carries the `subscription` JSON so the app can retry the delete by\n * `endpoint` later; if it never does, the push service answers the next send\n * to that endpoint with `404`/`410`, which is the backend's cue to drop the row.\n */\nexport class WebPushUnsubscribeError extends Error {\n /** The subscription whose backend delete failed. */\n readonly subscription: PushSubscriptionJSON;\n /** Whether `PushSubscription.unsubscribe()` reported success. */\n readonly browserUnsubscribed: boolean;\n\n /**\n * @param subscription - The subscription whose backend delete failed.\n * @param browserUnsubscribed - What `PushSubscription.unsubscribe()` returned.\n * @param cause - What `onUnsubscribe` threw.\n */\n constructor(subscription: PushSubscriptionJSON, browserUnsubscribed: boolean, cause: unknown) {\n super(\"Falha ao remover a inscrição de push no backend.\", { cause });\n this.name = \"WebPushUnsubscribeError\";\n this.subscription = subscription;\n this.browserUnsubscribed = browserUnsubscribed;\n }\n}\n\n/**\n * Browser-side Web Push helper. Wraps `Notification.requestPermission`,\n * `pushManager.subscribe`, and the corresponding teardown. Transport is up to\n * the caller via `onSubscribe` / `onUnsubscribe` callbacks.\n */\nexport class WebPushClient {\n private readonly config: WebPushClientConfig;\n\n constructor(config: WebPushClientConfig) {\n this.config = config;\n }\n\n /** Whether the runtime supports the Push API. */\n static isSupported(): boolean {\n return isPushSupported();\n }\n\n private async registration(): Promise<ServiceWorkerRegistration> {\n if (!isPushSupported()) throw new WebPushUnsupportedError();\n return this.config.getRegistration\n ? await this.config.getRegistration()\n : await navigator.serviceWorker.ready;\n }\n\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission(): NotificationPermission | \"unsupported\" {\n if (typeof Notification === \"undefined\") return \"unsupported\";\n return Notification.permission;\n }\n\n /**\n * Ask the user for notification permission.\n *\n * @throws {WebPushUnsupportedError} If the runtime lacks the Notification API.\n * @returns The resulting `NotificationPermission` value.\n */\n async requestPermission(): Promise<NotificationPermission> {\n if (typeof Notification === \"undefined\") throw new WebPushUnsupportedError();\n return Notification.requestPermission();\n }\n\n /** Return the active push subscription, if any. */\n async getSubscription(): Promise<PushSubscription | null> {\n const registration = await this.registration();\n return registration.pushManager.getSubscription();\n }\n\n /** True when a subscription already exists for this browser. */\n async isSubscribed(): Promise<boolean> {\n if (!isPushSupported()) return false;\n const existing = await this.getSubscription();\n return existing !== null;\n }\n\n /**\n * Subscribe the current device. Requests permission, creates a push\n * subscription if none exists, and forwards the JSON payload to\n * `onSubscribe` for backend persistence.\n *\n * @returns The active `PushSubscription`.\n * @throws {WebPushUnsupportedError} If Web Push is unavailable.\n * @throws {WebPushPermissionDeniedError} If the user denies the prompt.\n */\n async subscribe(): Promise<PushSubscription> {\n const permission = await this.requestPermission();\n if (permission !== \"granted\") throw new WebPushPermissionDeniedError();\n\n const registration = await this.registration();\n const existing = await registration.pushManager.getSubscription();\n if (existing) {\n await this.config.onSubscribe(existing.toJSON());\n return existing;\n }\n\n const subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(this.config.vapidPublicKey),\n });\n await this.config.onSubscribe(subscription.toJSON());\n return subscription;\n }\n\n /**\n * Cancel the current subscription: `onUnsubscribe` first, so the backend\n * can purge the record while the endpoint is known, then\n * `subscription.unsubscribe()` — **always**, even when `onUnsubscribe`\n * failed.\n *\n * Why the browser is released anyway: the two failure modes are not\n * symmetric. A backend row left behind costs one send to a dead endpoint,\n * which the push service answers with `404`/`410` and the backend deletes.\n * A browser subscription left behind keeps delivering this account's\n * notifications to whoever uses the browser next — and the backend call\n * fails precisely when that matters, at the end of a session, when the\n * token that authenticates it is already gone. Before 0.77.0 a rejected\n * `onUnsubscribe` aborted here and the browser stayed subscribed (#445).\n * The endpoint is not lost either way: it is read before both calls and\n * travels in the error.\n *\n * @returns True when an active subscription was removed, false when there\n * was none or the browser refused.\n * @throws {WebPushUnsubscribeError} When `onUnsubscribe` failed — thrown\n * after the browser subscription was released. When the browser call also\n * threw, `browserUnsubscribed` is `false` and `cause` is an\n * `AggregateError` holding both errors, backend first, so the endpoint the\n * error carries is never traded for a bare `DOMException`.\n */\n async unsubscribe(): Promise<boolean> {\n const subscription = await this.getSubscription();\n if (!subscription) return false;\n const json = subscription.toJSON();\n let backendError: { cause: unknown } | null = null;\n if (this.config.onUnsubscribe) {\n try {\n await this.config.onUnsubscribe(json);\n } catch (cause) {\n backendError = { cause };\n }\n }\n if (!backendError) return subscription.unsubscribe();\n let released: boolean;\n try {\n released = await subscription.unsubscribe();\n } catch (browserError) {\n throw new WebPushUnsubscribeError(\n json,\n false,\n new AggregateError(\n [backendError.cause, browserError],\n \"Backend delete and browser unsubscribe both failed.\",\n ),\n );\n }\n throw new WebPushUnsubscribeError(json, released, backendError.cause);\n }\n}\n"],"mappings":";;AAyBA,IAAa,IAAb,cAA6C,MAAM;CAC/C,cAAc;EAEV,AADA,MAAM,yCAAyC,GAC/C,KAAK,OAAO;CAChB;AACJ,GAEa,IAAb,cAAkD,MAAM;CACpD,cAAc;EAEV,AADA,MAAM,+CAA+C,GACrD,KAAK,OAAO;CAChB;AACJ,GAWa,IAAb,cAA6C,MAAM;CAE/C;CAEA;CAOA,YAAY,GAAoC,GAA8B,GAAgB;EAI1F,AAHA,MAAM,oDAAoD,EAAE,SAAM,CAAC,GACnE,KAAK,OAAO,2BACZ,KAAK,eAAe,GACpB,KAAK,sBAAsB;CAC/B;AACJ,GAOa,IAAb,MAA2B;CACvB;CAEA,YAAY,GAA6B;EACrC,KAAK,SAAS;CAClB;CAGA,OAAO,cAAuB;EAC1B,OAAO,EAAgB;CAC3B;CAEA,MAAc,eAAmD;EAC7D,IAAI,CAAC,EAAgB,GAAG,MAAM,IAAI,EAAwB;EAC1D,OAAO,KAAK,OAAO,kBACb,MAAM,KAAK,OAAO,gBAAgB,IAClC,MAAM,UAAU,cAAc;CACxC;CAGA,aAAqD;EAEjD,OADI,OAAO,eAAiB,MAAoB,gBACzC,aAAa;CACxB;CAQA,MAAM,oBAAqD;EACvD,IAAI,OAAO,eAAiB,KAAa,MAAM,IAAI,EAAwB;EAC3E,OAAO,aAAa,kBAAkB;CAC1C;CAGA,MAAM,kBAAoD;EAEtD,QAAO,MADoB,KAAK,aAAa,EAAA,CACzB,YAAY,gBAAgB;CACpD;CAGA,MAAM,eAAiC;EAGnC,OAFK,EAAgB,IAEd,MADgB,KAAK,gBAAgB,MACxB,OAFW;CAGnC;CAWA,MAAM,YAAuC;EAEzC,IAAI,MADqB,KAAK,kBAAkB,MAC7B,WAAW,MAAM,IAAI,EAA6B;EAErE,IAAM,IAAe,MAAM,KAAK,aAAa,GACvC,IAAW,MAAM,EAAa,YAAY,gBAAgB;EAChE,IAAI,GAEA,OADA,MAAM,KAAK,OAAO,YAAY,EAAS,OAAO,CAAC,GACxC;EAGX,IAAM,IAAe,MAAM,EAAa,YAAY,UAAU;GAC1D,iBAAiB;GACjB,sBAAsB,EAAsB,KAAK,OAAO,cAAc;EAC1E,CAAC;EAED,OADA,MAAM,KAAK,OAAO,YAAY,EAAa,OAAO,CAAC,GAC5C;CACX;CA2BA,MAAM,cAAgC;EAClC,IAAM,IAAe,MAAM,KAAK,gBAAgB;EAChD,IAAI,CAAC,GAAc,OAAO;EAC1B,IAAM,IAAO,EAAa,OAAO,GAC7B,IAA0C;EAC9C,IAAI,KAAK,OAAO,eACZ,IAAI;GACA,MAAM,KAAK,OAAO,cAAc,CAAI;EACxC,SAAS,GAAO;GACZ,IAAe,EAAE,SAAM;EAC3B;EAEJ,IAAI,CAAC,GAAc,OAAO,EAAa,YAAY;EACnD,IAAI;EACJ,IAAI;GACA,IAAW,MAAM,EAAa,YAAY;EAC9C,SAAS,GAAc;GACnB,MAAM,IAAI,EACN,GACA,IACI,eACA,CAAC,EAAa,OAAO,CAAY,GACjC,qDACJ,CACJ;EACJ;EACA,MAAM,IAAI,EAAwB,GAAM,GAAU,EAAa,KAAK;CACxE;AACJ"}
1
+ {"version":3,"file":"web-push-client.js","names":["WebPushUnsupportedError","WebPushPermissionDeniedError","WebPushUnsubscribeError","subscription","browserUnsubscribed","WebPushClient","config","isPushSupported","registration","existing","urlBase64ToUint8Array","json","backendError","cause","released","browserError"],"sources":["../../src/push/web-push-client.ts"],"sourcesContent":["import { isPushSupported, urlBase64ToUint8Array } from \"./utils\";\n\nexport interface WebPushClientConfig {\n /** VAPID public key (URL-safe base64). */\n vapidPublicKey: string;\n /**\n * Persist the subscription on the backend. The SDK does not own this call —\n * the host app decides the endpoint and how the payload is serialized.\n */\n onSubscribe: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Remove the subscription from the backend. Called before\n * `subscription.unsubscribe()`, with the subscription's JSON — key the\n * delete by its `endpoint`. A rejection no longer keeps the browser\n * subscribed: see {@link WebPushClient.unsubscribe}.\n */\n onUnsubscribe?: (subscription: PushSubscriptionJSON) => Promise<void> | void;\n /**\n * Override how the service worker registration is obtained.\n * Defaults to `navigator.serviceWorker.ready` — provide this only when you\n * register the SW yourself and want to reuse the registration.\n */\n getRegistration?: () => Promise<ServiceWorkerRegistration>;\n}\n\nexport class WebPushUnsupportedError extends Error {\n constructor() {\n super(\"Web Push não suportado neste navegador.\");\n this.name = \"WebPushUnsupportedError\";\n }\n}\n\nexport class WebPushPermissionDeniedError extends Error {\n constructor() {\n super(\"Permissão de notificação negada pelo usuário.\");\n this.name = \"WebPushPermissionDeniedError\";\n }\n}\n\n/**\n * Thrown by {@link WebPushClient.unsubscribe} when `onUnsubscribe` failed. The\n * browser subscription was still released — `browserUnsubscribed` says whether\n * the browser confirmed it — so the only thing left behind is the backend row.\n *\n * Carries the `subscription` JSON so the app can retry the delete by\n * `endpoint` later; if it never does, the push service answers the next send\n * to that endpoint with `404`/`410`, which is the backend's cue to drop the row.\n */\nexport class WebPushUnsubscribeError extends Error {\n /** The subscription whose backend delete failed. */\n readonly subscription: PushSubscriptionJSON;\n /** Whether `PushSubscription.unsubscribe()` reported success. */\n readonly browserUnsubscribed: boolean;\n\n /**\n * @param subscription - The subscription whose backend delete failed.\n * @param browserUnsubscribed - What `PushSubscription.unsubscribe()` returned.\n * @param cause - What `onUnsubscribe` threw.\n */\n constructor(subscription: PushSubscriptionJSON, browserUnsubscribed: boolean, cause: unknown) {\n super(\"Falha ao remover a inscrição de push no backend.\", { cause });\n this.name = \"WebPushUnsubscribeError\";\n this.subscription = subscription;\n this.browserUnsubscribed = browserUnsubscribed;\n }\n}\n\n/**\n * Browser-side Web Push helper. Wraps `Notification.requestPermission`,\n * `pushManager.subscribe`, and the corresponding teardown. Transport is up to\n * the caller via `onSubscribe` / `onUnsubscribe` callbacks.\n */\nexport class WebPushClient {\n private readonly config: WebPushClientConfig;\n\n constructor(config: WebPushClientConfig) {\n this.config = config;\n }\n\n /** Whether the runtime supports the Push API. */\n static isSupported(): boolean {\n return isPushSupported();\n }\n\n private async registration(): Promise<ServiceWorkerRegistration> {\n if (!isPushSupported()) throw new WebPushUnsupportedError();\n return this.config.getRegistration\n ? await this.config.getRegistration()\n : await navigator.serviceWorker.ready;\n }\n\n /** Current `Notification.permission` value, or `\"unsupported\"`. */\n permission(): NotificationPermission | \"unsupported\" {\n if (typeof Notification === \"undefined\") return \"unsupported\";\n return Notification.permission;\n }\n\n /**\n * Ask the user for notification permission.\n *\n * @throws {WebPushUnsupportedError} If the runtime lacks the Notification API.\n * @returns The resulting `NotificationPermission` value.\n */\n async requestPermission(): Promise<NotificationPermission> {\n if (typeof Notification === \"undefined\") throw new WebPushUnsupportedError();\n return Notification.requestPermission();\n }\n\n /** Return the active push subscription, if any. */\n async getSubscription(): Promise<PushSubscription | null> {\n const registration = await this.registration();\n return registration.pushManager.getSubscription();\n }\n\n /** True when a subscription already exists for this browser. */\n async isSubscribed(): Promise<boolean> {\n if (!isPushSupported()) return false;\n const existing = await this.getSubscription();\n return existing !== null;\n }\n\n /**\n * Subscribe the current device. Requests permission, creates a push\n * subscription if none exists, and forwards the JSON payload to\n * `onSubscribe` for backend persistence.\n *\n * @returns The active `PushSubscription`.\n * @throws {WebPushUnsupportedError} If Web Push is unavailable.\n * @throws {WebPushPermissionDeniedError} If the user denies the prompt.\n */\n async subscribe(): Promise<PushSubscription> {\n const permission = await this.requestPermission();\n if (permission !== \"granted\") throw new WebPushPermissionDeniedError();\n\n const registration = await this.registration();\n const existing = await registration.pushManager.getSubscription();\n if (existing) {\n await this.config.onSubscribe(existing.toJSON());\n return existing;\n }\n\n const subscription = await registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(this.config.vapidPublicKey),\n });\n await this.config.onSubscribe(subscription.toJSON());\n return subscription;\n }\n\n /**\n * Cancel the current subscription: `onUnsubscribe` first, so the backend\n * can purge the record while the endpoint is known, then\n * `subscription.unsubscribe()` — **always**, even when `onUnsubscribe`\n * failed.\n *\n * Why the browser is released anyway: the two failure modes are not\n * symmetric. A backend row left behind costs one send to a dead endpoint,\n * which the push service answers with `404`/`410` and the backend deletes.\n * A browser subscription left behind keeps delivering this account's\n * notifications to whoever uses the browser next — and the backend call\n * fails precisely when that matters, at the end of a session, when the\n * token that authenticates it is already gone. Before 0.77.0 a rejected\n * `onUnsubscribe` aborted here and the browser stayed subscribed (#445).\n * The endpoint is not lost either way: it is read before both calls and\n * travels in the error.\n *\n * @returns True when an active subscription was removed, false when there\n * was none or the browser refused.\n * @throws {WebPushUnsubscribeError} When `onUnsubscribe` failed — thrown\n * after the browser subscription was released. When the browser call also\n * threw, `browserUnsubscribed` is `false` and `cause` is an\n * `AggregateError` holding both errors, backend first, so the endpoint the\n * error carries is never traded for a bare `DOMException`.\n */\n async unsubscribe(): Promise<boolean> {\n const subscription = await this.getSubscription();\n if (!subscription) return false;\n const json = subscription.toJSON();\n let backendError: { cause: unknown } | null = null;\n if (this.config.onUnsubscribe) {\n try {\n await this.config.onUnsubscribe(json);\n } catch (cause) {\n backendError = { cause };\n }\n }\n if (!backendError) return subscription.unsubscribe();\n let released: boolean;\n try {\n released = await subscription.unsubscribe();\n } catch (browserError) {\n throw new WebPushUnsubscribeError(\n json,\n false,\n new AggregateError(\n [backendError.cause, browserError],\n \"Backend delete and browser unsubscribe both failed.\",\n ),\n );\n }\n throw new WebPushUnsubscribeError(json, released, backendError.cause);\n }\n}\n"],"mappings":";;AAyBA,IAAaA,IAAb,cAA6C,MAAM;CAC/C,cAAc;EAEV,AADA,MAAM,yCAAyC,GAC/C,KAAK,OAAO;CAChB;AACJ,GAEaC,IAAb,cAAkD,MAAM;CACpD,cAAc;EAEV,AADA,MAAM,+CAA+C,GACrD,KAAK,OAAO;CAChB;AACJ,GAWaC,IAAb,cAA6C,MAAM;CAE/C;CAEA;CAOA,YAAY,GAAoC,GAA8B,GAAgB;EAI1F,AAHA,MAAM,oDAAoD,EAAE,SAAM,CAAC,GACnE,KAAK,OAAO,2BACZ,KAAK,eAAeC,GACpB,KAAK,sBAAsBC;CAC/B;AACJ,GAOaC,IAAb,MAA2B;CACvB;CAEA,YAAY,GAA6B;EACrC,KAAK,SAASC;CAClB;CAGA,OAAO,cAAuB;EAC1B,OAAOC,EAAgB;CAC3B;CAEA,MAAc,eAAmD;EAC7D,IAAI,CAACA,EAAgB,GAAG,MAAM,IAAIP,EAAwB;EAC1D,OAAO,KAAK,OAAO,kBACb,MAAM,KAAK,OAAO,gBAAgB,IAClC,MAAM,UAAU,cAAc;CACxC;CAGA,aAAqD;EAEjD,OADI,OAAO,eAAiB,MAAoB,gBACzC,aAAa;CACxB;CAQA,MAAM,oBAAqD;EACvD,IAAI,OAAO,eAAiB,KAAa,MAAM,IAAIA,EAAwB;EAC3E,OAAO,aAAa,kBAAkB;CAC1C;CAGA,MAAM,kBAAoD;EAEtD,QAAO,MADoB,KAAK,aAAa,EAAA,CACzB,YAAY,gBAAgB;CACpD;CAGA,MAAM,eAAiC;EAGnC,OAFKO,EAAgB,IAEd,MADgB,KAAK,gBAAgB,MACxB,OAFW;CAGnC;CAWA,MAAM,YAAuC;EAEzC,IAAI,MADqB,KAAK,kBAAkB,MAC7B,WAAW,MAAM,IAAIN,EAA6B;EAErE,IAAMO,IAAe,MAAM,KAAK,aAAa,GACvCC,IAAW,MAAMD,EAAa,YAAY,gBAAgB;EAChE,IAAIC,GAEA,OADA,MAAM,KAAK,OAAO,YAAYA,EAAS,OAAO,CAAC,GACxCA;EAGX,IAAMN,IAAe,MAAMK,EAAa,YAAY,UAAU;GAC1D,iBAAiB;GACjB,sBAAsBE,EAAsB,KAAK,OAAO,cAAc;EAC1E,CAAC;EAED,OADA,MAAM,KAAK,OAAO,YAAYP,EAAa,OAAO,CAAC,GAC5CA;CACX;CA2BA,MAAM,cAAgC;EAClC,IAAMA,IAAe,MAAM,KAAK,gBAAgB;EAChD,IAAI,CAACA,GAAc,OAAO;EAC1B,IAAMQ,IAAOR,EAAa,OAAO,GAC7BS,IAA0C;EAC9C,IAAI,KAAK,OAAO,eACZ,IAAI;GACA,MAAM,KAAK,OAAO,cAAcD,CAAI;EACxC,SAASE,GAAO;GACZ,IAAe,EAAE,SAAM;EAC3B;EAEJ,IAAI,CAACD,GAAc,OAAOT,EAAa,YAAY;EACnD,IAAIW;EACJ,IAAI;GACA,IAAW,MAAMX,EAAa,YAAY;EAC9C,SAASY,GAAc;GACnB,MAAM,IAAIb,EACNS,GACA,IACI,eACA,CAACC,EAAa,OAAOG,CAAY,GACjC,qDACJ,CACJ;EACJ;EACA,MAAM,IAAIb,EAAwBS,GAAMG,GAAUF,EAAa,KAAK;CACxE;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryProvider.cjs","names":[],"sources":["../../src/query/QueryProvider.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { DefaultOptions } from \"@tanstack/react-query\";\nimport { STALE_TIME, CACHE_TIME } from \"./constants\";\nimport { shouldRetryQuery } from \"./retry-policy\";\nimport { warnOnForeignClient } from \"./foreign-client-warning\";\n\nexport interface QueryProviderProps {\n children: ReactNode;\n /** Pass an existing client to share it across roots. */\n client?: QueryClient;\n /** Overrides for the default options applied when no `client` is provided. */\n defaultOptions?: DefaultOptions;\n}\n\n/**\n * Wrapper around `QueryClientProvider` that bootstraps a `QueryClient` with\n * sane SDK defaults (5-minute stale time, 30-minute gc time, one retry for\n * failures worth replaying).\n *\n * Retries follow {@link shouldRetryQuery} rather than a flat count: a 4xx other\n * than 408/429 is the server refusing on purpose, and replaying it only doubles\n * the network log while the spinner keeps turning.\n */\nexport function QueryProvider({ children, client, defaultOptions }: QueryProviderProps) {\n warnOnForeignClient(client);\n\n const [internalClient] = useState<QueryClient>(\n () =>\n client ??\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: STALE_TIME.DEFAULT,\n gcTime: CACHE_TIME.DEFAULT,\n retry: shouldRetryQuery,\n refetchOnWindowFocus: false,\n ...(defaultOptions?.queries ?? {}),\n },\n mutations: {\n retry: 0,\n ...(defaultOptions?.mutations ?? {}),\n },\n },\n }),\n );\n\n return <QueryClientProvider client={internalClient}>{children}</QueryClientProvider>;\n}\n"],"mappings":"sMAyBA,SAAgB,EAAc,CAAE,WAAU,SAAQ,kBAAsC,CACpF,EAAA,oBAAoB,CAAM,EAE1B,GAAM,CAAC,IAAA,EAAkB,EAAA,SAAA,KAEjB,GACA,IAAI,EAAA,YAAY,CACZ,eAAgB,CACZ,QAAS,CACL,UAAW,EAAA,WAAW,QACtB,OAAQ,EAAA,WAAW,QACnB,MAAO,EAAA,iBACP,qBAAsB,GACtB,GAAI,GAAgB,SAAW,CAAC,CACpC,EACA,UAAW,CACP,MAAO,EACP,GAAI,GAAgB,WAAa,CAAC,CACtC,CACJ,CACJ,CAAC,CACT,EAEA,OAAO,EAAA,EAAA,IAAA,CAAC,EAAA,oBAAD,CAAqB,OAAQ,EAAiB,UAA8B,CAAA,CACvF"}
1
+ {"version":3,"file":"QueryProvider.cjs","names":["useState","QueryClient","STALE_TIME","CACHE_TIME","shouldRetryQuery","QueryClientProvider","require_constants","require_retry_policy","require_foreign_client_warning","react","react_jsx_runtime","_tanstack_react_query","QueryProvider","client","internalClient","defaultOptions"],"sources":["../../src/query/QueryProvider.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { DefaultOptions } from \"@tanstack/react-query\";\nimport { STALE_TIME, CACHE_TIME } from \"./constants\";\nimport { shouldRetryQuery } from \"./retry-policy\";\nimport { warnOnForeignClient } from \"./foreign-client-warning\";\n\nexport interface QueryProviderProps {\n children: ReactNode;\n /** Pass an existing client to share it across roots. */\n client?: QueryClient;\n /** Overrides for the default options applied when no `client` is provided. */\n defaultOptions?: DefaultOptions;\n}\n\n/**\n * Wrapper around `QueryClientProvider` that bootstraps a `QueryClient` with\n * sane SDK defaults (5-minute stale time, 30-minute gc time, one retry for\n * failures worth replaying).\n *\n * Retries follow {@link shouldRetryQuery} rather than a flat count: a 4xx other\n * than 408/429 is the server refusing on purpose, and replaying it only doubles\n * the network log while the spinner keeps turning.\n */\nexport function QueryProvider({ children, client, defaultOptions }: QueryProviderProps) {\n warnOnForeignClient(client);\n\n const [internalClient] = useState<QueryClient>(\n () =>\n client ??\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: STALE_TIME.DEFAULT,\n gcTime: CACHE_TIME.DEFAULT,\n retry: shouldRetryQuery,\n refetchOnWindowFocus: false,\n ...(defaultOptions?.queries ?? {}),\n },\n mutations: {\n retry: 0,\n ...(defaultOptions?.mutations ?? {}),\n },\n },\n }),\n );\n\n return <QueryClientProvider client={internalClient}>{children}</QueryClientProvider>;\n}\n"],"mappings":"A,sMAyBA,SAAgBY,EAAc,CAAE,WAAU,SAAQ,kBAAsC,CACpFJ,EAAA,oBAAoBK,CAAM,EAE1B,GAAM,CAACC,IAAA,EAAkBd,EAAAA,SAAAA,KAEjBa,GACA,IAAIZ,EAAAA,YAAY,CACZ,eAAgB,CACZ,QAAS,CACL,UAAWC,EAAAA,WAAW,QACtB,OAAQC,EAAAA,WAAW,QACnB,MAAOC,EAAAA,iBACP,qBAAsB,GACtB,GAAIW,GAAgB,SAAW,CAAC,CACpC,EACA,UAAW,CACP,MAAO,EACP,GAAIA,GAAgB,WAAa,CAAC,CACtC,CACJ,CACJ,CAAC,CACT,EAEA,OAAO,EAAAL,EAAA,IAAA,CAACL,EAAAA,oBAAD,CAAqB,OAAQS,EAAiB,UAA8B,CAAA,CACvF,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryProvider.js","names":[],"sources":["../../src/query/QueryProvider.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { DefaultOptions } from \"@tanstack/react-query\";\nimport { STALE_TIME, CACHE_TIME } from \"./constants\";\nimport { shouldRetryQuery } from \"./retry-policy\";\nimport { warnOnForeignClient } from \"./foreign-client-warning\";\n\nexport interface QueryProviderProps {\n children: ReactNode;\n /** Pass an existing client to share it across roots. */\n client?: QueryClient;\n /** Overrides for the default options applied when no `client` is provided. */\n defaultOptions?: DefaultOptions;\n}\n\n/**\n * Wrapper around `QueryClientProvider` that bootstraps a `QueryClient` with\n * sane SDK defaults (5-minute stale time, 30-minute gc time, one retry for\n * failures worth replaying).\n *\n * Retries follow {@link shouldRetryQuery} rather than a flat count: a 4xx other\n * than 408/429 is the server refusing on purpose, and replaying it only doubles\n * the network log while the spinner keeps turning.\n */\nexport function QueryProvider({ children, client, defaultOptions }: QueryProviderProps) {\n warnOnForeignClient(client);\n\n const [internalClient] = useState<QueryClient>(\n () =>\n client ??\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: STALE_TIME.DEFAULT,\n gcTime: CACHE_TIME.DEFAULT,\n retry: shouldRetryQuery,\n refetchOnWindowFocus: false,\n ...(defaultOptions?.queries ?? {}),\n },\n mutations: {\n retry: 0,\n ...(defaultOptions?.mutations ?? {}),\n },\n },\n }),\n );\n\n return <QueryClientProvider client={internalClient}>{children}</QueryClientProvider>;\n}\n"],"mappings":";;;;;;;AAyBA,SAAgB,EAAc,EAAE,aAAU,WAAQ,qBAAsC;CACpF,EAAoB,CAAM;CAE1B,IAAM,CAAC,KAAkB,QAEjB,KACA,IAAI,EAAY,EACZ,gBAAgB;EACZ,SAAS;GACL,WAAW,EAAW;GACtB,QAAQ,EAAW;GACnB,OAAO;GACP,sBAAsB;GACtB,GAAI,GAAgB,WAAW,CAAC;EACpC;EACA,WAAW;GACP,OAAO;GACP,GAAI,GAAgB,aAAa,CAAC;EACtC;CACJ,EACJ,CAAC,CACT;CAEA,OAAO,kBAAC,GAAD;EAAqB,QAAQ;EAAiB;CAA8B,CAAA;AACvF"}
1
+ {"version":3,"file":"QueryProvider.js","names":["QueryProvider","client","internalClient","useState","QueryClient","STALE_TIME","CACHE_TIME","shouldRetryQuery","defaultOptions","QueryClientProvider"],"sources":["../../src/query/QueryProvider.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { DefaultOptions } from \"@tanstack/react-query\";\nimport { STALE_TIME, CACHE_TIME } from \"./constants\";\nimport { shouldRetryQuery } from \"./retry-policy\";\nimport { warnOnForeignClient } from \"./foreign-client-warning\";\n\nexport interface QueryProviderProps {\n children: ReactNode;\n /** Pass an existing client to share it across roots. */\n client?: QueryClient;\n /** Overrides for the default options applied when no `client` is provided. */\n defaultOptions?: DefaultOptions;\n}\n\n/**\n * Wrapper around `QueryClientProvider` that bootstraps a `QueryClient` with\n * sane SDK defaults (5-minute stale time, 30-minute gc time, one retry for\n * failures worth replaying).\n *\n * Retries follow {@link shouldRetryQuery} rather than a flat count: a 4xx other\n * than 408/429 is the server refusing on purpose, and replaying it only doubles\n * the network log while the spinner keeps turning.\n */\nexport function QueryProvider({ children, client, defaultOptions }: QueryProviderProps) {\n warnOnForeignClient(client);\n\n const [internalClient] = useState<QueryClient>(\n () =>\n client ??\n new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: STALE_TIME.DEFAULT,\n gcTime: CACHE_TIME.DEFAULT,\n retry: shouldRetryQuery,\n refetchOnWindowFocus: false,\n ...(defaultOptions?.queries ?? {}),\n },\n mutations: {\n retry: 0,\n ...(defaultOptions?.mutations ?? {}),\n },\n },\n }),\n );\n\n return <QueryClientProvider client={internalClient}>{children}</QueryClientProvider>;\n}\n"],"mappings":";;;;;;;AAyBA,SAAgBA,EAAc,EAAE,aAAU,WAAQ,qBAAsC;CACpF,EAAoBC,CAAM;CAE1B,IAAM,CAACC,KAAkBC,QAEjBF,KACA,IAAIG,EAAY,EACZ,gBAAgB;EACZ,SAAS;GACL,WAAWC,EAAW;GACtB,QAAQC,EAAW;GACnB,OAAOC;GACP,sBAAsB;GACtB,GAAIC,GAAgB,WAAW,CAAC;EACpC;EACA,WAAW;GACP,OAAO;GACP,GAAIA,GAAgB,aAAa,CAAC;EACtC;CACJ,EACJ,CAAC,CACT;CAEA,OAAO,kBAACC,GAAD;EAAqB,QAAQP;EAAiB;CAA8B,CAAA;AACvF"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.cjs","names":[],"sources":["../../src/query/constants.ts"],"sourcesContent":["/** Recommended `staleTime` presets (milliseconds). */\nexport const STALE_TIME = {\n SHORT: 30 * 1000,\n DEFAULT: 5 * 60 * 1000,\n LONG: 30 * 60 * 1000,\n INFINITE: Infinity,\n} as const;\n\n/** Recommended `gcTime` presets (milliseconds). */\nexport const CACHE_TIME = {\n SHORT: 5 * 60 * 1000,\n DEFAULT: 30 * 60 * 1000,\n LONG: 60 * 60 * 1000,\n} as const;\n\n/** Recommended refetch intervals (milliseconds). */\nexport const REFETCH_TIME = {\n REALTIME: 5 * 1000,\n FAST: 30 * 1000,\n DEFAULT: 60 * 1000,\n SLOW: 5 * 60 * 1000,\n} as const;\n"],"mappings":"AACA,IAAa,EAAa,CACtB,MAAO,IACP,QAAS,IACT,KAAM,KACN,SAAU,GACd,EAGa,EAAa,CACtB,MAAO,IACP,QAAS,KACT,KAAM,IACV,EAGa,EAAe,CACxB,SAAU,IACV,KAAM,IACN,QAAS,IACT,KAAM,GACV"}
1
+ {"version":3,"file":"constants.cjs","names":["STALE_TIME","CACHE_TIME","REFETCH_TIME"],"sources":["../../src/query/constants.ts"],"sourcesContent":["/** Recommended `staleTime` presets (milliseconds). */\nexport const STALE_TIME = {\n SHORT: 30 * 1000,\n DEFAULT: 5 * 60 * 1000,\n LONG: 30 * 60 * 1000,\n INFINITE: Infinity,\n} as const;\n\n/** Recommended `gcTime` presets (milliseconds). */\nexport const CACHE_TIME = {\n SHORT: 5 * 60 * 1000,\n DEFAULT: 30 * 60 * 1000,\n LONG: 60 * 60 * 1000,\n} as const;\n\n/** Recommended refetch intervals (milliseconds). */\nexport const REFETCH_TIME = {\n REALTIME: 5 * 1000,\n FAST: 30 * 1000,\n DEFAULT: 60 * 1000,\n SLOW: 5 * 60 * 1000,\n} as const;\n"],"mappings":"AACA,IAAaA,EAAa,CACtB,MAAO,IACP,QAAS,IACT,KAAM,KACN,SAAU,GACd,EAGaC,EAAa,CACtB,MAAO,IACP,QAAS,KACT,KAAM,IACV,EAGaC,EAAe,CACxB,SAAU,IACV,KAAM,IACN,QAAS,IACT,KAAM,GACV,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../src/query/constants.ts"],"sourcesContent":["/** Recommended `staleTime` presets (milliseconds). */\nexport const STALE_TIME = {\n SHORT: 30 * 1000,\n DEFAULT: 5 * 60 * 1000,\n LONG: 30 * 60 * 1000,\n INFINITE: Infinity,\n} as const;\n\n/** Recommended `gcTime` presets (milliseconds). */\nexport const CACHE_TIME = {\n SHORT: 5 * 60 * 1000,\n DEFAULT: 30 * 60 * 1000,\n LONG: 60 * 60 * 1000,\n} as const;\n\n/** Recommended refetch intervals (milliseconds). */\nexport const REFETCH_TIME = {\n REALTIME: 5 * 1000,\n FAST: 30 * 1000,\n DEFAULT: 60 * 1000,\n SLOW: 5 * 60 * 1000,\n} as const;\n"],"mappings":";AACA,IAAa,IAAa;CACtB,OAAO;CACP,SAAS;CACT,MAAM;CACN,UAAU;AACd,GAGa,IAAa;CACtB,OAAO;CACP,SAAS;CACT,MAAM;AACV,GAGa,IAAe;CACxB,UAAU;CACV,MAAM;CACN,SAAS;CACT,MAAM;AACV"}
1
+ {"version":3,"file":"constants.js","names":["STALE_TIME","CACHE_TIME","REFETCH_TIME"],"sources":["../../src/query/constants.ts"],"sourcesContent":["/** Recommended `staleTime` presets (milliseconds). */\nexport const STALE_TIME = {\n SHORT: 30 * 1000,\n DEFAULT: 5 * 60 * 1000,\n LONG: 30 * 60 * 1000,\n INFINITE: Infinity,\n} as const;\n\n/** Recommended `gcTime` presets (milliseconds). */\nexport const CACHE_TIME = {\n SHORT: 5 * 60 * 1000,\n DEFAULT: 30 * 60 * 1000,\n LONG: 60 * 60 * 1000,\n} as const;\n\n/** Recommended refetch intervals (milliseconds). */\nexport const REFETCH_TIME = {\n REALTIME: 5 * 1000,\n FAST: 30 * 1000,\n DEFAULT: 60 * 1000,\n SLOW: 5 * 60 * 1000,\n} as const;\n"],"mappings":";AACA,IAAaA,IAAa;CACtB,OAAO;CACP,SAAS;CACT,MAAM;CACN,UAAU;AACd,GAGaC,IAAa;CACtB,OAAO;CACP,SAAS;CACT,MAAM;AACV,GAGaC,IAAe;CACxB,UAAU;CACV,MAAM;CACN,SAAS;CACT,MAAM;AACV"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-query-keys.cjs","names":[],"sources":["../../src/query/create-query-keys.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype KeyBuilder = (...args: any[]) => readonly unknown[];\n\n/**\n * Build a typed query-key factory for a domain. Each entry can be a static\n * tuple or a function returning a tuple. The returned object is `as const`\n * so TanStack Query infers literal keys.\n *\n * @example\n * const userKeys = createQueryKeys(\"user\", {\n * me: () => [\"me\"] as const,\n * byId: (id: string) => [id] as const,\n * list: (filters: { page: number }) => [\"list\", filters] as const,\n * });\n * // userKeys.byId(\"42\") === [\"user\", \"42\"]\n */\nexport function createQueryKeys<\n TKey extends string,\n TEntries extends Record<string, KeyBuilder | readonly unknown[]>,\n>(scope: TKey, entries: TEntries) {\n const output = { all: [scope] as const } as { all: readonly [TKey] } & {\n [K in keyof TEntries]: TEntries[K] extends KeyBuilder\n ? (...args: Parameters<TEntries[K]>) => readonly [TKey, ...ReturnType<TEntries[K]>]\n : TEntries[K] extends readonly unknown[]\n ? readonly [TKey, ...TEntries[K]]\n : never;\n };\n\n for (const [name, entry] of Object.entries(entries) as [\n keyof TEntries,\n KeyBuilder | readonly unknown[],\n ][]) {\n if (typeof entry === \"function\") {\n (output as Record<string, unknown>)[name as string] = (...args: unknown[]) =>\n [scope, ...entry(...args)] as const;\n } else {\n (output as Record<string, unknown>)[name as string] = [scope, ...entry] as const;\n }\n }\n\n return output;\n}\n"],"mappings":"AAgBA,SAAgB,EAGd,EAAa,EAAmB,CAC9B,IAAM,EAAS,CAAE,IAAK,CAAC,CAAK,CAAW,EAQvC,IAAK,GAAM,CAAC,EAAM,KAAU,OAAO,QAAQ,CAAO,EAI9C,AAII,EAAoC,GAJpC,OAAO,GAAU,YACsC,GAAG,IACtD,CAAC,EAAO,GAAG,EAAM,GAAG,CAAI,CAAC,EAEyB,CAAC,EAAO,GAAG,CAAK,EAI9E,OAAO,CACX"}
1
+ {"version":3,"file":"create-query-keys.cjs","names":["createQueryKeys","output","scope","name","entry","entries","args"],"sources":["../../src/query/create-query-keys.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype KeyBuilder = (...args: any[]) => readonly unknown[];\n\n/**\n * Build a typed query-key factory for a domain. Each entry can be a static\n * tuple or a function returning a tuple. The returned object is `as const`\n * so TanStack Query infers literal keys.\n *\n * @example\n * const userKeys = createQueryKeys(\"user\", {\n * me: () => [\"me\"] as const,\n * byId: (id: string) => [id] as const,\n * list: (filters: { page: number }) => [\"list\", filters] as const,\n * });\n * // userKeys.byId(\"42\") === [\"user\", \"42\"]\n */\nexport function createQueryKeys<\n TKey extends string,\n TEntries extends Record<string, KeyBuilder | readonly unknown[]>,\n>(scope: TKey, entries: TEntries) {\n const output = { all: [scope] as const } as { all: readonly [TKey] } & {\n [K in keyof TEntries]: TEntries[K] extends KeyBuilder\n ? (...args: Parameters<TEntries[K]>) => readonly [TKey, ...ReturnType<TEntries[K]>]\n : TEntries[K] extends readonly unknown[]\n ? readonly [TKey, ...TEntries[K]]\n : never;\n };\n\n for (const [name, entry] of Object.entries(entries) as [\n keyof TEntries,\n KeyBuilder | readonly unknown[],\n ][]) {\n if (typeof entry === \"function\") {\n (output as Record<string, unknown>)[name as string] = (...args: unknown[]) =>\n [scope, ...entry(...args)] as const;\n } else {\n (output as Record<string, unknown>)[name as string] = [scope, ...entry] as const;\n }\n }\n\n return output;\n}\n"],"mappings":"AAgBA,SAAgBA,EAGd,EAAa,EAAmB,CAC9B,IAAMC,EAAS,CAAE,IAAK,CAACC,CAAK,CAAW,EAQvC,IAAK,GAAM,CAACC,EAAMC,KAAU,OAAO,QAAQC,CAAO,EAI9C,AAIIJ,EAAoCE,GAJpC,OAAOC,GAAU,YACsC,GAAGE,IACtD,CAACJ,EAAO,GAAGE,EAAM,GAAGE,CAAI,CAAC,EAEyB,CAACJ,EAAO,GAAGE,CAAK,EAI9E,OAAOH,CACX,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-query-keys.js","names":[],"sources":["../../src/query/create-query-keys.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype KeyBuilder = (...args: any[]) => readonly unknown[];\n\n/**\n * Build a typed query-key factory for a domain. Each entry can be a static\n * tuple or a function returning a tuple. The returned object is `as const`\n * so TanStack Query infers literal keys.\n *\n * @example\n * const userKeys = createQueryKeys(\"user\", {\n * me: () => [\"me\"] as const,\n * byId: (id: string) => [id] as const,\n * list: (filters: { page: number }) => [\"list\", filters] as const,\n * });\n * // userKeys.byId(\"42\") === [\"user\", \"42\"]\n */\nexport function createQueryKeys<\n TKey extends string,\n TEntries extends Record<string, KeyBuilder | readonly unknown[]>,\n>(scope: TKey, entries: TEntries) {\n const output = { all: [scope] as const } as { all: readonly [TKey] } & {\n [K in keyof TEntries]: TEntries[K] extends KeyBuilder\n ? (...args: Parameters<TEntries[K]>) => readonly [TKey, ...ReturnType<TEntries[K]>]\n : TEntries[K] extends readonly unknown[]\n ? readonly [TKey, ...TEntries[K]]\n : never;\n };\n\n for (const [name, entry] of Object.entries(entries) as [\n keyof TEntries,\n KeyBuilder | readonly unknown[],\n ][]) {\n if (typeof entry === \"function\") {\n (output as Record<string, unknown>)[name as string] = (...args: unknown[]) =>\n [scope, ...entry(...args)] as const;\n } else {\n (output as Record<string, unknown>)[name as string] = [scope, ...entry] as const;\n }\n }\n\n return output;\n}\n"],"mappings":";AAgBA,SAAgB,EAGd,GAAa,GAAmB;CAC9B,IAAM,IAAS,EAAE,KAAK,CAAC,CAAK,EAAW;CAQvC,KAAK,IAAM,CAAC,GAAM,MAAU,OAAO,QAAQ,CAAO,GAI9C,AAII,EAAoC,KAJpC,OAAO,KAAU,cACsC,GAAG,MACtD,CAAC,GAAO,GAAG,EAAM,GAAG,CAAI,CAAC,IAEyB,CAAC,GAAO,GAAG,CAAK;CAI9E,OAAO;AACX"}
1
+ {"version":3,"file":"create-query-keys.js","names":["createQueryKeys","output","scope","name","entry","entries","args"],"sources":["../../src/query/create-query-keys.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype KeyBuilder = (...args: any[]) => readonly unknown[];\n\n/**\n * Build a typed query-key factory for a domain. Each entry can be a static\n * tuple or a function returning a tuple. The returned object is `as const`\n * so TanStack Query infers literal keys.\n *\n * @example\n * const userKeys = createQueryKeys(\"user\", {\n * me: () => [\"me\"] as const,\n * byId: (id: string) => [id] as const,\n * list: (filters: { page: number }) => [\"list\", filters] as const,\n * });\n * // userKeys.byId(\"42\") === [\"user\", \"42\"]\n */\nexport function createQueryKeys<\n TKey extends string,\n TEntries extends Record<string, KeyBuilder | readonly unknown[]>,\n>(scope: TKey, entries: TEntries) {\n const output = { all: [scope] as const } as { all: readonly [TKey] } & {\n [K in keyof TEntries]: TEntries[K] extends KeyBuilder\n ? (...args: Parameters<TEntries[K]>) => readonly [TKey, ...ReturnType<TEntries[K]>]\n : TEntries[K] extends readonly unknown[]\n ? readonly [TKey, ...TEntries[K]]\n : never;\n };\n\n for (const [name, entry] of Object.entries(entries) as [\n keyof TEntries,\n KeyBuilder | readonly unknown[],\n ][]) {\n if (typeof entry === \"function\") {\n (output as Record<string, unknown>)[name as string] = (...args: unknown[]) =>\n [scope, ...entry(...args)] as const;\n } else {\n (output as Record<string, unknown>)[name as string] = [scope, ...entry] as const;\n }\n }\n\n return output;\n}\n"],"mappings":";AAgBA,SAAgBA,EAGd,GAAa,GAAmB;CAC9B,IAAMC,IAAS,EAAE,KAAK,CAACC,CAAK,EAAW;CAQvC,KAAK,IAAM,CAACC,GAAMC,MAAU,OAAO,QAAQC,CAAO,GAI9C,AAIIJ,EAAoCE,KAJpC,OAAOC,KAAU,cACsC,GAAGE,MACtD,CAACJ,GAAO,GAAGE,EAAM,GAAGE,CAAI,CAAC,IAEyB,CAACJ,GAAO,GAAGE,CAAK;CAI9E,OAAOH;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"foreign-client-warning.cjs","names":[],"sources":["../../src/query/foreign-client-warning.ts"],"sourcesContent":["/**\n * Internal, in its own file for the reason the AppBar warning is: a module that\n * exports a component may export nothing else without breaking Fast Refresh\n * (`react-refresh/only-export-components`), and the warn-once latch needs a\n * reset for tests to assert the warning more than once.\n */\nimport { QueryClient } from \"@tanstack/react-query\";\n\nimport { isDevBuild } from \"../utils/dev-mode\";\nimport { DUPLICATE_COPY_REMEDY } from \"../utils/duplicate-instance\";\n\n/** Set once the warning has printed, so a re-render does not bury the console. */\nlet warnedForeignClient = false;\n\n/**\n * Reset the warn-once latch. Test-only: the latch is module state, so a suite\n * asserting the warning more than once would otherwise see it only the first time.\n */\nexport function resetForeignClientWarning(): void {\n warnedForeignClient = false;\n}\n\n/**\n * Warn when the `client` handed in was built by a different copy of\n * `@tanstack/react-query`.\n *\n * This prop is the one place the app's copy and the SDK's copy touch: the app\n * constructs a `QueryClient` and passes it in, and `QueryClientProvider` —\n * resolved from the SDK's copy — publishes it on *that* copy's context. Every\n * `useQuery` in the app then reads the app copy's context, finds nothing, and\n * throws `No QueryClient set, use QueryClientProvider to set one` while a\n * provider is plainly mounted three lines up. Nothing in that message points at\n * the duplicate, which is why it costs an afternoon.\n *\n * `instanceof` is the discriminator, and it is exactly the right one: two copies\n * define two distinct `QueryClient` classes, so a client from the other copy\n * duck-types perfectly and fails the identity check. The duck-type guard runs\n * first so the warning fires only on the shape that is actually a client —\n * without it, every hand-rolled test double would trip it.\n *\n * @param client - The client the caller passed, if any.\n */\nexport function warnOnForeignClient(client: QueryClient | undefined): void {\n if (warnedForeignClient || client === undefined || !isDevBuild()) return;\n if (client instanceof QueryClient) return;\n const looksLikeClient =\n typeof (client as Partial<QueryClient>).getQueryCache === \"function\" &&\n typeof (client as Partial<QueryClient>).mount === \"function\";\n if (!looksLikeClient) return;\n warnedForeignClient = true;\n console.warn(\n \"[tempest-react-sdk] <QueryProvider client={...} /> received a QueryClient \" +\n \"built by a different copy of @tanstack/react-query. The SDK publishes it on \" +\n \"its own copy's context, so the app's `useQuery` calls will throw \" +\n '\"No QueryClient set\" even though this provider is mounted. ' +\n DUPLICATE_COPY_REMEDY,\n );\n}\n"],"mappings":"6HAYA,IAAI,EAAsB,GA8B1B,SAAgB,EAAoB,EAAuC,CACnE,IAAuB,IAAW,IAAA,IAAc,EAAA,WAAW,IAC3D,aAAkB,EAAA,aAElB,OAAQ,EAAgC,eAAkB,YAC1D,OAAQ,EAAgC,OAAU,aAEtD,EAAsB,GACtB,QAAQ,KACJ,uRAII,EAAA,qBACR,GACJ"}
1
+ {"version":3,"file":"foreign-client-warning.cjs","names":["isDevBuild","QueryClient","DUPLICATE_COPY_REMEDY","require_dev_mode","require_duplicate_instance","_tanstack_react_query","warnedForeignClient","warnOnForeignClient","client"],"sources":["../../src/query/foreign-client-warning.ts"],"sourcesContent":["/**\n * Internal, in its own file for the reason the AppBar warning is: a module that\n * exports a component may export nothing else without breaking Fast Refresh\n * (`react-refresh/only-export-components`), and the warn-once latch needs a\n * reset for tests to assert the warning more than once.\n */\nimport { QueryClient } from \"@tanstack/react-query\";\n\nimport { isDevBuild } from \"../utils/dev-mode\";\nimport { DUPLICATE_COPY_REMEDY } from \"../utils/duplicate-instance\";\n\n/** Set once the warning has printed, so a re-render does not bury the console. */\nlet warnedForeignClient = false;\n\n/**\n * Reset the warn-once latch. Test-only: the latch is module state, so a suite\n * asserting the warning more than once would otherwise see it only the first time.\n */\nexport function resetForeignClientWarning(): void {\n warnedForeignClient = false;\n}\n\n/**\n * Warn when the `client` handed in was built by a different copy of\n * `@tanstack/react-query`.\n *\n * This prop is the one place the app's copy and the SDK's copy touch: the app\n * constructs a `QueryClient` and passes it in, and `QueryClientProvider` —\n * resolved from the SDK's copy — publishes it on *that* copy's context. Every\n * `useQuery` in the app then reads the app copy's context, finds nothing, and\n * throws `No QueryClient set, use QueryClientProvider to set one` while a\n * provider is plainly mounted three lines up. Nothing in that message points at\n * the duplicate, which is why it costs an afternoon.\n *\n * `instanceof` is the discriminator, and it is exactly the right one: two copies\n * define two distinct `QueryClient` classes, so a client from the other copy\n * duck-types perfectly and fails the identity check. The duck-type guard runs\n * first so the warning fires only on the shape that is actually a client —\n * without it, every hand-rolled test double would trip it.\n *\n * @param client - The client the caller passed, if any.\n */\nexport function warnOnForeignClient(client: QueryClient | undefined): void {\n if (warnedForeignClient || client === undefined || !isDevBuild()) return;\n if (client instanceof QueryClient) return;\n const looksLikeClient =\n typeof (client as Partial<QueryClient>).getQueryCache === \"function\" &&\n typeof (client as Partial<QueryClient>).mount === \"function\";\n if (!looksLikeClient) return;\n warnedForeignClient = true;\n console.warn(\n \"[tempest-react-sdk] <QueryProvider client={...} /> received a QueryClient \" +\n \"built by a different copy of @tanstack/react-query. The SDK publishes it on \" +\n \"its own copy's context, so the app's `useQuery` calls will throw \" +\n '\"No QueryClient set\" even though this provider is mounted. ' +\n DUPLICATE_COPY_REMEDY,\n );\n}\n"],"mappings":"A,6HAYA,IAAIM,EAAsB,GA8B1B,SAAgBC,EAAoB,EAAuC,CACnE,IAAuBC,IAAW,IAAA,IAAcR,EAAAA,WAAW,IAC3DQ,aAAkBP,EAAAA,aAElB,OAAQO,EAAgC,eAAkB,YAC1D,OAAQA,EAAgC,OAAU,aAEtD,EAAsB,GACtB,QAAQ,KACJ,uRAIIN,EAAAA,qBACR,GACJ,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"foreign-client-warning.js","names":[],"sources":["../../src/query/foreign-client-warning.ts"],"sourcesContent":["/**\n * Internal, in its own file for the reason the AppBar warning is: a module that\n * exports a component may export nothing else without breaking Fast Refresh\n * (`react-refresh/only-export-components`), and the warn-once latch needs a\n * reset for tests to assert the warning more than once.\n */\nimport { QueryClient } from \"@tanstack/react-query\";\n\nimport { isDevBuild } from \"../utils/dev-mode\";\nimport { DUPLICATE_COPY_REMEDY } from \"../utils/duplicate-instance\";\n\n/** Set once the warning has printed, so a re-render does not bury the console. */\nlet warnedForeignClient = false;\n\n/**\n * Reset the warn-once latch. Test-only: the latch is module state, so a suite\n * asserting the warning more than once would otherwise see it only the first time.\n */\nexport function resetForeignClientWarning(): void {\n warnedForeignClient = false;\n}\n\n/**\n * Warn when the `client` handed in was built by a different copy of\n * `@tanstack/react-query`.\n *\n * This prop is the one place the app's copy and the SDK's copy touch: the app\n * constructs a `QueryClient` and passes it in, and `QueryClientProvider` —\n * resolved from the SDK's copy — publishes it on *that* copy's context. Every\n * `useQuery` in the app then reads the app copy's context, finds nothing, and\n * throws `No QueryClient set, use QueryClientProvider to set one` while a\n * provider is plainly mounted three lines up. Nothing in that message points at\n * the duplicate, which is why it costs an afternoon.\n *\n * `instanceof` is the discriminator, and it is exactly the right one: two copies\n * define two distinct `QueryClient` classes, so a client from the other copy\n * duck-types perfectly and fails the identity check. The duck-type guard runs\n * first so the warning fires only on the shape that is actually a client —\n * without it, every hand-rolled test double would trip it.\n *\n * @param client - The client the caller passed, if any.\n */\nexport function warnOnForeignClient(client: QueryClient | undefined): void {\n if (warnedForeignClient || client === undefined || !isDevBuild()) return;\n if (client instanceof QueryClient) return;\n const looksLikeClient =\n typeof (client as Partial<QueryClient>).getQueryCache === \"function\" &&\n typeof (client as Partial<QueryClient>).mount === \"function\";\n if (!looksLikeClient) return;\n warnedForeignClient = true;\n console.warn(\n \"[tempest-react-sdk] <QueryProvider client={...} /> received a QueryClient \" +\n \"built by a different copy of @tanstack/react-query. The SDK publishes it on \" +\n \"its own copy's context, so the app's `useQuery` calls will throw \" +\n '\"No QueryClient set\" even though this provider is mounted. ' +\n DUPLICATE_COPY_REMEDY,\n );\n}\n"],"mappings":";;;;AAYA,IAAI,IAAsB;AA8B1B,SAAgB,EAAoB,GAAuC;CACnE,MAAuB,MAAW,KAAA,KAAc,EAAW,MAC3D,aAAkB,KAElB,OAAQ,EAAgC,iBAAkB,cAC1D,OAAQ,EAAgC,SAAU,eAEtD,IAAsB,IACtB,QAAQ,KACJ,yRAII,CACR;AACJ"}
1
+ {"version":3,"file":"foreign-client-warning.js","names":["warnedForeignClient","warnOnForeignClient","client","isDevBuild","QueryClient","DUPLICATE_COPY_REMEDY"],"sources":["../../src/query/foreign-client-warning.ts"],"sourcesContent":["/**\n * Internal, in its own file for the reason the AppBar warning is: a module that\n * exports a component may export nothing else without breaking Fast Refresh\n * (`react-refresh/only-export-components`), and the warn-once latch needs a\n * reset for tests to assert the warning more than once.\n */\nimport { QueryClient } from \"@tanstack/react-query\";\n\nimport { isDevBuild } from \"../utils/dev-mode\";\nimport { DUPLICATE_COPY_REMEDY } from \"../utils/duplicate-instance\";\n\n/** Set once the warning has printed, so a re-render does not bury the console. */\nlet warnedForeignClient = false;\n\n/**\n * Reset the warn-once latch. Test-only: the latch is module state, so a suite\n * asserting the warning more than once would otherwise see it only the first time.\n */\nexport function resetForeignClientWarning(): void {\n warnedForeignClient = false;\n}\n\n/**\n * Warn when the `client` handed in was built by a different copy of\n * `@tanstack/react-query`.\n *\n * This prop is the one place the app's copy and the SDK's copy touch: the app\n * constructs a `QueryClient` and passes it in, and `QueryClientProvider` —\n * resolved from the SDK's copy — publishes it on *that* copy's context. Every\n * `useQuery` in the app then reads the app copy's context, finds nothing, and\n * throws `No QueryClient set, use QueryClientProvider to set one` while a\n * provider is plainly mounted three lines up. Nothing in that message points at\n * the duplicate, which is why it costs an afternoon.\n *\n * `instanceof` is the discriminator, and it is exactly the right one: two copies\n * define two distinct `QueryClient` classes, so a client from the other copy\n * duck-types perfectly and fails the identity check. The duck-type guard runs\n * first so the warning fires only on the shape that is actually a client —\n * without it, every hand-rolled test double would trip it.\n *\n * @param client - The client the caller passed, if any.\n */\nexport function warnOnForeignClient(client: QueryClient | undefined): void {\n if (warnedForeignClient || client === undefined || !isDevBuild()) return;\n if (client instanceof QueryClient) return;\n const looksLikeClient =\n typeof (client as Partial<QueryClient>).getQueryCache === \"function\" &&\n typeof (client as Partial<QueryClient>).mount === \"function\";\n if (!looksLikeClient) return;\n warnedForeignClient = true;\n console.warn(\n \"[tempest-react-sdk] <QueryProvider client={...} /> received a QueryClient \" +\n \"built by a different copy of @tanstack/react-query. The SDK publishes it on \" +\n \"its own copy's context, so the app's `useQuery` calls will throw \" +\n '\"No QueryClient set\" even though this provider is mounted. ' +\n DUPLICATE_COPY_REMEDY,\n );\n}\n"],"mappings":";;;;AAYA,IAAIA,IAAsB;AA8B1B,SAAgBC,EAAoB,GAAuC;CACvE,AAAI,MAAuBC,MAAW,KAAA,KAAcC,EAAW,MAC3DD,aAAkBE,KAElB,OAAQF,EAAgC,iBAAkB,cAC1D,OAAQA,EAAgC,SAAU,eAEtD,IAAsB,IACtB,QAAQ,KACJ,yRAIIG,CACR;AACJ"}
@@ -1,2 +1,2 @@
1
- const e=require("../utils/dev-mode.cjs"),t=require("../offline/create-offline-store.cjs");let n=require("@tanstack/react-query");var r=new Map;function i(i){let{queryClient:a,throttleMs:o=1e3}=i,s=i.key??`tanstack-query`,c=i.databaseName??`TempestQueryCache`,l=t.createOfflineStore({databaseName:c,version:1,tableName:`cache`,indexes:`&id`,keyPath:`id`}),u=`${c}\u0000${s}`,d=!1,f=!1,p=null,m=new Set;async function h(){let e=r.get(u);e&&await e}function g(){!f&&e.isDevBuild()&&(f=!0,console.warn(`[tempest-react-sdk] persistQueryClientOffline: handle ended by clear(); create a new one after login to keep persisting.`))}async function _(){if(d||(await h(),d))return;let e=l.put({id:s,state:(0,n.dehydrate)(a)});m.add(e);try{await e}finally{m.delete(e)}}function v(){p&&=(clearTimeout(p),null)}function y(){p||d||(p=setTimeout(()=>{p=null,_()},o))}function b(e){if(!d){y();return}(e.type===`added`||e.type===`updated`)&&(x(),g())}let x=a.getQueryCache().subscribe(b);async function S(e){try{await Promise.allSettled([...m]),await l.delete(s)}finally{e&&a.clear()}}return{async restore(){if(d){g();return}if(await h(),d)return;let e=await l.get(s);e&&!d&&(0,n.hydrate)(a,e.state)},async flush(){if(d){g();return}v(),await _()},unsubscribe(){v(),x()},async clear(e={}){d=!0,v();let t=r.get(u),n=S(e.resetClient??!1),i=Promise.allSettled([t,n]);r.set(u,i),i.then(()=>{r.get(u)===i&&r.delete(u)}),await n}}}exports.persistQueryClientOffline=i;
1
+ const e=require("../utils/dev-mode.cjs"),t=require("../offline/create-offline-store.cjs");let n=require("@tanstack/react-query");var r=new Map;function i(i){let{queryClient:a,throttleMs:o=1e3}=i,s=i.key??`tanstack-query`,c=i.databaseName??`TempestQueryCache`,l=t.createOfflineStore({databaseName:c,version:1,tableName:`cache`,indexes:`&id`,keyPath:`id`}),u=`${c}\u0000${s}`,d=!1,f=!1,p=null,m=new Set;async function h(){let e=r.get(u);e&&await e}function g(){!f&&e.isDevBuild()&&(f=!0,console.warn(`[tempest-react-sdk] persistQueryClientOffline: handle ended by clear(); create a new one after login to keep persisting.`))}async function _(){if(d||(await h(),d))return;let e=l.put({id:s,state:(0,n.dehydrate)(a)});m.add(e);try{await e}finally{m.delete(e)}}function v(){p&&=(clearTimeout(p),null)}function y(){p||d||(p=setTimeout(()=>{p=null,_()},o))}function b(e){d?(e.type===`added`||e.type===`updated`)&&(x(),g()):y()}let x=a.getQueryCache().subscribe(b);async function S(e){try{await Promise.allSettled([...m]),await l.delete(s)}finally{e&&a.clear()}}return{async restore(){if(d){g();return}if(await h(),d)return;let e=await l.get(s);e&&!d&&(0,n.hydrate)(a,e.state)},async flush(){d?g():(v(),await _())},unsubscribe(){v(),x()},async clear(e={}){d=!0,v();let t=r.get(u),n=S(e.resetClient??!1),i=Promise.allSettled([t,n]);r.set(u,i),i.then(()=>{r.get(u)===i&&r.delete(u)}),await n}}}exports.persistQueryClientOffline=i;
2
2
  //# sourceMappingURL=offline-persistence.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"offline-persistence.cjs","names":[],"sources":["../../src/query/offline-persistence.ts"],"sourcesContent":["import {\n dehydrate,\n hydrate,\n type QueryCacheNotifyEvent,\n type QueryClient,\n} from \"@tanstack/react-query\";\nimport { createOfflineStore } from \"../offline/create-offline-store\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\n/**\n * Clears still running, per `databaseName` + `key` slot, across every handle.\n *\n * A handle's `clear()` deletes by key with no ordering against other handles,\n * so a new handle created on login while the previous one is still clearing\n * could `restore()` the previous user's snapshot before the delete lands, or\n * have its first write deleted by it. Every handle's `restore()` and writes\n * wait for the slot's pending clear first; the entry is dropped once settled.\n */\nconst pendingClears = new Map<string, Promise<unknown>>();\n\n/** Options for {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistenceOptions {\n /** The `QueryClient` to snapshot and restore. */\n queryClient: QueryClient;\n /** IndexedDB database name for the snapshot. Default `\"TempestQueryCache\"`. */\n databaseName?: string;\n /** Row key under which the snapshot is stored. Default `\"tanstack-query\"`. */\n key?: string;\n /**\n * Minimum gap between snapshot writes, in ms — cache churn is coalesced into\n * one trailing write per window. Default `1000`.\n */\n throttleMs?: number;\n}\n\n/** Options for {@link OfflineQueryPersistence.clear}. */\nexport interface OfflineQueryClearOptions {\n /**\n * Also clear the in-memory `QueryClient` (`queryClient.clear()`) once\n * persistence has stopped and the snapshot is deleted — the one-call logout.\n * Default `false`: the client belongs to the app, which may want to keep\n * public queries (a catalog, feature flags) across sessions and drop only\n * the user-scoped keys with `removeQueries`.\n */\n resetClient?: boolean;\n}\n\n/** Handle returned by {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistence {\n /**\n * Load the persisted snapshot into the `QueryClient`. Call once on boot,\n * before rendering queries, so cached data is available offline. A no-op\n * once {@link OfflineQueryPersistence.clear} has been called.\n */\n restore: () => Promise<void>;\n /**\n * Write the current cache snapshot immediately (bypassing the throttle). A\n * no-op once {@link OfflineQueryPersistence.clear} has been called.\n */\n flush: () => Promise<void>;\n /** Stop persisting and drop the pending write. Idempotent. */\n unsubscribe: () => void;\n /**\n * End the persisted session (e.g. on logout) and delete the snapshot.\n *\n * Terminal for this handle: it cancels the pending throttled write, stops\n * persisting cache changes, waits for any write already in flight and only\n * then deletes the row — so neither a write pending in the last throttle\n * window nor cache activity after logout (the next user's first query) can\n * re-persist the previous user's responses. Afterwards `restore`/`flush`\n * are no-ops; to persist a new session, call\n * {@link persistQueryClientOffline} again after login. In a dev build\n * (`isDevBuild()`), the first `restore`, `flush` or added/updated query on\n * an ended handle logs one `console.warn` saying so, because a handle kept\n * at module scope would otherwise stop persisting in silence.\n *\n * Ordered against other handles on the same `databaseName` + `key`: until\n * this clear settles, a new handle's `restore()` and writes wait for it, so\n * a handle created on login without awaiting the logout neither hydrates\n * the previous snapshot nor has its first write deleted.\n *\n * If the delete rejects, `resetClient` still clears the client and the\n * rejection reaches the caller.\n *\n * The in-memory `QueryClient` is cleared only with `resetClient: true`, and\n * then only after persistence has stopped, so the reset itself cannot\n * trigger a write. It is opt-in because the app owns the client and the\n * shape of its logout: it may keep public queries and drop only the\n * user-scoped keys with `removeQueries`. Because persistence is already\n * off, that manual call can come before or after this one.\n *\n * Idempotent and safe to call concurrently; every call deletes the row\n * again.\n *\n * @param options - `resetClient` also clears the in-memory `QueryClient`.\n */\n clear: (options?: OfflineQueryClearOptions) => Promise<void>;\n}\n\ninterface Snapshot {\n id: string;\n state: ReturnType<typeof dehydrate>;\n}\n\n/**\n * Persist a TanStack `QueryClient` cache to IndexedDB (via\n * {@link createOfflineStore}) and restore it on boot — so a reload or a cold\n * offline start shows the last-known data instead of empty screens.\n *\n * Self-contained: uses `dehydrate`/`hydrate` from `@tanstack/react-query`\n * directly, so no `@tanstack/react-query-persist-client` dependency is needed.\n * Writes are throttled and subscribe to the query cache; call `unsubscribe` on\n * teardown. Dexie is a peer dependency of the offline store — install it.\n *\n * @param options - The client plus storage/throttle configuration.\n * @returns A handle with `restore`, `flush`, `clear` and `unsubscribe`.\n *\n * `clear()` is terminal for the handle (see {@link OfflineQueryPersistence.clear}):\n * a logout that only deleted the row used to be undone by the pending write or\n * by the next cache event, restoring the previous user's data on the next boot\n * (#440).\n *\n * @example\n * const persistence = persistQueryClientOffline({ queryClient });\n * await persistence.restore();\n *\n * async function logout(): Promise<void> {\n * await persistence.clear({ resetClient: true });\n * }\n */\nexport function persistQueryClientOffline(\n options: OfflineQueryPersistenceOptions,\n): OfflineQueryPersistence {\n const { queryClient, throttleMs = 1000 } = options;\n const key = options.key ?? \"tanstack-query\";\n const databaseName = options.databaseName ?? \"TempestQueryCache\";\n const store = createOfflineStore<Snapshot, string>({\n databaseName,\n version: 1,\n tableName: \"cache\",\n indexes: \"&id\",\n keyPath: \"id\",\n });\n\n const slot = `${databaseName}\\u0000${key}`;\n let ended = false;\n let warnedEnded = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n const inFlight = new Set<Promise<unknown>>();\n\n async function afterPendingClear(): Promise<void> {\n const pending = pendingClears.get(slot);\n if (pending) await pending;\n }\n\n function warnEnded(): void {\n if (warnedEnded || !isDevBuild()) return;\n warnedEnded = true;\n console.warn(\n \"[tempest-react-sdk] persistQueryClientOffline: handle ended by clear(); \" +\n \"create a new one after login to keep persisting.\",\n );\n }\n\n async function save(): Promise<void> {\n if (ended) return;\n await afterPendingClear();\n if (ended) return;\n const write = store.put({ id: key, state: dehydrate(queryClient) });\n inFlight.add(write);\n try {\n await write;\n } finally {\n inFlight.delete(write);\n }\n }\n\n function cancelTimer(): void {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n\n function schedule(): void {\n if (timer || ended) return;\n timer = setTimeout(() => {\n timer = null;\n void save();\n }, throttleMs);\n }\n\n function onCacheEvent(event: QueryCacheNotifyEvent): void {\n if (!ended) {\n schedule();\n return;\n }\n if (event.type !== \"added\" && event.type !== \"updated\") return;\n unsubscribeCache();\n warnEnded();\n }\n\n const unsubscribeCache = queryClient.getQueryCache().subscribe(onCacheEvent);\n\n async function endSession(resetClient: boolean): Promise<void> {\n try {\n await Promise.allSettled([...inFlight]);\n await store.delete(key);\n } finally {\n if (resetClient) queryClient.clear();\n }\n }\n\n return {\n async restore() {\n if (ended) {\n warnEnded();\n return;\n }\n await afterPendingClear();\n if (ended) return;\n const snapshot = await store.get(key);\n if (snapshot && !ended) hydrate(queryClient, snapshot.state);\n },\n async flush() {\n if (ended) {\n warnEnded();\n return;\n }\n cancelTimer();\n await save();\n },\n unsubscribe() {\n cancelTimer();\n unsubscribeCache();\n },\n async clear(clearOptions = {}) {\n ended = true;\n cancelTimer();\n const previous = pendingClears.get(slot);\n const run = endSession(clearOptions.resetClient ?? false);\n const settled = Promise.allSettled([previous, run]);\n pendingClears.set(slot, settled);\n void settled.then(() => {\n if (pendingClears.get(slot) === settled) pendingClears.delete(slot);\n });\n await run;\n },\n };\n}\n"],"mappings":"iIAkBA,IAAM,EAAgB,IAAI,IAgH1B,SAAgB,EACZ,EACuB,CACvB,GAAM,CAAE,cAAa,aAAa,KAAS,EACrC,EAAM,EAAQ,KAAO,iBACrB,EAAe,EAAQ,cAAgB,oBACvC,EAAQ,EAAA,mBAAqC,CAC/C,eACA,QAAS,EACT,UAAW,QACX,QAAS,MACT,QAAS,IACb,CAAC,EAEK,EAAO,GAAG,EAAa,QAAQ,IACjC,EAAQ,GACR,EAAc,GACd,EAA8C,KAC5C,EAAW,IAAI,IAErB,eAAe,GAAmC,CAC9C,IAAM,EAAU,EAAc,IAAI,CAAI,EAClC,GAAS,MAAM,CACvB,CAEA,SAAS,GAAkB,CACnB,IAAgB,EAAA,WAAW,IAC/B,EAAc,GACd,QAAQ,KACJ,0HAEJ,EACJ,CAEA,eAAe,GAAsB,CAGjC,GAFI,IACJ,MAAM,EAAkB,EACpB,GAAO,OACX,IAAM,EAAQ,EAAM,IAAI,CAAE,GAAI,EAAK,OAAA,EAAO,EAAA,UAAA,CAAU,CAAW,CAAE,CAAC,EAClE,EAAS,IAAI,CAAK,EAClB,GAAI,CACA,MAAM,CACV,QAAU,CACN,EAAS,OAAO,CAAK,CACzB,CACJ,CAEA,SAAS,GAAoB,CACzB,AAEI,KADA,aAAa,CAAK,EACV,KAEhB,CAEA,SAAS,GAAiB,CAClB,GAAS,IACb,EAAQ,eAAiB,CACrB,EAAQ,KACR,EAAU,CACd,EAAG,CAAU,EACjB,CAEA,SAAS,EAAa,EAAoC,CACtD,GAAI,CAAC,EAAO,CACR,EAAS,EACT,MACJ,EACI,EAAM,OAAS,SAAW,EAAM,OAAS,aAC7C,EAAiB,EACjB,EAAU,EACd,CAEA,IAAM,EAAmB,EAAY,cAAc,CAAC,CAAC,UAAU,CAAY,EAE3E,eAAe,EAAW,EAAqC,CAC3D,GAAI,CACA,MAAM,QAAQ,WAAW,CAAC,GAAG,CAAQ,CAAC,EACtC,MAAM,EAAM,OAAO,CAAG,CAC1B,QAAU,CACF,GAAa,EAAY,MAAM,CACvC,CACJ,CAEA,MAAO,CACH,MAAM,SAAU,CACZ,GAAI,EAAO,CACP,EAAU,EACV,MACJ,CAEA,GADA,MAAM,EAAkB,EACpB,EAAO,OACX,IAAM,EAAW,MAAM,EAAM,IAAI,CAAG,EAChC,GAAY,CAAC,IAAO,EAAA,EAAA,QAAA,CAAQ,EAAa,EAAS,KAAK,CAC/D,EACA,MAAM,OAAQ,CACV,GAAI,EAAO,CACP,EAAU,EACV,MACJ,CACA,EAAY,EACZ,MAAM,EAAK,CACf,EACA,aAAc,CACV,EAAY,EACZ,EAAiB,CACrB,EACA,MAAM,MAAM,EAAe,CAAC,EAAG,CAC3B,EAAQ,GACR,EAAY,EACZ,IAAM,EAAW,EAAc,IAAI,CAAI,EACjC,EAAM,EAAW,EAAa,aAAe,EAAK,EAClD,EAAU,QAAQ,WAAW,CAAC,EAAU,CAAG,CAAC,EAClD,EAAc,IAAI,EAAM,CAAO,EAC/B,EAAa,SAAW,CAChB,EAAc,IAAI,CAAI,IAAM,GAAS,EAAc,OAAO,CAAI,CACtE,CAAC,EACD,MAAM,CACV,CACJ,CACJ"}
1
+ {"version":3,"file":"offline-persistence.cjs","names":["createOfflineStore","isDevBuild","dehydrate","require_dev_mode","require_create_offline_store","_tanstack_react_query","pendingClears","persistQueryClientOffline","options","key","databaseName","store","slot","ended","warnedEnded","timer","inFlight","afterPendingClear","pending","warnEnded","save","write","queryClient","cancelTimer","schedule","throttleMs","onCacheEvent","event","unsubscribeCache","endSession","resetClient","snapshot","previous","run","clearOptions","settled"],"sources":["../../src/query/offline-persistence.ts"],"sourcesContent":["import {\n dehydrate,\n hydrate,\n type QueryCacheNotifyEvent,\n type QueryClient,\n} from \"@tanstack/react-query\";\nimport { createOfflineStore } from \"../offline/create-offline-store\";\nimport { isDevBuild } from \"../utils/dev-mode\";\n\n/**\n * Clears still running, per `databaseName` + `key` slot, across every handle.\n *\n * A handle's `clear()` deletes by key with no ordering against other handles,\n * so a new handle created on login while the previous one is still clearing\n * could `restore()` the previous user's snapshot before the delete lands, or\n * have its first write deleted by it. Every handle's `restore()` and writes\n * wait for the slot's pending clear first; the entry is dropped once settled.\n */\nconst pendingClears = new Map<string, Promise<unknown>>();\n\n/** Options for {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistenceOptions {\n /** The `QueryClient` to snapshot and restore. */\n queryClient: QueryClient;\n /** IndexedDB database name for the snapshot. Default `\"TempestQueryCache\"`. */\n databaseName?: string;\n /** Row key under which the snapshot is stored. Default `\"tanstack-query\"`. */\n key?: string;\n /**\n * Minimum gap between snapshot writes, in ms — cache churn is coalesced into\n * one trailing write per window. Default `1000`.\n */\n throttleMs?: number;\n}\n\n/** Options for {@link OfflineQueryPersistence.clear}. */\nexport interface OfflineQueryClearOptions {\n /**\n * Also clear the in-memory `QueryClient` (`queryClient.clear()`) once\n * persistence has stopped and the snapshot is deleted — the one-call logout.\n * Default `false`: the client belongs to the app, which may want to keep\n * public queries (a catalog, feature flags) across sessions and drop only\n * the user-scoped keys with `removeQueries`.\n */\n resetClient?: boolean;\n}\n\n/** Handle returned by {@link persistQueryClientOffline}. */\nexport interface OfflineQueryPersistence {\n /**\n * Load the persisted snapshot into the `QueryClient`. Call once on boot,\n * before rendering queries, so cached data is available offline. A no-op\n * once {@link OfflineQueryPersistence.clear} has been called.\n */\n restore: () => Promise<void>;\n /**\n * Write the current cache snapshot immediately (bypassing the throttle). A\n * no-op once {@link OfflineQueryPersistence.clear} has been called.\n */\n flush: () => Promise<void>;\n /** Stop persisting and drop the pending write. Idempotent. */\n unsubscribe: () => void;\n /**\n * End the persisted session (e.g. on logout) and delete the snapshot.\n *\n * Terminal for this handle: it cancels the pending throttled write, stops\n * persisting cache changes, waits for any write already in flight and only\n * then deletes the row — so neither a write pending in the last throttle\n * window nor cache activity after logout (the next user's first query) can\n * re-persist the previous user's responses. Afterwards `restore`/`flush`\n * are no-ops; to persist a new session, call\n * {@link persistQueryClientOffline} again after login. In a dev build\n * (`isDevBuild()`), the first `restore`, `flush` or added/updated query on\n * an ended handle logs one `console.warn` saying so, because a handle kept\n * at module scope would otherwise stop persisting in silence.\n *\n * Ordered against other handles on the same `databaseName` + `key`: until\n * this clear settles, a new handle's `restore()` and writes wait for it, so\n * a handle created on login without awaiting the logout neither hydrates\n * the previous snapshot nor has its first write deleted.\n *\n * If the delete rejects, `resetClient` still clears the client and the\n * rejection reaches the caller.\n *\n * The in-memory `QueryClient` is cleared only with `resetClient: true`, and\n * then only after persistence has stopped, so the reset itself cannot\n * trigger a write. It is opt-in because the app owns the client and the\n * shape of its logout: it may keep public queries and drop only the\n * user-scoped keys with `removeQueries`. Because persistence is already\n * off, that manual call can come before or after this one.\n *\n * Idempotent and safe to call concurrently; every call deletes the row\n * again.\n *\n * @param options - `resetClient` also clears the in-memory `QueryClient`.\n */\n clear: (options?: OfflineQueryClearOptions) => Promise<void>;\n}\n\ninterface Snapshot {\n id: string;\n state: ReturnType<typeof dehydrate>;\n}\n\n/**\n * Persist a TanStack `QueryClient` cache to IndexedDB (via\n * {@link createOfflineStore}) and restore it on boot — so a reload or a cold\n * offline start shows the last-known data instead of empty screens.\n *\n * Self-contained: uses `dehydrate`/`hydrate` from `@tanstack/react-query`\n * directly, so no `@tanstack/react-query-persist-client` dependency is needed.\n * Writes are throttled and subscribe to the query cache; call `unsubscribe` on\n * teardown. Dexie is a peer dependency of the offline store — install it.\n *\n * @param options - The client plus storage/throttle configuration.\n * @returns A handle with `restore`, `flush`, `clear` and `unsubscribe`.\n *\n * `clear()` is terminal for the handle (see {@link OfflineQueryPersistence.clear}):\n * a logout that only deleted the row used to be undone by the pending write or\n * by the next cache event, restoring the previous user's data on the next boot\n * (#440).\n *\n * @example\n * const persistence = persistQueryClientOffline({ queryClient });\n * await persistence.restore();\n *\n * async function logout(): Promise<void> {\n * await persistence.clear({ resetClient: true });\n * }\n */\nexport function persistQueryClientOffline(\n options: OfflineQueryPersistenceOptions,\n): OfflineQueryPersistence {\n const { queryClient, throttleMs = 1000 } = options;\n const key = options.key ?? \"tanstack-query\";\n const databaseName = options.databaseName ?? \"TempestQueryCache\";\n const store = createOfflineStore<Snapshot, string>({\n databaseName,\n version: 1,\n tableName: \"cache\",\n indexes: \"&id\",\n keyPath: \"id\",\n });\n\n const slot = `${databaseName}\\u0000${key}`;\n let ended = false;\n let warnedEnded = false;\n let timer: ReturnType<typeof setTimeout> | null = null;\n const inFlight = new Set<Promise<unknown>>();\n\n async function afterPendingClear(): Promise<void> {\n const pending = pendingClears.get(slot);\n if (pending) await pending;\n }\n\n function warnEnded(): void {\n if (warnedEnded || !isDevBuild()) return;\n warnedEnded = true;\n console.warn(\n \"[tempest-react-sdk] persistQueryClientOffline: handle ended by clear(); \" +\n \"create a new one after login to keep persisting.\",\n );\n }\n\n async function save(): Promise<void> {\n if (ended) return;\n await afterPendingClear();\n if (ended) return;\n const write = store.put({ id: key, state: dehydrate(queryClient) });\n inFlight.add(write);\n try {\n await write;\n } finally {\n inFlight.delete(write);\n }\n }\n\n function cancelTimer(): void {\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n }\n\n function schedule(): void {\n if (timer || ended) return;\n timer = setTimeout(() => {\n timer = null;\n void save();\n }, throttleMs);\n }\n\n function onCacheEvent(event: QueryCacheNotifyEvent): void {\n if (!ended) {\n schedule();\n return;\n }\n if (event.type !== \"added\" && event.type !== \"updated\") return;\n unsubscribeCache();\n warnEnded();\n }\n\n const unsubscribeCache = queryClient.getQueryCache().subscribe(onCacheEvent);\n\n async function endSession(resetClient: boolean): Promise<void> {\n try {\n await Promise.allSettled([...inFlight]);\n await store.delete(key);\n } finally {\n if (resetClient) queryClient.clear();\n }\n }\n\n return {\n async restore() {\n if (ended) {\n warnEnded();\n return;\n }\n await afterPendingClear();\n if (ended) return;\n const snapshot = await store.get(key);\n if (snapshot && !ended) hydrate(queryClient, snapshot.state);\n },\n async flush() {\n if (ended) {\n warnEnded();\n return;\n }\n cancelTimer();\n await save();\n },\n unsubscribe() {\n cancelTimer();\n unsubscribeCache();\n },\n async clear(clearOptions = {}) {\n ended = true;\n cancelTimer();\n const previous = pendingClears.get(slot);\n const run = endSession(clearOptions.resetClient ?? false);\n const settled = Promise.allSettled([previous, run]);\n pendingClears.set(slot, settled);\n void settled.then(() => {\n if (pendingClears.get(slot) === settled) pendingClears.delete(slot);\n });\n await run;\n },\n };\n}\n"],"mappings":"A,iIAkBA,IAAMM,EAAgB,IAAI,IAgH1B,SAAgBC,EACZ,EACuB,CACvB,GAAM,CAAE,cAAa,aAAa,KAASC,EACrCC,EAAMD,EAAQ,KAAO,iBACrBE,EAAeF,EAAQ,cAAgB,oBACvCG,EAAQX,EAAAA,mBAAqC,CAC/C,eACA,QAAS,EACT,UAAW,QACX,QAAS,MACT,QAAS,IACb,CAAC,EAEKY,EAAO,GAAGF,EAAa,QAAQD,IACjCI,EAAQ,GACRC,EAAc,GACdC,EAA8C,KAC5CC,EAAW,IAAI,IAErB,eAAeC,GAAmC,CAC9C,IAAMC,EAAUZ,EAAc,IAAIM,CAAI,EAClCM,GAAS,MAAMA,CACvB,CAEA,SAASC,GAAkB,CACnB,IAAgBlB,EAAAA,WAAW,IAC/B,EAAc,GACd,QAAQ,KACJ,0HAEJ,EACJ,CAEA,eAAemB,GAAsB,CAGjC,GAFIP,IACJ,MAAMI,EAAkB,EACpBJ,GAAO,OACX,IAAMQ,EAAQV,EAAM,IAAI,CAAE,GAAIF,EAAK,OAAA,EAAOP,EAAAA,UAAAA,CAAUoB,CAAW,CAAE,CAAC,EAClEN,EAAS,IAAIK,CAAK,EAClB,GAAI,CACA,MAAMA,CACV,QAAU,CACNL,EAAS,OAAOK,CAAK,CACzB,CACJ,CAEA,SAASE,GAAoB,CACzB,AAEIR,KADA,aAAaA,CAAK,EACV,KAEhB,CAEA,SAASS,GAAiB,CAClBT,GAASF,IACb,EAAQ,eAAiB,CACrB,EAAQ,KACRO,EAAU,CACd,EAAGK,CAAU,EACjB,CAEA,SAASC,EAAa,EAAoC,CACjDb,GAIDc,EAAM,OAAS,SAAWA,EAAM,OAAS,aAC7CC,EAAiB,EACjBT,EAAU,GALNK,EAAS,CAMjB,CAEA,IAAMI,EAAmBN,EAAY,cAAc,CAAC,CAAC,UAAUI,CAAY,EAE3E,eAAeG,EAAW,EAAqC,CAC3D,GAAI,CACA,MAAM,QAAQ,WAAW,CAAC,GAAGb,CAAQ,CAAC,EACtC,MAAML,EAAM,OAAOF,CAAG,CAC1B,QAAU,CACFqB,GAAaR,EAAY,MAAM,CACvC,CACJ,CAEA,MAAO,CACH,MAAM,SAAU,CACZ,GAAIT,EAAO,CACPM,EAAU,EACV,MACJ,CAEA,GADA,MAAMF,EAAkB,EACpBJ,EAAO,OACX,IAAMkB,EAAW,MAAMpB,EAAM,IAAIF,CAAG,EAChCsB,GAAY,CAAClB,IAAO,EAAAR,EAAA,QAAA,CAAQiB,EAAaS,EAAS,KAAK,CAC/D,EACA,MAAM,OAAQ,CACNlB,EACAM,EAAU,GAGdI,EAAY,EACZ,MAAMH,EAAK,EACf,EACA,aAAc,CACVG,EAAY,EACZK,EAAiB,CACrB,EACA,MAAM,MAAM,EAAe,CAAC,EAAG,CAC3B,EAAQ,GACRL,EAAY,EACZ,IAAMS,EAAW1B,EAAc,IAAIM,CAAI,EACjCqB,EAAMJ,EAAWK,EAAa,aAAe,EAAK,EAClDC,EAAU,QAAQ,WAAW,CAACH,EAAUC,CAAG,CAAC,EAClD3B,EAAc,IAAIM,EAAMuB,CAAO,EAC/BA,EAAa,SAAW,CAChB7B,EAAc,IAAIM,CAAI,IAAMuB,GAAS7B,EAAc,OAAOM,CAAI,CACtE,CAAC,EACD,MAAMqB,CACV,CACJ,CACJ,C"}
@@ -40,11 +40,7 @@ function a(a) {
40
40
  }, s));
41
41
  }
42
42
  function x(e) {
43
- if (!f) {
44
- b();
45
- return;
46
- }
47
- (e.type === "added" || e.type === "updated") && (S(), _());
43
+ f ? (e.type === "added" || e.type === "updated") && (S(), _()) : b();
48
44
  }
49
45
  let S = o.getQueryCache().subscribe(x);
50
46
  async function C(e) {
@@ -65,11 +61,7 @@ function a(a) {
65
61
  e && !f && r(o, e.state);
66
62
  },
67
63
  async flush() {
68
- if (f) {
69
- _();
70
- return;
71
- }
72
- y(), await v();
64
+ f ? _() : (y(), await v());
73
65
  },
74
66
  unsubscribe() {
75
67
  y(), S();