@omerdlw/base-framework 3.4.0 → 3.4.1

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 (808) hide show
  1. package/README.md +56 -72
  2. package/dist/ambient/index.js +10 -10
  3. package/dist/ambient/server/index.js +3 -3
  4. package/dist/ambient/server/index.js.map +1 -1
  5. package/dist/ambient/worker/index.js +7 -4
  6. package/dist/ambient/worker/index.js.map +1 -1
  7. package/dist/background/index.js +9 -9
  8. package/dist/chunk-2E6OASVV.js +17 -0
  9. package/dist/{chunk-AZ2ZDFNP.js.map → chunk-2E6OASVV.js.map} +1 -1
  10. package/dist/{chunk-ESD5EQ5H.js → chunk-3JLG24KI.js} +11 -22
  11. package/dist/chunk-3JLG24KI.js.map +1 -0
  12. package/dist/{chunk-CRKJAACG.js → chunk-4QQ3QVY7.js} +10 -10
  13. package/dist/{chunk-CRKJAACG.js.map → chunk-4QQ3QVY7.js.map} +1 -1
  14. package/dist/{chunk-7VU2OAJB.js → chunk-6LWCTP2Y.js} +21 -37
  15. package/dist/chunk-6LWCTP2Y.js.map +1 -0
  16. package/dist/{chunk-YZS2B6YE.js → chunk-7A47AXKI.js} +9 -11
  17. package/dist/chunk-7A47AXKI.js.map +1 -0
  18. package/dist/{chunk-LKYW4LH6.js → chunk-BLWJZHRL.js} +36 -43
  19. package/dist/chunk-BLWJZHRL.js.map +1 -0
  20. package/dist/{chunk-ZXRE2KZO.js → chunk-C3SEBNF5.js} +11 -15
  21. package/dist/chunk-C3SEBNF5.js.map +1 -0
  22. package/dist/{chunk-KOYTJW5E.js → chunk-DC4XZPDK.js} +7 -7
  23. package/dist/chunk-DC4XZPDK.js.map +1 -0
  24. package/dist/{chunk-HFR6YROB.js → chunk-DGVRHX3C.js} +1160 -1171
  25. package/dist/chunk-DGVRHX3C.js.map +1 -0
  26. package/dist/{chunk-VNSMNGWP.js → chunk-DMQKXBWO.js} +5 -5
  27. package/dist/{chunk-VNSMNGWP.js.map → chunk-DMQKXBWO.js.map} +1 -1
  28. package/dist/{chunk-67MOKJFZ.js → chunk-E2QQJZYY.js} +16 -16
  29. package/dist/chunk-E2QQJZYY.js.map +1 -0
  30. package/dist/{chunk-WZ5T2NXH.js → chunk-EBNZXYLT.js} +17 -15
  31. package/dist/chunk-EBNZXYLT.js.map +1 -0
  32. package/dist/{chunk-IH3STE7W.js → chunk-ED32WLAD.js} +1168 -1215
  33. package/dist/chunk-ED32WLAD.js.map +1 -0
  34. package/dist/{chunk-RGC2VFQO.js → chunk-FLYL76ZT.js} +6 -6
  35. package/dist/{chunk-RGC2VFQO.js.map → chunk-FLYL76ZT.js.map} +1 -1
  36. package/dist/{chunk-UQLTP3XB.js → chunk-GTJMM32W.js} +144 -144
  37. package/dist/chunk-GTJMM32W.js.map +1 -0
  38. package/dist/{chunk-FFJWJ4OB.js → chunk-HPJWMBUS.js} +12333 -12368
  39. package/dist/chunk-HPJWMBUS.js.map +1 -0
  40. package/dist/{chunk-TAWTGCWJ.js → chunk-ICFPSAJZ.js} +7 -8
  41. package/dist/chunk-ICFPSAJZ.js.map +1 -0
  42. package/dist/{chunk-WQTMOUCA.js → chunk-JWUKAZ3A.js} +45 -67
  43. package/dist/chunk-JWUKAZ3A.js.map +1 -0
  44. package/dist/{chunk-QRXDXAQI.js → chunk-KN4KOTC7.js} +161 -165
  45. package/dist/chunk-KN4KOTC7.js.map +1 -0
  46. package/dist/{chunk-QGPRTUED.js → chunk-KRHH3UQ6.js} +34 -37
  47. package/dist/chunk-KRHH3UQ6.js.map +1 -0
  48. package/dist/{chunk-R4K6VAOK.js → chunk-M36DFIJ6.js} +11 -18
  49. package/dist/chunk-M36DFIJ6.js.map +1 -0
  50. package/dist/{chunk-UDJ7ARCH.js → chunk-S2ZOLTTS.js} +3 -3
  51. package/dist/{chunk-UDJ7ARCH.js.map → chunk-S2ZOLTTS.js.map} +1 -1
  52. package/dist/{chunk-D222OCTV.js → chunk-S67HGKJ2.js} +49 -55
  53. package/dist/chunk-S67HGKJ2.js.map +1 -0
  54. package/dist/chunk-ST7QOM4O.js +29 -0
  55. package/dist/chunk-ST7QOM4O.js.map +1 -0
  56. package/dist/{chunk-RDYYP36I.js → chunk-TMKA5ZHO.js} +7 -6
  57. package/dist/chunk-TMKA5ZHO.js.map +1 -0
  58. package/dist/{chunk-XGAYTDSI.js → chunk-UWX7GCNX.js} +23 -26
  59. package/dist/chunk-UWX7GCNX.js.map +1 -0
  60. package/dist/{chunk-6IP6YFQX.js → chunk-VMR7ZKIF.js} +21 -31
  61. package/dist/chunk-VMR7ZKIF.js.map +1 -0
  62. package/dist/{chunk-BMFHS3GV.js → chunk-YHWA7FXX.js} +22 -12
  63. package/dist/chunk-YHWA7FXX.js.map +1 -0
  64. package/dist/{chunk-GKAJ4EM2.js → chunk-ZQI4ZCVU.js} +83 -83
  65. package/dist/chunk-ZQI4ZCVU.js.map +1 -0
  66. package/dist/context-menu/index.js +16 -15
  67. package/dist/controls/index.js +7 -6
  68. package/dist/core/error/boundary.d.ts.map +1 -1
  69. package/dist/core/error/constants.d.ts +9 -0
  70. package/dist/core/error/constants.d.ts.map +1 -1
  71. package/dist/core/error/index.d.ts +2 -3
  72. package/dist/core/error/index.d.ts.map +1 -1
  73. package/dist/core/error/listener.d.ts.map +1 -1
  74. package/dist/core/error/reporter.d.ts +7 -6
  75. package/dist/core/error/reporter.d.ts.map +1 -1
  76. package/dist/core/error/utils.d.ts.map +1 -1
  77. package/dist/core/kernel/constants.d.ts +1 -1
  78. package/dist/core/kernel/constants.d.ts.map +1 -1
  79. package/dist/core/kernel/{compose.d.ts → host/compose.d.ts} +0 -4
  80. package/dist/core/kernel/host/compose.d.ts.map +1 -0
  81. package/dist/core/kernel/{installed.d.ts → host/installed.d.ts} +1 -1
  82. package/dist/core/kernel/host/installed.d.ts.map +1 -0
  83. package/dist/core/kernel/{module.d.ts → host/module.d.ts} +2 -5
  84. package/dist/core/kernel/host/module.d.ts.map +1 -0
  85. package/dist/core/kernel/{adapters.d.ts → host/registration.d.ts} +2 -2
  86. package/dist/core/kernel/host/registration.d.ts.map +1 -0
  87. package/dist/core/kernel/index.d.ts +12 -12
  88. package/dist/core/kernel/index.d.ts.map +1 -1
  89. package/dist/core/kernel/{page-controller.d.ts → page.d.ts} +2 -2
  90. package/dist/core/kernel/page.d.ts.map +1 -0
  91. package/dist/core/kernel/{handlers.d.ts → registry/apply.d.ts} +2 -2
  92. package/dist/core/kernel/registry/apply.d.ts.map +1 -0
  93. package/dist/core/kernel/{hooks.d.ts → registry/hooks.d.ts} +1 -1
  94. package/dist/core/kernel/registry/hooks.d.ts.map +1 -0
  95. package/dist/core/kernel/{operations.d.ts → registry/operations.d.ts} +2 -2
  96. package/dist/core/kernel/registry/operations.d.ts.map +1 -0
  97. package/dist/core/kernel/{provider.d.ts → registry/provider.d.ts} +2 -2
  98. package/dist/core/kernel/registry/provider.d.ts.map +1 -0
  99. package/dist/core/kernel/{operations-records.d.ts → registry/records.d.ts} +2 -2
  100. package/dist/core/kernel/registry/records.d.ts.map +1 -0
  101. package/dist/core/kernel/registry/registration.d.ts +13 -0
  102. package/dist/core/kernel/registry/registration.d.ts.map +1 -0
  103. package/dist/core/kernel/{schema.d.ts → registry/schema.d.ts} +1 -1
  104. package/dist/core/kernel/registry/schema.d.ts.map +1 -0
  105. package/dist/core/kernel/{store-snapshots.d.ts → registry/snapshots.d.ts} +3 -3
  106. package/dist/core/kernel/registry/snapshots.d.ts.map +1 -0
  107. package/dist/core/kernel/{stabilize.d.ts → registry/stabilize.d.ts} +1 -1
  108. package/dist/core/kernel/registry/stabilize.d.ts.map +1 -0
  109. package/dist/core/kernel/{store.d.ts → registry/store.d.ts} +2 -2
  110. package/dist/core/kernel/registry/store.d.ts.map +1 -0
  111. package/dist/core/kernel/{store-subscriptions.d.ts → registry/subscriptions.d.ts} +2 -6
  112. package/dist/core/kernel/registry/subscriptions.d.ts.map +1 -0
  113. package/dist/core/kernel/{runtime.d.ts → registry/transaction.d.ts} +2 -2
  114. package/dist/core/kernel/registry/transaction.d.ts.map +1 -0
  115. package/dist/core/kernel/{types-modules.d.ts → types/modules.d.ts} +4 -4
  116. package/dist/core/kernel/types/modules.d.ts.map +1 -0
  117. package/dist/core/kernel/{types-page.d.ts → types/page.d.ts} +3 -3
  118. package/dist/core/kernel/types/page.d.ts.map +1 -0
  119. package/dist/core/kernel/{types.d.ts → types/registry.d.ts} +4 -4
  120. package/dist/core/kernel/types/registry.d.ts.map +1 -0
  121. package/dist/core/kernel/{types-store.d.ts → types/store.d.ts} +3 -3
  122. package/dist/core/kernel/types/store.d.ts.map +1 -0
  123. package/dist/core/kernel/utils.d.ts +1 -1
  124. package/dist/core/kernel/utils.d.ts.map +1 -1
  125. package/dist/core/navigation/{navigator-holds.d.ts → holds.d.ts} +2 -1
  126. package/dist/core/navigation/holds.d.ts.map +1 -0
  127. package/dist/core/navigation/navigator.d.ts.map +1 -1
  128. package/dist/core/navigation/{navigator-patience.d.ts → patience.d.ts} +1 -1
  129. package/dist/core/navigation/patience.d.ts.map +1 -0
  130. package/dist/core/navigation/{navigator-payload.d.ts → payload.d.ts} +2 -1
  131. package/dist/core/navigation/payload.d.ts.map +1 -0
  132. package/dist/core/navigation/{navigator-prefetch.d.ts → prefetch.d.ts} +2 -1
  133. package/dist/core/navigation/prefetch.d.ts.map +1 -0
  134. package/dist/core/navigation/settings.d.ts.map +1 -1
  135. package/dist/core/navigation/state.d.ts.map +1 -1
  136. package/dist/core/navigation/utils.d.ts +3 -0
  137. package/dist/core/navigation/utils.d.ts.map +1 -1
  138. package/dist/core/provider/index.d.ts +1 -1
  139. package/dist/core/provider/index.d.ts.map +1 -1
  140. package/dist/dock/index.js +15 -14
  141. package/dist/error/index.js +7 -7
  142. package/dist/events/index.js +24 -20
  143. package/dist/events/index.js.map +1 -1
  144. package/dist/foundation/events/index.d.ts.map +1 -1
  145. package/dist/foundation/recipes/recipe.d.ts.map +1 -1
  146. package/dist/foundation/result/index.d.ts.map +1 -1
  147. package/dist/foundation/utils/collections.d.ts +11 -0
  148. package/dist/foundation/utils/collections.d.ts.map +1 -0
  149. package/dist/foundation/utils/dom.d.ts.map +1 -1
  150. package/dist/foundation/utils/report.d.ts.map +1 -1
  151. package/dist/foundation/utils/scheduler.d.ts.map +1 -1
  152. package/dist/foundation/utils/store.d.ts.map +1 -1
  153. package/dist/foundation/utils/string.d.ts.map +1 -1
  154. package/dist/foundation/utils/tempo.d.ts.map +1 -1
  155. package/dist/foundation/utils/timing.d.ts.map +1 -1
  156. package/dist/foundation/utils/user-message.d.ts.map +1 -1
  157. package/dist/hooks/index.js +3 -3
  158. package/dist/index.js +25 -24
  159. package/dist/kernel/index.js +4 -4
  160. package/dist/loading/index.js +8 -8
  161. package/dist/media/index.js +5 -5
  162. package/dist/modal/index.js +155 -166
  163. package/dist/modal/index.js.map +1 -1
  164. package/dist/modules/ambient/{analyze.d.ts → analysis/analyze.d.ts} +3 -3
  165. package/dist/modules/ambient/analysis/analyze.d.ts.map +1 -0
  166. package/dist/modules/ambient/{analyze-bounds.d.ts → analysis/bounds.d.ts} +2 -2
  167. package/dist/modules/ambient/analysis/bounds.d.ts.map +1 -0
  168. package/dist/modules/ambient/{analyze-clusters.d.ts → analysis/clusters.d.ts} +3 -3
  169. package/dist/modules/ambient/analysis/clusters.d.ts.map +1 -0
  170. package/dist/modules/ambient/{analyze-ground.d.ts → analysis/ground.d.ts} +3 -3
  171. package/dist/modules/ambient/analysis/ground.d.ts.map +1 -0
  172. package/dist/modules/ambient/{analyze-measures.d.ts → analysis/measures.d.ts} +2 -2
  173. package/dist/modules/ambient/analysis/measures.d.ts.map +1 -0
  174. package/dist/modules/ambient/{oklab.d.ts → analysis/oklab.d.ts} +1 -3
  175. package/dist/modules/ambient/analysis/oklab.d.ts.map +1 -0
  176. package/dist/modules/ambient/analysis/quantize.d.ts.map +1 -0
  177. package/dist/modules/ambient/{analyze-swatches.d.ts → analysis/swatches.d.ts} +3 -3
  178. package/dist/modules/ambient/analysis/swatches.d.ts.map +1 -0
  179. package/dist/modules/ambient/hooks.d.ts +0 -1
  180. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  181. package/dist/modules/ambient/index.d.ts +2 -2
  182. package/dist/modules/ambient/index.d.ts.map +1 -1
  183. package/dist/modules/ambient/module.d.ts +0 -3
  184. package/dist/modules/ambient/module.d.ts.map +1 -1
  185. package/dist/modules/ambient/pipeline.d.ts +6 -5
  186. package/dist/modules/ambient/pipeline.d.ts.map +1 -1
  187. package/dist/modules/ambient/server/index.d.ts +2 -2
  188. package/dist/modules/ambient/server/index.d.ts.map +1 -1
  189. package/dist/modules/ambient/settings.d.ts +0 -2
  190. package/dist/modules/ambient/settings.d.ts.map +1 -1
  191. package/dist/modules/ambient/worker/index.d.ts.map +1 -1
  192. package/dist/modules/background/constants.d.ts +3 -1
  193. package/dist/modules/background/constants.d.ts.map +1 -1
  194. package/dist/modules/background/context.d.ts +1 -1
  195. package/dist/modules/background/context.d.ts.map +1 -1
  196. package/dist/modules/background/hooks.d.ts +929 -0
  197. package/dist/modules/background/hooks.d.ts.map +1 -1
  198. package/dist/modules/background/index.d.ts +6 -6
  199. package/dist/modules/background/index.d.ts.map +1 -1
  200. package/dist/modules/background/module.d.ts +1 -1
  201. package/dist/modules/background/module.d.ts.map +1 -1
  202. package/dist/modules/background/{hooks/use-native-video-model.d.ts → native-video.d.ts} +4 -8
  203. package/dist/modules/background/native-video.d.ts.map +1 -0
  204. package/dist/modules/background/overlay.d.ts.map +1 -0
  205. package/dist/modules/background/playback.d.ts.map +1 -0
  206. package/dist/modules/background/{model/state.d.ts → state.d.ts} +11 -1
  207. package/dist/modules/background/state.d.ts.map +1 -0
  208. package/dist/modules/background/{model/visual.d.ts → visual.d.ts} +43 -6
  209. package/dist/modules/background/visual.d.ts.map +1 -0
  210. package/dist/modules/background/youtube/audio.d.ts.map +1 -0
  211. package/dist/modules/background/youtube/iframe.d.ts +92 -0
  212. package/dist/modules/background/youtube/iframe.d.ts.map +1 -0
  213. package/dist/modules/background/youtube/{lib/parse.d.ts → parse.d.ts} +1 -1
  214. package/dist/modules/background/youtube/parse.d.ts.map +1 -0
  215. package/dist/modules/background/youtube/{components/player.d.ts → player.d.ts} +1 -1
  216. package/dist/modules/background/youtube/player.d.ts.map +1 -0
  217. package/dist/modules/background/youtube/{lib/timing.d.ts → timing.d.ts} +0 -2
  218. package/dist/modules/background/youtube/timing.d.ts.map +1 -0
  219. package/dist/modules/background/youtube/use-iframe-player.d.ts +37 -0
  220. package/dist/modules/background/youtube/use-iframe-player.d.ts.map +1 -0
  221. package/dist/modules/background/youtube/{hooks/use-youtube-background-player-model.d.ts → use-player.d.ts} +2 -2
  222. package/dist/modules/background/youtube/use-player.d.ts.map +1 -0
  223. package/dist/modules/background/youtube/{hooks/use-youtube-video-sync.d.ts → use-video-sync.d.ts} +8 -4
  224. package/dist/modules/background/youtube/use-video-sync.d.ts.map +1 -0
  225. package/dist/modules/background/youtube/{lib/video-events.d.ts → video-events.d.ts} +8 -8
  226. package/dist/modules/background/youtube/video-events.d.ts.map +1 -0
  227. package/dist/modules/context-menu/dom.d.ts.map +1 -1
  228. package/dist/modules/context-menu/items.d.ts.map +1 -1
  229. package/dist/modules/context-menu/overlay.d.ts +3 -10
  230. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  231. package/dist/modules/context-menu/resolver.d.ts.map +1 -1
  232. package/dist/modules/controls/overlay.d.ts +0 -10
  233. package/dist/modules/controls/overlay.d.ts.map +1 -1
  234. package/dist/modules/dock/{lib → card}/banner.d.ts +3 -16
  235. package/dist/modules/dock/card/banner.d.ts.map +1 -0
  236. package/dist/modules/dock/{components/card-item.d.ts → card/card.d.ts} +5 -2
  237. package/dist/modules/dock/card/card.d.ts.map +1 -0
  238. package/dist/modules/dock/card/compact.d.ts.map +1 -0
  239. package/dist/modules/dock/{components/item-content.d.ts → card/content.d.ts} +1 -1
  240. package/dist/modules/dock/card/content.d.ts.map +1 -0
  241. package/dist/modules/dock/card/header.d.ts +8 -0
  242. package/dist/modules/dock/card/header.d.ts.map +1 -0
  243. package/dist/modules/dock/{components → card}/icon.d.ts +1 -1
  244. package/dist/modules/dock/card/icon.d.ts.map +1 -0
  245. package/dist/modules/dock/{lib/card-item.d.ts → card/model.d.ts} +20 -2
  246. package/dist/modules/dock/card/model.d.ts.map +1 -0
  247. package/dist/modules/dock/{hooks/use-card-item-model.d.ts → card/use-card.d.ts} +6 -5
  248. package/dist/modules/dock/{hooks/use-card-item-model.d.ts.map → card/use-card.d.ts.map} +1 -1
  249. package/dist/modules/dock/commands/command-bar.d.ts.map +1 -0
  250. package/dist/modules/dock/{runtime/commands.d.ts → commands/registry.d.ts} +1 -1
  251. package/dist/modules/dock/commands/registry.d.ts.map +1 -0
  252. package/dist/modules/dock/constants.d.ts +4 -7
  253. package/dist/modules/dock/constants.d.ts.map +1 -1
  254. package/dist/modules/dock/context.d.ts +1 -1
  255. package/dist/modules/dock/context.d.ts.map +1 -1
  256. package/dist/modules/dock/hooks.d.ts +47 -0
  257. package/dist/modules/dock/hooks.d.ts.map +1 -0
  258. package/dist/modules/dock/{hud.d.ts → hud/hud.d.ts} +14 -7
  259. package/dist/modules/dock/hud/hud.d.ts.map +1 -0
  260. package/dist/modules/dock/{model/hud-definition.d.ts → hud/model.d.ts} +7 -1
  261. package/dist/modules/dock/hud/model.d.ts.map +1 -0
  262. package/dist/modules/dock/{components/hud-view.d.ts → hud/view.d.ts} +1 -1
  263. package/dist/modules/dock/hud/view.d.ts.map +1 -0
  264. package/dist/modules/dock/index.d.ts +22 -22
  265. package/dist/modules/dock/index.d.ts.map +1 -1
  266. package/dist/modules/dock/items/attention.d.ts +43 -0
  267. package/dist/modules/dock/items/attention.d.ts.map +1 -0
  268. package/dist/modules/dock/{runtime/model/items.d.ts → items/build.d.ts} +2 -2
  269. package/dist/modules/dock/items/build.d.ts.map +1 -0
  270. package/dist/modules/dock/{runtime → items}/display.d.ts +2 -5
  271. package/dist/modules/dock/items/display.d.ts.map +1 -0
  272. package/dist/modules/dock/items/operations.d.ts +22 -0
  273. package/dist/modules/dock/items/operations.d.ts.map +1 -0
  274. package/dist/modules/dock/{runtime → items}/pipeline.d.ts +1 -1
  275. package/dist/modules/dock/items/pipeline.d.ts.map +1 -0
  276. package/dist/modules/dock/{components/media-action.d.ts → media/controls.d.ts} +5 -2
  277. package/dist/modules/dock/media/controls.d.ts.map +1 -0
  278. package/dist/modules/dock/{lib/media.d.ts → media/model.d.ts} +1 -3
  279. package/dist/modules/dock/media/model.d.ts.map +1 -0
  280. package/dist/modules/dock/{components/media-scrubber.d.ts → media/scrubber.d.ts} +1 -1
  281. package/dist/modules/dock/media/scrubber.d.ts.map +1 -0
  282. package/dist/modules/dock/{hooks/use-media-controls-model.d.ts → media/use-controls.d.ts} +8 -8
  283. package/dist/modules/dock/media/use-controls.d.ts.map +1 -0
  284. package/dist/modules/dock/module.d.ts.map +1 -1
  285. package/dist/modules/dock/motion.d.ts +3 -4
  286. package/dist/modules/dock/motion.d.ts.map +1 -1
  287. package/dist/modules/dock/provider.d.ts.map +1 -1
  288. package/dist/modules/dock/routing/breadcrumbs-card.d.ts.map +1 -0
  289. package/dist/modules/dock/routing/{model/continuity.d.ts → continuity-state.d.ts} +2 -2
  290. package/dist/modules/dock/routing/continuity-state.d.ts.map +1 -0
  291. package/dist/modules/dock/routing/continuity.d.ts +8 -8
  292. package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
  293. package/dist/modules/dock/routing/navigation.d.ts +0 -10
  294. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  295. package/dist/modules/dock/routing/paths.d.ts.map +1 -0
  296. package/dist/modules/dock/routing/{model/policy.d.ts → policy.d.ts} +1 -1
  297. package/dist/modules/dock/routing/policy.d.ts.map +1 -0
  298. package/dist/modules/dock/routing/{hooks/use-route-prefetch.d.ts → prefetch.d.ts} +3 -3
  299. package/dist/modules/dock/routing/prefetch.d.ts.map +1 -0
  300. package/dist/modules/dock/routing/route-bridge.d.ts +8 -0
  301. package/dist/modules/dock/routing/route-bridge.d.ts.map +1 -0
  302. package/dist/modules/dock/routing/{model/topology.d.ts → topology.d.ts} +1 -1
  303. package/dist/modules/dock/routing/topology.d.ts.map +1 -0
  304. package/dist/modules/dock/{runtime/model → stack}/cards.d.ts +8 -5
  305. package/dist/modules/dock/stack/cards.d.ts.map +1 -0
  306. package/dist/modules/dock/stack/dock.d.ts.map +1 -0
  307. package/dist/modules/dock/stack/focus.d.ts +22 -0
  308. package/dist/modules/dock/stack/focus.d.ts.map +1 -0
  309. package/dist/modules/dock/{model → stack}/layout.d.ts +8 -2
  310. package/dist/modules/dock/stack/layout.d.ts.map +1 -0
  311. package/dist/modules/dock/{runtime/dock.d.ts → stack/use-dock-model.d.ts} +2 -1
  312. package/dist/modules/dock/stack/use-dock-model.d.ts.map +1 -0
  313. package/dist/modules/dock/{runtime/hooks → stack}/use-dock.d.ts +9 -9
  314. package/dist/modules/dock/stack/use-dock.d.ts.map +1 -0
  315. package/dist/modules/dock/stack/use-height.d.ts +12 -0
  316. package/dist/modules/dock/stack/use-height.d.ts.map +1 -0
  317. package/dist/modules/dock/{components/status-actions.d.ts → status/actions.d.ts} +1 -1
  318. package/dist/modules/dock/status/actions.d.ts.map +1 -0
  319. package/dist/modules/dock/status/events.d.ts +4 -4
  320. package/dist/modules/dock/status/events.d.ts.map +1 -1
  321. package/dist/modules/dock/status/hooks.d.ts.map +1 -1
  322. package/dist/modules/dock/status/model.d.ts +34 -4
  323. package/dist/modules/dock/status/model.d.ts.map +1 -1
  324. package/dist/modules/dock/surface/{model/builder.d.ts → builder.d.ts} +13 -7
  325. package/dist/modules/dock/surface/builder.d.ts.map +1 -0
  326. package/dist/modules/dock/{components/surface/item-content.d.ts → surface/content.d.ts} +2 -2
  327. package/dist/modules/dock/surface/content.d.ts.map +1 -0
  328. package/dist/modules/dock/surface/context.d.ts +12 -3
  329. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  330. package/dist/modules/dock/surface/controls.d.ts +26 -0
  331. package/dist/modules/dock/surface/controls.d.ts.map +1 -0
  332. package/dist/modules/dock/surface/definition.d.ts.map +1 -1
  333. package/dist/modules/dock/{components/surface → surface}/extensions-bar.d.ts +1 -1
  334. package/dist/modules/dock/surface/extensions-bar.d.ts.map +1 -0
  335. package/dist/modules/dock/{components/surface/action.d.ts → surface/extensions.d.ts} +4 -2
  336. package/dist/modules/dock/surface/extensions.d.ts.map +1 -0
  337. package/dist/modules/dock/{components/surface → surface}/header-button.d.ts +3 -3
  338. package/dist/modules/dock/surface/header-button.d.ts.map +1 -0
  339. package/dist/modules/dock/surface/helpers.d.ts +13 -1
  340. package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
  341. package/dist/modules/dock/surface/{model/normalize.d.ts → normalize.d.ts} +1 -1
  342. package/dist/modules/dock/surface/normalize.d.ts.map +1 -0
  343. package/dist/modules/dock/surface/runtime/choreography.d.ts +28 -2
  344. package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -1
  345. package/dist/modules/dock/surface/runtime/flows.d.ts +1 -1
  346. package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -1
  347. package/dist/modules/dock/surface/{machine.d.ts → runtime/machine.d.ts} +1 -1
  348. package/dist/modules/dock/surface/runtime/machine.d.ts.map +1 -0
  349. package/dist/modules/dock/surface/runtime/open.d.ts +1 -2
  350. package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -1
  351. package/dist/modules/dock/surface/{model → runtime}/records.d.ts +1 -1
  352. package/dist/modules/dock/surface/runtime/records.d.ts.map +1 -0
  353. package/dist/modules/dock/surface/{stack.d.ts → runtime/stack.d.ts} +10 -10
  354. package/dist/modules/dock/surface/runtime/stack.d.ts.map +1 -0
  355. package/dist/modules/dock/surface/runtime/steps.d.ts +1 -1
  356. package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -1
  357. package/dist/modules/dock/surface/{model/transition-state.d.ts → runtime/transition.d.ts} +1 -1
  358. package/dist/modules/dock/surface/runtime/transition.d.ts.map +1 -0
  359. package/dist/modules/dock/surface/runtime/url.d.ts.map +1 -0
  360. package/dist/modules/dock/surface/{hooks/use-surface-shell-model.d.ts → shell.d.ts} +9 -3
  361. package/dist/modules/dock/surface/shell.d.ts.map +1 -0
  362. package/dist/modules/dock/surface/{hooks/use-surface-flow.d.ts → use-flow.d.ts} +2 -2
  363. package/dist/modules/dock/surface/use-flow.d.ts.map +1 -0
  364. package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
  365. package/dist/modules/dock/{lib/styles.d.ts → theme.d.ts} +8 -4
  366. package/dist/modules/dock/theme.d.ts.map +1 -0
  367. package/dist/modules/dock/types/card.d.ts +12 -3
  368. package/dist/modules/dock/types/card.d.ts.map +1 -1
  369. package/dist/modules/dock/types/index.d.ts +1 -1
  370. package/dist/modules/dock/types/index.d.ts.map +1 -1
  371. package/dist/modules/dock/types/surface.d.ts +2 -2
  372. package/dist/modules/dock/types/surface.d.ts.map +1 -1
  373. package/dist/modules/dock/{lib/helpers.d.ts → utils.d.ts} +10 -3
  374. package/dist/modules/dock/utils.d.ts.map +1 -0
  375. package/dist/modules/index.js +23 -22
  376. package/dist/modules/loading/hooks.d.ts +2 -1
  377. package/dist/modules/loading/hooks.d.ts.map +1 -1
  378. package/dist/modules/loading/state.d.ts.map +1 -1
  379. package/dist/modules/media/hooks.d.ts.map +1 -1
  380. package/dist/modules/media/playback.d.ts.map +1 -1
  381. package/dist/modules/modal/constants.d.ts +3 -1
  382. package/dist/modules/modal/constants.d.ts.map +1 -1
  383. package/dist/modules/modal/{components/modal-container.d.ts → container.d.ts} +2 -2
  384. package/dist/modules/modal/container.d.ts.map +1 -0
  385. package/dist/modules/modal/context.d.ts +5 -1
  386. package/dist/modules/modal/context.d.ts.map +1 -1
  387. package/dist/modules/modal/dom.d.ts.map +1 -0
  388. package/dist/modules/modal/hooks.d.ts +3 -2
  389. package/dist/modules/modal/hooks.d.ts.map +1 -1
  390. package/dist/modules/modal/index.d.ts +7 -7
  391. package/dist/modules/modal/index.d.ts.map +1 -1
  392. package/dist/modules/modal/{model/layout.d.ts → layout.d.ts} +1 -1
  393. package/dist/modules/modal/layout.d.ts.map +1 -0
  394. package/dist/modules/modal/module.d.ts +1 -1
  395. package/dist/modules/modal/module.d.ts.map +1 -1
  396. package/dist/modules/modal/overlay.d.ts.map +1 -0
  397. package/dist/modules/modal/state.d.ts +52 -0
  398. package/dist/modules/modal/state.d.ts.map +1 -0
  399. package/dist/modules/navigation/hooks.d.ts.map +1 -1
  400. package/dist/modules/notification/hooks.d.ts.map +1 -1
  401. package/dist/modules/notification/overlay.d.ts +0 -1
  402. package/dist/modules/notification/overlay.d.ts.map +1 -1
  403. package/dist/navigation/index.js +33 -41
  404. package/dist/navigation/index.js.map +1 -1
  405. package/dist/notification/index.js +8 -7
  406. package/dist/overlay-YMLS3SAQ.js +14 -0
  407. package/dist/{overlay-7QLGWHCH.js.map → overlay-YMLS3SAQ.js.map} +1 -1
  408. package/dist/provider/index.js +12 -11
  409. package/dist/react/hooks/index.d.ts +3 -1
  410. package/dist/react/hooks/index.d.ts.map +1 -1
  411. package/dist/react/hooks/use-client-value.d.ts +15 -0
  412. package/dist/react/hooks/use-client-value.d.ts.map +1 -0
  413. package/dist/react/hooks/use-controllable-state.d.ts +8 -1
  414. package/dist/react/hooks/use-controllable-state.d.ts.map +1 -1
  415. package/dist/react/hooks/use-fullscreen-state.d.ts +0 -2
  416. package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -1
  417. package/dist/react/hooks/use-global-event.d.ts +7 -1
  418. package/dist/react/hooks/use-global-event.d.ts.map +1 -1
  419. package/dist/react/hooks/use-hotkey.d.ts +9 -1
  420. package/dist/react/hooks/use-hotkey.d.ts.map +1 -1
  421. package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -1
  422. package/dist/react/hooks/use-store.d.ts +3 -0
  423. package/dist/react/hooks/use-store.d.ts.map +1 -1
  424. package/dist/react/theme/index.d.ts.map +1 -1
  425. package/dist/react/ui/components/avatar.d.ts +4 -0
  426. package/dist/react/ui/components/avatar.d.ts.map +1 -1
  427. package/dist/react/ui/components/carousel.d.ts +22 -1
  428. package/dist/react/ui/components/carousel.d.ts.map +1 -1
  429. package/dist/react/ui/components/image.d.ts.map +1 -1
  430. package/dist/react/ui/components/indicator.d.ts +18 -8
  431. package/dist/react/ui/components/indicator.d.ts.map +1 -1
  432. package/dist/react/ui/components/segmented.d.ts.map +1 -1
  433. package/dist/react/ui/components/{select-parts.d.ts → select/options.d.ts} +2 -2
  434. package/dist/react/ui/components/{select-parts.d.ts.map → select/options.d.ts.map} +1 -1
  435. package/dist/react/ui/components/{select.d.ts → select/select.d.ts} +1 -1
  436. package/dist/react/ui/components/select/select.d.ts.map +1 -0
  437. package/dist/react/ui/components/{tooltip-group.d.ts → tooltip/group.d.ts} +3 -2
  438. package/dist/react/ui/components/tooltip/group.d.ts.map +1 -0
  439. package/dist/react/ui/components/{tooltip-placement.d.ts → tooltip/placement.d.ts} +2 -3
  440. package/dist/react/ui/components/tooltip/placement.d.ts.map +1 -0
  441. package/dist/react/ui/components/{tooltip-slot.d.ts → tooltip/slot.d.ts} +1 -1
  442. package/dist/react/ui/components/tooltip/slot.d.ts.map +1 -0
  443. package/dist/react/ui/components/{tooltip.d.ts → tooltip/tooltip.d.ts} +2 -2
  444. package/dist/react/ui/components/tooltip/tooltip.d.ts.map +1 -0
  445. package/dist/react/ui/index.d.ts +5 -4
  446. package/dist/react/ui/index.d.ts.map +1 -1
  447. package/dist/react/ui/provider.d.ts.map +1 -1
  448. package/dist/react/ui/types.d.ts +131 -3
  449. package/dist/react/ui/types.d.ts.map +1 -1
  450. package/dist/recipes/index.js +5 -6
  451. package/dist/recipes/index.js.map +1 -1
  452. package/dist/result/index.js +12 -15
  453. package/dist/result/index.js.map +1 -1
  454. package/dist/theme/index.js +2 -2
  455. package/dist/ui/index.js +849 -858
  456. package/dist/ui/index.js.map +1 -1
  457. package/dist/utils/index.js +31 -34
  458. package/dist/utils/index.js.map +1 -1
  459. package/docs/README.md +1 -1
  460. package/docs/architecture-and-rules.md +35 -24
  461. package/docs/modules/README.md +15 -15
  462. package/docs/modules/ambient.md +23 -23
  463. package/docs/modules/background.md +23 -18
  464. package/docs/modules/dock.md +24 -20
  465. package/docs/modules/error-boundary.md +1 -2
  466. package/docs/modules/kernel.md +28 -30
  467. package/docs/modules/modal.md +16 -15
  468. package/docs/modules/navigation.md +14 -14
  469. package/docs/testing.md +1 -1
  470. package/package.json +1 -2
  471. package/dist/chunk-67MOKJFZ.js.map +0 -1
  472. package/dist/chunk-6IP6YFQX.js.map +0 -1
  473. package/dist/chunk-7VU2OAJB.js.map +0 -1
  474. package/dist/chunk-AZ2ZDFNP.js +0 -17
  475. package/dist/chunk-BMFHS3GV.js.map +0 -1
  476. package/dist/chunk-D222OCTV.js.map +0 -1
  477. package/dist/chunk-ESD5EQ5H.js.map +0 -1
  478. package/dist/chunk-FFJWJ4OB.js.map +0 -1
  479. package/dist/chunk-GKAJ4EM2.js.map +0 -1
  480. package/dist/chunk-HFR6YROB.js.map +0 -1
  481. package/dist/chunk-IH3STE7W.js.map +0 -1
  482. package/dist/chunk-KOYTJW5E.js.map +0 -1
  483. package/dist/chunk-LKYW4LH6.js.map +0 -1
  484. package/dist/chunk-QGPRTUED.js.map +0 -1
  485. package/dist/chunk-QRXDXAQI.js.map +0 -1
  486. package/dist/chunk-R4K6VAOK.js.map +0 -1
  487. package/dist/chunk-RDYYP36I.js.map +0 -1
  488. package/dist/chunk-TAWTGCWJ.js.map +0 -1
  489. package/dist/chunk-UQLTP3XB.js.map +0 -1
  490. package/dist/chunk-WQTMOUCA.js.map +0 -1
  491. package/dist/chunk-WZ5T2NXH.js.map +0 -1
  492. package/dist/chunk-XGAYTDSI.js.map +0 -1
  493. package/dist/chunk-YZS2B6YE.js.map +0 -1
  494. package/dist/chunk-ZXRE2KZO.js.map +0 -1
  495. package/dist/core/error/theme.d.ts +0 -10
  496. package/dist/core/error/theme.d.ts.map +0 -1
  497. package/dist/core/kernel/adapters.d.ts.map +0 -1
  498. package/dist/core/kernel/compose.d.ts.map +0 -1
  499. package/dist/core/kernel/handlers.d.ts.map +0 -1
  500. package/dist/core/kernel/hooks.d.ts.map +0 -1
  501. package/dist/core/kernel/installed.d.ts.map +0 -1
  502. package/dist/core/kernel/module.d.ts.map +0 -1
  503. package/dist/core/kernel/operations-records.d.ts.map +0 -1
  504. package/dist/core/kernel/operations-resolve.d.ts +0 -5
  505. package/dist/core/kernel/operations-resolve.d.ts.map +0 -1
  506. package/dist/core/kernel/operations.d.ts.map +0 -1
  507. package/dist/core/kernel/page-controller.d.ts.map +0 -1
  508. package/dist/core/kernel/provider.d.ts.map +0 -1
  509. package/dist/core/kernel/runtime.d.ts.map +0 -1
  510. package/dist/core/kernel/schema.d.ts.map +0 -1
  511. package/dist/core/kernel/stabilize.d.ts.map +0 -1
  512. package/dist/core/kernel/store-batch.d.ts +0 -17
  513. package/dist/core/kernel/store-batch.d.ts.map +0 -1
  514. package/dist/core/kernel/store-entries.d.ts +0 -6
  515. package/dist/core/kernel/store-entries.d.ts.map +0 -1
  516. package/dist/core/kernel/store-handles.d.ts +0 -4
  517. package/dist/core/kernel/store-handles.d.ts.map +0 -1
  518. package/dist/core/kernel/store-registration.d.ts +0 -14
  519. package/dist/core/kernel/store-registration.d.ts.map +0 -1
  520. package/dist/core/kernel/store-snapshots.d.ts.map +0 -1
  521. package/dist/core/kernel/store-subscriptions.d.ts.map +0 -1
  522. package/dist/core/kernel/store.d.ts.map +0 -1
  523. package/dist/core/kernel/types-modules.d.ts.map +0 -1
  524. package/dist/core/kernel/types-page.d.ts.map +0 -1
  525. package/dist/core/kernel/types-store.d.ts.map +0 -1
  526. package/dist/core/kernel/types.d.ts.map +0 -1
  527. package/dist/core/navigation/navigator-defaults.d.ts +0 -4
  528. package/dist/core/navigation/navigator-defaults.d.ts.map +0 -1
  529. package/dist/core/navigation/navigator-holds.d.ts.map +0 -1
  530. package/dist/core/navigation/navigator-patience.d.ts.map +0 -1
  531. package/dist/core/navigation/navigator-payload.d.ts.map +0 -1
  532. package/dist/core/navigation/navigator-prefetch.d.ts.map +0 -1
  533. package/dist/modules/ambient/analyze-bounds.d.ts.map +0 -1
  534. package/dist/modules/ambient/analyze-clusters.d.ts.map +0 -1
  535. package/dist/modules/ambient/analyze-ground.d.ts.map +0 -1
  536. package/dist/modules/ambient/analyze-measures.d.ts.map +0 -1
  537. package/dist/modules/ambient/analyze-swatches.d.ts.map +0 -1
  538. package/dist/modules/ambient/analyze.d.ts.map +0 -1
  539. package/dist/modules/ambient/oklab.d.ts.map +0 -1
  540. package/dist/modules/ambient/quantize.d.ts.map +0 -1
  541. package/dist/modules/background/components/background-gradients.d.ts +0 -8
  542. package/dist/modules/background/components/background-gradients.d.ts.map +0 -1
  543. package/dist/modules/background/components/edge-gradient.d.ts +0 -9
  544. package/dist/modules/background/components/edge-gradient.d.ts.map +0 -1
  545. package/dist/modules/background/components/native-video.d.ts +0 -4
  546. package/dist/modules/background/components/native-video.d.ts.map +0 -1
  547. package/dist/modules/background/components/noise-overlay.d.ts +0 -11
  548. package/dist/modules/background/components/noise-overlay.d.ts.map +0 -1
  549. package/dist/modules/background/components/overlay.d.ts.map +0 -1
  550. package/dist/modules/background/components/solid-overlay.d.ts +0 -10
  551. package/dist/modules/background/components/solid-overlay.d.ts.map +0 -1
  552. package/dist/modules/background/hooks/use-background-media-source.d.ts +0 -4
  553. package/dist/modules/background/hooks/use-background-media-source.d.ts.map +0 -1
  554. package/dist/modules/background/hooks/use-background-motion-model.d.ts +0 -15
  555. package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +0 -1
  556. package/dist/modules/background/hooks/use-background-overlay-model.d.ts +0 -929
  557. package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +0 -1
  558. package/dist/modules/background/hooks/use-native-video-model.d.ts.map +0 -1
  559. package/dist/modules/background/lib/theme.d.ts +0 -4
  560. package/dist/modules/background/lib/theme.d.ts.map +0 -1
  561. package/dist/modules/background/model/override.d.ts +0 -14
  562. package/dist/modules/background/model/override.d.ts.map +0 -1
  563. package/dist/modules/background/model/playback.d.ts.map +0 -1
  564. package/dist/modules/background/model/state.d.ts.map +0 -1
  565. package/dist/modules/background/model/video-frame.d.ts +0 -31
  566. package/dist/modules/background/model/video-frame.d.ts.map +0 -1
  567. package/dist/modules/background/model/visual.d.ts.map +0 -1
  568. package/dist/modules/background/youtube/components/player.d.ts.map +0 -1
  569. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +0 -1
  570. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +0 -20
  571. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +0 -1
  572. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +0 -8
  573. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +0 -1
  574. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +0 -1
  575. package/dist/modules/background/youtube/lib/audio.d.ts.map +0 -1
  576. package/dist/modules/background/youtube/lib/iframe-engine.d.ts +0 -29
  577. package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +0 -1
  578. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +0 -47
  579. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +0 -1
  580. package/dist/modules/background/youtube/lib/iframe.d.ts +0 -47
  581. package/dist/modules/background/youtube/lib/iframe.d.ts.map +0 -1
  582. package/dist/modules/background/youtube/lib/parse.d.ts.map +0 -1
  583. package/dist/modules/background/youtube/lib/timing.d.ts.map +0 -1
  584. package/dist/modules/background/youtube/lib/video-events.d.ts.map +0 -1
  585. package/dist/modules/dock/components/badge.d.ts +0 -5
  586. package/dist/modules/dock/components/badge.d.ts.map +0 -1
  587. package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +0 -1
  588. package/dist/modules/dock/components/card-banner.d.ts +0 -4
  589. package/dist/modules/dock/components/card-banner.d.ts.map +0 -1
  590. package/dist/modules/dock/components/card-header.d.ts +0 -4
  591. package/dist/modules/dock/components/card-header.d.ts.map +0 -1
  592. package/dist/modules/dock/components/card-item.d.ts.map +0 -1
  593. package/dist/modules/dock/components/command-bar.d.ts.map +0 -1
  594. package/dist/modules/dock/components/compact.d.ts.map +0 -1
  595. package/dist/modules/dock/components/description.d.ts +0 -4
  596. package/dist/modules/dock/components/description.d.ts.map +0 -1
  597. package/dist/modules/dock/components/dock.d.ts.map +0 -1
  598. package/dist/modules/dock/components/hud-view.d.ts.map +0 -1
  599. package/dist/modules/dock/components/icon.d.ts.map +0 -1
  600. package/dist/modules/dock/components/item-content.d.ts.map +0 -1
  601. package/dist/modules/dock/components/media-action.d.ts.map +0 -1
  602. package/dist/modules/dock/components/media-controls.d.ts +0 -4
  603. package/dist/modules/dock/components/media-controls.d.ts.map +0 -1
  604. package/dist/modules/dock/components/media-scrubber.d.ts.map +0 -1
  605. package/dist/modules/dock/components/status-actions.d.ts.map +0 -1
  606. package/dist/modules/dock/components/surface/action.d.ts.map +0 -1
  607. package/dist/modules/dock/components/surface/controls.d.ts +0 -12
  608. package/dist/modules/dock/components/surface/controls.d.ts.map +0 -1
  609. package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +0 -1
  610. package/dist/modules/dock/components/surface/header-button.d.ts.map +0 -1
  611. package/dist/modules/dock/components/surface/item-content.d.ts.map +0 -1
  612. package/dist/modules/dock/components/surface/shell.d.ts +0 -3
  613. package/dist/modules/dock/components/surface/shell.d.ts.map +0 -1
  614. package/dist/modules/dock/components/title.d.ts +0 -4
  615. package/dist/modules/dock/components/title.d.ts.map +0 -1
  616. package/dist/modules/dock/hooks/use-action-slot.d.ts +0 -6
  617. package/dist/modules/dock/hooks/use-action-slot.d.ts.map +0 -1
  618. package/dist/modules/dock/hooks/use-badge.d.ts +0 -4
  619. package/dist/modules/dock/hooks/use-badge.d.ts.map +0 -1
  620. package/dist/modules/dock/hooks/use-card-banner-model.d.ts +0 -18
  621. package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +0 -1
  622. package/dist/modules/dock/hooks/use-card-header-model.d.ts +0 -7
  623. package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +0 -1
  624. package/dist/modules/dock/hooks/use-command-bar-model.d.ts +0 -12
  625. package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +0 -1
  626. package/dist/modules/dock/hooks/use-dock-banner.d.ts +0 -11
  627. package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +0 -1
  628. package/dist/modules/dock/hooks/use-dock-config.d.ts +0 -19
  629. package/dist/modules/dock/hooks/use-dock-config.d.ts.map +0 -1
  630. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +0 -7
  631. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +0 -1
  632. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +0 -7
  633. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +0 -1
  634. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +0 -6
  635. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +0 -1
  636. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +0 -11
  637. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +0 -1
  638. package/dist/modules/dock/hooks/use-dock-registration.d.ts +0 -8
  639. package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +0 -1
  640. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +0 -2
  641. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +0 -1
  642. package/dist/modules/dock/hooks/use-dock-theme.d.ts +0 -6
  643. package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +0 -1
  644. package/dist/modules/dock/hooks/use-dock-viewport.d.ts +0 -6
  645. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +0 -1
  646. package/dist/modules/dock/hooks/use-element-height.d.ts +0 -3
  647. package/dist/modules/dock/hooks/use-element-height.d.ts.map +0 -1
  648. package/dist/modules/dock/hooks/use-hud-registry.d.ts +0 -16
  649. package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +0 -1
  650. package/dist/modules/dock/hooks/use-hud-view-model.d.ts +0 -9
  651. package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +0 -1
  652. package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +0 -1
  653. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +0 -27
  654. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +0 -1
  655. package/dist/modules/dock/hooks/use-pending-skeleton.d.ts +0 -7
  656. package/dist/modules/dock/hooks/use-pending-skeleton.d.ts.map +0 -1
  657. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +0 -12
  658. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +0 -1
  659. package/dist/modules/dock/hooks/use-surface-return.d.ts +0 -8
  660. package/dist/modules/dock/hooks/use-surface-return.d.ts.map +0 -1
  661. package/dist/modules/dock/hud.d.ts.map +0 -1
  662. package/dist/modules/dock/lib/banner.d.ts.map +0 -1
  663. package/dist/modules/dock/lib/card-item.d.ts.map +0 -1
  664. package/dist/modules/dock/lib/card.d.ts +0 -20
  665. package/dist/modules/dock/lib/card.d.ts.map +0 -1
  666. package/dist/modules/dock/lib/command-bar.d.ts +0 -8
  667. package/dist/modules/dock/lib/command-bar.d.ts.map +0 -1
  668. package/dist/modules/dock/lib/dom.d.ts +0 -7
  669. package/dist/modules/dock/lib/dom.d.ts.map +0 -1
  670. package/dist/modules/dock/lib/element-helpers.d.ts +0 -8
  671. package/dist/modules/dock/lib/element-helpers.d.ts.map +0 -1
  672. package/dist/modules/dock/lib/helpers.d.ts.map +0 -1
  673. package/dist/modules/dock/lib/media.d.ts.map +0 -1
  674. package/dist/modules/dock/lib/styles.d.ts.map +0 -1
  675. package/dist/modules/dock/model/hud-definition.d.ts.map +0 -1
  676. package/dist/modules/dock/model/hud.d.ts +0 -10
  677. package/dist/modules/dock/model/hud.d.ts.map +0 -1
  678. package/dist/modules/dock/model/layout.d.ts.map +0 -1
  679. package/dist/modules/dock/model/page-entry.d.ts +0 -11
  680. package/dist/modules/dock/model/page-entry.d.ts.map +0 -1
  681. package/dist/modules/dock/model/page-surface.d.ts +0 -4
  682. package/dist/modules/dock/model/page-surface.d.ts.map +0 -1
  683. package/dist/modules/dock/model/paths.d.ts.map +0 -1
  684. package/dist/modules/dock/model/state.d.ts +0 -28
  685. package/dist/modules/dock/model/state.d.ts.map +0 -1
  686. package/dist/modules/dock/model/surface-return.d.ts +0 -14
  687. package/dist/modules/dock/model/surface-return.d.ts.map +0 -1
  688. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +0 -1
  689. package/dist/modules/dock/routing/lib/restore.d.ts +0 -7
  690. package/dist/modules/dock/routing/lib/restore.d.ts.map +0 -1
  691. package/dist/modules/dock/routing/model/continuity.d.ts.map +0 -1
  692. package/dist/modules/dock/routing/model/policy.d.ts.map +0 -1
  693. package/dist/modules/dock/routing/model/topology.d.ts.map +0 -1
  694. package/dist/modules/dock/runtime/commands.d.ts.map +0 -1
  695. package/dist/modules/dock/runtime/display.d.ts.map +0 -1
  696. package/dist/modules/dock/runtime/dock.d.ts.map +0 -1
  697. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +0 -10
  698. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +0 -1
  699. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +0 -10
  700. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +0 -1
  701. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +0 -14
  702. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +0 -1
  703. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +0 -7
  704. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +0 -1
  705. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +0 -1
  706. package/dist/modules/dock/runtime/model/attention.d.ts +0 -25
  707. package/dist/modules/dock/runtime/model/attention.d.ts.map +0 -1
  708. package/dist/modules/dock/runtime/model/cards.d.ts.map +0 -1
  709. package/dist/modules/dock/runtime/model/items.d.ts.map +0 -1
  710. package/dist/modules/dock/runtime/model/layout.d.ts +0 -10
  711. package/dist/modules/dock/runtime/model/layout.d.ts.map +0 -1
  712. package/dist/modules/dock/runtime/pipeline.d.ts.map +0 -1
  713. package/dist/modules/dock/runtime/provider-actions.d.ts +0 -38
  714. package/dist/modules/dock/runtime/provider-actions.d.ts.map +0 -1
  715. package/dist/modules/dock/status/action-options.d.ts +0 -35
  716. package/dist/modules/dock/status/action-options.d.ts.map +0 -1
  717. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +0 -5
  718. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +0 -1
  719. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +0 -7
  720. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +0 -1
  721. package/dist/modules/dock/surface/constants.d.ts +0 -5
  722. package/dist/modules/dock/surface/constants.d.ts.map +0 -1
  723. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +0 -15
  724. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +0 -1
  725. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +0 -7
  726. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +0 -1
  727. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +0 -14
  728. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +0 -1
  729. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +0 -1
  730. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +0 -13
  731. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +0 -1
  732. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +0 -1
  733. package/dist/modules/dock/surface/lib/drag.d.ts +0 -9
  734. package/dist/modules/dock/surface/lib/drag.d.ts.map +0 -1
  735. package/dist/modules/dock/surface/lib/target.d.ts +0 -8
  736. package/dist/modules/dock/surface/lib/target.d.ts.map +0 -1
  737. package/dist/modules/dock/surface/machine.d.ts.map +0 -1
  738. package/dist/modules/dock/surface/model/builder.d.ts.map +0 -1
  739. package/dist/modules/dock/surface/model/normalize.d.ts.map +0 -1
  740. package/dist/modules/dock/surface/model/open.d.ts +0 -26
  741. package/dist/modules/dock/surface/model/open.d.ts.map +0 -1
  742. package/dist/modules/dock/surface/model/records.d.ts.map +0 -1
  743. package/dist/modules/dock/surface/model/steps.d.ts +0 -9
  744. package/dist/modules/dock/surface/model/steps.d.ts.map +0 -1
  745. package/dist/modules/dock/surface/model/transition-state.d.ts.map +0 -1
  746. package/dist/modules/dock/surface/model/url.d.ts.map +0 -1
  747. package/dist/modules/dock/surface/runtime/context.d.ts +0 -29
  748. package/dist/modules/dock/surface/runtime/context.d.ts.map +0 -1
  749. package/dist/modules/dock/surface/runtime/release.d.ts +0 -9
  750. package/dist/modules/dock/surface/runtime/release.d.ts.map +0 -1
  751. package/dist/modules/dock/surface/stack.d.ts.map +0 -1
  752. package/dist/modules/dock/types/compact.d.ts +0 -13
  753. package/dist/modules/dock/types/compact.d.ts.map +0 -1
  754. package/dist/modules/modal/components/close-button.d.ts +0 -6
  755. package/dist/modules/modal/components/close-button.d.ts.map +0 -1
  756. package/dist/modules/modal/components/modal-container.d.ts.map +0 -1
  757. package/dist/modules/modal/components/modal-layer-switcher.d.ts +0 -9
  758. package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +0 -1
  759. package/dist/modules/modal/components/modal-layer.d.ts +0 -17
  760. package/dist/modules/modal/components/modal-layer.d.ts.map +0 -1
  761. package/dist/modules/modal/components/overlay.d.ts.map +0 -1
  762. package/dist/modules/modal/components/resolve-header.d.ts +0 -10
  763. package/dist/modules/modal/components/resolve-header.d.ts.map +0 -1
  764. package/dist/modules/modal/components/slot-row.d.ts +0 -12
  765. package/dist/modules/modal/components/slot-row.d.ts.map +0 -1
  766. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +0 -3
  767. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +0 -1
  768. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +0 -12
  769. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +0 -1
  770. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +0 -3
  771. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +0 -1
  772. package/dist/modules/modal/lib/dom.d.ts.map +0 -1
  773. package/dist/modules/modal/lib/theme.d.ts +0 -4
  774. package/dist/modules/modal/lib/theme.d.ts.map +0 -1
  775. package/dist/modules/modal/model/entry.d.ts +0 -18
  776. package/dist/modules/modal/model/entry.d.ts.map +0 -1
  777. package/dist/modules/modal/model/header.d.ts +0 -16
  778. package/dist/modules/modal/model/header.d.ts.map +0 -1
  779. package/dist/modules/modal/model/identity.d.ts +0 -13
  780. package/dist/modules/modal/model/identity.d.ts.map +0 -1
  781. package/dist/modules/modal/model/layout.d.ts.map +0 -1
  782. package/dist/modules/modal/model/state.d.ts +0 -10
  783. package/dist/modules/modal/model/state.d.ts.map +0 -1
  784. package/dist/overlay-7QLGWHCH.js +0 -13
  785. package/dist/react/hooks/types.d.ts +0 -25
  786. package/dist/react/hooks/types.d.ts.map +0 -1
  787. package/dist/react/ui/components/select.d.ts.map +0 -1
  788. package/dist/react/ui/components/tooltip-group.d.ts.map +0 -1
  789. package/dist/react/ui/components/tooltip-placement.d.ts.map +0 -1
  790. package/dist/react/ui/components/tooltip-slot.d.ts.map +0 -1
  791. package/dist/react/ui/components/tooltip.d.ts.map +0 -1
  792. package/dist/react/ui/types-controls.d.ts +0 -133
  793. package/dist/react/ui/types-controls.d.ts.map +0 -1
  794. package/dist/react/ui/utils.d.ts +0 -65
  795. package/dist/react/ui/utils.d.ts.map +0 -1
  796. package/docs/proposals/navigation.md +0 -210
  797. /package/dist/modules/ambient/{quantize.d.ts → analysis/quantize.d.ts} +0 -0
  798. /package/dist/modules/background/{components/overlay.d.ts → overlay.d.ts} +0 -0
  799. /package/dist/modules/background/{model/playback.d.ts → playback.d.ts} +0 -0
  800. /package/dist/modules/background/youtube/{lib/audio.d.ts → audio.d.ts} +0 -0
  801. /package/dist/modules/dock/{components → card}/compact.d.ts +0 -0
  802. /package/dist/modules/dock/{components → commands}/command-bar.d.ts +0 -0
  803. /package/dist/modules/dock/{components → routing}/breadcrumbs-card.d.ts +0 -0
  804. /package/dist/modules/dock/{model → routing}/paths.d.ts +0 -0
  805. /package/dist/modules/dock/{components → stack}/dock.d.ts +0 -0
  806. /package/dist/modules/dock/surface/{model → runtime}/url.d.ts +0 -0
  807. /package/dist/modules/modal/{lib/dom.d.ts → dom.d.ts} +0 -0
  808. /package/dist/modules/modal/{components/overlay.d.ts → overlay.d.ts} +0 -0
