hyperframes 0.8.185 → 0.8.186

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 (166) hide show
  1. package/dist/{add-ODTNPRGG.js → add-UGK7AZI6.js} +11 -11
  2. package/dist/{animatedGifPrep-PEP5GWOJ.js → animatedGifPrep-HPZPSB43.js} +5 -5
  3. package/dist/api.js +14 -14
  4. package/dist/{asset-EZG42XPA.js → asset-X2GTFWOY.js} +2 -2
  5. package/dist/{assetCataloger-OHAJFCA7.js → assetCataloger-5NWEG4IU.js} +5 -5
  6. package/dist/audio-7PBM5F3H.js +2317 -0
  7. package/dist/{auth-VP2SIZFN.js → auth-WABSMO46.js} +1 -1
  8. package/dist/{autoUpdate-RVSUX4SS.js → autoUpdate-6SCMLTSC.js} +2 -2
  9. package/dist/{backgroundChecks-LEHK74NS.js → backgroundChecks-XOGPAAR3.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-3X6CL7PK.js → batchRender-VR6IA77K.js} +3 -3
  12. package/dist/{beats-66VPQLSC.js → beats-3IWXLMSC.js} +5 -5
  13. package/dist/{benchmark-PBJVTOJP.js → benchmark-2SSYATCX.js} +8 -8
  14. package/dist/{browser-TPL5MWGC.js → browser-PMRN345D.js} +3 -3
  15. package/dist/{bundleWithLocalizedFonts-67MLTHKM.js → bundleWithLocalizedFonts-TT32MZBO.js} +2 -2
  16. package/dist/{capture-F3GNMRZM.js → capture-4VD6AKUJ.js} +8 -8
  17. package/dist/{capture-YYRE7EV3.js → capture-BDGYTE57.js} +2 -2
  18. package/dist/{captureCompositionFrame-PXV2ISHD.js → captureCompositionFrame-5FVLAETA.js} +13 -9
  19. package/dist/{catalog-6SDD3OHF.js → catalog-HUYZO5D7.js} +11 -11
  20. package/dist/{catch-up-CWIVA5VG.js → catch-up-SSGTR2ZT.js} +4 -4
  21. package/dist/{check-YQ6REK2S.js → check-JWUWHGM2.js} +29 -29
  22. package/dist/{checkBrowser-5XZCBRXM.js → checkBrowser-X7G6YNR7.js} +26 -26
  23. package/dist/{chunk-RUEGYANA.js → chunk-22QKQDEE.js} +10 -10
  24. package/dist/{chunk-IPDKZ5IN.js → chunk-27H2363S.js} +1 -1
  25. package/dist/{chunk-2TAS5O4P.js → chunk-2II34JPM.js} +108 -20
  26. package/dist/{chunk-KQ4JEJLF.js → chunk-2PZZMAME.js} +8 -7
  27. package/dist/{chunk-7RAY4WZP.js → chunk-3YHGQJI6.js} +3 -3
  28. package/dist/{chunk-BRAPBUPQ.js → chunk-4AFNEKU7.js} +1 -1
  29. package/dist/{chunk-CX3USX23.js → chunk-4NTW45W5.js} +3 -3
  30. package/dist/{chunk-K2ZKXTVL.js → chunk-4XFFJAWS.js} +1 -1
  31. package/dist/{chunk-6GPR3G3C.js → chunk-5ZMIVTHN.js} +1 -1
  32. package/dist/{chunk-TAX2ZJAP.js → chunk-5ZMXGNGC.js} +9 -9
  33. package/dist/{chunk-H5SM5PJI.js → chunk-6IOBAOU7.js} +1 -1
  34. package/dist/{chunk-WQLKDL35.js → chunk-77QM6YRQ.js} +1 -1
  35. package/dist/{chunk-SQVRXHOW.js → chunk-7AUMTARQ.js} +3 -3
  36. package/dist/{chunk-I3IH5MV5.js → chunk-7M7TMM4S.js} +77 -2
  37. package/dist/{chunk-37CNYTQQ.js → chunk-7MLFYMFB.js} +1 -1
  38. package/dist/{chunk-55YELV7B.js → chunk-7MVODWQF.js} +1 -1
  39. package/dist/{chunk-X6L6MD5B.js → chunk-ACLABKEF.js} +6 -6
  40. package/dist/{chunk-Q47FAYYK.js → chunk-BRTDLVK3.js} +1 -1
  41. package/dist/{chunk-OAG47RE6.js → chunk-DQZMJS2P.js} +1 -1
  42. package/dist/{chunk-G2UANIDX.js → chunk-DTXDQ6OP.js} +1 -1
  43. package/dist/{chunk-I45HL3VP.js → chunk-EZINX6HH.js} +2 -2
  44. package/dist/{chunk-IVEFOUZI.js → chunk-FCWFV4P7.js} +36 -12
  45. package/dist/{chunk-ISTRDGIX.js → chunk-FRLTKTOR.js} +1 -1
  46. package/dist/{chunk-6RIZY7OP.js → chunk-GTMBII7X.js} +1 -1
  47. package/dist/{chunk-FX6RUJUY.js → chunk-HOFX63F2.js} +3 -3
  48. package/dist/{chunk-5GUKZRQN.js → chunk-HZ7M2MZA.js} +1 -1
  49. package/dist/{chunk-HXUTX5GR.js → chunk-ID5AJ4L3.js} +2 -2
  50. package/dist/{chunk-PHMBMOXF.js → chunk-K6KBOORN.js} +48 -4
  51. package/dist/{chunk-F3OPUWQX.js → chunk-KNLSYCI5.js} +7 -7
  52. package/dist/{chunk-I7QMXZSB.js → chunk-LDW3KVGK.js} +2 -2
  53. package/dist/{chunk-5UDRPPN2.js → chunk-MY6CVBDD.js} +7 -4
  54. package/dist/{chunk-XWC7CNPY.js → chunk-NPDPDEPP.js} +1 -1
  55. package/dist/{chunk-7PS6RVWD.js → chunk-PEIV2SOG.js} +1 -1
  56. package/dist/{chunk-H6UY725W.js → chunk-R6IGQ5NO.js} +2 -2
  57. package/dist/{chunk-A6QCO474.js → chunk-RFJ6SX4U.js} +5 -5
  58. package/dist/{chunk-KROXPHXX.js → chunk-RNZEQTWZ.js} +2 -8
  59. package/dist/{chunk-6ASIXMFP.js → chunk-ROWEDRVX.js} +1 -1
  60. package/dist/{chunk-HDIRZGK4.js → chunk-RPUIMFHF.js} +1 -1
  61. package/dist/{chunk-EMSDWBG3.js → chunk-RVZNSKRH.js} +2 -2
  62. package/dist/{chunk-IDGLGXPA.js → chunk-T4RP55P2.js} +1 -1
  63. package/dist/{chunk-EMAWIZ54.js → chunk-TH7J3JZ5.js} +57 -20
  64. package/dist/{chunk-VHZ6DL3M.js → chunk-TMK4Q7JA.js} +10 -7
  65. package/dist/{chunk-UPR3MU6Z.js → chunk-TQ2RRB5V.js} +1 -1
  66. package/dist/{chunk-IDFNKFPL.js → chunk-U4BMRIE6.js} +16 -7
  67. package/dist/{chunk-HHSJJFVM.js → chunk-U7QTMRLW.js} +2 -2
  68. package/dist/{chunk-TOI35GN2.js → chunk-UAJCTEK2.js} +1 -1
  69. package/dist/{chunk-ESBMUZXZ.js → chunk-UJZT6HNN.js} +1 -1
  70. package/dist/chunk-UOZX5W5T.js +3852 -0
  71. package/dist/{chunk-FFJ5TDRD.js → chunk-VHBBV5DH.js} +10 -3
  72. package/dist/{chunk-SKYPMHQC.js → chunk-WHMFW5ET.js} +2 -2
  73. package/dist/{chunk-LYKSTRAY.js → chunk-WLHNIIXU.js} +3 -3
  74. package/dist/{chunk-RTBSA3EA.js → chunk-Y2M6XSNK.js} +1 -1
  75. package/dist/{chunk-4CTNDBE3.js → chunk-YNH6ERDL.js} +2 -2
  76. package/dist/{chunk-D42NU3DZ.js → chunk-YQICCAVA.js} +1 -1
  77. package/dist/{chunk-PMMQRJDE.js → chunk-YRAJDFIN.js} +1 -1
  78. package/dist/{chunk-BH7TTIPN.js → chunk-Z5233OAN.js} +4 -4
  79. package/dist/{chunk-K73RJB23.js → chunk-ZKBW7NU2.js} +2 -2
  80. package/dist/{chunk-J5XEZ24I.js → chunk-ZVBEGBII.js} +3 -3
  81. package/dist/{clean-7J6ZCCGV.js → clean-IM2JIAUT.js} +13 -13
  82. package/dist/cli.js +53 -53
  83. package/dist/{cloud-7IJCJCDD.js → cloud-6IPBCJSX.js} +4 -4
  84. package/dist/{cloudrun-UNZRIIDB.js → cloudrun-MWZ6S2I2.js} +4 -4
  85. package/dist/{compare-Q7VW5JZT.js → compare-WD7A2TV5.js} +23 -23
  86. package/dist/{compiler-KPHYGFXL.js → compiler-2EKSMC3I.js} +2 -2
  87. package/dist/{component-UUBREJKN.js → component-JKALWH36.js} +3 -3
  88. package/dist/{compositions-T4FTKIDP.js → compositions-643NAG4A.js} +9 -9
  89. package/dist/{delete-WZQF2IIA.js → delete-EASPXKHQ.js} +2 -2
  90. package/dist/{deploy-JU7A3XNC.js → deploy-CDKCQ5MX.js} +1 -1
  91. package/dist/{dist-ULGTPSU4.js → dist-F6FOKRSU.js} +6 -4
  92. package/dist/{doctor-VSNGRKXJ.js → doctor-7XUVYDJQ.js} +9 -9
  93. package/dist/{events-CRW2DYUT.js → events-5TTPYBKG.js} +2 -2
  94. package/dist/{events-E63YBUL2.js → events-TULV6D3G.js} +3 -3
  95. package/dist/{feedback-OSZWVR6N.js → feedback-4FTPWM6P.js} +6 -6
  96. package/dist/{ffmpeg-JLH3Z7G7.js → ffmpeg-MP7ZVYLZ.js} +5 -5
  97. package/dist/{figma-2BQNNR53.js → figma-B7LFWYKO.js} +3 -3
  98. package/dist/fontLocalizeCli.js +7 -7
  99. package/dist/{get-P2XI53QW.js → get-F7W4AQ2V.js} +2 -2
  100. package/dist/{gpuPolicy-NTKQJY75.js → gpuPolicy-NSNVDFXC.js} +5 -5
  101. package/dist/{grade-compare-OYASIHIB.js → grade-compare-6QXDTLS2.js} +24 -24
  102. package/dist/{help-HK6K2N4G.js → help-RJAA4O74.js} +1 -1
  103. package/dist/{history-JMTYKLXW.js → history-OOQBDVV5.js} +6 -6
  104. package/dist/hyperframe.manifest.json +1 -1
  105. package/dist/hyperframe.runtime.iife.js +65 -65
  106. package/dist/hyperframes-player.global.js +1 -1
  107. package/dist/{info-AW7CIVRE.js → info-5OGGYYLO.js} +7 -7
  108. package/dist/{init-6KIDG4LB.js → init-DM3TJKW2.js} +63 -45
  109. package/dist/{inspect-B7BLYMRZ.js → inspect-FECQCLS5.js} +24 -24
  110. package/dist/{installer-ZP2LQZUQ.js → installer-WOG4VORV.js} +4 -4
  111. package/dist/{keyframes-EQ36A5JE.js → keyframes-SZHWUF5Y.js} +6 -6
  112. package/dist/{lambda-E6VURLIS.js → lambda-JG2ZRGMC.js} +6 -6
  113. package/dist/{layout-XYC64QQQ.js → layout-7ACF7ZKC.js} +24 -24
  114. package/dist/{lint-V5DJYWBX.js → lint-ZCQGMILV.js} +6 -6
  115. package/dist/{list-RUGVRTVD.js → list-MH2X3Y2T.js} +2 -2
  116. package/dist/{login-ZTKGKXGS.js → login-CK46WX5U.js} +4 -4
  117. package/dist/{manager-JUP7PM6N.js → manager-GXTPNJVW.js} +6 -6
  118. package/dist/{media-treatment-VIUPK4OR.js → media-treatment-EH2AT34Z.js} +11 -11
  119. package/dist/{models-LJS2HBOZ.js → models-D5XP2UK6.js} +9 -9
  120. package/dist/{motionShot-3UAXZ7SN.js → motionShot-UR7D3SRQ.js} +12 -12
  121. package/dist/{normalize-4UDISLPL.js → normalize-3AYFSN2F.js} +1 -1
  122. package/dist/{normalize-audio-SBYI4YIH.js → normalize-audio-635JOR5W.js} +4 -4
  123. package/dist/{open-S27TUD3A.js → open-6WE5WFVM.js} +11 -11
  124. package/dist/{parakeetRunner-ETLMLJ4L.js → parakeetRunner-STHZPG32.js} +10 -10
  125. package/dist/{pipeline-I2M22M24.js → pipeline-LVEKRETU.js} +6 -6
  126. package/dist/{play-COJU6VJK.js → play-W6TDW4FE.js} +16 -16
  127. package/dist/{preflight-FZ24NCHH.js → preflight-LIMQXLR7.js} +6 -6
  128. package/dist/{present-YAHKLC5D.js → present-RX5QX6UR.js} +12 -12
  129. package/dist/{preview-KQOEU5YE.js → preview-KIWTWK63.js} +16 -16
  130. package/dist/{producer-DTNNG4T6.js → producer-TSNKSCUM.js} +1 -1
  131. package/dist/{projectConfig-4A76VYUP.js → projectConfig-NCP7JRH4.js} +6 -6
  132. package/dist/{publication-SQPMC2W3.js → publication-5W5UZWGC.js} +2 -2
  133. package/dist/{publish-QUEJBGGT.js → publish-7WR4XJ6I.js} +7 -7
  134. package/dist/{remove-background-FP2ETAQH.js → remove-background-43JGBRWQ.js} +7 -7
  135. package/dist/{render-BIFIL4U6.js → render-456HCO6O.js} +26 -26
  136. package/dist/{render-P664SMC7.js → render-7T44HIM6.js} +3 -3
  137. package/dist/{render-GQFXJWLV.js → render-WHMLYIOI.js} +13 -13
  138. package/dist/{render-batch-ZCPMYH6Z.js → render-batch-LURBJTBV.js} +3 -3
  139. package/dist/{resolver-BUC2GFZQ.js → resolver-MBIW4VC4.js} +4 -4
  140. package/dist/{sherpa-HFT6XEP6.js → sherpa-5J2AALED.js} +9 -9
  141. package/dist/{skills-3WEVO3NU.js → skills-UHOXOGGF.js} +5 -5
  142. package/dist/{skillsUpdateCheck-BFPWFOK5.js → skillsUpdateCheck-PDZIFUJE.js} +3 -3
  143. package/dist/{snapshot-WDQ6S7CJ.js → snapshot-PFV7ALLH.js} +33 -30
  144. package/dist/{src-RZ574OKP.js → src-DCVSEODX.js} +4 -4
  145. package/dist/{src-NPR2JZOJ.js → src-XK5YIR6L.js} +6 -6
  146. package/dist/{staticProjectServer-FTGTEZI4.js → staticProjectServer-4IE4G4JO.js} +12 -12
  147. package/dist/studio/assets/{hyperframes-player-CoOdf435.js → hyperframes-player-B_skzvYC.js} +1 -1
  148. package/dist/studio/assets/{index-CR85xg2x.js → index-CgLbvCUo.js} +1 -1
  149. package/dist/studio/assets/{index-C_6rTpaB.js → index-Dn5FAk2e.js} +99 -99
  150. package/dist/studio/index.html +1 -1
  151. package/dist/{studio-api-TAWB7B23.js → studio-api-JMWYU7KF.js} +6 -6
  152. package/dist/{studioServer-HRQGJTBU.js → studioServer-BWLSTGIG.js} +43 -42
  153. package/dist/{telemetry-QZ6HJF4W.js → telemetry-JCU3AV7W.js} +3 -3
  154. package/dist/{timeline-IKUEW42T.js → timeline-BCIFQYOM.js} +14 -14
  155. package/dist/{tokens-AUGUEWHS.js → tokens-7IXKALMQ.js} +2 -2
  156. package/dist/{transcribe-7734CG3N.js → transcribe-HW7HGJ4V.js} +15 -15
  157. package/dist/{transcribe-FWU6EMEO.js → transcribe-ZUQD3B32.js} +8 -8
  158. package/dist/{updateCheck-VIPQ3FPW.js → updateCheck-Z6LNEK7B.js} +2 -2
  159. package/dist/{upgrade-4VNDQTVO.js → upgrade-JYH72JGL.js} +2 -2
  160. package/dist/{urlDownloader-6CXL4CL7.js → urlDownloader-WKLFHSUH.js} +4 -4
  161. package/dist/{validate-QWCMVWID.js → validate-QCC27YYI.js} +18 -18
  162. package/dist/{video-245Q5WN4.js → video-EZ7ONY6L.js} +5 -5
  163. package/dist/warmCheck.js +31 -31
  164. package/package.json +1 -1
  165. package/dist/audio-65R4T74I.js +0 -1154
  166. package/dist/chunk-3NPOFC43.js +0 -3805
