hyperframes 0.8.142 → 0.8.144

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 (222) hide show
  1. package/dist/{add-YS2RCWEK.js → add-CWRTVGDB.js} +18 -17
  2. package/dist/{animatedGifPrep-SAMCDT7T.js → animatedGifPrep-JTOHIWI4.js} +15 -14
  3. package/dist/{asset-BLWC2NWB.js → asset-KU2Z4UFM.js} +4 -4
  4. package/dist/{assetCataloger-FVNBBRP3.js → assetCataloger-3CS2P7PA.js} +8 -7
  5. package/dist/{auth-DRZB7OAC.js → auth-IDSOIQWG.js} +1 -1
  6. package/dist/{autoUpdate-I5I3BOJK.js → autoUpdate-373B4BA2.js} +2 -2
  7. package/dist/{backgroundChecks-VR2QHGNY.js → backgroundChecks-53Q3NAMG.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-4YUHQI6X.js → batchRender-UKZA6BME.js} +11 -10
  10. package/dist/{beats-7OT7ALV3.js → beats-N5JGEOFR.js} +33 -28
  11. package/dist/{benchmark-Q2XQCRTR.js → benchmark-CUN3LN4V.js} +15 -14
  12. package/dist/{browser-7VAWQQZC.js → browser-NCZT5AP6.js} +40 -56
  13. package/dist/{bundleWithLocalizedFonts-DDMLLL2R.js → bundleWithLocalizedFonts-FWC7PE2D.js} +2 -2
  14. package/dist/{capture-HEJS6M5A.js → capture-QBLG3VJR.js} +26 -25
  15. package/dist/{capture-U7ABPKS5.js → capture-YLS32UHT.js} +2 -2
  16. package/dist/{catalog-DVJ3XPDN.js → catalog-HIWNAFHW.js} +19 -18
  17. package/dist/{catch-up-DF6AVSN2.js → catch-up-HGS7KIAC.js} +5 -5
  18. package/dist/{check-KXORRWAE.js → check-FH6UYYLO.js} +78 -66
  19. package/dist/{checkBrowser-J7HZJTRH.js → checkBrowser-RNWNOMCZ.js} +93 -41
  20. package/dist/{chunk-R2JEKLDZ.js → chunk-2DA2BBNY.js} +3 -3
  21. package/dist/{chunk-TQFG7HTI.js → chunk-3RM2ETQT.js} +0 -168
  22. package/dist/{chunk-YFT3BL7N.js → chunk-3VYNNWVA.js} +30 -12
  23. package/dist/{chunk-7FCDA4RH.js → chunk-3XTEXWNN.js} +8 -5
  24. package/dist/{chunk-PFCFR3KZ.js → chunk-442JNXRM.js} +1 -1
  25. package/dist/{chunk-BPZVDBHY.js → chunk-4LAR447G.js} +1 -1
  26. package/dist/{chunk-AM5L5YIA.js → chunk-4OA4LDTU.js} +1 -1
  27. package/dist/{chunk-DZEVA7DI.js → chunk-4OC7MQNB.js} +2 -2
  28. package/dist/{chunk-75JJVANE.js → chunk-54QISXOC.js} +3 -3
  29. package/dist/{chunk-FZK35GT4.js → chunk-5HJ343GH.js} +1 -1
  30. package/dist/{chunk-IDX52YJN.js → chunk-5VMR4WBS.js} +458 -159
  31. package/dist/{chunk-OSUKETIH.js → chunk-5WADG7PR.js} +1 -1
  32. package/dist/{chunk-JYYOAKHS.js → chunk-6IIGT7BX.js} +1 -1
  33. package/dist/{chunk-6UYZB4TY.js → chunk-7RAYSCYT.js} +4 -4
  34. package/dist/{chunk-WTMUCJ6Z.js → chunk-7SDCIWHQ.js} +11 -2
  35. package/dist/{chunk-LAOCA3MQ.js → chunk-A4Q7W4LV.js} +13 -8
  36. package/dist/{chunk-B6SMSALD.js → chunk-A53CBD24.js} +18 -12
  37. package/dist/{chunk-4PFZPP2N.js → chunk-A6S35NYA.js} +54 -16
  38. package/dist/{chunk-JOTLPC6S.js → chunk-AUBOF2PN.js} +1 -1
  39. package/dist/{chunk-WCJGTLPF.js → chunk-BHVFTYSI.js} +6 -3
  40. package/dist/chunk-BSQ7XANM.js +210 -0
  41. package/dist/{chunk-LCSMOLGX.js → chunk-BYSBRF24.js} +69 -8
  42. package/dist/{chunk-U7E736AJ.js → chunk-DDIVWXN7.js} +32 -14
  43. package/dist/{chunk-KOEWEFHK.js → chunk-DIRJ322I.js} +10 -5
  44. package/dist/{chunk-HMUF7FEO.js → chunk-EX6C672Y.js} +2 -2
  45. package/dist/{chunk-QGRFOOLE.js → chunk-F2SMS24Q.js} +288 -85
  46. package/dist/{chunk-5Z63TBTX.js → chunk-FH7WODJH.js} +1 -1
  47. package/dist/{chunk-XTLBLWOV.js → chunk-GEWKFRFI.js} +1 -1
  48. package/dist/{chunk-RVCWIIZ7.js → chunk-GV5R5B7Q.js} +1 -1
  49. package/dist/{chunk-TY6XOHEM.js → chunk-GZM2EFOE.js} +3 -3
  50. package/dist/chunk-GZVP4TWN.js +76 -0
  51. package/dist/{chunk-QXPCARFE.js → chunk-I5KY7EZP.js} +1 -1
  52. package/dist/{chunk-IW2CKH6A.js → chunk-IEIJRMLZ.js} +94 -59
  53. package/dist/chunk-IR35BCLK.js +13 -0
  54. package/dist/{chunk-JFKL3WAE.js → chunk-IWFLMU2N.js} +104 -19
  55. package/dist/{chunk-EFDXGAAD.js → chunk-JEHFZQYT.js} +1 -1
  56. package/dist/{chunk-IHFUKJOR.js → chunk-K2FLNJVB.js} +8 -2
  57. package/dist/{chunk-KDPYVTEU.js → chunk-KBB4RG6F.js} +6 -1
  58. package/dist/{chunk-LJAU4TPS.js → chunk-KFKZ3ISO.js} +2 -2
  59. package/dist/{sherpa-ZYTNFHD5.js → chunk-L5TUCXWR.js} +11 -44
  60. package/dist/{chunk-KYN364DU.js → chunk-LC3RQURJ.js} +7 -9
  61. package/dist/{chunk-IMY4QQTQ.js → chunk-LFX2HEYP.js} +8 -8
  62. package/dist/{chunk-PXSM4HPB.js → chunk-MAYCCGMQ.js} +12 -3
  63. package/dist/{chunk-OZUQF4NB.js → chunk-MQZVBHEY.js} +123 -8
  64. package/dist/{chunk-FWRNQOLT.js → chunk-MXNDKDFT.js} +3 -3
  65. package/dist/{chunk-A4KQZXZI.js → chunk-NE55C6S5.js} +4 -2
  66. package/dist/{chunk-GYE63V4P.js → chunk-NOPBBSLA.js} +24 -19
  67. package/dist/{chunk-H2X52H2N.js → chunk-NV4RXIQ7.js} +3 -3
  68. package/dist/{chunk-WGVOWWVK.js → chunk-OIDN7G42.js} +3 -3
  69. package/dist/{chunk-DPHJKWP5.js → chunk-OUSLVRO4.js} +107 -108
  70. package/dist/{chunk-JLKMWY2T.js → chunk-P6WH6QTV.js} +8 -5
  71. package/dist/{chunk-7M4KAPAA.js → chunk-PUGIRFPX.js} +2 -2
  72. package/dist/{chunk-6RAD4BCC.js → chunk-QATWIE4K.js} +2 -2
  73. package/dist/{chunk-D2KNWIQ6.js → chunk-QFSCCQIR.js} +1 -1
  74. package/dist/{chunk-XGMNQQTJ.js → chunk-RG3QWWIE.js} +1 -1
  75. package/dist/{chunk-MVTUV4TP.js → chunk-RI53TS2Y.js} +14 -6
  76. package/dist/{chunk-LQASVU3I.js → chunk-RVFEDAUV.js} +12 -4
  77. package/dist/{chunk-GK4AIFIH.js → chunk-SDYDNHEE.js} +34 -3
  78. package/dist/{chunk-WSGY5CDQ.js → chunk-SLCFKB3Y.js} +14 -10
  79. package/dist/{chunk-2NCHQUPX.js → chunk-SQLK7SJL.js} +1 -1
  80. package/dist/{chunk-PMRBLBUP.js → chunk-T42U2W2R.js} +14 -2
  81. package/dist/chunk-UPFUC4DB.js +136 -0
  82. package/dist/{chunk-IXCTG2WY.js → chunk-VYSUZEJG.js} +5 -5
  83. package/dist/chunk-WJB7WI4J.js +3753 -0
  84. package/dist/{chunk-YEIFI443.js → chunk-WPNE5NEP.js} +1 -1
  85. package/dist/{chunk-YHRZQJXH.js → chunk-XGFHYAYN.js} +265 -68
  86. package/dist/{chunk-LBKDQKWV.js → chunk-XU5GGV6R.js} +1 -1
  87. package/dist/{chunk-LTGGTEMA.js → chunk-Y6UPYWJS.js} +2 -2
  88. package/dist/{chunk-OKCR3JTO.js → chunk-YJXHMIZA.js} +13 -10
  89. package/dist/{chunk-JU6Y5TTZ.js → chunk-YUAXFWSQ.js} +3 -3
  90. package/dist/{chunk-TVCRUG2S.js → chunk-ZEUONDQG.js} +1 -1
  91. package/dist/{chunk-THXFSPLV.js → chunk-ZIRIDSDB.js} +1 -1
  92. package/dist/{chunk-6UM3R7PP.js → chunk-ZOA2SC4P.js} +129 -60
  93. package/dist/{clean-KTHTV5G5.js → clean-KPX27IKJ.js} +27 -26
  94. package/dist/cli.js +70 -160
  95. package/dist/{cloud-ARSZWALC.js → cloud-P7DAOISN.js} +4 -4
  96. package/dist/{cloudrun-NM7RXOCL.js → cloudrun-XM56TBOH.js} +13 -12
  97. package/dist/commands/contrast-audit.browser.js +60 -4
  98. package/dist/commands/layout-audit.browser.js +68 -0
  99. package/dist/{compare-CY4UO3RW.js → compare-F6YAFZZM.js} +37 -36
  100. package/dist/{compiler-VTH2D3ID.js → compiler-JZ4GNFMG.js} +16 -10
  101. package/dist/{component-FRUIAXIR.js → component-3CFOGIQA.js} +5 -5
  102. package/dist/{compositions-CUSY6ZYY.js → compositions-CPCMWF24.js} +38 -33
  103. package/dist/{delete-KT3VHP4L.js → delete-GYVKOKB6.js} +4 -4
  104. package/dist/{deterministicFonts-F6WIVL2W.js → deterministicFonts-U2BIMGPG.js} +3 -3
  105. package/dist/{dist-7SZU7MA7.js → dist-KDJTFJHA.js} +7 -6
  106. package/dist/{dist-2GC6XKRQ.js → dist-YPWQDWJ4.js} +42 -40
  107. package/dist/{doctor-4ROTBL5U.js → doctor-GWI3B6JT.js} +21 -20
  108. package/dist/{dom-IROKGVJI.js → dom-37K6YOH4.js} +2 -2
  109. package/dist/{events-QJDVMKSR.js → events-BRRUDPPT.js} +3 -3
  110. package/dist/{events-Q5PXT5UC.js → events-V2QFN4YM.js} +2 -2
  111. package/dist/{feedback-PQ7TWESA.js → feedback-CXMD7FWL.js} +14 -13
  112. package/dist/{ffmpeg-QIUFEFTY.js → ffmpeg-T5SH2EFJ.js} +3 -2
  113. package/dist/{figma-JN5DDBDS.js → figma-YABDWD66.js} +3 -3
  114. package/dist/fontLocalizeCli.js +18 -17
  115. package/dist/{get-KT6OTERO.js → get-L2SOQKHX.js} +4 -4
  116. package/dist/{gpuPolicy-LCBWVGEH.js → gpuPolicy-NBJNWHYS.js} +19 -16
  117. package/dist/{grade-compare-VS3RP73G.js → grade-compare-STXQPKYQ.js} +39 -38
  118. package/dist/{help-AD6FIZIO.js → help-4H6BSFLB.js} +2 -2
  119. package/dist/{history-ZRWYRY7R.js → history-4IQOLTHJ.js} +6 -6
  120. package/dist/hyperframe-runtime.js +56 -56
  121. package/dist/hyperframe.manifest.json +1 -1
  122. package/dist/hyperframe.runtime.iife.js +56 -56
  123. package/dist/hyperframes-player.global.js +3 -3
  124. package/dist/hyperframes-slideshow.global.js +23 -23
  125. package/dist/{info-WBBQA2AX.js → info-2CZOTNBC.js} +17 -16
  126. package/dist/{init-A2XBDFGF.js → init-6BXK42VS.js} +46 -46
  127. package/dist/{inspect-CLTZHA5O.js → inspect-VKU47TBH.js} +38 -37
  128. package/dist/{installer-WQDRVXH4.js → installer-T2BSSUDY.js} +11 -10
  129. package/dist/{keyframes-3FYOK6H6.js → keyframes-IEYVHRPI.js} +10 -10
  130. package/dist/{lambda-Y2PA2BGS.js → lambda-TIKG25CK.js} +12 -11
  131. package/dist/{layout-4KP5O7IJ.js → layout-XOI4PT7A.js} +38 -37
  132. package/dist/{lint-V4GRFHOJ.js → lint-DWCMVIX5.js} +14 -13
  133. package/dist/{lintProject-RG2KGAXB.js → lintProject-UBZ3TDHU.js} +7 -6
  134. package/dist/{list-OQ4VED6E.js → list-7GXKG5QM.js} +5 -5
  135. package/dist/{login-W47NKN5S.js → login-BQ5L2UHX.js} +4 -4
  136. package/dist/{manager-CT3D67CG.js → manager-BPSR6D3V.js} +2 -2
  137. package/dist/{manager-524RPYO7.js → manager-RFZNG5YT.js} +2 -2
  138. package/dist/{manager-DXB7JDHU.js → manager-YKMHR6LN.js} +9 -6
  139. package/dist/{media-treatment-HJYL3EME.js → media-treatment-IFB7OSZ3.js} +24 -22
  140. package/dist/{models-DYBAD2GQ.js → models-TY4PJ545.js} +68 -27
  141. package/dist/{motionShot-7NE2YBB3.js → motionShot-WXMFHICW.js} +33 -33
  142. package/dist/{normalize-IGLHCWTF.js → normalize-U3SL5VG3.js} +19 -8
  143. package/dist/{normalize-audio-INKCLMS2.js → normalize-audio-RFD776HQ.js} +10 -6
  144. package/dist/{open-TYC5THVY.js → open-7IXXGO2E.js} +5 -5
  145. package/dist/parakeetRunner-IHLYYMTZ.js +67 -0
  146. package/dist/{pipeline-EVKEPQEW.js → pipeline-TXKPLL2U.js} +20 -18
  147. package/dist/{play-QMZEM6X3.js → play-J2KP64UK.js} +31 -29
  148. package/dist/{preflight-Y5DN5D37.js → preflight-B4AFK3RG.js} +4 -4
  149. package/dist/{present-Y7IK3C4W.js → present-MHHNRVRA.js} +26 -25
  150. package/dist/{preview-5OQRYE6A.js → preview-CONUOFFQ.js} +28 -27
  151. package/dist/{producer-Q6G6JU7B.js → producer-ZI46K7HH.js} +1 -1
  152. package/dist/{projectConfig-RJN3DKDB.js → projectConfig-FGGVG5MV.js} +13 -12
  153. package/dist/{publication-QCPGGN3U.js → publication-TXFBMW6B.js} +8 -7
  154. package/dist/{publish-VZLFIGYY.js → publish-YZSPBFRD.js} +18 -17
  155. package/dist/{remove-background-TKOEHBA5.js → remove-background-4ATVLHLG.js} +22 -20
  156. package/dist/{render-KIIIF6PS.js → render-6FBYLYGJ.js} +20 -19
  157. package/dist/{render-XTXE5CRU.js → render-GFW5BPES.js} +13 -12
  158. package/dist/{render-X3NFNVEQ.js → render-MH4IUPWB.js} +41 -40
  159. package/dist/{render-batch-M55YZLZ5.js → render-batch-XUCZ2PUJ.js} +13 -12
  160. package/dist/{renderCancellation-X5BEHAZU.js → renderCancellation-XF7M7IUP.js} +18 -16
  161. package/dist/renderSetupWorker.js +37 -48
  162. package/dist/{resolver-GAMXRA42.js → resolver-W7AYCQGS.js} +10 -9
  163. package/dist/sherpa-LDUB5NLY.js +75 -0
  164. package/dist/sherpaWorker.js +2 -1
  165. package/dist/skills/hyperframes-cli/references/doctor-browser.md +24 -1
  166. package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +1 -1
  167. package/dist/skills/media-use/scripts/lib/cache.mjs +28 -14
  168. package/dist/skills/media-use/scripts/lib/cache.test.mjs +110 -0
  169. package/dist/skills/media-use/scripts/lib/duck.mjs +2 -1
  170. package/dist/skills/media-use/scripts/lib/duck.test.mjs +87 -0
  171. package/dist/skills/media-use/scripts/lib/probe.mjs +6 -1
  172. package/dist/skills/media-use/scripts/lib/probe.test.mjs +73 -0
  173. package/dist/skills/media-use/scripts/lib/words.mjs +1 -1
  174. package/dist/{skills-CZHVAD3J.js → skills-VENERS5X.js} +7 -7
  175. package/dist/{skillsUpdateCheck-6WLLX53A.js → skillsUpdateCheck-UXFYTACG.js} +3 -3
  176. package/dist/{slideshow-EJ4IMY6P.js → slideshow-4OJEPWNZ.js} +1 -1
  177. package/dist/{snapshot-K7BTJPYQ.js → snapshot-C6T74HTI.js} +44 -40
  178. package/dist/{src-YUW26JU5.js → src-FS5RSVEI.js} +17 -16
  179. package/dist/{src-3I3RH3V5.js → src-VUJ2FUFK.js} +18 -13
  180. package/dist/{staticProjectServer-IKCSGN2B.js → staticProjectServer-V2RZ4DWD.js} +23 -22
  181. package/dist/studio/assets/hyperframes-player-Bw_jIaSX.js +473 -0
  182. package/dist/studio/assets/{index-B-wffzRH.js → index-BVM9NuWl.js} +153 -153
  183. package/dist/studio/assets/{index-D3Vij9t1.js → index-Cj7W_c7p.js} +1 -1
  184. package/dist/studio/assets/{index-D5q2_7Gw.js → index-DyH9dT7b.js} +1 -1
  185. package/dist/studio/{chunk-TFLU2MGI.js → chunk-3GHTHPZD.js} +8 -1
  186. package/dist/studio/chunk-3GHTHPZD.js.map +1 -0
  187. package/dist/studio/{chunk-H2DUOXTF.js → chunk-G3EDKRZH.js} +3 -3
  188. package/dist/studio/{chunk-UYWON5AX.js → chunk-PEAKCOUW.js} +7 -3
  189. package/dist/studio/chunk-PEAKCOUW.js.map +1 -0
  190. package/dist/studio/{chunk-LOVBLSMR.js → chunk-Y2OHHNM2.js} +35 -19
  191. package/dist/studio/chunk-Y2OHHNM2.js.map +1 -0
  192. package/dist/studio/{domEditingLayers-KBTPQKGA.js → domEditingLayers-PYST4G45.js} +3 -3
  193. package/dist/studio/index.html +1 -1
  194. package/dist/studio/index.js +261 -230
  195. package/dist/studio/index.js.map +1 -1
  196. package/dist/studio/player.js +3 -3
  197. package/dist/studio/ui.d.ts +4 -5
  198. package/dist/studio/ui.js +1 -1
  199. package/dist/{studio-api-SQ3NXFSM.js → studio-api-TQE7KWKO.js} +22 -17
  200. package/dist/{studioServer-VVEO7XCH.js → studioServer-CYKSQK7L.js} +81 -64
  201. package/dist/{synthesize-77PTU6C5.js → synthesize-UCI4X5O7.js} +6 -6
  202. package/dist/{telemetry-FQDKR5XA.js → telemetry-A23PPRD6.js} +3 -3
  203. package/dist/{timeline-N6ZASFNE.js → timeline-T3QSGT3A.js} +143 -99
  204. package/dist/{tokens-2OIIBBCW.js → tokens-RT5HWA6C.js} +4 -4
  205. package/dist/{transcribe-7YTUCXDX.js → transcribe-FOLNOC5G.js} +116 -52
  206. package/dist/{transcribe-4F6MK73N.js → transcribe-HCF64LQK.js} +23 -20
  207. package/dist/{tts-TOHSPWEG.js → tts-B6AHFQEO.js} +6 -6
  208. package/dist/{updateCheck-AZ2COZFR.js → updateCheck-27PIP3AA.js} +2 -2
  209. package/dist/{upgrade-QAJEYB4X.js → upgrade-TVGXBUPJ.js} +2 -2
  210. package/dist/{urlDownloader-LSMFEO3R.js → urlDownloader-KBLBJKRL.js} +14 -13
  211. package/dist/{validate-GW5MDL36.js → validate-ZMYGK4QI.js} +40 -27
  212. package/dist/{video-PRNOKUK3.js → video-AVE5GIGM.js} +15 -14
  213. package/package.json +1 -1
  214. package/dist/chunk-J4UX3RS3.js +0 -3717
  215. package/dist/studio/assets/hyperframes-player-sAsRuV73.js +0 -473
  216. package/dist/studio/chunk-LOVBLSMR.js.map +0 -1
  217. package/dist/studio/chunk-TFLU2MGI.js.map +0 -1
  218. package/dist/studio/chunk-UYWON5AX.js.map +0 -1
  219. package/dist/{chunk-HBBJFK6I.js → chunk-APDLWWFG.js} +0 -0
  220. package/dist/{screenshotCapture-TEUIWXWN.js → screenshotCapture-3JXXUZND.js} +3 -3
  221. /package/dist/studio/{chunk-H2DUOXTF.js.map → chunk-G3EDKRZH.js.map} +0 -0
  222. /package/dist/studio/{domEditingLayers-KBTPQKGA.js.map → domEditingLayers-PYST4G45.js.map} +0 -0
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveCaptureBrowserGpuMode
9
- } from "./chunk-WTMUCJ6Z.js";
9
+ } from "./chunk-7SDCIWHQ.js";
10
10
  import {
11
11
  requestCliExit
12
12
  } from "./chunk-PBN6GBJE.js";
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  downloadFile
9
- } from "./chunk-WCJGTLPF.js";
9
+ } from "./chunk-BHVFTYSI.js";
10
10
 