@@ -1,12 +1,12 @@
1
- import { useOptionalMediaActions } from './chunk-ZXRE2KZO.js';
2
- import { defineModule, useRegistryValue, useModuleRegistration } from './chunk-IH3STE7W.js';
3
- import { useStore, useRequiredContext } from './chunk-WQTMOUCA.js';
4
- import { Spinner } from './chunk-7VU2OAJB.js';
5
- import { cn } from './chunk-TAWTGCWJ.js';
6
- import { defineThemeSpec, useTheme, useMotionTokens, useModuleMotion } from './chunk-ESD5EQ5H.js';
7
- import { createStore, cssEasing, report } from './chunk-D222OCTV.js';
1
+ import { useOptionalMediaActions } from './chunk-C3SEBNF5.js';
2
+ import { defineModule, useRegistryValue, useModuleRegistration } from './chunk-ED32WLAD.js';
3
+ import { useStore, useRequiredContext } from './chunk-JWUKAZ3A.js';
4
+ import { Spinner } from './chunk-6LWCTP2Y.js';
5
+ import { cn } from './chunk-ICFPSAJZ.js';
6
+ import { defineThemeSpec, useTheme, useMotionTokens, useModuleMotion } from './chunk-3JLG24KI.js';
7
+ import { createStore, cssEasing, report } from './chunk-S67HGKJ2.js';
8
8
  import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
