hyperframes 0.8.114 → 0.8.116

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 (179) hide show
  1. package/dist/{add-KCBOVKEU.js → add-5AOKGJRR.js} +17 -16
  2. package/dist/{animatedGifPrep-U7FMC7DB.js → animatedGifPrep-XKCVQ4ZL.js} +7 -7
  3. package/dist/{asset-AJ4ZZE3K.js → asset-QE74HE7H.js} +2 -2
  4. package/dist/{assetCataloger-5LCGR5XU.js → assetCataloger-3VJRWB3N.js} +3 -3
  5. package/dist/{auth-PSEHAWSA.js → auth-HQE2GKY2.js} +2 -2
  6. package/dist/{autoUpdate-E32YLKFZ.js → autoUpdate-MH57H575.js} +2 -2
  7. package/dist/{backgroundChecks-FNHBA7YI.js → backgroundChecks-JP2GHEP4.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-QVJ7NEUH.js → batchRender-KIFBKKVN.js} +4 -4
  10. package/dist/{beats-F67KZC3V.js → beats-V334Q2GV.js} +16 -12
  11. package/dist/{benchmark-CGD6CPRK.js → benchmark-62QZH5YE.js} +13 -13
  12. package/dist/{browser-FPX3Z2AR.js → browser-EK7OBU6W.js} +10 -10
  13. package/dist/{bundleWithLocalizedFonts-4CVITCYK.js → bundleWithLocalizedFonts-263BUY7C.js} +2 -2
  14. package/dist/{capture-F2Y7TIHU.js → capture-56HMZGJW.js} +18 -13
  15. package/dist/{capture-GLHK4ST7.js → capture-6F3XPKXI.js} +2 -2
  16. package/dist/{catalog-4BZX7MQQ.js → catalog-JO7WHBYC.js} +17 -16
  17. package/dist/{check-IO3HWLLU.js → check-S4RZIS26.js} +34 -32
  18. package/dist/{checkBrowser-JTQ7ABCL.js → checkBrowser-NVWULRE7.js} +33 -31
  19. package/dist/{chunk-GDJ74GHW.js → chunk-23KZNTIV.js} +1 -1
  20. package/dist/{chunk-L5QASNBN.js → chunk-2E4A277E.js} +1 -1
  21. package/dist/{chunk-QPR4N2D4.js → chunk-2HE5ZOXK.js} +1 -1
  22. package/dist/{chunk-XFJXFNJF.js → chunk-34AE4KPB.js} +29 -14
  23. package/dist/{chunk-G2T2X6FZ.js → chunk-63O3AR5U.js} +3 -3
  24. package/dist/{chunk-T3NMEYGM.js → chunk-6FRHKGRY.js} +1 -1
  25. package/dist/{chunk-MST5JBOR.js → chunk-6TSA2KDM.js} +1 -1
  26. package/dist/{chunk-SIN32SJB.js → chunk-7Z2XNQ7F.js} +2 -2
  27. package/dist/{chunk-XMAL2A7Y.js → chunk-AIYKVE4Y.js} +1 -1
  28. package/dist/{chunk-FCEFKWPM.js → chunk-AKZD7VWZ.js} +2 -2
  29. package/dist/{chunk-3SH322X7.js → chunk-C47XJXSK.js} +15 -18
  30. package/dist/{chunk-P3FGUSFK.js → chunk-CCWSLTWA.js} +10 -10
  31. package/dist/{chunk-752X6G7T.js → chunk-CHWO3UN6.js} +2 -2
  32. package/dist/{chunk-LDSWUYZB.js → chunk-CVE7OUZE.js} +3 -3
  33. package/dist/{chunk-MLLBZR2U.js → chunk-DRLB5STV.js} +2 -2
  34. package/dist/{chunk-IPXPSCWV.js → chunk-ENQL7NCM.js} +3 -3
  35. package/dist/{chunk-SYQOD3W7.js → chunk-EWR3SLQV.js} +1 -1
  36. package/dist/{chunk-6U3K3U62.js → chunk-EWUI4PU6.js} +1 -1
  37. package/dist/{chunk-BOUDTDBQ.js → chunk-FERBBWDU.js} +1 -1
  38. package/dist/{chunk-DR7QW6C5.js → chunk-FFF36PQA.js} +2 -2
  39. package/dist/{chunk-UUDQD62L.js → chunk-FSLYPQ5Z.js} +1 -1
  40. package/dist/{chunk-HTQR7SUZ.js → chunk-GNQF4NZW.js} +1 -1
  41. package/dist/{chunk-7ZR25WGW.js → chunk-IGWZCCLO.js} +7 -7
  42. package/dist/{chunk-MR6BQLGM.js → chunk-IX75NQSA.js} +2 -2
  43. package/dist/{chunk-SSM2TJYE.js → chunk-JBZYEZPZ.js} +1 -1
  44. package/dist/{chunk-JH7ZJRDL.js → chunk-JYB7NKO6.js} +3 -3
  45. package/dist/{chunk-LSSIYIXI.js → chunk-KNCLHJB5.js} +3 -3
  46. package/dist/{chunk-OCNCK5FQ.js → chunk-MZPMAU25.js} +2 -2
  47. package/dist/{chunk-3IUSKIZW.js → chunk-NCQV2NMY.js} +1 -1
  48. package/dist/{chunk-YJEGT5L6.js → chunk-NITBGIHR.js} +2 -2
  49. package/dist/{chunk-PZTEY73C.js → chunk-NRTZ2JPC.js} +1 -1
  50. package/dist/{chunk-IP3XINRB.js → chunk-P6LJ4Y32.js} +23 -2944
  51. package/dist/chunk-PAZUQZYV.js +2961 -0
  52. package/dist/{chunk-7543YIMQ.js → chunk-PHBPRHKK.js} +1 -1
  53. package/dist/{chunk-HGMKPPGD.js → chunk-QITH7ALB.js} +4 -4
  54. package/dist/{chunk-WAS5VEA4.js → chunk-RTLYNXAC.js} +1 -1
  55. package/dist/{chunk-RKSRXPKV.js → chunk-S5Q46UEI.js} +5 -5
  56. package/dist/{chunk-LYNBNESS.js → chunk-SXV67HVP.js} +207 -74
  57. package/dist/{chunk-4KGMIOMY.js → chunk-TEYBS6T3.js} +10 -7
  58. package/dist/{chunk-RDMAU7AJ.js → chunk-TRLP3CSL.js} +1 -1
  59. package/dist/{chunk-LMC46FK5.js → chunk-TY76XMMP.js} +2 -2
  60. package/dist/{chunk-XXKBPGPJ.js → chunk-VJ2RAP65.js} +2 -2
  61. package/dist/{chunk-ENHAGQEP.js → chunk-VLB4NGRR.js} +1 -1
  62. package/dist/{chunk-ZMMSMDCA.js → chunk-VU5IDWKX.js} +2 -2
  63. package/dist/chunk-WN62HDA7.js +93 -0
  64. package/dist/{chunk-E52XEEAA.js → chunk-WUUEWXA2.js} +1 -1
  65. package/dist/chunk-WWL6YGYK.js +3541 -0
  66. package/dist/{chunk-VLC7JS4K.js → chunk-XTCMIITZ.js} +1 -1
  67. package/dist/{chunk-BORVRAHJ.js → chunk-YX55Y7UO.js} +14 -18
  68. package/dist/{clean-MCL76KQH.js → clean-DPW2FTMM.js} +17 -17
  69. package/dist/cli.js +53 -52
  70. package/dist/{cloud-444K6HIK.js → cloud-OAYSRXAJ.js} +4 -4
  71. package/dist/{cloudrun-BML6ZG7K.js → cloudrun-NM2ZMAJV.js} +5 -5
  72. package/dist/{compare-CGNTCOR2.js → compare-CZC6ROYF.js} +28 -26
  73. package/dist/{compiler-ZHVIEP26.js → compiler-3MFRD377.js} +3 -3
  74. package/dist/{component-HTXLOIHR.js → component-6D5RBOWZ.js} +3 -3
  75. package/dist/{compositions-KK46F5AC.js → compositions-5KCUVODZ.js} +12 -12
  76. package/dist/{delete-SSRZKKWQ.js → delete-ZGLELTUJ.js} +2 -2
  77. package/dist/{deterministicFonts-A4CNCSAL.js → deterministicFonts-O7BTFDJU.js} +2 -2
  78. package/dist/{dist-HRBNHR4M.js → dist-JAOG6MYW.js} +1 -1
  79. package/dist/{dist-OKRUIHYU.js → dist-XSSXGBRH.js} +3 -3
  80. package/dist/{doctor-IIOX25KM.js → doctor-CICSVC7I.js} +11 -11
  81. package/dist/{events-TYMMAKHX.js → events-V3O6Q5ZH.js} +9 -9
  82. package/dist/{events-DCUZBRW6.js → events-Y4NBIJBP.js} +10 -10
  83. package/dist/{feedback-RIAGW6LG.js → feedback-EA3K6QXT.js} +11 -11
  84. package/dist/{figma-VBOUGJNX.js → figma-WOOHCXDA.js} +3 -3
  85. package/dist/fontLocalizeCli.js +10 -10
  86. package/dist/{get-LT6NUGNR.js → get-64SDPINM.js} +2 -2
  87. package/dist/{gpuPolicy-LRMOZXFU.js → gpuPolicy-TFCLAD64.js} +7 -7
  88. package/dist/{grade-compare-WWYQSQUM.js → grade-compare-NXAFWDBR.js} +28 -26
  89. package/dist/{gsapParserAcorn-SZANFUAQ.js → gsapParserAcorn-FLWABPQM.js} +1 -1
  90. package/dist/{help-55ZV2M5U.js → help-6H4ICA27.js} +1 -1
  91. package/dist/{history-QCY7CO4P.js → history-TPRRROOR.js} +23 -21
  92. package/dist/hyperframe-runtime.js +53 -53
  93. package/dist/hyperframe.manifest.json +1 -1
  94. package/dist/hyperframe.runtime.iife.js +53 -53
  95. package/dist/hyperframes-player.global.js +1 -1
  96. package/dist/{info-ROTXHRAH.js → info-DDXWWAM3.js} +12 -12
  97. package/dist/{init-5XFOWGGN.js → init-KULZFAS7.js} +24 -23
  98. package/dist/{inspect-3UF4VLTM.js → inspect-VEJH72DJ.js} +29 -27
  99. package/dist/{installer-DGYYDGWJ.js → installer-TBL3PE2J.js} +6 -5
  100. package/dist/{keyframes-OFZ6XNMC.js → keyframes-W6KIRZ4O.js} +13 -13
  101. package/dist/{lambda-OQBFCEFA.js → lambda-JJXODPS5.js} +6 -6
  102. package/dist/{layout-B4XF2734.js → layout-KVG7PJ3F.js} +29 -27
  103. package/dist/{lint-3YIJITTC.js → lint-GQ5IVVCN.js} +13 -13
  104. package/dist/{lintProject-TOLC6HDS.js → lintProject-FDJYTOVM.js} +1 -1
  105. package/dist/{list-276FF3QE.js → list-QZ7LV6HF.js} +2 -2
  106. package/dist/{login-SA3MCAIS.js → login-526R3KCB.js} +4 -4
  107. package/dist/{media-treatment-ICA5DWHS.js → media-treatment-H7LGSO3I.js} +13 -13
  108. package/dist/{models-JF5OOZ5A.js → models-WOEP555T.js} +8 -8
  109. package/dist/{motionShot-TQBDZZ4M.js → motionShot-235LNUY7.js} +17 -14
  110. package/dist/{normalize-audio-URNASKUV.js → normalize-audio-GTAESDG6.js} +12 -12
  111. package/dist/{pipeline-IWPF5ZMK.js → pipeline-NBHOEZPA.js} +7 -7
  112. package/dist/{play-JYBAII35.js → play-SBTJLOWX.js} +23 -22
  113. package/dist/{preflight-2GH2Z4GZ.js → preflight-KQCXRC6W.js} +8 -8
  114. package/dist/{present-WIEZRZET.js → present-TXULFA2J.js} +18 -18
  115. package/dist/{preview-YUPU646E.js → preview-E2U4ER7H.js} +19 -18
  116. package/dist/{producer-SL66UNEP.js → producer-DR3TOPSC.js} +1 -1
  117. package/dist/{projectConfig-7AKXZNNR.js → projectConfig-QBYFCJYE.js} +8 -7
  118. package/dist/{publication-B2OERUY7.js → publication-TWGRIP5F.js} +3 -3
  119. package/dist/{publish-ZGKT7KED.js → publish-JOUHOKGX.js} +10 -9
  120. package/dist/{remove-background-4LRTT6YL.js → remove-background-GQZIZBHM.js} +8 -8
  121. package/dist/{render-AX77WC3C.js → render-2LC2DUR3.js} +13 -13
  122. package/dist/{render-TGCDBKMP.js → render-JR3YIYZ4.js} +4 -4
  123. package/dist/{render-F3QVCKKA.js → render-UVGS7PLJ.js} +23 -22
  124. package/dist/{render-batch-WRQFW4UC.js → render-batch-MYH6ZGO3.js} +4 -4
  125. package/dist/{renderCancellation-BFCQYGVV.js → renderCancellation-EIBZHTFW.js} +7 -7
  126. package/dist/renderSetupWorker.js +1 -1
  127. package/dist/{resolver-37UOGAMT.js → resolver-4Z5YISAU.js} +6 -5
  128. package/dist/{sherpa-SDVKYXCX.js → sherpa-UX3MQXO5.js} +8 -8
  129. package/dist/skills/hyperframes/SKILL.md +4 -0
  130. package/dist/skills/hyperframes-cli/SKILL.md +8 -0
  131. package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +8 -0
  132. package/dist/skills/media-use/audio/scripts/audio.mjs +4 -1
  133. package/dist/skills/media-use/audio/scripts/audio.test.mjs +33 -0
  134. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +1 -0
  135. package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +44 -1
  136. package/dist/{skills-M6ETUUH5.js → skills-GXETMIED.js} +12 -12
  137. package/dist/{skillsUpdateCheck-UTX5LT5C.js → skillsUpdateCheck-XS7OE6FX.js} +3 -3
  138. package/dist/{snapshot-HMDAENTY.js → snapshot-OAHQ3EVJ.js} +29 -27
  139. package/dist/{src-PLWCT745.js → src-AZ5YCYQP.js} +9 -9
  140. package/dist/{src-PJJ6NISA.js → src-X6ACPJHG.js} +6 -6
  141. package/dist/{staticProjectServer-XDH5SQV6.js → staticProjectServer-P4QSLLF6.js} +17 -16
  142. package/dist/{status-LENRPQS5.js → status-KDRWJBPW.js} +7 -7
  143. package/dist/studio/assets/{hyperframes-player-aXNJKiIg.js → hyperframes-player-mGYvPVpw.js} +1 -1
  144. package/dist/studio/assets/{index-Bn2RJNTJ.js → index-BWHt0-ir.js} +1 -1
  145. package/dist/studio/assets/{index-Dz7doz9l.js → index-DYNaXPVf.js} +203 -203
  146. package/dist/studio/assets/{index-C9N-DGjC.js → index-Dr3hNpvS.js} +1 -1
  147. package/dist/studio/assets/{index-BYnsJnJV.css → index-t1LH6H5H.css} +1 -1
  148. package/dist/studio/{chunk-BIUXP3PG.js → chunk-3F47EFCT.js} +142 -277
  149. package/dist/studio/chunk-3F47EFCT.js.map +1 -0
  150. package/dist/studio/{chunk-K47E2ZJA.js → chunk-5EKWJZLM.js} +504 -17
  151. package/dist/studio/chunk-5EKWJZLM.js.map +1 -0
  152. package/dist/studio/{chunk-VWT7STY3.js → chunk-J6Q572FA.js} +2 -2
  153. package/dist/studio/{domEditingLayers-V67MS4WP.js → domEditingLayers-OL7GLSS4.js} +3 -5
  154. package/dist/studio/index.d.ts +146 -40
  155. package/dist/studio/index.html +2 -2
  156. package/dist/studio/index.js +4021 -3591
  157. package/dist/studio/index.js.map +1 -1
  158. package/dist/studio/player.js +2 -2
  159. package/dist/studio/styles.css +1 -1
  160. package/dist/{studio-api-E5WFZ7YK.js → studio-api-SYQOPCMB.js} +12 -10
  161. package/dist/{studioServer-C7GTHTRY.js → studioServer-ANSX6DY2.js} +50 -50
  162. package/dist/{system-4KRSV2B7.js → system-B6UYANYL.js} +7 -7
  163. package/dist/{telemetry-XH6D37RL.js → telemetry-AZEW2DZP.js} +10 -10
  164. package/dist/{timeline-4RR7O6QW.js → timeline-VIKY65W6.js} +17 -17
  165. package/dist/{tokens-MVTK3RPO.js → tokens-SSGCAC7E.js} +2 -2
  166. package/dist/{transcribe-I6WDPH7E.js → transcribe-O33POKJY.js} +13 -13
  167. package/dist/{transcribe-3UXXEDXX.js → transcribe-PF6BUHHQ.js} +8 -8
  168. package/dist/{updateCheck-ELMPFCBF.js → updateCheck-Y4SUY6VE.js} +2 -2
  169. package/dist/{upgrade-6UAOGP4D.js → upgrade-EGIS5OCB.js} +2 -2
  170. package/dist/{urlDownloader-4KNER64L.js → urlDownloader-UBY27GFW.js} +6 -6
  171. package/dist/usage-EC3KFUIJ.js +2139 -0
  172. package/dist/{validate-ZMMGUMBD.js → validate-FE74RMPD.js} +17 -16
  173. package/dist/{video-GINAMW5I.js → video-DODRESEY.js} +7 -7
  174. package/package.json +1 -1
  175. package/dist/chunk-C6AIZOQN.js +0 -3541
  176. package/dist/studio/chunk-BIUXP3PG.js.map +0 -1
  177. package/dist/studio/chunk-K47E2ZJA.js.map +0 -1
  178. /package/dist/studio/{chunk-VWT7STY3.js.map → chunk-J6Q572FA.js.map} +0 -0
  179. /package/dist/studio/{domEditingLayers-V67MS4WP.js.map → domEditingLayers-OL7GLSS4.js.map} +0 -0