11
11
  // src/tts/manager.ts
12
12
  import { existsSync, mkdirSync } from "fs";
@@ -6,20 +6,20 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  errorBox
9
- } from "./chunk-IHFUKJOR.js";
9
+ } from "./chunk-K2FLNJVB.js";
10
10
  import {
11
11
  ensureDOMParser
12
- } from "./chunk-PFCFR3KZ.js";
12
+ } from "./chunk-442JNXRM.js";
13
13
  import {
14
14
  failCommand
15
15
  } from "./chunk-PBN6GBJE.js";
16
16
  import {
17
17
  formatVariableValidationIssue,
18
18
  validateVariables
19
- } from "./chunk-YFT3BL7N.js";
19
+ } from "./chunk-3VYNNWVA.js";
20
20
  import {
21
21
  extractCompositionMetadata
22
- } from "./chunk-OZUQF4NB.js";
22
+ } from "./chunk-MQZVBHEY.js";
23
23
  import {
24
24
  c
25
25
  } from "./chunk-ZTZA4UWZ.js";
@@ -4,6 +4,10 @@ import { dirname as __hf_dirname } from "node:path";
4
4
  var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
+ import {
8
+ resolveConfig,
9
+ usesSoftwareWebGpu
10
+ } from "./chunk-5VMR4WBS.js";
7
11
 
