hyperframes 0.8.199 → 0.8.201

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 (192) hide show
  1. package/dist/{add-7LA5CGDM.js → add-33XNCMY4.js} +15 -18
  2. package/dist/{animatedGifPrep-NB2MZTMQ.js → animatedGifPrep-MI7Z4OYQ.js} +9 -12
  3. package/dist/api.js +17 -20
  4. package/dist/{asset-4BIOI6GN.js → asset-RMRQN24O.js} +2 -2
  5. package/dist/{assetCataloger-TX5KL5VV.js → assetCataloger-KWTQNFUU.js} +9 -12
  6. package/dist/{audio-ZGMIIDNU.js → audio-SQDZZS6X.js} +34 -32
  7. package/dist/{auth-OQ5PWEUG.js → auth-PNC6K5ZD.js} +2 -2
  8. package/dist/{autoUpdate-QREPD6I4.js → autoUpdate-MBZFLUF2.js} +2 -2
  9. package/dist/{backgroundChecks-5CJPJX2O.js → backgroundChecks-ZMSPA6TK.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-BW2ZK4MA.js → batchRender-2MMOZRMW.js} +5 -7
  12. package/dist/{beats-I5XARMDB.js → beats-GDLNPR4A.js} +33 -24
  13. package/dist/{benchmark-S2WWY4U7.js → benchmark-AUKB3XDF.js} +12 -14
  14. package/dist/{browser-PAXVQYQZ.js → browser-C3AU5TST.js} +6 -6
  15. package/dist/{bundleWithLocalizedFonts-3ED26VCR.js → bundleWithLocalizedFonts-G3UT65XI.js} +2 -2
  16. package/dist/{capture-23574YLP.js → capture-EKNPCFPF.js} +16 -18
  17. package/dist/{capture-OVITDMKK.js → capture-XGBPNGC5.js} +2 -2
  18. package/dist/{captureCompositionFrame-KAUUHCOL.js → captureCompositionFrame-4HHLPTDH.js} +14 -17
  19. package/dist/{catalog-CM3VXSQE.js → catalog-HLDNEJX3.js} +15 -18
  20. package/dist/{catch-up-HMFREOC2.js → catch-up-LRFV4LJO.js} +6 -6
  21. package/dist/{check-CYJZ6CGT.js → check-XWHWGNYE.js} +40 -43
  22. package/dist/{checkBrowser-GZJ3W2OP.js → checkBrowser-KSOBXPJ3.js} +35 -38
  23. package/dist/{chunk-MMQ52NIZ.js → chunk-2BGOB2QK.js} +500 -17
  24. package/dist/{chunk-D5CZCYYT.js → chunk-2FA53V5S.js} +2 -2
  25. package/dist/{chunk-FV5GKRAO.js → chunk-3J5KO4EJ.js} +8 -10
  26. package/dist/{chunk-UMBCYIFE.js → chunk-47NZWTJL.js} +2 -2
  27. package/dist/{chunk-JFIEV2J4.js → chunk-53E45AKI.js} +60 -34
  28. package/dist/{chunk-BFYDVTD3.js → chunk-6UFEOVR5.js} +2 -2
  29. package/dist/{chunk-M6IMQBK6.js → chunk-6XGO7ZKS.js} +1 -1
  30. package/dist/{chunk-UVQLSMAR.js → chunk-74UH2KGI.js} +30 -6
  31. package/dist/{chunk-TVR744AS.js → chunk-7EJ7OZGC.js} +16 -3
  32. package/dist/{chunk-7QB46WTF.js → chunk-7WEGIXI3.js} +2 -2
  33. package/dist/{chunk-TTWFTEUG.js → chunk-A7YO6YSD.js} +6 -6
  34. package/dist/{chunk-HK45GJMI.js → chunk-AK2MOAJY.js} +192 -65
  35. package/dist/{chunk-TF7LCULS.js → chunk-B67P2WP3.js} +2 -2
  36. package/dist/chunk-B7CYKBXQ.js +36 -0
  37. package/dist/{chunk-DMRDGGNM.js → chunk-CD5ZU6PN.js} +9 -7
  38. package/dist/{chunk-IC6BO4GU.js → chunk-CV32PRH3.js} +65 -21
  39. package/dist/{chunk-UBSAHYWA.js → chunk-DS3XITZ5.js} +2 -2
  40. package/dist/{chunk-ILFDFMYJ.js → chunk-DWULQYOQ.js} +3 -3
  41. package/dist/{chunk-VHBBV5DH.js → chunk-ERUINDRT.js} +62 -25
  42. package/dist/{chunk-FMTJ4I6I.js → chunk-FDWN4XAD.js} +1 -1
  43. package/dist/{chunk-K5O6JTJQ.js → chunk-GC6N2LH5.js} +10 -12
  44. package/dist/{chunk-5CTORVUM.js → chunk-GHROWWUN.js} +32 -1
  45. package/dist/{chunk-T4IJMVCB.js → chunk-GKXH4C2B.js} +1 -1
  46. package/dist/{chunk-QYOUK3UO.js → chunk-GNX3BCQP.js} +2 -2
  47. package/dist/{chunk-IELYOY6S.js → chunk-I4DHHX7E.js} +3 -3
  48. package/dist/{chunk-FZ2VPLXL.js → chunk-IDRUJFT4.js} +2 -2
  49. package/dist/{chunk-KFZPWUPN.js → chunk-IFOZZYHK.js} +7 -7
  50. package/dist/{chunk-3CFTCM7X.js → chunk-IHQBTZHE.js} +3 -3
  51. package/dist/{chunk-OZVRCLEN.js → chunk-IIH24PKY.js} +2 -2
  52. package/dist/{chunk-K65XUUJX.js → chunk-ITJAHKYO.js} +1 -1
  53. package/dist/{chunk-6JR2XUEE.js → chunk-IXXVS2Z4.js} +1 -1
  54. package/dist/{chunk-IMVTN367.js → chunk-JOI7TNCX.js} +2 -2
  55. package/dist/{chunk-KG3BVLA4.js → chunk-JXLHLR26.js} +1 -1
  56. package/dist/{chunk-DY53XJ3P.js → chunk-K2AUGELJ.js} +1 -1
  57. package/dist/{chunk-VWPU6URV.js → chunk-L33EDCSR.js} +5 -5
  58. package/dist/{chunk-BYLC52GJ.js → chunk-LVEXHBSH.js} +1 -1
  59. package/dist/{chunk-XOTUPVIF.js → chunk-MSGWR7WP.js} +9 -1
  60. package/dist/{chunk-DWUOGV3M.js → chunk-ORMTNJBS.js} +3 -3
  61. package/dist/{chunk-Z6Q4ASCD.js → chunk-Q537KXWA.js} +153 -44
  62. package/dist/{chunk-YAMRODVV.js → chunk-Q6SHXSZX.js} +3 -2
  63. package/dist/{chunk-GQVTTWZF.js → chunk-QB4K2EWI.js} +1 -1
  64. package/dist/{chunk-T6AGUTZJ.js → chunk-QSFWGZG6.js} +7 -38
  65. package/dist/{chunk-XP55QWOB.js → chunk-QTWSMJ22.js} +15 -15
  66. package/dist/{chunk-M2GO2AAS.js → chunk-QXBZ6VBL.js} +1 -1
  67. package/dist/{chunk-65HUC64P.js → chunk-QYTGUWNF.js} +1 -1
  68. package/dist/{chunk-CMHVLASW.js → chunk-RVKJDAYE.js} +1 -1
  69. package/dist/{chunk-HRZ6ZBKO.js → chunk-SEAHCCQ4.js} +70 -51
  70. package/dist/{chunk-7SKOZHIY.js → chunk-SGKG7DNX.js} +3 -3
  71. package/dist/{chunk-6RRO4GE3.js → chunk-SIZYTGG4.js} +1 -1
  72. package/dist/{chunk-4QG64APO.js → chunk-SZNCAINN.js} +1 -1
  73. package/dist/{chunk-S5WSJVHP.js → chunk-T33GLS6C.js} +3 -3
  74. package/dist/{chunk-SQQZUUK6.js → chunk-TAXGZAXM.js} +10 -10
  75. package/dist/{chunk-GQACWAOC.js → chunk-TOT3CLUK.js} +1 -1
  76. package/dist/{chunk-2KZSKIYY.js → chunk-TYRDDIIH.js} +1 -1
  77. package/dist/{chunk-HOAXHVRR.js → chunk-U2EK5MFR.js} +10 -10
  78. package/dist/{chunk-QXPZGDTI.js → chunk-UIIGEPYY.js} +3 -3
  79. package/dist/{chunk-W2LGJSEN.js → chunk-UIOZIIB7.js} +33 -3
  80. package/dist/{chunk-L6FG62QM.js → chunk-UKB62QOT.js} +446 -151
  81. package/dist/{chunk-JN63IPHT.js → chunk-UOSTDTBF.js} +1 -1
  82. package/dist/{chunk-LPDNR3R4.js → chunk-VCVUEK65.js} +3 -3
  83. package/dist/{chunk-PO5PAROC.js → chunk-VF2VMKNI.js} +3 -3
  84. package/dist/{chunk-XVZZQVT4.js → chunk-VKTUZP7U.js} +1 -1
  85. package/dist/{chunk-NY2OH5XD.js → chunk-WO3XZ6HC.js} +1 -1
  86. package/dist/{chunk-7YZME6DE.js → chunk-X72DJZCM.js} +1 -1
  87. package/dist/{chunk-PGDWNIOK.js → chunk-XDMZY3H7.js} +57 -5
  88. package/dist/{chunk-QH4425AL.js → chunk-XG365L6T.js} +1 -1
  89. package/dist/{chunk-NUZMP7SV.js → chunk-XHVQIOOF.js} +19 -19
  90. package/dist/{chunk-FHDKRWQN.js → chunk-XONIZ5CH.js} +13 -13
  91. package/dist/{chunk-RYCANWOM.js → chunk-YBJECXQJ.js} +5 -5
  92. package/dist/{chunk-AHZLNYZY.js → chunk-YTBE4JCX.js} +1 -1
  93. package/dist/{chunk-VLVQQJOX.js → chunk-ZDVJXWEG.js} +22 -3
  94. package/dist/chunk-ZKHXN2BV.js +3983 -0
  95. package/dist/{clean-QX6LKOWJ.js → clean-EUKURSX2.js} +22 -25
  96. package/dist/cli.js +54 -54
  97. package/dist/{cloud-ASA7Y3HA.js → cloud-LJDRNQ2N.js} +4 -4
  98. package/dist/{cloudrun-LK4GJWUZ.js → cloudrun-AXVFD6KV.js} +7 -9
  99. package/dist/{compare-426Z2ND6.js → compare-T3LMATAF.js} +32 -35
  100. package/dist/{compiler-WER7FC5O.js → compiler-KH6DMHIJ.js} +6 -10
  101. package/dist/{component-HTDWZMEG.js → component-2FOHCMP2.js} +3 -3
  102. package/dist/{compositions-EKRLQ5TU.js → compositions-REQ6ARAO.js} +14 -17
  103. package/dist/{delete-KHXM6R7A.js → delete-KEPP2QAZ.js} +2 -2
  104. package/dist/{deploy-WJ5JQJBD.js → deploy-N756FEME.js} +1 -1
  105. package/dist/{deterministicFonts-RMA7GDJC.js → deterministicFonts-4FULD3AS.js} +2 -2
  106. package/dist/{dist-EYJATCTF.js → dist-5ULOGA6A.js} +30 -16
  107. package/dist/{dist-ONHJ6ZDA.js → dist-TFHABY7N.js} +2 -4
  108. package/dist/{doctor-NB3G2GDG.js → doctor-2SJPC4WZ.js} +15 -18
  109. package/dist/{dotEnv-64S3VKGH.js → dotEnv-RPHCAUBZ.js} +1 -1
  110. package/dist/{events-LH6W5ZCV.js → events-24ZE2PKB.js} +5 -5
  111. package/dist/{events-6EL5NIJV.js → events-U53QH4XZ.js} +4 -4
  112. package/dist/{feedback-2GNY725M.js → feedback-QFMLDLUN.js} +11 -13
  113. package/dist/{ffmpeg-XX3O53B3.js → ffmpeg-7XNWNO7M.js} +9 -12
  114. package/dist/{figma-X7KKOOXB.js → figma-B4JO44CV.js} +3 -3
  115. package/dist/fontLocalizeCli.js +12 -15
  116. package/dist/{get-M57U7QCX.js → get-7CFVCINR.js} +2 -2
  117. package/dist/{gpuPolicy-GIBBYBI5.js → gpuPolicy-MU7CFSAF.js} +9 -12
  118. package/dist/{grade-compare-XNY37UYQ.js → grade-compare-Q23U2HGS.js} +33 -36
  119. package/dist/{help-ZXSPZBUG.js → help-M67MEDV3.js} +1 -1
  120. package/dist/{history-G5B4IPBH.js → history-I2PZXOFL.js} +9 -9
  121. package/dist/hyperframe.manifest.json +1 -1
  122. package/dist/hyperframe.runtime.iife.js +66 -62
  123. package/dist/hyperframes-player.global.js +3 -3
  124. package/dist/{info-ZWZDG54W.js → info-Z2MX54IE.js} +11 -13
  125. package/dist/{init-F4XMU6SV.js → init-SWH5KZO2.js} +30 -33
  126. package/dist/{inspect-6VXFMQRR.js → inspect-WBBDB3YS.js} +33 -36
  127. package/dist/{installer-4M3Y5T5F.js → installer-DQIHGUBJ.js} +6 -9
  128. package/dist/{keyframes-3U466AWX.js → keyframes-PSNEUS6P.js} +8 -8
  129. package/dist/{lambda-OPSTAEF6.js → lambda-KSZFMQ3L.js} +9 -11
  130. package/dist/{layout-B3MXD3F3.js → layout-AAOI7W2M.js} +33 -36
  131. package/dist/{lint-TVOEGW63.js → lint-GGNVITIK.js} +10 -12
  132. package/dist/{lintProject-FKPKSU6M.js → lintProject-Q36Y3AHA.js} +2 -4
  133. package/dist/{list-M5GQSFVT.js → list-OFPDL2AM.js} +2 -2
  134. package/dist/{login-HBHGZIDN.js → login-MZAHGGP4.js} +4 -4
  135. package/dist/{manager-COSJVRAE.js → manager-F34TSFV6.js} +3 -3
  136. package/dist/{manager-VLIJARMF.js → manager-ZOFTZTRY.js} +10 -13
  137. package/dist/{media-treatment-RQZ437VS.js → media-treatment-PF67GSUD.js} +67 -43
  138. package/dist/{models-2CCKVBTR.js → models-WR7CL54R.js} +13 -16
  139. package/dist/{motionShot-3IFRSICA.js → motionShot-ISLDWLIU.js} +18 -21
  140. package/dist/{normalize-audio-23H2MBDP.js → normalize-audio-D7AH5GFZ.js} +45 -27
  141. package/dist/{open-J33KT3G7.js → open-HPVBB2CX.js} +15 -18
  142. package/dist/{parakeetRunner-QTXNEMVY.js → parakeetRunner-P6PE4WXG.js} +14 -17
  143. package/dist/{pipeline-2ECWWEBD.js → pipeline-XKBZG2CM.js} +10 -13
  144. package/dist/{play-G5777L7A.js → play-QXHO47ZH.js} +24 -27
  145. package/dist/{preflight-NVFB4HXQ.js → preflight-KZCU66ES.js} +12 -15
  146. package/dist/{present-4EI2BE4Z.js → present-ERGC5PR4.js} +20 -23
  147. package/dist/{preview-HYCIDZ52.js → preview-AGTOQIE7.js} +21 -24
  148. package/dist/{producer-6JAATJVD.js → producer-4ONVM5A2.js} +1 -1
  149. package/dist/{projectConfig-XPGN76VV.js → projectConfig-7T4VY6RJ.js} +8 -11
  150. package/dist/{publication-YRZ7EBUV.js → publication-J5TS5VR3.js} +4 -6
  151. package/dist/{publish-UIDHN7KD.js → publish-BSOVXRF4.js} +11 -14
  152. package/dist/{remove-background-LPQP4WBN.js → remove-background-645NVCGL.js} +11 -14
  153. package/dist/{render-LFJQNVCK.js → render-55TYPJ5U.js} +7 -9
  154. package/dist/{render-NZSNQFYW.js → render-IAVH33YG.js} +38 -34
  155. package/dist/{render-DT3OCUCV.js → render-R3L44QAP.js} +36 -38
  156. package/dist/{render-batch-QI2A45WH.js → render-batch-JWWLQ7ZC.js} +7 -9
  157. package/dist/renderSetupWorker.js +5 -7
  158. package/dist/{resolver-4YDXG4PP.js → resolver-DBAFWC4F.js} +6 -8
  159. package/dist/{sherpa-XLKWFYFO.js → sherpa-UPWG6TKY.js} +13 -16
  160. package/dist/skills/hyperframes/references/runtimes.md +26 -0
  161. package/dist/skills/media-use/references/mixing.md +1 -1
  162. package/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +38 -26
  163. package/dist/{skills-OVVLZHF5.js → skills-ILH52UL4.js} +7 -7
  164. package/dist/{skillsUpdateCheck-Y2UQA7I5.js → skillsUpdateCheck-ZHFDGMEL.js} +3 -3
  165. package/dist/{snapshot-7NVB5WSO.js → snapshot-WMVHIQVQ.js} +94 -61
  166. package/dist/{src-ACAFJXAJ.js → src-46QTOHZE.js} +11 -14
  167. package/dist/{src-QQPHMIJ7.js → src-HPLELQRK.js} +12 -11
  168. package/dist/{staticProjectServer-JUN6BRTW.js → staticProjectServer-FHP2YQFV.js} +19 -22
  169. package/dist/{status-H5WLKQDS.js → status-LR7VXITS.js} +2 -2
  170. package/dist/studio/assets/{hyperframes-player-BDtBfwof.js → hyperframes-player-BNeO6YSP.js} +1 -1
  171. package/dist/studio/assets/{index-BFfBBQMu.js → index-CZWE0FI8.js} +162 -162
  172. package/dist/studio/assets/{index--W_0fuR8.js → index-DiNYtcMK.js} +1 -1
  173. package/dist/studio/index.html +1 -1
  174. package/dist/{studio-api-D76Q4Q2N.js → studio-api-5YHQ4Y2D.js} +12 -15
  175. package/dist/{studioServer-HG3RFAOY.js → studioServer-P6IC76SV.js} +54 -57
  176. package/dist/{system-7F3UEHQT.js → system-YD4AW5ZX.js} +4 -3
  177. package/dist/{telemetry-Q2EHWVO4.js → telemetry-WZ7OGFWQ.js} +5 -5
  178. package/dist/{timeline-WDQCCETQ.js → timeline-U6S7BGMI.js} +24 -26
  179. package/dist/{tokens-2GJWP2HY.js → tokens-FPUYNZSV.js} +2 -2
  180. package/dist/{transcribe-Z63Y53GQ.js → transcribe-DJX4E2PE.js} +19 -22
  181. package/dist/{transcribe-SRLAY6RG.js → transcribe-DZHTKXI5.js} +12 -15
  182. package/dist/{updateCheck-MJ6NDE3T.js → updateCheck-2LHWRDE7.js} +2 -2
  183. package/dist/{upgrade-D5XEX3XE.js → upgrade-WAQHCAUS.js} +2 -2
  184. package/dist/{urlDownloader-R7BZ47TY.js → urlDownloader-HZQPXQET.js} +8 -11
  185. package/dist/{validate-F5BIDZLN.js → validate-D6XJ7OSS.js} +27 -30
  186. package/dist/{video-QUG5OG5Q.js → video-A4CQ4WDL.js} +9 -12
  187. package/dist/warmCheck.js +40 -43
  188. package/package.json +1 -1
  189. package/dist/chunk-2ONVJ7NT.js +0 -3901
  190. package/dist/chunk-BSQ7XANM.js +0 -210
  191. package/dist/chunk-PKZ7RK5N.js +0 -281
  192. package/dist/chunk-X7HBSTCZ.js +0 -53
