hyperframes 0.8.204 → 0.8.206

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 (199) hide show
  1. package/dist/{add-HBFVYKGU.js → add-FFMNAJXJ.js} +12 -12
  2. package/dist/{animatedGifPrep-VBUKGEZ6.js → animatedGifPrep-BIIIIVWL.js} +16 -10
  3. package/dist/api.js +18 -18
  4. package/dist/{asset-OVLMJY4S.js → asset-IPUHGZSL.js} +2 -2
  5. package/dist/{assetCataloger-K4INCLFU.js → assetCataloger-M5FWXLAJ.js} +8 -8
  6. package/dist/{audio-JHW3HLHK.js → audio-VYWWM4DB.js} +19 -16
  7. package/dist/{auth-RH67KQMZ.js → auth-GZQZCUPL.js} +1 -1
  8. package/dist/{autoUpdate-JYR2RW5Z.js → autoUpdate-GJUDDLLO.js} +2 -2
  9. package/dist/{backgroundChecks-DPHRM4HJ.js → backgroundChecks-BTMSW34Z.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-JFUWZR3M.js → batchRender-LI2BJRGO.js} +4 -4
  12. package/dist/{beats-AWAFZGOT.js → beats-H73CSYT4.js} +11 -11
  13. package/dist/{benchmark-VQCCULJ2.js → benchmark-XT3A5REC.js} +14 -12
  14. package/dist/{browser-TT5L7D32.js → browser-VIOK66YK.js} +5 -5
  15. package/dist/{bundleWithLocalizedFonts-EHXEP5ZL.js → bundleWithLocalizedFonts-PFRVWYOO.js} +2 -2
  16. package/dist/{capture-Y7TGR3BI.js → capture-252WNPCD.js} +2 -2
  17. package/dist/{capture-5CM2P6CB.js → capture-KKD5GMAF.js} +20 -20
  18. package/dist/{captureCompositionFrame-LIT6U6C4.js → captureCompositionFrame-YLYVGNN2.js} +13 -13
  19. package/dist/{catalog-WZN2XB7D.js → catalog-6IJGNN3T.js} +12 -12
  20. package/dist/{catch-up-WZMQUW5H.js → catch-up-BFW7Z35W.js} +4 -4
  21. package/dist/{check-YVJCDCJS.js → check-XUWBZASR.js} +40 -38
  22. package/dist/checkAudio-2NRR3VHQ.js +201 -0
  23. package/dist/{checkBrowser-7V2DGDVD.js → checkBrowser-JW74KWTF.js} +33 -32
  24. package/dist/{chunk-IDASYE4U.js → chunk-2MLMO25E.js} +8 -5
  25. package/dist/{chunk-TBSYUEB7.js → chunk-2RT7MXFL.js} +1 -1
  26. package/dist/{chunk-7RB4I2E6.js → chunk-2S263R6D.js} +19 -7
  27. package/dist/{chunk-YLGRZSH4.js → chunk-36QE3P6B.js} +1 -1
  28. package/dist/{chunk-3GPDAE3D.js → chunk-3B2DBUQX.js} +1 -1
  29. package/dist/{chunk-UKXF4IPA.js → chunk-3CS6QYL7.js} +5 -5
  30. package/dist/{chunk-KOBPUFCN.js → chunk-3R6SXPHD.js} +2 -2
  31. package/dist/{chunk-US6JSQ2L.js → chunk-42KN6I6A.js} +2 -2
  32. package/dist/{chunk-LTGTN2TH.js → chunk-4CY5RXXC.js} +1 -1
  33. package/dist/{chunk-TQH7BF7K.js → chunk-4DGLKB2H.js} +1 -1
  34. package/dist/{chunk-DQBY7FRR.js → chunk-543U46OR.js} +4 -1
  35. package/dist/{chunk-D3EZHD2D.js → chunk-5QKJPCQ4.js} +2 -2
  36. package/dist/{chunk-IJ6RY4CH.js → chunk-63DGZRZP.js} +1 -1
  37. package/dist/{chunk-DRDG46KK.js → chunk-6ZFDNEMY.js} +14 -14
  38. package/dist/{chunk-LN5EJMSC.js → chunk-7SXL476O.js} +30 -20
  39. package/dist/{chunk-2756LXGY.js → chunk-AAX2A7LQ.js} +1 -1
  40. package/dist/{chunk-DTV3VHFE.js → chunk-AEC4T4IF.js} +4 -4
  41. package/dist/{chunk-4HJMZI4H.js → chunk-AJSU6KGS.js} +13 -13
  42. package/dist/{chunk-S35XO2ZA.js → chunk-AXEEZKIL.js} +2 -2
  43. package/dist/{chunk-KLIKCX6Q.js → chunk-AYH5ANVS.js} +7 -1
  44. package/dist/{chunk-ZBDVKLIU.js → chunk-BBUK6A7Q.js} +5 -5
  45. package/dist/{chunk-NJT6SZGL.js → chunk-CIHW6VM2.js} +1 -1
  46. package/dist/{chunk-EF7R5EBJ.js → chunk-CMDVJP4T.js} +10 -10
  47. package/dist/{chunk-VCBZOU7U.js → chunk-CNVHMLPI.js} +1 -1
  48. package/dist/{chunk-RFCLI6TW.js → chunk-CPSGXAYD.js} +3 -3
  49. package/dist/{chunk-54FO6TN7.js → chunk-CZYS6UKP.js} +83 -78
  50. package/dist/{chunk-5UW7WCHQ.js → chunk-DEVZJ4AL.js} +10 -9
  51. package/dist/{chunk-TCI4MUT6.js → chunk-DZG565OO.js} +1 -1
  52. package/dist/{chunk-D5CAZ7R4.js → chunk-E2ZZSDDQ.js} +2 -2
  53. package/dist/{chunk-TAYZSNYS.js → chunk-FJW757TF.js} +1 -1
  54. package/dist/{chunk-LVMJXO45.js → chunk-FMWACL3L.js} +1 -1
  55. package/dist/{chunk-54K7HW46.js → chunk-FNNGQ3DB.js} +2 -2
  56. package/dist/{chunk-AQS3MMEQ.js → chunk-FULMZCDW.js} +13 -43
  57. package/dist/chunk-G6QDFWDN.js +355 -0
  58. package/dist/{chunk-QB4K2EWI.js → chunk-G6W55MTX.js} +1 -1
  59. package/dist/{chunk-WM7GOKEP.js → chunk-GAV56VJL.js} +2 -2
  60. package/dist/{chunk-4CR23IYU.js → chunk-H4JO7VSI.js} +7 -6
  61. package/dist/{chunk-6RLP6RDE.js → chunk-HEP5XMXV.js} +1 -1
  62. package/dist/{chunk-23RPCDGE.js → chunk-HJAJ6W4V.js} +2 -2
  63. package/dist/chunk-KLIPVNCO.js +4824 -0
  64. package/dist/{chunk-YIN2JAZE.js → chunk-L5MFWGGU.js} +62 -65
  65. package/dist/{chunk-WMCGD4XL.js → chunk-MFHYBSJC.js} +58 -828
  66. package/dist/{chunk-LFGJWOVA.js → chunk-MNNK7RV5.js} +11 -8
  67. package/dist/{chunk-EUFBE5BW.js → chunk-N7ZMDVAK.js} +1 -1
  68. package/dist/{chunk-X7XICOVM.js → chunk-NNLQTG3M.js} +1 -1
  69. package/dist/{chunk-TNOERLC6.js → chunk-NVLPW3DG.js} +17 -9
  70. package/dist/{chunk-SVVAUJPL.js → chunk-OFRRUYBA.js} +1 -1
  71. package/dist/{chunk-WLD4PX3P.js → chunk-OZUAVHFE.js} +18 -3
  72. package/dist/{chunk-QCQDUQVJ.js → chunk-PNKLOMHQ.js} +2 -2
  73. package/dist/{chunk-QZ4HQQYS.js → chunk-PQYWYBEQ.js} +1 -1
  74. package/dist/{chunk-VC3BMKYO.js → chunk-QL4ZYSIB.js} +3 -3
  75. package/dist/{chunk-N3EJG2X4.js → chunk-QVTCXN42.js} +3 -3
  76. package/dist/{chunk-Y63CT2ZC.js → chunk-RDDVQSNQ.js} +124 -37
  77. package/dist/{chunk-WXAQT63P.js → chunk-RW4DMP2Y.js} +4 -4
  78. package/dist/{chunk-5RJSWYWL.js → chunk-SFYLZX5C.js} +1 -1
  79. package/dist/{chunk-YU53JSUZ.js → chunk-T6SD37JZ.js} +1 -1
  80. package/dist/chunk-TQBQYO4L.js +55 -0
  81. package/dist/{chunk-MSH2F7VW.js → chunk-TSJVPPXT.js} +1 -1
  82. package/dist/{chunk-7PRESGFT.js → chunk-UMUVGNOH.js} +3 -3
  83. package/dist/{chunk-6KZY5RSV.js → chunk-VDVVQNTK.js} +2 -2
  84. package/dist/{chunk-XX5U64F2.js → chunk-VEA7Z4PZ.js} +4 -3
  85. package/dist/{chunk-QWATUGUX.js → chunk-VHVSBOZH.js} +3 -3
  86. package/dist/{chunk-65VFH2UV.js → chunk-VW2LVMKB.js} +19 -9
  87. package/dist/{chunk-DBF6LLXB.js → chunk-WHD5IAHI.js} +1 -1
  88. package/dist/{chunk-OPFG563D.js → chunk-WYB3VKLK.js} +2 -2
  89. package/dist/{chunk-34VLVDOU.js → chunk-X5HHHFTX.js} +3 -3
  90. package/dist/{chunk-BL4U6U52.js → chunk-X7A7C4JS.js} +70 -7
  91. package/dist/chunk-X7RXXBYM.js +29 -0
  92. package/dist/{chunk-GGEA5EHR.js → chunk-XOM3XTJ4.js} +1 -1
  93. package/dist/{chunk-HBDQGIQA.js → chunk-Z3XXLTVB.js} +2 -2
  94. package/dist/{chunk-ERUINDRT.js → chunk-ZF3R2IPC.js} +184 -183
  95. package/dist/{chunk-CXZDIWMK.js → chunk-ZNAOBFU5.js} +1 -1
  96. package/dist/{chunk-AII6P2TC.js → chunk-ZTEKVSZ6.js} +1 -1
  97. package/dist/{clean-3JE2KYTC.js → clean-N5VSKUVS.js} +20 -20
  98. package/dist/cli.js +82 -60
  99. package/dist/{cloud-Z54BHP6G.js → cloud-74NF5FXC.js} +4 -4
  100. package/dist/{cloudrun-4CPQLU5M.js → cloudrun-7UOH335V.js} +6 -6
  101. package/dist/{compare-AQMLMTFD.js → compare-AY2LS2TZ.js} +33 -33
  102. package/dist/{compiler-LIJYMSEL.js → compiler-4MHMC777.js} +14 -10
  103. package/dist/{component-ZH37EIYB.js → component-CFWQOAZI.js} +3 -3
  104. package/dist/{compositions-DF2FM6YD.js → compositions-DXLJTDSP.js} +14 -14
  105. package/dist/{delete-A3NSK2HH.js → delete-GB4MS7LM.js} +2 -2
  106. package/dist/{deploy-6RC2DXPQ.js → deploy-NXD3Q3KD.js} +4 -4
  107. package/dist/{deterministicFonts-HQYCUUAL.js → deterministicFonts-775YXAQ2.js} +2 -2
  108. package/dist/{dist-VSIT3UAX.js → dist-3ZJMZU75.js} +11 -3
  109. package/dist/{dist-6JMYDD7F.js → dist-ZY6IFESG.js} +2 -2
  110. package/dist/docs/examples.md +31 -7
  111. package/dist/{doctor-RILK4ATO.js → doctor-CVY2XXKS.js} +14 -14
  112. package/dist/{events-SL434XAY.js → events-RYQYEWBV.js} +2 -2
  113. package/dist/{events-B5EKVEPW.js → events-T3CLIYRG.js} +3 -3
  114. package/dist/{feedback-S4PC6VAR.js → feedback-K5ZMMLTA.js} +8 -8
  115. package/dist/{ffmpeg-XSDPPZCU.js → ffmpeg-UNDAJ2IC.js} +9 -9
  116. package/dist/{figma-MV2L6E2Z.js → figma-MYYCX635.js} +3 -3
  117. package/dist/fontLocalizeCli.js +13 -12
  118. package/dist/{get-ID3Y3PCN.js → get-JVIDYMVP.js} +2 -2
  119. package/dist/{gpuPolicy-2LRMQOAD.js → gpuPolicy-KEX7GDRJ.js} +8 -8
  120. package/dist/{grade-compare-NV3TKIOO.js → grade-compare-QEF6VASJ.js} +31 -31
  121. package/dist/{gsapParser-IEUSLYDJ.js → gsapParser-3H7ON3DO.js} +1 -1
  122. package/dist/heifImagePrep-A3ZPVQGU.js +53 -0
  123. package/dist/{help-ZPT23LZ3.js → help-XPPSLIRY.js} +1 -1
  124. package/dist/{history-MZGDX3TR.js → history-OFOPRD27.js} +7 -7
  125. package/dist/hyperframe.manifest.json +1 -1
  126. package/dist/hyperframe.runtime.iife.js +66 -64
  127. package/dist/hyperframes-player.global.js +3 -3
  128. package/dist/hyperframes-slideshow.global.js +16 -16
  129. package/dist/{info-FIZ4A54H.js → info-7RF6FQX5.js} +8 -8
  130. package/dist/{init-WX4MNPL2.js → init-NTIXWA3D.js} +32 -35
  131. package/dist/{inspect-R5KWWKNJ.js → inspect-MYMCV5E7.js} +31 -30
  132. package/dist/inspection.js +4 -4
  133. package/dist/{installer-CTV5FKYQ.js → installer-PYJIJ3PJ.js} +5 -5
  134. package/dist/{keyframes-FAJY5RK5.js → keyframes-UJ52PYE4.js} +6 -6
  135. package/dist/{lambda-3MCC2ZH7.js → lambda-SBNUYEQE.js} +8 -8
  136. package/dist/{layout-3RTVYRRN.js → layout-IOMCOABO.js} +31 -30
  137. package/dist/{lint-ZDCVL7K4.js → lint-AQWHHMPS.js} +8 -8
  138. package/dist/{lintProject-4IVYXS5J.js → lintProject-5A4SCW3S.js} +2 -2
  139. package/dist/{list-SBCXW2UT.js → list-WKAJ5SP3.js} +2 -2
  140. package/dist/{login-VQ2LQ2YG.js → login-3ZDK5JOA.js} +4 -4
  141. package/dist/{manager-F34TSFV6.js → manager-F2YREC5X.js} +2 -2
  142. package/dist/{manager-ZRF6UXUM.js → manager-QYFYWZOK.js} +10 -10
  143. package/dist/{media-treatment-MFIP7Q4G.js → media-treatment-4OLWVHUY.js} +15 -15
  144. package/dist/{models-OU36YZCT.js → models-MR55FAUX.js} +14 -14
  145. package/dist/{motionShot-SHDUG7YR.js → motionShot-DC47S7BT.js} +17 -17
  146. package/dist/{normalize-audio-7RTPEV7Y.js → normalize-audio-M2TK4NG5.js} +8 -8
  147. package/dist/{open-HT4RG32S.js → open-YXWBWTKL.js} +15 -14
  148. package/dist/{parakeetRunner-DOVPZDCH.js → parakeetRunner-J6QR3GTG.js} +15 -15
  149. package/dist/{pipeline-NIVQ6E2G.js → pipeline-7MJ5H4SW.js} +10 -10
  150. package/dist/{play-HPX5SIRQ.js → play-S562STR4.js} +34 -24
  151. package/dist/{preflight-TNYC7EIS.js → preflight-QWGXMISC.js} +11 -11
  152. package/dist/{present-QSOIMURR.js → present-PGOHZT3L.js} +30 -20
  153. package/dist/{preview-WDO53XKK.js → preview-JU75H4QN.js} +32 -29
  154. package/dist/{producer-G27KP3IY.js → producer-H66OMZLW.js} +1 -1
  155. package/dist/{projectConfig-CP722RCM.js → projectConfig-COSP24YT.js} +7 -7
  156. package/dist/{publication-LCWVBLDN.js → publication-J3XYHPGB.js} +3 -3
  157. package/dist/{publish-BIY6LEZ2.js → publish-7GCCEPJZ.js} +11 -11
  158. package/dist/{remove-background-NPLZGLZ3.js → remove-background-WRCGIU32.js} +11 -11
  159. package/dist/{render-J57LAXB5.js → render-5J5PP3UK.js} +21 -21
  160. package/dist/{render-IHNAZXA2.js → render-QS3YJCBR.js} +6 -6
  161. package/dist/{render-HHUGUKG6.js → render-VUVTK2JM.js} +36 -36
  162. package/dist/{render-batch-FK26OQ5E.js → render-batch-Q2LQ3D4P.js} +6 -6
  163. package/dist/renderSetupWorker.js +5 -5
  164. package/dist/{resolver-FWJXO6DY.js → resolver-QCBWPRSC.js} +5 -5
  165. package/dist/{sherpa-BXFJU5EP.js → sherpa-IZ22SC5W.js} +14 -14
  166. package/dist/skills/hyperframes/references/types/launch.md +12 -2
  167. package/dist/skills/media-use/references/memory.md +4 -0
  168. package/dist/skills/media-use/scripts/lib/prefs-store.concurrent.test.mjs +173 -0
  169. package/dist/skills/media-use/scripts/lib/prefs-store.mjs +46 -28
  170. package/dist/skills/media-use/scripts/lib/prefs-store.test.mjs +56 -0
  171. package/dist/{skills-7XS4HZBC.js → skills-3RFMPMJA.js} +5 -5
  172. package/dist/{skillsUpdateCheck-MGU5KLR4.js → skillsUpdateCheck-DWBFVUBT.js} +3 -3
  173. package/dist/{snapshot-O2PMEMKH.js → snapshot-5PHA43DK.js} +54 -41
  174. package/dist/{src-Q4R2YPKA.js → src-36BQVJL3.js} +17 -11
  175. package/dist/{src-OQRG6BT7.js → src-4YJKYMNF.js} +11 -7
  176. package/dist/{staticProjectServer-6OY4VMO6.js → staticProjectServer-3XFB76XS.js} +18 -18
  177. package/dist/studio/assets/hyperframes-player-lCVwx9d3.js +478 -0
  178. package/dist/studio/assets/{index-DpxSurnJ.js → index-BNuxGFZK.js} +1 -1
  179. package/dist/studio/assets/{index-DmST2bTJ.js → index-CwreIGoq.js} +132 -132
  180. package/dist/studio/index.html +1 -1
  181. package/dist/{studio-api-YSUTKHV7.js → studio-api-WL6EZ4KE.js} +11 -11
  182. package/dist/{studioSelectionClient-IUUPKUHZ.js → studioSelectionClient-D6VMGTKQ.js} +1 -1
  183. package/dist/{studioServer-APGEQIW5.js → studioServer-ZS5RA6U3.js} +66 -56
  184. package/dist/{telemetry-3B6EA5IU.js → telemetry-W3LRO3TB.js} +3 -3
  185. package/dist/{timeline-QWM6JS4B.js → timeline-BDO5DYWP.js} +19 -19
  186. package/dist/{tokens-TKLSP3OQ.js → tokens-47CEMYFV.js} +2 -2
  187. package/dist/{transcribe-XOPMHJLJ.js → transcribe-GEPVJO3A.js} +19 -19
  188. package/dist/{transcribe-PODOCWCC.js → transcribe-XF3NL6JI.js} +13 -13
  189. package/dist/{tts-5I2AJNLM.js → tts-QM4RFE7U.js} +1 -1
  190. package/dist/{updateCheck-RO6FPYMZ.js → updateCheck-BON6ZFYP.js} +2 -2
  191. package/dist/{upgrade-EVNIL5TZ.js → upgrade-KIF5Z4J3.js} +2 -2
  192. package/dist/{urlDownloader-F5HYFRA6.js → urlDownloader-UDRHVUWR.js} +7 -7
  193. package/dist/{validate-NXLFCHGG.js → validate-2OPSQT3W.js} +24 -24
  194. package/dist/{video-ECV2OIQN.js → video-ECWXMY4F.js} +8 -8
  195. package/dist/warmCheck.js +40 -38
  196. package/package.json +1 -1
  197. package/dist/chunk-YRQPU7SV.js +0 -3983
  198. package/dist/studio/assets/hyperframes-player-CttA4PW7.js +0 -478
  199. package/dist/{synthesize-PKTB5ATG.js → synthesize-QCRP3NI7.js} +4 -4