@@ -26,7 +26,7 @@ import {
26
26
  renderFrameIdForRenderId,
27
27
  resolveAuthoredTimingWindow,
28
28
  toFps
29
- } from "./chunk-KROXPHXX.js";
29
+ } from "./chunk-RNZEQTWZ.js";
30
30
  import {
31
31
  AUDIO_GROUP_RENDER_ID_ATTR,
32
32
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -37,7 +37,10 @@ import {
37
37
  HF_COLOR_GRADING_CANVAS_ID_PREFIX,
38
38
  MEDIA_DURATION_CLAMP_EPSILON_SECONDS,
39
39
  MEDIA_RENDER_ID_ATTR,
40
+ PAGE_DEVICE_SCALE_GLOBAL,
41
+ PAGE_MOTION_BLUR_OFF_GLOBAL,
40
42
  VOLUME_TARGET,
43
+ acceleratedCanvasTrackerSource,
41
44
  enabledAudioFxNodes,
42
45
  fxAutomationTarget,
43
46
  injectScriptsIntoHtml,
@@ -56,7 +59,7 @@ import {
56
59
  shiftRateLane,
57
60
  sourceTimeAt,
58
61
  timeAtSourceTime
59
- } from "./chunk-3NPOFC43.js";
62
+ } from "./chunk-UOZX5W5T.js";
60
63
  import {
61
64
  clampAudioGain,
62
65
  isAudibleVideoElement
@@ -2506,6 +2509,68 @@ var MotionBlurAccumulator = class {
2506
2509
  }
2507
2510
  };
2508
2511
 
2512
+ // ../engine/src/services/pageMotionBlur.ts
2513
+ function pageOffReason(options) {
2514
+ if (options.motionBlur) return "engine-motion-blur";
2515
+ if (options.pageMotionBlur === "off") return "preview-unsupported";
2516
+ return options.pageMotionBlur ?? null;
2517
+ }
2518
+ async function installPageMotionBlur(page, options) {
2519
+ await page.evaluateOnNewDocument(acceleratedCanvasTrackerSource());
2520
+ const scale = options.deviceScaleFactor ?? 1;
2521
+ if (scale > 1) {
2522
+ await page.evaluateOnNewDocument(
2523
+ (key, v) => {
2524
+ window[key] = v;
2525
+ },
2526
+ PAGE_DEVICE_SCALE_GLOBAL,
2527
+ scale
2528
+ );
2529
+ }
2530
+ const off = pageOffReason(options);
2531
+ if (!off) return;
2532
+ await page.evaluateOnNewDocument(
2533
+ (key, v) => {
2534
+ window[key] = v;
2535
+ },
2536
+ PAGE_MOTION_BLUR_OFF_GLOBAL,
2537
+ off
2538
+ );
2539
+ }
2540
+ async function readPageMotionBlur(page) {
2541
+ return page.evaluate(() => {
2542
+ const api = Reflect.get(window, "__hfMotionBlur");
2543
+ const report = api && typeof api === "object" ? Reflect.get(api, "report") : null;
2544
+ const got = typeof report === "function" ? report() : null;
2545
+ if (!got || typeof got !== "object") return null;
2546
+ return {
2547
+ state: String(Reflect.get(got, "state")),
2548
+ code: String(Reflect.get(got, "reasonCode")),
2549
+ movers: Number(Reflect.get(got, "movers")),
2550
+ failedFrames: Number(Reflect.get(got, "failedFrames")) || 0
2551
+ };
2552
+ });
2553
+ }
2554
+ var formatPageMotionBlur = (r) => `[motion-blur] ${r.state} reasonCode=${r.code} movers=${r.movers} failedFrames=${r.failedFrames}`;
2555
+ async function describePageMotionBlur(page) {
2556
+ const r = await readPageMotionBlur(page);
2557
+ return r && formatPageMotionBlur(r);
2558
+ }
2559
+ async function describePageMotionBlurAtEnd(page, timeoutMs = 1500) {
2560
+ let timer;
2561
+ const stuck = new Promise((resolve) => {
2562
+ timer = setTimeout(() => resolve(null), timeoutMs);
2563
+ });
2564
+ try {
2565
+ const r = await Promise.race([readPageMotionBlur(page), stuck]);
2566
+ return r && r.failedFrames > 0 ? `${formatPageMotionBlur(r)} (session end)` : null;
2567
+ } catch {
2568
+ return null;
2569
+ } finally {
2570
+ clearTimeout(timer);
2571
+ }
2572
+ }
2573
+
2509
2574
  // ../engine/src/services/videoFrameTransport.ts
2510
2575
  import { randomUUID } from "crypto";
2511
2576
  var base64ImagePrefix = /^data:(image\/[\w.+-]+);base64,/;
@@ -5437,6 +5502,7 @@ async function constructCaptureSession(input) {
5437
5502
  }
5438
5503
  }, variablesJson);
