hyperframes 0.8.142 → 0.8.143

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 (189) hide show
  1. package/dist/{add-YS2RCWEK.js → add-Q5EYDUAY.js} +18 -17
  2. package/dist/{animatedGifPrep-SAMCDT7T.js → animatedGifPrep-H2DUQEZ3.js} +15 -14
  3. package/dist/{asset-BLWC2NWB.js → asset-C7JBYYX4.js} +4 -4
  4. package/dist/{assetCataloger-FVNBBRP3.js → assetCataloger-FRO4G6OU.js} +8 -7
  5. package/dist/{auth-DRZB7OAC.js → auth-FRWLCO36.js} +1 -1
  6. package/dist/{autoUpdate-I5I3BOJK.js → autoUpdate-E4OZXQK6.js} +2 -2
  7. package/dist/{backgroundChecks-VR2QHGNY.js → backgroundChecks-FSUVHN5L.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-4YUHQI6X.js → batchRender-4U73BYTU.js} +11 -10
  10. package/dist/{beats-7OT7ALV3.js → beats-U6KJWF35.js} +32 -27
  11. package/dist/{benchmark-Q2XQCRTR.js → benchmark-5ONT7V7B.js} +15 -14
  12. package/dist/{browser-7VAWQQZC.js → browser-R4DU46IE.js} +4 -4
  13. package/dist/{bundleWithLocalizedFonts-DDMLLL2R.js → bundleWithLocalizedFonts-VH55VOAL.js} +2 -2
  14. package/dist/{capture-HEJS6M5A.js → capture-26G2DPSI.js} +18 -17
  15. package/dist/{capture-U7ABPKS5.js → capture-OGQAEYKO.js} +2 -2
  16. package/dist/{catalog-DVJ3XPDN.js → catalog-RKORTIUE.js} +19 -18
  17. package/dist/{catch-up-DF6AVSN2.js → catch-up-4OBERRQO.js} +5 -5
  18. package/dist/{check-KXORRWAE.js → check-P2XDN57S.js} +43 -42
  19. package/dist/{checkBrowser-J7HZJTRH.js → checkBrowser-NTGJGAEA.js} +42 -41
  20. package/dist/{chunk-EFDXGAAD.js → chunk-2LBBHMKT.js} +1 -1
  21. package/dist/{chunk-IDX52YJN.js → chunk-33RZPZ4K.js} +189 -42
  22. package/dist/{chunk-JU6Y5TTZ.js → chunk-3NE7ZYU2.js} +2 -2
  23. package/dist/{chunk-TQFG7HTI.js → chunk-3RM2ETQT.js} +0 -168
  24. package/dist/{chunk-PFCFR3KZ.js → chunk-442JNXRM.js} +1 -1
  25. package/dist/{chunk-YFT3BL7N.js → chunk-4M4EC7JX.js} +19 -12
  26. package/dist/{chunk-AM5L5YIA.js → chunk-4OA4LDTU.js} +1 -1
  27. package/dist/{chunk-LQASVU3I.js → chunk-5FISWJ37.js} +12 -4
  28. package/dist/{chunk-JYYOAKHS.js → chunk-6IIGT7BX.js} +1 -1
  29. package/dist/chunk-6TPZSTCL.js +3681 -0
  30. package/dist/{chunk-QGRFOOLE.js → chunk-6XMFEICO.js} +263 -75
  31. package/dist/{chunk-YHRZQJXH.js → chunk-7UYBQ6NF.js} +260 -67
  32. package/dist/{chunk-U7E736AJ.js → chunk-BFDJ63J5.js} +32 -14
  33. package/dist/{chunk-WCJGTLPF.js → chunk-BHVFTYSI.js} +6 -3
  34. package/dist/{chunk-B6SMSALD.js → chunk-BT27OYYX.js} +9 -9
  35. package/dist/{chunk-IXCTG2WY.js → chunk-BYK73CR7.js} +4 -4
  36. package/dist/{chunk-75JJVANE.js → chunk-CLOH4LIB.js} +3 -3
  37. package/dist/{chunk-H2X52H2N.js → chunk-DF2BHILQ.js} +3 -3
  38. package/dist/{chunk-DPHJKWP5.js → chunk-F26LCYRY.js} +42 -34
  39. package/dist/{chunk-5Z63TBTX.js → chunk-FH7WODJH.js} +1 -1
  40. package/dist/{chunk-LTGGTEMA.js → chunk-FVYXDXEV.js} +2 -2
  41. package/dist/{chunk-KYN364DU.js → chunk-GNBGPUJ7.js} +6 -8
  42. package/dist/{chunk-RVCWIIZ7.js → chunk-GV5R5B7Q.js} +1 -1
  43. package/dist/{chunk-FZK35GT4.js → chunk-HC7EVDEL.js} +1 -1
  44. package/dist/{chunk-MVTUV4TP.js → chunk-HLYOEIWM.js} +14 -6
  45. package/dist/{chunk-WSGY5CDQ.js → chunk-HMT2RPZU.js} +6 -6
  46. package/dist/{chunk-JOTLPC6S.js → chunk-HW4AKJ5F.js} +1 -1
  47. package/dist/{chunk-IMY4QQTQ.js → chunk-I7QGQAZM.js} +8 -8
  48. package/dist/{chunk-JFKL3WAE.js → chunk-IWFLMU2N.js} +104 -19
  49. package/dist/{chunk-IHFUKJOR.js → chunk-K2FLNJVB.js} +8 -2
  50. package/dist/chunk-KJJLA674.js +121 -0
  51. package/dist/{chunk-BPZVDBHY.js → chunk-KO5QBV73.js} +1 -1
  52. package/dist/{chunk-WGVOWWVK.js → chunk-KQLGTGE5.js} +3 -3
  53. package/dist/{chunk-R2JEKLDZ.js → chunk-LVX6NK36.js} +3 -3
  54. package/dist/{chunk-6UYZB4TY.js → chunk-LW6HO6U3.js} +4 -4
  55. package/dist/{chunk-OZUQF4NB.js → chunk-MQZVBHEY.js} +123 -8
  56. package/dist/{chunk-7FCDA4RH.js → chunk-N3DQEVSI.js} +2 -2
  57. package/dist/{chunk-A4KQZXZI.js → chunk-NE55C6S5.js} +4 -2
  58. package/dist/{chunk-6RAD4BCC.js → chunk-OBXQRJWQ.js} +2 -2
  59. package/dist/{chunk-LBKDQKWV.js → chunk-OSSHSIMD.js} +1 -1
  60. package/dist/{chunk-TY6XOHEM.js → chunk-P7THMINS.js} +3 -3
  61. package/dist/{chunk-HMUF7FEO.js → chunk-PAGIICKN.js} +2 -2
  62. package/dist/{chunk-OSUKETIH.js → chunk-PJU63L6W.js} +1 -1
  63. package/dist/{chunk-GYE63V4P.js → chunk-POLR33RB.js} +20 -13
  64. package/dist/{chunk-7M4KAPAA.js → chunk-PUGIRFPX.js} +2 -2
  65. package/dist/{chunk-XGMNQQTJ.js → chunk-QFN7NVWM.js} +1 -1
  66. package/dist/{chunk-D2KNWIQ6.js → chunk-QFSCCQIR.js} +1 -1
  67. package/dist/{chunk-WTMUCJ6Z.js → chunk-QRKLPWEX.js} +1 -1
  68. package/dist/{chunk-XTLBLWOV.js → chunk-QVYVUCWD.js} +1 -1
  69. package/dist/{chunk-GK4AIFIH.js → chunk-SDYDNHEE.js} +34 -3
  70. package/dist/{chunk-2NCHQUPX.js → chunk-SQLK7SJL.js} +1 -1
  71. package/dist/{chunk-PMRBLBUP.js → chunk-T42U2W2R.js} +14 -2
  72. package/dist/{chunk-QXPCARFE.js → chunk-TAMQYQGJ.js} +1 -1
  73. package/dist/{chunk-PXSM4HPB.js → chunk-U3X3TPBW.js} +1 -1
  74. package/dist/{chunk-FWRNQOLT.js → chunk-UICWP23D.js} +1 -1
  75. package/dist/{chunk-OKCR3JTO.js → chunk-UM2GRYM3.js} +13 -10
  76. package/dist/{chunk-LJAU4TPS.js → chunk-VIVBA6E6.js} +2 -2
  77. package/dist/{chunk-DZEVA7DI.js → chunk-W35EKBS6.js} +2 -2
  78. package/dist/{chunk-YEIFI443.js → chunk-WPNE5NEP.js} +1 -1
  79. package/dist/{chunk-IW2CKH6A.js → chunk-XONFUK3M.js} +48 -25
  80. package/dist/{chunk-JLKMWY2T.js → chunk-Y6QL2LGO.js} +8 -5
  81. package/dist/{chunk-THXFSPLV.js → chunk-ZIRIDSDB.js} +1 -1
  82. package/dist/chunk-ZLW2V65P.js +209 -0
  83. package/dist/{chunk-6UM3R7PP.js → chunk-ZQQ3SEIE.js} +33 -32
  84. package/dist/{clean-KTHTV5G5.js → clean-YHGPY33K.js} +23 -22
  85. package/dist/cli.js +57 -159
  86. package/dist/{cloud-ARSZWALC.js → cloud-DOFI5ISR.js} +4 -4
  87. package/dist/{cloudrun-NM7RXOCL.js → cloudrun-KTZ4XDHL.js} +13 -12
  88. package/dist/commands/contrast-audit.browser.js +60 -4
  89. package/dist/commands/layout-audit.browser.js +68 -0
  90. package/dist/{compare-CY4UO3RW.js → compare-SMMIZN2C.js} +37 -36
  91. package/dist/{compiler-VTH2D3ID.js → compiler-TEXQWW6N.js} +14 -10
  92. package/dist/{component-FRUIAXIR.js → component-B3GCNGSS.js} +5 -5
  93. package/dist/{compositions-CUSY6ZYY.js → compositions-OQNZZTKF.js} +38 -33
  94. package/dist/{delete-KT3VHP4L.js → delete-EL5LVSEP.js} +4 -4
  95. package/dist/{deterministicFonts-F6WIVL2W.js → deterministicFonts-U2BIMGPG.js} +3 -3
  96. package/dist/{dist-7SZU7MA7.js → dist-5UVIRMSM.js} +7 -6
  97. package/dist/{dist-2GC6XKRQ.js → dist-XN234YFQ.js} +41 -39
  98. package/dist/{doctor-4ROTBL5U.js → doctor-UOL3OI2A.js} +17 -16
  99. package/dist/{dom-IROKGVJI.js → dom-37K6YOH4.js} +2 -2
  100. package/dist/{events-Q5PXT5UC.js → events-K2DB2PBC.js} +2 -2
  101. package/dist/{events-QJDVMKSR.js → events-NIZBS6S7.js} +3 -3
  102. package/dist/{feedback-PQ7TWESA.js → feedback-QMP4E6L7.js} +13 -12
  103. package/dist/{figma-JN5DDBDS.js → figma-2AUJRNVC.js} +3 -3
  104. package/dist/fontLocalizeCli.js +18 -17
  105. package/dist/{get-KT6OTERO.js → get-P5NC7SRM.js} +4 -4
  106. package/dist/{gpuPolicy-LCBWVGEH.js → gpuPolicy-7N5MCE2G.js} +15 -14
  107. package/dist/{grade-compare-VS3RP73G.js → grade-compare-HV5AFZ6P.js} +37 -36
  108. package/dist/{help-AD6FIZIO.js → help-3TSTXBLN.js} +1 -1
  109. package/dist/{history-ZRWYRY7R.js → history-D65XFJ6D.js} +6 -6
  110. package/dist/hyperframe-runtime.js +25 -25
  111. package/dist/hyperframe.manifest.json +1 -1
  112. package/dist/hyperframe.runtime.iife.js +25 -25
  113. package/dist/hyperframes-player.global.js +3 -3
  114. package/dist/hyperframes-slideshow.global.js +23 -23
  115. package/dist/{info-WBBQA2AX.js → info-TXV7MLFO.js} +17 -16
  116. package/dist/{init-A2XBDFGF.js → init-OSDMJZJV.js} +38 -37
  117. package/dist/{inspect-CLTZHA5O.js → inspect-RQQSAYIJ.js} +38 -37
  118. package/dist/{installer-WQDRVXH4.js → installer-CDOB32HE.js} +11 -10
  119. package/dist/{keyframes-3FYOK6H6.js → keyframes-V75Q6GRM.js} +10 -10
  120. package/dist/{lambda-Y2PA2BGS.js → lambda-RODV4RCX.js} +12 -11
  121. package/dist/{layout-4KP5O7IJ.js → layout-IZAI5SFC.js} +38 -37
  122. package/dist/{lint-V4GRFHOJ.js → lint-PLXOXY5R.js} +14 -13
  123. package/dist/{lintProject-RG2KGAXB.js → lintProject-OQ6H6XBR.js} +7 -6
  124. package/dist/{list-OQ4VED6E.js → list-BQBPNKDZ.js} +5 -5
  125. package/dist/{login-W47NKN5S.js → login-NP6F4FHC.js} +4 -4
  126. package/dist/{manager-DXB7JDHU.js → manager-GXYF4AVO.js} +2 -2
  127. package/dist/{manager-524RPYO7.js → manager-RFZNG5YT.js} +2 -2
  128. package/dist/{media-treatment-HJYL3EME.js → media-treatment-PXGMZ4A4.js} +22 -20
  129. package/dist/{models-DYBAD2GQ.js → models-CEZM6XZ7.js} +17 -16
  130. package/dist/{motionShot-7NE2YBB3.js → motionShot-R4GHYWYM.js} +25 -24
  131. package/dist/{normalize-IGLHCWTF.js → normalize-H6KUHHEI.js} +18 -7
  132. package/dist/{normalize-audio-INKCLMS2.js → normalize-audio-MQ7NFCOV.js} +10 -6
  133. package/dist/{open-TYC5THVY.js → open-AKQTGNXF.js} +5 -5
  134. package/dist/{pipeline-EVKEPQEW.js → pipeline-SYJYP2RM.js} +17 -16
  135. package/dist/{play-QMZEM6X3.js → play-NBH4B7PL.js} +31 -29
  136. package/dist/{present-Y7IK3C4W.js → present-XAX55CFS.js} +26 -25
  137. package/dist/{preview-5OQRYE6A.js → preview-OLANKNFA.js} +26 -25
  138. package/dist/{producer-Q6G6JU7B.js → producer-Q6YNZZUJ.js} +1 -1
  139. package/dist/{projectConfig-RJN3DKDB.js → projectConfig-EM26P45P.js} +13 -12
  140. package/dist/{publication-QCPGGN3U.js → publication-OXWJZKSX.js} +8 -7
  141. package/dist/{publish-VZLFIGYY.js → publish-4VBWP2UB.js} +17 -16
  142. package/dist/{remove-background-TKOEHBA5.js → remove-background-REB7427G.js} +19 -18
  143. package/dist/{render-XTXE5CRU.js → render-3CVZ2SZG.js} +13 -12
  144. package/dist/{render-KIIIF6PS.js → render-K25YOG3M.js} +19 -18
  145. package/dist/{render-X3NFNVEQ.js → render-TSE75QUL.js} +35 -34
  146. package/dist/{render-batch-M55YZLZ5.js → render-batch-GGUOK3DS.js} +13 -12
  147. package/dist/{renderCancellation-X5BEHAZU.js → renderCancellation-PZRWB53I.js} +15 -14
  148. package/dist/renderSetupWorker.js +7 -6
  149. package/dist/{resolver-GAMXRA42.js → resolver-S5VK6UCB.js} +10 -9
  150. package/dist/{sherpa-ZYTNFHD5.js → sherpa-LVIUEAGF.js} +18 -17
  151. package/dist/skills/hyperframes-cli/references/doctor-browser.md +24 -1
  152. package/dist/skills/media-use/scripts/lib/cache.mjs +28 -14
  153. package/dist/skills/media-use/scripts/lib/cache.test.mjs +110 -0
  154. package/dist/skills/media-use/scripts/lib/duck.mjs +2 -1
  155. package/dist/skills/media-use/scripts/lib/duck.test.mjs +87 -0
  156. package/dist/skills/media-use/scripts/lib/probe.mjs +6 -1
  157. package/dist/skills/media-use/scripts/lib/probe.test.mjs +73 -0
  158. package/dist/skills/media-use/scripts/lib/words.mjs +1 -1
  159. package/dist/{skills-CZHVAD3J.js → skills-I65FU5HD.js} +5 -5
  160. package/dist/{skillsUpdateCheck-6WLLX53A.js → skillsUpdateCheck-J57RNNIV.js} +3 -3
  161. package/dist/{slideshow-EJ4IMY6P.js → slideshow-4OJEPWNZ.js} +1 -1
  162. package/dist/{snapshot-K7BTJPYQ.js → snapshot-YROOGY22.js} +42 -38
  163. package/dist/{src-3I3RH3V5.js → src-JO5JOV7Y.js} +16 -13
  164. package/dist/{src-YUW26JU5.js → src-X426BZAG.js} +17 -16
  165. package/dist/{staticProjectServer-IKCSGN2B.js → staticProjectServer-5VMBS262.js} +23 -22
  166. package/dist/studio/assets/{hyperframes-player-sAsRuV73.js → hyperframes-player-BXSuksFh.js} +3 -3
  167. package/dist/studio/assets/{index-D3Vij9t1.js → index-BgOVCqjo.js} +1 -1
  168. package/dist/studio/assets/{index-D5q2_7Gw.js → index-FgyO_5Kv.js} +1 -1
  169. package/dist/studio/assets/{index-B-wffzRH.js → index-J7jpL4pj.js} +150 -150
  170. package/dist/studio/index.html +1 -1
  171. package/dist/studio/index.js +122 -160
  172. package/dist/studio/index.js.map +1 -1
  173. package/dist/{studio-api-SQ3NXFSM.js → studio-api-VRBZUGAE.js} +22 -17
  174. package/dist/{studioServer-VVEO7XCH.js → studioServer-DBNKZ6I6.js} +50 -49
  175. package/dist/{synthesize-77PTU6C5.js → synthesize-C3IWDAXF.js} +2 -2
  176. package/dist/{telemetry-FQDKR5XA.js → telemetry-CXAX3TO3.js} +3 -3
  177. package/dist/{timeline-N6ZASFNE.js → timeline-VQ34WH7J.js} +91 -69
  178. package/dist/{tokens-2OIIBBCW.js → tokens-62R7VFAZ.js} +4 -4
  179. package/dist/{transcribe-4F6MK73N.js → transcribe-7KR7IPJA.js} +18 -17
  180. package/dist/{transcribe-7YTUCXDX.js → transcribe-XOHPPL2O.js} +11 -11
  181. package/dist/{tts-TOHSPWEG.js → tts-MUV42JXT.js} +6 -6
  182. package/dist/{updateCheck-AZ2COZFR.js → updateCheck-POYNH3B5.js} +2 -2
  183. package/dist/{upgrade-QAJEYB4X.js → upgrade-NBNOT7J2.js} +2 -2
  184. package/dist/{urlDownloader-LSMFEO3R.js → urlDownloader-3NS63A7B.js} +14 -13
  185. package/dist/{validate-GW5MDL36.js → validate-Y2QDHAEP.js} +40 -27
  186. package/dist/{video-PRNOKUK3.js → video-SJDMTSTL.js} +15 -14
  187. package/package.json +1 -1
  188. package/dist/chunk-J4UX3RS3.js +0 -3717
  189. /package/dist/{chunk-HBBJFK6I.js → chunk-APDLWWFG.js} +0 -0
