@cimplify/sdk 0.108.0 → 0.110.2

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 (608) hide show
  1. package/LICENSE +21 -0
  2. package/dist/advanced.d.mts +4 -3
  3. package/dist/advanced.d.ts +4 -3
  4. package/dist/advanced.js +24 -24
  5. package/dist/advanced.mjs +5 -5
  6. package/dist/animation-4EXBXRVX.js +27 -0
  7. package/dist/animation-6DICNWUP.mjs +6 -0
  8. package/dist/audio-DhvyjqdA.d.mts +249 -0
  9. package/dist/audio-m0w8cnxq.d.ts +249 -0
  10. package/dist/avatars.d.mts +110 -0
  11. package/dist/avatars.d.ts +110 -0
  12. package/dist/avatars.js +82 -0
  13. package/dist/avatars.mjs +5 -0
  14. package/dist/backend-gUCzs5Kg.d.mts +3866 -0
  15. package/dist/backend-gUCzs5Kg.d.ts +3866 -0
  16. package/dist/{catalogue-B4eLL8Mi.d.ts → catalogue-CPTMyBUz.d.mts} +109 -221
  17. package/dist/catalogue-DzrTXP3v.d.mts +541 -0
  18. package/dist/catalogue-DzrTXP3v.d.ts +541 -0
  19. package/dist/{catalogue-OT89_Ifs.d.mts → catalogue-OTuS5zp-.d.ts} +109 -221
  20. package/dist/chunk-22BD3RHN.mjs +1809 -0
  21. package/dist/chunk-25T4JHEA.mjs +21 -0
  22. package/dist/chunk-2AQ237Y4.js +508 -0
  23. package/dist/chunk-2IC4H6OV.mjs +48 -0
  24. package/dist/chunk-2LHLG4OB.mjs +71 -0
  25. package/dist/chunk-2O2CG465.js +1709 -0
  26. package/dist/chunk-2Q4DTHXK.js +316 -0
  27. package/dist/chunk-2QTQ6BUH.mjs +46 -0
  28. package/dist/chunk-2UN4SFLR.mjs +100 -0
  29. package/dist/chunk-2V75I7K3.js +454 -0
  30. package/dist/chunk-2V7IL4HC.js +10 -0
  31. package/dist/chunk-34XBXUMW.js +296 -0
  32. package/dist/chunk-3C4C654I.js +71 -0
  33. package/dist/chunk-3DAD2LDF.mjs +72 -0
  34. package/dist/chunk-3GXH2NFD.mjs +4 -0
  35. package/dist/chunk-3O47ZFW3.js +961 -0
  36. package/dist/chunk-3OY3VYNF.mjs +11 -0
  37. package/dist/chunk-3S6WPBZL.js +2936 -0
  38. package/dist/chunk-3TUOUP5T.js +399 -0
  39. package/dist/chunk-3VEH23I5.mjs +1380 -0
  40. package/dist/chunk-3ZYSAW2T.mjs +263 -0
  41. package/dist/chunk-4ANVF274.js +103 -0
  42. package/dist/chunk-4C7I3ELN.js +388 -0
  43. package/dist/chunk-4DYKAYFO.mjs +8 -0
  44. package/dist/chunk-4ZDR72SG.js +329 -0
  45. package/dist/chunk-52YS45RR.js +1066 -0
  46. package/dist/chunk-5325XSCH.js +107 -0
  47. package/dist/chunk-5AD5X6AV.js +13 -0
  48. package/dist/chunk-5BYDGGWO.mjs +197 -0
  49. package/dist/chunk-5C3C7VDM.mjs +55 -0
  50. package/dist/chunk-5HFMY3D7.js +660 -0
  51. package/dist/chunk-5LH2QN3T.js +1862 -0
  52. package/dist/chunk-5PJEXSOW.js +44 -0
  53. package/dist/chunk-5SXDH3Y7.js +90 -0
  54. package/dist/chunk-5YFBGGCK.mjs +502 -0
  55. package/dist/chunk-5YWN6H5Q.mjs +133 -0
  56. package/dist/chunk-66QP3SMN.js +402 -0
  57. package/dist/chunk-6DAEZKIG.mjs +385 -0
  58. package/dist/chunk-6DATW7TB.mjs +420 -0
  59. package/dist/{chunk-JRGK3NXR.mjs → chunk-6ETDAU62.mjs} +72 -212
  60. package/dist/chunk-6H254EVP.mjs +178 -0
  61. package/dist/chunk-6PFNJPBJ.mjs +820 -0
  62. package/dist/chunk-6PJWXIFX.mjs +357 -0
  63. package/dist/chunk-6SWKWCMS.js +80 -0
  64. package/dist/chunk-6VVXXX7S.js +808 -0
  65. package/dist/chunk-6WUBSMTX.js +1403 -0
  66. package/dist/chunk-73SGZLAQ.mjs +35 -0
  67. package/dist/chunk-76L2V6KD.mjs +4 -0
  68. package/dist/chunk-7AAIAVAA.js +1531 -0
  69. package/dist/chunk-7ARSJPV3.mjs +93 -0
  70. package/dist/chunk-7BHW5GTC.mjs +1234 -0
  71. package/dist/chunk-7DQSDKDU.js +6 -0
  72. package/dist/chunk-7IQQQENP.mjs +401 -0
  73. package/dist/chunk-7KFTYENS.js +11357 -0
  74. package/dist/chunk-7SM6XSPZ.js +3171 -0
  75. package/dist/chunk-7SXOHAIR.mjs +28 -0
  76. package/dist/chunk-A2MAX6S4.js +90 -0
  77. package/dist/chunk-A33OORT7.mjs +1530 -0
  78. package/dist/{chunk-U6ACF76H.mjs → chunk-A36JRXXH.mjs} +1075 -1845
  79. package/dist/chunk-A7BU3BK4.js +52 -0
  80. package/dist/chunk-A7MQSN2V.mjs +77 -0
  81. package/dist/chunk-A7V4L2IT.mjs +416 -0
  82. package/dist/chunk-AABEK6XU.js +226 -0
  83. package/dist/chunk-AGV33FWC.mjs +5005 -0
  84. package/dist/chunk-AHNR3BXI.js +108 -0
  85. package/dist/chunk-AQ5RLBU2.mjs +286 -0
  86. package/dist/chunk-AQOE6WCG.js +1270 -0
  87. package/dist/chunk-ATAWRACV.mjs +62 -0
  88. package/dist/chunk-ATCURNUV.js +14 -0
  89. package/dist/chunk-AWPV33OO.js +6 -0
  90. package/dist/chunk-AYJPHKYV.js +337 -0
  91. package/dist/chunk-AZ5BGWHB.js +162 -0
  92. package/dist/chunk-AZAXD44P.js +1373 -0
  93. package/dist/chunk-BBGKQIJJ.mjs +406 -0
  94. package/dist/chunk-BP4JLSUA.js +1453 -0
  95. package/dist/{chunk-SUCE7FWA.mjs → chunk-BTUSVHIE.mjs} +539 -978
  96. package/dist/chunk-BU6OK542.mjs +818 -0
  97. package/dist/chunk-CVSRWM6W.js +418 -0
  98. package/dist/chunk-CYBMFMJD.mjs +247 -0
  99. package/dist/chunk-DDJLDOUX.mjs +217 -0
  100. package/dist/{chunk-V32BCG7M.js → chunk-DFZWHNRG.js} +75 -215
  101. package/dist/chunk-DJ2C7AVG.js +644 -0
  102. package/dist/chunk-DS2VU4WW.mjs +102 -0
  103. package/dist/chunk-DSAG7T5P.js +7290 -0
  104. package/dist/chunk-E2QPPH7I.js +327 -0
  105. package/dist/chunk-E65WCTIG.mjs +1187 -0
  106. package/dist/{chunk-33VCYWVL.mjs → chunk-E6QQKDNE.mjs} +30 -42
  107. package/dist/chunk-ECDK6QBF.mjs +981 -0
  108. package/dist/chunk-EIB4OWVQ.mjs +620 -0
  109. package/dist/chunk-EQUZYCGO.js +250 -0
  110. package/dist/chunk-F3UJ6ZRM.mjs +313 -0
  111. package/dist/chunk-F63N2ZTQ.js +7023 -0
  112. package/dist/chunk-F6XRYEM3.mjs +26 -0
  113. package/dist/chunk-FE6VCE4K.js +5030 -0
  114. package/dist/chunk-FLWD6GRR.js +1372 -0
  115. package/dist/chunk-FQBFWJBS.mjs +110 -0
  116. package/dist/chunk-FXVJ2HFU.js +26 -0
  117. package/dist/chunk-FZMQMQBW.js +312 -0
  118. package/dist/chunk-G3EEC44R.js +53 -0
  119. package/dist/{chunk-KG3WT4PR.mjs → chunk-GCKWKLZF.mjs} +73 -104
  120. package/dist/chunk-GCX7TY4D.mjs +6826 -0
  121. package/dist/chunk-GDB6TCSD.js +450 -0
  122. package/dist/chunk-GDCV4IWO.mjs +21 -0
  123. package/dist/chunk-GDZT5LZ5.js +170 -0
  124. package/dist/chunk-GHPUYD4I.mjs +213 -0
  125. package/dist/chunk-GHS6MIL6.mjs +1432 -0
  126. package/dist/chunk-GPS2THCL.mjs +11 -0
  127. package/dist/{chunk-EV2EVOYS.js → chunk-GTJWQAGU.js} +31 -42
  128. package/dist/chunk-GVTI6UJQ.mjs +130 -0
  129. package/dist/chunk-GXKI64OT.mjs +1138 -0
  130. package/dist/chunk-GYDYF2WX.js +275 -0
  131. package/dist/chunk-GYLP6UG4.mjs +705 -0
  132. package/dist/chunk-H3OQKK6X.js +1158 -0
  133. package/dist/chunk-H5DFSCJ6.js +40 -0
  134. package/dist/chunk-HAGEIC2L.mjs +186 -0
  135. package/dist/chunk-HAJ4JRFO.js +293 -0
  136. package/dist/chunk-HDR72GB6.js +188 -0
  137. package/dist/chunk-HF5HPS4T.mjs +40 -0
  138. package/dist/chunk-HK6LOFDS.js +218 -0
  139. package/dist/chunk-HMWYTXCY.mjs +143 -0
  140. package/dist/chunk-HPCSRCMA.js +89 -0
  141. package/dist/chunk-HSEO6TPU.js +247 -0
  142. package/dist/chunk-I5FOHCLH.js +132 -0
  143. package/dist/chunk-IDLW4NWA.mjs +85 -0
  144. package/dist/chunk-IIDZ5WUX.js +61 -0
  145. package/dist/chunk-IR74FJHU.js +2332 -0
  146. package/dist/chunk-IRVFYAKP.mjs +100 -0
  147. package/dist/{chunk-XBL3TMPC.mjs → chunk-IZDWAL53.mjs} +1795 -3287
  148. package/dist/chunk-J2KZXIU3.js +51 -0
  149. package/dist/chunk-J2U6PJSO.js +91 -0
  150. package/dist/chunk-J5AJNY2N.js +283 -0
  151. package/dist/chunk-J6KQZ4FO.mjs +821 -0
  152. package/dist/{chunk-OWW5GUSB.js → chunk-JGBCIKJV.js} +7 -6
  153. package/dist/chunk-JKGTBMU7.mjs +25 -0
  154. package/dist/chunk-JR3TNEQC.js +422 -0
  155. package/dist/chunk-JURRXY2J.mjs +29 -0
  156. package/dist/chunk-K3HW5I2A.mjs +317 -0
  157. package/dist/chunk-K46SMZ66.mjs +103 -0
  158. package/dist/chunk-K4UDGE3Z.mjs +6 -0
  159. package/dist/chunk-KDQOR4QQ.mjs +350 -0
  160. package/dist/chunk-KDTVOLHI.mjs +288 -0
  161. package/dist/chunk-KGHJH5KJ.mjs +35 -0
  162. package/dist/chunk-KIZOA5LX.mjs +140 -0
  163. package/dist/chunk-KK6HYVBI.mjs +242 -0
  164. package/dist/chunk-KMKWGXMK.js +856 -0
  165. package/dist/chunk-KPA6K5IB.js +80 -0
  166. package/dist/chunk-KU7O4IXU.mjs +260 -0
  167. package/dist/chunk-KVFNRJOR.mjs +11142 -0
  168. package/dist/chunk-KZJRSXHK.js +2432 -0
  169. package/dist/chunk-LHWPRUJL.js +79 -0
  170. package/dist/chunk-LIV3KXJG.mjs +369 -0
  171. package/dist/chunk-LKV4LACG.js +21 -0
  172. package/dist/chunk-LUY45X3U.mjs +263 -0
  173. package/dist/chunk-LYEZZEEF.mjs +17 -0
  174. package/dist/chunk-M5EXQZYY.mjs +1519 -0
  175. package/dist/chunk-ME6HGG4I.mjs +1338 -0
  176. package/dist/chunk-MEXP6DA6.js +31 -0
  177. package/dist/chunk-MG52AW3H.js +902 -0
  178. package/dist/chunk-MIPO6F72.js +334 -0
  179. package/dist/{chunk-5QW7CQBA.js → chunk-MKIJQL5Q.js} +211 -321
  180. package/dist/chunk-MN3YETVN.mjs +17 -0
  181. package/dist/chunk-MOBSBXVE.mjs +2391 -0
  182. package/dist/chunk-MOMOZEUM.mjs +88 -0
  183. package/dist/chunk-MRFUNRAP.js +62 -0
  184. package/dist/chunk-MTIHEW2M.js +433 -0
  185. package/dist/chunk-N4RGGDEL.mjs +73 -0
  186. package/dist/chunk-NH654HAT.js +10 -0
  187. package/dist/chunk-NHJUGZUR.mjs +253 -0
  188. package/dist/chunk-NMQT4HG3.mjs +757 -0
  189. package/dist/chunk-NPSYB6DC.mjs +906 -0
  190. package/dist/chunk-NW2GPMSO.js +857 -0
  191. package/dist/chunk-NXKQOQ6L.js +76 -0
  192. package/dist/chunk-NXLAZIJZ.js +309 -0
  193. package/dist/chunk-NYWNA5CF.js +148 -0
  194. package/dist/chunk-NZTKLY2W.js +1442 -0
  195. package/dist/chunk-O2ICABUD.js +36 -0
  196. package/dist/chunk-OIVVQQ22.js +862 -0
  197. package/dist/chunk-OKC2B4O3.mjs +312 -0
  198. package/dist/chunk-OLWFPDBK.js +2220 -0
  199. package/dist/chunk-OMTVH334.js +3779 -0
  200. package/dist/chunk-OQRVEM56.mjs +362 -0
  201. package/dist/chunk-OXMIBOD4.js +337 -0
  202. package/dist/chunk-PBL6YL5L.mjs +288 -0
  203. package/dist/chunk-PDOELNNQ.js +97 -0
  204. package/dist/chunk-PDQJY2GZ.js +136 -0
  205. package/dist/chunk-PKOZXD2Q.js +1274 -0
  206. package/dist/chunk-PPF2BYFL.mjs +2191 -0
  207. package/dist/chunk-PQTQKNKD.js +539 -0
  208. package/dist/chunk-PRSR4FAV.mjs +81 -0
  209. package/dist/chunk-PTRNO5UD.js +95 -0
  210. package/dist/chunk-Q2Y3VMKH.js +2000 -0
  211. package/dist/chunk-QCZOE65N.js +96 -0
  212. package/dist/chunk-QDYFLATW.mjs +52 -0
  213. package/dist/chunk-QQABGCMM.js +22 -0
  214. package/dist/chunk-QS6TRHMR.js +345 -0
  215. package/dist/chunk-R56P64LB.mjs +208 -0
  216. package/dist/chunk-RCQ2MPBV.js +428 -0
  217. package/dist/chunk-RFVRPYR2.mjs +856 -0
  218. package/dist/chunk-RKBLPGPV.js +11521 -0
  219. package/dist/chunk-RM2V4IND.mjs +327 -0
  220. package/dist/chunk-RQXN5A34.mjs +613 -0
  221. package/dist/chunk-RUVGVNOF.mjs +2687 -0
  222. package/dist/chunk-SAFJIGYB.mjs +165 -0
  223. package/dist/chunk-SKQFLBDD.js +263 -0
  224. package/dist/chunk-SMK6JU2F.mjs +2092 -0
  225. package/dist/{chunk-UVRPC2P7.js → chunk-SNNEOS5Z.js} +1984 -3476
  226. package/dist/chunk-SPCRQ6NO.mjs +1246 -0
  227. package/dist/chunk-SWX4SALA.mjs +19 -0
  228. package/dist/{chunk-JVODCGFP.mjs → chunk-SYEO2WV4.mjs} +128 -238
  229. package/dist/chunk-T2QQMX2N.js +10 -0
  230. package/dist/chunk-T3AFF3L7.mjs +57 -0
  231. package/dist/chunk-T6Z2EXYL.js +712 -0
  232. package/dist/chunk-T7LOXGYX.js +118 -0
  233. package/dist/chunk-TJCAE7RC.mjs +1315 -0
  234. package/dist/chunk-TJI3K6RP.js +137 -0
  235. package/dist/chunk-TL2SVO4P.mjs +55 -0
  236. package/dist/chunk-TM63CYGN.mjs +399 -0
  237. package/dist/chunk-TU5RYTYU.mjs +13 -0
  238. package/dist/chunk-TVJZ4GPS.js +1553 -0
  239. package/dist/chunk-TWM6DLYF.js +371 -0
  240. package/dist/chunk-U63OC4TQ.js +30 -0
  241. package/dist/{chunk-L5GKVQVJ.js → chunk-U6BVSJZ6.js} +25 -57
  242. package/dist/chunk-U6UVWEAK.mjs +792 -0
  243. package/dist/chunk-UCEPNO6N.mjs +11048 -0
  244. package/dist/{chunk-ANT574FD.js → chunk-UCR5HRYM.js} +74 -105
  245. package/dist/chunk-UG5BTOTF.mjs +334 -0
  246. package/dist/chunk-UGH37BQW.mjs +157 -0
  247. package/dist/chunk-V7ZRH3PY.mjs +271 -0
  248. package/dist/chunk-VBGHBL3E.mjs +1394 -0
  249. package/dist/chunk-VRBDAS5I.js +920 -0
  250. package/dist/chunk-VVE3Y76O.js +230 -0
  251. package/dist/chunk-W65JIRI4.mjs +1182 -0
  252. package/dist/chunk-WHYKAT7G.js +62 -0
  253. package/dist/{chunk-YOIVZ6OA.mjs → chunk-WIZRUIZB.mjs} +25 -57
  254. package/dist/chunk-WKWTDZS7.js +385 -0
  255. package/dist/chunk-WLMINRC4.mjs +78 -0
  256. package/dist/chunk-WOF3AD3J.js +22 -0
  257. package/dist/chunk-WWKMOA76.js +1262 -0
  258. package/dist/chunk-X5A5FOWW.js +615 -0
  259. package/dist/chunk-X6CN6KQF.mjs +192 -0
  260. package/dist/chunk-XD2PMH46.mjs +517 -0
  261. package/dist/chunk-XJA2NGTI.mjs +88 -0
  262. package/dist/chunk-XJIHN3BY.mjs +8 -0
  263. package/dist/chunk-XK6UDWJS.js +203 -0
  264. package/dist/chunk-XPG3N5CF.mjs +415 -0
  265. package/dist/chunk-XVZ2NKSU.mjs +74 -0
  266. package/dist/chunk-XYP45OLE.js +117 -0
  267. package/dist/chunk-XZSDGZX6.mjs +301 -0
  268. package/dist/chunk-Y2EMGN4T.mjs +120 -0
  269. package/dist/chunk-Y3XWP5XW.mjs +298 -0
  270. package/dist/chunk-Y4K22JL6.js +228 -0
  271. package/dist/chunk-Y65LXQGA.mjs +3164 -0
  272. package/dist/chunk-Y66WVMO5.mjs +87 -0
  273. package/dist/chunk-Y7JWLB25.mjs +7280 -0
  274. package/dist/chunk-YCDXAJKU.js +175 -0
  275. package/dist/chunk-YRDQCCIS.js +152 -0
  276. package/dist/chunk-YV52DGSA.js +111 -0
  277. package/dist/chunk-YXGZQPUD.js +94 -0
  278. package/dist/chunk-Z3A3AFVU.mjs +102 -0
  279. package/dist/chunk-ZCY6YKKP.mjs +475 -0
  280. package/dist/chunk-ZEQHXVU5.js +215 -0
  281. package/dist/chunk-ZF7JCXCI.js +284 -0
  282. package/dist/chunk-ZJBRUH6V.js +29 -0
  283. package/dist/chunk-ZMIL4ZOA.js +365 -0
  284. package/dist/chunk-ZR5ULMN2.mjs +337 -0
  285. package/dist/chunk-ZXREOYOW.js +87 -0
  286. package/dist/{client-BSP9U1O1.d.mts → client-CX_WR0-J.d.mts} +2 -2
  287. package/dist/client-Dytx_ZTC.d.ts +230 -0
  288. package/dist/{client-B878xeAP.d.ts → client-dqOhP9Nc.d.ts} +2 -2
  289. package/dist/client-hTKbCuhG.d.mts +230 -0
  290. package/dist/clock-B-UAjkKa.d.mts +5 -0
  291. package/dist/clock-B-UAjkKa.d.ts +5 -0
  292. package/dist/config-BlXQluJR.d.mts +36 -0
  293. package/dist/config-BlXQluJR.d.ts +36 -0
  294. package/dist/courier-Cnn-edJ4.d.ts +95 -0
  295. package/dist/courier-FmGfkvIN.d.mts +95 -0
  296. package/dist/crowd-DdHFbqKK.d.ts +186 -0
  297. package/dist/crowd-hOVSAmA3.d.mts +186 -0
  298. package/dist/danfo-BEBapFlX.d.mts +146 -0
  299. package/dist/danfo-UQ_PTIIx.d.ts +146 -0
  300. package/dist/{elements-Bty6Qs_N.d.mts → elements-DdsRig-2.d.mts} +1548 -257
  301. package/dist/{elements-Bty6Qs_N.d.ts → elements-DdsRig-2.d.ts} +1548 -257
  302. package/dist/engines/godot.d.mts +56 -0
  303. package/dist/engines/godot.d.ts +56 -0
  304. package/dist/engines/godot.js +28 -0
  305. package/dist/engines/godot.mjs +3 -0
  306. package/dist/engines/wasm.d.mts +11 -0
  307. package/dist/engines/wasm.d.ts +11 -0
  308. package/dist/engines/wasm.js +178 -0
  309. package/dist/engines/wasm.mjs +176 -0
  310. package/dist/fallback-CrG_lTFk.d.mts +270 -0
  311. package/dist/fallback-CrG_lTFk.d.ts +270 -0
  312. package/dist/fallback-KDB4Y2CE.mjs +6 -0
  313. package/dist/fallback-Y26TQENE.js +19 -0
  314. package/dist/features-CZB4rmcD.d.mts +118 -0
  315. package/dist/features-CZB4rmcD.d.ts +118 -0
  316. package/dist/fit-BWiE7rgA.d.mts +44 -0
  317. package/dist/fit-DK0oT7zO.d.ts +44 -0
  318. package/dist/five-a-side-Bv1AOUy3.d.mts +115 -0
  319. package/dist/five-a-side-EC51SJY1.d.ts +115 -0
  320. package/dist/fluid-ARr0qUIL.d.ts +939 -0
  321. package/dist/fluid-DLlEj2cs.d.mts +939 -0
  322. package/dist/game/conformance.d.mts +84 -0
  323. package/dist/game/conformance.d.ts +84 -0
  324. package/dist/game/conformance.js +1025 -0
  325. package/dist/game/conformance.mjs +994 -0
  326. package/dist/game/heap.d.mts +40 -0
  327. package/dist/game/heap.d.ts +40 -0
  328. package/dist/game/heap.js +48 -0
  329. package/dist/game/heap.mjs +7 -0
  330. package/dist/game/kit/canvas.d.mts +240 -0
  331. package/dist/game/kit/canvas.d.ts +240 -0
  332. package/dist/game/kit/canvas.js +3566 -0
  333. package/dist/game/kit/canvas.mjs +1039 -0
  334. package/dist/game/kit/courier.d.mts +17 -0
  335. package/dist/game/kit/courier.d.ts +17 -0
  336. package/dist/game/kit/courier.js +66 -0
  337. package/dist/game/kit/courier.mjs +49 -0
  338. package/dist/game/kit/danfo.d.mts +11 -0
  339. package/dist/game/kit/danfo.d.ts +11 -0
  340. package/dist/game/kit/danfo.js +109 -0
  341. package/dist/game/kit/danfo.mjs +44 -0
  342. package/dist/game/kit/engine.d.mts +29 -0
  343. package/dist/game/kit/engine.d.ts +29 -0
  344. package/dist/game/kit/engine.js +183 -0
  345. package/dist/game/kit/engine.mjs +30 -0
  346. package/dist/game/kit/five-a-side.d.mts +11 -0
  347. package/dist/game/kit/five-a-side.d.ts +11 -0
  348. package/dist/game/kit/five-a-side.js +86 -0
  349. package/dist/game/kit/five-a-side.mjs +41 -0
  350. package/dist/game/kit/frontier.d.mts +344 -0
  351. package/dist/game/kit/frontier.d.ts +344 -0
  352. package/dist/game/kit/frontier.js +435 -0
  353. package/dist/game/kit/frontier.mjs +14 -0
  354. package/dist/game/kit/genesis.d.mts +752 -0
  355. package/dist/game/kit/genesis.d.ts +752 -0
  356. package/dist/game/kit/genesis.js +380 -0
  357. package/dist/game/kit/genesis.mjs +15 -0
  358. package/dist/game/kit/ludo.d.mts +15 -0
  359. package/dist/game/kit/ludo.d.ts +15 -0
  360. package/dist/game/kit/ludo.js +87 -0
  361. package/dist/game/kit/ludo.mjs +42 -0
  362. package/dist/game/kit/runner.d.mts +12 -0
  363. package/dist/game/kit/runner.d.ts +12 -0
  364. package/dist/game/kit/runner.js +83 -0
  365. package/dist/game/kit/runner.mjs +46 -0
  366. package/dist/game/kit/shootout.d.mts +13 -0
  367. package/dist/game/kit/shootout.d.ts +13 -0
  368. package/dist/game/kit/shootout.js +122 -0
  369. package/dist/game/kit/shootout.mjs +57 -0
  370. package/dist/game/kit/slots.d.mts +392 -0
  371. package/dist/game/kit/slots.d.ts +392 -0
  372. package/dist/game/kit/slots.js +215 -0
  373. package/dist/game/kit/slots.mjs +6 -0
  374. package/dist/game/kit/tycoon.d.mts +16 -0
  375. package/dist/game/kit/tycoon.d.ts +16 -0
  376. package/dist/game/kit/tycoon.js +145 -0
  377. package/dist/game/kit/tycoon.mjs +44 -0
  378. package/dist/game/kit/word.d.mts +11 -0
  379. package/dist/game/kit/word.d.ts +11 -0
  380. package/dist/game/kit/word.js +78 -0
  381. package/dist/game/kit/word.mjs +41 -0
  382. package/dist/game/kit/worlds.d.mts +18 -0
  383. package/dist/game/kit/worlds.d.ts +18 -0
  384. package/dist/game/kit/worlds.js +74 -0
  385. package/dist/game/kit/worlds.mjs +49 -0
  386. package/dist/game/kit.d.mts +53 -0
  387. package/dist/game/kit.d.ts +53 -0
  388. package/dist/game/kit.js +2610 -0
  389. package/dist/game/kit.mjs +101 -0
  390. package/dist/game/prepared.d.mts +14 -0
  391. package/dist/game/prepared.d.ts +14 -0
  392. package/dist/game/prepared.js +81 -0
  393. package/dist/game/prepared.mjs +32 -0
  394. package/dist/game-Bx8onkhX.d.mts +1451 -0
  395. package/dist/game-fgQy2YIm.d.ts +1451 -0
  396. package/dist/game-theme-CBTw1b_d.d.mts +35 -0
  397. package/dist/game-theme-Dg-ict5A.d.ts +35 -0
  398. package/dist/game.d.mts +3546 -0
  399. package/dist/game.d.ts +3546 -0
  400. package/dist/game.js +4455 -0
  401. package/dist/game.mjs +50 -0
  402. package/dist/graphics-C6YjWYvP.d.ts +5 -0
  403. package/dist/graphics-Dk2yQnYN.d.mts +5 -0
  404. package/dist/guest-DrsA00XD.d.mts +732 -0
  405. package/dist/guest-wIdfoT05.d.ts +732 -0
  406. package/dist/hit-stop-BKkVwTq7.d.mts +43 -0
  407. package/dist/hit-stop-D-8pPYnM.d.ts +43 -0
  408. package/dist/hot-Crn9XpHJ.d.ts +29 -0
  409. package/dist/hot-DH3nOhQD.d.mts +29 -0
  410. package/dist/{index-CQStGb3B.d.mts → index-6gkHMGAq.d.mts} +2 -2
  411. package/dist/index-B8ybCKJI.d.ts +41 -0
  412. package/dist/{index-DJwXmoaP.d.ts → index-B98Xac8e.d.ts} +2 -2
  413. package/dist/{index-B7oA_1XI.d.ts → index-B_ByTtIT.d.ts} +2 -2
  414. package/dist/index-DHjNHb1c.d.mts +41 -0
  415. package/dist/{index-DhUSTAhT.d.mts → index-DbAN_VQE.d.mts} +2 -2
  416. package/dist/index.d.mts +134 -24
  417. package/dist/index.d.ts +134 -24
  418. package/dist/index.js +407 -248
  419. package/dist/index.mjs +184 -58
  420. package/dist/interactives-authoring.d.mts +231 -0
  421. package/dist/interactives-authoring.d.ts +231 -0
  422. package/dist/interactives-authoring.js +1743 -0
  423. package/dist/interactives-authoring.mjs +1704 -0
  424. package/dist/interactives-canvas.global.js +148 -0
  425. package/dist/interactives-guest.d.mts +20 -0
  426. package/dist/interactives-guest.d.ts +20 -0
  427. package/dist/interactives-guest.js +63 -0
  428. package/dist/interactives-guest.json +1 -0
  429. package/dist/interactives-guest.mjs +61 -0
  430. package/dist/interactives-jsc.global.js +9357 -0
  431. package/dist/interactives-meters.d.mts +93 -0
  432. package/dist/interactives-meters.d.ts +93 -0
  433. package/dist/interactives-meters.js +252 -0
  434. package/dist/interactives-meters.mjs +68 -0
  435. package/dist/interactives-production.d.mts +430 -0
  436. package/dist/interactives-production.d.ts +430 -0
  437. package/dist/interactives-production.js +1231 -0
  438. package/dist/interactives-production.mjs +1170 -0
  439. package/dist/interactives-record.d.mts +112 -0
  440. package/dist/interactives-record.d.ts +112 -0
  441. package/dist/interactives-record.js +302 -0
  442. package/dist/interactives-record.mjs +295 -0
  443. package/dist/interactives-runtime.d.mts +61 -0
  444. package/dist/interactives-runtime.d.ts +61 -0
  445. package/dist/interactives-runtime.js +442 -0
  446. package/dist/interactives-runtime.mjs +25 -0
  447. package/dist/interactives-studio-kernel.global.js +1 -0
  448. package/dist/interactives-studio.d.mts +806 -0
  449. package/dist/interactives-studio.d.ts +806 -0
  450. package/dist/interactives-studio.js +5741 -0
  451. package/dist/interactives-studio.mjs +5651 -0
  452. package/dist/interactives-tick.d.mts +90 -0
  453. package/dist/interactives-tick.d.ts +90 -0
  454. package/dist/interactives-tick.js +203 -0
  455. package/dist/interactives-tick.mjs +6 -0
  456. package/dist/interactives-web.d.mts +762 -0
  457. package/dist/interactives-web.d.ts +762 -0
  458. package/dist/interactives-web.js +5000 -0
  459. package/dist/interactives-web.mjs +4628 -0
  460. package/dist/interactives.d.mts +2430 -0
  461. package/dist/interactives.d.ts +2430 -0
  462. package/dist/interactives.js +5723 -0
  463. package/dist/interactives.mjs +4333 -0
  464. package/dist/juice-CoHxlpKA.d.ts +42 -0
  465. package/dist/juice-DQztFS43.d.mts +42 -0
  466. package/dist/launch-T2f4_Di4.d.mts +151 -0
  467. package/dist/launch-d6oreMzR.d.ts +151 -0
  468. package/dist/library-DXYaMFhi.d.mts +69 -0
  469. package/dist/library-DXYaMFhi.d.ts +69 -0
  470. package/dist/link-BUTqGmyi.d.mts +38 -0
  471. package/dist/link-BUTqGmyi.d.ts +38 -0
  472. package/dist/lint.js +104 -204
  473. package/dist/lint.mjs +103 -203
  474. package/dist/local-D8_I6UeL.d.mts +6967 -0
  475. package/dist/local-VZkqsCzR.d.ts +6967 -0
  476. package/dist/lockstep-BLf6dglI.d.mts +321 -0
  477. package/dist/lockstep-D50Ia0JW.d.ts +321 -0
  478. package/dist/ludo-B8ClkDqr.d.ts +205 -0
  479. package/dist/ludo-BOuohQ-M.d.mts +205 -0
  480. package/dist/mock/cli.mjs +200 -56
  481. package/dist/mock/library.js +200 -56
  482. package/dist/mock/library.mjs +200 -56
  483. package/dist/mock/msw.js +200 -56
  484. package/dist/mock/msw.mjs +200 -56
  485. package/dist/native-BodxSh03.d.mts +16 -0
  486. package/dist/native-DUHMT8gA.d.ts +16 -0
  487. package/dist/network-ZXLD7l1b.d.mts +19 -0
  488. package/dist/network-ZXLD7l1b.d.ts +19 -0
  489. package/dist/online-XeymeM9s.d.ts +381 -0
  490. package/dist/online-d7W_Al9a.d.mts +381 -0
  491. package/dist/params-DxFb5G_U.d.mts +155 -0
  492. package/dist/params-DxFb5G_U.d.ts +155 -0
  493. package/dist/play-BRRlfLhX.d.ts +940 -0
  494. package/dist/play-ClrMd_e8.d.mts +940 -0
  495. package/dist/policy-CCw8tXLm.d.mts +3078 -0
  496. package/dist/policy-CMqOSQIu.d.ts +3078 -0
  497. package/dist/ports-B_0v_P3A.d.mts +13 -0
  498. package/dist/ports-CGU_3e_0.d.ts +13 -0
  499. package/dist/prefetch-BHnicOQj.d.ts +117 -0
  500. package/dist/prefetch-CBXgYacv.d.mts +117 -0
  501. package/dist/{price-CSztR02F.d.mts → price-BOzexBww.d.mts} +1 -1
  502. package/dist/{price-C_vasx9A.d.ts → price-C1h9sPxE.d.ts} +1 -1
  503. package/dist/protocol-C8qbpUbT.d.mts +242 -0
  504. package/dist/protocol-C8qbpUbT.d.ts +242 -0
  505. package/dist/rapier-AZHT4YI7.js +7886 -0
  506. package/dist/rapier-ODEPCQA6.mjs +7792 -0
  507. package/dist/react.d.mts +157 -15
  508. package/dist/react.d.ts +157 -15
  509. package/dist/react.js +5564 -5904
  510. package/dist/react.mjs +5451 -5808
  511. package/dist/runner-CQcLL7By.d.ts +189 -0
  512. package/dist/runner-D46Yj-wE.d.mts +189 -0
  513. package/dist/runtime-BRWfkf_q.d.mts +51 -0
  514. package/dist/runtime-DyuBMkKM.d.ts +51 -0
  515. package/dist/scheduling-D2ajXpMC.d.ts +224 -0
  516. package/dist/scheduling-DSRbbaZb.d.mts +224 -0
  517. package/dist/schema-BrWxzKp6.d.mts +63 -0
  518. package/dist/schema-BrWxzKp6.d.ts +63 -0
  519. package/dist/server/evict.js +34 -37
  520. package/dist/server/evict.mjs +34 -37
  521. package/dist/server/tanstack.d.mts +49 -3
  522. package/dist/server/tanstack.d.ts +49 -3
  523. package/dist/server/tanstack.js +169 -117
  524. package/dist/server/tanstack.mjs +166 -118
  525. package/dist/{server-Dckg4Vdr.d.ts → server-D29IIuDV.d.ts} +136 -130
  526. package/dist/{server-B6dW7-Lj.d.mts → server-DQMWPnc8.d.mts} +136 -130
  527. package/dist/server.d.mts +45 -5
  528. package/dist/server.d.ts +45 -5
  529. package/dist/server.js +171 -227
  530. package/dist/server.mjs +165 -225
  531. package/dist/session-grant-CJ27DwrT.d.mts +19 -0
  532. package/dist/session-grant-CJ27DwrT.d.ts +19 -0
  533. package/dist/shootout-BJZeX6FG.d.ts +140 -0
  534. package/dist/shootout-tcZd1Rxt.d.mts +140 -0
  535. package/dist/state-replica-stMtdkVD.d.mts +42 -0
  536. package/dist/state-replica-stMtdkVD.d.ts +42 -0
  537. package/dist/studio-CowqWqez.d.mts +14 -0
  538. package/dist/studio-CowqWqez.d.ts +14 -0
  539. package/dist/styles.css +1 -1
  540. package/dist/template-AhCdB1kW.d.mts +190 -0
  541. package/dist/template-BkEGVTQj.d.ts +190 -0
  542. package/dist/terrain-BMxEc6Oc.d.ts +429 -0
  543. package/dist/terrain-C-XC1Oui.d.mts +429 -0
  544. package/dist/testing/msw.d.mts +28 -4
  545. package/dist/testing/msw.d.ts +28 -4
  546. package/dist/testing/msw.js +15 -21
  547. package/dist/testing/msw.mjs +15 -21
  548. package/dist/testing/suite.d.mts +6 -5
  549. package/dist/testing/suite.d.ts +6 -5
  550. package/dist/testing/suite.js +89 -124
  551. package/dist/testing/suite.mjs +81 -116
  552. package/dist/testing.d.mts +27 -1227
  553. package/dist/testing.d.ts +27 -1227
  554. package/dist/testing.js +127 -131
  555. package/dist/testing.mjs +19 -23
  556. package/dist/tick-transport-C8QEh8Uw.d.mts +50 -0
  557. package/dist/tick-transport-UjHY3xK1.d.ts +50 -0
  558. package/dist/timeline-protocol-hp6e8zFB.d.mts +47 -0
  559. package/dist/timeline-protocol-hp6e8zFB.d.ts +47 -0
  560. package/dist/tokens-DhanQRQS.d.mts +21 -0
  561. package/dist/tokens-K8yxwd6G.d.ts +21 -0
  562. package/dist/tree-C-Io2Hbx.d.mts +35 -0
  563. package/dist/tree-CP_qSW4H.d.ts +35 -0
  564. package/dist/tycoon-B5KHk2Xx.d.mts +255 -0
  565. package/dist/tycoon-hmHo-3HX.d.ts +255 -0
  566. package/dist/types-BQkxPwZP.d.mts +219 -0
  567. package/dist/types-D_f6UUxM.d.ts +219 -0
  568. package/dist/ui-DwHicuFv.d.mts +563 -0
  569. package/dist/ui-hi7S2YcH.d.ts +563 -0
  570. package/dist/{sign-in-DQlIdqsi.d.mts → url-52ndUruG.d.mts} +15 -1
  571. package/dist/{sign-in-DQlIdqsi.d.ts → url-52ndUruG.d.ts} +15 -1
  572. package/dist/utils.d.mts +3 -3
  573. package/dist/utils.d.ts +3 -3
  574. package/dist/utils.js +37 -37
  575. package/dist/utils.mjs +4 -4
  576. package/dist/vars-Dc_PrhBK.d.mts +511 -0
  577. package/dist/vars-Dc_PrhBK.d.ts +511 -0
  578. package/dist/vm-IUARFFAI.mjs +63 -0
  579. package/dist/vm-N7L6MGGH.js +65 -0
  580. package/dist/weave-delivery-CW-Kstut.d.mts +360 -0
  581. package/dist/weave-delivery-CW-Kstut.d.ts +360 -0
  582. package/dist/web-Dss74a7v.d.ts +883 -0
  583. package/dist/web-f9ZQPoyw.d.mts +883 -0
  584. package/dist/web-transport-C7MkBL0a.d.ts +19 -0
  585. package/dist/web-transport-aYEqXMd9.d.mts +19 -0
  586. package/dist/weight-CPGjsgjV.d.ts +92 -0
  587. package/dist/weight-tF1ODR1p.d.mts +92 -0
  588. package/dist/word-BcX9Jcmv.d.mts +70 -0
  589. package/dist/word-C7sVPLHm.d.ts +70 -0
  590. package/dist/world-PvILHDR1.d.ts +2285 -0
  591. package/dist/world-qekkXjJv.d.mts +2285 -0
  592. package/dist/worlds-Br2Pb0Cs.d.ts +109 -0
  593. package/dist/worlds-D5ydYr7d.d.mts +109 -0
  594. package/engines/c/cimplify.h +108 -0
  595. package/engines/c/cimplify.lib.js +11 -0
  596. package/engines/godot/addons/cimplify/cimplify.gd +97 -0
  597. package/engines/rust/interactives-ctx/Cargo.toml +9 -0
  598. package/engines/rust/interactives-ctx/src/lib.rs +189 -0
  599. package/package.json +189 -3
  600. package/vendor/rapier3d-compat/LICENSE +201 -0
  601. package/vendor/rapier3d-compat/PATCHES.md +61 -0
  602. package/dist/chunk-2P4KXFB6.js +0 -274
  603. package/dist/chunk-3G6RQLXK.mjs +0 -21
  604. package/dist/chunk-3V4DVXV3.mjs +0 -254
  605. package/dist/chunk-EDK3LNM6.js +0 -2436
  606. package/dist/chunk-F7J3HK27.js +0 -4549
  607. package/dist/chunk-U4MW6PYU.mjs +0 -23
  608. package/dist/chunk-XREIZ56K.js +0 -26
