@verticopolis/components 0.0.0-stage → 0.2.0

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 (791) hide show
  1. package/ASSETS-LICENSE.md +49 -0
  2. package/LICENSE +21 -0
  3. package/README.md +121 -2
  4. package/lib/audio/Audio.d.ts +110 -0
  5. package/lib/audio/Audio.js +199 -0
  6. package/lib/audio/Audio.js.map +1 -0
  7. package/lib/audio/ToneAudioEngine.d.ts +125 -0
  8. package/lib/audio/ToneAudioEngine.js +452 -0
  9. package/lib/audio/ToneAudioEngine.js.map +1 -0
  10. package/lib/audio/audioAssets.d.ts +25 -0
  11. package/lib/audio/audioAssets.js +28 -0
  12. package/lib/audio/audioAssets.js.map +1 -0
  13. package/lib/audio/awayWatch.d.ts +17 -0
  14. package/lib/audio/awayWatch.js +33 -0
  15. package/lib/audio/awayWatch.js.map +1 -0
  16. package/lib/audio/firstCueLatch.d.ts +18 -0
  17. package/lib/audio/firstCueLatch.js +34 -0
  18. package/lib/audio/firstCueLatch.js.map +1 -0
  19. package/lib/audio/lightEnvelope.d.ts +64 -0
  20. package/lib/audio/lightEnvelope.js +124 -0
  21. package/lib/audio/lightEnvelope.js.map +1 -0
  22. package/lib/audio/lightSynth.d.ts +125 -0
  23. package/lib/audio/lightSynth.js +203 -0
  24. package/lib/audio/lightSynth.js.map +1 -0
  25. package/lib/audio/toneContext.d.ts +30 -0
  26. package/lib/audio/toneContext.js +79 -0
  27. package/lib/audio/toneContext.js.map +1 -0
  28. package/lib/audio/toneCrowd.d.ts +62 -0
  29. package/lib/audio/toneCrowd.js +429 -0
  30. package/lib/audio/toneCrowd.js.map +1 -0
  31. package/lib/audio/toneCrowdData.d.ts +144 -0
  32. package/lib/audio/toneCrowdData.js +317 -0
  33. package/lib/audio/toneCrowdData.js.map +1 -0
  34. package/lib/audio/toneCrowdPrograms.d.ts +71 -0
  35. package/lib/audio/toneCrowdPrograms.js +273 -0
  36. package/lib/audio/toneCrowdPrograms.js.map +1 -0
  37. package/lib/audio/toneCrowdVoices.d.ts +49 -0
  38. package/lib/audio/toneCrowdVoices.js +212 -0
  39. package/lib/audio/toneCrowdVoices.js.map +1 -0
  40. package/lib/audio/toneMusicVoices.d.ts +11 -0
  41. package/lib/audio/toneMusicVoices.js +31 -0
  42. package/lib/audio/toneMusicVoices.js.map +1 -0
  43. package/lib/audio/tonePercussion.d.ts +45 -0
  44. package/lib/audio/tonePercussion.js +97 -0
  45. package/lib/audio/tonePercussion.js.map +1 -0
  46. package/lib/audio/toneRain.d.ts +23 -0
  47. package/lib/audio/toneRain.js +39 -0
  48. package/lib/audio/toneRain.js.map +1 -0
  49. package/lib/audio/toneRecordingMock.d.ts +89 -0
  50. package/lib/audio/toneRecordingMock.js +145 -0
  51. package/lib/audio/toneRecordingMock.js.map +1 -0
  52. package/lib/audio/toneRoomTone.d.ts +11 -0
  53. package/lib/audio/toneRoomTone.js +27 -0
  54. package/lib/audio/toneRoomTone.js.map +1 -0
  55. package/lib/audio/toneScenes.d.ts +57 -0
  56. package/lib/audio/toneScenes.js +208 -0
  57. package/lib/audio/toneScenes.js.map +1 -0
  58. package/lib/audio/toneTracks.d.ts +50 -0
  59. package/lib/audio/toneTracks.js +356 -0
  60. package/lib/audio/toneTracks.js.map +1 -0
  61. package/lib/audio/toneVoices.d.ts +57 -0
  62. package/lib/audio/toneVoices.js +208 -0
  63. package/lib/audio/toneVoices.js.map +1 -0
  64. package/lib/catalog/catalogTypes.d.ts +428 -0
  65. package/lib/catalog/catalogTypes.js +102 -0
  66. package/lib/catalog/catalogTypes.js.map +1 -0
  67. package/lib/catalog/skyBridgeTypes.d.ts +25 -0
  68. package/lib/catalog/skyBridgeTypes.js +7 -0
  69. package/lib/catalog/skyBridgeTypes.js.map +1 -0
  70. package/lib/catalog/starDutyTypes.d.ts +22 -0
  71. package/lib/catalog/starDutyTypes.js +7 -0
  72. package/lib/catalog/starDutyTypes.js.map +1 -0
  73. package/lib/catalog/towerCatalog.d.ts +32 -0
  74. package/lib/catalog/towerCatalog.js +44 -0
  75. package/lib/catalog/towerCatalog.js.map +1 -0
  76. package/lib/engineBinding/binding.d.ts +36 -0
  77. package/lib/engineBinding/binding.js +90 -0
  78. package/lib/engineBinding/binding.js.map +1 -0
  79. package/lib/engineBinding/catalog.d.ts +24 -0
  80. package/lib/engineBinding/catalog.js +267 -0
  81. package/lib/engineBinding/catalog.js.map +1 -0
  82. package/lib/engineBinding/engine.d.ts +866 -0
  83. package/lib/engineBinding/exportTiers.d.ts +289 -0
  84. package/lib/engineBinding/exportTiers.js +283 -0
  85. package/lib/engineBinding/exportTiers.js.map +1 -0
  86. package/lib/engineBinding/toolingMethods.d.ts +12 -0
  87. package/lib/engineBinding/toolingMethods.js +20 -0
  88. package/lib/engineBinding/toolingMethods.js.map +1 -0
  89. package/lib/events/gameplayCatalog.d.ts +57 -0
  90. package/lib/events/gameplayCatalog.js +214 -0
  91. package/lib/events/gameplayCatalog.js.map +1 -0
  92. package/lib/events/gameplayEventRules.d.ts +4 -0
  93. package/lib/events/gameplayEventRules.js +32 -0
  94. package/lib/events/gameplayEventRules.js.map +1 -0
  95. package/lib/events/gameplayEvents.d.ts +284 -0
  96. package/lib/presentation/clockText.d.ts +28 -0
  97. package/lib/presentation/clockText.js +38 -0
  98. package/lib/presentation/clockText.js.map +1 -0
  99. package/lib/presentation/facilityPresentation.d.ts +20 -0
  100. package/lib/presentation/facilityPresentation.js +164 -0
  101. package/lib/presentation/facilityPresentation.js.map +1 -0
  102. package/lib/presentation/statsCopy.d.ts +20 -0
  103. package/lib/presentation/statsCopy.js +37 -0
  104. package/lib/presentation/statsCopy.js.map +1 -0
  105. package/lib/presentation/traffic.d.ts +75 -0
  106. package/lib/presentation/traffic.js +79 -0
  107. package/lib/presentation/traffic.js.map +1 -0
  108. package/lib/presentation/viewKinds.d.ts +33 -0
  109. package/lib/presentation/viewKinds.js +88 -0
  110. package/lib/presentation/viewKinds.js.map +1 -0
  111. package/lib/presentation/viewWorld.d.ts +29 -0
  112. package/lib/presentation/viewWorld.js +31 -0
  113. package/lib/presentation/viewWorld.js.map +1 -0
  114. package/lib/render/atlas/archive.d.ts +78 -0
  115. package/lib/render/atlas/archive.js +427 -0
  116. package/lib/render/atlas/archive.js.map +1 -0
  117. package/lib/render/atlas/bake.d.ts +132 -0
  118. package/lib/render/atlas/bake.js +331 -0
  119. package/lib/render/atlas/bake.js.map +1 -0
  120. package/lib/render/atlas/bakeAdditions.d.ts +24 -0
  121. package/lib/render/atlas/bakeAdditions.js +46 -0
  122. package/lib/render/atlas/bakeAdditions.js.map +1 -0
  123. package/lib/render/atlas/browserEntry.d.ts +12 -0
  124. package/lib/render/atlas/browserEntry.js +222 -0
  125. package/lib/render/atlas/browserEntry.js.map +1 -0
  126. package/lib/render/atlas/catalog.d.ts +118 -0
  127. package/lib/render/atlas/catalog.js +253 -0
  128. package/lib/render/atlas/catalog.js.map +1 -0
  129. package/lib/render/atlas/catalogExtras.d.ts +45 -0
  130. package/lib/render/atlas/catalogExtras.js +217 -0
  131. package/lib/render/atlas/catalogExtras.js.map +1 -0
  132. package/lib/render/atlas/compose.d.ts +30 -0
  133. package/lib/render/atlas/compose.js +125 -0
  134. package/lib/render/atlas/compose.js.map +1 -0
  135. package/lib/render/atlas/cycles.d.ts +25 -0
  136. package/lib/render/atlas/cycles.js +41 -0
  137. package/lib/render/atlas/cycles.js.map +1 -0
  138. package/lib/render/atlas/lookup.d.ts +65 -0
  139. package/lib/render/atlas/lookup.js +83 -0
  140. package/lib/render/atlas/lookup.js.map +1 -0
  141. package/lib/render/atlas/pack.d.ts +23 -0
  142. package/lib/render/atlas/pack.js +50 -0
  143. package/lib/render/atlas/pack.js.map +1 -0
  144. package/lib/render/atlas/paint.d.ts +120 -0
  145. package/lib/render/atlas/paint.js +154 -0
  146. package/lib/render/atlas/paint.js.map +1 -0
  147. package/lib/render/atlas/pixels.d.ts +46 -0
  148. package/lib/render/atlas/pixels.js +158 -0
  149. package/lib/render/atlas/pixels.js.map +1 -0
  150. package/lib/render/atlas/png.d.ts +3 -0
  151. package/lib/render/atlas/png.js +102 -0
  152. package/lib/render/atlas/png.js.map +1 -0
  153. package/lib/render/atlas/raster.d.ts +34 -0
  154. package/lib/render/atlas/raster.js +114 -0
  155. package/lib/render/atlas/raster.js.map +1 -0
  156. package/lib/render/atlas/recyclingFill.d.ts +5 -0
  157. package/lib/render/atlas/recyclingFill.js +65 -0
  158. package/lib/render/atlas/recyclingFill.js.map +1 -0
  159. package/lib/render/atlas/samples.d.ts +24 -0
  160. package/lib/render/atlas/samples.js +75 -0
  161. package/lib/render/atlas/samples.js.map +1 -0
  162. package/lib/render/atlas/scenery.d.ts +230 -0
  163. package/lib/render/atlas/scenery.js +242 -0
  164. package/lib/render/atlas/scenery.js.map +1 -0
  165. package/lib/render/atlas/schema.d.ts +189 -0
  166. package/lib/render/atlas/schema.js +31 -0
  167. package/lib/render/atlas/schema.js.map +1 -0
  168. package/lib/render/atlas/shellMarks.d.ts +16 -0
  169. package/lib/render/atlas/shellMarks.js +72 -0
  170. package/lib/render/atlas/shellMarks.js.map +1 -0
  171. package/lib/render/atlas/store.d.ts +75 -0
  172. package/lib/render/atlas/store.js +127 -0
  173. package/lib/render/atlas/store.js.map +1 -0
  174. package/lib/render/atlas/verify.d.ts +43 -0
  175. package/lib/render/atlas/verify.js +87 -0
  176. package/lib/render/atlas/verify.js.map +1 -0
  177. package/lib/render/atlas/verifyExtras.d.ts +19 -0
  178. package/lib/render/atlas/verifyExtras.js +310 -0
  179. package/lib/render/atlas/verifyExtras.js.map +1 -0
  180. package/lib/render/cameraBounds.d.ts +71 -0
  181. package/lib/render/cameraBounds.js +107 -0
  182. package/lib/render/cameraBounds.js.map +1 -0
  183. package/lib/render/carIndicator.d.ts +41 -0
  184. package/lib/render/carIndicator.js +45 -0
  185. package/lib/render/carIndicator.js.map +1 -0
  186. package/lib/render/carMotion.d.ts +33 -0
  187. package/lib/render/carMotion.js +42 -0
  188. package/lib/render/carMotion.js.map +1 -0
  189. package/lib/render/catalogScale.d.ts +40 -0
  190. package/lib/render/catalogScale.js +33 -0
  191. package/lib/render/catalogScale.js.map +1 -0
  192. package/lib/render/climbPath.d.ts +59 -0
  193. package/lib/render/climbPath.js +115 -0
  194. package/lib/render/climbPath.js.map +1 -0
  195. package/lib/render/depthPlanes.d.ts +55 -0
  196. package/lib/render/depthPlanes.js +58 -0
  197. package/lib/render/depthPlanes.js.map +1 -0
  198. package/lib/render/excalibur/TowerEngine.d.ts +348 -0
  199. package/lib/render/excalibur/TowerEngine.js +415 -0
  200. package/lib/render/excalibur/TowerEngine.js.map +1 -0
  201. package/lib/render/excalibur/cabGraphics.d.ts +75 -0
  202. package/lib/render/excalibur/cabGraphics.js +108 -0
  203. package/lib/render/excalibur/cabGraphics.js.map +1 -0
  204. package/lib/render/excalibur/cabParts.d.ts +32 -0
  205. package/lib/render/excalibur/cabParts.js +79 -0
  206. package/lib/render/excalibur/cabParts.js.map +1 -0
  207. package/lib/render/excalibur/cabRiders.d.ts +72 -0
  208. package/lib/render/excalibur/cabRiders.js +176 -0
  209. package/lib/render/excalibur/cabRiders.js.map +1 -0
  210. package/lib/render/excalibur/crowdCull.d.ts +34 -0
  211. package/lib/render/excalibur/crowdCull.js +72 -0
  212. package/lib/render/excalibur/crowdCull.js.map +1 -0
  213. package/lib/render/excalibur/crowdFigure.d.ts +42 -0
  214. package/lib/render/excalibur/crowdFigure.js +99 -0
  215. package/lib/render/excalibur/crowdFigure.js.map +1 -0
  216. package/lib/render/excalibur/crowdLook.d.ts +137 -0
  217. package/lib/render/excalibur/crowdLook.js +186 -0
  218. package/lib/render/excalibur/crowdLook.js.map +1 -0
  219. package/lib/render/excalibur/frameHold.d.ts +23 -0
  220. package/lib/render/excalibur/frameHold.js +30 -0
  221. package/lib/render/excalibur/frameHold.js.map +1 -0
  222. package/lib/render/excalibur/guardPosition.d.ts +17 -0
  223. package/lib/render/excalibur/guardPosition.js +37 -0
  224. package/lib/render/excalibur/guardPosition.js.map +1 -0
  225. package/lib/render/excalibur/keyboardHost.d.ts +15 -0
  226. package/lib/render/excalibur/keyboardHost.js +22 -0
  227. package/lib/render/excalibur/keyboardHost.js.map +1 -0
  228. package/lib/render/excalibur/longPress.d.ts +16 -0
  229. package/lib/render/excalibur/longPress.js +71 -0
  230. package/lib/render/excalibur/longPress.js.map +1 -0
  231. package/lib/render/excalibur/peopleGfx.d.ts +16 -0
  232. package/lib/render/excalibur/peopleGfx.js +46 -0
  233. package/lib/render/excalibur/peopleGfx.js.map +1 -0
  234. package/lib/render/excalibur/peopleWindow.d.ts +35 -0
  235. package/lib/render/excalibur/peopleWindow.js +38 -0
  236. package/lib/render/excalibur/peopleWindow.js.map +1 -0
  237. package/lib/render/excalibur/personFocus.d.ts +36 -0
  238. package/lib/render/excalibur/personFocus.js +169 -0
  239. package/lib/render/excalibur/personFocus.js.map +1 -0
  240. package/lib/render/excalibur/pointerButtonGuard.d.ts +35 -0
  241. package/lib/render/excalibur/pointerButtonGuard.js +86 -0
  242. package/lib/render/excalibur/pointerButtonGuard.js.map +1 -0
  243. package/lib/render/excalibur/pressLifecycle.d.ts +26 -0
  244. package/lib/render/excalibur/pressLifecycle.js +66 -0
  245. package/lib/render/excalibur/pressLifecycle.js.map +1 -0
  246. package/lib/render/excalibur/rainShelter.d.ts +16 -0
  247. package/lib/render/excalibur/rainShelter.js +94 -0
  248. package/lib/render/excalibur/rainShelter.js.map +1 -0
  249. package/lib/render/excalibur/roomSignature.d.ts +30 -0
  250. package/lib/render/excalibur/roomSignature.js +49 -0
  251. package/lib/render/excalibur/roomSignature.js.map +1 -0
  252. package/lib/render/excalibur/sceneBake.d.ts +9 -0
  253. package/lib/render/excalibur/sceneBake.js +12 -0
  254. package/lib/render/excalibur/sceneBake.js.map +1 -0
  255. package/lib/render/excalibur/thiefSpan.d.ts +18 -0
  256. package/lib/render/excalibur/thiefSpan.js +51 -0
  257. package/lib/render/excalibur/thiefSpan.js.map +1 -0
  258. package/lib/render/excalibur/towerBridgeTiles.d.ts +30 -0
  259. package/lib/render/excalibur/towerBridgeTiles.js +43 -0
  260. package/lib/render/excalibur/towerBridgeTiles.js.map +1 -0
  261. package/lib/render/excalibur/towerCrowd.d.ts +73 -0
  262. package/lib/render/excalibur/towerCrowd.js +464 -0
  263. package/lib/render/excalibur/towerCrowd.js.map +1 -0
  264. package/lib/render/excalibur/towerCrowdLayout.d.ts +40 -0
  265. package/lib/render/excalibur/towerCrowdLayout.js +77 -0
  266. package/lib/render/excalibur/towerCrowdLayout.js.map +1 -0
  267. package/lib/render/excalibur/towerFireResponse.d.ts +25 -0
  268. package/lib/render/excalibur/towerFireResponse.js +89 -0
  269. package/lib/render/excalibur/towerFireResponse.js.map +1 -0
  270. package/lib/render/excalibur/towerFrame.d.ts +8 -0
  271. package/lib/render/excalibur/towerFrame.js +57 -0
  272. package/lib/render/excalibur/towerFrame.js.map +1 -0
  273. package/lib/render/excalibur/towerGhostLabel.d.ts +9 -0
  274. package/lib/render/excalibur/towerGhostLabel.js +37 -0
  275. package/lib/render/excalibur/towerGhostLabel.js.map +1 -0
  276. package/lib/render/excalibur/towerHallDoors.d.ts +42 -0
  277. package/lib/render/excalibur/towerHallDoors.js +129 -0
  278. package/lib/render/excalibur/towerHallDoors.js.map +1 -0
  279. package/lib/render/excalibur/towerHaloRings.d.ts +34 -0
  280. package/lib/render/excalibur/towerHaloRings.js +45 -0
  281. package/lib/render/excalibur/towerHaloRings.js.map +1 -0
  282. package/lib/render/excalibur/towerInputCamera.d.ts +90 -0
  283. package/lib/render/excalibur/towerInputCamera.js +480 -0
  284. package/lib/render/excalibur/towerInputCamera.js.map +1 -0
  285. package/lib/render/excalibur/towerMetro.d.ts +31 -0
  286. package/lib/render/excalibur/towerMetro.js +115 -0
  287. package/lib/render/excalibur/towerMetro.js.map +1 -0
  288. package/lib/render/excalibur/towerNoiseReach.d.ts +32 -0
  289. package/lib/render/excalibur/towerNoiseReach.js +75 -0
  290. package/lib/render/excalibur/towerNoiseReach.js.map +1 -0
  291. package/lib/render/excalibur/towerOverlay.d.ts +59 -0
  292. package/lib/render/excalibur/towerOverlay.js +453 -0
  293. package/lib/render/excalibur/towerOverlay.js.map +1 -0
  294. package/lib/render/excalibur/towerReconcile.d.ts +17 -0
  295. package/lib/render/excalibur/towerReconcile.js +404 -0
  296. package/lib/render/excalibur/towerReconcile.js.map +1 -0
  297. package/lib/render/excalibur/towerRegions.d.ts +61 -0
  298. package/lib/render/excalibur/towerRegions.js +193 -0
  299. package/lib/render/excalibur/towerRegions.js.map +1 -0
  300. package/lib/render/excalibur/towerScene.d.ts +66 -0
  301. package/lib/render/excalibur/towerScene.js +443 -0
  302. package/lib/render/excalibur/towerScene.js.map +1 -0
  303. package/lib/render/excalibur/towerScenery.d.ts +12 -0
  304. package/lib/render/excalibur/towerScenery.js +299 -0
  305. package/lib/render/excalibur/towerScenery.js.map +1 -0
  306. package/lib/render/excalibur/towerSceneryDraw.d.ts +86 -0
  307. package/lib/render/excalibur/towerSceneryDraw.js +288 -0
  308. package/lib/render/excalibur/towerSceneryDraw.js.map +1 -0
  309. package/lib/render/excalibur/towerShaftNumbers.d.ts +23 -0
  310. package/lib/render/excalibur/towerShaftNumbers.js +90 -0
  311. package/lib/render/excalibur/towerShaftNumbers.js.map +1 -0
  312. package/lib/render/excalibur/towerStructTiles.d.ts +56 -0
  313. package/lib/render/excalibur/towerStructTiles.js +238 -0
  314. package/lib/render/excalibur/towerStructTiles.js.map +1 -0
  315. package/lib/render/excalibur/towerSyncSchedule.d.ts +84 -0
  316. package/lib/render/excalibur/towerSyncSchedule.js +137 -0
  317. package/lib/render/excalibur/towerSyncSchedule.js.map +1 -0
  318. package/lib/render/excalibur/towerWalkerBuild.d.ts +30 -0
  319. package/lib/render/excalibur/towerWalkerBuild.js +126 -0
  320. package/lib/render/excalibur/towerWalkerBuild.js.map +1 -0
  321. package/lib/render/excalibur/trafficSpotlight.d.ts +29 -0
  322. package/lib/render/excalibur/trafficSpotlight.js +64 -0
  323. package/lib/render/excalibur/trafficSpotlight.js.map +1 -0
  324. package/lib/render/facadeGeometry.d.ts +50 -0
  325. package/lib/render/facadeGeometry.js +79 -0
  326. package/lib/render/facadeGeometry.js.map +1 -0
  327. package/lib/render/groundEntrances.d.ts +44 -0
  328. package/lib/render/groundEntrances.js +118 -0
  329. package/lib/render/groundEntrances.js.map +1 -0
  330. package/lib/render/lateNight.d.ts +14 -0
  331. package/lib/render/lateNight.js +18 -0
  332. package/lib/render/lateNight.js.map +1 -0
  333. package/lib/render/lobbyHalls.d.ts +44 -0
  334. package/lib/render/lobbyHalls.js +63 -0
  335. package/lib/render/lobbyHalls.js.map +1 -0
  336. package/lib/render/metroTrainSchedule.d.ts +20 -0
  337. package/lib/render/metroTrainSchedule.js +65 -0
  338. package/lib/render/metroTrainSchedule.js.map +1 -0
  339. package/lib/render/overviewMap/drawList.d.ts +67 -0
  340. package/lib/render/overviewMap/drawList.js +103 -0
  341. package/lib/render/overviewMap/drawList.js.map +1 -0
  342. package/lib/render/overviewMap/extent.d.ts +70 -0
  343. package/lib/render/overviewMap/extent.js +155 -0
  344. package/lib/render/overviewMap/extent.js.map +1 -0
  345. package/lib/render/overviewMap/floorSpans.d.ts +27 -0
  346. package/lib/render/overviewMap/floorSpans.js +32 -0
  347. package/lib/render/overviewMap/floorSpans.js.map +1 -0
  348. package/lib/render/overviewMap/gaps.d.ts +48 -0
  349. package/lib/render/overviewMap/gaps.js +148 -0
  350. package/lib/render/overviewMap/gaps.js.map +1 -0
  351. package/lib/render/overviewMap/geometry.d.ts +139 -0
  352. package/lib/render/overviewMap/geometry.js +245 -0
  353. package/lib/render/overviewMap/geometry.js.map +1 -0
  354. package/lib/render/overviewMap/heatView.d.ts +91 -0
  355. package/lib/render/overviewMap/heatView.js +143 -0
  356. package/lib/render/overviewMap/heatView.js.map +1 -0
  357. package/lib/render/overviewMap/hotelView.d.ts +82 -0
  358. package/lib/render/overviewMap/hotelView.js +136 -0
  359. package/lib/render/overviewMap/hotelView.js.map +1 -0
  360. package/lib/render/overviewMap/model.d.ts +97 -0
  361. package/lib/render/overviewMap/model.js +116 -0
  362. package/lib/render/overviewMap/model.js.map +1 -0
  363. package/lib/render/overviewMap/paint.d.ts +63 -0
  364. package/lib/render/overviewMap/paint.js +168 -0
  365. package/lib/render/overviewMap/paint.js.map +1 -0
  366. package/lib/render/overviewMap/style.d.ts +46 -0
  367. package/lib/render/overviewMap/style.js +117 -0
  368. package/lib/render/overviewMap/style.js.map +1 -0
  369. package/lib/render/overviewMap/tierView.d.ts +103 -0
  370. package/lib/render/overviewMap/tierView.js +209 -0
  371. package/lib/render/overviewMap/tierView.js.map +1 -0
  372. package/lib/render/overviewMap/viewMark.d.ts +69 -0
  373. package/lib/render/overviewMap/viewMark.js +103 -0
  374. package/lib/render/overviewMap/viewMark.js.map +1 -0
  375. package/lib/render/overviewMap/views.d.ts +24 -0
  376. package/lib/render/overviewMap/views.js +29 -0
  377. package/lib/render/overviewMap/views.js.map +1 -0
  378. package/lib/render/pinchTracker.d.ts +91 -0
  379. package/lib/render/pinchTracker.js +145 -0
  380. package/lib/render/pinchTracker.js.map +1 -0
  381. package/lib/render/pixelSprites/amusements.d.ts +32 -0
  382. package/lib/render/pixelSprites/amusements.js +243 -0
  383. package/lib/render/pixelSprites/amusements.js.map +1 -0
  384. package/lib/render/pixelSprites/artScale.d.ts +97 -0
  385. package/lib/render/pixelSprites/artScale.js +151 -0
  386. package/lib/render/pixelSprites/artScale.js.map +1 -0
  387. package/lib/render/pixelSprites/boutique.d.ts +30 -0
  388. package/lib/render/pixelSprites/boutique.js +244 -0
  389. package/lib/render/pixelSprites/boutique.js.map +1 -0
  390. package/lib/render/pixelSprites/clinic.d.ts +30 -0
  391. package/lib/render/pixelSprites/clinic.js +184 -0
  392. package/lib/render/pixelSprites/clinic.js.map +1 -0
  393. package/lib/render/pixelSprites/common.d.ts +185 -0
  394. package/lib/render/pixelSprites/common.js +449 -0
  395. package/lib/render/pixelSprites/common.js.map +1 -0
  396. package/lib/render/pixelSprites/daycare.d.ts +3 -0
  397. package/lib/render/pixelSprites/daycare.js +99 -0
  398. package/lib/render/pixelSprites/daycare.js.map +1 -0
  399. package/lib/render/pixelSprites/dollhouse.d.ts +45 -0
  400. package/lib/render/pixelSprites/dollhouse.js +110 -0
  401. package/lib/render/pixelSprites/dollhouse.js.map +1 -0
  402. package/lib/render/pixelSprites/fitness.d.ts +30 -0
  403. package/lib/render/pixelSprites/fitness.js +176 -0
  404. package/lib/render/pixelSprites/fitness.js.map +1 -0
  405. package/lib/render/pixelSprites/food.d.ts +27 -0
  406. package/lib/render/pixelSprites/food.interiors.d.ts +38 -0
  407. package/lib/render/pixelSprites/food.interiors.js +516 -0
  408. package/lib/render/pixelSprites/food.interiors.js.map +1 -0
  409. package/lib/render/pixelSprites/food.js +36 -0
  410. package/lib/render/pixelSprites/food.js.map +1 -0
  411. package/lib/render/pixelSprites/food.kit.d.ts +50 -0
  412. package/lib/render/pixelSprites/food.kit.js +140 -0
  413. package/lib/render/pixelSprites/food.kit.js.map +1 -0
  414. package/lib/render/pixelSprites/food.looks.d.ts +45 -0
  415. package/lib/render/pixelSprites/food.looks.js +56 -0
  416. package/lib/render/pixelSprites/food.looks.js.map +1 -0
  417. package/lib/render/pixelSprites/layers.d.ts +49 -0
  418. package/lib/render/pixelSprites/layers.js +61 -0
  419. package/lib/render/pixelSprites/layers.js.map +1 -0
  420. package/lib/render/pixelSprites/nightclub.d.ts +3 -0
  421. package/lib/render/pixelSprites/nightclub.js +108 -0
  422. package/lib/render/pixelSprites/nightclub.js.map +1 -0
  423. package/lib/render/pixelSprites/people.d.ts +168 -0
  424. package/lib/render/pixelSprites/people.js +431 -0
  425. package/lib/render/pixelSprites/people.js.map +1 -0
  426. package/lib/render/pixelSprites/residential.d.ts +5 -0
  427. package/lib/render/pixelSprites/residential.js +506 -0
  428. package/lib/render/pixelSprites/residential.js.map +1 -0
  429. package/lib/render/pixelSprites/residential.looks.d.ts +40 -0
  430. package/lib/render/pixelSprites/residential.looks.js +43 -0
  431. package/lib/render/pixelSprites/residential.looks.js.map +1 -0
  432. package/lib/render/pixelSprites/residential.roaches.d.ts +38 -0
  433. package/lib/render/pixelSprites/residential.roaches.js +88 -0
  434. package/lib/render/pixelSprites/residential.roaches.js.map +1 -0
  435. package/lib/render/pixelSprites/residentialRentalSprites.d.ts +11 -0
  436. package/lib/render/pixelSprites/residentialRentalSprites.js +19 -0
  437. package/lib/render/pixelSprites/residentialRentalSprites.js.map +1 -0
  438. package/lib/render/pixelSprites/shop.d.ts +14 -0
  439. package/lib/render/pixelSprites/shop.interiors.d.ts +50 -0
  440. package/lib/render/pixelSprites/shop.interiors.js +382 -0
  441. package/lib/render/pixelSprites/shop.interiors.js.map +1 -0
  442. package/lib/render/pixelSprites/shop.js +72 -0
  443. package/lib/render/pixelSprites/shop.js.map +1 -0
  444. package/lib/render/pixelSprites/shop.looks.d.ts +17 -0
  445. package/lib/render/pixelSprites/shop.looks.js +24 -0
  446. package/lib/render/pixelSprites/shop.looks.js.map +1 -0
  447. package/lib/render/pixelSprites/skyBar.d.ts +11 -0
  448. package/lib/render/pixelSprites/skyBar.js +125 -0
  449. package/lib/render/pixelSprites/skyBar.js.map +1 -0
  450. package/lib/render/pixelSprites/spa.d.ts +3 -0
  451. package/lib/render/pixelSprites/spa.js +88 -0
  452. package/lib/render/pixelSprites/spa.js.map +1 -0
  453. package/lib/render/pixelSprites.d.ts +33 -0
  454. package/lib/render/pixelSprites.js +167 -0
  455. package/lib/render/pixelSprites.js.map +1 -0
  456. package/lib/render/regionGrid.d.ts +49 -0
  457. package/lib/render/regionGrid.js +82 -0
  458. package/lib/render/regionGrid.js.map +1 -0
  459. package/lib/render/regionPaint.d.ts +15 -0
  460. package/lib/render/regionPaint.js +33 -0
  461. package/lib/render/regionPaint.js.map +1 -0
  462. package/lib/render/renderSim.d.ts +104 -0
  463. package/lib/render/renderSim.js +2 -0
  464. package/lib/render/renderSim.js.map +1 -0
  465. package/lib/render/roomPortrait.d.ts +35 -0
  466. package/lib/render/roomPortrait.js +142 -0
  467. package/lib/render/roomPortrait.js.map +1 -0
  468. package/lib/render/roomShading.d.ts +29 -0
  469. package/lib/render/roomShading.js +43 -0
  470. package/lib/render/roomShading.js.map +1 -0
  471. package/lib/render/scale.d.ts +31 -0
  472. package/lib/render/scale.js +34 -0
  473. package/lib/render/scale.js.map +1 -0
  474. package/lib/render/sceneryLayout.d.ts +234 -0
  475. package/lib/render/sceneryLayout.js +199 -0
  476. package/lib/render/sceneryLayout.js.map +1 -0
  477. package/lib/render/sprites/common.d.ts +41 -0
  478. package/lib/render/sprites/common.js +46 -0
  479. package/lib/render/sprites/common.js.map +1 -0
  480. package/lib/render/sprites/escalator.d.ts +27 -0
  481. package/lib/render/sprites/escalator.js +156 -0
  482. package/lib/render/sprites/escalator.js.map +1 -0
  483. package/lib/render/sprites/events.d.ts +56 -0
  484. package/lib/render/sprites/events.js +280 -0
  485. package/lib/render/sprites/events.js.map +1 -0
  486. package/lib/render/sprites/facilities/garage.d.ts +23 -0
  487. package/lib/render/sprites/facilities/garage.js +230 -0
  488. package/lib/render/sprites/facilities/garage.js.map +1 -0
  489. package/lib/render/sprites/facilities/recycling.d.ts +3 -0
  490. package/lib/render/sprites/facilities/recycling.js +210 -0
  491. package/lib/render/sprites/facilities/recycling.js.map +1 -0
  492. package/lib/render/sprites/facilities/recyclingLook.d.ts +49 -0
  493. package/lib/render/sprites/facilities/recyclingLook.js +52 -0
  494. package/lib/render/sprites/facilities/recyclingLook.js.map +1 -0
  495. package/lib/render/sprites/facilities/service.d.ts +14 -0
  496. package/lib/render/sprites/facilities/service.js +437 -0
  497. package/lib/render/sprites/facilities/service.js.map +1 -0
  498. package/lib/render/sprites/facilities/serviceKit.d.ts +61 -0
  499. package/lib/render/sprites/facilities/serviceKit.js +113 -0
  500. package/lib/render/sprites/facilities/serviceKit.js.map +1 -0
  501. package/lib/render/sprites/facilities/vehicles.d.ts +38 -0
  502. package/lib/render/sprites/facilities/vehicles.js +276 -0
  503. package/lib/render/sprites/facilities/vehicles.js.map +1 -0
  504. package/lib/render/sprites/facilities/venue.d.ts +28 -0
  505. package/lib/render/sprites/facilities/venue.js +211 -0
  506. package/lib/render/sprites/facilities/venue.js.map +1 -0
  507. package/lib/render/sprites/facilities/weddingHall.d.ts +9 -0
  508. package/lib/render/sprites/facilities/weddingHall.js +410 -0
  509. package/lib/render/sprites/facilities/weddingHall.js.map +1 -0
  510. package/lib/render/sprites/facilities.d.ts +22 -0
  511. package/lib/render/sprites/facilities.js +24 -0
  512. package/lib/render/sprites/facilities.js.map +1 -0
  513. package/lib/render/sprites/helicopter.d.ts +11 -0
  514. package/lib/render/sprites/helicopter.js +60 -0
  515. package/lib/render/sprites/helicopter.js.map +1 -0
  516. package/lib/render/sprites/sky.d.ts +67 -0
  517. package/lib/render/sprites/sky.js +85 -0
  518. package/lib/render/sprites/sky.js.map +1 -0
  519. package/lib/render/sprites/spiralStair.d.ts +19 -0
  520. package/lib/render/sprites/spiralStair.js +111 -0
  521. package/lib/render/sprites/spiralStair.js.map +1 -0
  522. package/lib/render/sprites/structure/entrance.d.ts +35 -0
  523. package/lib/render/sprites/structure/entrance.js +347 -0
  524. package/lib/render/sprites/structure/entrance.js.map +1 -0
  525. package/lib/render/sprites/structure/lobby.d.ts +88 -0
  526. package/lib/render/sprites/structure/lobby.js +350 -0
  527. package/lib/render/sprites/structure/lobby.js.map +1 -0
  528. package/lib/render/sprites/structure/revolvingDoor.d.ts +53 -0
  529. package/lib/render/sprites/structure/revolvingDoor.js +184 -0
  530. package/lib/render/sprites/structure/revolvingDoor.js.map +1 -0
  531. package/lib/render/sprites/structure/rooftop.d.ts +93 -0
  532. package/lib/render/sprites/structure/rooftop.js +302 -0
  533. package/lib/render/sprites/structure/rooftop.js.map +1 -0
  534. package/lib/render/sprites/structure/shell.d.ts +19 -0
  535. package/lib/render/sprites/structure/shell.js +142 -0
  536. package/lib/render/sprites/structure/shell.js.map +1 -0
  537. package/lib/render/sprites/structure/skyBridge.d.ts +28 -0
  538. package/lib/render/sprites/structure/skyBridge.js +259 -0
  539. package/lib/render/sprites/structure/skyBridge.js.map +1 -0
  540. package/lib/render/sprites/structure/tallLobby.d.ts +8 -0
  541. package/lib/render/sprites/structure/tallLobby.js +166 -0
  542. package/lib/render/sprites/structure/tallLobby.js.map +1 -0
  543. package/lib/render/sprites/structure/tallLobbyPieces.d.ts +18 -0
  544. package/lib/render/sprites/structure/tallLobbyPieces.js +82 -0
  545. package/lib/render/sprites/structure/tallLobbyPieces.js.map +1 -0
  546. package/lib/render/sprites/structure.d.ts +15 -0
  547. package/lib/render/sprites/structure.js +16 -0
  548. package/lib/render/sprites/structure.js.map +1 -0
  549. package/lib/render/sprites/transport.d.ts +30 -0
  550. package/lib/render/sprites/transport.js +376 -0
  551. package/lib/render/sprites/transport.js.map +1 -0
  552. package/lib/render/sprites.d.ts +16 -0
  553. package/lib/render/sprites.js +108 -0
  554. package/lib/render/sprites.js.map +1 -0
  555. package/lib/render/venueFlights.d.ts +61 -0
  556. package/lib/render/venueFlights.js +50 -0
  557. package/lib/render/venueFlights.js.map +1 -0
  558. package/lib/shared/engineTypes.d.ts +256 -0
  559. package/lib/shared/engineTypes.js +8 -0
  560. package/lib/shared/engineTypes.js.map +1 -0
  561. package/lib/shared/floorRuns.d.ts +22 -0
  562. package/lib/shared/floorRuns.js +39 -0
  563. package/lib/shared/floorRuns.js.map +1 -0
  564. package/lib/shared/inputEvents.d.ts +18 -0
  565. package/lib/shared/inputEvents.js +23 -0
  566. package/lib/shared/inputEvents.js.map +1 -0
  567. package/lib/shared/serializedGame.d.ts +142 -0
  568. package/lib/shared/serializedGame.js +2 -0
  569. package/lib/shared/serializedGame.js.map +1 -0
  570. package/lib/shared/types.d.ts +298 -0
  571. package/lib/shared/types.js +47 -0
  572. package/lib/shared/types.js.map +1 -0
  573. package/lib/shared/unitState.d.ts +36 -0
  574. package/lib/shared/unitState.js +42 -0
  575. package/lib/shared/unitState.js.map +1 -0
  576. package/lib/shared/vacateReasonText.d.ts +20 -0
  577. package/lib/shared/vacateReasonText.js +23 -0
  578. package/lib/shared/vacateReasonText.js.map +1 -0
  579. package/lib/shared/viewZoom.d.ts +14 -0
  580. package/lib/shared/viewZoom.js +17 -0
  581. package/lib/shared/viewZoom.js.map +1 -0
  582. package/lib/shared/wellFormed.d.ts +14 -0
  583. package/lib/shared/wellFormed.js +19 -0
  584. package/lib/shared/wellFormed.js.map +1 -0
  585. package/lib/simport/cards.d.ts +26 -0
  586. package/lib/simport/cards.js +138 -0
  587. package/lib/simport/cards.js.map +1 -0
  588. package/lib/simport/clockView.d.ts +24 -0
  589. package/lib/simport/clockView.js +43 -0
  590. package/lib/simport/clockView.js.map +1 -0
  591. package/lib/simport/commands.d.ts +215 -0
  592. package/lib/simport/commands.js +2 -0
  593. package/lib/simport/commands.js.map +1 -0
  594. package/lib/simport/emergencyReads.d.ts +19 -0
  595. package/lib/simport/emergencyReads.js +47 -0
  596. package/lib/simport/emergencyReads.js.map +1 -0
  597. package/lib/simport/enginePort.d.ts +433 -0
  598. package/lib/simport/enginePort.js +11 -0
  599. package/lib/simport/enginePort.js.map +1 -0
  600. package/lib/simport/fixtures/catalog.classic.json +2137 -0
  601. package/lib/simport/fixtures/catalog.modern.json +2515 -0
  602. package/lib/simport/fixtures/viewLayout.json +927 -0
  603. package/lib/simport/headerClock.d.ts +31 -0
  604. package/lib/simport/headerClock.js +29 -0
  605. package/lib/simport/headerClock.js.map +1 -0
  606. package/lib/simport/panels.d.ts +243 -0
  607. package/lib/simport/panels.js +2 -0
  608. package/lib/simport/panels.js.map +1 -0
  609. package/lib/simport/personCards.d.ts +63 -0
  610. package/lib/simport/personCards.js +55 -0
  611. package/lib/simport/personCards.js.map +1 -0
  612. package/lib/simport/portCodes.d.ts +41 -0
  613. package/lib/simport/portCodes.js +49 -0
  614. package/lib/simport/portCodes.js.map +1 -0
  615. package/lib/simport/portEvents.d.ts +39 -0
  616. package/lib/simport/portEvents.js +43 -0
  617. package/lib/simport/portEvents.js.map +1 -0
  618. package/lib/simport/portRenderSim.d.ts +70 -0
  619. package/lib/simport/portRenderSim.js +129 -0
  620. package/lib/simport/portRenderSim.js.map +1 -0
  621. package/lib/simport/queries.d.ts +64 -0
  622. package/lib/simport/queries.js +30 -0
  623. package/lib/simport/queries.js.map +1 -0
  624. package/lib/simport/recyclingPort.d.ts +13 -0
  625. package/lib/simport/recyclingPort.js +2 -0
  626. package/lib/simport/recyclingPort.js.map +1 -0
  627. package/lib/simport/request.d.ts +44 -0
  628. package/lib/simport/request.js +214 -0
  629. package/lib/simport/request.js.map +1 -0
  630. package/lib/simport/roomTiers.d.ts +102 -0
  631. package/lib/simport/roomTiers.js +122 -0
  632. package/lib/simport/roomTiers.js.map +1 -0
  633. package/lib/simport/scheduleSlots.d.ts +19 -0
  634. package/lib/simport/scheduleSlots.js +87 -0
  635. package/lib/simport/scheduleSlots.js.map +1 -0
  636. package/lib/simport/skyBridgePort.d.ts +20 -0
  637. package/lib/simport/skyBridgePort.js +2 -0
  638. package/lib/simport/skyBridgePort.js.map +1 -0
  639. package/lib/simport/skyBridgeView.d.ts +15 -0
  640. package/lib/simport/skyBridgeView.js +42 -0
  641. package/lib/simport/skyBridgeView.js.map +1 -0
  642. package/lib/simport/statsSheet.d.ts +15 -0
  643. package/lib/simport/statsSheet.js +101 -0
  644. package/lib/simport/statsSheet.js.map +1 -0
  645. package/lib/simport/tdtRecords.d.ts +9 -0
  646. package/lib/simport/tdtRecords.js +112 -0
  647. package/lib/simport/tdtRecords.js.map +1 -0
  648. package/lib/simport/tdtReportFacts.d.ts +110 -0
  649. package/lib/simport/tdtReportFacts.js +8 -0
  650. package/lib/simport/tdtReportFacts.js.map +1 -0
  651. package/lib/simport/trafficPort.d.ts +22 -0
  652. package/lib/simport/trafficPort.js +2 -0
  653. package/lib/simport/trafficPort.js.map +1 -0
  654. package/lib/simport/view.d.ts +275 -0
  655. package/lib/simport/view.js +2 -0
  656. package/lib/simport/view.js.map +1 -0
  657. package/lib/simport/viewReader.d.ts +89 -0
  658. package/lib/simport/viewReader.js +426 -0
  659. package/lib/simport/viewReader.js.map +1 -0
  660. package/lib/styles/game/appearance.css +108 -0
  661. package/lib/styles/game/base.css +68 -0
  662. package/lib/styles/game/components.css +69 -0
  663. package/lib/styles/game/desk-title.css +183 -0
  664. package/lib/styles/game/desk.css +487 -0
  665. package/lib/styles/game/dialogs.css +360 -0
  666. package/lib/styles/game/editor-sidebar.css +116 -0
  667. package/lib/styles/game/elevator-schedule.css +217 -0
  668. package/lib/styles/game/file-dialog.css +470 -0
  669. package/lib/styles/game/help.css +141 -0
  670. package/lib/styles/game/launch-fireworks.css +17 -0
  671. package/lib/styles/game/media-landscape.css +333 -0
  672. package/lib/styles/game/media-phone.css +303 -0
  673. package/lib/styles/game/media-tablet-touch.css +177 -0
  674. package/lib/styles/game/menubar.css +158 -0
  675. package/lib/styles/game/new-tower.css +219 -0
  676. package/lib/styles/game/onboarding.css +32 -0
  677. package/lib/styles/game/screen-saver.css +85 -0
  678. package/lib/styles/game/splash.css +413 -0
  679. package/lib/styles/game/stats-saves.css +106 -0
  680. package/lib/styles/game/tools-stage.css +340 -0
  681. package/lib/styles/game/topbar.css +191 -0
  682. package/lib/styles/menu-bar.css +108 -0
  683. package/lib/styles/not-found.css +335 -0
  684. package/lib/styles/overview-map-views.css +88 -0
  685. package/lib/styles/overview-map.css +195 -0
  686. package/lib/styles/retro-components.css +179 -0
  687. package/lib/styles/retro-page.css +254 -0
  688. package/lib/styles/retro-tokens.css +122 -0
  689. package/lib/styles/schemes/high-contrast.css +173 -0
  690. package/lib/styles/schemes/skyline.css +134 -0
  691. package/lib/styles.css +66 -0
  692. package/lib/ui/desk/deskGeometry.d.ts +59 -0
  693. package/lib/ui/desk/deskGeometry.js +106 -0
  694. package/lib/ui/desk/deskGeometry.js.map +1 -0
  695. package/lib/ui/desk/deskWindow.d.ts +90 -0
  696. package/lib/ui/desk/deskWindow.js +253 -0
  697. package/lib/ui/desk/deskWindow.js.map +1 -0
  698. package/lib/ui/desk/deskWindowMenu.d.ts +55 -0
  699. package/lib/ui/desk/deskWindowMenu.js +143 -0
  700. package/lib/ui/desk/deskWindowMenu.js.map +1 -0
  701. package/lib/ui/escape.d.ts +1 -0
  702. package/lib/ui/escape.js +14 -0
  703. package/lib/ui/escape.js.map +1 -0
  704. package/lib/ui/format.d.ts +14 -0
  705. package/lib/ui/format.js +36 -0
  706. package/lib/ui/format.js.map +1 -0
  707. package/lib/ui/iconPaths.generated.d.ts +4 -0
  708. package/lib/ui/iconPaths.generated.js +68 -0
  709. package/lib/ui/iconPaths.generated.js.map +1 -0
  710. package/lib/ui/icons.d.ts +83 -0
  711. package/lib/ui/icons.js +156 -0
  712. package/lib/ui/icons.js.map +1 -0
  713. package/lib/ui/menuBar.d.ts +94 -0
  714. package/lib/ui/menuBar.js +361 -0
  715. package/lib/ui/menuBar.js.map +1 -0
  716. package/lib/ui/modalPrecedence.d.ts +108 -0
  717. package/lib/ui/modalPrecedence.js +165 -0
  718. package/lib/ui/modalPrecedence.js.map +1 -0
  719. package/lib/ui/movableWindow.d.ts +124 -0
  720. package/lib/ui/movableWindow.js +247 -0
  721. package/lib/ui/movableWindow.js.map +1 -0
  722. package/lib/ui/overviewMapInput.d.ts +109 -0
  723. package/lib/ui/overviewMapInput.js +135 -0
  724. package/lib/ui/overviewMapInput.js.map +1 -0
  725. package/lib/ui/uiModal.d.ts +38 -0
  726. package/lib/ui/uiModal.js +70 -0
  727. package/lib/ui/uiModal.js.map +1 -0
  728. package/lib/wasmhost/buildSection.d.ts +54 -0
  729. package/lib/wasmhost/buildSection.js +143 -0
  730. package/lib/wasmhost/buildSection.js.map +1 -0
  731. package/lib/wasmhost/catalogCheck.d.ts +11 -0
  732. package/lib/wasmhost/catalogCheck.js +43 -0
  733. package/lib/wasmhost/catalogCheck.js.map +1 -0
  734. package/lib/wasmhost/engineAssets.d.ts +57 -0
  735. package/lib/wasmhost/engineAssets.js +63 -0
  736. package/lib/wasmhost/engineAssets.js.map +1 -0
  737. package/lib/wasmhost/engineBoot.d.ts +165 -0
  738. package/lib/wasmhost/engineBoot.js +254 -0
  739. package/lib/wasmhost/engineBoot.js.map +1 -0
  740. package/lib/wasmhost/engineChoice.d.ts +6 -0
  741. package/lib/wasmhost/engineChoice.js +2 -0
  742. package/lib/wasmhost/engineChoice.js.map +1 -0
  743. package/lib/wasmhost/engineDiagnostics.d.ts +66 -0
  744. package/lib/wasmhost/engineDiagnostics.js +189 -0
  745. package/lib/wasmhost/engineDiagnostics.js.map +1 -0
  746. package/lib/wasmhost/engineDiagnosticsLive.d.ts +15 -0
  747. package/lib/wasmhost/engineDiagnosticsLive.js +31 -0
  748. package/lib/wasmhost/engineDiagnosticsLive.js.map +1 -0
  749. package/lib/wasmhost/engineIdentity.d.ts +30 -0
  750. package/lib/wasmhost/engineIdentity.js +59 -0
  751. package/lib/wasmhost/engineIdentity.js.map +1 -0
  752. package/lib/wasmhost/engineLabel.d.ts +40 -0
  753. package/lib/wasmhost/engineLabel.js +50 -0
  754. package/lib/wasmhost/engineLabel.js.map +1 -0
  755. package/lib/wasmhost/engineLoad.d.ts +48 -0
  756. package/lib/wasmhost/engineLoad.js +53 -0
  757. package/lib/wasmhost/engineLoad.js.map +1 -0
  758. package/lib/wasmhost/enginePackageCheck.d.ts +77 -0
  759. package/lib/wasmhost/enginePackageCheck.js +274 -0
  760. package/lib/wasmhost/enginePackageCheck.js.map +1 -0
  761. package/lib/wasmhost/enginePackageNames.d.ts +25 -0
  762. package/lib/wasmhost/enginePackageNames.js +28 -0
  763. package/lib/wasmhost/enginePackageNames.js.map +1 -0
  764. package/lib/wasmhost/enginePackageRecord.d.ts +78 -0
  765. package/lib/wasmhost/enginePackageRecord.js +108 -0
  766. package/lib/wasmhost/enginePackageRecord.js.map +1 -0
  767. package/lib/wasmhost/engineRepair.d.ts +55 -0
  768. package/lib/wasmhost/engineRepair.js +183 -0
  769. package/lib/wasmhost/engineRepair.js.map +1 -0
  770. package/lib/wasmhost/frameView.d.ts +87 -0
  771. package/lib/wasmhost/frameView.js +133 -0
  772. package/lib/wasmhost/frameView.js.map +1 -0
  773. package/lib/wasmhost/hostFault.d.ts +40 -0
  774. package/lib/wasmhost/hostFault.js +94 -0
  775. package/lib/wasmhost/hostFault.js.map +1 -0
  776. package/lib/wasmhost/loadEngineModule.d.ts +79 -0
  777. package/lib/wasmhost/loadEngineModule.js +66 -0
  778. package/lib/wasmhost/loadEngineModule.js.map +1 -0
  779. package/lib/wasmhost/packageHash.d.ts +48 -0
  780. package/lib/wasmhost/packageHash.js +436 -0
  781. package/lib/wasmhost/packageHash.js.map +1 -0
  782. package/lib/wasmhost/rustEngine.d.ts +49 -0
  783. package/lib/wasmhost/rustEngine.js +63 -0
  784. package/lib/wasmhost/rustEngine.js.map +1 -0
  785. package/lib/wasmhost/slotPopulation.d.ts +19 -0
  786. package/lib/wasmhost/slotPopulation.js +69 -0
  787. package/lib/wasmhost/slotPopulation.js.map +1 -0
  788. package/lib/wasmhost/telemetry.d.ts +31 -0
  789. package/lib/wasmhost/telemetry.js +13 -0
  790. package/lib/wasmhost/telemetry.js.map +1 -0
  791. package/package.json +80 -4
