hyperframes 0.9.56 → 0.9.58

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 (392) hide show
  1. package/dist/{add-KW7OTOWF.js → add-JQUKPSEZ.js} +30 -28
  2. package/dist/{agentPromptGenerator-NNXUWNU4.js → agentPromptGenerator-3NEY7FPP.js} +15 -14
  3. package/dist/{animatedGifPrep-6ATQHQON.js → animatedGifPrep-VMUZ6IVJ.js} +17 -15
  4. package/dist/api.js +60 -59
  5. package/dist/{appHistory-KHX53SGI.js → appHistory-JNI6IOR6.js} +5 -4
  6. package/dist/{asset-QVINGJRK.js → asset-ZT3VXZ67.js} +3 -2
  7. package/dist/{assetCataloger-DENJPUBH.js → assetCataloger-D2DV65BA.js} +16 -15
  8. package/dist/{audio-LB7HQYPJ.js → audio-LD5H2R5V.js} +37 -36
  9. package/dist/{auth-7AGRVI5A.js → auth-4FPYYMSH.js} +4 -4
  10. package/dist/{autoUpdate-ITCP2JDM.js → autoUpdate-5ZKSFCG4.js} +5 -5
  11. package/dist/{avatars-2K2C74EQ.js → avatars-DCLFE7VG.js} +25 -24
  12. package/dist/{backgroundChecks-UOTBCWPN.js → backgroundChecks-UZA3F46H.js} +6 -6
  13. package/dist/backgroundChecksWorker.js +6 -6
  14. package/dist/{batchRender-Z7ESYQDS.js → batchRender-TAUW3CT2.js} +11 -8
  15. package/dist/{beats-TG6ZB3XH.js → beats-X3LCR6OG.js} +16 -15
  16. package/dist/{benchmark-RU5MLZHE.js → benchmark-DNZQT3YQ.js} +23 -22
  17. package/dist/{billing-VB5PYYSN.js → billing-4BFUAHWX.js} +44 -29
  18. package/dist/{browser-VSQRY5GG.js → browser-5J2MTDB6.js} +13 -12
  19. package/dist/{bundleWithLocalizedFonts-XDPJE355.js → bundleWithLocalizedFonts-XWK47ZVF.js} +1 -1
  20. package/dist/{capture-M4FL7MWI.js → capture-2YSVFKWV.js} +39 -38
  21. package/dist/{capture-TQCFWPAT.js → capture-TVYTKWTG.js} +4 -4
  22. package/dist/{captureCompositionFrame-XF67Q6YK.js → captureCompositionFrame-L765HLCT.js} +21 -20
  23. package/dist/{captureFile-F254H22J.js → captureFile-DOCK42K3.js} +4 -3
  24. package/dist/{catalog-24EGH662.js → catalog-CHGGRRQX.js} +30 -28
  25. package/dist/{catch-up-L23HGDLB.js → catch-up-OCFU6ZR3.js} +16 -15
  26. package/dist/{check-F4HQVV2M.js → check-LWK4Z7FI.js} +64 -63
  27. package/dist/{checkAudio-6DT3ONR7.js → checkAudio-R5ORBXBO.js} +26 -23
  28. package/dist/{checkBrowser-S7P4X7QV.js → checkBrowser-6SH73T47.js} +55 -54
  29. package/dist/{chunk-MK4RH5L7.js → chunk-23SG3B6M.js} +1 -1
  30. package/dist/{chunk-QBADK3LD.js → chunk-2GRCLLKU.js} +1 -1
  31. package/dist/chunk-2RUCE54M.js +5083 -0
  32. package/dist/{chunk-SGWDJLFL.js → chunk-2SJNGWSY.js} +1 -1
  33. package/dist/{chunk-RFULFCYW.js → chunk-2WA62M3B.js} +3 -3
  34. package/dist/{chunk-FGGRBKWL.js → chunk-37VS6QY6.js} +1 -1
  35. package/dist/{chunk-ZIF44RW2.js → chunk-37Y334MN.js} +11 -8
  36. package/dist/{chunk-3GVHDPEP.js → chunk-3GKGBYW3.js} +7 -27
  37. package/dist/{chunk-BZXW5QU7.js → chunk-3VMZQQUI.js} +1 -1
  38. package/dist/{chunk-B6BWLFAF.js → chunk-4LZSNWFJ.js} +2 -2
  39. package/dist/{chunk-L5NPBGQB.js → chunk-4N3WOFP3.js} +21 -21
  40. package/dist/{chunk-7DKWEIH4.js → chunk-4NNYYCJN.js} +15 -15
  41. package/dist/{chunk-5GSCSZOS.js → chunk-4QPT3IEL.js} +5 -5
  42. package/dist/{chunk-JQKCRTVQ.js → chunk-5IUVWP3A.js} +2 -2
  43. package/dist/{chunk-APCVZGU6.js → chunk-5SGGOZNL.js} +84 -46
  44. package/dist/{chunk-T5HYPGST.js → chunk-7ECPFKQV.js} +4 -4
  45. package/dist/{chunk-BZULWFMJ.js → chunk-7FIJRDUG.js} +45 -10
  46. package/dist/{chunk-BA33QNKK.js → chunk-7IMHPBSH.js} +51 -19
  47. package/dist/{chunk-TVZTTWU7.js → chunk-7WAWUQDQ.js} +3 -3
  48. package/dist/{chunk-QNIID7EN.js → chunk-7WYJXKIG.js} +17 -7
  49. package/dist/{chunk-CZCZ5YXT.js → chunk-7ZHBY7T5.js} +1 -1
  50. package/dist/{chunk-WHX2OV4C.js → chunk-A4L7G74T.js} +1 -1
  51. package/dist/{chunk-LK7F7P2X.js → chunk-A4YRESMH.js} +2 -2
  52. package/dist/{chunk-MDRLJ737.js → chunk-AJ7YRQS4.js} +1 -1
  53. package/dist/{chunk-CBG6MIT2.js → chunk-ALD7JBPV.js} +2 -2
  54. package/dist/{chunk-7F4RAWDS.js → chunk-AM4Y3XMR.js} +2 -2
  55. package/dist/{chunk-D3WRRPHI.js → chunk-AM6UYKVR.js} +10 -10
  56. package/dist/{chunk-YDNBMPP3.js → chunk-AMS7Q7P7.js} +4 -4
  57. package/dist/{chunk-VC4YMXUQ.js → chunk-BSDUTNFX.js} +1 -1
  58. package/dist/{chunk-IRZUZ32B.js → chunk-BSFTB6AM.js} +4 -4
  59. package/dist/{chunk-XKNNZ4WR.js → chunk-CGJIMWNU.js} +5 -2
  60. package/dist/{chunk-WFB4XPJR.js → chunk-CGODFJZ7.js} +9 -9
  61. package/dist/{chunk-BMVUB2CY.js → chunk-CPDPSNSB.js} +8 -8
  62. package/dist/{chunk-OXT2LXZB.js → chunk-CRPLPK6J.js} +8 -8
  63. package/dist/{chunk-PPLFDG7N.js → chunk-CVTIGS5K.js} +3 -3
  64. package/dist/{chunk-IDGWNOBX.js → chunk-D2LSYXLW.js} +1 -1
  65. package/dist/{chunk-5ZDNSYTO.js → chunk-D3M5VOC5.js} +3 -3
  66. package/dist/{chunk-PGHROSLJ.js → chunk-DH3M5X3Y.js} +4 -4
  67. package/dist/{chunk-LRQEIKFT.js → chunk-DHVRVI7F.js} +5 -5
  68. package/dist/{chunk-PUTPYYE4.js → chunk-DL6PEJWH.js} +5 -2
  69. package/dist/{chunk-DDCXMXAD.js → chunk-DWFWF6IR.js} +30 -22
  70. package/dist/{chunk-BUG5AOPJ.js → chunk-DX5Y3L5B.js} +2 -2
  71. package/dist/{chunk-52XHPMCX.js → chunk-E26Z73S3.js} +1 -1
  72. package/dist/{chunk-YWH7HWDP.js → chunk-E4IR34CF.js} +332 -328
  73. package/dist/{chunk-BTJYK56C.js → chunk-ELRE6LVJ.js} +3 -3
  74. package/dist/{chunk-XLP34AJR.js → chunk-EOXNEA4Z.js} +2 -2
  75. package/dist/{chunk-7E7VKASF.js → chunk-ERDQIRUL.js} +4 -4
  76. package/dist/{chunk-MPOWSPBD.js → chunk-EWKJDXH6.js} +3 -3
  77. package/dist/{chunk-MVLAPENI.js → chunk-EZJHKHWU.js} +3 -3
  78. package/dist/{chunk-TY7EHE4Q.js → chunk-FFOFGL2O.js} +2 -2
  79. package/dist/{chunk-UHVKV5IF.js → chunk-FNXU56VT.js} +1 -1
  80. package/dist/{chunk-PHAZT6EB.js → chunk-G3U5CUF3.js} +1 -1
  81. package/dist/{chunk-ON3CGL3V.js → chunk-GDIBE57N.js} +2 -2
  82. package/dist/{chunk-VVXSMYXQ.js → chunk-GEOJA37C.js} +3 -3
  83. package/dist/{chunk-CUO2HF4M.js → chunk-GIVMQDSK.js} +2 -2
  84. package/dist/{chunk-NFST2HIM.js → chunk-GRSZAGJB.js} +2 -2
  85. package/dist/{chunk-AGTBMLNM.js → chunk-GVIJFPZV.js} +2 -2
  86. package/dist/{chunk-CKIYT34K.js → chunk-H3LEOZVK.js} +1 -1
  87. package/dist/{chunk-UIMXEY4U.js → chunk-H7DTMLAR.js} +7 -7
  88. package/dist/{chunk-7HQC5MDZ.js → chunk-HFIVZJJD.js} +1 -1
  89. package/dist/{chunk-IT2QBRVS.js → chunk-HFUI6LVF.js} +1 -1
  90. package/dist/chunk-HOIEN7O4.js +31 -0
  91. package/dist/{chunk-WGWKT7ME.js → chunk-HTGJOOXE.js} +12 -4
  92. package/dist/{chunk-GWSMTN55.js → chunk-IE6BIB3L.js} +53 -1
  93. package/dist/{chunk-YFWFCKKF.js → chunk-IGZQYMZA.js} +7638 -7451
  94. package/dist/{chunk-IO7PRQQC.js → chunk-J6VYWZSO.js} +1 -1
  95. package/dist/{chunk-OZDELWQP.js → chunk-JKLWQUSV.js} +1 -1
  96. package/dist/{chunk-WUY74LHU.js → chunk-JOOKM2NC.js} +2 -2
  97. package/dist/{chunk-BR7GOCQJ.js → chunk-JQZ5WP7L.js} +1 -1
  98. package/dist/{chunk-EBRN4YJH.js → chunk-JZVI2TMX.js} +3 -3
  99. package/dist/{chunk-R2LP7QPB.js → chunk-K2EJQ44S.js} +1 -1
  100. package/dist/{chunk-YOMFN6HH.js → chunk-KYKQO4VN.js} +2 -2
  101. package/dist/{chunk-QJDMX53S.js → chunk-LO5USUM4.js} +1 -1
  102. package/dist/{chunk-L5CBCPUH.js → chunk-M3IHARIW.js} +13 -13
  103. package/dist/{chunk-664QGMR4.js → chunk-M5TTYUZM.js} +2 -2
  104. package/dist/{chunk-IJYIIHGK.js → chunk-MK23FXLH.js} +1 -1
  105. package/dist/{chunk-7QFLMCTD.js → chunk-MPC3OODR.js} +36 -5
  106. package/dist/{chunk-DUZ6Z2ZN.js → chunk-MSC5KBCE.js} +1 -1
  107. package/dist/{chunk-KRYXZVA2.js → chunk-N6PAWR5C.js} +3 -3
  108. package/dist/{chunk-RRT6URIP.js → chunk-NJPLH762.js} +2 -2
  109. package/dist/{chunk-Q2TT62RQ.js → chunk-NLVIE7VN.js} +4 -4
  110. package/dist/{chunk-XD5T43S7.js → chunk-O2BLY7PO.js} +1 -1
  111. package/dist/{chunk-SEC76O65.js → chunk-O2INZCGB.js} +1 -1
  112. package/dist/{chunk-NCJSN6SV.js → chunk-O4K22EFS.js} +5 -5
  113. package/dist/{chunk-L27Z3PZT.js → chunk-O5U3Y5DX.js} +1 -1
  114. package/dist/{chunk-MP52CUHL.js → chunk-OD7XWF5T.js} +2 -2
  115. package/dist/{chunk-7QFFS657.js → chunk-OEGWTN6N.js} +1 -1
  116. package/dist/{chunk-2GRCTZNS.js → chunk-OL7RHRNJ.js} +1 -1
  117. package/dist/{chunk-EKSS3KI7.js → chunk-OMZSPAK5.js} +1 -1
  118. package/dist/{chunk-RCGNYXWK.js → chunk-OPSGEOCO.js} +27 -19
  119. package/dist/{chunk-IHX3AFTY.js → chunk-PGITR2WX.js} +7 -4
  120. package/dist/{chunk-XEVAW42J.js → chunk-PS7WBIPK.js} +10 -10
  121. package/dist/{chunk-HVG656G6.js → chunk-PYTF6VHF.js} +6 -4
  122. package/dist/{chunk-OIO7YMBP.js → chunk-QGQCWG7F.js} +1 -1
  123. package/dist/{chunk-CXFW7YPT.js → chunk-ROESFEBP.js} +62 -47
  124. package/dist/{chunk-VCSQLM36.js → chunk-RV3HR3BZ.js} +5 -5
  125. package/dist/{chunk-UVPLW55S.js → chunk-SALNTRJA.js} +10 -2
  126. package/dist/{chunk-LKWWY6WN.js → chunk-SE4NOUB6.js} +1 -1
  127. package/dist/{chunk-JPEIUGS5.js → chunk-SM5PNCDI.js} +1 -1
  128. package/dist/{chunk-W4AR7UZH.js → chunk-SNKBI4YB.js} +2 -2
  129. package/dist/{chunk-43CQTZGB.js → chunk-SV72WLBE.js} +2 -2
  130. package/dist/{chunk-JDXALWOM.js → chunk-SYKUNH25.js} +1 -1
  131. package/dist/{chunk-CNXZCMJZ.js → chunk-TAXMLPTE.js} +2 -2
  132. package/dist/{chunk-QTZICZWT.js → chunk-TLDIP7Y3.js} +16 -12
  133. package/dist/{chunk-EGR2ZFFP.js → chunk-TLGQQ324.js} +4 -4
  134. package/dist/{chunk-CWIOKI2R.js → chunk-U5MILT4G.js} +1 -1
  135. package/dist/{chunk-YQSVPHOS.js → chunk-UDLWVQ74.js} +8 -5
  136. package/dist/{chunk-6XRXUMFG.js → chunk-UGKUGYHD.js} +1 -1
  137. package/dist/{chunk-EUP7ODOV.js → chunk-UJTLTFB6.js} +1 -1
  138. package/dist/{chunk-4GPKDDQZ.js → chunk-V3O4AFO3.js} +9 -9
  139. package/dist/{chunk-2ZOJCSLJ.js → chunk-VBEDZGBW.js} +3 -3
  140. package/dist/{chunk-PVF32NRA.js → chunk-VI2LLFW6.js} +2 -2
  141. package/dist/{chunk-6LONEKJR.js → chunk-VLFBOKZX.js} +5743 -5615
  142. package/dist/{chunk-Z72VXQPN.js → chunk-VSM7OIG2.js} +2 -2
  143. package/dist/{chunk-4RPIEGL3.js → chunk-VXE46PXX.js} +1 -1
  144. package/dist/{chunk-LH5FRVAO.js → chunk-W2OXNTHG.js} +3 -3
  145. package/dist/{chunk-4DJGUZJR.js → chunk-WEU6WLVT.js} +2 -2
  146. package/dist/{chunk-BPYNILOZ.js → chunk-WGHJUGNU.js} +11 -9
  147. package/dist/{chunk-HOCV5AW6.js → chunk-WJIWXHXK.js} +8 -4
  148. package/dist/{chunk-CPSD7337.js → chunk-WLNHZ2OM.js} +9 -9
  149. package/dist/{chunk-HCQXGGVY.js → chunk-WQZQMADW.js} +14 -14
  150. package/dist/{chunk-DY7PQLIE.js → chunk-WTJZ5QFR.js} +42 -5
  151. package/dist/{chunk-CKIVYAKG.js → chunk-X3IVUSOX.js} +2 -2
  152. package/dist/{chunk-LRWWCTSJ.js → chunk-X3UXEB2U.js} +2 -2
  153. package/dist/{chunk-ICDGP335.js → chunk-XMT4MG6W.js} +9 -9
  154. package/dist/{chunk-4WSJ5MUN.js → chunk-XYP4T6TQ.js} +1 -1
  155. package/dist/{chunk-PGJYA6I3.js → chunk-Y6CZFX5X.js} +65 -20
  156. package/dist/{chunk-GTC2STHN.js → chunk-Z642P33A.js} +4 -4
  157. package/dist/{chunk-CLRHKYOK.js → chunk-ZAWQJOTW.js} +8 -8
  158. package/dist/{chunk-BW4H55SU.js → chunk-ZCLC3KVY.js} +1 -1
  159. package/dist/{chunk-PCKKKICA.js → chunk-ZFOV3R2L.js} +4 -4
  160. package/dist/{chunk-ANYW22IT.js → chunk-ZO5NHAF3.js} +1 -1
  161. package/dist/{chunk-AN6KWGYI.js → chunk-ZYNNZ5DE.js} +2 -2
  162. package/dist/{clean-VB6BH3FV.js → clean-6ODSABBF.js} +34 -32
  163. package/dist/cli.js +70 -70
  164. package/dist/{cloud-7KRPD2K4.js → cloud-IMYQB5RC.js} +4 -4
  165. package/dist/{cloud-A67BW6OH.js → cloud-NTKLXMBS.js} +9 -8
  166. package/dist/{cloudrun-VKBARVVT.js → cloudrun-JNLDP33J.js} +12 -11
  167. package/dist/{compare-SE55PMC3.js → compare-VLYZ6ZS4.js} +54 -52
  168. package/dist/{compiler-WK7ABGRW.js → compiler-7M2UCEWG.js} +7 -6
  169. package/dist/{component-XT2AT3RY.js → component-KMUHKZ4R.js} +4 -3
  170. package/dist/{compositions-ZZWLQNDQ.js → compositions-ESLWNOMS.js} +23 -23
  171. package/dist/{contactSheet-MXOASCDR.js → contactSheet-4YF7U6U7.js} +5 -4
  172. package/dist/contract/path-policy.json +12 -2
  173. package/dist/{curve-4RQQKZ2K.js → curve-7RPSNRPE.js} +21 -20
  174. package/dist/{cuts-M3QU2CBE.js → cuts-KBAAZSPS.js} +22 -21
  175. package/dist/{delete-5ZZNPK5G.js → delete-EP5Z7HKF.js} +14 -13
  176. package/dist/{deploy-VR5SQP4U.js → deploy-MVR63JLD.js} +14 -13
  177. package/dist/{describeProject-NU5BVVIA.js → describeProject-NBVZT5EN.js} +15 -14
  178. package/dist/{destroy-FFS62PAW.js → destroy-DQKIT574.js} +13 -12
  179. package/dist/{deterministicFonts-FQQNGORI.js → deterministicFonts-LYBMXXBW.js} +5 -4
  180. package/dist/{diff-NQGTF6GR.js → diff-RI3FTMOZ.js} +57 -56
  181. package/dist/{dist-6GYOC3BU.js → dist-G7VFX23I.js} +8 -4
  182. package/dist/{dist-APXZ5EN2.js → dist-LRGTXDSM.js} +3 -3
  183. package/dist/{dist-B7IBHWIW.js → dist-TOOMD57O.js} +19 -17
  184. package/dist/{doctor-FATJGTPD.js → doctor-43YNRCRB.js} +24 -23
  185. package/dist/{energy-PHDK6SKL.js → energy-YCH36KCC.js} +22 -21
  186. package/dist/{events-OIWXSBZA.js → events-6RJBITYN.js} +24 -23
  187. package/dist/{events-RXVHG2NT.js → events-JCPYG3CD.js} +6 -6
  188. package/dist/{events-25VQ2O66.js → events-VUR27EF6.js} +12 -11
  189. package/dist/{execute-MKP4Z573.js → execute-OXMKWIFI.js} +44 -43
  190. package/dist/{extract-YYNYXPOC.js → extract-XGD2RDEX.js} +24 -23
  191. package/dist/{face-JSTMFQRM.js → face-XCNWNTGN.js} +23 -22
  192. package/dist/{feedback-PY6LMZCX.js → feedback-JNFDVBFV.js} +27 -26
  193. package/dist/{ffmpeg-KLIB55FK.js → ffmpeg-YQLAJUEA.js} +14 -13
  194. package/dist/{figma-ACFOXVPM.js → figma-XXGHYEB3.js} +3 -3
  195. package/dist/fontLocalizeCli.js +22 -20
  196. package/dist/{frames-BLZCBXO7.js → frames-PEMWFRRY.js} +24 -23
  197. package/dist/{generate-DMVEKZEV.js → generate-H5M4QSJR.js} +41 -40
  198. package/dist/{get-3WZDQ5YM.js → get-R6Y2OE5P.js} +14 -13
  199. package/dist/{gpuPolicy-TT6UCOLQ.js → gpuPolicy-2WVDQYZA.js} +14 -13
  200. package/dist/{grade-compare-F5DJ53XH.js → grade-compare-KFXPZFDL.js} +54 -52
  201. package/dist/{gsapParserAcorn-SKGP4R4N.js → gsapParserAcorn-RODCGO2L.js} +1 -1
  202. package/dist/hangReport.js +2 -2
  203. package/dist/{heifImagePrep-UV23RWOG.js → heifImagePrep-VLKYA5QZ.js} +18 -16
  204. package/dist/{help-QMP5KFYW.js → help-T3XUX5RI.js} +2 -2
  205. package/dist/{history-UOZ4RDEZ.js → history-QJPUCUUC.js} +25 -23
  206. package/dist/hyperframe.manifest.json +1 -1
  207. package/dist/hyperframe.runtime.iife.js +67 -67
  208. package/dist/hyperframes-player.global.js +1 -1
  209. package/dist/{index-gen-OPMQ5WSN.js → index-gen-3DWPA4FO.js} +14 -12
  210. package/dist/{info-A6KSO64E.js → info-556DHJHJ.js} +25 -25
  211. package/dist/{init-OQU46K3Q.js → init-P62TPWR3.js} +46 -45
  212. package/dist/{ink-HGRKLGII.js → ink-SRN65OZH.js} +22 -21
  213. package/dist/{inspect-BKENKUXF.js → inspect-U5FWQQFB.js} +53 -52
  214. package/dist/{installer-Z6FTR7BJ.js → installer-3TNMANQV.js} +9 -8
  215. package/dist/{keyframes-UDQGWKPW.js → keyframes-FPGEFGCH.js} +63 -28
  216. package/dist/{lambda-SHXQFHLE.js → lambda-YJY2MYWL.js} +24 -23
  217. package/dist/{layout-CJAVQ4D3.js → layout-QIKSVA44.js} +53 -52
  218. package/dist/{lint-RAPNYPWS.js → lint-RD33ESM5.js} +20 -20
  219. package/dist/{lintProject-JZRM7UKH.js → lintProject-ZWLXB3A2.js} +3 -3
  220. package/dist/{list-4BKFMJQN.js → list-FFO3WOB2.js} +14 -13
  221. package/dist/{localPage-BJW2TP77.js → localPage-DHIBMNJH.js} +15 -14
  222. package/dist/{login-S5VZAGCI.js → login-IMFRQOEQ.js} +8 -8
  223. package/dist/{logout-CCATTNTL.js → logout-SLBKP67J.js} +4 -4
  224. package/dist/{look-V2I6BGUY.js → look-ZZHJYSPC.js} +22 -21
  225. package/dist/{manager-WQWU5VJ4.js → manager-U4WEPCLV.js} +4 -4
  226. package/dist/{manager-OS2FYJI5.js → manager-V4LGD4HB.js} +15 -14
  227. package/dist/{manifest-QSJYVERU.js → manifest-TSKRUXZ5.js} +5 -1
  228. package/dist/{measure-RO5R2SUZ.js → measure-ZRBVN45B.js} +11 -11
  229. package/dist/{media-treatment-CS7BVMJW.js → media-treatment-3I2CMQJZ.js} +29 -24
  230. package/dist/{media-use-W3DGCKFB.js → media-use-2OYJ3CCN.js} +8 -8
  231. package/dist/{models-ZOGYW2SC.js → models-PRW7EWSV.js} +19 -18
  232. package/dist/{motionShot-IMRI7W7T.js → motionShot-VWILMLHQ.js} +38 -29
  233. package/dist/{normalize-audio-HXTFAZUK.js → normalize-audio-42XMF35K.js} +19 -17
  234. package/dist/{oauth-SAVP2YM4.js → oauth-V3HSFZRE.js} +2 -2
  235. package/dist/{open-LJDQ37KV.js → open-D52MJZQA.js} +29 -27
  236. package/dist/{parakeetRunner-CKMSKDH6.js → parakeetRunner-ZR2JWQZH.js} +22 -21
  237. package/dist/{pipeline-ZNCYOTUH.js → pipeline-W3H4JA6H.js} +17 -16
  238. package/dist/{plan-NCFS5T6W.js → plan-2HQOFJO7.js} +33 -32
  239. package/dist/{play-5UZDFFXJ.js → play-G5XDRDIZ.js} +46 -44
  240. package/dist/{preflight-H5XYFKFF.js → preflight-W2JDYF3T.js} +17 -16
  241. package/dist/{present-EFXUFT5Y.js → present-CYMTHQFM.js} +36 -34
  242. package/dist/{preview-RV7ALGDQ.js → preview-DTQPQZTK.js} +46 -45
  243. package/dist/{probe-UB6DM2Q3.js → probe-WZJK3YQI.js} +22 -21
  244. package/dist/{producer-2PKB5CW5.js → producer-2BSMSO6I.js} +1 -1
  245. package/dist/{progress-S36VQBQW.js → progress-KRDVC24C.js} +4 -3
  246. package/dist/{projectConfig-EUH5DILC.js → projectConfig-BYRVYLCC.js} +12 -11
  247. package/dist/{publication-VI2AXXKR.js → publication-UCFJLELD.js} +7 -6
  248. package/dist/{publish-225GB7R4.js → publish-KXVPSWCO.js} +36 -35
  249. package/dist/{refresh-X5ZLKQO5.js → refresh-2GVNKDQE.js} +4 -4
  250. package/dist/{remove-background-W2RLEQHJ.js → remove-background-O7BZNS3X.js} +18 -17
  251. package/dist/{render-WMWCCMWI.js → render-DGAP4Q2Z.js} +69 -67
  252. package/dist/{render-Y3JKWEN4.js → render-QOWXGWQZ.js} +54 -53
  253. package/dist/{render-KXKBSNOQ.js → render-TYS3LCIQ.js} +10 -9
  254. package/dist/{render-batch-GK6CDHKN.js → render-batch-TEQRGAUC.js} +10 -9
  255. package/dist/renderSetupWorker.js +7 -7
  256. package/dist/{resolver-5CRZD5XB.js → resolver-RN2JGGQL.js} +9 -8
  257. package/dist/{reverse-YPYKKQSJ.js → reverse-FUARFEG2.js} +1 -1
  258. package/dist/{run-FQ76QNES.js → run-V722HMUG.js} +12 -11
  259. package/dist/{sam-A4NXDWSU.js → sam-KHLM2DJA.js} +4 -4
  260. package/dist/{screenshotCapture-R6VE66NR.js → screenshotCapture-4BB4LUMX.js} +17 -16
  261. package/dist/{service-P3IKHZFC.js → service-ZPCHJY6B.js} +23 -22
  262. package/dist/{share-BU4VQL3B.js → share-PXUN7AH7.js} +28 -27
  263. package/dist/{sherpa-44GLXY3A.js → sherpa-LT6Y7IGM.js} +21 -20
  264. package/dist/sherpaWorker.js +6 -5
  265. package/dist/{sites-TAX3JLNX.js → sites-WWCABDSX.js} +4 -3
  266. package/dist/skills/hyperframes/references/plugin-installation.md +12 -0
  267. package/dist/skills/hyperframes/scripts/plugin-cli.mjs +47 -9
  268. package/dist/skills/media-use/audio/scripts/audio.mjs +24 -7
  269. package/dist/skills/media-use/audio/scripts/carve.mjs +10 -82
  270. package/dist/skills/media-use/audio/scripts/lib/audio-carve.mjs +4 -0
  271. package/dist/skills/media-use/audio/scripts/lib/media-record.mjs +25 -7
  272. package/dist/skills/media-use/audio/scripts/lib/project-path.mjs +56 -0
  273. package/dist/skills/media-use/audio/scripts/lib/recording.mjs +66 -3
  274. package/dist/skills/media-use/audio/scripts/wait-bgm.mjs +12 -7
  275. package/dist/skills/media-use/references/audio.md +2 -2
  276. package/dist/skills/media-use/references/mixing.md +1 -1
  277. package/dist/skills/media-use/scripts/lib/index-gen.mjs +13 -11
  278. package/dist/skills/media-use/scripts/lib/manifest.mjs +51 -4
  279. package/dist/{skills-H4OZQ6VR.js → skills-G63W5GD5.js} +17 -16
  280. package/dist/{skillsUpdateCheck-U3XZX7UE.js → skillsUpdateCheck-2T3JVDAA.js} +6 -6
  281. package/dist/{snapshot-FJQVXBFB.js → snapshot-EVSKTVDG.js} +89 -78
  282. package/dist/{src-O6BHCR4O.js → src-K5FSMLTB.js} +22 -20
  283. package/dist/{src-PAM5LJ6K.js → src-R57EQQSI.js} +28 -19
  284. package/dist/{start-R7CYOQ5S.js → start-XBCYKGBV.js} +40 -39
  285. package/dist/{state-YFRV6TQH.js → state-FO64CPYE.js} +4 -3
  286. package/dist/{staticProjectServer-4X2OSUN4.js → staticProjectServer-Q6VR7CXT.js} +32 -30
  287. package/dist/{status-VN3FAN4M.js → status-E5XIWRCQ.js} +37 -34
  288. package/dist/studio/assets/{hyperframes-player-SRLbmEDB.js → hyperframes-player-B78JDyI_.js} +1 -1
  289. package/dist/studio/assets/{index-CgyBYe2L.js → index-D7ICtobF.js} +178 -178
  290. package/dist/studio/assets/{index-yuN1pZrv.js → index-ww7-RmuM.js} +1 -1
  291. package/dist/studio/assets/{pausedVideoDecoder-DtvSF8bV.js → pausedVideoDecoder-Dbe8Cmab.js} +1 -1
  292. package/dist/studio/index.html +1 -1
  293. package/dist/{studio-api-V3TMIWFB.js → studio-api-GMJVYGET.js} +19 -17
  294. package/dist/{studioServer-GY2ZTR2E.js → studioServer-MIQCMK6U.js} +117 -101
  295. package/dist/subCompositionWorker.js +1162 -0
  296. package/dist/{sync-2V3JYCDE.js → sync-WJOFN6VN.js} +22 -21
  297. package/dist/{synthesize-TQELPMS5.js → synthesize-FXM7ZD6J.js} +6 -5
  298. package/dist/{system-2YOII5LZ.js → system-DBUN5UDD.js} +3 -3
  299. package/dist/{telemetry-KMRZ3IJV.js → telemetry-HZ4P4DMC.js} +12 -11
  300. package/dist/{templates-EEFY4FPS.js → templates-KFZZSSKW.js} +29 -28
  301. package/dist/{timeline-HSRGYZ3Q.js → timeline-5M6DPCXF.js} +37 -35
  302. package/dist/{tokens-NYFORL53.js → tokens-H4NPNRFR.js} +3 -2
  303. package/dist/{transcribe-CNIQYQ52.js → transcribe-6STI2ALX.js} +47 -46
  304. package/dist/{transcribe-GFFWRWK3.js → transcribe-7PE5UH7J.js} +18 -17
  305. package/dist/{tts-NPMDYSXP.js → tts-D7CLD3AD.js} +1 -1
  306. package/dist/{update-BDMPUNNA.js → update-H3T3AVVG.js} +19 -18
  307. package/dist/{updateCheck-43UZ2USJ.js → updateCheck-TLCXUNBV.js} +5 -5
  308. package/dist/{upgrade-Z5B57UWL.js → upgrade-BZVTMCQU.js} +9 -8
  309. package/dist/{urlDownloader-KDZ76BKM.js → urlDownloader-FJXNC3IM.js} +13 -12
  310. package/dist/{validate-UQKZNR5K.js → validate-WTRVCEL5.js} +39 -37
  311. package/dist/{video-VR4363OG.js → video-TVO2U5F2.js} +17 -16
  312. package/dist/{voices-GUWAM3TH.js → voices-F3EW43LX.js} +39 -38
  313. package/dist/warmCheck.js +64 -63
  314. package/dist/warmCheckClient.js +2 -2
  315. package/package.json +1 -1
  316. package/dist/chunk-56T2OGYR.js +0 -5085
  317. package/dist/skills/hyperframes/scripts/lib/main-module.test.mjs +0 -46
  318. package/dist/skills/hyperframes/scripts/lib/windows-exe-search.test.mjs +0 -149
  319. package/dist/skills/hyperframes/scripts/plugin-cli.test.mjs +0 -231
  320. package/dist/skills/media-use/audio/scripts/audio.test.mjs +0 -166
  321. package/dist/skills/media-use/audio/scripts/carve.test.mjs +0 -254
  322. package/dist/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +0 -131
  323. package/dist/skills/media-use/audio/scripts/heygen-tts.test.mjs +0 -38
  324. package/dist/skills/media-use/audio/scripts/heygen-voice.test.mjs +0 -233
  325. package/dist/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +0 -136
  326. package/dist/skills/media-use/audio/scripts/lib/bgm.test.mjs +0 -135
  327. package/dist/skills/media-use/audio/scripts/lib/concurrency.test.mjs +0 -41
  328. package/dist/skills/media-use/audio/scripts/lib/gemini-auth.test.mjs +0 -86
  329. package/dist/skills/media-use/audio/scripts/lib/gemini-tts.test.mjs +0 -253
  330. package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +0 -627
  331. package/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +0 -239
  332. package/dist/skills/media-use/audio/scripts/lib/python.test.mjs +0 -198
  333. package/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +0 -331
  334. package/dist/skills/media-use/audio/scripts/lib/tts.cleanup.test.mjs +0 -181
  335. package/dist/skills/media-use/audio/scripts/lib/tts.spawn.test.mjs +0 -183
  336. package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +0 -280
  337. package/dist/skills/media-use/audio/scripts/lib/voice-credit.test.mjs +0 -21
  338. package/dist/skills/media-use/audio/scripts/recording.test.mjs +0 -139
  339. package/dist/skills/media-use/audio/scripts/trusted-program.test.mjs +0 -106
  340. package/dist/skills/media-use/audio/scripts/wait-bgm.test.mjs +0 -108
  341. package/dist/skills/media-use/scripts/compatibility.test.mjs +0 -41
  342. package/dist/skills/media-use/scripts/dither.test.mjs +0 -176
  343. package/dist/skills/media-use/scripts/lib/adopt.test.mjs +0 -143
  344. package/dist/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +0 -178
  345. package/dist/skills/media-use/scripts/lib/cache.test.mjs +0 -110
  346. package/dist/skills/media-use/scripts/lib/candidates.test.mjs +0 -155
  347. package/dist/skills/media-use/scripts/lib/codex-provider.test.mjs +0 -34
  348. package/dist/skills/media-use/scripts/lib/config-lock.test.mjs +0 -79
  349. package/dist/skills/media-use/scripts/lib/coverage.test.mjs +0 -136
  350. package/dist/skills/media-use/scripts/lib/credit-limit.test.mjs +0 -39
  351. package/dist/skills/media-use/scripts/lib/cube-build.test.mjs +0 -80
  352. package/dist/skills/media-use/scripts/lib/cube-validate.test.mjs +0 -130
  353. package/dist/skills/media-use/scripts/lib/cutlist.test.mjs +0 -174
  354. package/dist/skills/media-use/scripts/lib/duck.test.mjs +0 -319
  355. package/dist/skills/media-use/scripts/lib/error-diffusion.test.mjs +0 -102
  356. package/dist/skills/media-use/scripts/lib/freeze.test.mjs +0 -138
  357. package/dist/skills/media-use/scripts/lib/grade-analyzer.test.mjs +0 -285
  358. package/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +0 -315
  359. package/dist/skills/media-use/scripts/lib/heygen-search.test.mjs +0 -49
  360. package/dist/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +0 -435
  361. package/dist/skills/media-use/scripts/lib/local-media-search.test.mjs +0 -92
  362. package/dist/skills/media-use/scripts/lib/local-models.test.mjs +0 -220
  363. package/dist/skills/media-use/scripts/lib/local-run.test.mjs +0 -121
  364. package/dist/skills/media-use/scripts/lib/logo-provider.test.mjs +0 -312
  365. package/dist/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +0 -331
  366. package/dist/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +0 -199
  367. package/dist/skills/media-use/scripts/lib/manifest.test.mjs +0 -397
  368. package/dist/skills/media-use/scripts/lib/media-fetch.test.mjs +0 -197
  369. package/dist/skills/media-use/scripts/lib/media-home.test.mjs +0 -61
  370. package/dist/skills/media-use/scripts/lib/mflux-provider.test.mjs +0 -174
  371. package/dist/skills/media-use/scripts/lib/misses.test.mjs +0 -89
  372. package/dist/skills/media-use/scripts/lib/npx-sync.test.mjs +0 -41
  373. package/dist/skills/media-use/scripts/lib/openverse.test.mjs +0 -219
  374. package/dist/skills/media-use/scripts/lib/parakeet-words.test.mjs +0 -44
  375. package/dist/skills/media-use/scripts/lib/prefs-store.concurrent.test.mjs +0 -173
  376. package/dist/skills/media-use/scripts/lib/prefs-store.test.mjs +0 -245
  377. package/dist/skills/media-use/scripts/lib/probe.test.mjs +0 -221
  378. package/dist/skills/media-use/scripts/lib/recipe-store.test.mjs +0 -391
  379. package/dist/skills/media-use/scripts/lib/registry.test.mjs +0 -261
  380. package/dist/skills/media-use/scripts/lib/search.test.mjs +0 -32
  381. package/dist/skills/media-use/scripts/lib/specs.test.mjs +0 -157
  382. package/dist/skills/media-use/scripts/lib/stats.test.mjs +0 -165
  383. package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +0 -550
  384. package/dist/skills/media-use/scripts/lib/test-home.test.mjs +0 -10
  385. package/dist/skills/media-use/scripts/lib/transcriptCutFade.test.mjs +0 -33
  386. package/dist/skills/media-use/scripts/lib/tts-local-provider.test.mjs +0 -59
  387. package/dist/skills/media-use/scripts/lib/usage.test.mjs +0 -54
  388. package/dist/skills/media-use/scripts/lib/voice-provider.test.mjs +0 -46
  389. package/dist/skills/media-use/scripts/resolve-plugin.test.mjs +0 -86
  390. package/dist/skills/media-use/scripts/transcribe.test.mjs +0 -215
  391. package/dist/skills/media-use/scripts/transcript-cut.test.mjs +0 -341
  392. package/dist/{chunk-BAWGEGKD.js → chunk-XMAU5ZQX.js} +3 -3