8
12
  // src/browser/gpuPolicy.ts
9
13
  function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCER_BROWSER_GPU_MODE) {
@@ -13,11 +17,16 @@ function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCE
13
17
  return "auto";
14
18
  }
15
19
  async function resolveCaptureBrowserGpuMode(requestedMode, chromePath) {
16
- const { resolveBrowserGpuMode } = await import("./src-3I3RH3V5.js");
20
+ const { resolveBrowserGpuMode } = await import("./src-VUJ2FUFK.js");
17
21
  return resolveBrowserGpuMode(requestedMode, { chromePath });
18
22
  }
23
+ function resolveLocalWebGpu(browserGpuMode, requiresWebGpu) {
24
+ const gpuConfig = { browserGpuMode, allowSoftwareWebGpu: resolveConfig().allowSoftwareWebGpu };
25
+ return { gpuConfig, softwareWebGpu: usesSoftwareWebGpu(requiresWebGpu, gpuConfig) };
26
+ }
19
27
 
20
28
  export {
21
29
  resolveLocalBrowserGpuMode,
22
- resolveCaptureBrowserGpuMode
30
+ resolveCaptureBrowserGpuMode,
31
+ resolveLocalWebGpu
23
32
  };
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  runRenderSetupWorker,
9
9
  terminateProcessTree