@@ -0,0 +1,361 @@
1
+ /**
2
+ * The Win95 menu bar's behavior (index.html `#menubar`): a title opens its
3
+ * menu, and while one is open, pointing at another title switches to it, the
4
+ * way a 1995 desktop menu bar works. The keyboard follows the WAI-ARIA
5
+ * menubar keys (the markup is a row of menu buttons, each with its menu):
6
+ * Left and Right move between titles, Down (or Enter or Space) on a title
7
+ * opens it, Up and Down move inside a menu, Home and End jump to its ends,
8
+ * Escape closes it and gives the focus back to its title, and Tab closes it.
9
+ * Alt with a title's underlined letter opens that menu.
10
+ *
11
+ * An item can open a submenu (`.mb-sub-title`, File > Open Recent): a click,
12
+ * Enter, Space or Right on it opens the submenu beside it (under it on a
13
+ * phone), a mouse opens it by pointing, Left or Escape inside it goes back to
14
+ * its title, and pointing at another item closes it. A submenu's title is
15
+ * never a pick; the items inside it are. A grayed title opens nothing.
16
+ *
17
+ * An item with an underlined character (Open Recent's numbers) is picked by
18
+ * pressing that key while its menu has the focus, as in a 1995 menu.
19
+ *
20
+ * What an item does is not this module's business: each item is a real
21
+ * button whose click the game wires (`game/menuWiring.ts`). A click on an
22
+ * item that is not grayed out closes the menu after its own handlers run.
23
+ *
24
+ * Cost: nothing runs per frame. Opening a menu calls `onOpen` once, so the
25
+ * wiring can refresh check marks and grayed items only when someone looks.
26
+ *
27
+ * A trip is the time from a menu opening with none open to the menus
28
+ * closing. `onTrip` hears it begin and `onDismiss` hears it end with no pick
29
+ * (the analytics in `game/menuWiring.ts`); pointing from menu to menu inside
30
+ * a trip is neither.
31
+ */
32
+ /** How long a press that closed a menu keeps swallowing its own pointerup and
33
+ * click, in milliseconds: long enough for a slow tap, short enough that the
34
+ * next real press always lands. */
35
+ const SWALLOW_MS = 1000;
36
+ /** Keep an open menu inside the window: slide it left by as much as it runs
37
+ * past the right edge (a menu near the end of a phone's bar), and right by
38
+ * as much as it starts before the left edge, which wins when the window is
39
+ * narrower than the menu. One layout read per open. */
40
+ function keepOnScreen(menu) {
41
+ menu.style.translate = "";
42
+ const r = menu.getBoundingClientRect();
43
+ const over = r.right - menu.ownerDocument.documentElement.clientWidth;
44
+ const shift = Math.max(over > 0 ? -over : 0, -r.left);
45
+ if (shift !== 0)
46
+ menu.style.translate = `${shift}px 0`;
47
+ }
48
+ /** An item the player can pick: shown and not grayed out. */
49
+ const PICKABLE = ".mb-item:not([hidden]):not([aria-disabled='true'])";
50
+ /** Whether a title's menu is on the bar: not `hidden` (the title screen
51
+ * hides the menus that need a tower) and not left out by the layout (a
52
+ * layout's `.mb-desktop-only`), on a page that still holds it. One style
53
+ * read per title, on a key press only. */
54
+ function onBar(title) {
55
+ if (!title.isConnected || title.closest("[hidden]"))
56
+ return false;
57
+ const menu = title.parentElement;
58
+ return !menu || menu.ownerDocument.defaultView?.getComputedStyle(menu).display !== "none";
59
+ }
60
+ /** A submenu's title item, and its popup. */
61
+ const SUB_TITLE = ".mb-sub-title";
62
+ const SUB_POP = ".mb-subpop";
63
+ class MenuBar {
64
+ constructor(root, opts = {}) {
65
+ this.root = root;
66
+ this.opts = opts;
67
+ this.openTitle = null;
68
+ /** The sub title whose submenu is open, or null. */
69
+ this.openSubTitle = null;
70
+ /** Whether the last press in a menu was a mouse's (a tap toggles a submenu's title). */
71
+ this.mouseDown = false;
72
+ /** Until when a press that closed a menu still swallows its pointerup and click. */
73
+ this.swallowUntil = -Infinity;
74
+ /** The menus this trip has shown. */
75
+ this.tripMenus = new Set();
76
+ this.titles = [...root.querySelectorAll(".mb-title")];
77
+ for (const title of this.titles) {
78
+ // A keyboard press on a focused title arrives as a click with no
79
+ // pointer behind it (`detail` 0).
80
+ title.addEventListener("click", (e) => this.openTitle === title ? this.close(true, "title") : this.open(title, false, e.detail === 0 ? "keys" : "click"));
81
+ // A mouse switches menus by pointing. A finger's tap also fires
82
+ // pointerenter just before its click, which would open the menu and
83
+ // then close it again, so a tap switches by its click alone.
84
+ title.addEventListener("pointerenter", (e) => {
85
+ if (e.pointerType !== "mouse")
86
+ return;
87
+ if (this.openTitle && this.openTitle !== title)
88
+ this.open(title, false);
89
+ });
90
+ title.addEventListener("keydown", (e) => this.titleKey(e, title));
91
+ const menu = this.menuOf(title);
92
+ menu?.addEventListener("keydown", (e) => this.menuKey(e, title));
93
+ // After the item's own click handlers (they were added at wiring time,
94
+ // before this bubbling listener on the popup runs).
95
+ menu?.addEventListener("click", (e) => {
96
+ const item = e.target instanceof Element ? e.target.closest(".mb-item") : null;
97
+ if (!item || item.getAttribute("aria-disabled") === "true")
98
+ return;
99
+ if (!item.matches(SUB_TITLE))
100
+ this.close();
101
+ // A mouse already opened it by pointing, so its click keeps it open.
102
+ // A tap or a key toggles it, and a key also moves into it.
103
+ else if (this.mouseDown && e.detail > 0)
104
+ this.openSub(item, false);
105
+ else
106
+ this.toggleSub(item, e.detail === 0);
107
+ });
108
+ menu?.addEventListener("pointerdown", (e) => (this.mouseDown = e.pointerType === "mouse"));
109
+ // A mouse opens a submenu by pointing at its title, and closes it by
110
+ // pointing at another item of the same menu.
111
+ menu?.addEventListener("pointerover", (e) => {
112
+ if (e.pointerType !== "mouse" || !(e.target instanceof Element))
113
+ return;
114
+ const item = e.target.closest(".mb-item");
115
+ if (!item || item.closest(SUB_POP))
116
+ return;
117
+ if (item.matches(SUB_TITLE))
118
+ this.openSub(item, false);
119
+ else
120
+ this.closeSub(false);
121
+ });
122
+ }
123
+ const doc = root.ownerDocument;
124
+ const win = doc.defaultView;
125
+ // A press outside the bar only closes the open menu, as a 1995 menu does:
126
+ // caught on the way down (capture, on the window, before the tower's own
127
+ // listeners), it never reaches what is under it, and neither do its
128
+ // pointerup and click, so closing a menu cannot also build on the tower.
129
+ const outside = (e) => !(e.target instanceof Node && root.contains(e.target));
130
+ win?.addEventListener("pointerdown", (e) => {
131
+ if (!this.openTitle || !outside(e))
132
+ return;
133
+ this.close(true, "outside");
134
+ this.swallowUntil = e.timeStamp + SWALLOW_MS;
135
+ e.preventDefault();
136
+ e.stopPropagation();
137
+ }, true);
138
+ const swallow = (e) => {
139
+ if (e.timeStamp > this.swallowUntil || !outside(e))
140
+ return;
141
+ if (e.type === "click")
142
+ this.swallowUntil = -Infinity;
143
+ e.preventDefault();
144
+ e.stopPropagation();
145
+ };
146
+ win?.addEventListener("pointerup", swallow, true);
147
+ win?.addEventListener("click", swallow, true);
148
+ doc.addEventListener("keydown", (e) => this.accelerator(e));
149
+ win?.addEventListener("blur", () => this.close(true, "blur"));
150
+ }
151
+ /** The title whose menu is open, or null. */
152
+ current() {
153
+ return this.openTitle;
154
+ }
155
+ /** How many menus this trip has shown (0 with none open). */
156
+ browsed() {
157
+ return this.tripMenus.size;
158
+ }
159
+ /** Open `title`'s menu, closing any other; `focusItem` focuses its first
160
+ * item. `via` says how a trip that this open begins was started. */
161
+ open(title, focusItem, via = "click") {
162
+ const menu = this.menuOf(title);
163
+ if (!menu)
164
+ return;
165
+ if (this.openTitle && this.openTitle !== title)
166
+ this.hide(false);
167
+ else if (!this.openTitle) {
168
+ this.tripMenus.clear();
169
+ this.opts.onTrip?.(title, via);
170
+ }
171
+ this.tripMenus.add(title);
172
+ this.opts.onOpen?.(menu);
173
+ menu.hidden = false;
174
+ keepOnScreen(menu);
175
+ title.setAttribute("aria-expanded", "true");
176
+ this.openTitle = title;
177
+ if (focusItem)
178
+ this.items(menu)[0]?.focus();
179
+ }
180
+ /** Close the open menu, ending the trip. `refocus` gives the focus back to
181
+ * its title when the focus was inside the menu, so the keyboard is not
182
+ * dropped. `how` is `pick` when an item closed it. */
183
+ close(refocus = true, how = "pick") {
184
+ const title = this.openTitle;
185
+ if (!title)
186
+ return;
187
+ this.hide(refocus);
188
+ if (how !== "pick")
189
+ this.opts.onDismiss?.(title, how, this.tripMenus.size);
190
+ this.tripMenus.clear();
191
+ }
192
+ /** Hide the open menu without ending the trip. */
193
+ hide(refocus) {
194
+ const title = this.openTitle;
195
+ if (!title)
196
+ return;
197
+ const menu = this.menuOf(title);
198
+ const hadFocus = !!menu && menu.contains(this.root.ownerDocument.activeElement);
199
+ this.closeSub(false);
200
+ if (menu)
201
+ menu.hidden = true;
202
+ title.setAttribute("aria-expanded", "false");
203
+ this.openTitle = null;
204
+ if (refocus && hadFocus)
205
+ title.focus();
206
+ }
207
+ menuOf(title) {
208
+ const id = title.getAttribute("aria-controls");
209
+ return id ? this.root.ownerDocument.getElementById(id) : null;
210
+ }
211
+ /** The pickable items of `menu`, leaving out those of a submenu inside it. */
212
+ items(menu) {
213
+ return [...menu.querySelectorAll(PICKABLE)].filter((i) => i.closest(`${SUB_POP}, .mb-pop`) === menu);
214
+ }
215
+ /** The submenu a sub title opens. */
216
+ subOf(title) {
217
+ const id = title.getAttribute("aria-controls");
218
+ return id ? this.root.ownerDocument.getElementById(id) : null;
219
+ }
220
+ /** Open `title`'s submenu; `focusItem` focuses its first item. */
221
+ openSub(title, focusItem) {
222
+ const sub = this.subOf(title);
223
+ if (!sub || title.getAttribute("aria-disabled") === "true")
224
+ return;
225
+ if (this.openSubTitle && this.openSubTitle !== title)
226
+ this.closeSub(false);
227
+ sub.hidden = false;
228
+ keepOnScreen(sub);
229
+ title.setAttribute("aria-expanded", "true");
230
+ this.openSubTitle = title;
231
+ if (focusItem)
232
+ this.items(sub)[0]?.focus();
233
+ }
234
+ /** Close the open submenu; `refocus` puts the focus back on its title. */
235
+ closeSub(refocus) {
236
+ const title = this.openSubTitle;
237
+ if (!title)
238
+ return;
239
+ const sub = this.subOf(title);
240
+ if (sub)
241
+ sub.hidden = true;
242
+ title.setAttribute("aria-expanded", "false");
243
+ this.openSubTitle = null;
244
+ if (refocus)
245
+ title.focus();
246
+ }
247
+ toggleSub(title, focusItem) {
248
+ if (this.openSubTitle === title)
249
+ this.closeSub(true);
250
+ else
251
+ this.openSub(title, focusItem);
252
+ }
253
+ neighbor(title, step) {
254
+ const shown = this.titles.filter(onBar);
255
+ const at = shown.indexOf(title);
256
+ return shown[(at + step + shown.length) % shown.length] ?? title;
257
+ }
258
+ titleKey(e, title) {
259
+ if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
260
+ const next = this.neighbor(title, e.key === "ArrowRight" ? 1 : -1);
261
+ next.focus();
262
+ if (this.openTitle)
263
+ this.open(next, false);
264
+ }
265
+ else if (e.key === "ArrowDown" || e.key === "Enter" || e.key === " ") {
266
+ this.open(title, true, "keys");
267
+ }
268
+ else if (e.key === "Escape" && this.openTitle) {
269
+ this.close(true, "escape");
270
+ title.focus();
271
+ }
272
+ else {
273
+ return;
274
+ }
275
+ e.preventDefault();
276
+ e.stopPropagation();
277
+ }
278
+ menuKey(e, title) {
279
+ const top = this.menuOf(title);
280
+ if (!top)
281
+ return;
282
+ const active = this.root.ownerDocument.activeElement;
283
+ const inSub = !!this.openSubTitle && !!active?.closest(SUB_POP);
284
+ if (inSub && (e.key === "ArrowLeft" || e.key === "Escape")) {
285
+ this.closeSub(true);
286
+ e.preventDefault();
287
+ e.stopPropagation();
288
+ return;
289
+ }
290
+ if (!inSub && e.key === "ArrowRight" && active?.matches(SUB_TITLE)) {
291
+ this.openSub(active, true);
292
+ e.preventDefault();
293
+ e.stopPropagation();
294
+ return;
295
+ }
296
+ const menu = inSub ? this.subOf(this.openSubTitle) ?? top : top;
297
+ const items = this.items(menu);
298
+ const at = items.indexOf(this.root.ownerDocument.activeElement);
299
+ const focusAt = (i) => items[(i + items.length) % items.length]?.focus();
300
+ switch (e.key) {
301
+ case "ArrowDown":
302
+ focusAt(at + 1);
303
+ break;
304
+ case "ArrowUp":
305
+ focusAt(at < 0 ? -1 : at - 1);
306
+ break;
307
+ case "Home":
308
+ focusAt(0);
309
+ break;
310
+ case "End":
311
+ focusAt(-1);
312
+ break;
313
+ case "ArrowRight":
314
+ case "ArrowLeft": {
315
+ const next = this.neighbor(title, e.key === "ArrowRight" ? 1 : -1);
316
+ this.open(next, true);
317
+ break;
318
+ }
319
+ case "Escape":
320
+ this.close(true, "escape");
321
+ title.focus();
322
+ break;
323
+ case "Tab":
324
+ this.close(false, "tab");
325
+ return; // let the focus move on
326
+ default:
327
+ if (!this.pickByKey(items, e))
328
+ return;
329
+ break;
330
+ }
331
+ e.preventDefault();
332
+ e.stopPropagation();
333
+ }
334
+ /** Pick the item of `items` whose underlined character is the key pressed
335
+ * (no Ctrl, Alt or Cmd). A keyboard pick, so its click has no pointer. */
336
+ pickByKey(items, e) {
337
+ if (e.ctrlKey || e.altKey || e.metaKey || e.key.length !== 1)
338
+ return false;
339
+ const key = e.key.toLowerCase();
340
+ const item = items.find((i) => i.querySelector("u")?.textContent?.toLowerCase() === key);
341
+ item?.click();
342
+ return !!item;
343
+ }
344
+ /** Alt with a title's underlined letter opens that menu, unless a dialog is
345
+ * open: the menus act on the tower, and a dialog holds the screen. */
346
+ accelerator(e) {
347
+ if (!e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.key.length !== 1)
348
+ return;
349
+ if (this.root.ownerDocument.querySelector("dialog[open]"))
350
+ return;
351
+ const letter = e.key.toLowerCase();
352
+ const title = this.titles.find((t) => onBar(t) && t.querySelector("u")?.textContent?.toLowerCase() === letter);
353
+ if (!title)
354
+ return;
355
+ e.preventDefault();
356
+ this.open(title, true, "alt");
357
+ }
358
+ }
359
+
360
+ export { MenuBar };
361
+ //# sourceMappingURL=menuBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menuBar.js","sources":["../../src/ui/menuBar.ts"],"sourcesContent":["/**\n * The Win95 menu bar's behavior (index.html `#menubar`): a title opens its\n * menu, and while one is open, pointing at another title switches to it, the\n * way a 1995 desktop menu bar works. The keyboard follows the WAI-ARIA\n * menubar keys (the markup is a row of menu buttons, each with its menu):\n * Left and Right move between titles, Down (or Enter or Space) on a title\n * opens it, Up and Down move inside a menu, Home and End jump to its ends,\n * Escape closes it and gives the focus back to its title, and Tab closes it.\n * Alt with a title's underlined letter opens that menu.\n *\n * An item can open a submenu (`.mb-sub-title`, File > Open Recent): a click,\n * Enter, Space or Right on it opens the submenu beside it (under it on a\n * phone), a mouse opens it by pointing, Left or Escape inside it goes back to\n * its title, and pointing at another item closes it. A submenu's title is\n * never a pick; the items inside it are. A grayed title opens nothing.\n *\n * An item with an underlined character (Open Recent's numbers) is picked by\n * pressing that key while its menu has the focus, as in a 1995 menu.\n *\n * What an item does is not this module's business: each item is a real\n * button whose click the game wires (`game/menuWiring.ts`). A click on an\n * item that is not grayed out closes the menu after its own handlers run.\n *\n * Cost: nothing runs per frame. Opening a menu calls `onOpen` once, so the\n * wiring can refresh check marks and grayed items only when someone looks.\n *\n * A trip is the time from a menu opening with none open to the menus\n * closing. `onTrip` hears it begin and `onDismiss` hears it end with no pick\n * (the analytics in `game/menuWiring.ts`); pointing from menu to menu inside\n * a trip is neither.\n */\n\n/** How a trip into the menus began: a click on a title, the keyboard on a\n * focused title, or Alt with a title's underlined letter. */\nexport type MenuOpenVia = \"click\" | \"keys\" | \"alt\";\n/** How a trip ended without a pick: a press outside the menus, Escape, Tab,\n * a click on the open menu's own title, or the window losing focus. */\nexport type MenuDismissHow = \"outside\" | \"escape\" | \"tab\" | \"title\" | \"blur\";\n\n/** How long a press that closed a menu keeps swallowing its own pointerup and\n * click, in milliseconds: long enough for a slow tap, short enough that the\n * next real press always lands. */\nconst SWALLOW_MS = 1000;\n\n/** Keep an open menu inside the window: slide it left by as much as it runs\n * past the right edge (a menu near the end of a phone's bar), and right by\n * as much as it starts before the left edge, which wins when the window is\n * narrower than the menu. One layout read per open. */\nfunction keepOnScreen(menu: HTMLElement): void {\n menu.style.translate = \"\";\n const r = menu.getBoundingClientRect();\n const over = r.right - menu.ownerDocument.documentElement.clientWidth;\n const shift = Math.max(over > 0 ? -over : 0, -r.left);\n if (shift !== 0) menu.style.translate = `${shift}px 0`;\n}\n\n/** An item the player can pick: shown and not grayed out. */\nconst PICKABLE = \".mb-item:not([hidden]):not([aria-disabled='true'])\";\n\n/** Whether a title's menu is on the bar: not `hidden` (the title screen\n * hides the menus that need a tower) and not left out by the layout (a\n * layout's `.mb-desktop-only`), on a page that still holds it. One style\n * read per title, on a key press only. */\nfunction onBar(title: HTMLElement): boolean {\n if (!title.isConnected || title.closest(\"[hidden]\")) return false;\n const menu = title.parentElement;\n return !menu || menu.ownerDocument.defaultView?.getComputedStyle(menu).display !== \"none\";\n}\n\n/** A submenu's title item, and its popup. */\nconst SUB_TITLE = \".mb-sub-title\";\nconst SUB_POP = \".mb-subpop\";\n\n/** How the menus closed: an item was picked, or one of the dismissals. */\nexport type MenuCloseHow = \"pick\" | MenuDismissHow;\n\nexport interface MenuBarOptions {\n /** Runs as a menu opens, before it shows, with the menu's popup. */\n readonly onOpen?: (menu: HTMLElement) => void;\n /** A trip begins: `title`'s menu opened with none open before it. */\n readonly onTrip?: (title: HTMLButtonElement, via: MenuOpenVia) => void;\n /** A trip ended with no pick; `title` is the menu that was open. */\n readonly onDismiss?: (title: HTMLButtonElement, how: MenuDismissHow, browsed: number) => void;\n}\n\nexport class MenuBar {\n private readonly titles: HTMLButtonElement[];\n private openTitle: HTMLButtonElement | null = null;\n /** The sub title whose submenu is open, or null. */\n private openSubTitle: HTMLElement | null = null;\n /** Whether the last press in a menu was a mouse's (a tap toggles a submenu's title). */\n private mouseDown = false;\n /** Until when a press that closed a menu still swallows its pointerup and click. */\n private swallowUntil = -Infinity;\n /** The menus this trip has shown. */\n private readonly tripMenus = new Set<HTMLButtonElement>();\n\n constructor(\n private readonly root: HTMLElement,\n private readonly opts: MenuBarOptions = {},\n ) {\n this.titles = [...root.querySelectorAll<HTMLButtonElement>(\".mb-title\")];\n for (const title of this.titles) {\n // A keyboard press on a focused title arrives as a click with no\n // pointer behind it (`detail` 0).\n title.addEventListener(\"click\", (e) =>\n this.openTitle === title ? this.close(true, \"title\") : this.open(title, false, e.detail === 0 ? \"keys\" : \"click\"),\n );\n // A mouse switches menus by pointing. A finger's tap also fires\n // pointerenter just before its click, which would open the menu and\n // then close it again, so a tap switches by its click alone.\n title.addEventListener(\"pointerenter\", (e) => {\n if (e.pointerType !== \"mouse\") return;\n if (this.openTitle && this.openTitle !== title) this.open(title, false);\n });\n title.addEventListener(\"keydown\", (e) => this.titleKey(e, title));\n const menu = this.menuOf(title);\n menu?.addEventListener(\"keydown\", (e) => this.menuKey(e, title));\n // After the item's own click handlers (they were added at wiring time,\n // before this bubbling listener on the popup runs).\n menu?.addEventListener(\"click\", (e) => {\n const item = e.target instanceof Element ? e.target.closest(\".mb-item\") : null;\n if (!item || item.getAttribute(\"aria-disabled\") === \"true\") return;\n if (!item.matches(SUB_TITLE)) this.close();\n // A mouse already opened it by pointing, so its click keeps it open.\n // A tap or a key toggles it, and a key also moves into it.\n else if (this.mouseDown && (e as MouseEvent).detail > 0) this.openSub(item as HTMLElement, false);\n else this.toggleSub(item as HTMLElement, (e as MouseEvent).detail === 0);\n });\n menu?.addEventListener(\"pointerdown\", (e) => (this.mouseDown = e.pointerType === \"mouse\"));\n // A mouse opens a submenu by pointing at its title, and closes it by\n // pointing at another item of the same menu.\n menu?.addEventListener(\"pointerover\", (e) => {\n if (e.pointerType !== \"mouse\" || !(e.target instanceof Element)) return;\n const item = e.target.closest(\".mb-item\");\n if (!item || item.closest(SUB_POP)) return;\n if (item.matches(SUB_TITLE)) this.openSub(item as HTMLElement, false);\n else this.closeSub(false);\n });\n }\n const doc = root.ownerDocument;\n const win = doc.defaultView;\n // A press outside the bar only closes the open menu, as a 1995 menu does:\n // caught on the way down (capture, on the window, before the tower's own\n // listeners), it never reaches what is under it, and neither do its\n // pointerup and click, so closing a menu cannot also build on the tower.\n const outside = (e: Event) => !(e.target instanceof Node && root.contains(e.target));\n win?.addEventListener(\n \"pointerdown\",\n (e) => {\n if (!this.openTitle || !outside(e)) return;\n this.close(true, \"outside\");\n this.swallowUntil = e.timeStamp + SWALLOW_MS;\n e.preventDefault();\n e.stopPropagation();\n },\n true,\n );\n const swallow = (e: Event) => {\n if (e.timeStamp > this.swallowUntil || !outside(e)) return;\n if (e.type === \"click\") this.swallowUntil = -Infinity;\n e.preventDefault();\n e.stopPropagation();\n };\n win?.addEventListener(\"pointerup\", swallow, true);\n win?.addEventListener(\"click\", swallow, true);\n doc.addEventListener(\"keydown\", (e) => this.accelerator(e));\n win?.addEventListener(\"blur\", () => this.close(true, \"blur\"));\n }\n\n /** The title whose menu is open, or null. */\n current(): HTMLButtonElement | null {\n return this.openTitle;\n }\n\n /** How many menus this trip has shown (0 with none open). */\n browsed(): number {\n return this.tripMenus.size;\n }\n\n /** Open `title`'s menu, closing any other; `focusItem` focuses its first\n * item. `via` says how a trip that this open begins was started. */\n open(title: HTMLButtonElement, focusItem: boolean, via: MenuOpenVia = \"click\"): void {\n const menu = this.menuOf(title);\n if (!menu) return;\n if (this.openTitle && this.openTitle !== title) this.hide(false);\n else if (!this.openTitle) {\n this.tripMenus.clear();\n this.opts.onTrip?.(title, via);\n }\n this.tripMenus.add(title);\n this.opts.onOpen?.(menu);\n menu.hidden = false;\n keepOnScreen(menu);\n title.setAttribute(\"aria-expanded\", \"true\");\n this.openTitle = title;\n if (focusItem) this.items(menu)[0]?.focus();\n }\n\n /** Close the open menu, ending the trip. `refocus` gives the focus back to\n * its title when the focus was inside the menu, so the keyboard is not\n * dropped. `how` is `pick` when an item closed it. */\n close(refocus = true, how: MenuCloseHow = \"pick\"): void {\n const title = this.openTitle;\n if (!title) return;\n this.hide(refocus);\n if (how !== \"pick\") this.opts.onDismiss?.(title, how, this.tripMenus.size);\n this.tripMenus.clear();\n }\n\n /** Hide the open menu without ending the trip. */\n private hide(refocus: boolean): void {\n const title = this.openTitle;\n if (!title) return;\n const menu = this.menuOf(title);\n const hadFocus = !!menu && menu.contains(this.root.ownerDocument.activeElement);\n this.closeSub(false);\n if (menu) menu.hidden = true;\n title.setAttribute(\"aria-expanded\", \"false\");\n this.openTitle = null;\n if (refocus && hadFocus) title.focus();\n }\n\n private menuOf(title: HTMLButtonElement): HTMLElement | null {\n const id = title.getAttribute(\"aria-controls\");\n return id ? this.root.ownerDocument.getElementById(id) : null;\n }\n\n /** The pickable items of `menu`, leaving out those of a submenu inside it. */\n private items(menu: HTMLElement): HTMLElement[] {\n return [...menu.querySelectorAll<HTMLElement>(PICKABLE)].filter((i) => i.closest(`${SUB_POP}, .mb-pop`) === menu);\n }\n\n /** The submenu a sub title opens. */\n private subOf(title: HTMLElement): HTMLElement | null {\n const id = title.getAttribute(\"aria-controls\");\n return id ? this.root.ownerDocument.getElementById(id) : null;\n }\n\n /** Open `title`'s submenu; `focusItem` focuses its first item. */\n private openSub(title: HTMLElement, focusItem: boolean): void {\n const sub = this.subOf(title);\n if (!sub || title.getAttribute(\"aria-disabled\") === \"true\") return;\n if (this.openSubTitle && this.openSubTitle !== title) this.closeSub(false);\n sub.hidden = false;\n keepOnScreen(sub);\n title.setAttribute(\"aria-expanded\", \"true\");\n this.openSubTitle = title;\n if (focusItem) this.items(sub)[0]?.focus();\n }\n\n /** Close the open submenu; `refocus` puts the focus back on its title. */\n private closeSub(refocus: boolean): void {\n const title = this.openSubTitle;\n if (!title) return;\n const sub = this.subOf(title);\n if (sub) sub.hidden = true;\n title.setAttribute(\"aria-expanded\", \"false\");\n this.openSubTitle = null;\n if (refocus) title.focus();\n }\n\n private toggleSub(title: HTMLElement, focusItem: boolean): void {\n if (this.openSubTitle === title) this.closeSub(true);\n else this.openSub(title, focusItem);\n }\n\n private neighbor(title: HTMLButtonElement, step: 1 | -1): HTMLButtonElement {\n const shown = this.titles.filter(onBar);\n const at = shown.indexOf(title);\n return shown[(at + step + shown.length) % shown.length] ?? title;\n }\n\n private titleKey(e: KeyboardEvent, title: HTMLButtonElement): void {\n if (e.key === \"ArrowRight\" || e.key === \"ArrowLeft\") {\n const next = this.neighbor(title, e.key === \"ArrowRight\" ? 1 : -1);\n next.focus();\n if (this.openTitle) this.open(next, false);\n } else if (e.key === \"ArrowDown\" || e.key === \"Enter\" || e.key === \" \") {\n this.open(title, true, \"keys\");\n } else if (e.key === \"Escape\" && this.openTitle) {\n this.close(true, \"escape\");\n title.focus();\n } else {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n }\n\n private menuKey(e: KeyboardEvent, title: HTMLButtonElement): void {\n const top = this.menuOf(title);\n if (!top) return;\n const active = this.root.ownerDocument.activeElement as HTMLElement | null;\n const inSub = !!this.openSubTitle && !!active?.closest(SUB_POP);\n if (inSub && (e.key === \"ArrowLeft\" || e.key === \"Escape\")) {\n this.closeSub(true);\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (!inSub && e.key === \"ArrowRight\" && active?.matches(SUB_TITLE)) {\n this.openSub(active, true);\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n const menu = inSub ? this.subOf(this.openSubTitle!) ?? top : top;\n const items = this.items(menu);\n const at = items.indexOf(this.root.ownerDocument.activeElement as HTMLElement);\n const focusAt = (i: number) => items[(i + items.length) % items.length]?.focus();\n switch (e.key) {\n case \"ArrowDown\": focusAt(at + 1); break;\n case \"ArrowUp\": focusAt(at < 0 ? -1 : at - 1); break;\n case \"Home\": focusAt(0); break;\n case \"End\": focusAt(-1); break;\n case \"ArrowRight\":\n case \"ArrowLeft\": {\n const next = this.neighbor(title, e.key === \"ArrowRight\" ? 1 : -1);\n this.open(next, true);\n break;\n }\n case \"Escape\":\n this.close(true, \"escape\");\n title.focus();\n break;\n case \"Tab\":\n this.close(false, \"tab\");\n return; // let the focus move on\n default:\n if (!this.pickByKey(items, e)) return;\n break;\n }\n e.preventDefault();\n e.stopPropagation();\n }\n\n /** Pick the item of `items` whose underlined character is the key pressed\n * (no Ctrl, Alt or Cmd). A keyboard pick, so its click has no pointer. */\n private pickByKey(items: readonly HTMLElement[], e: KeyboardEvent): boolean {\n if (e.ctrlKey || e.altKey || e.metaKey || e.key.length !== 1) return false;\n const key = e.key.toLowerCase();\n const item = items.find((i) => i.querySelector(\"u\")?.textContent?.toLowerCase() === key);\n item?.click();\n return !!item;\n }\n\n /** Alt with a title's underlined letter opens that menu, unless a dialog is\n * open: the menus act on the tower, and a dialog holds the screen. */\n private accelerator(e: KeyboardEvent): void {\n if (!e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.key.length !== 1) return;\n if (this.root.ownerDocument.querySelector(\"dialog[open]\")) return;\n const letter = e.key.toLowerCase();\n const title = this.titles.find((t) => onBar(t) && t.querySelector(\"u\")?.textContent?.toLowerCase() === letter);\n if (!title) return;\n e.preventDefault();\n this.open(title, true, \"alt\");\n }\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AASH;;AAEoC;AACpC,MAAM,UAAU,GAAG,IAAI;AAEvB;;;AAGwD;AACxD,SAAS,YAAY,CAAC,IAAiB,EAAA;AACrC,IAAA,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE;AACzB,IAAA,MAAM,CAAC,GAAG,IAAI,CAAC,qBAAqB,EAAE;AACtC,IAAA,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,aAA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AK,GAAG,CAAC;QACxF,IAAI,EAAE,KAAK,EAAE;QACb,OAAO,CAAC,CAAC,IAAI;IACf;AAEA;AACuE;AAC/D,IAAA,WAAW,CAAC,CAAgB,EAAA;QAClC,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;YAAE;QAC7E,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,cAAc,CAAC;YAAE;QAC3D,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE;AAClC,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,MAAM,CAAC;AAC9G,QAAA,IAAI,CAAC,KAAK;YAAE;QACZ,CAAC,CAAC,cAAc,EAAE;QAClB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;IAC/B;AACD;;"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Who gets the shared `<dialog>`, and what happens to whoever is waiting.
3
+ *
4
+ * One dialog element serves the whole app, so a surface that opens
5
+ * asynchronously (a fidelity report, which lands whenever `FileReader`
6
+ * finishes) can arrive to find the dialog already taken. The old rule was "is a
7
+ * modal open", which conflated two different questions and refused perfectly
8
+ * safe openings, then reported the refusal with a toast: a `<dialog>` renders in
9
+ * the browser's top layer and paints over the toast rail at any z-index, so that
10
+ * message could only ever fire when something was guaranteed to be covering it
11
+ * (GH #658). Its whole content was what-to-do-next, delivered where nobody
12
+ * could read it, and the cost was a discarded tower.
13
+ *
14
+ * The split this module owns:
15
+ *
16
+ * - **Displaceable.** The dialog owns no pending decision and no unsaved
17
+ * work, so an arriving report may simply take the dialog.
18
+ * - **Protected.** Everything else. Classification FAILS SAFE: protected
19
+ * unless an opener says otherwise, so a dialog added later defaults to
20
+ * protected and the cost of forgetting is an unnecessary wait rather than
21
+ * lost player work.
22
+ *
23
+ * A report that finds a protected dialog waits on a leash tied to THAT dialog
24
+ * resolving, never open ended: it closes over a fully parsed tower, and a wait
25
+ * held across a tower swap or a second import would eventually adopt the wrong
26
+ * tower or ambush a player who has moved on. When the leash breaks, the parsed
27
+ * tower is dropped and the player is told so somewhere they can actually see.
28
+ */
29
+ /** Per-open modal declarations. `displaceable` is the only one, and only as an
30
+ * opt-in, so omitting it is the protective choice. */
31
+ export interface ModalOpts {
32
+ /** This dialog owns no pending decision and no unsaved work, so a report
33
+ * arriving behind it may replace it outright. Informational dialogs only. */
34
+ displaceable?: boolean;
35
+ /** Run if this dialog is replaced rather than closed on its own terms.
36
+ *
37
+ * A dialog that holds something the player would miss uses this to say so
38
+ * before it goes. It is NOT a veto and NOT a stacking rule: the replacement
39
+ * happens either way, which keeps this short of the general precedence
40
+ * system the spec rules out. It exists because a fidelity report that is
41
+ * already on screen holds a fully parsed tower, and losing that in silence
42
+ * is the same defect as losing it while it waits. */
43
+ onDisplaced?: () => void;
44
+ }
45
+ /** A wait for one specific dialog to resolve. */
46
+ /** Why a wait ended without the dialog it was tied to resolving. */
47
+ export type BrokenReason = "displaced" | "superseded" | "tower-swapped";
48
+ export declare class ModalPrecedence {
49
+ /** Whether the dialog on screen declared itself displaceable. Reset on every
50
+ * open and every close, so it can never outlive the dialog that set it. */
51
+ private displaceable;
52
+ /** The single pending wait. One at a time: a second waiter breaks the first
53
+ * rather than queueing, since two parsed towers racing for one dialog is the
54
+ * ambush this design exists to prevent. */
55
+ private leash;
56
+ /** A line to mount into the next dialog, set when something must be said
57
+ * while the shared dialog is mid-replace and has no body to write into. */
58
+ private pendingNotice;
59
+ /** The incumbent dialog's goodbye, if it registered one. */
60
+ private onDisplaced;
61
+ /** A dialog is mounting. `displacing` is whether one was already on screen. */
62
+ opening(displacing: boolean, opts: ModalOpts): void;
63
+ /** A dialog closed. `wasOpen` is whether one actually was: `closeModal()` is
64
+ * idempotent and several handlers call it defensively, and a stray call with
65
+ * nothing on screen must not fire a waiting report at an arbitrary moment.
66
+ *
67
+ * The leash is taken BEFORE its callback runs, because that callback
68
+ * typically opens the report, and a leash still in place would then read as
69
+ * broken by its own waiter. A held notice is dropped here too: it was meant
70
+ * for a dialog that no longer exists, and carrying it forward would stamp it
71
+ * into an unrelated window opened later. */
72
+ closed(wasOpen: boolean): void;
73
+ /** True when the dialog on screen owns something worth protecting. */
74
+ ownsPendingWork(isOpen: boolean): boolean;
75
+ /** Wait for the current dialog to resolve; `onBroken` runs if it never does,
76
+ * and is told WHY so the player is not given a reason that did not happen. */
77
+ wait(onResolve: () => void, onBroken: (reason: BrokenReason) => void): void;
78
+ /** The tower was swapped out from under whatever is waiting.
79
+ *
80
+ * A report closes over a fully parsed Simulation, so a wait that survives a
81
+ * swap would open over a tower it was never parsed against and "Open tower"
82
+ * would adopt a state that no longer exists. The spec names this as one of
83
+ * the three things that must BREAK a leash, not resolve it, and it cannot be
84
+ * inferred from dialog lifecycle alone: the New Tower dialog closes normally
85
+ * and swaps the tower afterwards, which reads as a clean resolution. */
86
+ towerSwapped(): void;
87
+ /** Hold a line for the next dialog to mount. */
88
+ deferNotice(text: string, kind?: NoticeKind): void;
89
+ /** Mount any held line into a dialog body that has just been built. */
90
+ drainNotice(box: HTMLElement): void;
91
+ private breakLeash;
92
+ }
93
+ /** Route a line to wherever the player can actually read it right now.
94
+ *
95
+ * A toast cannot carry a message raised while a dialog is up: the `<dialog>`
96
+ * top layer paints over the rail at any z-index, which is the defect itself.
97
+ * So it goes into the live dialog body, or is held for the next one to mount
98
+ * when the shared dialog is mid-replace and has no body, and only falls back
99
+ * to the caller's toast when nothing is on screen and a toast is visible. */
100
+ export declare function routeNotice(dialog: HTMLDialogElement, precedence: ModalPrecedence, text: string, toast: (text: string) => void, again?: boolean, kind?: NoticeKind): void;
101
+ /** What a notice says about the game: a failure, or plain or good news. */
102
+ export type NoticeKind = "bad" | "info" | "good";
103
+ /** Put a notice at the top of a dialog body, under the title bar where the eye
104
+ * lands first. A failure is drawn in danger ink with `role="alert"`, so it
105
+ * interrupts; plain and good news use ordinary ink and `role="status"`, so a
106
+ * late "it finished after all" is neither shown nor announced as an error
107
+ * (#785). */
108
+ export declare function mountNotice(box: HTMLElement, text: string, kind?: NoticeKind): void;