hyperframes 0.9.33 → 0.9.35

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 (316) hide show
  1. package/bin/hyperframes.mjs +10 -0
  2. package/dist/{add-GDXM36YQ.js → add-T5XBJN7F.js} +17 -16
  3. package/dist/{agentPromptGenerator-KPNDH2EI.js → agentPromptGenerator-KYLYM7IC.js} +11 -11
  4. package/dist/{animatedGifPrep-SAKETEZ2.js → animatedGifPrep-FLIPCLVQ.js} +10 -10
  5. package/dist/api.js +41 -41
  6. package/dist/{appHistory-WZIHFCPK.js → appHistory-VOZOEPVK.js} +3 -3
  7. package/dist/{asset-KOJC72AQ.js → asset-PJLMPMBK.js} +3 -3
  8. package/dist/{assetCataloger-Q4ZFUI6G.js → assetCataloger-ZQ2PWA47.js} +12 -12
  9. package/dist/{audio-XZBBXKQC.js → audio-EBICH5EQ.js} +21 -21
  10. package/dist/{auth-X45YSZGE.js → auth-OTDAEZYD.js} +2 -2
  11. package/dist/{autoUpdate-77XWQ564.js → autoUpdate-TQWOBFKJ.js} +2 -2
  12. package/dist/{avatars-D3D22TI2.js → avatars-WRUDCHTJ.js} +14 -14
  13. package/dist/{backgroundChecks-2L2RWFJ3.js → backgroundChecks-AMPTVQY5.js} +3 -3
  14. package/dist/backgroundChecksWorker.js +5 -4
  15. package/dist/{batchRender-O7J47H2Z.js → batchRender-SGTA6JAT.js} +6 -6
  16. package/dist/{beats-6RVVU56H.js → beats-TLHZXD7W.js} +13 -13
  17. package/dist/{benchmark-D5JRNAVQ.js → benchmark-TAXHNW33.js} +11 -11
  18. package/dist/{billing-WT4DGZII.js → billing-GOHX7W6X.js} +15 -15
  19. package/dist/{browser-2OR737P4.js → browser-H7K5L7WE.js} +10 -9
  20. package/dist/{bundleWithLocalizedFonts-VBET4RVR.js → bundleWithLocalizedFonts-6VWRV726.js} +1 -1
  21. package/dist/{capture-23X2CK56.js → capture-WJAV7DPT.js} +22 -22
  22. package/dist/{capture-B34FTO6G.js → capture-WVJK3FNU.js} +4 -4
  23. package/dist/{captureCompositionFrame-TPZKEVKN.js → captureCompositionFrame-R2OQ5A4S.js} +18 -18
  24. package/dist/{captureFile-Y2ZMB7HK.js → captureFile-MRDRPMNA.js} +3 -3
  25. package/dist/{catalog-ACHSYU5Z.js → catalog-JKDKE3QA.js} +17 -16
  26. package/dist/{catch-up-FGANS2BB.js → catch-up-65YBZQSC.js} +11 -11
  27. package/dist/{check-DXK4L5WP.js → check-XMNNDKNC.js} +50 -50
  28. package/dist/{checkAudio-4ISYJED3.js → checkAudio-ITIWPYET.js} +14 -14
  29. package/dist/{checkBrowser-5ECMULMP.js → checkBrowser-MQHZWWLA.js} +43 -43
  30. package/dist/{chunk-2I4DQZLQ.js → chunk-2QM6JA3F.js} +23 -37
  31. package/dist/{chunk-UC4X6I35.js → chunk-3F2DTPBD.js} +0 -6
  32. package/dist/chunk-42KTBKL4.js +5053 -0
  33. package/dist/{chunk-DMZER7D5.js → chunk-46ZLBZPE.js} +2 -2
  34. package/dist/{chunk-7UUUV4PN.js → chunk-47JK3BOK.js} +1 -1
  35. package/dist/{chunk-I3PA54IU.js → chunk-4IPKEJPW.js} +1 -1
  36. package/dist/{chunk-MDGNQWFN.js → chunk-5M43Z25X.js} +1 -1
  37. package/dist/{chunk-CHM3QYLF.js → chunk-5OHPI5OR.js} +3 -3
  38. package/dist/{chunk-SOAQ3XXB.js → chunk-5TAFQEKH.js} +2 -2
  39. package/dist/{chunk-XDRSEU2I.js → chunk-6AJG7TMS.js} +6 -6
  40. package/dist/{chunk-G7PITEUH.js → chunk-6MYO2IHD.js} +1 -1
  41. package/dist/{chunk-BMDABBHG.js → chunk-7IVPSA4K.js} +5 -17
  42. package/dist/{chunk-HPKW6UVW.js → chunk-7JCATDO6.js} +3 -3
  43. package/dist/{chunk-JZIEZCQM.js → chunk-7PBJR7WI.js} +5 -12
  44. package/dist/{chunk-O2T6ZTLN.js → chunk-7SUMXO6L.js} +1 -1
  45. package/dist/{chunk-UE2WSWNA.js → chunk-7ZYTAHZ2.js} +1 -1
  46. package/dist/{chunk-YTUPQTXA.js → chunk-A2MYAIM3.js} +10 -10
  47. package/dist/{chunk-A4VXOJZO.js → chunk-A2OQGUBL.js} +3 -3
  48. package/dist/{chunk-YNFHZ4RI.js → chunk-A3CUI2S2.js} +3 -3
  49. package/dist/{chunk-JCJJCYCP.js → chunk-A3MH6DGU.js} +10 -10
  50. package/dist/{chunk-VZQXHYEI.js → chunk-A3UI2LNA.js} +3 -3
  51. package/dist/{chunk-DDDSTRHU.js → chunk-ADAXA5XD.js} +26 -8
  52. package/dist/{chunk-2TBW7UOF.js → chunk-AOZKUVTY.js} +203 -115
  53. package/dist/{chunk-T3GSTIBS.js → chunk-AU6UGZZ4.js} +3 -3
  54. package/dist/{chunk-N6Y645MX.js → chunk-B7GOS2BL.js} +1 -1
  55. package/dist/{chunk-2QTGQGYA.js → chunk-BFXSMYNY.js} +1 -1
  56. package/dist/{chunk-IYLGUQFR.js → chunk-BHOEEMCW.js} +3 -3
  57. package/dist/{chunk-XUDJ5XSQ.js → chunk-BHPPJMXP.js} +6 -6
  58. package/dist/{chunk-REJ4NIBY.js → chunk-BHSQSWN6.js} +1 -1
  59. package/dist/{chunk-MA35E5OY.js → chunk-BTYCPOPD.js} +2 -2
  60. package/dist/{chunk-GHLLC6LJ.js → chunk-CEBLQRYG.js} +2 -2
  61. package/dist/{chunk-2LMCARA5.js → chunk-CI34E4VF.js} +6 -4
  62. package/dist/{chunk-CKJDY6EK.js → chunk-DC7AOIHN.js} +1 -1
  63. package/dist/{chunk-6ZVUTYNB.js → chunk-DLJ6ESP7.js} +6 -6
  64. package/dist/{chunk-23354HMA.js → chunk-DVAKYHZN.js} +3 -3
  65. package/dist/{chunk-B66UZ2YK.js → chunk-DYNIPOEN.js} +6 -6
  66. package/dist/{chunk-R45WFVRA.js → chunk-ECYVLHZZ.js} +2 -2
  67. package/dist/{chunk-W2FSQBUR.js → chunk-EIBERSJ2.js} +14 -14
  68. package/dist/{chunk-EX533ULK.js → chunk-EVMSNLUQ.js} +2 -2
  69. package/dist/{chunk-WYPRTHXQ.js → chunk-EXMJ7JS5.js} +2 -2
  70. package/dist/{chunk-I35B5RWZ.js → chunk-F645WHPZ.js} +4 -4
  71. package/dist/{chunk-ZIYXPDKY.js → chunk-FF6T5VPF.js} +2 -2
  72. package/dist/{chunk-G55YEL2L.js → chunk-FJ4PIVGB.js} +436 -57
  73. package/dist/{chunk-YAS347ZS.js → chunk-FLVHLNQN.js} +1 -1
  74. package/dist/{chunk-HEXTAQYG.js → chunk-FYCI7NEH.js} +2 -2
  75. package/dist/{chunk-6RV2QY4K.js → chunk-G4CQIZZC.js} +23 -23
  76. package/dist/{chunk-BBL6STGK.js → chunk-GHCG2KZD.js} +2 -2
  77. package/dist/{chunk-XVVPEWNX.js → chunk-GPERPLAQ.js} +1 -1
  78. package/dist/{chunk-VQJLTYEK.js → chunk-GT5REDGY.js} +2 -2
  79. package/dist/{chunk-CDI3CCAU.js → chunk-GUYH2XH2.js} +12 -14
  80. package/dist/{chunk-4DLYTSWQ.js → chunk-H3DP5ELI.js} +1 -1
  81. package/dist/chunk-HOIEN7O4.js +31 -0
  82. package/dist/{chunk-4CHGNFCS.js → chunk-I5VIATAH.js} +4 -4
  83. package/dist/{chunk-2B2IMLUQ.js → chunk-I6V25IXG.js} +1 -1
  84. package/dist/{chunk-76KUCQXD.js → chunk-IARWDMY7.js} +3 -3
  85. package/dist/{chunk-KRWPTZBY.js → chunk-IU5DC4HP.js} +94 -42
  86. package/dist/{chunk-PXDRW3QN.js → chunk-J466WOMZ.js} +1 -1
  87. package/dist/{chunk-6QEEF5RR.js → chunk-J54ZPEWO.js} +1 -1
  88. package/dist/{chunk-DGC2RIQE.js → chunk-JN3N335Z.js} +4 -4
  89. package/dist/{chunk-N2C7WJDG.js → chunk-KCIZBYAS.js} +1 -1
  90. package/dist/{chunk-SVI2CJ6R.js → chunk-KCPIENND.js} +1 -1
  91. package/dist/{chunk-W5PW26KE.js → chunk-KEUDODWJ.js} +1 -1
  92. package/dist/{chunk-QWM3NY2E.js → chunk-KKIAPWVZ.js} +4 -4
  93. package/dist/{chunk-ROXILOZ6.js → chunk-KLXPYLNA.js} +2 -2
  94. package/dist/{chunk-3J32XVJ6.js → chunk-LCK6C46G.js} +3 -3
  95. package/dist/{chunk-EVMY7IPL.js → chunk-LD6JONPV.js} +155 -22
  96. package/dist/{chunk-YSHUIQ3I.js → chunk-LO74I6MZ.js} +1 -1
  97. package/dist/{chunk-CNJLBAKM.js → chunk-LQV2PMKI.js} +2 -2
  98. package/dist/{chunk-N7C7U3ZR.js → chunk-M425BL2U.js} +22 -11
  99. package/dist/{chunk-MP36L7OJ.js → chunk-MG6GU4FF.js} +2 -2
  100. package/dist/{chunk-AIC7T7CC.js → chunk-MM5URNHE.js} +2 -2
  101. package/dist/{chunk-PIEVAPKP.js → chunk-MYETYFDI.js} +1 -1
  102. package/dist/{chunk-CHJGVW5W.js → chunk-N36NHUGP.js} +4 -11
  103. package/dist/{chunk-EX7WPDFA.js → chunk-NABIUZRZ.js} +2 -2
  104. package/dist/{chunk-4US5QCXR.js → chunk-NJF566HN.js} +77 -31
  105. package/dist/{chunk-XQWWFIBR.js → chunk-NMQ26YZX.js} +2 -2
  106. package/dist/{chunk-MVIUSNPZ.js → chunk-NQAXN2B2.js} +1 -1
  107. package/dist/{chunk-YDG3OXH3.js → chunk-NQE4NKVE.js} +2 -2
  108. package/dist/{chunk-ETWXZQN5.js → chunk-NTVSXJHQ.js} +2 -2
  109. package/dist/{chunk-U77L3ZQZ.js → chunk-OW5BBEVE.js} +1 -1
  110. package/dist/{chunk-SUXEL7G4.js → chunk-OYCKZZDC.js} +11 -11
  111. package/dist/{chunk-Y5DOT5NQ.js → chunk-PHDEKHEN.js} +1 -1
  112. package/dist/{chunk-KIAY63AB.js → chunk-PIA7JBWF.js} +26 -14
  113. package/dist/{chunk-RGYOCAHC.js → chunk-PP6XMZXN.js} +2 -2
  114. package/dist/{chunk-XFXCI4IP.js → chunk-Q4RX6D2H.js} +2 -2
  115. package/dist/{chunk-4WZU4FYS.js → chunk-QZFKLORI.js} +4 -4
  116. package/dist/{chunk-ADYMQM7T.js → chunk-R43U3RJ3.js} +2 -2
  117. package/dist/{chunk-C2VZ7UPE.js → chunk-RES7SNFU.js} +15 -15
  118. package/dist/{chunk-2RBQLV6B.js → chunk-RK3KWEOM.js} +1 -1
  119. package/dist/{chunk-ZOAANTVI.js → chunk-RZBPK4LO.js} +1 -1
  120. package/dist/{chunk-5GYTBKZA.js → chunk-S5FHA2NX.js} +2 -2
  121. package/dist/{chunk-SWPI27QV.js → chunk-SG4DOSAE.js} +8 -8
  122. package/dist/{chunk-L6BFXQ6S.js → chunk-SJGYWLHO.js} +3 -3
  123. package/dist/{chunk-JSVCF4A6.js → chunk-SM36NR25.js} +2 -2
  124. package/dist/{chunk-WIMVXPYG.js → chunk-SODOJ4CP.js} +11 -11
  125. package/dist/{chunk-ERJBWDPM.js → chunk-SWOE4NH4.js} +6 -6
  126. package/dist/{chunk-4FTJE22M.js → chunk-SZUO4O74.js} +2 -2
  127. package/dist/{chunk-O5CNNVRY.js → chunk-TORIKOIX.js} +8 -8
  128. package/dist/{chunk-TFBPCJPG.js → chunk-U47ZNIUB.js} +1 -1
  129. package/dist/{chunk-NQFIMBXS.js → chunk-UFWTTQ72.js} +2 -2
  130. package/dist/{chunk-FRH3CPW5.js → chunk-V4XLGSUL.js} +1 -1
  131. package/dist/{chunk-XSHJ37U3.js → chunk-VQVA4FRS.js} +8 -8
  132. package/dist/{chunk-HMB3IAVP.js → chunk-VX5JYR6N.js} +2 -2
  133. package/dist/{chunk-GOMTMQRT.js → chunk-VXVDZFZL.js} +1 -1
  134. package/dist/{chunk-MDBEAWP2.js → chunk-VYARX4SV.js} +3 -3
  135. package/dist/{chunk-77UB5EHM.js → chunk-WCSGSWKA.js} +1 -1
  136. package/dist/{chunk-2KYLVWLO.js → chunk-WWKU5VK7.js} +1 -1
  137. package/dist/{chunk-45ZQI734.js → chunk-X47GMPT2.js} +2 -2
  138. package/dist/{chunk-IEEIPTDW.js → chunk-X5BRDEOM.js} +2 -2
  139. package/dist/{chunk-G2XAFJ2B.js → chunk-X73RI4GQ.js} +2 -2
  140. package/dist/{chunk-7LTXT7ME.js → chunk-XAPVWRO5.js} +2 -2
  141. package/dist/{chunk-PNP2BO3U.js → chunk-XKL3WQI2.js} +3 -3
  142. package/dist/{chunk-RCB4SGTB.js → chunk-XODMUHGW.js} +50 -13
  143. package/dist/{chunk-HZTRKUKE.js → chunk-XWK2RSD5.js} +37 -0
  144. package/dist/{chunk-SIGASWB7.js → chunk-Y6U6DDBC.js} +4 -4
  145. package/dist/chunk-YFC5II7G.js +143 -0
  146. package/dist/chunk-YHJOTCTV.js +16 -0
  147. package/dist/{chunk-VKZSAAXZ.js → chunk-YUG4GVRH.js} +4 -4
  148. package/dist/{chunk-GBIASKIH.js → chunk-Z7VKBKC3.js} +1 -1
  149. package/dist/{chunk-OD7PLYYX.js → chunk-ZKGDIPMD.js} +32 -23
  150. package/dist/{chunk-LIWK3MFR.js → chunk-ZLTB7ZCQ.js} +6 -6
  151. package/dist/{chunk-5RVPI6QL.js → chunk-ZOL6363C.js} +3 -3
  152. package/dist/{clean-3IN64RHM.js → clean-MTIRQX5P.js} +28 -28
  153. package/dist/cli.js +66 -65
  154. package/dist/{cloud-LBUZBUP6.js → cloud-MWZ3SO3Z.js} +4 -4
  155. package/dist/{cloud-SVYXHFEG.js → cloud-SXXNSICW.js} +3 -3
  156. package/dist/{cloudrun-PZOF2QGL.js → cloudrun-7ZLJG5K7.js} +8 -8
  157. package/dist/{compare-UOJ3LXQQ.js → compare-336QVVJC.js} +42 -42
  158. package/dist/{compiler-5ZDHBKBQ.js → compiler-HYZUBDAD.js} +6 -6
  159. package/dist/{component-EVIPLTTJ.js → component-NEPVQVDF.js} +4 -4
  160. package/dist/{compositions-R4GG5FBO.js → compositions-5UXCOLME.js} +15 -15
  161. package/dist/{contactSheet-HZMP42FZ.js → contactSheet-3YTXO7U5.js} +4 -4
  162. package/dist/{curve-LR3PSRW3.js → curve-GDAFPSYA.js} +14 -14
  163. package/dist/{cuts-DHCOBAFT.js → cuts-U5XZJLGG.js} +15 -15
  164. package/dist/{delete-MMGGU3QP.js → delete-G4U723IG.js} +7 -7
  165. package/dist/{deploy-SKIGUTM2.js → deploy-ZJ6GBOAW.js} +2 -2
  166. package/dist/{describeProject-L7HNTBPV.js → describeProject-NOXO6HJS.js} +11 -11
  167. package/dist/{destroy-5HSMMDH7.js → destroy-ZYOIJW7D.js} +2 -2
  168. package/dist/{deterministicFonts-2ZPRAI3C.js → deterministicFonts-UDNPRDYM.js} +4 -4
  169. package/dist/{diff-KR7VKPYL.js → diff-NZ7IBYWS.js} +36 -36
  170. package/dist/{dist-3MFNUZSN.js → dist-CF7A6UPR.js} +3 -3
  171. package/dist/{dist-ZGYPFYOH.js → dist-I3WOJFIM.js} +4 -4
  172. package/dist/{dist-HK3AZNNL.js → dist-YSFMNDNF.js} +26 -23
  173. package/dist/{doctor-G7VGNSA5.js → doctor-OAEXYBD5.js} +17 -17
  174. package/dist/{energy-H7EEH6WO.js → energy-36Y2RVKN.js} +15 -15
  175. package/dist/{events-YD6N7OPQ.js → events-7MO6VYY5.js} +7 -7
  176. package/dist/{events-ASG27IXP.js → events-BN5A4QSC.js} +17 -17
  177. package/dist/{events-5ATZCZTK.js → events-OY5PAL44.js} +2 -2
  178. package/dist/{execute-OAS454OB.js → execute-6QR32QHM.js} +34 -34
  179. package/dist/{extract-645SENLA.js → extract-GS4GFBJ4.js} +15 -15
  180. package/dist/{face-WRT5XH4I.js → face-DXIURLMN.js} +16 -16
  181. package/dist/{feedback-3LKLR5MV.js → feedback-L5B5D2H4.js} +14 -14
  182. package/dist/{ffmpeg-PXKIZL2X.js → ffmpeg-RO3TC7DT.js} +10 -10
  183. package/dist/{figma-RIEVJJBW.js → figma-YSLP3NDJ.js} +3 -3
  184. package/dist/fontLocalizeCli.js +18 -17
  185. package/dist/{frames-OTB3J5W3.js → frames-NNGPW5Q5.js} +17 -17
  186. package/dist/{generate-IUKCZW2D.js → generate-IYY5CQKF.js} +26 -26
  187. package/dist/{get-6WVQ7TBV.js → get-GHTMJWAX.js} +7 -7
  188. package/dist/{gpuPolicy-HXSVAEU4.js → gpuPolicy-UGUQTJXT.js} +10 -10
  189. package/dist/{grade-compare-TCAYHDEF.js → grade-compare-HMQIS6CO.js} +41 -41
  190. package/dist/hangReport.js +2 -1
  191. package/dist/{heifImagePrep-GXIMK4HK.js → heifImagePrep-6CHEBOTB.js} +11 -11
  192. package/dist/{help-RGOL5EJD.js → help-M6V73NMA.js} +1 -1
  193. package/dist/{history-XKPRGJGS.js → history-JLNS7C6E.js} +15 -15
  194. package/dist/hyperframe.manifest.json +1 -1
  195. package/dist/hyperframe.runtime.iife.js +64 -64
  196. package/dist/hyperframes-player.global.js +1 -1
  197. package/dist/{info-EYBBC42V.js → info-VHVWJBZ5.js} +17 -17
  198. package/dist/{init-F2FWPSMA.js → init-RAWSPX3T.js} +33 -33
  199. package/dist/{ink-BWFERAAT.js → ink-R2VCYLF3.js} +15 -15
  200. package/dist/{inspect-74N7L3BW.js → inspect-ODGFUWRM.js} +41 -41
  201. package/dist/{installer-LOUR7G4R.js → installer-YAJDSTNZ.js} +8 -8
  202. package/dist/{keyframes-WB5PTKFE.js → keyframes-MWS46OMG.js} +11 -11
  203. package/dist/{lambda-JYCNXUKB.js → lambda-EPIPZ62Q.js} +17 -17
  204. package/dist/{layout-P52EVR24.js → layout-IVOS3PHW.js} +41 -41
  205. package/dist/{lint-SL55KAS2.js → lint-G3XW5PVR.js} +13 -13
  206. package/dist/{lintProject-46WU53VC.js → lintProject-L42FF7XI.js} +3 -3
  207. package/dist/{list-LN6CQH52.js → list-25OWFBNT.js} +8 -8
  208. package/dist/{localPage-L6OJU3UH.js → localPage-PAUE6E6K.js} +11 -11
  209. package/dist/{login-WTOAMDID.js → login-EHL5EH3E.js} +4 -4
  210. package/dist/{look-O6ESLJRP.js → look-H2AAYHQC.js} +15 -15
  211. package/dist/{manager-IAXYSRG5.js → manager-DLEEPJVW.js} +2 -1
  212. package/dist/{manager-CMEZWENF.js → manager-T3FIJKIL.js} +11 -11
  213. package/dist/{measure-NEIXU53P.js → measure-IAGLDGL2.js} +11 -11
  214. package/dist/{media-treatment-6CAQG7MU.js → media-treatment-F53Y4K2K.js} +17 -17
  215. package/dist/{media-use-IXJFMKU7.js → media-use-7XRQIXDO.js} +22 -7
  216. package/dist/{models-TZALWUEY.js → models-UA72SFBG.js} +16 -16
  217. package/dist/{motionShot-OQYK6G6M.js → motionShot-WRHPBYSX.js} +22 -22
  218. package/dist/{normalize-audio-43PJLOBY.js → normalize-audio-6UO7T2NP.js} +14 -14
  219. package/dist/{open-EOX6QY4M.js → open-DVABOI2D.js} +19 -19
  220. package/dist/{parakeetRunner-STHAXQAF.js → parakeetRunner-IHEW335J.js} +18 -18
  221. package/dist/{pipeline-RRWZHFBQ.js → pipeline-SGJTBYFI.js} +13 -13
  222. package/dist/{plan-JWUSMF4W.js → plan-IB2LZKFH.js} +26 -26
  223. package/dist/{play-TUKTST32.js → play-OSJU47PB.js} +31 -31
  224. package/dist/{preflight-L42JKT6F.js → preflight-4UVA2SF4.js} +12 -12
  225. package/dist/{present-Z7HRDXPV.js → present-6HRJ67G2.js} +25 -25
  226. package/dist/{preview-HGTIRAV3.js → preview-ILIRTOIL.js} +59 -35
  227. package/dist/{probe-RXK44FY7.js → probe-QJIEY5RM.js} +15 -15
  228. package/dist/{producer-KJ2RZDJ3.js → producer-LUARVB5B.js} +1 -1
  229. package/dist/{projectConfig-K36NTJXP.js → projectConfig-CS4PKLO5.js} +11 -11
  230. package/dist/{publication-OZWLT6K6.js → publication-DQMOW7B4.js} +6 -6
  231. package/dist/{publish-CRUTXNYM.js → publish-TSZA3TYC.js} +19 -19
  232. package/dist/{remove-background-R37HZPCG.js → remove-background-URZDLZJ4.js} +14 -14
  233. package/dist/{render-ZHCPCISN.js → render-3HONOYZE.js} +49 -49
  234. package/dist/{render-SU2XTMJL.js → render-OHACUI7J.js} +8 -8
  235. package/dist/{render-EZMKBT7V.js → render-RDFQDDZA.js} +37 -37
  236. package/dist/{render-batch-YIUOEAAL.js → render-batch-EUKAQFHN.js} +8 -8
  237. package/dist/renderSetupWorker.js +6 -5
  238. package/dist/{resolver-DLCKRKQR.js → resolver-BTUTJ26S.js} +8 -8
  239. package/dist/{reverse-4FAVXIER.js → reverse-LTPJ6QRV.js} +1 -1
  240. package/dist/{run-H4GVEJVS.js → run-SIBZZM3T.js} +4 -4
  241. package/dist/{screenshotCapture-CQF5FYVI.js → screenshotCapture-2VXR5FHK.js} +13 -13
  242. package/dist/{service-XDQOULGD.js → service-47AZQ6EN.js} +14 -14
  243. package/dist/{share-CUCQALE7.js → share-4JJK6QM6.js} +19 -19
  244. package/dist/{sherpa-WZNRQUVC.js → sherpa-WDGLCJMP.js} +17 -17
  245. package/dist/sherpaWorker.js +4 -2
  246. package/dist/skills/hyperframes/references/plugin-installation.md +5 -2
  247. package/dist/skills/hyperframes/scripts/bake-basemap.mjs +1 -0
  248. package/dist/skills/hyperframes/scripts/lib/windows-exe-search.mjs +11 -0
  249. package/dist/skills/hyperframes/scripts/lib/windows-exe-search.test.mjs +149 -0
  250. package/dist/skills/hyperframes/scripts/locate.mjs +1 -0
  251. package/dist/skills/hyperframes/scripts/plugin-cli.mjs +21 -3
  252. package/dist/skills/hyperframes/scripts/plugin-cli.test.mjs +93 -7
  253. package/dist/skills/hyperframes-cli/references/doctor-browser.md +1 -1
  254. package/dist/skills/media-use/audio/scripts/carve.mjs +1 -0
  255. package/dist/skills/media-use/audio/scripts/extract-audio-data.py +3 -1
  256. package/dist/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +6 -6
  257. package/dist/skills/media-use/audio/scripts/lib/bgm.mjs +1 -0
  258. package/dist/skills/media-use/audio/scripts/lib/gemini-auth.mjs +1 -0
  259. package/dist/skills/media-use/audio/scripts/lib/python.mjs +1 -0
  260. package/dist/skills/media-use/audio/scripts/lib/recording.mjs +1 -0
  261. package/dist/skills/media-use/audio/scripts/lib/tts.cleanup.test.mjs +12 -6
  262. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +26 -6
  263. package/dist/skills/media-use/audio/scripts/lib/tts.spawn.test.mjs +37 -12
  264. package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +54 -18
  265. package/dist/skills/media-use/audio/scripts/trusted-program.test.mjs +106 -0
  266. package/dist/skills/media-use/audio/scripts/trusted_program.py +76 -0
  267. package/dist/skills/media-use/references/audio.md +2 -0
  268. package/dist/skills/media-use/references/operations.md +2 -1
  269. package/dist/skills/media-use/scripts/dither.mjs +1 -0
  270. package/dist/skills/media-use/scripts/eval.mjs +1 -0
  271. package/dist/skills/media-use/scripts/lib/npx-sync.test.mjs +22 -31
  272. package/dist/skills/media-use/scripts/lib/tts-local-provider.mjs +16 -11
  273. package/dist/skills/media-use/scripts/lib/tts-local-provider.test.mjs +34 -78
  274. package/dist/skills/media-use/scripts/lib/windows-exe-search.mjs +11 -0
  275. package/dist/skills/media-use/scripts/resolve-plugin.test.mjs +43 -19
  276. package/dist/skills/media-use/scripts/transcribe.mjs +1 -0
  277. package/dist/skills/media-use/scripts/transcribe.test.mjs +60 -17
  278. package/dist/skills/media-use/scripts/transcript-cut.mjs +1 -0
  279. package/dist/{skills-J52DBZAK.js → skills-32PFTMRC.js} +10 -10
  280. package/dist/{skillsUpdateCheck-26DJHBTC.js → skillsUpdateCheck-4YNSO2QT.js} +3 -3
  281. package/dist/{snapshot-ZIRQFDA7.js → snapshot-L26W46YP.js} +53 -53
  282. package/dist/{src-C3XYMTF4.js → src-KJ7FMIH7.js} +11 -9
  283. package/dist/{src-7BGBN6SS.js → src-SGZPUKDL.js} +15 -15
  284. package/dist/{start-QG2XNMYN.js → start-77AN6NW5.js} +24 -24
  285. package/dist/{staticProjectServer-TWMEFK3T.js → staticProjectServer-RDXGUNKX.js} +27 -27
  286. package/dist/{status-3UPA5WPI.js → status-BRVZZRTC.js} +18 -17
  287. package/dist/studio/assets/{codec-qz1-OXLj.js → codec-GKrIfefq.js} +1 -1
  288. package/dist/studio/assets/{hyperframes-player-2eG1zFX5.js → hyperframes-player-BUFkdSG-.js} +1 -1
  289. package/dist/studio/assets/{index-DDmhnfrS.js → index-BzrZjoXW.js} +159 -159
  290. package/dist/studio/assets/{index-DUveJ_YP.js → index-oGGylite.js} +1 -1
  291. package/dist/studio/assets/{pausedVideoDecoder-CoHTKUjM.js → pausedVideoDecoder-VUkpOCb9.js} +1 -1
  292. package/dist/studio/index.html +1 -1
  293. package/dist/{studio-api-Z42OO4JJ.js → studio-api-UZHSY6PR.js} +26 -23
  294. package/dist/{studioServer-SMN3RMVL.js → studioServer-UOVV7CDW.js} +126 -79
  295. package/dist/{sync-ONTI2WSI.js → sync-74O4W75V.js} +15 -15
  296. package/dist/{synthesize-FR5KPBRP.js → synthesize-7DD5JV36.js} +5 -4
  297. package/dist/{telemetry-RRXALB5D.js → telemetry-NB5MWICG.js} +7 -7
  298. package/dist/{templates-BHFOSD6F.js → templates-HOIYYCM2.js} +15 -15
  299. package/dist/{timeline-Z5IHY5TN.js → timeline-NUG347GZ.js} +26 -26
  300. package/dist/{tokens-MZVEPARM.js → tokens-TVAYON5K.js} +3 -3
  301. package/dist/{transcribe-M5N3YZZU.js → transcribe-3RN5NRX6.js} +14 -14
  302. package/dist/{transcribe-5IZS4BGW.js → transcribe-67A5YVQD.js} +31 -31
  303. package/dist/{tts-ZE776B4I.js → tts-SOSATBP4.js} +2 -2
  304. package/dist/{update-EVPWBIKY.js → update-QEVNP7XN.js} +12 -12
  305. package/dist/{updateCheck-2UUEF6TC.js → updateCheck-SZ6BPLHI.js} +2 -2
  306. package/dist/{upgrade-DK45FD4K.js → upgrade-NFDDBX2T.js} +5 -5
  307. package/dist/{urlDownloader-3MPHIDSA.js → urlDownloader-Q7225DS7.js} +9 -9
  308. package/dist/{validate-W27TQ367.js → validate-IMI6OBMO.js} +33 -33
  309. package/dist/{video-TI372QGV.js → video-K7UAJJLP.js} +12 -12
  310. package/dist/{voices-FZV4PGT6.js → voices-K2GLTRAS.js} +24 -24
  311. package/dist/warmCheck.js +52 -51
  312. package/dist/warmCheckClient.js +2 -1
  313. package/package.json +1 -1
  314. package/dist/chunk-64F653HO.js +0 -164
  315. package/dist/chunk-WXOOAAT4.js +0 -314
  316. package/dist/chunk-XDDBSGBD.js +0 -5049