5439
5504
  }
5505
+ await installPageMotionBlur(page, options);
5440
5506
  const browserVersion = await browser.version();
5441
5507
  const sessionOptions = resolveCaptureSessionOptions(options, browserVersion);
5442
5508
  const expectedMajor = config?.expectedChromiumMajor;
@@ -6614,6 +6680,7 @@ async function createStaticVerificationPage(session) {
6614
6680
  window.__hfVariables = JSON.parse(json);
6615
6681
  }, variablesJson);
6616
6682
  }
6683
+ await installPageMotionBlur(page, session.options);
6617
6684
  await page.setViewport({
6618
6685
  width: session.options.width,
6619
6686
  height: session.options.height,
@@ -7159,6 +7226,10 @@ async function captureFrameCore(session, frameIndex, time) {
7159
7226
  session.capturePerf.screenshotMs += screenshotMs;
7160
7227
  session.capturePerf.totalMs += captureTimeMs;
7161
7228
  session.capturePerf.frameMs.push(captureTimeMs);
7229
+ if (session.capturePerf.frames === 1) {
7230
+ const blur = await describePageMotionBlur(session.page).catch(() => null);
7231
+ if (blur) console.log(blur);
7232
+ }
7162
7233
  if (session.staticFrames) {
7163
7234
  session.lastFrameBuffer = buffer;
7164
7235
  session.lastFrameAbsoluteIndex = absFrameIndex;
@@ -7371,6 +7442,10 @@ async function closeCaptureSession(session) {
7371
7442
  session.chromeMemory.stop();
7372
7443
  await session.chromeMemory.sampleOnce();
7373
7444
  }
7445
+ if (session.page && !session.pageReleased) {
7446
+ const blur = await describePageMotionBlurAtEnd(session.page);
7447
+ if (blur) console.log(blur);
7448
+ }
7374
7449
  const reused = session.staticDedupCount ?? 0;
7375
7450
  if (session.staticFrames && reused > 0) {
7376
7451
  const captured = session.capturePerf.frames;
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  formatVariableValidationIssue,
21
21
  validateVariables
22
- } from "./chunk-KROXPHXX.js";
22
+ } from "./chunk-RNZEQTWZ.js";
23
23
  import {
24
24
  extractCompositionMetadata
25
25
  } from "./chunk-B2A56S5C.js";
@@ -10,7 +10,7 @@ import {
10
10
  isDevice,
11
11
  isQuality,
12
12
  render
13
- } from "./chunk-LYKSTRAY.js";
13
+ } from "./chunk-WLHNIIXU.js";
14
14
 
15
15
  // src/api/removeBackground.ts
16
16
  import { resolve } from "path";
@@ -6,32 +6,32 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  parakeetRunner
9
- } from "./chunk-XWC7CNPY.js";
9
+ } from "./chunk-NPDPDEPP.js";
10
10
  import {
11
11
  DecodeCancelled,
12
12
  prepareSherpaWav,
13
13
  sherpaUnsupportedReason,
14
14
  transcribeWithSherpa
15
- } from "./chunk-CX3USX23.js";
15
+ } from "./chunk-4NTW45W5.js";
16
16
  import {
17
17
  initialModelForLanguage,
18
18
  transcribe
19
- } from "./chunk-7RAY4WZP.js";
19
+ } from "./chunk-3YHGQJI6.js";
20
20
  import {
21
21
  createRenderCancellationScope,
22
22
  stoppedByCancelSignal
23
- } from "./chunk-IDGLGXPA.js";
23
+ } from "./chunk-T4RP55P2.js";
24
24
  import {
25
25
  DEFAULT_MODEL,
26
26
  findWhisper,
27
27
  isWhisperUnavailable
28
- } from "./chunk-6ASIXMFP.js";
28
+ } from "./chunk-ROWEDRVX.js";
29
29
  import {
30
30
  formatSrt,
31
31
  formatVtt,
32
32
  loadTranscript,
33
33
  patchCaptionHtml
34
- } from "./chunk-VHZ6DL3M.js";
34
+ } from "./chunk-TMK4Q7JA.js";
35
35
  import {
36
36
  normalizeErrorMessage
37
37
  } from "./chunk-KNU5COPB.js";
