@mapvx/web-js 4.0.2 → 4.0.3-dev.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 (339) hide show
  1. package/README.md +7 -7
  2. package/dist/cjs/index.js +4 -2
  3. package/dist/es/assets/icons.d.ts +0 -1
  4. package/dist/es/assets/icons.js +0 -50
  5. package/dist/es/config/draco.d.ts +0 -1
  6. package/dist/es/config/draco.js +0 -10
  7. package/dist/es/config/sdkConfig.d.ts +0 -1
  8. package/dist/es/config/sdkConfig.js +0 -1
  9. package/dist/es/controllers/markerLayoutController.d.ts +0 -1
  10. package/dist/es/controllers/markerLayoutController.js +0 -103
  11. package/dist/es/controllers/routeController.d.ts +0 -1
  12. package/dist/es/controllers/routeController.js +1 -473
  13. package/dist/es/domain/models/_internal.d.ts +0 -1
  14. package/dist/es/domain/models/_internal.js +0 -8
  15. package/dist/es/domain/models/animation.d.ts +0 -1
  16. package/dist/es/domain/models/animation.js +0 -6
  17. package/dist/es/domain/models/banner.d.ts +0 -1
  18. package/dist/es/domain/models/banner.js +0 -10
  19. package/dist/es/domain/models/campaign.d.ts +0 -1
  20. package/dist/es/domain/models/campaign.js +0 -29
  21. package/dist/es/domain/models/categories.d.ts +0 -1
  22. package/dist/es/domain/models/categories.js +0 -20
  23. package/dist/es/domain/models/circle.d.ts +0 -1
  24. package/dist/es/domain/models/circle.js +0 -118
  25. package/dist/es/domain/models/cityFilterOption.d.ts +0 -1
  26. package/dist/es/domain/models/cityFilterOption.js +0 -1
  27. package/dist/es/domain/models/configuration.d.ts +0 -1
  28. package/dist/es/domain/models/configuration.js +0 -1
  29. package/dist/es/domain/models/cssCustomization.d.ts +0 -1
  30. package/dist/es/domain/models/cssCustomization.js +0 -1
  31. package/dist/es/domain/models/fitOptions.d.ts +0 -1
  32. package/dist/es/domain/models/fitOptions.js +0 -1
  33. package/dist/es/domain/models/innerFloors.d.ts +0 -1
  34. package/dist/es/domain/models/innerFloors.js +0 -1
  35. package/dist/es/domain/models/institution.d.ts +0 -1
  36. package/dist/es/domain/models/institution.js +0 -26
  37. package/dist/es/domain/models/latLng.d.ts +0 -1
  38. package/dist/es/domain/models/latLng.js +0 -1
  39. package/dist/es/domain/models/location.d.ts +0 -1
  40. package/dist/es/domain/models/location.js +0 -1
  41. package/dist/es/domain/models/loggeable.d.ts +0 -1
  42. package/dist/es/domain/models/loggeable.js +0 -24
  43. package/dist/es/domain/models/mapCamera.d.ts +0 -1
  44. package/dist/es/domain/models/mapCamera.js +0 -1
  45. package/dist/es/domain/models/mapConfig.d.ts +0 -1
  46. package/dist/es/domain/models/mapConfig.js +1 -17
  47. package/dist/es/domain/models/marker.d.ts +0 -1
  48. package/dist/es/domain/models/marker.js +0 -292
  49. package/dist/es/domain/models/multilanguage.d.ts +0 -1
  50. package/dist/es/domain/models/multilanguage.js +0 -10
  51. package/dist/es/domain/models/openingHours.d.ts +0 -1
  52. package/dist/es/domain/models/openingHours.js +0 -1
  53. package/dist/es/domain/models/place.d.ts +0 -1
  54. package/dist/es/domain/models/place.js +0 -68
  55. package/dist/es/domain/models/platform.d.ts +0 -1
  56. package/dist/es/domain/models/platform.js +0 -1
  57. package/dist/es/domain/models/popover.d.ts +0 -1
  58. package/dist/es/domain/models/popover.js +0 -1
  59. package/dist/es/domain/models/product.d.ts +0 -1
  60. package/dist/es/domain/models/product.js +0 -1
  61. package/dist/es/domain/models/property.d.ts +0 -1
  62. package/dist/es/domain/models/property.js +0 -16
  63. package/dist/es/domain/models/route.d.ts +0 -1
  64. package/dist/es/domain/models/route.js +0 -71
  65. package/dist/es/domain/models/routeConfiguration.d.ts +0 -1
  66. package/dist/es/domain/models/routeConfiguration.js +0 -36
  67. package/dist/es/domain/models/routeInstance.d.ts +0 -1
  68. package/dist/es/domain/models/routeInstance.js +0 -8
  69. package/dist/es/domain/models/routeStyle.d.ts +0 -1
  70. package/dist/es/domain/models/routeStyle.js +0 -1
  71. package/dist/es/domain/models/scene3D.d.ts +0 -1
  72. package/dist/es/domain/models/scene3D.js +0 -1
  73. package/dist/es/domain/models/transport.d.ts +0 -1
  74. package/dist/es/domain/models/transport.js +0 -12
  75. package/dist/es/domain/ports/ICache.d.ts +0 -1
  76. package/dist/es/domain/ports/ICache.js +0 -1
  77. package/dist/es/domain/ports/IHttpClient.d.ts +0 -1
  78. package/dist/es/domain/ports/IHttpClient.js +0 -1
  79. package/dist/es/domain/ports/ILogger.d.ts +0 -1
  80. package/dist/es/domain/ports/ILogger.js +0 -9
  81. package/dist/es/domain/ports/index.d.ts +0 -1
  82. package/dist/es/domain/ports/index.js +0 -5
  83. package/dist/es/index.d.ts +0 -1
  84. package/dist/es/index.js +1 -28
  85. package/dist/es/infrastructure/cache/CacheManager.d.ts +0 -1
  86. package/dist/es/infrastructure/cache/CacheManager.js +0 -94
  87. package/dist/es/infrastructure/cache/LRUCache.d.ts +0 -1
  88. package/dist/es/infrastructure/cache/LRUCache.js +0 -57
  89. package/dist/es/infrastructure/cache/PersistentCache.d.ts +0 -1
  90. package/dist/es/infrastructure/cache/PersistentCache.js +0 -51
  91. package/dist/es/infrastructure/cache/cacheConfig.d.ts +0 -1
  92. package/dist/es/infrastructure/cache/cacheConfig.js +8 -27
  93. package/dist/es/infrastructure/http/FetchHttpClient.d.ts +0 -1
  94. package/dist/es/infrastructure/http/FetchHttpClient.js +0 -36
  95. package/dist/es/infrastructure/logging/MVXLogger.d.ts +0 -1
  96. package/dist/es/infrastructure/logging/MVXLogger.js +0 -37
  97. package/dist/es/interfaces/cache.d.ts +0 -1
  98. package/dist/es/interfaces/cache.js +0 -1
  99. package/dist/es/interfaces/healthResponse.d.ts +0 -1
  100. package/dist/es/interfaces/healthResponse.js +0 -1
  101. package/dist/es/interfaces/institutionResponse.d.ts +0 -1
  102. package/dist/es/interfaces/institutionResponse.js +0 -1
  103. package/dist/es/interfaces/metadata.d.ts +0 -1
  104. package/dist/es/interfaces/metadata.js +0 -1
  105. package/dist/es/interfaces/placeResponse.d.ts +0 -1
  106. package/dist/es/interfaces/placeResponse.js +0 -1
  107. package/dist/es/interfaces/routeCacheResponse.d.ts +0 -1
  108. package/dist/es/interfaces/routeCacheResponse.js +0 -1
  109. package/dist/es/interfaces/routeResponse.d.ts +0 -1
  110. package/dist/es/interfaces/routeResponse.js +0 -1
  111. package/dist/es/interfaces/styleResponse.d.ts +0 -1
  112. package/dist/es/interfaces/styleResponse.js +0 -1
  113. package/dist/es/logger/logger.d.ts +0 -1
  114. package/dist/es/logger/logger.js +0 -10
  115. package/dist/es/logger/sentry.d.ts +0 -1
  116. package/dist/es/logger/sentry.js +1 -39
  117. package/dist/es/map/fitCamera.d.ts +0 -1
  118. package/dist/es/map/fitCamera.js +0 -44
  119. package/dist/es/map/generated/maplibreWorkerSource.d.ts +0 -1
  120. package/dist/es/map/generated/maplibreWorkerSource.js +0 -12
  121. package/dist/es/map/installMapLibreWorker.d.ts +0 -1
  122. package/dist/es/map/installMapLibreWorker.js +0 -100
  123. package/dist/es/map/liveMapFitTransform.d.ts +0 -1
  124. package/dist/es/map/liveMapFitTransform.js +0 -82
  125. package/dist/es/map/map.d.ts +0 -1
  126. package/dist/es/map/map.js +4 -681
  127. package/dist/es/map/mapInteractionOptions.d.ts +0 -1
  128. package/dist/es/map/mapInteractionOptions.js +0 -35
  129. package/dist/es/map/scene3DController.d.ts +0 -1
  130. package/dist/es/map/scene3DController.js +0 -221
  131. package/dist/es/repository/repository.d.ts +0 -1
  132. package/dist/es/repository/repository.js +0 -56
  133. package/dist/es/repository/requester.d.ts +0 -1
  134. package/dist/es/repository/requester.js +0 -233
  135. package/dist/es/sdk.d.ts +0 -1
  136. package/dist/es/sdk.js +0 -35
  137. package/dist/es/utils/3d.d.ts +0 -1
  138. package/dist/es/utils/3d.js +0 -79
  139. package/dist/es/utils/deckLayers.d.ts +0 -1
  140. package/dist/es/utils/deckLayers.js +1 -27
  141. package/dist/es/utils/error.d.ts +0 -1
  142. package/dist/es/utils/error.js +0 -7
  143. package/dist/es/utils/images.d.ts +0 -1
  144. package/dist/es/utils/images.js +0 -7
  145. package/dist/es/utils/loadGlb.d.ts +0 -1
  146. package/dist/es/utils/loadGlb.js +2 -96
  147. package/dist/es/utils/mapvxHostname.d.ts +0 -1
  148. package/dist/es/utils/mapvxHostname.js +0 -11
  149. package/dist/es/utils/nav-functions.d.ts +0 -1
  150. package/dist/es/utils/nav-functions.js +0 -82
  151. package/dist/es/utils/opening-hours-helper.d.ts +0 -1
  152. package/dist/es/utils/opening-hours-helper.js +6 -382
  153. package/dist/es/utils/preconnect.d.ts +0 -1
  154. package/dist/es/utils/preconnect.js +0 -61
  155. package/dist/es/utils/route-utils.d.ts +0 -1
  156. package/dist/es/utils/route-utils.js +0 -25
  157. package/dist/es/utils/semaphore.d.ts +0 -1
  158. package/dist/es/utils/semaphore.js +0 -78
  159. package/dist/es/utils/three.d.ts +0 -1
  160. package/dist/es/utils/three.js +0 -43
  161. package/dist/es/utils/threeScene.d.ts +0 -1
  162. package/dist/es/utils/threeScene.js +0 -38
  163. package/dist/es/utils/update-css.d.ts +0 -1
  164. package/dist/es/utils/update-css.js +0 -26
  165. package/dist/es/utils/utils.d.ts +0 -1
  166. package/dist/es/utils/utils.js +0 -53
  167. package/dist/umd/index.js +4 -29240
  168. package/dist/umd/index.js.LICENSE.txt +1 -0
  169. package/dist/umd/styles.css +0 -1
  170. package/dist/umd/styles.js +3 -32
  171. package/package.json +12 -6
  172. package/dist/cjs/index.js.map +0 -1
  173. package/dist/es/assets/icons.d.ts.map +0 -1
  174. package/dist/es/assets/icons.js.map +0 -1
  175. package/dist/es/config/draco.d.ts.map +0 -1
  176. package/dist/es/config/draco.js.map +0 -1
  177. package/dist/es/config/sdkConfig.d.ts.map +0 -1
  178. package/dist/es/config/sdkConfig.js.map +0 -1
  179. package/dist/es/controllers/markerLayoutController.d.ts.map +0 -1
  180. package/dist/es/controllers/markerLayoutController.js.map +0 -1
  181. package/dist/es/controllers/routeController.d.ts.map +0 -1
  182. package/dist/es/controllers/routeController.js.map +0 -1
  183. package/dist/es/domain/models/_internal.d.ts.map +0 -1
  184. package/dist/es/domain/models/_internal.js.map +0 -1
  185. package/dist/es/domain/models/animation.d.ts.map +0 -1
  186. package/dist/es/domain/models/animation.js.map +0 -1
  187. package/dist/es/domain/models/banner.d.ts.map +0 -1
  188. package/dist/es/domain/models/banner.js.map +0 -1
  189. package/dist/es/domain/models/campaign.d.ts.map +0 -1
  190. package/dist/es/domain/models/campaign.js.map +0 -1
  191. package/dist/es/domain/models/categories.d.ts.map +0 -1
  192. package/dist/es/domain/models/categories.js.map +0 -1
  193. package/dist/es/domain/models/circle.d.ts.map +0 -1
  194. package/dist/es/domain/models/circle.js.map +0 -1
  195. package/dist/es/domain/models/cityFilterOption.d.ts.map +0 -1
  196. package/dist/es/domain/models/cityFilterOption.js.map +0 -1
  197. package/dist/es/domain/models/configuration.d.ts.map +0 -1
  198. package/dist/es/domain/models/configuration.js.map +0 -1
  199. package/dist/es/domain/models/cssCustomization.d.ts.map +0 -1
  200. package/dist/es/domain/models/cssCustomization.js.map +0 -1
  201. package/dist/es/domain/models/fitOptions.d.ts.map +0 -1
  202. package/dist/es/domain/models/fitOptions.js.map +0 -1
  203. package/dist/es/domain/models/innerFloors.d.ts.map +0 -1
  204. package/dist/es/domain/models/innerFloors.js.map +0 -1
  205. package/dist/es/domain/models/institution.d.ts.map +0 -1
  206. package/dist/es/domain/models/institution.js.map +0 -1
  207. package/dist/es/domain/models/latLng.d.ts.map +0 -1
  208. package/dist/es/domain/models/latLng.js.map +0 -1
  209. package/dist/es/domain/models/location.d.ts.map +0 -1
  210. package/dist/es/domain/models/location.js.map +0 -1
  211. package/dist/es/domain/models/loggeable.d.ts.map +0 -1
  212. package/dist/es/domain/models/loggeable.js.map +0 -1
  213. package/dist/es/domain/models/mapCamera.d.ts.map +0 -1
  214. package/dist/es/domain/models/mapCamera.js.map +0 -1
  215. package/dist/es/domain/models/mapConfig.d.ts.map +0 -1
  216. package/dist/es/domain/models/mapConfig.js.map +0 -1
  217. package/dist/es/domain/models/marker.d.ts.map +0 -1
  218. package/dist/es/domain/models/marker.js.map +0 -1
  219. package/dist/es/domain/models/multilanguage.d.ts.map +0 -1
  220. package/dist/es/domain/models/multilanguage.js.map +0 -1
  221. package/dist/es/domain/models/openingHours.d.ts.map +0 -1
  222. package/dist/es/domain/models/openingHours.js.map +0 -1
  223. package/dist/es/domain/models/place.d.ts.map +0 -1
  224. package/dist/es/domain/models/place.js.map +0 -1
  225. package/dist/es/domain/models/platform.d.ts.map +0 -1
  226. package/dist/es/domain/models/platform.js.map +0 -1
  227. package/dist/es/domain/models/popover.d.ts.map +0 -1
  228. package/dist/es/domain/models/popover.js.map +0 -1
  229. package/dist/es/domain/models/product.d.ts.map +0 -1
  230. package/dist/es/domain/models/product.js.map +0 -1
  231. package/dist/es/domain/models/property.d.ts.map +0 -1
  232. package/dist/es/domain/models/property.js.map +0 -1
  233. package/dist/es/domain/models/route.d.ts.map +0 -1
  234. package/dist/es/domain/models/route.js.map +0 -1
  235. package/dist/es/domain/models/routeConfiguration.d.ts.map +0 -1
  236. package/dist/es/domain/models/routeConfiguration.js.map +0 -1
  237. package/dist/es/domain/models/routeInstance.d.ts.map +0 -1
  238. package/dist/es/domain/models/routeInstance.js.map +0 -1
  239. package/dist/es/domain/models/routeStyle.d.ts.map +0 -1
  240. package/dist/es/domain/models/routeStyle.js.map +0 -1
  241. package/dist/es/domain/models/scene3D.d.ts.map +0 -1
  242. package/dist/es/domain/models/scene3D.js.map +0 -1
  243. package/dist/es/domain/models/transport.d.ts.map +0 -1
  244. package/dist/es/domain/models/transport.js.map +0 -1
  245. package/dist/es/domain/ports/ICache.d.ts.map +0 -1
  246. package/dist/es/domain/ports/ICache.js.map +0 -1
  247. package/dist/es/domain/ports/IHttpClient.d.ts.map +0 -1
  248. package/dist/es/domain/ports/IHttpClient.js.map +0 -1
  249. package/dist/es/domain/ports/ILogger.d.ts.map +0 -1
  250. package/dist/es/domain/ports/ILogger.js.map +0 -1
  251. package/dist/es/domain/ports/index.d.ts.map +0 -1
  252. package/dist/es/domain/ports/index.js.map +0 -1
  253. package/dist/es/index.d.ts.map +0 -1
  254. package/dist/es/index.js.map +0 -1
  255. package/dist/es/infrastructure/cache/CacheManager.d.ts.map +0 -1
  256. package/dist/es/infrastructure/cache/CacheManager.js.map +0 -1
  257. package/dist/es/infrastructure/cache/LRUCache.d.ts.map +0 -1
  258. package/dist/es/infrastructure/cache/LRUCache.js.map +0 -1
  259. package/dist/es/infrastructure/cache/PersistentCache.d.ts.map +0 -1
  260. package/dist/es/infrastructure/cache/PersistentCache.js.map +0 -1
  261. package/dist/es/infrastructure/cache/cacheConfig.d.ts.map +0 -1
  262. package/dist/es/infrastructure/cache/cacheConfig.js.map +0 -1
  263. package/dist/es/infrastructure/http/FetchHttpClient.d.ts.map +0 -1
  264. package/dist/es/infrastructure/http/FetchHttpClient.js.map +0 -1
  265. package/dist/es/infrastructure/logging/MVXLogger.d.ts.map +0 -1
  266. package/dist/es/infrastructure/logging/MVXLogger.js.map +0 -1
  267. package/dist/es/interfaces/cache.d.ts.map +0 -1
  268. package/dist/es/interfaces/cache.js.map +0 -1
  269. package/dist/es/interfaces/healthResponse.d.ts.map +0 -1
  270. package/dist/es/interfaces/healthResponse.js.map +0 -1
  271. package/dist/es/interfaces/institutionResponse.d.ts.map +0 -1
  272. package/dist/es/interfaces/institutionResponse.js.map +0 -1
  273. package/dist/es/interfaces/metadata.d.ts.map +0 -1
  274. package/dist/es/interfaces/metadata.js.map +0 -1
  275. package/dist/es/interfaces/placeResponse.d.ts.map +0 -1
  276. package/dist/es/interfaces/placeResponse.js.map +0 -1
  277. package/dist/es/interfaces/routeCacheResponse.d.ts.map +0 -1
  278. package/dist/es/interfaces/routeCacheResponse.js.map +0 -1
  279. package/dist/es/interfaces/routeResponse.d.ts.map +0 -1
  280. package/dist/es/interfaces/routeResponse.js.map +0 -1
  281. package/dist/es/interfaces/styleResponse.d.ts.map +0 -1
  282. package/dist/es/interfaces/styleResponse.js.map +0 -1
  283. package/dist/es/logger/logger.d.ts.map +0 -1
  284. package/dist/es/logger/logger.js.map +0 -1
  285. package/dist/es/logger/sentry.d.ts.map +0 -1
  286. package/dist/es/logger/sentry.js.map +0 -1
  287. package/dist/es/map/fitCamera.d.ts.map +0 -1
  288. package/dist/es/map/fitCamera.js.map +0 -1
  289. package/dist/es/map/generated/maplibreWorkerSource.d.ts.map +0 -1
  290. package/dist/es/map/generated/maplibreWorkerSource.js.map +0 -1
  291. package/dist/es/map/installMapLibreWorker.d.ts.map +0 -1
  292. package/dist/es/map/installMapLibreWorker.js.map +0 -1
  293. package/dist/es/map/liveMapFitTransform.d.ts.map +0 -1
  294. package/dist/es/map/liveMapFitTransform.js.map +0 -1
  295. package/dist/es/map/map.d.ts.map +0 -1
  296. package/dist/es/map/map.js.map +0 -1
  297. package/dist/es/map/mapInteractionOptions.d.ts.map +0 -1
  298. package/dist/es/map/mapInteractionOptions.js.map +0 -1
  299. package/dist/es/map/scene3DController.d.ts.map +0 -1
  300. package/dist/es/map/scene3DController.js.map +0 -1
  301. package/dist/es/repository/repository.d.ts.map +0 -1
  302. package/dist/es/repository/repository.js.map +0 -1
  303. package/dist/es/repository/requester.d.ts.map +0 -1
  304. package/dist/es/repository/requester.js.map +0 -1
  305. package/dist/es/sdk.d.ts.map +0 -1
  306. package/dist/es/sdk.js.map +0 -1
  307. package/dist/es/utils/3d.d.ts.map +0 -1
  308. package/dist/es/utils/3d.js.map +0 -1
  309. package/dist/es/utils/deckLayers.d.ts.map +0 -1
  310. package/dist/es/utils/deckLayers.js.map +0 -1
  311. package/dist/es/utils/error.d.ts.map +0 -1
  312. package/dist/es/utils/error.js.map +0 -1
  313. package/dist/es/utils/images.d.ts.map +0 -1
  314. package/dist/es/utils/images.js.map +0 -1
  315. package/dist/es/utils/loadGlb.d.ts.map +0 -1
  316. package/dist/es/utils/loadGlb.js.map +0 -1
  317. package/dist/es/utils/mapvxHostname.d.ts.map +0 -1
  318. package/dist/es/utils/mapvxHostname.js.map +0 -1
  319. package/dist/es/utils/nav-functions.d.ts.map +0 -1
  320. package/dist/es/utils/nav-functions.js.map +0 -1
  321. package/dist/es/utils/opening-hours-helper.d.ts.map +0 -1
  322. package/dist/es/utils/opening-hours-helper.js.map +0 -1
  323. package/dist/es/utils/preconnect.d.ts.map +0 -1
  324. package/dist/es/utils/preconnect.js.map +0 -1
  325. package/dist/es/utils/route-utils.d.ts.map +0 -1
  326. package/dist/es/utils/route-utils.js.map +0 -1
  327. package/dist/es/utils/semaphore.d.ts.map +0 -1
  328. package/dist/es/utils/semaphore.js.map +0 -1
  329. package/dist/es/utils/three.d.ts.map +0 -1
  330. package/dist/es/utils/three.js.map +0 -1
  331. package/dist/es/utils/threeScene.d.ts.map +0 -1
  332. package/dist/es/utils/threeScene.js.map +0 -1
  333. package/dist/es/utils/update-css.d.ts.map +0 -1
  334. package/dist/es/utils/update-css.js.map +0 -1
  335. package/dist/es/utils/utils.d.ts.map +0 -1
  336. package/dist/es/utils/utils.js.map +0 -1
  337. package/dist/umd/index.js.map +0 -1
  338. package/dist/umd/styles.css.map +0 -1
  339. package/dist/umd/styles.js.map +0 -1