10
- } from "./chunk-LCSMOLGX.js";
10
+ } from "./chunk-BYSBRF24.js";
11
11
 
12
12
  // src/utils/orphanCleanup.ts
13
13
  import { execFileSync } from "child_process";
@@ -62,17 +62,19 @@ function processIdentity(pid) {
62
62
  return null;
63
63
  }
64
64
  }
65
+ var holdsReusedPid = (parent, child) => parent.startedAt !== void 0 && child?.startedAt !== void 0 && parent.startedAt > child.startedAt;
65
66
  function recordsToAncestors(pid, records) {
66
67
  const byPid = new Map(records.map((record) => [record.pid, record]));
67
68
  const ancestors = [];
68
69
  const visited = /* @__PURE__ */ new Set([pid]);
69
70
  let current = pid;
70
71
  for (let depth = 0; depth < 64; depth++) {
71
- const parent = byPid.get(current)?.parentPid;
72
+ const child = byPid.get(current);
73
+ const parent = child?.parentPid;
72
74
  if (parent === void 0 || parent <= 1 || visited.has(parent)) break;
73
75
  visited.add(parent);
74
76
  const ancestor = byPid.get(parent);
75
- if (!ancestor) break;
77
+ if (!ancestor || holdsReusedPid(ancestor, child)) break;
76
78
  ancestors.push({ pid: ancestor.pid, identity: ancestor.identity });
77
79
  current = parent;
78
80
  }
@@ -92,11 +94,14 @@ function processAncestorSnapshot(pid) {
92
94
  ],
93
95
  { encoding: "utf8", timeout: 2e3, stdio: ["pipe", "pipe", "ignore"], windowsHide: true }
94
96
  );