@@ -19,7 +19,7 @@ import {
19
19
  splitElementInHtml,
20
20
  unwrapElementsFromHtml,
21
21
  wrapElementsInHtml
22
- } from "./chunk-QWM3NY2E.js";
22
+ } from "./chunk-KKIAPWVZ.js";
23
23
  import {
24
24
  DEFAULT_TARGET_LUFS,
25
25
  absoluteLoudnessPlan,
@@ -28,7 +28,7 @@ import {
28
28
  requestedProjectPath,
29
29
  requiredFfmpeg,
30
30
  resolveLocalAudioPath
31
- } from "./chunk-XUDJ5XSQ.js";
31
+ } from "./chunk-BHPPJMXP.js";
32
32
  import {
33
33
  MEDIA_LINK_ATTR,
34
34
  relinkSplitHalves
@@ -56,11 +56,11 @@ import {
56
56
  scanProjectMedia,
57
57
  shouldPrewarmProxy,
58
58
  waitForProxy
59
- } from "./chunk-XSHJ37U3.js";
59
+ } from "./chunk-VQVA4FRS.js";
60
60
  import {
61
61
  probeAudioTrack,
62
62
  probeMediaMetadata
63
- } from "./chunk-2LMCARA5.js";
63
+ } from "./chunk-CI34E4VF.js";
64
64
  import {
65
65
  HistoryBusyError,
66
66
  MAX_WINDOW_IDLE_MS,
@@ -75,38 +75,37 @@ import {
75
75
  resolveProjectSignature,
76
76
  serveWhileOpen,
77
77
  settledFileTag
78
- } from "./chunk-XDRSEU2I.js";
78
+ } from "./chunk-6AJG7TMS.js";
79
79
  import {
80
80
  findTimelineScript,
81
81
  parseGsapScriptAcorn
82
82
  } from "./chunk-BZULWFMJ.js";