@@ -5,18 +5,20 @@ var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
 
8
+ // src/utils/port.ts
9
+ function parsePort(value, option = "--port") {
10
+ const message = `${option} must be an integer between 1 and 65535`;
11
+ if (!/^\d+$/.test(value)) throw new Error(message);
12
+ const port = Number(value);
13
+ if (port < 1 || port > 65535) throw new Error(message);
14
+ return port;
15
+ }
16
+
8
17
  // src/utils/openBrowser.ts
9
18
  import { spawn } from "child_process";
10
19
  function parseRemoteDebuggingPort(value) {
11
20
  if (value === void 0 || value === "") return void 0;
12
- if (!/^\d+$/.test(value)) {
13
- throw new Error("--remote-debugging-port must be an integer between 1 and 65535");
14
- }
15
- const port = Number(value);
16
- if (port < 1 || port > 65535) {
17
- throw new Error("--remote-debugging-port must be an integer between 1 and 65535");
18
- }
19
- return port;
21
+ return parsePort(value, "--remote-debugging-port");
20
22
  }
21
23
  function validateRemoteDebuggingPortDeps(deps) {
22
24
  if (!deps.remoteDebuggingPort) return null;
@@ -55,6 +57,7 @@ function openBrowser(url, options = {}) {
55
57
  }
56
58
 
57
59
  export {
60
+ parsePort,
58
61
  parseRemoteDebuggingPort,
59
62
  validateRemoteDebuggingPortDeps,
60
63
  openBrowser
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  FONT_ALIAS_MAP,
16
16
  resolveAliasDisplayName
17
- } from "./chunk-SVVAUJPL.js";
17
+ } from "./chunk-OFRRUYBA.js";
18
18
  import {
19
19
  parseHTML
20
20
  } from "./chunk-GWTIFRF5.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  updateCheckDisabled