@@ -8,7 +8,7 @@ import {
8
8
  EncoderInterruptedError,
9
9
  encoderFailureError,
10
10
  prepareAnimatedGifInputs
11
- } from "./chunk-7SKOZHIY.js";
11
+ } from "./chunk-SGKG7DNX.js";
12
12
  import {
13
13
  GENERIC_FAMILIES,
14
14
  collectFontFamilyCustomProperties,
@@ -16,7 +16,7 @@ import {
16
16
  iterateFontFamilyDeclarations,
17
17
  normalizeSystemFontPrimaryFamilies,
18
18
  resolveFontFamilyDeclarationFamilies
19
- } from "./chunk-FMTJ4I6I.js";
19
+ } from "./chunk-FDWN4XAD.js";
20
20
  import {
21
21
  parseEncoderOptions
22
22
  } from "./chunk-KLIKCX6Q.js";
@@ -114,6 +114,7 @@ import {
114
114
  isHttpUrl,
115
115
  isMemoryExhaustionError,
116
116
  isNotMediaPayload,
117
+ isSelfOrAncestorHidden,
117
118
  isTransientBrowserError,
118
119
  isVideoFrameFormat,
119
120
  isVideoHiddenBeforeStreamStart,
@@ -161,7 +162,7 @@ import {
161
162
  verifyDiskDrawElementSamples,
162
163
  videoAudioId,
163
164
  writeCapturedFrame
164
- } from "./chunk-L6FG62QM.js";
165
+ } from "./chunk-UKB62QOT.js";
165
166
  import {
166
167
  DISTRIBUTED_FPS,
167
168
  HF_VFX_ATTR,
@@ -177,7 +178,7 @@ import {
177
178
  parseVfxChain,
178
179
  resolveAuthoredTimingWindow,
179
180
  toFps
180
- } from "./chunk-UVQLSMAR.js";
181
+ } from "./chunk-74UH2KGI.js";
181
182
  import {
182
183
  assignBundledRuntimeCompositionIds,
183
184
  buildVariablesByCompScript,
@@ -189,10 +190,11 @@ import {
189
190
  inlineSubCompositions,
190
191
  parsesAsScript,
191
192
  prepareFlattenedInnerRoot
192
- } from "./chunk-HRZ6ZBKO.js";
193
+ } from "./chunk-SEAHCCQ4.js";
193
194
  import {
194
195
  COMPOSITION_SOURCE_URL,
195
196
  HF_COLOR_GRADING_ATTR,
197
+ MAX_AUDIO_GAIN,
196
198
  MEDIA_RENDER_ID_ATTR,
197
199
  assignMediaRenderIds,
198
200
  clampDurations,
@@ -220,10 +222,7 @@ import {
220
222
  sourceTimeAt,
221
223
  styleElementsFor,
222
224
  timeAtSourceTime
223
- } from "./chunk-2ONVJ7NT.js";
224
- import {
225
- MAX_AUDIO_GAIN
226
- } from "./chunk-X7HBSTCZ.js";
225
+ } from "./chunk-ZKHXN2BV.js";
227
226
  import {
228
227
  CANVAS_DIMENSIONS,
229
228
  HTML_BODY_CSS_HEIGHT_FIRST_RE,
@@ -234,7 +233,7 @@ import {
234
233
  isAspectAgnosticResolutionAlias,
235
234
  normalizeResolutionFlag,
236
235
  suggestMatchingPreset
237
- } from "./chunk-XOTUPVIF.js";
236
+ } from "./chunk-MSGWR7WP.js";
238
237
  import {
239
238
  TRANSITIONS,
240
239
  convertTransfer,
@@ -250,31 +249,29 @@ import {
250
249
  import {
251
250
  lintHyperframeHtml,
252
251
  resolveReferencedStart
253
- } from "./chunk-IC6BO4GU.js";
252
+ } from "./chunk-CV32PRH3.js";
254
253
  import {
255
254
  isUnresolvedAssetPlaceholder,
256
255
  readProjectFile,
257
256
  resolveProjectRelativeSrc
258
257
  } from "./chunk-6BNTGNGD.js";
259
258
  import {
259
+ CSS_URL_RE,
260
260
  MEDIA_START_BASIS_ATTR,
261
261
  checkSubCompositionUsability,
262
262
  compositionOriginSeconds,
263
263
  cutToHostSlots,
264
- hostInPointSeconds,
265
- readMediaStartBasis,
266
- resolveAbsoluteMediaStartSeconds
267
- } from "./chunk-MMQ52NIZ.js";
268
- import {
269
- CSS_URL_RE,
270
264
  decodedUrlPath,
265
+ hostInPointSeconds,
271
266
  isNonRelativeUrl,
267
+ readMediaStartBasis,
272
268
  readPlaybackRate,
269
+ resolveAbsoluteMediaStartSeconds,
273
270
  rewriteAssetPath,
274
271
  rewriteAssetPaths,
275
272
  rewriteCssAssetUrls,
276
273
  rewriteInlineStyleAssetUrls
277
- } from "./chunk-BSQ7XANM.js";
274
+ } from "./chunk-2BGOB2QK.js";
278
275
  import {
279
276
  parseHTML
280
277
  } from "./chunk-SDYDNHEE.js";