@@ -0,0 +1,1162 @@
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
+ import "./chunk-HOIEN7O4.js";
8
+ import {
9
+ STUDIO_PREVIEW_CAPTURE_MODE,
10
+ STUDIO_PREVIEW_ERRORS,
11
+ STUDIO_PREVIEW_ERROR_KINDS,
12
+ STUDIO_PREVIEW_LAZY_ATTR,
13
+ STUDIO_PREVIEW_MARK_META
14
+ } from "./chunk-YXX6CIHL.js";
15
+ import "./chunk-5S7W3TUO.js";
16
+ import "./chunk-D54ZDCZR.js";
17
+ import {
18
+ ensureHfIds
19
+ } from "./chunk-4N3WOFP3.js";
20
+ import "./chunk-DL6PEJWH.js";
21
+ import {
22
+ GSAP_BASE_URL_META,
23
+ gsapCdnDist,
24
+ motionPathPluginUrl
25
+ } from "./chunk-5IUVWP3A.js";
26
+ import "./chunk-FXMKHHPO.js";
27
+ import {
28
+ AFTER_FONTS_SCRIPT_TYPE,
29
+ RUNTIME_BOOTSTRAP_ATTR,
30
+ deferScriptsUntilFonts,
31
+ findStartTags,
32
+ injectTagsAtHeadStart,
33
+ insertBeforeCloseTag,
34
+ insertRuntimeTag,
35
+ isFullHtmlDocument,
36
+ mapStartTagsAndStyles,
37
+ stripEmbeddedRuntimeScripts
38
+ } from "./chunk-2RUCE54M.js";
39
+ import "./chunk-VC76R6W2.js";
40
+ import {
41
+ resolveWithinProject
42
+ } from "./chunk-SALNTRJA.js";
43
+ import "./chunk-MK23FXLH.js";
44
+ import "./chunk-RQVDTPGD.js";
45
+ import "./chunk-UDLWVQ74.js";
46
+ import "./chunk-6EMFSRTW.js";
47
+ import {
48
+ rewriteAssetPaths,
49
+ rewriteCssAssetUrls,
50
+ rewriteInlineStyleAssetUrls
51
+ } from "./chunk-IH2C53YV.js";
52
+ import "./chunk-7IMHPBSH.js";
53
+ import "./chunk-FR7YBU3H.js";
54
+ import "./chunk-DZWAYZG2.js";
55
+ import {
56
+ parseHTML
57
+ } from "./chunk-GWTIFRF5.js";
58
+ import "./chunk-2RY2LWAA.js";
59
+ import "./chunk-WC4MTXGN.js";
60
+ import "./chunk-WFQJ6EJ6.js";
61
+ import "./chunk-IE6BIB3L.js";
62
+ import "./chunk-M2WBOQ2Q.js";
63
+
64
+ // ../studio-server/src/helpers/subCompositionWorker.ts
65
+ import { readFileSync as readFileSync8 } from "fs";
66
+ import { parentPort } from "worker_threads";
67
+
68
+ // ../studio-server/src/routes/preview.ts
69
+ import { createReadStream as createReadStream3, existsSync as existsSync8, readFileSync as readFileSync7, statSync as statSync6 } from "fs";
70
+ import { Readable } from "stream";
71
+ import { join as join10, resolve as resolve8 } from "path";
72
+ import { createHash as createHash4 } from "crypto";
73
+
74
+ // ../studio-server/src/helpers/safePath.ts
75
+ import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "path";
76
+ import { lstatSync, readdirSync } from "fs";
77
+
78
+ // ../studio-server/src/helpers/servedFiles.ts
79
+ import { resolve as resolve2 } from "path";
80
+
81
+ // ../studio-server/src/helpers/mediaRange.ts
82
+ var MAX_OPEN_MEDIA_RANGE_BYTES = 4 * 1024 * 1024;
83
+
84
+ // ../studio-server/src/helpers/subComposition.ts
85
+ import { existsSync, readFileSync } from "fs";
86
+ import { join as join2 } from "path";
87
+
88
+ // ../studio-server/src/helpers/gsapCoreScript.ts
89
+ var URL_BASE = "http://localhost/";
90
+ function urlPath(src) {
91
+ return URL.canParse(src, URL_BASE) ? new URL(src, URL_BASE).pathname : null;
92
+ }
93
+ function isGsapCoreUrl(src) {
94
+ return /\/gsap(-\d+(\.\d+)*)?(\.min)?\.js$/i.test(urlPath(src) ?? "");
95
+ }
96
+ var GSAP_PLUGIN_FILE = /\/(\w+Plugin|CustomBounce|CustomEase|CustomWiggle|Draggable|EasePack|Flip|GSDevTools|MotionPathHelper|Observer|ScrollSmoother|ScrollTrigger|SplitText)(\.min)?\.js$/i;
97
+ function isGsapPluginUrl(src) {
98
+ const path = urlPath(src);
99
+ if (!path || isGsapCoreUrl(src)) return false;
100
+ return GSAP_PLUGIN_FILE.test(path) || /\/gsap(@[^/]*)?\/(.+\/)?[^/]+\.js$/i.test(path);
101
+ }
102
+ var TEMPLATE_ELEMENT = /<template\b[^>]*>[\s\S]*?<\/template>/gi;
103
+ var SCRIPT_SRC = /<script\b[^>]*?\ssrc\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gi;
104
+ var INLINED_MARKER = /\/\*\s*inlined:\s*(\S+)\s*\*\//gi;
105
+ var CORE_LICENSE_BANNER = /\/\*!\s*\*\s*GSAP\s+\d/;
106
+ var PLUGIN_LICENSE_BANNER = /\/\*!\s*\*\s*(?!GSAP\s)\w+\s+\d[^*]*\*\s*https:\/\/gsap\.com/;
107
+ var CORE_BODY = /Missing plugin\? gsap\.registerPlugin\(\)/;
108
+ function scriptUrls(html) {
109
+ const srcs = [...html.matchAll(SCRIPT_SRC)].map(
110
+ (m) => (m[1] ?? m[2] ?? m[3] ?? "").replace(/&amp;/gi, "&")
111
+ );
112
+ return [...srcs, ...[...html.matchAll(INLINED_MARKER)].map((m) => m[1] ?? "")];
113
+ }
114
+ function htmlHasGsapCore(html) {
115
+ const live = html.replace(TEMPLATE_ELEMENT, "");
116
+ return scriptUrls(live).some(isGsapCoreUrl) || CORE_LICENSE_BANNER.test(live) || CORE_BODY.test(live);
117
+ }
118
+ function isGsapPluginScript(script) {
119
+ return scriptUrls(script).some(isGsapPluginUrl) || PLUGIN_LICENSE_BANNER.test(script);
120
+ }
121
+ function insertGsapCoreBeforeHeadPlugin(html, coreTag) {
122
+ const lowered = html.toLowerCase();
123
+ const at = findStartTags(html, "script").find((start) => {
124
+ const close = lowered.indexOf("</script", start);
125
+ return isGsapPluginScript(html.slice(start, close === -1 ? void 0 : close));
126
+ });
127
+ if (at === void 0 || insertBeforeCloseTag(html.slice(0, at), "head", "") !== null) return null;
128
+ return `${html.slice(0, at)}${coreTag}
129
+ ${html.slice(at)}`;
130
+ }
131
+
132
+ // ../studio-server/src/helpers/rootPaths.ts
133
+ var ROOT_PATH = /^\/(?!\/)/;
134
+ var PATH_ATTR = /(\s(?:src|href|poster|xlink:href)\s*=\s*)(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/gi;
135
+ var CSS_ROOT_URL = /(\burl\(\s*)(["']?)(\/(?!\/)[^"')\s]*)\2/gi;
136
+ var projectRelative = (path, base) => ROOT_PATH.test(path) && path !== "/" && !path.startsWith(base) ? path.slice(1) : path;
137
+ var underBase = (path, base) => {
138
+ const relative6 = projectRelative(path, base);
139
+ return relative6 === path ? path : base + relative6;
140
+ };
141
+ function withRootPathsRelative(html, base) {
142
+ const css = (text) => text.replace(
143
+ CSS_ROOT_URL,
144
+ (_m, open, quote, path) => `${open}${quote}${projectRelative(path, base)}${quote}`
145
+ );
146
+ const attrs = (tag) => tag.replace(PATH_ATTR, (whole, name, dq, sq, bare) => {
147
+ const path = (dq ?? sq ?? bare ?? "").trim();
148
+ const moved = projectRelative(path, base);
149
+ if (moved === path) return whole;
150
+ return dq !== void 0 ? `${name}"${moved}"` : sq !== void 0 ? `${name}'${moved}'` : `${name}${moved}`;
151
+ });
152
+ return mapStartTagsAndStyles(html, {
153
+ tag: (tag) => /^<(?:a|base)[\s/>]/i.test(tag) ? tag : css(attrs(tag)),
154
+ style: css
155
+ });
156
+ }
157
+
158
+ // ../studio-server/src/helpers/subComposition.ts
159
+ function rewriteRelativePaths(root, compPath, projectDir) {
160
+ const assetExists = (path) => existsSync(join2(projectDir, path));
161
+ rewriteAssetPaths(
162
+ root.querySelectorAll("[src], [href], [srcset]"),
163
+ compPath,
164
+ (el, attr) => el.getAttribute(attr),
165
+ (el, attr, value) => el.setAttribute(attr, value),
166
+ assetExists
167
+ );
168
+ rewriteInlineStyleAssetUrls(
169
+ root.querySelectorAll("[style]"),
170
+ compPath,
171
+ (el) => el.getAttribute("style"),
172
+ (el, value) => el.setAttribute("style", value),
173
+ assetExists
174
+ );
175
+ for (const styleEl of root.querySelectorAll("style")) {
176
+ styleEl.textContent = rewriteCssAssetUrls(styleEl.textContent || "", compPath, assetExists);
177
+ }
178
+ }
179
+ function escapeLeadingDigitIdent(id) {
180
+ return `\\${id.charCodeAt(0).toString(16)} ${id.slice(1)}`;
181
+ }
182
+ var REGEXP_SPECIALS = /[.*+?^${}()|[\]\\]/g;
183
+ function fixDigitLeadingIdSelectors(root) {
184
+ const digitIds = /* @__PURE__ */ new Set();
185
+ for (const el of root.querySelectorAll("[id]")) {
186
+ const id = el.getAttribute("id");
187
+ if (id && /^\d/.test(id)) digitIds.add(id);
188
+ }
189
+ if (digitIds.size === 0) return;
190
+ for (const styleEl of root.querySelectorAll("style")) {
191
+ let css = styleEl.textContent || "";
192
+ for (const id of digitIds) {
193
+ const pattern = new RegExp(`#${id.replace(REGEXP_SPECIALS, "\\$&")}(?![\\w-])`, "g");
194
+ css = css.replace(pattern, `#${escapeLeadingDigitIdent(id)}`);
195
+ }
196
+ styleEl.textContent = css;
197
+ }
198
+ }
199
+ function extractFullDocumentParts(rawHtml, compPath, projectDir) {
200
+ const { document: doc } = parseHTML(rawHtml);
201
+ const rewriteTargets = [doc.head, doc.body].filter(Boolean);
202
+ for (const target of rewriteTargets) {
203
+ rewriteRelativePaths(target, compPath, projectDir);
204
+ }
205
+ fixDigitLeadingIdSelectors(doc);
206
+ const headContent = doc.head?.innerHTML ?? "";
207
+ const bodyContent = doc.body?.innerHTML ?? "";
208
+ const htmlEl = doc.documentElement;
209
+ const htmlAttrs = extractElementAttrs(htmlEl);
210
+ const bodyAttrs = doc.body ? extractElementAttrs(doc.body) : "";
211
+ return { headContent, bodyContent, htmlAttrs, bodyAttrs };
212
+ }
213
+ function extractTemplateInnerHtml(rawComp) {
214
+ const { document: doc } = parseHTML(rawComp);
215
+ const template = doc.querySelector("template");
216
+ return template ? template.innerHTML : null;
217
+ }
218
+ function escapeAttrValue(value) {
219
+ return value.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
220
+ }
221
+ function extractElementAttrs(el) {
222
+ const parts = [];
223
+ for (let i = 0; i < el.attributes.length; i++) {
224
+ const attr = el.attributes[i];
225
+ if (attr.value === "") {
226
+ parts.push(attr.name);
227
+ } else {
228
+ parts.push(`${attr.name}="${escapeAttrValue(attr.value)}"`);
229
+ }
230
+ }
231
+ return parts.join(" ");
232
+ }
233
+ var NON_RENDERED_TAGS = /* @__PURE__ */ new Set(["SCRIPT", "STYLE", "LINK", "META", "TEMPLATE", "NOSCRIPT"]);
234
+ function promoteTemplateCompositionId(rawComp, body) {
235
+ let templateCompositionId;
236
+ for (const tag of rawComp.matchAll(/<template\b[^>]*/gi)) {
237
+ const id = /\bdata-composition-id\s*=\s*["']([^"']+)["']/i.exec(tag[0] ?? "")?.[1];
238
+ if (id) {
239
+ templateCompositionId = id;
240
+ break;
241
+ }
242
+ }
243
+ if (!templateCompositionId) return;
244
+ if (body.querySelector("[data-composition-id]")) return;
245
+ const root = Array.from(body.children).find((el) => !NON_RENDERED_TAGS.has(el.tagName));
246
+ root?.setAttribute("data-composition-id", templateCompositionId);
247
+ }
248
+ function tagRootCompositionFile(bodyHtml, compPath) {
249
+ const tag = firstCompositionIdTag(bodyHtml);
250
+ if (!tag) return bodyHtml;
251
+ if (bodyHtml.slice(tag.start, tag.end).includes("data-composition-file")) return bodyHtml;
252
+ return bodyHtml.slice(0, tag.end) + ` data-composition-file="${escapeAttrValue(compPath)}"` + bodyHtml.slice(tag.end);
253
+ }
254
+ var TAG_OPENER = /<[a-zA-Z]/g;
255
+ var COMPOSITION_ID_ATTR = "data-composition-id=";
256
+ function firstCompositionIdTag(html) {
257
+ TAG_OPENER.lastIndex = 0;
258
+ for (let open = TAG_OPENER.exec(html); open; open = TAG_OPENER.exec(html)) {
259
+ const close = html.indexOf(">", open.index);
260
+ const tag = html.slice(open.index, close === -1 ? html.length : close);
261
+ if (hasBoundedAttr(tag, COMPOSITION_ID_ATTR, 2)) {
262
+ return close === -1 ? null : { start: open.index, end: close };
263
+ }
264
+ if (close === -1) return null;
265
+ TAG_OPENER.lastIndex = close;
266
+ }
267
+ return null;
268
+ }
269
+ function hasBoundedAttr(tag, name, from) {
270
+ for (let at = tag.indexOf(name, from); at !== -1; at = tag.indexOf(name, at + 1)) {
271
+ if (!/\w/.test(tag[at - 1] ?? "")) return true;
272
+ }
273
+ return false;
274
+ }
275
+ var HEAD_OPENER = /<head/gi;
276
+ var HEAD_CLOSER = /<\/head>/gi;
277
+ function rootHeadContent(rootHtml) {
278
+ HEAD_OPENER.lastIndex = 0;
279
+ const open = HEAD_OPENER.exec(rootHtml);
280
+ if (!open) return "";
281
+ const gt = rootHtml.indexOf(">", open.index + open[0].length);
282
+ if (gt === -1) return "";
283
+ HEAD_CLOSER.lastIndex = gt + 1;
284
+ const close = HEAD_CLOSER.exec(rootHtml);
285
+ return close ? rootHtml.slice(gt + 1, close.index) : "";
286
+ }
287
+ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, rawOverride, gsapBaseUrl) {
288
+ const compFile = resolveWithinProject(projectDir, compPath);
289
+ if (!compFile || !existsSync(compFile)) return null;
290
+ const rawComp = rawOverride ?? readFileSync(compFile, "utf-8");
291
+ let compHeadContent = "";
292
+ let rewrittenContent;
293
+ let htmlAttrs = "";
294
+ let bodyAttrs = "";
295
+ const templateInner = extractTemplateInnerHtml(rawComp);
296
+ if (templateInner != null) {
297
+ const { document: contentDoc } = parseHTML(
298
+ `<!DOCTYPE html><html><head></head><body>${templateInner}</body></html>`
299
+ );
300
+ rewriteRelativePaths(contentDoc, compPath, projectDir);
301
+ fixDigitLeadingIdSelectors(contentDoc);
302
+ promoteTemplateCompositionId(rawComp, contentDoc.body);
303
+ rewrittenContent = contentDoc.body.innerHTML || templateInner;
304
+ } else if (isFullHtmlDocument(rawComp)) {
305
+ const parts = extractFullDocumentParts(rawComp, compPath, projectDir);
306
+ compHeadContent = parts.headContent;
307
+ rewrittenContent = parts.bodyContent;
308
+ htmlAttrs = parts.htmlAttrs;
309
+ bodyAttrs = parts.bodyAttrs;
310
+ } else {
311
+ const { document: contentDoc } = parseHTML(
312
+ `<!DOCTYPE html><html><head></head><body>${rawComp}</body></html>`
313
+ );
314
+ rewriteRelativePaths(contentDoc, compPath, projectDir);
315
+ fixDigitLeadingIdSelectors(contentDoc);
316
+ rewrittenContent = contentDoc.body.innerHTML || rawComp;
317
+ }
318
+ rewrittenContent = stripEmbeddedRuntimeScripts(rewrittenContent);
319
+ const { document: scriptsDoc } = parseHTML(
320
+ `<!DOCTYPE html><html><head></head><body>${rewrittenContent}</body></html>`
321
+ );
322
+ deferScriptsUntilFonts(scriptsDoc);
323
+ rewrittenContent = scriptsDoc.body.innerHTML;
324
+ rewrittenContent = tagRootCompositionFile(rewrittenContent, compPath);
325
+ const indexPath = resolveWithinProject(projectDir, "index.html");
326
+ let headContent = "";
327
+ if (indexPath && existsSync(indexPath))
328
+ headContent = rootHeadContent(readFileSync(indexPath, "utf-8"));
329
+ if (baseHref && !hasBaseElement(headContent)) {
330
+ headContent = `<base href="${baseHref}">
331
+ ${headContent}`;
332
+ }
333
+ if (compHeadContent) headContent += `
334
+ ${compHeadContent}`;
335
+ if (baseHref) {
336
+ headContent = withRootPathsRelative(headContent, baseHref);
337
+ rewrittenContent = withRootPathsRelative(rewrittenContent, baseHref);
338
+ }
339
+ headContent = stripEmbeddedRuntimeScripts(headContent);
340
+ headContent += `
341
+ <script ${RUNTIME_BOOTSTRAP_ATTR}="1" src="${runtimeUrl}"></script>`;
342
+ if (!htmlHasGsapCore(headContent)) {
343
+ const core = `<script src="${gsapCdnDist(void 0, gsapBaseUrl).replace(/&/g, "&amp;")}gsap.min.js"></script>`;
344
+ headContent = insertGsapCoreBeforeHeadPlugin(headContent, core) ?? `${headContent}
345
+ ${core}`;
346
+ }
347
+ const htmlOpen = htmlAttrs ? `<html ${htmlAttrs}>` : "<html>";
348
+ const bodyOpen = bodyAttrs ? `<body ${bodyAttrs}>` : "<body>";
349
+ return `<!DOCTYPE html>
350
+ ${htmlOpen}
351
+ <head>
352
+ ${headContent}
353
+ </head>
354
+ ${bodyOpen}
355
+ <script>window.__timelines=window.__timelines||{};</script>
356
+ ${rewrittenContent}
357
+ </body>
358
+ </html>`;
359
+ }
360
+ function hasBaseElement(html) {
361
+ return findStartTags(html, "base").length > 0;
362
+ }
363
+
364
+ // ../studio-server/src/helpers/subCompositionBuild.ts
365
+ import { existsSync as existsSync2 } from "fs";
366
+ import { dirname as dirname2, join as join3 } from "path";
367
+ import { fileURLToPath, pathToFileURL } from "url";
368
+ import { Worker } from "worker_threads";
369
+
370
+ // ../studio-server/src/helpers/rootImportMap.ts
371
+ var IMPORT_MAP_TYPE = /\btype\s*=\s*["']?importmap["']?(?=[\s/>])/i;
372
+ function findImportMap(html) {
373
+ for (const at of findStartTags(html, "script")) {
374
+ const open = /^<script\b[^>]*>/i.exec(html.slice(at));
375
+ if (!open || !IMPORT_MAP_TYPE.test(open[0])) continue;
376
+ const start = at + open[0].length;
377
+ const end = html.toLowerCase().indexOf("</script", start);
378
+ if (end !== -1) return { start, end, json: html.slice(start, end) };
379
+ }
380
+ return null;
381
+ }
382
+ function withRootImportMap(html, base) {
383
+ const ours = { "/": base, [base]: base };
384
+ const own = findImportMap(html);
385
+ if (!own)
386
+ return injectTagsAtHeadStart(
387
+ html,
388
+ `<script type="importmap">${JSON.stringify({ imports: ours })}</script>`
389
+ );
390
+ let map;
391
+ try {
392
+ map = JSON.parse(own.json);
393
+ } catch {
394
+ return html;
395
+ }
396
+ if (!map || typeof map !== "object") return html;
397
+ const under = (path) => underBase(path, base);
398
+ const moved = (entries = {}) => Object.fromEntries(
399
+ Object.entries(entries).map(([key, target]) => [key, under(String(target))])
400
+ );
401
+ const merged = { ...map, imports: { ...ours, ...moved(map.imports) } };
402
+ if (map.scopes)
403
+ merged.scopes = Object.fromEntries(
404
+ Object.entries(map.scopes).map(([scope, entries]) => [under(scope), moved(entries)])
405
+ );
406
+ return html.slice(0, own.start) + JSON.stringify(merged) + html.slice(own.end);
407
+ }
408
+
409
+ // ../studio-server/src/helpers/renderOutputs.ts
410
+ import { readFileSync as readFileSync3 } from "fs";
411
+ import { isAbsolute as isAbsolute2, relative as relative2, resolve as resolve3, sep as sep2 } from "path";
412
+
413
+ // ../studio-server/src/history/ownerLock.ts
414
+ import { spawnSync } from "child_process";
415
+ import { randomUUID } from "crypto";
416
+ import {
417
+ closeSync,
418
+ constants,
419
+ fstatSync,
420
+ linkSync,
421
+ mkdirSync,
422
+ openSync,
423
+ readFileSync as readFileSync2,
424
+ rmSync,
425
+ statSync,
426
+ writeFileSync
427
+ } from "fs";
428
+ import { uptime } from "os";
429
+ import { join as join4 } from "path";
430
+ var NO_FOLLOW = constants.O_NOFOLLOW ?? 0;
431
+ var NON_BLOCK = constants.O_NONBLOCK ?? 0;
432
+
433
+ // ../studio-server/src/helpers/projectSignature.ts
434
+ import { createHash } from "crypto";
435
+ import { lstatSync as lstatSync2, readFileSync as readFileSync4, readdirSync as readdirSync2 } from "fs";
436
+ import { lstat, readFile, readdir } from "fs/promises";
437
+ import { extname, isAbsolute as isAbsolute3, relative as relative3, resolve as resolve4, sep as sep3 } from "path";
438
+ var STUDIO_SIGNATURE_MANIFEST_PATHS = [
439
+ ".hyperframes/studio-manual-edits.json",
440
+ ".hyperframes/studio-motion.json"
441
+ ];
442
+
443
+ // ../studio-server/src/helpers/studioMotionRenderScript.ts
444
+ var STUDIO_MOTION_PATH = ".hyperframes/studio-motion.json";
445
+ function hasStudioMotionEntries(manifestContent) {
446
+ try {
447
+ const parsed = JSON.parse(manifestContent);
448
+ return Array.isArray(parsed.motions) && parsed.motions.length > 0;
449
+ } catch {
450
+ return false;
451
+ }
452
+ }
453
+ function createStudioMotionRenderBodyScript(manifestContent, options = {}) {
454
+ if (!manifestContent.trim() || !hasStudioMotionEntries(manifestContent)) return null;
455
+ return `(${studioMotionRenderRuntime.toString()})(${JSON.stringify(manifestContent)}, ${JSON.stringify(options.activeCompositionPath ?? null)});`;
456
+ }
457
+ function studioMotionRenderRuntime(manifestContent, activeCompositionPath) {
458
+ const STUDIO_MOTION_TIMELINE_ID = "studio-motion";
459
+ const STUDIO_MOTION_ATTR = "data-hf-studio-motion";
460
+ const ORIGINAL_TRANSFORM_ATTR = "data-hf-studio-motion-original-transform";
461
+ const ORIGINAL_OPACITY_ATTR = "data-hf-studio-motion-original-opacity";
462
+ const ORIGINAL_VISIBILITY_ATTR = "data-hf-studio-motion-original-visibility";
463
+ const objectRecord = (value) => value && typeof value === "object" ? value : null;
464
+ const finiteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
465
+ const runtimeWindow = window;
466
+ const parseMotionValues = (value) => {
467
+ const record = objectRecord(value);
468
+ if (!record) return null;
469
+ const parsed = {};
470
+ for (const key of ["x", "y", "scale", "rotation", "opacity", "autoAlpha"]) {
471
+ const next = finiteNumber(record[key]);
472
+ if (next != null) parsed[key] = next;
473
+ }
474
+ return Object.keys(parsed).length > 0 ? parsed : null;
475
+ };
476
+ const parseCustomEase = (value) => {
477
+ const record = objectRecord(value);
478
+ if (!record) return null;
479
+ const id = typeof record.id === "string" ? record.id.trim() : "";
480
+ const data = typeof record.data === "string" ? record.data.trim() : "";
481
+ if (!id || !data) return null;
482
+ return { id, data };
483
+ };
484
+ const parsedManifest = (() => {
485
+ try {
486
+ return objectRecord(JSON.parse(manifestContent));
487
+ } catch {
488
+ return null;
489
+ }
490
+ })();
491
+ const manifestMotions = Array.isArray(parsedManifest?.motions) ? parsedManifest.motions : [];
492
+ const sourceFileForElement = (element) => {
493
+ let current = element;
494
+ while (current) {
495
+ const sourceFile = current.getAttribute("data-composition-file") ?? current.getAttribute("data-composition-src");
496
+ if (sourceFile) return sourceFile;
497
+ current = current.parentElement;
498
+ }
499
+ return activeCompositionPath ?? "index.html";
500
+ };
501
+ const elementMatchesSourceFile = (element, sourceFile) => sourceFileForElement(element) === sourceFile;
502
+ const isHTMLElement = (element) => element instanceof HTMLElement;
503
+ const querySelectorCandidates = (selector) => {
504
+ const className = selector.match(/^\.([A-Za-z0-9_-]+)$/)?.[1];
505
+ if (className) {
506
+ return Array.from(document.getElementsByTagName("*")).filter(
507
+ (element) => isHTMLElement(element) && element.classList.contains(className)
508
+ );
509
+ }
510
+ if (/^[A-Za-z][A-Za-z0-9-]*$/.test(selector)) {
511
+ return Array.from(document.getElementsByTagName(selector)).filter(isHTMLElement);
512
+ }
513
+ return Array.from(document.querySelectorAll(selector)).filter(isHTMLElement);
514
+ };
515
+ const resolveTarget = (targetRecord) => {
516
+ const sourceFile = typeof targetRecord.sourceFile === "string" ? targetRecord.sourceFile : "";
517
+ if (!sourceFile) return null;
518
+ const id = typeof targetRecord.id === "string" ? targetRecord.id : "";
519
+ if (id) {
520
+ const byId = document.getElementById(id);
521
+ if (isHTMLElement(byId) && elementMatchesSourceFile(byId, sourceFile)) return byId;
522
+ }
523
+ const selector = typeof targetRecord.selector === "string" ? targetRecord.selector : "";
524
+ if (!selector) return null;
525
+ try {
526
+ const selectorIndex = Math.max(0, Math.floor(finiteNumber(targetRecord.selectorIndex) ?? 0));
527
+ return querySelectorCandidates(selector).filter(
528
+ (element) => elementMatchesSourceFile(element, sourceFile)
529
+ )[selectorIndex] ?? null;
530
+ } catch {
531
+ return null;
532
+ }
533
+ };
534
+ const restoreElement = (element) => {
535
+ runtimeWindow.gsap?.set?.(element, { clearProps: "transform,opacity,visibility" });
536
+ element.style.transform = element.getAttribute(ORIGINAL_TRANSFORM_ATTR) ?? "";
537
+ element.style.opacity = element.getAttribute(ORIGINAL_OPACITY_ATTR) ?? "";
538
+ element.style.visibility = element.getAttribute(ORIGINAL_VISIBILITY_ATTR) ?? "";
539
+ element.removeAttribute(STUDIO_MOTION_ATTR);
540
+ element.removeAttribute(ORIGINAL_TRANSFORM_ATTR);
541
+ element.removeAttribute(ORIGINAL_OPACITY_ATTR);
542
+ element.removeAttribute(ORIGINAL_VISIBILITY_ATTR);
543
+ };
544
+ const restoreStudioMotionElements = () => {
545
+ for (const element of Array.from(document.querySelectorAll(`[${STUDIO_MOTION_ATTR}]`))) {
546
+ if (isHTMLElement(element)) restoreElement(element);
547
+ }
548
+ };
549
+ const readCurrentTime = () => {
550
+ try {
551
+ const playerTime = runtimeWindow.__player?.getTime?.();
552
+ if (typeof playerTime === "number" && Number.isFinite(playerTime)) {
553
+ return Math.max(0, playerTime);
554
+ }
555
+ } catch {
556
+ }
557
+ try {
558
+ const timelineTime = runtimeWindow.__timeline?.time?.();
559
+ if (typeof timelineTime === "number" && Number.isFinite(timelineTime)) {
560
+ return Math.max(0, timelineTime);
561
+ }
562
+ } catch {
563
+ }
564
+ return 0;
565
+ };
566
+ const resolveEase = (motion) => {
567
+ const fallback = typeof motion.ease === "string" && motion.ease.trim() ? motion.ease.trim() : "none";
568
+ const customEase = parseCustomEase(motion.customEase);
569
+ const customEasePlugin = runtimeWindow.CustomEase;
570
+ if (!customEase || typeof customEasePlugin?.create !== "function") return fallback;
571
+ try {
572
+ runtimeWindow.gsap?.registerPlugin?.(customEasePlugin);
573
+ customEasePlugin.create(customEase.id, customEase.data);
574
+ return customEase.id;
575
+ } catch {
576
+ return fallback;
577
+ }
578
+ };
579
+ const applyManifest = () => {
580
+ runtimeWindow.__timelines = runtimeWindow.__timelines ?? {};
581
+ runtimeWindow.__timelines[STUDIO_MOTION_TIMELINE_ID]?.kill?.();
582
+ delete runtimeWindow.__timelines[STUDIO_MOTION_TIMELINE_ID];
583
+ restoreStudioMotionElements();
584
+ const gsap = runtimeWindow.gsap;
585
+ if (!gsap?.timeline || manifestMotions.length === 0) return 0;
586
+ const timeline = gsap.timeline({ paused: true, defaults: { overwrite: "auto" } });
587
+ let applied = 0;
588
+ for (const motionValue of manifestMotions) {
589
+ const motion = objectRecord(motionValue);
590
+ if (!motion || motion.kind !== "gsap-motion") continue;
591
+ const targetRecord = objectRecord(motion.target);
592
+ if (!targetRecord) continue;
593
+ const target = resolveTarget(targetRecord);
594
+ if (!target || typeof timeline.fromTo !== "function") continue;
595
+ const start = finiteNumber(motion.start);
596
+ const duration = finiteNumber(motion.duration);
597
+ if (start == null || duration == null || start < 0 || duration <= 0) continue;
598
+ const from = parseMotionValues(motion.from);
599
+ const to = parseMotionValues(motion.to);
600
+ if (!from || !to) continue;
601
+ if (!target.hasAttribute(STUDIO_MOTION_ATTR)) {
602
+ target.setAttribute(ORIGINAL_TRANSFORM_ATTR, target.style.transform);
603
+ target.setAttribute(ORIGINAL_OPACITY_ATTR, target.style.opacity);
604
+ target.setAttribute(ORIGINAL_VISIBILITY_ATTR, target.style.visibility);
605
+ }
606
+ target.setAttribute(STUDIO_MOTION_ATTR, "true");
607
+ timeline.fromTo(
608
+ target,
609
+ from,
610
+ { ...to, duration, ease: resolveEase(motion), overwrite: "auto", immediateRender: false },
611
+ start
612
+ );
613
+ applied += 1;
614
+ }
615
+ if (applied === 0) {
616
+ timeline.kill?.();
617
+ return 0;
618
+ }
619
+ runtimeWindow.__timelines[STUDIO_MOTION_TIMELINE_ID] = timeline;
620
+ timeline.pause?.();
621
+ const currentTime = readCurrentTime();
622
+ if (typeof timeline.totalTime === "function") timeline.totalTime(currentTime, false);
623
+ else timeline.time?.(currentTime);
624
+ return applied;
625
+ };
626
+ runtimeWindow.__hfStudioMotionApply = applyManifest;
627
+ applyManifest();
628
+ }
629
+
630
+ // ../studio-server/src/helpers/fileVersion.ts
631
+ import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
632
+
633
+ // ../studio-server/src/helpers/previewReads.ts
634
+ import { readlinkSync } from "fs";
635
+ import { dirname as dirname3, join as join5, parse, relative as relative4, resolve as resolve5 } from "path";
636
+ var ALWAYS_AFFECTS = ["hyperframes.json", ...STUDIO_SIGNATURE_MANIFEST_PATHS];
637
+ var MAX_PREVIEW_PATH_LENGTH = 4096;
638
+ var SHOW_ELEMENT = 1;
639
+ var REFERENCE = /\b(?:src|href|poster|data-composition-src)\s*=\s*(?:"([^"\n]*)"|'([^'\n]*)')|url\(\s*(?:"([^"\n]*)"|'([^'\n]*)'|([^"'\s)]+))/gi;
640
+ var REFERENCE_ATTRIBUTE = /\b(?:src|href|poster|data-composition-src)$/i;
641
+ var isElement = (node) => node.nodeType === 1;
642
+ var pathKey = process.platform === "darwin" || process.platform === "win32" ? (path) => resolve5(path).toLowerCase() : (path) => resolve5(path);
643
+ function previewReferences(html) {
644
+ const named = /* @__PURE__ */ new Set();
645
+ const add = (reference) => {
646
+ const url = reference.trim();
647
+ if (!url || /^(?:[a-z][a-z0-9+.-]*:|[/#])/i.test(url)) return;
648
+ const path = url.split(/[?#]/)[0] ?? "";
649
+ let decoded = path;
650
+ try {
651
+ decoded = decodeURIComponent(path);
652
+ } catch {
653
+ }
654
+ if (decoded && decoded.length <= MAX_PREVIEW_PATH_LENGTH) named.add(decoded);
655
+ };
656
+ const scan = (text) => {
657
+ for (const match of text.matchAll(REFERENCE)) {
658
+ add(match[1] ?? match[2] ?? match[3] ?? match[4] ?? match[5] ?? "");
659
+ }
660
+ };
661
+ const scanElement = (element) => {
662
+ for (const attribute of element.attributes) {
663
+ if (REFERENCE_ATTRIBUTE.test(attribute.name)) add(attribute.value);
664
+ }
665
+ const style = element.getAttribute("style");
666
+ if (style) scan(style);
667
+ if (element.localName === "style" || element.localName === "script") {
668
+ scan(element.textContent ?? "");
669
+ }
670
+ };
671
+ const { document: document2 } = parseHTML(html);
672
+ for (const root of document2.children) {
673
+ scanElement(root);
674
+ const elements = document2.createTreeWalker(root, SHOW_ELEMENT);
675
+ for (let node = elements.nextNode(); node; node = elements.nextNode()) {
676
+ if (isElement(node)) scanElement(node);
677
+ }
678
+ }
679
+ return named;
680
+ }
681
+
682
+ // ../studio-server/src/helpers/previewVariables.ts
683
+ function injectPreviewVariables(html, values) {
684
+ const json = JSON.stringify(values).replace(/</g, "\\u003c");
685
+ const tag = `<script data-hf-preview-variables>window.__hfVariables=${json};</script>`;
686
+ for (const pattern of [/<head/i, /<html/i, /^\s*<!doctype/i]) {
687
+ const match = pattern.exec(html);
688
+ if (match) {
689
+ const end = html.indexOf(">", match.index + match[0].length);
690
+ if (end < 0) continue;
691
+ const at = end + 1;
692
+ return html.slice(0, at) + tag + html.slice(at);
693
+ }
694
+ }
695
+ return tag + html;
696
+ }
697
+
698
+ // ../studio-server/src/helpers/proxyTranscoder.ts
699
+ import { spawn as spawn2 } from "child_process";
700
+ import { randomUUID as randomUUID3 } from "crypto";
701
+ import {
702
+ existsSync as existsSync6,
703
+ mkdtempSync,
704
+ renameSync,
705
+ rmSync as rmSync3,
706
+ unlinkSync as unlinkSync2,
707
+ utimesSync,
708
+ writeFileSync as writeFileSync3
709
+ } from "fs";
710
+ import os, { availableParallelism, tmpdir, totalmem } from "os";
711
+ import { basename as basename4, dirname as dirname7, extname as extname6, isAbsolute as isAbsolute4, join as join9, relative as relative5, resolve as resolve6, sep as sep5 } from "path";
712
+
713
+ // ../studio-server/src/helpers/hdrFilters.ts
714
+ import { spawn } from "child_process";
715
+
716
+ // ../studio-server/src/helpers/mediaMetadata.ts
717
+ import { execFile } from "child_process";
718
+ import { createReadStream } from "fs";
719
+ import { extname as extname2 } from "path";
720
+
721
+ // ../studio-server/src/helpers/proxyCache.ts
722
+ import { existsSync as existsSync3, readdirSync as readdirSync3, statSync as statSync3, unlinkSync } from "fs";
723
+ import { dirname as dirname4, extname as extname3, join as join6 } from "path";
724
+
725
+ // ../studio-server/src/helpers/mediaCodecMap.ts
726
+ import { statSync as statSync2 } from "fs";
727
+ import { sep as sep4 } from "path";
728
+ var PROXY_VARIANT_CONFIG = {
729
+ h264: { extension: ".mp4", contentType: "video/mp4" },
730
+ vp8: { extension: ".webm", contentType: "video/webm" }
731
+ };
732
+ var PROXY_STILL_EXTENSION = ".jpg";
733
+
734
+ // ../studio-server/src/helpers/proxyCache.ts
735
+ var DEFAULT_MAX_BYTES = 10 * 1024 * 1024 * 1024;
736
+ var DEFAULT_STALE_TEMP_MS = 60 * 60 * 1e3;
737
+ var DEFAULT_MIN_SWEEP_INTERVAL_MS = 5 * 60 * 1e3;
738
+ var PROXY_EXTENSIONS = /* @__PURE__ */ new Set([
739
+ ...Object.values(PROXY_VARIANT_CONFIG).map(({ extension }) => extension),
740
+ PROXY_STILL_EXTENSION
741
+ ]);
742
+ var STALE_PIECE_MS = 60 * 60 * 1e3;
743
+
744
+ // ../studio-server/src/helpers/proxyCacheKey.ts
745
+ import { createHash as createHash3 } from "crypto";
746
+ import {
747
+ closeSync as closeSync2,
748
+ createReadStream as createReadStream2,
749
+ existsSync as existsSync4,
750
+ fstatSync as fstatSync2,
751
+ openSync as openSync2,
752
+ readFileSync as readFileSync5,
753
+ statSync as statSync4,
754
+ writeFileSync as writeFileSync2
755
+ } from "fs";
756
+ import { basename as basename2, dirname as dirname5, extname as extname4, join as join7 } from "path";
757
+ var SMALL_FILE_BYTES = 16 * 1024 * 1024;
758
+
759
+ // ../studio-server/src/helpers/proxyLock.ts
760
+ import {
761
+ closeSync as closeSync3,
762
+ existsSync as existsSync5,
763
+ openSync as openSync3,
764
+ readdirSync as readdirSync4,
765
+ readFileSync as readFileSync6,
766
+ rmSync as rmSync2,
767
+ statSync as statSync5,
768
+ writeSync
769
+ } from "fs";
770
+ import { basename as basename3, dirname as dirname6, extname as extname5, join as join8 } from "path";
771
+
772
+ // ../studio-server/src/helpers/proxyTranscoder.ts
773
+ function boundedEnvInteger(name, fallback, min, max) {
774
+ const raw = process.env[name]?.trim();
775
+ if (!raw) return fallback;
776
+ const parsed = Number(raw);
777
+ return Number.isSafeInteger(parsed) && parsed >= min && parsed <= max ? parsed : fallback;
778
+ }
779
+ var MAX_CONCURRENT_TRANSCODES = boundedEnvInteger("HYPERFRAMES_PROXY_MAX_CONCURRENCY", 2, 1, 16);
780
+ var MAX_QUEUED_TRANSCODES = boundedEnvInteger("HYPERFRAMES_PROXY_MAX_QUEUE", 8, 0, 256);
781
+ var TRANSCODE_STALL_MS = boundedEnvInteger(
782
+ "HYPERFRAMES_PROXY_STALL_MS",
783
+ 3 * 60 * 1e3,
784
+ 1e4,
785
+ 60 * 60 * 1e3
786
+ );
787
+ var CONCAT_TIMEOUT_MS = 2 * 60 * 1e3;
788
+ var FAILURE_CACHE_TTL_MS = 60 * 1e3;
789
+ var PROXY_PENDING_RETRY_AFTER_SECONDS = 2;
790
+ var ENVIRONMENT_FAILURE_TTL_MS = 5 * PROXY_PENDING_RETRY_AFTER_SECONDS * 1e3;
791
+ var DEFAULT_PROXY_WAIT_TIMEOUT_MS = 2 * 60 * 1e3;
792
+ var UNTOUCHED_TEMP_IS_DEAD_MS = 10 * 60 * 1e3;
793
+ function createPieceGate(size) {
794
+ let free = size;
795
+ const waiters = [];
796
+ return {
797
+ size,
798
+ acquire: (signal) => {
799
+ signal.throwIfAborted();
800
+ if (free > 0) {
801
+ free--;
802
+ return Promise.resolve();
803
+ }
804
+ return new Promise((resolve9, reject) => {
805
+ const grant = () => {
806
+ signal.removeEventListener("abort", onAbort);
807
+ resolve9();
808
+ };
809
+ const onAbort = () => {
810
+ waiters.splice(waiters.indexOf(grant), 1);
811
+ reject(signal.reason);
812
+ };
813
+ signal.addEventListener("abort", onAbort, { once: true });
814
+ waiters.push(grant);
815
+ });
816
+ },
817
+ release: () => {
818
+ const next = waiters.shift();
819
+ if (next) next();
820
+ else free++;
821
+ }
822
+ };
823
+ }
824
+ var CORES = availableParallelism();
825
+ var PIECE_MEMORY_BYTES = 3 * 1024 ** 3;
826
+ var ALPHA_PIECE_GATE = createPieceGate(
827
+ Math.max(1, Math.min(4, CORES - 1, Math.floor(totalmem() / PIECE_MEMORY_BYTES)))
828
+ );
829
+
830
+ // ../studio-server/src/helpers/mediaProxyPreview.ts
831
+ import { resolve as resolve7 } from "path";
832
+
833
+ // ../studio-server/src/helpers/requestSubPath.ts
834
+ import { existsSync as existsSync7 } from "fs";
835
+
836
+ // ../studio-server/src/helpers/lazyPreviewImages.ts
837
+ function startsAfterZero(el) {
838
+ for (let node = el; node; node = node.parentElement) {
839
+ if (Number(node.getAttribute("data-start")) > 0) return true;
840
+ }
841
+ return false;
842
+ }
843
+ var hasLoading = (img) => Array.from(img.attributes).some((attr) => attr.name.toLowerCase() === "loading");
844
+ function lazyPreviewImages(html) {
845
+ if (!/<!doctype|<html[\s>]/i.test(html)) return html;
846
+ const tags = findStartTags(html, "img");
847
+ if (tags.length === 0) return html;
848
+ const images = [...parseHTML(html).document.querySelectorAll("img")];
849
+ if (tags.length !== images.length) return html;
850
+ const parts = [];
851
+ let from = 0;
852
+ images.forEach((img, i) => {
853
+ if (hasLoading(img) || !startsAfterZero(img)) return;
854
+ const at = (tags[i] ?? 0) + 4;
855
+ parts.push(html.slice(from, at), ` loading="lazy" ${STUDIO_PREVIEW_LAZY_ATTR}`);
856
+ from = at;
857
+ });
858
+ parts.push(html.slice(from));
859
+ return parts.join("");
860
+ }
861
+
862
+ // ../studio-server/src/helpers/captureVideos.ts
863
+ var OTHER_HOST = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
864
+ var isOtherHost = (el) => OTHER_HOST.test(el.getAttribute("src")?.trim() ?? "");
865
+ var isProjectVideo = (video) => !video.hasAttribute("crossorigin") && !isOtherHost(video) && ![...video.querySelectorAll("source")].some(isOtherHost);
866
+ function corsProjectVideos(html) {
867
+ const tags = findStartTags(html, "video");
868
+ if (tags.length === 0) return html;
869
+ const videos = [...parseHTML(html).document.querySelectorAll("video")];
870
+ if (tags.length !== videos.length) return html;
871
+ const parts = [];
872
+ let from = 0;
873
+ videos.forEach((video, i) => {
874
+ if (!isProjectVideo(video)) return;
875
+ const at = (tags[i] ?? 0) + "<video".length;
876
+ parts.push(html.slice(from, at), ' crossorigin="anonymous"');
877
+ from = at;
878
+ });
879
+ parts.push(html.slice(from));
880
+ return parts.join("");
881
+ }
882
+
883
+ // ../studio-server/src/helpers/jobSlots.ts
884
+ var JobAbandonedError = class extends Error {
885
+ constructor() {
886
+ super("job abandoned before it started");
887
+ this.name = "JobAbandonedError";
888
+ }
889
+ };
890
+ function createJobSlots(limit) {
891
+ let running = 0;
892
+ const waiting = [];
893
+ const acquire = (signal) => new Promise((resolve9, reject) => {
894
+ if (signal?.aborted) return reject(new JobAbandonedError());
895
+ if (running < limit) {
896
+ running++;
897
+ return resolve9();
898
+ }
899
+ const leave = () => {
900
+ waiting.splice(waiting.indexOf(start), 1);
901
+ reject(new JobAbandonedError());
902
+ };
903
+ const start = () => {
904
+ signal?.removeEventListener("abort", leave);
905
+ resolve9();
906
+ };
907
+ waiting.push(start);
908
+ signal?.addEventListener("abort", leave, { once: true });
909
+ });
910
+ const release = () => {
911
+ const next = waiting.shift();
912
+ if (next) next();
913
+ else running--;
914
+ };
915
+ return async function run(job, signal) {
916
+ await acquire(signal);
917
+ try {
918
+ return await job();
919
+ } finally {
920
+ release();
921
+ }
922
+ };
923
+ }
924
+
925
+ // ../studio-server/src/routes/preview.ts
926
+ var PROJECT_SIGNATURE_META = "hyperframes-project-signature";
927
+ var runStillJob = createJobSlots(4);
928
+ function escapeGsapUrl(url) {
929
+ return url.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
930
+ }
931
+ function gsapScriptTag(file, baseUrl) {
932
+ return `<script src="${escapeGsapUrl(gsapCdnDist(void 0, baseUrl) + file)}"></script>`;
933
+ }
934
+ function injectProjectSignature(html, signature) {
935
+ const tag = `<meta name="${PROJECT_SIGNATURE_META}" content="${signature}">`;
936
+ if (html.includes(`name="${PROJECT_SIGNATURE_META}"`)) {
937
+ return html.replace(
938
+ new RegExp(`<meta\\s+name=["']${PROJECT_SIGNATURE_META}["'][^>]*>`, "i"),
939
+ tag
940
+ );
941
+ }
942
+ return insertBeforeCloseTag(html, "head", `${tag}
943
+ `) ?? `${tag}
944
+ ${html}`;
945
+ }
946
+ function readStudioMotionManifestContent(projectDir) {
947
+ const manifestPath = join10(projectDir, STUDIO_MOTION_PATH);
948
+ if (!existsSync8(manifestPath)) return "";
949
+ try {
950
+ return readFileSync7(manifestPath, "utf-8");
951
+ } catch {
952
+ return "";
953
+ }
954
+ }
955
+ function parseStudioMotionManifestContent(content) {
956
+ try {
957
+ const parsed = JSON.parse(content);
958
+ const motions = Array.isArray(parsed.motions) ? parsed.motions : [];
959
+ return {
960
+ hasMotion: motions.length > 0,
961
+ hasCustomEase: motions.some((motion) => Boolean(motion?.customEase))
962
+ };
963
+ } catch {
964
+ return { hasMotion: false, hasCustomEase: false };
965
+ }
966
+ }
967
+ function withPreviewRuntime(html, runtimeUrl) {
968
+ const tag = `<script ${RUNTIME_BOOTSTRAP_ATTR}="1" src="${runtimeUrl}"></script>`;
969
+ return insertRuntimeTag(stripEmbeddedRuntimeScripts(html), tag, true);
970
+ }
971
+ function injectScriptTagIntoHead(html, scriptTag) {
972
+ return insertBeforeCloseTag(html, "head", `${scriptTag}
973
+ `) ?? `${scriptTag}
974
+ ${html}`;
975
+ }
976
+ function htmlHasCustomEase(html) {
977
+ return /<script\b[^>]*src=["'][^"']*CustomEase/i.test(html) || /\bwindow\.CustomEase\b/.test(html) || /\bCustomEase\s*=\s*/.test(html);
978
+ }
979
+ function htmlUsesMotionPath(html) {
980
+ return /motionPath\s*[:{]/.test(html);
981
+ }
982
+ function htmlHasMotionPathPlugin(html) {
983
+ return /<script\b[^>]*src=["'][^"']*MotionPathPlugin/i.test(html) || /\bwindow\.MotionPathPlugin\b/.test(html) || /\bMotionPathPlugin\s*=\s*/.test(html);
984
+ }
985
+ function injectMotionPathPluginIfNeeded(html, baseUrl) {
986
+ if (!htmlUsesMotionPath(html) || htmlHasMotionPathPlugin(html)) return html;
987
+ const gsap = findGsapCoreScript(html);
988
+ if (gsap) {
989
+ const version = gsap.src.match(/gsap@([\d.]+)/)?.[1];
990
+ const ordering = `${gsap.type ? ` type="${gsap.type}"` : ""}${gsap.defer ? " defer" : ""}`;
991
+ const pluginTag = `<script${ordering} src="${escapeGsapUrl(motionPathPluginUrl(version, baseUrl))}"></script>`;
992
+ return html.slice(0, gsap.end) + "\n" + pluginTag + html.slice(gsap.end);
993
+ }
994
+ return injectScriptTagIntoHead(html, gsapScriptTag("MotionPathPlugin.min.js", baseUrl));
995
+ }
996
+ function findGsapCoreScript(html) {
997
+ const scripts = [...parseHTML(html).document.querySelectorAll("script")];
998
+ const starts = findStartTags(html, "script");
999
+ if (starts.length !== scripts.length) return null;
1000
+ const at = scripts.findIndex(
1001
+ (script) => isGsapCoreUrl(lowerCaseAttributes(script).get("src") ?? "")
1002
+ );
1003
+ if (at === -1) return null;
1004
+ const attributes = lowerCaseAttributes(scripts[at]);
1005
+ const end = scriptCloseEnd(html, starts[at]);
1006
+ if (end === 0) return null;
1007
+ return {
1008
+ src: attributes.get("src"),
1009
+ type: attributes.get("type") ?? null,
1010
+ defer: attributes.has("defer"),
1011
+ end
1012
+ };
1013
+ }
1014
+ function lowerCaseAttributes(el) {
1015
+ return new Map([...el.attributes].map((a) => [a.name.toLowerCase(), a.value]));
1016
+ }
1017
+ function scriptCloseEnd(html, start) {
1018
+ const close = /<\/script/gi;
1019
+ close.lastIndex = start;
1020
+ const closeAt = close.exec(html)?.index;
1021
+ return closeAt === void 0 ? 0 : html.indexOf(">", closeAt) + 1;
1022
+ }
1023
+ function injectStudioMotionDependencies(html, manifestContent, baseUrl) {
1024
+ const manifest = parseStudioMotionManifestContent(manifestContent);
1025
+ if (!manifest.hasMotion) return html;
1026
+ let next = html;
1027
+ if (!htmlHasGsapCore(next)) {
1028
+ const core = gsapScriptTag("gsap.min.js", baseUrl);
1029
+ next = insertGsapCoreBeforeHeadPlugin(next, core) ?? injectScriptTagIntoHead(next, core);
1030
+ }
1031
+ if (manifest.hasCustomEase && !htmlHasCustomEase(next)) {
1032
+ next = injectScriptTagIntoHead(next, gsapScriptTag("CustomEase.min.js", baseUrl));
1033
+ }
1034
+ return next;
1035
+ }
1036
+ function readStudioMotion(projectDir, activeCompositionPath) {
1037
+ const manifestContent = readStudioMotionManifestContent(projectDir);
1038
+ const script = createStudioMotionRenderBodyScript(manifestContent, {
1039
+ activeCompositionPath
1040
+ });
1041
+ return script ? { manifestContent, script } : null;
1042
+ }
1043
+ function injectStudioMotionScript(html, script) {
1044
+ const tag = `<script type="${AFTER_FONTS_SCRIPT_TYPE}">${script.replace(/<\/script/gi, "<\\/script")}</script>`;
1045
+ return insertBeforeCloseTag(html, "body", tag) ?? `${html}${tag}`;
1046
+ }
1047
+ var GSAP_FALLBACK_ATTR = "data-hf-gsap-fallback";
1048
+ function gsapCdnFallbackScript(baseUrl) {
1049
+ return `<script ${GSAP_FALLBACK_ATTR}>
1050
+ (function(){
1051
+ var cdnBase=${scriptJson(gsapCdnDist(void 0, baseUrl))};
1052
+ var loaded={};
1053
+ function loadFallback(file){
1054
+ if(loaded[file])return loaded[file];
1055
+ return loaded[file]=new Promise(function(ok,fail){
1056
+ var s=document.createElement("script");
1057
+ s.src=cdnBase+file;s.hfGsapFallback=true;s.onload=ok;s.onerror=fail;
1058
+ document.head.appendChild(s);
1059
+ });
1060
+ }
1061
+ document.addEventListener("error",function(e){
1062
+ var t=e.target;
1063
+ if(!t||t.tagName!=="SCRIPT"||!t.src||t.hfGsapFallback)return;
1064
+ var m=t.src.match(/gsap[^/]*\\/dist\\/(.+\\.js)/);
1065
+ if(m)loadFallback(m[1]).catch(function(){
1066
+ reportError(new Error("GSAP could not load from "+t.src+" or "+cdnBase+m[1]+", so this preview's animations will not play."));
1067
+ });
1068
+ },true);
1069
+ })();
1070
+ </script>`;
1071
+ }
1072
+ function injectGsapCdnFallback(html, baseUrl) {
1073
+ if (html.includes(GSAP_FALLBACK_ATTR)) return html;
1074
+ if (html.includes("<head>"))
1075
+ return html.replace("<head>", "<head>" + gsapCdnFallbackScript(baseUrl));
1076
+ return gsapCdnFallbackScript(baseUrl) + html;
1077
+ }
1078
+ function scriptJson(value) {
1079
+ return JSON.stringify(value).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
1080
+ }
1081
+ var earlyErrorsScript = (runtimeUrl) => `<script>(function(){var seen=window.${STUDIO_PREVIEW_ERRORS}=[],kinds=window.${STUDIO_PREVIEW_ERROR_KINDS}=[],known={SyntaxError:1,TypeError:1,ReferenceError:1,RangeError:1},runtime=${scriptJson(new URL(runtimeUrl, "http://x").pathname)};
1082
+ addEventListener("error",function(e){seen.push(e.message||String(e));
1083
+ var name=e.error&&e.error.constructor&&e.error.constructor.name,path="";
1084
+ try{var url=e.filename&&new URL(e.filename,window.location.href);if(url&&url.origin===window.location.origin)path=url.pathname}catch(_){}
1085
+ kinds.push({name:known[name]===1?name:"other",origin:!path?"unknown":path===runtime?"runtime":path.indexOf("/api/projects/")===0?"project":"studio"})});})();</script>`;
1086
+ function injectStudioPreviewAugmentations(html, runtimeUrl, signature, projectDir, activeCompositionPath, options) {
1087
+ const marked = options.capture ? injectTagsAtHeadStart(
1088
+ options.sandboxedCapture ? corsProjectVideos(html) : html,
1089
+ `<meta name="${STUDIO_PREVIEW_MARK_META}" content="${STUDIO_PREVIEW_CAPTURE_MODE}">`
1090
+ ) : injectTagsAtHeadStart(
1091
+ lazyPreviewImages(html),
1092
+ `<meta name="${STUDIO_PREVIEW_MARK_META}">${earlyErrorsScript(runtimeUrl)}`
1093
+ );
1094
+ const withFallback = injectGsapCdnFallback(
1095
+ injectProjectSignature(
1096
+ injectTagsAtHeadStart(
1097
+ marked,
1098
+ `<meta name="${GSAP_BASE_URL_META}" content="${escapeGsapUrl(options.gsapBaseUrl)}">`
1099
+ ),
1100
+ signature
1101
+ ),
1102
+ options.gsapBaseUrl
1103
+ );
1104
+ const studioMotion = readStudioMotion(projectDir, activeCompositionPath);
1105
+ const withMotionDependencies = studioMotion ? injectStudioMotionDependencies(
1106
+ withFallback,
1107
+ studioMotion.manifestContent,
1108
+ options.gsapBaseUrl
1109
+ ) : withFallback;
1110
+ const withPlugin = injectMotionPathPluginIfNeeded(withMotionDependencies, options.gsapBaseUrl);
1111
+ return studioMotion ? injectStudioMotionScript(withPlugin, studioMotion.script) : withPlugin;
1112
+ }
1113
+
1114
+ // ../studio-server/src/helpers/subCompositionWorker.ts
1115
+ function build(job) {
1116
+ const { projectDir, compPath, compFile, runtimeUrl, baseHref, gsapBaseUrl } = job;
1117
+ let pinned;
1118
+ if (/\.html?$/i.test(compPath)) {
1119
+ try {
1120
+ pinned = ensureHfIds(readFileSync8(compFile, "utf-8"));
1121
+ } catch {
1122
+ return null;
1123
+ }
1124
+ }
1125
+ const built = buildSubCompositionHtml(
1126
+ projectDir,
1127
+ compPath,
1128
+ runtimeUrl,
1129
+ baseHref,
1130
+ pinned,
1131
+ gsapBaseUrl
1132
+ );
1133
+ if (!built) return null;
1134
+ const html = withPreviewRuntime(withRootImportMap(built, baseHref), runtimeUrl);
1135
+ return { html, references: [...previewReferences(html)] };
1136
+ }
1137
+ function finish({
1138
+ html,
1139
+ runtimeUrl,
1140
+ signature,
1141
+ projectDir,
1142
+ compPath,
1143
+ options,
1144
+ variables
1145
+ }) {
1146
+ const augmented = injectStudioPreviewAugmentations(
1147
+ ensureHfIds(html),
1148
+ runtimeUrl,
1149
+ signature,
1150
+ projectDir,
1151
+ compPath,
1152
+ options
1153
+ );
1154
+ return variables ? injectPreviewVariables(augmented, variables) : augmented;
1155
+ }
1156
+ parentPort?.on("message", ({ id, job }) => {
1157
+ try {
1158
+ parentPort?.postMessage({ id, result: job.kind === "build" ? build(job) : finish(job) });
1159
+ } catch (error) {
1160
+ parentPort?.postMessage({ id, error: error instanceof Error ? error.message : String(error) });
1161
+ }
1162
+ });