83
83
  import {
84
- STUDIO_MOTION_PATH,
85
- createStudioMotionRenderBodyScript,
86
84
  isInHiddenOrVendorDir,
87
85
  isLinkFreeWithinProject,
88
86
  isPrivateProjectFile,
89
87
  isPrivateProjectPath,
88
+ isWritableProjectFile,
90
89
  mkdirOwnedWithinProject,
91
90
  pinWithinProject,
91
+ pinWritableWithinProject,
92
92
  projectRelativePath,
93
93
  realFilePath,
94
94
  resolveWithinProject as resolveWithinProject2,
95
+ resolveWritableWithinProject,
95
96
  walkDir
96
- } from "./chunk-WXOOAAT4.js";
97
+ } from "./chunk-YFC5II7G.js";
97
98
  import {
99
+ STUDIO_MANUAL_EDITS_PATH,
98
100
  openRangeEnd,
99
101
  parseEncoderOptions
100
- } from "./chunk-64F653HO.js";
102
+ } from "./chunk-LD6JONPV.js";
101
103
  import {
102
104
  SYSTEM_FONT_SIZE_LIMIT,
103
105
  collectFontFileEntries,
104
106
  fontDirectories,
105
107
  locateSystemFont
106
108
  } from "./chunk-ZB2XGJSP.js";
