agentroam-runtime-darwin-arm64 0.2.0-preview.81 → 0.2.0-preview.83

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 (379) hide show
  1. package/manifest.json +2 -2
  2. package/package.json +1 -1
  3. package/runtime/.next/BUILD_ID +1 -1
  4. package/runtime/.next/app-build-manifest.json +26 -25
  5. package/runtime/.next/app-path-routes-manifest.json +1 -1
  6. package/runtime/.next/build-manifest.json +10 -10
  7. package/runtime/.next/prerender-manifest.json +1 -1
  8. package/runtime/.next/react-loadable-manifest.json +4 -4
  9. package/runtime/.next/required-server-files.json +1 -1
  10. package/runtime/.next/server/app/_not-found/page.js +1 -1
  11. package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/runtime/.next/server/app/_not-found.html +1 -1
  13. package/runtime/.next/server/app/_not-found.rsc +1 -1
  14. package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
  15. package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
  16. package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
  17. package/runtime/.next/server/app/api/agent/composer/route.js +1 -0
  18. package/runtime/.next/server/app/api/agent/composer/route.js.nft.json +1 -0
  19. package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
  20. package/runtime/.next/server/app/api/agent/model/route.js +1 -1
  21. package/runtime/.next/server/app/api/agent/models/route.js +1 -1
  22. package/runtime/.next/server/app/api/agent/run/route.js +1 -1
  23. package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
  24. package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
  25. package/runtime/.next/server/app/api/agent/stream/route.js +2 -2
  26. package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
  27. package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
  28. package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
  29. package/runtime/.next/server/app/api/business/route.js +1 -1
  30. package/runtime/.next/server/app/api/calendar/route.js +2 -2
  31. package/runtime/.next/server/app/api/client-logs/route.js +1 -1
  32. package/runtime/.next/server/app/api/collaboration/route.js +2 -2
  33. package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
  34. package/runtime/.next/server/app/api/engine-threads.body +1 -1
  35. package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
  36. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
  37. package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
  38. package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
  39. package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
  40. package/runtime/.next/server/app/api/internal/todo-bootstrap/route.js +1 -1
  41. package/runtime/.next/server/app/api/internal/todo-mcp/route.js +1 -1
  42. package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
  43. package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
  44. package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
  45. package/runtime/.next/server/app/api/mcp/servers.body +1 -1
  46. package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
  47. package/runtime/.next/server/app/api/memory/route.js +1 -1
  48. package/runtime/.next/server/app/api/messaging/route.js +1 -1
  49. package/runtime/.next/server/app/api/notifications/[id]/ack/route.js +1 -1
  50. package/runtime/.next/server/app/api/notifications/[id]/route.js +1 -1
  51. package/runtime/.next/server/app/api/notifications/route.js +1 -1
  52. package/runtime/.next/server/app/api/notifications/stream/route.js +2 -2
  53. package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
  54. package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
  55. package/runtime/.next/server/app/api/projects/check/route.js +1 -1
  56. package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
  57. package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
  58. package/runtime/.next/server/app/api/projects/route.js +1 -1
  59. package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
  60. package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
  61. package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
  62. package/runtime/.next/server/app/api/push/vapid.body +1 -1
  63. package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
  64. package/runtime/.next/server/app/api/session-images/[id]/route.js +1 -1
  65. package/runtime/.next/server/app/api/session-views/route.js +1 -1
  66. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
  67. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
  68. package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
  69. package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
  70. package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
  71. package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
  72. package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
  73. package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
  74. package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
  75. package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
  76. package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
  77. package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
  78. package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
  79. package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
  80. package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
  81. package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
  82. package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
  83. package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
  84. package/runtime/.next/server/app/api/sessions/route.js +1 -1
  85. package/runtime/.next/server/app/api/settings/route.js +1 -1
  86. package/runtime/.next/server/app/api/skills/route.js +1 -1
  87. package/runtime/.next/server/app/api/todos/[id]/commands/route.js +1 -1
  88. package/runtime/.next/server/app/api/todos/[id]/executions/route.js +1 -1
  89. package/runtime/.next/server/app/api/todos/[id]/route.js +1 -1
  90. package/runtime/.next/server/app/api/todos/route.js +1 -1
  91. package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
  92. package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
  93. package/runtime/.next/server/app/api/tools/route.js +1 -1
  94. package/runtime/.next/server/app/api/update/check/route.js +1 -1
  95. package/runtime/.next/server/app/api/update/install/route.js +1 -1
  96. package/runtime/.next/server/app/api/update/status/route.js +1 -1
  97. package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
  98. package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
  99. package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
  100. package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
  101. package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
  102. package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
  103. package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
  104. package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
  105. package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
  106. package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
  107. package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
  108. package/runtime/.next/server/app/api/workspace-changes/route.js +1 -1
  109. package/runtime/.next/server/app/web/page.js +4 -4
  110. package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
  111. package/runtime/.next/server/app-paths-manifest.json +39 -38
  112. package/runtime/.next/server/chunks/1298.js +1 -1
  113. package/runtime/.next/server/chunks/5303.js +2 -2
  114. package/runtime/.next/server/chunks/5801.js +1 -1
  115. package/runtime/.next/server/chunks/6703.js +1 -1
  116. package/runtime/.next/server/chunks/9119.js +3 -3
  117. package/runtime/.next/server/chunks/9457.js +1 -1
  118. package/runtime/.next/server/middleware-build-manifest.js +1 -1
  119. package/runtime/.next/server/middleware-react-loadable-manifest.js +1 -1
  120. package/runtime/.next/server/pages/404.html +1 -1
  121. package/runtime/.next/server/pages/500.html +1 -1
  122. package/runtime/.next/server/server-reference-manifest.json +1 -1
  123. package/runtime/.next/static/chunks/20.2eb9bc3a5b4d410b.js +1 -0
  124. package/runtime/.next/static/chunks/325-0818ba5a4060a0e8.js +1 -0
  125. package/runtime/.next/static/chunks/34.c7dbf7ffc8914be9.js +1 -0
  126. package/runtime/.next/static/chunks/686.7b5c444243fcf29a.js +1 -0
  127. package/runtime/.next/static/chunks/app/web/error-828d278147a0619d.js +1 -0
  128. package/runtime/.next/static/chunks/app/web/layout-1127176e7e88e395.js +1 -0
  129. package/runtime/.next/static/chunks/app/web/page-8adf166584b0088e.js +1 -0
  130. package/runtime/.next/static/chunks/{main-68faabab5d101471.js → main-9c08f7656f9692e6.js} +1 -1
  131. package/runtime/.next/static/chunks/main-app-07d67f2d4e96ecb8.js +1 -0
  132. package/runtime/.next/static/chunks/{webpack-f51a057f833e73eb.js → webpack-040c7a20dd455025.js} +1 -1
  133. package/runtime/.next/static/css/645d4c94ea111811.css +1 -0
  134. package/runtime/lib/remote-control/application/paced-video-sender.mjs +20 -1
  135. package/runtime/lib/remote-control/application/remote-video-session.mjs +18 -4
  136. package/runtime/lib/remote-control/infrastructure/native-video-encoder.mjs +15 -2
  137. package/runtime/lib/remote-control/infrastructure/werift-video-transport.mjs +3 -1
  138. package/runtime/lib/remote-control/remote-authorization.mjs +2 -2
  139. package/runtime/lib/remote-control/remote-video-signal.mjs +2 -0
  140. package/runtime/lib/todo-completion-worker.mjs +45 -0
  141. package/runtime/lib/tunnel-control.mjs +1 -1
  142. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
  143. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
  144. package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
  145. package/runtime/node_modules/.package-lock.json +129 -129
  146. package/runtime/node_modules/@agent/core/dist/index.js +295 -70
  147. package/runtime/node_modules/@agent/native-runtime/dist/index.js +498 -150
  148. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +75 -79
  149. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +52 -52
  150. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-2g5j09ba.mjs +16 -0
  151. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-59ydwk0g.mjs +17 -0
  152. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-q4cwy1ja.mjs → core-664d5mmy.mjs} +2 -2
  153. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-zn1abzvs.mjs → core-70sfhqm6.mjs} +2 -2
  154. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-95gcz3n1.mjs +38 -0
  155. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ew5sfvfe.mjs +39 -0
  156. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gjhs7gf6.mjs +20 -0
  157. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-kvdt1szx.mjs +18 -0
  158. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-p654hjkr.mjs +22 -0
  159. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-q9bjbxkv.mjs +19 -0
  160. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-samdvsjh.mjs +33 -0
  161. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x6bt758j.mjs +17 -0
  162. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +12 -12
  163. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +22 -22
  164. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +26 -26
  165. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +22 -23
  166. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +84 -83
  167. package/runtime/node_modules/caniuse-lite/package.json +1 -1
  168. package/runtime/node_modules/mediabunny/README.md +4 -0
  169. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.cjs +225 -136
  170. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.cjs +10 -10
  171. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.min.mjs +11 -11
  172. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.mjs +225 -136
  173. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.node.cjs +225 -136
  174. package/runtime/node_modules/mediabunny/dist/bundles/mediabunny.worker.js +8 -0
  175. package/runtime/node_modules/mediabunny/dist/modules/src/adts/adts-demuxer.js +4 -0
  176. package/runtime/node_modules/mediabunny/dist/modules/src/aes.js +6 -4
  177. package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-demuxer.js +6 -0
  178. package/runtime/node_modules/mediabunny/dist/modules/src/hls/hls-segmented-input.js +17 -5
  179. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-boxes.js +2 -1
  180. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-demuxer.js +62 -12
  181. package/runtime/node_modules/mediabunny/dist/modules/src/isobmff/isobmff-muxer.js +34 -18
  182. package/runtime/node_modules/mediabunny/dist/modules/src/matroska/matroska-demuxer.js +3 -0
  183. package/runtime/node_modules/mediabunny/dist/modules/src/media-sink.js +3 -8
  184. package/runtime/node_modules/mediabunny/dist/modules/src/media-source.js +5 -12
  185. package/runtime/node_modules/mediabunny/dist/modules/src/misc.js +19 -5
  186. package/runtime/node_modules/mediabunny/dist/modules/src/mp3/mp3-demuxer.js +4 -0
  187. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-demuxer.js +22 -13
  188. package/runtime/node_modules/mediabunny/dist/modules/src/mpeg-ts/mpeg-ts-muxer.js +2 -2
  189. package/runtime/node_modules/mediabunny/dist/modules/src/segmented-input.js +70 -65
  190. package/runtime/node_modules/mediabunny/dist/modules/src/tsconfig.tsbuildinfo +1 -1
  191. package/runtime/node_modules/mediabunny/dist/modules/src/version.js +1 -1
  192. package/runtime/node_modules/mediabunny/dist/modules/src/worker.js +26 -0
  193. package/runtime/node_modules/mediabunny/package.json +1 -1
  194. package/runtime/node_modules/mediabunny/src/adts/adts-demuxer.ts +5 -0
  195. package/runtime/node_modules/mediabunny/src/aes.ts +7 -4
  196. package/runtime/node_modules/mediabunny/src/hls/hls-demuxer.ts +7 -0
  197. package/runtime/node_modules/mediabunny/src/hls/hls-segmented-input.ts +19 -6
  198. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-boxes.ts +2 -1
  199. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-demuxer.ts +74 -14
  200. package/runtime/node_modules/mediabunny/src/isobmff/isobmff-muxer.ts +37 -19
  201. package/runtime/node_modules/mediabunny/src/matroska/matroska-demuxer.ts +4 -0
  202. package/runtime/node_modules/mediabunny/src/media-sink.ts +3 -12
  203. package/runtime/node_modules/mediabunny/src/media-source.ts +5 -20
  204. package/runtime/node_modules/mediabunny/src/metadata.ts +1 -0
  205. package/runtime/node_modules/mediabunny/src/misc.ts +26 -5
  206. package/runtime/node_modules/mediabunny/src/mp3/mp3-demuxer.ts +5 -0
  207. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-demuxer.ts +30 -19
  208. package/runtime/node_modules/mediabunny/src/mpeg-ts/mpeg-ts-muxer.ts +2 -2
  209. package/runtime/node_modules/mediabunny/src/segmented-input.ts +76 -79
  210. package/runtime/node_modules/mediabunny/src/version.ts +1 -1
  211. package/runtime/node_modules/mediabunny/src/worker.ts +28 -0
  212. package/runtime/package-lock.json +162 -162
  213. package/runtime/server.js +1 -1
  214. package/runtime/webapp/dist/assets/AIHubView-HV2FIroL.js +1 -0
  215. package/runtime/webapp/dist/assets/{AgentManager-dXI31b0a.js → AgentManager-C4zPGI-Y.js} +2 -2
  216. package/runtime/webapp/dist/assets/AiHubPane-CEjQjdqT.js +1 -0
  217. package/runtime/webapp/dist/assets/App-CS2wVlfV.js +68 -0
  218. package/runtime/webapp/dist/assets/BrowserLivePanel-BwtEM-IV.js +61 -0
  219. package/runtime/webapp/dist/assets/{CalendarPage-BbYdGYWn.js → CalendarPage-DY8pZK7d.js} +1 -1
  220. package/runtime/webapp/dist/assets/{CalendarView-QfbrlL9X.js → CalendarView-CuBzp-g8.js} +1 -1
  221. package/runtime/webapp/dist/assets/{CollaborationCreateDialog-CWhmFQtA.js → CollaborationCreateDialog-DsXkxAd1.js} +1 -1
  222. package/runtime/webapp/dist/assets/{CollaborationDashboard-XL5SnFOu.js → CollaborationDashboard-CvE5vaOh.js} +1 -1
  223. package/runtime/webapp/dist/assets/{CollaborationPage-B1tiqgnG.js → CollaborationPage-Cjeo60S0.js} +2 -2
  224. package/runtime/webapp/dist/assets/{FilePreview-CPY6dP8Q.js → FilePreview-CyXKv1Cu.js} +9 -9
  225. package/runtime/webapp/dist/assets/{FileTree-BBgrOian.js → FileTree-DNI9VhEp.js} +2 -2
  226. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-DRluuYWn.js +1 -0
  227. package/runtime/webapp/dist/assets/FlowStudioPane-CKlzxza_.js +5 -0
  228. package/runtime/webapp/dist/assets/{HostProjectPicker-DN_vGqQb.js → HostProjectPicker-CjlxN2ct.js} +1 -1
  229. package/runtime/webapp/dist/assets/{LSPServerList-B-R7HDSP.js → LSPServerList-BbAS_sm-.js} +1 -1
  230. package/runtime/webapp/dist/assets/{MCPServerList-CTc0iAwT.js → MCPServerList-DkVUlKEJ.js} +1 -1
  231. package/runtime/webapp/dist/assets/{MemoryViewer-Dzh_miRv.js → MemoryViewer-Ywl80xth.js} +1 -1
  232. package/runtime/webapp/dist/assets/NewSessionWindow-B4H26X5c.js +1 -0
  233. package/runtime/webapp/dist/assets/RemoteDesktopPage-B4q2I23i.js +1 -0
  234. package/runtime/webapp/dist/assets/{RemoteDesktopTabBridge-BA_HQv3V.js → RemoteDesktopTabBridge-B_cCKi7K.js} +1 -1
  235. package/runtime/webapp/dist/assets/{RunningSessionsIcon-BvFSI9OF.js → RunningSessionsIcon-Cz8_524L.js} +1 -1
  236. package/runtime/webapp/dist/assets/{SessionDashboard-DcPPoXe2.js → SessionDashboard-DXPSvNsY.js} +1 -1
  237. package/runtime/webapp/dist/assets/{SessionDashboardBridge-CjoeUy-v.js → SessionDashboardBridge-7BjKdfN8.js} +1 -1
  238. package/runtime/webapp/dist/assets/{SettingsPanel-DmdXDQUm.js → SettingsPanel-C78O9_ho.js} +2 -2
  239. package/runtime/webapp/dist/assets/{SkillManager-CS_skFZj.js → SkillManager-BdkBUxhH.js} +1 -1
  240. package/runtime/webapp/dist/assets/{TaskPaneTerminal-BFHDRCb9.js → TaskPaneTerminal-B2WKBysj.js} +1 -1
  241. package/runtime/webapp/dist/assets/{TerminalPane-Dr_nY9pI.js → TerminalPane-CxGcN85G.js} +1 -1
  242. package/runtime/webapp/dist/assets/TodoPage-CdzjZR2O.js +1 -0
  243. package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-FEEApB15.js → abnfDiagram-VCTEODGH-DFIXyU71.js} +1 -1
  244. package/runtime/webapp/dist/assets/{arc-CycwMc2c.js → arc-CLpaLEla.js} +1 -1
  245. package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BFq9JapX.js → architectureDiagram-5GKGNRK7-Df8T0lx0.js} +1 -1
  246. package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-DkOJ55Ag.js → blockDiagram-I7D4REHJ-jCoyPZhV.js} +1 -1
  247. package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-CRvi_3RM.js → c4Diagram-7LVT6UL2-DsZuTCuo.js} +1 -1
  248. package/runtime/webapp/dist/assets/{calendar-days-CLwKstxM.js → calendar-days-BIRmYMrW.js} +1 -1
  249. package/runtime/webapp/dist/assets/channel-0IyV-PVi.js +1 -0
  250. package/runtime/webapp/dist/assets/{check-8EVJMrTV.js → check-DCU8YHqr.js} +1 -1
  251. package/runtime/webapp/dist/assets/{chevron-down-ChNxfI2x.js → chevron-down-BUEiUZA7.js} +1 -1
  252. package/runtime/webapp/dist/assets/{chevron-right-Cbkc_d70.js → chevron-right-B_ITnckH.js} +1 -1
  253. package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Cklzvs8u.js → chunk-2Q5K7J3B-BEZp3wuG.js} +1 -1
  254. package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-NxozE5UP.js → chunk-5VM5RSS4-BGGDhFwD.js} +1 -1
  255. package/runtime/webapp/dist/assets/{chunk-F27PBJKO-Dyb8E7YM.js → chunk-F27PBJKO-Mqzm4ODE.js} +1 -1
  256. package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-BqbMMc1n.js → chunk-IMKFNOWR-DtnGgUQJ.js} +1 -1
  257. package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-do0R2H6U.js → chunk-JWPE2WC7-By3kXE4y.js} +1 -1
  258. package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-B2HIaynf.js → chunk-POPQ4Y6H-BTHuMHN1.js} +1 -1
  259. package/runtime/webapp/dist/assets/{chunk-SVP7TREG-C_zmjkwn.js → chunk-SVP7TREG-BeWH1pvB.js} +1 -1
  260. package/runtime/webapp/dist/assets/{chunk-TICWLB2K-Dh2bZgM1.js → chunk-TICWLB2K-oiekJTZh.js} +1 -1
  261. package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-CnqciVDz.js → chunk-XXDRQBXY-B7CKqUBs.js} +1 -1
  262. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-Dm5zwUmQ.js +1 -0
  263. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-Dm5zwUmQ.js +1 -0
  264. package/runtime/webapp/dist/assets/{client-I0ZVCjOI.js → client-BpqlZTm2.js} +1 -1
  265. package/runtime/webapp/dist/assets/{codeSyntax-C8n4_KZS.js → codeSyntax-GjP28nDI.js} +3 -3
  266. package/runtime/webapp/dist/assets/{collaboration-lVxWL5ce.js → collaboration-CYS2Soeh.js} +1 -1
  267. package/runtime/webapp/dist/assets/composer-file-routing-DHdpFYk8.js +6 -0
  268. package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-CulKVUkj.js → cose-bilkent-JH36ORCC-BmhhO76e.js} +1 -1
  269. package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-C1LUI1_G.js → cynefin-OW5HDTMX-BesIxLGS.js} +1 -1
  270. package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-D3Ymzw_P.js → cynefinDiagram-5FMLGOSQ-DdF6XhwX.js} +1 -1
  271. package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-DRaL0cGu.js → dagre-GXQ25YYZ-CxUfRr5w.js} +1 -1
  272. package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-D8gLHoZo.js → diagram-S7CK7UJ4-zSD7nygh.js} +1 -1
  273. package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-CaVU0aQT.js → diagram-UQ7AKVKN-CgirUu7t.js} +1 -1
  274. package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-LFAKRvZz.js → diagram-VSXAHHWV-CkI9kDpP.js} +1 -1
  275. package/runtime/webapp/dist/assets/{diagram-VX7I27RA-DXpxUERc.js → diagram-VX7I27RA-ZfbGJBGR.js} +1 -1
  276. package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-vAiik55G.js → diagram-Z3DM3KII-CA44IJP4.js} +1 -1
  277. package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-MaFL7Kgb.js → ebnfDiagram-PWID7BFC-CVwSxyot.js} +1 -1
  278. package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-DuEu79B3.js → erDiagram-RLTQ6QDP-DwjlVHEs.js} +1 -1
  279. package/runtime/webapp/dist/assets/{file-types-ZVLWtslN.js → file-types-Dj25tuty.js} +1 -1
  280. package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-BAQ6nP2D.js → flowDiagram-HODETNUW-CEt0pwA8.js} +1 -1
  281. package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-C48VBnPy.js → ganttDiagram-EL5Y4UJY-CNsj7gWS.js} +3 -3
  282. package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-BfWAh9Kr.js → gitGraphDiagram-WWUBYQGX-ERbll1_Q.js} +1 -1
  283. package/runtime/webapp/dist/assets/{history-D4E3D_aM.js → history-DTS97eAH.js} +1 -1
  284. package/runtime/webapp/dist/assets/{image-plus-DQV_EEAN.js → image-plus-BmlwMe18.js} +1 -1
  285. package/runtime/webapp/dist/assets/index-C30NoLsn.js +500 -0
  286. package/runtime/webapp/dist/assets/index-COFV-DUC.css +1 -0
  287. package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-BM7P_-u_.js → infoDiagram-27XIBGKW-BiMEmJW5.js} +1 -1
  288. package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Cwd8XR-p.js → ishikawaDiagram-5VMMS53U-CPlJXmF2.js} +1 -1
  289. package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-MOgiksTh.js → journeyDiagram-3NMN7TZE-DJJ-qvlw.js} +1 -1
  290. package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-DulC5OLL.js → kanban-definition-UXKFOSKX-PHmavvDJ.js} +1 -1
  291. package/runtime/webapp/dist/assets/{layout-Dku9sXQ7.js → layout-DH5OfcVL.js} +1 -1
  292. package/runtime/webapp/dist/assets/{linear-B3-dddD7.js → linear-DQek-QDQ.js} +1 -1
  293. package/runtime/webapp/dist/assets/{list-todo-Bik5IY2r.js → list-todo-DULblcsU.js} +1 -1
  294. package/runtime/webapp/dist/assets/{locate-fixed-CHkezEEh.js → locate-fixed-B3zScPI-.js} +1 -1
  295. package/runtime/webapp/dist/assets/{mermaid.core-CRRXKysA.js → mermaid.core-D6eHnLLU.js} +5 -5
  296. package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-CaaP-nEb.js → mindmap-definition-YA3MSWOX-D0TkZusX.js} +1 -1
  297. package/runtime/webapp/dist/assets/{mobileViewport-CekmYKqS.js → mobileViewport-BhIxH-zP.js} +1 -1
  298. package/runtime/webapp/dist/assets/{new-session-window-BfDMd-h3.css → new-session-window-DIU2v1uh.css} +1 -1
  299. package/runtime/webapp/dist/assets/new-session-window-bxVA-U3Y.js +191 -0
  300. package/runtime/webapp/dist/assets/page-DyPXAvyj.js +86 -0
  301. package/runtime/webapp/dist/assets/{pause-BsmUCuwZ.js → pause-C793N3J1.js} +1 -1
  302. package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-BqybPEwk.js → pegDiagram-XKGWAZYB-DMIjPBzH.js} +1 -1
  303. package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-BX1H2lh2.js → pieDiagram-E7YTZNPT-DctF47JZ.js} +1 -1
  304. package/runtime/webapp/dist/assets/{pin-BsEEYq8M.js → pin-BLVakDSL.js} +1 -1
  305. package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-Btnywv1k.js → quadrantDiagram-AXDQQJYC-JnwbWWwT.js} +1 -1
  306. package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-Da_TV1ER.js → railroadDiagram-O6MQD6OU-DcpHMNVP.js} +1 -1
  307. package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-5V1Aow9h.js → requirementDiagram-BXWQKSXE-C-fRbIOI.js} +1 -1
  308. package/runtime/webapp/dist/assets/{rotate-ccw-BbSby0GQ.js → rotate-ccw-CyZK_Om1.js} +1 -1
  309. package/runtime/webapp/dist/assets/{rotate-cw-BMdX-ln4.js → rotate-cw-ChAt9mcI.js} +1 -1
  310. package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-D_OIVihV.js → sankeyDiagram-P5KCCOFB-Sb34Y9Ep.js} +1 -1
  311. package/runtime/webapp/dist/assets/{send-Cb7EWSJF.js → send-DlrISC4K.js} +1 -1
  312. package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-LKeF5Mri.js → sequenceDiagram-WJ2MYXX4-BeHoOpkJ.js} +1 -1
  313. package/runtime/webapp/dist/assets/{session-dashboard-BFqNDCc8.js → session-dashboard-D1JY1ka0.js} +1 -1
  314. package/runtime/webapp/dist/assets/{session-tree-BK_qaCnb.js → session-tree-Q-jABJNB.js} +1 -1
  315. package/runtime/webapp/dist/assets/{shield-check-C-r87aMq.js → shield-check-Bzd1i1OQ.js} +1 -1
  316. package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-B6j7Q_MN.js → sizeCapture-INFHLROL-DspvE2eQ.js} +1 -1
  317. package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-zhPFqHdQ.js → stateDiagram-D77RDMKH-oBIvmRy9.js} +1 -1
  318. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DXD2F0in.js +1 -0
  319. package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-C_FCENx1.js → swimlanes-42K2YHIH-CAdrbVmI.js} +1 -1
  320. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-CXpNu-5Z.js +8 -0
  321. package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-C3DBXjDU.js → timeline-definition-24CTP7MA-BtWjc4KI.js} +1 -1
  322. package/runtime/webapp/dist/assets/{trash-2-DjggJGbw.js → trash-2-DwFoTvHX.js} +1 -1
  323. package/runtime/webapp/dist/assets/{types-BQCEWNQz.js → types-COzZsLPY.js} +1 -1
  324. package/runtime/webapp/dist/assets/{use-session-activity-BbTXGW7Z.js → use-session-activity-BRhj0V5U.js} +1 -1
  325. package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-CssdTIB0.js → vennDiagram-4TSXK5OY-Be4H6PYr.js} +1 -1
  326. package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-C58K2vVU.js → wardleyDiagram-VM6X3IG4-COVxCAu8.js} +1 -1
  327. package/runtime/webapp/dist/assets/{web-B4y8vdRZ.js → web-BdMHTzmo.js} +1 -1
  328. package/runtime/webapp/dist/assets/{web-D9rJZXHW.js → web-Qg6ZVe1T.js} +1 -1
  329. package/runtime/webapp/dist/assets/{x-BYUglEo9.js → x-CoIXF2eL.js} +1 -1
  330. package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-CQi8bD6A.js → xychartDiagram-S5SC5T6Z-J_S9eMK9.js} +1 -1
  331. package/runtime/webapp/dist/assets/{zoom-out-iMMWRXJs.js → zoom-out-C10hb0zX.js} +1 -1
  332. package/runtime/webapp/dist/index.html +2 -2
  333. package/runtime/ws-server.mjs +5 -0
  334. package/runtime/.next/static/chunks/106.b2050e53421795af.js +0 -1
  335. package/runtime/.next/static/chunks/20.7bd5212774091396.js +0 -1
  336. package/runtime/.next/static/chunks/34.40a88b70750502fb.js +0 -1
  337. package/runtime/.next/static/chunks/753-90c7dd1ba08be9be.js +0 -1
  338. package/runtime/.next/static/chunks/app/web/error-30cea9cffce0ebc2.js +0 -1
  339. package/runtime/.next/static/chunks/app/web/layout-d8a4f4131e7f2330.js +0 -1
  340. package/runtime/.next/static/chunks/app/web/page-b0da5ef19349a66b.js +0 -1
  341. package/runtime/.next/static/chunks/main-app-30a478479a347a9e.js +0 -1
  342. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0e6mn0ck.mjs +0 -17
  343. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0ssqfy51.mjs +0 -18
  344. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-82ghff97.mjs +0 -39
  345. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-82yhcz2x.mjs +0 -17
  346. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-b8jr1m8m.mjs +0 -23
  347. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-cj0jh226.mjs +0 -17
  348. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ebtbxtjf.mjs +0 -28
  349. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-pb4erfqh.mjs +0 -42
  350. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rs058s2g.mjs +0 -16
  351. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-w6pv4szb.mjs +0 -18
  352. package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-wjeh40nr.mjs +0 -20
  353. package/runtime/webapp/dist/assets/AIHubView-CM6ugXG3.js +0 -1
  354. package/runtime/webapp/dist/assets/AiHubPane-DFzC3nbd.js +0 -1
  355. package/runtime/webapp/dist/assets/App-mF6ELC07.js +0 -68
  356. package/runtime/webapp/dist/assets/BrowserLivePanel-CamAULwS.js +0 -61
  357. package/runtime/webapp/dist/assets/FileWorkspaceDrawer-BXDuKlrL.js +0 -1
  358. package/runtime/webapp/dist/assets/FlowStudioPane-lnjLcd9c.js +0 -5
  359. package/runtime/webapp/dist/assets/NewSessionWindow-zjqAUfKb.js +0 -1
  360. package/runtime/webapp/dist/assets/RemoteDesktopPage-9AhztqA2.js +0 -1
  361. package/runtime/webapp/dist/assets/TodoPage-guIvBCW0.js +0 -1
  362. package/runtime/webapp/dist/assets/artifact-links-B0ApmgK6.js +0 -2
  363. package/runtime/webapp/dist/assets/channel-BwDuyJO4.js +0 -1
  364. package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BfyV8P0w.js +0 -1
  365. package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BfyV8P0w.js +0 -1
  366. package/runtime/webapp/dist/assets/composer-file-routing-qSvJpT-v.js +0 -6
  367. package/runtime/webapp/dist/assets/download-BE31-Qm0.js +0 -6
  368. package/runtime/webapp/dist/assets/index-DSgLFE4Q.js +0 -489
  369. package/runtime/webapp/dist/assets/index-zQk0NCEB.css +0 -1
  370. package/runtime/webapp/dist/assets/loader-circle-C5C-IzGK.js +0 -6
  371. package/runtime/webapp/dist/assets/new-session-window-Dgl7UWPR.js +0 -190
  372. package/runtime/webapp/dist/assets/page-_fFyRId-.js +0 -86
  373. package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DWnBZAiI.js +0 -1
  374. package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-DOZCbCJP.js +0 -8
  375. /package/runtime/.next/static/{5rv6PMhU7yq1sI1ClFWRU → XwGGZtJQeU5VoGqV-1dyI}/_buildManifest.js +0 -0
  376. /package/runtime/.next/static/{5rv6PMhU7yq1sI1ClFWRU → XwGGZtJQeU5VoGqV-1dyI}/_ssgManifest.js +0 -0
  377. /package/runtime/.next/static/chunks/{183-dbd3e343da4ba103.js → 183-5019797f0b42210b.js} +0 -0
  378. /package/runtime/.next/static/chunks/{3cc391f0-4ff886cecc4d6d79.js → 3cc391f0-6cd083946ece156d.js} +0 -0
  379. /package/runtime/.next/static/chunks/app/_not-found/{page-c0fc9b6684d4f0ca.js → page-cffe4d626dcef5fd.js} +0 -0