@@ -282,7 +279,7 @@ import {
282
279
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
283
280
  getCgroupMemoryLimitMb,
284
281
  getSystemTotalMb
285
- } from "./chunk-W2LGJSEN.js";
282
+ } from "./chunk-UIOZIIB7.js";
286
283
 
287
284
  // ../producer/src/services/renderOrchestrator.ts
288
285
  import {
@@ -2282,6 +2279,7 @@ function aggregateDrawElement(perfs, de) {
2282
2279
  blankDeterministicAccepts: drain?.blankDeterministicAccepts ?? 0,
2283
2280
  blankRecaptures: drain?.blankRecaptures ?? 0,
2284
2281
  boundaryFrames: perfs.reduce((sum2, p) => sum2 + (p.deBoundaryFrames ?? 0), 0),
2282
+ riskFrames: perfs.reduce((sum2, p) => sum2 + (p.deRiskFrames ?? 0), 0),
2285
2283
  ncprFallbacks: perfs.reduce((sum2, p) => sum2 + (p.deNcprFallbacks ?? 0), 0),
2286
2284
  frameTimeouts: perfs.reduce((sum2, p) => sum2 + (p.deFrameTimeouts ?? 0), 0)
2287
2285
  };
@@ -3862,11 +3860,21 @@ function createDrainFrameGuard(args) {
3862
3860
  return buf;
3863
3861
  };
3864
3862
  }