@@ -0,0 +1,209 @@
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
+ if (!basePath) return relativePath;
148
+ const filePath = decodeWellFormedEscapes(basePath);
149
+ const sibling = resolve2("/", join(compDir, filePath)).slice(1);
150
+ if (!needsRewrite(filePath) && (!assetExists || !assetExists(sibling))) return relativePath;
151
+ return encodeUrlPath(sibling) + suffix;
152
+ }
153
+ function rewriteAssetPaths(elements, compSrcPath, getAttr, setAttr, assetExists) {
154
+ for (const el of elements) {
155
+ for (const attr of PATH_ATTRS) {
156
+ const val = (getAttr(el, attr) || "").trim();
157
+ const rewritten = rewriteAssetPath(compSrcPath, val, assetExists);
158
+ if (rewritten !== val) {
159
+ setAttr(el, attr, rewritten);
160
+ }
161
+ }
162
+ }
163
+ }
164
+ function rewriteInlineStyleAssetUrls(elements, compSrcPath, getStyle, setStyle, assetExists) {
165
+ const compDir = dirname(compSrcPath);
166
+ if (!compDir || compDir === ".") return;
167
+ for (const el of elements) {
168
+ const style = getStyle(el);
169
+ if (!style) continue;
170
+ const rewritten = rewriteCssAssetUrls(style, compSrcPath, assetExists);
171
+ if (rewritten !== style) {
172
+ setStyle(el, rewritten);
173
+ }
174
+ }
175
+ }
176
+ function rewriteCssAssetUrls(cssText, compSrcPath, assetExists) {
177
+ if (!cssText) return cssText;
178
+ return cssText.replace(CSS_URL_RE, (full, quote, rawUrl) => {
179
+ const urlValue = (rawUrl || "").trim();
180
+ const rewritten = rewriteAssetPath(compSrcPath, urlValue, assetExists);
181
+ if (rewritten === urlValue) return full;
182
+ return `url(${quote || ""}${rewritten}${quote || ""})`;
183
+ });
184
+ }
185
+
186
+ export {
187
+ readMediaOffsetSeconds,
188
+ MIN_PLAYBACK_RATE,
189
+ MAX_PLAYBACK_RATE,
190
+ clampPlaybackRate,
191
+ readPlaybackRate,
192
+ readDataDurationSeconds,
193
+ readAuthoredDurationSeconds,
194
+ resolveNaturalDurationSeconds,
195
+ resolveMediaDuration,
196
+ decodeWellFormedEscapes,
197
+ splitUrlSuffix,
198
+ decodedUrlPath,
199
+ encodeUrlPath,
200
+ decodeCssEscapes,
201
+ CSS_URL_RE,
202
+ PATH_ATTRS,
203
+ isNonRelativeUrl,
204
+ isPathInside,
205
+ rewriteAssetPath,
206
+ rewriteAssetPaths,
207
+ rewriteInlineStyleAssetUrls,
208
+ rewriteCssAssetUrls
209
+ };
@@ -9,7 +9,11 @@ import {
9
9
  formatPreviewProxyBox,
10
10
  hdrToSdrToneMapFilter,
11
11
  parseFirstFrameColour
12
- } from "./chunk-YFT3BL7N.js";
12
+ } from "./chunk-4M4EC7JX.js";
13
+ import {
14
+ decodeAuthoredAttribute,
15
+ scanHtmlOpeningTags
16
+ } from "./chunk-MQZVBHEY.js";
13
17
  import {
14
18
  mkdirWithinProject,
15
19
  realProjectRoot,
@@ -19,19 +23,18 @@ import {
19
23
  cleanAssetUrl,
20
24
  isRemoteOrInlineUrl,
21
25
  isUnresolvedAssetPlaceholder,
22
- maskNonScannableRanges,
23
- resolveLocalAssetCandidates
24
- } from "./chunk-JFKL3WAE.js";
26
+ resolveExistingLocalAsset
27
+ } from "./chunk-IWFLMU2N.js";
25
28
  import {
26
29
  findFfBinary
27
30
  } from "./chunk-PJ3HDUCY.js";