@@ -1074,7 +1074,7 @@ var unthrottledIntervalCallbacks = /* @__PURE__ */ new Map();
1074
1074
  var shouldUseNativeTimers = () => {
1075
1075
  return typeof window === "undefined";
1076
1076
  };
1077
- var unthrottledTimerWorkerMain = () => {
1077
+ var unthrottledTimerWorkerCode = () => {
1078
1078
  const timeoutHandles = /* @__PURE__ */ new Map();
1079
1079
  const intervalHandles = /* @__PURE__ */ new Map();
1080
1080
  self.onmessage = (event) => {
@@ -1126,10 +1126,7 @@ var getUnthrottledTimerWorker = () => {
1126
1126
  if (unthrottledTimerWorker) {
1127
1127
  return unthrottledTimerWorker;
1128
1128
  }
1129
- const workerSource = `(${unthrottledTimerWorkerMain.toString()})();`;
1130
- const workerURL = URL.createObjectURL(new Blob([workerSource], { type: "text/javascript" }));
1131
- unthrottledTimerWorker = new Worker(workerURL);
1132
- URL.revokeObjectURL(workerURL);
1129
+ unthrottledTimerWorker = createWorker("unthrottled-timer", unthrottledTimerWorkerCode);
1133
1130
  unthrottledTimerWorker.onmessage = (event) => {
1134
1131
  const message = event.data;
1135
1132
  const timeoutCallback = unthrottledTimeoutCallbacks.get(message.timerId);
@@ -1145,6 +1142,24 @@ var getUnthrottledTimerWorker = () => {
1145
1142
  };
1146
1143
  return unthrottledTimerWorker;
1147
1144
  };
1145
+ var workerBlobUrls = /* @__PURE__ */ new Map();
1146
+ var createWorker = (name, workerMain) => {
1147
+ const workerUrl = globalThis[Symbol.for("mediabunny:workerUrl")];
1148
+ if (workerUrl !== void 0 && typeof workerUrl !== "string" && !(workerUrl instanceof URL)) {
1149
+ throw new TypeError(
1150
+ "globalThis[Symbol.for('mediabunny:workerUrl')], when provided, must be a string or URL."
1151
+ );
1152
+ }
1153
+ if (workerUrl !== void 0) {
1154
+ return new Worker(workerUrl, { name });
1155
+ }
1156
+ let blobUrl = workerBlobUrls.get(workerMain);
1157
+ if (!blobUrl) {
1158
+ blobUrl = URL.createObjectURL(new Blob([`(${workerMain.toString()})();`], { type: "text/javascript" }));
1159
+ workerBlobUrls.set(workerMain, blobUrl);
1160
+ }
1161
+ return new Worker(blobUrl, { name });
1162
+ };
1148
1163
  var setIntervalUnthrottled = (callback, delay) => {
1149
1164
  if (shouldUseNativeTimers()) {
1150
1165
  return { id: setInterval(callback, delay) };
@@ -2233,7 +2248,7 @@ var EAC3_REDUCED_SAMPLE_RATES = [24e3, 22050, 16e3];
2233
2248
  var TRUEHD_MAJOR_SYNC_WORD = 4168249274;
2234
2249
 
2235
2250
  // src/version.ts
2236
- var VERSION = "1.66.2";
2251
+ var VERSION = "1.66.5";
2237
2252
  var VERSIONED_NAME = `Mediabunny v${VERSION}`;
2238
2253
 
2239
2254
  // src/codec-data.ts
@@ -9251,10 +9266,9 @@ var createAes128CbcDecryptStream = (reader, getInit, close) => {
9251
9266
  return new ReadableStream({
9252
9267
  pull: async (controller) => {
9253
9268
  try {
9254
- if (!initted) {
9255
- aesContext.init(await getInit());
9256
- initted = true;
9257
- }
9269
+ const initPromise = initted ? null : Promise.resolve(getInit());
9270
+ void initPromise?.catch(() => {
9271
+ });
9258
9272
  const requestedLength = CHUNK_SIZE + BLOCK_SIZE;
9259
9273
  let nextSlice = reader.requestSliceRange(pos, 0, requestedLength);
9260
9274
  if (isThenable(nextSlice)) nextSlice = await nextSlice;
@@ -9268,6 +9282,10 @@ var createAes128CbcDecryptStream = (reader, getInit, close) => {
9268
9282
  const bytesToRead = sliceLength === requestedLength ? sliceLength - BLOCK_SIZE : sliceLength;
9269
9283
  const input = readBytes(nextSlice, bytesToRead);
9270
9284
  const output = new Uint8Array(bytesToRead);
9285
+ if (initPromise) {
9286
+ aesContext.init(await initPromise);
9287
+ initted = true;
9288
+ }
9271
9289
  for (let i = 0; i < bytesToRead; i += 16) {
9272
9290
  aesContext.in.set(input.subarray(i, i + 16));
9273
9291
  aesContext.decrypt();
@@ -9378,9 +9396,17 @@ var IsobmffDemuxer = class _IsobmffDemuxer extends Demuxer {
9378
9396
  if (this.movieTimescale === -1) {
9379
9397
  throw new Error("Invalid moov box: missing mvhd box.");
9380
9398
  }
9399
+ const iTunSmpb = this.metadataTags.raw?.["iTunSMPB"];
9381
9400
  for (const track of this.tracks) {
9401
+ if (typeof iTunSmpb === "string" && track.info?.type === "audio" && track.info.codec === "aac" && track.timestampOffset === 0) {
9402
+ const priming = Number.parseInt(iTunSmpb.trim().split(/\s+/)[1] ?? "", 16);
9403
+ if (priming > 0) {
9404
+ const primingInSeconds = priming / track.info.sampleRate;
9405
+ track.timestampOffset = Math.round(primingInSeconds * track.timescale);
9406
+ }
9407
+ }
9382
9408
  const previousSegmentDurationsInSeconds = track.editListPreviousSegmentDurations / this.movieTimescale;
9383
- track.editListOffset -= Math.round(previousSegmentDurationsInSeconds * track.timescale);
9409
+ track.timestampOffset -= Math.round(previousSegmentDurationsInSeconds * track.timescale);
9384
9410
  }
9385
9411
  lookForMfraBox = this.isFragmented && this.reader.fileSize !== null && this.reader.fileSize > startPos + boxInfo.totalSize;
9386
9412
  foundMovieBoxes = true;
@@ -9398,7 +9424,10 @@ var IsobmffDemuxer = class _IsobmffDemuxer extends Demuxer {
9398
9424
  }
9399
9425
  currentPos = startPos + boxInfo.totalSize;
9400
9426
  }
9401
- if (!foundMovieBoxes && this.input._initInput) {
9427
+ if (!foundMovieBoxes) {
9428
+ if (!this.input._initInput) {
9429
+ throw new Error('No "moov" box found; the file is invalid or incomplete.');
9430
+ }
9402
9431
  await this.copyMetadataFromInitInput(this.input._initInput);
9403
9432
  }
9404
9433
  if (lookForMfraBox) {
@@ -9471,7 +9500,7 @@ var IsobmffDemuxer = class _IsobmffDemuxer extends Demuxer {
9471
9500
  fragmentLookupTable: [],
9472
9501
  fragmentPositionCache: [],
9473
9502
  editListPreviousSegmentDurations: foreignTrack.editListPreviousSegmentDurations,
9474
- editListOffset: foreignTrack.editListOffset,
9503
+ timestampOffset: foreignTrack.timestampOffset,
9475
9504
  encryptionInfo: foreignTrack.encryptionInfo,
9476
9505
  encryptionAuxInfo: null,
9477
9506
  frmaCodecString: null,
@@ -9848,7 +9877,7 @@ var IsobmffDemuxer = class _IsobmffDemuxer extends Demuxer {
9848
9877
  fragmentLookupTable: [],
9849
9878
  fragmentPositionCache: [],
9850
9879
  editListPreviousSegmentDurations: 0,
9851
- editListOffset: 0,
9880
+ timestampOffset: 0,
9852
9881
  encryptionInfo: null,
9853
9882
  encryptionAuxInfo: null,
9854
9883
  frmaCodecString: null,
@@ -9933,7 +9962,7 @@ var IsobmffDemuxer = class _IsobmffDemuxer extends Demuxer {
9933
9962
  break;
9934
9963
  }
9935
9964
  track.editListPreviousSegmentDurations = previousSegmentDurations;
9936
- track.editListOffset = mediaTime;
9965
+ track.timestampOffset = mediaTime;
9937
9966
  relevantEntryFound = true;
9938
9967
  }
9939
9968
  }
@@ -11538,7 +11567,30 @@ var IsobmffDemuxer = class _IsobmffDemuxer extends Demuxer {
11538
11567
  if (this.currentMetadataKeys.has(nameAsNumber)) {
11539
11568
  metadataKey = this.currentMetadataKeys.get(nameAsNumber);
11540
11569
  }
11541
- const data = readDataBox(slice2);
11570
+ let data = null;
11571
+ if (metadataKey === "----") {
11572
+ let name = null;
11573
+ const freeformSlice = slice2.slice(slice2.filePos, boxInfo2.contentSize);
11574
+ const childIterator = this.iterateContiguousBoxes(freeformSlice);
11575
+ for (const { boxInfo: childBoxInfo, slice: childSlice } of childIterator) {
11576
+ if (childBoxInfo.name === "name" && name === null) {
11577
+ if (childBoxInfo.contentSize < 4) {
11578
+ throw new Error("Invalid 'name' box: too small.");
11579
+ }
11580
+ childSlice.skip(4);
11581
+ name = textDecoder.decode(readBytes(childSlice, childBoxInfo.contentSize - 4));
11582
+ } else if (childBoxInfo.name === "data" && data === null) {
11583
+ childSlice.filePos -= childBoxInfo.headerSize;
11584
+ data = readDataBox(childSlice);
11585
+ }
11586
+ }
11587
+ if (name === null) {
11588
+ continue;
11589
+ }
11590
+ metadataKey = name;
11591
+ } else {
11592
+ data = readDataBox(slice2);
11593
+ }
11542
11594
  this.metadataTags.raw ??= {};
11543
11595
  this.metadataTags.raw[metadataKey] ??= data;
11544
11596
  switch (metadataKey) {
@@ -11807,7 +11859,7 @@ var IsobmffTrackBacking = class {
11807
11859
  return this.fetchFirstFragmentedPacket(false, options);
11808
11860
  }
11809
11861
  mapTimestampIntoTimescale(timestamp) {
11810
- return roundIfAlmostInteger(timestamp * this.internalTrack.timescale) + this.internalTrack.editListOffset;
11862
+ return roundIfAlmostInteger(timestamp * this.internalTrack.timescale) + this.internalTrack.timestampOffset;
11811
11863
  }
11812
11864
  async getPacket(timestamp, options) {
11813
11865
  const timestampInTimescale = this.mapTimestampIntoTimescale(timestamp);
@@ -12003,6 +12055,10 @@ var IsobmffTrackBacking = class {
12003
12055
  if (!sampleInfo) {
12004
12056
  return null;
12005
12057
  }
12058
+ const fileSize = this.internalTrack.demuxer.reader.fileSize;
12059
+ if (fileSize !== null && sampleInfo.sampleOffset + sampleInfo.sampleSize > fileSize) {
12060
+ return null;
12061
+ }
12006
12062
  let data;
12007
12063
  if (options.metadataOnly && this.internalTrack.info?.codec !== "eac3") {
12008
12064
  data = PLACEHOLDER_DATA;
@@ -12034,7 +12090,7 @@ var IsobmffTrackBacking = class {
12034
12090
  }
12035
12091
  }
12036
12092
  }
12037
- const timestamp = (sampleInfo.presentationTimestamp - this.internalTrack.editListOffset) / this.internalTrack.timescale;
12093
+ const timestamp = (sampleInfo.presentationTimestamp - this.internalTrack.timestampOffset) / this.internalTrack.timescale;
12038
12094
  const duration = sampleInfo.duration / this.internalTrack.timescale;
12039
12095
  const packet = new EncodedPacket(
12040
12096
  data,
@@ -12057,6 +12113,10 @@ var IsobmffTrackBacking = class {
12057
12113
  const trackData = fragment.trackData.get(this.internalTrack.id);
12058
12114
  const fragmentSample = trackData.samples[sampleIndex];
12059
12115
  assert(fragmentSample);
12116
+ const fileSize = this.internalTrack.demuxer.reader.fileSize;
12117
+ if (fileSize !== null && fragmentSample.byteOffset + fragmentSample.byteSize > fileSize) {
12118
+ return null;
12119
+ }
12060
12120
  let data;
12061
12121
  if (options.metadataOnly && this.internalTrack.info?.codec !== "eac3") {
12062
12122
  data = PLACEHOLDER_DATA;
@@ -12077,7 +12137,7 @@ var IsobmffTrackBacking = class {
12077
12137
  }
12078
12138
  }
12079
12139
  }
12080
- const timestamp = (fragmentSample.presentationTimestamp - this.internalTrack.editListOffset) / this.internalTrack.timescale;
12140
+ const timestamp = (fragmentSample.presentationTimestamp - this.internalTrack.timestampOffset) / this.internalTrack.timescale;
12081
12141
  const duration = fragmentSample.duration / this.internalTrack.timescale;
12082
12142
  const packet = new EncodedPacket(
12083
12143
  data,
@@ -12194,7 +12254,7 @@ var IsobmffTrackBacking = class {
12194
12254
  size: samplePacket.data.byteLength,
12195
12255
  blockCount: 6
12196
12256
  }];
12197
- const searchTimestampInSeconds = (searchTimestamp - this.internalTrack.editListOffset) / this.internalTrack.timescale;
12257
+ const searchTimestampInSeconds = (searchTimestamp - this.internalTrack.timestampOffset) / this.internalTrack.timescale;
12198
12258
  let match = null;
12199
12259
  let previousPacket = null;
12200
12260
  let blocksBefore = 0;
@@ -13479,6 +13539,9 @@ var MatroskaDemuxer = class extends Demuxer {
13479
13539
  assertDefinedSize(size);
13480
13540
  currentPos = dataStartPos + size;
13481
13541
  }
13542
+ if (this.segments.length === 0) {
13543
+ throw new Error("No Segment element found; the file is invalid or incomplete.");
13544
+ }
13482
13545
  })();
13483
13546
  }
13484
13547
  async readSegment(segmentDataStart, dataSize) {
@@ -17123,6 +17186,10 @@ var Mp3AudioTrackBacking = class {
17123
17186
  if (!rawSample) {
17124
17187
  return null;
17125
17188
  }
17189
+ const fileSize = this.demuxer.reader.fileSize;
17190
+ if (fileSize !== null && rawSample.dataStart + rawSample.dataSize > fileSize) {
17191
+ return null;
17192
+ }
17126
17193
  let data;
17127
17194
  if (options.metadataOnly) {
17128
17195
  data = PLACEHOLDER_DATA;
@@ -18943,6 +19010,10 @@ var AdtsAudioTrackBacking = class {
18943
19010
  if (!rawSample) {
18944
19011
  return null;
18945
19012
  }
19013
+ const fileSize = this.demuxer.reader.fileSize;
19014
+ if (fileSize !== null && rawSample.dataStart + rawSample.dataSize > fileSize) {
19015
+ return null;
19016
+ }
18946
19017
  let data;
18947
19018
  if (options.metadataOnly) {
18948
19019
  data = PLACEHOLDER_DATA;
@@ -19728,6 +19799,7 @@ var MpegTsDemuxer = class _MpegTsDemuxer extends Demuxer {
19728
19799
  let programMapPid = null;
19729
19800
  let hasProgramAssociationTable = false;
19730
19801
  let hasProgramMap = false;
19802
+ let initDemuxer = null;
19731
19803
  while (true) {
19732
19804
  const packetHeader = await this.readPacketHeader(currentPos);
19733
19805
  if (!packetHeader) {
@@ -19968,22 +20040,26 @@ var MpegTsDemuxer = class _MpegTsDemuxer extends Demuxer {
19968
20040
  }
19969
20041
  elementaryStream.firstSection = section;
19970
20042
  elementaryStream.canBeTrustedWithKeyPackets = section.randomAccessIndicator === 1;
19971
- if (this.input._initInput) {
19972
- const initDemuxer = await this.input._initInput._getDemuxer();
19973
- if (initDemuxer.constructor !== _MpegTsDemuxer) {
19974
- throw new Error("Init input must match the input's format.");
19975
- }
19976
- await initDemuxer.readMetadata();
19977
- const matchingStream = initDemuxer.elementaryStreams.find((x) => x.pid === section.pid && x.info.codec === elementaryStream.info.codec && x.initialized);
19978
- if (matchingStream) {
19979
- elementaryStream.info = matchingStream.info;
19980
- elementaryStream.initialized = true;
19981
- break outer;
19982
- }
19983
- }
19984
20043
  const context = new PacketReadingContext(elementaryStream, section.startPos);
19985
20044
  if (elementaryStream.info.type === "video") {
20045
+ let packetCount = 0;
19986
20046
  while (true) {
20047
+ if (packetCount === 1 && this.input._initInput) {
20048
+ if (!initDemuxer) {
20049
+ initDemuxer = await this.input._initInput._getDemuxer();
20050
+ if (initDemuxer.constructor !== _MpegTsDemuxer) {
20051
+ throw new Error("Init input must match the input's format.");
20052
+ }
20053
+ await initDemuxer.readMetadata();
20054
+ }
20055
+ const matchingStream = initDemuxer.elementaryStreams.find((x) => x.pid === section.pid && x.info.codec === elementaryStream.info.codec && x.initialized);
20056
+ if (matchingStream) {
20057
+ elementaryStream.info = matchingStream.info;
20058
+ elementaryStream.initialized = true;
20059
+ break outer;
20060
+ }
20061
+ }
20062
+ packetCount++;
19987
20063
  const contextAlias = context;
19988
20064
  contextAlias.suppliedPacket = null;
19989
20065
  await context.markNextPacket();
@@ -21736,7 +21812,7 @@ var SegmentedInput = class {
21736
21812
  if (!this.firstSegment) {
21737
21813
  return [];
21738
21814
  }
21739
- const input = this.getInputForSegment(this.firstSegment);
21815
+ const input = this.getInputForSegment(this.firstSegment.initSegment ?? this.firstSegment);
21740
21816
  const inputTracks = await input.getTracks();
21741
21817
  for (const track of inputTracks) {
21742
21818
  if (track.type === "video") {
@@ -21804,34 +21880,34 @@ var SegmentedInputInputTrackBacking = class {
21804
21880
  constructor(segmentedInput, decl, number) {
21805
21881
  this.packetInfos = /* @__PURE__ */ new WeakMap();
21806
21882
  this.hydrationPromise = null;
21807
- this.firstInputTrack = null;
21808
- this.firstSegment = null;
21883
+ this.metadataInputTrack = null;
21809
21884
  this.segmentedInput = segmentedInput;
21810
21885
  this.decl = decl;
21811
21886
  this.number = number;
21812
21887
  }
21813
21888
  hydrate() {
21814
21889
  return this.hydrationPromise ??= (async () => {
21815
- this.segmentedInput.firstSegment ??= await this.segmentedInput.getFirstSegment({});
21816
- if (!this.segmentedInput.firstSegment) {
21817
- throw new Error("Missing first segment, can't retrieve track.");
21818
- }
21819
- let currentSegment = this.segmentedInput.firstSegment;
21890
+ const firstSegment = await this.getFirstSegment();
21820
21891
  let track = null;
21821
- while (currentSegment) {
21822
- const input = this.segmentedInput.getInputForSegment(currentSegment);
21823
- const inputTracks = await input.getTracks();
21892
+ if (firstSegment.initSegment) {
21893
+ const inputTracks = await this.segmentedInput.getInputForSegment(firstSegment.initSegment).getTracks();
21824
21894
  track = inputTracks.find((x) => x.type === this.decl.type && x.number === this.number) ?? null;
21825
- if (track) {
21826
- break;
21895
+ } else {
21896
+ let currentSegment = firstSegment;
21897
+ while (currentSegment) {
21898
+ const input = this.segmentedInput.getInputForSegment(currentSegment);
21899
+ const inputTracks = await input.getTracks();
21900
+ track = inputTracks.find((x) => x.type === this.decl.type && x.number === this.number) ?? null;
21901
+ if (track) {
21902
+ break;
21903
+ }
21904
+ currentSegment = await this.segmentedInput.getNextSegment(currentSegment, {});
21827
21905
  }
21828
- currentSegment = await this.segmentedInput.getNextSegment(currentSegment, {});
21829
21906
  }
21830
21907
  if (!track) {
21831
21908
  throw new Error("No matching track found in underlying media data.");
21832
21909
  }
21833
- this.firstInputTrack = track;
21834
- this.firstSegment = currentSegment;
21910
+ this.metadataInputTrack = track;
21835
21911
  })();
21836
21912
  }
21837
21913
  getType() {
@@ -21842,53 +21918,52 @@ var SegmentedInputInputTrackBacking = class {
21842
21918
  }
21843
21919
  /** If the backing track is already present, delegate synchronously; otherwise, hydrate first. */
21844
21920
  delegate(fn) {
21845
- if (this.firstInputTrack) {
21921
+ if (this.metadataInputTrack) {
21846
21922
  return fn();
21847
21923
  }
21848
21924
  return this.hydrate().then(fn);
21849
21925
  }
21850
21926
  async getDecoderConfig() {
21851
- return this.delegate(() => this.firstInputTrack._backing.getDecoderConfig());
21927
+ return this.delegate(() => this.metadataInputTrack._backing.getDecoderConfig());
21852
21928
  }
21853
21929
  getHasOnlyKeyPackets() {
21854
21930
  return this.delegate(() => {
21855
- return this.segmentedInput.hasOnlyKeyPackets || (this.firstInputTrack._backing.getHasOnlyKeyPackets?.() ?? null);
21931
+ return this.segmentedInput.hasOnlyKeyPackets || (this.metadataInputTrack._backing.getHasOnlyKeyPackets?.() ?? null);
21856
21932
  });
21857
21933
  }
21858
21934
  getPairingMask() {
21859
21935
  return 1n;
21860
21936
  }
21861
21937
  getCodec() {
21862
- return this.delegate(() => this.firstInputTrack._backing.getCodec());
21938
+ return this.delegate(() => this.metadataInputTrack._backing.getCodec());
21863
21939
  }
21864
21940
  getInternalCodecId() {
21865
- return this.delegate(() => this.firstInputTrack._backing.getInternalCodecId());
21941
+ return this.delegate(() => this.metadataInputTrack._backing.getInternalCodecId());
21866
21942
  }
21867
21943
  getDisposition() {
21868
- return this.delegate(() => this.firstInputTrack._backing.getDisposition());
21944
+ return this.delegate(() => this.metadataInputTrack._backing.getDisposition());
21869
21945
  }
21870
21946
  getLanguageCode() {
21871
- return this.delegate(() => this.firstInputTrack._backing.getLanguageCode());
21947
+ return this.delegate(() => this.metadataInputTrack._backing.getLanguageCode());
21872
21948
  }
21873
21949
  getName() {
21874
- return this.delegate(() => this.firstInputTrack._backing.getName());
21950
+ return this.delegate(() => this.metadataInputTrack._backing.getName());
21875
21951
  }
21876
21952
  getTimeResolution() {
21877
- return this.delegate(() => this.firstInputTrack._backing.getTimeResolution());
21953
+ return this.delegate(() => this.metadataInputTrack._backing.getTimeResolution());
21878
21954
  }
21879
21955
  async isRelativeToUnixEpoch() {
21880
- await this.hydrate();
21881
- assert(this.segmentedInput.firstSegment);
21882
- return this.segmentedInput.firstSegment.unixEpochTimestamp === this.segmentedInput.firstSegment.timestamp;
21956
+ const firstSegment = await this.getFirstSegment();
21957
+ return firstSegment.unixEpochTimestamp === firstSegment.timestamp;
21883
21958
  }
21884
21959
  getUnixTimeForTimestamp(timestamp) {
21885
21960
  return this.segmentedInput.getUnixTimeForTimestamp(timestamp);
21886
21961
  }
21887
21962
  getBitrate() {
21888
- return this.delegate(() => this.firstInputTrack._backing.getBitrate());
21963
+ return this.delegate(() => this.metadataInputTrack._backing.getBitrate());
21889
21964
  }
21890
21965
  getAverageBitrate() {
21891
- return this.delegate(() => this.firstInputTrack._backing.getAverageBitrate());
21966
+ return this.delegate(() => this.metadataInputTrack._backing.getAverageBitrate());
21892
21967
  }
21893
21968
  getDurationFromMetadata(options) {
21894
21969
  return this.segmentedInput.getDurationFromMetadata(options);
@@ -21898,9 +21973,9 @@ var SegmentedInputInputTrackBacking = class {
21898
21973
  }
21899
21974
  async createAdjustedPacket(packet, segment, track) {
21900
21975
  assert(packet.sequenceNumber >= 0);
21901
- assert(this.segmentedInput.firstSegment);
21976
+ const firstSegment = await this.getFirstSegment();
21902
21977
  const mediaOffset = await this.segmentedInput.getMediaOffset(segment, track.input);
21903
- const segmentTimestampRelativeToFirst = segment.timestamp - this.segmentedInput.firstSegment.timestamp;
21978
+ const segmentTimestampRelativeToFirst = segment.timestamp - firstSegment.timestamp;
21904
21979
  const modified = packet.clone({
21905
21980
  timestamp: roundToDivisor(
21906
21981
  packet.timestamp + mediaOffset,
@@ -21918,30 +21993,33 @@ var SegmentedInputInputTrackBacking = class {
21918
21993
  return modified;
21919
21994
  }
21920
21995
  async getFirstPacket(options) {
21921
- await this.hydrate();
21922
- assert(this.firstInputTrack);
21923
- assert(this.firstSegment);
21924
- let currentTrack = this.firstInputTrack;
21925
- let currentSegment = this.firstSegment;
21926
- while (true) {
21927
- if (currentTrack) {
21928
- const packet = await currentTrack._backing.getFirstPacket(options);
21996
+ const firstSegment = await this.getFirstSegment();
21997
+ void this.segmentedInput.getMediaOffsetForDiscontinuity(firstSegment.discontinuityNumber).catch(() => {
21998
+ });
21999
+ let currentSegment = firstSegment;
22000
+ while (currentSegment) {
22001
+ const input = this.segmentedInput.getInputForSegment(currentSegment);
22002
+ const tracks = await input.getTracks();
22003
+ const track = tracks.find((t) => t.type === this.decl.type && t.number === this.number);
22004
+ if (track) {
22005
+ const packet = await track._backing.getFirstPacket(options);
21929
22006
  if (packet) {
21930
- return this.createAdjustedPacket(packet, currentSegment, currentTrack);
22007
+ return this.createAdjustedPacket(packet, currentSegment, track);
21931
22008
  }
21932
22009
  }
21933
22010
  currentSegment = await this.segmentedInput.getNextSegment(currentSegment, {
21934
22011
  skipLiveWait: options.skipLiveWait
21935
22012
  });
21936
- if (!currentSegment) {
21937
- break;
21938
- }
21939
- const nextInput = this.segmentedInput.getInputForSegment(currentSegment);
21940
- const nextTracks = await nextInput.getTracks();
21941
- currentTrack = nextTracks.find((t) => t.type === this.firstInputTrack.type && t.number === this.firstInputTrack.number) ?? null;
21942
22013
  }
21943
22014
  return null;
21944
22015
  }
22016
+ async getFirstSegment() {
22017
+ this.segmentedInput.firstSegment ??= await this.segmentedInput.getFirstSegment({});
22018
+ if (!this.segmentedInput.firstSegment) {
22019
+ throw new Error("Missing first segment, can't retrieve track.");
22020
+ }
22021
+ return this.segmentedInput.firstSegment;
22022
+ }
21945
22023
  getNextPacket(packet, options) {
21946
22024
  return this._getNextInternal(packet, options, false);
21947
22025
  }
@@ -21997,11 +22075,12 @@ var SegmentedInputInputTrackBacking = class {
21997
22075
  if (!currentSegment) {
21998
22076
  return null;
21999
22077
  }
22000
- await this.hydrate();
22078
+ void this.segmentedInput.getMediaOffsetForDiscontinuity(currentSegment.discontinuityNumber).catch(() => {
22079
+ });
22001
22080
  while (currentSegment) {
22002
22081
  const input = this.segmentedInput.getInputForSegment(currentSegment);
22003
22082
  const tracks = await input.getTracks();
22004
- const track = tracks.find((t) => t.type === this.firstInputTrack.type && t.number === this.firstInputTrack.number);
22083
+ const track = tracks.find((t) => t.type === this.decl.type && t.number === this.number);
22005
22084
  if (!track) {
22006
22085
  currentSegment = await this.segmentedInput.getPreviousSegment(currentSegment, {
22007
22086
  skipLiveWait: options.skipLiveWait
@@ -22041,7 +22120,7 @@ var SegmentedInputInputTrackBacking = class {
22041
22120
  if (nextSegment) {
22042
22121
  const nextInput = this.segmentedInput.getInputForSegment(nextSegment);
22043
22122
  const nextTracks = await nextInput.getTracks();
22044
- const nextTrack = nextTracks.find((t) => t.type === this.firstInputTrack.type && t.number === this.firstInputTrack.number);
22123
+ const nextTrack = nextTracks.find((t) => t.type === this.decl.type && t.number === this.number);
22045
22124
  let nextPacket = nextTrack ? await nextTrack._backing.getFirstPacket({ ...options, metadataOnly: true }) : null;
22046
22125
  if (nextPacket && keyframesOnly && nextPacket.type !== "key") {
22047
22126
  nextPacket = await nextTrack._backing.getNextKeyPacket(nextPacket, {
@@ -22077,31 +22156,31 @@ var SegmentedInputInputVideoTrackBacking = class extends SegmentedInputInputTrac
22077
22156
  return "video";
22078
22157
  }
22079
22158
  getCodec() {
22080
- return this.delegate(() => this.firstInputTrack._backing.getCodec());
22159
+ return this.delegate(() => this.metadataInputTrack._backing.getCodec());
22081
22160
  }
22082
22161
  getCodedWidth() {
22083
- return this.delegate(() => this.firstInputTrack._backing.getCodedWidth());
22162
+ return this.delegate(() => this.metadataInputTrack._backing.getCodedWidth());
22084
22163
  }
22085
22164
  getCodedHeight() {
22086
- return this.delegate(() => this.firstInputTrack._backing.getCodedHeight());
22165
+ return this.delegate(() => this.metadataInputTrack._backing.getCodedHeight());
22087
22166
  }
22088
22167
  getSquarePixelWidth() {
22089
- return this.delegate(() => this.firstInputTrack._backing.getSquarePixelWidth());
22168
+ return this.delegate(() => this.metadataInputTrack._backing.getSquarePixelWidth());
22090
22169
  }
22091
22170
  getSquarePixelHeight() {
22092
- return this.delegate(() => this.firstInputTrack._backing.getSquarePixelHeight());
22171
+ return this.delegate(() => this.metadataInputTrack._backing.getSquarePixelHeight());
22093
22172
  }
22094
22173
  getTransformationMatrix() {
22095
- return this.delegate(() => this.firstInputTrack._backing.getTransformationMatrix());
22174
+ return this.delegate(() => this.metadataInputTrack._backing.getTransformationMatrix());
22096
22175
  }
22097
22176
  async getColorSpace() {
22098
- return this.delegate(() => this.firstInputTrack._backing.getColorSpace());
22177
+ return this.delegate(() => this.metadataInputTrack._backing.getColorSpace());
22099
22178
  }
22100
22179
  async canBeTransparent() {
22101
- return this.delegate(() => this.firstInputTrack._backing.canBeTransparent());
22180
+ return this.delegate(() => this.metadataInputTrack._backing.canBeTransparent());
22102
22181
  }
22103
22182
  async getDecoderConfig() {
22104
- return this.delegate(() => this.firstInputTrack._backing.getDecoderConfig());
22183
+ return this.delegate(() => this.metadataInputTrack._backing.getDecoderConfig());
22105
22184
  }
22106
22185
  };
22107
22186
  var SegmentedInputInputAudioTrackBacking = class extends SegmentedInputInputTrackBacking {
@@ -22109,16 +22188,16 @@ var SegmentedInputInputAudioTrackBacking = class extends SegmentedInputInputTrac
22109
22188
  return "audio";
22110
22189
  }
22111
22190
  getCodec() {
22112
- return this.delegate(() => this.firstInputTrack._backing.getCodec());
22191
+ return this.delegate(() => this.metadataInputTrack._backing.getCodec());
22113
22192
  }
22114
22193
  getNumberOfChannels() {
22115
- return this.delegate(() => this.firstInputTrack._backing.getNumberOfChannels());
22194
+ return this.delegate(() => this.metadataInputTrack._backing.getNumberOfChannels());
22116
22195
  }
22117
22196
  getSampleRate() {
22118
- return this.delegate(() => this.firstInputTrack._backing.getSampleRate());
22197
+ return this.delegate(() => this.metadataInputTrack._backing.getSampleRate());
22119
22198
  }
22120
22199
  async getDecoderConfig() {
22121
- return this.delegate(() => this.firstInputTrack._backing.getDecoderConfig());
22200
+ return this.delegate(() => this.metadataInputTrack._backing.getDecoderConfig());
22122
22201
  }
22123
22202
  };
22124
22203
 
@@ -24493,8 +24572,12 @@ var HlsSegmentedInput = class extends SegmentedInput {
24493
24572
  return cacheEntry.input;
24494
24573
  }
24495
24574
  let initInput = null;
24496
- if (hlsSegment.initSegment || hlsSegment.firstSegment) {
24497
- initInput = this.getInputForSegment(hlsSegment.initSegment ?? hlsSegment.firstSegment);
24575
+ if (hlsSegment.initSegment) {
24576
+ initInput = this.getInputForSegment(hlsSegment.initSegment);
24577
+ void initInput.getTracks().catch(() => {
24578
+ });
24579
+ } else if (hlsSegment.firstSegment) {
24580
+ initInput = this.getInputForSegment(hlsSegment.firstSegment);
24498
24581
  }
24499
24582
  const formatOptions = {
24500
24583
  ...this.input._formatOptions,
@@ -24615,17 +24698,21 @@ var HlsSegmentedInput = class extends SegmentedInput {
24615
24698
  }
24616
24699
  getFirstSegmentTimestampOffset() {
24617
24700
  return this.segmentTimestampOffsetPromise ??= (async () => {
24618
- const firstSegment = await this.getFirstSegment();
24619
- assert(firstSegment);
24620
24701
  const referenceSegmentedInput = this.demuxer.getReferenceSegmentedInput();
24621
24702
  if (this === referenceSegmentedInput) {
24622
24703
  return 0;
24623
24704
  }
24624
- const referenceFirstSegment = await referenceSegmentedInput.getFirstSegment();
24705
+ const [firstSegment, referenceFirstSegment] = await Promise.all([
24706
+ this.getFirstSegment(),
24707
+ referenceSegmentedInput.getFirstSegment()
24708
+ ]);
24709
+ assert(firstSegment);
24625
24710
  if (referenceFirstSegment && (this.listsAllSegments() && referenceSegmentedInput.listsAllSegments() || firstSegment.unixEpochTimestamp === firstSegment.timestamp && referenceFirstSegment.unixEpochTimestamp === referenceFirstSegment.timestamp)) {
24626
24711
  return 0;
24627
24712
  }
24628
24713
  const input = this.getInputForSegment(firstSegment);
24714
+ void this.getMediaOffsetForDiscontinuity(firstSegment.discontinuityNumber).catch(() => {
24715
+ });
24629
24716
  if (await this.getRawTimestampOffset(input) === null) {
24630
24717
  return 0;
24631
24718
  }
@@ -25271,14 +25358,17 @@ var HlsInputTrackBacking = class {
25271
25358
  return this.internalTrack.hasOnlyKeyPackets || null;
25272
25359
  }
25273
25360
  async getFirstPacket(options) {
25361
+ this.prefetchReferencePlaylist();
25274
25362
  await this.hydrate();
25275
25363
  return this.internalTrack.backingTrack.getFirstPacket(options);
25276
25364
  }
25277
25365
  async getPacket(timestamp, options) {
25366
+ this.prefetchReferencePlaylist();
25278
25367
  await this.hydrate();
25279
25368
  return this.internalTrack.backingTrack.getPacket(timestamp, options);
25280
25369
  }
25281
25370
  async getKeyPacket(timestamp, options) {
25371
+ this.prefetchReferencePlaylist();
25282
25372
  await this.hydrate();
25283
25373
  return this.internalTrack.backingTrack.getKeyPacket(timestamp, options);
25284
25374
  }
@@ -25290,6 +25380,10 @@ var HlsInputTrackBacking = class {
25290
25380
  await this.hydrate();
25291
25381
  return this.internalTrack.backingTrack.getNextKeyPacket(packet, options);
25292
25382
  }
25383
+ prefetchReferencePlaylist() {
25384
+ void this.internalTrack.demuxer.getReferenceSegmentedInput().getFirstSegment().catch(() => {
25385
+ });
25386
+ }
25293
25387
  };
25294
25388
  var HlsInputVideoTrackBacking = class extends HlsInputTrackBacking {
25295
25389
  constructor(internalTrack) {
@@ -26984,7 +27078,6 @@ var VideoDecoderWrapper = class extends DecoderWrapper {
26984
27078
  this.sampleQueue.length = 0;
26985
27079
  }
26986
27080
  };
26987
- var mergerWorkerUrl = null;
26988
27081
  var ColorAlphaMerger = class {
26989
27082
  constructor() {
26990
27083
  this.workers = [];
@@ -26994,16 +27087,9 @@ var ColorAlphaMerger = class {
26994
27087
  }
26995
27088
  merge(color, alpha) {
26996
27089
  if (this.workers.length === 0) {
26997
- if (!mergerWorkerUrl) {
26998
- const blob = new Blob(
26999
- [`(${colorAlphaMergerWorkerCode.toString()})()`],
27000
- { type: "application/javascript" }
27001
- );
27002
- mergerWorkerUrl = URL.createObjectURL(blob);
27003
- }
27004
27090
  const poolSize = clamp(navigator.hardwareConcurrency, 1, 4);
27005
27091
  for (let i = 0; i < poolSize; i++) {
27006
- const worker2 = new Worker(mergerWorkerUrl);
27092
+ const worker2 = createWorker("color-alpha-merger", colorAlphaMergerWorkerCode);
27007
27093
  worker2.addEventListener("message", (event) => {
27008
27094
  const data = event.data;
27009
27095
  const pending2 = this.pendingRequests.get(data.id);
@@ -30709,7 +30795,6 @@ var detectAvcChunkTimestampShift = () => {
30709
30795
  return chunkTimestamp === 500;
30710
30796
  })();
30711
30797
  };
30712
- var splitterWorkerUrl = null;
30713
30798
  var ColorAlphaSplitter = class {
30714
30799
  constructor() {
30715
30800
  this.worker = null;
@@ -30718,14 +30803,7 @@ var ColorAlphaSplitter = class {
30718
30803
  }
30719
30804
  split(sourceFrame) {
30720
30805
  if (!this.worker) {
30721
- if (!splitterWorkerUrl) {
30722
- const blob = new Blob(
30723
- [`(${colorAlphaSplitterWorkerCode.toString()})()`],
30724
- { type: "application/javascript" }
30725
- );
30726
- splitterWorkerUrl = URL.createObjectURL(blob);
30727
- }
30728
- this.worker = new Worker(splitterWorkerUrl);
30806
+ this.worker = createWorker("color-alpha-splitter", colorAlphaSplitterWorkerCode);
30729
30807
  this.worker.addEventListener("message", (event) => {
30730
30808
  const data = event.data;
30731
30809
  const pending2 = this.pendingRequests.get(data.id);
@@ -32314,12 +32392,7 @@ var mediaStreamTrackProcessorWorkerCode = () => {
32314
32392
  var nextMediaStreamTrackProcessorWorkerId = 0;
32315
32393
  var mediaStreamTrackProcessorWorker = null;
32316
32394
  var initMediaStreamTrackProcessorWorker = () => {
32317
- const blob = new Blob(
32318
- [`(${mediaStreamTrackProcessorWorkerCode.toString()})()`],
32319
- { type: "application/javascript" }
32320
- );
32321
- const url2 = URL.createObjectURL(blob);
32322
- mediaStreamTrackProcessorWorker = new Worker(url2);
32395
+ mediaStreamTrackProcessorWorker = createWorker("media-stream-track-processor", mediaStreamTrackProcessorWorkerCode);
32323
32396
  };
32324
32397
  var mediaStreamTrackProcessorIsSupportedInWorkerCache = null;
32325
32398
  var mediaStreamTrackProcessorIsSupportedInWorker = async () => {
@@ -35383,8 +35456,8 @@ var tfhd = (trackData) => {
35383
35456
  var tfdt = (trackData) => {
35384
35457
  assert(trackData.currentChunk);
35385
35458
  return fullBox("tfdt", 1, 0, [
35386
- u64(intoTimescale(trackData.currentChunk.startTimestamp, trackData.timescale))
35387
35459
  // Base Media Decode Time
35460
+ u64(intoTimescale(trackData.currentChunk.samples[0].decodeTimestamp, trackData.timescale))
35388
35461
  ]);
35389
35462
  };
35390
35463
  var trun = (trackData) => {
@@ -37353,16 +37426,27 @@ var IsobmffMuxer2 = class extends Muxer {
37353
37426
  trackData.timestampProcessingQueue.length = 0;
37354
37427
  return;
37355
37428
  }
37356
- const sortedTimestamps = trackData.timestampProcessingQueue.map((x) => x.timestamp).sort((a, b) => a - b);
37429
+ const queue = trackData.timestampProcessingQueue;
37430
+ const sortedTimestamps = queue.map((x) => x.timestamp).sort((a, b) => a - b);
37431
+ const firstTimestampInTimescale = intoTimescale(sortedTimestamps[0], trackData.timescale);
37357
37432
  if (this.isFragmented) {
37358
37433
  trackData.startTimestampOffset ??= Math.min(sortedTimestamps[0], 0);
37359
37434
  } else {
37360
37435
  trackData.startTimestampOffset ??= sortedTimestamps[0];
37361
37436
  }
37362
- for (let i = 0; i < trackData.timestampProcessingQueue.length; i++) {
37363
- const sample = trackData.timestampProcessingQueue[i];
37364
- sample.decodeTimestamp = sortedTimestamps[i];
37365
- const sampleCompositionTimeOffset = intoTimescale(sample.timestamp - sample.decodeTimestamp, trackData.timescale);
37437
+ let groupStartTimescaleUnits;
37438
+ if (trackData.lastTimescaleUnits === null) {
37439
+ groupStartTimescaleUnits = firstTimestampInTimescale;
37440
+ } else {
37441
+ assert(trackData.lastSample);
37442
+ groupStartTimescaleUnits = Math.round(trackData.lastTimescaleUnits) + trackData.lastSample.timescaleUnitsToNextSample;
37443
+ }
37444
+ let lastDecodeStep = 0;
37445
+ for (let i = 0; i < queue.length; i++) {
37446
+ const sample = queue[i];
37447
+ const decodeTimescaleUnits = groupStartTimescaleUnits + intoTimescale(sortedTimestamps[i], trackData.timescale) - firstTimestampInTimescale;
37448
+ sample.decodeTimestamp = decodeTimescaleUnits / trackData.timescale;
37449
+ const sampleCompositionTimeOffset = intoTimescale(sample.timestamp, trackData.timescale) - decodeTimescaleUnits;
37366
37450
  const durationInTimescale = intoTimescale(sample.duration, trackData.timescale);
37367
37451
  if (trackData.lastTimescaleUnits !== null) {
37368
37452
  assert(trackData.lastSample);
@@ -37371,6 +37455,7 @@ var IsobmffMuxer2 = class extends Muxer {
37371
37455
  assert(delta >= 0);
37372
37456
  trackData.lastTimescaleUnits += delta;
37373
37457
  trackData.lastSample.timescaleUnitsToNextSample = delta;
37458
+ lastDecodeStep = delta;
37374
37459
  if (!this.isFragmented) {
37375
37460
  let lastTableEntry = last(trackData.timeToSampleTable);
37376
37461
  assert(lastTableEntry);
@@ -37426,11 +37511,15 @@ var IsobmffMuxer2 = class extends Muxer {
37426
37511
  trackData.timestampProcessingQueue.length = 0;
37427
37512
  assert(trackData.lastSample);
37428
37513
  assert(trackData.lastTimescaleUnits !== null);
37429
- if (nextSample !== void 0 && trackData.lastSample.timescaleUnitsToNextSample === 0) {
37430
- assert(nextSample.type === "key");
37431
- const timescaleUnits = intoTimescale(nextSample.timestamp, trackData.timescale, false);
37432
- const delta = Math.round(timescaleUnits - trackData.lastTimescaleUnits);
37433
- trackData.lastSample.timescaleUnitsToNextSample = delta;
37514
+ if (nextSample) {
37515
+ const nextTimestampInTimescale = intoTimescale(nextSample.timestamp, trackData.timescale);
37516
+ trackData.lastSample.timescaleUnitsToNextSample = Math.max(
37517
+ nextTimestampInTimescale - Math.round(trackData.lastTimescaleUnits),
37518
+ // With open GOPs, the last sample's decode timestamp may already lie past the next key frame. Then, it
37519
+ // still gets a regular decode step to keep decode timestamps strictly increasing, and the next group
37520
+ // starts later. If we didn't do this, we'd get duplicate DTSs.
37521
+ lastDecodeStep
37522
+ );
37434
37523
  }
37435
37524
  }
37436
37525
  async registerSample(trackData, sample) {