9
- } from "./chunk-GGEA5EHR.js";
9
+ } from "./chunk-XOM3XTJ4.js";
10
10
  import {
11
11
  hostAnswers
12
12
  } from "./chunk-K4WIOZFP.js";
@@ -9,10 +9,10 @@ import {
9
9
  isHttpUrl,
10
10
  renameWithRetry,
11
11
  runFfmpeg
12
- } from "./chunk-Y63CT2ZC.js";
12
+ } from "./chunk-RDDVQSNQ.js";
13
13
  import {
14
14
  parseAnimatedGifMetadata
15
- } from "./chunk-65VFH2UV.js";
15
+ } from "./chunk-VW2LVMKB.js";
16
16
  import {
17
17
  parseHTML
18
18
  } from "./chunk-GWTIFRF5.js";
@@ -72,7 +72,7 @@ function readLoopOverride(el) {
72
72
  }
73
73
  return null;
74
74
  }
75
- function resolveGifSourcePath(src, options) {
75
+ function resolveLocalImageSourcePath(src, options) {
76
76
  const trimmed = src.trim();
77
77
  if (!trimmed || trimmed.startsWith("data:")) return null;
78
78
  const { basePath } = splitUrlSuffix(trimmed);
@@ -128,12 +128,12 @@ function resolveClipWindowSeconds(img, compositionDuration) {
128
128
  }
129
129
  return null;
130
130
  }
131
- function resolvePreparedPlayback(metadata, loop, windowSeconds) {
131
+ function resolvePreparedPlayback(metadata, loopOverride, windowSeconds) {
132
132
  const gifDuration = metadata.durationSeconds > 0 ? metadata.durationSeconds : null;
133
133
  let loopIterations = 1;
134
- if (loop) {
134
+ if (resolveLoop(metadata, loopOverride)) {
135
135
  loopIterations = windowSeconds != null && gifDuration != null ? Math.min(MAX_LOOP_ITERATIONS, Math.max(1, Math.ceil(windowSeconds / gifDuration))) : 1;
136
- } else if (metadata.loopCount != null && metadata.loopCount > 1) {
136
+ } else if (loopOverride == null && metadata.loopCount != null && metadata.loopCount > 1) {
137
137
  loopIterations = Math.min(MAX_LOOP_ITERATIONS, metadata.loopCount);
138
138
  }
139
139
  let padSeconds = 0;
@@ -295,14 +295,19 @@ async function prepareAnimatedGifInputs(html, options) {
295
295
  const img = images[i];
296
296
  const src = (img.getAttribute("src") || "").trim();
297
297
  if (!hasGifExtension(src)) continue;
298
- const sourcePath = resolveGifSourcePath(src, options);
298
+ const sourcePath = resolveLocalImageSourcePath(src, options);
299
299
  if (!sourcePath) continue;
300
300
  const bytes = readFileSync(sourcePath);
301
301
  const metadata = parseAnimatedGifMetadata(bytes);
302
302
  if (!metadata?.animated) continue;
303
- const loop = resolveLoop(metadata, readLoopOverride(img));
303
+ const loopOverride = readLoopOverride(img);
304
+ const loop = resolveLoop(metadata, loopOverride);
304
305
  const windowSeconds = resolveClipWindowSeconds(img, compositionDuration);
305
- const { loopIterations, padSeconds } = resolvePreparedPlayback(metadata, loop, windowSeconds);
306
+ const { loopIterations, padSeconds } = resolvePreparedPlayback(
307
+ metadata,
308
+ loopOverride,
309
+ windowSeconds
310
+ );
306
311
  const hash = computePreparedGifHash(bytes, loopIterations, padSeconds);
307
312
  const filename = `${CACHE_SCHEMA}-${hash.slice(0, 24)}.webm`;
308
313
  const cachePath = join(cacheDir, filename);
@@ -341,6 +346,9 @@ async function prepareAnimatedGifInputs(html, options) {
341
346
  export {
342
347
  EncoderInterruptedError,
343
348
  encoderFailureError,
349
+ splitUrlSuffix,
350
+ normalizeRelPath,
351
+ resolveLocalImageSourcePath,
344
352
  buildAnimatedGifTranscodeArgs,
345
353
  prepareAnimatedGifInputs
346
354
  };
@@ -1260,7 +1260,7 @@ function serializeGsapAnimations(animations, timelineVar = "tl", options) {
1260
1260
  const mediaTime = time - start;
1261
1261
  if (time >= start && time < end) {
1262
1262
  if (Math.abs(media.currentTime - mediaTime) > 0.1) {
1263
- media.currentTime = mediaTime;
1263
+ media.currentTime = mediaTime + ${Number(options.mediaElementLeadSeconds ?? 0)};
1264
1264
  }
1265
1265
  if (media.paused && !${timelineVar}.paused()) {
1266
1266
  media.play().catch(function() {});
@@ -6,14 +6,17 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType
9
- } from "./chunk-LN5EJMSC.js";
9
+ } from "./chunk-7SXL476O.js";
10
+ import {
11
+ stripSdrPngColourTags
12
+ } from "./chunk-MFHYBSJC.js";
10
13
  import {
11
14
  injectTagsAtHeadStart
12
- } from "./chunk-YRQPU7SV.js";
15
+ } from "./chunk-KLIPVNCO.js";
13
16
 
14
17
  // src/utils/compositionServer.ts
15
18
  import { createHash } from "crypto";
16
- import { createReadStream, existsSync, statSync } from "fs";
19
+ import { createReadStream, existsSync, readFileSync, statSync } from "fs";
17
20
  import { resolve, dirname } from "path";
18
21
  import { Readable } from "stream";
19
22
  import { fileURLToPath } from "url";
@@ -61,6 +64,9 @@ function revalidatedResponse(body, contentType, ifNoneMatch) {
61
64
  if (ifNoneMatch === etag) return new Response(null, { status: 304, headers });
62
65
  return new Response(body, { status: 200, headers });
63
66
  }
67
+ function untaggedPngBody(filePath, contentType) {
68
+ return contentType === "image/png" ? stripSdrPngColourTags(readFileSync(filePath)) : null;
69
+ }
64
70
  function buildRangeResponse(filePath, contentType, rangeHeader, ifNoneMatch) {
65
71
  const { size, mtimeMs } = statSync(filePath);
66
72
  const last = size - 1;
@@ -69,6 +75,15 @@ function buildRangeResponse(filePath, contentType, rangeHeader, ifNoneMatch) {
69
75
  ETag: `"${mtimeMs.toString(36)}-${size.toString(36)}"`
70
76
  };
71
77
  if (ifNoneMatch === cache.ETag) return new Response(null, { status: 304, headers: cache });
78
+ const untagged = untaggedPngBody(filePath, contentType);
79
+ if (untagged) {
80
+ const headers = {
81
+ ...cache,
82
+ "Content-Type": contentType,
83
+ "Content-Length": `${untagged.length}`
84
+ };
85
+ return new Response(new Uint8Array(untagged), { status: 200, headers });
86
+ }
72
87
  const match = rangeHeader ? /^bytes=(\d*)-(\d*)$/.exec(rangeHeader.trim()) : null;
73
88
  const body = (start2, end2) => size === 0 ? null : Readable.toWeb(createReadStream(filePath, { start: start2, end: end2 }));
74
89
  if (!match) {
@@ -19,10 +19,10 @@ import {
19
19
  import {
20
20
  formatVariableValidationIssue,
21
21
  validateVariables
22
- } from "./chunk-65VFH2UV.js";
22
+ } from "./chunk-VW2LVMKB.js";
23
23
  import {
24
24
  extractCompositionMetadata
25
- } from "./chunk-SVVAUJPL.js";
25
+ } from "./chunk-OFRRUYBA.js";
26
26
 
27
27
  // src/utils/variables.ts
28
28
  import { readFileSync } from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  DISTRIBUTED_FPS,
12
12
  isDistributedFps
13
- } from "./chunk-65VFH2UV.js";
13
+ } from "./chunk-VW2LVMKB.js";
14
14
  import {
15
15
  parseHTML
16
16
  } from "./chunk-GWTIFRF5.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  readCompositionFps
9
- } from "./chunk-QZ4HQQYS.js";
9
+ } from "./chunk-PQYWYBEQ.js";
10
10
  import {
11
11
  errorBox
12
12
  } from "./chunk-K2FLNJVB.js";
@@ -16,10 +16,10 @@ import {
16
16
  import {
17
17
  DEFAULT_CONFIG,
18
18
  resolvePageNavigationTimeout
19
- } from "./chunk-Y63CT2ZC.js";
19
+ } from "./chunk-RDDVQSNQ.js";
20
20
  import {
21
21
  parseFps
22
- } from "./chunk-65VFH2UV.js";
22
+ } from "./chunk-VW2LVMKB.js";
23
23
 
24
24
  // src/browser/windowsCrash.ts
25
25
  var STATUS_STACK_BUFFER_OVERRUN_DEC = "3221225595";
@@ -11,14 +11,14 @@ import {
11
11
  distroLabel,
12
12
  getFFmpegInstallHint,
13
13
  parseLddMissingLibs
14
- } from "./chunk-D3EZHD2D.js";
14
+ } from "./chunk-5QKJPCQ4.js";
15
15
  import {
16
16
  ensureBrowser,
17
17
  findBrowser
18
- } from "./chunk-QB4K2EWI.js";
18
+ } from "./chunk-G6W55MTX.js";
19
19
  import {
20
20
  runCancellableProcess
21
- } from "./chunk-BL4U6U52.js";
21
+ } from "./chunk-X7A7C4JS.js";
22
22
  import {
23
23
  getFreeDiskMb
24
24
  } from "./chunk-QSFWGZG6.js";