3865
- async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEncoder, reorderBuffer, assertNotAborted, onProgress, log, stats, abortSignal) {
3863
+ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEncoder, reorderBuffer, assertNotAborted, onProgress, log, stats, abortSignal, risk) {
3866
3864
  let prev = null;
3867
3865
  const frameTime = (i) => i * job.config.fps.den / job.config.fps.num;
3868
3866
  const guard = createDrainFrameGuard({ log, stats, frameTime });
3869
- const guardFrame = (idx, buf) => guard(session, idx, buf);
3867
+ const guardFrame = (item, buf) => item.trusted ? Promise.resolve(buf) : guard(session, item.idx, buf);
3868
+ const captureRisk = async (idx) => {
3869
+ await risk.open();
3870
+ lastProgressAt = Date.now();
3871
+ return raceAgainstStall(
3872
+ risk.capture(idx, frameTime(idx)),
3873
+ stallTimeoutMs - (Date.now() - lastProgressAt),
3874
+ { session, frameIndex: idx, totalFrames, stallTimeoutMs },
3875
+ abortSignal
3876
+ );
3877
+ };
3870
3878
  const stallTimeoutMs = resolveCaptureStallTimeoutMs();
3871
3879
  let lastProgressAt = Date.now();
3872
3880
  const captureWithStallGuard = (idx, promise) => raceAgainstStall(
@@ -3878,7 +3886,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3878
3886
  const drainPrev = async () => {
3879
3887
  if (!prev) return;
3880
3888
  assertNotAborted();
3881
- const buf = await guardFrame(prev.idx, await prev.encodeResult);
3889
+ const buf = await guardFrame(prev, await prev.encodeResult);
3882
3890
  await reorderBuffer.waitForFrame(prev.idx);
3883
3891
  ensureFrameWritten(await currentEncoder.writeFrame(buf), prev.idx, currentEncoder);
3884
3892
  reorderBuffer.advanceTo(prev.idx + 1);
@@ -3898,7 +3906,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3898
3906
  const drainBatch = async (batch) => {
3899
3907
  for (const item of batch) {
3900
3908
  assertNotAborted();
3901
- const buf = await guardFrame(item.idx, await item.encodeResult);
3909
+ const buf = await guardFrame(item, await item.encodeResult);
3902
3910
  await reorderBuffer.waitForFrame(item.idx);
3903
3911
  ensureFrameWritten(await currentEncoder.writeFrame(buf), item.idx, currentEncoder);
3904
3912
  reorderBuffer.advanceTo(item.idx + 1);
@@ -3916,7 +3924,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3916
3924
  };
3917
3925
  if (batchN > 1 && !session.onBeforeCapture) {
3918
3926
  const boundarySS = process.env.HF_FAST_CAPTURE_BOUNDARY_SS === "true";
3919
- const batchable = (f) => !session.staticFrames?.has(f) && !(boundarySS && session.clipBoundaryFrames?.has(f));
3927
+ const batchable = (f) => !session.staticFrames?.has(f) && !(boundarySS && session.clipBoundaryFrames?.has(f)) && !risk?.frames.has(f);
3920
3928
  let prevBatch = [];
3921
3929
  let i = 0;
3922
3930
  while (i < totalFrames) {
@@ -3933,6 +3941,11 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3933
3941
  );
3934
3942
  await drainBatch(prevBatch);
3935
3943
  prevBatch = results.map((r) => ({ idx: r.frameIndex, encodeResult: r.encodeResult }));
3944
+ } else if (risk?.frames.has(i)) {
3945
+ const buffer = await captureRisk(i);
3946
+ await drainBatch(prevBatch);
3947
+ prevBatch = [{ idx: i, encodeResult: Promise.resolve(buffer), trusted: true }];
3948
+ i++;
3936
3949
  } else {
3937
3950
  const { encodeResult } = await captureWithStallGuard(
3938
3951
  i,
@@ -3948,6 +3961,12 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3948
3961
  }
3949
3962
  for (let i = 0; i < totalFrames; i++) {
3950
3963
  assertNotAborted();
3964
+ if (risk?.frames.has(i)) {
3965
+ const buffer = await captureRisk(i);
3966
+ await drainPrev();
3967
+ prev = { idx: i, encodeResult: Promise.resolve(buffer), trusted: true };
3968
+ continue;
3969
+ }
3951
3970
  const time = frameTime(i);
3952
3971
  const { encodeResult } = await captureWithStallGuard(
3953
3972
  i,
@@ -4194,6 +4213,24 @@ async function runCaptureStreamingStage(input) {
4194
4213
  prepareCaptureSessionForReuse(session, framesDir, videoInjector);
4195
4214
  probeSession = null;
4196
4215
  }
4216
+ let riskSession = null;
4217
+ const openRiskSession = async () => {
4218
+ const opened = await createCaptureSession(
4219
+ fileServer.url,
4220
+ framesDir,
4221
+ buildCaptureOptions(),
4222
+ createRenderVideoFrameInjector(),
4223
+ {
4224
+ ...captureCfg,
4225
+ useDrawElement: false,
4226
+ staticFrameDedup: false,
4227
+ enableBrowserPool: false
4228
+ }
4229
+ );
4230
+ riskSession = opened;
4231
+ await initializeSession(opened);
4232
+ return opened;
4233
+ };
4197
4234
  try {
4198
4235
  if (!session.isInitialized) {
4199
4236
  await initializeSession(session);
@@ -4208,6 +4245,7 @@ async function runCaptureStreamingStage(input) {
4208
4245
  blankDeterministicAccepts: 0,
4209
4246
  blankRecaptures: 0
4210
4247
  };
4248
+ const riskFrames = session.deRiskFrames;
4211
4249
  await runWorkerEncodePipelineLoop(
4212
4250
  session,
4213
4251
  totalFrames,
@@ -4218,7 +4256,16 @@ async function runCaptureStreamingStage(input) {
4218
4256
  onProgress,
4219
4257
  log,
4220
4258
  deDrainStats,
4221
- abortSignal
4259
+ abortSignal,
4260
+ riskFrames && riskFrames.size > 0 ? {
4261
+ frames: riskFrames,
4262
+ // Opened on the first risk frame, in a browser of its own: pages sharing a
4263
+ // browser share a compositor, which starves the drawElement page's paint events.
4264
+ open: async () => {
4265
+ riskSession ??= await openRiskSession();
4266
+ },
4267
+ capture: async (frameIndex, time) => (await captureFrameToBuffer(riskSession, frameIndex, time)).buffer
4268
+ } : void 0
4222
4269
  );
4223
4270
  } else {
4224
4271
  const stallTimeoutMs = resolveCaptureStallTimeoutMs();
@@ -4256,6 +4303,7 @@ async function runCaptureStreamingStage(input) {
4256
4303
  } finally {
4257
4304
  lastBrowserConsole = session.browserConsoleBuffer;
4258
4305
  await closeCaptureSession(session);
4306
+ if (riskSession) await closeCaptureSession(riskSession);
4259
4307
  }
4260
4308
  }
4261
4309
  const encodeFrom = job.progress;
@@ -4415,7 +4463,7 @@ function openSegmentedSessionReuse(input, session) {
4415
4463
  async function openSegmentedSession(input) {
4416
4464
  const captureCfg = input.cfg.forceScreenshot === input.plan.forceScreenshot ? input.cfg : { ...input.cfg, forceScreenshot: input.plan.forceScreenshot };
4417
4465
  const videoInjector = input.createRenderVideoFrameInjector();
4418
- const captureOptions = input.buildCaptureOptions();
4466
+ const captureOptions = { ...input.buildCaptureOptions(), deFrameFallback: false };
4419
4467
  const ownBrowser = shouldDisableBrowserPoolForParallelWorker({
4420
4468
  parallel: (input.workerCount ?? 1) > 1
4421
4469
  });
@@ -5616,6 +5664,15 @@ function collectHostWindows(html) {
5616
5664
  }
5617
5665
  return windows;
5618
5666
  }
5667
+ function collectHiddenVideoIds(html) {
5668
+ const { document: document2 } = parseHTML(html);
5669
+ const hidden = /* @__PURE__ */ new Set();
5670
+ for (const element of document2.querySelectorAll("video")) {
5671
+ const id = element.getAttribute(MEDIA_RENDER_ID_ATTR) || element.getAttribute("id");
5672
+ if (id && isSelfOrAncestorHidden(element)) hidden.add(id);
5673
+ }
5674
+ return hidden;
5675
+ }
5619
5676
  function toAbsoluteWindow(start, end, window2) {
5620
5677
  const absoluteStart = resolveAbsoluteMediaStartSeconds({
5621
5678
  authoredStart: start,
@@ -5649,8 +5706,13 @@ function collectRenderMedia(html) {
5649
5706
  const windows = collectHostWindows(html);
5650
5707
  const windowFor = (id) => windows.get(id) ?? ROOT_WINDOW;
5651
5708
  const droppedMediaIds = /* @__PURE__ */ new Set();
5709
+ const hiddenIds = collectHiddenVideoIds(html);
5652
5710
  const videos = [];
5653
5711
  for (const video of parseVideoElements(html)) {
5712
+ if (hiddenIds.has(video.id)) {
5713
+ droppedMediaIds.add(video.id);
5714
+ continue;
5715
+ }
5654
5716
  const absolute = toAbsoluteWindow(video.start, video.end, windowFor(video.id));
5655
5717
  if (!absolute) {
5656
5718
  droppedMediaIds.add(video.id);
@@ -5684,7 +5746,7 @@ function placeAudio(audio, window2) {
5684
5746
  }
5685
5747
 
5686
5748
  // ../core/dist/generated/position-edits-render-inline.js
5687
- var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function k(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",_=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,C=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},V=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},j=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function B(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=_(e.getAttribute("data-x"))-_(e.getAttribute(w)),s=_(e.getAttribute("data-y"))-_(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,j(e)),o===void 0&&V(e);let a=e.getAttribute(m)??"",i=C(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!k(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!k(i)||(B(i,t),s+=1)}return s}var L="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,M=new WeakMap;function H(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[L]),s=n=>{D.add(n);try{Object.defineProperty(n,L,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=M.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),M.set(t,u)}let p=t[n];return p?i(p,l):!1},h=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(h())return;let v=120,A=t.setInterval(()=>{if(h()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),H(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
5749
+ var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function x(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=x(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var T=null;function R(e,t){if(T)try{T({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var M="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===M||e.namespaceURI==="http://www.w3.org/2000/svg")}var y="data-hf-edit-base-x",w="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},C=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},$=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>$.test(e)&&$.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,O=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=C(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},V=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function B(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(y)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(w));e.hasAttribute(m)||e.setAttribute(m,V(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=O(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function h(e,t){let o=e.querySelectorAll(`[${m}]:not([${y}]):not([${w}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${y}], [${w}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var L="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,F=new WeakMap,H=new WeakMap;function W(e){let t=e,o=()=>{try{h(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[L]),s=n=>{D.add(n);try{Object.defineProperty(n,L,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=F.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),F.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},S=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(S())return;let v=120,A=t.setInterval(()=>{if(S()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${y}], [${w}]`)&&(h(document),W(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
5688
5750
  function getPositionEditsRenderScript() {
5689
5751
  return POSITION_EDITS_RENDER_IIFE;
5690
5752
  }
@@ -5997,10 +6059,6 @@ var THREE_D_CONTEXT_PATTERN = /transform-style\s*:\s*preserve-3d|backface-visibi
5997
6059
  function detectThreeDTransformUsage(html) {
5998
6060
  return THREE_D_CONTEXT_PATTERN.test(html);
5999
6061
  }
6000
- var MIX_BLEND_MODE_PATTERN = /mix-blend-mode\s*:/i;
6001
- function detectMixBlendModeUsage(html) {
6002
- return MIX_BLEND_MODE_PATTERN.test(html);
6003
- }
6004
6062
  var BACKGROUND_IMAGE_DECL_PATTERN = /(?:^|;|\{)\s*background(?:-image)?\s*:[^;}]*(?:\bgradient\s*\(|url\s*\()/i;
6005
6063
  function detectAncestorBackgroundImage(html) {
6006
6064
  const { document: document2 } = parseHTML(html);
@@ -6153,8 +6211,9 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
6153
6211
  const markedStaticHtml = markInferredVariableMediaDurations(staticCompiled, mediaUnresolved);
6154
6212
  let compiledHtml = resolutions.length > 0 ? injectDurations(markedStaticHtml, resolutions) : markedStaticHtml;
6155
6213
  const preResolved = extractResolvedMedia(compiledHtml);
6214
+ const hiddenVideoIds = collectHiddenVideoIds(compiledHtml);
6156
6215
  const clampResults = await Promise.all(
6157
- preResolved.filter((el) => !!el.src && !el.loop).map(async (el) => {
6216
+ preResolved.filter((el) => !!el.src && !el.loop && !hiddenVideoIds.has(el.id)).map(async (el) => {
6158
6217
  const { duration: maxDuration } = await resolveMediaDuration(
6159
6218
  el.src,
6160
6219
  el.mediaStart,
@@ -6872,7 +6931,7 @@ async function readLocalFont(absPath) {
6872
6931
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
6873
6932
  }
6874
6933
  async function embedLocalFontFaces(html, projectDir) {
6875
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-RMA7GDJC.js");
6934
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-4FULD3AS.js");
6876
6935
  const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
6877
6936
  const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
6878
6937
  let result = html;
@@ -7013,7 +7072,6 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
7013
7072
  const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
7014
7073
  const hasShaderTransitions = detectShaderTransitionUsage(sanitizedHtml);
7015
7074
  const usesThreeDTransforms = detectThreeDTransformUsage(sanitizedHtml);
7016
- const usesMixBlendMode = detectMixBlendModeUsage(sanitizedHtml);
7017
7075
  const hasAncestorBackgroundImage = detectAncestorBackgroundImage(sanitizedHtml);
7018
7076
  const normalizedFontHtml = normalizeSystemFontPrimaryFamilies(
7019
7077
  injectTextRenderingRule(
@@ -7127,7 +7185,6 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
7127
7185
  renderModeHints,
7128
7186
  hasShaderTransitions,
7129
7187
  usesThreeDTransforms,
7130
- usesMixBlendMode,
7131
7188
  hasAncestorBackgroundImage
7132
7189
  };
7133
7190
  }
@@ -7534,13 +7591,6 @@ async function runCompileStage(input) {
7534
7591
  "[Render] Fast capture: composition uses a CSS 3D rendering context (perspective / preserve-3d / backface-visibility), so disabling drawElementImage for this render. Capture uses the platform's baseline route."
7535
7592
  );
7536
7593
  }
7537
- if (cfg.useDrawElement && process.env.HF_FAST_CAPTURE_BLEND !== "true" && compiled.usesMixBlendMode) {
7538
- cfg.useDrawElement = false;
7539
- deCompileGate = "mix_blend_mode";
7540
- log.info(
7541
- "[Render] Fast capture: composition uses mix-blend-mode, so disabling drawElementImage for this render. Capture uses the platform's baseline route."
7542
- );
7543
- }
7544
7594
  if (cfg.useDrawElement && process.env.HF_FAST_CAPTURE_ANCESTOR_BG !== "true" && compiled.hasAncestorBackgroundImage) {
7545
7595
  cfg.useDrawElement = false;
7546
7596
  deCompileGate = "ancestor_background_image";
@@ -7812,6 +7862,7 @@ async function runProbeStage(input) {
7812
7862
  height,
7813
7863
  fps: job.config.fps,
7814
7864
  format: captureFormat,
7865
+ transparent: needsAlpha,
7815
7866
  quality: captureFormat === "png" ? void 0 : resolveCaptureJpegQuality(job.config.quality),
7816
7867
  variables: job.config.variables,
7817
7868
  deviceScaleFactor,
@@ -8900,10 +8951,11 @@ async function constrainAacTruePeak(input) {
8900
8951
  const timeoutMs = input.timeoutMs ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
8901
8952
  return enforceAacTruePeak({
8902
8953
  audioPath: input.audioPath,
8954
+ sourcePath: input.sourcePath,
8903
8955
  targetDurationSeconds: input.targetDurationSeconds,
8904
8956
  signal: input.signal,
8905
- probeTruePeak: (audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal }),
8906
- encode: defaultAacEncoder(timeoutMs, input.signal, input.sourcePath)
8957
+ probeTruePeak: input.probeTruePeakDbfs ?? ((audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal })),
8958
+ encode: input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath)
8907
8959
  });
8908
8960
  }
8909
8961
  async function enforceAacTruePeak(input) {
@@ -8913,6 +8965,7 @@ async function enforceAacTruePeak(input) {
8913
8965
  const correctedPath = join17(scratchDir, "audio.m4a");
8914
8966
  const measurements = [];
8915
8967
  let attenuationDb = 0;
8968
+ let sourcePeakDbfs;
8916
8969
  let measuredPath = input.audioPath;
8917
8970
  for (let pass = 0; pass <= MAX_TRUE_PEAK_CORRECTION_PASSES; pass += 1) {
8918
8971
  const truePeakDbfs = await input.probeTruePeak(measuredPath, input.signal);
@@ -8929,7 +8982,11 @@ async function enforceAacTruePeak(input) {
8929
8982
  }
8930
8983
  if (pass === MAX_TRUE_PEAK_CORRECTION_PASSES) break;
8931
8984
  const headroomDb = AAC_TRUE_PEAK_CORRECTION_HEADROOM_DB * 2 ** pass;
8932
- attenuationDb += AAC_DELIVERY_TRUE_PEAK_DBFS - headroomDb - truePeakDbfs;
8985
+ if (input.sourcePath && sourcePeakDbfs === void 0) {
8986
+ sourcePeakDbfs = await input.probeTruePeak(input.sourcePath, input.signal);
8987
+ }
8988
+ const referenceDbfs = Math.max(truePeakDbfs, (sourcePeakDbfs ?? -Infinity) + attenuationDb);
8989
+ attenuationDb += AAC_DELIVERY_TRUE_PEAK_DBFS - headroomDb - referenceDbfs;
8933
8990
  const result = await input.encode(
8934
8991
  input.audioPath,
8935
8992
  correctedPath,
@@ -9351,7 +9408,7 @@ async function runCaptureStage(input) {
9351
9408
  );
9352
9409
  }
9353
9410
  }
9354
- const captureOptions = buildCaptureOptions();
9411
+ const captureOptions = { ...buildCaptureOptions(), deFrameFallback: false };
9355
9412
  const remedy = diskCaptureRemedy(cfg, job.config.format ?? "mp4", job.duration ?? 0, workerCount);
9356
9413
  const checkDiskProjection = createDiskCaptureProjection({
9357
9414
  framesDir,
@@ -9372,6 +9429,7 @@ async function runCaptureStage(input) {
9372
9429
  createBeforeCaptureHook: createRenderVideoFrameInjector,
9373
9430
  abortSignal,
9374
9431
  frameRangeStart: frameRange?.startFrame,
9432
+ interleaveFrames: input.interleaveFrames,
9375
9433
  dedupPerfs,
9376
9434
  pageErrorLines: workerPageErrors,
9377
9435
  onProgress: (progress) => {
@@ -10849,9 +10907,6 @@ async function runEncodeStage(input) {
10849
10907
  return { encodeMs: Date.now() - stage5Start };
10850
10908
  }
10851
10909
  const onFramesEncoded = startEncodeProgress(job, "Encoding video", onProgress);
10852
- const baseScaledEncodeTimeout = Math.ceil((job.duration ?? 0) * 4e3);
10853
- const scaledEncodeTimeout = baseScaledEncodeTimeout * (job.config.quality === "high" ? 6 : 1);
10854
- const videoEngineCfg = scaledEncodeTimeout > engineCfg.ffmpegEncodeTimeout ? { ...engineCfg, ffmpegEncodeTimeout: scaledEncodeTimeout } : engineCfg;
10855
10910
  const frameExt = frameFileExtension(input.captureImageFormat);
10856
10911
  const framePattern = `frame_%06d.${frameExt}`;
10857
10912
  const encoderOpts = videoEncoderOptions(input, engineCfg);
@@ -10862,7 +10917,7 @@ async function runEncodeStage(input) {
10862
10917
  encoderOpts,
10863
10918
  chunkedEncodeSize,
10864
10919
  abortSignal,
10865
- videoEngineCfg,
10920
+ engineCfg,
10866
10921
  onFramesEncoded
10867
10922
  ) : await encodeFramesFromDir(
10868
10923
  framesDir,
@@ -10870,7 +10925,7 @@ async function runEncodeStage(input) {
10870
10925
  videoOnlyPath,
10871
10926
  encoderOpts,
10872
10927
  abortSignal,
10873
- videoEngineCfg,
10928
+ engineCfg,
10874
10929
  onFramesEncoded
10875
10930
  );
10876
10931
  assertNotAborted();
@@ -11211,16 +11266,42 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
11211
11266
  }
11212
11267
  return ranges;
11213
11268
  }
11214
- function buildMissingFrameRetryBatches(ranges, maxWorkers, workDir, attempt, rangeStart = 0) {
11269
+ function buildMissingFrameRetryBatches(ranges, maxWorkers, workDir, attempt, rangeStart = 0, stride = 1) {
11215
11270
  const workersPerBatch = Math.max(1, Math.floor(maxWorkers));
11216
11271
  const batches = [];
11272
+ const outputDirFor = (batchIndex, workerId) => join25(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`);
11273
+ if (stride > 1) {
11274
+ const spans = /* @__PURE__ */ new Map();
11275
+ for (const range of ranges) {
11276
+ for (let frame = range.startFrame; frame < range.endFrame; frame++) {
11277
+ const span = spans.get(frame % stride);
11278
+ if (span) span.last = frame;
11279
+ else spans.set(frame % stride, { first: frame, last: frame });
11280
+ }
11281
+ }
11282
+ const strided = [...spans.values()];
11283
+ for (let i = 0; i < strided.length; i += workersPerBatch) {
11284
+ const batchIndex = batches.length;
11285
+ batches.push(
11286
+ strided.slice(i, i + workersPerBatch).map(({ first, last }, workerId) => ({
11287
+ workerId,
11288
+ startFrame: rangeStart + first,
11289
+ endFrame: rangeStart + last + 1,
11290
+ frameStride: stride,
11291
+ outputDir: outputDirFor(batchIndex, workerId),
11292
+ outputFrameOffset: rangeStart
11293
+ }))
11294
+ );
11295
+ }
11296
+ return batches;
11297
+ }
11217
11298
  for (let i = 0; i < ranges.length; i += workersPerBatch) {
11218
11299
  const batchIndex = batches.length;
11219
11300
  const batch = ranges.slice(i, i + workersPerBatch).map((range, workerId) => ({
11220
11301
  workerId,
11221
11302
  startFrame: rangeStart + range.startFrame,
11222
11303
  endFrame: rangeStart + range.endFrame,
11223
- outputDir: join25(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`),
11304
+ outputDir: outputDirFor(batchIndex, workerId),
11224
11305
  outputFrameOffset: rangeStart
11225
11306
  }));
11226
11307
  batches.push(batch);
@@ -11313,8 +11394,16 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
11313
11394
  currentWorkers,
11314
11395
  attemptWorkDir,
11315
11396
  attempt,
11316
- rangeStart
11317
- ) : [distributeFrames(options.totalFrames, currentWorkers, attemptWorkDir, rangeStart)];
11397
+ rangeStart,
11398
+ options.interleaveFrames ? options.initialWorkerCount : 1
11399
+ ) : [
11400
+ (options.interleaveFrames ? distributeFramesInterleaved : distributeFrames)(
11401
+ options.totalFrames,
11402
+ currentWorkers,
11403
+ attemptWorkDir,
11404
+ rangeStart
11405
+ )
11406
+ ];
11318
11407
  options.dedupPerfs.length = 0;
11319
11408
  try {
11320
11409
  for (const tasks of batches) {
@@ -11766,6 +11855,9 @@ function resolveDeShortBand(args) {
11766
11855
  function shouldPreferSingleWorkerDrawElement(args) {
11767
11856
  return args.workerCount > 1 && args.useDrawElement && !args.deCompileGate && !args.forceScreenshot && outputUsesH264Pipeline(args.outputFormat) && args.minFrames > 0 && args.totalFrames >= args.minFrames && args.singleWorkerStreamingOk && !args.layeredOrEffectRoute && !args.supersampling && !args.probeDeGated && !args.experimentalParallelDeOptIn;
11768
11857
  }
11858
+ function probeNeedsScreenshotFrames(session) {
11859
+ return (session?.deRiskFrames?.size ?? 0) > 0;
11860
+ }
11769
11861
  function isProbeDeGated(session) {
11770
11862
  return session !== null && session.captureMode !== "drawelement" && !session.deInitDeferred;
11771
11863
  }
@@ -12423,6 +12515,7 @@ async function executeRenderPipeline(input) {
12423
12515
  height,
12424
12516
  fps: job.config.fps,
12425
12517
  format: captureImageFormat,
12518
+ transparent: needsAlpha,
12426
12519
  quality: captureImageFormat === "png" ? void 0 : resolveCaptureJpegQuality(job.config.quality),
12427
12520
  variables: job.config.variables,
12428
12521
  deviceScaleFactor,
@@ -12444,6 +12537,7 @@ async function executeRenderPipeline(input) {
12444
12537
  // Probe-resolved duration: drawElement self-verification derives its
12445
12538
  // sample frame indices from this so they land inside the drained range.
12446
12539
  compositionDurationSeconds: job.duration,
12540
+ deFrameFallback: true,
12447
12541
  requiresWebGpu: compositionRequiresWebGpu(compiled.html),
12448
12542
  // Live route for Chrome memory (spec §5 Phase −1). The aggregate route
12449
12543
  // through CapturePerfSummary only exists on success; a mid-capture
@@ -12544,7 +12638,7 @@ async function executeRenderPipeline(input) {
12544
12638
  minFrames: deParallelMinFrames,
12545
12639
  layeredOrEffectRoute: hasHdrContent || compiled.hasShaderTransitions,
12546
12640
  supersampling: deviceScaleFactor !== 1,
12547
- probeDeGated: isProbeDeGated(probeSession),
12641
+ probeDeGated: isProbeDeGated(probeSession) || probeNeedsScreenshotFrames(probeSession),
12548
12642
  experimentalParallelDeOptIn: process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true" || process.env.HF_DE_PARALLEL_STREAM === "true",
12549
12643
  routerEnabled: deParallelRouterEnabled,
12550
12644
  // Router pins 3 workers for the streaming path; don't pin when a
@@ -12586,6 +12680,8 @@ async function executeRenderPipeline(input) {
12586
12680
  deInversionEligible = false;
12587
12681
  deParallelRouterEligible = false;
12588
12682
  deShortBand = void 0;
12683
+ } else if (probeNeedsScreenshotFrames(probeSession)) {
12684
+ deParallelRouterEligible = false;
12589
12685
  }
12590
12686
  }
12591
12687
  const deProbeGateReason = isProbeDeGated(probeSession) ? probeSession.deGateReason : void 0;
@@ -12777,7 +12873,8 @@ async function executeRenderPipeline(input) {
12777
12873
  deParallelStreamForced
12778
12874
  );
12779
12875
  const deParallelStreamVerified = (deParallelStreamForced || process.env.HF_DE_PARALLEL_STREAM === "true") && useStreamingEncode && workerCount > 1;
12780
- if (shouldClampDefaultDrawElement({
12876
+ const routeDropsScreenshotFrames = cfg.useDrawElement && probeNeedsScreenshotFrames(probeSession) && (!useStreamingEncode || workerCount !== 1);
12877
+ if (routeDropsScreenshotFrames || shouldClampDefaultDrawElement({
12781
12878
  useDrawElement: cfg.useDrawElement,
12782
12879
  fastCaptureExplicitOptIn: process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true",
12783
12880
  useStreamingEncode,
@@ -13451,7 +13548,8 @@ async function executeRenderPipeline(input) {
13451
13548
  abortSignal: executionSignal,
13452
13549
  assertNotAborted,
13453
13550
  onProgress,
13454
- onFrameLanded: (frame) => overlap?.onFrameLanded(frame)
13551
+ onFrameLanded: (frame) => overlap?.onFrameLanded(frame),
13552
+ interleaveFrames: overlap !== null
13455
13553
  })
13456
13554
  );
13457
13555
  let captureRes;
@@ -14352,6 +14450,18 @@ function planFrameWeights(input) {
14352
14450
  }
14353
14451
  return weights;
14354
14452
  }
14453
+ function withChunkCaptureCost(slices, weights) {
14454
+ const lightest = weights.reduce((least, weight) => Math.min(least, weight), Infinity);
14455
+ return slices.map((slice) => {
14456
+ let sum2 = 0;
14457
+ for (let frame = slice.startFrame; frame < slice.endFrame; frame++) sum2 += weights[frame];
14458
+ const cost = Math.round(sum2 / (slice.endFrame - slice.startFrame) / lightest * 100) / 100;
14459
+ return cost > 1 ? { ...slice, captureCost: cost } : slice;
14460
+ });
14461
+ }
14462
+ function effectiveChunkFrames(frames, captureCost = 1) {
14463
+ return Math.round(frames * captureCost);
14464
+ }
14355
14465
  function buildWeightedChunkSlices(weights, chunkCount, minFrames, maxFrames) {
14356
14466
  if (isUniformFrameCost(weights)) return null;
14357
14467
  const totalFrames = weights.length;
@@ -15670,7 +15780,10 @@ function buildPlanChunkSlices(frameWeights, config, chunkCount, effectiveChunkSi
15670
15780
  MIN_CHUNK_SIZE,
15671
15781
  Math.min(config.targetChunkFrames ?? MAX_CHUNK_SIZE, MAX_CHUNK_SIZE, maxFramesPerChunk)
15672
15782
  ) : null;
15673
- return weighted ?? buildChunkSlices(frameWeights.length, chunkCount, effectiveChunkSize);
15783
+ return withChunkCaptureCost(
15784
+ weighted ?? buildChunkSlices(frameWeights.length, chunkCount, effectiveChunkSize),
15785
+ frameWeights
15786
+ );
15674
15787
  }
15675
15788
  async function readFontSnapshotSha() {
15676
15789
  const module = await import("./fontData.generated-NXAOI4GH.js");
@@ -15957,7 +16070,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
15957
16070
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
15958
16071
  if (probeResult.probeSession) {
15959
16072
  try {
15960
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-QQPHMIJ7.js");
16073
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-HPLELQRK.js");
15961
16074
  await closeCaptureSession2(probeResult.probeSession);
15962
16075
  } catch (err) {
15963
16076
  log.warn("[plan] probe session close failed", {
@@ -17631,7 +17744,7 @@ function startServer(options = {}) {
17631
17744
  });
17632
17745
  async function shutdown(signal) {
17633
17746
  log.info(`Received ${signal}, shutting down`);
17634
- const { drainBrowserPool } = await import("./src-QQPHMIJ7.js");
17747
+ const { drainBrowserPool } = await import("./src-HPLELQRK.js");
17635
17748
  await drainBrowserPool().catch(() => {
17636
17749
  });
17637
17750
  const handle = await Promise.race([
@@ -17992,7 +18105,12 @@ function parseChunkSlices(value) {
17992
18105
  throw new PlanV2IntegrityError(`meta/chunks.json contains duplicate chunk index ${index}`);
17993
18106
  }
17994
18107
  indexes.add(index);
17995
- return { index, startFrame, endFrame };
18108
+ if (chunk.captureCost === void 0) return { index, startFrame, endFrame };
18109
+ const captureCost = chunk.captureCost;
18110
+ if (typeof captureCost !== "number" || !Number.isFinite(captureCost) || captureCost <= 1) {
18111
+ throw new PlanV2IntegrityError(`${field}.captureCost must be a number above 1`);
18112
+ }
18113
+ return { index, startFrame, endFrame, captureCost };
17996
18114
  });
17997
18115
  }
17998
18116
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
@@ -19140,15 +19258,17 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19140
19258
  deferredVideos.filter((video) => remoteVideoIds.has(video.videoId))
19141
19259
  )
19142
19260
  });
19261
+ const captureFrames = effectiveChunkFrames(framesInChunk, slice.captureCost);
19143
19262
  const chunkWorkerCount = resolveChunkCaptureWorkers(
19144
- framesInChunk,
19145
- calculateOptimalWorkers(framesInChunk, void 0, cfg),
19263
+ captureFrames,
19264
+ calculateOptimalWorkers(captureFrames, void 0, cfg),
19146
19265
  options?.maxCaptureWorkers
19147
19266
  );
19148
19267
  let session = null;
19149
19268
  let outputKind;
19150
19269
  let framesEncoded = 0;
19151
19270
  let sessionBootMs = 0;
19271
+ let videoExtractMs = 0;
19152
19272
  let captureStageMs = 0;
19153
19273
  let encodeStageMs = 0;
19154
19274
  let captureMode;
@@ -19214,6 +19334,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19214
19334
  session = null;
19215
19335
  }
19216
19336
  }
19337
+ const extractStarted = Date.now();
19217
19338
  const deferredVideoFrames = planVideos ? extractDeferredVideoFramesForChunk({
19218
19339
  planDir,
19219
19340
  planVideos,
@@ -19223,6 +19344,9 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19223
19344
  cfg,
19224
19345
  remoteSources,
19225
19346
  shownBoxes
19347
+ }).then((frames) => {
19348
+ videoExtractMs = Date.now() - extractStarted;
19349
+ return frames;
19226
19350
  }) : Promise.resolve([]);
19227
19351
  extraction = deferredVideoFrames;
19228
19352
  const videoFrameLookup = planVideos && planVideos.extracted.length > 0 ? deferredVideoFrames.then(
@@ -19351,7 +19475,8 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19351
19475
  assertNotAborted: () => {
19352
19476
  },
19353
19477
  frameRange: range,
19354
- onFrameLanded: (frame) => overlap.current?.onFrameLanded(frame)
19478
+ onFrameLanded: (frame) => overlap.current?.onFrameLanded(frame),
19479
+ interleaveFrames: overlap.current !== null
19355
19480
  }).catch(async (captureError) => {
19356
19481
  await overlap.current?.abort();
19357
19482
  overlap.current = null;
@@ -19440,6 +19565,8 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19440
19565
  sessionBootMs,
19441
19566
  captureStageMs,
19442
19567
  encodeStageMs,
19568
+ // Wall time of the chunk's own video frame extraction; it overlaps captureStageMs, so do not add them.
19569
+ videoExtractMs,
19443
19570
  workers: chunkWorkerCount,
19444
19571
  captureMode,
19445
19572
  // Device-pixel box each video's frames were extracted to cover; a video not listed kept full size.