9
- import { retime } from './chunk-BMFHS3GV.js';
9
+ import { retime } from './chunk-YHWA7FXX.js';
10
10
  import { c } from 'react/compiler-runtime';
11
11
  import { motion, AnimatePresence } from 'motion/react';
12
12
  import { useState, useLayoutEffect, useEffect, use, useRef, useCallback } from 'react';
@@ -19,67 +19,82 @@ var BACKGROUND_REGISTRY_KEY = "page-background";
19
19
  var BACKGROUND_MEDIA_ID = "background";
20
20
  var DEFAULT_AUDIBLE_VOLUME = 0.8;
21
21
  var PROXY_UNMUTE_VOLUME = 0.7;
22
- function useBackgroundMediaSource(state, actions) {
23
- const $ = c(11);
24
- const media = useOptionalMediaActions();
25
- const {
26
- isPlaying,
27
- isVideo,
28
- videoElement
29
- } = state;
30
- const isLoop = Boolean(state.videoOptions?.loop);
31
- let t0;
32
- let t1;
33
- if ($[0] !== actions || $[1] !== isLoop || $[2] !== isPlaying || $[3] !== isVideo || $[4] !== media || $[5] !== videoElement) {
34
- t0 = () => {
35
- if (!isVideo) {
36
- media.removeSource(BACKGROUND_MEDIA_ID);
37
- return;
38
- }
39
- media.upsertSource({
40
- controls: {
41
- setMuted: actions.setVideoMuted,
42
- toggle: actions.toggleVideo,
43
- toggleLoop: actions.toggleLoop
44
- },
45
- element: videoElement ?? null,
46
- id: BACKGROUND_MEDIA_ID,
47
- isPlaying,
48
- kind: "video",
49
- loop: isLoop
22
+
23
+ // src/modules/background/playback.ts
24
+ function applyVideoPlaybackState({
25
+ isPlaying,
26
+ playbackRate,
27
+ setVideoPlaying,
28
+ videoElement
29
+ }) {
30
+ if (!videoElement) return;
31
+ const numericPlaybackRate = Number(playbackRate);
32
+ const resolvedPlaybackRate = Number.isFinite(numericPlaybackRate) && numericPlaybackRate > 0 ? numericPlaybackRate : 1;
33
+ try {
34
+ if (videoElement.playbackRate !== resolvedPlaybackRate) {
35
+ videoElement.playbackRate = resolvedPlaybackRate;
36
+ }
37
+ } catch {
38
+ return;
39
+ }
40
+ if (!isPlaying) {
41
+ if (!videoElement.paused) videoElement.pause();
42
+ return;
43
+ }
44
+ if (videoElement.readyState === 0) {
45
+ return;
46
+ }
47
+ const playPromise = videoElement.play();
48
+ if (!playPromise || typeof playPromise.then !== "function") return;
49
+ playPromise.then(() => setVideoPlaying(true)).catch((error) => {
50
+ if (error?.name === "AbortError" || videoElement.readyState < 2) {
51
+ return;
52
+ }
53
+ if (error?.name === "NotAllowedError") {
54
+ videoElement.muted = true;
55
+ videoElement.play().then(() => setVideoPlaying(true)).catch(() => {
50
56
  });
51
- };
52
- t1 = [actions, isLoop, isPlaying, isVideo, media, videoElement];
53
- $[0] = actions;
54
- $[1] = isLoop;
55
- $[2] = isPlaying;
56
- $[3] = isVideo;
57
- $[4] = media;
58
- $[5] = videoElement;
59
- $[6] = t0;
60
- $[7] = t1;
57
+ return;
58
+ }
59
+ setVideoPlaying(false);
60
+ });
61
+ }
62
+ function triggerVideoPlaybackDirect(videoElement, nextPlaying, configuredMuted) {
63
+ if (!videoElement) return;
64
+ if (nextPlaying) {
65
+ videoElement.muted = configuredMuted;
66
+ if (!configuredMuted && videoElement.volume === 0) {
67
+ videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
68
+ }
69
+ videoElement.play().catch((err) => {
70
+ if (err?.name === "NotAllowedError") {
71
+ videoElement.muted = true;
72
+ videoElement.play().catch(() => {
73
+ });
74
+ }
75
+ });
61
76
  } else {
62
- t0 = $[6];
63
- t1 = $[7];
77
+ videoElement.pause();
64
78
  }
65
- useEffect(t0, t1);
66
- let t2;
67
- let t3;
68
- if ($[8] !== media) {
69
- t2 = () => () => media.removeSource(BACKGROUND_MEDIA_ID);
70
- t3 = [media];
71
- $[8] = media;
72
- $[9] = t2;
73
- $[10] = t3;
74
- } else {
75
- t2 = $[9];
76
- t3 = $[10];
79
+ }
80
+ function syncVideoMutedDirect(videoElement, nextMuted) {
81
+ if (!videoElement) return;
82
+ videoElement.muted = nextMuted;
83
+ if (!nextMuted && videoElement.volume === 0) {
84
+ videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
77
85
  }
78
- useEffect(t2, t3);
86
+ }
87
+ function syncVideoLoopDirect(videoElement, nextLoop) {
88
+ if (!videoElement) return;
89
+ videoElement.loop = nextLoop;
90
+ }
91
+ function isElementPlaying(element, fallback) {
92
+ return element ? !element.paused && !element.ended : Boolean(fallback);
79
93
  }
80
94
 
81
- // src/modules/background/youtube/lib/parse.ts
95
+ // src/modules/background/youtube/parse.ts
82
96
  var YOUTUBE_ID_PATTERN = /^[a-zA-Z0-9_-]{11}$/;
97
+ var YOUTUBE_HOST_PATH = /^(?:www\.|m\.|music\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)\//i;
83
98
  function parseYouTubeTimeParam(value) {
84
99
  if (value === void 0 || value === null || value === "") return 0;
85
100
  if (typeof value === "number") {
@@ -99,7 +114,6 @@ function parseYouTubeTimeParam(value) {
99
114
  }
100
115
  return 0;
101
116
  }
102
- var YOUTUBE_HOST_PATH = /^(?:www\.|m\.|music\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)\//i;
103
117
  function toUrl(input, {
104
118
  youtubeOnly = false
105
119
  } = {}) {
@@ -249,7 +263,7 @@ function createYouTubeVideoElementProxy(controller) {
249
263
  return proxyVideo;
250
264
  }
251
265
 
252
- // src/modules/background/model/state.ts
266
+ // src/modules/background/state.ts
253
267
  var DEFAULT_BACKGROUND = Object.freeze({
254
268
  animation: null,
255
269
  className: "",
@@ -386,8 +400,6 @@ function computeBackgroundState(background) {
386
400
  youtubeVideoId
387
401
  };
388
402
  }
389
-
390
- // src/modules/background/model/override.ts
391
403
  function mergeOverridePatch(currentPatch, nextPatch) {
392
404
  return {
393
405
  ...currentPatch || {},
@@ -414,78 +426,6 @@ function applyOverrideUpdate(prev, inputs, updater) {
414
426
  pathname: currentPath
415
427
  };
416
428
  }
417
-
418
- // src/modules/background/model/playback.ts
419
- function applyVideoPlaybackState({
420
- isPlaying,
421
- playbackRate,
422
- setVideoPlaying,
423
- videoElement
424
- }) {
425
- if (!videoElement) return;
426
- const numericPlaybackRate = Number(playbackRate);
427
- const resolvedPlaybackRate = Number.isFinite(numericPlaybackRate) && numericPlaybackRate > 0 ? numericPlaybackRate : 1;
428
- try {
429
- if (videoElement.playbackRate !== resolvedPlaybackRate) {
430
- videoElement.playbackRate = resolvedPlaybackRate;
431
- }
432
- } catch {
433
- return;
434
- }
435
- if (!isPlaying) {
436
- if (!videoElement.paused) videoElement.pause();
437
- return;
438
- }
439
- if (videoElement.readyState === 0) {
440
- return;
441
- }
442
- const playPromise = videoElement.play();
443
- if (!playPromise || typeof playPromise.then !== "function") return;
444
- playPromise.then(() => setVideoPlaying(true)).catch((error) => {
445
- if (error?.name === "AbortError" || videoElement.readyState < 2) {
446
- return;
447
- }
448
- if (error?.name === "NotAllowedError") {
449
- videoElement.muted = true;
450
- videoElement.play().then(() => setVideoPlaying(true)).catch(() => {
451
- });
452
- return;
453
- }
454
- setVideoPlaying(false);
455
- });
456
- }
457
- function triggerVideoPlaybackDirect(videoElement, nextPlaying, configuredMuted) {
458
- if (!videoElement) return;
459
- if (nextPlaying) {
460
- videoElement.muted = configuredMuted;
461
- if (!configuredMuted && videoElement.volume === 0) {
462
- videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
463
- }
464
- videoElement.play().catch((err) => {
465
- if (err?.name === "NotAllowedError") {
466
- videoElement.muted = true;
467
- videoElement.play().catch(() => {
468
- });
469
- }
470
- });
471
- } else {
472
- videoElement.pause();
473
- }
474
- }
475
- function syncVideoMutedDirect(videoElement, nextMuted) {
476
- if (!videoElement) return;
477
- videoElement.muted = nextMuted;
478
- if (!nextMuted && videoElement.volume === 0) {
479
- videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
480
- }
481
- }
482
- function syncVideoLoopDirect(videoElement, nextLoop) {
483
- if (!videoElement) return;
484
- videoElement.loop = nextLoop;
485
- }
486
- function isElementPlaying(element, fallback) {
487
- return element ? !element.paused && !element.ended : Boolean(fallback);
488
- }
489
429
  var BackgroundContext = getOrCreateGlobalContext("BackgroundContext", null);
490
430
  function createBackground(initial) {
491
431
  let inputs = initial;
@@ -690,50 +630,102 @@ function BackgroundProvider(t0) {
690
630
  }
691
631
  return t8;
692
632
  }
693
-
694
- // src/modules/background/hooks.ts
695
- var NOOP_BACKGROUND_STORE = createStore(DEFAULT_BACKGROUND_COMPUTED);
696
- function useBackgroundRegistration(config, options) {
697
- useModuleRegistration("background", config, options);
698
- }
699
- function useBackgroundState() {
633
+ function useBackgroundMediaSource(state, actions) {
634
+ const $ = c(11);
635
+ const media = useOptionalMediaActions();
700
636
  const {
701
- store
702
- } = useRequiredContext(BackgroundContext, "useBackgroundState", "BackgroundProvider");
703
- return useStore(store);
704
- }
705
- function useBackgroundActions() {
706
- return useRequiredContext(BackgroundContext, "useBackgroundActions", "BackgroundProvider").actions;
707
- }
708
- function useBackground(config, options) {
709
- const $ = c(3);
710
- useBackgroundRegistration(config, options);
711
- const actions = useBackgroundActions();
712
- const state = useBackgroundState();
637
+ isPlaying,
638
+ isVideo,
639
+ videoElement
640
+ } = state;
641
+ const isLoop = Boolean(state.videoOptions?.loop);
713
642
  let t0;
714
- if ($[0] !== actions || $[1] !== state) {
715
- t0 = {
716
- ...state,
717
- ...actions
643
+ let t1;
644
+ if ($[0] !== actions || $[1] !== isLoop || $[2] !== isPlaying || $[3] !== isVideo || $[4] !== media || $[5] !== videoElement) {
645
+ t0 = () => {
646
+ if (!isVideo) {
647
+ media.removeSource(BACKGROUND_MEDIA_ID);
648
+ return;
649
+ }
650
+ media.upsertSource({
651
+ controls: {
652
+ setMuted: actions.setVideoMuted,
653
+ toggle: actions.toggleVideo,
654
+ toggleLoop: actions.toggleLoop
655
+ },
656
+ element: videoElement ?? null,
657
+ id: BACKGROUND_MEDIA_ID,
658
+ isPlaying,
659
+ kind: "video",
660
+ loop: isLoop
661
+ });
718
662
  };
663
+ t1 = [actions, isLoop, isPlaying, isVideo, media, videoElement];
719
664
  $[0] = actions;
720
- $[1] = state;
721
- $[2] = t0;
665
+ $[1] = isLoop;
666
+ $[2] = isPlaying;
667
+ $[3] = isVideo;
668
+ $[4] = media;
669
+ $[5] = videoElement;
670
+ $[6] = t0;
671
+ $[7] = t1;
722
672
  } else {
723
- t0 = $[2];
673
+ t0 = $[6];
674
+ t1 = $[7];
724
675
  }
725
- return t0;
676
+ useEffect(t0, t1);
677
+ let t2;
678
+ let t3;
679
+ if ($[8] !== media) {
680
+ t2 = () => () => media.removeSource(BACKGROUND_MEDIA_ID);
681
+ t3 = [media];
682
+ $[8] = media;
683
+ $[9] = t2;
684
+ $[10] = t3;
685
+ } else {
686
+ t2 = $[9];
687
+ t3 = $[10];
688
+ }
689
+ useEffect(t2, t3);
726
690
  }
727
- function useOptionalBackgroundState(selector, isEqual) {
728
- const ctx = use(BackgroundContext);
729
- return useStore(ctx?.store ?? NOOP_BACKGROUND_STORE, selector, isEqual);
691
+
692
+ // src/modules/background/motion.ts
693
+ function useBackgroundMotion() {
694
+ return useModuleMotion(backgroundTheme);
730
695
  }
731
- function useOptionalBackgroundActions() {
732
- const ctx = use(BackgroundContext);
733
- return ctx?.actions ?? INERT_BACKGROUND_ACTIONS;
696
+ function getBackgroundMotionConfig(motion2, animation) {
697
+ return {
698
+ animate: animation?.animate ?? motion2.animate,
699
+ exit: animation?.exit ?? motion2.exit,
700
+ exitDurationFactor: Number(animation?.exitDurationFactor),
701
+ initial: animation?.initial ?? motion2.initial,
702
+ transition: animation?.transition ?? motion2.transition
703
+ };
704
+ }
705
+ function getBackgroundExitTransition(motion2, config) {
706
+ const own = config.exit.transition;
707
+ const fallback = motion2.exit.transition;
708
+ const factor = Number.isFinite(config.exitDurationFactor) ? Math.max(0, config.exitDurationFactor) : motion2.exitDurationFactor;
709
+ return {
710
+ ...config.transition,
711
+ delay: 0,
712
+ duration: own?.duration ?? (config.transition.duration ?? motion2.transition.duration ?? 0) * factor,
713
+ ease: own?.ease ?? fallback?.ease
714
+ };
715
+ }
716
+ function toCssDuration(seconds, fallback = 0) {
717
+ const value = Number(seconds);
718
+ return `${Math.max(0, Number.isFinite(value) ? value : fallback) * 1e3}ms`;
719
+ }
720
+ function toCssDelay(seconds) {
721
+ const value = Number(seconds);
722
+ return `${Math.max(0, Number.isFinite(value) ? value : 0) * 1e3}ms`;
723
+ }
724
+ function toCssEasing(easing) {
725
+ return cssEasing(easing);
734
726
  }
735
727
 
736
- // src/modules/background/model/visual.ts
728
+ // src/modules/background/visual.ts
737
729
  var objectFit = (value) => ({
738
730
  objectFit: value
739
731
  });
@@ -759,6 +751,11 @@ var BG_TOKEN_TO_OBJECT_STYLE = Object.freeze({
759
751
  var OBJECT_FITS = Object.freeze(["contain", "cover", "fill", "none", "scale-down"]);
760
752
  var DEFAULT_COLOR = "currentColor";
761
753
  var WIDTH_CLASS = /^(w-|max-w-|min-w-)/;
754
+ var FADE_PERCENT_PER_STRENGTH = 7.5;
755
+ var MIN_FADE_PERCENT = 12;
756
+ var MAX_FADE_PERCENT = 48;
757
+ var WIDTH_FADE_PERCENT = 20;
758
+ var OPACITY_PER_STRENGTH = 0.22;
762
759
  function resolveVideoClassNames(...inputs) {
763
760
  const tokens = inputs.flatMap((input) => typeof input === "string" ? input.replace(/,/g, " ").split(/\s+/) : []).filter(Boolean);
764
761
  return {
@@ -803,18 +800,17 @@ function getVisualStyle(currentStyle = {}) {
803
800
  rightGradient: Number(rightGradient) || 0
804
801
  };
805
802
  }
803
+ var fadePercentFor = (strength) => Math.min(MAX_FADE_PERCENT, Math.max(MIN_FADE_PERCENT, strength * FADE_PERCENT_PER_STRENGTH));
804
+ var opacityFor = (strength) => strength > 0 ? Math.min(1, strength * OPACITY_PER_STRENGTH) : 0;
806
805
  function resolveGradientSettings({
807
806
  fadeEdges = null,
808
807
  hasWidth = false,
809
808
  leftGradient = 0,
810
809
  rightGradient = 0
811
810
  }) {
812
- let leftPercent = 0;
813
- let rightPercent = 0;
814
- if (leftGradient > 0) leftPercent = Math.min(48, Math.max(12, leftGradient * 7.5));
815
- else if (hasWidth && fadeEdges !== false) leftPercent = 20;
816
- if (rightGradient > 0) rightPercent = Math.min(48, Math.max(12, rightGradient * 7.5));
817
- else if (hasWidth && fadeEdges !== false) rightPercent = 20;
811
+ const widthFade = hasWidth && fadeEdges !== false ? WIDTH_FADE_PERCENT : 0;
812
+ let leftPercent = leftGradient > 0 ? fadePercentFor(leftGradient) : widthFade;
813
+ let rightPercent = rightGradient > 0 ? fadePercentFor(rightGradient) : widthFade;
818
814
  if (typeof fadeEdges === "number") {
819
815
  leftPercent = fadeEdges;
820
816
  rightPercent = fadeEdges;
@@ -834,13 +830,11 @@ function resolveGradientSettings({
834
830
  leftPercent = 0;
835
831
  rightPercent = 0;
836
832
  }
837
- const leftOpacity = leftGradient > 0 ? Math.min(1, leftGradient * 0.22) : 0;
838
- const rightOpacity = rightGradient > 0 ? Math.min(1, rightGradient * 0.22) : 0;
839
833
  return {
840
834
  enabled: leftPercent > 0 || rightPercent > 0,
841
- leftOpacity,
835
+ leftOpacity: opacityFor(leftGradient),
842
836
  leftPercent,
843
- rightOpacity,
837
+ rightOpacity: opacityFor(rightGradient),
844
838
  rightPercent
845
839
  };
846
840
  }
@@ -899,8 +893,6 @@ function resolveCssWidth(rawWidth) {
899
893
  }
900
894
  return typeof rawWidth === "number" ? `${rawWidth}px` : String(rawWidth);
901
895
  }
902
-
903
- // src/modules/background/model/video-frame.ts
904
896
  function resolveVideoFrame({
905
897
  baseStyle,
906
898
  className,
@@ -959,99 +951,47 @@ function resolveVideoFrame({
959
951
  };
960
952
  }
961
953
 
962
- // src/modules/background/motion.ts
963
- function useBackgroundMotion() {
964
- return useModuleMotion(backgroundTheme);
965
- }
966
- function getBackgroundMotionConfig(motion2, animation) {
967
- return {
968
- animate: animation?.animate ?? motion2.animate,
969
- exit: animation?.exit ?? motion2.exit,
970
- exitDurationFactor: Number(animation?.exitDurationFactor),
971
- initial: animation?.initial ?? motion2.initial,
972
- transition: animation?.transition ?? motion2.transition
973
- };
974
- }
975
- function getBackgroundExitTransition(motion2, config) {
976
- const own = config.exit.transition;
977
- const fallback = motion2.exit.transition;
978
- const factor = Number.isFinite(config.exitDurationFactor) ? Math.max(0, config.exitDurationFactor) : motion2.exitDurationFactor;
979
- return {
980
- ...config.transition,
981
- delay: 0,
982
- duration: own?.duration ?? (config.transition.duration ?? motion2.transition.duration ?? 0) * factor,
983
- ease: own?.ease ?? fallback?.ease
984
- };
985
- }
986
- function toCssDuration(seconds, fallback = 0) {
987
- const value = Number(seconds);
988
- return `${Math.max(0, Number.isFinite(value) ? value : fallback) * 1e3}ms`;
954
+ // src/modules/background/hooks.ts
955
+ var NOOP_BACKGROUND_STORE = createStore(DEFAULT_BACKGROUND_COMPUTED);
956
+ function useBackgroundRegistration(config, options) {
957
+ useModuleRegistration("background", config, options);
989
958
  }
990
- function toCssDelay(seconds) {
991
- const value = Number(seconds);
992
- return `${Math.max(0, Number.isFinite(value) ? value : 0) * 1e3}ms`;
959
+ function useBackgroundState() {
960
+ const {
961
+ store
962
+ } = useRequiredContext(BackgroundContext, "useBackgroundState", "BackgroundProvider");
963
+ return useStore(store);
993
964
  }
994
- function toCssEasing(easing) {
995
- return cssEasing(easing);
965
+ function useBackgroundActions() {
966
+ return useRequiredContext(BackgroundContext, "useBackgroundActions", "BackgroundProvider").actions;
996
967
  }
997
-
998
- // src/modules/background/hooks/use-background-motion-model.ts
999
- function useBackgroundMotionModel(animation) {
1000
- const $ = c(12);
1001
- const backgroundMotion = useBackgroundMotion();
1002
- const {
1003
- reduced,
1004
- still,
1005
- tempo
1006
- } = useMotionTokens();
1007
- let motionConfig;
1008
- let overlayTransitionStyle;
968
+ function useBackground(config, options) {
969
+ const $ = c(3);
970
+ useBackgroundRegistration(config, options);
971
+ const actions = useBackgroundActions();
972
+ const state = useBackgroundState();
1009
973
  let t0;
1010
- if ($[0] !== animation || $[1] !== backgroundMotion || $[2] !== reduced || $[3] !== still || $[4] !== tempo) {
1011
- motionConfig = getBackgroundMotionConfig(backgroundMotion, retime(animation, {
1012
- reduced,
1013
- still,
1014
- tempo
1015
- }));
1016
- overlayTransitionStyle = {
1017
- transitionDelay: toCssDelay(motionConfig.transition.delay),
1018
- transitionDuration: toCssDuration(motionConfig.transition.duration, backgroundMotion.transition.duration),
1019
- transitionProperty: "opacity",
1020
- transitionTimingFunction: toCssEasing(motionConfig.transition.ease)
1021
- };
1022
- t0 = getBackgroundExitTransition(backgroundMotion, motionConfig);
1023
- $[0] = animation;
1024
- $[1] = backgroundMotion;
1025
- $[2] = reduced;
1026
- $[3] = still;
1027
- $[4] = tempo;
1028
- $[5] = motionConfig;
1029
- $[6] = overlayTransitionStyle;
1030
- $[7] = t0;
1031
- } else {
1032
- motionConfig = $[5];
1033
- overlayTransitionStyle = $[6];
1034
- t0 = $[7];
1035
- }
1036
- const exitTransition = t0;
1037
- let t1;
1038
- if ($[8] !== exitTransition || $[9] !== motionConfig || $[10] !== overlayTransitionStyle) {
1039
- t1 = {
1040
- exitTransition,
1041
- motionConfig,
1042
- overlayTransitionStyle
974
+ if ($[0] !== actions || $[1] !== state) {
975
+ t0 = {
976
+ ...state,
977
+ ...actions
1043
978
  };
1044
- $[8] = exitTransition;
1045
- $[9] = motionConfig;
1046
- $[10] = overlayTransitionStyle;
1047
- $[11] = t1;
979
+ $[0] = actions;
980
+ $[1] = state;
981
+ $[2] = t0;
1048
982
  } else {
1049
- t1 = $[11];
983
+ t0 = $[2];
1050
984
  }
1051
- return t1;
985
+ return t0;
986
+ }
987
+ function useOptionalBackgroundState(selector, isEqual) {
988
+ const ctx = use(BackgroundContext);
989
+ return useStore(ctx?.store ?? NOOP_BACKGROUND_STORE, selector, isEqual);
990
+ }
991
+ function useOptionalBackgroundActions() {
992
+ const ctx = use(BackgroundContext);
993
+ return ctx?.actions ?? INERT_BACKGROUND_ACTIONS;
1052
994
  }
1053
-
1054
- // src/modules/background/hooks/use-background-overlay-model.ts
1055
995
  function resolveBackgroundKey({
1056
996
  image,
1057
997
  isVideo,
@@ -1289,88 +1229,79 @@ function useBackgroundOverlayModel() {
1289
1229
  }
1290
1230
  return t3;
1291
1231
  }
1232
+ function useBackgroundMotionModel(animation) {
1233
+ const $ = c(12);
1234
+ const backgroundMotion = useBackgroundMotion();
1235
+ const {
1236
+ reduced,
1237
+ still,
1238
+ tempo
1239
+ } = useMotionTokens();
1240
+ let motionConfig;
1241
+ let overlayTransitionStyle;
1242
+ let t0;
1243
+ if ($[0] !== animation || $[1] !== backgroundMotion || $[2] !== reduced || $[3] !== still || $[4] !== tempo) {
1244
+ motionConfig = getBackgroundMotionConfig(backgroundMotion, retime(animation, {
1245
+ reduced,
1246
+ still,
1247
+ tempo
1248
+ }));
1249
+ overlayTransitionStyle = {
1250
+ transitionDelay: toCssDelay(motionConfig.transition.delay),
1251
+ transitionDuration: toCssDuration(motionConfig.transition.duration, backgroundMotion.transition.duration),
1252
+ transitionProperty: "opacity",
1253
+ transitionTimingFunction: toCssEasing(motionConfig.transition.ease)
1254
+ };
1255
+ t0 = getBackgroundExitTransition(backgroundMotion, motionConfig);
1256
+ $[0] = animation;
1257
+ $[1] = backgroundMotion;
1258
+ $[2] = reduced;
1259
+ $[3] = still;
1260
+ $[4] = tempo;
1261
+ $[5] = motionConfig;
1262
+ $[6] = overlayTransitionStyle;
1263
+ $[7] = t0;
1264
+ } else {
1265
+ motionConfig = $[5];
1266
+ overlayTransitionStyle = $[6];
1267
+ t0 = $[7];
1268
+ }
1269
+ const exitTransition = t0;
1270
+ let t1;
1271
+ if ($[8] !== exitTransition || $[9] !== motionConfig || $[10] !== overlayTransitionStyle) {
1272
+ t1 = {
1273
+ exitTransition,
1274
+ motionConfig,
1275
+ overlayTransitionStyle
1276
+ };
1277
+ $[8] = exitTransition;
1278
+ $[9] = motionConfig;
1279
+ $[10] = overlayTransitionStyle;
1280
+ $[11] = t1;
1281
+ } else {
1282
+ t1 = $[11];
1283
+ }
1284
+ return t1;
1285
+ }
1292
1286
 
1293
- // src/modules/background/youtube/lib/audio.ts
1294
- var AUDIO_SEEK_COOLDOWN_MS = 1500;
1295
- var AUDIO_DRIFT_LIMIT = 0.35;
1296
- var AUDIO_DRIFT_LIMIT_SILENT = 0.5;
1297
- var AUDIO_VOLUME_EPSILON = 5e-3;
1298
- var AUDIO_MIN_READY_STATE = 2;
1299
- var AUDIO_SYNC_EVENTS = ["play", "playing", "pause", "waiting", "volumechange", "ratechange"];
1300
- function setElementMuted(video, muted) {
1301
- video.muted = muted;
1302
- if (!muted && video.volume === 0) video.volume = DEFAULT_AUDIBLE_VOLUME;
1303
- }
1304
- function unlockAudioOnGesture(unlock) {
1305
- const handler = () => {
1306
- unlock();
1307
- window.removeEventListener("pointerdown", handler);
1308
- window.removeEventListener("keydown", handler);
1309
- };
1310
- window.addEventListener("pointerdown", handler, {
1311
- once: true
1312
- });
1313
- window.addEventListener("keydown", handler, {
1314
- once: true
1315
- });
1316
- }
1317
- function resolveCompanionVolume(volume) {
1318
- const numeric = Number(volume);
1319
- return Math.max(0, Math.min(1, Number.isFinite(numeric) ? numeric : 1));
1320
- }
1321
- function syncCompanionAudioElements({
1322
- audio,
1323
- forceSeek,
1324
- seekClock,
1325
- video
1326
- }) {
1327
- if (!video || !audio) return;
1328
- try {
1329
- const targetRate = Number(video.playbackRate) || 1;
1330
- if (audio.playbackRate !== targetRate) audio.playbackRate = targetRate;
1331
- if (audio.readyState < AUDIO_MIN_READY_STATE || !Number.isFinite(audio.duration) || audio.duration <= 0) {
1332
- return;
1333
- }
1334
- const volume = resolveCompanionVolume(video.volume);
1335
- if (Math.abs(audio.volume - volume) > AUDIO_VOLUME_EPSILON) {
1336
- audio.volume = volume;
1337
- }
1338
- const isSilent = Boolean(video.muted) || volume === 0;
1339
- if (audio.muted !== isSilent) audio.muted = isSilent;
1340
- if (video.paused || video.ended || video.seeking) {
1341
- if (!audio.paused) audio.pause();
1342
- return;
1343
- }
1344
- const now = performance.now();
1345
- const drift = Math.abs(audio.currentTime - video.currentTime);
1346
- const maxDrift = isSilent ? AUDIO_DRIFT_LIMIT_SILENT : AUDIO_DRIFT_LIMIT;
1347
- if (forceSeek || drift > maxDrift && now - seekClock.current > AUDIO_SEEK_COOLDOWN_MS) {
1348
- seekClock.current = now;
1349
- audio.currentTime = video.currentTime;
1350
- }
1351
- if (audio.paused) audio.play().catch(() => {
1352
- });
1353
- } catch {
1354
- }
1355
- }
1356
-
1357
- // src/modules/background/youtube/lib/timing.ts
1358
- function scheduleRetryTimer(timerIds, callback, delay) {
1359
- const timerId = window.setTimeout(() => {
1360
- timerIds.delete(timerId);
1361
- try {
1362
- callback();
1363
- } catch {
1364
- }
1365
- }, delay);
1366
- timerIds.add(timerId);
1287
+ // src/modules/background/youtube/timing.ts
1288
+ var IFRAME_MIN_END_MARGIN = 0.4;
1289
+ function scheduleRetryTimer(timerIds, callback, delay) {
1290
+ const timerId = window.setTimeout(() => {
1291
+ timerIds.delete(timerId);
1292
+ try {
1293
+ callback();
1294
+ } catch (error) {
1295
+ report("Background playback retry", error, "warn");
1296
+ }
1297
+ }, delay);
1298
+ timerIds.add(timerId);
1367
1299
  }
1368
1300
  function resolveEffectiveEnd(endTime, corp, duration) {
1369
1301
  if (endTime > 0) return endTime;
1370
1302
  if (corp > 0 && duration > 0) return duration - corp;
1371
1303
  return 0;
1372
1304
  }
1373
- var IFRAME_MIN_END_MARGIN = 0.4;
1374
1305
  function resolveIframeSafetyEnd(endTime, corp, duration) {
1375
1306
  if (endTime > 0) return endTime;
1376
1307
  if (duration > 0) return duration - Math.max(corp, IFRAME_MIN_END_MARGIN);
@@ -1384,213 +1315,303 @@ function isWithinCorp(currentTime, duration, corp) {
1384
1315
  if (!duration) return false;
1385
1316
  return corp > 0 && currentTime >= duration - corp;
1386
1317
  }
1387
-
1388
- // src/modules/background/youtube/lib/video-events.ts
1389
- var HAVE_CURRENT_DATA = 2;
1390
- var ERROR_RESUME_RETRY_DELAY_MS = 150;
1391
- var LOAD_RETRY_DELAY_MS = 200;
1392
- var AUDIO_RETRY_DELAY_MS = 200;
1393
- var MAX_VIDEO_LOAD_RETRIES = 1;
1394
- var MAX_AUDIO_LOAD_RETRIES = 1;
1395
- function playWithMutedFallback({
1396
- forceSeek,
1397
- live,
1398
- setVideoPlaying,
1399
- syncCompanionAudio,
1400
- unlockAudio,
1401
- video,
1402
- videoRef
1403
- }) {
1404
- const onPlayed = () => {
1405
- setVideoPlaying(true);
1406
- syncCompanionAudio(forceSeek);
1407
- };
1408
- video.play().then(onPlayed).catch((error) => {
1409
- if (error?.name !== "NotAllowedError") return;
1410
- video.muted = true;
1411
- video.play().then(() => {
1412
- onPlayed();
1413
- if (!unlockAudio) return;
1414
- unlockAudioOnGesture(() => {
1415
- const current = videoRef.current;
1416
- if (!live.current.isMuted && current) {
1417
- setElementMuted(current, false);
1418
- }
1419
- });
1420
- }).catch(() => {
1421
- });
1422
- });
1423
- }
1424
- function endVideoPlayback(ctx) {
1318
+ function NativeVideo(t0) {
1319
+ const $ = c(22);
1425
1320
  const {
1426
- audioRef,
1427
- live,
1321
+ corp,
1322
+ isLoop,
1323
+ isMuted,
1324
+ isPlaying,
1325
+ playbackRate,
1326
+ setVideoElement,
1428
1327
  setVideoPlaying,
1429
- syncCompanionAudio,
1430
- videoRef
1431
- } = ctx;
1432
- const video = videoRef.current;
1433
- const audio = audioRef.current;
1434
- if (!video) return;
1435
- if (video.loop || live.current.isLoop) {
1436
- const resetTime = Math.max(0, live.current.startTime || 0);
1437
- video.currentTime = resetTime;
1438
- if (audio && audio.readyState >= HAVE_CURRENT_DATA) {
1439
- audio.currentTime = resetTime;
1440
- }
1441
- video.play().then(() => {
1442
- setVideoPlaying(true);
1443
- syncCompanionAudio(true);
1444
- }).catch(() => {
1445
- });
1446
- return;
1328
+ shouldAutoPlay,
1329
+ src,
1330
+ style,
1331
+ className
1332
+ } = t0;
1333
+ let t1;
1334
+ if ($[0] !== className || $[1] !== corp || $[2] !== isLoop || $[3] !== isMuted || $[4] !== isPlaying || $[5] !== playbackRate || $[6] !== setVideoElement || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay || $[9] !== src || $[10] !== style) {
1335
+ t1 = {
1336
+ corp,
1337
+ isLoop,
1338
+ isMuted,
1339
+ isPlaying,
1340
+ playbackRate,
1341
+ setVideoElement,
1342
+ setVideoPlaying,
1343
+ shouldAutoPlay,
1344
+ src,
1345
+ style,
1346
+ className
1347
+ };
1348
+ $[0] = className;
1349
+ $[1] = corp;
1350
+ $[2] = isLoop;
1351
+ $[3] = isMuted;
1352
+ $[4] = isPlaying;
1353
+ $[5] = playbackRate;
1354
+ $[6] = setVideoElement;
1355
+ $[7] = setVideoPlaying;
1356
+ $[8] = shouldAutoPlay;
1357
+ $[9] = src;
1358
+ $[10] = style;
1359
+ $[11] = t1;
1360
+ } else {
1361
+ t1 = $[11];
1447
1362
  }
1448
- video.pause();
1449
- if (audio && !audio.paused) audio.pause();
1450
- setVideoPlaying(false);
1451
- }
1452
- function handleCompanionAudioError(ctx) {
1453
1363
  const {
1454
- audioRef,
1455
- live,
1456
- scheduleRetry,
1457
- setUseIframeFallback,
1458
- videoRef
1459
- } = ctx;
1460
- const audio = audioRef.current;
1461
- if (!audio) return;
1462
- ctx.audioErrorRetryCountRef.current += 1;
1463
- if (ctx.audioErrorRetryCountRef.current <= MAX_AUDIO_LOAD_RETRIES) {
1464
- scheduleRetry(() => {
1465
- audio.load();
1466
- if (videoRef.current) {
1467
- audio.currentTime = videoRef.current.currentTime || 0;
1468
- }
1469
- }, AUDIO_RETRY_DELAY_MS);
1470
- return;
1471
- }
1472
- if (!live.current.isMuted) {
1473
- setUseIframeFallback(true);
1364
+ videoRef,
1365
+ handleEnded,
1366
+ handleTimeUpdate,
1367
+ handleLoadedData
1368
+ } = useNativeVideoModel(t1);
1369
+ let t2;
1370
+ if ($[12] !== className || $[13] !== handleEnded || $[14] !== handleLoadedData || $[15] !== handleTimeUpdate || $[16] !== isLoop || $[17] !== isMuted || $[18] !== src || $[19] !== style || $[20] !== videoRef) {
1371
+ t2 = /* @__PURE__ */ jsx("video", { ref: videoRef, src, className, preload: "auto", muted: isMuted, loop: isLoop, playsInline: true, style, onTimeUpdate: handleTimeUpdate, onEnded: handleEnded, onLoadedData: handleLoadedData });
1372
+ $[12] = className;
1373
+ $[13] = handleEnded;
1374
+ $[14] = handleLoadedData;
1375
+ $[15] = handleTimeUpdate;
1376
+ $[16] = isLoop;
1377
+ $[17] = isMuted;
1378
+ $[18] = src;
1379
+ $[19] = style;
1380
+ $[20] = videoRef;
1381
+ $[21] = t2;
1382
+ } else {
1383
+ t2 = $[21];
1474
1384
  }
1385
+ return t2;
1475
1386
  }
1476
- function onTimeUpdate(ctx) {
1477
- const video = ctx.videoRef.current;
1478
- if (!video) return;
1479
- if (video.currentTime > 0 && video.readyState >= HAVE_CURRENT_DATA) {
1480
- ctx.setIsFrameReady(true);
1481
- ctx.setIsBuffering(false);
1387
+ function pauseQuietly(video) {
1388
+ try {
1389
+ video?.pause();
1390
+ } catch {
1482
1391
  }
1483
- const duration = Number(video.duration) || 0;
1392
+ }
1393
+ function useNativeVideoModel(t0) {
1394
+ const $ = c(27);
1484
1395
  const {
1485
1396
  corp,
1486
- endTime
1487
- } = ctx.live.current;
1488
- if (hasPassedEnd(video.currentTime, endTime, corp, duration)) {
1489
- ctx.handleEnded();
1490
- }
1491
- }
1492
- function onPlay(ctx) {
1493
- const video = ctx.videoRef.current;
1494
- ctx.hasLoadedVideoRef.current = true;
1495
- if (video && !ctx.live.current.isMuted && video.muted) {
1496
- setElementMuted(video, false);
1397
+ isMuted,
1398
+ isPlaying,
1399
+ playbackRate,
1400
+ setVideoElement,
1401
+ setVideoPlaying,
1402
+ shouldAutoPlay,
1403
+ src
1404
+ } = t0;
1405
+ const videoRef = useRef(null);
1406
+ let t1;
1407
+ if ($[0] !== setVideoPlaying) {
1408
+ t1 = () => {
1409
+ const video = videoRef.current;
1410
+ if (!video) {
1411
+ return;
1412
+ }
1413
+ if (video.loop) {
1414
+ video.currentTime = 0;
1415
+ video.play().catch(_temp);
1416
+ return;
1417
+ }
1418
+ video.pause();
1419
+ setVideoPlaying(false);
1420
+ };
1421
+ $[0] = setVideoPlaying;
1422
+ $[1] = t1;
1423
+ } else {
1424
+ t1 = $[1];
1497
1425
  }
1498
- if (!video || video.readyState < HAVE_CURRENT_DATA) ctx.setIsBuffering(true);
1499
- ctx.setVideoPlaying(true);
1500
- ctx.syncCompanionAudio(false);
1501
- }
1502
- function onPlaying(ctx) {
1503
- ctx.hasLoadedVideoRef.current = true;
1504
- ctx.setIsFrameReady(true);
1505
- ctx.setIsBuffering(false);
1506
- ctx.setVideoPlaying(true);
1507
- ctx.syncCompanionAudio(false);
1508
- }
1509
- function onPause(ctx) {
1510
- const video = ctx.videoRef.current;
1511
- ctx.syncCompanionAudio(false);
1512
- ctx.setIsBuffering(false);
1513
- if (video && !video.seeking && !video.ended && !ctx.live.current.isPlaying) {
1514
- ctx.setVideoPlaying(false);
1426
+ const handleEnded = t1;
1427
+ let t2;
1428
+ if ($[2] !== corp || $[3] !== handleEnded) {
1429
+ t2 = () => {
1430
+ const video_0 = videoRef.current;
1431
+ if (video_0 && isWithinCorp(video_0.currentTime, video_0.duration, corp)) {
1432
+ handleEnded();
1433
+ }
1434
+ };
1435
+ $[2] = corp;
1436
+ $[3] = handleEnded;
1437
+ $[4] = t2;
1438
+ } else {
1439
+ t2 = $[4];
1515
1440
  }
1516
- }
1517
- function onSeeked(ctx) {
1518
- const video = ctx.videoRef.current;
1519
- if (!video) return;
1520
- const {
1521
- isPlaying
1522
- } = ctx.live.current;
1523
- ctx.setIsFrameReady(true);
1524
- if (video.readyState >= HAVE_CURRENT_DATA && (!isPlaying || !video.paused)) {
1525
- ctx.setIsBuffering(false);
1441
+ const handleTimeUpdate = t2;
1442
+ let t3;
1443
+ if ($[5] !== isMuted || $[6] !== playbackRate || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay) {
1444
+ t3 = () => {
1445
+ const video_1 = videoRef.current;
1446
+ if (!video_1) {
1447
+ return;
1448
+ }
1449
+ video_1.playbackRate = playbackRate;
1450
+ if (!shouldAutoPlay) {
1451
+ return;
1452
+ }
1453
+ if (isMuted) {
1454
+ video_1.muted = true;
1455
+ }
1456
+ video_1.play().then(() => setVideoPlaying(true)).catch((error_0) => {
1457
+ report("Background autoplay", error_0, "warn");
1458
+ setVideoPlaying(false);
1459
+ });
1460
+ };
1461
+ $[5] = isMuted;
1462
+ $[6] = playbackRate;
1463
+ $[7] = setVideoPlaying;
1464
+ $[8] = shouldAutoPlay;
1465
+ $[9] = t3;
1466
+ } else {
1467
+ t3 = $[9];
1526
1468
  }
1527
- ctx.syncCompanionAudio(true);
1528
- if (isPlaying && video.paused) {
1529
- video.play().then(() => {
1530
- ctx.setVideoPlaying(true);
1531
- ctx.syncCompanionAudio(true);
1532
- }).catch(() => {
1533
- });
1469
+ const handleLoadedData = t3;
1470
+ let t4;
1471
+ if ($[10] !== setVideoElement) {
1472
+ t4 = () => {
1473
+ const video_2 = videoRef.current;
1474
+ setVideoElement(video_2);
1475
+ return () => {
1476
+ pauseQuietly(video_2);
1477
+ };
1478
+ };
1479
+ $[10] = setVideoElement;
1480
+ $[11] = t4;
1481
+ } else {
1482
+ t4 = $[11];
1534
1483
  }
1535
- }
1536
- function onCanPlay(ctx) {
1537
- const video = ctx.videoRef.current;
1538
- if (!video) return;
1539
- ctx.hasLoadedVideoRef.current = true;
1540
- if (!ctx.live.current.isPlaying) {
1541
- ctx.setIsFrameReady(true);
1542
- ctx.setIsBuffering(false);
1543
- } else if (video.paused) {
1544
- setElementMuted(video, Boolean(ctx.live.current.isMuted));
1545
- ctx.playWithFallback(video, false, true);
1484
+ let t5;
1485
+ if ($[12] !== setVideoElement || $[13] !== src) {
1486
+ t5 = [src, setVideoElement];
1487
+ $[12] = setVideoElement;
1488
+ $[13] = src;
1489
+ $[14] = t5;
1490
+ } else {
1491
+ t5 = $[14];
1546
1492
  }
1547
- }
1548
- function onLoadedMetadata(ctx) {
1549
- const video = ctx.videoRef.current;
1550
- if (!video) return;
1551
- ctx.hasLoadedVideoRef.current = true;
1552
- if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
1553
- video.currentTime = ctx.startTime;
1554
- if (ctx.audioRef.current) ctx.audioRef.current.currentTime = ctx.startTime;
1493
+ useEffect(t4, t5);
1494
+ let t6;
1495
+ let t7;
1496
+ if ($[15] !== setVideoElement) {
1497
+ t6 = () => () => setVideoElement(null);
1498
+ t7 = [setVideoElement];
1499
+ $[15] = setVideoElement;
1500
+ $[16] = t6;
1501
+ $[17] = t7;
1502
+ } else {
1503
+ t6 = $[16];
1504
+ t7 = $[17];
1555
1505
  }
1556
- }
1557
- function onLoadedData(ctx) {
1558
- const video = ctx.videoRef.current;
1559
- if (!video) return;
1560
- ctx.hasLoadedVideoRef.current = true;
1561
- video.playbackRate = ctx.playbackRate;
1562
- setElementMuted(video, Boolean(ctx.live.current.isMuted));
1563
- if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
1564
- video.currentTime = ctx.startTime;
1506
+ useEffect(t6, t7);
1507
+ let t8;
1508
+ let t9;
1509
+ if ($[18] !== isPlaying || $[19] !== playbackRate || $[20] !== setVideoPlaying) {
1510
+ t8 = () => {
1511
+ applyVideoPlaybackState({
1512
+ isPlaying,
1513
+ playbackRate,
1514
+ setVideoPlaying,
1515
+ videoElement: videoRef.current
1516
+ });
1517
+ };
1518
+ t9 = [isPlaying, playbackRate, setVideoPlaying];
1519
+ $[18] = isPlaying;
1520
+ $[19] = playbackRate;
1521
+ $[20] = setVideoPlaying;
1522
+ $[21] = t8;
1523
+ $[22] = t9;
1524
+ } else {
1525
+ t8 = $[21];
1526
+ t9 = $[22];
1565
1527
  }
1566
- if (!ctx.live.current.isPlaying) {
1567
- ctx.setIsFrameReady(true);
1568
- ctx.setIsBuffering(false);
1569
- } else if (video.paused) {
1570
- ctx.playWithFallback(video, true, false);
1528
+ useEffect(t8, t9);
1529
+ let t10;
1530
+ if ($[23] !== handleEnded || $[24] !== handleLoadedData || $[25] !== handleTimeUpdate) {
1531
+ t10 = {
1532
+ videoRef,
1533
+ handleEnded,
1534
+ handleTimeUpdate,
1535
+ handleLoadedData
1536
+ };
1537
+ $[23] = handleEnded;
1538
+ $[24] = handleLoadedData;
1539
+ $[25] = handleTimeUpdate;
1540
+ $[26] = t10;
1541
+ } else {
1542
+ t10 = $[26];
1571
1543
  }
1544
+ return t10;
1572
1545
  }
1573
- function onError(ctx) {
1574
- const video = ctx.videoRef.current;
1575
- if (video && ctx.hasLoadedVideoRef.current) {
1576
- const resumeTime = video.currentTime || 0;
1577
- ctx.scheduleRetry(() => {
1578
- video.load();
1579
- video.currentTime = resumeTime;
1580
- if (ctx.live.current.isPlaying) video.play().catch(() => {
1581
- });
1582
- }, ERROR_RESUME_RETRY_DELAY_MS);
1583
- return;
1584
- }
1585
- ctx.errorRetryCountRef.current += 1;
1586
- if (video && ctx.errorRetryCountRef.current <= MAX_VIDEO_LOAD_RETRIES) {
1587
- ctx.scheduleRetry(() => video.load(), LOAD_RETRY_DELAY_MS);
1588
- return;
1546
+ function _temp(error) {
1547
+ return report("Background loop play", error, "warn");
1548
+ }
1549
+
1550
+ // src/modules/background/youtube/audio.ts
1551
+ var AUDIO_SEEK_COOLDOWN_MS = 1500;
1552
+ var AUDIO_DRIFT_LIMIT = 0.35;
1553
+ var AUDIO_DRIFT_LIMIT_SILENT = 0.5;
1554
+ var AUDIO_VOLUME_EPSILON = 5e-3;
1555
+ var AUDIO_MIN_READY_STATE = 2;
1556
+ var AUDIO_SYNC_EVENTS = ["play", "playing", "pause", "waiting", "volumechange", "ratechange"];
1557
+ function setElementMuted(video, muted) {
1558
+ video.muted = muted;
1559
+ if (!muted && video.volume === 0) video.volume = DEFAULT_AUDIBLE_VOLUME;
1560
+ }
1561
+ function unlockAudioOnGesture(unlock) {
1562
+ const handler = () => {
1563
+ unlock();
1564
+ window.removeEventListener("pointerdown", handler);
1565
+ window.removeEventListener("keydown", handler);
1566
+ };
1567
+ window.addEventListener("pointerdown", handler, {
1568
+ once: true
1569
+ });
1570
+ window.addEventListener("keydown", handler, {
1571
+ once: true
1572
+ });
1573
+ }
1574
+ function resolveCompanionVolume(volume) {
1575
+ const numeric = Number(volume);
1576
+ return Math.max(0, Math.min(1, Number.isFinite(numeric) ? numeric : 1));
1577
+ }
1578
+ function syncCompanionAudioElements({
1579
+ audio,
1580
+ forceSeek,
1581
+ seekClock,
1582
+ video
1583
+ }) {
1584
+ if (!video || !audio) return;
1585
+ try {
1586
+ const targetRate = Number(video.playbackRate) || 1;
1587
+ if (audio.playbackRate !== targetRate) audio.playbackRate = targetRate;
1588
+ if (audio.readyState < AUDIO_MIN_READY_STATE || !Number.isFinite(audio.duration) || audio.duration <= 0) {
1589
+ return;
1590
+ }
1591
+ const volume = resolveCompanionVolume(video.volume);
1592
+ if (Math.abs(audio.volume - volume) > AUDIO_VOLUME_EPSILON) {
1593
+ audio.volume = volume;
1594
+ }
1595
+ const isSilent = Boolean(video.muted) || volume === 0;
1596
+ if (audio.muted !== isSilent) audio.muted = isSilent;
1597
+ if (video.paused || video.ended || video.seeking) {
1598
+ if (!audio.paused) audio.pause();
1599
+ return;
1600
+ }
1601
+ const now = performance.now();
1602
+ const drift = Math.abs(audio.currentTime - video.currentTime);
1603
+ const maxDrift = isSilent ? AUDIO_DRIFT_LIMIT_SILENT : AUDIO_DRIFT_LIMIT;
1604
+ if (forceSeek || drift > maxDrift && now - seekClock.current > AUDIO_SEEK_COOLDOWN_MS) {
1605
+ seekClock.current = now;
1606
+ audio.currentTime = video.currentTime;
1607
+ }
1608
+ if (audio.paused) audio.play().catch(() => {
1609
+ });
1610
+ } catch {
1589
1611
  }
1590
- ctx.setUseIframeFallback(true);
1591
1612
  }
1592
1613
 
1593
- // src/modules/background/youtube/lib/iframe.ts
1614
+ // src/modules/background/youtube/iframe.ts
1594
1615
  var PLAYER_STATE = {
1595
1616
  ENDED: 0,
1596
1617
  PLAYING: 1,
@@ -1624,125 +1645,6 @@ function setHighQuality(player) {
1624
1645
  player?.setPlaybackQualityRange?.("hd1080", "hd1080");
1625
1646
  player?.setPlaybackQuality?.("hd1080");
1626
1647
  }
1627
-
1628
- // src/modules/background/youtube/lib/iframe-engine.ts
1629
- function createIframeEngine({
1630
- emit,
1631
- getPlayer,
1632
- getProxy,
1633
- isDisposed,
1634
- live,
1635
- setIsBuffering,
1636
- setIsFrameReady,
1637
- setPlayer,
1638
- setVideoElement,
1639
- setVideoPlaying,
1640
- startProgress,
1641
- state
1642
- }) {
1643
- const restart = (target) => {
1644
- const restartAt = Math.max(0, live.current.startTime || 0);
1645
- target?.seekTo?.(restartAt, true);
1646
- target?.playVideo?.();
1647
- return restartAt;
1648
- };
1649
- const trackProgress = () => {
1650
- const current = getPlayer();
1651
- if (!current || typeof current.getCurrentTime !== "function") return;
1652
- const time = Number(current.getCurrentTime()) || 0;
1653
- const duration = Number(current.getDuration?.()) || state.duration;
1654
- state.currentTime = time;
1655
- if (duration > 0 && duration !== state.duration) {
1656
- state.duration = duration;
1657
- emit("durationchange");
1658
- }
1659
- const {
1660
- corp,
1661
- endTime,
1662
- isLoop: loops
1663
- } = live.current;
1664
- const safetyEnd = resolveIframeSafetyEnd(endTime, corp, duration);
1665
- if (safetyEnd > 0 && time >= safetyEnd) {
1666
- if (state.loop || loops) {
1667
- state.currentTime = restart(current);
1668
- } else {
1669
- current.pauseVideo?.();
1670
- state.paused = true;
1671
- setVideoPlaying(false);
1672
- }
1673
- }
1674
- emit("timeupdate");
1675
- };
1676
- const handleReady = (event) => {
1677
- if (isDisposed()) return;
1678
- const target = event.target;
1679
- setPlayer(target ?? null);
1680
- state.duration = Number(target?.getDuration?.()) || 0;
1681
- const {
1682
- isMuted: muted,
1683
- isPlaying,
1684
- playbackRate: rate
1685
- } = live.current;
1686
- if (rate !== 1) target?.setPlaybackRate?.(rate);
1687
- if (muted) {
1688
- target?.mute?.();
1689
- } else {
1690
- target?.unMute?.();
1691
- target?.setVolume?.(toPlayerVolume(DEFAULT_AUDIBLE_VOLUME));
1692
- }
1693
- if (live.current.shouldAutoPlay && isPlaying) {
1694
- setHighQuality(target);
1695
- target?.playVideo?.();
1696
- state.paused = false;
1697
- setVideoPlaying(true);
1698
- }
1699
- const proxy = getProxy();
1700
- if (proxy) {
1701
- setVideoElement(proxy);
1702
- emit("loadedmetadata");
1703
- emit("durationchange");
1704
- }
1705
- startProgress(trackProgress);
1706
- };
1707
- const handleStateChange = (event) => {
1708
- if (isDisposed()) return;
1709
- switch (event.data) {
1710
- case PLAYER_STATE.PLAYING:
1711
- setHighQuality(event.target);
1712
- state.paused = false;
1713
- setIsFrameReady(true);
1714
- setIsBuffering(false);
1715
- setVideoPlaying(true);
1716
- emit("play");
1717
- emit("playing");
1718
- break;
1719
- case PLAYER_STATE.BUFFERING:
1720
- setIsBuffering(true);
1721
- break;
1722
- case PLAYER_STATE.PAUSED:
1723
- state.paused = true;
1724
- setIsBuffering(false);
1725
- setVideoPlaying(false);
1726
- emit("pause");
1727
- break;
1728
- case PLAYER_STATE.ENDED:
1729
- if (state.loop || live.current.isLoop) {
1730
- restart(getPlayer());
1731
- } else {
1732
- state.paused = true;
1733
- setVideoPlaying(false);
1734
- emit("ended");
1735
- }
1736
- break;
1737
- }
1738
- };
1739
- return {
1740
- handleReady,
1741
- handleStateChange
1742
- };
1743
- }
1744
-
1745
- // src/modules/background/youtube/lib/iframe-proxy.ts
1746
1648
  function createIframeProxyController({
1747
1649
  player,
1748
1650
  setVideoPlaying,
@@ -1841,7 +1743,7 @@ function createIframePlaybackState({
1841
1743
  };
1842
1744
  }
1843
1745
 
1844
- // src/modules/background/youtube/hooks/use-youtube-iframe-player.ts
1746
+ // src/modules/background/youtube/use-iframe-player.ts
1845
1747
  var PROGRESS_INTERVAL_MS = 200;
1846
1748
  function destroyQuietly(player) {
1847
1749
  try {
@@ -2004,32 +1906,123 @@ function useYouTubeIframePlayer(t0) {
2004
1906
  }
2005
1907
  useEffect(t3, t4);
2006
1908
  }
2007
-
2008
- // src/modules/background/youtube/hooks/use-youtube-stream-sources.ts
2009
- function useYouTubeStreamSources({
2010
- codec,
2011
- posterUrl,
2012
- quality,
2013
- showPoster,
2014
- videoId
1909
+ function createIframeEngine({
1910
+ emit,
1911
+ getPlayer,
1912
+ getProxy,
1913
+ isDisposed,
1914
+ live,
1915
+ setIsBuffering,
1916
+ setIsFrameReady,
1917
+ setPlayer,
1918
+ setVideoElement,
1919
+ setVideoPlaying,
1920
+ startProgress,
1921
+ state
2015
1922
  }) {
2016
- const videoStreamUrl = getYouTubeStreamUrl(videoId, {
2017
- codec,
2018
- quality,
2019
- stream: "video"
2020
- });
2021
- const audioStreamUrl = getYouTubeStreamUrl(videoId, {
2022
- stream: "audio"
2023
- });
2024
- const resolvedPoster = showPoster ? posterUrl || getYouTubeThumbnailUrl(videoId, true) : null;
1923
+ const restart = (target) => {
1924
+ const restartAt = Math.max(0, live.current.startTime || 0);
1925
+ target?.seekTo?.(restartAt, true);
1926
+ target?.playVideo?.();
1927
+ return restartAt;
1928
+ };
1929
+ const trackProgress = () => {
1930
+ const current = getPlayer();
1931
+ if (!current || typeof current.getCurrentTime !== "function") return;
1932
+ const time = Number(current.getCurrentTime()) || 0;
1933
+ const duration = Number(current.getDuration?.()) || state.duration;
1934
+ state.currentTime = time;
1935
+ if (duration > 0 && duration !== state.duration) {
1936
+ state.duration = duration;
1937
+ emit("durationchange");
1938
+ }
1939
+ const {
1940
+ corp,
1941
+ endTime,
1942
+ isLoop: loops
1943
+ } = live.current;
1944
+ const safetyEnd = resolveIframeSafetyEnd(endTime, corp, duration);
1945
+ if (safetyEnd > 0 && time >= safetyEnd) {
1946
+ if (state.loop || loops) {
1947
+ state.currentTime = restart(current);
1948
+ } else {
1949
+ current.pauseVideo?.();
1950
+ state.paused = true;
1951
+ setVideoPlaying(false);
1952
+ }
1953
+ }
1954
+ emit("timeupdate");
1955
+ };
1956
+ const handleReady = (event) => {
1957
+ if (isDisposed()) return;
1958
+ const target = event.target;
1959
+ setPlayer(target ?? null);
1960
+ state.duration = Number(target?.getDuration?.()) || 0;
1961
+ const {
1962
+ isMuted: muted,
1963
+ isPlaying,
1964
+ playbackRate: rate
1965
+ } = live.current;
1966
+ if (rate !== 1) target?.setPlaybackRate?.(rate);
1967
+ if (muted) {
1968
+ target?.mute?.();
1969
+ } else {
1970
+ target?.unMute?.();
1971
+ target?.setVolume?.(toPlayerVolume(DEFAULT_AUDIBLE_VOLUME));
1972
+ }
1973
+ if (live.current.shouldAutoPlay && isPlaying) {
1974
+ setHighQuality(target);
1975
+ target?.playVideo?.();
1976
+ state.paused = false;
1977
+ setVideoPlaying(true);
1978
+ }
1979
+ const proxy = getProxy();
1980
+ if (proxy) {
1981
+ setVideoElement(proxy);
1982
+ emit("loadedmetadata");
1983
+ emit("durationchange");
1984
+ }
1985
+ startProgress(trackProgress);
1986
+ };
1987
+ const handleStateChange = (event) => {
1988
+ if (isDisposed()) return;
1989
+ switch (event.data) {
1990
+ case PLAYER_STATE.PLAYING:
1991
+ setHighQuality(event.target);
1992
+ state.paused = false;
1993
+ setIsFrameReady(true);
1994
+ setIsBuffering(false);
1995
+ setVideoPlaying(true);
1996
+ emit("play");
1997
+ emit("playing");
1998
+ break;
1999
+ case PLAYER_STATE.BUFFERING:
2000
+ setIsBuffering(true);
2001
+ break;
2002
+ case PLAYER_STATE.PAUSED:
2003
+ state.paused = true;
2004
+ setIsBuffering(false);
2005
+ setVideoPlaying(false);
2006
+ emit("pause");
2007
+ break;
2008
+ case PLAYER_STATE.ENDED:
2009
+ if (state.loop || live.current.isLoop) {
2010
+ restart(getPlayer());
2011
+ } else {
2012
+ state.paused = true;
2013
+ setVideoPlaying(false);
2014
+ emit("ended");
2015
+ }
2016
+ break;
2017
+ }
2018
+ };
2025
2019
  return {
2026
- audioStreamUrl,
2027
- resolvedPoster,
2028
- videoStreamUrl
2020
+ handleReady,
2021
+ handleStateChange
2029
2022
  };
2030
2023
  }
2031
2024
  var AUDIO_SYNC_INTERVAL_MS = 1e3;
2032
- function pauseQuietly(video, audio) {
2025
+ function pauseQuietly2(video, audio) {
2033
2026
  try {
2034
2027
  video.pause();
2035
2028
  audio?.pause();
@@ -2074,13 +2067,13 @@ function useYouTubeVideoSync(t0) {
2074
2067
  const syncTimer = window.setInterval(onSync, AUDIO_SYNC_INTERVAL_MS);
2075
2068
  return () => {
2076
2069
  window.clearInterval(syncTimer);
2077
- retryTimerIds.forEach(_temp);
2070
+ retryTimerIds.forEach(_temp2);
2078
2071
  retryTimerIds.clear();
2079
2072
  for (const event_0 of AUDIO_SYNC_EVENTS) {
2080
2073
  video.removeEventListener(event_0, onSync);
2081
2074
  }
2082
2075
  video.removeEventListener("seeked", onSeeked2);
2083
- pauseQuietly(video, audio);
2076
+ pauseQuietly2(video, audio);
2084
2077
  };
2085
2078
  };
2086
2079
  $[0] = audioRef;
@@ -2164,27 +2157,232 @@ function useYouTubeVideoSync(t0) {
2164
2157
  }
2165
2158
  useEffect(t5, t6);
2166
2159
  }
2167
- function _temp(timerId) {
2160
+ function _temp2(timerId) {
2168
2161
  return window.clearTimeout(timerId);
2169
2162
  }
2170
2163
 
2171
- // src/modules/background/youtube/hooks/use-youtube-background-player-model.ts
2172
- function useYouTubeBackgroundPlayerModel({
2173
- codec = "auto",
2174
- corp = 0,
2175
- endTime = 0,
2176
- forceIframe = false,
2177
- isLoop = false,
2178
- isMuted = true,
2179
- isPlaying = true,
2180
- playbackRate = 1,
2181
- posterUrl = null,
2182
- quality = "1080p",
2183
- setVideoElement,
2184
- setVideoPlaying,
2185
- shouldAutoPlay = true,
2186
- showPoster = false,
2187
- showSpinner = true,
2164
+ // src/modules/background/youtube/video-events.ts
2165
+ var HAVE_CURRENT_DATA = 2;
2166
+ var ERROR_RESUME_RETRY_DELAY_MS = 150;
2167
+ var LOAD_RETRY_DELAY_MS = 200;
2168
+ var AUDIO_RETRY_DELAY_MS = 200;
2169
+ var MAX_VIDEO_LOAD_RETRIES = 1;
2170
+ var MAX_AUDIO_LOAD_RETRIES = 1;
2171
+ function playWithMutedFallback({
2172
+ forceSeek,
2173
+ live,
2174
+ setVideoPlaying,
2175
+ syncCompanionAudio,
2176
+ unlockAudio,
2177
+ video,
2178
+ videoRef
2179
+ }) {
2180
+ const onPlayed = () => {
2181
+ setVideoPlaying(true);
2182
+ syncCompanionAudio(forceSeek);
2183
+ };
2184
+ video.play().then(onPlayed).catch((error) => {
2185
+ if (error?.name !== "NotAllowedError") return;
2186
+ video.muted = true;
2187
+ video.play().then(() => {
2188
+ onPlayed();
2189
+ if (!unlockAudio) return;
2190
+ unlockAudioOnGesture(() => {
2191
+ const current = videoRef.current;
2192
+ if (!live.current.isMuted && current) {
2193
+ setElementMuted(current, false);
2194
+ }
2195
+ });
2196
+ }).catch(() => {
2197
+ });
2198
+ });
2199
+ }
2200
+ function endVideoPlayback(ctx) {
2201
+ const {
2202
+ audioRef,
2203
+ live,
2204
+ setVideoPlaying,
2205
+ syncCompanionAudio,
2206
+ videoRef
2207
+ } = ctx;
2208
+ const video = videoRef.current;
2209
+ const audio = audioRef.current;
2210
+ if (!video) return;
2211
+ if (video.loop || live.current.isLoop) {
2212
+ const resetTime = Math.max(0, live.current.startTime || 0);
2213
+ video.currentTime = resetTime;
2214
+ if (audio && audio.readyState >= HAVE_CURRENT_DATA) {
2215
+ audio.currentTime = resetTime;
2216
+ }
2217
+ video.play().then(() => {
2218
+ setVideoPlaying(true);
2219
+ syncCompanionAudio(true);
2220
+ }).catch(() => {
2221
+ });
2222
+ return;
2223
+ }
2224
+ video.pause();
2225
+ if (audio && !audio.paused) audio.pause();
2226
+ setVideoPlaying(false);
2227
+ }
2228
+ function handleCompanionAudioError(ctx) {
2229
+ const {
2230
+ audioRef,
2231
+ live,
2232
+ scheduleRetry,
2233
+ setUseIframeFallback,
2234
+ videoRef
2235
+ } = ctx;
2236
+ const audio = audioRef.current;
2237
+ if (!audio) return;
2238
+ ctx.audioErrorRetryCountRef.current += 1;
2239
+ if (ctx.audioErrorRetryCountRef.current <= MAX_AUDIO_LOAD_RETRIES) {
2240
+ scheduleRetry(() => {
2241
+ audio.load();
2242
+ if (videoRef.current) {
2243
+ audio.currentTime = videoRef.current.currentTime || 0;
2244
+ }
2245
+ }, AUDIO_RETRY_DELAY_MS);
2246
+ return;
2247
+ }
2248
+ if (!live.current.isMuted) {
2249
+ setUseIframeFallback(true);
2250
+ }
2251
+ }
2252
+ function onTimeUpdate(ctx) {
2253
+ const video = ctx.videoRef.current;
2254
+ if (!video) return;
2255
+ if (video.currentTime > 0 && video.readyState >= HAVE_CURRENT_DATA) {
2256
+ ctx.setIsFrameReady(true);
2257
+ ctx.setIsBuffering(false);
2258
+ }
2259
+ const duration = Number(video.duration) || 0;
2260
+ const {
2261
+ corp,
2262
+ endTime
2263
+ } = ctx.live.current;
2264
+ if (hasPassedEnd(video.currentTime, endTime, corp, duration)) {
2265
+ ctx.handleEnded();
2266
+ }
2267
+ }
2268
+ function onPlay(ctx) {
2269
+ const video = ctx.videoRef.current;
2270
+ ctx.hasLoadedVideoRef.current = true;
2271
+ if (video && !ctx.live.current.isMuted && video.muted) {
2272
+ setElementMuted(video, false);
2273
+ }
2274
+ if (!video || video.readyState < HAVE_CURRENT_DATA) ctx.setIsBuffering(true);
2275
+ ctx.setVideoPlaying(true);
2276
+ ctx.syncCompanionAudio(false);
2277
+ }
2278
+ function onPlaying(ctx) {
2279
+ ctx.hasLoadedVideoRef.current = true;
2280
+ ctx.setIsFrameReady(true);
2281
+ ctx.setIsBuffering(false);
2282
+ ctx.setVideoPlaying(true);
2283
+ ctx.syncCompanionAudio(false);
2284
+ }
2285
+ function onPause(ctx) {
2286
+ const video = ctx.videoRef.current;
2287
+ ctx.syncCompanionAudio(false);
2288
+ ctx.setIsBuffering(false);
2289
+ if (video && !video.seeking && !video.ended && !ctx.live.current.isPlaying) {
2290
+ ctx.setVideoPlaying(false);
2291
+ }
2292
+ }
2293
+ function onSeeked(ctx) {
2294
+ const video = ctx.videoRef.current;
2295
+ if (!video) return;
2296
+ const {
2297
+ isPlaying
2298
+ } = ctx.live.current;
2299
+ ctx.setIsFrameReady(true);
2300
+ if (video.readyState >= HAVE_CURRENT_DATA && (!isPlaying || !video.paused)) {
2301
+ ctx.setIsBuffering(false);
2302
+ }
2303
+ ctx.syncCompanionAudio(true);
2304
+ if (isPlaying && video.paused) {
2305
+ video.play().then(() => {
2306
+ ctx.setVideoPlaying(true);
2307
+ ctx.syncCompanionAudio(true);
2308
+ }).catch(() => {
2309
+ });
2310
+ }
2311
+ }
2312
+ function onCanPlay(ctx) {
2313
+ const video = ctx.videoRef.current;
2314
+ if (!video) return;
2315
+ ctx.hasLoadedVideoRef.current = true;
2316
+ if (!ctx.live.current.isPlaying) {
2317
+ ctx.setIsFrameReady(true);
2318
+ ctx.setIsBuffering(false);
2319
+ } else if (video.paused) {
2320
+ setElementMuted(video, Boolean(ctx.live.current.isMuted));
2321
+ ctx.playWithFallback(video, false, true);
2322
+ }
2323
+ }
2324
+ function onLoadedMetadata(ctx) {
2325
+ const video = ctx.videoRef.current;
2326
+ if (!video) return;
2327
+ ctx.hasLoadedVideoRef.current = true;
2328
+ if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
2329
+ video.currentTime = ctx.startTime;
2330
+ if (ctx.audioRef.current) ctx.audioRef.current.currentTime = ctx.startTime;
2331
+ }
2332
+ }
2333
+ function onLoadedData(ctx) {
2334
+ const video = ctx.videoRef.current;
2335
+ if (!video) return;
2336
+ ctx.hasLoadedVideoRef.current = true;
2337
+ video.playbackRate = ctx.playbackRate;
2338
+ setElementMuted(video, Boolean(ctx.live.current.isMuted));
2339
+ if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
2340
+ video.currentTime = ctx.startTime;
2341
+ }
2342
+ if (!ctx.live.current.isPlaying) {
2343
+ ctx.setIsFrameReady(true);
2344
+ ctx.setIsBuffering(false);
2345
+ } else if (video.paused) {
2346
+ ctx.playWithFallback(video, true, false);
2347
+ }
2348
+ }
2349
+ function onError(ctx) {
2350
+ const video = ctx.videoRef.current;
2351
+ if (video && ctx.hasLoadedVideoRef.current) {
2352
+ const resumeTime = video.currentTime || 0;
2353
+ ctx.scheduleRetry(() => {
2354
+ video.load();
2355
+ video.currentTime = resumeTime;
2356
+ if (ctx.live.current.isPlaying) video.play().catch(() => {
2357
+ });
2358
+ }, ERROR_RESUME_RETRY_DELAY_MS);
2359
+ return;
2360
+ }
2361
+ ctx.errorRetryCountRef.current += 1;
2362
+ if (video && ctx.errorRetryCountRef.current <= MAX_VIDEO_LOAD_RETRIES) {
2363
+ ctx.scheduleRetry(() => video.load(), LOAD_RETRY_DELAY_MS);
2364
+ return;
2365
+ }
2366
+ ctx.setUseIframeFallback(true);
2367
+ }
2368
+
2369
+ // src/modules/background/youtube/use-player.ts
2370
+ function useYouTubeBackgroundPlayerModel({
2371
+ codec = "auto",
2372
+ corp = 0,
2373
+ endTime = 0,
2374
+ forceIframe = false,
2375
+ isLoop = false,
2376
+ isMuted = true,
2377
+ isPlaying = true,
2378
+ playbackRate = 1,
2379
+ posterUrl = null,
2380
+ quality = "1080p",
2381
+ setVideoElement,
2382
+ setVideoPlaying,
2383
+ shouldAutoPlay = true,
2384
+ showPoster = false,
2385
+ showSpinner = true,
2188
2386
  startTime = 0,
2189
2387
  videoClasses: _videoClasses,
2190
2388
  videoId,
@@ -2355,6 +2553,28 @@ function useYouTubeBackgroundPlayerModel({
2355
2553
  showSpinnerOverlay
2356
2554
  };
2357
2555
  }
2556
+ function useYouTubeStreamSources({
2557
+ codec,
2558
+ posterUrl,
2559
+ quality,
2560
+ showPoster,
2561
+ videoId
2562
+ }) {
2563
+ const videoStreamUrl = getYouTubeStreamUrl(videoId, {
2564
+ codec,
2565
+ quality,
2566
+ stream: "video"
2567
+ });
2568
+ const audioStreamUrl = getYouTubeStreamUrl(videoId, {
2569
+ stream: "audio"
2570
+ });
2571
+ const resolvedPoster = showPoster ? posterUrl || getYouTubeThumbnailUrl(videoId, true) : null;
2572
+ return {
2573
+ audioStreamUrl,
2574
+ resolvedPoster,
2575
+ videoStreamUrl
2576
+ };
2577
+ }
2358
2578
  function YouTubeBackgroundPlayer(t0) {
2359
2579
  const $ = c(75);
2360
2580
  const {
@@ -2550,488 +2770,34 @@ function YouTubeBackgroundPlayer(t0) {
2550
2770
  $[60] = theme.slots.youtubeHost;
2551
2771
  $[61] = theme.slots.youtubeVideo;
2552
2772
  $[62] = useIframeFallback;
2553
- $[63] = videoClasses;
2554
- $[64] = videoRef;
2555
- $[65] = videoStreamUrl;
2556
- $[66] = videoStyle;
2557
- $[67] = t21;
2558
- } else {
2559
- t21 = $[67];
2560
- }
2561
- let t22;
2562
- if ($[68] !== t16 || $[69] !== t18 || $[70] !== t19 || $[71] !== t20 || $[72] !== t21 || $[73] !== theme.slots.youtube) {
2563
- t22 = /* @__PURE__ */ jsxs("div", { className: theme.slots.youtube, children: [
2564
- t16,
2565
- t18,
2566
- t19,
2567
- t20,
2568
- t21
2569
- ] });
2570
- $[68] = t16;
2571
- $[69] = t18;
2572
- $[70] = t19;
2573
- $[71] = t20;
2574
- $[72] = t21;
2575
- $[73] = theme.slots.youtube;
2576
- $[74] = t22;
2577
- } else {
2578
- t22 = $[74];
2579
- }
2580
- return t22;
2581
- }
2582
- function BackgroundGradients(t0) {
2583
- const $ = c(11);
2584
- const {
2585
- count: t1,
2586
- direction,
2587
- color: t2,
2588
- theme
2589
- } = t0;
2590
- const count = t1 === void 0 ? 0 : t1;
2591
- const color = t2 === void 0 ? DEFAULT_COLOR : t2;
2592
- if (!count || count <= 0) {
2593
- return null;
2594
- }
2595
- const opacity = Math.min(1, Math.max(0.2, count * 0.25));
2596
- const t3 = theme.slots.gradient;
2597
- const t4 = theme.styles.gradient;
2598
- let t5;
2599
- if ($[0] !== color || $[1] !== direction) {
2600
- t5 = generateBaseGradient(direction, color);
2601
- $[0] = color;
2602
- $[1] = direction;
2603
- $[2] = t5;
2604
- } else {
2605
- t5 = $[2];
2606
- }
2607
- let t6;
2608
- if ($[3] !== opacity || $[4] !== t5 || $[5] !== theme.styles.gradient) {
2609
- t6 = {
2610
- ...t4,
2611
- opacity,
2612
- background: t5
2613
- };
2614
- $[3] = opacity;
2615
- $[4] = t5;
2616
- $[5] = theme.styles.gradient;
2617
- $[6] = t6;
2618
- } else {
2619
- t6 = $[6];
2620
- }
2621
- let t7;
2622
- if ($[7] !== direction || $[8] !== t6 || $[9] !== theme.slots.gradient) {
2623
- t7 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t6 });
2624
- $[7] = direction;
2625
- $[8] = t6;
2626
- $[9] = theme.slots.gradient;
2627
- $[10] = t7;
2628
- } else {
2629
- t7 = $[10];
2630
- }
2631
- return t7;
2632
- }
2633
- function EdgeGradient(t0) {
2634
- const $ = c(11);
2635
- const {
2636
- direction,
2637
- percent: t1,
2638
- opacity: t2,
2639
- color,
2640
- theme
2641
- } = t0;
2642
- const percent = t1 === void 0 ? 0 : t1;
2643
- const opacity = t2 === void 0 ? 0 : t2;
2644
- if (opacity <= 0) {
2645
- return null;
2646
- }
2647
- const t3 = theme.slots.edge;
2648
- const t4 = `${Math.max(30, percent * 1.15)}%`;
2649
- const t5 = color || DEFAULT_COLOR;
2650
- let t6;
2651
- if ($[0] !== direction || $[1] !== t5) {
2652
- t6 = generateEdgeGradient(direction, t5);
2653
- $[0] = direction;
2654
- $[1] = t5;
2655
- $[2] = t6;
2656
- } else {
2657
- t6 = $[2];
2658
- }
2659
- let t7;
2660
- if ($[3] !== opacity || $[4] !== t4 || $[5] !== t6) {
2661
- t7 = {
2662
- width: t4,
2663
- opacity,
2664
- background: t6
2665
- };
2666
- $[3] = opacity;
2667
- $[4] = t4;
2668
- $[5] = t6;
2669
- $[6] = t7;
2670
- } else {
2671
- t7 = $[6];
2672
- }
2673
- let t8;
2674
- if ($[7] !== direction || $[8] !== t7 || $[9] !== theme.slots.edge) {
2675
- t8 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t7 });
2676
- $[7] = direction;
2677
- $[8] = t7;
2678
- $[9] = theme.slots.edge;
2679
- $[10] = t8;
2680
- } else {
2681
- t8 = $[10];
2682
- }
2683
- return t8;
2684
- }
2685
- function pauseQuietly2(video) {
2686
- try {
2687
- video?.pause();
2688
- } catch {
2689
- }
2690
- }
2691
- function useNativeVideoModel(t0) {
2692
- const $ = c(27);
2693
- const {
2694
- corp,
2695
- isMuted,
2696
- isPlaying,
2697
- playbackRate,
2698
- setVideoElement,
2699
- setVideoPlaying,
2700
- shouldAutoPlay,
2701
- src
2702
- } = t0;
2703
- const videoRef = useRef(null);
2704
- let t1;
2705
- if ($[0] !== setVideoPlaying) {
2706
- t1 = () => {
2707
- const video = videoRef.current;
2708
- if (!video) {
2709
- return;
2710
- }
2711
- if (video.loop) {
2712
- video.currentTime = 0;
2713
- video.play().catch(_temp2);
2714
- return;
2715
- }
2716
- video.pause();
2717
- setVideoPlaying(false);
2718
- };
2719
- $[0] = setVideoPlaying;
2720
- $[1] = t1;
2721
- } else {
2722
- t1 = $[1];
2723
- }
2724
- const handleEnded = t1;
2725
- let t2;
2726
- if ($[2] !== corp || $[3] !== handleEnded) {
2727
- t2 = () => {
2728
- const video_0 = videoRef.current;
2729
- if (video_0 && isWithinCorp(video_0.currentTime, video_0.duration, corp)) {
2730
- handleEnded();
2731
- }
2732
- };
2733
- $[2] = corp;
2734
- $[3] = handleEnded;
2735
- $[4] = t2;
2736
- } else {
2737
- t2 = $[4];
2738
- }
2739
- const handleTimeUpdate = t2;
2740
- let t3;
2741
- if ($[5] !== isMuted || $[6] !== playbackRate || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay) {
2742
- t3 = () => {
2743
- const video_1 = videoRef.current;
2744
- if (!video_1) {
2745
- return;
2746
- }
2747
- video_1.playbackRate = playbackRate;
2748
- if (!shouldAutoPlay) {
2749
- return;
2750
- }
2751
- if (isMuted) {
2752
- video_1.muted = true;
2753
- }
2754
- video_1.play().then(() => setVideoPlaying(true)).catch((error_0) => {
2755
- report("Background autoplay", error_0, "warn");
2756
- setVideoPlaying(false);
2757
- });
2758
- };
2759
- $[5] = isMuted;
2760
- $[6] = playbackRate;
2761
- $[7] = setVideoPlaying;
2762
- $[8] = shouldAutoPlay;
2763
- $[9] = t3;
2764
- } else {
2765
- t3 = $[9];
2766
- }
2767
- const handleLoadedData = t3;
2768
- let t4;
2769
- if ($[10] !== setVideoElement) {
2770
- t4 = () => {
2771
- const video_2 = videoRef.current;
2772
- setVideoElement(video_2);
2773
- return () => {
2774
- pauseQuietly2(video_2);
2775
- };
2776
- };
2777
- $[10] = setVideoElement;
2778
- $[11] = t4;
2779
- } else {
2780
- t4 = $[11];
2781
- }
2782
- let t5;
2783
- if ($[12] !== setVideoElement || $[13] !== src) {
2784
- t5 = [src, setVideoElement];
2785
- $[12] = setVideoElement;
2786
- $[13] = src;
2787
- $[14] = t5;
2788
- } else {
2789
- t5 = $[14];
2790
- }
2791
- useEffect(t4, t5);
2792
- let t6;
2793
- let t7;
2794
- if ($[15] !== setVideoElement) {
2795
- t6 = () => () => setVideoElement(null);
2796
- t7 = [setVideoElement];
2797
- $[15] = setVideoElement;
2798
- $[16] = t6;
2799
- $[17] = t7;
2800
- } else {
2801
- t6 = $[16];
2802
- t7 = $[17];
2803
- }
2804
- useEffect(t6, t7);
2805
- let t8;
2806
- let t9;
2807
- if ($[18] !== isPlaying || $[19] !== playbackRate || $[20] !== setVideoPlaying) {
2808
- t8 = () => {
2809
- applyVideoPlaybackState({
2810
- isPlaying,
2811
- playbackRate,
2812
- setVideoPlaying,
2813
- videoElement: videoRef.current
2814
- });
2815
- };
2816
- t9 = [isPlaying, playbackRate, setVideoPlaying];
2817
- $[18] = isPlaying;
2818
- $[19] = playbackRate;
2819
- $[20] = setVideoPlaying;
2820
- $[21] = t8;
2821
- $[22] = t9;
2822
- } else {
2823
- t8 = $[21];
2824
- t9 = $[22];
2825
- }
2826
- useEffect(t8, t9);
2827
- let t10;
2828
- if ($[23] !== handleEnded || $[24] !== handleLoadedData || $[25] !== handleTimeUpdate) {
2829
- t10 = {
2830
- videoRef,
2831
- handleEnded,
2832
- handleTimeUpdate,
2833
- handleLoadedData
2834
- };
2835
- $[23] = handleEnded;
2836
- $[24] = handleLoadedData;
2837
- $[25] = handleTimeUpdate;
2838
- $[26] = t10;
2839
- } else {
2840
- t10 = $[26];
2841
- }
2842
- return t10;
2843
- }
2844
- function _temp2(error) {
2845
- return report("Background loop play", error, "warn");
2846
- }
2847
- function NativeVideo(t0) {
2848
- const $ = c(22);
2849
- const {
2850
- corp,
2851
- isLoop,
2852
- isMuted,
2853
- isPlaying,
2854
- playbackRate,
2855
- setVideoElement,
2856
- setVideoPlaying,
2857
- shouldAutoPlay,
2858
- src,
2859
- style,
2860
- className
2861
- } = t0;
2862
- let t1;
2863
- if ($[0] !== className || $[1] !== corp || $[2] !== isLoop || $[3] !== isMuted || $[4] !== isPlaying || $[5] !== playbackRate || $[6] !== setVideoElement || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay || $[9] !== src || $[10] !== style) {
2864
- t1 = {
2865
- corp,
2866
- isLoop,
2867
- isMuted,
2868
- isPlaying,
2869
- playbackRate,
2870
- setVideoElement,
2871
- setVideoPlaying,
2872
- shouldAutoPlay,
2873
- src,
2874
- style,
2875
- className
2876
- };
2877
- $[0] = className;
2878
- $[1] = corp;
2879
- $[2] = isLoop;
2880
- $[3] = isMuted;
2881
- $[4] = isPlaying;
2882
- $[5] = playbackRate;
2883
- $[6] = setVideoElement;
2884
- $[7] = setVideoPlaying;
2885
- $[8] = shouldAutoPlay;
2886
- $[9] = src;
2887
- $[10] = style;
2888
- $[11] = t1;
2889
- } else {
2890
- t1 = $[11];
2891
- }
2892
- const {
2893
- videoRef,
2894
- handleEnded,
2895
- handleTimeUpdate,
2896
- handleLoadedData
2897
- } = useNativeVideoModel(t1);
2898
- let t2;
2899
- if ($[12] !== className || $[13] !== handleEnded || $[14] !== handleLoadedData || $[15] !== handleTimeUpdate || $[16] !== isLoop || $[17] !== isMuted || $[18] !== src || $[19] !== style || $[20] !== videoRef) {
2900
- t2 = /* @__PURE__ */ jsx("video", { ref: videoRef, src, className, preload: "auto", muted: isMuted, loop: isLoop, playsInline: true, style, onTimeUpdate: handleTimeUpdate, onEnded: handleEnded, onLoadedData: handleLoadedData });
2901
- $[12] = className;
2902
- $[13] = handleEnded;
2903
- $[14] = handleLoadedData;
2904
- $[15] = handleTimeUpdate;
2905
- $[16] = isLoop;
2906
- $[17] = isMuted;
2907
- $[18] = src;
2908
- $[19] = style;
2909
- $[20] = videoRef;
2910
- $[21] = t2;
2911
- } else {
2912
- t2 = $[21];
2913
- }
2914
- return t2;
2915
- }
2916
- function NoiseOverlay(t0) {
2917
- const $ = c(16);
2918
- const {
2919
- opacity,
2920
- blendMode,
2921
- inlineStyle,
2922
- maskImage,
2923
- isFixed,
2924
- theme
2925
- } = t0;
2926
- const t1 = isFixed ? "fixed" : "absolute";
2927
- let t2;
2928
- if ($[0] !== opacity) {
2929
- t2 = typeof opacity === "number" ? {
2930
- opacity
2931
- } : {};
2932
- $[0] = opacity;
2933
- $[1] = t2;
2934
- } else {
2935
- t2 = $[1];
2936
- }
2937
- let t3;
2938
- if ($[2] !== blendMode) {
2939
- t3 = typeof blendMode === "string" && blendMode.trim() ? {
2940
- mixBlendMode: blendMode
2941
- } : {};
2942
- $[2] = blendMode;
2943
- $[3] = t3;
2944
- } else {
2945
- t3 = $[3];
2946
- }
2947
- let t4;
2948
- if ($[4] !== maskImage) {
2949
- t4 = maskImage ? {
2950
- maskImage,
2951
- WebkitMaskImage: maskImage
2952
- } : {};
2953
- $[4] = maskImage;
2954
- $[5] = t4;
2955
- } else {
2956
- t4 = $[5];
2957
- }
2958
- let t5;
2959
- if ($[6] !== inlineStyle || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== theme.styles.noise) {
2960
- t5 = {
2961
- ...theme.styles.noise,
2962
- ...t2,
2963
- ...t3,
2964
- ...t4,
2965
- ...inlineStyle
2966
- };
2967
- $[6] = inlineStyle;
2968
- $[7] = t2;
2969
- $[8] = t3;
2970
- $[9] = t4;
2971
- $[10] = theme.styles.noise;
2972
- $[11] = t5;
2973
- } else {
2974
- t5 = $[11];
2975
- }
2976
- let t6;
2977
- if ($[12] !== t1 || $[13] !== t5 || $[14] !== theme.slots.noise) {
2978
- t6 = /* @__PURE__ */ jsx("div", { "data-position": t1, className: theme.slots.noise, style: t5 });
2979
- $[12] = t1;
2980
- $[13] = t5;
2981
- $[14] = theme.slots.noise;
2982
- $[15] = t6;
2983
- } else {
2984
- t6 = $[15];
2985
- }
2986
- return t6;
2987
- }
2988
- function SolidOverlay(t0) {
2989
- const $ = c(10);
2990
- const {
2991
- opacity: t1,
2992
- color,
2993
- transitionStyle,
2994
- maskImage,
2995
- theme
2996
- } = t0;
2997
- const opacity = t1 === void 0 ? 0 : t1;
2998
- let t2;
2999
- if ($[0] !== maskImage) {
3000
- t2 = maskImage ? {
3001
- maskImage,
3002
- WebkitMaskImage: maskImage
3003
- } : {};
3004
- $[0] = maskImage;
3005
- $[1] = t2;
3006
- } else {
3007
- t2 = $[1];
3008
- }
3009
- let t3;
3010
- if ($[2] !== color || $[3] !== opacity || $[4] !== t2 || $[5] !== transitionStyle) {
3011
- t3 = {
3012
- opacity,
3013
- backgroundColor: color,
3014
- ...t2,
3015
- ...transitionStyle
3016
- };
3017
- $[2] = color;
3018
- $[3] = opacity;
3019
- $[4] = t2;
3020
- $[5] = transitionStyle;
3021
- $[6] = t3;
2773
+ $[63] = videoClasses;
2774
+ $[64] = videoRef;
2775
+ $[65] = videoStreamUrl;
2776
+ $[66] = videoStyle;
2777
+ $[67] = t21;
3022
2778
  } else {
3023
- t3 = $[6];
2779
+ t21 = $[67];
3024
2780
  }
3025
- let t4;
3026
- if ($[7] !== t3 || $[8] !== theme.slots.solid) {
3027
- t4 = /* @__PURE__ */ jsx("div", { className: theme.slots.solid, style: t3 });
3028
- $[7] = t3;
3029
- $[8] = theme.slots.solid;
3030
- $[9] = t4;
2781
+ let t22;
2782
+ if ($[68] !== t16 || $[69] !== t18 || $[70] !== t19 || $[71] !== t20 || $[72] !== t21 || $[73] !== theme.slots.youtube) {
2783
+ t22 = /* @__PURE__ */ jsxs("div", { className: theme.slots.youtube, children: [
2784
+ t16,
2785
+ t18,
2786
+ t19,
2787
+ t20,
2788
+ t21
2789
+ ] });
2790
+ $[68] = t16;
2791
+ $[69] = t18;
2792
+ $[70] = t19;
2793
+ $[71] = t20;
2794
+ $[72] = t21;
2795
+ $[73] = theme.slots.youtube;
2796
+ $[74] = t22;
3031
2797
  } else {
3032
- t4 = $[9];
2798
+ t22 = $[74];
3033
2799
  }
3034
- return t4;
2800
+ return t22;
3035
2801
  }
3036
2802
  function VideoSource(t0) {
3037
2803
  const $ = c(33);
@@ -3403,6 +3169,229 @@ function BackgroundOverlay() {
3403
3169
  }
3404
3170
  return t1;
3405
3171
  }
3172
+ function BackgroundGradients(t0) {
3173
+ const $ = c(11);
3174
+ const {
3175
+ count: t1,
3176
+ direction,
3177
+ color: t2,
3178
+ theme
3179
+ } = t0;
3180
+ const count = t1 === void 0 ? 0 : t1;
3181
+ const color = t2 === void 0 ? DEFAULT_COLOR : t2;
3182
+ if (!count || count <= 0) {
3183
+ return null;
3184
+ }
3185
+ const opacity = Math.min(1, Math.max(0.2, count * 0.25));
3186
+ const t3 = theme.slots.gradient;
3187
+ const t4 = theme.styles.gradient;
3188
+ let t5;
3189
+ if ($[0] !== color || $[1] !== direction) {
3190
+ t5 = generateBaseGradient(direction, color);
3191
+ $[0] = color;
3192
+ $[1] = direction;
3193
+ $[2] = t5;
3194
+ } else {
3195
+ t5 = $[2];
3196
+ }
3197
+ let t6;
3198
+ if ($[3] !== opacity || $[4] !== t5 || $[5] !== theme.styles.gradient) {
3199
+ t6 = {
3200
+ ...t4,
3201
+ opacity,
3202
+ background: t5
3203
+ };
3204
+ $[3] = opacity;
3205
+ $[4] = t5;
3206
+ $[5] = theme.styles.gradient;
3207
+ $[6] = t6;
3208
+ } else {
3209
+ t6 = $[6];
3210
+ }
3211
+ let t7;
3212
+ if ($[7] !== direction || $[8] !== t6 || $[9] !== theme.slots.gradient) {
3213
+ t7 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t6 });
3214
+ $[7] = direction;
3215
+ $[8] = t6;
3216
+ $[9] = theme.slots.gradient;
3217
+ $[10] = t7;
3218
+ } else {
3219
+ t7 = $[10];
3220
+ }
3221
+ return t7;
3222
+ }
3223
+ function EdgeGradient(t0) {
3224
+ const $ = c(11);
3225
+ const {
3226
+ direction,
3227
+ percent: t1,
3228
+ opacity: t2,
3229
+ color,
3230
+ theme
3231
+ } = t0;
3232
+ const percent = t1 === void 0 ? 0 : t1;
3233
+ const opacity = t2 === void 0 ? 0 : t2;
3234
+ if (opacity <= 0) {
3235
+ return null;
3236
+ }
3237
+ const t3 = theme.slots.edge;
3238
+ const t4 = `${Math.max(30, percent * 1.15)}%`;
3239
+ const t5 = color || DEFAULT_COLOR;
3240
+ let t6;
3241
+ if ($[0] !== direction || $[1] !== t5) {
3242
+ t6 = generateEdgeGradient(direction, t5);
3243
+ $[0] = direction;
3244
+ $[1] = t5;
3245
+ $[2] = t6;
3246
+ } else {
3247
+ t6 = $[2];
3248
+ }
3249
+ let t7;
3250
+ if ($[3] !== opacity || $[4] !== t4 || $[5] !== t6) {
3251
+ t7 = {
3252
+ width: t4,
3253
+ opacity,
3254
+ background: t6
3255
+ };
3256
+ $[3] = opacity;
3257
+ $[4] = t4;
3258
+ $[5] = t6;
3259
+ $[6] = t7;
3260
+ } else {
3261
+ t7 = $[6];
3262
+ }
3263
+ let t8;
3264
+ if ($[7] !== direction || $[8] !== t7 || $[9] !== theme.slots.edge) {
3265
+ t8 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t7 });
3266
+ $[7] = direction;
3267
+ $[8] = t7;
3268
+ $[9] = theme.slots.edge;
3269
+ $[10] = t8;
3270
+ } else {
3271
+ t8 = $[10];
3272
+ }
3273
+ return t8;
3274
+ }
3275
+ function NoiseOverlay(t0) {
3276
+ const $ = c(16);
3277
+ const {
3278
+ opacity,
3279
+ blendMode,
3280
+ inlineStyle,
3281
+ maskImage,
3282
+ isFixed,
3283
+ theme
3284
+ } = t0;
3285
+ const t1 = isFixed ? "fixed" : "absolute";
3286
+ let t2;
3287
+ if ($[0] !== opacity) {
3288
+ t2 = typeof opacity === "number" ? {
3289
+ opacity
3290
+ } : {};
3291
+ $[0] = opacity;
3292
+ $[1] = t2;
3293
+ } else {
3294
+ t2 = $[1];
3295
+ }
3296
+ let t3;
3297
+ if ($[2] !== blendMode) {
3298
+ t3 = typeof blendMode === "string" && blendMode.trim() ? {
3299
+ mixBlendMode: blendMode
3300
+ } : {};
3301
+ $[2] = blendMode;
3302
+ $[3] = t3;
3303
+ } else {
3304
+ t3 = $[3];
3305
+ }
3306
+ let t4;
3307
+ if ($[4] !== maskImage) {
3308
+ t4 = maskImage ? {
3309
+ maskImage,
3310
+ WebkitMaskImage: maskImage
3311
+ } : {};
3312
+ $[4] = maskImage;
3313
+ $[5] = t4;
3314
+ } else {
3315
+ t4 = $[5];
3316
+ }
3317
+ let t5;
3318
+ if ($[6] !== inlineStyle || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== theme.styles.noise) {
3319
+ t5 = {
3320
+ ...theme.styles.noise,
3321
+ ...t2,
3322
+ ...t3,
3323
+ ...t4,
3324
+ ...inlineStyle
3325
+ };
3326
+ $[6] = inlineStyle;
3327
+ $[7] = t2;
3328
+ $[8] = t3;
3329
+ $[9] = t4;
3330
+ $[10] = theme.styles.noise;
3331
+ $[11] = t5;
3332
+ } else {
3333
+ t5 = $[11];
3334
+ }
3335
+ let t6;
3336
+ if ($[12] !== t1 || $[13] !== t5 || $[14] !== theme.slots.noise) {
3337
+ t6 = /* @__PURE__ */ jsx("div", { "data-position": t1, className: theme.slots.noise, style: t5 });
3338
+ $[12] = t1;
3339
+ $[13] = t5;
3340
+ $[14] = theme.slots.noise;
3341
+ $[15] = t6;
3342
+ } else {
3343
+ t6 = $[15];
3344
+ }
3345
+ return t6;
3346
+ }
3347
+ function SolidOverlay(t0) {
3348
+ const $ = c(10);
3349
+ const {
3350
+ opacity: t1,
3351
+ color,
3352
+ transitionStyle,
3353
+ maskImage,
3354
+ theme
3355
+ } = t0;
3356
+ const opacity = t1 === void 0 ? 0 : t1;
3357
+ let t2;
3358
+ if ($[0] !== maskImage) {
3359
+ t2 = maskImage ? {
3360
+ maskImage,
3361
+ WebkitMaskImage: maskImage
3362
+ } : {};
3363
+ $[0] = maskImage;
3364
+ $[1] = t2;
3365
+ } else {
3366
+ t2 = $[1];
3367
+ }
3368
+ let t3;
3369
+ if ($[2] !== color || $[3] !== opacity || $[4] !== t2 || $[5] !== transitionStyle) {
3370
+ t3 = {
3371
+ opacity,
3372
+ backgroundColor: color,
3373
+ ...t2,
3374
+ ...transitionStyle
3375
+ };
3376
+ $[2] = color;
3377
+ $[3] = opacity;
3378
+ $[4] = t2;
3379
+ $[5] = transitionStyle;
3380
+ $[6] = t3;
3381
+ } else {
3382
+ t3 = $[6];
3383
+ }
3384
+ let t4;
3385
+ if ($[7] !== t3 || $[8] !== theme.slots.solid) {
3386
+ t4 = /* @__PURE__ */ jsx("div", { className: theme.slots.solid, style: t3 });
3387
+ $[7] = t3;
3388
+ $[8] = theme.slots.solid;
3389
+ $[9] = t4;
3390
+ } else {
3391
+ t4 = $[9];
3392
+ }
3393
+ return t4;
3394
+ }
3406
3395
  function selectPageBackground(background) {
3407
3396
  return background ? normalizeBackgroundInput(background) : null;
3408
3397
  }
@@ -3477,5 +3466,5 @@ function defineBackground(definition = {}) {
3477
3466
  }
3478
3467
 
3479
3468
  export { BACKGROUND_MEDIA_ID, BACKGROUND_REGISTRY_KEY, BG_TOKEN_TO_OBJECT_STYLE, BackgroundContext, BackgroundOverlay, BackgroundProvider, DEFAULT_BACKGROUND, DEFAULT_BACKGROUND_COMPUTED, DEFAULT_COLOR, INERT_BACKGROUND_ACTIONS, OBJECT_FITS, YouTubeBackgroundPlayer, applyVideoPlaybackState, backgroundModule, backgroundTheme, computeBackgroundState, defineBackground, extractYouTubeVideoId, generateBaseGradient, generateEdgeGradient, getEdgeFadeMask, getYouTubeStreamUrl, getYouTubeThumbnailUrl, isDirectVideoUrl, isYouTubeUrl, mergeBackgroundState, normalizeBackgroundInput, parseYouTubeUrlConfig, resolveBackgroundState, resolveVideoClassNames, resolveVideoOptions, selectPageBackground, syncVideoLoopDirect, syncVideoMutedDirect, triggerVideoPlaybackDirect, useBackground, useBackgroundActions, useBackgroundRegistration, useBackgroundState, useOptionalBackgroundActions, useOptionalBackgroundState };
3480
- //# sourceMappingURL=chunk-HFR6YROB.js.map
3481
- //# sourceMappingURL=chunk-HFR6YROB.js.map
3469
+ //# sourceMappingURL=chunk-DGVRHX3C.js.map
3470
+ //# sourceMappingURL=chunk-DGVRHX3C.js.map