package/dist/es/sdk.js CHANGED
@@ -4,11 +4,6 @@ import { Loggeable } from "./domain/models/loggeable";
4
4
  import { InternalGetRouteConfiguration, } from "./domain/models/routeConfiguration";
5
5
  import { CacheManager } from "./infrastructure/cache/CacheManager";
6
6
  import { Repository } from "./repository/repository";
7
- /**
8
- * Normalize the argument accepted by the place-detail methods into a
9
- * {@link PlaceQuery}. A plain string is treated as the place id/alias with no
10
- * building/floor disambiguation, preserving backward compatibility.
11
- */
12
7
  function normalizePlaceQuery(place) {
13
8
  return typeof place === "string" ? { id: place } : place;
14
9
  }
@@ -27,16 +22,7 @@ export function initializeSDK(token, config) {
27
22
  const sdk = new InternalMapVXSDK(token, sdkConfig);
28
23
  return sdk;
29
24
  }
30
- /**
31
- * Main class to access the SDK functionalities.
32
- * @category Main
33
- */
34
25
  export class InternalMapVXSDK extends Loggeable {
35
- /**
36
- * Create a new MapVXSDK object.
37
- * @param token The secret API token that you obtained from MapVX.
38
- * @param config Configuration object for SDK customization
39
- */
40
26
  constructor(token, config) {
41
27
  var _a, _b, _c;
42
28
  super();
@@ -45,7 +31,6 @@ export class InternalMapVXSDK extends Loggeable {
45
31
  this.headingListeners = [];
46
32
  this.token = token;
47
33
  this.config = config;
48
- // Create cache manager with user configuration
49
34
  const cacheManager = new CacheManager({
50
35
  persistent: (_a = config.cache) === null || _a === void 0 ? void 0 : _a.persistent,
51
36
  maxStorageBytes: (_b = config.cache) === null || _b === void 0 ? void 0 : _b.maxStorageBytes,
@@ -60,12 +45,8 @@ export class InternalMapVXSDK extends Loggeable {
60
45
  this.cachePlaces();
61
46
  this.logEvent("initSDK");
62
47
  }
63
- /**
64
- * Fetch and save on cache the data from the available places.
65
- */
66
48
  cachePlaces() {
67
49
  this.repository.fetchAndParseAvailablePlaces().catch(() => {
68
- // Error already logged in repository
69
50
  });
70
51
  }
71
52
  setSdkLang(lang) {
@@ -110,9 +91,6 @@ export class InternalMapVXSDK extends Loggeable {
110
91
  mapConfig.apiUrl = this.config.apiUrl;
111
92
  mapConfig.portalApiUrl = this.config.portalApiUrl;
112
93
  mapConfig.mapvxRequestContext = this.config.mapvxRequestContext;
113
- // Routing endpoints go through the map's own Repository, so forward the
114
- // (possibly overridden) hosts too — otherwise routes would fall back to
115
- // the hardcoded api.mapvx.com even when the SDK was pointed at an edge.
116
94
  mapConfig.routeApiUrl = this.config.routeApiUrl;
117
95
  mapConfig.healthApiUrl = this.config.healthApiUrl;
118
96
  mapConfig.legacyApiUrl = this.config.legacyApiUrl;
@@ -268,7 +246,6 @@ export class InternalMapVXSDK extends Loggeable {
268
246
  }
269
247
  async getPlacesByInput(input, institutionId, parentPlaceId, otherParentPlacesIds, origin, lat, lng, floor) {
270
248
  try {
271
- // TODO: se debe cambiar a usar un solo parámetro en la siguiente version major.
272
249
  const parentPlaces = parentPlaceId
273
250
  ? otherParentPlacesIds
274
251
  ? [parentPlaceId, ...otherParentPlacesIds]
@@ -308,8 +285,6 @@ export class InternalMapVXSDK extends Loggeable {
308
285
  }
309
286
  async getPlacesByCategory(category) {
310
287
  try {
311
- // TODO: Implement proper category-based search when API endpoint is available
312
- // For now, return an empty array as a placeholder implementation
313
288
  this.logEvent("getPlacesByCategory");
314
289
  return [];
315
290
  }
@@ -354,11 +329,9 @@ export class InternalMapVXSDK extends Loggeable {
354
329
  }
355
330
  let heading = null;
356
331
  if (event.webkitCompassHeading !== undefined) {
357
- // Para iOS
358
332
  heading = event.webkitCompassHeading || null;
359
333
  }
360
334
  else if (event.absolute && event.alpha !== null) {
361
- // Para Android y otros navegadores
362
335
  heading = 360 - event.alpha;
363
336
  }
364
337
  if (heading !== null) {
@@ -370,22 +343,15 @@ export class InternalMapVXSDK extends Loggeable {
370
343
  };
371
344
  this.headingListeners.push(listener);
372
345
  if ("ondeviceorientationabsolute" in window) {
373
- // We can listen for the new deviceorientationabsolute event.
374
346
  window.addEventListener("deviceorientationabsolute", listener);
375
347
  }
376
348
  else if ("ondeviceorientation" in window) {
377
- // We can still listen for deviceorientation events.
378
- // The `absolute` property of the event tells us whether
379
- // or not the degrees are absolute.
380
349
  const w = window;
381
350
  w.addEventListener("deviceorientation", listener);
382
351
  }
383
352
  }
384
353
  unwatchUserHeading() {
385
354
  this.headingListeners.forEach((listener) => {
386
- // It is safe to call with both events
387
- // since the call with the event that has no listener
388
- // will simply do nothing.
389
355
  window.removeEventListener("deviceorientationabsolute", listener);
390
356
  window.removeEventListener("deviceorientation", listener);
391
357
  });
@@ -430,4 +396,3 @@ export class InternalMapVXSDK extends Loggeable {
430
396
  }
431
397
  }
432
398
  }
433
- //# sourceMappingURL=sdk.js.map
@@ -125,4 +125,3 @@ export declare function computeScenePosition(target: {
125
125
  x: number;
126
126
  y: number;
127
127
  }, meterScale: number, assetOffset?: GLBModelOffset, placementOffset?: GLBModelOffset): [number, number, number];
128
- //# sourceMappingURL=3d.d.ts.map
@@ -1,9 +1,4 @@
1
- /** Default LOD hysteresis (zoom units) when {@link Models3DLodConfig.hysteresis} is unset. */
2
1
  export const DEFAULT_LOD_HYSTERESIS = 0.5;
3
- /**
4
- * Computes the unload/reload zoom boundaries from {@link Models3DConfig.lod}, or `null` when LOD is
5
- * disabled (no `lod`, no models, or a non-finite `minZoom`). Pure — safe to unit-test without WebGL.
6
- */
7
2
  export const resolveModels3DLodThresholds = (models) => {
8
3
  const lod = models === null || models === void 0 ? void 0 : models.lod;
9
4
  if (!models ||
@@ -21,12 +16,6 @@ export const resolveModels3DLodThresholds = (models) => {
21
16
  unloadBelow: lod.minZoom - hysteresis,
22
17
  };
23
18
  };
24
- /**
25
- * Decides what the LOD controller should do at the current zoom given whether the models are
26
- * currently unloaded. Returns `"unload"` when they are loaded but the camera is below the unload
27
- * boundary, `"reload"` when they are unloaded but the camera has returned to/above the reload
28
- * boundary, and `"none"` otherwise (including within the hysteresis band). Pure/testable.
29
- */
30
19
  export const lodActionForZoom = (zoom, thresholds, currentlyUnloaded) => {
31
20
  if (!currentlyUnloaded && zoom < thresholds.unloadBelow) {
32
21
  return "unload";
@@ -36,28 +25,12 @@ export const lodActionForZoom = (zoom, thresholds, currentlyUnloaded) => {
36
25
  }
37
26
  return "none";
38
27
  };
39
- /**
40
- * Conservative defaults that bound each deck.gl overlay layer's in-memory tile cache. Chosen to
41
- * favor low RAM: only the visible working set (plus a small margin) stays parsed in memory; the
42
- * raw tile bytes remain on disk in the Service Worker cache, so an evicted tile is re-parsed
43
- * rather than re-downloaded. Raise `maxCacheSize` only if profiling shows flashing at the
44
- * viewport edge while panning.
45
- * @internal
46
- */
47
28
  export const DEFAULT_DECK_TILE_CACHE = {
48
- // Per layer; with four overlay layers this caps the parsed-tile set at ~4x this number.
49
29
  maxCacheSize: 64,
50
30
  maxRequests: 6,
51
- // Drop parent tiles once children cover the viewport — keeps the resident set smallest.
52
31
  refinementStrategy: "no-overlap",
53
- // Byte budget is opt-in (deck.gl only enforces it when a tile's byte size is known).
54
32
  maxCacheByteSize: undefined,
55
33
  };
56
- /**
57
- * Merges an optional {@link DeckTileCacheConfig} over {@link DEFAULT_DECK_TILE_CACHE}, ignoring
58
- * `undefined`/`null` fields and clamping numeric bounds to at least 1. The result is always
59
- * bounded — passing `undefined` yields the defaults, never an unlimited cache.
60
- */
61
34
  export const resolveDeckTileCache = (config) => {
62
35
  var _a;
63
36
  const clampPositive = (value, fallback) => typeof value === "number" && Number.isFinite(value) && value >= 1 ? Math.floor(value) : fallback;
@@ -73,10 +46,6 @@ export const resolveDeckTileCache = (config) => {
73
46
  maxCacheByteSize,
74
47
  };
75
48
  };
76
- /**
77
- * Default lights matching the legacy escalator scene when {@link Models3DConfig.lights} is unset.
78
- * @internal
79
- */
80
49
  export const DEFAULT_SCENE3D_LIGHTS = [
81
50
  { type: "directional", color: 0xffffff, intensity: 2, position: { x: 50, y: 100, z: 80 } },
82
51
  { type: "directional", color: 0xffffff, intensity: 1.5, position: { x: -50, y: 80, z: -60 } },
@@ -103,18 +72,12 @@ export const hexToRgba = (hex) => {
103
72
  const a = matches.length >= 4 ? Number.parseInt(matches[3], 16) : 255;
104
73
  return [r, g, b, a];
105
74
  };
106
- /**
107
- * Resolves lights for the declarative GLB scene: {@link Models3DConfig.lights} when set, otherwise SDK defaults.
108
- */
109
75
  export function resolveModels3DLights(models) {
110
76
  if (models.lights && models.lights.length > 0) {
111
77
  return [...models.lights];
112
78
  }
113
79
  return [...DEFAULT_SCENE3D_LIGHTS];
114
80
  }
115
- /**
116
- * Merges two partial rotations by adding each axis in degrees.
117
- */
118
81
  export function mergeRotation3D(a, b) {
119
82
  var _a, _b, _c, _d, _e, _f;
120
83
  return {
@@ -123,9 +86,6 @@ export function mergeRotation3D(a, b) {
123
86
  roll: ((_e = a === null || a === void 0 ? void 0 : a.roll) !== null && _e !== void 0 ? _e : 0) + ((_f = b === null || b === void 0 ? void 0 : b.roll) !== null && _f !== void 0 ? _f : 0),
124
87
  };
125
88
  }
126
- /**
127
- * Normalizes a uniform or per-axis scale; undefined uses `fallback` on all axes.
128
- */
129
89
  export function normalizeScale(scale, fallback) {
130
90
  if (scale === undefined) {
131
91
  return [fallback, fallback, fallback];
@@ -135,9 +95,6 @@ export function normalizeScale(scale, fallback) {
135
95
  }
136
96
  return [scale[0], scale[1], scale[2]];
137
97
  }
138
- /**
139
- * Placement scale overrides asset default when provided; otherwise asset (or 1) applies.
140
- */
141
98
  export function mergeGlbScale(assetDefault, placementOverride) {
142
99
  const base = normalizeScale(assetDefault, 1);
143
100
  if (placementOverride === undefined) {
@@ -145,72 +102,37 @@ export function mergeGlbScale(assetDefault, placementOverride) {
145
102
  }
146
103
  return normalizeScale(placementOverride, 1);
147
104
  }
148
- /**
149
- * Resolves the effective zoom-based transparency for a placement, applying precedence:
150
- * placement > asset > global. Returns `undefined` when none is configured.
151
- */
152
105
  export function resolveZoomTransparency(models, asset, placement) {
153
106
  var _a, _b;
154
107
  return (_b = (_a = placement.zoomTransparency) !== null && _a !== void 0 ? _a : asset === null || asset === void 0 ? void 0 : asset.zoomTransparency) !== null && _b !== void 0 ? _b : models.zoomTransparency;
155
108
  }
156
- /**
157
- * Opacity for a given zoom under a hard-threshold {@link ZoomTransparencyConfig}.
158
- * Returns `cfg.opacity` when `zoom >= cfg.zoom`, otherwise `1` (fully opaque).
159
- * With no config, returns `1`.
160
- */
161
109
  export function opacityForZoom(cfg, zoom) {
162
110
  if (!cfg) {
163
111
  return 1;
164
112
  }
165
113
  return zoom >= cfg.zoom ? cfg.opacity : 1;
166
114
  }
167
- /**
168
- * Resolves the effective route-based transparency for a placement, applying precedence:
169
- * placement > asset > global. Returns `undefined` when none is configured, which disables
170
- * route transparency for that model (a route crossing it leaves its opacity unchanged).
171
- */
172
115
  export function resolveRouteTransparency(models, asset, placement) {
173
116
  var _a, _b;
174
117
  return (_b = (_a = placement.routeTransparency) !== null && _a !== void 0 ? _a : asset === null || asset === void 0 ? void 0 : asset.routeTransparency) !== null && _b !== void 0 ? _b : models.routeTransparency;
175
118
  }
176
- /**
177
- * Whether a point already expressed in the model's local space falls within its x/z footprint.
178
- * @internal
179
- */
180
119
  export function pointInFootprint(footprint, localX, localZ) {
181
120
  return (localX >= footprint.minX &&
182
121
  localX <= footprint.maxX &&
183
122
  localZ >= footprint.minZ &&
184
123
  localZ <= footprint.maxZ);
185
124
  }
186
- /**
187
- * Effective opacity for a placed model: the more transparent of its zoom-based value and, when a
188
- * route currently crosses it, its route-based value. Route transparency only participates when a
189
- * {@link RouteTransparencyConfig} is configured (`routeCfg` present) and the model is currently
190
- * crossed by a route (`routeAffected`).
191
- * @internal
192
- */
193
125
  export function effectiveModelOpacity(zoomCfg, routeCfg, zoom, routeAffected) {
194
126
  const zoomOpacity = opacityForZoom(zoomCfg, zoom);
195
127
  const routeOpacity = routeAffected && routeCfg ? routeCfg.opacity : 1;
196
128
  return Math.min(zoomOpacity, routeOpacity);
197
129
  }
198
- /**
199
- * Whether a GLB placement should be visible for the given floor key.
200
- */
201
130
  export function isPlacementVisibleOnFloor(placement, floorKey) {
202
131
  if (placement.visibility.mode === "allFloors") {
203
132
  return true;
204
133
  }
205
134
  return placement.visibility.floorKey === floorKey;
206
135
  }
207
- /**
208
- * Computes a GLB pivot's scene-space position (in metres) from a placement's Mercator target and a
209
- * Mercator reference origin, plus the asset-level and placement-level offsets.
210
- *
211
- * X/Z come from the Mercator delta divided by the metre scale; Y comes only from the offsets (the
212
- * model is bottom-aligned separately). All offsets are in map-space metres.
213
- */
214
136
  export function computeScenePosition(target, ref, meterScale, assetOffset, placementOffset) {
215
137
  var _a, _b, _c, _d, _e, _f;
216
138
  const sx = (target.x - ref.x) / meterScale;
@@ -223,4 +145,3 @@ export function computeScenePosition(target, ref, meterScale, assetOffset, place
223
145
  const pz = (_f = placementOffset === null || placementOffset === void 0 ? void 0 : placementOffset.z) !== null && _f !== void 0 ? _f : 0;
224
146
  return [sx + ax + px, ay + py, sz + az + pz];
225
147
  }
226
- //# sourceMappingURL=3d.js.map
@@ -48,4 +48,3 @@ export declare function buildStoreLogoData(features: Feature[], floorKey: string
48
48
  * per-logo scale factor. Returns a fallback of `10` when the icon is missing from the sprite atlas.
49
49
  */
50
50
  export declare function computeStoreLogoSize(mapping: Record<string, SpriteIconData>, icon: string, logoScale: Record<string, number>): number;
51
- //# sourceMappingURL=deckLayers.d.ts.map
@@ -1,13 +1,3 @@
1
- /**
2
- * Pure data builders for the deck.gl indoor overlay sublayers.
3
- *
4
- * These functions contain the feature-filtering and coordinate/height mapping logic used inside the
5
- * deck.gl `renderSubLayers` callbacks in {@link InternalMapVXMap}. They are kept free of any deck.gl
6
- * / WebGL imports so the logic is unit-testable without a GL context.
7
- *
8
- * @group Utils
9
- */
10
- /** Extracts polygon coordinate rings from a GeoJSON geometry (Polygon or MultiPolygon). */
11
1
  export function extractPolygonRings(geom) {
12
2
  if (geom.type === "Polygon") {
13
3
  return [geom.coordinates];
@@ -17,10 +7,6 @@ export function extractPolygonRings(geom) {
17
7
  }
18
8
  return [];
19
9
  }
20
- /**
21
- * Builds elevated room-outline paths from indoor "room" features on the given floor.
22
- * Each ring is lifted to `z` (feature `height` when present, otherwise `defaultHeight`).
23
- */
24
10
  export function buildElevatedPaths(features, floorKey, defaultHeight) {
25
11
  var _a;
26
12
  const rooms = features.filter((f) => {
@@ -40,10 +26,6 @@ export function buildElevatedPaths(features, floorKey, defaultHeight) {
40
26
  }
41
27
  return paths;
42
28
  }
43
- /**
44
- * Builds indoor label text data from `area_name` / `poi` point features on the given floor.
45
- * A feature is skipped when a matching `logo-{name}` sprite exists (icon takes priority over text).
46
- */
47
29
  export function buildLabelData(features, floorKey, hasImage, defaultHeight) {
48
30
  const labelFeatures = features.filter((f) => {
49
31
  var _a, _b, _c, _d, _e, _f;
@@ -57,7 +39,7 @@ export function buildLabelData(features, floorKey, hasImage, defaultHeight) {
57
39
  if (((_f = f.properties) === null || _f === void 0 ? void 0 : _f.floor_key) && f.properties.floor_key !== floorKey)
58
40
  return false;
59
41
  if (hasImage("logo-" + name))
60
- return false; // icon has priority
42
+ return false;
61
43
  return true;
62
44
  });
63
45
  return labelFeatures.map((f) => {
@@ -71,7 +53,6 @@ export function buildLabelData(features, floorKey, hasImage, defaultHeight) {
71
53
  });
72
54
  });
73
55
  }
74
- /** Resolves the POI icon id from a feature's `tags` and `subclass`. */
75
56
  export function resolvePoiIcon(tags, subclass) {
76
57
  if (tags.includes("wheelchair"))
77
58
  return "accessible_toilets";
@@ -79,7 +60,6 @@ export function resolvePoiIcon(tags, subclass) {
79
60
  return "changing_table";
80
61
  return subclass;
81
62
  }
82
- /** Builds POI icon data (elevators / toilets) from point features on the given floor. */
83
63
  export function buildPoiIconData(features, floorKey, defaultHeight) {
84
64
  const poi = features.filter((f) => {
85
65
  var _a, _b, _c;
@@ -101,7 +81,6 @@ export function buildPoiIconData(features, floorKey, defaultHeight) {
101
81
  });
102
82
  });
103
83
  }
104
- /** Builds store-logo icon data from point features that have a matching `logo-{name}` sprite. */
105
84
  export function buildStoreLogoData(features, floorKey, spriteMapping, defaultHeight) {
106
85
  const logos = features.filter((f) => {
107
86
  var _a, _b, _c;
@@ -127,10 +106,6 @@ export function buildStoreLogoData(features, floorKey, spriteMapping, defaultHei
127
106
  };
128
107
  });
129
108
  }
130
- /**
131
- * Computes the display size for a store-logo icon from its sprite dimensions and an optional
132
- * per-logo scale factor. Returns a fallback of `10` when the icon is missing from the sprite atlas.
133
- */
134
109
  export function computeStoreLogoSize(mapping, icon, logoScale) {
135
110
  const m = mapping[icon];
136
111
  if (!m)
@@ -141,4 +116,3 @@ export function computeStoreLogoSize(mapping, icon, logoScale) {
141
116
  const base = 10 * (h / Math.max(w, h));
142
117
  return base * (logoScale[icon] || 1);
143
118
  }
144
- //# sourceMappingURL=deckLayers.js.map
@@ -5,4 +5,3 @@
5
5
  * @returns An Error object.
6
6
  */
7
7
  export declare function convertToError(error: unknown): Error;
8
- //# sourceMappingURL=error.d.ts.map
@@ -1,9 +1,3 @@
1
- /**
2
- * Convert an unknown error to an Error object.
3
- * @group Utils
4
- * @param error - The unknown error.
5
- * @returns An Error object.
6
- */
7
1
  export function convertToError(error) {
8
2
  if (error instanceof Error) {
9
3
  return error;
@@ -13,4 +7,3 @@ export function convertToError(error) {
13
7
  return new Error(text);
14
8
  }
15
9
  }
16
- //# sourceMappingURL=error.js.map
@@ -5,4 +5,3 @@
5
5
  * @returns A promise that resolves to the data URL of the image.
6
6
  */
7
7
  export declare function loadImageAsDataUrl(imgUrl: string): Promise<string>;
8
- //# sourceMappingURL=images.d.ts.map
@@ -1,9 +1,3 @@
1
- /**
2
- * Load an image as a data URL.
3
- * @group Utils
4
- * @param imgUrl - The URL of the image to load.
5
- * @returns A promise that resolves to the data URL of the image.
6
- */
7
1
  export function loadImageAsDataUrl(imgUrl) {
8
2
  return new Promise((resolve, reject) => {
9
3
  fetch(imgUrl)
@@ -19,4 +13,3 @@ export function loadImageAsDataUrl(imgUrl) {
19
13
  .catch(reject);
20
14
  });
21
15
  }
22
- //# sourceMappingURL=images.js.map
@@ -88,4 +88,3 @@ export interface LoadGlbRootOptions {
88
88
  * @group Utils
89
89
  */
90
90
  export declare function loadGlbRoot(url: string, options?: LoadGlbRootOptions): Promise<THREE.Group>;
91
- //# sourceMappingURL=loadGlb.d.ts.map
@@ -1,26 +1,7 @@
1
1
  import { DEFAULT_DRACO_DECODER_PATH, DEFAULT_KTX2_TRANSCODER_PATH } from "../config/draco";
2
2
  import { loadMeshoptDecoder, loadThree, memoizeImport } from "./three";
3
- /**
4
- * Builds a stand-in meshopt decoder that defers importing the real module (and instantiating its
5
- * WASM) until the first `EXT_meshopt_compression` buffer actually needs decoding. GLBs without the
6
- * extension never trigger the import, so the decoder stays off the critical path of the first 3D
7
- * frame — it used to be part of the eager three.js import chain, delaying every scene load.
8
- *
9
- * `supported` mirrors the real module's own gate — it returns a bare `{ supported: false }` when
10
- * `typeof WebAssembly !== "object"` — so the answer is reproduced synchronously here without
11
- * importing anything. Reporting a flat `true` instead would break the platforms it claims to
12
- * support: `GLTFLoader` reads `supported` before deciding to decode, and on `false` with meshopt
13
- * merely OPTIONAL it returns `null` and falls back to the GLB's uncompressed buffer
14
- * (`GLTFLoader.js` `GLTFMeshoptCompression.loadBufferView`). Claiming support on a WASM-less
15
- * platform discards that fallback and fails the whole asset with a `TypeError` from this shim,
16
- * since `decodeGltfBufferAsync` does not exist on the real module there.
17
- *
18
- * @param load Injectable module loader, for tests. Defaults to the cached {@link loadMeshoptDecoder}.
19
- * @internal
20
- */
21
3
  export function createLazyMeshoptDecoder(load = loadMeshoptDecoder) {
22
4
  return {
23
- // Same condition the real decoder uses, evaluated without loading it.
24
5
  supported: typeof WebAssembly === "object",
25
6
  decodeGltfBufferAsync: async (count, size, source, mode, filter) => {
26
7
  const decoder = await load();
@@ -29,20 +10,6 @@ export function createLazyMeshoptDecoder(load = loadMeshoptDecoder) {
29
10
  },
30
11
  };
31
12
  }
32
- /**
33
- * Lazily-initialized, cached GLTF loader configured with Draco + KTX2 support.
34
- *
35
- * The loaders (and their WebGLRenderer for KTX2 support detection) are heavy and pull in Three.js,
36
- * so they are created on first use inside the dynamic-import boundary rather than at module load.
37
- *
38
- * Memoized through {@link memoizeImport} for the same reason the loaders in `three.ts` are: a plain
39
- * `cached ??=` also caches a rejection. Fixing the three loaders was not enough, because this is a
40
- * SECOND cache wrapped around `loadThree()` — so a transient failure was evicted there and then
41
- * replayed from here forever, and `loadGlbRoot` awaits both, meaning every GLB kept failing with
42
- * the stale error long after `loadThree()` had recovered. Not only network: the `.then` below
43
- * constructs a `WebGLRenderer` for KTX2 support detection, and a failed context creation was
44
- * cached just the same.
45
- */
46
13
  const getGltfLoader = memoizeImport(() => loadThree().then((mod) => {
47
14
  const dracoLoader = new mod.DRACOLoader();
48
15
  dracoLoader.setDecoderPath(DEFAULT_DRACO_DECODER_PATH);
@@ -52,81 +19,25 @@ const getGltfLoader = memoizeImport(() => loadThree().then((mod) => {
52
19
  ktx2Loader.setTranscoderPath(DEFAULT_KTX2_TRANSCODER_PATH);
53
20
  gltfLoader.setKTX2Loader(ktx2Loader);
54
21
  ktx2Loader.detectSupport(new mod.THREE.WebGLRenderer({ antialias: true }));
55
- // Enable EXT_meshopt_compression so meshopt-compressed GLBs decode, without paying for the
56
- // decoder module up front: the lazy stand-in imports it (and instantiates its WASM) only when
57
- // the first meshopt-compressed buffer is actually decoded. Assets that don't use the extension
58
- // never load it. The cast is safe — with `decodeGltfBufferAsync` present, GLTFLoader touches
59
- // only `supported` and `decodeGltfBufferAsync` (see LazyMeshoptDecoder).
60
22
  gltfLoader.setMeshoptDecoder(createLazyMeshoptDecoder());
61
23
  return gltfLoader;
62
24
  }));
63
- /**
64
- * Default per-asset timeout for {@link loadGlbRoot}.
65
- *
66
- * Guards against loaders that hang instead of throwing — a GLB whose binary chunk is truncated
67
- * (see {@link loadGlbRoot}'s completeness check) or otherwise malformed can put Three.js's
68
- * `DRACOLoader` into an undefined state: sometimes a decode error, sometimes no callback at all.
69
- * Without a timeout, one such asset never settles and blocks every other load queued behind it.
70
- *
71
- * Declarative GLB scenes can legitimately include very large assets — a client's ground-mesh
72
- * "Suelo" model measured at ~400 MB took ~26s to download alone on a solid connection, before any
73
- * Draco decode time, and totem hardware/networks in the field are often slower than that. The
74
- * timeout only needs to be long enough that no realistically-sized valid asset ever hits it; a
75
- * truly hung load (the actual failure this guards against) would still hang forever whether this
76
- * is 30 seconds or 500 seconds, so there is no tradeoff in keeping it generous.
77
- *
78
- * @group Configuration
79
- */
80
25
  export const DEFAULT_GLB_LOAD_TIMEOUT_MS = 500000;
81
- /**
82
- * Magic number ("glTF" read little-endian) at byte offset 0 of every binary glTF (`.glb`)
83
- * container. Used only to tell a binary GLB apart from a plain JSON `.gltf` payload — the latter
84
- * has no such header and skips the completeness check in {@link assertGlbBufferComplete}.
85
- */
86
26
  const GLB_MAGIC = 0x46546c67;
87
- /**
88
- * Rejects a GLB download that was cut short before it reaches Three.js's `GLTFLoader`/`DRACOLoader`,
89
- * whose behavior on truncated input ranges from a cryptic decode error (e.g. "Unexpected geometry
90
- * type") to an outright hang, rather than a clear message pointing at the actual problem.
91
- *
92
- * The binary glTF container format requires the 12-byte header's declared total length to equal
93
- * the file's real byte length (see the {@link https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#binary-header | spec}).
94
- * A mismatch means the response body was truncated — a dropped connection, or the object stored at
95
- * `url` is itself incomplete — so every buffer-view offset past that point reads garbage. This is
96
- * exactly what was found in the field for one "Suelo" asset that both threw a decode error and (in
97
- * a larger sibling file) hung: the file's own header declared a ~383 MB binary chunk while only
98
- * ~8.7 MB had actually been received.
99
- */
100
27
  function assertGlbBufferComplete(buffer, url) {
101
28
  if (buffer.byteLength < 12)
102
- return; // too short to have a GLB header; let parse() report it
29
+ return;
103
30
  const header = new DataView(buffer, 0, 12);
104
31
  if (header.getUint32(0, true) !== GLB_MAGIC)
105
- return; // plain JSON .gltf, not a binary .glb
32
+ return;
106
33
  const declaredLength = header.getUint32(8, true);
107
34
  if (declaredLength !== buffer.byteLength) {
108
35
  throw new Error(`GLB download is truncated or corrupt: header declares ${declaredLength} bytes, received ${buffer.byteLength}: ${url}`);
109
36
  }
110
37
  }
111
- /**
112
- * Loads a GLB/GLTF from URL and returns the root scene group.
113
- * Central entry point so the loader implementation can be swapped later (e.g. Draco, KTX2, custom fetch).
114
- *
115
- * Fetches the raw bytes itself (rather than deferring to `GLTFLoader.load`) so a truncated download
116
- * can be caught and rejected clearly — see {@link assertGlbBufferComplete} — before it ever reaches
117
- * the Draco/KTX2 decoders.
118
- *
119
- * @param url - GLB URL
120
- * @returns Root `THREE.Group` from the loaded glTF scene
121
- * @group Utils
122
- */
123
38
  export async function loadGlbRoot(url, options = {}) {
124
39
  const { timeoutMs = DEFAULT_GLB_LOAD_TIMEOUT_MS, onProgress } = options;
125
40
  const [gltfLoader, { THREE: three }] = await Promise.all([getGltfLoader(), loadThree()]);
126
- // Set once the caller has stopped waiting (success, failure, or timeout) so any callback three
127
- // fires afterwards — e.g. a timed-out fetch/decode that keeps running in the background — is a
128
- // no-op instead of resolving/rejecting an already-settled promise or emitting a stray progress
129
- // event after the batch this asset belongs to already reported `done: true`.
130
41
  let settled = false;
131
42
  const fileLoader = new three.FileLoader();
132
43
  fileLoader.setResponseType("arraybuffer");
@@ -175,11 +86,6 @@ export async function loadGlbRoot(url, options = {}) {
175
86
  finally {
176
87
  settled = true;
177
88
  clearTimeout(timer);
178
- // Cancels the underlying fetch (and, by never delivering its buffer, the Draco/KTX2 decode)
179
- // so a timed-out asset actually frees its network/CPU usage instead of running to completion
180
- // unattended — otherwise GLB_LOAD_CONCURRENCY only bounds how many loads the caller awaits,
181
- // not how many are truly in flight. A no-op if `load` already won the race.
182
89
  fileLoader.abort();
183
90
  }
184
91
  }
185
- //# sourceMappingURL=loadGlb.js.map
@@ -9,4 +9,3 @@
9
9
  * @group Utils
10
10
  */
11
11
  export declare function isMapVxRequestHostname(hostname: string): boolean;
12
- //# sourceMappingURL=mapvxHostname.d.ts.map
@@ -1,13 +1,3 @@
1
- /**
2
- * Returns whether a URL hostname is part of the MapVX API domain tree.
3
- * Matches `mapvx.com` and `mapvx.dev` plus any subdomain (`api.mapvx.com`,
4
- * `public-api.mapvx.com`, `api.mapvx.dev`, `portal.mapvx.dev`, etc.).
5
- * Does not match lookalike domains (e.g. `notmapvx.com`).
6
- *
7
- * @param hostname - Value from `URL.hostname` (no port)
8
- * @returns True if context headers should be attached for this host
9
- * @group Utils
10
- */
11
1
  export function isMapVxRequestHostname(hostname) {
12
2
  const h = hostname.trim().toLowerCase();
13
3
  if (!h) {
@@ -15,4 +5,3 @@ export function isMapVxRequestHostname(hostname) {
15
5
  }
16
6
  return /^(?:[a-z0-9-]+\.)*mapvx\.(?:com|dev)$/.test(h);
17
7
  }
18
- //# sourceMappingURL=mapvxHostname.js.map
@@ -82,4 +82,3 @@ export declare abstract class NavFunctions {
82
82
  */
83
83
  static intermediateAngleBetween(initialAngle: number, finalAngle: number, fraction: number): number;
84
84
  }
85
- //# sourceMappingURL=nav-functions.d.ts.map