@@ -12,13 +12,15 @@ import {
12
12
  parseSourceDocument,
13
13
  patchElementInHtml,
14
14
  probeElementInSource,
15
+ probeElementsInSource,
15
16
  relinkSplitHalves,
16
17
  relinkSplitHalvesInHtml,
17
18
  removeElementFromHtml,
19
+ removeElementsFromHtml,
18
20
  splitElementInHtml,
19
21
  unwrapElementsFromHtml,
20
22
  wrapElementsInHtml
21
- } from "./chunk-XFJXFNJF.js";
23
+ } from "./chunk-34AE4KPB.js";
22
24
  import {
23
25
  atomicTempPath,
24
26
  createFileAtomically,
@@ -31,7 +33,7 @@ import {
31
33
  measureAudio,
32
34
  requiredFfmpeg,
33
35
  resolveLocalAudioPath
34
- } from "./chunk-GDJ74GHW.js";
36
+ } from "./chunk-23KZNTIV.js";
35
37
  import {
36
38
  PROXY_PARAMS_VERSION,
37
39
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -57,11 +59,11 @@ import {
57
59
  shouldPrewarmProxy,
58
60
  waitForProxy,
59
61
  walkDir
60
- } from "./chunk-LMC46FK5.js";
62
+ } from "./chunk-TY76XMMP.js";
61
63
  import {
62
64
  findTimelineScript,
63
65
  parseGsapScriptAcorn
64
- } from "./chunk-RDMAU7AJ.js";
66
+ } from "./chunk-TRLP3CSL.js";
65
67
  import {
66
68
  STUDIO_MANUAL_EDITS_PATH
67
69
  } from "./chunk-KC5XXX3X.js";