@@ -37,7 +37,7 @@ import {
37
37
  stripEmbeddedRuntimeScripts,
38
38
  styleElementsFor,
39
39
  warnUnknownEnumValues
40
- } from "./chunk-3NPOFC43.js";
40
+ } from "./chunk-UOZX5W5T.js";
41
41
  import {
42
42
  cssVariableName
43
43
  } from "./chunk-VC76R6W2.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  withOwner
9
- } from "./chunk-PHMBMOXF.js";
9
+ } from "./chunk-K6KBOORN.js";
10
10
  import {
11
11
  HistoryBusyError,
12
12
  beginArtifactCapture
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  DISTRIBUTED_FPS,
12
12
  isDistributedFps
13
- } from "./chunk-KROXPHXX.js";
13
+ } from "./chunk-RNZEQTWZ.js";
14
14
  import {
15
15
  parseHTML
16
16
  } from "./chunk-SDYDNHEE.js";
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  trackLintReport,
9
9
  trackLintRuleStreak
10
- } from "./chunk-WQLKDL35.js";
10
+ } from "./chunk-77QM6YRQ.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-H5SM5PJI.js";
13
+ } from "./chunk-6IOBAOU7.js";
14
14
  import {
15
15
  LINT_RULE_COUNT,
16
16
  LINT_RULE_GROUP_COUNTS
@@ -8,7 +8,7 @@ import {
8
8
  EncoderInterruptedError,
9
9
  encoderFailureError,
10
10
  prepareAnimatedGifInputs
11
- } from "./chunk-K73RJB23.js";
11
+ } from "./chunk-ZKBW7NU2.js";
12
12
  import {
13
13
  GENERIC_FAMILIES,
14
14
  collectFontFamilyCustomProperties,
@@ -154,7 +154,7 @@ import {
154
154
  validateEngineConfigSnapshot,
155
155
  verifyDiskDrawElementSamples,
156
156
  writeCapturedFrame
157
- } from "./chunk-I3IH5MV5.js";
157
+ } from "./chunk-7M7TMM4S.js";
158
158
  import {
159
159
  DISTRIBUTED_FPS,
160
160
  HF_VFX_ATTR,
@@ -169,7 +169,7 @@ import {
169
169
  parseVfxChain,
170
170
  resolveAuthoredTimingWindow,
171
171
  toFps
172
- } from "./chunk-KROXPHXX.js";
172
+ } from "./chunk-RNZEQTWZ.js";
173
173
  import {
174
174
  assignBundledRuntimeCompositionIds,
175
175
  buildVariablesByCompScript,
@@ -182,7 +182,7 @@ import {
182
182
  isTemplateEntry,
183
183
  parsesAsScript,
184
184
  prepareFlattenedInnerRoot
185
- } from "./chunk-Q47FAYYK.js";
185
+ } from "./chunk-BRTDLVK3.js";
186
186
  import {
187
187
  COMPOSITION_SOURCE_URL,
188
188
  HF_COLOR_GRADING_ATTR,
@@ -210,7 +210,7 @@ import {
210
210
  shouldClampResolvedMediaDuration,
211
211
  sourceTimeAt,
212
212
  styleElementsFor
213
- } from "./chunk-3NPOFC43.js";
213
+ } from "./chunk-UOZX5W5T.js";
214
214
  import {
215
215
  MAX_AUDIO_GAIN
216
216
  } from "./chunk-UJKQWGFF.js";