107
- import {
108
- STUDIO_MANUAL_EDITS_PATH
109
- } from "./chunk-EVMY7IPL.js";
110
109
  import {
111
110
  decodableAudioStream
112
111
  } from "./chunk-D3MUHMFG.js";
@@ -115,13 +114,13 @@ import {
115
114
  ensureHfIds,
116
115
  stampHfIdsInPlace,
117
116
  stripSdrPngColourTags
118
- } from "./chunk-KIAY63AB.js";
117
+ } from "./chunk-PIA7JBWF.js";
119
118
  import {
120
119
  atomicTempPath,
121
120
  createFileAtomically,
122
121
  createStagingDir,
123
122
  replaceFileAtomically
124
- } from "./chunk-IEEIPTDW.js";
123
+ } from "./chunk-X5BRDEOM.js";
125
124
  import {
126
125
  GSAP_BASE_URL_META,
127
126
  PREVIEW_PROXY_BOX_PARAM,
@@ -139,7 +138,7 @@ import {
139
138
  normalizeGsapLocalRoot,
140
139
  parseFps,
141
140
  parsePreviewProxyBox
142
- } from "./chunk-EX7WPDFA.js";
141
+ } from "./chunk-NABIUZRZ.js";
143
142
  import {
144
143
  AFTER_FONTS_SCRIPT_TYPE,
145
144
  RUNTIME_BOOTSTRAP_ATTR,
@@ -154,7 +153,7 @@ import {
154
153
  resolveRateSpec,
155
154
  sourceTimeAt,
156
155
  stripEmbeddedRuntimeScripts
157
- } from "./chunk-XDDBSGBD.js";
156
+ } from "./chunk-42KTBKL4.js";
158
157
  import {
159
158
  ProjectRootMissingError,
160
159
  folderGone,
@@ -163,15 +162,16 @@ import {
163
162
  mkdirWithinProject,
164
163
  realpath,
165
164
  resolveWithinProject
166
- } from "./chunk-HZTRKUKE.js";
165
+ } from "./chunk-XWK2RSD5.js";
167
166
  import {
168
167
  isWithinProjectRoot,
169
168
  readProjectFile
170
169
  } from "./chunk-K2Z6OXEI.js";
171
170
  import {
172
171
  FFPROBE_PATH_ENV,
173
- findFfBinary
174
- } from "./chunk-KRWPTZBY.js";
172
+ findFfBinary,
173
+ requireFfBinary
174
+ } from "./chunk-IU5DC4HP.js";
175
175
  import {
176
176
  decodeCssEscapes,
177
177
  decodeWellFormedEscapes,
@@ -190,7 +190,7 @@ import {
190
190
  decodeAuthoredAttribute,
191
191
  scanHtmlOpeningTags,
192
192
  unrollComputedTimeline
193
- } from "./chunk-N7C7U3ZR.js";
193
+ } from "./chunk-M425BL2U.js";
194
194
  import {
195
195
  parseHTML
196
196
  } from "./chunk-GWTIFRF5.js";
@@ -312,7 +312,7 @@ function sameOriginPost(headers) {
312
312
  return originMatches(headers.origin, host, proto);
313
313
  }
314
314
 
315
- // ../studio-server/dist/chunk-SWYC6DTD.js
315
+ // ../studio-server/dist/chunk-ILQI7DJE.js
316
316
  import { createHash } from "crypto";
317
317
  import { closeSync, constants, fstatSync, openSync, readFileSync } from "fs";
318
318
  import { dirname, join } from "path";
@@ -457,7 +457,7 @@ function clearElementScreenshotIsolation() {
457
457
  page.__hfThumbnailFaded = [];
458
458
  }
459
459
 
460
- // ../studio-server/dist/chunk-GTWLICSP.js
460
+ // ../studio-server/dist/chunk-2KDRIAG2.js
461
461
  import { resolve } from "path";