28
31
  import {
29
32
  rewriteAssetPath
30
- } from "./chunk-TQFG7HTI.js";
33
+ } from "./chunk-ZLW2V65P.js";
31
34
 
32
- // ../studio-server/dist/chunk-74JVVCWL.js
33
- import { existsSync, statSync } from "fs";
34
- import { relative, resolve, sep } from "path";
35
+ // ../studio-server/dist/chunk-RN33UALN.js
36
+ import { statSync } from "fs";
37
+ import { sep } from "path";
35
38
  import { execFile } from "child_process";
36
39
  import { extname } from "path";
37
40
  var execFileRunner = (command, args, options) => new Promise((resolvePromise) => {
@@ -279,29 +282,27 @@ async function probeAssetCodec(filePath, runner, cache = defaultProbeCache) {
279
282
  rememberProbeResult(cache, filePath, { target, mtimeMs: stat.mtimeMs, size: stat.size, facts });
280
283
  return facts;
281
284
  }
282
- var VIDEO_SRC_RE = /<video\b[^>]*\bsrc\s*=\s*["']([^"']+)["'][^>]*>/gi;
283
- function resolveExistingLocalAsset(projectDir, url) {
284
- const projectRoot = resolve(projectDir);
285
- const resolvedPath = resolveLocalAssetCandidates(projectRoot, url).find(
286
- (candidate) => existsSync(candidate)
287
- );
288
- if (!resolvedPath) return null;
289
- const rootRelative = relative(projectRoot, resolvedPath).split(sep).join("/");
290
- return { resolvedPath, rootRelativePathname: `/${rootRelative}` };
285
+ function resolveExistingLocalAsset2(projectDir, url) {
286
+ const asset = resolveExistingLocalAsset(projectDir, url);
287
+ if (!asset) return null;
288
+ return {
289
+ resolvedPath: asset.resolved,
290
+ rootRelativePathname: `/${asset.rootRelativePath.split(sep).join("/")}`
291
+ };
291
292
  }
292
293
  function collectLocalVideoAssets(projectDir, htmlSources) {
293
294
  const candidates = /* @__PURE__ */ new Map();
294
295
  for (const { html, compSrcPath } of htmlSources) {
295
- const scannable = maskNonScannableRanges(html);
296
- const re = new RegExp(VIDEO_SRC_RE.source, VIDEO_SRC_RE.flags);
297
- let match;
298
- while ((match = re.exec(scannable)) !== null) {
299
- const rawSrc = match[1] ?? "";
296
+ for (const tag of scanHtmlOpeningTags(html)) {
297
+ if (tag.name !== "video" || !tag.closed) continue;
298
+ const attribute = tag.attributes.find((attr) => attr.name === "src");
299
+ if (attribute?.kind !== "value") continue;
300
+ const rawSrc = decodeAuthoredAttribute(attribute.value);
300
301
  if (isUnresolvedAssetPlaceholder(rawSrc)) continue;
301
302
  const src = cleanAssetUrl(rawSrc);
302
303
  if (!src || isRemoteOrInlineUrl(src)) continue;
303
304
  const rootRelativeSrc = compSrcPath ? rewriteAssetPath(compSrcPath, src) : src;
304
- const resolved = resolveExistingLocalAsset(projectDir, rootRelativeSrc);
305
+ const resolved = resolveExistingLocalAsset2(projectDir, rootRelativeSrc);
305
306
  if (!resolved) continue;
306
307
  candidates.set(resolved.resolvedPath, resolved.rootRelativePathname);
307
308
  }
@@ -335,12 +336,12 @@ async function scanProjectMediaCodecMap(projectDir, htmlSources, options = {}) {
335
336
  return map;
336
337
  }
337
338
 
338
- // ../studio-server/dist/chunk-QP7LKFU2.js
339
+ // ../studio-server/dist/chunk-6EFY2WPN.js
339
340
  import { spawn } from "child_process";
340
341
  import { createHash, randomUUID } from "crypto";
341
342
  import { existsSync as existsSync2, renameSync, statSync as statSync2, unlinkSync as unlinkSync2, utimesSync } from "fs";
342
- import { basename, dirname, isAbsolute, join as join2, relative as relative2, resolve as resolve2, sep as sep2 } from "path";
343
- import { existsSync as existsSync3, readdirSync, statSync as statSync3, unlinkSync } from "fs";
343
+ import { basename, dirname, isAbsolute, join as join2, relative, resolve, sep as sep2 } from "path";
344
+ import { existsSync, readdirSync, statSync as statSync3, unlinkSync } from "fs";
344
345
  import { extname as extname2, join } from "path";
345
346
  var DEFAULT_MAX_BYTES = 10 * 1024 * 1024 * 1024;
346
347
  var DEFAULT_STALE_TEMP_MS = 60 * 60 * 1e3;
@@ -413,7 +414,7 @@ function evictCacheEntries(entries, staleTemps, now, maxIdleMs, maxBytes, dryRun
413
414
  }
414
415
  for (const entry of kept) {
415
416
  if (bytesAfter <= maxBytes) break;
416
- if (!entry.protected && existsSync3(entry.path)) remove(entry, true);
417
+ if (!entry.protected && existsSync(entry.path)) remove(entry, true);
417
418
  }
418
419
  return { removed, bytesBefore, bytesAfter };
419
420
  }
@@ -424,7 +425,7 @@ function cleanupProxyCache(cacheDir, options = {}) {
424
425
  if (shouldSkipSweep(cacheDir, now, minSweepIntervalMs)) {
425
426
  return { removed: [], bytesBefore: 0, bytesAfter: 0, skipped: true };
426
427
  }
427
- if (!existsSync3(cacheDir)) {
428
+ if (!existsSync(cacheDir)) {
428
429
  return { removed: [], bytesBefore: 0, bytesAfter: 0, skipped: false };
429
430
  }
430
431
  const maxBytes = options.maxBytes ?? defaults.maxBytes;
@@ -512,15 +513,15 @@ async function waitForProxy(promise, timeoutMs = DEFAULT_PROXY_WAIT_TIMEOUT_MS)
512
513
  }
513
514
  }
514
515
  function canonicalizeProxySource(projectDir, absoluteSourcePath) {
515
- const requestedProjectDir = resolve2(projectDir);
516
- const requestedSourcePath = resolve2(absoluteSourcePath);
517
- const requestedRelativePath = relative2(requestedProjectDir, requestedSourcePath);
516
+ const requestedProjectDir = resolve(projectDir);
517
+ const requestedSourcePath = resolve(absoluteSourcePath);
518
+ const requestedRelativePath = relative(requestedProjectDir, requestedSourcePath);
518
519
  if (requestedRelativePath === ".." || requestedRelativePath.startsWith(`..${sep2}`) || isAbsolute(requestedRelativePath)) {
519
520
  throw new ProxySourceOutsideProjectError();
520
521
  }
521
522
  const canonicalProjectDir = realProjectRoot(projectDir);
522
523
  const canonicalSourcePath = realpath(absoluteSourcePath);
523
- const canonicalRelativePath = relative2(canonicalProjectDir, canonicalSourcePath);
524
+ const canonicalRelativePath = relative(canonicalProjectDir, canonicalSourcePath);
524
525
  const sourceIsInsideCanonicalProject = canonicalRelativePath !== ".." && !canonicalRelativePath.startsWith(`..${sep2}`) && !isAbsolute(canonicalRelativePath);
525
526
  return {
526
527
  projectDir: canonicalProjectDir,
@@ -6,28 +6,28 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  redactHome
9
- } from "./chunk-IXCTG2WY.js";
9
+ } from "./chunk-BYK73CR7.js";
10
10
  import "./chunk-Z27A7NUB.js";
11
11
  import "./chunk-5ETJX6WM.js";
12
12
  import {
13
13
  loadProducer
14
- } from "./chunk-XTLBLWOV.js";
14
+ } from "./chunk-QVYVUCWD.js";
15
15
  import "./chunk-3DKN5WKL.js";
16
16
  import {
17
17
  formatBytes
18
- } from "./chunk-IHFUKJOR.js";
19
- import "./chunk-YHRZQJXH.js";
20
- import "./chunk-OKCR3JTO.js";
18
+ } from "./chunk-K2FLNJVB.js";
19
+ import "./chunk-7UYBQ6NF.js";
20
+ import "./chunk-UM2GRYM3.js";
21
21
  import {
22
22
  DEFAULT_HISTORY_ROOT,
23
23
  listProjectHistories,
24
24
  pruneGoneProjectHistories
25
25
  } from "./chunk-QZ3AZTXI.js";
26
- import "./chunk-U7E736AJ.js";
26
+ import "./chunk-BFDJ63J5.js";
27
27
  import {
28
28
  CACHE_DIR_NAME,
29
29
  cleanupProxyCache
30
- } from "./chunk-6UM3R7PP.js";
30
+ } from "./chunk-ZQQ3SEIE.js";
31
31
  import "./chunk-G75ENCEZ.js";
32
32
  import "./chunk-EOVYQ3IG.js";
33
33
  import "./chunk-KOEWEFHK.js";
@@ -49,39 +49,40 @@ import {
49
49
  directorySizeBytes,
50
50
  gcExtractionCache,
51
51
  resolveExtractCacheDir
52
- } from "./chunk-IDX52YJN.js";
53
- import "./chunk-DPHJKWP5.js";
54
- import "./chunk-A4KQZXZI.js";
52
+ } from "./chunk-33RZPZ4K.js";
53
+ import "./chunk-F26LCYRY.js";
54
+ import "./chunk-NE55C6S5.js";
55
55
  import "./chunk-USDEMXXL.js";
56
- import "./chunk-YFT3BL7N.js";
57
- import "./chunk-OZUQF4NB.js";
58
- import "./chunk-DPVXBVLL.js";
59
- import "./chunk-J4UX3RS3.js";
56
+ import "./chunk-4M4EC7JX.js";
57
+ import "./chunk-6TPZSTCL.js";
60
58
  import "./chunk-VC76R6W2.js";
61
59
  import "./chunk-YA62XGXS.js";
60
+ import "./chunk-MQZVBHEY.js";
62
61
  import "./chunk-OFQWTKPW.js";
62
+ import "./chunk-DPVXBVLL.js";
63
63
  import "./chunk-T76PLPD6.js";
64
64
  import "./chunk-FXMKHHPO.js";
65
65
  import "./chunk-RQVDTPGD.js";
66
66
  import "./chunk-4PFZPP2N.js";
67
67
  import "./chunk-LCSMOLGX.js";
68
68
  import "./chunk-TWWSYAKJ.js";
69
- import "./chunk-IW2CKH6A.js";
70
- import "./chunk-JFKL3WAE.js";
71
- import "./chunk-HBBJFK6I.js";
69
+ import "./chunk-XONFUK3M.js";
70
+ import "./chunk-IWFLMU2N.js";
71
+ import "./chunk-APDLWWFG.js";
72
72
  import "./chunk-PJ3HDUCY.js";
73
- import "./chunk-TQFG7HTI.js";
74
- import "./chunk-GK4AIFIH.js";
73
+ import "./chunk-3RM2ETQT.js";
74
+ import "./chunk-ZLW2V65P.js";
75
+ import "./chunk-SDYDNHEE.js";
75
76
  import "./chunk-2PSPARWP.js";
76
- import "./chunk-PMRBLBUP.js";
77
+ import "./chunk-T42U2W2R.js";
77
78
  import {
78
79
  withMeta
79
- } from "./chunk-JLKMWY2T.js";
80
+ } from "./chunk-Y6QL2LGO.js";
80
81
  import "./chunk-K4WIOZFP.js";
81
82
  import "./chunk-XUXGIA7H.js";
82
83
  import "./chunk-WERLJGIC.js";
83
84
  import "./chunk-ISN5GRYI.js";
84
- import "./chunk-DZEVA7DI.js";
85
+ import "./chunk-W35EKBS6.js";
85
86
  import "./chunk-KNU5COPB.js";
86
87
  import "./chunk-3GXQPCJC.js";
87
88
  import {