@@ -5694,7 +5694,10 @@ function stripCompilerMountBootstrap(source) {
5694
5694
  ""
5695
5695
  );
5696
5696
  }
5697
- function detectRenderModeHints(html) {
5697
+ function runtimeRoot(document2) {
5698
+ return document2.querySelector('[data-composition-id][data-root="true"]') ?? document2.querySelector("[data-composition-id]");
5699
+ }
5700
+ function detectRenderModeHints(html, pageMotionBlur) {
5698
5701
  const reasons = [];
5699
5702
  const { document: document2 } = parseHTML(html);
5700
5703
  if (document2.querySelector("canvas[layoutsubtree]")) {
@@ -5702,6 +5705,11 @@ function detectRenderModeHints(html) {
5702
5705
  code: "htmlInCanvas",
5703
5706
  message: "Detected html-in-canvas API (layoutsubtree canvas). Chrome does not support concurrent drawElementImage across multiple workers; render is pinned to a single worker."
5704
5707
  });
5708
+ } else if (pageMotionBlur !== "off" && runtimeRoot(document2)?.getAttribute("data-motion-blur") === "on") {
5709
+ reasons.push({
5710
+ code: "captureMotionBlur",
5711
+ message: 'Detected capture motion blur (data-motion-blur="on"), which draws each frame with html-in-canvas; routed through screenshot capture mode.'
5712
+ });
5705
5713
  }
5706
5714
  if (document2.querySelector("iframe")) {
5707
5715
  reasons.push({
@@ -6733,7 +6741,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
6733
6741
  /(<(?:video|audio)\b[^>]*?)\s+preload\s*=\s*["']none["']/gi,
6734
6742
  "$1"
6735
6743
  );
6736
- const renderModeHints = detectRenderModeHints(sanitizedHtml);
6744
+ const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
6737
6745
  const hasShaderTransitions = detectShaderTransitionUsage(sanitizedHtml);
6738
6746
  const usesThreeDTransforms = detectThreeDTransformUsage(sanitizedHtml);
6739
6747
  const usesMixBlendMode = detectMixBlendModeUsage(sanitizedHtml);
@@ -7218,6 +7226,7 @@ async function runCompileStage(input) {
7218
7226
  abortSignal,
7219
7227
  variables: input.variables,
7220
7228
  urlByAbsentLocalPath: input.urlByAbsentLocalPath,
7229
+ pageMotionBlur: input.pageMotionBlur,
7221
7230
  animatedGifCacheDir: cfg.extractCacheDir ? join13(cfg.extractCacheDir, "animated-gif") : void 0,
7222
7231
  ffmpegProcessTimeout: cfg.ffmpegProcessTimeout
7223
7232
  });
@@ -7501,6 +7510,7 @@ async function runProbeStage(input) {
7501
7510
  variables: job.config.variables,
7502
7511
  deviceScaleFactor,
7503
7512
  motionBlur,
7513
+ pageMotionBlur: job.config.pageMotionBlur,
7504
7514
  requiresWebGpu: compositionRequiresWebGpu(compiled.html),
7505
7515
  subTimelineWaitMemo
7506
7516
  };
@@ -10670,6 +10680,10 @@ function assertMotionBlurSupported(motionBlur, route) {
10670
10680
  `[MotionBlur] sub-frame motion blur is not supported on the "${route}" capture route: ${reason}`
10671
10681
  );
10672
10682
  }
10683
+ function pageMotionBlurForRoute(route) {
10684
+ if (route.hasHdrContent) return "hdr-render";
10685
+ return route.useLayeredComposite ? "layered-composite" : void 0;
10686
+ }
10673
10687
 
10674
10688
  // ../producer/src/services/render/outputScaleRoute.ts
10675
10689
  var UNSUPPORTED_REASON2 = {
@@ -11744,7 +11758,8 @@ async function executeRenderPipeline(input) {
11744
11758
  needsAlpha,
11745
11759
  log,
11746
11760
  assertNotAborted,
11747
- variables: job.config.variables
11761
+ variables: job.config.variables,
11762
+ pageMotionBlur: job.config.pageMotionBlur
11748
11763
  })
11749
11764
  );
11750
11765
  let compiled = compileResult.compiled;
@@ -12048,14 +12063,17 @@ async function executeRenderPipeline(input) {
12048
12063
  variables: job.config.variables,
12049
12064
  deviceScaleFactor,
12050
12065
  motionBlur: job.config.motionBlur,
12066
+ pageMotionBlur: job.config.pageMotionBlur,
12051
12067
  ...videoCaptureBeyondViewport !== void 0 ? { captureBeyondViewport: videoCaptureBeyondViewport } : {}
12052
12068
  };
12053
12069
  resolvedCaptureBeyondViewport = captureOptions.captureBeyondViewport ?? resolvedCaptureBeyondViewport;
12054
12070
  if (resolvedCaptureBeyondViewport !== void 0) {
12055
12071
  updateCaptureObservability({ captureBeyondViewport: resolvedCaptureBeyondViewport });
12056
12072
  }
12073
+ let routePageMotionBlur;
12057
12074
  const buildCaptureOptions = () => ({
12058
12075
  ...captureOptions,
12076
+ ...routePageMotionBlur ? { pageMotionBlur: routePageMotionBlur } : {},
12059
12077
  videoMetadataHints,
12060
12078
  skipReadinessVideoIds: videoReadinessSkipIds,
12061
12079
  subTimelineWaitMemo,
@@ -12089,6 +12107,7 @@ async function executeRenderPipeline(input) {
12089
12107
  const nativeHdrIds = /* @__PURE__ */ new Set([...nativeHdrVideoIds, ...nativeHdrImageIds]);
12090
12108
  const hasHdrContent = Boolean(effectiveHdr && nativeHdrIds.size > 0);
12091
12109
  if (hasHdrContent) assertOutputScaleSupported(deviceScaleFactor, "hdr_layered");
12110
+ routePageMotionBlur = pageMotionBlurForRoute({ hasHdrContent, useLayeredComposite: false });
12092
12111
  const deSingleMinFramesRaw = process.env.HF_DE_SINGLE_MIN_FRAMES;
12093
12112
  const deSingleMinFramesNum = deSingleMinFramesRaw === void 0 || deSingleMinFramesRaw.trim() === "" ? 900 : Number(deSingleMinFramesRaw);
12094
12113
  const deSingleMinFrames = Number.isFinite(deSingleMinFramesNum) ? deSingleMinFramesNum : 900;
@@ -12491,6 +12510,7 @@ async function executeRenderPipeline(input) {
12491
12510
  hasShaderTransitions: compiled.hasShaderTransitions && !isGif,
12492
12511
  isPngSequence
12493
12512
  });
12513
+ routePageMotionBlur = pageMotionBlurForRoute({ hasHdrContent, useLayeredComposite });
12494
12514
  const inversionFallback = resolveInversionRetryPlan({
12495
12515
  deWorkerInversion,
12496
12516
  preInversionWorkerCount: preRoutingWorkerCount,
@@ -13642,7 +13662,8 @@ function buildSyntheticRenderJob(input) {
13642
13662
  hdrMode: input.hdrMode,
13643
13663
  strictness: input.strictness,
13644
13664
  producerConfig: input.producerConfig,
13645
- variables: input.variables
13665
+ variables: input.variables,
13666
+ pageMotionBlur: "off"
13646
13667
  };
13647
13668
  return createRenderJob(renderConfig);
13648
13669
  }
@@ -13766,6 +13787,7 @@ function buildChunkCaptureOptions(input) {
13766
13787
  skipReadinessVideoIds: input.skipReadinessVideoIds,
13767
13788
  videoMetadataHints: input.videoMetadataHints,
13768
13789
  ...videoCaptureBeyondViewport !== void 0 ? { captureBeyondViewport: videoCaptureBeyondViewport } : {},
13790
+ pageMotionBlur: "distributed-render",
13769
13791
  // A fixed warmup count keeps `beginFrameTimeTicks` host-independent.
13770
13792
  lockWarmupTicks: true,
13771
13793
  requiresWebGpu: compositionRequiresWebGpu(input.html)
@@ -15427,7 +15449,8 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
15427
15449
  // Distributed renders must not capture host-specific system fonts —
15428
15450
  // the Lambda/worker filesystem won't have the same fonts installed.
15429
15451
  allowSystemFontCapture: false,
15430
- variables: config.variables
15452
+ variables: config.variables,
15453
+ pageMotionBlur: job.config.pageMotionBlur
15431
15454
  });
15432
15455
  logPlanStage(log, "compile", stageStarted);
15433
15456
  let compiled = compileResult.compiled;
@@ -15470,7 +15493,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
15470
15493
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
15471
15494
  if (probeResult.probeSession) {
15472
15495
  try {
15473
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-RZ574OKP.js");
15496
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-DCVSEODX.js");
15474
15497
  await closeCaptureSession2(probeResult.probeSession);
15475
15498
  } catch (err) {
15476
15499
  log.warn("[plan] probe session close failed", {
@@ -16138,6 +16161,7 @@ function assertRequestOptionScalars(options) {
16138
16161
  }
16139
16162
  assertOptionalEnum(options, "strictness", ["strict", "best-effort"]);
16140
16163
  assertOptionalEnum(options, "hdrMode", ["auto", "force-hdr", "force-sdr"]);
16164
+ assertOptionalEnum(options, "pageMotionBlur", ["off"]);
16141
16165
  if (options.videoFrameFormat !== void 0 && !isVideoFrameFormat(options.videoFrameFormat)) {
16142
16166
  throw new Error("Render request videoFrameFormat is invalid");
16143
16167
  }
@@ -17130,7 +17154,7 @@ function startServer(options = {}) {
17130
17154
  });
17131
17155
  async function shutdown(signal) {
17132
17156
  log.info(`Received ${signal}, shutting down`);
17133
- const { drainBrowserPool } = await import("./src-RZ574OKP.js");
17157
+ const { drainBrowserPool } = await import("./src-DCVSEODX.js");
17134
17158
  await drainBrowserPool().catch(() => {
17135
17159
  });
17136
17160
  const handle = await Promise.race([
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-ISN5GRYI.js";
18
18
  import {
19
19
  VERSION
20
- } from "./chunk-I7QMXZSB.js";
20
+ } from "./chunk-LDW3KVGK.js";
21
21
 
22
22
  // src/utils/updateCheck.ts
23
23
  import { existsSync, readFileSync } from "fs";
@@ -11,7 +11,7 @@ import {
11
11
  distroLabel,
12
12
  getFFmpegInstallHint,
13
13
  parseLddMissingLibs
14
- } from "./chunk-K2ZKXTVL.js";
14
+ } from "./chunk-4XFFJAWS.js";
15
15
  import {
16
16
  ensureBrowser,
17
17
  findBrowser
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  parseFeedbackRating,
9
9
  trackRenderFeedback
10
- } from "./chunk-WQLKDL35.js";
10
+ } from "./chunk-77QM6YRQ.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-H5SM5PJI.js";
13
+ } from "./chunk-6IOBAOU7.js";
14
14
  import {
15
15
  c
16
16
  } from "./chunk-ZTZA4UWZ.js";
@@ -84,7 +84,7 @@ async function getDoctorSummary() {
84
84
  try {
85
85
  const [{ getSystemMeta }, { findFFmpeg }] = await Promise.all([
86
86
  import("./system-7F3UEHQT.js"),
87
- import("./ffmpeg-JLH3Z7G7.js")
87
+ import("./ffmpeg-MP7ZVYLZ.js")
88
88
  ]);
89
89
  const sys = getSystemMeta();
90
90
  const parts = [
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-K2FLNJVB.js";
10
10
  import {
11
11
  trackCommandFailure
12
- } from "./chunk-WQLKDL35.js";
12
+ } from "./chunk-77QM6YRQ.js";
13
13
  import {
14
14
  failCommand
15
15
  } from "./chunk-JVBRJMOP.js";
@@ -8,14 +8,14 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemFile,
10
10
  validRegistryItem
11
- } from "./chunk-PMMQRJDE.js";
11
+ } from "./chunk-YRAJDFIN.js";
12
12
  import {
13
13
  publishRegistryFile,
14
14
  registryTargetPath
15
15
  } from "./chunk-GMECXFAN.js";
16
16
  import {
17
17
  validateVariables
18
- } from "./chunk-KROXPHXX.js";
18
+ } from "./chunk-RNZEQTWZ.js";
19
19
  import {
20
20
  realProjectRoot
21
21
  } from "./chunk-OFQWTKPW.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveProject
9
- } from "./chunk-5GUKZRQN.js";
9
+ } from "./chunk-HZ7M2MZA.js";
10
10
  import {
11
11
  DEFAULT_HISTORY_ROOT,
12
12
  HistoryBusyError,
@@ -21,7 +21,15 @@ import {
21
21
 
22
22
  // src/utils/historyOwner.ts
23
23
  import { randomUUID } from "crypto";
24
- import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "fs";
24
+ import {
25
+ accessSync,
26
+ constants,
27
+ mkdirSync,
28
+ readFileSync,
29
+ renameSync,
30
+ rmSync,
31
+ writeFileSync
32
+ } from "fs";
25
33
  import { dirname, join, resolve } from "path";
26
34
  var historyDeps = {
27
35
  historyRoot: resolve(process.env.HYPERFRAMES_HISTORY_ROOT || DEFAULT_HISTORY_ROOT),
@@ -183,11 +191,47 @@ async function withOwner(dir, task, { ownerWaitMs } = {}) {
183
191
  }
184
192
  }
185
193
  }
194
+ var CANNOT_WRITE = /* @__PURE__ */ new Set(["ENOSPC", "EDQUOT", "EACCES", "EPERM", "EROFS"]);
195
+ var WRITE_CALLS = /* @__PURE__ */ new Set([
196
+ "mkdir",
197
+ "write",
198
+ "rename",
199
+ "unlink",
200
+ "link",
201
+ "copyfile",
202
+ "rmdir",
203
+ "symlink",
204
+ "utime",
205
+ "ftruncate",
206
+ "fsync"
207
+ ]);
208
+ function openedForWriting(path) {
209
+ try {
210
+ accessSync(path, constants.R_OK);
211
+ return true;
212
+ } catch (error) {
213
+ return error.code === "ENOENT";
214
+ }
215
+ }
216
+ function failedWrite(error) {
217
+ const { code = "", syscall = "", path } = error;
218
+ if (!CANNOT_WRITE.has(code)) return false;
219
+ return WRITE_CALLS.has(syscall) || syscall === "open" && path !== void 0 && openedForWriting(path);
220
+ }
186
221
  async function withReader(dir, task) {
222
+ let ran = false;
187
223
  try {
188
- return await withOwner(dir, (owner) => task(owner));
224
+ return await withOwner(dir, (owner) => {
225
+ ran = true;
226
+ return task(owner);
227
+ });
189
228
  } catch (error) {
190
- if (!(error instanceof HistoryBusyError)) throw error;
229
+ const unwritable = failedWrite(error);
230
+ if (ran || !(error instanceof HistoryBusyError || unwritable)) throw error;
231
+ if (unwritable)
232
+ console.error(
233
+ `[hyperframes] Could not write this project's history (${error.message}); showing it as last recorded.`
234
+ );
191
235
  }
192
236
  const view = readProjectHistory({
193
237
  projectDir: resolveProject(dir).dir,
@@ -7,29 +7,29 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  RegistryCompatibilityError,
9
9
  gateRegistryItemsCompatibility
10
- } from "./chunk-BRAPBUPQ.js";
10
+ } from "./chunk-4AFNEKU7.js";
11
11
  import {
12
12
  DEFAULT_PROJECT_CONFIG,
13
13
  createProjectConfig,
14
14
  loadProjectConfig,
15
15
  projectConfigPath,
16
16
  recordProjectRegistryItems
17
- } from "./chunk-HDIRZGK4.js";
17
+ } from "./chunk-RPUIMFHF.js";
18
18
  import {
19
19
  resolveItemWithDependencies,
20
20
  resolveItemsByTag
21
- } from "./chunk-RTBSA3EA.js";
21
+ } from "./chunk-Y2M6XSNK.js";
22
22
  import {
23
23
  InvalidVariableValuesError,
24
24
  prepareItem,
25
25
  publishItem
26
- } from "./chunk-HXUTX5GR.js";
26
+ } from "./chunk-ID5AJ4L3.js";
27
27
  import {
28
28
  DEFAULT_REGISTRY_URL
29
- } from "./chunk-PMMQRJDE.js";
29
+ } from "./chunk-YRAJDFIN.js";
30
30
  import {
31
31
  trackRegistryItemAdded
32
- } from "./chunk-WQLKDL35.js";
32
+ } from "./chunk-77QM6YRQ.js";
33
33
  import {
34
34
  defineCommand
35
35
  } from "./chunk-S3S4TGEH.js";