@@ -0,0 +1,1453 @@
1
+ 'use strict';
2
+
3
+ var chunkAABEK6XU_js = require('./chunk-AABEK6XU.js');
4
+ var chunkOIVVQQ22_js = require('./chunk-OIVVQQ22.js');
5
+ var chunkO2ICABUD_js = require('./chunk-O2ICABUD.js');
6
+ var chunkJ2U6PJSO_js = require('./chunk-J2U6PJSO.js');
7
+ var chunkGDZT5LZ5_js = require('./chunk-GDZT5LZ5.js');
8
+ var chunkXK6UDWJS_js = require('./chunk-XK6UDWJS.js');
9
+ var chunkT7LOXGYX_js = require('./chunk-T7LOXGYX.js');
10
+ var chunkI5FOHCLH_js = require('./chunk-I5FOHCLH.js');
11
+ var chunkTJI3K6RP_js = require('./chunk-TJI3K6RP.js');
12
+ require('./chunk-WWKMOA76.js');
13
+ var chunk4ZDR72SG_js = require('./chunk-4ZDR72SG.js');
14
+ var chunkJ2KZXIU3_js = require('./chunk-J2KZXIU3.js');
15
+
16
+ // src/interactives/content/origin.ts
17
+ var SHELL_PREFIX = "/g/", RUNTIME_PREFIX = "/r/", WASM_PREFIX = "/w/", JOINED_PREFIX = "/j/", JOINED_PARTS_PARAM = "p", JOINED_PART_SEPARATOR = ",", MAX_JOINED_PARTS = 16, RUNTIME_SUFFIX = ".js", WASM_SUFFIX = ".wasm", SRI_PREFIX = "sha256-", FORBIDDEN_PARENT = "cimplify.io", HOST_PAGE_ISOLATION_HEADERS = {
18
+ "cross-origin-opener-policy": "same-origin",
19
+ "cross-origin-embedder-policy": "require-corp",
20
+ "cross-origin-resource-policy": "same-origin"
21
+ }, LABEL_BYTES = 20, BASE32 = "abcdefghijklmnopqrstuvwxyz234567", BASE32_BITS = 5, BYTE_BITS = 8, BASE32_MASK = 31, HOST_LABEL = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, SECURE_SCHEME = "https:", LOCAL_SCHEME = "http:", LOCAL_SUFFIXES = [".test", ".localhost"], MIN_LABELS = 2, HEX_DIGEST = /^[0-9a-f]{64}$/;
22
+ function local(host) {
23
+ return LOCAL_SUFFIXES.some((suffix) => host.endsWith(suffix));
24
+ }
25
+ function parseContentOrigin(value) {
26
+ let url;
27
+ try {
28
+ url = new URL(value);
29
+ } catch {
30
+ return null;
31
+ }
32
+ let scheme = url.protocol;
33
+ if (scheme !== SECURE_SCHEME && scheme !== LOCAL_SCHEME || url.username !== "" || url.password !== "" || url.search !== "" || url.hash !== "" || url.pathname !== "/" && url.pathname !== "") return null;
34
+ let host = url.hostname.toLowerCase(), labels = host.split(".");
35
+ return labels.length < (2) || !labels.every((label) => HOST_LABEL.test(label)) || host === FORBIDDEN_PARENT || host.endsWith(`.${FORBIDDEN_PARENT}`) || scheme === LOCAL_SCHEME && !local(host) ? null : { scheme, host, port: url.port };
36
+ }
37
+ function base32(bytes) {
38
+ let out = "", buffer = 0, bits = 0;
39
+ for (let i = 0; i < bytes.length; i++)
40
+ for (buffer = buffer << (8) | bytes[i], bits += (8); bits >= (5); )
41
+ bits -= (5), out += BASE32[buffer >>> bits & (31)];
42
+ return bits > 0 && (out += BASE32[buffer << (5) - bits & (31)]), out;
43
+ }
44
+ function interactiveLabel(interactiveId) {
45
+ let digest = new Uint8Array(chunkTJI3K6RP_js.SHA256_BYTES);
46
+ return chunkTJI3K6RP_js.sha256Into(new TextEncoder().encode(interactiveId), digest), base32(digest.subarray(0, (20)));
47
+ }
48
+ function guestOrigin(origin, interactiveId) {
49
+ let port = origin.port === "" ? "" : `:${origin.port}`;
50
+ return `${origin.scheme}//${interactiveLabel(interactiveId)}.${origin.host}${port}`;
51
+ }
52
+ function servesContent(origin, host) {
53
+ let name = host.toLowerCase().split(":")[0];
54
+ return name.endsWith(`.${origin.host}`) ? HOST_LABEL.test(name.slice(0, name.length - origin.host.length - 1)) : false;
55
+ }
56
+ function sha256Hex(bytes) {
57
+ let digest = new Uint8Array(chunkTJI3K6RP_js.SHA256_BYTES);
58
+ return chunkTJI3K6RP_js.sha256Into(bytes, digest), chunk4ZDR72SG_js.hex(digest);
59
+ }
60
+ function isDigestHex(value) {
61
+ return HEX_DIGEST.test(value);
62
+ }
63
+ function sri(digestHex) {
64
+ let bytes = new Uint8Array(chunkTJI3K6RP_js.SHA256_BYTES);
65
+ return !isDigestHex(digestHex) || !chunk4ZDR72SG_js.unhex(digestHex, bytes) ? null : SRI_PREFIX + chunkJ2KZXIU3_js.encodeBase64(bytes);
66
+ }
67
+ function shellPath(runtimeDigest) {
68
+ return SHELL_PREFIX + runtimeDigest;
69
+ }
70
+ function runtimePath(runtimeDigest) {
71
+ return RUNTIME_PREFIX + runtimeDigest + RUNTIME_SUFFIX;
72
+ }
73
+
74
+ // src/interactives/hosts/lazy.ts
75
+ var DEFAULT_LAZY_BUDGET_BYTES = 64 * 1024 * 1024, DEFAULT_LAZY_CONCURRENCY = 4, DEFAULT_RUN_BYTES = 256 * 1024, PRIORITIES = chunk4ZDR72SG_js.ChunkPriority.prefetch + 1, LazyChunkServer = class {
76
+ constructor(refs, options, sink = null) {
77
+ this.options = options;
78
+ this.sink = sink;
79
+ this.known = /* @__PURE__ */ new Map();
80
+ this.queues = Array.from({ length: PRIORITIES }, () => []);
81
+ this.queued = /* @__PURE__ */ new Map();
82
+ this.flying = /* @__PURE__ */ new Map();
83
+ this.held = /* @__PURE__ */ new Map();
84
+ this.partials = /* @__PURE__ */ new Map();
85
+ this.failure = new Uint8Array(chunk4ZDR72SG_js.CHUNK_FAILED_BYTES);
86
+ this.heldBytes = 0;
87
+ this.generation = 0;
88
+ this.preemptions = 0;
89
+ this.runs = 0;
90
+ for (let ref of refs) this.known.set(ref.digest, ref);
91
+ this.budget = options.budget_bytes ?? DEFAULT_LAZY_BUDGET_BYTES, this.concurrency = Math.max(1, options.concurrency ?? (4)), this.prefetchSlots = chunk4ZDR72SG_js.prefetchSlots(this.concurrency);
92
+ }
93
+ get bytesHeld() {
94
+ return this.heldBytes;
95
+ }
96
+ get pending() {
97
+ return this.queued.size + this.flying.size;
98
+ }
99
+ get preempted() {
100
+ return this.preemptions;
101
+ }
102
+ get ranged() {
103
+ return this.runs;
104
+ }
105
+ priorityOf(digest) {
106
+ return this.queued.get(digest) ?? this.flying.get(digest)?.priority ?? null;
107
+ }
108
+ attach(sink) {
109
+ this.sink = sink, this.generation++;
110
+ for (let queue of this.queues) queue.length = 0;
111
+ this.queued.clear();
112
+ for (let flight of this.flying.values()) flight.controller?.abort();
113
+ this.flying.clear(), this.held.clear(), this.partials.clear(), this.heldBytes = 0;
114
+ }
115
+ request(bytes) {
116
+ chunk4ZDR72SG_js.forEachChunkEntry(bytes, chunk4ZDR72SG_js.CHUNK_REQUEST_ENTRY_BYTES, (digest, priority) => this.enqueue(digest, priority)), this.preempt(), this.pump();
117
+ }
118
+ requestOne(digest, priority) {
119
+ this.enqueue(digest, priority), this.preempt(), this.pump();
120
+ }
121
+ requestMany(entries) {
122
+ for (let [digest, priority] of entries) this.enqueue(digest, priority);
123
+ this.preempt(), this.pump();
124
+ }
125
+ enqueue(digest, requested) {
126
+ if (!this.known.has(digest)) {
127
+ this.fail(digest, "unknown");
128
+ return;
129
+ }
130
+ let priority = Math.min(Math.max(0, requested), PRIORITIES - 1), flight = this.flying.get(digest);
131
+ if (flight !== void 0) {
132
+ priority < flight.priority && (flight.priority = priority);
133
+ return;
134
+ }
135
+ let queued = this.queued.get(digest);
136
+ if (queued !== void 0) {
137
+ if (priority >= queued) return;
138
+ this.unqueue(digest, queued);
139
+ }
140
+ this.queued.set(digest, priority), this.queues[priority].push(digest);
141
+ }
142
+ unqueue(digest, priority) {
143
+ let queue = this.queues[priority], at = queue.indexOf(digest);
144
+ at >= 0 && queue.splice(at, 1), this.queued.delete(digest);
145
+ }
146
+ release(bytes) {
147
+ chunk4ZDR72SG_js.forEachChunkEntry(bytes, chunk4ZDR72SG_js.CHUNK_RELEASE_ENTRY_BYTES, (digest) => {
148
+ let queued = this.queued.get(digest);
149
+ if (queued !== void 0) {
150
+ this.unqueue(digest, queued), this.partials.delete(digest);
151
+ return;
152
+ }
153
+ let size = this.held.get(digest);
154
+ size !== void 0 && (this.held.delete(digest), this.heldBytes -= size);
155
+ }), this.pump();
156
+ }
157
+ top() {
158
+ let top = null;
159
+ for (let priority = 0; priority < PRIORITIES; priority++)
160
+ if (this.queues[priority].length > 0) {
161
+ top = priority;
162
+ break;
163
+ }
164
+ for (let flight of this.flying.values()) (top === null || flight.priority < top) && (top = flight.priority);
165
+ return top;
166
+ }
167
+ preempt() {
168
+ let top = this.top();
169
+ if (top === null) return;
170
+ let aborted = /* @__PURE__ */ new Set();
171
+ for (let flight of this.flying.values())
172
+ flight.priority <= top || flight.controller === null || aborted.add(flight.controller);
173
+ if (aborted.size !== 0) {
174
+ for (let [digest, flight] of this.flying)
175
+ flight.controller === null || !aborted.has(flight.controller) || (flight.preempted = true, this.flying.delete(digest), this.preemptions++, this.queued.set(digest, flight.priority), this.queues[flight.priority].unshift(digest));
176
+ for (let controller of aborted) controller.abort();
177
+ }
178
+ }
179
+ next() {
180
+ let top = this.top();
181
+ if (top === null) return null;
182
+ let queue = this.queues[top];
183
+ return queue.length === 0 || top === chunk4ZDR72SG_js.ChunkPriority.prefetch && this.prefetchFlying() >= this.prefetchSlots ? null : queue.shift() ?? null;
184
+ }
185
+ requestsFlying(priority) {
186
+ let count = 0, counted = /* @__PURE__ */ new Set();
187
+ for (let flight of this.flying.values())
188
+ if (!(priority !== null && flight.priority !== priority)) {
189
+ if (flight.controller !== null) {
190
+ if (counted.has(flight.controller)) continue;
191
+ counted.add(flight.controller);
192
+ }
193
+ count++;
194
+ }
195
+ return count;
196
+ }
197
+ prefetchFlying() {
198
+ return this.requestsFlying(chunk4ZDR72SG_js.ChunkPriority.prefetch);
199
+ }
200
+ pump() {
201
+ for (; this.requestsFlying(null) < this.concurrency; ) {
202
+ let digest = this.next();
203
+ if (digest === null) return;
204
+ let priority = this.queued.get(digest) ?? chunk4ZDR72SG_js.ChunkPriority.now;
205
+ this.queued.delete(digest);
206
+ let controller = typeof AbortController == "function" ? new AbortController() : null, run = this.gather(digest, priority);
207
+ if (run.length > 1) {
208
+ let flights = run.map((member) => {
209
+ let flight2 = { priority, preempted: false, controller };
210
+ return this.flying.set(member, flight2), flight2;
211
+ });
212
+ this.runs++, this.serveRun(run, flights, this.generation);
213
+ continue;
214
+ }
215
+ let flight = { priority, preempted: false, controller };
216
+ this.flying.set(digest, flight), this.serve(digest, flight, this.generation);
217
+ }
218
+ }
219
+ gather(digest, priority) {
220
+ let spans = this.options.spans;
221
+ if (spans === void 0 || this.options.source.fetchRun === void 0 || this.partials.has(digest)) return [digest];
222
+ let run = [digest], bytes = spans.locate(digest)?.size ?? 0, limit = this.options.run_bytes ?? DEFAULT_RUN_BYTES;
223
+ for (let step of [1, -1]) {
224
+ let at = digest;
225
+ for (; bytes < limit; ) {
226
+ let next = spans.neighbour(at, step);
227
+ if (next === null || this.queued.get(next) !== priority || this.partials.has(next)) break;
228
+ this.unqueue(next, priority), step === 1 ? run.push(next) : run.unshift(next), bytes += spans.locate(next)?.size ?? 0, at = next;
229
+ }
230
+ }
231
+ return run;
232
+ }
233
+ async serveRun(run, flights, generation) {
234
+ let live = (k) => generation === this.generation && !flights[k].preempted, fetchRun = this.options.source.fetchRun;
235
+ try {
236
+ let wanted = [];
237
+ for (let k = 0; k < run.length; k++) {
238
+ let declared = this.known.get(run[k])?.size;
239
+ declared !== void 0 && !this.fits(run[k], declared, flights[k].priority) ? this.fail(run[k], "budget") : wanted.push(k);
240
+ }
241
+ if (wanted.length === 0 || fetchRun === void 0) return;
242
+ let bodies;
243
+ try {
244
+ bodies = await fetchRun(
245
+ wanted.map((k) => run[k]),
246
+ flights[0].controller?.signal
247
+ );
248
+ } catch {
249
+ for (let k of wanted) live(k) && this.fail(run[k], "network");
250
+ return;
251
+ }
252
+ for (let m = 0; m < wanted.length; m++) {
253
+ let k = wanted[m];
254
+ if (!live(k)) continue;
255
+ let body = bodies[m] ?? null;
256
+ if (body === null || !await chunkOIVVQQ22_js.verifyChunk(run[k], body)) {
257
+ live(k) && this.fail(run[k], body === null ? "network" : "verify");
258
+ continue;
259
+ }
260
+ if (live(k)) {
261
+ if (!this.fits(run[k], body.length, flights[k].priority)) {
262
+ this.fail(run[k], "budget");
263
+ continue;
264
+ }
265
+ this.heldBytes += body.length - (this.held.get(run[k]) ?? 0), this.held.set(run[k], body.length), this.sink?.deliver(run[k], body);
266
+ }
267
+ }
268
+ } finally {
269
+ for (let k = 0; k < run.length; k++)
270
+ generation === this.generation && this.flying.get(run[k]) === flights[k] && this.flying.delete(run[k]);
271
+ generation === this.generation && this.pump();
272
+ }
273
+ }
274
+ fits(digest, size, priority) {
275
+ let already = this.held.get(digest) ?? 0, limit = priority === chunk4ZDR72SG_js.ChunkPriority.prefetch ? Math.floor(this.budget * chunk4ZDR72SG_js.PREFETCH_BUDGET_SHARE) : this.budget;
276
+ return this.heldBytes - already + size <= limit;
277
+ }
278
+ async serve(digest, flight, generation) {
279
+ let live = () => generation === this.generation && !flight.preempted;
280
+ try {
281
+ let declared = this.known.get(digest)?.size;
282
+ if (declared !== void 0 && !this.fits(digest, declared, flight.priority)) {
283
+ this.fail(digest, "budget");
284
+ return;
285
+ }
286
+ let partial = this.partials.get(digest);
287
+ partial === void 0 && (partial = new chunkOIVVQQ22_js.PartialChunk(), this.partials.set(digest, partial));
288
+ let body;
289
+ try {
290
+ body = await this.options.source.fetch(digest, flight.controller?.signal, partial);
291
+ } catch {
292
+ live() && (this.partials.delete(digest), this.fail(digest, "network"));
293
+ return;
294
+ }
295
+ if (!live()) return;
296
+ if (this.partials.delete(digest), !await chunkOIVVQQ22_js.verifyChunk(digest, body)) {
297
+ live() && this.fail(digest, "verify");
298
+ return;
299
+ }
300
+ if (!live()) return;
301
+ if (!this.fits(digest, body.length, flight.priority)) {
302
+ this.fail(digest, "budget");
303
+ return;
304
+ }
305
+ this.heldBytes += body.length - (this.held.get(digest) ?? 0), this.held.set(digest, body.length), this.sink?.deliver(digest, body);
306
+ } finally {
307
+ generation === this.generation && this.flying.get(digest) === flight && this.flying.delete(digest), generation === this.generation && this.pump();
308
+ }
309
+ }
310
+ fail(digest, reason) {
311
+ let length = chunk4ZDR72SG_js.writeChunkFailed(this.failure, digest, reason);
312
+ this.sink?.send(this.failure, length);
313
+ }
314
+ };
315
+
316
+ // src/interactives/hosts/chrome/mediator.ts
317
+ var HOST_REQUEST_PREFIX = "host-", NO_ARGUMENTS = {};
318
+ function trackingOf(consents, interactive_id) {
319
+ let state = consents.state(interactive_id, "tracking");
320
+ return state === "granted" ? "authorized" : state === "denied" ? "denied" : "not_asked";
321
+ }
322
+ var HostMediator = class {
323
+ constructor(options) {
324
+ this.options = options;
325
+ this.writer = new chunk4ZDR72SG_js.MessageWriter();
326
+ this.offers = /* @__PURE__ */ new Map();
327
+ this.offerRequests = /* @__PURE__ */ new Set();
328
+ this.hostCalls = /* @__PURE__ */ new Map();
329
+ this.asking = /* @__PURE__ */ new Set();
330
+ this.outlet = null;
331
+ this.program = null;
332
+ this.stopConsents = null;
333
+ this.nextHostCall = 0;
334
+ }
335
+ start(program, outlet) {
336
+ this.program = program, this.outlet = outlet, this.stopConsents?.(), this.stopConsents = this.options.consents.subscribe((interactive_id) => {
337
+ interactive_id === this.options.interactive_id && this.sendConsents();
338
+ }), this.sendConsents();
339
+ }
340
+ stop() {
341
+ this.stopConsents?.(), this.stopConsents = null, this.outlet = null, this.hostCalls.clear();
342
+ }
343
+ send(length) {
344
+ this.outlet?.toSession(this.writer.bytes, length);
345
+ }
346
+ sendConsents() {
347
+ this.send(this.writer.json(chunk4ZDR72SG_js.MessageTag.consent, { granted: [...this.options.consents.granted(this.options.interactive_id)] }));
348
+ }
349
+ relay(bytes) {
350
+ this.outlet?.toSession(bytes, bytes.length);
351
+ }
352
+ fromGuest(bytes) {
353
+ if (bytes[0] !== chunk4ZDR72SG_js.MessageTag.request) return false;
354
+ let envelope = chunk4ZDR72SG_js.readJson(bytes);
355
+ switch (envelope.call.operation) {
356
+ case "wallet.offers":
357
+ return this.offerRequests.add(envelope.request_id), false;
358
+ case "wallet.spend":
359
+ return this.spend(bytes.slice(), envelope.call.arguments), true;
360
+ case "ads.placement":
361
+ return this.options.registry === null ? false : (this.placement(bytes.slice(), envelope.call.arguments, this.options.registry), true);
362
+ default:
363
+ return false;
364
+ }
365
+ }
366
+ fromSession(bytes) {
367
+ if (bytes[0] !== chunk4ZDR72SG_js.MessageTag.response) return false;
368
+ let envelope = chunk4ZDR72SG_js.readJson(bytes), hostCall = this.hostCalls.get(envelope.request_id);
369
+ if (hostCall !== void 0)
370
+ return this.hostCalls.delete(envelope.request_id), hostCall(envelope), true;
371
+ let outcome = envelope.outcome;
372
+ return this.offerRequests.delete(envelope.request_id) && outcome.status === "ok" && this.remember(outcome.response.result), outcome.status === "error" && this.consentRequired(outcome.error), false;
373
+ }
374
+ remember(offers) {
375
+ for (let offer of offers.offers) this.offers.set(offer.offer_id, { display_name: offer.display_name, price_cimples: offer.price_cimples });
376
+ }
377
+ consentRequired(error) {
378
+ if (error.code !== "consent_required") return;
379
+ let kind = error.consent;
380
+ this.asking.has(kind) || this.options.consents.state(this.options.interactive_id, kind) !== "undecided" || (this.asking.add(kind), this.options.controller.requestConsent(kind).then((granted) => {
381
+ this.asking.delete(kind), this.options.consents.decide(this.options.interactive_id, kind, granted);
382
+ }));
383
+ }
384
+ /** Sends one ctx call on the host's own behalf, such as posting a clip the player saved from host chrome. */
385
+ hostCall(operation, args = NO_ARGUMENTS) {
386
+ let program = this.program;
387
+ if (program === null) return Promise.reject(new Error("the host session has not started"));
388
+ let request_id = `${HOST_REQUEST_PREFIX}${this.nextHostCall++}`, envelope = {
389
+ contract_version: 1,
390
+ request_id,
391
+ interactive_id: program.interactive_id,
392
+ revision: program.revision,
393
+ deadline_ms: null,
394
+ call: { operation, arguments: args }
395
+ };
396
+ return new Promise((resolve) => {
397
+ this.hostCalls.set(request_id, resolve), this.send(this.writer.json(chunk4ZDR72SG_js.MessageTag.request, envelope));
398
+ });
399
+ }
400
+ async offer(offer_id) {
401
+ let known = this.offers.get(offer_id);
402
+ if (known !== void 0) return known;
403
+ let envelope = await this.hostCall("wallet.offers");
404
+ return envelope.outcome.status === "ok" && this.remember(envelope.outcome.response.result), this.offers.get(offer_id) ?? null;
405
+ }
406
+ async spend(request, spend) {
407
+ let offer = await this.offer(spend.offer_id).catch(() => null), price_cimples = offer === null ? 0 : offer.price_cimples * spend.quantity, decision = offer === null ? "cancelled" : await this.options.controller.confirmSpend({
408
+ offer_id: spend.offer_id,
409
+ display_name: offer.display_name,
410
+ quantity: spend.quantity,
411
+ price_cimples
412
+ }), confirmation = {
413
+ request_key: spend.request_key,
414
+ offer_id: spend.offer_id,
415
+ quantity: spend.quantity,
416
+ price_cimples,
417
+ decision
418
+ };
419
+ this.send(this.writer.json(chunk4ZDR72SG_js.MessageTag.confirm, confirmation)), this.relay(request);
420
+ }
421
+ async placement(request, placement, registry) {
422
+ let interactive_id = this.options.interactive_id;
423
+ try {
424
+ let served = await registry.decideAd(interactive_id, {
425
+ request_key: placement.request_key,
426
+ format: placement.format,
427
+ slot: placement.slot,
428
+ tracking: trackingOf(this.options.consents, interactive_id)
429
+ });
430
+ served.status === "decided" && served.creative !== null && await this.options.controller.showAd(served.creative) === "completed" && await registry.completeAd(interactive_id, served.placement_id, !1);
431
+ } catch {
432
+ this.relay(request);
433
+ return;
434
+ }
435
+ this.relay(request);
436
+ }
437
+ };
438
+
439
+ // src/interactives/hosts/gpu.ts
440
+ var GPU_REQUIREMENT_NAMES = [
441
+ "sampled_textures_per_stage",
442
+ "samplers_per_stage",
443
+ "storage_buffers_per_stage",
444
+ "compute_workgroup_invocations",
445
+ "compute_workgroup_storage_bytes"
446
+ ], WEBGPU_LIMITS = {
447
+ sampled_textures_per_stage: "maxSampledTexturesPerShaderStage",
448
+ samplers_per_stage: "maxSamplersPerShaderStage",
449
+ storage_buffers_per_stage: "maxStorageBuffersPerShaderStage",
450
+ compute_workgroup_invocations: "maxComputeInvocationsPerWorkgroup",
451
+ compute_workgroup_storage_bytes: "maxComputeWorkgroupStorageSize"
452
+ }, NO_GPU = {
453
+ sampled_textures_per_stage: 0,
454
+ samplers_per_stage: 0,
455
+ storage_buffers_per_stage: 0,
456
+ compute_workgroup_invocations: 0,
457
+ compute_workgroup_storage_bytes: 0
458
+ }, WEBGL2 = "webgl2", MAX_TEXTURE_IMAGE_UNITS = 34930, decoder = new TextDecoder();
459
+ function unmetGpuRequirement(requirements, limits) {
460
+ for (let name of GPU_REQUIREMENT_NAMES) {
461
+ let floor = requirements[name];
462
+ if (floor !== void 0 && floor > limits[name]) return name;
463
+ }
464
+ return null;
465
+ }
466
+ function manifestGpuRequirements(manifest) {
467
+ return JSON.parse(decoder.decode(manifest)).gpu?.requirements ?? {};
468
+ }
469
+ function webglLimits(scope) {
470
+ let gl = scope.document?.createElement("canvas").getContext(WEBGL2) ?? null;
471
+ if (gl === null) return NO_GPU;
472
+ let units = Number(gl.getParameter((34930))) || 0;
473
+ return { ...NO_GPU, sampled_textures_per_stage: units, samplers_per_stage: units };
474
+ }
475
+ async function deviceGpuLimits(scope = globalThis) {
476
+ let adapter = await scope.navigator?.gpu?.requestAdapter().catch(() => null);
477
+ if (adapter == null) return webglLimits(scope);
478
+ let limits = { ...NO_GPU };
479
+ for (let name of GPU_REQUIREMENT_NAMES) limits[name] = adapter.limits[WEBGPU_LIMITS[name]] ?? 0;
480
+ return limits;
481
+ }
482
+
483
+ // src/interactives/parts/brotli.ts
484
+ var BROTLI_FORMAT = "brotli";
485
+ function brotliStream() {
486
+ try {
487
+ return new DecompressionStream(BROTLI_FORMAT);
488
+ } catch {
489
+ return null;
490
+ }
491
+ }
492
+ async function inflateCapped(body, inflate, cap) {
493
+ let reader = body.pipeThrough(inflate).getReader(), pieces = [], length = 0;
494
+ for (; ; ) {
495
+ let { done, value } = await reader.read();
496
+ if (done) break;
497
+ if (length += value.length, length > cap)
498
+ return await reader.cancel(), null;
499
+ pieces.push(value);
500
+ }
501
+ let out = new Uint8Array(length), at = 0;
502
+ for (let piece of pieces)
503
+ out.set(piece, at), at += piece.length;
504
+ return out;
505
+ }
506
+ async function fetchTwin(fetcher, url, cap, signal) {
507
+ let inflate = brotliStream();
508
+ if (inflate === null) return null;
509
+ try {
510
+ let response = await fetcher(`${url}.br`, { signal });
511
+ if (!response.ok || response.body === null) return null;
512
+ let wire = Number(response.headers.get("content-length") ?? 0), bytes = await inflateCapped(response.body, inflate, cap);
513
+ return bytes === null ? null : { bytes, wire };
514
+ } catch {
515
+ if (signal?.aborted === true) throw signal.reason;
516
+ return null;
517
+ }
518
+ }
519
+
520
+ // src/interactives/hosts/session.ts
521
+ var SESSION_PATH_SUFFIX = "/session", OPEN = 1, NORMAL_CLOSE = 1e3;
522
+ function sessionUrl(target) {
523
+ let url = new URL(`/v1/interactives/${encodeURIComponent(target.interactive_id)}${SESSION_PATH_SUFFIX}`, target.base_url);
524
+ return url.protocol = url.protocol === "https:" ? "wss:" : url.protocol === "http:" ? "ws:" : url.protocol, url.searchParams.set("revision", target.revision), url.searchParams.set("channel", target.channel ?? "live"), url.href;
525
+ }
526
+ function bytesOf(data) {
527
+ return data instanceof ArrayBuffer ? new Uint8Array(data) : ArrayBuffer.isView(data) ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength) : null;
528
+ }
529
+ function openSession(target, connect) {
530
+ let socket = connect(sessionUrl(target));
531
+ socket.binaryType = "arraybuffer";
532
+ let listener = () => {
533
+ }, closers = [], closed = null, finish = (close) => {
534
+ if (closed === null) {
535
+ closed = close;
536
+ for (let closer of closers) closer(close);
537
+ }
538
+ }, transport = {
539
+ send(bytes, length) {
540
+ socket.readyState === (1) && socket.send(bytes.subarray(0, length));
541
+ },
542
+ on_message(next) {
543
+ listener = next;
544
+ },
545
+ on_close(next) {
546
+ closed !== null ? next(closed) : closers.push(next);
547
+ },
548
+ close() {
549
+ finish({ reason: "closed_by_host", detail: null }), socket.close((1e3));
550
+ }
551
+ };
552
+ return new Promise((resolve, reject) => {
553
+ socket.onmessage = (event) => {
554
+ let bytes = bytesOf(event.data);
555
+ if (!(bytes === null || bytes.length === 0)) {
556
+ if (bytes[0] === chunk4ZDR72SG_js.MessageTag.hello) {
557
+ let hello = chunk4ZDR72SG_js.readJson(bytes);
558
+ if (hello.protocol !== 1) {
559
+ reject(new Error(`session protocol ${hello.protocol} is not ${1}`)), socket.close((1e3));
560
+ return;
561
+ }
562
+ resolve({ transport, hello });
563
+ return;
564
+ }
565
+ if (bytes[0] === chunk4ZDR72SG_js.MessageTag.close) {
566
+ let close = chunk4ZDR72SG_js.readJson(bytes);
567
+ reject(new Error(close.detail ?? close.reason)), finish(close);
568
+ return;
569
+ }
570
+ listener(bytes);
571
+ }
572
+ }, socket.onclose = (event) => {
573
+ let close = { reason: "disconnected", detail: event.reason || String(event.code) };
574
+ reject(new Error(close.detail)), finish(close);
575
+ }, socket.onerror = () => {
576
+ };
577
+ });
578
+ }
579
+ var PARTIAL_CONTENT = 206;
580
+ function httpChunks(base, fetcher = fetch) {
581
+ return {
582
+ fetchTwin: async (digest, cap, signal) => (await fetchTwin(fetcher, new URL(digest, base).href, cap, signal))?.bytes ?? null,
583
+ async fetch(digest, signal, partial) {
584
+ let from = partial?.received ?? 0, init = { signal, headers: from > 0 ? { Range: `bytes=${from}-` } : void 0 }, response = await fetcher(new URL(digest, base).href, init);
585
+ if (!response.ok) throw new Error(`chunk ${digest} answered ${response.status}`);
586
+ if (partial === void 0 || response.body === null) {
587
+ partial?.reset();
588
+ let body = new Uint8Array(await response.arrayBuffer());
589
+ return partial?.append(body), body;
590
+ }
591
+ from > 0 && response.status !== (206) && partial.reset();
592
+ let reader = response.body.getReader();
593
+ for (; ; ) {
594
+ let { done, value } = await reader.read();
595
+ if (done) break;
596
+ partial.append(value);
597
+ }
598
+ return partial.join();
599
+ }
600
+ };
601
+ }
602
+
603
+ // src/interactives/hosts/zones.ts
604
+ var PARTIAL_CONTENT2 = 206, ZoneSpans = class _ZoneSpans {
605
+ constructor() {
606
+ this.spans = /* @__PURE__ */ new Map();
607
+ this.members = /* @__PURE__ */ new Map();
608
+ }
609
+ static of(chunks, files) {
610
+ let spans = new _ZoneSpans();
611
+ for (let file of files) {
612
+ let members = chunks.filter((chunk) => chunk.asset_group === file.asset_group);
613
+ if (members.length !== file.parts || members.some((chunk) => chunk.size === void 0) || members.reduce((sum, chunk) => sum + (chunk.size ?? 0), 0) !== file.bytes) continue;
614
+ let offset = 0;
615
+ members.forEach((chunk, index) => {
616
+ let size = chunk.size ?? 0;
617
+ spans.spans.has(chunk.digest) || spans.spans.set(chunk.digest, { file: file.digest, offset, size, index }), offset += size;
618
+ }), spans.members.set(
619
+ file.digest,
620
+ members.map((chunk) => chunk.digest)
621
+ );
622
+ }
623
+ return spans;
624
+ }
625
+ get size() {
626
+ return this.spans.size;
627
+ }
628
+ locate(digest) {
629
+ return this.spans.get(digest);
630
+ }
631
+ neighbour(digest, step) {
632
+ let span = this.spans.get(digest);
633
+ return span === void 0 ? null : this.members.get(span.file)?.[span.index + step] ?? null;
634
+ }
635
+ runs(digests) {
636
+ let runs = [], current = [], last;
637
+ for (let k = 0; k < digests.length; k++) {
638
+ let span = this.spans.get(digests[k]);
639
+ !(span !== void 0 && last !== void 0 && span.file === last.file && span.index === last.index + 1) && current.length > 0 && (runs.push(current), current = []), current.push(k), last = span;
640
+ }
641
+ return current.length > 0 && runs.push(current), runs;
642
+ }
643
+ };
644
+ function rangedChunks(base, spans, fetcher = fetch) {
645
+ let single = httpChunks(base, fetcher), range = async (digests, signal) => {
646
+ let first = spans.locate(digests[0]), last = spans.locate(digests[digests.length - 1]);
647
+ if (first === void 0 || last === void 0) return Promise.all(digests.map((digest) => single.fetch(digest, signal).catch(() => null)));
648
+ let start = first.offset, end = last.offset + last.size, response = await fetcher(new URL(first.file, base).href, { signal, headers: { Range: `bytes=${start}-${end - 1}` } });
649
+ if (!response.ok) throw new Error(`zone file ${first.file} answered ${response.status}`);
650
+ let whole = new Uint8Array(await response.arrayBuffer()), at = response.status === (206) ? 0 : start;
651
+ if (whole.length < at + end - start) throw new Error(`zone file ${first.file} answered ${whole.length} bytes for ${end - start}`);
652
+ return digests.map((digest) => {
653
+ let span = spans.locate(digest);
654
+ if (span === void 0) return null;
655
+ let from = at + span.offset - start;
656
+ return whole.slice(from, from + span.size);
657
+ });
658
+ };
659
+ return {
660
+ fetch: single.fetch,
661
+ fetchTwin: single.fetchTwin,
662
+ async fetchRun(digests, signal) {
663
+ let out = new Array(digests.length).fill(null);
664
+ return await Promise.all(
665
+ spans.runs(digests).map(async (run) => {
666
+ let bodies = await range(
667
+ run.map((k) => digests[k]),
668
+ signal
669
+ ).catch(() => run.map(() => null));
670
+ run.forEach((k, m) => {
671
+ out[k] = bodies[m];
672
+ });
673
+ })
674
+ ), out;
675
+ }
676
+ };
677
+ }
678
+
679
+ // src/interactives/hosts/webgpu.ts
680
+ var probed = null, probing = null;
681
+ function gpuOf() {
682
+ let gpu = globalThis.navigator?.gpu;
683
+ return gpu !== void 0 && typeof gpu.requestAdapter == "function" ? gpu : null;
684
+ }
685
+ function probeHostWebGpu() {
686
+ if (probing !== null) return probing;
687
+ let gpu = gpuOf();
688
+ return probing = gpu === null ? Promise.resolve(false) : gpu.requestAdapter().then(
689
+ (adapter) => adapter != null,
690
+ () => false
691
+ ), probing.then((found) => {
692
+ probed = found;
693
+ }), probing;
694
+ }
695
+ function hostWebGpu() {
696
+ return probed ?? gpuOf() !== null;
697
+ }
698
+ function forgetHostWebGpu() {
699
+ probed = null, probing = null;
700
+ }
701
+
702
+ // src/interactives/hosts/clips.ts
703
+ var CLIP_CAMERA = "clip_camera", REPLAY_MEDIA_TYPE = "application/vnd.cimplify.replay", CLIP_COMMANDS = /* @__PURE__ */ new Set(["clip_start", "clip_stop", "clip_cancel", "clip_keep", "replay_save"]);
704
+ function isClipCommand(command) {
705
+ return CLIP_COMMANDS.has(command.kind);
706
+ }
707
+ function clipArm(options) {
708
+ return {
709
+ window_ms: options.window_ms ?? chunkGDZT5LZ5_js.DEFAULT_CLIP_ARM.window_ms,
710
+ fps: options.fps ?? chunkGDZT5LZ5_js.DEFAULT_CLIP_ARM.fps,
711
+ video_bits_per_second: options.video_bits_per_second ?? chunkGDZT5LZ5_js.DEFAULT_CLIP_ARM.video_bits_per_second,
712
+ audio: options.audio ?? chunkGDZT5LZ5_js.DEFAULT_CLIP_ARM.audio,
713
+ max_long_edge: options.max_long_edge ?? chunkGDZT5LZ5_js.DEFAULT_CLIP_ARM.max_long_edge
714
+ };
715
+ }
716
+ function keptMs(window_ms, started, now, max_ms) {
717
+ return Math.max(0, Math.min(now - started, max_ms, window_ms));
718
+ }
719
+ function failure(code) {
720
+ return { error: code };
721
+ }
722
+ function replyOf(outcome) {
723
+ return "media" in outcome ? { media_id: outcome.media.media_id } : { error: { code: outcome.error } };
724
+ }
725
+ var HostClips = class {
726
+ constructor(options, interactive_id, consent, now) {
727
+ this.options = options;
728
+ this.interactive_id = interactive_id;
729
+ this.consent = consent;
730
+ this.now = now;
731
+ this.guest = null;
732
+ this.recordings = /* @__PURE__ */ new Map();
733
+ this.nextRecording = 1;
734
+ this.paused = false;
735
+ this.stopConsents = null;
736
+ this.asking = null;
737
+ this.arm = clipArm(options);
738
+ }
739
+ get available() {
740
+ return this.guest !== null;
741
+ }
742
+ attach(guest) {
743
+ if (this.detach(), this.guest = guest, guest === null) return;
744
+ this.paused = false, guest.arm(this.arm), guest.on_camera_live(() => this.update());
745
+ let consents = this.consent?.consents;
746
+ consents !== void 0 && (this.stopConsents = consents.subscribe((interactive_id) => {
747
+ interactive_id === this.interactive_id && this.update();
748
+ })), this.update();
749
+ }
750
+ detach() {
751
+ this.stopConsents?.(), this.stopConsents = null, this.guest?.arm(null), this.guest = null, this.recordings.clear();
752
+ }
753
+ cameraAllowed() {
754
+ return this.consent?.consents.state(this.interactive_id, CLIP_CAMERA) === "granted";
755
+ }
756
+ update() {
757
+ let guest = this.guest;
758
+ if (guest === null) return;
759
+ let paused = guest.camera_live && !this.cameraAllowed();
760
+ paused !== this.paused && (this.paused = paused, guest.pause(paused));
761
+ }
762
+ /** Asks for camera in clips from host chrome; the answer lifts the pause for later saves. */
763
+ askCamera() {
764
+ let consent = this.consent;
765
+ return consent === null ? Promise.resolve(false) : (this.asking ?? (this.asking = consent.controller.requestConsent(CLIP_CAMERA).then((granted) => (consent.consents.decide(this.interactive_id, CLIP_CAMERA, granted), this.asking = null, this.update(), granted))), this.asking);
766
+ }
767
+ async keep(keep_ms) {
768
+ let guest = this.guest;
769
+ if (guest === null) return failure("unavailable");
770
+ if (guest.camera_live && !this.cameraAllowed())
771
+ return this.consent?.consents.state(this.interactive_id, CLIP_CAMERA) === "undecided" && this.askCamera(), failure("camera_consent");
772
+ let saved = await guest.save(Math.min(Math.max(0, keep_ms), this.arm.window_ms));
773
+ return saved === null ? failure("nothing_recorded") : this.upload("video", saved);
774
+ }
775
+ async saveReplay(bytes) {
776
+ let blob = new Blob([bytes], { type: REPLAY_MEDIA_TYPE });
777
+ return this.upload("replay", { blob, type: REPLAY_MEDIA_TYPE, duration_ms: 0, width: 0, height: 0 });
778
+ }
779
+ async upload(kind, saved) {
780
+ try {
781
+ return { media: await this.options.upload({ kind, interactive_id: this.interactive_id, ...saved }) };
782
+ } catch {
783
+ return failure("failed");
784
+ }
785
+ }
786
+ async command(command) {
787
+ switch (command.kind) {
788
+ case "clip_start": {
789
+ let clip = this.nextRecording++;
790
+ return this.recordings.set(clip, { started: this.now(), max_ms: Math.min(Math.max(0, command.max_ms), this.arm.window_ms) }), { clip };
791
+ }
792
+ case "clip_stop": {
793
+ let recording = this.recordings.get(command.clip);
794
+ return recording === void 0 ? { error: { code: "unknown_clip" } } : (this.recordings.delete(command.clip), replyOf(await this.keep(keptMs(this.arm.window_ms, recording.started, this.now(), recording.max_ms))));
795
+ }
796
+ case "clip_cancel":
797
+ return this.recordings.delete(command.clip), null;
798
+ case "clip_keep":
799
+ return replyOf(await this.keep(command.ms));
800
+ case "replay_save":
801
+ return replyOf(await this.saveReplay(chunkJ2KZXIU3_js.decodeBase64(command.replay)));
802
+ }
803
+ }
804
+ };
805
+
806
+ // src/interactives/hosts/web.ts
807
+ var FIRST_FRAME_MILESTONE = "first_frame_scheduled";
808
+ function referable(ref) {
809
+ return typeof ref.payload_digest == "string" && isDigestHex(ref.payload_digest);
810
+ }
811
+ function never() {
812
+ return false;
813
+ }
814
+ var ENGINE_GROUP_PREFIX = "engine:", SINGLE_THREAD_GROUP = "threads:single", ISOLATED_THREAD_GROUP = "threads:isolated", TIER_GROUP_PREFIX = "tier:", DEFAULT_HOST_TIER = "mid", ALTERNATIVE_RUNTIMES = { [chunk4ZDR72SG_js.ENGINE_CORE_THREADS_UNIT]: chunk4ZDR72SG_js.ENGINE_CORE_UNIT };
815
+ function standsInFor(chunk) {
816
+ let name = chunk.runtime?.name;
817
+ return name === void 0 ? null : chunk.asset_group === chunkOIVVQQ22_js.SCRIPTS_CORE_GROUP || chunk.asset_group === chunkI5FOHCLH_js.GL_CORE_GROUP ? name === chunk4ZDR72SG_js.ENGINE_CORE_UNIT ? chunk4ZDR72SG_js.ENGINE_CORE_UNIT : null : chunk.asset_group !== ISOLATED_THREAD_GROUP ? null : ALTERNATIVE_RUNTIMES[name] ?? null;
818
+ }
819
+ function chunksForHost(chunks, engine, isolated = false, tier = DEFAULT_HOST_TIER, threads = false, scripts = chunkOIVVQQ22_js.luauVmRunsHere, webgpu = hostWebGpu()) {
820
+ let skipped = isolated ? SINGLE_THREAD_GROUP : ISOLATED_THREAD_GROUP, tierGroup = `${TIER_GROUP_PREFIX}${tier}`, offers = (group) => chunks.some((chunk) => chunk.asset_group === group && standsInFor(chunk) !== null), scripted = offers(chunkOIVVQQ22_js.SCRIPTS_CORE_GROUP), glCore = !webgpu && offers(chunkI5FOHCLH_js.GL_CORE_GROUP) && (!scripted || scripts()), scriptsCore = !glCore && scripted && scripts(), chosen = (chunk) => chunk.asset_group === chunkI5FOHCLH_js.GL_CORE_GROUP ? glCore : chunk.asset_group === chunkOIVVQQ22_js.SCRIPTS_CORE_GROUP ? scriptsCore : threads && !scriptsCore && !glCore, replaced = /* @__PURE__ */ new Set();
821
+ for (let chunk of chunks) {
822
+ let unit = standsInFor(chunk);
823
+ unit !== null && chosen(chunk) && replaced.add(unit);
824
+ }
825
+ return chunks.filter((chunk) => {
826
+ if (standsInFor(chunk) !== null) return chosen(chunk);
827
+ let runtime = chunk.runtime?.name;
828
+ if (runtime !== void 0 && replaced.has(runtime)) return false;
829
+ let group = chunk.asset_group;
830
+ return group === void 0 ? true : group === skipped ? false : group.startsWith(TIER_GROUP_PREFIX) ? group === tierGroup : group === chunkOIVVQQ22_js.LUAU_SCRIPTS_GROUP ? chunkOIVVQQ22_js.luauVmRunsHere() : group.startsWith(ENGINE_GROUP_PREFIX) ? engine !== null && group === `${ENGINE_GROUP_PREFIX}${engine}` : true;
831
+ });
832
+ }
833
+ var CODE_GROUP = "code";
834
+ function linksBeforeStart(chunk) {
835
+ if (!chunk.before_play) return false;
836
+ if (standsInFor(chunk) !== null) return true;
837
+ let group = chunk.asset_group;
838
+ return group === void 0 || group === CODE_GROUP || group.startsWith(ENGINE_GROUP_PREFIX);
839
+ }
840
+ function swappable(chunk) {
841
+ if (chunk.lazy === true || (chunk.runtime ?? null) !== null || standsInFor(chunk) !== null) return false;
842
+ let group = chunk.asset_group;
843
+ return group === void 0 || !(group.startsWith(ENGINE_GROUP_PREFIX) || group.startsWith(TIER_GROUP_PREFIX) || group === SINGLE_THREAD_GROUP || group === ISOLATED_THREAD_GROUP);
844
+ }
845
+ async function swapInPlace(host, build) {
846
+ if (host === null) return { swapped: false, reason: "the Interactive is not running" };
847
+ let next;
848
+ try {
849
+ next = await build();
850
+ } catch (error) {
851
+ return { swapped: false, reason: error instanceof Error ? error.message : String(error) };
852
+ }
853
+ return !next.ok || next.host !== true || next.chunks === void 0 || next.chunks === null ? { swapped: false, reason: "the new build cannot run here" } : host.hotSwap(next.chunks);
854
+ }
855
+ function hostIsolated() {
856
+ return globalThis.crossOriginIsolated === true;
857
+ }
858
+ function hostThreads() {
859
+ return hostIsolated() && chunkJ2U6PJSO_js.threadsAvailable();
860
+ }
861
+ var DEFAULT_HOST_LIMITS = {
862
+ ping_ms: 250,
863
+ cpu_slice_ms: 2e3,
864
+ memory_bytes: 128 * 1024 * 1024,
865
+ boot_ms: 1e4,
866
+ restarts_per_window: 3,
867
+ restart_window_ms: 6e4
868
+ }, HostFaultError = class extends Error {
869
+ constructor(fault) {
870
+ super(fault.message);
871
+ this.fault = fault;
872
+ this.name = "HostFaultError";
873
+ }
874
+ }, RELAYED_FROM_GUEST = /* @__PURE__ */ new Set([chunk4ZDR72SG_js.MessageTag.request, chunk4ZDR72SG_js.MessageTag.frames]), RELAYED_FROM_SESSION = /* @__PURE__ */ new Set([chunk4ZDR72SG_js.MessageTag.response, chunk4ZDR72SG_js.MessageTag.event, chunk4ZDR72SG_js.MessageTag.frames]), PARTS_SUBSCRIPTION = "sub_host_parts";
875
+ function workerEngines(script) {
876
+ return {
877
+ spawn() {
878
+ let worker = new Worker(script, { type: "module" }), listener = () => {
879
+ };
880
+ return worker.onmessage = (event) => listener(new Uint8Array(event.data)), {
881
+ send(bytes, length) {
882
+ let copy = bytes.slice(0, length);
883
+ worker.postMessage(copy.buffer, [copy.buffer]);
884
+ },
885
+ on_message(next) {
886
+ listener = next;
887
+ },
888
+ on_crash(next) {
889
+ worker.onerror = (event) => {
890
+ event.preventDefault(), next(event.message || "the guest engine stopped");
891
+ };
892
+ },
893
+ terminate() {
894
+ worker.terminate();
895
+ }
896
+ };
897
+ }
898
+ };
899
+ }
900
+ var GuestPool = class {
901
+ constructor(factory, size) {
902
+ this.factory = factory;
903
+ this.size = size;
904
+ this.ready = [];
905
+ this.waiting = [];
906
+ for (let i = 0; i < size; i++) this.warm();
907
+ }
908
+ warm() {
909
+ let engine = this.factory.spawn();
910
+ engine.on_crash(() => {
911
+ engine.terminate(), this.warm();
912
+ }), engine.on_message((bytes) => {
913
+ if (bytes[0] !== chunk4ZDR72SG_js.MessageTag.ready) return;
914
+ engine.on_message(() => {
915
+ });
916
+ let next = this.waiting.shift();
917
+ next !== void 0 ? next(engine) : this.ready.push(engine);
918
+ });
919
+ }
920
+ acquire() {
921
+ this.warm();
922
+ let engine = this.ready.shift();
923
+ return engine !== void 0 ? Promise.resolve(engine) : new Promise((resolve) => this.waiting.push(resolve));
924
+ }
925
+ drain() {
926
+ for (let engine of this.ready) engine.terminate();
927
+ this.ready.length = 0;
928
+ }
929
+ get warmed() {
930
+ return this.ready.length;
931
+ }
932
+ }, TreeStore = class {
933
+ constructor() {
934
+ this.mirror = new chunkGDZT5LZ5_js.TreeMirror();
935
+ this.listeners = /* @__PURE__ */ new Set();
936
+ this.subscribe = (listener) => (this.listeners.add(listener), () => this.listeners.delete(listener));
937
+ this.snapshot = () => this.mirror.root;
938
+ }
939
+ apply(patches) {
940
+ this.mirror.apply(patches);
941
+ for (let listener of this.listeners) listener();
942
+ }
943
+ reset() {
944
+ this.mirror.apply([{ op: "root", node: null }]);
945
+ for (let listener of this.listeners) listener();
946
+ }
947
+ }, WebHost = class {
948
+ constructor(options) {
949
+ this.options = options;
950
+ this.tree = new TreeStore();
951
+ this.writer = new chunk4ZDR72SG_js.MessageWriter();
952
+ this.stepMessage = new Uint8Array(chunk4ZDR72SG_js.TAG_BYTES);
953
+ this.supplying = 0;
954
+ this.ping = new Uint8Array(chunk4ZDR72SG_js.PING_BYTES);
955
+ this.pingView = new DataView(this.ping.buffer);
956
+ this.lifecycleMessage = new Uint8Array(chunk4ZDR72SG_js.LIFECYCLE_BYTES);
957
+ this.partsSequence = 0;
958
+ this.engine = null;
959
+ this.watchdog = null;
960
+ this.pingSequence = 0;
961
+ this.pingSentAt = -1;
962
+ this.restarts = [];
963
+ this.started = null;
964
+ this.failed = null;
965
+ this.phase = "idle";
966
+ this.outlet = { toSession: (bytes, length) => this.options.transport.send(bytes, length) };
967
+ this.networkMessage = new Uint8Array(chunkT7LOXGYX_js.NETWORK_MESSAGE_BYTES);
968
+ this.unwatchNetwork = null;
969
+ this.inspectorMessage = new Uint8Array(chunk4ZDR72SG_js.INSPECTOR_BYTES);
970
+ this.inspectorShown = false;
971
+ this.meterRequest = chunkXK6UDWJS_js.METERS_OFF;
972
+ this.studioOut = new chunkXK6UDWJS_js.StudioSender(chunk4ZDR72SG_js.MessageTag.studio, (frame) => this.engine?.send(frame, frame.length));
973
+ this.hotDone = null;
974
+ options.webgpu === void 0 && probeHostWebGpu(), this.networkHint = options.network === void 0 ? chunkT7LOXGYX_js.webNetworkHint() : options.network, options.network === void 0 && (this.unwatchNetwork = chunkT7LOXGYX_js.watchWebNetwork((hint) => this.setNetwork(hint))), this.limits = { ...DEFAULT_HOST_LIMITS, ...options.limits }, this.studioIn = options.on_studio === void 0 ? null : new chunkXK6UDWJS_js.StudioAssembler();
975
+ let isolated = hostIsolated(), threads = options.threads ?? hostThreads(), webgpu = options.webgpu ?? hostWebGpu();
976
+ this.hosted = (chunks) => chunksForHost(chunks, null, isolated, options.device_tier ?? DEFAULT_HOST_TIER, threads, chunkOIVVQQ22_js.luauVmRunsHere, webgpu);
977
+ let hosted = this.hosted(options.package.chunks);
978
+ this.known = new Set(hosted.map((chunk) => chunk.digest)), this.chunks = hosted.filter((chunk) => chunk.lazy !== true), this.parts = options.part_store === void 0 ? null : options.part_store.session(
979
+ options.hello.program.interactive_id,
980
+ hosted.map((chunk) => ({ digest: chunk.digest, zone: chunk.asset_group ?? chunkOIVVQQ22_js.DEFAULT_PART_ZONE })),
981
+ { keep_on_device: options.package.keep_on_device === true }
982
+ ), this.parts?.on_evicted((eviction) => this.evicted(eviction));
983
+ let upstream = chunkOIVVQQ22_js.twinned(options.chunks, chunkOIVVQQ22_js.twinCaps(options.package.chunks));
984
+ this.source = this.parts === null ? upstream : this.parts.source(upstream);
985
+ let spans = ZoneSpans.of(options.package.chunks, options.package.zone_files ?? []);
986
+ this.afterFirstFrame = hosted.filter((chunk) => chunk.lazy === true && chunk.asset_group === chunkOIVVQQ22_js.LUAU_SCRIPTS_GROUP).map((chunk) => chunk.digest), this.lazyChunks = new LazyChunkServer(hosted.filter((chunk) => chunk.lazy === true), {
987
+ source: this.source,
988
+ budget_bytes: options.lazy_budget_bytes,
989
+ concurrency: options.lazy_concurrency,
990
+ spans: spans.size > 0 ? spans : void 0
991
+ }), this.mediator = options.chrome === void 0 ? null : new HostMediator(options.chrome), this.now = options.now ?? (() => Date.now());
992
+ let chrome = options.chrome;
993
+ this.clips = options.clips === void 0 ? null : new HostClips(options.clips, options.hello.program.interactive_id, chrome === void 0 ? null : { consents: chrome.consents, controller: chrome.controller }, this.now), this.ping[0] = chunk4ZDR72SG_js.MessageTag.ping, this.lifecycleMessage[0] = chunk4ZDR72SG_js.MessageTag.lifecycle, this.inspectorMessage[0] = chunk4ZDR72SG_js.MessageTag.inspector, options.transport.on_message((bytes) => this.fromSession(bytes)), options.transport.on_close((close) => this.fail({ source: "session", message: `${close.reason}${close.detail ? `: ${close.detail}` : ""}` }));
994
+ }
995
+ engineHeap() {
996
+ return chunkO2ICABUD_js.engineHeapFor(this.options.package.engine_heap, this.options.device_tier ?? DEFAULT_HOST_TIER);
997
+ }
998
+ deviceRefusal() {
999
+ let gpu = this.options.gpu, unmet = gpu === void 0 ? null : unmetGpuRequirement(gpu.requirements, gpu.limits);
1000
+ if (unmet !== null) return { source: "device", requirement: unmet, message: `this device's GPU is below the game's ${unmet} requirement` };
1001
+ let features = this.options.engine_features, missing = features === void 0 ? null : chunkOIVVQQ22_js.unmetEngineFeature(features.required, features.available);
1002
+ if (missing !== null) return { source: "device", requirement: missing, message: `this device's engine does not provide ${missing}, which the game uses` };
1003
+ let heap = this.engineHeap();
1004
+ return "refused" in heap ? { source: "device", requirement: chunkO2ICABUD_js.ENGINE_HEAP_REQUIREMENT, message: heap.refused } : null;
1005
+ }
1006
+ async start() {
1007
+ if (this.phase !== "idle" && this.phase !== "crashed") throw new Error(`the host is ${this.phase}`);
1008
+ let refused = this.deviceRefusal();
1009
+ if (refused !== null)
1010
+ throw this.options.on_fault?.(refused), new HostFaultError(refused);
1011
+ this.phase = "booting", this.mediator?.start(this.options.hello.program, this.outlet);
1012
+ let engines = this.options.engines, runtimes = this.options.runtimes, interactive = this.options.hello.program.interactive_id, warm = runtimes === void 0 ? null : await runtimes.take(this.chunks, interactive), pooled = warm !== null || engines instanceof GuestPool, engine = warm?.engine ?? (engines instanceof GuestPool ? await engines.acquire() : engines.spawn(interactive));
1013
+ this.engine = engine;
1014
+ let settled = new Promise((resolve, reject) => {
1015
+ this.started = resolve, this.failed = reject;
1016
+ }), booted = pooled ? Promise.resolve() : this.awaitReady(engine);
1017
+ engine.on_crash((message) => this.fail({ source: "crash", message }));
1018
+ let unstaged = warm === null ? this.chunks : this.chunks.filter((chunk) => !warm.staged.has(chunk.digest)), deferred = engine.may_fetch_wasm === true ? (ref) => referable(ref) && !this.holdsPart(ref.digest) : never, playable = unstaged.filter(linksBeforeStart), eager = playable.filter((ref) => !deferred(ref)), linked = playable.filter(deferred), chunks = this.fetchChunks(eager);
1019
+ chunks.catch(() => {
1020
+ });
1021
+ let following = unstaged.filter((chunk) => !linksBeforeStart(chunk)), followingBodies = following.map((ref) => deferred(ref) ? null : ref.before_play ? this.fetchChunks([ref]) : chunks.then(() => this.fetchChunks([ref])));
1022
+ for (let body of followingBodies) body?.catch(() => {
1023
+ });
1024
+ if (await Promise.race([booted, settled]), this.engine !== engine) return settled;
1025
+ engine.on_message((bytes) => this.fromGuest(bytes)), this.lazyChunks.attach({ deliver: (digest, body) => this.sendChunk(engine, digest, body), send: (bytes, length) => engine.send(bytes, length) }), this.boot(engine);
1026
+ try {
1027
+ let bodies = await Promise.race([chunks, settled.then(() => [])]);
1028
+ if (this.engine !== engine) return settled;
1029
+ for (let i = 0; i < bodies.length; i++) this.sendChunk(engine, eager[i].digest, bodies[i]);
1030
+ for (let ref of linked) await this.deliver(engine, ref);
1031
+ } catch (error) {
1032
+ return this.engine !== engine || this.fail({ source: "package", message: error instanceof Error ? error.message : String(error) }), settled;
1033
+ }
1034
+ return engine.send(this.writer.bytes, this.writer.tag(chunk4ZDR72SG_js.MessageTag.start)), this.clips?.attach(engine.clips ?? null), this.openReplay(engine), this.armWatchdog(), this.streamChunks(engine, following, followingBodies).then(() => this.keepRuntimes(engine, linked)), settled;
1035
+ }
1036
+ holdsPart(digest) {
1037
+ return this.parts !== null && this.options.part_store?.has(digest) === true;
1038
+ }
1039
+ /**
1040
+ * Copies the runtime wasm the guest fetched itself into the shared part store once the start-time
1041
+ * chunks are in, so the next game on this device reads it from the store instead of the network.
1042
+ * Skipped on a metered or data-saver link, where the copy would cost the player a second download.
1043
+ */
1044
+ async keepRuntimes(engine, refs) {
1045
+ let hint = this.networkHint;
1046
+ if (!(this.parts === null || hint !== null && (hint.metered || hint.saver)))
1047
+ for (let ref of refs) {
1048
+ if (this.engine !== engine) return;
1049
+ if (!(!referable(ref) || this.holdsPart(ref.digest)))
1050
+ try {
1051
+ await this.fetchChunks([ref]);
1052
+ } catch {
1053
+ return;
1054
+ }
1055
+ }
1056
+ }
1057
+ async deliver(engine, ref) {
1058
+ if (engine.fetches_wasm === true && referable(ref) && !this.holdsPart(ref.digest)) {
1059
+ let message = chunkOIVVQQ22_js.chunkRefMessage(chunk4ZDR72SG_js.MessageTag.chunk_ref, ref.digest, ref.payload_digest);
1060
+ engine.send(message, message.length);
1061
+ return;
1062
+ }
1063
+ let [bytes] = await this.fetchChunks([ref]);
1064
+ this.engine === engine && this.sendChunk(engine, ref.digest, bytes);
1065
+ }
1066
+ async supply(engine, digest) {
1067
+ let ref = this.chunks.find((chunk) => chunk.digest === digest);
1068
+ if (ref !== void 0) {
1069
+ this.supplying++;
1070
+ try {
1071
+ let [bytes] = await this.fetchChunks([ref]);
1072
+ this.engine === engine && this.sendChunk(engine, digest, bytes);
1073
+ } catch (error) {
1074
+ if (this.engine !== engine) return;
1075
+ this.fail({ source: "package", message: error instanceof Error ? error.message : String(error) });
1076
+ } finally {
1077
+ this.supplying--;
1078
+ }
1079
+ }
1080
+ }
1081
+ async stepWhenSettled(engine, settled) {
1082
+ for (; this.engine === engine && (this.supplying > 0 || this.lazyChunks.pending > 0); ) await new Promise((resolve) => setTimeout(resolve, 0));
1083
+ this.engine === engine && (settled(), this.stepMessage[0] = chunk4ZDR72SG_js.MessageTag.frame_step, engine.send(this.stepMessage, chunk4ZDR72SG_js.TAG_BYTES));
1084
+ }
1085
+ async streamChunks(engine, refs, bodies) {
1086
+ for (let i = 0; i < refs.length; i++)
1087
+ try {
1088
+ let body = bodies[i];
1089
+ if (body === null) {
1090
+ await this.deliver(engine, refs[i]);
1091
+ continue;
1092
+ }
1093
+ let [bytes] = await body;
1094
+ if (this.engine !== engine) return;
1095
+ this.sendChunk(engine, refs[i].digest, bytes);
1096
+ } catch (error) {
1097
+ if (this.engine !== engine) return;
1098
+ this.fail({ source: "package", message: error instanceof Error ? error.message : String(error) });
1099
+ return;
1100
+ }
1101
+ }
1102
+ awaitReady(engine) {
1103
+ return new Promise((resolve) => {
1104
+ let timer = setTimeout(() => this.fail({ source: "watchdog", message: "the guest engine did not start in time" }), this.limits.boot_ms);
1105
+ engine.on_message((bytes) => {
1106
+ bytes[0] === chunk4ZDR72SG_js.MessageTag.ready && (clearTimeout(timer), resolve());
1107
+ });
1108
+ });
1109
+ }
1110
+ boot(engine) {
1111
+ let heap = this.engineHeap(), boot = {
1112
+ program: this.options.hello.program,
1113
+ locale: this.options.locale,
1114
+ clock_offset_ms: this.options.hello.server_time_ms - this.now(),
1115
+ deadline_ms: null,
1116
+ chunk_requests: chunk4ZDR72SG_js.CHUNK_REQUESTS_VERSION,
1117
+ ..."bytes" in heap ? { engine_heap_bytes: heap.bytes } : {},
1118
+ ...this.networkHint === null ? {} : { network: this.networkHint }
1119
+ };
1120
+ engine.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.boot, boot)), this.inspectorShown && this.sendInspector(engine), this.meterRequest.on && engine.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.meters, this.meterRequest)), this.studioIn !== null && (this.studioIn.reset(), this.studioOut.post({ topic: chunkXK6UDWJS_js.STUDIO_GRANT_TOPIC }));
1121
+ }
1122
+ get studio() {
1123
+ return this.studioIn !== null;
1124
+ }
1125
+ sendStudio(message) {
1126
+ if (this.studioIn === null) throw new Error("this host was not opened as a studio viewer");
1127
+ return this.engine === null || this.phase === "disposed" ? false : (this.studioOut.post(message), true);
1128
+ }
1129
+ studioReport(bytes) {
1130
+ let assembler = this.studioIn, deliver = this.options.on_studio;
1131
+ if (assembler === null || deliver === void 0) return;
1132
+ let message;
1133
+ try {
1134
+ message = assembler.accept(bytes);
1135
+ } catch (error) {
1136
+ this.fail({ source: "guest", phase: "run", message: error instanceof Error ? error.message : String(error), stack: null });
1137
+ return;
1138
+ }
1139
+ message !== null && deliver(message);
1140
+ }
1141
+ get inspector() {
1142
+ return this.inspectorShown;
1143
+ }
1144
+ get meters() {
1145
+ return this.meterRequest;
1146
+ }
1147
+ setMeters(request) {
1148
+ this.meterRequest = request;
1149
+ let engine = this.engine;
1150
+ engine === null || this.phase === "disposed" || engine.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.meters, request));
1151
+ }
1152
+ setInspector(shown) {
1153
+ this.inspectorShown = shown;
1154
+ let engine = this.engine;
1155
+ engine === null || this.phase === "disposed" || this.sendInspector(engine);
1156
+ }
1157
+ sendInspector(engine) {
1158
+ this.inspectorMessage[chunk4ZDR72SG_js.TAG_BYTES] = this.inspectorShown ? chunk4ZDR72SG_js.INSPECTOR_SHOWN : chunk4ZDR72SG_js.INSPECTOR_HIDDEN, engine.send(this.inspectorMessage, chunk4ZDR72SG_js.INSPECTOR_BYTES);
1159
+ }
1160
+ get network() {
1161
+ return this.networkHint;
1162
+ }
1163
+ setNetwork(hint) {
1164
+ this.networkHint = hint;
1165
+ let engine = this.engine;
1166
+ engine === null || this.phase === "disposed" || engine.send(this.networkMessage, chunkT7LOXGYX_js.writeNetworkHint(this.networkMessage, chunk4ZDR72SG_js.MessageTag.network, hint));
1167
+ }
1168
+ fetchChunks(refs) {
1169
+ return chunkOIVVQQ22_js.fetchVerified(this.source, refs.map((ref) => ref.digest));
1170
+ }
1171
+ sendChunk(engine, digest, body) {
1172
+ let message = chunkOIVVQQ22_js.chunkMessage(chunk4ZDR72SG_js.MessageTag.chunk, digest, body);
1173
+ engine.send(message, message.length);
1174
+ }
1175
+ armWatchdog() {
1176
+ this.disarmWatchdog(), this.pingSentAt = -1, this.watchdog = setInterval(() => this.tick(), this.limits.ping_ms);
1177
+ }
1178
+ disarmWatchdog() {
1179
+ this.watchdog !== null && clearInterval(this.watchdog), this.watchdog = null;
1180
+ }
1181
+ tick() {
1182
+ let engine = this.engine;
1183
+ if (engine === null) return;
1184
+ let now = this.now();
1185
+ if (this.pingSentAt >= 0) {
1186
+ now - this.pingSentAt > this.limits.cpu_slice_ms && this.fail({ source: "watchdog", message: `the guest ran longer than ${this.limits.cpu_slice_ms} ms without yielding` });
1187
+ return;
1188
+ }
1189
+ this.pingSequence = this.pingSequence + 1 >>> 0, this.pingView.setUint32(1, this.pingSequence, true), this.pingSentAt = now, engine.send(this.ping, chunk4ZDR72SG_js.PING_BYTES);
1190
+ }
1191
+ pong(bytes) {
1192
+ let view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
1193
+ if (view.getUint32(1, true) !== this.pingSequence) return;
1194
+ this.pingSentAt = -1;
1195
+ let heap = view.getFloat64(5, true);
1196
+ heap > this.limits.memory_bytes && this.fail({ source: "memory", message: `the guest heap reached ${heap} bytes, over its ${this.limits.memory_bytes} byte cap` });
1197
+ }
1198
+ fromGuest(bytes) {
1199
+ if (bytes.length > chunk4ZDR72SG_js.BRIDGE_LIMITS.max_message_bytes) {
1200
+ this.fail({ source: "guest", phase: "run", message: "the guest sent an oversized message", stack: null });
1201
+ return;
1202
+ }
1203
+ let tag = bytes[0];
1204
+ if (RELAYED_FROM_GUEST.has(tag)) {
1205
+ if (this.mediator?.fromGuest(bytes) === true) return;
1206
+ this.options.transport.send(bytes, bytes.length);
1207
+ return;
1208
+ }
1209
+ switch (tag) {
1210
+ case chunk4ZDR72SG_js.MessageTag.pong:
1211
+ this.pong(bytes);
1212
+ return;
1213
+ case chunk4ZDR72SG_js.MessageTag.render:
1214
+ if (bytes.length > chunk4ZDR72SG_js.BRIDGE_LIMITS.max_render_bytes) {
1215
+ this.fail({ source: "guest", phase: "render", message: "a tree update exceeded the render budget", stack: null });
1216
+ return;
1217
+ }
1218
+ this.tree.apply(chunk4ZDR72SG_js.readJson(bytes));
1219
+ return;
1220
+ case chunk4ZDR72SG_js.MessageTag.ui_command:
1221
+ this.command(chunk4ZDR72SG_js.readJson(bytes));
1222
+ return;
1223
+ case chunk4ZDR72SG_js.MessageTag.fault:
1224
+ this.fail({ source: "guest", ...chunk4ZDR72SG_js.readJson(bytes) });
1225
+ return;
1226
+ case chunk4ZDR72SG_js.MessageTag.hot_done:
1227
+ this.finishHot(chunk4ZDR72SG_js.readJson(bytes));
1228
+ return;
1229
+ case chunk4ZDR72SG_js.MessageTag.meter_report:
1230
+ this.meterRequest.on && this.options.on_meters?.(chunk4ZDR72SG_js.readJson(bytes));
1231
+ return;
1232
+ case chunk4ZDR72SG_js.MessageTag.studio_report:
1233
+ this.studioReport(bytes);
1234
+ return;
1235
+ case chunk4ZDR72SG_js.MessageTag.started:
1236
+ this.phase = "running", this.started?.(), this.started = null;
1237
+ return;
1238
+ case chunk4ZDR72SG_js.MessageTag.disposed:
1239
+ this.teardown("disposed");
1240
+ return;
1241
+ case chunk4ZDR72SG_js.MessageTag.chunk_request: {
1242
+ let engine = this.engine;
1243
+ if (engine === null) return;
1244
+ let lazy = [];
1245
+ chunk4ZDR72SG_js.forEachChunkEntry(bytes, chunk4ZDR72SG_js.CHUNK_REQUEST_ENTRY_BYTES, (digest, priority) => {
1246
+ this.chunks.some((chunk) => chunk.digest === digest) ? this.supply(engine, digest) : lazy.push([digest, priority]);
1247
+ }), lazy.length > 0 && this.lazyChunks.requestMany(lazy);
1248
+ return;
1249
+ }
1250
+ case chunk4ZDR72SG_js.MessageTag.chunk_release:
1251
+ this.lazyChunks.release(bytes), this.parts !== null && chunk4ZDR72SG_js.forEachChunkEntry(bytes, chunk4ZDR72SG_js.CHUNK_RELEASE_ENTRY_BYTES, (digest) => this.parts?.release(digest));
1252
+ return;
1253
+ case chunk4ZDR72SG_js.MessageTag.milestone: {
1254
+ let name = chunk4ZDR72SG_js.MILESTONE_BY_CODE[bytes[chunk4ZDR72SG_js.TAG_BYTES]] ?? null;
1255
+ if (name === FIRST_FRAME_MILESTONE) for (let digest of this.afterFirstFrame) this.lazyChunks.requestOne(digest, chunk4ZDR72SG_js.ChunkPriority.soon);
1256
+ name !== null && this.options.on_milestone?.(name, this.now());
1257
+ return;
1258
+ }
1259
+ case chunk4ZDR72SG_js.MessageTag.session_complete: {
1260
+ let completion = chunk4ZDR72SG_js.readSessionComplete(bytes);
1261
+ completion !== null && this.options.on_complete?.(completion, this.now());
1262
+ return;
1263
+ }
1264
+ case chunk4ZDR72SG_js.MessageTag.frame_mark: {
1265
+ let engine = this.engine, marked = this.options.on_frame_mark, mark = chunk4ZDR72SG_js.readFrameMark(bytes);
1266
+ if (engine === null || marked === void 0 || mark === null) return;
1267
+ this.stepWhenSettled(engine, () => marked(mark));
1268
+ return;
1269
+ }
1270
+ }
1271
+ }
1272
+ fromSession(bytes) {
1273
+ let engine = this.engine;
1274
+ this.mediator?.fromSession(bytes) !== true && (engine === null || !RELAYED_FROM_SESSION.has(bytes[0]) || engine.send(bytes, bytes.length));
1275
+ }
1276
+ openReplay(engine) {
1277
+ let opened = this.options.replay ?? null;
1278
+ if (opened === null) return;
1279
+ let flags = chunkAABEK6XU_js.replayFlags(opened.bytes);
1280
+ if (flags === null) return;
1281
+ let mode = opened.mode === "play" && flags.play_from_here ? "play" : "watch", message = chunkGDZT5LZ5_js.replayMessage(opened.bytes, mode);
1282
+ engine.send(message, message.length);
1283
+ }
1284
+ get clipsEnabled() {
1285
+ return this.clips !== null;
1286
+ }
1287
+ /** Saves the host's rolling window (the last 15 s by default) and uploads it, or says why it could not. */
1288
+ saveClip(keep_ms) {
1289
+ let clips = this.clips;
1290
+ return clips === null ? Promise.resolve({ error: "unavailable" }) : clips.keep(keep_ms ?? clips.arm.window_ms);
1291
+ }
1292
+ /** Asks the player, in host chrome, whether clips may include the camera while it is on. */
1293
+ askClipCamera() {
1294
+ return this.clips?.askCamera() ?? Promise.resolve(false);
1295
+ }
1296
+ /** Posts a saved clip as a Flick through the session, as the game's own `social.post` would. */
1297
+ async postClip(media, score = null) {
1298
+ let mediator = this.mediator;
1299
+ if (mediator === null) return null;
1300
+ let envelope = await mediator.hostCall("social.post", { kind: "clip", media, score });
1301
+ return envelope.outcome.status === "ok" ? envelope.outcome.response.result : null;
1302
+ }
1303
+ async shareClip(media) {
1304
+ let mediator = this.mediator;
1305
+ if (mediator === null) return null;
1306
+ let envelope = await mediator.hostCall("share.open", { target: { kind: "clip", media }, audience_hint: null });
1307
+ return envelope.outcome.status === "ok" ? envelope.outcome.response.result : null;
1308
+ }
1309
+ async command(message) {
1310
+ let command = message.command, clips = this.clips, value = clips !== null && isClipCommand(command) ? await clips.command(command) : await this.options.on_command?.(command);
1311
+ if (message.id === 0 || this.engine === null) return;
1312
+ let reply = { id: message.id, value: value ?? null };
1313
+ this.engine.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.ui_reply, reply));
1314
+ }
1315
+ grantConsents(granted) {
1316
+ let consent = { granted: [...new Set(granted)] };
1317
+ this.options.transport.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.consent, consent));
1318
+ }
1319
+ evicted(eviction) {
1320
+ if (this.engine === null) return;
1321
+ let envelope = {
1322
+ contract_version: 1,
1323
+ subscription_id: PARTS_SUBSCRIPTION,
1324
+ sequence: ++this.partsSequence,
1325
+ emitted_at: this.now(),
1326
+ event: { family: "parts", event: { kind: "evicted", zone: eviction.zone, parts: eviction.parts, bytes: eviction.bytes, reason: eviction.reason, kept: eviction.kept } }
1327
+ };
1328
+ this.engine.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.event, envelope));
1329
+ }
1330
+ dispatch(event) {
1331
+ this.engine?.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.ui_event, event));
1332
+ }
1333
+ lifecycle(name) {
1334
+ this.engine !== null && (this.lifecycleMessage[1] = chunk4ZDR72SG_js.LifecycleCode[name], this.engine.send(this.lifecycleMessage, chunk4ZDR72SG_js.LIFECYCLE_BYTES));
1335
+ }
1336
+ dispose() {
1337
+ if (this.phase === "disposed") return;
1338
+ if (this.engine === null) {
1339
+ this.teardown("disposed");
1340
+ return;
1341
+ }
1342
+ this.lifecycle("dispose");
1343
+ let engine = this.engine;
1344
+ setTimeout(() => {
1345
+ this.engine === engine && this.teardown("disposed");
1346
+ }, this.limits.ping_ms);
1347
+ }
1348
+ async hotSwap(chunks) {
1349
+ let engine = this.engine;
1350
+ if (engine === null || this.phase !== "running") return { swapped: false, reason: "the Interactive is not running" };
1351
+ if (this.hotDone !== null) return { swapped: false, reason: "a swap is already in progress" };
1352
+ let unseen = this.hosted(chunks).filter((chunk) => !this.known.has(chunk.digest)), fresh = unseen.filter((chunk) => swappable(chunk));
1353
+ if (fresh.length !== unseen.length) return { swapped: false, reason: "more than the code and assets changed" };
1354
+ if (fresh.length === 0) return { swapped: false, reason: "no code changed" };
1355
+ let bodies;
1356
+ try {
1357
+ bodies = await this.fetchChunks(fresh);
1358
+ } catch (error) {
1359
+ return { swapped: false, reason: error instanceof Error ? error.message : String(error) };
1360
+ }
1361
+ if (this.engine !== engine) return { swapped: false, reason: "the Interactive stopped" };
1362
+ for (let i = 0; i < fresh.length; i++)
1363
+ this.sendChunk(engine, fresh[i].digest, bodies[i]), this.chunks.push(fresh[i]), this.known.add(fresh[i].digest);
1364
+ let result = new Promise((resolve) => {
1365
+ this.hotDone = resolve;
1366
+ }), request = { chunks: fresh.map((chunk) => chunk.digest) };
1367
+ return engine.send(this.writer.bytes, this.writer.json(chunk4ZDR72SG_js.MessageTag.hot, request)), result;
1368
+ }
1369
+ finishHot(result) {
1370
+ let done = this.hotDone;
1371
+ this.hotDone = null, done?.(result);
1372
+ }
1373
+ async restart() {
1374
+ let now = this.now();
1375
+ if (this.restarts = this.restarts.filter((at) => now - at < this.limits.restart_window_ms), this.restarts.length >= this.limits.restarts_per_window)
1376
+ throw new Error("the Interactive crashed too often to restart");
1377
+ return this.restarts.push(now), this.tree.reset(), this.phase = "crashed", this.start();
1378
+ }
1379
+ fail(fault) {
1380
+ if (this.phase !== "disposed") {
1381
+ if (this.options.on_fault?.(fault), fault.source === "session")
1382
+ this.teardown("disposed");
1383
+ else {
1384
+ if (fault.source === "guest" && fault.phase === "run")
1385
+ return;
1386
+ this.teardown("crashed");
1387
+ }
1388
+ this.failed?.(new HostFaultError(fault)), this.failed = null, this.started = null;
1389
+ }
1390
+ }
1391
+ teardown(phase) {
1392
+ this.finishHot({ swapped: false, reason: "the Interactive stopped" }), this.lazyChunks.attach(null), this.parts?.close(), this.clips?.detach(), this.disarmWatchdog(), this.engine?.terminate(), this.engine = null, this.phase = phase, phase === "disposed" && (this.unwatchNetwork?.(), this.unwatchNetwork = null, this.options.runtimes?.warm(this.chunks), this.mediator?.stop(), this.options.chrome?.controller.dismissAll(), this.options.transport.close());
1393
+ }
1394
+ };
1395
+
1396
+ exports.ALTERNATIVE_RUNTIMES = ALTERNATIVE_RUNTIMES;
1397
+ exports.CLIP_CAMERA = CLIP_CAMERA;
1398
+ exports.DEFAULT_HOST_LIMITS = DEFAULT_HOST_LIMITS;
1399
+ exports.DEFAULT_HOST_TIER = DEFAULT_HOST_TIER;
1400
+ exports.DEFAULT_LAZY_BUDGET_BYTES = DEFAULT_LAZY_BUDGET_BYTES;
1401
+ exports.DEFAULT_LAZY_CONCURRENCY = (4);
1402
+ exports.ENGINE_GROUP_PREFIX = ENGINE_GROUP_PREFIX;
1403
+ exports.GPU_REQUIREMENT_NAMES = GPU_REQUIREMENT_NAMES;
1404
+ exports.GuestPool = GuestPool;
1405
+ exports.HOST_PAGE_ISOLATION_HEADERS = HOST_PAGE_ISOLATION_HEADERS;
1406
+ exports.HostClips = HostClips;
1407
+ exports.HostFaultError = HostFaultError;
1408
+ exports.HostMediator = HostMediator;
1409
+ exports.ISOLATED_THREAD_GROUP = ISOLATED_THREAD_GROUP;
1410
+ exports.JOINED_PARTS_PARAM = JOINED_PARTS_PARAM;
1411
+ exports.JOINED_PART_SEPARATOR = JOINED_PART_SEPARATOR;
1412
+ exports.JOINED_PREFIX = JOINED_PREFIX;
1413
+ exports.LazyChunkServer = LazyChunkServer;
1414
+ exports.MAX_JOINED_PARTS = (16);
1415
+ exports.REPLAY_MEDIA_TYPE = REPLAY_MEDIA_TYPE;
1416
+ exports.RUNTIME_PREFIX = RUNTIME_PREFIX;
1417
+ exports.RUNTIME_SUFFIX = RUNTIME_SUFFIX;
1418
+ exports.SHELL_PREFIX = SHELL_PREFIX;
1419
+ exports.SINGLE_THREAD_GROUP = SINGLE_THREAD_GROUP;
1420
+ exports.TIER_GROUP_PREFIX = TIER_GROUP_PREFIX;
1421
+ exports.TreeStore = TreeStore;
1422
+ exports.WASM_PREFIX = WASM_PREFIX;
1423
+ exports.WASM_SUFFIX = WASM_SUFFIX;
1424
+ exports.WebHost = WebHost;
1425
+ exports.ZoneSpans = ZoneSpans;
1426
+ exports.chunksForHost = chunksForHost;
1427
+ exports.deviceGpuLimits = deviceGpuLimits;
1428
+ exports.fetchTwin = fetchTwin;
1429
+ exports.forgetHostWebGpu = forgetHostWebGpu;
1430
+ exports.guestOrigin = guestOrigin;
1431
+ exports.hostIsolated = hostIsolated;
1432
+ exports.hostThreads = hostThreads;
1433
+ exports.hostWebGpu = hostWebGpu;
1434
+ exports.httpChunks = httpChunks;
1435
+ exports.interactiveLabel = interactiveLabel;
1436
+ exports.isDigestHex = isDigestHex;
1437
+ exports.linksBeforeStart = linksBeforeStart;
1438
+ exports.manifestGpuRequirements = manifestGpuRequirements;
1439
+ exports.openSession = openSession;
1440
+ exports.parseContentOrigin = parseContentOrigin;
1441
+ exports.probeHostWebGpu = probeHostWebGpu;
1442
+ exports.rangedChunks = rangedChunks;
1443
+ exports.referable = referable;
1444
+ exports.runtimePath = runtimePath;
1445
+ exports.servesContent = servesContent;
1446
+ exports.sessionUrl = sessionUrl;
1447
+ exports.sha256Hex = sha256Hex;
1448
+ exports.shellPath = shellPath;
1449
+ exports.sri = sri;
1450
+ exports.swapInPlace = swapInPlace;
1451
+ exports.swappable = swappable;
1452
+ exports.unmetGpuRequirement = unmetGpuRequirement;
1453
+ exports.workerEngines = workerEngines;