@@ -76,16 +78,16 @@ import {
76
78
  formatRenderOutputTimestamp,
77
79
  parseFps,
78
80
  sameInstant
79
- } from "./chunk-FCEFKWPM.js";
81
+ } from "./chunk-AKZD7VWZ.js";
80
82
  import {
81
83
  MagicString,
82
84
  VALID_CANVAS_RESOLUTIONS,
83
85
  unrollComputedTimeline
84
- } from "./chunk-UUDQD62L.js";
86
+ } from "./chunk-FSLYPQ5Z.js";
85
87
  import {
86
88
  addScenePartsManifest,
87
89
  ensureHfIds
88
- } from "./chunk-OCNCK5FQ.js";
90
+ } from "./chunk-MZPMAU25.js";
89
91
  import {
90
92
  findStartTags,
91
93
  injectScriptsIntoHtml,
@@ -95,7 +97,7 @@ import {
95
97
  resolveRateSpec,
96
98
  sourceTimeAt,
97
99
  stripEmbeddedRuntimeScripts
98
- } from "./chunk-C6AIZOQN.js";
100
+ } from "./chunk-WWL6YGYK.js";
99
101
  import {
100
102
  ProjectRootMissingError,
101
103
  folderGone,
@@ -108,7 +110,7 @@ import {
108
110
  import {
109
111
  isWithinProjectRoot,
110
112
  readProjectFile
111
- } from "./chunk-YJEGT5L6.js";
113
+ } from "./chunk-NITBGIHR.js";
112
114
  import {
113
115
  FFPROBE_PATH_ENV,
114
116
  findFfBinary
@@ -213,7 +215,7 @@ function stampFileHfIds(filePath) {
213
215
  }
214
216
  }
215
217
 
216
- // ../studio-server/dist/chunk-EPL4YKGI.js
218
+ // ../studio-server/dist/chunk-E3HLZKPI.js
217
219
  import { randomUUID as randomUUID6 } from "crypto";
218
220
  import { mkdir as mkdir2, readdir as readdir3, rm as rm3, rmdir, writeFile } from "fs/promises";
219
221
  import {
@@ -1015,6 +1017,7 @@ function ignoresCase(dir) {
1015
1017
  return self !== void 0 && other?.ino === self.ino && other.dev === self.dev;
1016
1018
  }
1017
1019
  var blocks = (removed, added) => added.startsWith(`${removed}/`) || removed.startsWith(`${added}/`);
1020
+ var MAX_TIMER_MS = 2 ** 31 - 1;
1018
1021
  var takesWrite = (window2, at) => window2.idleMs === void 0 || at - (window2.lastWriteAt ?? at) <= window2.idleMs;
1019
1022
  function chainBackFrom(byAfter, hash) {
1020
1023
  const chain = /* @__PURE__ */ new Map();
@@ -1170,7 +1173,7 @@ var Engine = class {
1170
1173
  this.windows.push({ id, who, label, startedAt, lastWriteAt, idleMs, changes: /* @__PURE__ */ new Map() });
1171
1174
  }
1172
1175
  async firstOpen() {
1173
- const sweptAt = Date.now();
1176
+ const sweptAt = this.now();
1174
1177
  for (const file of listProjectFiles(this.dir)) {
1175
1178
  const hash = await this.storeIfPresent(file.path);
1176
1179
  if (this.whereFolder() !== "here") throw this.replaced();
@@ -1202,7 +1205,7 @@ var Engine = class {
1202
1205
  */
1203
1206
  async sweep() {
1204
1207
  if (this.whereFolder() !== "here") return;
1205
- const sweptAt = Date.now();
1208
+ const sweptAt = this.now();
1206
1209
  const changedAt = (file) => Math.min(sweptAt, Math.max(file.mtimeMs, file.ctimeMs));
1207
1210
  const seen = listProjectFiles(this.dir);
1208
1211
  const heard = new Map(this.overwritten);
@@ -1477,7 +1480,7 @@ var Engine = class {
1477
1480
  await this.settle();
1478
1481
  const window2 = { ...this.newGroup(who, label), idleMs };
1479
1482
  this.windows.push(window2);
1480
- this.touch(window2, Date.now());
1483
+ this.touch(window2, this.now());
1481
1484
  const close = () => this.queue(() => this.sweepAndEnd(window2));
1482
1485
  return { id: window2.id, startedAt: window2.startedAt, close };
1483
1486
  });
@@ -1485,11 +1488,19 @@ var Engine = class {
1485
1488
  /** A window with no write for its idleMs ends, so a close that never comes cannot hold every later write. */
1486
1489
  touch(window2, at) {
1487
1490
  window2.lastWriteAt = Math.max(window2.lastWriteAt ?? at, at);
1491
+ this.endWhenIdle(window2, window2.idleMs);
1492
+ }
1493
+ endWhenIdle(window2, delay) {
1488
1494
  clearTimeout(window2.idleTimer);
1489
- if (window2.idleMs === void 0 || !Number.isFinite(window2.idleMs)) return;
1495
+ if (window2.idleMs === void 0 || !Number.isFinite(window2.idleMs) || delay === void 0)
1496
+ return;
1490
1497
  window2.idleTimer = setTimeout(
1491
- () => this.background(() => this.sweepAndEnd(window2)),
1492
- window2.idleMs
1498
+ () => {
1499
+ const left = window2.idleMs - (this.now() - (window2.lastWriteAt ?? this.now()));
1500
+ if (left > 0) this.endWhenIdle(window2, left);
1501
+ else this.background(() => this.sweepAndEnd(window2));
1502
+ },
1503
+ Math.min(delay, MAX_TIMER_MS)
1493
1504
  );
1494
1505
  window2.idleTimer.unref?.();
1495
1506
  }
@@ -1799,7 +1810,7 @@ function historyCache(open2) {
1799
1810
  };
1800
1811
  }
1801
1812
 
1802
- // ../studio-server/dist/chunk-W2SBTCO2.js
1813
+ // ../studio-server/dist/chunk-IMG2GSY6.js
1803
1814
  function getElementScreenshotClip(selector, selectorIndex) {
1804
1815
  let matches;
1805
1816
  try {
@@ -1812,6 +1823,16 @@ function getElementScreenshotClip(selector, selectorIndex) {
1812
1823
  const safeIndex = Math.max(0, Math.min(matches.length - 1, Math.floor(selectorIndex ?? 0)));
1813
1824
  const el = matches[safeIndex] ?? null;
1814
1825
  if (!(el instanceof HTMLElement)) return void 0;
1826
+ const page = window;
1827
+ const faded = page.__hfThumbnailFaded ??= [];
1828
+ for (let node = el; node.parentElement; node = node.parentElement) {
1829
+ for (const sibling of Array.from(node.parentElement.children)) {
1830
+ const style = sibling.style;
1831
+ if (sibling === node || !style) continue;
1832
+ faded.push([style, style.getPropertyValue("opacity"), style.getPropertyPriority("opacity")]);
1833
+ style.setProperty("opacity", "0", "important");
1834
+ }
1835
+ }
1815
1836
  const rect = el.getBoundingClientRect();
1816
1837
  if (rect.width < 4 || rect.height < 4) return void 0;
1817
1838
  const pad = 8;
@@ -1826,6 +1847,14 @@ function getElementScreenshotClip(selector, selectorIndex) {
1826
1847
  height: Math.max(1, Math.min(rect.height + pad * 2, maxHeight))
1827
1848
  };
1828
1849
  }
1850
+ function clearElementScreenshotIsolation() {
1851
+ const page = window;
1852
+ for (const [style, value, priority] of (page.__hfThumbnailFaded ?? []).reverse()) {
1853
+ if (value) style.setProperty("opacity", value, priority);
1854
+ else style.removeProperty("opacity");
1855
+ }
1856
+ page.__hfThumbnailFaded = [];
1857
+ }
1829
1858
 
1830
1859
  // ../studio-server/dist/chunk-WK3ZL3SN.js
1831
1860
  import { resolve as resolve4 } from "path";
@@ -3349,6 +3378,41 @@ function resolveTimelinePositions(anims, labelDefs = []) {
3349
3378
  });
3350
3379
  while (labelIdx < sortedLabels.length) defineLabel(sortedLabels[labelIdx++]);
3351
3380
  }
3381
+ function collectAddLabelDefs(ast, ref, scope, sortedCalls) {
3382
+ const callKeys = sortedCalls.map((c) => ({
3383
+ site: callSiteStart(c),
3384
+ order: c.node.__hfOrder
3385
+ }));
3386
+ const comesAfter = (site, order, labelSite, labelOrder) => {
3387
+ if (site === void 0) return false;
3388
+ if (site !== labelSite) return site > labelSite;
3389
+ return (order ?? -Infinity) > (labelOrder ?? -Infinity);
3390
+ };
3391
+ const defs = [];
3392
+ simple(ast, {
3393
+ // fallow-ignore-next-line complexity
3394
+ CallExpression(node) {
3395
+ const callee = node.callee;
3396
+ const objMatches = ref.kind === "identifier" ? callee.object?.type === "Identifier" && callee.object.name === ref.name : sameMemberAccess(callee.object, ref.node);
3397
+ if (callee?.type !== "MemberExpression" || !objMatches || callee.property?.name !== "addLabel")
3398
+ return;
3399
+ const nameNode = node.arguments?.[0];
3400
+ const name = typeof nameNode?.value === "string" ? nameNode.value : void 0;
3401
+ if (!name) return;
3402
+ const posVal = resolveNode(node.arguments?.[1], scope);
3403
+ const position = typeof posVal === "number" || typeof posVal === "string" ? posVal : void 0;
3404
+ const labelStart = node.__hfSiteStart ?? callee.property?.start;
3405
+ const labelOrder = node.__hfOrder;
3406
+ let order = sortedCalls.length;
3407
+ if (labelStart !== void 0) {
3408
+ order = callKeys.findIndex((k) => comesAfter(k.site, k.order, labelStart, labelOrder));
3409
+ if (order === -1) order = sortedCalls.length;
3410
+ }
3411
+ defs.push({ name, position, order });
3412
+ }
3413
+ });
3414
+ return defs;
3415
+ }
3352
3416
  function compareByLoc(a, b) {
3353
3417
  const aLoc = a.node.callee?.property?.loc?.start;
3354
3418
  const bLoc = b.node.callee?.property?.loc?.start;
@@ -3401,7 +3465,7 @@ function parseGsapScriptAcornForWrite(script) {
3401
3465
  (call) => tweenCallToAnimation(call, scope, script, identifierBindings)
3402
3466
  );
3403
3467
  applyTimelineDefaults(rawAnims, detection.defaults);
3404
- resolveTimelinePositions(rawAnims);
3468
+ resolveTimelinePositions(rawAnims, collectAddLabelDefs(ast, ref, scope, calls));
3405
3469
  const animations = assignStableIds(rawAnims);
3406
3470
  const located = calls.map((call, i) => ({
3407
3471
  id: animations[i].id,
@@ -3675,7 +3739,8 @@ function overwritePosition(ms, call, position) {
3675
3739
  if (call.positionArg) {
3676
3740
  ms.overwrite(call.positionArg.start, call.positionArg.end, valueToCode(position));
3677
3741
  } else {
3678
- ms.appendLeft(call.node.end - 1, `, ${valueToCode(position)}`);
3742
+ const last = call.node.arguments.at(-1);
3743
+ ms.appendLeft(last ? last.end : call.node.end - 1, `, ${valueToCode(position)}`);
3679
3744
  }
3680
3745
  }
3681
3746
  function shiftPositionsInScript(script, targetSelector, delta, root) {
@@ -4397,6 +4462,33 @@ function materializeKeyframesFromScript(script, animationId, keyframes, easeEach
4397
4462
  }
4398
4463
  return ms.toString();
4399
4464
  }
4465
+ function replaceTweenWithKeyframesInScript(script, animationId, edit) {
4466
+ const parsed = parseGsapScriptAcornForWrite(script);
4467
+ const target = parsed?.located.find((l) => l.id === animationId);
4468
+ const call = target?.call;
4469
+ if (!target || call?.varsArg?.type !== "ObjectExpression") return null;
4470
+ const { animation } = target;
4471
+ if (animation.method !== "to" && animation.method !== "from" && animation.method !== "fromTo")
4472
+ return null;
4473
+ const ms = new MagicString(script);
4474
+ const start = animation.resolvedStart ?? animation.position;
4475
+ const moved = typeof start !== "number" || Math.abs(start - edit.position) > 5e-4;
4476
+ const kept = preservedVarsEntries(call.varsArg, script).filter(
4477
+ (e) => !/^\s*duration\s*:/.test(e) && !(moved && /^\s*delay\s*:/.test(e))
4478
+ );
4479
+ const sorted = [...edit.keyframes].sort((a, b) => a.percentage - b.percentage);
4480
+ const parts = [`keyframes: ${buildKeyframeObjectCode(sorted, edit.easeEach)}`, ...kept];
4481
+ parts.push(`duration: ${valueToCode(edit.duration)}`);
4482
+ if (edit.ease) parts.push(`ease: ${JSON.stringify(edit.ease)}`);
4483
+ if (animation.hasUnresolvedSelector || animation.targetSelector !== edit.targetSelector) {
4484
+ const selectorArg = call.node.arguments[0];
4485
+ ms.overwrite(selectorArg.start, selectorArg.end, JSON.stringify(edit.targetSelector));
4486
+ }
4487
+ convertMethodToTo(ms, animation, call, call.varsArg);
4488
+ overwriteVarsArg(ms, call, `{ ${parts.join(", ")} }`);
4489
+ if (moved) overwritePosition(ms, call, edit.position);
4490
+ return ms.toString();
4491
+ }
4400
4492
  function addAnimationWithKeyframesToScript(script, targetSelector, position, duration, keyframes, ease, easeEach) {
4401
4493
  const parsed = parseGsapScriptAcornForWrite(script);
4402
4494
  if (!parsed) return { script, id: "" };
@@ -5122,14 +5214,15 @@ import {
5122
5214
  writeFileSync as writeFileSync42
5123
5215
  } from "fs";
5124
5216
  import { join as join11 } from "path";
5125
- import { createHash as createHash32, randomUUID as randomUUID22 } from "crypto";
5217
+ import { createHash as createHash42, randomUUID as randomUUID22 } from "crypto";
5126
5218
  import { readFileSync as readFileSync8 } from "fs";
5219
+ import { createHash as createHash32 } from "crypto";
5127
5220
  import { existsSync as existsSync7, readFileSync as readFileSync10, statSync as statSync7 } from "fs";
5128
5221
  import { join as join12, resolve as resolve52 } from "path";
5129
5222
  import { execFile } from "child_process";
5130
5223
  import { existsSync as existsSync8, readFileSync as readFileSync11, statSync as statSync8 } from "fs";
5131
5224
  import { dirname as dirname52, join as join13, relative as relative4, sep as sep22 } from "path";
5132
- import { createHash as createHash42, randomBytes } from "crypto";
5225
+ import { createHash as createHash5, randomBytes } from "crypto";
5133
5226
  import { existsSync as existsSync9 } from "fs";
5134
5227
  import { existsSync as existsSync10, readFileSync as readFileSync12, statSync as statSync9 } from "fs";
5135
5228
  import { join as join14, resolve as resolve6 } from "path";
@@ -5142,7 +5235,7 @@ import { basename as basename22, dirname as dirname6, extname as extname2, join
5142
5235
  import { existsSync as existsSync12, readFileSync as readFileSync13 } from "fs";
5143
5236
  import { homedir as homedir2 } from "os";
5144
5237
  import { join as join16 } from "path";
5145
- import { createHash as createHash5 } from "crypto";
5238
+ import { createHash as createHash6 } from "crypto";
5146
5239
  import { readFileSync as readFileSync14, readdirSync as readdirSync5, rmSync as rmSync5 } from "fs";
5147
5240
  import { join as join17 } from "path";
5148
5241
  async function filterCompositionFiles(projectDir, files) {
@@ -6383,6 +6476,21 @@ function bakeVisibilityOnDelete(document2, anim) {
6383
6476
  } catch {
6384
6477
  }
6385
6478
  }
6479
+ function replaceInPlaceUnlessSetOrUnknown(scriptText, body) {
6480
+ const edit = { ...body, easeEach: resolveReplacementEaseEach(scriptText, body) };
6481
+ const inPlace = replaceTweenWithKeyframesInScript(scriptText, body.animationId, edit);
6482
+ if (inPlace !== null) return inPlace;
6483
+ const script = removeAnimationFromScript(scriptText, body.animationId);
6484
+ return addAnimationWithKeyframesToScript(
6485
+ script,
6486
+ body.targetSelector,
6487
+ body.position,
6488
+ body.duration,
6489
+ body.keyframes,
6490
+ body.ease,
6491
+ edit.easeEach
6492
+ ).script;
6493
+ }
6386
6494
  function resolveReplacementEaseEach(scriptText, request) {
6387
6495
  if (request.easeEach !== void 0) return request.easeEach;
6388
6496
  const original = parseGsapScriptAcorn(scriptText).animations.find(
@@ -6454,7 +6562,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
6454
6562
  let block = extractGsapScriptBlock(html);
6455
6563
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
6456
6564
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
6457
- const { GSAP_CDN } = await import("./dist-OKRUIHYU.js");
6565
+ const { GSAP_CDN } = await import("./dist-XSSXGBRH.js");
6458
6566
  const bootstrap = [
6459
6567
  `<script src="${GSAP_CDN}"></script>`,
6460
6568
  "<script>",
@@ -6502,7 +6610,9 @@ async function applyGsapMutations(c, res, mutations) {
6502
6610
  } catch (error) {
6503
6611
  return c.json({ error: error instanceof Error ? error.message : String(error) }, 400);
6504
6612
  }
6613
+ const mutationChanges = [];
6505
6614
  for (const mutation of mutations) {
6615
+ const previousScript = block.scriptText;
6506
6616
  const result = await executeGsapMutation(mutation, block, respond, writer);
6507
6617
  if (result instanceof Response) return result;
6508
6618
  let newScript = typeof result === "string" ? result : result.script;
@@ -6512,6 +6622,7 @@ async function applyGsapMutations(c, res, mutations) {
6512
6622
  if (HOLD_SYNC_MUTATION_TYPES.has(mutation.type)) {
6513
6623
  newScript = writer === "acorn" ? syncPositionHoldsBeforeKeyframes(newScript) : (await loadGsapParser()).syncPositionHoldsBeforeKeyframes(newScript);
6514
6624
  }
6625
+ mutationChanges.push(newScript !== previousScript);
6515
6626
  block.scriptText = newScript;
6516
6627
  }
6517
6628
  const changed = block.scriptText !== initialScript;
@@ -6536,6 +6647,7 @@ async function applyGsapMutations(c, res, mutations) {
6536
6647
  ok: true,
6537
6648
  changed,
6538
6649
  mutated: changed,
6650
+ mutationChanges,
6539
6651
  parsed: parseGsapScriptAcorn(block.scriptText),
6540
6652
  before: beforeHtml,
6541
6653
  after: newHtml,
@@ -6785,17 +6897,7 @@ function executeGsapMutationAcorn(body, block, respond) {
6785
6897
  if (keyframesWritePosition(body.keyframes) || keyframesWriteRotation(body.keyframes)) {
6786
6898
  stripStudioEditsFromTarget(block.document, body.targetSelector);
6787
6899
  }
6788
- const script = removeAnimationFromScript(block.scriptText, body.animationId);
6789
- const added = addAnimationWithKeyframesToScript(
6790
- script,
6791
- body.targetSelector,
6792
- body.position,
6793
- body.duration,
6794
- body.keyframes,
6795
- body.ease,
6796
- resolveReplacementEaseEach(block.scriptText, body)
6797
- );
6798
- return added.script;
6900
+ return replaceInPlaceUnlessSetOrUnknown(block.scriptText, body);
6799
6901
  }
6800
6902
  case "split-animations": {
6801
6903
  if (typeof body.originalId !== "string" || !body.originalId || typeof body.newId !== "string" || !body.newId || typeof body.splitTime !== "number" || !Number.isFinite(body.splitTime) || typeof body.elementStart !== "number" || !Number.isFinite(body.elementStart) || typeof body.elementDuration !== "number" || !Number.isFinite(body.elementDuration) || body.elementDuration <= 0) {
@@ -7117,17 +7219,7 @@ async function executeGsapMutationRecast(body, block, respond) {
7117
7219
  if (keyframesWritePosition(body.keyframes) || keyframesWriteRotation(body.keyframes)) {
7118
7220
  stripStudioEditsFromTarget(block.document, body.targetSelector);
7119
7221
  }
7120
- const script = removeAnimationFromScript2(block.scriptText, body.animationId);
7121
- const added = addAnimationWithKeyframesToScript2(
7122
- script,
7123
- body.targetSelector,
7124
- body.position,
7125
- body.duration,
7126
- body.keyframes,
7127
- body.ease,
7128
- resolveReplacementEaseEach(block.scriptText, body)
7129
- );
7130
- return added.script;
7222
+ return replaceInPlaceUnlessSetOrUnknown(block.scriptText, body);
7131
7223
  }
7132
7224
  case "split-animations": {
7133
7225
  if (typeof body.originalId !== "string" || !body.originalId || typeof body.newId !== "string" || !body.newId || typeof body.splitTime !== "number" || !Number.isFinite(body.splitTime) || typeof body.elementStart !== "number" || !Number.isFinite(body.elementStart) || typeof body.elementDuration !== "number" || !Number.isFinite(body.elementDuration) || body.elementDuration <= 0) {
@@ -7595,11 +7687,14 @@ function registerFileRoutes(api, adapter) {
7595
7687
  return c.json({ error: "targets required" }, 400);
7596
7688
  }
7597
7689
  const originalContent = readFileSync32(ctx.absPath, "utf-8");
7598
- let next = originalContent;
7599
- for (const target of targets) {
7600
- next = removeElementFromHtml(next, target);
7601
- }
7602
- return writeIfChanged(c, ctx.project.dir, ctx.filePath, ctx.absPath, originalContent, next);
7690
+ return writeIfChanged(
7691
+ c,
7692
+ ctx.project.dir,
7693
+ ctx.filePath,
7694
+ ctx.absPath,
7695
+ originalContent,
7696
+ removeElementsFromHtml(originalContent, targets)
7697
+ );
7603
7698
  });
7604
7699
  api.post("/projects/:id/file-mutations/split-batch", async (c) => {
7605
7700
  const body = await c.req.json().catch(() => null);
@@ -8003,6 +8098,19 @@ function registerFileRoutes(api, adapter) {
8003
8098
  const exists = probeElementInSource(content, parsed.target);
8004
8099
  return c.json({ exists });
8005
8100
  });
8101
+ api.post("/projects/:id/file-mutations/probe-elements/*", async (c) => {
8102
+ const ctx = await resolveFileMutationContext(c, adapter, "probe-elements");
8103
+ if ("error" in ctx) return ctx.error;
8104
+ const body = await c.req.json().catch(() => null);
8105
+ if (!Array.isArray(body?.targets)) return c.json({ error: "targets required" }, 400);
8106
+ let content;
8107
+ try {
8108
+ content = readFileSync32(ctx.absPath, "utf-8");
8109
+ } catch {
8110
+ return c.json({ exists: body.targets.map(() => false) });
8111
+ }
8112
+ return c.json({ exists: probeElementsInSource(content, body.targets) });
8113
+ });
8006
8114
  api.patch("/projects/:id/files/*", async (c) => {
8007
8115
  const res = await resolveProjectFile(c, adapter, { mustExist: true });
8008
8116
  if ("error" in res) return res.error;
@@ -8086,17 +8194,18 @@ function registerFileRoutes(api, adapter) {
8086
8194
  });
8087
8195
  if ("error" in res) return res.error;
8088
8196
  const html = readFileSync32(res.absPath, "utf-8");
8197
+ const etag = `${fileContentVersion(html).slice(0, -1)}:gsap-animations:v1"`;
8198
+ const headers = { ETag: etag, "Cache-Control": "no-cache" };
8199
+ if (c.req.header("If-None-Match") === etag) return new Response(null, { status: 304, headers });
8089
8200
  const block = extractGsapScriptBlock(html);
8090
8201
  if (!block) {
8091
- return c.json({
8092
- animations: [],
8093
- timelineVar: "tl",
8094
- preamble: "",
8095
- postamble: ""
8096
- });
8202
+ return c.json(
8203
+ { animations: [], timelineVar: "tl", preamble: "", postamble: "" },
8204
+ 200,
8205
+ headers
8206
+ );
8097
8207
  }
8098
- const parsed = parseGsapScriptAcorn(block.scriptText);
8099
- return c.json(parsed);
8208
+ return c.json(parseGsapScriptAcorn(block.scriptText), 200, headers);
8100
8209
  });
8101
8210
  api.get("/projects/:id/gsap-mutation-capabilities", async (c) => {
8102
8211
  const project = await adapter.resolveProject(c.req.param("id"));
@@ -8246,6 +8355,9 @@ function tagRootCompositionFile(bodyHtml, compPath) {
8246
8355
  if (bodyHtml.slice(match.index, tagEnd).includes("data-composition-file")) return bodyHtml;
8247
8356
  return bodyHtml.slice(0, tagEnd) + ` data-composition-file="${compPath}"` + bodyHtml.slice(tagEnd);
8248
8357
  }
8358
+ function rootHeadContent(rootHtml) {
8359
+ return rootHtml.match(/<head[^>]*>([\s\S]*?)<\/head>/i)?.[1] ?? "";
8360
+ }
8249
8361
  function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, rawOverride) {
8250
8362
  const compFile = join62(projectDir, compPath);
8251
8363
  if (!existsSync42(compFile)) return null;
@@ -8281,11 +8393,7 @@ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, raw
8281
8393
  rewrittenContent = tagRootCompositionFile(rewrittenContent, compPath);
8282
8394
  const indexPath = join62(projectDir, "index.html");
8283
8395
  let headContent = "";
8284
- if (existsSync42(indexPath)) {
8285
- const indexHtml = readFileSync42(indexPath, "utf-8");
8286
- const headMatch = indexHtml.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
8287
- headContent = headMatch?.[1] ?? "";
8288
- }
8396
+ if (existsSync42(indexPath)) headContent = rootHeadContent(readFileSync42(indexPath, "utf-8"));
8289
8397
  if (baseHref && !hasBaseElement(headContent)) {
8290
8398
  headContent = `<base href="${baseHref}">
8291
8399
  ${headContent}`;
@@ -9424,25 +9532,49 @@ function closureOf(read, compPath) {
9424
9532
  return closure;
9425
9533
  }
9426
9534
  var inputSignatures = /* @__PURE__ */ new Map();
9535
+ var rootMemos = /* @__PURE__ */ new Map();
9536
+ var sha1 = (text2) => createHash32("sha1").update(text2).digest("hex");
9537
+ function rootHashes(read) {
9538
+ const source = read(ROOT_COMPOSITION) ?? "";
9539
+ return { root: sha1(source), head: sha1(rootHeadContent(source)) };
9540
+ }
9427
9541
  function compositionInputSignature(projectDir, compPath, projectSignature) {
9428
9542
  const key = `${projectDir}\0${compPath}`;
9429
9543
  const known = inputSignatures.get(key);
9430
9544
  if (known?.projectSignature === projectSignature) return known.inputSignature;
9431
9545
  const read = projectReader(projectDir);
9432
- const inputs = closureOf(read, normalizeSource(compPath) ?? compPath).add(ROOT_COMPOSITION);
9433
- const siblings = [...closureOf(read, ROOT_COMPOSITION)].filter((path) => !inputs.has(path));
9434
- const inputSignature = createProjectSignature(projectDir, new Set(siblings));
9546
+ const comp = normalizeSource(compPath) ?? compPath;
9547
+ const inputs = closureOf(read, comp).add(ROOT_COMPOSITION);
9548
+ const excluded = new Set(
9549
+ [...closureOf(read, ROOT_COMPOSITION)].filter((path) => !inputs.has(path))
9550
+ );
9551
+ let inputSignature;
9552
+ if (comp === ROOT_COMPOSITION) {
9553
+ inputSignature = createProjectSignature(projectDir, excluded);
9554
+ } else {
9555
+ const hashes = rootHashes(read);
9556
+ if (!rootMemos.has(projectDir)) rootMemos.set(projectDir, { ...hashes, affected: null });
9557
+ inputSignature = `${createProjectSignature(projectDir, excluded.add(ROOT_COMPOSITION))}:${hashes.head}`;
9558
+ }
9435
9559
  inputSignatures.set(key, { projectSignature, inputSignature });
9436
9560
  return inputSignature;
9437
9561
  }
9438
9562
  function compositionsAffectedBy(projectDir, changedPath) {
9439
9563
  const changed = changedPath.replace(/\\/g, "/");
9440
9564
  const read = projectReader(projectDir);
9565
+ if (changed === ROOT_COMPOSITION) {
9566
+ const now = rootHashes(read);
9567
+ const memo = rootMemos.get(projectDir);
9568
+ if (memo?.root === now.root) return memo.affected;
9569
+ const affected = memo?.head === now.head ? [ROOT_COMPOSITION] : null;
9570
+ rootMemos.set(projectDir, { ...now, affected });
9571
+ return affected;
9572
+ }
9441
9573
  const mounted = closureOf(read, ROOT_COMPOSITION);
9442
- if (changed === ROOT_COMPOSITION || !mounted.has(changed)) return null;
9574
+ if (!mounted.has(changed)) return null;
9443
9575
  return [...mounted].filter((path) => closureOf(read, path).has(changed));
9444
9576
  }
9445
- var THUMBNAIL_CACHE_VERSION = "v4";
9577
+ var THUMBNAIL_CACHE_VERSION = "v5";
9446
9578
  var THUMBNAIL_MAX_OUTPUT_WIDTH = 240;
9447
9579
  var THUMBNAIL_MAX_OUTPUT_HEIGHT = 135;
9448
9580
  var THUMBNAIL_CACHE_MAX_BYTES = 512 * 1024 * 1024;
@@ -9515,7 +9647,7 @@ function readFileOnce(file) {
9515
9647
  function manifestKey(file) {
9516
9648
  const manifest = readFileOnce(file);
9517
9649
  if (typeof manifest === "string") return { key: "", mtimeMs: -Infinity };
9518
- const hash = createHash32("sha1").update(manifest.data).digest("hex").slice(0, 16);
9650
+ const hash = createHash42("sha1").update(manifest.data).digest("hex").slice(0, 16);
9519
9651
  return { key: `_${hash}`, mtimeMs: Math.round(manifest.mtimeMs) };
9520
9652
  }
9521
9653
  function registerThumbnailRoutes(api, adapter) {
@@ -9552,7 +9684,7 @@ function registerThumbnailRoutes(api, adapter) {
9552
9684
  let sourceKey = "";
9553
9685
  if (source !== "missing") {
9554
9686
  const html = source.data.toString("utf-8");
9555
- sourceKey = `_${createHash32("sha1").update(html).digest("hex").slice(0, 16)}`;
9687
+ sourceKey = `_${createHash42("sha1").update(html).digest("hex").slice(0, 16)}`;
9556
9688
  sourceMtime = Math.round(source.mtimeMs);
9557
9689
  if (!vpWidth) {
9558
9690
  const wMatch = html.match(/data-width=["'](\d+)["']/);
@@ -9568,9 +9700,9 @@ function registerThumbnailRoutes(api, adapter) {
9568
9700
  const previewPath = compPath === "index.html" ? `${projectUrl}/preview` : `${projectUrl}/preview/comp/${compPath.split("/").map(encodeURIComponent).join("/")}`;
9569
9701
  const previewUrl = `${previewPath}?${PREVIEW_CAPTURE_PARAM}=1`;
9570
9702
  const cacheDir = join11(project.dir, ".thumbnails");
9571
- const selectorKey = selector ? `_${selector.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 80)}_${selectorIndex ?? 0}` : "";
9703
+ const selectorKey = selector ? `_${createHash42("sha1").update(selector).digest("hex").slice(0, 16)}_${selectorIndex ?? 0}` : "";
9572
9704
  const urlVersionKey = urlVersion ? `_${urlVersion.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 32)}` : "";
9573
- const inputSignatureKey = `_${createHash32("sha1").update(inputSignature).digest("hex").slice(0, 16)}`;
9705
+ const inputSignatureKey = `_${createHash42("sha1").update(inputSignature).digest("hex").slice(0, 16)}`;
9574
9706
  const outputScale = outputMode === "source" ? 1 : Math.min(1, THUMBNAIL_MAX_OUTPUT_WIDTH / compW, THUMBNAIL_MAX_OUTPUT_HEIGHT / compH);
9575
9707
  const outputWidth = Math.max(1, Math.round(compW * outputScale));
9576
9708
  const outputHeight = Math.max(1, Math.round(compH * outputScale));
@@ -9698,7 +9830,7 @@ function freezeExtractArgs(src, mediaTime, output) {
9698
9830
  var randomStillToken = () => randomBytes(4).toString("hex");
9699
9831
  function freezeStillFileName(clipId, playhead, token = randomStillToken()) {
9700
9832
  const stem = clipId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 48) || "clip";
9701
- const idHash = createHash42("sha256").update(clipId).digest("hex").slice(0, 10);
9833
+ const idHash = createHash5("sha256").update(clipId).digest("hex").slice(0, 10);
9702
9834
  return `${stem}-${idHash}-${Math.round(playhead * 1e3)}-${token}.png`;
9703
9835
  }
9704
9836
  function readFreezeSource(html, target, playhead) {
@@ -10857,7 +10989,7 @@ function numericAttribute(element, name) {
10857
10989
  }
10858
10990
  function createPreviewDocumentStore(projectDir, salt) {
10859
10991
  const dir = join17(projectDir, ".hyperframes", "preview");
10860
- const fileFor = (key) => join17(dir, `${createHash5("sha256").update(`${salt}
10992
+ const fileFor = (key) => join17(dir, `${createHash6("sha256").update(`${salt}
10861
10993
  ${key}`).digest("hex").slice(0, 32)}.html`);
10862
10994
  return {
10863
10995
  read(key) {
@@ -10966,6 +11098,7 @@ export {
10966
11098
  openProjectHistory,
10967
11099
  historyCache,
10968
11100
  getElementScreenshotClip,
11101
+ clearElementScreenshotIsolation,
10969
11102
  injectMediaCodecMapIntoHtml,
10970
11103
  STUDIO_MOTION_PATH,
10971
11104
  createStudioMotionRenderBodyScript,
@@ -7,23 +7,26 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveCompositionViewportFromHtml
9
9
  } from "./chunk-5Z63TBTX.js";
10
+ import {
11
+ launchManagedBrowser,
12
+ resolveManagedGpuMode
13
+ } from "./chunk-WN62HDA7.js";
10
14
  import {
11
15
  windowsChromeCrashRemediation
12
16
  } from "./chunk-262C25DQ.js";
13
17
  import {
14
18
  resolveDiagnosticNavigationTimeoutMs
15
- } from "./chunk-3IUSKIZW.js";
19
+ } from "./chunk-NCQV2NMY.js";
16
20
  import {
17
- resolveCaptureBrowserGpuMode,
18
21
  resolveLocalBrowserGpuMode
19
- } from "./chunk-T3NMEYGM.js";
22
+ } from "./chunk-6FRHKGRY.js";
20
23
  import {
21
24
  c
22
25
  } from "./chunk-ZTZA4UWZ.js";
23
26
  import {
24
27
  assertWebGpuAdapterAvailable,
25
28
  compositionRequiresWebGpu
26
- } from "./chunk-G2T2X6FZ.js";
29
+ } from "./chunk-63O3AR5U.js";
27
30
  import {
28
31
  normalizeErrorMessage
29
32
  } from "./chunk-KNU5COPB.js";
@@ -99,12 +102,12 @@ async function openSettledCompositionPage(html, url, options) {
99
102
  const { ensureBrowser, findSystemBrowser } = await import("./manager-CT3D67CG.js");
100
103
  const browser = await ensureBrowser();
101
104
  const puppeteer = await import("puppeteer-core");
102
- const { buildChromeArgs } = await import("./src-PJJ6NISA.js");
105
+ const { buildChromeArgs } = await import("./src-X6ACPJHG.js");
103
106
  const requestedGpuMode = options.browserGpuMode ?? resolveCliChromeGpuMode();
104
107
  const requiresWebGpu = compositionRequiresWebGpu(html);
105
108
  const launch = async (executablePath) => {
106
- const resolvedGpuMode = await resolveCaptureBrowserGpuMode(requestedGpuMode, executablePath);
107
- return puppeteer.default.launch({
109
+ const resolvedGpuMode = await resolveManagedGpuMode(requestedGpuMode, executablePath);
110
+ return launchManagedBrowser(puppeteer.default, {
108
111
  headless: true,
109
112
  executablePath,
110
113
  args: buildChromeArgs(
@@ -1793,7 +1793,7 @@ function parseGsapScriptAcornForWrite(script) {
1793
1793
  (call) => tweenCallToAnimation(call, scope, script, identifierBindings)
1794
1794
  );
1795
1795
  applyTimelineDefaults(rawAnims, detection.defaults);
1796
- resolveTimelinePositions(rawAnims);
1796
+ resolveTimelinePositions(rawAnims, collectAddLabelDefs(ast, ref, scope, calls));
1797
1797
  const animations = assignStableIds(rawAnims);
1798
1798
  const located = calls.map((call, i) => ({
1799
1799
  id: animations[i].id,
@@ -8,7 +8,7 @@ import {
8
8
  firstFrameColourArgs,
9
9
  hdrToSdrToneMapFilter,
10
10
  parseFirstFrameColour
11
- } from "./chunk-FCEFKWPM.js";
11
+ } from "./chunk-AKZD7VWZ.js";
12
12
  import {
13
13
  mkdirWithinProject,
14
14
  realProjectRoot,
@@ -21,7 +21,7 @@ import {
21
21
  isUnresolvedAssetPlaceholder,
22
22
  maskNonScannableRanges,
23
23
  resolveLocalAssetCandidates
24
- } from "./chunk-YJEGT5L6.js";
24
+ } from "./chunk-NITBGIHR.js";
25
25
  import {
26
26
  findFfBinary
27
27
  } from "./chunk-PJ3HDUCY.js";