@@ -22,15 +22,18 @@ import {
22
22
  hasClipStarted,
23
23
  hdrToSdrToneMapFilter,
24
24
  isInClipWindow,
25
+ mediaElementTime,
25
26
  parseFirstFrameColour,
26
27
  quantizeSeekTime,
27
28
  quantizeTimeToFrame,
28
29
  renderFrameIdForRenderId,
29
30
  resolveAuthoredTimingWindow,
30
31
  toFps
31
- } from "./chunk-65VFH2UV.js";
32
+ } from "./chunk-VW2LVMKB.js";
32
33
  import {
33
34
  AUDIO_GROUP_RENDER_ID_ATTR,
35
+ AUTHORED_SOURCE_BEGIN,
36
+ AUTHORED_SOURCE_END,
34
37
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
35
38
  COMPOSITION_SOURCE_URL,
36
39
  HF_AUDIO_AUTOMATION_ATTR,
@@ -41,6 +44,7 @@ import {
41
44
  MEDIA_RENDER_ID_ATTR,
42
45
  PAGE_DEVICE_SCALE_GLOBAL,
43
46
  PAGE_MOTION_BLUR_OFF_GLOBAL,
47
+ RUNTIME_BOOTSTRAP_ATTR,
44
48
  VOLUME_TARGET,
45
49
  acceleratedCanvasTrackerSource,
46
50
  clampAudioGain,
@@ -68,7 +72,7 @@ import {
68
72
  sourceTimeAt,
69
73
  timeAtSourceTime,
70
74
  volumeSegmentSampleCount
71
- } from "./chunk-YRQPU7SV.js";
75
+ } from "./chunk-KLIPVNCO.js";
72
76
  import {
73
77
  redactTelemetryString,
74
78
  redactUrlQueryStrings
@@ -86,7 +90,7 @@ import {
86
90
  } from "./chunk-4UMPIPCQ.js";
87
91
  import {
88
92
  resolveReferencedStart
89
- } from "./chunk-IDASYE4U.js";
93
+ } from "./chunk-2MLMO25E.js";
90
94
  import {
91
95
  FFMPEG_PATH_ENV,
92
96
  FFPROBE_PATH_ENV,
@@ -898,7 +902,7 @@ var hostHandlesSigint = false;
898
902
  function setHostHandlesSigint(owned) {
899
903
  hostHandlesSigint = owned;
900
904
  }
901
- var sigintLaunchOptions = () => ({ handleSIGINT: !hostHandlesSigint });
905
+ var ownedLaunchOptions = () => ({ handleSIGINT: !hostHandlesSigint, pipe: true });
902
906
  function isSoftwareWebGlRenderer(rendererInfo) {
903
907
  const renderer = rendererInfo.trim().toLowerCase();
904
908
  return renderer.includes("swiftshader") || renderer.includes("llvmpipe") || renderer.includes("lavapipe") || renderer.includes("softpipe") || renderer.includes("mesa offscreen") || renderer.includes("microsoft basic render driver") || renderer.includes("software rasterizer");
@@ -920,7 +924,7 @@ async function probeHardwareWebGlInfo(ppt, options) {
920
924
  let probeBrowser;
921
925
  try {
922
926
  const launchOptions = {
923
- ...sigintLaunchOptions(),
927
+ ...ownedLaunchOptions(),
924
928
  headless: true,
925
929
  args: withHyperframesBrowserMarker(options.args),
926
930
  defaultViewport: { width: 64, height: 64 },
@@ -1395,7 +1399,7 @@ async function launchBrowser(fingerprint) {
1395
1399
  let captureMode = fingerprint.requestedCaptureMode;
1396
1400
  let browser;
1397
1401
  const launch = (args) => ppt.launch({
1398
- ...sigintLaunchOptions(),
1402
+ ...ownedLaunchOptions(),
1399
1403
  headless: true,
1400
1404
  args: withHyperframesBrowserMarker(args),
1401
1405
  defaultViewport: null,
@@ -3062,18 +3066,22 @@ async function ensureRenderFrameSiblings(page) {
3062
3066
  RENDER_FRAME_ID_SUFFIX
3063
3067
  );
3064
3068
  }
3065
- async function injectVideoFramesBatch(page, updates) {
3066
- if (updates.length === 0) return [];
3069
+ async function injectVideoFramesBatch(page, updates, restyleIds = []) {
3070
+ if (updates.length === 0 && restyleIds.length === 0) return [];
3067
3071
  return withVideoFrameSources(
3068
3072
  page,
3069
3073
  updates,
3070
- (resolved) => injectResolvedVideoFramesBatch(page, resolved)
3074
+ (resolved) => injectResolvedVideoFramesBatch(page, resolved, restyleIds)
3071
3075
  );
3072
3076
  }
3073
- async function injectResolvedVideoFramesBatch(page, updates) {
3077
+ async function injectResolvedVideoFramesBatch(page, updates, restyleIds) {
3078
+ const items = [
3079
+ ...updates,
3080
+ ...restyleIds.map((videoId) => ({ videoId }))
3081
+ ].map((item) => ({ ...item, frameId: renderFrameIdForRenderId(item.videoId) }));
3074
3082
  return await page.evaluate(
3075
3083
  // fallow-ignore-next-line complexity
3076
- async (items, visualProperties, colorGradingSourceHiddenAttr) => {
3084
+ async (items2, visualProperties, colorGradingSourceHiddenAttr) => {
3077
3085
  const injectedIds = [];
3078
3086
  const pendingDecodes = [];
3079
3087
  const imagesToPublish = [];
@@ -3098,11 +3106,13 @@ async function injectResolvedVideoFramesBatch(page, updates) {
3098
3106
  }
3099
3107
  return false;
3100
3108
  };
3101
- for (const item of items) {
3109
+ for (const item of items2) {
3102
3110
  const video = window.__hfMediaEl?.(item.videoId) ?? document.getElementById(item.videoId);
3103
3111
  if (!video) continue;
3104
3112
  let img = video.nextElementSibling;
3105
3113
  const hasImg = img !== null && img.classList.contains("__render_frame__");
3114
+ const restyleOnly = item.dataUri === void 0;
3115
+ if (restyleOnly && !hasImg) continue;
3106
3116
  if (isVisualAncestorHidden(video)) {
3107
3117
  if (hasImg && img) img.style.setProperty("visibility", "hidden", "important");
3108
3118
  continue;
@@ -3150,7 +3160,7 @@ async function injectResolvedVideoFramesBatch(page, updates) {
3150
3160
  img.style.zIndex = computedStyle.zIndex;
3151
3161
  img.style.setProperty("visibility", "hidden", "important");
3152
3162
  img.decoding = "sync";
3153
- if (img.getAttribute("src") !== item.dataUri) {
3163
+ if (item.dataUri !== void 0 && img.getAttribute("src") !== item.dataUri) {
3154
3164
  if (item.crossOrigin) img.crossOrigin = item.crossOrigin;
3155
3165
  else img.removeAttribute("crossorigin");
3156
3166
  img.src = item.dataUri;
@@ -3167,21 +3177,19 @@ async function injectResolvedVideoFramesBatch(page, updates) {
3167
3177
  imagesToPublish.push(img);
3168
3178
  video.style.setProperty("visibility", "hidden", "important");
3169
3179
  video.style.setProperty("pointer-events", "none", "important");
3170
- injectedIds.push(item.videoId);
3180
+ if (!restyleOnly) injectedIds.push(item.videoId);
3171
3181
  }
3172
3182
  if (pendingDecodes.length > 0) {
3173
3183
  await Promise.all(pendingDecodes);
3174
3184
  }
3175
3185
  for (const img of imagesToPublish) img.style.visibility = "visible";
3176
- if (injectedIds.length > 0) {
3186
+ if (imagesToPublish.length > 0) {
3177
3187
  const redraw = window.__hf?.colorGrading?.redraw;
3178
3188
  redraw?.();
3179
3189
  }
3180
3190
  return injectedIds;
3181
3191
  },
3182
- // Build the sibling id with core's function rather than a template here,
3183
- // so the id the readers look up has exactly one definition.
3184
- updates.map((update) => ({ ...update, frameId: renderFrameIdForRenderId(update.videoId) })),
3192
+ items,
3185
3193
  [...MEDIA_VISUAL_STYLE_PROPERTIES],
3186
3194
  COLOR_GRADING_SOURCE_HIDDEN_ATTR
3187
3195
  );
@@ -6101,6 +6109,37 @@ async function waitForSubCompositionTimelines(session, page, timeoutMs, options
6101
6109
  memo.unregisteredIds = session.pendingTimelineIds ?? [];
6102
6110
  }
6103
6111
  }
6112
+ async function authorScriptsMayRegisterTimelines(runtimeAttr, authoredBegin, authoredEnd) {
6113
+ if (document.readyState !== "complete") return true;
6114
+ const memo = globalThis;
6115
+ memo.__hfAuthorScan ??= await (async () => {
6116
+ const scripts = [
6117
+ ...Array.from(document.querySelectorAll("script")),
6118
+ ...Array.from(document.querySelectorAll("template")).flatMap(
6119
+ (t) => Array.from(t.content.querySelectorAll("script"))
6120
+ )
6121
+ ].filter((script) => !script.hasAttribute(runtimeAttr));
6122
+ const mayRegister = (code) => code.includes("__timelines") || /\bimport\s*\(|^\s*import\s*[\w{*"']/m.test(code);
6123
+ for (const script of scripts) {
6124
+ if (script.type === "module") return true;
6125
+ if (!script.src) {
6126
+ const text = script.textContent ?? "";
6127
+ const authored = text.includes(authoredBegin) ? text.split(authoredBegin).slice(1).map((region) => region.split(authoredEnd)[0]).join("\n") : text;
6128
+ if (mayRegister(authored)) return true;
6129
+ continue;
6130
+ }
6131
+ const url = new URL(script.src, location.href);
6132
+ if (url.origin !== location.origin) return true;
6133
+ try {
6134
+ if (mayRegister(await (await fetch(url)).text())) return true;
6135
+ } catch {
6136
+ return true;
6137
+ }
6138
+ }
6139
+ return false;
6140
+ })();
6141
+ return memo.__hfAuthorScan;
6142
+ }
6104
6143
  async function pollSubCompositionTimelines(page, timeoutMs, {
6105
6144
  intervalMs = 150,
6106
6145
  getScriptLoadFailures,
@@ -6130,13 +6169,18 @@ async function pollSubCompositionTimelines(page, timeoutMs, {
6130
6169
  let scriptFailureBail = false;
6131
6170
  let errorSeenAt;
6132
6171
  for (; ; ) {
6133
- ready = Boolean(await page.evaluate(expression));
6134
- if (ready || shouldStop?.()) break;
6135
- const now = Date.now();
6136
- if (now >= deadline) break;
6137
6172
  const failures = getScriptLoadFailures?.() ?? [];
6138
6173
  const errors = getPageErrors?.() ?? [];
6139
6174
  const failed = failures.length > 0 ? failures : errors;
6175
+ ready = Boolean(await page.evaluate(expression)) || failed.length === 0 && !await page.evaluate(
6176
+ authorScriptsMayRegisterTimelines,
6177
+ RUNTIME_BOOTSTRAP_ATTR,
6178
+ AUTHORED_SOURCE_BEGIN,
6179
+ AUTHORED_SOURCE_END
6180
+ );
6181
+ if (ready || shouldStop?.()) break;
6182
+ const now = Date.now();
6183
+ if (now >= deadline) break;
6140
6184
  const graceMs = failures.length > 0 ? scriptFailureGraceMs : scriptErrorGraceMs;
6141
6185
  if (failed.length > 0) errorSeenAt ??= now;
6142
6186
  const sinceFailure = failures.length > 0 ? now - start : now - (errorSeenAt ?? now);
@@ -6463,8 +6507,31 @@ function classifyPageError(details, projectScripts) {
6463
6507
  const frames = (details.stackTrace?.callFrames ?? []).map((frame) => frame.url);
6464
6508
  if (frames.length === 0 && details.text.startsWith("Uncaught (in promise)")) return null;
6465
6509
  const urls = frames.length > 0 ? frames : [details.url];
6466
- const owned = (url) => url !== void 0 && (projectScripts.has(url) || url.startsWith(COMPOSITION_SOURCE_URL));
6467
- return urls.some(owned) ? `runtime-error:${firstLine}` : null;
6510
+ return urls.some((url) => isOwnedScriptUrl(url, projectScripts)) ? `runtime-error:${firstLine}` : null;
6511
+ }
6512
+ function isOwnedScriptUrl(url, projectScripts) {
6513
+ return url !== void 0 && (projectScripts.has(url) || url.startsWith(COMPOSITION_SOURCE_URL));
6514
+ }
6515
+ var LOOKUP_CALL = /\b(?:getElementById|querySelectorAll|querySelector|getElementsByClassName|getElementsByTagName)\(\s*(["'`])((?:(?!\1).)*)\1/g;
6516
+ async function describeThrowSite(client, details, projectScripts) {
6517
+ const frame = (details.stackTrace?.callFrames ?? []).find(
6518
+ (f) => isOwnedScriptUrl(f.url, projectScripts)
6519
+ );
6520
+ if (!frame) return "";
6521
+ let where = `${frame.url}:${frame.lineNumber + 1}:${frame.columnNumber + 1}`;
6522
+ try {
6523
+ await client.send("Debugger.enable");
6524
+ const { scriptSource } = await client.send("Debugger.getScriptSource", {
6525
+ scriptId: frame.scriptId
6526
+ });
6527
+ const line = scriptSource.split("\n")[frame.lineNumber] ?? "";
6528
+ const lookups = [...line.matchAll(LOOKUP_CALL)];
6529
+ if (lookups.length === 1) where += `, ${lookups[0]?.[0]})`;
6530
+ } catch {
6531
+ } finally {
6532
+ await client.send("Debugger.disable").catch(() => void 0);
6533
+ }
6534
+ return ` [thrown at: ${where}]`;
6468
6535
  }
6469
6536
  async function initializeSession(session) {
6470
6537
  const { page, serverUrl } = session;
@@ -6530,7 +6597,15 @@ async function initializeSession(session) {
6530
6597
  const url = `${serverUrl}/index.html`;
6531
6598
  const runtimeClient = await getCdpSession(page);
6532
6599
  runtimeClient.on("Runtime.exceptionThrown", ({ exceptionDetails }) => {
6533
- recordPageError(session, classifyPageError(exceptionDetails, projectScripts));
6600
+ const error = classifyPageError(exceptionDetails, projectScripts);
6601
+ recordPageError(session, error);
6602
+ if (!error) return;
6603
+ void describeThrowSite(runtimeClient, exceptionDetails, projectScripts).then((site) => {
6604
+ const i = session.pageErrors.indexOf(error);
6605
+ if (!site || i < 0) return;
6606
+ if (session.pageErrors.includes(`${error}${site}`)) session.pageErrors.splice(i, 1);
6607
+ else session.pageErrors[i] = `${error}${site}`;
6608
+ });
6534
6609
  });
6535
6610
  await runtimeClient.send("Runtime.enable");
6536
6611
  const pageNavigationTimeout = session.config?.pageNavigationTimeout ?? DEFAULT_CONFIG.pageNavigationTimeout;
@@ -11326,8 +11401,8 @@ function resolveRedirectUrl(response, currentUrl, redirects) {
11326
11401
  if (redirects >= MAX_REDIRECTS) {
11327
11402
  throw new UrlDownloadError("http_rejected", false, "Download exceeded redirect limit");
11328
11403
  }
11329
- const location = response.headers.get("location");
11330
- if (!location) {
11404
+ const location2 = response.headers.get("location");
11405
+ if (!location2) {
11331
11406
  throw new UrlDownloadError(
11332
11407
  "http_rejected",
11333
11408
  false,
@@ -11335,7 +11410,7 @@ function resolveRedirectUrl(response, currentUrl, redirects) {
11335
11410
  );
11336
11411
  }
11337
11412
  try {
11338
- return new URL(location, currentUrl).toString();
11413
+ return new URL(location2, currentUrl).toString();
11339
11414
  } catch {
11340
11415
  throw new UrlDownloadError("http_rejected", false, "Download redirect Location is invalid");
11341
11416
  }
@@ -12737,6 +12812,12 @@ function chromeGuessForUntaggedMatrix(metadata) {
12737
12812
  const hd = metadata.height >= 720 && !CHROME_BT601_UNTAGGED_CODECS.has(metadata.videoCodec);
12738
12813
  return [`setparams=colorspace=${hd ? "bt709" : "smpte170m"}`];
12739
12814
  }
12815
+ function sdrCanvasColourFilters(metadata, toneMappedToSdr = false) {
12816
+ if (!isHdrColorSpace(metadata.colorSpace)) {
12817
+ return [...chromeGuessForUntaggedMatrix(metadata), SDR_CANVAS_PASSTHROUGH_FILTER];
12818
+ }
12819
+ return toneMappedToSdr ? [SDR_CANVAS_PASSTHROUGH_FILTER] : [];
12820
+ }
12740
12821
  var EXTRACTION_SEGMENT_SECONDS = 120;
12741
12822
  function undoTickRoundingOnTheSourceFrameGrid(seek, lead) {
12742
12823
  const sinceFileStart = `(PTS*TB+${seek}-${lead})`;
@@ -12898,10 +12979,7 @@ async function extractVideoFramesRangeUnredacted(videoPath, videoId, startTime,
12898
12979
  vfFilters.push(hdrToSdrToneMapFilter(metadata.colorSpace ?? {}, frameColour));
12899
12980
  }
12900
12981
  if (toneMappedToSdr || !isHdr && !options.sdrToHdrTransfer) {
12901
- vfFilters.push(
12902
- ...isHdr ? [] : chromeGuessForUntaggedMatrix(metadata),
12903
- SDR_CANVAS_PASSTHROUGH_FILTER
12904
- );
12982
+ vfFilters.push(...sdrCanvasColourFilters(metadata, toneMappedToSdr));
12905
12983
  if (format === "jpg") {
12906
12984
  if (options.shownBox) vfFilters.push(halveToCoverScaleFilter(options.shownBox));
12907
12985
  vfFilters.push(SDR_JPEG_AS_BT601_FULL_RANGE_FILTER);
@@ -14001,7 +14079,8 @@ function getFrameIndexAtTime(extracted, globalTime, videoStart, loop = false, me
14001
14079
  const cycle = Math.max(0, resolvePlayableVideoDuration(extracted.metadata) - mediaStart);
14002
14080
  if (cycle > 0 && sourceTime >= cycle) sourceTime %= cycle;
14003
14081
  }
14004
- const frameIndex = Math.floor(sourceTime * extracted.fps + 1e-9);
14082
+ const shownTime = mediaElementTime(mediaStart + sourceTime) - mediaStart;
14083
+ const frameIndex = Math.floor(shownTime * extracted.fps);
14005
14084
  if (frameIndex < 0 || extracted.totalFrames <= 0) return null;
14006
14085
  if (isVideoHiddenBeforeStreamStart(
14007
14086
  extracted.metadata.videoStreamLeadSeconds,
@@ -14261,13 +14340,18 @@ function createVideoFrameInjector(frameLookup, config) {
14261
14340
  }
14262
14341
  }
14263
14342
  const updates = [];
14343
+ const restyleIds = [];
14264
14344
  const activeIds = /* @__PURE__ */ new Set();
14345
+ const isBlurSubSample = heldVideoTime !== void 0 && heldVideoTime !== time;
14265
14346
  if (activePayloads.size > 0) {
14266
14347
  const pendingReads = [];
14267
14348
  for (const [videoId, payload] of activePayloads) {
14268
14349
  activeIds.add(videoId);
14269
14350
  const lastFrameIndex = lastInjectedFrameByVideo.get(videoId);
14270
- if (lastFrameIndex === payload.frameIndex) continue;
14351
+ if (lastFrameIndex === payload.frameIndex) {
14352
+ if (!isBlurSubSample) restyleIds.push(videoId);
14353
+ continue;
14354
+ }
14271
14355
  pendingReads.push(
14272
14356
  frameCache.get(payload.framePath).then((dataUri) => ({ videoId, dataUri, frameIndex: payload.frameIndex }))
14273
14357
  );
@@ -14280,11 +14364,12 @@ function createVideoFrameInjector(frameLookup, config) {
14280
14364
  }
14281
14365
  }
14282
14366
  await syncVideoFrameVisibility(page, Array.from(activeIds));
14283
- if (updates.length > 0) {
14367
+ if (updates.length > 0 || restyleIds.length > 0) {
14284
14368
  const injectedIds = new Set(
14285
14369
  await injectVideoFramesBatch(
14286
14370
  page,
14287
- updates.map((u) => ({ videoId: u.videoId, dataUri: u.dataUri }))
14371
+ updates.map((u) => ({ videoId: u.videoId, dataUri: u.dataUri })),
14372
+ restyleIds
14288
14373
  )
14289
14374
  );
14290
14375
  for (const update of updates) {
@@ -18237,7 +18322,7 @@ async function launchHdrBrowser(width, height) {
18237
18322
  );
18238
18323
  }
18239
18324
  const browser = await ppt.launch({
18240
- ...sigintLaunchOptions(),
18325
+ ...ownedLaunchOptions(),
18241
18326
  headless: false,
18242
18327
  executablePath: chromePath,
18243
18328
  args: withHyperframesBrowserMarker(buildHdrChromeArgs(width, height))
@@ -18382,6 +18467,7 @@ export {
18382
18467
  formatFfmpegError,
18383
18468
  describeFfmpegFailure,
18384
18469
  runFfmpeg,
18470
+ runFfprobe,
18385
18471
  declareContentAddressedUrl,
18386
18472
  declareProbeFactsUrl,
18387
18473
  PROBE_FACTS_VERSION,
@@ -18441,6 +18527,7 @@ export {
18441
18527
  runVideoExtractionWithRetry,
18442
18528
  parseVideoElements,
18443
18529
  parseImageElements,
18530
+ sdrCanvasColourFilters,
18444
18531
  extractVideoFramesRange,
18445
18532
  isVideoPastTimelineEnd,
18446
18533
  rebaseVideoToWindow,
@@ -15,16 +15,16 @@ import {
15
15
  findFFmpeg,
16
16
  findFFprobe,
17
17
  getFFmpegInstallHint
18
- } from "./chunk-D3EZHD2D.js";
18
+ } from "./chunk-5QKJPCQ4.js";
19
19
  import {
20
20
  DEFAULT_VP9_CPU_USED,
21
21
  SDR_RGB_TO_BT709_FILTER,
22
22
  SDR_RGB_TO_TAGGED_BT709_FILTER,
23
23
  renderProvenanceArgs
24
- } from "./chunk-Y63CT2ZC.js";
24
+ } from "./chunk-RDDVQSNQ.js";
25
25
  import {
26
26
  runCancellableProcess
27
- } from "./chunk-BL4U6U52.js";
27
+ } from "./chunk-X7A7C4JS.js";
28
28
 
29
29
  // src/background-removal/pipeline.ts
30
30
  import { spawn } from "child_process";
@@ -317,7 +317,7 @@ async function decoderTransposesDimensions(inputPath) {
317
317
  }
318
318
  async function probeMedia(inputPath) {
319
319
  const isImage = inferInputKind(inputPath) === "image";
320
- const engine = await import("./src-OQRG6BT7.js");
320
+ const engine = await import("./src-4YJKYMNF.js");
321
321
  const meta = await engine.extractMediaMetadata(inputPath);
322
322
  if (isImage) {
323
323
  return { width: meta.width, height: meta.height, fps: 0, frameCount: 1 };
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-AWDFDFI3.js";
18
18
  import {
19
19
  isBlockedNetworkHost
20
- } from "./chunk-Y63CT2ZC.js";
20
+ } from "./chunk-RDDVQSNQ.js";
21
21
  import {
22
22
  DOMParser,
23
23
  parseHTML
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-DKPNNYBZ.js";
15
15
  import {
16
16
  resolveCaptureBrowserGpuMode
17
- } from "./chunk-US6JSQ2L.js";
17
+ } from "./chunk-42KN6I6A.js";
18
18
  import {
19
19
  requestCliExit
20
20
  } from "./chunk-JVBRJMOP.js";