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":"labels.cjs","names":[],"sources":["../../src/vision/labels.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Class label resolution: presets, lists, dicts, or auto-generated.\n *\n * Tasks call {@link resolveLabels} once at construction time to turn whatever\n * the caller passed (preset name, array, dict, or `null`) into an ordered\n * array of class names indexed by class id.\n *\n * In the browser there is no filesystem, so this module does not load labels\n * from a path — fetch the file yourself and pass an array.\n */\n\nimport { LabelMapError } from \"./core/exceptions\";\n\n/**\n * Anything accepted by {@link resolveLabels}.\n *\n * - `string[]` / `readonly string[]`: explicit names indexed by class id.\n * - `Record<number, string>`: sparse mapping (gaps filled with `class_<id>`).\n * - `string`: a preset name (e.g. `\"coco\"`).\n * - `null` / `undefined`: auto-generate `class_0` ... `class_{numClasses-1}`.\n */\nexport type LabelSpec = readonly string[] | Record<number, string> | string | null | undefined;\n\n/** COCO 2017 80-class labels in canonical class-id order. */\nexport const COCO_CLASSES: readonly string[] = Object.freeze([\n \"person\",\n \"bicycle\",\n \"car\",\n \"motorcycle\",\n \"airplane\",\n \"bus\",\n \"train\",\n \"truck\",\n \"boat\",\n \"traffic light\",\n \"fire hydrant\",\n \"stop sign\",\n \"parking meter\",\n \"bench\",\n \"bird\",\n \"cat\",\n \"dog\",\n \"horse\",\n \"sheep\",\n \"cow\",\n \"elephant\",\n \"bear\",\n \"zebra\",\n \"giraffe\",\n \"backpack\",\n \"umbrella\",\n \"handbag\",\n \"tie\",\n \"suitcase\",\n \"frisbee\",\n \"skis\",\n \"snowboard\",\n \"sports ball\",\n \"kite\",\n \"baseball bat\",\n \"baseball glove\",\n \"skateboard\",\n \"surfboard\",\n \"tennis racket\",\n \"bottle\",\n \"wine glass\",\n \"cup\",\n \"fork\",\n \"knife\",\n \"spoon\",\n \"bowl\",\n \"banana\",\n \"apple\",\n \"sandwich\",\n \"orange\",\n \"broccoli\",\n \"carrot\",\n \"hot dog\",\n \"pizza\",\n \"donut\",\n \"cake\",\n \"chair\",\n \"couch\",\n \"potted plant\",\n \"bed\",\n \"dining table\",\n \"toilet\",\n \"tv\",\n \"laptop\",\n \"mouse\",\n \"remote\",\n \"keyboard\",\n \"cell phone\",\n \"microwave\",\n \"oven\",\n \"toaster\",\n \"sink\",\n \"refrigerator\",\n \"book\",\n \"clock\",\n \"vase\",\n \"scissors\",\n \"teddy bear\",\n \"hair drier\",\n \"toothbrush\",\n]);\n\nconst PRESETS: Readonly<Record<string, readonly string[]>> = {\n coco: COCO_CLASSES,\n};\n\nexport interface ResolveLabelsOptions {\n /**\n * Expected number of classes.\n *\n * - When `spec` is `null`/`undefined`, this is required to auto-generate names.\n * - When `spec` is provided, it validates that the resolved length matches.\n */\n readonly numClasses?: number;\n}\n\n/**\n * Resolve a labels specification into an ordered array of class names.\n *\n * @throws {@link LabelMapError} if the spec is invalid, the preset is unknown,\n * or the resolved length disagrees with `numClasses`.\n */\n/**\n * Pick the fallback label spec for a model that declares no class names.\n *\n * The COCO preset is the right default for a stock YOLO export and an\n * impossible one for anything else: it names exactly 80 classes, so handing it\n * to a 3-class head makes {@link resolveLabels} throw `Resolved 80 labels but\n * the model has 3 classes` and the task cannot be created at all. A custom\n * model without baked-in `names` is an ordinary thing to have — it should come\n * up as `class_0`, `class_1`, ..., not as a failure.\n *\n * @param numClasses Classes the model predicts, or `undefined` when the output\n * shape does not say.\n * @returns `\"coco\"` when the preset can describe the model, otherwise `null`,\n * which makes {@link resolveLabels} generate `class_N` names.\n */\nexport function defaultLabels(numClasses: number | undefined): LabelSpec {\n if (numClasses === undefined || numClasses === COCO_CLASSES.length) {\n return \"coco\";\n }\n return null;\n}\n\nexport function resolveLabels(\n spec: LabelSpec,\n options: ResolveLabelsOptions = {},\n): readonly string[] {\n const labels = resolve(spec, options.numClasses);\n if (options.numClasses !== undefined && labels.length !== options.numClasses) {\n throw new LabelMapError(\n `Resolved ${labels.length} labels but the model has ${options.numClasses} classes.`,\n );\n }\n return labels;\n}\n\nfunction resolve(spec: LabelSpec, numClasses: number | undefined): readonly string[] {\n if (spec === null || spec === undefined) {\n if (numClasses === undefined) {\n throw new LabelMapError(\n \"Cannot auto-generate labels without numClasses. Pass an explicit labels spec or numClasses.\",\n );\n }\n return Array.from({ length: numClasses }, (_, i) => `class_${i}`);\n }\n\n if (Array.isArray(spec)) {\n return [...spec];\n }\n\n if (typeof spec === \"string\") {\n const preset = PRESETS[spec];\n if (preset !== undefined) {\n return preset;\n }\n throw new LabelMapError(\n `Unknown labels preset: ${JSON.stringify(spec)}. Known presets: ${Object.keys(PRESETS).join(\", \")}.`,\n );\n }\n\n if (typeof spec === \"object\") {\n const map = spec as Record<number, string>;\n const ids = Object.keys(map).map((k) => Number(k));\n if (ids.length === 0) {\n return [];\n }\n const maxId = Math.max(...ids);\n return Array.from({ length: maxId + 1 }, (_, i) => map[i] ?? `class_${i}`);\n }\n\n throw new LabelMapError(`Unsupported labels spec type: ${typeof spec}.`);\n}\n"],"mappings":"yCAyBA,IAAa,EAAkC,OAAO,OAAO,wnBAiF7D,CAAC,EAEK,EAAuD,CACzD,KAAM,CACV,EAiCA,SAAgB,EAAc,EAA2C,CAIrE,OAHI,IAAe,IAAA,IAAa,IAAe,EAAa,OACjD,OAEJ,IACX,CAEA,SAAgB,EACZ,EACA,EAAgC,CAAC,EAChB,CACjB,IAAM,EAAS,EAAQ,EAAM,EAAQ,UAAU,EAC/C,GAAI,EAAQ,aAAe,IAAA,IAAa,EAAO,SAAW,EAAQ,WAC9D,MAAM,IAAI,EAAA,cACN,YAAY,EAAO,OAAO,4BAA4B,EAAQ,WAAW,UAC7E,EAEJ,OAAO,CACX,CAEA,SAAS,EAAQ,EAAiB,EAAmD,CACjF,GAAI,GAAS,KAA4B,CACrC,GAAI,IAAe,IAAA,GACf,MAAM,IAAI,EAAA,cACN,6FACJ,EAEJ,OAAO,MAAM,KAAK,CAAE,OAAQ,CAAW,GAAI,EAAG,IAAM,SAAS,GAAG,CACpE,CAEA,GAAI,MAAM,QAAQ,CAAI,EAClB,MAAO,CAAC,GAAG,CAAI,EAGnB,GAAI,OAAO,GAAS,SAAU,CAC1B,IAAM,EAAS,EAAQ,GACvB,GAAI,IAAW,IAAA,GACX,OAAO,EAEX,MAAM,IAAI,EAAA,cACN,0BAA0B,KAAK,UAAU,CAAI,EAAE,mBAAmB,OAAO,KAAK,CAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EACtG,CACJ,CAEA,GAAI,OAAO,GAAS,SAAU,CAC1B,IAAM,EAAM,EACN,EAAM,OAAO,KAAK,CAAG,CAAC,CAAC,IAAK,GAAM,OAAO,CAAC,CAAC,EACjD,GAAI,EAAI,SAAW,EACf,MAAO,CAAC,EAEZ,IAAM,EAAQ,KAAK,IAAI,GAAG,CAAG,EAC7B,OAAO,MAAM,KAAK,CAAE,OAAQ,EAAQ,CAAE,GAAI,EAAG,IAAM,EAAI,IAAM,SAAS,GAAG,CAC7E,CAEA,MAAM,IAAI,EAAA,cAAc,iCAAiC,OAAO,EAAK,EAAE,CAC3E"}
1
+ {"version":3,"file":"labels.cjs","names":["LabelMapError","require_exceptions","COCO_CLASSES","PRESETS","defaultLabels","numClasses","resolveLabels","labels","resolve","spec","options","i","preset","map","ids","k","maxId"],"sources":["../../src/vision/labels.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Class label resolution: presets, lists, dicts, or auto-generated.\n *\n * Tasks call {@link resolveLabels} once at construction time to turn whatever\n * the caller passed (preset name, array, dict, or `null`) into an ordered\n * array of class names indexed by class id.\n *\n * In the browser there is no filesystem, so this module does not load labels\n * from a path — fetch the file yourself and pass an array.\n */\n\nimport { LabelMapError } from \"./core/exceptions\";\n\n/**\n * Anything accepted by {@link resolveLabels}.\n *\n * - `string[]` / `readonly string[]`: explicit names indexed by class id.\n * - `Record<number, string>`: sparse mapping (gaps filled with `class_<id>`).\n * - `string`: a preset name (e.g. `\"coco\"`).\n * - `null` / `undefined`: auto-generate `class_0` ... `class_{numClasses-1}`.\n */\nexport type LabelSpec = readonly string[] | Record<number, string> | string | null | undefined;\n\n/** COCO 2017 80-class labels in canonical class-id order. */\nexport const COCO_CLASSES: readonly string[] = Object.freeze([\n \"person\",\n \"bicycle\",\n \"car\",\n \"motorcycle\",\n \"airplane\",\n \"bus\",\n \"train\",\n \"truck\",\n \"boat\",\n \"traffic light\",\n \"fire hydrant\",\n \"stop sign\",\n \"parking meter\",\n \"bench\",\n \"bird\",\n \"cat\",\n \"dog\",\n \"horse\",\n \"sheep\",\n \"cow\",\n \"elephant\",\n \"bear\",\n \"zebra\",\n \"giraffe\",\n \"backpack\",\n \"umbrella\",\n \"handbag\",\n \"tie\",\n \"suitcase\",\n \"frisbee\",\n \"skis\",\n \"snowboard\",\n \"sports ball\",\n \"kite\",\n \"baseball bat\",\n \"baseball glove\",\n \"skateboard\",\n \"surfboard\",\n \"tennis racket\",\n \"bottle\",\n \"wine glass\",\n \"cup\",\n \"fork\",\n \"knife\",\n \"spoon\",\n \"bowl\",\n \"banana\",\n \"apple\",\n \"sandwich\",\n \"orange\",\n \"broccoli\",\n \"carrot\",\n \"hot dog\",\n \"pizza\",\n \"donut\",\n \"cake\",\n \"chair\",\n \"couch\",\n \"potted plant\",\n \"bed\",\n \"dining table\",\n \"toilet\",\n \"tv\",\n \"laptop\",\n \"mouse\",\n \"remote\",\n \"keyboard\",\n \"cell phone\",\n \"microwave\",\n \"oven\",\n \"toaster\",\n \"sink\",\n \"refrigerator\",\n \"book\",\n \"clock\",\n \"vase\",\n \"scissors\",\n \"teddy bear\",\n \"hair drier\",\n \"toothbrush\",\n]);\n\nconst PRESETS: Readonly<Record<string, readonly string[]>> = {\n coco: COCO_CLASSES,\n};\n\nexport interface ResolveLabelsOptions {\n /**\n * Expected number of classes.\n *\n * - When `spec` is `null`/`undefined`, this is required to auto-generate names.\n * - When `spec` is provided, it validates that the resolved length matches.\n */\n readonly numClasses?: number;\n}\n\n/**\n * Resolve a labels specification into an ordered array of class names.\n *\n * @throws {@link LabelMapError} if the spec is invalid, the preset is unknown,\n * or the resolved length disagrees with `numClasses`.\n */\n/**\n * Pick the fallback label spec for a model that declares no class names.\n *\n * The COCO preset is the right default for a stock YOLO export and an\n * impossible one for anything else: it names exactly 80 classes, so handing it\n * to a 3-class head makes {@link resolveLabels} throw `Resolved 80 labels but\n * the model has 3 classes` and the task cannot be created at all. A custom\n * model without baked-in `names` is an ordinary thing to have — it should come\n * up as `class_0`, `class_1`, ..., not as a failure.\n *\n * @param numClasses Classes the model predicts, or `undefined` when the output\n * shape does not say.\n * @returns `\"coco\"` when the preset can describe the model, otherwise `null`,\n * which makes {@link resolveLabels} generate `class_N` names.\n */\nexport function defaultLabels(numClasses: number | undefined): LabelSpec {\n if (numClasses === undefined || numClasses === COCO_CLASSES.length) {\n return \"coco\";\n }\n return null;\n}\n\nexport function resolveLabels(\n spec: LabelSpec,\n options: ResolveLabelsOptions = {},\n): readonly string[] {\n const labels = resolve(spec, options.numClasses);\n if (options.numClasses !== undefined && labels.length !== options.numClasses) {\n throw new LabelMapError(\n `Resolved ${labels.length} labels but the model has ${options.numClasses} classes.`,\n );\n }\n return labels;\n}\n\nfunction resolve(spec: LabelSpec, numClasses: number | undefined): readonly string[] {\n if (spec === null || spec === undefined) {\n if (numClasses === undefined) {\n throw new LabelMapError(\n \"Cannot auto-generate labels without numClasses. Pass an explicit labels spec or numClasses.\",\n );\n }\n return Array.from({ length: numClasses }, (_, i) => `class_${i}`);\n }\n\n if (Array.isArray(spec)) {\n return [...spec];\n }\n\n if (typeof spec === \"string\") {\n const preset = PRESETS[spec];\n if (preset !== undefined) {\n return preset;\n }\n throw new LabelMapError(\n `Unknown labels preset: ${JSON.stringify(spec)}. Known presets: ${Object.keys(PRESETS).join(\", \")}.`,\n );\n }\n\n if (typeof spec === \"object\") {\n const map = spec as Record<number, string>;\n const ids = Object.keys(map).map((k) => Number(k));\n if (ids.length === 0) {\n return [];\n }\n const maxId = Math.max(...ids);\n return Array.from({ length: maxId + 1 }, (_, i) => map[i] ?? `class_${i}`);\n }\n\n throw new LabelMapError(`Unsupported labels spec type: ${typeof spec}.`);\n}\n"],"mappings":"A,yCAyBA,IAAaE,EAAkC,OAAO,OAAO,wnBAiF7D,CAAC,EAEKC,EAAuD,CACzD,KAAMD,CACV,EAiCA,SAAgBE,EAAc,EAA2C,CAIrE,OAHIC,IAAe,IAAA,IAAaA,IAAeH,EAAa,OACjD,OAEJ,IACX,CAEA,SAAgBI,EACZ,EACA,EAAgC,CAAC,EAChB,CACjB,IAAMC,EAASC,EAAQC,EAAMC,EAAQ,UAAU,EAC/C,GAAIA,EAAQ,aAAe,IAAA,IAAaH,EAAO,SAAWG,EAAQ,WAC9D,MAAM,IAAIV,EAAAA,cACN,YAAYO,EAAO,OAAO,4BAA4BG,EAAQ,WAAW,UAC7E,EAEJ,OAAOH,CACX,CAEA,SAASC,EAAQ,EAAiB,EAAmD,CACjF,GAAIC,GAAS,KAA4B,CACrC,GAAIJ,IAAe,IAAA,GACf,MAAM,IAAIL,EAAAA,cACN,6FACJ,EAEJ,OAAO,MAAM,KAAK,CAAE,OAAQK,CAAW,GAAI,EAAG,IAAM,SAASM,GAAG,CACpE,CAEA,GAAI,MAAM,QAAQF,CAAI,EAClB,MAAO,CAAC,GAAGA,CAAI,EAGnB,GAAI,OAAOA,GAAS,SAAU,CAC1B,IAAMG,EAAST,EAAQM,GACvB,GAAIG,IAAW,IAAA,GACX,OAAOA,EAEX,MAAM,IAAIZ,EAAAA,cACN,0BAA0B,KAAK,UAAUS,CAAI,EAAE,mBAAmB,OAAO,KAAKN,CAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EACtG,CACJ,CAEA,GAAI,OAAOM,GAAS,SAAU,CAC1B,IAAMI,EAAMJ,EACNK,EAAM,OAAO,KAAKD,CAAG,CAAC,CAAC,IAAK,GAAM,OAAOE,CAAC,CAAC,EACjD,GAAID,EAAI,SAAW,EACf,MAAO,CAAC,EAEZ,IAAME,EAAQ,KAAK,IAAI,GAAGF,CAAG,EAC7B,OAAO,MAAM,KAAK,CAAE,OAAQE,EAAQ,CAAE,GAAI,EAAG,IAAMH,EAAIF,IAAM,SAASA,GAAG,CAC7E,CAEA,MAAM,IAAIX,EAAAA,cAAc,iCAAiC,OAAOS,EAAK,EAAE,CAC3E,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"labels.js","names":[],"sources":["../../src/vision/labels.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Class label resolution: presets, lists, dicts, or auto-generated.\n *\n * Tasks call {@link resolveLabels} once at construction time to turn whatever\n * the caller passed (preset name, array, dict, or `null`) into an ordered\n * array of class names indexed by class id.\n *\n * In the browser there is no filesystem, so this module does not load labels\n * from a path — fetch the file yourself and pass an array.\n */\n\nimport { LabelMapError } from \"./core/exceptions\";\n\n/**\n * Anything accepted by {@link resolveLabels}.\n *\n * - `string[]` / `readonly string[]`: explicit names indexed by class id.\n * - `Record<number, string>`: sparse mapping (gaps filled with `class_<id>`).\n * - `string`: a preset name (e.g. `\"coco\"`).\n * - `null` / `undefined`: auto-generate `class_0` ... `class_{numClasses-1}`.\n */\nexport type LabelSpec = readonly string[] | Record<number, string> | string | null | undefined;\n\n/** COCO 2017 80-class labels in canonical class-id order. */\nexport const COCO_CLASSES: readonly string[] = Object.freeze([\n \"person\",\n \"bicycle\",\n \"car\",\n \"motorcycle\",\n \"airplane\",\n \"bus\",\n \"train\",\n \"truck\",\n \"boat\",\n \"traffic light\",\n \"fire hydrant\",\n \"stop sign\",\n \"parking meter\",\n \"bench\",\n \"bird\",\n \"cat\",\n \"dog\",\n \"horse\",\n \"sheep\",\n \"cow\",\n \"elephant\",\n \"bear\",\n \"zebra\",\n \"giraffe\",\n \"backpack\",\n \"umbrella\",\n \"handbag\",\n \"tie\",\n \"suitcase\",\n \"frisbee\",\n \"skis\",\n \"snowboard\",\n \"sports ball\",\n \"kite\",\n \"baseball bat\",\n \"baseball glove\",\n \"skateboard\",\n \"surfboard\",\n \"tennis racket\",\n \"bottle\",\n \"wine glass\",\n \"cup\",\n \"fork\",\n \"knife\",\n \"spoon\",\n \"bowl\",\n \"banana\",\n \"apple\",\n \"sandwich\",\n \"orange\",\n \"broccoli\",\n \"carrot\",\n \"hot dog\",\n \"pizza\",\n \"donut\",\n \"cake\",\n \"chair\",\n \"couch\",\n \"potted plant\",\n \"bed\",\n \"dining table\",\n \"toilet\",\n \"tv\",\n \"laptop\",\n \"mouse\",\n \"remote\",\n \"keyboard\",\n \"cell phone\",\n \"microwave\",\n \"oven\",\n \"toaster\",\n \"sink\",\n \"refrigerator\",\n \"book\",\n \"clock\",\n \"vase\",\n \"scissors\",\n \"teddy bear\",\n \"hair drier\",\n \"toothbrush\",\n]);\n\nconst PRESETS: Readonly<Record<string, readonly string[]>> = {\n coco: COCO_CLASSES,\n};\n\nexport interface ResolveLabelsOptions {\n /**\n * Expected number of classes.\n *\n * - When `spec` is `null`/`undefined`, this is required to auto-generate names.\n * - When `spec` is provided, it validates that the resolved length matches.\n */\n readonly numClasses?: number;\n}\n\n/**\n * Resolve a labels specification into an ordered array of class names.\n *\n * @throws {@link LabelMapError} if the spec is invalid, the preset is unknown,\n * or the resolved length disagrees with `numClasses`.\n */\n/**\n * Pick the fallback label spec for a model that declares no class names.\n *\n * The COCO preset is the right default for a stock YOLO export and an\n * impossible one for anything else: it names exactly 80 classes, so handing it\n * to a 3-class head makes {@link resolveLabels} throw `Resolved 80 labels but\n * the model has 3 classes` and the task cannot be created at all. A custom\n * model without baked-in `names` is an ordinary thing to have — it should come\n * up as `class_0`, `class_1`, ..., not as a failure.\n *\n * @param numClasses Classes the model predicts, or `undefined` when the output\n * shape does not say.\n * @returns `\"coco\"` when the preset can describe the model, otherwise `null`,\n * which makes {@link resolveLabels} generate `class_N` names.\n */\nexport function defaultLabels(numClasses: number | undefined): LabelSpec {\n if (numClasses === undefined || numClasses === COCO_CLASSES.length) {\n return \"coco\";\n }\n return null;\n}\n\nexport function resolveLabels(\n spec: LabelSpec,\n options: ResolveLabelsOptions = {},\n): readonly string[] {\n const labels = resolve(spec, options.numClasses);\n if (options.numClasses !== undefined && labels.length !== options.numClasses) {\n throw new LabelMapError(\n `Resolved ${labels.length} labels but the model has ${options.numClasses} classes.`,\n );\n }\n return labels;\n}\n\nfunction resolve(spec: LabelSpec, numClasses: number | undefined): readonly string[] {\n if (spec === null || spec === undefined) {\n if (numClasses === undefined) {\n throw new LabelMapError(\n \"Cannot auto-generate labels without numClasses. Pass an explicit labels spec or numClasses.\",\n );\n }\n return Array.from({ length: numClasses }, (_, i) => `class_${i}`);\n }\n\n if (Array.isArray(spec)) {\n return [...spec];\n }\n\n if (typeof spec === \"string\") {\n const preset = PRESETS[spec];\n if (preset !== undefined) {\n return preset;\n }\n throw new LabelMapError(\n `Unknown labels preset: ${JSON.stringify(spec)}. Known presets: ${Object.keys(PRESETS).join(\", \")}.`,\n );\n }\n\n if (typeof spec === \"object\") {\n const map = spec as Record<number, string>;\n const ids = Object.keys(map).map((k) => Number(k));\n if (ids.length === 0) {\n return [];\n }\n const maxId = Math.max(...ids);\n return Array.from({ length: maxId + 1 }, (_, i) => map[i] ?? `class_${i}`);\n }\n\n throw new LabelMapError(`Unsupported labels spec type: ${typeof spec}.`);\n}\n"],"mappings":";;AAyBA,IAAa,IAAkC,OAAO,OAAO,woBAiF7D,CAAC,GAEK,IAAuD,EACzD,MAAM,EACV;AAiCA,SAAgB,EAAc,GAA2C;CAIrE,OAHI,MAAe,KAAA,KAAa,MAAe,EAAa,SACjD,SAEJ;AACX;AAEA,SAAgB,EACZ,GACA,IAAgC,CAAC,GAChB;CACjB,IAAM,IAAS,EAAQ,GAAM,EAAQ,UAAU;CAC/C,IAAI,EAAQ,eAAe,KAAA,KAAa,EAAO,WAAW,EAAQ,YAC9D,MAAM,IAAI,EACN,YAAY,EAAO,OAAO,4BAA4B,EAAQ,WAAW,UAC7E;CAEJ,OAAO;AACX;AAEA,SAAS,EAAQ,GAAiB,GAAmD;CACjF,IAAI,KAAS,MAA4B;EACrC,IAAI,MAAe,KAAA,GACf,MAAM,IAAI,EACN,6FACJ;EAEJ,OAAO,MAAM,KAAK,EAAE,QAAQ,EAAW,IAAI,GAAG,MAAM,SAAS,GAAG;CACpE;CAEA,IAAI,MAAM,QAAQ,CAAI,GAClB,OAAO,CAAC,GAAG,CAAI;CAGnB,IAAI,OAAO,KAAS,UAAU;EAC1B,IAAM,IAAS,EAAQ;EACvB,IAAI,MAAW,KAAA,GACX,OAAO;EAEX,MAAM,IAAI,EACN,0BAA0B,KAAK,UAAU,CAAI,EAAE,mBAAmB,OAAO,KAAK,CAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EACtG;CACJ;CAEA,IAAI,OAAO,KAAS,UAAU;EAC1B,IAAM,IAAM,GACN,IAAM,OAAO,KAAK,CAAG,CAAC,CAAC,KAAK,MAAM,OAAO,CAAC,CAAC;EACjD,IAAI,EAAI,WAAW,GACf,OAAO,CAAC;EAEZ,IAAM,IAAQ,KAAK,IAAI,GAAG,CAAG;EAC7B,OAAO,MAAM,KAAK,EAAE,QAAQ,IAAQ,EAAE,IAAI,GAAG,MAAM,EAAI,MAAM,SAAS,GAAG;CAC7E;CAEA,MAAM,IAAI,EAAc,iCAAiC,OAAO,EAAK,EAAE;AAC3E"}
1
+ {"version":3,"file":"labels.js","names":["COCO_CLASSES","PRESETS","defaultLabels","numClasses","resolveLabels","labels","resolve","spec","options","LabelMapError","i","preset","map","ids","k","maxId"],"sources":["../../src/vision/labels.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Class label resolution: presets, lists, dicts, or auto-generated.\n *\n * Tasks call {@link resolveLabels} once at construction time to turn whatever\n * the caller passed (preset name, array, dict, or `null`) into an ordered\n * array of class names indexed by class id.\n *\n * In the browser there is no filesystem, so this module does not load labels\n * from a path — fetch the file yourself and pass an array.\n */\n\nimport { LabelMapError } from \"./core/exceptions\";\n\n/**\n * Anything accepted by {@link resolveLabels}.\n *\n * - `string[]` / `readonly string[]`: explicit names indexed by class id.\n * - `Record<number, string>`: sparse mapping (gaps filled with `class_<id>`).\n * - `string`: a preset name (e.g. `\"coco\"`).\n * - `null` / `undefined`: auto-generate `class_0` ... `class_{numClasses-1}`.\n */\nexport type LabelSpec = readonly string[] | Record<number, string> | string | null | undefined;\n\n/** COCO 2017 80-class labels in canonical class-id order. */\nexport const COCO_CLASSES: readonly string[] = Object.freeze([\n \"person\",\n \"bicycle\",\n \"car\",\n \"motorcycle\",\n \"airplane\",\n \"bus\",\n \"train\",\n \"truck\",\n \"boat\",\n \"traffic light\",\n \"fire hydrant\",\n \"stop sign\",\n \"parking meter\",\n \"bench\",\n \"bird\",\n \"cat\",\n \"dog\",\n \"horse\",\n \"sheep\",\n \"cow\",\n \"elephant\",\n \"bear\",\n \"zebra\",\n \"giraffe\",\n \"backpack\",\n \"umbrella\",\n \"handbag\",\n \"tie\",\n \"suitcase\",\n \"frisbee\",\n \"skis\",\n \"snowboard\",\n \"sports ball\",\n \"kite\",\n \"baseball bat\",\n \"baseball glove\",\n \"skateboard\",\n \"surfboard\",\n \"tennis racket\",\n \"bottle\",\n \"wine glass\",\n \"cup\",\n \"fork\",\n \"knife\",\n \"spoon\",\n \"bowl\",\n \"banana\",\n \"apple\",\n \"sandwich\",\n \"orange\",\n \"broccoli\",\n \"carrot\",\n \"hot dog\",\n \"pizza\",\n \"donut\",\n \"cake\",\n \"chair\",\n \"couch\",\n \"potted plant\",\n \"bed\",\n \"dining table\",\n \"toilet\",\n \"tv\",\n \"laptop\",\n \"mouse\",\n \"remote\",\n \"keyboard\",\n \"cell phone\",\n \"microwave\",\n \"oven\",\n \"toaster\",\n \"sink\",\n \"refrigerator\",\n \"book\",\n \"clock\",\n \"vase\",\n \"scissors\",\n \"teddy bear\",\n \"hair drier\",\n \"toothbrush\",\n]);\n\nconst PRESETS: Readonly<Record<string, readonly string[]>> = {\n coco: COCO_CLASSES,\n};\n\nexport interface ResolveLabelsOptions {\n /**\n * Expected number of classes.\n *\n * - When `spec` is `null`/`undefined`, this is required to auto-generate names.\n * - When `spec` is provided, it validates that the resolved length matches.\n */\n readonly numClasses?: number;\n}\n\n/**\n * Resolve a labels specification into an ordered array of class names.\n *\n * @throws {@link LabelMapError} if the spec is invalid, the preset is unknown,\n * or the resolved length disagrees with `numClasses`.\n */\n/**\n * Pick the fallback label spec for a model that declares no class names.\n *\n * The COCO preset is the right default for a stock YOLO export and an\n * impossible one for anything else: it names exactly 80 classes, so handing it\n * to a 3-class head makes {@link resolveLabels} throw `Resolved 80 labels but\n * the model has 3 classes` and the task cannot be created at all. A custom\n * model without baked-in `names` is an ordinary thing to have — it should come\n * up as `class_0`, `class_1`, ..., not as a failure.\n *\n * @param numClasses Classes the model predicts, or `undefined` when the output\n * shape does not say.\n * @returns `\"coco\"` when the preset can describe the model, otherwise `null`,\n * which makes {@link resolveLabels} generate `class_N` names.\n */\nexport function defaultLabels(numClasses: number | undefined): LabelSpec {\n if (numClasses === undefined || numClasses === COCO_CLASSES.length) {\n return \"coco\";\n }\n return null;\n}\n\nexport function resolveLabels(\n spec: LabelSpec,\n options: ResolveLabelsOptions = {},\n): readonly string[] {\n const labels = resolve(spec, options.numClasses);\n if (options.numClasses !== undefined && labels.length !== options.numClasses) {\n throw new LabelMapError(\n `Resolved ${labels.length} labels but the model has ${options.numClasses} classes.`,\n );\n }\n return labels;\n}\n\nfunction resolve(spec: LabelSpec, numClasses: number | undefined): readonly string[] {\n if (spec === null || spec === undefined) {\n if (numClasses === undefined) {\n throw new LabelMapError(\n \"Cannot auto-generate labels without numClasses. Pass an explicit labels spec or numClasses.\",\n );\n }\n return Array.from({ length: numClasses }, (_, i) => `class_${i}`);\n }\n\n if (Array.isArray(spec)) {\n return [...spec];\n }\n\n if (typeof spec === \"string\") {\n const preset = PRESETS[spec];\n if (preset !== undefined) {\n return preset;\n }\n throw new LabelMapError(\n `Unknown labels preset: ${JSON.stringify(spec)}. Known presets: ${Object.keys(PRESETS).join(\", \")}.`,\n );\n }\n\n if (typeof spec === \"object\") {\n const map = spec as Record<number, string>;\n const ids = Object.keys(map).map((k) => Number(k));\n if (ids.length === 0) {\n return [];\n }\n const maxId = Math.max(...ids);\n return Array.from({ length: maxId + 1 }, (_, i) => map[i] ?? `class_${i}`);\n }\n\n throw new LabelMapError(`Unsupported labels spec type: ${typeof spec}.`);\n}\n"],"mappings":";;AAyBA,IAAaA,IAAkC,OAAO,OAAO,woBAiF7D,CAAC,GAEKC,IAAuD,EACzD,MAAMD,EACV;AAiCA,SAAgBE,EAAc,GAA2C;CAIrE,OAHIC,MAAe,KAAA,KAAaA,MAAeH,EAAa,SACjD,SAEJ;AACX;AAEA,SAAgBI,EACZ,GACA,IAAgC,CAAC,GAChB;CACjB,IAAMC,IAASC,EAAQC,GAAMC,EAAQ,UAAU;CAC/C,IAAIA,EAAQ,eAAe,KAAA,KAAaH,EAAO,WAAWG,EAAQ,YAC9D,MAAM,IAAIC,EACN,YAAYJ,EAAO,OAAO,4BAA4BG,EAAQ,WAAW,UAC7E;CAEJ,OAAOH;AACX;AAEA,SAASC,EAAQ,GAAiB,GAAmD;CACjF,IAAIC,KAAS,MAA4B;EACrC,IAAIJ,MAAe,KAAA,GACf,MAAM,IAAIM,EACN,6FACJ;EAEJ,OAAO,MAAM,KAAK,EAAE,QAAQN,EAAW,IAAI,GAAG,MAAM,SAASO,GAAG;CACpE;CAEA,IAAI,MAAM,QAAQH,CAAI,GAClB,OAAO,CAAC,GAAGA,CAAI;CAGnB,IAAI,OAAOA,KAAS,UAAU;EAC1B,IAAMI,IAASV,EAAQM;EACvB,IAAII,MAAW,KAAA,GACX,OAAOA;EAEX,MAAM,IAAIF,EACN,0BAA0B,KAAK,UAAUF,CAAI,EAAE,mBAAmB,OAAO,KAAKN,CAAO,CAAC,CAAC,KAAK,IAAI,EAAE,EACtG;CACJ;CAEA,IAAI,OAAOM,KAAS,UAAU;EAC1B,IAAMK,IAAML,GACNM,IAAM,OAAO,KAAKD,CAAG,CAAC,CAAC,KAAK,MAAM,OAAOE,CAAC,CAAC;EACjD,IAAID,EAAI,WAAW,GACf,OAAO,CAAC;EAEZ,IAAME,IAAQ,KAAK,IAAI,GAAGF,CAAG;EAC7B,OAAO,MAAM,KAAK,EAAE,QAAQE,IAAQ,EAAE,IAAI,GAAG,MAAMH,EAAIF,MAAM,SAASA,GAAG;CAC7E;CAEA,MAAM,IAAID,EAAc,iCAAiC,OAAOF,EAAK,EAAE;AAC3E"}
@@ -1 +1 @@
1
- {"version":3,"file":"luminance.cjs","names":[],"sources":["../../src/vision/luminance.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Frame-brightness helpers — measure the mean luminance of an already-decoded\n * frame (`<img>`, `<video>`, `<canvas>`, `ImageBitmap` or `OffscreenCanvas`) so\n * a UI can reject underexposed captures before paying the cost of downstream\n * inference.\n *\n * These are framework-agnostic pure functions; {@link useLiveLuminance} wires\n * {@link computeImageLuminance} into a React `requestAnimationFrame` loop for\n * live camera feedback.\n */\n\n/**\n * Longest edge (in pixels) the source is downsampled to before sampling.\n * Averaging over a small downsample is statistically equivalent for a\n * brightness threshold and orders of magnitude faster than reading every pixel\n * of a full-resolution camera frame.\n */\nexport const LUMINANCE_SAMPLE_MAX_EDGE = 256;\n\n/**\n * Drawable source we can sample luminance from.\n *\n * The list tracks what `CanvasRenderingContext2D.drawImage` accepts and we can\n * read a pixel size off, which is what the implementation actually needs.\n * `ImageBitmap` matters for the decode-downscaled path: `createImageBitmap(blob,\n * { resizeWidth })` is how a caller avoids materialising a full-resolution\n * phone photo, and the frame it hands back is the frame whose brightness has to\n * be checked.\n */\nexport type LuminanceSource =\n HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;\n\n/**\n * Natural pixel size of the source (`0`/`0` while it is still unloaded).\n *\n * `ImageBitmap` and `OffscreenCanvas` both expose plain `width`/`height`, so\n * they fall through to the same branch as a canvas — but they are named\n * explicitly rather than left to the `naturalWidth || width` fallback, which\n * only reads as intentional for an `<img>`.\n */\nfunction sourceSize(source: LuminanceSource): { width: number; height: number } {\n if (source instanceof HTMLVideoElement) {\n return { width: source.videoWidth, height: source.videoHeight };\n }\n if (source instanceof HTMLImageElement) {\n return {\n width: source.naturalWidth || source.width,\n height: source.naturalHeight || source.height,\n };\n }\n return { width: source.width, height: source.height };\n}\n\n/**\n * Mean BT.709 luminance (`0.2126*R + 0.7152*G + 0.0722*B`) of a decoded frame,\n * scaled to `0..255`. See {@link LuminanceSource} for what counts as one.\n *\n * The source is downsampled so its longest edge is at most\n * {@link LUMINANCE_SAMPLE_MAX_EDGE} before pixels are read. The 2D context is\n * created with `willReadFrequently` so repeated sampling (live feedback) stays\n * on the fast path.\n *\n * Pass `reusableCanvas` to avoid allocating a fresh canvas every frame in a hot\n * loop; when omitted a one-shot detached canvas is created.\n *\n * @param source - the decoded frame to sample.\n * @param reusableCanvas - optional canvas reused across frames to avoid GC churn.\n * @returns The mean luminance in `0..255`, or `0` when the source is unloaded\n * (zero-sized) or a 2D context is unavailable.\n */\nexport function computeImageLuminance(\n source: LuminanceSource,\n reusableCanvas?: HTMLCanvasElement,\n): number {\n const { width: srcW, height: srcH } = sourceSize(source);\n if (srcW === 0 || srcH === 0) return 0;\n\n const scale = Math.min(1, LUMINANCE_SAMPLE_MAX_EDGE / Math.max(srcW, srcH));\n const w = Math.max(1, Math.round(srcW * scale));\n const h = Math.max(1, Math.round(srcH * scale));\n\n const canvas = reusableCanvas ?? document.createElement(\"canvas\");\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n if (!ctx) return 0;\n ctx.drawImage(source, 0, 0, w, h);\n\n const data = ctx.getImageData(0, 0, w, h).data;\n let sum = 0;\n const pixelCount = w * h;\n for (let i = 0; i < data.length; i += 4) {\n sum += 0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2];\n }\n return sum / pixelCount;\n}\n\n/**\n * Whether a measured luminance clears a brightness threshold.\n *\n * `threshold` is intentionally required — a sensible value is\n * application-specific (it depends on the model, the lighting the model was\n * trained on, and the acceptable false-reject rate), so the SDK does not bake\n * in a default.\n *\n * @param luminance - measured mean luminance in `0..255`.\n * @param threshold - minimum acceptable luminance in `0..255`.\n * @returns `true` when `luminance >= threshold`.\n */\nexport function isLuminanceAcceptable(luminance: number, threshold: number): boolean {\n return luminance >= threshold;\n}\n\n/**\n * Error raised when a captured frame is too dark to be analysed reliably.\n * Carries the measured luminance and the threshold it failed so callers can\n * surface actionable feedback.\n */\nexport class LowLuminanceError extends Error {\n /** Measured mean luminance, `0..255`. */\n readonly luminance: number;\n /** Threshold that was checked against, `0..255`. */\n readonly threshold: number;\n\n /**\n * @param luminance - the measured mean luminance in `0..255`.\n * @param threshold - the threshold the measurement failed to reach.\n */\n constructor(luminance: number, threshold: number) {\n super(\"Image is too dark to analyse. Capture again in a brighter environment.\");\n this.name = \"LowLuminanceError\";\n this.luminance = luminance;\n this.threshold = threshold;\n }\n}\n"],"mappings":"AAkBA,IAAa,EAA4B,IAuBzC,SAAS,EAAW,EAA4D,CAU5E,OATI,aAAkB,iBACX,CAAE,MAAO,EAAO,WAAY,OAAQ,EAAO,WAAY,EAE9D,aAAkB,iBACX,CACH,MAAO,EAAO,cAAgB,EAAO,MACrC,OAAQ,EAAO,eAAiB,EAAO,MAC3C,EAEG,CAAE,MAAO,EAAO,MAAO,OAAQ,EAAO,MAAO,CACxD,CAmBA,SAAgB,EACZ,EACA,EACM,CACN,GAAM,CAAE,MAAO,EAAM,OAAQ,GAAS,EAAW,CAAM,EACvD,GAAI,IAAS,GAAK,IAAS,EAAG,MAAO,GAErC,IAAM,EAAQ,KAAK,IAAI,EAAA,IAA+B,KAAK,IAAI,EAAM,CAAI,CAAC,EACpE,EAAI,KAAK,IAAI,EAAG,KAAK,MAAM,EAAO,CAAK,CAAC,EACxC,EAAI,KAAK,IAAI,EAAG,KAAK,MAAM,EAAO,CAAK,CAAC,EAExC,EAAS,GAAkB,SAAS,cAAc,QAAQ,EAChE,EAAO,MAAQ,EACf,EAAO,OAAS,EAChB,IAAM,EAAM,EAAO,WAAW,KAAM,CAAE,mBAAoB,EAAK,CAAC,EAChE,GAAI,CAAC,EAAK,MAAO,GACjB,EAAI,UAAU,EAAQ,EAAG,EAAG,EAAG,CAAC,EAEhC,IAAM,EAAO,EAAI,aAAa,EAAG,EAAG,EAAG,CAAC,CAAC,CAAC,KACtC,EAAM,EACJ,EAAa,EAAI,EACvB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,OAAQ,GAAK,EAClC,GAAO,MAAS,EAAK,GAAK,MAAS,EAAK,EAAI,GAAK,MAAS,EAAK,EAAI,GAEvE,OAAO,EAAM,CACjB,CAcA,SAAgB,EAAsB,EAAmB,EAA4B,CACjF,OAAO,GAAa,CACxB,CAOA,IAAa,EAAb,cAAuC,KAAM,CAEzC,UAEA,UAMA,YAAY,EAAmB,EAAmB,CAC9C,MAAM,wEAAwE,EAC9E,KAAK,KAAO,oBACZ,KAAK,UAAY,EACjB,KAAK,UAAY,CACrB,CACJ"}
1
+ {"version":3,"file":"luminance.cjs","names":["LUMINANCE_SAMPLE_MAX_EDGE","sourceSize","source","computeImageLuminance","srcW","srcH","scale","w","h","canvas","reusableCanvas","ctx","data","sum","pixelCount","i","isLuminanceAcceptable","luminance","threshold","LowLuminanceError"],"sources":["../../src/vision/luminance.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Frame-brightness helpers — measure the mean luminance of an already-decoded\n * frame (`<img>`, `<video>`, `<canvas>`, `ImageBitmap` or `OffscreenCanvas`) so\n * a UI can reject underexposed captures before paying the cost of downstream\n * inference.\n *\n * These are framework-agnostic pure functions; {@link useLiveLuminance} wires\n * {@link computeImageLuminance} into a React `requestAnimationFrame` loop for\n * live camera feedback.\n */\n\n/**\n * Longest edge (in pixels) the source is downsampled to before sampling.\n * Averaging over a small downsample is statistically equivalent for a\n * brightness threshold and orders of magnitude faster than reading every pixel\n * of a full-resolution camera frame.\n */\nexport const LUMINANCE_SAMPLE_MAX_EDGE = 256;\n\n/**\n * Drawable source we can sample luminance from.\n *\n * The list tracks what `CanvasRenderingContext2D.drawImage` accepts and we can\n * read a pixel size off, which is what the implementation actually needs.\n * `ImageBitmap` matters for the decode-downscaled path: `createImageBitmap(blob,\n * { resizeWidth })` is how a caller avoids materialising a full-resolution\n * phone photo, and the frame it hands back is the frame whose brightness has to\n * be checked.\n */\nexport type LuminanceSource =\n HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;\n\n/**\n * Natural pixel size of the source (`0`/`0` while it is still unloaded).\n *\n * `ImageBitmap` and `OffscreenCanvas` both expose plain `width`/`height`, so\n * they fall through to the same branch as a canvas — but they are named\n * explicitly rather than left to the `naturalWidth || width` fallback, which\n * only reads as intentional for an `<img>`.\n */\nfunction sourceSize(source: LuminanceSource): { width: number; height: number } {\n if (source instanceof HTMLVideoElement) {\n return { width: source.videoWidth, height: source.videoHeight };\n }\n if (source instanceof HTMLImageElement) {\n return {\n width: source.naturalWidth || source.width,\n height: source.naturalHeight || source.height,\n };\n }\n return { width: source.width, height: source.height };\n}\n\n/**\n * Mean BT.709 luminance (`0.2126*R + 0.7152*G + 0.0722*B`) of a decoded frame,\n * scaled to `0..255`. See {@link LuminanceSource} for what counts as one.\n *\n * The source is downsampled so its longest edge is at most\n * {@link LUMINANCE_SAMPLE_MAX_EDGE} before pixels are read. The 2D context is\n * created with `willReadFrequently` so repeated sampling (live feedback) stays\n * on the fast path.\n *\n * Pass `reusableCanvas` to avoid allocating a fresh canvas every frame in a hot\n * loop; when omitted a one-shot detached canvas is created.\n *\n * @param source - the decoded frame to sample.\n * @param reusableCanvas - optional canvas reused across frames to avoid GC churn.\n * @returns The mean luminance in `0..255`, or `0` when the source is unloaded\n * (zero-sized) or a 2D context is unavailable.\n */\nexport function computeImageLuminance(\n source: LuminanceSource,\n reusableCanvas?: HTMLCanvasElement,\n): number {\n const { width: srcW, height: srcH } = sourceSize(source);\n if (srcW === 0 || srcH === 0) return 0;\n\n const scale = Math.min(1, LUMINANCE_SAMPLE_MAX_EDGE / Math.max(srcW, srcH));\n const w = Math.max(1, Math.round(srcW * scale));\n const h = Math.max(1, Math.round(srcH * scale));\n\n const canvas = reusableCanvas ?? document.createElement(\"canvas\");\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n if (!ctx) return 0;\n ctx.drawImage(source, 0, 0, w, h);\n\n const data = ctx.getImageData(0, 0, w, h).data;\n let sum = 0;\n const pixelCount = w * h;\n for (let i = 0; i < data.length; i += 4) {\n sum += 0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2];\n }\n return sum / pixelCount;\n}\n\n/**\n * Whether a measured luminance clears a brightness threshold.\n *\n * `threshold` is intentionally required — a sensible value is\n * application-specific (it depends on the model, the lighting the model was\n * trained on, and the acceptable false-reject rate), so the SDK does not bake\n * in a default.\n *\n * @param luminance - measured mean luminance in `0..255`.\n * @param threshold - minimum acceptable luminance in `0..255`.\n * @returns `true` when `luminance >= threshold`.\n */\nexport function isLuminanceAcceptable(luminance: number, threshold: number): boolean {\n return luminance >= threshold;\n}\n\n/**\n * Error raised when a captured frame is too dark to be analysed reliably.\n * Carries the measured luminance and the threshold it failed so callers can\n * surface actionable feedback.\n */\nexport class LowLuminanceError extends Error {\n /** Measured mean luminance, `0..255`. */\n readonly luminance: number;\n /** Threshold that was checked against, `0..255`. */\n readonly threshold: number;\n\n /**\n * @param luminance - the measured mean luminance in `0..255`.\n * @param threshold - the threshold the measurement failed to reach.\n */\n constructor(luminance: number, threshold: number) {\n super(\"Image is too dark to analyse. Capture again in a brighter environment.\");\n this.name = \"LowLuminanceError\";\n this.luminance = luminance;\n this.threshold = threshold;\n }\n}\n"],"mappings":"AAkBA,IAAaA,EAA4B,IAuBzC,SAASC,EAAW,EAA4D,CAU5E,OATIC,aAAkB,iBACX,CAAE,MAAOA,EAAO,WAAY,OAAQA,EAAO,WAAY,EAE9DA,aAAkB,iBACX,CACH,MAAOA,EAAO,cAAgBA,EAAO,MACrC,OAAQA,EAAO,eAAiBA,EAAO,MAC3C,EAEG,CAAE,MAAOA,EAAO,MAAO,OAAQA,EAAO,MAAO,CACxD,CAmBA,SAAgBC,EACZ,EACA,EACM,CACN,GAAM,CAAE,MAAOC,EAAM,OAAQC,GAASJ,EAAWC,CAAM,EACvD,GAAIE,IAAS,GAAKC,IAAS,EAAG,MAAO,GAErC,IAAMC,EAAQ,KAAK,IAAI,EAAA,IAA+B,KAAK,IAAIF,EAAMC,CAAI,CAAC,EACpEE,EAAI,KAAK,IAAI,EAAG,KAAK,MAAMH,EAAOE,CAAK,CAAC,EACxCE,EAAI,KAAK,IAAI,EAAG,KAAK,MAAMH,EAAOC,CAAK,CAAC,EAExCG,EAASC,GAAkB,SAAS,cAAc,QAAQ,EAChE,EAAO,MAAQH,EACf,EAAO,OAASC,EAChB,IAAMG,EAAMF,EAAO,WAAW,KAAM,CAAE,mBAAoB,EAAK,CAAC,EAChE,GAAI,CAACE,EAAK,MAAO,GACjBA,EAAI,UAAUT,EAAQ,EAAG,EAAGK,EAAGC,CAAC,EAEhC,IAAMI,EAAOD,EAAI,aAAa,EAAG,EAAGJ,EAAGC,CAAC,CAAC,CAAC,KACtCK,EAAM,EACJC,EAAaP,EAAIC,EACvB,IAAK,IAAIO,EAAI,EAAGA,EAAIH,EAAK,OAAQ,GAAK,EAClC,GAAO,MAASA,EAAKG,GAAK,MAASH,EAAKG,EAAI,GAAK,MAASH,EAAKG,EAAI,GAEvE,OAAOF,EAAMC,CACjB,CAcA,SAAgBE,EAAsB,EAAmB,EAA4B,CACjF,OAAOC,GAAaC,CACxB,CAOA,IAAaC,EAAb,cAAuC,KAAM,CAEzC,UAEA,UAMA,YAAY,EAAmB,EAAmB,CAC9C,MAAM,wEAAwE,EAC9E,KAAK,KAAO,oBACZ,KAAK,UAAYF,EACjB,KAAK,UAAYC,CACrB,CACJ,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"luminance.js","names":[],"sources":["../../src/vision/luminance.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Frame-brightness helpers — measure the mean luminance of an already-decoded\n * frame (`<img>`, `<video>`, `<canvas>`, `ImageBitmap` or `OffscreenCanvas`) so\n * a UI can reject underexposed captures before paying the cost of downstream\n * inference.\n *\n * These are framework-agnostic pure functions; {@link useLiveLuminance} wires\n * {@link computeImageLuminance} into a React `requestAnimationFrame` loop for\n * live camera feedback.\n */\n\n/**\n * Longest edge (in pixels) the source is downsampled to before sampling.\n * Averaging over a small downsample is statistically equivalent for a\n * brightness threshold and orders of magnitude faster than reading every pixel\n * of a full-resolution camera frame.\n */\nexport const LUMINANCE_SAMPLE_MAX_EDGE = 256;\n\n/**\n * Drawable source we can sample luminance from.\n *\n * The list tracks what `CanvasRenderingContext2D.drawImage` accepts and we can\n * read a pixel size off, which is what the implementation actually needs.\n * `ImageBitmap` matters for the decode-downscaled path: `createImageBitmap(blob,\n * { resizeWidth })` is how a caller avoids materialising a full-resolution\n * phone photo, and the frame it hands back is the frame whose brightness has to\n * be checked.\n */\nexport type LuminanceSource =\n HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;\n\n/**\n * Natural pixel size of the source (`0`/`0` while it is still unloaded).\n *\n * `ImageBitmap` and `OffscreenCanvas` both expose plain `width`/`height`, so\n * they fall through to the same branch as a canvas — but they are named\n * explicitly rather than left to the `naturalWidth || width` fallback, which\n * only reads as intentional for an `<img>`.\n */\nfunction sourceSize(source: LuminanceSource): { width: number; height: number } {\n if (source instanceof HTMLVideoElement) {\n return { width: source.videoWidth, height: source.videoHeight };\n }\n if (source instanceof HTMLImageElement) {\n return {\n width: source.naturalWidth || source.width,\n height: source.naturalHeight || source.height,\n };\n }\n return { width: source.width, height: source.height };\n}\n\n/**\n * Mean BT.709 luminance (`0.2126*R + 0.7152*G + 0.0722*B`) of a decoded frame,\n * scaled to `0..255`. See {@link LuminanceSource} for what counts as one.\n *\n * The source is downsampled so its longest edge is at most\n * {@link LUMINANCE_SAMPLE_MAX_EDGE} before pixels are read. The 2D context is\n * created with `willReadFrequently` so repeated sampling (live feedback) stays\n * on the fast path.\n *\n * Pass `reusableCanvas` to avoid allocating a fresh canvas every frame in a hot\n * loop; when omitted a one-shot detached canvas is created.\n *\n * @param source - the decoded frame to sample.\n * @param reusableCanvas - optional canvas reused across frames to avoid GC churn.\n * @returns The mean luminance in `0..255`, or `0` when the source is unloaded\n * (zero-sized) or a 2D context is unavailable.\n */\nexport function computeImageLuminance(\n source: LuminanceSource,\n reusableCanvas?: HTMLCanvasElement,\n): number {\n const { width: srcW, height: srcH } = sourceSize(source);\n if (srcW === 0 || srcH === 0) return 0;\n\n const scale = Math.min(1, LUMINANCE_SAMPLE_MAX_EDGE / Math.max(srcW, srcH));\n const w = Math.max(1, Math.round(srcW * scale));\n const h = Math.max(1, Math.round(srcH * scale));\n\n const canvas = reusableCanvas ?? document.createElement(\"canvas\");\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n if (!ctx) return 0;\n ctx.drawImage(source, 0, 0, w, h);\n\n const data = ctx.getImageData(0, 0, w, h).data;\n let sum = 0;\n const pixelCount = w * h;\n for (let i = 0; i < data.length; i += 4) {\n sum += 0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2];\n }\n return sum / pixelCount;\n}\n\n/**\n * Whether a measured luminance clears a brightness threshold.\n *\n * `threshold` is intentionally required — a sensible value is\n * application-specific (it depends on the model, the lighting the model was\n * trained on, and the acceptable false-reject rate), so the SDK does not bake\n * in a default.\n *\n * @param luminance - measured mean luminance in `0..255`.\n * @param threshold - minimum acceptable luminance in `0..255`.\n * @returns `true` when `luminance >= threshold`.\n */\nexport function isLuminanceAcceptable(luminance: number, threshold: number): boolean {\n return luminance >= threshold;\n}\n\n/**\n * Error raised when a captured frame is too dark to be analysed reliably.\n * Carries the measured luminance and the threshold it failed so callers can\n * surface actionable feedback.\n */\nexport class LowLuminanceError extends Error {\n /** Measured mean luminance, `0..255`. */\n readonly luminance: number;\n /** Threshold that was checked against, `0..255`. */\n readonly threshold: number;\n\n /**\n * @param luminance - the measured mean luminance in `0..255`.\n * @param threshold - the threshold the measurement failed to reach.\n */\n constructor(luminance: number, threshold: number) {\n super(\"Image is too dark to analyse. Capture again in a brighter environment.\");\n this.name = \"LowLuminanceError\";\n this.luminance = luminance;\n this.threshold = threshold;\n }\n}\n"],"mappings":";AAkBA,IAAa,IAA4B;AAuBzC,SAAS,EAAW,GAA4D;CAU5E,OATI,aAAkB,mBACX;EAAE,OAAO,EAAO;EAAY,QAAQ,EAAO;CAAY,IAE9D,aAAkB,mBACX;EACH,OAAO,EAAO,gBAAgB,EAAO;EACrC,QAAQ,EAAO,iBAAiB,EAAO;CAC3C,IAEG;EAAE,OAAO,EAAO;EAAO,QAAQ,EAAO;CAAO;AACxD;AAmBA,SAAgB,EACZ,GACA,GACM;CACN,IAAM,EAAE,OAAO,GAAM,QAAQ,MAAS,EAAW,CAAM;CACvD,IAAI,MAAS,KAAK,MAAS,GAAG,OAAO;CAErC,IAAM,IAAQ,KAAK,IAAI,GAAA,MAA+B,KAAK,IAAI,GAAM,CAAI,CAAC,GACpE,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,IAAO,CAAK,CAAC,GACxC,IAAI,KAAK,IAAI,GAAG,KAAK,MAAM,IAAO,CAAK,CAAC,GAExC,IAAS,KAAkB,SAAS,cAAc,QAAQ;CAEhE,AADA,EAAO,QAAQ,GACf,EAAO,SAAS;CAChB,IAAM,IAAM,EAAO,WAAW,MAAM,EAAE,oBAAoB,GAAK,CAAC;CAChE,IAAI,CAAC,GAAK,OAAO;CACjB,EAAI,UAAU,GAAQ,GAAG,GAAG,GAAG,CAAC;CAEhC,IAAM,IAAO,EAAI,aAAa,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,MACtC,IAAM,GACJ,IAAa,IAAI;CACvB,KAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,GAClC,KAAO,QAAS,EAAK,KAAK,QAAS,EAAK,IAAI,KAAK,QAAS,EAAK,IAAI;CAEvE,OAAO,IAAM;AACjB;AAcA,SAAgB,EAAsB,GAAmB,GAA4B;CACjF,OAAO,KAAa;AACxB;AAOA,IAAa,IAAb,cAAuC,MAAM;CAEzC;CAEA;CAMA,YAAY,GAAmB,GAAmB;EAI9C,AAHA,MAAM,wEAAwE,GAC9E,KAAK,OAAO,qBACZ,KAAK,YAAY,GACjB,KAAK,YAAY;CACrB;AACJ"}
1
+ {"version":3,"file":"luminance.js","names":["LUMINANCE_SAMPLE_MAX_EDGE","sourceSize","source","computeImageLuminance","srcW","srcH","scale","w","h","canvas","reusableCanvas","ctx","data","sum","pixelCount","i","isLuminanceAcceptable","luminance","threshold","LowLuminanceError"],"sources":["../../src/vision/luminance.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Frame-brightness helpers — measure the mean luminance of an already-decoded\n * frame (`<img>`, `<video>`, `<canvas>`, `ImageBitmap` or `OffscreenCanvas`) so\n * a UI can reject underexposed captures before paying the cost of downstream\n * inference.\n *\n * These are framework-agnostic pure functions; {@link useLiveLuminance} wires\n * {@link computeImageLuminance} into a React `requestAnimationFrame` loop for\n * live camera feedback.\n */\n\n/**\n * Longest edge (in pixels) the source is downsampled to before sampling.\n * Averaging over a small downsample is statistically equivalent for a\n * brightness threshold and orders of magnitude faster than reading every pixel\n * of a full-resolution camera frame.\n */\nexport const LUMINANCE_SAMPLE_MAX_EDGE = 256;\n\n/**\n * Drawable source we can sample luminance from.\n *\n * The list tracks what `CanvasRenderingContext2D.drawImage` accepts and we can\n * read a pixel size off, which is what the implementation actually needs.\n * `ImageBitmap` matters for the decode-downscaled path: `createImageBitmap(blob,\n * { resizeWidth })` is how a caller avoids materialising a full-resolution\n * phone photo, and the frame it hands back is the frame whose brightness has to\n * be checked.\n */\nexport type LuminanceSource =\n HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas;\n\n/**\n * Natural pixel size of the source (`0`/`0` while it is still unloaded).\n *\n * `ImageBitmap` and `OffscreenCanvas` both expose plain `width`/`height`, so\n * they fall through to the same branch as a canvas — but they are named\n * explicitly rather than left to the `naturalWidth || width` fallback, which\n * only reads as intentional for an `<img>`.\n */\nfunction sourceSize(source: LuminanceSource): { width: number; height: number } {\n if (source instanceof HTMLVideoElement) {\n return { width: source.videoWidth, height: source.videoHeight };\n }\n if (source instanceof HTMLImageElement) {\n return {\n width: source.naturalWidth || source.width,\n height: source.naturalHeight || source.height,\n };\n }\n return { width: source.width, height: source.height };\n}\n\n/**\n * Mean BT.709 luminance (`0.2126*R + 0.7152*G + 0.0722*B`) of a decoded frame,\n * scaled to `0..255`. See {@link LuminanceSource} for what counts as one.\n *\n * The source is downsampled so its longest edge is at most\n * {@link LUMINANCE_SAMPLE_MAX_EDGE} before pixels are read. The 2D context is\n * created with `willReadFrequently` so repeated sampling (live feedback) stays\n * on the fast path.\n *\n * Pass `reusableCanvas` to avoid allocating a fresh canvas every frame in a hot\n * loop; when omitted a one-shot detached canvas is created.\n *\n * @param source - the decoded frame to sample.\n * @param reusableCanvas - optional canvas reused across frames to avoid GC churn.\n * @returns The mean luminance in `0..255`, or `0` when the source is unloaded\n * (zero-sized) or a 2D context is unavailable.\n */\nexport function computeImageLuminance(\n source: LuminanceSource,\n reusableCanvas?: HTMLCanvasElement,\n): number {\n const { width: srcW, height: srcH } = sourceSize(source);\n if (srcW === 0 || srcH === 0) return 0;\n\n const scale = Math.min(1, LUMINANCE_SAMPLE_MAX_EDGE / Math.max(srcW, srcH));\n const w = Math.max(1, Math.round(srcW * scale));\n const h = Math.max(1, Math.round(srcH * scale));\n\n const canvas = reusableCanvas ?? document.createElement(\"canvas\");\n canvas.width = w;\n canvas.height = h;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n if (!ctx) return 0;\n ctx.drawImage(source, 0, 0, w, h);\n\n const data = ctx.getImageData(0, 0, w, h).data;\n let sum = 0;\n const pixelCount = w * h;\n for (let i = 0; i < data.length; i += 4) {\n sum += 0.2126 * data[i] + 0.7152 * data[i + 1] + 0.0722 * data[i + 2];\n }\n return sum / pixelCount;\n}\n\n/**\n * Whether a measured luminance clears a brightness threshold.\n *\n * `threshold` is intentionally required — a sensible value is\n * application-specific (it depends on the model, the lighting the model was\n * trained on, and the acceptable false-reject rate), so the SDK does not bake\n * in a default.\n *\n * @param luminance - measured mean luminance in `0..255`.\n * @param threshold - minimum acceptable luminance in `0..255`.\n * @returns `true` when `luminance >= threshold`.\n */\nexport function isLuminanceAcceptable(luminance: number, threshold: number): boolean {\n return luminance >= threshold;\n}\n\n/**\n * Error raised when a captured frame is too dark to be analysed reliably.\n * Carries the measured luminance and the threshold it failed so callers can\n * surface actionable feedback.\n */\nexport class LowLuminanceError extends Error {\n /** Measured mean luminance, `0..255`. */\n readonly luminance: number;\n /** Threshold that was checked against, `0..255`. */\n readonly threshold: number;\n\n /**\n * @param luminance - the measured mean luminance in `0..255`.\n * @param threshold - the threshold the measurement failed to reach.\n */\n constructor(luminance: number, threshold: number) {\n super(\"Image is too dark to analyse. Capture again in a brighter environment.\");\n this.name = \"LowLuminanceError\";\n this.luminance = luminance;\n this.threshold = threshold;\n }\n}\n"],"mappings":";AAkBA,IAAaA,IAA4B;AAuBzC,SAASC,EAAW,GAA4D;CAU5E,OATIC,aAAkB,mBACX;EAAE,OAAOA,EAAO;EAAY,QAAQA,EAAO;CAAY,IAE9DA,aAAkB,mBACX;EACH,OAAOA,EAAO,gBAAgBA,EAAO;EACrC,QAAQA,EAAO,iBAAiBA,EAAO;CAC3C,IAEG;EAAE,OAAOA,EAAO;EAAO,QAAQA,EAAO;CAAO;AACxD;AAmBA,SAAgBC,EACZ,GACA,GACM;CACN,IAAM,EAAE,OAAOC,GAAM,QAAQC,MAASJ,EAAWC,CAAM;CACvD,IAAIE,MAAS,KAAKC,MAAS,GAAG,OAAO;CAErC,IAAMC,IAAQ,KAAK,IAAI,GAAA,MAA+B,KAAK,IAAIF,GAAMC,CAAI,CAAC,GACpEE,IAAI,KAAK,IAAI,GAAG,KAAK,MAAMH,IAAOE,CAAK,CAAC,GACxCE,IAAI,KAAK,IAAI,GAAG,KAAK,MAAMH,IAAOC,CAAK,CAAC,GAExCG,IAASC,KAAkB,SAAS,cAAc,QAAQ;CAEhE,AADA,EAAO,QAAQH,GACf,EAAO,SAASC;CAChB,IAAMG,IAAMF,EAAO,WAAW,MAAM,EAAE,oBAAoB,GAAK,CAAC;CAChE,IAAI,CAACE,GAAK,OAAO;CACjB,EAAI,UAAUT,GAAQ,GAAG,GAAGK,GAAGC,CAAC;CAEhC,IAAMI,IAAOD,EAAI,aAAa,GAAG,GAAGJ,GAAGC,CAAC,CAAC,CAAC,MACtCK,IAAM,GACJC,IAAaP,IAAIC;CACvB,KAAK,IAAIO,IAAI,GAAGA,IAAIH,EAAK,QAAQ,KAAK,GAClC,KAAO,QAASA,EAAKG,KAAK,QAASH,EAAKG,IAAI,KAAK,QAASH,EAAKG,IAAI;CAEvE,OAAOF,IAAMC;AACjB;AAcA,SAAgBE,EAAsB,GAAmB,GAA4B;CACjF,OAAOC,KAAaC;AACxB;AAOA,IAAaC,IAAb,cAAuC,MAAM;CAEzC;CAEA;CAMA,YAAY,GAAmB,GAAmB;EAI9C,AAHA,MAAM,wEAAwE,GAC9E,KAAK,OAAO,qBACZ,KAAK,YAAYF,GACjB,KAAK,YAAYC;CACrB;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalization.cjs","names":[],"sources":["../../src/vision/normalization.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Which preprocessing a classifier expects its input to have had.\n *\n * A classifier is trained on a specific tensor, and feeding it a differently\n * prepared one degrades it silently — no exception, no warning, just worse\n * predictions. The two families this SDK sees most disagree completely:\n * torchvision-style models want the ImageNet mean and deviation subtracted and\n * divided out, while an Ultralytics classification head consumes raw `[0, 1]`.\n *\n * Guessing wrong is not detectable from the outside, but it is not a guess: an\n * Ultralytics export stamps `author` and `task` into its own metadata, and every\n * task in this SDK already reads that map for the class names.\n *\n * Mirrors `ort_vision_sdk.normalization` in the Python SDK; the two must agree,\n * because the same model file is driven by both.\n */\n\n/**\n * Which preprocessing the classifier expects its input to have had.\n *\n * - `\"auto\"` (the default wherever it is accepted) reads the model's own export\n * metadata and picks. An Ultralytics classification head gets\n * `\"ultralytics\"`; anything else gets `\"imagenet\"`.\n * - `\"imagenet\"` subtracts the ImageNet mean and divides by the ImageNet\n * deviation — the torchvision convention.\n * - `\"ultralytics\"` leaves the image in `[0, 1]`. Ultralytics' own classifier\n * applies no mean/std at all, so anything else feeds it images it never saw\n * in training.\n * - `\"none\"` is the same arithmetic as `\"ultralytics\"` — identity — under a\n * name that says \"this model wants raw `[0, 1]`\" rather than naming a vendor.\n */\nexport type Normalization = \"auto\" | \"imagenet\" | \"ultralytics\" | \"none\";\n\n/** Per-channel RGB mean of ImageNet, the torchvision preprocessing convention. */\nexport const IMAGENET_MEAN: readonly [number, number, number] = [0.485, 0.456, 0.406];\n\n/** Per-channel RGB standard deviation of ImageNet. */\nexport const IMAGENET_STD: readonly [number, number, number] = [0.229, 0.224, 0.225];\n\n/** Mean that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_MEAN: readonly [number, number, number] = [0, 0, 0];\n\n/** Deviation that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_STD: readonly [number, number, number] = [1, 1, 1];\n\n/** Name reported when the caller supplied `mean`/`std` directly. */\nexport const CUSTOM_NORMALIZATION = \"custom\";\n\nconst PRESETS: Readonly<\n Record<string, readonly [readonly [number, number, number], readonly [number, number, number]]>\n> = {\n imagenet: [IMAGENET_MEAN, IMAGENET_STD],\n ultralytics: [IDENTITY_MEAN, IDENTITY_STD],\n none: [IDENTITY_MEAN, IDENTITY_STD],\n};\n\n/** What {@link resolveNormalization} settled on. */\nexport interface ResolvedNormalization {\n /** The preset name, or `\"custom\"` when the caller supplied the values. */\n readonly name: string;\n /** Per-channel mean to subtract. */\n readonly mean: readonly [number, number, number];\n /** Per-channel deviation to divide by. */\n readonly std: readonly [number, number, number];\n}\n\n/**\n * Whether a metadata map came out of `YOLO(...).export(format=\"onnx\")`.\n *\n * Every Ultralytics export stamps `author` and `task` into its metadata, and the\n * pair is unambiguous: `\"Ultralytics\"` plus `\"classify\"` is a classification head\n * from that codebase and nothing else.\n *\n * @param metadata The model's custom metadata map.\n */\nexport function isUltralyticsClassifier(metadata: Readonly<Record<string, string>>): boolean {\n return (\n (metadata.author ?? \"\").trim().toLowerCase() === \"ultralytics\" &&\n (metadata.task ?? \"\").trim().toLowerCase() === \"classify\"\n );\n}\n\n/**\n * Settle which `mean`/`std` to apply, and what to call the choice.\n *\n * Explicit `mean`/`std` always win — they are the escape hatch for a model whose\n * preprocessing neither preset describes. Anything they leave open falls back to\n * the preset, so passing only a `mean` does not silently reset the deviation\n * to 1.\n *\n * Warns (via `console.warn`) when the model is an Ultralytics export and the\n * supplied values are not the identity it was trained with. Nothing fails in\n * that case: the prediction has the right shape and is simply less accurate,\n * which is exactly why it is worth saying out loud.\n *\n * @param metadata The model's custom metadata map, read to detect the family.\n * @param options The preset asked for, plus any explicit `mean`/`std`.\n * @throws {RangeError} If `normalization` is not a known preset, or names one\n * while `mean`/`std` are also supplied — two answers to the same question.\n */\nexport function resolveNormalization(\n metadata: Readonly<Record<string, string>>,\n options: {\n readonly normalization?: Normalization;\n readonly mean?: readonly [number, number, number];\n readonly std?: readonly [number, number, number];\n } = {},\n): ResolvedNormalization {\n const normalization = options.normalization ?? \"auto\";\n const explicit = options.mean !== undefined || options.std !== undefined;\n\n if (normalization !== \"auto\" && PRESETS[normalization] === undefined) {\n throw new RangeError(\n `normalization must be one of 'auto', 'imagenet', 'ultralytics', 'none'; ` +\n `got ${JSON.stringify(normalization)}.`,\n );\n }\n if (explicit && normalization !== \"auto\") {\n throw new RangeError(\n `Pass either normalization=${JSON.stringify(normalization)} or explicit mean/std, not both.`,\n );\n }\n\n const ultralytics = isUltralyticsClassifier(metadata);\n const preset =\n normalization === \"auto\" ? (ultralytics ? \"ultralytics\" : \"imagenet\") : normalization;\n const [presetMean, presetStd] = PRESETS[preset] as readonly [\n readonly [number, number, number],\n readonly [number, number, number],\n ];\n\n if (!explicit) {\n return { name: preset, mean: presetMean, std: presetStd };\n }\n\n const mean = options.mean ?? presetMean;\n const std = options.std ?? presetStd;\n if (ultralytics && !(isIdentity(mean, IDENTITY_MEAN) && isIdentity(std, IDENTITY_STD))) {\n console.warn(\n \"The classifier is an Ultralytics export, whose classification head is trained on raw \" +\n `[0, 1] images, but mean=${JSON.stringify(mean)} / std=${JSON.stringify(std)} was ` +\n \"requested. It will be fed images normalized in a way it never saw in training, which \" +\n \"degrades accuracy without raising anything. Drop mean/std to let normalization='auto' \" +\n \"pick the identity.\",\n );\n }\n return { name: CUSTOM_NORMALIZATION, mean, std };\n}\n\n/**\n * Whether two channel triples are equal.\n *\n * @param value The triple to check.\n * @param reference The triple to compare against.\n */\nfunction isIdentity(\n value: readonly [number, number, number],\n reference: readonly [number, number, number],\n): boolean {\n return value.every((entry, index) => entry === reference[index]);\n}\n"],"mappings":"AAmCA,IAAa,EAAmD,CAAC,KAAO,KAAO,IAAK,EAGvE,EAAkD,CAAC,KAAO,KAAO,IAAK,EAGtE,EAAmD,CAAC,EAAG,EAAG,CAAC,EAG3D,EAAkD,CAAC,EAAG,EAAG,CAAC,EAG1D,EAAuB,SAE9B,EAEF,CACA,SAAU,CAAC,EAAe,CAAY,EACtC,YAAa,CAAC,EAAe,CAAY,EACzC,KAAM,CAAC,EAAe,CAAY,CACtC,EAqBA,SAAgB,EAAwB,EAAqD,CACzF,OACK,EAAS,QAAU,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,IAAM,gBAChD,EAAS,MAAQ,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,IAAM,UAEvD,CAoBA,SAAgB,EACZ,EACA,EAII,CAAC,EACgB,CACrB,IAAM,EAAgB,EAAQ,eAAiB,OACzC,EAAW,EAAQ,OAAS,IAAA,IAAa,EAAQ,MAAQ,IAAA,GAE/D,GAAI,IAAkB,QAAU,EAAQ,KAAmB,IAAA,GACvD,MAAU,WACN,+EACW,KAAK,UAAU,CAAa,EAAE,EAC7C,EAEJ,GAAI,GAAY,IAAkB,OAC9B,MAAU,WACN,6BAA6B,KAAK,UAAU,CAAa,EAAE,iCAC/D,EAGJ,IAAM,EAAc,EAAwB,CAAQ,EAC9C,EACF,IAAkB,OAAU,EAAc,cAAgB,WAAc,EACtE,CAAC,EAAY,GAAa,EAAQ,GAKxC,GAAI,CAAC,EACD,MAAO,CAAE,KAAM,EAAQ,KAAM,EAAY,IAAK,CAAU,EAG5D,IAAM,EAAO,EAAQ,MAAQ,EACvB,EAAM,EAAQ,KAAO,EAU3B,OATI,GAAe,EAAE,EAAW,EAAM,CAAa,GAAK,EAAW,EAAK,CAAY,IAChF,QAAQ,KACJ,gHAC+B,KAAK,UAAU,CAAI,EAAE,SAAS,KAAK,UAAU,CAAG,EAAE,mMAIrF,EAEG,CAAE,KAAM,EAAsB,OAAM,KAAI,CACnD,CAQA,SAAS,EACL,EACA,EACO,CACP,OAAO,EAAM,OAAO,EAAO,IAAU,IAAU,EAAU,EAAM,CACnE"}
1
+ {"version":3,"file":"normalization.cjs","names":["IMAGENET_MEAN","IMAGENET_STD","IDENTITY_MEAN","IDENTITY_STD","CUSTOM_NORMALIZATION","PRESETS","isUltralyticsClassifier","metadata","resolveNormalization","normalization","options","explicit","ultralytics","preset","presetMean","presetStd","mean","std","isIdentity","value","entry","reference","index"],"sources":["../../src/vision/normalization.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Which preprocessing a classifier expects its input to have had.\n *\n * A classifier is trained on a specific tensor, and feeding it a differently\n * prepared one degrades it silently — no exception, no warning, just worse\n * predictions. The two families this SDK sees most disagree completely:\n * torchvision-style models want the ImageNet mean and deviation subtracted and\n * divided out, while an Ultralytics classification head consumes raw `[0, 1]`.\n *\n * Guessing wrong is not detectable from the outside, but it is not a guess: an\n * Ultralytics export stamps `author` and `task` into its own metadata, and every\n * task in this SDK already reads that map for the class names.\n *\n * Mirrors `ort_vision_sdk.normalization` in the Python SDK; the two must agree,\n * because the same model file is driven by both.\n */\n\n/**\n * Which preprocessing the classifier expects its input to have had.\n *\n * - `\"auto\"` (the default wherever it is accepted) reads the model's own export\n * metadata and picks. An Ultralytics classification head gets\n * `\"ultralytics\"`; anything else gets `\"imagenet\"`.\n * - `\"imagenet\"` subtracts the ImageNet mean and divides by the ImageNet\n * deviation — the torchvision convention.\n * - `\"ultralytics\"` leaves the image in `[0, 1]`. Ultralytics' own classifier\n * applies no mean/std at all, so anything else feeds it images it never saw\n * in training.\n * - `\"none\"` is the same arithmetic as `\"ultralytics\"` — identity — under a\n * name that says \"this model wants raw `[0, 1]`\" rather than naming a vendor.\n */\nexport type Normalization = \"auto\" | \"imagenet\" | \"ultralytics\" | \"none\";\n\n/** Per-channel RGB mean of ImageNet, the torchvision preprocessing convention. */\nexport const IMAGENET_MEAN: readonly [number, number, number] = [0.485, 0.456, 0.406];\n\n/** Per-channel RGB standard deviation of ImageNet. */\nexport const IMAGENET_STD: readonly [number, number, number] = [0.229, 0.224, 0.225];\n\n/** Mean that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_MEAN: readonly [number, number, number] = [0, 0, 0];\n\n/** Deviation that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_STD: readonly [number, number, number] = [1, 1, 1];\n\n/** Name reported when the caller supplied `mean`/`std` directly. */\nexport const CUSTOM_NORMALIZATION = \"custom\";\n\nconst PRESETS: Readonly<\n Record<string, readonly [readonly [number, number, number], readonly [number, number, number]]>\n> = {\n imagenet: [IMAGENET_MEAN, IMAGENET_STD],\n ultralytics: [IDENTITY_MEAN, IDENTITY_STD],\n none: [IDENTITY_MEAN, IDENTITY_STD],\n};\n\n/** What {@link resolveNormalization} settled on. */\nexport interface ResolvedNormalization {\n /** The preset name, or `\"custom\"` when the caller supplied the values. */\n readonly name: string;\n /** Per-channel mean to subtract. */\n readonly mean: readonly [number, number, number];\n /** Per-channel deviation to divide by. */\n readonly std: readonly [number, number, number];\n}\n\n/**\n * Whether a metadata map came out of `YOLO(...).export(format=\"onnx\")`.\n *\n * Every Ultralytics export stamps `author` and `task` into its metadata, and the\n * pair is unambiguous: `\"Ultralytics\"` plus `\"classify\"` is a classification head\n * from that codebase and nothing else.\n *\n * @param metadata The model's custom metadata map.\n */\nexport function isUltralyticsClassifier(metadata: Readonly<Record<string, string>>): boolean {\n return (\n (metadata.author ?? \"\").trim().toLowerCase() === \"ultralytics\" &&\n (metadata.task ?? \"\").trim().toLowerCase() === \"classify\"\n );\n}\n\n/**\n * Settle which `mean`/`std` to apply, and what to call the choice.\n *\n * Explicit `mean`/`std` always win — they are the escape hatch for a model whose\n * preprocessing neither preset describes. Anything they leave open falls back to\n * the preset, so passing only a `mean` does not silently reset the deviation\n * to 1.\n *\n * Warns (via `console.warn`) when the model is an Ultralytics export and the\n * supplied values are not the identity it was trained with. Nothing fails in\n * that case: the prediction has the right shape and is simply less accurate,\n * which is exactly why it is worth saying out loud.\n *\n * @param metadata The model's custom metadata map, read to detect the family.\n * @param options The preset asked for, plus any explicit `mean`/`std`.\n * @throws {RangeError} If `normalization` is not a known preset, or names one\n * while `mean`/`std` are also supplied — two answers to the same question.\n */\nexport function resolveNormalization(\n metadata: Readonly<Record<string, string>>,\n options: {\n readonly normalization?: Normalization;\n readonly mean?: readonly [number, number, number];\n readonly std?: readonly [number, number, number];\n } = {},\n): ResolvedNormalization {\n const normalization = options.normalization ?? \"auto\";\n const explicit = options.mean !== undefined || options.std !== undefined;\n\n if (normalization !== \"auto\" && PRESETS[normalization] === undefined) {\n throw new RangeError(\n `normalization must be one of 'auto', 'imagenet', 'ultralytics', 'none'; ` +\n `got ${JSON.stringify(normalization)}.`,\n );\n }\n if (explicit && normalization !== \"auto\") {\n throw new RangeError(\n `Pass either normalization=${JSON.stringify(normalization)} or explicit mean/std, not both.`,\n );\n }\n\n const ultralytics = isUltralyticsClassifier(metadata);\n const preset =\n normalization === \"auto\" ? (ultralytics ? \"ultralytics\" : \"imagenet\") : normalization;\n const [presetMean, presetStd] = PRESETS[preset] as readonly [\n readonly [number, number, number],\n readonly [number, number, number],\n ];\n\n if (!explicit) {\n return { name: preset, mean: presetMean, std: presetStd };\n }\n\n const mean = options.mean ?? presetMean;\n const std = options.std ?? presetStd;\n if (ultralytics && !(isIdentity(mean, IDENTITY_MEAN) && isIdentity(std, IDENTITY_STD))) {\n console.warn(\n \"The classifier is an Ultralytics export, whose classification head is trained on raw \" +\n `[0, 1] images, but mean=${JSON.stringify(mean)} / std=${JSON.stringify(std)} was ` +\n \"requested. It will be fed images normalized in a way it never saw in training, which \" +\n \"degrades accuracy without raising anything. Drop mean/std to let normalization='auto' \" +\n \"pick the identity.\",\n );\n }\n return { name: CUSTOM_NORMALIZATION, mean, std };\n}\n\n/**\n * Whether two channel triples are equal.\n *\n * @param value The triple to check.\n * @param reference The triple to compare against.\n */\nfunction isIdentity(\n value: readonly [number, number, number],\n reference: readonly [number, number, number],\n): boolean {\n return value.every((entry, index) => entry === reference[index]);\n}\n"],"mappings":"AAmCA,IAAaA,EAAmD,CAAC,KAAO,KAAO,IAAK,EAGvEC,EAAkD,CAAC,KAAO,KAAO,IAAK,EAGtEC,EAAmD,CAAC,EAAG,EAAG,CAAC,EAG3DC,EAAkD,CAAC,EAAG,EAAG,CAAC,EAG1DC,EAAuB,SAE9BC,EAEF,CACA,SAAU,CAACL,EAAeC,CAAY,EACtC,YAAa,CAACC,EAAeC,CAAY,EACzC,KAAM,CAACD,EAAeC,CAAY,CACtC,EAqBA,SAAgBG,EAAwB,EAAqD,CACzF,OACKC,EAAS,QAAU,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,IAAM,gBAChDA,EAAS,MAAQ,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,IAAM,UAEvD,CAoBA,SAAgBC,EACZ,EACA,EAII,CAAC,EACgB,CACrB,IAAMC,EAAgBC,EAAQ,eAAiB,OACzCC,EAAWD,EAAQ,OAAS,IAAA,IAAaA,EAAQ,MAAQ,IAAA,GAE/D,GAAID,IAAkB,QAAUJ,EAAQI,KAAmB,IAAA,GACvD,MAAU,WACN,+EACW,KAAK,UAAUA,CAAa,EAAE,EAC7C,EAEJ,GAAIE,GAAYF,IAAkB,OAC9B,MAAU,WACN,6BAA6B,KAAK,UAAUA,CAAa,EAAE,iCAC/D,EAGJ,IAAMG,EAAcN,EAAwBC,CAAQ,EAC9CM,EACFJ,IAAkB,OAAUG,EAAc,cAAgB,WAAcH,EACtE,CAACK,EAAYC,GAAaV,EAAQQ,GAKxC,GAAI,CAACF,EACD,MAAO,CAAE,KAAME,EAAQ,KAAMC,EAAY,IAAKC,CAAU,EAG5D,IAAMC,EAAON,EAAQ,MAAQI,EACvBG,EAAMP,EAAQ,KAAOK,EAU3B,OATIH,GAAe,EAAEM,EAAWF,EAAMd,CAAa,GAAKgB,EAAWD,EAAKd,CAAY,IAChF,QAAQ,KACJ,gHAC+B,KAAK,UAAUa,CAAI,EAAE,SAAS,KAAK,UAAUC,CAAG,EAAE,mMAIrF,EAEG,CAAE,KAAMb,EAAsB,OAAM,KAAI,CACnD,CAQA,SAASc,EACL,EACA,EACO,CACP,OAAOC,EAAM,OAAO,EAAO,IAAUC,IAAUC,EAAUC,EAAM,CACnE,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalization.js","names":[],"sources":["../../src/vision/normalization.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Which preprocessing a classifier expects its input to have had.\n *\n * A classifier is trained on a specific tensor, and feeding it a differently\n * prepared one degrades it silently — no exception, no warning, just worse\n * predictions. The two families this SDK sees most disagree completely:\n * torchvision-style models want the ImageNet mean and deviation subtracted and\n * divided out, while an Ultralytics classification head consumes raw `[0, 1]`.\n *\n * Guessing wrong is not detectable from the outside, but it is not a guess: an\n * Ultralytics export stamps `author` and `task` into its own metadata, and every\n * task in this SDK already reads that map for the class names.\n *\n * Mirrors `ort_vision_sdk.normalization` in the Python SDK; the two must agree,\n * because the same model file is driven by both.\n */\n\n/**\n * Which preprocessing the classifier expects its input to have had.\n *\n * - `\"auto\"` (the default wherever it is accepted) reads the model's own export\n * metadata and picks. An Ultralytics classification head gets\n * `\"ultralytics\"`; anything else gets `\"imagenet\"`.\n * - `\"imagenet\"` subtracts the ImageNet mean and divides by the ImageNet\n * deviation — the torchvision convention.\n * - `\"ultralytics\"` leaves the image in `[0, 1]`. Ultralytics' own classifier\n * applies no mean/std at all, so anything else feeds it images it never saw\n * in training.\n * - `\"none\"` is the same arithmetic as `\"ultralytics\"` — identity — under a\n * name that says \"this model wants raw `[0, 1]`\" rather than naming a vendor.\n */\nexport type Normalization = \"auto\" | \"imagenet\" | \"ultralytics\" | \"none\";\n\n/** Per-channel RGB mean of ImageNet, the torchvision preprocessing convention. */\nexport const IMAGENET_MEAN: readonly [number, number, number] = [0.485, 0.456, 0.406];\n\n/** Per-channel RGB standard deviation of ImageNet. */\nexport const IMAGENET_STD: readonly [number, number, number] = [0.229, 0.224, 0.225];\n\n/** Mean that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_MEAN: readonly [number, number, number] = [0, 0, 0];\n\n/** Deviation that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_STD: readonly [number, number, number] = [1, 1, 1];\n\n/** Name reported when the caller supplied `mean`/`std` directly. */\nexport const CUSTOM_NORMALIZATION = \"custom\";\n\nconst PRESETS: Readonly<\n Record<string, readonly [readonly [number, number, number], readonly [number, number, number]]>\n> = {\n imagenet: [IMAGENET_MEAN, IMAGENET_STD],\n ultralytics: [IDENTITY_MEAN, IDENTITY_STD],\n none: [IDENTITY_MEAN, IDENTITY_STD],\n};\n\n/** What {@link resolveNormalization} settled on. */\nexport interface ResolvedNormalization {\n /** The preset name, or `\"custom\"` when the caller supplied the values. */\n readonly name: string;\n /** Per-channel mean to subtract. */\n readonly mean: readonly [number, number, number];\n /** Per-channel deviation to divide by. */\n readonly std: readonly [number, number, number];\n}\n\n/**\n * Whether a metadata map came out of `YOLO(...).export(format=\"onnx\")`.\n *\n * Every Ultralytics export stamps `author` and `task` into its metadata, and the\n * pair is unambiguous: `\"Ultralytics\"` plus `\"classify\"` is a classification head\n * from that codebase and nothing else.\n *\n * @param metadata The model's custom metadata map.\n */\nexport function isUltralyticsClassifier(metadata: Readonly<Record<string, string>>): boolean {\n return (\n (metadata.author ?? \"\").trim().toLowerCase() === \"ultralytics\" &&\n (metadata.task ?? \"\").trim().toLowerCase() === \"classify\"\n );\n}\n\n/**\n * Settle which `mean`/`std` to apply, and what to call the choice.\n *\n * Explicit `mean`/`std` always win — they are the escape hatch for a model whose\n * preprocessing neither preset describes. Anything they leave open falls back to\n * the preset, so passing only a `mean` does not silently reset the deviation\n * to 1.\n *\n * Warns (via `console.warn`) when the model is an Ultralytics export and the\n * supplied values are not the identity it was trained with. Nothing fails in\n * that case: the prediction has the right shape and is simply less accurate,\n * which is exactly why it is worth saying out loud.\n *\n * @param metadata The model's custom metadata map, read to detect the family.\n * @param options The preset asked for, plus any explicit `mean`/`std`.\n * @throws {RangeError} If `normalization` is not a known preset, or names one\n * while `mean`/`std` are also supplied — two answers to the same question.\n */\nexport function resolveNormalization(\n metadata: Readonly<Record<string, string>>,\n options: {\n readonly normalization?: Normalization;\n readonly mean?: readonly [number, number, number];\n readonly std?: readonly [number, number, number];\n } = {},\n): ResolvedNormalization {\n const normalization = options.normalization ?? \"auto\";\n const explicit = options.mean !== undefined || options.std !== undefined;\n\n if (normalization !== \"auto\" && PRESETS[normalization] === undefined) {\n throw new RangeError(\n `normalization must be one of 'auto', 'imagenet', 'ultralytics', 'none'; ` +\n `got ${JSON.stringify(normalization)}.`,\n );\n }\n if (explicit && normalization !== \"auto\") {\n throw new RangeError(\n `Pass either normalization=${JSON.stringify(normalization)} or explicit mean/std, not both.`,\n );\n }\n\n const ultralytics = isUltralyticsClassifier(metadata);\n const preset =\n normalization === \"auto\" ? (ultralytics ? \"ultralytics\" : \"imagenet\") : normalization;\n const [presetMean, presetStd] = PRESETS[preset] as readonly [\n readonly [number, number, number],\n readonly [number, number, number],\n ];\n\n if (!explicit) {\n return { name: preset, mean: presetMean, std: presetStd };\n }\n\n const mean = options.mean ?? presetMean;\n const std = options.std ?? presetStd;\n if (ultralytics && !(isIdentity(mean, IDENTITY_MEAN) && isIdentity(std, IDENTITY_STD))) {\n console.warn(\n \"The classifier is an Ultralytics export, whose classification head is trained on raw \" +\n `[0, 1] images, but mean=${JSON.stringify(mean)} / std=${JSON.stringify(std)} was ` +\n \"requested. It will be fed images normalized in a way it never saw in training, which \" +\n \"degrades accuracy without raising anything. Drop mean/std to let normalization='auto' \" +\n \"pick the identity.\",\n );\n }\n return { name: CUSTOM_NORMALIZATION, mean, std };\n}\n\n/**\n * Whether two channel triples are equal.\n *\n * @param value The triple to check.\n * @param reference The triple to compare against.\n */\nfunction isIdentity(\n value: readonly [number, number, number],\n reference: readonly [number, number, number],\n): boolean {\n return value.every((entry, index) => entry === reference[index]);\n}\n"],"mappings":";AAmCA,IAAa,IAAmD;CAAC;CAAO;CAAO;AAAK,GAGvE,IAAkD;CAAC;CAAO;CAAO;AAAK,GAGtE,IAAmD;CAAC;CAAG;CAAG;AAAC,GAG3D,IAAkD;CAAC;CAAG;CAAG;AAAC,GAG1D,IAAuB,UAE9B,IAEF;CACA,UAAU,CAAC,GAAe,CAAY;CACtC,aAAa,CAAC,GAAe,CAAY;CACzC,MAAM,CAAC,GAAe,CAAY;AACtC;AAqBA,SAAgB,EAAwB,GAAqD;CACzF,QACK,EAAS,UAAU,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,MAAM,kBAChD,EAAS,QAAQ,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,MAAM;AAEvD;AAoBA,SAAgB,EACZ,GACA,IAII,CAAC,GACgB;CACrB,IAAM,IAAgB,EAAQ,iBAAiB,QACzC,IAAW,EAAQ,SAAS,KAAA,KAAa,EAAQ,QAAQ,KAAA;CAE/D,IAAI,MAAkB,UAAU,EAAQ,OAAmB,KAAA,GACvD,MAAU,WACN,+EACW,KAAK,UAAU,CAAa,EAAE,EAC7C;CAEJ,IAAI,KAAY,MAAkB,QAC9B,MAAU,WACN,6BAA6B,KAAK,UAAU,CAAa,EAAE,iCAC/D;CAGJ,IAAM,IAAc,EAAwB,CAAQ,GAC9C,IACF,MAAkB,SAAU,IAAc,gBAAgB,aAAc,GACtE,CAAC,GAAY,KAAa,EAAQ;CAKxC,IAAI,CAAC,GACD,OAAO;EAAE,MAAM;EAAQ,MAAM;EAAY,KAAK;CAAU;CAG5D,IAAM,IAAO,EAAQ,QAAQ,GACvB,IAAM,EAAQ,OAAO;CAU3B,OATI,KAAe,EAAE,EAAW,GAAM,CAAa,KAAK,EAAW,GAAK,CAAY,MAChF,QAAQ,KACJ,gHAC+B,KAAK,UAAU,CAAI,EAAE,SAAS,KAAK,UAAU,CAAG,EAAE,mMAIrF,GAEG;EAAE,MAAM;EAAsB;EAAM;CAAI;AACnD;AAQA,SAAS,EACL,GACA,GACO;CACP,OAAO,EAAM,OAAO,GAAO,MAAU,MAAU,EAAU,EAAM;AACnE"}
1
+ {"version":3,"file":"normalization.js","names":["IMAGENET_MEAN","IMAGENET_STD","IDENTITY_MEAN","IDENTITY_STD","CUSTOM_NORMALIZATION","PRESETS","isUltralyticsClassifier","metadata","resolveNormalization","normalization","options","explicit","ultralytics","preset","presetMean","presetStd","mean","std","isIdentity","value","entry","reference","index"],"sources":["../../src/vision/normalization.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Which preprocessing a classifier expects its input to have had.\n *\n * A classifier is trained on a specific tensor, and feeding it a differently\n * prepared one degrades it silently — no exception, no warning, just worse\n * predictions. The two families this SDK sees most disagree completely:\n * torchvision-style models want the ImageNet mean and deviation subtracted and\n * divided out, while an Ultralytics classification head consumes raw `[0, 1]`.\n *\n * Guessing wrong is not detectable from the outside, but it is not a guess: an\n * Ultralytics export stamps `author` and `task` into its own metadata, and every\n * task in this SDK already reads that map for the class names.\n *\n * Mirrors `ort_vision_sdk.normalization` in the Python SDK; the two must agree,\n * because the same model file is driven by both.\n */\n\n/**\n * Which preprocessing the classifier expects its input to have had.\n *\n * - `\"auto\"` (the default wherever it is accepted) reads the model's own export\n * metadata and picks. An Ultralytics classification head gets\n * `\"ultralytics\"`; anything else gets `\"imagenet\"`.\n * - `\"imagenet\"` subtracts the ImageNet mean and divides by the ImageNet\n * deviation — the torchvision convention.\n * - `\"ultralytics\"` leaves the image in `[0, 1]`. Ultralytics' own classifier\n * applies no mean/std at all, so anything else feeds it images it never saw\n * in training.\n * - `\"none\"` is the same arithmetic as `\"ultralytics\"` — identity — under a\n * name that says \"this model wants raw `[0, 1]`\" rather than naming a vendor.\n */\nexport type Normalization = \"auto\" | \"imagenet\" | \"ultralytics\" | \"none\";\n\n/** Per-channel RGB mean of ImageNet, the torchvision preprocessing convention. */\nexport const IMAGENET_MEAN: readonly [number, number, number] = [0.485, 0.456, 0.406];\n\n/** Per-channel RGB standard deviation of ImageNet. */\nexport const IMAGENET_STD: readonly [number, number, number] = [0.229, 0.224, 0.225];\n\n/** Mean that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_MEAN: readonly [number, number, number] = [0, 0, 0];\n\n/** Deviation that leaves an image untouched — what an Ultralytics classifier expects. */\nexport const IDENTITY_STD: readonly [number, number, number] = [1, 1, 1];\n\n/** Name reported when the caller supplied `mean`/`std` directly. */\nexport const CUSTOM_NORMALIZATION = \"custom\";\n\nconst PRESETS: Readonly<\n Record<string, readonly [readonly [number, number, number], readonly [number, number, number]]>\n> = {\n imagenet: [IMAGENET_MEAN, IMAGENET_STD],\n ultralytics: [IDENTITY_MEAN, IDENTITY_STD],\n none: [IDENTITY_MEAN, IDENTITY_STD],\n};\n\n/** What {@link resolveNormalization} settled on. */\nexport interface ResolvedNormalization {\n /** The preset name, or `\"custom\"` when the caller supplied the values. */\n readonly name: string;\n /** Per-channel mean to subtract. */\n readonly mean: readonly [number, number, number];\n /** Per-channel deviation to divide by. */\n readonly std: readonly [number, number, number];\n}\n\n/**\n * Whether a metadata map came out of `YOLO(...).export(format=\"onnx\")`.\n *\n * Every Ultralytics export stamps `author` and `task` into its metadata, and the\n * pair is unambiguous: `\"Ultralytics\"` plus `\"classify\"` is a classification head\n * from that codebase and nothing else.\n *\n * @param metadata The model's custom metadata map.\n */\nexport function isUltralyticsClassifier(metadata: Readonly<Record<string, string>>): boolean {\n return (\n (metadata.author ?? \"\").trim().toLowerCase() === \"ultralytics\" &&\n (metadata.task ?? \"\").trim().toLowerCase() === \"classify\"\n );\n}\n\n/**\n * Settle which `mean`/`std` to apply, and what to call the choice.\n *\n * Explicit `mean`/`std` always win — they are the escape hatch for a model whose\n * preprocessing neither preset describes. Anything they leave open falls back to\n * the preset, so passing only a `mean` does not silently reset the deviation\n * to 1.\n *\n * Warns (via `console.warn`) when the model is an Ultralytics export and the\n * supplied values are not the identity it was trained with. Nothing fails in\n * that case: the prediction has the right shape and is simply less accurate,\n * which is exactly why it is worth saying out loud.\n *\n * @param metadata The model's custom metadata map, read to detect the family.\n * @param options The preset asked for, plus any explicit `mean`/`std`.\n * @throws {RangeError} If `normalization` is not a known preset, or names one\n * while `mean`/`std` are also supplied — two answers to the same question.\n */\nexport function resolveNormalization(\n metadata: Readonly<Record<string, string>>,\n options: {\n readonly normalization?: Normalization;\n readonly mean?: readonly [number, number, number];\n readonly std?: readonly [number, number, number];\n } = {},\n): ResolvedNormalization {\n const normalization = options.normalization ?? \"auto\";\n const explicit = options.mean !== undefined || options.std !== undefined;\n\n if (normalization !== \"auto\" && PRESETS[normalization] === undefined) {\n throw new RangeError(\n `normalization must be one of 'auto', 'imagenet', 'ultralytics', 'none'; ` +\n `got ${JSON.stringify(normalization)}.`,\n );\n }\n if (explicit && normalization !== \"auto\") {\n throw new RangeError(\n `Pass either normalization=${JSON.stringify(normalization)} or explicit mean/std, not both.`,\n );\n }\n\n const ultralytics = isUltralyticsClassifier(metadata);\n const preset =\n normalization === \"auto\" ? (ultralytics ? \"ultralytics\" : \"imagenet\") : normalization;\n const [presetMean, presetStd] = PRESETS[preset] as readonly [\n readonly [number, number, number],\n readonly [number, number, number],\n ];\n\n if (!explicit) {\n return { name: preset, mean: presetMean, std: presetStd };\n }\n\n const mean = options.mean ?? presetMean;\n const std = options.std ?? presetStd;\n if (ultralytics && !(isIdentity(mean, IDENTITY_MEAN) && isIdentity(std, IDENTITY_STD))) {\n console.warn(\n \"The classifier is an Ultralytics export, whose classification head is trained on raw \" +\n `[0, 1] images, but mean=${JSON.stringify(mean)} / std=${JSON.stringify(std)} was ` +\n \"requested. It will be fed images normalized in a way it never saw in training, which \" +\n \"degrades accuracy without raising anything. Drop mean/std to let normalization='auto' \" +\n \"pick the identity.\",\n );\n }\n return { name: CUSTOM_NORMALIZATION, mean, std };\n}\n\n/**\n * Whether two channel triples are equal.\n *\n * @param value The triple to check.\n * @param reference The triple to compare against.\n */\nfunction isIdentity(\n value: readonly [number, number, number],\n reference: readonly [number, number, number],\n): boolean {\n return value.every((entry, index) => entry === reference[index]);\n}\n"],"mappings":";AAmCA,IAAaA,IAAmD;CAAC;CAAO;CAAO;AAAK,GAGvEC,IAAkD;CAAC;CAAO;CAAO;AAAK,GAGtEC,IAAmD;CAAC;CAAG;CAAG;AAAC,GAG3DC,IAAkD;CAAC;CAAG;CAAG;AAAC,GAG1DC,IAAuB,UAE9BC,IAEF;CACA,UAAU,CAACL,GAAeC,CAAY;CACtC,aAAa,CAACC,GAAeC,CAAY;CACzC,MAAM,CAACD,GAAeC,CAAY;AACtC;AAqBA,SAAgBG,EAAwB,GAAqD;CACzF,QACKC,EAAS,UAAU,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,MAAM,kBAChDA,EAAS,QAAQ,GAAA,CAAI,KAAK,CAAC,CAAC,YAAY,MAAM;AAEvD;AAoBA,SAAgBC,EACZ,GACA,IAII,CAAC,GACgB;CACrB,IAAMC,IAAgBC,EAAQ,iBAAiB,QACzCC,IAAWD,EAAQ,SAAS,KAAA,KAAaA,EAAQ,QAAQ,KAAA;CAE/D,IAAID,MAAkB,UAAUJ,EAAQI,OAAmB,KAAA,GACvD,MAAU,WACN,+EACW,KAAK,UAAUA,CAAa,EAAE,EAC7C;CAEJ,IAAIE,KAAYF,MAAkB,QAC9B,MAAU,WACN,6BAA6B,KAAK,UAAUA,CAAa,EAAE,iCAC/D;CAGJ,IAAMG,IAAcN,EAAwBC,CAAQ,GAC9CM,IACFJ,MAAkB,SAAUG,IAAc,gBAAgB,aAAcH,GACtE,CAACK,GAAYC,KAAaV,EAAQQ;CAKxC,IAAI,CAACF,GACD,OAAO;EAAE,MAAME;EAAQ,MAAMC;EAAY,KAAKC;CAAU;CAG5D,IAAMC,IAAON,EAAQ,QAAQI,GACvBG,IAAMP,EAAQ,OAAOK;CAU3B,OATIH,KAAe,EAAEM,EAAWF,GAAMd,CAAa,KAAKgB,EAAWD,GAAKd,CAAY,MAChF,QAAQ,KACJ,gHAC+B,KAAK,UAAUa,CAAI,EAAE,SAAS,KAAK,UAAUC,CAAG,EAAE,mMAIrF,GAEG;EAAE,MAAMb;EAAsB;EAAM;CAAI;AACnD;AAQA,SAASc,EACL,GACA,GACO;CACP,OAAOC,EAAM,OAAO,GAAO,MAAUC,MAAUC,EAAUC,EAAM;AACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"classification.cjs","names":[],"sources":["../../../src/vision/postprocess/classification.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Classification head postprocessing — softmax + top-k.\n */\n\n/** Apply numerically-stable softmax to a 1-D vector of logits. */\nexport function softmax(logits: Float32Array | readonly number[]): Float32Array {\n const n = logits.length;\n const out = new Float32Array(n);\n let max = -Infinity;\n for (let i = 0; i < n; i++) {\n const v = logits[i] as number;\n if (v > max) max = v;\n }\n let sum = 0;\n for (let i = 0; i < n; i++) {\n const e = Math.exp((logits[i] as number) - max);\n out[i] = e;\n sum += e;\n }\n for (let i = 0; i < n; i++) {\n out[i] = (out[i] as number) / sum;\n }\n return out;\n}\n\nexport interface TopKResult {\n readonly indices: Int32Array;\n readonly values: Float32Array;\n}\n\n/**\n * Return the top-k entries of a 1-D probability vector, sorted descending.\n *\n * @param k Number of entries to return; `null` returns all entries.\n */\nexport function topK(probabilities: Float32Array, k: number | null): TopKResult {\n const n = probabilities.length;\n const kEff = k === null ? n : Math.min(Math.max(0, k), n);\n\n const idx = new Array<number>(n);\n for (let i = 0; i < n; i++) idx[i] = i;\n idx.sort((a, b) => (probabilities[b] as number) - (probabilities[a] as number));\n\n const indices = new Int32Array(kEff);\n const values = new Float32Array(kEff);\n for (let i = 0; i < kEff; i++) {\n const j = idx[i] as number;\n indices[i] = j;\n values[i] = probabilities[j] as number;\n }\n return { indices, values };\n}\n"],"mappings":"AAMA,SAAgB,EAAQ,EAAwD,CAC5E,IAAM,EAAI,EAAO,OACX,EAAM,IAAI,aAAa,CAAC,EAC1B,EAAM,KACV,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,CACxB,IAAM,EAAI,EAAO,GACb,EAAI,IAAK,EAAM,EACvB,CACA,IAAI,EAAM,EACV,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,CACxB,IAAM,EAAI,KAAK,IAAK,EAAO,GAAgB,CAAG,EAC9C,EAAI,GAAK,EACT,GAAO,CACX,CACA,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IACnB,EAAI,GAAM,EAAI,GAAgB,EAElC,OAAO,CACX,CAYA,SAAgB,EAAK,EAA6B,EAA8B,CAC5E,IAAM,EAAI,EAAc,OAClB,EAAO,IAAM,KAAO,EAAI,KAAK,IAAI,KAAK,IAAI,EAAG,CAAC,EAAG,CAAC,EAElD,EAAU,MAAc,CAAC,EAC/B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,EAAI,GAAK,EACrC,EAAI,MAAM,EAAG,IAAO,EAAc,GAAiB,EAAc,EAAa,EAE9E,IAAM,EAAU,IAAI,WAAW,CAAI,EAC7B,EAAS,IAAI,aAAa,CAAI,EACpC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAM,IAAK,CAC3B,IAAM,EAAI,EAAI,GACd,EAAQ,GAAK,EACb,EAAO,GAAK,EAAc,EAC9B,CACA,MAAO,CAAE,UAAS,QAAO,CAC7B"}
1
+ {"version":3,"file":"classification.cjs","names":["softmax","n","logits","out","max","i","v","sum","e","topK","probabilities","kEff","k","idx","b","a","indices","values","j"],"sources":["../../../src/vision/postprocess/classification.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Classification head postprocessing — softmax + top-k.\n */\n\n/** Apply numerically-stable softmax to a 1-D vector of logits. */\nexport function softmax(logits: Float32Array | readonly number[]): Float32Array {\n const n = logits.length;\n const out = new Float32Array(n);\n let max = -Infinity;\n for (let i = 0; i < n; i++) {\n const v = logits[i] as number;\n if (v > max) max = v;\n }\n let sum = 0;\n for (let i = 0; i < n; i++) {\n const e = Math.exp((logits[i] as number) - max);\n out[i] = e;\n sum += e;\n }\n for (let i = 0; i < n; i++) {\n out[i] = (out[i] as number) / sum;\n }\n return out;\n}\n\nexport interface TopKResult {\n readonly indices: Int32Array;\n readonly values: Float32Array;\n}\n\n/**\n * Return the top-k entries of a 1-D probability vector, sorted descending.\n *\n * @param k Number of entries to return; `null` returns all entries.\n */\nexport function topK(probabilities: Float32Array, k: number | null): TopKResult {\n const n = probabilities.length;\n const kEff = k === null ? n : Math.min(Math.max(0, k), n);\n\n const idx = new Array<number>(n);\n for (let i = 0; i < n; i++) idx[i] = i;\n idx.sort((a, b) => (probabilities[b] as number) - (probabilities[a] as number));\n\n const indices = new Int32Array(kEff);\n const values = new Float32Array(kEff);\n for (let i = 0; i < kEff; i++) {\n const j = idx[i] as number;\n indices[i] = j;\n values[i] = probabilities[j] as number;\n }\n return { indices, values };\n}\n"],"mappings":"AAMA,SAAgBA,EAAQ,EAAwD,CAC5E,IAAMC,EAAIC,EAAO,OACXC,EAAM,IAAI,aAAaF,CAAC,EAC1BG,EAAM,KACV,IAAK,IAAIC,EAAI,EAAGA,EAAIJ,EAAG,IAAK,CACxB,IAAMK,EAAIJ,EAAOG,GACbC,EAAIF,IAAK,EAAME,EACvB,CACA,IAAIC,EAAM,EACV,IAAK,IAAIF,EAAI,EAAGA,EAAIJ,EAAG,IAAK,CACxB,IAAMO,EAAI,KAAK,IAAKN,EAAOG,GAAgBD,CAAG,EAC9C,EAAIC,GAAKG,EACT,GAAOA,CACX,CACA,IAAK,IAAIH,EAAI,EAAGA,EAAIJ,EAAG,IACnB,EAAII,GAAMF,EAAIE,GAAgBE,EAElC,OAAOJ,CACX,CAYA,SAAgBM,EAAK,EAA6B,EAA8B,CAC5E,IAAM,EAAIC,EAAc,OAClBC,EAAOC,IAAM,KAAO,EAAI,KAAK,IAAI,KAAK,IAAI,EAAGA,CAAC,EAAG,CAAC,EAElDC,EAAU,MAAc,CAAC,EAC/B,IAAK,IAAIR,EAAI,EAAGA,EAAI,EAAG,IAAK,EAAIA,GAAKA,EACrCQ,EAAI,MAAM,EAAG,IAAOH,EAAcI,GAAiBJ,EAAcK,EAAa,EAE9E,IAAMC,EAAU,IAAI,WAAWL,CAAI,EAC7BM,EAAS,IAAI,aAAaN,CAAI,EACpC,IAAK,IAAIN,EAAI,EAAGA,EAAIM,EAAM,IAAK,CAC3B,IAAMO,EAAIL,EAAIR,GACd,EAAQA,GAAKa,EACb,EAAOb,GAAKK,EAAcQ,EAC9B,CACA,MAAO,CAAE,UAAS,QAAO,CAC7B,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"classification.js","names":[],"sources":["../../../src/vision/postprocess/classification.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Classification head postprocessing — softmax + top-k.\n */\n\n/** Apply numerically-stable softmax to a 1-D vector of logits. */\nexport function softmax(logits: Float32Array | readonly number[]): Float32Array {\n const n = logits.length;\n const out = new Float32Array(n);\n let max = -Infinity;\n for (let i = 0; i < n; i++) {\n const v = logits[i] as number;\n if (v > max) max = v;\n }\n let sum = 0;\n for (let i = 0; i < n; i++) {\n const e = Math.exp((logits[i] as number) - max);\n out[i] = e;\n sum += e;\n }\n for (let i = 0; i < n; i++) {\n out[i] = (out[i] as number) / sum;\n }\n return out;\n}\n\nexport interface TopKResult {\n readonly indices: Int32Array;\n readonly values: Float32Array;\n}\n\n/**\n * Return the top-k entries of a 1-D probability vector, sorted descending.\n *\n * @param k Number of entries to return; `null` returns all entries.\n */\nexport function topK(probabilities: Float32Array, k: number | null): TopKResult {\n const n = probabilities.length;\n const kEff = k === null ? n : Math.min(Math.max(0, k), n);\n\n const idx = new Array<number>(n);\n for (let i = 0; i < n; i++) idx[i] = i;\n idx.sort((a, b) => (probabilities[b] as number) - (probabilities[a] as number));\n\n const indices = new Int32Array(kEff);\n const values = new Float32Array(kEff);\n for (let i = 0; i < kEff; i++) {\n const j = idx[i] as number;\n indices[i] = j;\n values[i] = probabilities[j] as number;\n }\n return { indices, values };\n}\n"],"mappings":";AAMA,SAAgB,EAAQ,GAAwD;CAC5E,IAAM,IAAI,EAAO,QACX,IAAM,IAAI,aAAa,CAAC,GAC1B,IAAM;CACV,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EACxB,IAAM,IAAI,EAAO;EACjB,AAAI,IAAI,MAAK,IAAM;CACvB;CACA,IAAI,IAAM;CACV,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EACxB,IAAM,IAAI,KAAK,IAAK,EAAO,KAAgB,CAAG;EAE9C,AADA,EAAI,KAAK,GACT,KAAO;CACX;CACA,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KACnB,EAAI,KAAM,EAAI,KAAgB;CAElC,OAAO;AACX;AAYA,SAAgB,EAAK,GAA6B,GAA8B;CAC5E,IAAM,IAAI,EAAc,QAClB,IAAO,MAAM,OAAO,IAAI,KAAK,IAAI,KAAK,IAAI,GAAG,CAAC,GAAG,CAAC,GAElD,IAAU,MAAc,CAAC;CAC/B,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,EAAI,KAAK;CACrC,EAAI,MAAM,GAAG,MAAO,EAAc,KAAiB,EAAc,EAAa;CAE9E,IAAM,IAAU,IAAI,WAAW,CAAI,GAC7B,IAAS,IAAI,aAAa,CAAI;CACpC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAM,KAAK;EAC3B,IAAM,IAAI,EAAI;EAEd,AADA,EAAQ,KAAK,GACb,EAAO,KAAK,EAAc;CAC9B;CACA,OAAO;EAAE;EAAS;CAAO;AAC7B"}
1
+ {"version":3,"file":"classification.js","names":["softmax","n","logits","out","max","i","v","sum","e","topK","probabilities","kEff","k","idx","b","a","indices","values","j"],"sources":["../../../src/vision/postprocess/classification.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Classification head postprocessing — softmax + top-k.\n */\n\n/** Apply numerically-stable softmax to a 1-D vector of logits. */\nexport function softmax(logits: Float32Array | readonly number[]): Float32Array {\n const n = logits.length;\n const out = new Float32Array(n);\n let max = -Infinity;\n for (let i = 0; i < n; i++) {\n const v = logits[i] as number;\n if (v > max) max = v;\n }\n let sum = 0;\n for (let i = 0; i < n; i++) {\n const e = Math.exp((logits[i] as number) - max);\n out[i] = e;\n sum += e;\n }\n for (let i = 0; i < n; i++) {\n out[i] = (out[i] as number) / sum;\n }\n return out;\n}\n\nexport interface TopKResult {\n readonly indices: Int32Array;\n readonly values: Float32Array;\n}\n\n/**\n * Return the top-k entries of a 1-D probability vector, sorted descending.\n *\n * @param k Number of entries to return; `null` returns all entries.\n */\nexport function topK(probabilities: Float32Array, k: number | null): TopKResult {\n const n = probabilities.length;\n const kEff = k === null ? n : Math.min(Math.max(0, k), n);\n\n const idx = new Array<number>(n);\n for (let i = 0; i < n; i++) idx[i] = i;\n idx.sort((a, b) => (probabilities[b] as number) - (probabilities[a] as number));\n\n const indices = new Int32Array(kEff);\n const values = new Float32Array(kEff);\n for (let i = 0; i < kEff; i++) {\n const j = idx[i] as number;\n indices[i] = j;\n values[i] = probabilities[j] as number;\n }\n return { indices, values };\n}\n"],"mappings":";AAMA,SAAgBA,EAAQ,GAAwD;CAC5E,IAAMC,IAAIC,EAAO,QACXC,IAAM,IAAI,aAAaF,CAAC,GAC1BG,IAAM;CACV,KAAK,IAAIC,IAAI,GAAGA,IAAIJ,GAAG,KAAK;EACxB,IAAMK,IAAIJ,EAAOG;EACjB,AAAIC,IAAIF,MAAK,IAAME;CACvB;CACA,IAAIC,IAAM;CACV,KAAK,IAAIF,IAAI,GAAGA,IAAIJ,GAAG,KAAK;EACxB,IAAMO,IAAI,KAAK,IAAKN,EAAOG,KAAgBD,CAAG;EAE9C,AADA,EAAIC,KAAKG,GACT,KAAOA;CACX;CACA,KAAK,IAAIH,IAAI,GAAGA,IAAIJ,GAAG,KACnB,EAAII,KAAMF,EAAIE,KAAgBE;CAElC,OAAOJ;AACX;AAYA,SAAgBM,EAAK,GAA6B,GAA8B;CAC5E,IAAM,IAAIC,EAAc,QAClBC,IAAOC,MAAM,OAAO,IAAI,KAAK,IAAI,KAAK,IAAI,GAAGA,CAAC,GAAG,CAAC,GAElDC,IAAU,MAAc,CAAC;CAC/B,KAAK,IAAIR,IAAI,GAAGA,IAAI,GAAG,KAAK,EAAIA,KAAKA;CACrC,EAAI,MAAM,GAAG,MAAOK,EAAcI,KAAiBJ,EAAcK,EAAa;CAE9E,IAAMC,IAAU,IAAI,WAAWL,CAAI,GAC7BM,IAAS,IAAI,aAAaN,CAAI;CACpC,KAAK,IAAIN,IAAI,GAAGA,IAAIM,GAAM,KAAK;EAC3B,IAAMO,IAAIL,EAAIR;EAEd,AADA,EAAQA,KAAKa,GACb,EAAOb,KAAKK,EAAcQ;CAC9B;CACA,OAAO;EAAE;EAAS;CAAO;AAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"detection.cjs","names":[],"sources":["../../../src/vision/postprocess/detection.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Detection head postprocessing: anchor-free YOLO decoding + non-maximum suppression.\n *\n * The shared {@link decodeYoloAnchors} helper does the per-anchor work that\n * is identical for plain detection and segmentation (transpose, xywh→xyxy,\n * letterbox unmap, per-class NMS, sort & cap). {@link decodeYolo} is a thin\n * wrapper around it; the segmentation module ({@link ./segmentation.js})\n * calls the helper directly so it can also recover the per-anchor mask\n * coefficients.\n *\n * Works for any YOLO export with the post-v8 anchor-free head:\n * **YOLOv8 / v9 / v10 / v11 / v12** detect heads, all of which share the\n * `[1, 4 + nc, N]` output layout.\n */\n\nimport { BoundingBox } from \"../types\";\n\n/**\n * Greedy non-maximum suppression on axis-aligned bounding boxes.\n *\n * Mirrors `torchvision.ops.nms` (keeps boxes with the highest score, drops\n * any subsequent box whose IoU exceeds the threshold).\n *\n * @param boxes Flat array of length `4 * N` in xyxy order: `[x1,y1,x2,y2, ...]`.\n * @param scores Detection score per box, length `N`.\n * @param iouThreshold Boxes with IoU above this threshold relative to a kept box are suppressed.\n * @returns Indices of kept boxes, in descending score order. Boxes tied on\n * score are visited lowest-index first, so the survivor of a tie is\n * deterministic and matches both `torchvision` and the Python SDK.\n *\n * The boxes are copied once into score order, so the inner loop walks a\n * contiguous `Float32Array` instead of hopping through `order` into the caller's\n * layout. A pair with no horizontal overlap is skipped before the vertical\n * extent is computed: its IoU is `0`, which suppresses nothing for any\n * non-negative threshold — the shortcut is gated on that so a negative\n * threshold keeps the exact semantics.\n */\nexport function nms(boxes: Float32Array, scores: Float32Array, iouThreshold: number): Int32Array {\n const n = scores.length;\n if (n === 0) return new Int32Array(0);\n\n const order = new Array<number>(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n\n const sorted = new Float32Array(n * 4);\n const areas = new Float32Array(n);\n for (let k = 0; k < n; k++) {\n const i = (order[k] as number) * 4;\n const x1 = boxes[i] as number;\n const y1 = boxes[i + 1] as number;\n const x2 = boxes[i + 2] as number;\n const y2 = boxes[i + 3] as number;\n sorted[k * 4] = x1;\n sorted[k * 4 + 1] = y1;\n sorted[k * 4 + 2] = x2;\n sorted[k * 4 + 3] = y2;\n areas[k] = Math.max(0, x2 - x1) * Math.max(0, y2 - y1);\n }\n\n const skipDisjoint = iouThreshold >= 0;\n const suppressed = new Uint8Array(n);\n const keep: number[] = [];\n\n for (let k = 0; k < n; k++) {\n if (suppressed[k]) continue;\n keep.push(order[k] as number);\n\n const ax1 = sorted[k * 4] as number;\n const ay1 = sorted[k * 4 + 1] as number;\n const ax2 = sorted[k * 4 + 2] as number;\n const ay2 = sorted[k * 4 + 3] as number;\n const ak = areas[k] as number;\n\n for (let m = k + 1; m < n; m++) {\n if (suppressed[m]) continue;\n const bx1 = sorted[m * 4] as number;\n const by1 = sorted[m * 4 + 1] as number;\n const bx2 = sorted[m * 4 + 2] as number;\n const by2 = sorted[m * 4 + 3] as number;\n const iw = Math.max(0, Math.min(ax2, bx2) - Math.max(ax1, bx1));\n if (iw === 0 && skipDisjoint) continue;\n const ih = Math.max(0, Math.min(ay2, by2) - Math.max(ay1, by1));\n const inter = iw * ih;\n const union = ak + (areas[m] as number) - inter;\n const iou = union > 0 ? inter / union : 0;\n if (iou > iouThreshold) suppressed[m] = 1;\n }\n }\n\n return Int32Array.from(keep);\n}\n\n/**\n * Per-class NMS — boxes are suppressed only by other boxes of the same class.\n *\n * Mirrors `torchvision.ops.batched_nms`.\n *\n * @param boxes Flat array of length `4 * N` in xyxy order.\n * @param scores Detection score per box, length `N`.\n * @param idxs Class index per box, length `N`. Boxes with different `idxs`\n * never suppress each other.\n * @param iouThreshold IoU threshold for suppression within a class.\n * @returns Indices of kept boxes, sorted by descending score across all\n * classes. Survivors from different classes that are tied on score are\n * ordered lowest-index first — an explicit tie-break, because the order the\n * per-class loop emits them in is an implementation detail (here, `Map`\n * insertion order; in Python, sorted class order).\n */\nexport function batchedNms(\n boxes: Float32Array,\n scores: Float32Array,\n idxs: Int32Array,\n iouThreshold: number,\n): Int32Array {\n if (scores.length === 0) return new Int32Array(0);\n\n const byClass = new Map<number, number[]>();\n for (let i = 0; i < idxs.length; i++) {\n const c = idxs[i] as number;\n const list = byClass.get(c);\n if (list === undefined) byClass.set(c, [i]);\n else list.push(i);\n }\n\n const keep: number[] = [];\n for (const indices of byClass.values()) {\n const m = indices.length;\n const subBoxes = new Float32Array(m * 4);\n const subScores = new Float32Array(m);\n for (let k = 0; k < m; k++) {\n const i = indices[k] as number;\n subBoxes[k * 4] = boxes[i * 4] as number;\n subBoxes[k * 4 + 1] = boxes[i * 4 + 1] as number;\n subBoxes[k * 4 + 2] = boxes[i * 4 + 2] as number;\n subBoxes[k * 4 + 3] = boxes[i * 4 + 3] as number;\n subScores[k] = scores[i] as number;\n }\n const subKeep = nms(subBoxes, subScores, iouThreshold);\n for (let k = 0; k < subKeep.length; k++) {\n keep.push(indices[subKeep[k] as number] as number);\n }\n }\n\n keep.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n return Int32Array.from(keep);\n}\n\nexport interface DecodeYoloAnchorsOptions {\n /** Number of class-score channels following the 4 box channels. */\n readonly numClasses: number;\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedAnchors {\n /** Indices into the original `numAnchors` axis, in descending confidence order. */\n readonly anchorIndices: Int32Array;\n /** `[k, 4]` boxes in original-image pixel coords, flat row-major xyxy. */\n readonly boxesXyxy: Float32Array;\n /** Predicted class id per survivor. */\n readonly classIds: Int32Array;\n /** Confidence per survivor. */\n readonly confidences: Float32Array;\n}\n\n/**\n * Shared YOLO per-anchor decode used by both detection and segmentation\n * (v8 / v9 / v10 / v11 / v12).\n *\n * Only the first `4 + numClasses` channels are read; later channels (e.g.\n * mask coefficients) are ignored — callers can fetch them via the returned\n * {@link DecodedAnchors.anchorIndices}.\n *\n * Candidates are found in two passes, mirroring the Python decoder. The first\n * walks each class row contiguously and only *marks* anchors holding some score\n * at or above the threshold — an anchor's best score clears the threshold\n * exactly when one of its scores does, so no running maximum is needed and the\n * hot loop never writes on a typical frame. The anchor-major scan it replaces\n * read `numClasses` values spaced `numAnchors` apart for every one of the 8400\n * anchors and cost ~1 ms even on a frame with no candidates. The winning class\n * is then picked only for the marked anchors — a few hundred, not 8400 — with\n * the same strict `>` that keeps the lowest class id on a tie.\n *\n * @param data Flat per-anchor output, length `channels * numAnchors`.\n * @param dims Dims as reported by ORT, e.g. `[1, 84, 8400]` (det) or\n * `[1, 116, 8400]` (seg). The leading batch dim must be 1.\n */\nexport function decodeYoloAnchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n let normalized = dims;\n if (normalized.length === 3) {\n if (normalized[0] !== 1) {\n throw new Error(`decodeYoloAnchors: expected batch size 1, got ${normalized[0]}.`);\n }\n normalized = [normalized[1] as number, normalized[2] as number];\n }\n if (normalized.length !== 2) {\n throw new Error(\n `decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(dims)}.`,\n );\n }\n const channels = normalized[0] as number;\n const numAnchors = normalized[1] as number;\n\n const {\n numClasses,\n originalWidth,\n originalHeight,\n padLeft,\n padTop,\n scale,\n confThreshold,\n iouThreshold,\n maxDetections,\n } = options;\n\n if (numClasses < 1 || numClasses + 4 > channels) {\n throw new Error(\n `decodeYoloAnchors: invalid numClasses=${numClasses} for channels=${channels}.`,\n );\n }\n if (data.length !== channels * numAnchors) {\n throw new Error(\n `decodeYoloAnchors: data length ${data.length} does not match channels*numAnchors=${channels * numAnchors}.`,\n );\n }\n\n const hit = new Uint8Array(numAnchors);\n const classEnd = (4 + numClasses) * numAnchors;\n for (let row = 4 * numAnchors; row < classEnd; row += numAnchors) {\n for (let a = 0; a < numAnchors; a++) {\n if ((data[row + a] as number) >= confThreshold) hit[a] = 1;\n }\n }\n\n let count = 0;\n const candidateAnchors = new Int32Array(numAnchors);\n for (let a = 0; a < numAnchors; a++) {\n if (hit[a] === 1) candidateAnchors[count++] = a;\n }\n if (count === 0) return emptyDecoded();\n\n const flatBoxes = new Float32Array(count * 4);\n const scoresArr = new Float32Array(count);\n const idxsArr = new Int32Array(count);\n for (let i = 0; i < count; i++) {\n const a = candidateAnchors[i] as number;\n const cx = data[a] as number;\n const cy = data[numAnchors + a] as number;\n const w = data[2 * numAnchors + a] as number;\n const h = data[3 * numAnchors + a] as number;\n const x1 = (cx - w / 2 - padLeft) / scale;\n const y1 = (cy - h / 2 - padTop) / scale;\n const x2 = (cx + w / 2 - padLeft) / scale;\n const y2 = (cy + h / 2 - padTop) / scale;\n flatBoxes[i * 4] = Math.max(0, Math.min(originalWidth, x1));\n flatBoxes[i * 4 + 1] = Math.max(0, Math.min(originalHeight, y1));\n flatBoxes[i * 4 + 2] = Math.max(0, Math.min(originalWidth, x2));\n flatBoxes[i * 4 + 3] = Math.max(0, Math.min(originalHeight, y2));\n let bestScore = -Infinity;\n let bestClass = 0;\n for (let c = 0, at = 4 * numAnchors + a; c < numClasses; c++, at += numAnchors) {\n const score = data[at] as number;\n if (score > bestScore) {\n bestScore = score;\n bestClass = c;\n }\n }\n scoresArr[i] = bestScore;\n idxsArr[i] = bestClass;\n }\n const kept = batchedNms(flatBoxes, scoresArr, idxsArr, iouThreshold);\n if (kept.length === 0) return emptyDecoded();\n\n const k = Math.min(kept.length, maxDetections);\n const anchorIndices = new Int32Array(k);\n const boxesXyxy = new Float32Array(k * 4);\n const classIds = new Int32Array(k);\n const confidences = new Float32Array(k);\n for (let i = 0; i < k; i++) {\n const j = kept[i] as number;\n anchorIndices[i] = candidateAnchors[j] as number;\n boxesXyxy[i * 4] = flatBoxes[j * 4] as number;\n boxesXyxy[i * 4 + 1] = flatBoxes[j * 4 + 1] as number;\n boxesXyxy[i * 4 + 2] = flatBoxes[j * 4 + 2] as number;\n boxesXyxy[i * 4 + 3] = flatBoxes[j * 4 + 3] as number;\n classIds[i] = idxsArr[j] as number;\n confidences[i] = scoresArr[j] as number;\n }\n return { anchorIndices, boxesXyxy, classIds, confidences };\n}\n\nfunction emptyDecoded(): DecodedAnchors {\n return {\n anchorIndices: new Int32Array(0),\n boxesXyxy: new Float32Array(0),\n classIds: new Int32Array(0),\n confidences: new Float32Array(0),\n };\n}\n\nexport interface DecodeYoloOptions {\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedDetection {\n readonly bbox: BoundingBox;\n readonly classId: number;\n readonly confidence: number;\n}\n\n/**\n * Decode an anchor-free YOLO detection output into a list of detections.\n *\n * Works for **YOLOv8 / v9 / v10 / v11 / v12** detect heads.\n *\n * Expected raw shape: `[1, 4 + numClasses, N]`. `numClasses` is inferred\n * from the channel count.\n */\nexport function decodeYolo(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n const channels = outputDims.length === 3 ? outputDims[1] : outputDims[0];\n if (channels === undefined || channels < 5) {\n throw new Error(`decodeYolo: invalid output channel count ${channels} (expected >= 5).`);\n }\n const numClasses = channels - 4;\n\n const decoded = decodeYoloAnchors(output, outputDims, {\n numClasses,\n ...options,\n });\n\n const results: DecodedDetection[] = [];\n for (let i = 0; i < decoded.classIds.length; i++) {\n results.push({\n bbox: new BoundingBox(\n decoded.boxesXyxy[i * 4] as number,\n decoded.boxesXyxy[i * 4 + 1] as number,\n decoded.boxesXyxy[i * 4 + 2] as number,\n decoded.boxesXyxy[i * 4 + 3] as number,\n ),\n classId: decoded.classIds[i] as number,\n confidence: decoded.confidences[i] as number,\n });\n }\n return results;\n}\n"],"mappings":"gCAsCA,SAAgB,EAAI,EAAqB,EAAsB,EAAkC,CAC7F,IAAM,EAAI,EAAO,OACjB,GAAI,IAAM,EAAG,OAAO,IAAI,WAExB,IAAM,EAAY,MAAc,CAAC,EACjC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,IAAK,EAAM,GAAK,EACvC,EAAM,MAAM,EAAG,IAAO,EAAO,GAAiB,EAAO,I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AAO,CACH,cAAe,IAAI,WACnB,UAAW,IAAI,aACf,SAAU,IAAI,WACd,YAAa,IAAI,YACrB,CACJ,CA2BA,SAAgB,EACZ,EACA,EACA,EACkB,CAClB,IAAM,EAAW,EAAW,SAAW,EAAI,EAAW,GAAK,EAAW,GACtE,GAAI,IAAa,IAAA,IAAa,EAAW,EACrC,MAAU,MAAM,4CAA4C,EAAS,kBAAkB,EAI3F,IAAM,EAAU,EAAkB,EAAQ,EAAY,CAClD,WAHe,EAAW,EAI1B,GAAG,CACP,CAAC,EAEK,EAA8B,CAAC,EACrC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAQ,SAAS,OAAQ,IACzC,EAAQ,KAAK,CACT,KAAM,IAAI,EAAA,YACN,EAAQ,UAAU,EAAI,GACtB,EAAQ,UAAU,EAAI,EAAI,GAC1B,EAAQ,UAAU,EAAI,EAAI,GAC1B,EAAQ,UAAU,EAAI,EAAI,EAC9B,EACA,QAAS,EAAQ,SAAS,GAC1B,WAAY,EAAQ,YAAY,EACpC,CAAC,EAEL,OAAO,CACX"}
1
+ {"version":3,"file":"detection.cjs","names":["BoundingBox","require_types","nms","n","scores","order","i","b","a","sorted","areas","k","x1","boxes","y1","x2","y2","skipDisjoint","iouThreshold","suppressed","keep","ax1","ay1","ax2","ay2","ak","m","bx1","by1","bx2","by2","iw","inter","union","batchedNms","byClass","idxs","c","list","indices","subBoxes","subScores","subKeep","decodeYoloAnchors","normalized","dims","channels","numAnchors","options","numClasses","data","hit","classEnd","row","confThreshold","count","candidateAnchors","emptyDecoded","flatBoxes","scoresArr","idxsArr","cx","cy","w","h","padLeft","scale","padTop","originalWidth","originalHeight","bestScore","bestClass","at","score","kept","maxDetections","anchorIndices","boxesXyxy","classIds","confidences","j","decodeYolo","outputDims","decoded","output","results"],"sources":["../../../src/vision/postprocess/detection.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Detection head postprocessing: anchor-free YOLO decoding + non-maximum suppression.\n *\n * The shared {@link decodeYoloAnchors} helper does the per-anchor work that\n * is identical for plain detection and segmentation (transpose, xywh→xyxy,\n * letterbox unmap, per-class NMS, sort & cap). {@link decodeYolo} is a thin\n * wrapper around it; the segmentation module ({@link ./segmentation.js})\n * calls the helper directly so it can also recover the per-anchor mask\n * coefficients.\n *\n * Works for any YOLO export with the post-v8 anchor-free head:\n * **YOLOv8 / v9 / v10 / v11 / v12** detect heads, all of which share the\n * `[1, 4 + nc, N]` output layout.\n */\n\nimport { BoundingBox } from \"../types\";\n\n/**\n * Greedy non-maximum suppression on axis-aligned bounding boxes.\n *\n * Mirrors `torchvision.ops.nms` (keeps boxes with the highest score, drops\n * any subsequent box whose IoU exceeds the threshold).\n *\n * @param boxes Flat array of length `4 * N` in xyxy order: `[x1,y1,x2,y2, ...]`.\n * @param scores Detection score per box, length `N`.\n * @param iouThreshold Boxes with IoU above this threshold relative to a kept box are suppressed.\n * @returns Indices of kept boxes, in descending score order. Boxes tied on\n * score are visited lowest-index first, so the survivor of a tie is\n * deterministic and matches both `torchvision` and the Python SDK.\n *\n * The boxes are copied once into score order, so the inner loop walks a\n * contiguous `Float32Array` instead of hopping through `order` into the caller's\n * layout. A pair with no horizontal overlap is skipped before the vertical\n * extent is computed: its IoU is `0`, which suppresses nothing for any\n * non-negative threshold — the shortcut is gated on that so a negative\n * threshold keeps the exact semantics.\n */\nexport function nms(boxes: Float32Array, scores: Float32Array, iouThreshold: number): Int32Array {\n const n = scores.length;\n if (n === 0) return new Int32Array(0);\n\n const order = new Array<number>(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n\n const sorted = new Float32Array(n * 4);\n const areas = new Float32Array(n);\n for (let k = 0; k < n; k++) {\n const i = (order[k] as number) * 4;\n const x1 = boxes[i] as number;\n const y1 = boxes[i + 1] as number;\n const x2 = boxes[i + 2] as number;\n const y2 = boxes[i + 3] as number;\n sorted[k * 4] = x1;\n sorted[k * 4 + 1] = y1;\n sorted[k * 4 + 2] = x2;\n sorted[k * 4 + 3] = y2;\n areas[k] = Math.max(0, x2 - x1) * Math.max(0, y2 - y1);\n }\n\n const skipDisjoint = iouThreshold >= 0;\n const suppressed = new Uint8Array(n);\n const keep: number[] = [];\n\n for (let k = 0; k < n; k++) {\n if (suppressed[k]) continue;\n keep.push(order[k] as number);\n\n const ax1 = sorted[k * 4] as number;\n const ay1 = sorted[k * 4 + 1] as number;\n const ax2 = sorted[k * 4 + 2] as number;\n const ay2 = sorted[k * 4 + 3] as number;\n const ak = areas[k] as number;\n\n for (let m = k + 1; m < n; m++) {\n if (suppressed[m]) continue;\n const bx1 = sorted[m * 4] as number;\n const by1 = sorted[m * 4 + 1] as number;\n const bx2 = sorted[m * 4 + 2] as number;\n const by2 = sorted[m * 4 + 3] as number;\n const iw = Math.max(0, Math.min(ax2, bx2) - Math.max(ax1, bx1));\n if (iw === 0 && skipDisjoint) continue;\n const ih = Math.max(0, Math.min(ay2, by2) - Math.max(ay1, by1));\n const inter = iw * ih;\n const union = ak + (areas[m] as number) - inter;\n const iou = union > 0 ? inter / union : 0;\n if (iou > iouThreshold) suppressed[m] = 1;\n }\n }\n\n return Int32Array.from(keep);\n}\n\n/**\n * Per-class NMS — boxes are suppressed only by other boxes of the same class.\n *\n * Mirrors `torchvision.ops.batched_nms`.\n *\n * @param boxes Flat array of length `4 * N` in xyxy order.\n * @param scores Detection score per box, length `N`.\n * @param idxs Class index per box, length `N`. Boxes with different `idxs`\n * never suppress each other.\n * @param iouThreshold IoU threshold for suppression within a class.\n * @returns Indices of kept boxes, sorted by descending score across all\n * classes. Survivors from different classes that are tied on score are\n * ordered lowest-index first — an explicit tie-break, because the order the\n * per-class loop emits them in is an implementation detail (here, `Map`\n * insertion order; in Python, sorted class order).\n */\nexport function batchedNms(\n boxes: Float32Array,\n scores: Float32Array,\n idxs: Int32Array,\n iouThreshold: number,\n): Int32Array {\n if (scores.length === 0) return new Int32Array(0);\n\n const byClass = new Map<number, number[]>();\n for (let i = 0; i < idxs.length; i++) {\n const c = idxs[i] as number;\n const list = byClass.get(c);\n if (list === undefined) byClass.set(c, [i]);\n else list.push(i);\n }\n\n const keep: number[] = [];\n for (const indices of byClass.values()) {\n const m = indices.length;\n const subBoxes = new Float32Array(m * 4);\n const subScores = new Float32Array(m);\n for (let k = 0; k < m; k++) {\n const i = indices[k] as number;\n subBoxes[k * 4] = boxes[i * 4] as number;\n subBoxes[k * 4 + 1] = boxes[i * 4 + 1] as number;\n subBoxes[k * 4 + 2] = boxes[i * 4 + 2] as number;\n subBoxes[k * 4 + 3] = boxes[i * 4 + 3] as number;\n subScores[k] = scores[i] as number;\n }\n const subKeep = nms(subBoxes, subScores, iouThreshold);\n for (let k = 0; k < subKeep.length; k++) {\n keep.push(indices[subKeep[k] as number] as number);\n }\n }\n\n keep.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n return Int32Array.from(keep);\n}\n\nexport interface DecodeYoloAnchorsOptions {\n /** Number of class-score channels following the 4 box channels. */\n readonly numClasses: number;\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedAnchors {\n /** Indices into the original `numAnchors` axis, in descending confidence order. */\n readonly anchorIndices: Int32Array;\n /** `[k, 4]` boxes in original-image pixel coords, flat row-major xyxy. */\n readonly boxesXyxy: Float32Array;\n /** Predicted class id per survivor. */\n readonly classIds: Int32Array;\n /** Confidence per survivor. */\n readonly confidences: Float32Array;\n}\n\n/**\n * Shared YOLO per-anchor decode used by both detection and segmentation\n * (v8 / v9 / v10 / v11 / v12).\n *\n * Only the first `4 + numClasses` channels are read; later channels (e.g.\n * mask coefficients) are ignored — callers can fetch them via the returned\n * {@link DecodedAnchors.anchorIndices}.\n *\n * Candidates are found in two passes, mirroring the Python decoder. The first\n * walks each class row contiguously and only *marks* anchors holding some score\n * at or above the threshold — an anchor's best score clears the threshold\n * exactly when one of its scores does, so no running maximum is needed and the\n * hot loop never writes on a typical frame. The anchor-major scan it replaces\n * read `numClasses` values spaced `numAnchors` apart for every one of the 8400\n * anchors and cost ~1 ms even on a frame with no candidates. The winning class\n * is then picked only for the marked anchors — a few hundred, not 8400 — with\n * the same strict `>` that keeps the lowest class id on a tie.\n *\n * @param data Flat per-anchor output, length `channels * numAnchors`.\n * @param dims Dims as reported by ORT, e.g. `[1, 84, 8400]` (det) or\n * `[1, 116, 8400]` (seg). The leading batch dim must be 1.\n */\nexport function decodeYoloAnchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n let normalized = dims;\n if (normalized.length === 3) {\n if (normalized[0] !== 1) {\n throw new Error(`decodeYoloAnchors: expected batch size 1, got ${normalized[0]}.`);\n }\n normalized = [normalized[1] as number, normalized[2] as number];\n }\n if (normalized.length !== 2) {\n throw new Error(\n `decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(dims)}.`,\n );\n }\n const channels = normalized[0] as number;\n const numAnchors = normalized[1] as number;\n\n const {\n numClasses,\n originalWidth,\n originalHeight,\n padLeft,\n padTop,\n scale,\n confThreshold,\n iouThreshold,\n maxDetections,\n } = options;\n\n if (numClasses < 1 || numClasses + 4 > channels) {\n throw new Error(\n `decodeYoloAnchors: invalid numClasses=${numClasses} for channels=${channels}.`,\n );\n }\n if (data.length !== channels * numAnchors) {\n throw new Error(\n `decodeYoloAnchors: data length ${data.length} does not match channels*numAnchors=${channels * numAnchors}.`,\n );\n }\n\n const hit = new Uint8Array(numAnchors);\n const classEnd = (4 + numClasses) * numAnchors;\n for (let row = 4 * numAnchors; row < classEnd; row += numAnchors) {\n for (let a = 0; a < numAnchors; a++) {\n if ((data[row + a] as number) >= confThreshold) hit[a] = 1;\n }\n }\n\n let count = 0;\n const candidateAnchors = new Int32Array(numAnchors);\n for (let a = 0; a < numAnchors; a++) {\n if (hit[a] === 1) candidateAnchors[count++] = a;\n }\n if (count === 0) return emptyDecoded();\n\n const flatBoxes = new Float32Array(count * 4);\n const scoresArr = new Float32Array(count);\n const idxsArr = new Int32Array(count);\n for (let i = 0; i < count; i++) {\n const a = candidateAnchors[i] as number;\n const cx = data[a] as number;\n const cy = data[numAnchors + a] as number;\n const w = data[2 * numAnchors + a] as number;\n const h = data[3 * numAnchors + a] as number;\n const x1 = (cx - w / 2 - padLeft) / scale;\n const y1 = (cy - h / 2 - padTop) / scale;\n const x2 = (cx + w / 2 - padLeft) / scale;\n const y2 = (cy + h / 2 - padTop) / scale;\n flatBoxes[i * 4] = Math.max(0, Math.min(originalWidth, x1));\n flatBoxes[i * 4 + 1] = Math.max(0, Math.min(originalHeight, y1));\n flatBoxes[i * 4 + 2] = Math.max(0, Math.min(originalWidth, x2));\n flatBoxes[i * 4 + 3] = Math.max(0, Math.min(originalHeight, y2));\n let bestScore = -Infinity;\n let bestClass = 0;\n for (let c = 0, at = 4 * numAnchors + a; c < numClasses; c++, at += numAnchors) {\n const score = data[at] as number;\n if (score > bestScore) {\n bestScore = score;\n bestClass = c;\n }\n }\n scoresArr[i] = bestScore;\n idxsArr[i] = bestClass;\n }\n const kept = batchedNms(flatBoxes, scoresArr, idxsArr, iouThreshold);\n if (kept.length === 0) return emptyDecoded();\n\n const k = Math.min(kept.length, maxDetections);\n const anchorIndices = new Int32Array(k);\n const boxesXyxy = new Float32Array(k * 4);\n const classIds = new Int32Array(k);\n const confidences = new Float32Array(k);\n for (let i = 0; i < k; i++) {\n const j = kept[i] as number;\n anchorIndices[i] = candidateAnchors[j] as number;\n boxesXyxy[i * 4] = flatBoxes[j * 4] as number;\n boxesXyxy[i * 4 + 1] = flatBoxes[j * 4 + 1] as number;\n boxesXyxy[i * 4 + 2] = flatBoxes[j * 4 + 2] as number;\n boxesXyxy[i * 4 + 3] = flatBoxes[j * 4 + 3] as number;\n classIds[i] = idxsArr[j] as number;\n confidences[i] = scoresArr[j] as number;\n }\n return { anchorIndices, boxesXyxy, classIds, confidences };\n}\n\nfunction emptyDecoded(): DecodedAnchors {\n return {\n anchorIndices: new Int32Array(0),\n boxesXyxy: new Float32Array(0),\n classIds: new Int32Array(0),\n confidences: new Float32Array(0),\n };\n}\n\nexport interface DecodeYoloOptions {\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedDetection {\n readonly bbox: BoundingBox;\n readonly classId: number;\n readonly confidence: number;\n}\n\n/**\n * Decode an anchor-free YOLO detection output into a list of detections.\n *\n * Works for **YOLOv8 / v9 / v10 / v11 / v12** detect heads.\n *\n * Expected raw shape: `[1, 4 + numClasses, N]`. `numClasses` is inferred\n * from the channel count.\n */\nexport function decodeYolo(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n const channels = outputDims.length === 3 ? outputDims[1] : outputDims[0];\n if (channels === undefined || channels < 5) {\n throw new Error(`decodeYolo: invalid output channel count ${channels} (expected >= 5).`);\n }\n const numClasses = channels - 4;\n\n const decoded = decodeYoloAnchors(output, outputDims, {\n numClasses,\n ...options,\n });\n\n const results: DecodedDetection[] = [];\n for (let i = 0; i < decoded.classIds.length; i++) {\n results.push({\n bbox: new BoundingBox(\n decoded.boxesXyxy[i * 4] as number,\n decoded.boxesXyxy[i * 4 + 1] as number,\n decoded.boxesXyxy[i * 4 + 2] as number,\n decoded.boxesXyxy[i * 4 + 3] as number,\n ),\n classId: decoded.classIds[i] as number,\n confidence: decoded.confidences[i] as number,\n });\n }\n return results;\n}\n"],"mappings":"A,gCAsCA,SAAgBE,EAAI,EAAqB,EAAsB,EAAkC,CAC7F,IAAMC,EAAIC,EAAO,OACjB,GAAID,IAAM,EAAG,OAAO,IAAI,WAExB,IAAME,EAAY,MAAcF,CAAC,EACjC,I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U7E,EAAI,EAAI,GAC1B6E,EAAQ,UAAU7E,EAAI,EAAI,EAC9B,EACA,QAAS6E,EAAQ,SAAS7E,GAC1B,WAAY6E,EAAQ,YAAY7E,EACpC,CAAC,EAEL,OAAO+E,CACX,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"detection.js","names":[],"sources":["../../../src/vision/postprocess/detection.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Detection head postprocessing: anchor-free YOLO decoding + non-maximum suppression.\n *\n * The shared {@link decodeYoloAnchors} helper does the per-anchor work that\n * is identical for plain detection and segmentation (transpose, xywh→xyxy,\n * letterbox unmap, per-class NMS, sort & cap). {@link decodeYolo} is a thin\n * wrapper around it; the segmentation module ({@link ./segmentation.js})\n * calls the helper directly so it can also recover the per-anchor mask\n * coefficients.\n *\n * Works for any YOLO export with the post-v8 anchor-free head:\n * **YOLOv8 / v9 / v10 / v11 / v12** detect heads, all of which share the\n * `[1, 4 + nc, N]` output layout.\n */\n\nimport { BoundingBox } from \"../types\";\n\n/**\n * Greedy non-maximum suppression on axis-aligned bounding boxes.\n *\n * Mirrors `torchvision.ops.nms` (keeps boxes with the highest score, drops\n * any subsequent box whose IoU exceeds the threshold).\n *\n * @param boxes Flat array of length `4 * N` in xyxy order: `[x1,y1,x2,y2, ...]`.\n * @param scores Detection score per box, length `N`.\n * @param iouThreshold Boxes with IoU above this threshold relative to a kept box are suppressed.\n * @returns Indices of kept boxes, in descending score order. Boxes tied on\n * score are visited lowest-index first, so the survivor of a tie is\n * deterministic and matches both `torchvision` and the Python SDK.\n *\n * The boxes are copied once into score order, so the inner loop walks a\n * contiguous `Float32Array` instead of hopping through `order` into the caller's\n * layout. A pair with no horizontal overlap is skipped before the vertical\n * extent is computed: its IoU is `0`, which suppresses nothing for any\n * non-negative threshold — the shortcut is gated on that so a negative\n * threshold keeps the exact semantics.\n */\nexport function nms(boxes: Float32Array, scores: Float32Array, iouThreshold: number): Int32Array {\n const n = scores.length;\n if (n === 0) return new Int32Array(0);\n\n const order = new Array<number>(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n\n const sorted = new Float32Array(n * 4);\n const areas = new Float32Array(n);\n for (let k = 0; k < n; k++) {\n const i = (order[k] as number) * 4;\n const x1 = boxes[i] as number;\n const y1 = boxes[i + 1] as number;\n const x2 = boxes[i + 2] as number;\n const y2 = boxes[i + 3] as number;\n sorted[k * 4] = x1;\n sorted[k * 4 + 1] = y1;\n sorted[k * 4 + 2] = x2;\n sorted[k * 4 + 3] = y2;\n areas[k] = Math.max(0, x2 - x1) * Math.max(0, y2 - y1);\n }\n\n const skipDisjoint = iouThreshold >= 0;\n const suppressed = new Uint8Array(n);\n const keep: number[] = [];\n\n for (let k = 0; k < n; k++) {\n if (suppressed[k]) continue;\n keep.push(order[k] as number);\n\n const ax1 = sorted[k * 4] as number;\n const ay1 = sorted[k * 4 + 1] as number;\n const ax2 = sorted[k * 4 + 2] as number;\n const ay2 = sorted[k * 4 + 3] as number;\n const ak = areas[k] as number;\n\n for (let m = k + 1; m < n; m++) {\n if (suppressed[m]) continue;\n const bx1 = sorted[m * 4] as number;\n const by1 = sorted[m * 4 + 1] as number;\n const bx2 = sorted[m * 4 + 2] as number;\n const by2 = sorted[m * 4 + 3] as number;\n const iw = Math.max(0, Math.min(ax2, bx2) - Math.max(ax1, bx1));\n if (iw === 0 && skipDisjoint) continue;\n const ih = Math.max(0, Math.min(ay2, by2) - Math.max(ay1, by1));\n const inter = iw * ih;\n const union = ak + (areas[m] as number) - inter;\n const iou = union > 0 ? inter / union : 0;\n if (iou > iouThreshold) suppressed[m] = 1;\n }\n }\n\n return Int32Array.from(keep);\n}\n\n/**\n * Per-class NMS — boxes are suppressed only by other boxes of the same class.\n *\n * Mirrors `torchvision.ops.batched_nms`.\n *\n * @param boxes Flat array of length `4 * N` in xyxy order.\n * @param scores Detection score per box, length `N`.\n * @param idxs Class index per box, length `N`. Boxes with different `idxs`\n * never suppress each other.\n * @param iouThreshold IoU threshold for suppression within a class.\n * @returns Indices of kept boxes, sorted by descending score across all\n * classes. Survivors from different classes that are tied on score are\n * ordered lowest-index first — an explicit tie-break, because the order the\n * per-class loop emits them in is an implementation detail (here, `Map`\n * insertion order; in Python, sorted class order).\n */\nexport function batchedNms(\n boxes: Float32Array,\n scores: Float32Array,\n idxs: Int32Array,\n iouThreshold: number,\n): Int32Array {\n if (scores.length === 0) return new Int32Array(0);\n\n const byClass = new Map<number, number[]>();\n for (let i = 0; i < idxs.length; i++) {\n const c = idxs[i] as number;\n const list = byClass.get(c);\n if (list === undefined) byClass.set(c, [i]);\n else list.push(i);\n }\n\n const keep: number[] = [];\n for (const indices of byClass.values()) {\n const m = indices.length;\n const subBoxes = new Float32Array(m * 4);\n const subScores = new Float32Array(m);\n for (let k = 0; k < m; k++) {\n const i = indices[k] as number;\n subBoxes[k * 4] = boxes[i * 4] as number;\n subBoxes[k * 4 + 1] = boxes[i * 4 + 1] as number;\n subBoxes[k * 4 + 2] = boxes[i * 4 + 2] as number;\n subBoxes[k * 4 + 3] = boxes[i * 4 + 3] as number;\n subScores[k] = scores[i] as number;\n }\n const subKeep = nms(subBoxes, subScores, iouThreshold);\n for (let k = 0; k < subKeep.length; k++) {\n keep.push(indices[subKeep[k] as number] as number);\n }\n }\n\n keep.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n return Int32Array.from(keep);\n}\n\nexport interface DecodeYoloAnchorsOptions {\n /** Number of class-score channels following the 4 box channels. */\n readonly numClasses: number;\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedAnchors {\n /** Indices into the original `numAnchors` axis, in descending confidence order. */\n readonly anchorIndices: Int32Array;\n /** `[k, 4]` boxes in original-image pixel coords, flat row-major xyxy. */\n readonly boxesXyxy: Float32Array;\n /** Predicted class id per survivor. */\n readonly classIds: Int32Array;\n /** Confidence per survivor. */\n readonly confidences: Float32Array;\n}\n\n/**\n * Shared YOLO per-anchor decode used by both detection and segmentation\n * (v8 / v9 / v10 / v11 / v12).\n *\n * Only the first `4 + numClasses` channels are read; later channels (e.g.\n * mask coefficients) are ignored — callers can fetch them via the returned\n * {@link DecodedAnchors.anchorIndices}.\n *\n * Candidates are found in two passes, mirroring the Python decoder. The first\n * walks each class row contiguously and only *marks* anchors holding some score\n * at or above the threshold — an anchor's best score clears the threshold\n * exactly when one of its scores does, so no running maximum is needed and the\n * hot loop never writes on a typical frame. The anchor-major scan it replaces\n * read `numClasses` values spaced `numAnchors` apart for every one of the 8400\n * anchors and cost ~1 ms even on a frame with no candidates. The winning class\n * is then picked only for the marked anchors — a few hundred, not 8400 — with\n * the same strict `>` that keeps the lowest class id on a tie.\n *\n * @param data Flat per-anchor output, length `channels * numAnchors`.\n * @param dims Dims as reported by ORT, e.g. `[1, 84, 8400]` (det) or\n * `[1, 116, 8400]` (seg). The leading batch dim must be 1.\n */\nexport function decodeYoloAnchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n let normalized = dims;\n if (normalized.length === 3) {\n if (normalized[0] !== 1) {\n throw new Error(`decodeYoloAnchors: expected batch size 1, got ${normalized[0]}.`);\n }\n normalized = [normalized[1] as number, normalized[2] as number];\n }\n if (normalized.length !== 2) {\n throw new Error(\n `decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(dims)}.`,\n );\n }\n const channels = normalized[0] as number;\n const numAnchors = normalized[1] as number;\n\n const {\n numClasses,\n originalWidth,\n originalHeight,\n padLeft,\n padTop,\n scale,\n confThreshold,\n iouThreshold,\n maxDetections,\n } = options;\n\n if (numClasses < 1 || numClasses + 4 > channels) {\n throw new Error(\n `decodeYoloAnchors: invalid numClasses=${numClasses} for channels=${channels}.`,\n );\n }\n if (data.length !== channels * numAnchors) {\n throw new Error(\n `decodeYoloAnchors: data length ${data.length} does not match channels*numAnchors=${channels * numAnchors}.`,\n );\n }\n\n const hit = new Uint8Array(numAnchors);\n const classEnd = (4 + numClasses) * numAnchors;\n for (let row = 4 * numAnchors; row < classEnd; row += numAnchors) {\n for (let a = 0; a < numAnchors; a++) {\n if ((data[row + a] as number) >= confThreshold) hit[a] = 1;\n }\n }\n\n let count = 0;\n const candidateAnchors = new Int32Array(numAnchors);\n for (let a = 0; a < numAnchors; a++) {\n if (hit[a] === 1) candidateAnchors[count++] = a;\n }\n if (count === 0) return emptyDecoded();\n\n const flatBoxes = new Float32Array(count * 4);\n const scoresArr = new Float32Array(count);\n const idxsArr = new Int32Array(count);\n for (let i = 0; i < count; i++) {\n const a = candidateAnchors[i] as number;\n const cx = data[a] as number;\n const cy = data[numAnchors + a] as number;\n const w = data[2 * numAnchors + a] as number;\n const h = data[3 * numAnchors + a] as number;\n const x1 = (cx - w / 2 - padLeft) / scale;\n const y1 = (cy - h / 2 - padTop) / scale;\n const x2 = (cx + w / 2 - padLeft) / scale;\n const y2 = (cy + h / 2 - padTop) / scale;\n flatBoxes[i * 4] = Math.max(0, Math.min(originalWidth, x1));\n flatBoxes[i * 4 + 1] = Math.max(0, Math.min(originalHeight, y1));\n flatBoxes[i * 4 + 2] = Math.max(0, Math.min(originalWidth, x2));\n flatBoxes[i * 4 + 3] = Math.max(0, Math.min(originalHeight, y2));\n let bestScore = -Infinity;\n let bestClass = 0;\n for (let c = 0, at = 4 * numAnchors + a; c < numClasses; c++, at += numAnchors) {\n const score = data[at] as number;\n if (score > bestScore) {\n bestScore = score;\n bestClass = c;\n }\n }\n scoresArr[i] = bestScore;\n idxsArr[i] = bestClass;\n }\n const kept = batchedNms(flatBoxes, scoresArr, idxsArr, iouThreshold);\n if (kept.length === 0) return emptyDecoded();\n\n const k = Math.min(kept.length, maxDetections);\n const anchorIndices = new Int32Array(k);\n const boxesXyxy = new Float32Array(k * 4);\n const classIds = new Int32Array(k);\n const confidences = new Float32Array(k);\n for (let i = 0; i < k; i++) {\n const j = kept[i] as number;\n anchorIndices[i] = candidateAnchors[j] as number;\n boxesXyxy[i * 4] = flatBoxes[j * 4] as number;\n boxesXyxy[i * 4 + 1] = flatBoxes[j * 4 + 1] as number;\n boxesXyxy[i * 4 + 2] = flatBoxes[j * 4 + 2] as number;\n boxesXyxy[i * 4 + 3] = flatBoxes[j * 4 + 3] as number;\n classIds[i] = idxsArr[j] as number;\n confidences[i] = scoresArr[j] as number;\n }\n return { anchorIndices, boxesXyxy, classIds, confidences };\n}\n\nfunction emptyDecoded(): DecodedAnchors {\n return {\n anchorIndices: new Int32Array(0),\n boxesXyxy: new Float32Array(0),\n classIds: new Int32Array(0),\n confidences: new Float32Array(0),\n };\n}\n\nexport interface DecodeYoloOptions {\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedDetection {\n readonly bbox: BoundingBox;\n readonly classId: number;\n readonly confidence: number;\n}\n\n/**\n * Decode an anchor-free YOLO detection output into a list of detections.\n *\n * Works for **YOLOv8 / v9 / v10 / v11 / v12** detect heads.\n *\n * Expected raw shape: `[1, 4 + numClasses, N]`. `numClasses` is inferred\n * from the channel count.\n */\nexport function decodeYolo(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n const channels = outputDims.length === 3 ? outputDims[1] : outputDims[0];\n if (channels === undefined || channels < 5) {\n throw new Error(`decodeYolo: invalid output channel count ${channels} (expected >= 5).`);\n }\n const numClasses = channels - 4;\n\n const decoded = decodeYoloAnchors(output, outputDims, {\n numClasses,\n ...options,\n });\n\n const results: DecodedDetection[] = [];\n for (let i = 0; i < decoded.classIds.length; i++) {\n results.push({\n bbox: new BoundingBox(\n decoded.boxesXyxy[i * 4] as number,\n decoded.boxesXyxy[i * 4 + 1] as number,\n decoded.boxesXyxy[i * 4 + 2] as number,\n decoded.boxesXyxy[i * 4 + 3] as number,\n ),\n classId: decoded.classIds[i] as number,\n confidence: decoded.confidences[i] as number,\n });\n }\n return results;\n}\n"],"mappings":";;AAsCA,SAAgB,EAAI,GAAqB,GAAsB,GAAkC;CAC7F,IAAM,IAAI,EAAO;CACjB,IAAI,MAAM,GAAG,uBAAO,IAAI,WAAY;CAEpC,IAAM,IAAY,MAAc,CAAC;CACjC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK,EAAM,KAAK;CACvC,EAAM,MAAM,GAAG,MAAO,EAAO,KAAiB,EAAO,MAAiB,IAAI,CAAC;CAE3E,IAAM,IAAS,IAAI,aAAa,IAAI,CAAC,GAC/B,IAAQ,IAAI,aAAa,CAAC;CAChC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EACxB,IAAM,IAAK,EAAM,KAAgB,GAC3B,IAAK,EAAM,IACX,IAAK,EAAM,IAAI,IACf,IAAK,EAAM,IAAI,IACf,IAAK,EAAM,IAAI;EAKrB,AAJA,EAAO,IAAI,KAAK,GAChB,EAAO,IAAI,IAAI,KAAK,GACpB,EAAO,IAAI,IAAI,KAAK,GACpB,EAAO,IAAI,IAAI,KAAK,GACpB,EAAM,KAAK,KAAK,IAAI,GAAG,IAAK,CAAE,IAAI,KAAK,IAAI,GAAG,IAAK,CAAE;CACzD;CAEA,IAAM,IAAe,KAAgB,GAC/B,IAAa,IAAI,WAAW,CAAC,GAC7B,IAAiB,CAAC;CAExB,KAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;EACxB,IAAI,EAAW,IAAI;EACnB,EAAK,KAAK,EAAM,EAAY;EAE5B,IAAM,IAAM,EAAO,IAAI,IACjB,IAAM,EAAO,IAAI,IAAI,IACrB,IAAM,EAAO,IAAI,IAAI,IACrB,IAAM,EAAO,IAAI,IAAI,IACrB,IAAK,EAAM;EAEjB,KAAK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n","scores","order","i","b","a","sorted","areas","k","x1","boxes","y1","x2","y2","skipDisjoint","iouThreshold","suppressed","keep","ax1","ay1","ax2","ay2","ak","m","bx1","by1","bx2","by2","iw","inter","union","batchedNms","byClass","idxs","c","list","indices","subBoxes","subScores","subKeep","decodeYoloAnchors","normalized","dims","channels","numAnchors","options","numClasses","data","hit","classEnd","row","confThreshold","count","candidateAnchors","emptyDecoded","flatBoxes","scoresArr","idxsArr","cx","cy","w","h","padLeft","scale","padTop","originalWidth","originalHeight","bestScore","bestClass","at","score","kept","maxDetections","anchorIndices","boxesXyxy","classIds","confidences","j","decodeYolo","outputDims","decoded","output","results","BoundingBox"],"sources":["../../../src/vision/postprocess/detection.ts"],"sourcesContent":["/** @generated Vendored from @mauriciobenjamin700/ort-vision-sdk-web. Do not hand-edit — regenerate with `npm run vendor:vision`. */\n/**\n * Detection head postprocessing: anchor-free YOLO decoding + non-maximum suppression.\n *\n * The shared {@link decodeYoloAnchors} helper does the per-anchor work that\n * is identical for plain detection and segmentation (transpose, xywh→xyxy,\n * letterbox unmap, per-class NMS, sort & cap). {@link decodeYolo} is a thin\n * wrapper around it; the segmentation module ({@link ./segmentation.js})\n * calls the helper directly so it can also recover the per-anchor mask\n * coefficients.\n *\n * Works for any YOLO export with the post-v8 anchor-free head:\n * **YOLOv8 / v9 / v10 / v11 / v12** detect heads, all of which share the\n * `[1, 4 + nc, N]` output layout.\n */\n\nimport { BoundingBox } from \"../types\";\n\n/**\n * Greedy non-maximum suppression on axis-aligned bounding boxes.\n *\n * Mirrors `torchvision.ops.nms` (keeps boxes with the highest score, drops\n * any subsequent box whose IoU exceeds the threshold).\n *\n * @param boxes Flat array of length `4 * N` in xyxy order: `[x1,y1,x2,y2, ...]`.\n * @param scores Detection score per box, length `N`.\n * @param iouThreshold Boxes with IoU above this threshold relative to a kept box are suppressed.\n * @returns Indices of kept boxes, in descending score order. Boxes tied on\n * score are visited lowest-index first, so the survivor of a tie is\n * deterministic and matches both `torchvision` and the Python SDK.\n *\n * The boxes are copied once into score order, so the inner loop walks a\n * contiguous `Float32Array` instead of hopping through `order` into the caller's\n * layout. A pair with no horizontal overlap is skipped before the vertical\n * extent is computed: its IoU is `0`, which suppresses nothing for any\n * non-negative threshold — the shortcut is gated on that so a negative\n * threshold keeps the exact semantics.\n */\nexport function nms(boxes: Float32Array, scores: Float32Array, iouThreshold: number): Int32Array {\n const n = scores.length;\n if (n === 0) return new Int32Array(0);\n\n const order = new Array<number>(n);\n for (let i = 0; i < n; i++) order[i] = i;\n order.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n\n const sorted = new Float32Array(n * 4);\n const areas = new Float32Array(n);\n for (let k = 0; k < n; k++) {\n const i = (order[k] as number) * 4;\n const x1 = boxes[i] as number;\n const y1 = boxes[i + 1] as number;\n const x2 = boxes[i + 2] as number;\n const y2 = boxes[i + 3] as number;\n sorted[k * 4] = x1;\n sorted[k * 4 + 1] = y1;\n sorted[k * 4 + 2] = x2;\n sorted[k * 4 + 3] = y2;\n areas[k] = Math.max(0, x2 - x1) * Math.max(0, y2 - y1);\n }\n\n const skipDisjoint = iouThreshold >= 0;\n const suppressed = new Uint8Array(n);\n const keep: number[] = [];\n\n for (let k = 0; k < n; k++) {\n if (suppressed[k]) continue;\n keep.push(order[k] as number);\n\n const ax1 = sorted[k * 4] as number;\n const ay1 = sorted[k * 4 + 1] as number;\n const ax2 = sorted[k * 4 + 2] as number;\n const ay2 = sorted[k * 4 + 3] as number;\n const ak = areas[k] as number;\n\n for (let m = k + 1; m < n; m++) {\n if (suppressed[m]) continue;\n const bx1 = sorted[m * 4] as number;\n const by1 = sorted[m * 4 + 1] as number;\n const bx2 = sorted[m * 4 + 2] as number;\n const by2 = sorted[m * 4 + 3] as number;\n const iw = Math.max(0, Math.min(ax2, bx2) - Math.max(ax1, bx1));\n if (iw === 0 && skipDisjoint) continue;\n const ih = Math.max(0, Math.min(ay2, by2) - Math.max(ay1, by1));\n const inter = iw * ih;\n const union = ak + (areas[m] as number) - inter;\n const iou = union > 0 ? inter / union : 0;\n if (iou > iouThreshold) suppressed[m] = 1;\n }\n }\n\n return Int32Array.from(keep);\n}\n\n/**\n * Per-class NMS — boxes are suppressed only by other boxes of the same class.\n *\n * Mirrors `torchvision.ops.batched_nms`.\n *\n * @param boxes Flat array of length `4 * N` in xyxy order.\n * @param scores Detection score per box, length `N`.\n * @param idxs Class index per box, length `N`. Boxes with different `idxs`\n * never suppress each other.\n * @param iouThreshold IoU threshold for suppression within a class.\n * @returns Indices of kept boxes, sorted by descending score across all\n * classes. Survivors from different classes that are tied on score are\n * ordered lowest-index first — an explicit tie-break, because the order the\n * per-class loop emits them in is an implementation detail (here, `Map`\n * insertion order; in Python, sorted class order).\n */\nexport function batchedNms(\n boxes: Float32Array,\n scores: Float32Array,\n idxs: Int32Array,\n iouThreshold: number,\n): Int32Array {\n if (scores.length === 0) return new Int32Array(0);\n\n const byClass = new Map<number, number[]>();\n for (let i = 0; i < idxs.length; i++) {\n const c = idxs[i] as number;\n const list = byClass.get(c);\n if (list === undefined) byClass.set(c, [i]);\n else list.push(i);\n }\n\n const keep: number[] = [];\n for (const indices of byClass.values()) {\n const m = indices.length;\n const subBoxes = new Float32Array(m * 4);\n const subScores = new Float32Array(m);\n for (let k = 0; k < m; k++) {\n const i = indices[k] as number;\n subBoxes[k * 4] = boxes[i * 4] as number;\n subBoxes[k * 4 + 1] = boxes[i * 4 + 1] as number;\n subBoxes[k * 4 + 2] = boxes[i * 4 + 2] as number;\n subBoxes[k * 4 + 3] = boxes[i * 4 + 3] as number;\n subScores[k] = scores[i] as number;\n }\n const subKeep = nms(subBoxes, subScores, iouThreshold);\n for (let k = 0; k < subKeep.length; k++) {\n keep.push(indices[subKeep[k] as number] as number);\n }\n }\n\n keep.sort((a, b) => (scores[b] as number) - (scores[a] as number) || a - b);\n return Int32Array.from(keep);\n}\n\nexport interface DecodeYoloAnchorsOptions {\n /** Number of class-score channels following the 4 box channels. */\n readonly numClasses: number;\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedAnchors {\n /** Indices into the original `numAnchors` axis, in descending confidence order. */\n readonly anchorIndices: Int32Array;\n /** `[k, 4]` boxes in original-image pixel coords, flat row-major xyxy. */\n readonly boxesXyxy: Float32Array;\n /** Predicted class id per survivor. */\n readonly classIds: Int32Array;\n /** Confidence per survivor. */\n readonly confidences: Float32Array;\n}\n\n/**\n * Shared YOLO per-anchor decode used by both detection and segmentation\n * (v8 / v9 / v10 / v11 / v12).\n *\n * Only the first `4 + numClasses` channels are read; later channels (e.g.\n * mask coefficients) are ignored — callers can fetch them via the returned\n * {@link DecodedAnchors.anchorIndices}.\n *\n * Candidates are found in two passes, mirroring the Python decoder. The first\n * walks each class row contiguously and only *marks* anchors holding some score\n * at or above the threshold — an anchor's best score clears the threshold\n * exactly when one of its scores does, so no running maximum is needed and the\n * hot loop never writes on a typical frame. The anchor-major scan it replaces\n * read `numClasses` values spaced `numAnchors` apart for every one of the 8400\n * anchors and cost ~1 ms even on a frame with no candidates. The winning class\n * is then picked only for the marked anchors — a few hundred, not 8400 — with\n * the same strict `>` that keeps the lowest class id on a tie.\n *\n * @param data Flat per-anchor output, length `channels * numAnchors`.\n * @param dims Dims as reported by ORT, e.g. `[1, 84, 8400]` (det) or\n * `[1, 116, 8400]` (seg). The leading batch dim must be 1.\n */\nexport function decodeYoloAnchors(\n data: Float32Array,\n dims: readonly number[],\n options: DecodeYoloAnchorsOptions,\n): DecodedAnchors {\n let normalized = dims;\n if (normalized.length === 3) {\n if (normalized[0] !== 1) {\n throw new Error(`decodeYoloAnchors: expected batch size 1, got ${normalized[0]}.`);\n }\n normalized = [normalized[1] as number, normalized[2] as number];\n }\n if (normalized.length !== 2) {\n throw new Error(\n `decodeYoloAnchors: expected 2-D output after batch removal, got dims=${JSON.stringify(dims)}.`,\n );\n }\n const channels = normalized[0] as number;\n const numAnchors = normalized[1] as number;\n\n const {\n numClasses,\n originalWidth,\n originalHeight,\n padLeft,\n padTop,\n scale,\n confThreshold,\n iouThreshold,\n maxDetections,\n } = options;\n\n if (numClasses < 1 || numClasses + 4 > channels) {\n throw new Error(\n `decodeYoloAnchors: invalid numClasses=${numClasses} for channels=${channels}.`,\n );\n }\n if (data.length !== channels * numAnchors) {\n throw new Error(\n `decodeYoloAnchors: data length ${data.length} does not match channels*numAnchors=${channels * numAnchors}.`,\n );\n }\n\n const hit = new Uint8Array(numAnchors);\n const classEnd = (4 + numClasses) * numAnchors;\n for (let row = 4 * numAnchors; row < classEnd; row += numAnchors) {\n for (let a = 0; a < numAnchors; a++) {\n if ((data[row + a] as number) >= confThreshold) hit[a] = 1;\n }\n }\n\n let count = 0;\n const candidateAnchors = new Int32Array(numAnchors);\n for (let a = 0; a < numAnchors; a++) {\n if (hit[a] === 1) candidateAnchors[count++] = a;\n }\n if (count === 0) return emptyDecoded();\n\n const flatBoxes = new Float32Array(count * 4);\n const scoresArr = new Float32Array(count);\n const idxsArr = new Int32Array(count);\n for (let i = 0; i < count; i++) {\n const a = candidateAnchors[i] as number;\n const cx = data[a] as number;\n const cy = data[numAnchors + a] as number;\n const w = data[2 * numAnchors + a] as number;\n const h = data[3 * numAnchors + a] as number;\n const x1 = (cx - w / 2 - padLeft) / scale;\n const y1 = (cy - h / 2 - padTop) / scale;\n const x2 = (cx + w / 2 - padLeft) / scale;\n const y2 = (cy + h / 2 - padTop) / scale;\n flatBoxes[i * 4] = Math.max(0, Math.min(originalWidth, x1));\n flatBoxes[i * 4 + 1] = Math.max(0, Math.min(originalHeight, y1));\n flatBoxes[i * 4 + 2] = Math.max(0, Math.min(originalWidth, x2));\n flatBoxes[i * 4 + 3] = Math.max(0, Math.min(originalHeight, y2));\n let bestScore = -Infinity;\n let bestClass = 0;\n for (let c = 0, at = 4 * numAnchors + a; c < numClasses; c++, at += numAnchors) {\n const score = data[at] as number;\n if (score > bestScore) {\n bestScore = score;\n bestClass = c;\n }\n }\n scoresArr[i] = bestScore;\n idxsArr[i] = bestClass;\n }\n const kept = batchedNms(flatBoxes, scoresArr, idxsArr, iouThreshold);\n if (kept.length === 0) return emptyDecoded();\n\n const k = Math.min(kept.length, maxDetections);\n const anchorIndices = new Int32Array(k);\n const boxesXyxy = new Float32Array(k * 4);\n const classIds = new Int32Array(k);\n const confidences = new Float32Array(k);\n for (let i = 0; i < k; i++) {\n const j = kept[i] as number;\n anchorIndices[i] = candidateAnchors[j] as number;\n boxesXyxy[i * 4] = flatBoxes[j * 4] as number;\n boxesXyxy[i * 4 + 1] = flatBoxes[j * 4 + 1] as number;\n boxesXyxy[i * 4 + 2] = flatBoxes[j * 4 + 2] as number;\n boxesXyxy[i * 4 + 3] = flatBoxes[j * 4 + 3] as number;\n classIds[i] = idxsArr[j] as number;\n confidences[i] = scoresArr[j] as number;\n }\n return { anchorIndices, boxesXyxy, classIds, confidences };\n}\n\nfunction emptyDecoded(): DecodedAnchors {\n return {\n anchorIndices: new Int32Array(0),\n boxesXyxy: new Float32Array(0),\n classIds: new Int32Array(0),\n confidences: new Float32Array(0),\n };\n}\n\nexport interface DecodeYoloOptions {\n readonly originalWidth: number;\n readonly originalHeight: number;\n readonly padLeft: number;\n readonly padTop: number;\n readonly scale: number;\n readonly confThreshold: number;\n readonly iouThreshold: number;\n readonly maxDetections: number;\n}\n\nexport interface DecodedDetection {\n readonly bbox: BoundingBox;\n readonly classId: number;\n readonly confidence: number;\n}\n\n/**\n * Decode an anchor-free YOLO detection output into a list of detections.\n *\n * Works for **YOLOv8 / v9 / v10 / v11 / v12** detect heads.\n *\n * Expected raw shape: `[1, 4 + numClasses, N]`. `numClasses` is inferred\n * from the channel count.\n */\nexport function decodeYolo(\n output: Float32Array,\n outputDims: readonly number[],\n options: DecodeYoloOptions,\n): DecodedDetection[] {\n const channels = outputDims.length === 3 ? outputDims[1] : outputDims[0];\n if (channels === undefined || channels < 5) {\n throw new Error(`decodeYolo: invalid output channel count ${channels} (expected >= 5).`);\n }\n const numClasses = channels - 4;\n\n const decoded = decodeYoloAnchors(output, outputDims, {\n numClasses,\n ...options,\n });\n\n const results: DecodedDetection[] = [];\n for (let i = 0; i < decoded.classIds.length; i++) {\n results.push({\n bbox: new BoundingBox(\n decoded.boxesXyxy[i * 4] as number,\n decoded.boxesXyxy[i * 4 + 1] as number,\n decoded.boxesXyxy[i * 4 + 2] as number,\n decoded.boxesXyxy[i * 4 + 3] as number,\n ),\n classId: decoded.classIds[i] as number,\n confidence: decoded.confidences[i] as number,\n });\n }\n return results;\n}\n"],"mappings":";;AAsCA,SAAgBA,EAAI,GAAqB,GAAsB,GAAkC;CAC7F,IAAMC,IAAIC,EAAO;CACjB,IAAID,MAAM,GAAG,uBAAO,IAAI,WAAY;CAEpC,IAAME,IAAY,MAAcF,CAAC;CACjC,KAAK,IAAIG,IAAI,GAAGA,IAAIH,GAAG,KAAK,EAAMG,KAAKA;CACvC,EAAM,MAAM,GAAG,MAAOF,EAAOG,KAAiBH,EAAOI,MAAiBA,IAAID,CAAC;CAE3E,IAAME,IAAS,IAAI,aAAaN,IAAI,CAAC,GAC/BO,IAAQ,IAAI,aAAaP,CAAC;CAChC,KAAK,IAAIQ,IAAI,GAAGA,IAAIR,GAAG,KAAK;EACxB,IAAMG,IAAKD,EAAMM,KAAgB,GAC3BC,IAAKC,EAAMP,IACXQ,IAAKD,EAAMP,IAAI,IACfS,IAAKF,EAAMP,IAAI,IACfU,IAAKH,EAAMP,IAAI;EAKrB,AAJA,EAAOK,IAAI,KAAKC,GAChB,EAAOD,IAAI,IAAI,KAAKG,GACpB,EAAOH,IAAI,IAAI,KAAKI,GACpB,EAAOJ,IAAI,IAAI,KAAKK,GACpB,EAAML,KAAK,KAAK,IAAI,GAAGI,IAAKH,CAAE,IAAI,KAAK,IAAI,GAAGI,IAAKF,CAAE;CACzD;CAEA,IAAMG,IAAeC,KAAgB,GAC/BC,IAAa,IAAI,WAAWhB,CAAC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