@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,906 @@
1
+ import { RoomClient } from './chunk-M5EXQZYY.mjs';
2
+
3
+ // src/interactives/worlds/protocol.ts
4
+ var NO_BUILDER = 65535, QUATERNION_SCALE = 32767, SCALE_UNIT_PERMILLE = 1e3, MILLIMETRES_PER_METRE = 1e3, WORLD_EXTENT_MM = 255996, CENTIDEGREES_PER_TURN = 36e3, Action = {
5
+ Place: 22273,
6
+ Select: 22274,
7
+ ClearSelection: 22275,
8
+ TransformSelection: 22276,
9
+ SetTransform: 22277,
10
+ DuplicateSelection: 22278,
11
+ DeleteSelection: 22279,
12
+ Undo: 22280,
13
+ Redo: 22281,
14
+ Settings: 22282,
15
+ Moderate: 22283,
16
+ ShareCopy: 22284,
17
+ JoinCopy: 22285,
18
+ Clock: 22286
19
+ }, MessageKind = {
20
+ Upsert: 1,
21
+ Remove: 2,
22
+ Result: 3,
23
+ Durable: 4,
24
+ Settings: 5,
25
+ Begin: 6,
26
+ End: 7,
27
+ Lock: 8,
28
+ Welcome: 9,
29
+ Author: 10,
30
+ Palette: 11,
31
+ Shared: 12,
32
+ Notice: 13,
33
+ Clock: 14
34
+ }, Status = {
35
+ Applied: 0,
36
+ Denied: 1,
37
+ Invalid: 2,
38
+ Conflict: 3,
39
+ Limit: 4,
40
+ Unlicensed: 5,
41
+ Nothing: 6,
42
+ Full: 7,
43
+ UnknownCode: 8,
44
+ Muted: 9
45
+ }, Notice = {
46
+ Kicked: 0,
47
+ Banned: 1,
48
+ Muted: 2,
49
+ Unmuted: 3,
50
+ RoleChanged: 4,
51
+ Moved: 5
52
+ }, SNAP_GRID = 1, SNAP_SURFACE = 2, SelectMode = { Replace: 0, Add: 1, Remove: 2 }, Sanction = { Kick: 0, Mute: 1, Unmute: 2, Ban: 3 }, WorldRoleCode = { Visitor: 0, Builder: 1, CoBuilder: 2, Moderator: 3, Owner: 4 }, Sky = { Clear: 0, Sunset: 1, Overcast: 2, Night: 3 }, Ground = { Grass: 0, Sand: 1, Concrete: 2, Water: 3 }, Lighting = { Day: 0, GoldenHour: 1, Night: 2 }, Visibility = { Private: 0, Friends: 1, Unlisted: 2, Public: 3 }, Likeness = { Fictional: 0, OptedIn: 1, Unclaimed: 2, Landmark: 3 }, POSITION = 0, ROTATION = 3, SCALE = 7, TRANSFORM_WORDS = 10;
53
+ function identityTransform(out = new Float64Array((10))) {
54
+ return out[0] = 0, out[1] = 0, out[2] = 0, out[3] = 0, out[4] = 0, out[5] = 0, out[6] = 32767, out[7] = 1e3, out[8] = 1e3, out[9] = 1e3, out;
55
+ }
56
+ var LITTLE = true, U8 = 1, U16 = 2, U32 = 4, OP_ID_BYTES = 4, MAX_TEXT_BYTES = 255, UTF8 = new TextEncoder(), CommandWriter = class {
57
+ constructor(capacity = 256) {
58
+ this.offset = 0;
59
+ this.bytes = new Uint8Array(capacity), this.view = new DataView(this.bytes.buffer);
60
+ }
61
+ get length() {
62
+ return this.offset;
63
+ }
64
+ begin(opId) {
65
+ return this.offset = 0, this.u32(opId);
66
+ }
67
+ u8(value) {
68
+ return this.view.setUint8(this.offset, value), this.offset += (1), this;
69
+ }
70
+ u16(value) {
71
+ return this.view.setUint16(this.offset, value, (true)), this.offset += (2), this;
72
+ }
73
+ i16(value) {
74
+ return this.view.setInt16(this.offset, value, (true)), this.offset += (2), this;
75
+ }
76
+ u32(value) {
77
+ return this.view.setUint32(this.offset, value >>> 0, (true)), this.offset += (4), this;
78
+ }
79
+ i32(value) {
80
+ return this.view.setInt32(this.offset, value | 0, (true)), this.offset += (4), this;
81
+ }
82
+ transform(t) {
83
+ return this.i32(t[(0)]).i32(t[(0) + 1]).i32(t[(0) + 2]), this.i16(t[(3)]).i16(t[(3) + 1]).i16(t[(3) + 2]).i16(t[(3) + 3]), this.u16(t[(7)]).u16(t[(7) + 1]).u16(t[(7) + 2]);
84
+ }
85
+ text(text) {
86
+ let start = this.offset + (1), end = Math.min(start + (255), this.bytes.length), written = UTF8.encodeInto(text, this.bytes.subarray(start, end)).written;
87
+ return this.u8(written), this.offset += written, this;
88
+ }
89
+ };
90
+ function encodePlace(w, opId, item, snap, transform) {
91
+ return w.begin(opId).u16(item).u8(snap).u8(0).transform(transform).length;
92
+ }
93
+ function encodeSelect(w, opId, mode, ids, count) {
94
+ let n = Math.min(count, 62);
95
+ w.begin(opId).u8(mode).u8(n);
96
+ for (let i = 0; i < n; i++) w.u32(ids[i]);
97
+ return w.length;
98
+ }
99
+ function encodeBare(w, opId) {
100
+ return w.begin(opId).length;
101
+ }
102
+ function encodeTransformSelection(w, opId, snap, dx, dy, dz, rotation, scalePermille) {
103
+ return w.begin(opId).u8(snap).u8(0).i32(dx).i32(dy).i32(dz), w.i16(rotation[0]).i16(rotation[1]).i16(rotation[2]).i16(rotation[3]), w.u16(scalePermille).length;
104
+ }
105
+ function encodeSetTransform(w, opId, id, snap, transform) {
106
+ return w.begin(opId).u32(id).u8(snap).u8(0).transform(transform).length;
107
+ }
108
+ function encodeDuplicate(w, opId, dx, dy, dz) {
109
+ return w.begin(opId).i32(dx).i32(dy).i32(dz).length;
110
+ }
111
+ function encodeSettings(w, opId, s) {
112
+ return w.begin(opId).u8(s.sky).u8(s.ground).u8(s.lighting).u8(s.visibility).u32(s.gridMm).u16(s.angleStepCentidegrees).length;
113
+ }
114
+ function encodeModerate(w, opId, target, sanction, durationS) {
115
+ return w.begin(opId).u8(sanction).u32(durationS).text(target).length;
116
+ }
117
+ function encodeJoinCopy(w, opId, code) {
118
+ return w.begin(opId).u32(code).length;
119
+ }
120
+ function encodeClock(w, opId, scalePermille, historyRatePermille, paused) {
121
+ return w.begin(opId).u32(scalePermille).u32(historyRatePermille).u8(paused ? 1 : 0).length;
122
+ }
123
+ var COMMAND_OP_ID_BYTES = (4);
124
+ function yawRotation(radians, out, offset = (3)) {
125
+ let half = radians / 2, s = Math.sin(half), c = Math.cos(half), sign = c < 0 ? -1 : 1;
126
+ return out[offset] = 0, out[offset + 1] = Math.round(s * sign * 32767), out[offset + 2] = 0, out[offset + 3] = Math.round(c * sign * 32767), out;
127
+ }
128
+
129
+ // src/interactives/worlds/transform.ts
130
+ var BOUNDS_MIN = 0, BOUNDS_MAX = 3, BOUNDS_WORDS = 6, AXES = 3, QUAT = 4, EPSILON = 11920929e-14, MAX_U16 = 65535, TAU = Math.PI * 2, q = new Float64Array((4)), qd = new Float64Array((4)), qc = new Float64Array((4)), v = new Float64Array((3)), r = new Float64Array((3)), scaled = new Float64Array((3)), centre = new Float64Array((3)), absM = new Float64Array((3) * (3));
131
+ function normalise(out) {
132
+ let length = Math.sqrt(out[0] * out[0] + out[1] * out[1] + out[2] * out[2] + out[3] * out[3]);
133
+ if (length <= (11920929e-14)) {
134
+ out[0] = 0, out[1] = 0, out[2] = 0, out[3] = 1;
135
+ return;
136
+ }
137
+ for (let i = 0; i < (4); i++) out[i] /= length;
138
+ }
139
+ function quatOf(t, offset, out) {
140
+ for (let i = 0; i < (4); i++) out[i] = t[offset + i] / 32767;
141
+ normalise(out);
142
+ }
143
+ function quantise(src, out, offset) {
144
+ normalise(src);
145
+ let sign = src[3] < 0 ? -1 : 1;
146
+ for (let i = 0; i < (4); i++) out[offset + i] = Math.round(src[i] * sign * 32767);
147
+ }
148
+ function rotate(quat, vec, out) {
149
+ let ux = quat[0], uy = quat[1], uz = quat[2], s = quat[3], dotUv = ux * vec[0] + uy * vec[1] + uz * vec[2], dotUu = ux * ux + uy * uy + uz * uz, cx = uy * vec[2] - uz * vec[1], cy = uz * vec[0] - ux * vec[2], cz = ux * vec[1] - uy * vec[0], k = s * s - dotUu;
150
+ out[0] = 2 * dotUv * ux + k * vec[0] + 2 * s * cx, out[1] = 2 * dotUv * uy + k * vec[1] + 2 * s * cy, out[2] = 2 * dotUv * uz + k * vec[2] + 2 * s * cz;
151
+ }
152
+ function multiply(a, b, out) {
153
+ let x = a[3] * b[0] + a[0] * b[3] + a[1] * b[2] - a[2] * b[1], y = a[3] * b[1] - a[0] * b[2] + a[1] * b[3] + a[2] * b[0], z = a[3] * b[2] + a[0] * b[1] - a[1] * b[0] + a[2] * b[3], w = a[3] * b[3] - a[0] * b[0] - a[1] * b[1] - a[2] * b[2];
154
+ out[0] = x, out[1] = y, out[2] = z, out[3] = w;
155
+ }
156
+ function canonical(t) {
157
+ quatOf(t, (3), q), quantise(q, t, (3));
158
+ for (let i = 0; i < (3); i++) t[(7) + i] = Math.max(1, t[(7) + i]);
159
+ return t;
160
+ }
161
+ function bounds(t, offset, halfExtentsMm, halfOffset, out) {
162
+ quatOf(t, offset + (3), q);
163
+ for (let a = 0; a < (3); a++) scaled[a] = halfExtentsMm[halfOffset + a] * t[offset + (7) + a] / 1e3;
164
+ v[0] = 0, v[1] = scaled[1], v[2] = 0, rotate(q, v, centre);
165
+ for (let column = 0; column < (3); column++) {
166
+ v[0] = column === 0 ? 1 : 0, v[1] = column === 1 ? 1 : 0, v[2] = column === 2 ? 1 : 0, rotate(q, v, r);
167
+ for (let row = 0; row < (3); row++) absM[row * (3) + column] = Math.abs(r[row]);
168
+ }
169
+ for (let row = 0; row < (3); row++) {
170
+ let reach = absM[row * (3)] * scaled[0] + absM[row * (3) + 1] * scaled[1] + absM[row * (3) + 2] * scaled[2], c = t[offset + (0) + row] + centre[row];
171
+ out[(0) + row] = c - reach, out[(3) + row] = c + reach;
172
+ }
173
+ return out;
174
+ }
175
+ function overlapsFootprint(a, b) {
176
+ return a[(0)] < b[(3)] && a[(3)] > b[(0)] && a[(0) + 2] < b[(3) + 2] && a[(3) + 2] > b[(0) + 2];
177
+ }
178
+ function divEuclid(value, step) {
179
+ return Math.floor(value / step);
180
+ }
181
+ function snappedToGrid(t, gridMm, angleStepCentidegrees) {
182
+ if (gridMm > 0) {
183
+ let half = Math.trunc(gridMm / 2);
184
+ t[(0)] = divEuclid(t[(0)] + half, gridMm) * gridMm, t[(0) + 2] = divEuclid(t[(0) + 2] + half, gridMm) * gridMm;
185
+ }
186
+ if (angleStepCentidegrees > 0) {
187
+ let step = angleStepCentidegrees / 36e3 * TAU;
188
+ quatOf(t, (3), q);
189
+ let siny = 2 * (q[3] * q[1] + q[0] * q[2]), cosy = 1 - 2 * (q[1] * q[1] + q[2] * q[2]), half = Math.round(Math.atan2(siny, cosy) / step) * step * 0.5;
190
+ qc[0] = 0, qc[1] = Math.sin(half), qc[2] = 0, qc[3] = Math.cos(half), quantise(qc, t, (3));
191
+ }
192
+ return t;
193
+ }
194
+ function snapHeightToGrid(t, gridMm) {
195
+ gridMm <= 0 || (t[(0) + 1] = divEuclid(t[(0) + 1] + Math.trunc(gridMm / 2), gridMm) * gridMm);
196
+ }
197
+ function movedAbout(t, pivotX, pivotY, pivotZ, dx, dy, dz, rotation, scalePermille, out) {
198
+ quatOf(rotation, 0, qd);
199
+ let factor = Math.max(1, scalePermille) / 1e3;
200
+ v[0] = (t[(0)] - pivotX) * factor, v[1] = (t[(0) + 1] - pivotY) * factor, v[2] = (t[(0) + 2] - pivotZ) * factor, rotate(qd, v, r), out[(0)] = Math.round(pivotX + r[0] + dx), out[(0) + 1] = Math.round(pivotY + r[1] + dy), out[(0) + 2] = Math.round(pivotZ + r[2] + dz), quatOf(t, (3), q), multiply(qd, q, qc), quantise(qc, out, (3));
201
+ for (let a = 0; a < (3); a++) out[(7) + a] = Math.min((65535), Math.max(1, Math.round(t[(7) + a] * factor)));
202
+ return out;
203
+ }
204
+ function withinWorld(t) {
205
+ let x = t[(0)], y = t[(0) + 1], z = t[(0) + 2];
206
+ return x >= 0 && x <= 255996 && z >= 0 && z <= 255996 && y >= -1e6 && y <= 1e6;
207
+ }
208
+ function copyTransform(src, srcOffset, out, outOffset = 0) {
209
+ for (let i = 0; i < (10); i++) out[outOffset + i] = src[srcOffset + i];
210
+ return out;
211
+ }
212
+
213
+ // src/interactives/worlds/mirror.ts
214
+ var LITTLE2 = true, NO_ROW = -1, INITIAL_ROWS = 1024, INITIAL_IDS = 4096, INITIAL_PALETTE = 64, RESULT_RING = 64, SHARED_RING = 8, AXES2 = 3, FNV_OFFSET_HI = 3421674724, FNV_OFFSET_LO = 2216829733, FNV_PRIME_LOW = 435, FNV_PRIME_SHIFT = 8, TWO_32 = 4294967296, HEX_WORD = 8, HEX_RADIX = 16, DEFAULT_HALF_EXTENT_MM = 500, UTF82 = new TextDecoder();
215
+ function grown(array, length, fill = 0) {
216
+ let next = new array.constructor(length);
217
+ return next.set(array), fill !== 0 && next.fill(fill, array.length), next;
218
+ }
219
+ var WorldMirror = class {
220
+ constructor() {
221
+ this.ids = new Uint32Array((1024));
222
+ this.revisions = new Uint32Array((1024));
223
+ this.items = new Uint16Array((1024));
224
+ this.authorsOf = new Uint32Array((1024));
225
+ this.transforms = new Float64Array((1024) * (10));
226
+ this.locks = new Uint16Array((1024));
227
+ this.count = 0;
228
+ this.version = 0;
229
+ this.rowById = new Int32Array((4096)).fill((-1));
230
+ this.tombstones = new Uint32Array((4096));
231
+ this.paletteItems = [];
232
+ this.paletteHalfExtents = new Float64Array((64) * (3));
233
+ this.paletteLicence = new Uint8Array((64));
234
+ this.paletteLikeness = new Uint8Array((64));
235
+ this.authors = [];
236
+ this.results = Array.from({ length: (64) }, () => ({ opId: 0, status: 0, affected: 0, conflicts: 0, appliedThrough: 0 }));
237
+ this.resultCount = 0;
238
+ this.sharedCodes = new Uint32Array((8));
239
+ this.sharedCount = 0;
240
+ this.notices = new Uint8Array((64));
241
+ this.noticeCount = 0;
242
+ this.settings = {
243
+ sky: 0,
244
+ ground: 0,
245
+ lighting: 0,
246
+ visibility: 0,
247
+ gridMm: 500,
248
+ angleStepCentidegrees: 1500
249
+ };
250
+ this.clock = { simMs: 0, scalePermille: 0, historyRatePermille: 0, dilationPermille: 0, paused: false };
251
+ this.hasSettings = false;
252
+ this.hasClock = false;
253
+ this.durableThrough = 0;
254
+ this.streamed = false;
255
+ this.builder = 65535;
256
+ this.role = -1;
257
+ this.muted = false;
258
+ this.copy = -1;
259
+ this.capacity = 0;
260
+ this.malformed = 0;
261
+ this.frames = 0;
262
+ this.scratchBounds = new Float64Array((6));
263
+ }
264
+ deliver(slot, _sender, view, offset, length) {
265
+ slot === 63 && this.apply(view, offset, length);
266
+ }
267
+ applyBytes(bytes) {
268
+ this.apply(new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), 0, bytes.byteLength);
269
+ }
270
+ apply(view, offset, length) {
271
+ this.frames++;
272
+ let end = offset + length, at = offset;
273
+ for (; at < end; ) {
274
+ let next = this.message(view, at, end);
275
+ if (next < 0) {
276
+ this.malformed++;
277
+ return;
278
+ }
279
+ at = next;
280
+ }
281
+ }
282
+ rowOf(id) {
283
+ return id < this.rowById.length ? this.rowById[id] : (-1);
284
+ }
285
+ knownRevision(id) {
286
+ let row = this.rowOf(id);
287
+ return row !== (-1) ? this.revisions[row] : id < this.tombstones.length ? this.tombstones[id] : 0;
288
+ }
289
+ get lastResult() {
290
+ return this.resultCount === 0 ? null : this.results[(this.resultCount - 1) % (64)];
291
+ }
292
+ resultFor(opId) {
293
+ let available = Math.min(this.resultCount, (64));
294
+ for (let i = 1; i <= available; i++) {
295
+ let result = this.results[(this.resultCount - i) % (64)];
296
+ if (result.opId === opId) return result;
297
+ }
298
+ return null;
299
+ }
300
+ get lastSharedCode() {
301
+ return this.sharedCount === 0 ? 0 : this.sharedCodes[(this.sharedCount - 1) % (8)];
302
+ }
303
+ get lastNotice() {
304
+ return this.noticeCount === 0 ? -1 : this.notices[(this.noticeCount - 1) % (64)];
305
+ }
306
+ halfExtents(item, out, offset = 0) {
307
+ let known = item < this.paletteItems.length;
308
+ for (let a = 0; a < (3); a++) out[offset + a] = known ? this.paletteHalfExtents[item * (3) + a] : (500);
309
+ return out;
310
+ }
311
+ surfaceHeight(footprint, ignore, ignoreCount) {
312
+ let top = 0, half = this.scratchBounds;
313
+ for (let row = 0; row < this.count; row++) {
314
+ let id = this.ids[row], skip = false;
315
+ for (let i = 0; i < ignoreCount && !skip; i++) skip = ignore[i] === id;
316
+ if (skip) continue;
317
+ this.halfExtents(this.items[row], half, 0);
318
+ let b = bounds(this.transforms, row * (10), half, 0, BOX);
319
+ overlapsFootprint(b, footprint) && (top = Math.max(top, b[(3) + 1]));
320
+ }
321
+ return top;
322
+ }
323
+ digest() {
324
+ let order = new Uint32Array(this.count);
325
+ for (let row = 0; row < this.count; row++) order[row] = this.ids[row];
326
+ order.sort();
327
+ let hi = (3421674724), lo = (2216829733), mix = (value) => {
328
+ lo = (lo ^ value >>> 0) >>> 0;
329
+ let low = lo * (435), carry = Math.floor(low / (4294967296)), nextHi = (hi * (435) + carry + (lo << (8) >>> 0)) % (4294967296);
330
+ lo = low % (4294967296), hi = nextHi;
331
+ };
332
+ for (let i = 0; i < order.length; i++) {
333
+ let row = this.rowById[order[i]], t = row * (10);
334
+ mix(this.ids[row]), mix(this.revisions[row]), mix(this.items[row]), mix(this.transforms[t] | 0), mix(this.transforms[t + 1] | 0), mix(this.transforms[t + 2] | 0);
335
+ }
336
+ return hi.toString((16)).padStart((8), "0") + lo.toString((16)).padStart((8), "0");
337
+ }
338
+ ensureId(id) {
339
+ if (id < this.rowById.length) return;
340
+ let length = this.rowById.length;
341
+ for (; length <= id; ) length *= 2;
342
+ this.rowById = grown(this.rowById, length, (-1)), this.tombstones = grown(this.tombstones, length);
343
+ }
344
+ ensureRows(rows) {
345
+ if (rows <= this.ids.length) return;
346
+ let length = Math.max(rows, this.ids.length * 2);
347
+ this.ids = grown(this.ids, length), this.revisions = grown(this.revisions, length), this.items = grown(this.items, length), this.authorsOf = grown(this.authorsOf, length), this.locks = grown(this.locks, length), this.transforms = grown(this.transforms, length * (10));
348
+ }
349
+ ensurePalette(index) {
350
+ if (index < this.paletteLicence.length) return;
351
+ let length = this.paletteLicence.length;
352
+ for (; length <= index; ) length *= 2;
353
+ this.paletteHalfExtents = grown(this.paletteHalfExtents, length * (3)), this.paletteLicence = grown(this.paletteLicence, length), this.paletteLikeness = grown(this.paletteLikeness, length);
354
+ }
355
+ upsert(view, at) {
356
+ let id = view.getUint32(at, (true)), revision = view.getUint32(at + 4, (true));
357
+ if (this.ensureId(id), this.tombstones[id] !== 0 && this.tombstones[id] >= revision) return;
358
+ let row = this.rowById[id];
359
+ if (row !== (-1) && this.revisions[row] > revision) return;
360
+ row === (-1) && (this.ensureRows(this.count + 1), row = this.count++, this.rowById[id] = row), this.ids[row] = id, this.revisions[row] = revision, this.items[row] = view.getUint16(at + 8, (true)), this.authorsOf[row] = view.getUint32(at + 10, (true));
361
+ let t = row * (10), p = at + 14, transforms = this.transforms;
362
+ transforms[t] = view.getInt32(p, (true)), transforms[t + 1] = view.getInt32(p + 4, (true)), transforms[t + 2] = view.getInt32(p + 8, (true)), transforms[t + 3] = view.getInt16(p + 12, (true)), transforms[t + 4] = view.getInt16(p + 14, (true)), transforms[t + 5] = view.getInt16(p + 16, (true)), transforms[t + 6] = view.getInt16(p + 18, (true)), transforms[t + 7] = view.getUint16(p + 20, (true)), transforms[t + 8] = view.getUint16(p + 22, (true)), transforms[t + 9] = view.getUint16(p + 24, (true)), this.locks[row] = view.getUint16(at + 40, (true)), this.version++;
363
+ }
364
+ remove(id, revision) {
365
+ this.ensureId(id);
366
+ let row = this.rowById[id];
367
+ if (row !== (-1) && this.revisions[row] >= revision || (this.tombstones[id] = revision, row === (-1))) return;
368
+ let last = this.count - 1;
369
+ if (row !== last) {
370
+ let lastId = this.ids[last];
371
+ this.ids[row] = lastId, this.revisions[row] = this.revisions[last], this.items[row] = this.items[last], this.authorsOf[row] = this.authorsOf[last], this.locks[row] = this.locks[last], this.transforms.copyWithin(row * (10), last * (10), last * (10) + (10)), this.rowById[lastId] = row;
372
+ }
373
+ this.rowById[id] = (-1), this.count = last, this.version++;
374
+ }
375
+ text(view, at, end) {
376
+ let length = view.getUint8(at);
377
+ return at + 1 + length > end ? null : UTF82.decode(new Uint8Array(view.buffer, view.byteOffset + at + 1, length));
378
+ }
379
+ message(view, at, end) {
380
+ let kind = view.getUint8(at), body = at + 1;
381
+ switch (kind) {
382
+ case MessageKind.Upsert:
383
+ return body + (42) > end ? -1 : (this.upsert(view, body), body + (42));
384
+ case MessageKind.Remove:
385
+ return body + (8) > end ? -1 : (this.remove(view.getUint32(body, (true)), view.getUint32(body + 4, (true))), body + (8));
386
+ case MessageKind.Result: {
387
+ if (body + (17) > end) return -1;
388
+ let result = this.results[this.resultCount % (64)];
389
+ return result.opId = view.getUint32(body, (true)), result.status = view.getUint8(body + 4), result.affected = view.getUint16(body + 5, (true)), result.conflicts = view.getUint16(body + 7, (true)), result.appliedThrough = view.getUint32(body + 9, (true)) + view.getUint32(body + 13, (true)) * (4294967296), this.resultCount++, body + (17);
390
+ }
391
+ case MessageKind.Durable:
392
+ return body + (8) > end ? -1 : (this.durableThrough = view.getUint32(body, (true)) + view.getUint32(body + 4, (true)) * (4294967296), body + (8));
393
+ case MessageKind.Settings: {
394
+ if (body + (10) > end) return -1;
395
+ let s = this.settings;
396
+ return s.sky = view.getUint8(body), s.ground = view.getUint8(body + 1), s.lighting = view.getUint8(body + 2), s.visibility = view.getUint8(body + 3), s.gridMm = view.getUint32(body + 4, (true)), s.angleStepCentidegrees = view.getUint16(body + 8, (true)), this.hasSettings = true, this.version++, body + (10);
397
+ }
398
+ case MessageKind.Clock: {
399
+ if (body + (21) > end) return -1;
400
+ let c = this.clock;
401
+ return c.simMs = view.getUint32(body, (true)) + view.getUint32(body + 4, (true)) * (4294967296), c.scalePermille = view.getUint32(body + 8, (true)), c.historyRatePermille = view.getUint32(body + 12, (true)), c.dilationPermille = view.getUint32(body + 16, (true)), c.paused = view.getUint8(body + 20) !== 0, this.hasClock = true, body + (21);
402
+ }
403
+ case MessageKind.Begin:
404
+ return body + (12) > end ? -1 : (this.streamed = false, body + (12));
405
+ case MessageKind.End:
406
+ return this.streamed = true, body;
407
+ case MessageKind.Lock: {
408
+ if (body + (6) > end) return -1;
409
+ let id = view.getUint32(body, (true)), row = this.rowOf(id);
410
+ return row !== (-1) && (this.locks[row] = view.getUint16(body + 4, (true)), this.version++), body + (6);
411
+ }
412
+ case MessageKind.Welcome:
413
+ return body + (8) > end ? -1 : (this.builder = view.getUint16(body, (true)), this.role = view.getUint8(body + 2), this.muted = view.getUint8(body + 3) !== 0, this.copy = view.getUint16(body + 4, (true)), this.capacity = view.getUint16(body + 6, (true)), body + (8));
414
+ case MessageKind.Author: {
415
+ if (body + (4) + 1 > end) return -1;
416
+ let index = view.getUint32(body, (true)), name = this.text(view, body + (4), end);
417
+ return name === null ? -1 : (this.authors[index] = name, body + (4) + 1 + view.getUint8(body + (4)));
418
+ }
419
+ case MessageKind.Palette: {
420
+ if (body + (16) + 1 > end) return -1;
421
+ let index = view.getUint16(body, (true));
422
+ this.ensurePalette(index), this.paletteLicence[index] = view.getUint8(body + 2), this.paletteLikeness[index] = view.getUint8(body + 3);
423
+ for (let a = 0; a < (3); a++) this.paletteHalfExtents[index * (3) + a] = view.getUint32(body + 4 + a * 4, (true));
424
+ let item = this.text(view, body + (16), end);
425
+ return item === null ? -1 : (this.paletteItems[index] = item, body + (16) + 1 + view.getUint8(body + (16)));
426
+ }
427
+ case MessageKind.Shared:
428
+ return body + (4) > end ? -1 : (this.sharedCodes[this.sharedCount % (8)] = view.getUint32(body, (true)), this.sharedCount++, body + (4));
429
+ case MessageKind.Notice:
430
+ return body + 1 > end ? -1 : (this.notices[this.noticeCount % (64)] = view.getUint8(body), this.noticeCount++, body + 1);
431
+ default:
432
+ return -1;
433
+ }
434
+ }
435
+ }, U322 = 4, U64 = 8, UPSERT_BODY = 42, REMOVE_BODY = 8, RESULT_BODY = 17, SETTINGS_BODY = 10, CLOCK_BODY = 21, BEGIN_BODY = 12, LOCK_BODY = 6, WELCOME_BODY = 8, AUTHOR_HEAD = 4, PALETTE_HEAD = 16, BOX = new Float64Array((6));
436
+
437
+ // src/interactives/worlds/builder.ts
438
+ var NOT_SENT = -1, AXES3 = 3, U32_RANGE = 4294967296, WorldBuilder = class {
439
+ constructor(port, mirror) {
440
+ this.writer = new CommandWriter();
441
+ this.footprint = new Float64Array((6));
442
+ this.half = new Float64Array((3));
443
+ this.opId = 0;
444
+ this.port = port, this.mirror = mirror;
445
+ }
446
+ get lastOpId() {
447
+ return this.opId;
448
+ }
449
+ next() {
450
+ return this.opId = (this.opId + 1) % (4294967296), this.opId === 0 && (this.opId = 1), this.opId;
451
+ }
452
+ send(action, length) {
453
+ let opId = this.opId;
454
+ return this.port.sendCommand(action, this.writer.bytes, length) < 0 ? (-1) : opId;
455
+ }
456
+ place(item, snap, transform) {
457
+ return this.send(Action.Place, encodePlace(this.writer, this.next(), item, snap, transform));
458
+ }
459
+ select(mode, ids, count) {
460
+ return this.send(Action.Select, encodeSelect(this.writer, this.next(), mode, ids, count));
461
+ }
462
+ clearSelection() {
463
+ return this.send(Action.ClearSelection, encodeBare(this.writer, this.next()));
464
+ }
465
+ transformSelection(snap, dx, dy, dz, rotation, scalePermille) {
466
+ return this.send(
467
+ Action.TransformSelection,
468
+ encodeTransformSelection(this.writer, this.next(), snap, dx, dy, dz, rotation, scalePermille)
469
+ );
470
+ }
471
+ setTransform(id, snap, transform) {
472
+ return this.send(Action.SetTransform, encodeSetTransform(this.writer, this.next(), id, snap, transform));
473
+ }
474
+ duplicate(dx, dy, dz) {
475
+ return this.send(Action.DuplicateSelection, encodeDuplicate(this.writer, this.next(), dx, dy, dz));
476
+ }
477
+ deleteSelection() {
478
+ return this.send(Action.DeleteSelection, encodeBare(this.writer, this.next()));
479
+ }
480
+ undo() {
481
+ return this.send(Action.Undo, encodeBare(this.writer, this.next()));
482
+ }
483
+ redo() {
484
+ return this.send(Action.Redo, encodeBare(this.writer, this.next()));
485
+ }
486
+ settings(settings) {
487
+ return this.send(Action.Settings, encodeSettings(this.writer, this.next(), settings));
488
+ }
489
+ clock(scalePermille, historyRatePermille, paused) {
490
+ return this.send(Action.Clock, encodeClock(this.writer, this.next(), scalePermille, historyRatePermille, paused));
491
+ }
492
+ moderate(target, sanction, durationS) {
493
+ return this.send(Action.Moderate, encodeModerate(this.writer, this.next(), target, sanction, durationS));
494
+ }
495
+ shareCopy() {
496
+ return this.send(Action.ShareCopy, encodeBare(this.writer, this.next()));
497
+ }
498
+ joinCopy(code) {
499
+ return this.send(Action.JoinCopy, encodeJoinCopy(this.writer, this.next(), code));
500
+ }
501
+ preview(item, snap, transform, ignore, ignoreCount) {
502
+ let settings = this.mirror.settings;
503
+ if (canonical(transform), (snap & (1)) !== 0 && snappedToGrid(transform, settings.gridMm, settings.angleStepCentidegrees), (snap & (2)) !== 0) {
504
+ this.mirror.halfExtents(item, this.half, 0);
505
+ let footprint = bounds(transform, 0, this.half, 0, this.footprint), resting = this.mirror.surfaceHeight(footprint, ignore, ignoreCount), lift = footprint[(0) + 1] - transform[(0) + 1];
506
+ transform[(0) + 1] = Math.round(resting - lift);
507
+ } else (snap & (1)) !== 0 && snapHeightToGrid(transform, settings.gridMm);
508
+ return transform;
509
+ }
510
+ };
511
+
512
+ // src/interactives/worlds/loopback.ts
513
+ var LITTLE3 = true, PAYLOAD_BYTES = 1188, MESSAGE_HEADROOM = 64, BUILDER = 0, AUTHOR = 0, MAX_SELECTION = 2048, UNDO_STEPS = 256, UNDO_EFFECTS = 4096, AXES4 = 3, NO_ROW2 = -1, COPY_CAPACITY = 1, LOCAL_PARTICIPANT = "local", PALETTE_HEAD2 = 17, AUTHOR_HEAD2 = 5, ENCODER = new TextEncoder(), LocalWorld = class {
514
+ constructor(options) {
515
+ this.store = new WorldMirror();
516
+ this.sinks = [];
517
+ this.payload = new Uint8Array((1188));
518
+ this.view = new DataView(this.payload.buffer);
519
+ this.length = 0;
520
+ this.nextId = 1;
521
+ this.sequence = 0;
522
+ this.durable = 0;
523
+ this.selection = new Uint32Array((2048));
524
+ this.selected = 0;
525
+ this.staged = new Float64Array((2048) * (10));
526
+ this.stagedIds = new Uint32Array((2048));
527
+ this.stagedCount = 0;
528
+ this.t = new Float64Array((10));
529
+ this.rotation = new Float64Array(4);
530
+ this.half = new Float64Array((3));
531
+ this.footprint = new Float64Array((6));
532
+ this.effId = new Uint32Array((4096));
533
+ this.effBeforePresent = new Uint8Array((4096));
534
+ this.effBeforeRevision = new Uint32Array((4096));
535
+ this.effBeforeItem = new Uint16Array((4096));
536
+ this.effBeforeTransform = new Float64Array((4096) * (10));
537
+ this.effAfterPresent = new Uint8Array((4096));
538
+ this.effAfterRevision = new Uint32Array((4096));
539
+ this.effAfterItem = new Uint16Array((4096));
540
+ this.effAfterTransform = new Float64Array((4096) * (10));
541
+ this.written = 0;
542
+ this.open = -1;
543
+ this.undoStart = new Float64Array((256));
544
+ this.undoLength = new Uint32Array((256));
545
+ this.undoCount = 0;
546
+ this.undoHead = 0;
547
+ this.redoStart = new Float64Array((256));
548
+ this.redoLength = new Uint32Array((256));
549
+ this.redoCount = 0;
550
+ this.redoHead = 0;
551
+ this.popped = new Uint32Array((4096));
552
+ this.poppedCount = 0;
553
+ this.applied = 0;
554
+ this.target = null;
555
+ this.commandView = null;
556
+ this.source = new Float64Array((10));
557
+ this.maxObjects = options.maxObjects ?? Number.MAX_SAFE_INTEGER, this.palette = options.palette, this.hello(), this.flush();
558
+ }
559
+ hello() {
560
+ for (let index = 0; index < this.palette.length; index++) {
561
+ let entry = this.palette[index], name = ENCODER.encode(entry.item);
562
+ this.reserve((17) + 1 + name.length), this.u8(MessageKind.Palette).u16(index).u8(0).u8(0);
563
+ for (let a = 0; a < (3); a++) this.u32(entry.halfExtentsMm[a]);
564
+ this.bytes(name);
565
+ }
566
+ let author = ENCODER.encode(LOCAL_PARTICIPANT);
567
+ this.reserve((5) + 1 + author.length), this.u8(MessageKind.Author).u32((0)), this.bytes(author), this.reserve((64)), this.u8(MessageKind.Welcome).u16((0)).u8(WorldRoleCode.Owner).u8(0).u16(0).u16((1));
568
+ let s = this.store.settings;
569
+ this.u8(MessageKind.Settings).u8(s.sky).u8(s.ground).u8(s.lighting).u8(s.visibility).u32(s.gridMm).u16(s.angleStepCentidegrees), this.u8(MessageKind.Begin).u32(this.store.count).u32(this.sequence).u32(0);
570
+ }
571
+ bytes(text) {
572
+ this.u8(text.length), this.payload.set(text, this.length), this.length += text.length;
573
+ }
574
+ attach(mirror) {
575
+ this.flush(), this.target = mirror, this.hello();
576
+ let store = this.store;
577
+ for (let row = 0; row < store.count; row++) {
578
+ let lock = this.indexOf(store.ids[row]) >= 0 ? (0) : 65535;
579
+ this.emitUpsert(store.ids[row], store.revisions[row], store.items[row], store.transforms, row * (10), lock);
580
+ }
581
+ this.reserve((64)), this.u8(MessageKind.End), this.flush(), this.target = null, this.sinks.push(mirror);
582
+ }
583
+ sendCommand(action, payload, length) {
584
+ return (this.commandView === null || this.commandView.buffer !== payload.buffer || this.commandView.byteOffset !== payload.byteOffset) && (this.commandView = new DataView(payload.buffer, payload.byteOffset, payload.byteLength)), this.apply(action, this.commandView, length), this.flush(), this.sequence;
585
+ }
586
+ u8(value) {
587
+ return this.view.setUint8(this.length, value), this.length += 1, this;
588
+ }
589
+ u16(value) {
590
+ return this.view.setUint16(this.length, value, (true)), this.length += 2, this;
591
+ }
592
+ u32(value) {
593
+ return this.view.setUint32(this.length, value >>> 0, (true)), this.length += 4, this;
594
+ }
595
+ i32(value) {
596
+ return this.view.setInt32(this.length, value | 0, (true)), this.length += 4, this;
597
+ }
598
+ i16(value) {
599
+ return this.view.setInt16(this.length, value, (true)), this.length += 2, this;
600
+ }
601
+ reserve(bytes) {
602
+ this.length + bytes > (1188) && this.flush();
603
+ }
604
+ flush() {
605
+ if (this.length === 0) return;
606
+ let target = this.target;
607
+ if (target !== null)
608
+ target.apply(this.view, 0, this.length);
609
+ else {
610
+ this.store.apply(this.view, 0, this.length);
611
+ for (let i = 0; i < this.sinks.length; i++) this.sinks[i].apply(this.view, 0, this.length);
612
+ }
613
+ this.length = 0;
614
+ }
615
+ emitUpsert(id, revision, item, t, tOffset, lock) {
616
+ this.reserve((64)), this.u8(MessageKind.Upsert).u32(id).u32(revision).u16(item).u32((0)), this.i32(t[tOffset + (0)]).i32(t[tOffset + (0) + 1]).i32(t[tOffset + (0) + 2]);
617
+ for (let i = 0; i < 4; i++) this.i16(t[tOffset + (3) + i]);
618
+ for (let i = 0; i < (3); i++) this.u16(t[tOffset + (7) + i]);
619
+ this.u16(lock), this.flush();
620
+ }
621
+ emitRemove(id, revision) {
622
+ this.reserve((64)), this.u8(MessageKind.Remove).u32(id).u32(revision), this.flush();
623
+ }
624
+ emitLock(id, builder) {
625
+ this.reserve((64)), this.u8(MessageKind.Lock).u32(id).u16(builder), this.flush();
626
+ }
627
+ emitResult(opId, status, affected, conflicts) {
628
+ this.reserve((64)), this.u8(MessageKind.Result).u32(opId).u8(status).u16(affected).u16(conflicts).u32(this.sequence).u32(0), this.durable = this.sequence, this.u8(MessageKind.Durable).u32(this.durable).u32(0);
629
+ }
630
+ apply(action, c, length) {
631
+ if (length < 4) return;
632
+ let opId = c.getUint32(0, (true)), status = Status.Applied, affected = 0, conflicts = 0;
633
+ switch (action) {
634
+ case Action.Place: {
635
+ let item = c.getUint16(4, (true)), snap = c.getUint8(6);
636
+ if (this.readTransform(c, 8, this.t), item >= this.store.paletteItems.length) {
637
+ status = Status.Invalid;
638
+ break;
639
+ }
640
+ if (this.store.count >= this.maxObjects) {
641
+ status = Status.Limit;
642
+ break;
643
+ }
644
+ if (this.snap(this.t, item, snap, 0), !withinWorld(this.t)) {
645
+ status = Status.Invalid;
646
+ break;
647
+ }
648
+ this.begin();
649
+ let id = this.nextId++;
650
+ this.write(id, 1, item, this.t, 0, false, 0), this.commit(), affected = 1;
651
+ break;
652
+ }
653
+ case Action.Select: {
654
+ let mode = c.getUint8(4), count = Math.min(c.getUint8(5), 62);
655
+ mode === SelectMode.Replace && this.release();
656
+ for (let i = 0; i < count; i++) {
657
+ let id = c.getUint32(6 + i * 4, (true));
658
+ if (this.store.rowOf(id) === (-1)) {
659
+ conflicts++;
660
+ continue;
661
+ }
662
+ let at = this.indexOf(id);
663
+ if (mode === SelectMode.Remove) {
664
+ at >= 0 && (this.selection[at] = this.selection[--this.selected], this.emitLock(id, 65535), affected++);
665
+ continue;
666
+ }
667
+ if (!(at >= 0)) {
668
+ if (this.selected >= (2048)) {
669
+ conflicts++;
670
+ continue;
671
+ }
672
+ this.selection[this.selected++] = id, this.emitLock(id, (0)), affected++;
673
+ }
674
+ }
675
+ break;
676
+ }
677
+ case Action.ClearSelection:
678
+ affected = this.selected, this.release();
679
+ break;
680
+ case Action.TransformSelection: {
681
+ if (this.selected === 0) {
682
+ status = Status.Nothing;
683
+ break;
684
+ }
685
+ let snap = c.getUint8(4), dx = c.getInt32(6, (true)), dy = c.getInt32(10, (true)), dz = c.getInt32(14, (true));
686
+ for (let i = 0; i < 4; i++) this.rotation[i] = c.getInt16(18 + i * 2, (true));
687
+ let scale = c.getUint16(26, (true)), px = 0, py = 0, pz = 0, store = this.store;
688
+ for (let i = 0; i < this.selected; i++) {
689
+ let o = store.rowOf(this.selection[i]) * (10);
690
+ px += store.transforms[o], py += store.transforms[o + 1], pz += store.transforms[o + 2];
691
+ }
692
+ px /= this.selected, py /= this.selected, pz /= this.selected, this.stagedCount = 0;
693
+ for (let i = 0; i < this.selected; i++) {
694
+ let id = this.selection[i], row = store.rowOf(id), o = this.stagedCount * (10);
695
+ copyTransform(store.transforms, row * (10), this.source, 0), movedAbout(this.source, px, py, pz, dx, dy, dz, this.rotation, scale, this.t), this.snap(this.t, store.items[row], snap, this.selected), copyTransform(this.t, 0, this.staged, o), this.stagedIds[this.stagedCount++] = id;
696
+ }
697
+ let commit = this.commitStaged();
698
+ status = commit < 0 ? Status.Invalid : Status.Applied, affected = Math.max(0, commit);
699
+ break;
700
+ }
701
+ case Action.SetTransform: {
702
+ let id = c.getUint32(4, (true)), snap = c.getUint8(8);
703
+ this.readTransform(c, 10, this.t);
704
+ let row = this.store.rowOf(id);
705
+ if (row === (-1)) {
706
+ status = Status.Conflict;
707
+ break;
708
+ }
709
+ this.snap(this.t, this.store.items[row], snap, 0), copyTransform(this.t, 0, this.staged, 0), this.stagedIds[0] = id, this.stagedCount = 1;
710
+ let commit = this.commitStaged();
711
+ status = commit < 0 ? Status.Invalid : Status.Applied, affected = Math.max(0, commit);
712
+ break;
713
+ }
714
+ case Action.DuplicateSelection: {
715
+ if (this.selected === 0) {
716
+ status = Status.Nothing;
717
+ break;
718
+ }
719
+ if (this.store.count + this.selected > this.maxObjects) {
720
+ status = Status.Limit;
721
+ break;
722
+ }
723
+ let dx = c.getInt32(4, (true)), dy = c.getInt32(8, (true)), dz = c.getInt32(12, (true));
724
+ this.stageSelection(), this.release(), this.begin();
725
+ let store = this.store;
726
+ for (let i = 0; i < this.stagedCount; i++) {
727
+ let row = store.rowOf(this.stagedIds[i]), o = i * (10);
728
+ if (copyTransform(this.staged, o, this.t, 0), this.t[(0)] += dx, this.t[(0) + 1] += dy, this.t[(0) + 2] += dz, !withinWorld(this.t)) {
729
+ conflicts++;
730
+ continue;
731
+ }
732
+ let id = this.nextId++;
733
+ this.write(id, 1, store.items[row], this.t, 0, false, 0), this.selection[this.selected++] = id, this.emitLock(id, (0)), affected++;
734
+ }
735
+ this.commit();
736
+ break;
737
+ }
738
+ case Action.DeleteSelection: {
739
+ if (this.selected === 0) {
740
+ status = Status.Nothing;
741
+ break;
742
+ }
743
+ this.stageSelection(), this.release(), this.begin();
744
+ for (let i = 0; i < this.stagedCount; i++) this.erase(this.stagedIds[i]) && affected++;
745
+ this.commit();
746
+ break;
747
+ }
748
+ case Action.Undo:
749
+ case Action.Redo: {
750
+ let undo = action === Action.Undo;
751
+ if (!this.pop(undo)) {
752
+ status = Status.Nothing;
753
+ break;
754
+ }
755
+ this.begin();
756
+ let store = this.store;
757
+ for (let p = 0; p < this.poppedCount; p++) {
758
+ let e = this.popped[p], id = this.effId[e], row = store.rowOf(id);
759
+ if (!(row === (-1) ? this.effAfterPresent[e] === 0 : this.effAfterPresent[e] === 1 && this.sameAsAfter(e, row))) {
760
+ conflicts++;
761
+ continue;
762
+ }
763
+ if (this.effBeforePresent[e] === 1) {
764
+ let revision = Math.max(store.knownRevision(id), this.effAfterRevision[e], this.effBeforeRevision[e]) + 1;
765
+ this.write(id, revision, this.effBeforeItem[e], this.effBeforeTransform, e * (10), row !== (-1), row);
766
+ } else {
767
+ let at = this.indexOf(id);
768
+ at >= 0 && (this.selection[at] = this.selection[--this.selected]), this.erase(id);
769
+ }
770
+ affected++;
771
+ }
772
+ this.commitReversal(undo), affected === 0 && conflicts > 0 && (status = Status.Conflict);
773
+ break;
774
+ }
775
+ default:
776
+ status = Status.Nothing;
777
+ }
778
+ status === Status.Applied && affected === 0 && conflicts > 0 && (status = Status.Conflict), status === Status.Applied && this.applied++, this.emitResult(opId, status, affected, conflicts);
779
+ }
780
+ readTransform(c, at, out) {
781
+ out[0] = c.getInt32(at, (true)), out[1] = c.getInt32(at + 4, (true)), out[2] = c.getInt32(at + 8, (true));
782
+ for (let i = 0; i < 4; i++) out[(3) + i] = c.getInt16(at + 12 + i * 2, (true));
783
+ for (let i = 0; i < (3); i++) out[(7) + i] = c.getUint16(at + 20 + i * 2, (true));
784
+ }
785
+ snap(t, item, snap, ignoreSelection) {
786
+ let settings = this.store.settings;
787
+ if (canonical(t), (snap & (1)) !== 0 && snappedToGrid(t, settings.gridMm, settings.angleStepCentidegrees), (snap & (2)) !== 0) {
788
+ this.store.halfExtents(item, this.half, 0);
789
+ let footprint = bounds(t, 0, this.half, 0, this.footprint), resting = this.store.surfaceHeight(footprint, this.selection, ignoreSelection);
790
+ t[(0) + 1] = Math.round(resting - (footprint[(0) + 1] - t[(0) + 1]));
791
+ } else (snap & (1)) !== 0 && snapHeightToGrid(t, settings.gridMm);
792
+ }
793
+ indexOf(id) {
794
+ for (let i = 0; i < this.selected; i++) if (this.selection[i] === id) return i;
795
+ return -1;
796
+ }
797
+ release() {
798
+ for (let i = 0; i < this.selected; i++) this.emitLock(this.selection[i], 65535);
799
+ this.selected = 0;
800
+ }
801
+ stageSelection() {
802
+ this.stagedCount = 0;
803
+ let store = this.store;
804
+ for (let i = 0; i < this.selected; i++) {
805
+ let id = this.selection[i], row = store.rowOf(id);
806
+ row !== (-1) && (copyTransform(store.transforms, row * (10), this.staged, this.stagedCount * (10)), this.stagedIds[this.stagedCount++] = id);
807
+ }
808
+ }
809
+ commitStaged() {
810
+ for (let i = 0; i < this.stagedCount; i++)
811
+ if (copyTransform(this.staged, i * (10), this.t, 0), !withinWorld(this.t)) return -1;
812
+ this.begin();
813
+ let store = this.store, affected = 0;
814
+ for (let i = 0; i < this.stagedCount; i++) {
815
+ let id = this.stagedIds[i], row = store.rowOf(id);
816
+ row !== (-1) && (this.write(id, store.revisions[row] + 1, store.items[row], this.staged, i * (10), true, row), affected++);
817
+ }
818
+ return this.commit(), affected;
819
+ }
820
+ sameAsAfter(e, row) {
821
+ let store = this.store;
822
+ if (store.items[row] !== this.effAfterItem[e]) return false;
823
+ let a = e * (10), b = row * (10);
824
+ for (let i = 0; i < (10); i++) if (store.transforms[b + i] !== this.effAfterTransform[a + i]) return false;
825
+ return true;
826
+ }
827
+ record(id, beforeRow, afterPresent, afterRevision, afterItem, after, afterOffset) {
828
+ let e = this.written % (4096);
829
+ this.effId[e] = id;
830
+ let store = this.store;
831
+ beforeRow === (-1) ? this.effBeforePresent[e] = 0 : (this.effBeforePresent[e] = 1, this.effBeforeRevision[e] = store.revisions[beforeRow], this.effBeforeItem[e] = store.items[beforeRow], copyTransform(store.transforms, beforeRow * (10), this.effBeforeTransform, e * (10))), this.effAfterPresent[e] = afterPresent ? 1 : 0, this.effAfterRevision[e] = afterRevision, this.effAfterItem[e] = afterItem, afterPresent && copyTransform(after, afterOffset, this.effAfterTransform, e * (10)), this.written++;
832
+ }
833
+ write(id, revision, item, t, tOffset, existed, row) {
834
+ this.sequence++, this.record(id, existed ? row : (-1), true, revision, item, t, tOffset);
835
+ let lock = this.indexOf(id) >= 0 ? (0) : 65535;
836
+ this.emitUpsert(id, revision, item, t, tOffset, lock);
837
+ }
838
+ erase(id) {
839
+ let row = this.store.rowOf(id);
840
+ if (row === (-1)) return false;
841
+ let revision = this.store.revisions[row] + 1;
842
+ return this.sequence++, this.record(id, row, false, revision, 0, this.t, 0), this.emitRemove(id, revision), true;
843
+ }
844
+ begin() {
845
+ this.open = this.written;
846
+ }
847
+ close() {
848
+ let start = this.open;
849
+ if (this.open = -1, start < 0) return 0;
850
+ let length = this.written - start;
851
+ return length > 0 && length <= (4096) ? length : 0;
852
+ }
853
+ commit() {
854
+ let start = this.open, length = this.close();
855
+ length !== 0 && (this.push(true, start, length), this.redoCount = 0);
856
+ }
857
+ commitReversal(undo) {
858
+ let start = this.open, length = this.close();
859
+ length !== 0 && this.push(!undo, start, length);
860
+ }
861
+ push(toUndo, start, length) {
862
+ let starts = toUndo ? this.undoStart : this.redoStart, lengths = toUndo ? this.undoLength : this.redoLength, head = toUndo ? this.undoHead : this.redoHead, count = toUndo ? this.undoCount : this.redoCount;
863
+ starts[head] = start, lengths[head] = length, head = (head + 1) % (256), count = Math.min(count + 1, (256)), toUndo ? (this.undoHead = head, this.undoCount = count) : (this.redoHead = head, this.redoCount = count);
864
+ }
865
+ pop(undo) {
866
+ if ((undo ? this.undoCount : this.redoCount) === 0) return false;
867
+ let head = ((undo ? this.undoHead : this.redoHead) + (256) - 1) % (256), start = undo ? this.undoStart[head] : this.redoStart[head], length = undo ? this.undoLength[head] : this.redoLength[head];
868
+ if (undo ? (this.undoHead = head, this.undoCount--) : (this.redoHead = head, this.redoCount--), this.written - start > (4096))
869
+ return this.undoCount = 0, this.redoCount = 0, false;
870
+ this.poppedCount = 0;
871
+ for (let offset = length - 1; offset >= 0; offset--) this.popped[this.poppedCount++] = (start + offset) % (4096);
872
+ return true;
873
+ }
874
+ get undoDepth() {
875
+ return this.undoCount;
876
+ }
877
+ get redoDepth() {
878
+ return this.redoCount;
879
+ }
880
+ get selectionCount() {
881
+ return this.selected;
882
+ }
883
+ selectionAt(index) {
884
+ return this.selection[index];
885
+ }
886
+ };
887
+
888
+ // src/interactives/worlds/online.ts
889
+ var EXPIRED = "the world ticket expired and cannot be renewed";
890
+ function connectWorld(realtime, options = {}) {
891
+ let mirror = options.mirror ?? new WorldMirror(), first = realtime.ticket, renew = options.renew ?? null, tickets = () => {
892
+ let ticket = first;
893
+ return ticket !== null ? (first = null, Promise.resolve(ticket)) : renew === null ? Promise.reject(new Error(EXPIRED)) : renew();
894
+ }, client = new RoomClient({
895
+ tickets,
896
+ primary: realtime.primary,
897
+ fallback: realtime.fallback,
898
+ physicsHz: options.physicsHz,
899
+ memory: options.memory,
900
+ network: options.network,
901
+ channels: mirror
902
+ });
903
+ return { client, mirror, builder: new WorldBuilder(client, mirror) };
904
+ }
905
+
906
+ export { Action, BOUNDS_MAX, BOUNDS_MIN, BOUNDS_WORDS, CENTIDEGREES_PER_TURN, COMMAND_OP_ID_BYTES, CommandWriter, Ground, Lighting, Likeness, LocalWorld, MILLIMETRES_PER_METRE, MessageKind, NOT_SENT, NO_BUILDER, Notice, POSITION, QUATERNION_SCALE, ROTATION, SCALE, SCALE_UNIT_PERMILLE, SNAP_GRID, SNAP_SURFACE, Sanction, SelectMode, Sky, Status, TRANSFORM_WORDS, Visibility, WORLD_EXTENT_MM, WorldBuilder, WorldMirror, WorldRoleCode, bounds, canonical, connectWorld, copyTransform, encodeBare, encodeClock, encodeDuplicate, encodeJoinCopy, encodeModerate, encodePlace, encodeSelect, encodeSetTransform, encodeSettings, encodeTransformSelection, identityTransform, movedAbout, overlapsFootprint, snapHeightToGrid, snappedToGrid, withinWorld, yawRotation };