95
- const records2 = output2.split(/\r?\n/).map((line) => line.trim().split(/\s+/)).map(([processId, parentProcessId, creationDate]) => ({
96
- pid: Number(processId),
97
- parentPid: Number(parentProcessId),
98
- identity: creationDate ? `windows:${creationDate}` : ""
99
- })).filter(
97
+ const records2 = output2.split(/\r?\n/).map((line) => line.trim().split(/\s+/)).map(
98
+ ([processId, parentProcessId, creationDate]) => ({
99
+ pid: Number(processId),
100
+ parentPid: Number(parentProcessId),
101
+ identity: creationDate ? `windows:${creationDate}` : "",
102
+ startedAt: creationDate && /^\d+$/.test(creationDate) ? BigInt(creationDate) : void 0
103
+ })
104
+ ).filter(
100
105
  (record) => Number.isInteger(record.pid) && record.pid > 0 && Number.isInteger(record.parentPid) && record.parentPid > 0 && record.identity !== ""
101
106
  );
102
107
  return recordsToAncestors(pid, records2);
@@ -6,24 +6,24 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  serveStaticProjectHtml
9
- } from "./chunk-LQASVU3I.js";
9
+ } from "./chunk-RVFEDAUV.js";
10
10
  import {
11
11
  resolveProject
12
- } from "./chunk-LJAU4TPS.js";
12
+ } from "./chunk-KFKZ3ISO.js";
13
13
  import {
14
14
  AUDIT_SEEK_OPTIONS,
15
15
  installPageFunctionGuard,
16
16
  seekCompositionTimeline,
17
17
  waitForCompositionFonts,
18
18
  waitForRuntimeReady
19
- } from "./chunk-WSGY5CDQ.js";
19
+ } from "./chunk-SLCFKB3Y.js";
20
20
  import {
21
21
  launchManagedBrowser,
22
22
  resolveManagedGpuMode
23
- } from "./chunk-OSUKETIH.js";
23
+ } from "./chunk-5WADG7PR.js";
24
24
  import {
25
25
  resolveDiagnosticNavigationTimeoutMs
26
- } from "./chunk-TY6XOHEM.js";
26
+ } from "./chunk-GZM2EFOE.js";
27
27
  import {
28
28
  defineCommand
29
29
  } from "./chunk-S3S4TGEH.js";
@@ -34,7 +34,7 @@ import {
34
34
  import {
35
35
  printDeprecationNotice,
36
36
  withMeta
37
- } from "./chunk-JLKMWY2T.js";
37
+ } from "./chunk-P6WH6QTV.js";
38
38
  import {
39
39
  normalizeErrorMessage
40
40
  } from "./chunk-KNU5COPB.js";
@@ -707,7 +707,7 @@ async function collectTweenBoundaries(page) {
707
707
  });
708
708
  }
709
709
  async function bundleProjectHtml(projectDir) {
710
- const { bundleToSingleHtml } = await import("./compiler-VTH2D3ID.js");
710
+ const { bundleToSingleHtml } = await import("./compiler-JZ4GNFMG.js");
711
711
  return bundleToSingleHtml(projectDir);
712
712
  }
713
713
  async function alignViewportToComposition(page, url) {
@@ -727,10 +727,15 @@ async function alignViewportToComposition(page, url) {
727
727
  });
728
728
  }