462
462
  function isAutoProxyEnabled(adapter) {
463
463
  return adapter.autoProxy !== false;
@@ -504,6 +504,193 @@ async function injectMediaCodecMap(html, adapter, projectDir, compSrcPath, probe
504
504
  return injectMediaCodecMapIntoHtml(html, projectDir, [{ html, compSrcPath }], probeCache, false);
505
505
  }
506
506
 
507
+ // ../studio-server/dist/chunk-L3HJVTQE.js
508
+ var STUDIO_MOTION_PATH = ".hyperframes/studio-motion.json";
509
+ function hasStudioMotionEntries(manifestContent) {
510
+ try {
511
+ const parsed = JSON.parse(manifestContent);
512
+ return Array.isArray(parsed.motions) && parsed.motions.length > 0;
513
+ } catch {
514
+ return false;
515
+ }
516
+ }
517
+ function createStudioMotionRenderBodyScript(manifestContent, options = {}) {
518
+ if (!manifestContent.trim() || !hasStudioMotionEntries(manifestContent)) return null;
519
+ return `(${studioMotionRenderRuntime.toString()})(${JSON.stringify(manifestContent)}, ${JSON.stringify(options.activeCompositionPath ?? null)});`;
520
+ }
521
+ function studioMotionRenderRuntime(manifestContent, activeCompositionPath) {
522
+ const STUDIO_MOTION_TIMELINE_ID = "studio-motion";
523
+ const STUDIO_MOTION_ATTR = "data-hf-studio-motion";
524
+ const ORIGINAL_TRANSFORM_ATTR = "data-hf-studio-motion-original-transform";
525
+ const ORIGINAL_OPACITY_ATTR = "data-hf-studio-motion-original-opacity";
526
+ const ORIGINAL_VISIBILITY_ATTR = "data-hf-studio-motion-original-visibility";
527
+ const objectRecord = (value) => value && typeof value === "object" ? value : null;
528
+ const finiteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
529
+ const runtimeWindow = window;
530
+ const parseMotionValues = (value) => {
531
+ const record = objectRecord(value);
532
+ if (!record) return null;
533
+ const parsed = {};
534
+ for (const key of ["x", "y", "scale", "rotation", "opacity", "autoAlpha"]) {
535
+ const next = finiteNumber(record[key]);
536
+ if (next != null) parsed[key] = next;
537
+ }
538
+ return Object.keys(parsed).length > 0 ? parsed : null;
539
+ };
540
+ const parseCustomEase = (value) => {
541
+ const record = objectRecord(value);
542
+ if (!record) return null;
543
+ const id = typeof record.id === "string" ? record.id.trim() : "";
544
+ const data = typeof record.data === "string" ? record.data.trim() : "";
545
+ if (!id || !data) return null;
546
+ return { id, data };
547
+ };
548
+ const parsedManifest = (() => {
549
+ try {
550
+ return objectRecord(JSON.parse(manifestContent));
551
+ } catch {
552
+ return null;
553
+ }
554
+ })();
555
+ const manifestMotions = Array.isArray(parsedManifest?.motions) ? parsedManifest.motions : [];
556
+ const sourceFileForElement = (element) => {
557
+ let current = element;
558
+ while (current) {
559
+ const sourceFile = current.getAttribute("data-composition-file") ?? current.getAttribute("data-composition-src");
560
+ if (sourceFile) return sourceFile;
561
+ current = current.parentElement;
562
+ }
563
+ return activeCompositionPath ?? "index.html";
564
+ };
565
+ const elementMatchesSourceFile = (element, sourceFile) => sourceFileForElement(element) === sourceFile;
566
+ const isHTMLElement2 = (element) => element instanceof HTMLElement;
567
+ const querySelectorCandidates = (selector) => {
568
+ const className = selector.match(/^\.([A-Za-z0-9_-]+)$/)?.[1];
569
+ if (className) {
570
+ return Array.from(document.getElementsByTagName("*")).filter(
571
+ (element) => isHTMLElement2(element) && element.classList.contains(className)
572
+ );
573
+ }
574
+ if (/^[A-Za-z][A-Za-z0-9-]*$/.test(selector)) {
575
+ return Array.from(document.getElementsByTagName(selector)).filter(isHTMLElement2);
576
+ }
577
+ return Array.from(document.querySelectorAll(selector)).filter(isHTMLElement2);
578
+ };
579
+ const resolveTarget = (targetRecord) => {
580
+ const sourceFile = typeof targetRecord.sourceFile === "string" ? targetRecord.sourceFile : "";
581
+ if (!sourceFile) return null;
582
+ const id = typeof targetRecord.id === "string" ? targetRecord.id : "";
583
+ if (id) {
584
+ const byId = document.getElementById(id);
585
+ if (isHTMLElement2(byId) && elementMatchesSourceFile(byId, sourceFile)) return byId;
586
+ }
587
+ const selector = typeof targetRecord.selector === "string" ? targetRecord.selector : "";
588
+ if (!selector) return null;
589
+ try {
590
+ const selectorIndex = Math.max(0, Math.floor(finiteNumber(targetRecord.selectorIndex) ?? 0));
591
+ return querySelectorCandidates(selector).filter(
592
+ (element) => elementMatchesSourceFile(element, sourceFile)
593
+ )[selectorIndex] ?? null;
594
+ } catch {
595
+ return null;
596
+ }
597
+ };
598
+ const restoreElement = (element) => {
599
+ runtimeWindow.gsap?.set?.(element, { clearProps: "transform,opacity,visibility" });
600
+ element.style.transform = element.getAttribute(ORIGINAL_TRANSFORM_ATTR) ?? "";
601
+ element.style.opacity = element.getAttribute(ORIGINAL_OPACITY_ATTR) ?? "";
602
+ element.style.visibility = element.getAttribute(ORIGINAL_VISIBILITY_ATTR) ?? "";
603
+ element.removeAttribute(STUDIO_MOTION_ATTR);
604
+ element.removeAttribute(ORIGINAL_TRANSFORM_ATTR);
605
+ element.removeAttribute(ORIGINAL_OPACITY_ATTR);
606
+ element.removeAttribute(ORIGINAL_VISIBILITY_ATTR);
607
+ };
608
+ const restoreStudioMotionElements = () => {
609
+ for (const element of Array.from(document.querySelectorAll(`[${STUDIO_MOTION_ATTR}]`))) {
610
+ if (isHTMLElement2(element)) restoreElement(element);
611
+ }
612
+ };
613
+ const readCurrentTime = () => {
614
+ try {
615
+ const playerTime = runtimeWindow.__player?.getTime?.();
616
+ if (typeof playerTime === "number" && Number.isFinite(playerTime)) {
617
+ return Math.max(0, playerTime);
618
+ }
619
+ } catch {
620
+ }
621
+ try {
622
+ const timelineTime = runtimeWindow.__timeline?.time?.();
623
+ if (typeof timelineTime === "number" && Number.isFinite(timelineTime)) {
624
+ return Math.max(0, timelineTime);
625
+ }
626
+ } catch {
627
+ }
628
+ return 0;
629
+ };
630
+ const resolveEase = (motion) => {
631
+ const fallback = typeof motion.ease === "string" && motion.ease.trim() ? motion.ease.trim() : "none";
632
+ const customEase = parseCustomEase(motion.customEase);
633
+ const customEasePlugin = runtimeWindow.CustomEase;
634
+ if (!customEase || typeof customEasePlugin?.create !== "function") return fallback;
635
+ try {
636
+ runtimeWindow.gsap?.registerPlugin?.(customEasePlugin);
637
+ customEasePlugin.create(customEase.id, customEase.data);
638
+ return customEase.id;
639
+ } catch {
640
+ return fallback;
641
+ }
642
+ };
643
+ const applyManifest = () => {
644
+ runtimeWindow.__timelines = runtimeWindow.__timelines ?? {};
645
+ runtimeWindow.__timelines[STUDIO_MOTION_TIMELINE_ID]?.kill?.();
646
+ delete runtimeWindow.__timelines[STUDIO_MOTION_TIMELINE_ID];
647
+ restoreStudioMotionElements();
648
+ const gsap = runtimeWindow.gsap;
649
+ if (!gsap?.timeline || manifestMotions.length === 0) return 0;
650
+ const timeline = gsap.timeline({ paused: true, defaults: { overwrite: "auto" } });
651
+ let applied = 0;
652
+ for (const motionValue of manifestMotions) {
653
+ const motion = objectRecord(motionValue);
654
+ if (!motion || motion.kind !== "gsap-motion") continue;
655
+ const targetRecord = objectRecord(motion.target);
656
+ if (!targetRecord) continue;
657
+ const target = resolveTarget(targetRecord);
658
+ if (!target || typeof timeline.fromTo !== "function") continue;
659
+ const start = finiteNumber(motion.start);
660
+ const duration = finiteNumber(motion.duration);
661
+ if (start == null || duration == null || start < 0 || duration <= 0) continue;
662
+ const from = parseMotionValues(motion.from);
663
+ const to = parseMotionValues(motion.to);
664
+ if (!from || !to) continue;
665
+ if (!target.hasAttribute(STUDIO_MOTION_ATTR)) {
666
+ target.setAttribute(ORIGINAL_TRANSFORM_ATTR, target.style.transform);
667
+ target.setAttribute(ORIGINAL_OPACITY_ATTR, target.style.opacity);
668
+ target.setAttribute(ORIGINAL_VISIBILITY_ATTR, target.style.visibility);
669
+ }
670
+ target.setAttribute(STUDIO_MOTION_ATTR, "true");
671
+ timeline.fromTo(
672
+ target,
673
+ from,
674
+ { ...to, duration, ease: resolveEase(motion), overwrite: "auto", immediateRender: false },
675
+ start
676
+ );
677
+ applied += 1;
678
+ }
679
+ if (applied === 0) {
680
+ timeline.kill?.();
681
+ return 0;
682
+ }
683
+ runtimeWindow.__timelines[STUDIO_MOTION_TIMELINE_ID] = timeline;
684
+ timeline.pause?.();
685
+ const currentTime = readCurrentTime();
686
+ if (typeof timeline.totalTime === "function") timeline.totalTime(currentTime, false);
687
+ else timeline.time?.(currentTime);
688
+ return applied;
689
+ };
690
+ runtimeWindow.__hfStudioMotionApply = applyManifest;
691
+ applyManifest();
692
+ }
693
+
507
694
  // ../studio-server/dist/index.js
508
695
  import { Hono } from "hono";
509
696
  import { readFile } from "fs/promises";
@@ -3859,6 +4046,7 @@ import { basename as basename3, dirname as dirname8, extname, join as join15, po
3859
4046
  import { existsSync as existsSync11, readFileSync as readFileSync13 } from "fs";
3860
4047
  import { homedir } from "os";
3861
4048
  import { join as join16 } from "path";
4049
+ import { createHmac, randomBytes as randomBytes2, timingSafeEqual } from "crypto";
3862
4050
  import { createHash as createHash7 } from "crypto";
3863
4051
  import { readFileSync as readFileSync14, readdirSync as readdirSync5, rmSync as rmSync6 } from "fs";
3864
4052
  import { join as join17 } from "path";
@@ -4514,9 +4702,10 @@ function computePeaks(floats, count) {
4514
4702
  async function decodeAudioPeaks(audioPath) {
4515
4703
  const track = await probeAudioTrack(audioPath);
4516
4704
  if (!track) throw new Error("no audio stream");
4705
+ const ffmpeg = requireFfBinary("ffmpeg");
4517
4706
  return new Promise((resolvePromise, reject) => {
4518
4707
  const proc = spawn(
4519
- findFfBinary("ffmpeg") ?? "ffmpeg",
4708
+ ffmpeg,
4520
4709
  [
4521
4710
  "-i",
4522
4711
  audioPath,
@@ -4928,6 +5117,9 @@ async function resolveProjectPath(c, adapter, route, opts) {
4928
5117
  }
4929
5118
  return { error: c.json({ error: "forbidden", why: "outside_project" }, 403) };
4930
5119
  }
5120
+ if (opts?.write && !isWritableProjectFile(project.dir, absPath)) {
5121
+ return { error: c.json({ error: "forbidden", why: "protected_path" }, 403) };
5122
+ }
4931
5123
  if (opts?.mustExist && !existsSync4(absPath)) {
4932
5124
  return { error: c.json({ error: "not found" }, 404) };
4933
5125
  }
@@ -4937,7 +5129,7 @@ function resolveProjectFile(c, adapter, opts) {
4937
5129
  return resolveProjectPath(c, adapter, "files", opts);
4938
5130
  }
4939
5131
  function resolveFileMutationContext(c, adapter, operation) {
4940
- return resolveProjectPath(c, adapter, `file-mutations/${operation}`, { pin: true });
5132
+ return resolveProjectPath(c, adapter, `file-mutations/${operation}`, { pin: true, write: true });
4941
5133
  }
4942
5134
  function isOptionalInteger(value) {
4943
5135
  return value === void 0 || Number.isInteger(value);
@@ -5017,7 +5209,7 @@ function foldAndCommitElementPatchBatches(projectDir, batches, writeFile, reques
5017
5209
  const resolvedPaths = /* @__PURE__ */ new Set();
5018
5210
  const prepared = [];
5019
5211
  for (const batch of batches) {
5020
- const absPath = pinWithinProject(projectDir, batch.sourceFile);
5212
+ const absPath = pinWritableWithinProject(projectDir, batch.sourceFile);
5021
5213
  if (!absPath) return { error: "forbidden", sourceFile: batch.sourceFile };
5022
5214
  if (resolvedPaths.has(absPath)) return { error: "duplicate", sourceFile: batch.sourceFile };
5023
5215
  resolvedPaths.add(absPath);
@@ -5455,7 +5647,7 @@ function updateReferences(projectDir, oldPath, newPath, isDirectory) {
5455
5647
  const rewrite = referenceRewriter(oldPath, newPath, isDirectory, projectPaths(projectDir));
5456
5648
  let updatedCount = 0;
5457
5649
  for (const file of textFiles) {
5458
- if (!isSafePath(projectDir, file) || isPrivateProjectFile(projectDir, file)) continue;
5650
+ if (!isSafePath(projectDir, file) || !isWritableProjectFile(projectDir, file)) continue;
5459
5651
  const content = readableText(file);
5460
5652
  if (content === null) continue;
5461
5653
  const updated = rewrite(content, referenceSyntax(file));
@@ -5748,7 +5940,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
5748
5940
  let block = extractGsapScriptBlock(html);
5749
5941
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
5750
5942
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
5751
- const { GSAP_CDN } = await import("./dist-ZGYPFYOH.js");
5943
+ const { GSAP_CDN } = await import("./dist-I3WOJFIM.js");
5752
5944
  const bootstrap = [
5753
5945
  `<script src="${GSAP_CDN}"></script>`,
5754
5946
  "<script>",
@@ -6605,7 +6797,8 @@ async function processUploadedFiles(formData, targetDir, projectDir) {
6605
6797
  finalName = `${base} (${n})${ext}`;
6606
6798
  finalPath = resolve2(targetDir, finalName);
6607
6799
  }
6608
- if (!isSafePath(projectDir, finalPath) || isPrivateProjectFile(projectDir, finalPath)) continue;
6800
+ if (!isSafePath(projectDir, finalPath) || !isWritableProjectFile(projectDir, finalPath))
6801
+ continue;
6609
6802
  const buffer = Buffer.from(await value.arrayBuffer());
6610
6803
  const validation = validateUploadedMediaBuffer(finalName, buffer);
6611
6804
  if (!validation.ok) {
@@ -6681,7 +6874,7 @@ function registerFileRoutes(api, adapter) {
6681
6874
  }
6682
6875
  });
6683
6876
  api.put("/projects/:id/files/*", async (c) => {
6684
- const res = await resolveProjectFile(c, adapter, { pin: true });
6877
+ const res = await resolveProjectFile(c, adapter, { pin: true, write: true });
6685
6878
  if ("error" in res) return res.error;
6686
6879
  const body = Buffer.from(await c.req.arrayBuffer());
6687
6880
  const expectedVersion = c.req.header("If-Match")?.trim() ?? null;
@@ -6782,7 +6975,7 @@ function registerFileRoutes(api, adapter) {
6782
6975
  });
6783
6976
  });
6784
6977
  api.post("/projects/:id/files/*", async (c) => {
6785
- const res = await resolveProjectFile(c, adapter);
6978
+ const res = await resolveProjectFile(c, adapter, { write: true });
6786
6979
  if ("error" in res) return res.error;
6787
6980
  ensureDir(res.project.dir, res.absPath);
6788
6981
  const body = Buffer.from(await c.req.arrayBuffer());
@@ -6797,7 +6990,7 @@ function registerFileRoutes(api, adapter) {
6797
6990
  return c.json({ ok: true, path: res.filePath }, 201);
6798
6991
  });
6799
6992
  api.delete("/projects/:id/files/*", async (c) => {
6800
- const res = await resolveProjectFile(c, adapter, { mustExist: true });
6993
+ const res = await resolveProjectFile(c, adapter, { mustExist: true, write: true });
6801
6994
  if ("error" in res) return res.error;
6802
6995
  const stat2 = statSync3(res.absPath);
6803
6996
  const backup = snapshotBeforeWrite(res.project.dir, res.absPath);
@@ -6934,7 +7127,7 @@ function registerFileRoutes(api, adapter) {
6934
7127
  const seen = /* @__PURE__ */ new Set();
6935
7128
  const prepared = [];
6936
7129
  for (const file of files) {
6937
- const absPath = pinWithinProject(project.dir, file.path);
7130
+ const absPath = pinWritableWithinProject(project.dir, file.path);
6938
7131
  if (!absPath) return c.json({ error: `forbidden path: ${file.path}` }, 403);
6939
7132
  if (seen.has(absPath)) return c.json({ error: `duplicate path: ${file.path}` }, 400);
6940
7133
  seen.add(absPath);
@@ -7338,14 +7531,14 @@ function registerFileRoutes(api, adapter) {
7338
7531
  return c.json({ exists: probeElementsInSource(content, body.targets) });
7339
7532
  });
7340
7533
  api.patch("/projects/:id/files/*", async (c) => {
7341
- const res = await resolveProjectFile(c, adapter, { mustExist: true });
7534
+ const res = await resolveProjectFile(c, adapter, { mustExist: true, write: true });
7342
7535
  if ("error" in res) return res.error;
7343
7536
  const body = await c.req.json();
7344
7537
  const newPath = body !== null && typeof body === "object" && "newPath" in body ? body.newPath : void 0;
7345
7538
  if (typeof newPath !== "string" || !newPath || newPath.includes("\0") || /[\uD800-\uDFFF]/u.test(newPath)) {
7346
7539
  return c.json({ error: "newPath required" }, 400);
7347
7540
  }
7348
- const newAbs = resolveWithinProject2(res.project.dir, newPath);
7541
+ const newAbs = resolveWritableWithinProject(res.project.dir, newPath);
7349
7542
  if (!newAbs) {
7350
7543
  return c.json({ error: "forbidden" }, 403);
7351
7544
  }
@@ -7370,7 +7563,7 @@ function registerFileRoutes(api, adapter) {
7370
7563
  return c.json({ error: "not found" }, 404);
7371
7564
  }
7372
7565
  const copyPath = generateCopyPath(project.dir, body.path);
7373
- const destAbs = resolveWithinProject2(project.dir, copyPath);
7566
+ const destAbs = resolveWritableWithinProject(project.dir, copyPath);
7374
7567
  if (!destAbs) {
7375
7568
  return c.json({ error: "forbidden" }, 403);
7376
7569
  }
@@ -7396,7 +7589,7 @@ function registerFileRoutes(api, adapter) {
7396
7589
  if (!project) return c.json({ error: "not found" }, 404);
7397
7590
  if (folderGone(project.dir)) return projectDirMissing(c);
7398
7591
  const subDir = c.req.query("dir") ?? "";
7399
- const targetDir = subDir ? resolveWithinProject2(project.dir, subDir) : project.dir;
7592
+ const targetDir = subDir ? resolveWritableWithinProject(project.dir, subDir) : project.dir;
7400
7593
  if (!targetDir) return c.json({ error: "forbidden" }, 403);
7401
7594
  const formData = await c.req.formData();
7402
7595
  mkdirWithinProject(project.dir, targetDir);
@@ -7441,7 +7634,8 @@ function registerFileRoutes(api, adapter) {
7441
7634
  api.post("/projects/:id/gsap-mutations/*", async (c) => {
7442
7635
  const res = await resolveProjectPath(c, adapter, "gsap-mutations", {
7443
7636
  mustExist: true,
7444
- pin: true
7637
+ pin: true,
7638
+ write: true
7445
7639
  });
7446
7640
  if ("error" in res) return res.error;
7447
7641
  const body = await c.req.json().catch(() => null);
@@ -7453,7 +7647,8 @@ function registerFileRoutes(api, adapter) {
7453
7647
  api.post("/projects/:id/gsap-mutations-batch/*", async (c) => {
7454
7648
  const res = await resolveProjectPath(c, adapter, "gsap-mutations-batch", {
7455
7649
  mustExist: true,
7456
- pin: true
7650
+ pin: true,
7651
+ write: true
7457
7652
  });
7458
7653
  if ("error" in res) return res.error;
7459
7654
  const body = await c.req.json().catch(() => null);
@@ -7469,7 +7664,8 @@ function registerFileRoutes(api, adapter) {
7469
7664
  api.post("/projects/:id/gsap-mutation-rollback/*", async (c) => {
7470
7665
  const res = await resolveProjectPath(c, adapter, "gsap-mutation-rollback", {
7471
7666
  mustExist: true,
7472
- pin: true
7667
+ pin: true,
7668
+ write: true
7473
7669
  });
7474
7670
  if ("error" in res) return res.error;
7475
7671
  const body = await c.req.json().catch(() => null);
@@ -7666,6 +7862,25 @@ function lazyPreviewImages(html) {
7666
7862
  parts.push(html.slice(from));
7667
7863
  return parts.join("");
7668
7864
  }
7865
+ var OTHER_HOST = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
7866
+ var isOtherHost = (el) => OTHER_HOST.test(el.getAttribute("src")?.trim() ?? "");
7867
+ var isProjectVideo = (video) => !video.hasAttribute("crossorigin") && !isOtherHost(video) && ![...video.querySelectorAll("source")].some(isOtherHost);
7868
+ function corsProjectVideos(html) {
7869
+ const tags = findStartTags(html, "video");
7870
+ if (tags.length === 0) return html;
7871
+ const videos = [...parseHTML(html).document.querySelectorAll("video")];
7872
+ if (tags.length !== videos.length) return html;
7873
+ const parts = [];
7874
+ let from = 0;
7875
+ videos.forEach((video, i) => {
7876
+ if (!isProjectVideo(video)) return;
7877
+ const at = (tags[i] ?? 0) + "<video".length;
7878
+ parts.push(html.slice(from, at), ' crossorigin="anonymous"');
7879
+ from = at;
7880
+ });
7881
+ parts.push(html.slice(from));
7882
+ return parts.join("");
7883
+ }
7669
7884
  var PROJECT_SIGNATURE_META = "hyperframes-project-signature";
7670
7885
  function escapeGsapUrl(url) {
7671
7886
  return url.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
@@ -7850,7 +8065,7 @@ try{var url=e.filename&&new URL(e.filename,window.location.href);if(url&&url.ori
7850
8065
  kinds.push({name:known[name]===1?name:"other",origin:!path?"unknown":path===runtime?"runtime":path.indexOf("/api/projects/")===0?"project":"studio"})});})();</script>`;
7851
8066
  function injectStudioPreviewAugmentations(html, adapter, signature, projectDir, activeCompositionPath, options) {
7852
8067
  const marked = options.capture ? injectTagsAtHeadStart(
7853
- html,
8068
+ options.sandboxedCapture ? corsProjectVideos(html) : html,
7854
8069
  `<meta name="${STUDIO_PREVIEW_MARK_META}" content="${STUDIO_PREVIEW_CAPTURE_MODE}">`
7855
8070
  ) : injectTagsAtHeadStart(
7856
8071
  lazyPreviewImages(html),
@@ -7893,13 +8108,14 @@ function resolveProjectMainHtml(projectDir, projectId) {
7893
8108
  const blockHtmlPath = join8(projectDir, `${projectId}.html`);
7894
8109
  recordPreviewRead(projectDir, indexPath);
7895
8110
  recordPreviewRead(projectDir, blockHtmlPath);
7896
- if (existsSync5(indexPath)) {
8111
+ const existsAndNotPrivate = (file) => existsSync5(file) && !isPrivateProjectFile(projectDir, file);
8112
+ if (existsAndNotPrivate(indexPath)) {
7897
8113
  return {
7898
8114
  html: readFileSync6(indexPath, "utf-8"),
7899
8115
  compositionPath: "index.html"
7900
8116
  };
7901
8117
  }
7902
- if (existsSync5(blockHtmlPath)) {
8118
+ if (existsAndNotPrivate(blockHtmlPath)) {
7903
8119
  return {
7904
8120
  html: readFileSync6(blockHtmlPath, "utf-8"),
7905
8121
  compositionPath: `${projectId}.html`
@@ -7933,7 +8149,7 @@ function resolvePreviewGsapBaseUrl(adapter) {
7933
8149
  }
7934
8150
  return normalizeGsapLocalRoot(adapter.gsapLocalRoot);
7935
8151
  }
7936
- function registerPreviewRoutes(api, adapter) {
8152
+ function registerPreviewRoutes(api, adapter, { sandboxThumbnailCaptures = false } = {}) {
7937
8153
  const gsapBaseUrl = resolvePreviewGsapBaseUrl(adapter);
7938
8154
  const gsapEtagSalt = `:gsap:${createHash3("sha1").update(gsapBaseUrl).digest("hex").slice(0, 12)}`;
7939
8155
  const previewCacheHeaders = (etag) => ({
@@ -7953,7 +8169,8 @@ function registerPreviewRoutes(api, adapter) {
7953
8169
  try {
7954
8170
  let bundled = await adapter.bundle(project.dir, {
7955
8171
  stampHfIds: true,
7956
- onRead: (filePath) => recordPreviewRead(project.dir, filePath)
8172
+ onRead: (filePath) => recordPreviewRead(project.dir, filePath),
8173
+ privateFiles: "studio"
7957
8174
  });
7958
8175
  let mainCompositionPath = "index.html";
7959
8176
  if (!bundled) {
@@ -7970,7 +8187,7 @@ function registerPreviewRoutes(api, adapter) {
7970
8187
  signature,
7971
8188
  project.dir,
7972
8189
  mainCompositionPath,
7973
- { capture, gsapBaseUrl }
8190
+ { capture, gsapBaseUrl, sandboxedCapture: sandboxThumbnailCaptures }
7974
8191
  );
7975
8192
  if (previewVariables) bundled = injectPreviewVariables(bundled, previewVariables);
7976
8193
  bundled = await injectMediaCodecMap(
@@ -7999,7 +8216,7 @@ function registerPreviewRoutes(api, adapter) {
7999
8216
  signature,
8000
8217
  project.dir,
8001
8218
  fallback.compositionPath,
8002
- { capture, gsapBaseUrl }
8219
+ { capture, gsapBaseUrl, sandboxedCapture: sandboxThumbnailCaptures }
8003
8220
  );
8004
8221
  if (previewVariables) {
8005
8222
  fallbackAugmented = injectPreviewVariables(fallbackAugmented, previewVariables);
@@ -8102,7 +8319,8 @@ ${etag}`;
8102
8319
  html = ensureHfIds(await transformPreviewHtml(html, adapter, project, compPath));
8103
8320
  html = injectStudioPreviewAugmentations(html, adapter, signature, project.dir, compPath, {
8104
8321
  capture,
8105
- gsapBaseUrl
8322
+ gsapBaseUrl,
8323
+ sandboxedCapture: sandboxThumbnailCaptures
8106
8324
  });
8107
8325
  if (previewVariables) html = injectPreviewVariables(html, previewVariables);
8108
8326
  html = await injectMediaCodecMap(html, adapter, project.dir, compPath, mediaCodecProbeCache);
@@ -9313,7 +9531,7 @@ function registerFreezeFrameRoutes(api, adapter, extract = ffmpegExtractor, stil
9313
9531
  }
9314
9532
  const project = await adapter.resolveProject(c.req.param("id"));
9315
9533
  if (!project) return c.json({ error: "not found" }, 404);
9316
- const absPath = pinWithinProject(project.dir, body.path);
9534
+ const absPath = pinWritableWithinProject(project.dir, body.path);
9317
9535
  if (!absPath) return c.json({ error: `forbidden path: ${body.path}` }, 403);
9318
9536
  const read = readExpected(absPath, body.expectedVersion);
9319
9537
  if ("error" in read) return c.json({ error: `${read.error}: ${body.path}` }, read.status);
@@ -9457,9 +9675,10 @@ async function decodePeakMap(mediaPath) {
9457
9675
  const track = await probeAudioTrack(mediaPath);
9458
9676
  if (!track || track.channels < 1) throw new Error("no audio stream");
9459
9677
  const { stream, channels } = track;
9678
+ const ffmpeg = requireFfBinary("ffmpeg");
9460
9679
  return new Promise((resolvePromise, reject) => {
9461
9680
  const proc = spawn2(
9462
- findFfBinary("ffmpeg") ?? "ffmpeg",
9681
+ ffmpeg,
9463
9682
  [
9464
9683
  "-v",
9465
9684
  "error",
@@ -9911,12 +10130,12 @@ function registerMediaRoutes(api, adapter, options = {}) {
9911
10130
  if (requestedOutput && containsNullByte(requestedOutput)) {
9912
10131
  return c.json({ error: "forbidden" }, 403);
9913
10132
  }
9914
- if (requestedOutput && !resolveWithinProject2(project.dir, requestedOutput)) {
10133
+ if (requestedOutput && !resolveWritableWithinProject(project.dir, requestedOutput)) {
9915
10134
  return c.json({ error: "forbidden" }, 403);
9916
10135
  }
9917
10136
  const taken = outputsInFlight(mediaJobs);
9918
10137
  const outputAssetPath = requestedOutput ? uniqueAssetPath(project.dir, requestedOutput, taken) : defaultOutputPath(project.dir, inputAssetPath, taken);
9919
- const outputPath = pinWithinProject(project.dir, outputAssetPath);
10138
+ const outputPath = pinWritableWithinProject(project.dir, outputAssetPath);
9920
10139
  if (!outputPath) return c.json({ error: "forbidden" }, 403);
9921
10140
  if (inputIsVideo && !VIDEO_OUTPUT_EXTENSIONS.has(extname(outputAssetPath).toLowerCase())) {
9922
10141
  return c.json({ error: "video background removal output must be .webm or .mov" }, 400);
@@ -9932,7 +10151,7 @@ function registerMediaRoutes(api, adapter, options = {}) {
9932
10151
  }
9933
10152
  taken.add(outputAssetPath);
9934
10153
  backgroundOutputAssetPath = defaultPlatePath(project.dir, inputAssetPath, taken);
9935
- backgroundOutputPath = pinWithinProject(project.dir, backgroundOutputAssetPath) ?? void 0;
10154
+ backgroundOutputPath = pinWritableWithinProject(project.dir, backgroundOutputAssetPath) ?? void 0;
9936
10155
  if (!backgroundOutputPath) {
9937
10156
  return c.json({ error: "forbidden" }, 403);
9938
10157
  }
@@ -10215,6 +10434,64 @@ function previewErrorPage(status) {
10215
10434
  const message = refusedPreviewMessage(status);
10216
10435
  return `<!doctype html><meta charset="utf-8"><script>window.${STUDIO_PREVIEW_ERRORS}=[${JSON.stringify(message)}]</script><p>${message}</p>`;
10217
10436
  }
10437
+ var GRANTED_LOADS = /* @__PURE__ */ new Map([
10438
+ ["font", { path: /\.(woff2?|ttf|otf)$/i, type: /^font\// }],
10439
+ ["script", { path: /\.m?js$/i, type: /^text\/javascript\b/ }]
10440
+ ]);
10441
+ var TOKEN_SEGMENT = /^~([\w-]{43})$/;
10442
+ function opaqueFrameLoadGranted(load) {
10443
+ const grant = load.origin === "null" ? GRANTED_LOADS.get(load.dest ?? "") : void 0;
10444
+ if (!grant?.path.test(load.pathname)) return false;
10445
+ const keepsStoredContentType = load.status === 304;
10446
+ return keepsStoredContentType || grant.type.test(load.contentType ?? "");
10447
+ }
10448
+ function createFrameTokens() {
10449
+ const secret = randomBytes2(32);
10450
+ const tokenFor = (projectId) => createHmac("sha256", secret).update(projectId).digest("base64url");
10451
+ const matches = (projectId, token) => timingSafeEqual(Buffer.from(token), Buffer.from(tokenFor(projectId)));
10452
+ return { tokenFor, matches };
10453
+ }
10454
+ var previewBase = (projectId) => `/api/projects/${encodeURIComponent(projectId)}/preview/`;
10455
+ function tokenPathHeaders(c, res, pathname) {
10456
+ const headers = new Headers(res.headers);
10457
+ headers.set("Referrer-Policy", "no-referrer");
10458
+ const granted = opaqueFrameLoadGranted({
10459
+ origin: c.req.header("origin"),
10460
+ dest: c.req.header("sec-fetch-dest"),
10461
+ pathname,
10462
+ status: res.status,
10463
+ contentType: headers.get("content-type")
10464
+ });
10465
+ if (granted) {
10466
+ headers.set("Access-Control-Allow-Origin", "null");
10467
+ headers.set("X-Content-Type-Options", "nosniff");
10468
+ headers.append("Vary", "Origin");
10469
+ }
10470
+ return headers;
10471
+ }
10472
+ async function underToken(res, headers, projectId, token) {
10473
+ if (res.status !== 200 || !headers.get("content-type")?.startsWith("text/html"))
10474
+ return new Response(res.body, { status: res.status, headers });
10475
+ const base = previewBase(projectId);
10476
+ headers.delete("content-length");
10477
+ const html = (await res.text()).replaceAll(base, `${base}~${token}/`);
10478
+ return new Response(html, { status: res.status, headers });
10479
+ }
10480
+ function serveTokenPreviewPaths(api, tokens, resolveProjectId) {
10481
+ return async (c, next) => {
10482
+ const url = new URL(c.req.url);
10483
+ const segments = url.pathname.split("/");
10484
+ const token = TOKEN_SEGMENT.exec(segments[4] ?? "")?.[1];
10485
+ if (!token) return next();
10486
+ const projectId = await resolveProjectId(c.req.param("id") ?? "");
10487
+ if (!projectId || !tokens.matches(projectId, token)) return c.text("not found", 404);
10488
+ segments.splice(4, 1);
10489
+ url.pathname = segments.join("/");
10490
+ const req = new Request(url, { method: c.req.method, headers: c.req.raw.headers });
10491
+ const res = await api.fetch(req);
10492
+ return underToken(res, tokenPathHeaders(c, res, url.pathname), projectId, token);
10493
+ };
10494
+ }
10218
10495
  async function answerRefusedFrameWithPage(c, next) {
10219
10496
  await next();
10220
10497
  if (c.req.header("sec-fetch-dest") !== "iframe" || c.res.status < 400) return;
@@ -10230,11 +10507,13 @@ var fromAnotherSite = (c) => {
10230
10507
  const site = c.req.header("sec-fetch-site");
10231
10508
  return site === "cross-site" || site === "same-site";
10232
10509
  };
10233
- async function sandboxPreviewOpenedFromAnotherSite(c, next) {
10510
+ var isThumbnailCapture = (c) => c.req.query(PREVIEW_CAPTURE_PARAM) !== void 0;
10511
+ var sandboxPreviewForAnotherSiteOrCapture = (sandboxCaptures) => async (c, next) => {
10234
10512
  await next();
10235
10513
  c.header("Vary", "Sec-Fetch-Site", { append: true });
10236
- if (fromAnotherSite(c)) c.header("Content-Security-Policy", "sandbox allow-scripts");
10237
- }
10514
+ if (fromAnotherSite(c) || sandboxCaptures && isThumbnailCapture(c))
10515
+ c.header("Content-Security-Policy", "sandbox allow-scripts");
10516
+ };
10238
10517
  async function refuseThumbnailForAnotherSite(c, next) {
10239
10518
  if (fromAnotherSite(c))
10240
10519
  return c.json({ error: "forbidden: thumbnail requested by another site" }, 403);
@@ -10256,7 +10535,23 @@ function urlScheme(url) {
10256
10535
  }
10257
10536
  function createStudioApi(adapter, options = {}) {
10258
10537
  const api = new Hono();
10259
- api.use("/projects/:id/preview/*", sandboxPreviewOpenedFromAnotherSite);
10538
+ const sandboxThumbnailCaptures = options.sandboxThumbnailCaptures ?? false;
10539
+ const frameTokens = createFrameTokens();
10540
+ const resolveProjectId = (id) => Promise.resolve().then(() => adapter.resolveProject(id)).then(
10541
+ (project) => project?.id,
10542
+ () => void 0
10543
+ );
10544
+ api.use("/projects/:id/preview/*", serveTokenPreviewPaths(api, frameTokens, resolveProjectId));
10545
+ api.use(
10546
+ "/projects/:id/preview/*",
10547
+ sandboxPreviewForAnotherSiteOrCapture(sandboxThumbnailCaptures)
10548
+ );
10549
+ api.get("/projects/:id/frame-token", async (c) => {
10550
+ if (fromAnotherSite(c)) return c.json({ error: "forbidden: requested by another site" }, 403);
10551
+ const projectId = await resolveProjectId(c.req.param("id"));
10552
+ if (!projectId) return c.json({ error: "not found" }, 404);
10553
+ return c.json({ token: frameTokens.tokenFor(projectId) }, 200, { "Cache-Control": "no-store" });
10554
+ });
10260
10555
  api.use("/projects/:id/thumbnail/*", refuseThumbnailForAnotherSite);
10261
10556
  api.use(async function rejectCrossOriginWrites(c, next) {
10262
10557
  if (c.req.method === "GET" || c.req.method === "HEAD" || c.req.method === "OPTIONS") {
@@ -10316,7 +10611,7 @@ function createStudioApi(adapter, options = {}) {
10316
10611
  });
10317
10612
  registerProjectRoutes(api, adapter);
10318
10613
  registerFileRoutes(api, adapter);
10319
- registerPreviewRoutes(api, adapter);
10614
+ registerPreviewRoutes(api, adapter, { sandboxThumbnailCaptures });
10320
10615
  registerLintRoutes(api, adapter);
10321
10616
  registerRenderRoutes(api, adapter);
10322
10617
  registerThumbnailRoutes(api, adapter);
@@ -10408,6 +10703,86 @@ ${key}`).digest("hex").slice(0, 32)}.html`);
10408
10703
  }
10409
10704
  };
10410
10705
  }
10706
+ var GRANTED_TYPES = /* @__PURE__ */ new Set(["Font", "Script", "Stylesheet", "Image", "Media", "Fetch", "XHR"]);
10707
+ var PROXY_PARAM = "hf-proxy";
10708
+ var VIDEO_FILE = /\.(mp4|webm|mov|mkv|avi|m4v|mxf|mts|m2ts)$/i;
10709
+ function capturePreviewPrefix(captureUrl) {
10710
+ let url;
10711
+ try {
10712
+ url = new URL(captureUrl);
10713
+ } catch {
10714
+ return null;
10715
+ }
10716
+ const path = /^\/api\/projects\/[^/]+\/preview(?=\/|$)/.exec(url.pathname)?.[0];
10717
+ return path ? `${url.origin}${path}/` : null;
10718
+ }
10719
+ var decodedSegment = (segment) => {
10720
+ try {
10721
+ return decodeURIComponent(segment);
10722
+ } catch {
10723
+ return ".";
10724
+ }
10725
+ };
10726
+ var isDotPath = (url, prefix) => {
10727
+ const rest = url.pathname.slice(new URL(prefix).pathname.length);
10728
+ return [
10729
+ ...rest.split("/").map(decodedSegment),
10730
+ ...decodeWellFormedEscapes(rest).split(/[\\/]/)
10731
+ ].some((segment) => segment.startsWith("."));
10732
+ };
10733
+ function captureLoadGrant(load, captureUrl) {
10734
+ const prefix = capturePreviewPrefix(captureUrl);
10735
+ if (!prefix || !load.url.startsWith(prefix)) return null;
10736
+ const url = new URL(load.url);
10737
+ if (isDotPath(url, prefix) || !GRANTED_TYPES.has(load.resourceType)) return null;
10738
+ const proxyWait = (load.resourceType === "XHR" || load.resourceType === "Fetch") && url.searchParams.has(PROXY_PARAM) && VIDEO_FILE.test(url.pathname);
10739
+ if (load.method === "OPTIONS") return proxyWait ? "preflight" : null;
10740
+ return load.method === "GET" ? "read" : null;
10741
+ }
10742
+ var OPAQUE_CALLER = [
10743
+ { name: "Access-Control-Allow-Origin", value: "null" },
10744
+ { name: "X-Content-Type-Options", value: "nosniff" },
10745
+ {
10746
+ name: "Access-Control-Expose-Headers",
10747
+ value: `Retry-After, ${PREVIEW_PROXY_PROGRESS_HEADER}, Content-Range`
10748
+ }
10749
+ ];
10750
+ var PREFLIGHT_ANSWER = [
10751
+ { name: "Access-Control-Allow-Origin", value: "null" },
10752
+ { name: "Access-Control-Allow-Methods", value: "GET" },
10753
+ { name: "Access-Control-Allow-Headers", value: `Range, ${PREVIEW_PROXY_PRIORITY_HEADER}` }
10754
+ ];
10755
+ async function grantCaptureLoads(cdp, captureUrl) {
10756
+ const prefix = capturePreviewPrefix(captureUrl);
10757
+ if (!prefix) return;
10758
+ cdp.on("Fetch.requestPaused", (event) => {
10759
+ const { requestId } = event;
10760
+ const headers = event.responseHeaders ?? [];
10761
+ const status = event.responseStatusCode;
10762
+ const grant = captureLoadGrant(
10763
+ { url: event.request.url, method: event.request.method, resourceType: event.resourceType },
10764
+ captureUrl
10765
+ );
10766
+ const answered = status !== void 0 && !headers.some((header) => header.name.toLowerCase() === "access-control-allow-origin");
10767
+ const sent = grant === "preflight" ? cdp.send("Fetch.fulfillRequest", {
10768
+ requestId,
10769
+ responseCode: 204,
10770
+ responseHeaders: PREFLIGHT_ANSWER
10771
+ }) : grant && answered ? cdp.send("Fetch.continueResponse", {
10772
+ requestId,
10773
+ responseCode: status,
10774
+ responseHeaders: [...headers, ...OPAQUE_CALLER]
10775
+ }) : cdp.send("Fetch.continueRequest", { requestId });
10776
+ void sent.catch(() => void 0);
10777
+ });
10778
+ await cdp.send("Fetch.enable", {
10779
+ patterns: [...GRANTED_TYPES].map((resourceType) => ({
10780
+ urlPattern: `${prefix}*`,
10781
+ resourceType,
10782
+ requestStage: "Response"
10783
+ }))
10784
+ });
10785
+ }
10411
10786
  function thumbnailDeviceScaleFactor({
10412
10787
  width,
10413
10788
  height,
@@ -10484,6 +10859,8 @@ export {
10484
10859
  getElementScreenshotClip,
10485
10860
  clearElementScreenshotIsolation,
10486
10861
  injectMediaCodecMapIntoHtml,
10862
+ STUDIO_MOTION_PATH,
10863
+ createStudioMotionRenderBodyScript,
10487
10864
  STUDIO_PREVIEW_MARK_META,
10488
10865
  STUDIO_PREVIEW_CAPTURE_MODE,
10489
10866
  MIME_TYPES,
@@ -10498,6 +10875,8 @@ export {
10498
10875
  createStudioApi,
10499
10876
  duplicateElementInHtml,
10500
10877
  createPreviewDocumentStore,
10878
+ captureLoadGrant,
10879
+ grantCaptureLoads,
10501
10880
  thumbnailDeviceScaleFactor,
10502
10881
  createBackgroundRemovalJob
10503
10882
  };