@@ -41,7 +41,7 @@ import {
41
41
  } from "./chunk-ZTZA4UWZ.js";
42
42
  import {
43
43
  ITEM_TYPE_DIRS
44
- } from "./chunk-KROXPHXX.js";
44
+ } from "./chunk-RNZEQTWZ.js";
45
45
  import {
46
46
  isProjectRootMissing,
47
47
  realpath
@@ -6,8 +6,8 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
 
8
8
  // src/version.ts
9
- var VERSION = true ? "0.8.185" : "0.0.0-dev";
10
- var PRODUCER_VERSION = true ? "0.8.185" : "0.0.0-dev";
9
+ var VERSION = true ? "0.8.186" : "0.0.0-dev";
10
+ var PRODUCER_VERSION = true ? "0.8.186" : "0.0.0-dev";
11
11
 
12
12
  export {
13
13
  VERSION,
@@ -36,14 +36,15 @@ function normalizeUploadHeaders(raw) {
36
36
  }
37
37
  return out;
38
38
  }
39
- async function putBytesToPresignedUrl(fetchImpl, uploadUrl, uploadHeaders, body, contentType) {
39
+ async function putBytesToPresignedUrl(fetchImpl, uploadUrl, uploadHeaders, body, contentType, signal) {
40
40
  const headers = {
41
41
  "content-type": contentType,
42
42
  ...normalizeUploadHeaders(uploadHeaders)
43
43
  };
44
- if (!(body instanceof Uint8Array)) return putFileToPresignedUrl(uploadUrl, headers, body);
44
+ if (!(body instanceof Uint8Array)) return putFileToPresignedUrl(uploadUrl, headers, body, signal);
45
45
  const res = await fetchImpl(uploadUrl, {
46
46
  method: "PUT",
47
+ signal,
47
48
  headers,
48
49
  body
49
50
  });
@@ -54,10 +55,11 @@ async function putBytesToPresignedUrl(fetchImpl, uploadUrl, uploadHeaders, body,
54
55
  );
55
56
  }
56
57
  }
57
- async function putFileToPresignedUrl(uploadUrl, headers, file) {
58
+ async function putFileToPresignedUrl(uploadUrl, headers, file, signal) {
58
59
  const send = new URL(uploadUrl).protocol === "https:" ? httpsRequest : httpRequest;
59
60
  const req = send(uploadUrl, {
60
61
  method: "PUT",
62
+ signal,
61
63
  headers: { ...headers, "content-length": String(file.size) }
62
64
  });
63
65
  const response = new Promise((resolve, reject) => {
@@ -121,7 +123,8 @@ async function uploadAssetViaDirectUpload(opts) {
121
123
  initialize.upload_url,
122
124
  initialize.upload_headers,
123
125
  body,
124
- opts.contentType
126
+ opts.contentType,
127
+ opts.signal
125
128
  );
126
129
  opts.onProgress?.({ phase: "upload", percent: 100 });
127
130
  opts.onProgress?.({ phase: "complete" });