729
729
  async function runLayoutAudit(projectDir, opts) {
730
- const { ensureBrowser } = await import("./manager-CT3D67CG.js");
730
+ const { ensureBrowser } = await import("./manager-BPSR6D3V.js");
731
731
  const puppeteer = await import("puppeteer-core");
732
- const { buildChromeArgs } = await import("./src-3I3RH3V5.js");
733
- const { assertWebGpuAdapterAvailable, compositionRequiresWebGpu, resolveLocalBrowserGpuMode } = await import("./gpuPolicy-LCBWVGEH.js");
732
+ const { buildChromeArgs } = await import("./src-VUJ2FUFK.js");
733
+ const {
734
+ assertWebGpuAdapterAvailable,
735
+ compositionRequiresWebGpu,
736
+ resolveLocalBrowserGpuMode,
737
+ resolveLocalWebGpu
738
+ } = await import("./gpuPolicy-NBJNWHYS.js");
734
739
  const html = await bundleProjectHtml(projectDir);
735
740
  const server = await serveStaticProjectHtml(
736
741
  projectDir,
@@ -743,12 +748,13 @@ async function runLayoutAudit(projectDir, opts) {
743
748
  const requestedGpuMode = resolveLocalBrowserGpuMode();
744
749
  const resolvedGpuMode = await resolveManagedGpuMode(requestedGpuMode, browser.executablePath);
745
750
  const requiresWebGpu = compositionRequiresWebGpu(html);
751
+ const { gpuConfig, softwareWebGpu } = resolveLocalWebGpu(resolvedGpuMode, requiresWebGpu);
746
752
  chromeBrowser = await launchManagedBrowser(puppeteer.default, {
747
753
  headless: true,
748
754
  executablePath: browser.executablePath,
749
755
  args: buildChromeArgs(
750
756
  { width: 1920, height: 1080, captureMode: "screenshot", requiresWebGpu },
751
- { browserGpuMode: resolvedGpuMode }
757
+ gpuConfig
752
758
  )
753
759
  });
754
760
  const page = await chromeBrowser.newPage();
@@ -758,7 +764,7 @@ async function runLayoutAudit(projectDir, opts) {
758
764
  waitUntil: "domcontentloaded",
759
765
  timeout: resolveDiagnosticNavigationTimeoutMs()
760
766
  });
761
- await assertWebGpuAdapterAvailable(page, requiresWebGpu);
767
+ await assertWebGpuAdapterAvailable(page, requiresWebGpu, softwareWebGpu);
762
768
  await alignViewportToComposition(page, server.url);
763
769
  await waitForRuntimeReady(page, opts.timeout);
764
770
  await waitForCompositionFonts(page, 750);
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  runRenderSetupWorker
9
- } from "./chunk-LCSMOLGX.js";
9
+ } from "./chunk-BYSBRF24.js";
10
10
  import {
11
11
  chromeMajorCeiling,
12
12
  exceedsChromeCeiling
@@ -30,6 +30,7 @@ import {
30
30
  writeFileSync
31
31
  } from "fs";
32
32
  import { homedir } from "os";
33
+ import { debuglog } from "util";
33
34
  import { basename, dirname, join, relative } from "path";
34
35
  async function loadPuppeteerBrowsers() {
35
36
  try {
@@ -234,7 +235,7 @@ async function findFromHyperframesCache() {
234
235
  const match = installed.find(
235
236
  (b) => b.browser === Browser.CHROMEHEADLESSSHELL && b.buildId === managedChromeVersion() && b.platform === hostPlatform
236
237
  );
237
- if (match && existsSync(match.executablePath)) {
238
+ if (match && isUsableExecutable(match.executablePath)) {
238
239
  return { result: { executablePath: match.executablePath, source: "cache" } };
239
240
  }
240
241
  if (match) {
@@ -301,7 +302,7 @@ function findFromPuppeteerCache() {
301
302
  for (const version of versions) {
302
303
  if (exceedsChromeCeiling(version, ceiling)) continue;
303
304
  const binary = join(PUPPETEER_CACHE_DIR, version, ...executable);
304
- if (existsSync(binary)) {
305
+ if (isUsableExecutable(binary)) {
305
306
  return { executablePath: binary, source: "cache" };
306
307
  }
307
308
  }
@@ -345,14 +346,14 @@ async function findBrowser() {
345
346
  if (fromCache.result) return fromCache.result;
346
347
  if (fromCache.staleHyperframesCachePath) {
347
348
  console.warn(
348
- `[browser] Cached binary missing at ${fromCache.staleHyperframesCachePath} \u2014 re-downloading...`
349
+ `[browser] Cached binary unusable (missing, empty or not a file) at ${fromCache.staleHyperframesCachePath} \u2014 re-downloading...`
349
350
  );
350
351
  try {
351
352
  return await withInstallLock(() => downloadBrowser());
352
353
  } catch (err) {
353
354
  const cause = normalizeErrorMessage(err);
354
355
  throw new Error(
355
- `Cached Chrome binary was missing at ${fromCache.staleHyperframesCachePath}, and re-download failed: ${cause}
356
+ `Cached Chrome binary was unusable at ${fromCache.staleHyperframesCachePath}, and re-download failed: ${cause}
356
357
  Run \`hyperframes browser ensure --force\` to re-download.`
357
358
  );
358
359
  }
@@ -414,7 +415,7 @@ async function ensureBrowserInCurrentProcess(options) {
414
415
  if (fromCache.result) return fromCache.result;
415
416
  if (fromCache.staleHyperframesCachePath) {
416
417
  console.warn(
417
- `[browser] Cached binary missing at ${fromCache.staleHyperframesCachePath} \u2014 re-downloading...`
418
+ `[browser] Cached binary unusable (missing, empty or not a file) at ${fromCache.staleHyperframesCachePath} \u2014 re-downloading...`
418
419
  );
419
420
  return withInstallLock(() => downloadBrowser(options));
420
421
  }
@@ -478,10 +479,11 @@ function browserPathHintForPlatform() {
478
479
  }
479
480
  return "/usr/bin/google-chrome";
480
481
  }
481
- function wrapDownloadFailureWithBrowserPathHint(cause) {
482
+ function wrapDownloadFailureWithBrowserPathHint(cause, unzipLog) {
482
483
  const original = normalizeErrorMessage(cause);
484
+ const unzipErrors = unzipLog.length > 0 ? ` Unzip errors: ${unzipLog.join("; ")}` : "";
483
485
  const example = browserPathHintForPlatform();
484
- const message = `Failed to download chrome-headless-shell ${managedChromeVersion()}: ${original}
486
+ const message = `Failed to install chrome-headless-shell ${managedChromeVersion()}: ${original}${unzipErrors}
485
487
 
486
488
  Point hyperframes at an already-installed Chrome/Chromium instead:
487
489
 
@@ -502,13 +504,27 @@ async function downloadBrowser(options) {
502
504
  removeInstallLeftovers();
503
505
  const stagingDir = join(CACHE_ROOT_DIR, `${STAGING_PREFIX}${randomUUID()}`);
504
506
  const clearStaging = () => rmSync(stagingDir, { recursive: true, force: true });
505
- const runInstall = () => install({
506
- cacheDir: stagingDir,
507
- browser: Browser.CHROMEHEADLESSSHELL,
508
- buildId: managedChromeVersion(),
509
- platform,
510
- downloadProgressCallback: options?.onProgress
511
- });
507
+ let unzipLog = [];
508
+ const runInstall = () => {
509
+ unzipLog = [];
510
+ return install({
511
+ cacheDir: stagingDir,
512
+ browser: Browser.CHROMEHEADLESSSHELL,
513
+ buildId: managedChromeVersion(),
514
+ platform,
515
+ downloadProgressCallback: options?.onProgress,
516
+ logger: (prefix) => {
517
+ const debug = debuglog(prefix);
518
+ const isUnzip = prefix === "puppeteer:browsers:fileUtil";
519
+ if (!isUnzip && !debug.enabled) return void 0;
520
+ return (...args) => {
521
+ const line = args.join(" ");
522
+ if (isUnzip) unzipLog.push(line);
523
+ if (debug.enabled) debug(line);
524
+ };
525
+ }
526
+ });
527
+ };
512
528
  try {
513
529
  const staged = await installWithCorruptArchiveRecovery(
514
530
  runInstall,
@@ -517,13 +533,35 @@ async function downloadBrowser(options) {
517
533
  `[hyperframes] Downloaded browser archive was corrupt (${normalizeErrorMessage(err)}); re-downloading.`
518
534
  )
519
535
  );
536
+ assertExecutableUnpacked(stagingDir, staged.executablePath);
537
+ unzipLog = [];
520
538
  return { executablePath: moveStagedInstallIntoCache(stagingDir, staged), source: "download" };
521
539
  } catch (err) {
522
- throw wrapDownloadFailureWithBrowserPathHint(err);
540
+ throw wrapDownloadFailureWithBrowserPathHint(err, unzipLog);
523
541
  } finally {
524
542
  clearStaging();
525
543
  }
526
544
  }
545
+ function executableState(path) {
546
+ const stat = statSync(path, { throwIfNoEntry: false });
547
+ if (!stat) return "is missing";
548
+ if (!stat.isFile()) return "is not a file";
549
+ return stat.size > 0 ? "usable" : "is empty";
550
+ }
551
+ function isUsableExecutable(path) {
552
+ try {
553
+ return executableState(path) === "usable";
554
+ } catch {
555
+ return false;
556
+ }
557
+ }
558
+ function assertExecutableUnpacked(stagingDir, executablePath) {
559
+ const state = executableState(executablePath);
560
+ if (state === "usable") return;
561
+ throw new Error(
562
+ `the archive downloaded, but ${relative(stagingDir, executablePath)} ${state} after unzipping.`
563
+ );
564
+ }
527
565
  function moveStagedInstallIntoCache(stagingDir, staged) {
528
566
  const target = join(CACHE_DIR, relative(stagingDir, staged.path));
529
567
  const aside = join(CACHE_ROOT_DIR, `${REPLACED_PREFIX}${randomUUID()}`);
@@ -8,7 +8,7 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemManifest,
10
10
  fetchRegistryManifest
11
- } from "./chunk-QXPCARFE.js";
11
+ } from "./chunk-I5KY7EZP.js";
12
12
 
13
13
  // src/registry/resolver.ts
14
14
  function defaultWarn(message) {
@@ -52,6 +52,7 @@ function downloadFile(url, dest, options = {}) {
52
52
  return new Promise((resolve, reject) => {
53
53
  const follow = (u, hops = 0) => {
54
54
  let activeResponse;
55
+ let responseDiscarded = false;
55
56
  let responsePipelineStarted = false;
56
57
  let requestError;
57
58
  let request;
@@ -61,15 +62,15 @@ function downloadFile(url, dest, options = {}) {
61
62
  if (res.statusCode && REDIRECT_CODES.has(res.statusCode)) {
62
63
  const location = res.headers.location;
63
64
  if (location) {
65
+ responseDiscarded = true;
66
+ res.destroy();
64
67
  if (hops >= MAX_REDIRECTS) {
65
- res.resume();
66
68
  removePartialFile(tmp);
67
69
  reject(
68
70
  new Error(`Download failed: more than ${MAX_REDIRECTS} redirects from ${url}`)
69
71
  );
70
72
  return;
71
73
  }
72
- res.resume();
73
74
  try {
74
75
  follow(redirectTarget(location, u), hops + 1);
75
76
  } catch (error) {
@@ -80,7 +81,8 @@ function downloadFile(url, dest, options = {}) {
80
81
  }
81
82
  }
82
83
  if (res.statusCode !== 200) {
83
- res.resume();
84
+ responseDiscarded = true;
85
+ res.destroy();
84
86
  removePartialFile(tmp);
85
87
  reject(new Error(`Download failed: HTTP ${res.statusCode}`));
86
88
  return;
@@ -107,6 +109,7 @@ function downloadFile(url, dest, options = {}) {
107
109
  request.destroy(new Error(`Download timed out after ${timeoutMs}ms`));
108
110
  });
109
111
  request.on("error", (err) => {
112
+ if (responseDiscarded) return;
110
113
  if (responsePipelineStarted) {
111
114
  requestError = err;
112
115
  activeResponse?.destroy(err);
@@ -0,0 +1,210 @@
1
+ import { createRequire as __hf_createRequire } from "node:module";
2
+ import { fileURLToPath as __hf_fileURLToPath } from "node:url";
3
+ import { dirname as __hf_dirname } from "node:path";
4
+ var require = __hf_createRequire(import.meta.url);
5
+ var __filename = __hf_fileURLToPath(import.meta.url);
6
+ var __dirname = __hf_dirname(__filename);
7
+
8
+ // ../parsers/dist/mediaDuration.js
9
+ var COMPOSITION_ATTRIBUTES = Object.freeze({
10
+ start: "data-start",
11
+ duration: "data-duration",
12
+ trackIndex: "data-track-index",
13
+ derivedEnd: "data-end",
14
+ legacyTrack: "data-layer"
15
+ });
16
+ var CANONICAL_AUTHORED_TIMING_ATTRIBUTES = Object.freeze([
17
+ COMPOSITION_ATTRIBUTES.start,
18
+ COMPOSITION_ATTRIBUTES.duration,
19
+ COMPOSITION_ATTRIBUTES.trackIndex
20
+ ]);
21
+ var DERIVED_TIMING_ATTRIBUTES = Object.freeze([
22
+ COMPOSITION_ATTRIBUTES.derivedEnd
23
+ ]);
24
+ var LEGACY_TIMING_ATTRIBUTES = Object.freeze([
25
+ COMPOSITION_ATTRIBUTES.derivedEnd,
26
+ COMPOSITION_ATTRIBUTES.legacyTrack
27
+ ]);
28
+ function parseNumeric(value) {
29
+ if (value == null || value.trim() === "") return null;
30
+ const parsed = Number(value);
31
+ return Number.isFinite(parsed) ? parsed : null;
32
+ }
33
+ var nonNegative = (raw) => {
34
+ const value = parseNumeric(raw);
35
+ return value !== null && value >= 0 ? value : null;
36
+ };
37
+ function readMediaOffsetSeconds(getAttr) {
38
+ return nonNegative(getAttr("data-playback-start")) ?? nonNegative(getAttr("data-media-start")) ?? 0;
39
+ }
40
+ var MIN_PLAYBACK_RATE = 0.1;
41
+ var MAX_PLAYBACK_RATE = 10;
42
+ function clampPlaybackRate(raw) {
43
+ return Number.isFinite(raw) && raw > 0 ? Math.max(MIN_PLAYBACK_RATE, Math.min(MAX_PLAYBACK_RATE, raw)) : 1;
44
+ }
45
+ function readPlaybackRate(getAttr, fallback = 1) {
46
+ const authored = Number.parseFloat(getAttr("data-playback-rate") ?? "");
47
+ return clampPlaybackRate(Number.isFinite(authored) && authored > 0 ? authored : fallback);
48
+ }
49
+ function readDataDurationSeconds(getAttr) {
50
+ const duration = parseNumeric(getAttr("data-duration"));
51
+ return duration !== null && duration > 0 ? duration : null;
52
+ }
53
+ function readAuthoredDurationSeconds(getAttr, startSeconds) {
54
+ const duration = readDataDurationSeconds(getAttr);
55
+ if (duration !== null) return duration;
56
+ const end = parseNumeric(getAttr("data-end"));
57
+ return end !== null ? end - startSeconds : null;
58
+ }
59
+ var DEFAULT_IMAGE_TIMELINE_DURATION_SECONDS = 3;
60
+ function resolveNaturalDurationSeconds(sourceDurationSeconds, mediaStartSeconds, playbackRate) {
61
+ if (!Number.isFinite(sourceDurationSeconds)) return null;
62
+ const remaining = Math.max(0, sourceDurationSeconds - mediaStartSeconds);
63
+ return remaining / clampPlaybackRate(playbackRate);
64
+ }
65
+ function resolveMediaDuration(input) {
66
+ const { tag, authoredDurationSeconds, sourceDurationSeconds, mediaStartSeconds, playbackRate } = input;
67
+ if (authoredDurationSeconds !== null && authoredDurationSeconds > 0) {
68
+ return { seconds: authoredDurationSeconds, source: "authored" };
69
+ }
70
+ if (tag === "img") {
71
+ return { seconds: DEFAULT_IMAGE_TIMELINE_DURATION_SECONDS, source: "default" };
72
+ }
73
+ if (sourceDurationSeconds === null) {
74
+ return { seconds: null, source: "pending", reason: "source duration not yet probed" };
75
+ }
76
+ const seconds = resolveNaturalDurationSeconds(
77
+ sourceDurationSeconds,
78
+ mediaStartSeconds,
79
+ playbackRate
80
+ );
81
+ if (seconds === null) {
82
+ return { seconds: null, source: "pending", reason: "source reported a non-finite duration" };
83
+ }
84
+ return { seconds, source: "media" };
85
+ }
86
+
87
+ // ../parsers/dist/assets.js
88
+ import { isAbsolute, relative, resolve } from "path";
89
+ import { posix } from "path";
90
+ function decodeWellFormedEscapes(path) {
91
+ return path.replace(/(?:%[0-9A-Fa-f]{2})+/g, (run) => {
92
+ try {
93
+ return decodeURIComponent(run);
94
+ } catch {
95
+ return run;
96
+ }
97
+ });
98
+ }
99
+ function splitUrlSuffix(urlValue) {
100
+ const queryIdx = urlValue.indexOf("?");
101
+ const hashIdx = urlValue.indexOf("#");
102
+ if (queryIdx < 0 && hashIdx < 0) return { basePath: urlValue, suffix: "" };
103
+ let cutIdx = urlValue.length;
104
+ if (queryIdx >= 0) cutIdx = Math.min(cutIdx, queryIdx);
105
+ if (hashIdx >= 0) cutIdx = Math.min(cutIdx, hashIdx);
106
+ return { basePath: urlValue.slice(0, cutIdx), suffix: urlValue.slice(cutIdx) };
107
+ }
108
+ function decodedUrlPath(url) {
109
+ return decodeWellFormedEscapes(splitUrlSuffix(url).basePath);
110
+ }
111
+ function encodeUrlPath(path) {
112
+ return encodeURIComponent(path).replace(/%2F/g, "/").replace(/['()]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
113
+ }
114
+ function decodeCssEscapes(text) {
115
+ return text.replaceAll("\0", "\uFFFD").replace(
116
+ /\\(?:([0-9a-f]{1,6})(?:\r\n|[ \t\r\n\f])?|(\r\n|[\n\r\f])|([\s\S]))/gi,
117
+ (_escaped, hex, lineBreak, char) => {
118
+ if (hex === void 0) return lineBreak === void 0 ? char : "";
119
+ const code = Number.parseInt(hex, 16);
120
+ if (code === 0 || code > 1114111 || code >= 55296 && code <= 57343) return "\uFFFD";
121
+ return String.fromCodePoint(code);
122
+ }
123
+ );
124
+ }
125
+ var CSS_URL_RE = /\burl\(\s*(["']?)([^)"'\s](?:[^)"']*[^)"'\s])?)\1\s*\)/g;
126
+ var PATH_ATTRS = ["src", "href"];
127
+ function isNonRelativeUrl(val) {
128
+ return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/");
129
+ }
130
+ function isPathInside(childPath, parentPath) {
131
+ const absChild = resolve(childPath);
132
+ const absParent = resolve(parentPath);
133
+ if (absChild === absParent) return true;
134
+ const rel = relative(absParent, absChild);
135
+ return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
136
+ }
137
+ var { join, resolve: resolve2, dirname } = posix;
138
+ var isAbsoluteOrSpecial = isNonRelativeUrl;
139
+ function needsRewrite(val) {
140
+ return val.startsWith("../") || val === "..";
141
+ }
142
+ function rewriteAssetPath(compSrcPath, relativePath, assetExists) {
143
+ if (isAbsoluteOrSpecial(relativePath)) return relativePath;
144
+ const compDir = dirname(compSrcPath);
145
+ if (!compDir || compDir === ".") return relativePath;
146
+ const { basePath, suffix } = splitUrlSuffix(relativePath);
147
+ const slashed = basePath.replace(/\\/g, "/");
148
+ if (!slashed || slashed.startsWith("/")) return relativePath;
149
+ const filePath = decodeWellFormedEscapes(slashed);
150
+ const sibling = resolve2("/", join(compDir, filePath)).slice(1);
151
+ if (!needsRewrite(filePath) && (!assetExists || !assetExists(sibling))) return relativePath;
152
+ return encodeUrlPath(sibling) + suffix;
153
+ }
154
+ function rewriteAssetPaths(elements, compSrcPath, getAttr, setAttr, assetExists) {
155
+ for (const el of elements) {
156
+ for (const attr of PATH_ATTRS) {
157
+ const val = (getAttr(el, attr) || "").trim();
158
+ const rewritten = rewriteAssetPath(compSrcPath, val, assetExists);
159
+ if (rewritten !== val) {
160
+ setAttr(el, attr, rewritten);
161
+ }
162
+ }
163
+ }
164
+ }
165
+ function rewriteInlineStyleAssetUrls(elements, compSrcPath, getStyle, setStyle, assetExists) {
166
+ const compDir = dirname(compSrcPath);
167
+ if (!compDir || compDir === ".") return;
168
+ for (const el of elements) {
169
+ const style = getStyle(el);
170
+ if (!style) continue;
171
+ const rewritten = rewriteCssAssetUrls(style, compSrcPath, assetExists);
172
+ if (rewritten !== style) {
173
+ setStyle(el, rewritten);
174
+ }
175
+ }
176
+ }
177
+ function rewriteCssAssetUrls(cssText, compSrcPath, assetExists) {
178
+ if (!cssText) return cssText;
179
+ return cssText.replace(CSS_URL_RE, (full, quote, rawUrl) => {
180
+ const urlValue = (rawUrl || "").trim();
181
+ const rewritten = rewriteAssetPath(compSrcPath, urlValue, assetExists);
182
+ if (rewritten === urlValue) return full;
183
+ return `url(${quote || ""}${rewritten}${quote || ""})`;
184
+ });
185
+ }
186
+
187
+ export {
188
+ readMediaOffsetSeconds,
189
+ MIN_PLAYBACK_RATE,
190
+ MAX_PLAYBACK_RATE,
191
+ clampPlaybackRate,
192
+ readPlaybackRate,
193
+ readDataDurationSeconds,
194
+ readAuthoredDurationSeconds,
195
+ resolveNaturalDurationSeconds,
196
+ resolveMediaDuration,
197
+ decodeWellFormedEscapes,
198
+ splitUrlSuffix,
199
+ decodedUrlPath,
200
+ encodeUrlPath,
201
+ decodeCssEscapes,
202
+ CSS_URL_RE,
203
+ PATH_ATTRS,
204
+ isNonRelativeUrl,
205
+ isPathInside,
206
+ rewriteAssetPath,
207
+ rewriteAssetPaths,
208
+ rewriteInlineStyleAssetUrls,
209
+ rewriteCssAssetUrls
210
+ };