@mountaya/elements 0.0.0-stage → 0.1.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 (831) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/LICENCE.fr.txt +280 -0
  3. package/LICENSE.txt +262 -0
  4. package/README.md +1509 -2
  5. package/THIRD-PARTY-NOTICES.txt +103 -0
  6. package/dist/accentColor-GNKBD2CW.js +4 -0
  7. package/dist/accentColor-GNKBD2CW.js.map +1 -0
  8. package/dist/accentColor-VX2JSMGE.cjs +17 -0
  9. package/dist/accentColor-VX2JSMGE.cjs.map +1 -0
  10. package/dist/agent/index.cjs +1964 -0
  11. package/dist/agent/index.cjs.map +1 -0
  12. package/dist/agent/index.d.cts +2016 -0
  13. package/dist/agent/index.d.ts +2016 -0
  14. package/dist/agent/index.js +1937 -0
  15. package/dist/agent/index.js.map +1 -0
  16. package/dist/amenities-B3-qAjxu.d.cts +160 -0
  17. package/dist/amenities-B3-qAjxu.d.ts +160 -0
  18. package/dist/bundle-Je5zsRFg.d.cts +222 -0
  19. package/dist/bundle-xYrrbJTH.d.ts +222 -0
  20. package/dist/camera/index.cjs +3477 -0
  21. package/dist/camera/index.cjs.map +1 -0
  22. package/dist/camera/index.d.cts +1751 -0
  23. package/dist/camera/index.d.ts +1751 -0
  24. package/dist/camera/index.js +3328 -0
  25. package/dist/camera/index.js.map +1 -0
  26. package/dist/camera-BrFLU1DH.d.cts +549 -0
  27. package/dist/camera-C48Ykaxv.d.ts +549 -0
  28. package/dist/chunk-23PFRRB6.js +3 -0
  29. package/dist/chunk-23PFRRB6.js.map +1 -0
  30. package/dist/chunk-2GI5SAH2.js +71 -0
  31. package/dist/chunk-2GI5SAH2.js.map +1 -0
  32. package/dist/chunk-2MQK6A74.js +39 -0
  33. package/dist/chunk-2MQK6A74.js.map +1 -0
  34. package/dist/chunk-2RE7R4LD.js +73 -0
  35. package/dist/chunk-2RE7R4LD.js.map +1 -0
  36. package/dist/chunk-3JZQKN4O.js +6 -0
  37. package/dist/chunk-3JZQKN4O.js.map +1 -0
  38. package/dist/chunk-3NDXVUUI.js +50 -0
  39. package/dist/chunk-3NDXVUUI.js.map +1 -0
  40. package/dist/chunk-3R4GFTUM.cjs +59 -0
  41. package/dist/chunk-3R4GFTUM.cjs.map +1 -0
  42. package/dist/chunk-3RVUQ6JN.cjs +22 -0
  43. package/dist/chunk-3RVUQ6JN.cjs.map +1 -0
  44. package/dist/chunk-4F6BJMJC.cjs +49 -0
  45. package/dist/chunk-4F6BJMJC.cjs.map +1 -0
  46. package/dist/chunk-4NWQD4BX.js +132 -0
  47. package/dist/chunk-4NWQD4BX.js.map +1 -0
  48. package/dist/chunk-5K2MH3R6.js +10 -0
  49. package/dist/chunk-5K2MH3R6.js.map +1 -0
  50. package/dist/chunk-6ACRNQQQ.cjs +8 -0
  51. package/dist/chunk-6ACRNQQQ.cjs.map +1 -0
  52. package/dist/chunk-6D26E3IA.js +66 -0
  53. package/dist/chunk-6D26E3IA.js.map +1 -0
  54. package/dist/chunk-6ESAW35P.cjs +80 -0
  55. package/dist/chunk-6ESAW35P.cjs.map +1 -0
  56. package/dist/chunk-6LIW2A5M.cjs +1176 -0
  57. package/dist/chunk-6LIW2A5M.cjs.map +1 -0
  58. package/dist/chunk-6OTTWVCA.js +57 -0
  59. package/dist/chunk-6OTTWVCA.js.map +1 -0
  60. package/dist/chunk-6VROJ4UG.js +862 -0
  61. package/dist/chunk-6VROJ4UG.js.map +1 -0
  62. package/dist/chunk-6Y7FTGO4.js +23 -0
  63. package/dist/chunk-6Y7FTGO4.js.map +1 -0
  64. package/dist/chunk-75I4CG64.js +104 -0
  65. package/dist/chunk-75I4CG64.js.map +1 -0
  66. package/dist/chunk-7CUBXHAH.cjs +14 -0
  67. package/dist/chunk-7CUBXHAH.cjs.map +1 -0
  68. package/dist/chunk-7GTCURVY.js +52 -0
  69. package/dist/chunk-7GTCURVY.js.map +1 -0
  70. package/dist/chunk-7IWOL6AM.cjs +100 -0
  71. package/dist/chunk-7IWOL6AM.cjs.map +1 -0
  72. package/dist/chunk-7QN7M667.cjs +151 -0
  73. package/dist/chunk-7QN7M667.cjs.map +1 -0
  74. package/dist/chunk-A6KQDKLM.cjs +1197 -0
  75. package/dist/chunk-A6KQDKLM.cjs.map +1 -0
  76. package/dist/chunk-A77EA67G.js +354 -0
  77. package/dist/chunk-A77EA67G.js.map +1 -0
  78. package/dist/chunk-AFKOABJ4.cjs +7194 -0
  79. package/dist/chunk-AFKOABJ4.cjs.map +1 -0
  80. package/dist/chunk-AG6JV5Z2.cjs +183 -0
  81. package/dist/chunk-AG6JV5Z2.cjs.map +1 -0
  82. package/dist/chunk-APBK7NMS.js +30 -0
  83. package/dist/chunk-APBK7NMS.js.map +1 -0
  84. package/dist/chunk-AWO5YA7A.cjs +33 -0
  85. package/dist/chunk-AWO5YA7A.cjs.map +1 -0
  86. package/dist/chunk-AZATU6QW.js +108 -0
  87. package/dist/chunk-AZATU6QW.js.map +1 -0
  88. package/dist/chunk-BD2U3WST.cjs +623 -0
  89. package/dist/chunk-BD2U3WST.cjs.map +1 -0
  90. package/dist/chunk-BHBEOU6L.cjs +65 -0
  91. package/dist/chunk-BHBEOU6L.cjs.map +1 -0
  92. package/dist/chunk-CNOSNYNE.js +8 -0
  93. package/dist/chunk-CNOSNYNE.js.map +1 -0
  94. package/dist/chunk-CW3EFR4O.js +12 -0
  95. package/dist/chunk-CW3EFR4O.js.map +1 -0
  96. package/dist/chunk-DASVRNBK.js +7187 -0
  97. package/dist/chunk-DASVRNBK.js.map +1 -0
  98. package/dist/chunk-DJ6LCKYP.js +42 -0
  99. package/dist/chunk-DJ6LCKYP.js.map +1 -0
  100. package/dist/chunk-E5FHQAIO.cjs +45 -0
  101. package/dist/chunk-E5FHQAIO.cjs.map +1 -0
  102. package/dist/chunk-EOML5OTY.cjs +360 -0
  103. package/dist/chunk-EOML5OTY.cjs.map +1 -0
  104. package/dist/chunk-EP5CASHL.js +613 -0
  105. package/dist/chunk-EP5CASHL.js.map +1 -0
  106. package/dist/chunk-EP5OEEVZ.cjs +14 -0
  107. package/dist/chunk-EP5OEEVZ.cjs.map +1 -0
  108. package/dist/chunk-EUXI3FGQ.js +150 -0
  109. package/dist/chunk-EUXI3FGQ.js.map +1 -0
  110. package/dist/chunk-EWFSHCOS.js +40 -0
  111. package/dist/chunk-EWFSHCOS.js.map +1 -0
  112. package/dist/chunk-EX2C5K2T.cjs +25 -0
  113. package/dist/chunk-EX2C5K2T.cjs.map +1 -0
  114. package/dist/chunk-FEXWDQIZ.cjs +8 -0
  115. package/dist/chunk-FEXWDQIZ.cjs.map +1 -0
  116. package/dist/chunk-FEYBFY7H.cjs +358 -0
  117. package/dist/chunk-FEYBFY7H.cjs.map +1 -0
  118. package/dist/chunk-FRGAV6N6.cjs +34 -0
  119. package/dist/chunk-FRGAV6N6.cjs.map +1 -0
  120. package/dist/chunk-G5DHP5VF.js +6 -0
  121. package/dist/chunk-G5DHP5VF.js.map +1 -0
  122. package/dist/chunk-G5W2UHV2.js +99 -0
  123. package/dist/chunk-G5W2UHV2.js.map +1 -0
  124. package/dist/chunk-G7OP7O2C.cjs +39 -0
  125. package/dist/chunk-G7OP7O2C.cjs.map +1 -0
  126. package/dist/chunk-GE6CFCAM.cjs +25 -0
  127. package/dist/chunk-GE6CFCAM.cjs.map +1 -0
  128. package/dist/chunk-GIFALLHI.cjs +111 -0
  129. package/dist/chunk-GIFALLHI.cjs.map +1 -0
  130. package/dist/chunk-GLFET5GM.js +129 -0
  131. package/dist/chunk-GLFET5GM.js.map +1 -0
  132. package/dist/chunk-GQ6UFPFM.js +22 -0
  133. package/dist/chunk-GQ6UFPFM.js.map +1 -0
  134. package/dist/chunk-GQJWVMXS.js +129 -0
  135. package/dist/chunk-GQJWVMXS.js.map +1 -0
  136. package/dist/chunk-GVVJPUKC.js +80 -0
  137. package/dist/chunk-GVVJPUKC.js.map +1 -0
  138. package/dist/chunk-GZ2HOCQ2.cjs +134 -0
  139. package/dist/chunk-GZ2HOCQ2.cjs.map +1 -0
  140. package/dist/chunk-HCBOHXWP.js +37 -0
  141. package/dist/chunk-HCBOHXWP.js.map +1 -0
  142. package/dist/chunk-IBQJDVHF.cjs +281 -0
  143. package/dist/chunk-IBQJDVHF.cjs.map +1 -0
  144. package/dist/chunk-ISLB6Y5Q.cjs +106 -0
  145. package/dist/chunk-ISLB6Y5Q.cjs.map +1 -0
  146. package/dist/chunk-J55CRR4F.js +105 -0
  147. package/dist/chunk-J55CRR4F.js.map +1 -0
  148. package/dist/chunk-JBG6Z6MQ.cjs +28 -0
  149. package/dist/chunk-JBG6Z6MQ.cjs.map +1 -0
  150. package/dist/chunk-K3RQOZRU.js +61 -0
  151. package/dist/chunk-K3RQOZRU.js.map +1 -0
  152. package/dist/chunk-KDJYS4GB.cjs +703 -0
  153. package/dist/chunk-KDJYS4GB.cjs.map +1 -0
  154. package/dist/chunk-KMCAHUZM.cjs +4 -0
  155. package/dist/chunk-KMCAHUZM.cjs.map +1 -0
  156. package/dist/chunk-KUCBNPC6.js +87 -0
  157. package/dist/chunk-KUCBNPC6.js.map +1 -0
  158. package/dist/chunk-KV6UE5A4.js +50 -0
  159. package/dist/chunk-KV6UE5A4.js.map +1 -0
  160. package/dist/chunk-L6TZ2HQR.cjs +18 -0
  161. package/dist/chunk-L6TZ2HQR.cjs.map +1 -0
  162. package/dist/chunk-L7QHHGG2.cjs +141 -0
  163. package/dist/chunk-L7QHHGG2.cjs.map +1 -0
  164. package/dist/chunk-LHK3Y2AL.js +271 -0
  165. package/dist/chunk-LHK3Y2AL.js.map +1 -0
  166. package/dist/chunk-LO5RYRBH.cjs +6317 -0
  167. package/dist/chunk-LO5RYRBH.cjs.map +1 -0
  168. package/dist/chunk-LS5SJMUO.cjs +194 -0
  169. package/dist/chunk-LS5SJMUO.cjs.map +1 -0
  170. package/dist/chunk-LUGTMZFN.cjs +42 -0
  171. package/dist/chunk-LUGTMZFN.cjs.map +1 -0
  172. package/dist/chunk-LVUQU6D5.js +32 -0
  173. package/dist/chunk-LVUQU6D5.js.map +1 -0
  174. package/dist/chunk-M2QRC2GZ.js +166 -0
  175. package/dist/chunk-M2QRC2GZ.js.map +1 -0
  176. package/dist/chunk-M6QJYQIM.cjs +53 -0
  177. package/dist/chunk-M6QJYQIM.cjs.map +1 -0
  178. package/dist/chunk-MGCPH5EO.js +12 -0
  179. package/dist/chunk-MGCPH5EO.js.map +1 -0
  180. package/dist/chunk-MLVUWEZR.cjs +474 -0
  181. package/dist/chunk-MLVUWEZR.cjs.map +1 -0
  182. package/dist/chunk-MTAMJMZL.cjs +707 -0
  183. package/dist/chunk-MTAMJMZL.cjs.map +1 -0
  184. package/dist/chunk-MXL5AT3N.js +48 -0
  185. package/dist/chunk-MXL5AT3N.js.map +1 -0
  186. package/dist/chunk-MYEQSESM.cjs +75 -0
  187. package/dist/chunk-MYEQSESM.cjs.map +1 -0
  188. package/dist/chunk-N3VPF6ZD.js +427 -0
  189. package/dist/chunk-N3VPF6ZD.js.map +1 -0
  190. package/dist/chunk-N6VUAIGI.js +7 -0
  191. package/dist/chunk-N6VUAIGI.js.map +1 -0
  192. package/dist/chunk-N6XRLUN6.js +6286 -0
  193. package/dist/chunk-N6XRLUN6.js.map +1 -0
  194. package/dist/chunk-NOGDOZIT.cjs +114 -0
  195. package/dist/chunk-NOGDOZIT.cjs.map +1 -0
  196. package/dist/chunk-NUWXEISH.cjs +10 -0
  197. package/dist/chunk-NUWXEISH.cjs.map +1 -0
  198. package/dist/chunk-NZCZHXYN.cjs +161 -0
  199. package/dist/chunk-NZCZHXYN.cjs.map +1 -0
  200. package/dist/chunk-ODROSWQX.cjs +53 -0
  201. package/dist/chunk-ODROSWQX.cjs.map +1 -0
  202. package/dist/chunk-OE36AYKG.cjs +82 -0
  203. package/dist/chunk-OE36AYKG.cjs.map +1 -0
  204. package/dist/chunk-OLON7MO6.cjs +437 -0
  205. package/dist/chunk-OLON7MO6.cjs.map +1 -0
  206. package/dist/chunk-PBUOR2IT.js +277 -0
  207. package/dist/chunk-PBUOR2IT.js.map +1 -0
  208. package/dist/chunk-PC2ELXFF.cjs +225 -0
  209. package/dist/chunk-PC2ELXFF.cjs.map +1 -0
  210. package/dist/chunk-PCSGXLOC.js +71 -0
  211. package/dist/chunk-PCSGXLOC.js.map +1 -0
  212. package/dist/chunk-PFNMP6FQ.js +56 -0
  213. package/dist/chunk-PFNMP6FQ.js.map +1 -0
  214. package/dist/chunk-PIWSZTIP.js +690 -0
  215. package/dist/chunk-PIWSZTIP.js.map +1 -0
  216. package/dist/chunk-PKWHJ2GI.js +136 -0
  217. package/dist/chunk-PKWHJ2GI.js.map +1 -0
  218. package/dist/chunk-PLMVBX2A.cjs +76 -0
  219. package/dist/chunk-PLMVBX2A.cjs.map +1 -0
  220. package/dist/chunk-PM3XCD2G.cjs +113 -0
  221. package/dist/chunk-PM3XCD2G.cjs.map +1 -0
  222. package/dist/chunk-QAL4GZO7.cjs +143 -0
  223. package/dist/chunk-QAL4GZO7.cjs.map +1 -0
  224. package/dist/chunk-QDB2SEA2.js +74 -0
  225. package/dist/chunk-QDB2SEA2.js.map +1 -0
  226. package/dist/chunk-QOV7UNUN.js +25 -0
  227. package/dist/chunk-QOV7UNUN.js.map +1 -0
  228. package/dist/chunk-QQUWYLSF.cjs +50 -0
  229. package/dist/chunk-QQUWYLSF.cjs.map +1 -0
  230. package/dist/chunk-QUMBH3U4.cjs +9 -0
  231. package/dist/chunk-QUMBH3U4.cjs.map +1 -0
  232. package/dist/chunk-R4KA7OFQ.js +12 -0
  233. package/dist/chunk-R4KA7OFQ.js.map +1 -0
  234. package/dist/chunk-RBSGAZQQ.js +17 -0
  235. package/dist/chunk-RBSGAZQQ.js.map +1 -0
  236. package/dist/chunk-RM5YJWZI.js +46 -0
  237. package/dist/chunk-RM5YJWZI.js.map +1 -0
  238. package/dist/chunk-ROKNKXA4.cjs +8 -0
  239. package/dist/chunk-ROKNKXA4.cjs.map +1 -0
  240. package/dist/chunk-RQG6D546.cjs +75 -0
  241. package/dist/chunk-RQG6D546.cjs.map +1 -0
  242. package/dist/chunk-SG4YDD5L.cjs +74 -0
  243. package/dist/chunk-SG4YDD5L.cjs.map +1 -0
  244. package/dist/chunk-SNRCA7EO.js +56 -0
  245. package/dist/chunk-SNRCA7EO.js.map +1 -0
  246. package/dist/chunk-SO75R4WW.cjs +22 -0
  247. package/dist/chunk-SO75R4WW.cjs.map +1 -0
  248. package/dist/chunk-SP34NHFI.js +45 -0
  249. package/dist/chunk-SP34NHFI.js.map +1 -0
  250. package/dist/chunk-SSKSSBWJ.cjs +179 -0
  251. package/dist/chunk-SSKSSBWJ.cjs.map +1 -0
  252. package/dist/chunk-TB5663C2.js +1108 -0
  253. package/dist/chunk-TB5663C2.js.map +1 -0
  254. package/dist/chunk-TGH4NRES.js +220 -0
  255. package/dist/chunk-TGH4NRES.js.map +1 -0
  256. package/dist/chunk-TJ6ZPNID.js +189 -0
  257. package/dist/chunk-TJ6ZPNID.js.map +1 -0
  258. package/dist/chunk-U45T35N2.cjs +90 -0
  259. package/dist/chunk-U45T35N2.cjs.map +1 -0
  260. package/dist/chunk-UKVOPEZ2.js +442 -0
  261. package/dist/chunk-UKVOPEZ2.js.map +1 -0
  262. package/dist/chunk-UTB4NROA.cjs +887 -0
  263. package/dist/chunk-UTB4NROA.cjs.map +1 -0
  264. package/dist/chunk-UTW33B5V.js +6 -0
  265. package/dist/chunk-UTW33B5V.js.map +1 -0
  266. package/dist/chunk-UYUBSD2V.cjs +33 -0
  267. package/dist/chunk-UYUBSD2V.cjs.map +1 -0
  268. package/dist/chunk-V3JEP5AG.cjs +59 -0
  269. package/dist/chunk-V3JEP5AG.cjs.map +1 -0
  270. package/dist/chunk-VFAGJXHR.js +18 -0
  271. package/dist/chunk-VFAGJXHR.js.map +1 -0
  272. package/dist/chunk-VMEE57E5.cjs +58 -0
  273. package/dist/chunk-VMEE57E5.cjs.map +1 -0
  274. package/dist/chunk-VQVBEX3Y.cjs +113 -0
  275. package/dist/chunk-VQVBEX3Y.cjs.map +1 -0
  276. package/dist/chunk-VZDXX7TT.cjs +64 -0
  277. package/dist/chunk-VZDXX7TT.cjs.map +1 -0
  278. package/dist/chunk-WE5ZTI4D.js +346 -0
  279. package/dist/chunk-WE5ZTI4D.js.map +1 -0
  280. package/dist/chunk-WEFUVABP.js +19 -0
  281. package/dist/chunk-WEFUVABP.js.map +1 -0
  282. package/dist/chunk-WMU4LRKC.js +28 -0
  283. package/dist/chunk-WMU4LRKC.js.map +1 -0
  284. package/dist/chunk-WQ24RRHL.cjs +354 -0
  285. package/dist/chunk-WQ24RRHL.cjs.map +1 -0
  286. package/dist/chunk-WW4CGS7G.cjs +26 -0
  287. package/dist/chunk-WW4CGS7G.cjs.map +1 -0
  288. package/dist/chunk-WXE5WCTM.js +1144 -0
  289. package/dist/chunk-WXE5WCTM.js.map +1 -0
  290. package/dist/chunk-X23BGIYA.cjs +37 -0
  291. package/dist/chunk-X23BGIYA.cjs.map +1 -0
  292. package/dist/chunk-XEW4FTR2.js +98 -0
  293. package/dist/chunk-XEW4FTR2.js.map +1 -0
  294. package/dist/chunk-XIOI4IYW.js +167 -0
  295. package/dist/chunk-XIOI4IYW.js.map +1 -0
  296. package/dist/chunk-XLVPJ37V.cjs +44 -0
  297. package/dist/chunk-XLVPJ37V.cjs.map +1 -0
  298. package/dist/chunk-XOHAXXZA.cjs +51 -0
  299. package/dist/chunk-XOHAXXZA.cjs.map +1 -0
  300. package/dist/chunk-Y4NRIHK6.cjs +313 -0
  301. package/dist/chunk-Y4NRIHK6.cjs.map +1 -0
  302. package/dist/chunk-Y4YMMKL3.js +23 -0
  303. package/dist/chunk-Y4YMMKL3.js.map +1 -0
  304. package/dist/chunk-YJNYBVE3.cjs +14 -0
  305. package/dist/chunk-YJNYBVE3.cjs.map +1 -0
  306. package/dist/chunk-Z762QNQP.cjs +60 -0
  307. package/dist/chunk-Z762QNQP.cjs.map +1 -0
  308. package/dist/chunk-ZG5KMBOF.js +669 -0
  309. package/dist/chunk-ZG5KMBOF.js.map +1 -0
  310. package/dist/chunk-ZKONQEFA.js +344 -0
  311. package/dist/chunk-ZKONQEFA.js.map +1 -0
  312. package/dist/chunk-ZR5X7QMH.js +39 -0
  313. package/dist/chunk-ZR5X7QMH.js.map +1 -0
  314. package/dist/chunk-ZW4BJQ26.js +84 -0
  315. package/dist/chunk-ZW4BJQ26.js.map +1 -0
  316. package/dist/climbs-BhlWuu0x.d.ts +70 -0
  317. package/dist/climbs-DgBFwySV.d.cts +70 -0
  318. package/dist/collab/index.cjs +1283 -0
  319. package/dist/collab/index.cjs.map +1 -0
  320. package/dist/collab/index.d.cts +850 -0
  321. package/dist/collab/index.d.ts +850 -0
  322. package/dist/collab/index.js +1274 -0
  323. package/dist/collab/index.js.map +1 -0
  324. package/dist/data/index.cjs +132 -0
  325. package/dist/data/index.cjs.map +1 -0
  326. package/dist/data/index.d.cts +468 -0
  327. package/dist/data/index.d.ts +468 -0
  328. package/dist/data/index.js +15 -0
  329. package/dist/data/index.js.map +1 -0
  330. package/dist/editor/index.cjs +4506 -0
  331. package/dist/editor/index.cjs.map +1 -0
  332. package/dist/editor/index.d.cts +59 -0
  333. package/dist/editor/index.d.ts +59 -0
  334. package/dist/editor/index.js +4486 -0
  335. package/dist/editor/index.js.map +1 -0
  336. package/dist/elevationTiles-pmsb9wnU.d.cts +77 -0
  337. package/dist/elevationTiles-pmsb9wnU.d.ts +77 -0
  338. package/dist/errors/index.cjs +28 -0
  339. package/dist/errors/index.cjs.map +1 -0
  340. package/dist/errors/index.d.cts +125 -0
  341. package/dist/errors/index.d.ts +125 -0
  342. package/dist/errors/index.js +3 -0
  343. package/dist/errors/index.js.map +1 -0
  344. package/dist/geo/index.cjs +232 -0
  345. package/dist/geo/index.cjs.map +1 -0
  346. package/dist/geo/index.d.cts +821 -0
  347. package/dist/geo/index.d.ts +821 -0
  348. package/dist/geo/index.js +15 -0
  349. package/dist/geo/index.js.map +1 -0
  350. package/dist/geodesy-543qXKtI.d.cts +78 -0
  351. package/dist/geodesy-543qXKtI.d.ts +78 -0
  352. package/dist/geolocation-DDkQdWMN.d.cts +106 -0
  353. package/dist/geolocation-DDkQdWMN.d.ts +106 -0
  354. package/dist/i18n/fr/index.cjs +338 -0
  355. package/dist/i18n/fr/index.cjs.map +1 -0
  356. package/dist/i18n/fr/index.d.cts +25 -0
  357. package/dist/i18n/fr/index.d.ts +25 -0
  358. package/dist/i18n/fr/index.js +336 -0
  359. package/dist/i18n/fr/index.js.map +1 -0
  360. package/dist/i18n/index.cjs +464 -0
  361. package/dist/i18n/index.cjs.map +1 -0
  362. package/dist/i18n/index.d.cts +227 -0
  363. package/dist/i18n/index.d.ts +227 -0
  364. package/dist/i18n/index.js +430 -0
  365. package/dist/i18n/index.js.map +1 -0
  366. package/dist/icons/index.cjs +116 -0
  367. package/dist/icons/index.cjs.map +1 -0
  368. package/dist/icons/index.d.cts +457 -0
  369. package/dist/icons/index.d.ts +457 -0
  370. package/dist/icons/index.js +11 -0
  371. package/dist/icons/index.js.map +1 -0
  372. package/dist/index.cjs +1869 -0
  373. package/dist/index.cjs.map +1 -0
  374. package/dist/index.d.cts +251 -0
  375. package/dist/index.d.ts +251 -0
  376. package/dist/index.js +67 -0
  377. package/dist/index.js.map +1 -0
  378. package/dist/itinerary-Dp2ZnqgD.d.cts +178 -0
  379. package/dist/itinerary-Dp2ZnqgD.d.ts +178 -0
  380. package/dist/language-CEWQ5uYw.d.cts +69 -0
  381. package/dist/language-CEWQ5uYw.d.ts +69 -0
  382. package/dist/layers/index.cjs +318 -0
  383. package/dist/layers/index.cjs.map +1 -0
  384. package/dist/layers/index.d.cts +1555 -0
  385. package/dist/layers/index.d.ts +1555 -0
  386. package/dist/layers/index.js +17 -0
  387. package/dist/layers/index.js.map +1 -0
  388. package/dist/map-client/index.cjs +4 -0
  389. package/dist/map-client/index.cjs.map +1 -0
  390. package/dist/map-client/index.d.cts +1856 -0
  391. package/dist/map-client/index.d.ts +1856 -0
  392. package/dist/map-client/index.js +3 -0
  393. package/dist/map-client/index.js.map +1 -0
  394. package/dist/maplibre-worker.mjs +12 -0
  395. package/dist/markerSprite-DGBQF6PO.cjs +49 -0
  396. package/dist/markerSprite-DGBQF6PO.cjs.map +1 -0
  397. package/dist/markerSprite-DZLTR6F6.js +8 -0
  398. package/dist/markerSprite-DZLTR6F6.js.map +1 -0
  399. package/dist/mountayaMap-C9mxRFib.d.cts +3277 -0
  400. package/dist/mountayaMap-DgnlQ2fE.d.ts +3277 -0
  401. package/dist/navigation/index.cjs +699 -0
  402. package/dist/navigation/index.cjs.map +1 -0
  403. package/dist/navigation/index.d.cts +632 -0
  404. package/dist/navigation/index.d.ts +632 -0
  405. package/dist/navigation/index.js +689 -0
  406. package/dist/navigation/index.js.map +1 -0
  407. package/dist/order-BLhsGsH8.d.ts +132 -0
  408. package/dist/order-BZkUwMou.d.cts +132 -0
  409. package/dist/paint-BgUcj8l7.d.cts +118 -0
  410. package/dist/paint-Dx_qGNE_.d.ts +118 -0
  411. package/dist/profile/index.cjs +675 -0
  412. package/dist/profile/index.cjs.map +1 -0
  413. package/dist/profile/index.d.cts +2086 -0
  414. package/dist/profile/index.d.ts +2086 -0
  415. package/dist/profile/index.js +18 -0
  416. package/dist/profile/index.js.map +1 -0
  417. package/dist/provider-DM71XnLX.d.cts +121 -0
  418. package/dist/provider-DM71XnLX.d.ts +121 -0
  419. package/dist/roadAccess-D_rOE4xW.d.cts +86 -0
  420. package/dist/roadAccess-D_rOE4xW.d.ts +86 -0
  421. package/dist/routeProfile-BKfSfxx6.d.ts +210 -0
  422. package/dist/routeProfile-BsSUABXv.d.cts +210 -0
  423. package/dist/seams/index.cjs +39 -0
  424. package/dist/seams/index.cjs.map +1 -0
  425. package/dist/seams/index.d.cts +254 -0
  426. package/dist/seams/index.d.ts +254 -0
  427. package/dist/seams/index.js +6 -0
  428. package/dist/seams/index.js.map +1 -0
  429. package/dist/search/index.cjs +147 -0
  430. package/dist/search/index.cjs.map +1 -0
  431. package/dist/search/index.d.cts +888 -0
  432. package/dist/search/index.d.ts +888 -0
  433. package/dist/search/index.js +14 -0
  434. package/dist/search/index.js.map +1 -0
  435. package/dist/searchHighlight-DFE7LVIL.cjs +33 -0
  436. package/dist/searchHighlight-DFE7LVIL.cjs.map +1 -0
  437. package/dist/searchHighlight-MHAQZVWG.js +12 -0
  438. package/dist/searchHighlight-MHAQZVWG.js.map +1 -0
  439. package/dist/searchLimits-j99-NTXR.d.cts +24 -0
  440. package/dist/searchLimits-j99-NTXR.d.ts +24 -0
  441. package/dist/sections-CVlc2Inr.d.cts +953 -0
  442. package/dist/sections-CmtaduLc.d.ts +953 -0
  443. package/dist/segmentRoute-C5UL_5bp.d.ts +172 -0
  444. package/dist/segmentRoute-CIo6dR8Y.d.cts +172 -0
  445. package/dist/strings-30RSdIat.d.cts +552 -0
  446. package/dist/strings-DPTIbzT5.d.ts +552 -0
  447. package/dist/stripeImage-CQUXM2YI.js +14 -0
  448. package/dist/stripeImage-CQUXM2YI.js.map +1 -0
  449. package/dist/stripeImage-R43OPA6U.cjs +39 -0
  450. package/dist/stripeImage-R43OPA6U.cjs.map +1 -0
  451. package/dist/style/index.cjs +116 -0
  452. package/dist/style/index.cjs.map +1 -0
  453. package/dist/style/index.d.cts +538 -0
  454. package/dist/style/index.d.ts +538 -0
  455. package/dist/style/index.js +11 -0
  456. package/dist/style/index.js.map +1 -0
  457. package/dist/styles.css +11 -0
  458. package/dist/testing/index.cjs +629 -0
  459. package/dist/testing/index.cjs.map +1 -0
  460. package/dist/testing/index.d.cts +265 -0
  461. package/dist/testing/index.d.ts +265 -0
  462. package/dist/testing/index.js +623 -0
  463. package/dist/testing/index.js.map +1 -0
  464. package/dist/timezone/index.cjs +759 -0
  465. package/dist/timezone/index.cjs.map +1 -0
  466. package/dist/timezone/index.d.cts +53 -0
  467. package/dist/timezone/index.d.ts +53 -0
  468. package/dist/timezone/index.js +757 -0
  469. package/dist/timezone/index.js.map +1 -0
  470. package/dist/types-B034JMjl.d.ts +973 -0
  471. package/dist/types-B2NDLxQA.d.cts +21 -0
  472. package/dist/types-B2NDLxQA.d.ts +21 -0
  473. package/dist/types-BEv8V_8V.d.cts +55 -0
  474. package/dist/types-BEv8V_8V.d.ts +55 -0
  475. package/dist/types-C8aX5KMU.d.cts +973 -0
  476. package/dist/types-CTQwbSdA.d.cts +321 -0
  477. package/dist/types-nO2joeRk.d.ts +321 -0
  478. package/dist/units/index.cjs +99 -0
  479. package/dist/units/index.cjs.map +1 -0
  480. package/dist/units/index.d.cts +75 -0
  481. package/dist/units/index.d.ts +75 -0
  482. package/dist/units/index.js +6 -0
  483. package/dist/units/index.js.map +1 -0
  484. package/dist/units-D9mBrusY.d.cts +900 -0
  485. package/dist/units-D9mBrusY.d.ts +900 -0
  486. package/dist/video/index.cjs +2198 -0
  487. package/dist/video/index.cjs.map +1 -0
  488. package/dist/video/index.d.cts +873 -0
  489. package/dist/video/index.d.ts +873 -0
  490. package/dist/video/index.js +2173 -0
  491. package/dist/video/index.js.map +1 -0
  492. package/dist/videoOverlay-Dh_D5_Zs.d.cts +44 -0
  493. package/dist/videoOverlay-Dh_D5_Zs.d.ts +44 -0
  494. package/dist/view/index.cjs +43 -0
  495. package/dist/view/index.cjs.map +1 -0
  496. package/dist/view/index.d.cts +836 -0
  497. package/dist/view/index.d.ts +836 -0
  498. package/dist/view/index.js +34 -0
  499. package/dist/view/index.js.map +1 -0
  500. package/dist/zones-B05QA8fy.d.cts +75 -0
  501. package/dist/zones-B05QA8fy.d.ts +75 -0
  502. package/package.json +433 -4
  503. package/src/agent/engines/session.ts +2255 -0
  504. package/src/agent/index.ts +109 -0
  505. package/src/agent/rules/agentError.ts +128 -0
  506. package/src/agent/rules/boundedInputJson.ts +53 -0
  507. package/src/agent/rules/conversation.ts +629 -0
  508. package/src/agent/rules/conversationFaults.ts +349 -0
  509. package/src/agent/rules/conversationHost.ts +390 -0
  510. package/src/agent/rules/dispatcher.ts +102 -0
  511. package/src/agent/rules/errorCodes.ts +78 -0
  512. package/src/agent/rules/errorStatus.ts +65 -0
  513. package/src/agent/rules/scriptedTransport.ts +390 -0
  514. package/src/agent/rules/stickToBottom.ts +38 -0
  515. package/src/agent/rules/toolResultPayload.ts +197 -0
  516. package/src/auth/rules/clientHeader.ts +22 -0
  517. package/src/auth/rules/sentCredential.ts +76 -0
  518. package/src/auth/rules/transformRequest.ts +803 -0
  519. package/src/camera/engines/videoFlight.ts +1758 -0
  520. package/src/camera/index.ts +157 -0
  521. package/src/camera/rules/clearance.ts +1099 -0
  522. package/src/camera/rules/fit.ts +132 -0
  523. package/src/camera/rules/modes.ts +1023 -0
  524. package/src/camera/rules/plan.ts +478 -0
  525. package/src/camera/rules/planner.ts +129 -0
  526. package/src/camera/rules/poseRanges.ts +38 -0
  527. package/src/camera/rules/presets.ts +185 -0
  528. package/src/camera/rules/profileSamples.ts +243 -0
  529. package/src/camera/rules/route.ts +596 -0
  530. package/src/camera/rules/routeContent.ts +104 -0
  531. package/src/camera/rules/spline.ts +765 -0
  532. package/src/camera/rules/sweptViewports.ts +39 -0
  533. package/src/camera/rules/track.ts +1412 -0
  534. package/src/camera/rules/vocabulary.ts +130 -0
  535. package/src/camera/rules/zoom.ts +216 -0
  536. package/src/collab/engines/session.ts +1902 -0
  537. package/src/collab/engines/trailingThrottle.ts +151 -0
  538. package/src/collab/index.ts +56 -0
  539. package/src/collab/rules/dispatch.ts +143 -0
  540. package/src/collab/rules/peerNames.ts +51 -0
  541. package/src/collab/rules/scriptedTransport.ts +244 -0
  542. package/src/compose/engines/baseMapSwitch.ts +1136 -0
  543. package/src/compose/engines/events.ts +962 -0
  544. package/src/compose/engines/mountayaMap.ts +5674 -0
  545. package/src/compose/engines/sentCredentials.ts +146 -0
  546. package/src/compose/engines/slotRequests.ts +413 -0
  547. package/src/compose/rules/accessRefusal.ts +109 -0
  548. package/src/compose/rules/accessStanding.ts +75 -0
  549. package/src/compose/rules/analysisKinds.ts +331 -0
  550. package/src/compose/rules/analysisLayers.ts +176 -0
  551. package/src/compose/rules/cameraMoves.ts +38 -0
  552. package/src/compose/rules/carriedLayers.ts +87 -0
  553. package/src/compose/rules/developmentWarnings.ts +166 -0
  554. package/src/compose/rules/fitCamera.ts +54 -0
  555. package/src/compose/rules/geoJsonSlot.ts +61 -0
  556. package/src/compose/rules/geometrySlots.ts +155 -0
  557. package/src/compose/rules/glyphNode.ts +62 -0
  558. package/src/compose/rules/layerKeys.ts +92 -0
  559. package/src/compose/rules/layerOrder.ts +85 -0
  560. package/src/compose/rules/layersManifest.ts +26 -0
  561. package/src/compose/rules/mapOptions.ts +300 -0
  562. package/src/compose/rules/maplibreWorkerVersion.gen.ts +8 -0
  563. package/src/compose/rules/markerPin.ts +122 -0
  564. package/src/compose/rules/markerRegistry.ts +85 -0
  565. package/src/compose/rules/markerSprite.ts +382 -0
  566. package/src/compose/rules/maxBounds.ts +120 -0
  567. package/src/compose/rules/overlayLookup.ts +49 -0
  568. package/src/compose/rules/paintDiff.ts +38 -0
  569. package/src/compose/rules/panLock.ts +77 -0
  570. package/src/compose/rules/patch.ts +124 -0
  571. package/src/compose/rules/queriedFeature.ts +55 -0
  572. package/src/compose/rules/queryLayers.ts +46 -0
  573. package/src/compose/rules/searchHighlight.ts +313 -0
  574. package/src/compose/rules/slotNames.ts +19 -0
  575. package/src/compose/rules/stripeImage.ts +253 -0
  576. package/src/compose/rules/swapMarker.ts +66 -0
  577. package/src/compose/rules/terrainVariant.ts +88 -0
  578. package/src/compose/rules/types.ts +566 -0
  579. package/src/compose/rules/urlHash.ts +19 -0
  580. package/src/compose/rules/viewOptions.ts +451 -0
  581. package/src/compose/rules/workerUrl.ts +96 -0
  582. package/src/data/engines/itineraryResource.ts +643 -0
  583. package/src/data/index.ts +78 -0
  584. package/src/data/rules/adapt.ts +473 -0
  585. package/src/data/rules/editModes.ts +51 -0
  586. package/src/data/rules/itinerary.ts +168 -0
  587. package/src/data/rules/nullable.ts +63 -0
  588. package/src/data/rules/roadAccess.ts +169 -0
  589. package/src/data/rules/segmentGroups.ts +309 -0
  590. package/src/data/rules/selectors.ts +95 -0
  591. package/src/data/rules/zones.ts +79 -0
  592. package/src/draw/engines/boundaryEngine.ts +1003 -0
  593. package/src/draw/engines/framedAdapter.ts +198 -0
  594. package/src/draw/engines/pointerCursor.ts +205 -0
  595. package/src/draw/engines/segmentEngine.ts +1405 -0
  596. package/src/draw/engines/snapIndex.ts +254 -0
  597. package/src/draw/engines/waypointEngine.ts +574 -0
  598. package/src/draw/engines/zoneEngine.ts +1137 -0
  599. package/src/draw/rules/drawFrame.ts +123 -0
  600. package/src/draw/rules/insertVertex.ts +226 -0
  601. package/src/draw/rules/screenSpace.ts +62 -0
  602. package/src/draw/rules/seeds.ts +185 -0
  603. package/src/draw/rules/snap.ts +115 -0
  604. package/src/draw/rules/snapCameraKey.ts +50 -0
  605. package/src/draw/rules/terraDrawShared.ts +214 -0
  606. package/src/draw/rules/zoneOutline.ts +213 -0
  607. package/src/editing/engines/cursor.ts +505 -0
  608. package/src/editing/engines/draftMarker.ts +149 -0
  609. package/src/editing/rules/accent.ts +11 -0
  610. package/src/editing/rules/engine.ts +286 -0
  611. package/src/editing/rules/placement.ts +22 -0
  612. package/src/editing/rules/positions.ts +89 -0
  613. package/src/editing/rules/sources.ts +9 -0
  614. package/src/editing/rules/types.ts +457 -0
  615. package/src/editing/rules/vocabulary.ts +10 -0
  616. package/src/editing/rules/waypointCursor.ts +228 -0
  617. package/src/editor/engines/directionArrows.ts +459 -0
  618. package/src/editor/engines/directions.ts +1383 -0
  619. package/src/editor/engines/editorClient.ts +134 -0
  620. package/src/editor/engines/eventScope.ts +59 -0
  621. package/src/editor/engines/frameLoop.ts +159 -0
  622. package/src/editor/engines/itineraryPreview.ts +272 -0
  623. package/src/editor/engines/mapLockGuard.ts +66 -0
  624. package/src/editor/engines/overlayRenderer.ts +2696 -0
  625. package/src/editor/engines/peerDraft.ts +760 -0
  626. package/src/editor/engines/poiPick.ts +305 -0
  627. package/src/editor/engines/pointPick.ts +84 -0
  628. package/src/editor/engines/roadAccessLine.ts +140 -0
  629. package/src/editor/engines/searchHighlight.ts +183 -0
  630. package/src/editor/engines/viewClient.ts +4083 -0
  631. package/src/editor/engines/zoneBadges.ts +503 -0
  632. package/src/editor/index.ts +97 -0
  633. package/src/editor/rules/accentColor.ts +116 -0
  634. package/src/editor/rules/camera.ts +121 -0
  635. package/src/editor/rules/contract.ts +125 -0
  636. package/src/editor/rules/icons.ts +825 -0
  637. package/src/editor/rules/markerElements.ts +244 -0
  638. package/src/editor/rules/style.ts +51 -0
  639. package/src/editor/rules/terrain.ts +98 -0
  640. package/src/editor/rules/tileWarm.ts +191 -0
  641. package/src/editor/rules/tilesReload.ts +158 -0
  642. package/src/editor/rules/zoneBadgePlacement.ts +1832 -0
  643. package/src/editor/rules/zoneTimeStyling.ts +119 -0
  644. package/src/errors/index.ts +25 -0
  645. package/src/errors/rules/errors.ts +157 -0
  646. package/src/errors/rules/print.ts +129 -0
  647. package/src/geo/index.ts +94 -0
  648. package/src/geo/rules/boundaries.ts +105 -0
  649. package/src/geo/rules/camera.ts +496 -0
  650. package/src/geo/rules/corridor.ts +242 -0
  651. package/src/geo/rules/elevationTiles.ts +269 -0
  652. package/src/geo/rules/formatLngLat.ts +63 -0
  653. package/src/geo/rules/geodesy.ts +125 -0
  654. package/src/geo/rules/geometry.ts +362 -0
  655. package/src/geo/rules/lineWalk.ts +77 -0
  656. package/src/geo/rules/longitude.ts +99 -0
  657. package/src/geo/rules/searchLimits.ts +22 -0
  658. package/src/geo/rules/segmentGeometry.ts +80 -0
  659. package/src/geo/rules/terrain.ts +107 -0
  660. package/src/geo/rules/tuples.ts +124 -0
  661. package/src/geo/rules/types.ts +54 -0
  662. package/src/geo/rules/webMercator.ts +57 -0
  663. package/src/i18n/fr/index.ts +17 -0
  664. package/src/i18n/fr/rules/fr.ts +85 -0
  665. package/src/i18n/fr/rules/words.gen.ts +277 -0
  666. package/src/i18n/index.ts +81 -0
  667. package/src/i18n/rules/bundle.ts +378 -0
  668. package/src/i18n/rules/config.ts +71 -0
  669. package/src/i18n/rules/endonyms.gen.ts +19 -0
  670. package/src/i18n/rules/language.ts +92 -0
  671. package/src/i18n/rules/localizedName.ts +33 -0
  672. package/src/i18n/rules/merge.ts +106 -0
  673. package/src/i18n/rules/scope.ts +127 -0
  674. package/src/i18n/rules/strings.ts +632 -0
  675. package/src/i18n/rules/videoOverlay.ts +121 -0
  676. package/src/i18n/rules/wordForms.ts +95 -0
  677. package/src/i18n/rules/words.gen.ts +277 -0
  678. package/src/icons/index.ts +54 -0
  679. package/src/icons/rules/activities.ts +40 -0
  680. package/src/icons/rules/amenities.ts +250 -0
  681. package/src/icons/rules/artwork.gen.ts +83 -0
  682. package/src/icons/rules/artwork.ts +47 -0
  683. package/src/icons/rules/fallback.ts +21 -0
  684. package/src/icons/rules/lucideMarkers.gen.ts +112 -0
  685. package/src/icons/rules/lucideUi.gen.ts +197 -0
  686. package/src/icons/rules/paint.ts +107 -0
  687. package/src/icons/rules/parse.ts +475 -0
  688. package/src/icons/rules/provider.ts +373 -0
  689. package/src/icons/rules/sprites.ts +54 -0
  690. package/src/icons/rules/ui.ts +348 -0
  691. package/src/icons/rules/waypoints.ts +215 -0
  692. package/src/index.ts +1012 -0
  693. package/src/layers/engines/layersSelection.ts +515 -0
  694. package/src/layers/engines/readoutEngine.ts +131 -0
  695. package/src/layers/index.ts +151 -0
  696. package/src/layers/rules/analysis.ts +135 -0
  697. package/src/layers/rules/enrichment.ts +30 -0
  698. package/src/layers/rules/geoJson.ts +270 -0
  699. package/src/layers/rules/hover.ts +67 -0
  700. package/src/layers/rules/itineraries.ts +182 -0
  701. package/src/layers/rules/layersPanel.ts +237 -0
  702. package/src/layers/rules/order.ts +194 -0
  703. package/src/layers/rules/overlayInstant.ts +49 -0
  704. package/src/layers/rules/overlays.ts +52 -0
  705. package/src/layers/rules/poiPanel.ts +119 -0
  706. package/src/layers/rules/pois.ts +114 -0
  707. package/src/layers/rules/readout.ts +340 -0
  708. package/src/layers/rules/streetView.ts +16 -0
  709. package/src/layers/rules/tileTimestamp.ts +146 -0
  710. package/src/layers/rules/timeSlider.ts +192 -0
  711. package/src/layers/rules/timeWindow.ts +123 -0
  712. package/src/layers/rules/zones.ts +43 -0
  713. package/src/layers/rules/zoom.ts +77 -0
  714. package/src/map-client/index.ts +71 -0
  715. package/src/map-client/rules/mapClient.ts +1943 -0
  716. package/src/navigation/engines/navigation.ts +493 -0
  717. package/src/navigation/index.ts +51 -0
  718. package/src/navigation/rules/followedRoute.ts +78 -0
  719. package/src/navigation/rules/instructions.ts +89 -0
  720. package/src/navigation/rules/itineraryRoute.ts +232 -0
  721. package/src/navigation/rules/offRoute.ts +41 -0
  722. package/src/navigation/rules/progress.ts +230 -0
  723. package/src/navigation/rules/prompts.ts +217 -0
  724. package/src/navigation/rules/routeRequest.ts +98 -0
  725. package/src/navigation/rules/status.ts +142 -0
  726. package/src/navigation/rules/steps.ts +234 -0
  727. package/src/navigation/rules/types.ts +83 -0
  728. package/src/profile/index.ts +307 -0
  729. package/src/profile/rules/amenityBadge.ts +35 -0
  730. package/src/profile/rules/amenityFilter.ts +74 -0
  731. package/src/profile/rules/amenityStacks.ts +66 -0
  732. package/src/profile/rules/axis.ts +89 -0
  733. package/src/profile/rules/axisCulling.ts +83 -0
  734. package/src/profile/rules/axisLookup.ts +180 -0
  735. package/src/profile/rules/climbs.ts +292 -0
  736. package/src/profile/rules/cursorMarker.ts +122 -0
  737. package/src/profile/rules/cursorReadout.ts +104 -0
  738. package/src/profile/rules/curvePlacement.ts +216 -0
  739. package/src/profile/rules/dock.ts +293 -0
  740. package/src/profile/rules/elevation.ts +1263 -0
  741. package/src/profile/rules/instant.ts +89 -0
  742. package/src/profile/rules/intl.ts +237 -0
  743. package/src/profile/rules/legEmphasis.ts +53 -0
  744. package/src/profile/rules/profileColors.ts +66 -0
  745. package/src/profile/rules/profileLayout.ts +59 -0
  746. package/src/profile/rules/profileSlices.ts +55 -0
  747. package/src/profile/rules/routeProfile.ts +475 -0
  748. package/src/profile/rules/rowMatch.ts +50 -0
  749. package/src/profile/rules/scale.ts +650 -0
  750. package/src/profile/rules/scaleFrame.ts +171 -0
  751. package/src/profile/rules/sectionChips.ts +83 -0
  752. package/src/profile/rules/sections.ts +923 -0
  753. package/src/profile/rules/slopeRamp.ts +160 -0
  754. package/src/profile/rules/statStrip.ts +103 -0
  755. package/src/profile/rules/steepness.ts +51 -0
  756. package/src/profile/rules/tableCells.ts +269 -0
  757. package/src/profile/rules/tableCursor.ts +87 -0
  758. package/src/profile/rules/unitPatterns.ts +335 -0
  759. package/src/profile/rules/units.ts +1025 -0
  760. package/src/profile/rules/waypointCard.ts +593 -0
  761. package/src/profile/rules/webAddress.ts +130 -0
  762. package/src/profile/rules/windowSpans.ts +65 -0
  763. package/src/rules/asciiFold.ts +17 -0
  764. package/src/rules/inDevelopment.ts +54 -0
  765. package/src/rules/listeners.ts +62 -0
  766. package/src/rules/timers.ts +9 -0
  767. package/src/rules/types.ts +22 -0
  768. package/src/rules/uuid.ts +87 -0
  769. package/src/seams/engines/geolocateControl.ts +286 -0
  770. package/src/seams/index.ts +50 -0
  771. package/src/seams/rules/clock.ts +169 -0
  772. package/src/seams/rules/geolocation.ts +165 -0
  773. package/src/seams/rules/segmentRoute.ts +187 -0
  774. package/src/search/engines/search.ts +1093 -0
  775. package/src/search/index.ts +114 -0
  776. package/src/search/rules/describe.ts +383 -0
  777. package/src/search/rules/filters.ts +195 -0
  778. package/src/search/rules/highlight.ts +270 -0
  779. package/src/search/rules/pick.ts +90 -0
  780. package/src/search/rules/rows.ts +258 -0
  781. package/src/search/rules/searchFocus.ts +27 -0
  782. package/src/search/rules/searchViewport.ts +44 -0
  783. package/src/search/rules/shown.ts +77 -0
  784. package/src/search/rules/types.ts +340 -0
  785. package/src/stream/rules/reconnectSchedule.ts +83 -0
  786. package/src/style/engines/organizationRead.ts +80 -0
  787. package/src/style/index.ts +63 -0
  788. package/src/style/rules/apply.ts +268 -0
  789. package/src/style/rules/attribution.ts +119 -0
  790. package/src/style/rules/itineraryLine.ts +142 -0
  791. package/src/style/rules/language.ts +668 -0
  792. package/src/style/rules/layout.gen.ts +27 -0
  793. package/src/style/rules/organization.ts +96 -0
  794. package/src/style/rules/paint.ts +143 -0
  795. package/src/style/rules/panelLayout.ts +51 -0
  796. package/src/style/rules/roadAccessColors.ts +29 -0
  797. package/src/style/rules/roadAccessLine.ts +267 -0
  798. package/src/style/rules/segmentColors.ts +207 -0
  799. package/src/testing/catalogs.ts +103 -0
  800. package/src/testing/index.ts +30 -0
  801. package/src/testing/mapClient.ts +241 -0
  802. package/src/testing/mountayaMap.ts +741 -0
  803. package/src/timezone/index.ts +14 -0
  804. package/src/timezone/rules/viewport.ts +875 -0
  805. package/src/units/index.ts +55 -0
  806. package/src/units/rules/conversions.ts +620 -0
  807. package/src/units/rules/preferenceChoices.ts +124 -0
  808. package/src/units/rules/preferences.ts +77 -0
  809. package/src/units/rules/rounding.ts +69 -0
  810. package/src/video/engines/videoRun.ts +654 -0
  811. package/src/video/engines/viewClient.ts +6 -0
  812. package/src/video/index.ts +83 -0
  813. package/src/video/profileOverlay/rules/contract.ts +212 -0
  814. package/src/video/profileOverlay/rules/curve.ts +216 -0
  815. package/src/video/profileOverlay/rules/draw.ts +410 -0
  816. package/src/video/profileOverlay/rules/fonts.ts +54 -0
  817. package/src/video/profileOverlay/rules/graphDesign.ts +690 -0
  818. package/src/video/profileOverlay/rules/minimalDesign.ts +144 -0
  819. package/src/video/profileOverlay/rules/registry.ts +23 -0
  820. package/src/video/profileOverlay/rules/staticLayer.ts +582 -0
  821. package/src/video/profileOverlay/rules/stripDesign.ts +327 -0
  822. package/src/video/profileOverlay/rules/types.ts +78 -0
  823. package/src/video/rules/videoConstants.ts +250 -0
  824. package/src/video/rules/videoEncoder.ts +277 -0
  825. package/src/video/rules/videoFrames.ts +99 -0
  826. package/src/video/rules/videoPreview.ts +185 -0
  827. package/src/video/rules/videoRecorder.ts +746 -0
  828. package/src/video/rules/videoWatermark.ts +155 -0
  829. package/src/video/rules/watermarkMark.ts +40 -0
  830. package/src/view/engines/viewClient.ts +6 -0
  831. package/src/view/index.ts +20 -0
@@ -0,0 +1,3277 @@
1
+ import { Geometry, Feature } from 'geojson';
2
+ import { MapEventType, MapLayerEventType, Map, AllLayoutProperties, AllPaintProperties, LngLatBoundsLike, StyleSpecification, MapOptions, TransformStyleFunction, AddLayerObject } from 'maplibre-gl';
3
+ import { RestSchema, Mountaya, DirectionsResult, SuggestionsResult, IsochronesResult, GeocodeResult, MatrixResult, PoisResult, Organization, SearchResult } from '@mountaya/client';
4
+ import { B as BoundingBox } from './types-BEv8V_8V.cjs';
5
+ import { I as IconProvider } from './provider-DM71XnLX.cjs';
6
+ import { L as LayerRank } from './order-BZkUwMou.cjs';
7
+ import { a as TileSpecification } from './types-B2NDLxQA.cjs';
8
+ import { c as GeolocationSeam, a as GeolocationFixOptions } from './geolocation-DDkQdWMN.cjs';
9
+ import { S as SearchHighlight } from './types-CTQwbSdA.cjs';
10
+ import { M as MapLanguage } from './language-CEWQ5uYw.cjs';
11
+ import { y as Renderable, p as ItineraryDrawOptions, k as CollectionDrawOptions, O as Overlay, t as MountOptions, R as RasterPaint, n as DirectionsInput, o as DrawOptions, A as AnalysisHandle, h as AnalysisId, K as SuggestionsInput, J as SuggestionDrawOptions, I as IsochronesInput, G as GeocodeInput, r as MatrixInput, q as MatrixDrawOptions, x as PoisInput, M as MarkerOptions, C as Camera, i as CameraPose, F as FitBoundsOptions, V as ZoomRange, Q as QueriedFeature, E as SearchInput, L as Layers, u as MountayaMapEvent, v as MountayaMapEvents, U as Unsubscribe } from './types-C8aX5KMU.cjs';
12
+ import { a as MapPaintOverrides } from './paint-BgUcj8l7.cjs';
13
+
14
+ /**
15
+ * MapEvents is what a `MountayaMap` hands a consumer of its event engine (`map.events`): its
16
+ * listeners, typed by MapLibre's own events, and the deferral to the style a base-map switch
17
+ * brings in.
18
+ *
19
+ * The rest of {@link MapEventEngine} (announcing and cancelling a reload, the missing-image
20
+ * resolver, the teardown) belongs to the map that owns the engine, and is not reachable here: a
21
+ * reload announced from outside would hold every drawing of the map for a style it never asked
22
+ * for.
23
+ */
24
+ interface MapEvents {
25
+ /**
26
+ * on attaches a listener of one of MapLibre's map events, typed by the event's payload, until
27
+ * the map is destroyed or the returned unsubscribe is called. A listener attached this way
28
+ * outlives a base-map switch.
29
+ *
30
+ * @param eventType The MapLibre event, such as `"moveend"` or `"click"`.
31
+ * @param handler Called with the event's own payload.
32
+ * @returns An unsubscribe that detaches this listener and no other.
33
+ */
34
+ on<T extends keyof MapEventType>(eventType: T, handler: (event: MapEventType[T]) => void): () => void;
35
+ /**
36
+ * on attaches a listener of one of MapLibre's layer events, scoped to one style layer.
37
+ *
38
+ * @param eventType The MapLibre layer event, such as `"mouseenter"`.
39
+ * @param handler Called with the event's own payload.
40
+ * @param layerId The style layer the listener is scoped to.
41
+ * @returns An unsubscribe that detaches this listener and no other.
42
+ */
43
+ on<T extends keyof MapLayerEventType>(eventType: T, handler: (event: MapLayerEventType[T]) => void, layerId: string): () => void;
44
+ /**
45
+ * once attaches a listener for the next firing of one of MapLibre's map events.
46
+ *
47
+ * @param eventType The MapLibre event.
48
+ * @param handler Called once, with the event's own payload.
49
+ * @returns An unsubscribe that detaches the listener before it fires, and does nothing after.
50
+ */
51
+ once<T extends keyof MapEventType>(eventType: T, handler: (event: MapEventType[T]) => void): () => void;
52
+ /**
53
+ * afterStyleLoad runs `fn` once the style can take a source or a layer: at once on a settled
54
+ * style, and after the style a base-map switch brings in while one is on its way.
55
+ */
56
+ afterStyleLoad(fn: () => void): void;
57
+ /**
58
+ * whenSettled resolves once the map has finished drawing what it was asked to draw, with no
59
+ * resize of the canvas on its way, as the next animation frame reads it. It never rejects, and
60
+ * it resolves as the map is destroyed. Padding of the container that changed alone, after the
61
+ * map first sized its canvas and before the first wait, holds every wait until the canvas is
62
+ * next resized (see {@link MapEventEngine.whenSettled}).
63
+ */
64
+ whenSettled(): Promise<void>;
65
+ /** isStyleReloading reports whether a base-map switch is on its way. */
66
+ isStyleReloading(): boolean;
67
+ }
68
+ /**
69
+ * MapEventEngine is the single owner of every listener attached to a map.
70
+ *
71
+ * It exists because **`setStyle()` replaces the style but leaves the listeners**: sources,
72
+ * layers, sprites and terrain all go, and a handler registered with `map.on()` keeps firing
73
+ * across a base-map switch. So this never detaches on a restyle; it holds each listener
74
+ * until `dispose()` and then calls `map.off()` for every one, deterministically, rather
75
+ * than leaving teardown to `map.remove()`.
76
+ *
77
+ * Three lifecycles:
78
+ *
79
+ * - **persistent** (`map.on`): map-level events (`move`, `contextmenu`, `styledata`) and
80
+ * layer-scoped ones. They live until `dispose()`.
81
+ * - **once** ({@link once}): a single firing (`load`, `style.load`). The listener is tracked
82
+ * like a persistent one until it fires, and detaches itself as it does.
83
+ * - **the missing-image resolver** (`map.setMissingStyleImageResolver`): not an event at
84
+ * all, but map-level state with a persistent listener's lifetime, so it is installed and
85
+ * cleared here rather than by the renderer that supplies the sprites. See
86
+ * {@link setMissingImageResolver}.
87
+ *
88
+ * Every persistent listener is tracked under a unique key so the same *reference* goes back
89
+ * to `map.off()`. An anonymous handler cannot be removed and would leak, which is the
90
+ * failure this class exists to make impossible rather than merely discouraged.
91
+ *
92
+ * It also owns the STYLE RELOAD, for the same reason: a `setStyle()` is the one moment when
93
+ * "is the map ready" has an answer no listener can read off the map itself, and work
94
+ * deferred against the wrong answer either lands on a style about to be wiped or waits for
95
+ * one that failed to arrive. See {@link beginStyleReload}.
96
+ *
97
+ * A consumer reaches it as {@link MapEvents}, through `MountayaMap.events`.
98
+ */
99
+ declare class MapEventEngine implements MapEvents {
100
+ private readonly map;
101
+ private readonly persistent;
102
+ private keySeq;
103
+ private styleReloading;
104
+ private reloadSeq;
105
+ private styleDocumentReady;
106
+ private styleHasLoaded;
107
+ private readonly deferredToStyleLoad;
108
+ private reloadListeners;
109
+ private disposed_;
110
+ private readonly disposeHooks;
111
+ private sizedFor;
112
+ private followsRendererSize;
113
+ /**
114
+ * Builds the engine over one renderer. It attaches nothing until a member asks it to.
115
+ *
116
+ * @param map The renderer whose listeners, missing-image resolver and reloads this owns.
117
+ */
118
+ constructor(map: Map);
119
+ /**
120
+ * on attaches a persistent listener and tracks it so `dispose()` can detach it by
121
+ * reference. The event name is one of MapLibre's, and the handler is typed by the payload
122
+ * MapLibre fires it with. A disposed engine attaches nothing.
123
+ *
124
+ * @param eventType The MapLibre event, such as `"moveend"`, or a layer event such as
125
+ * `"mouseenter"` where `layerId` is given.
126
+ * @param handler Called with the event's own payload.
127
+ * @param layerId The style layer the listener is scoped to; omitted, the listener is
128
+ * map-level.
129
+ * @returns An unsubscribe that detaches this exact listener, so a caller can remove its own
130
+ * without waiting for `dispose()`.
131
+ */
132
+ on<T extends keyof MapEventType>(eventType: T, handler: (event: MapEventType[T]) => void): () => void;
133
+ on<T extends keyof MapLayerEventType>(eventType: T, handler: (event: MapLayerEventType[T]) => void, layerId: string): () => void;
134
+ /**
135
+ * once attaches a listener that runs for the next firing of an event and detaches itself as
136
+ * it does.
137
+ *
138
+ * Tracked as {@link on}'s listeners are, until it fires: an event that never comes would
139
+ * otherwise leave it on the map past `dispose()`, which detaches it by reference with the
140
+ * rest. A disposed engine attaches nothing.
141
+ *
142
+ * @param eventType The MapLibre event to listen for.
143
+ * @param handler Called once, with the event's own arguments.
144
+ * @returns An unsubscribe that detaches the listener before it fires, and does nothing after.
145
+ */
146
+ once<T extends keyof MapEventType>(eventType: T, handler: (event: MapEventType[T]) => void): () => void;
147
+ /**
148
+ * setMissingImageResolver installs the one callback MapLibre asks for an image the style
149
+ * references and the sprite sheet does not hold, and clears it on `dispose()`.
150
+ *
151
+ * It belongs here because it has a persistent listener's LIFETIME and none of its
152
+ * mechanics. MapLibre 6 reports `styleimagemissing` for notice only and takes the image from
153
+ * `Map#setMissingStyleImageResolver`, a SETTER holding one resolver rather than an event
154
+ * holding a list: there is no reference to hand back to `map.off()`, so teardown clears it
155
+ * instead of detaching it.
156
+ *
157
+ * Like a persistent listener it outlives a base-map switch: the resolver is held on the
158
+ * map, not on the style `setStyle()` replaces. And like one, exactly one owner installs it:
159
+ * a second caller REPLACES the first rather than stacking beside it, which is the
160
+ * difference from `on` that makes routing it through this class worth doing.
161
+ *
162
+ * @param resolver Called with the id of the image the style asks for; it answers by adding
163
+ * that image to the map.
164
+ */
165
+ setMissingImageResolver(resolver: (id: string) => void | Promise<void>): void;
166
+ /**
167
+ * afterStyleLoad runs `fn` once the style is ready, distinguishing three states.
168
+ *
169
+ * The third is the one that is easy to miss and expensive to get wrong:
170
+ *
171
+ * - Loaded, no reload in flight: run immediately.
172
+ * - A `setStyle()` in flight: hold until the incoming style is ready. `isStyleLoaded()`
173
+ * still reports the OLD style as loaded here, so running now would add sources and
174
+ * layers to the style being replaced, which the incoming one then wipes. A swap that
175
+ * fails releases the hold too, rather than parking it forever (see
176
+ * {@link beginStyleReload}).
177
+ * - **The document has not parsed yet**: the genuine wait, and the only one left.
178
+ *
179
+ * **What this asks is whether the style can ACCEPT a source or a layer, not whether the map
180
+ * has finished drawing.** Under MapLibre 6 the two differ, and the distinction is the whole
181
+ * correctness of this method. `map.isStyleLoaded()` is four conditions in one (the document
182
+ * parsed, no pending source updates, every tile manager settled, and the sprite atlas
183
+ * complete), and `addSource` requires only the first.
184
+ *
185
+ * The strong form fails in a way only a real browser shows. Waiting on `idle` OR a `styledata`
186
+ * that finds `isStyleLoaded()` true both fail against a map holding a source whose tiles
187
+ * cannot load: `idle` never arrives at all, and the `styledata` storm ENDS while the style
188
+ * still reports unloaded, with the transition to loaded arriving afterwards announced by
189
+ * nothing. An edge-triggered release cannot observe a level that changes between edges.
190
+ *
191
+ * The stake: `MountayaMap.mount` awaits this and `OverlayRenderer` chains every slot write
192
+ * onto one promise, so ONE such wait would stall every subsequent mount and removal for the
193
+ * life of the map. An overlay, an enrichment or a zone layer added afterwards would silently
194
+ * never appear, with nothing raised anywhere: from
195
+ * `addTileSources([itinerarySource, overlaySource])`, the second source's mount would enter
196
+ * this wait and never leave it. And tiles do fail in production, most quietly when a tile
197
+ * credential is scoped to a different origin and every request 401s.
198
+ *
199
+ * So the condition is tracked as a LEVEL ({@link styleDocumentReady}) rather than sampled at
200
+ * an edge, and the level is the weak, correct one. The race below is only ever reached
201
+ * before the first `style.load` of a map's life, and keeps `idle` and `styledata` beside it
202
+ * so a document that parsed without the one-shot being observed still releases.
203
+ *
204
+ * A disposed engine drops `fn`.
205
+ *
206
+ * @param fn The work to run on a style that takes a source or a layer.
207
+ */
208
+ afterStyleLoad(fn: () => void): void;
209
+ /**
210
+ * whenSettled resolves once the map has finished drawing what it has been asked to draw: any
211
+ * style reload complete, the style itself reporting loaded, and no resize of the canvas on its
212
+ * way.
213
+ *
214
+ * The last is read again in the next animation frame, the frame the reader is shown. MapLibre
215
+ * resizes the canvas from its observer of the container, holds a resize back by a moment after an
216
+ * earlier one, and draws at once when it resizes, between two frames. A page that resizes the
217
+ * container at every frame (an animation, or a parent resizing the iframe the map is in) lays out
218
+ * the next size before that drawing is shown. So a drawing settles the wait only once the next
219
+ * frame still finds no resize on its way, and otherwise the wait goes on to the drawing after it:
220
+ * a caller that frames the view for the canvas it reads settles on the canvas the reader is
221
+ * shown, never on one a resize under way passed through. The read costs every wait over a shown
222
+ * container one frame, a map that has drawn everything included.
223
+ *
224
+ * The frame reads the size alone: a load begun after the drawing is work asked for after the wait
225
+ * was answered. A size the page sets later in that frame (from a `ResizeObserver` callback, or a
226
+ * render committed there) is read by no frame before the wait settles.
227
+ *
228
+ * A resize is on its way while the renderer follows its container (MapLibre's `trackResize`,
229
+ * on by default), the canvas does not hold the container's size, and the container's content
230
+ * box, the box the renderer observes, is not the one it last resized for. A canvas left at
231
+ * another size with no resize to come (`trackResize: false`, or padding that changed alone) is
232
+ * the size the reader is shown, and holds no wait. A container with no extent, or a page that
233
+ * is hidden and runs no frame, has no frame to read, and its wait settles on the drawing.
234
+ *
235
+ * The engine dates the renderer's resizes from the first wait on, since it attaches nothing
236
+ * until a member asks. A first wait that finds the canvas at another size than its container
237
+ * cannot tell a resize on its way from padding that changed alone, and takes it to be a resize:
238
+ * padding changed alone after the renderer's first resize and before the first wait holds every
239
+ * wait until the renderer next resizes the canvas, which any change of the container's content
240
+ * box brings. Dating the resizes from construction would close it, at the cost of a listener on
241
+ * every map whether or not anything ever waits on it.
242
+ *
243
+ * It lives here rather than beside a caller because the reload flag is the only honest
244
+ * answer to "is the map ready", and it is this class that holds it.
245
+ *
246
+ * Two hazards, both of which park a naive implementation forever:
247
+ *
248
+ * - **Check-then-register is not atomic.** The deferred queue drains synchronously inside
249
+ * the `style.load` handler, and `map.loaded()` is still false at that instant. So a wait
250
+ * that registered for `idle` there would be listening for an event the map may have
251
+ * already emitted, or may never emit, if the new style has nothing left to fetch. The
252
+ * microtask re-read closes it: by then MapLibre has finished the frame, and `loaded()`
253
+ * answers for the style that actually arrived. The `data` listener is the same re-read on
254
+ * a slower path, for a style that settles only after a source responds.
255
+ * - **Disposal.** A wait held behind a reload when the map is torn down would otherwise
256
+ * never settle in either direction. It resolves instead, as the engine is disposed or as the
257
+ * renderer is removed, whichever comes first: the caller asked whether the map
258
+ * had finished drawing, and a map that no longer exists is not going to draw anything
259
+ * else. Rejecting would turn every un-awaited `void map.events.whenSettled().then(…)` into
260
+ * an unhandled rejection at teardown, which is a worse answer to the same question.
261
+ *
262
+ * @returns A promise that never rejects.
263
+ */
264
+ whenSettled(): Promise<void>;
265
+ /**
266
+ * followRendererSize starts keeping the content box the renderer last resized the canvas for,
267
+ * once per engine: read now when the canvas holds the container's size, and at every `resize`
268
+ * the renderer fires after it has resized the canvas.
269
+ */
270
+ private followRendererSize;
271
+ /**
272
+ * resizeOnItsWay reports whether the renderer has a resize of the canvas still to make: it
273
+ * follows its container, the canvas does not hold the container's size, and the container's
274
+ * content box is not the one the renderer last resized for.
275
+ *
276
+ * `_trackResize` is MapLibre's own record of its `trackResize` option, which it publishes no
277
+ * accessor for (`rendererPremises.test.ts` holds the field).
278
+ */
279
+ private resizeOnItsWay;
280
+ /**
281
+ * isStyleReloading reports whether a `setStyle()` is in flight.
282
+ *
283
+ * It distinguishes a base-map switch (where work must defer to the new style) from a
284
+ * plain source load, which also drops `isStyleLoaded()` to false but needs no style-load
285
+ * deferral. A readiness wait reads it so it defers only across a real reload, rather than
286
+ * parking on a `style.load` that a source load never re-fires.
287
+ */
288
+ isStyleReloading(): boolean;
289
+ /**
290
+ * beginStyleReload marks that a `setStyle()` is in flight so `afterStyleLoad` holds work
291
+ * for the NEW style. Call it immediately before `map.setStyle()`.
292
+ *
293
+ * Two signals end the reload, and the second one is the reason this is not four lines:
294
+ *
295
+ * - The incoming style's `style.load`: the ordinary path.
296
+ * - An `error` during this reload followed by the next `idle`: the failure path. A swap MapLibre
297
+ * cannot complete (an unreachable style document) fires no `style.load` at all, so without this
298
+ * the flag stays raised and every later readiness wait parks forever. The style on the map when
299
+ * that happens is the one that was already there, and it is loaded, so releasing the held work
300
+ * against it is safe: each layer re-resolves its own rank anchor on the way back in.
301
+ *
302
+ * Neither half of the failure pair releases on its own. `idle` fires whenever the map
303
+ * settles, including well before a slow style arrives; `error` fires for an unrelated 404
304
+ * on a tile while a perfectly good swap is in flight. Only an error belonging to THIS
305
+ * reload arms the idle that follows it, and the sequence number is what keeps a late
306
+ * signal from a reload that is already over out of the one that replaced it.
307
+ *
308
+ * Each error also asks the renderer for a frame. MapLibre reports `idle` from the end of a
309
+ * frame alone, and draws none of its own after a document it could not fetch or a tile the
310
+ * server failed on, so the idle that follows such an error would otherwise wait for whatever
311
+ * next asks for a frame: the reader moving the map. A fake of the renderer that answers no
312
+ * `triggerRepaint` is asked for none.
313
+ *
314
+ * Over a renderer that holds no loaded style (none has loaded yet, or the one that had is
315
+ * gone, {@link noteStyleDropped}), an error of the reload ends it at once. There is no style to
316
+ * protect, and MapLibre draws no frame over a style that never loaded, so the idle would never
317
+ * come. A sprite or a glyph that fails for the incoming style is reported after its
318
+ * `style.load`, which has already ended the reload.
319
+ *
320
+ * @param options `endsOnFailure: false` announces a reload that only its own `style.load` or
321
+ * {@link cancelStyleReload} ends: one held open for a style that is not on its way yet, such
322
+ * as a base-map switch that waits for a lost WebGL context to return, where an error and an
323
+ * idle say nothing of the style awaited. Defaults to `true`.
324
+ */
325
+ beginStyleReload(options?: {
326
+ readonly endsOnFailure?: boolean | undefined;
327
+ }): void;
328
+ /**
329
+ * noteStyleDropped records that the renderer holds no loaded style any more, so the next reload
330
+ * ends on its first error ({@link beginStyleReload}) until a style loads again.
331
+ *
332
+ * MapLibre says nothing as a style goes without a load to follow, as one dropped with a lost
333
+ * WebGL context and not set again as the context returns does, so the switch that sees it go
334
+ * says so here.
335
+ */
336
+ noteStyleDropped(): void;
337
+ /**
338
+ * cancelStyleReload ends a reload that never started, so nothing waits on a style that is
339
+ * not coming.
340
+ *
341
+ * The synchronous half of the failure path above: `map.setStyle()` can throw before it
342
+ * fires anything at all (a style document it rejects outright), and the reload was
343
+ * announced a statement earlier. The map is left showing the style it already had, so the
344
+ * held work runs against that, exactly as the error-then-idle path does.
345
+ */
346
+ cancelStyleReload(): void;
347
+ /**
348
+ * dispose detaches every persistent listener by calling `map.off()` with the original
349
+ * reference, then forgets them.
350
+ *
351
+ * This is the only point listeners come off. A base-map switch leaves them attached, so
352
+ * teardown is deterministic here rather than left to `map.remove()`. A `once()` listener
353
+ * still waiting for its event is detached with the rest.
354
+ *
355
+ * Every call after it is inert: {@link on} and {@link once} attach nothing and hand back an
356
+ * unsubscribe that does nothing, {@link afterStyleLoad} drops the work it is handed,
357
+ * {@link setMissingImageResolver} installs nothing and a reload is neither announced nor
358
+ * cancelled. {@link whenSettled} resolves at once.
359
+ */
360
+ dispose(): void;
361
+ /** The number of listeners currently held. For diagnostics and for leak tests. */
362
+ get size(): number;
363
+ /**
364
+ * Whether the map this engine belongs to has been torn down.
365
+ *
366
+ * Read by work that resumes after an await: {@link whenSettled} settles on dispose rather
367
+ * than stranding its caller, so a continuation that goes on to WRITE to the map has to ask
368
+ * whether there is still one to write to. Every member of the engine reads this, so an engine
369
+ * that answers it otherwise (a scope over a map another owner disposes) is inert from the
370
+ * moment it answers true.
371
+ */
372
+ get disposed(): boolean;
373
+ /**
374
+ * endStyleReload lowers the flag for one reload and runs what was held behind it.
375
+ *
376
+ * Idempotent, and current-reload only. Both matter: an incidental error arms an idle that
377
+ * may land after the reload has already ended normally, and a reload that failed can see
378
+ * its idle arrive after a newer `setStyle` has begun, where releasing would hand the
379
+ * queued work to the style being torn down.
380
+ *
381
+ * The flag drops BEFORE the queue drains, so work that re-enters `afterStyleLoad` runs
382
+ * rather than deferring a second time.
383
+ */
384
+ private endStyleReload;
385
+ /** watchReload attaches a listener that lives only as long as the reload that armed it. */
386
+ private watchReload;
387
+ /** dropReloadListeners detaches everything the reload sequence attached. */
388
+ private dropReloadListeners;
389
+ /** detach calls map.off() for one tracked listener, matching the form it was attached with. */
390
+ private detach;
391
+ }
392
+
393
+ /**
394
+ * The geometry slots a map draws from data: a preview of an itinerary being planned, a
395
+ * highlight of what a search picked, and an emphasis of the leg a reader points at.
396
+ *
397
+ * Each holds one geometry in a colour, apart from the others, so writing one never clears
398
+ * another: a hover lighting a leg leaves the search result lit. What each slot holds is a reducer
399
+ * over the writes a caller makes ({@link geometrySlotsAfter}), and what it draws is a descriptor of
400
+ * its own ({@link geometrySlotLayers}), so a map and a second language read the same rules.
401
+ */
402
+
403
+ /**
404
+ * GeometrySlot names one of the geometry slots a map draws from data: `"preview"`, the itinerary
405
+ * being planned; `"highlight"`, the feature a reader chose; `"emphasis"`, the leg a reader points
406
+ * at. Each holds one geometry in a colour of its own, apart from the other two.
407
+ */
408
+ type GeometrySlot = "emphasis" | "highlight" | "preview";
409
+
410
+ /**
411
+ * How a patch is read before it is merged onto what a map holds.
412
+ *
413
+ * An `edit` takes a partial and keeps whatever the partial does not name. A member written as
414
+ * `undefined` names nothing: it is what a caller forwards when it may not have a value
415
+ * (`{ color: props.color }`), and a spread of the patch as written would put that `undefined`
416
+ * over the member held, pinning a marker nowhere or sending a query without its range. So a
417
+ * patch is read through {@link statedMembers} first, and a member is cleared by the value its
418
+ * own type gives for that.
419
+ *
420
+ * An edit of a layer is read the same way, its paint and its layout each member by member
421
+ * ({@link statedLayerPatch}), and a property it clears takes `null`, which MapLibre reads as its
422
+ * default.
423
+ */
424
+
425
+ /**
426
+ * LayerPatch is an edit of one layer: the paint properties and the layout properties it changes,
427
+ * by the names and the values MapLibre gives them.
428
+ *
429
+ * A property stated as `undefined` names nothing, and the layer keeps the value it holds. One
430
+ * stated as `null` goes back to MapLibre's default for it. `false`, `0` and the empty string are
431
+ * values like any other. A layer is shown or hidden with `MountayaMap.setLayerVisibility`, which
432
+ * the map keeps across a base-map switch, so the layout's `visibility` is no member of an edit.
433
+ */
434
+ interface LayerPatch {
435
+ /** The layout properties the edit changes, `visibility` apart. */
436
+ readonly layout?: {
437
+ readonly [K in Exclude<keyof AllLayoutProperties, "visibility">]?: AllLayoutProperties[K] | null | undefined;
438
+ } | undefined;
439
+ /** The paint properties the edit changes. */
440
+ readonly paint?: {
441
+ readonly [K in keyof AllPaintProperties]?: AllPaintProperties[K] | null | undefined;
442
+ } | undefined;
443
+ }
444
+
445
+ /**
446
+ * The variant of a catalogue terrain a map draws, and the rule it is read by.
447
+ *
448
+ * Every terrain of the layers manifest lists a light and a dark rendition. Which one a map draws
449
+ * is the host's choice, stated apart from the colour scheme of the page around the map: a page in
450
+ * a dark theme may well show the light topographic map, and the other way round.
451
+ */
452
+
453
+ /** TerrainVariant names a terrain's rendition, as the layers manifest keys its `variants`. */
454
+ type TerrainVariant = keyof RestSchema.Terrain["variants"];
455
+
456
+ /**
457
+ * Authenticating the requests MapLibre makes for itself.
458
+ *
459
+ * This package never calls `fetch`. MapLibre fetches tiles, sprites and glyphs on its own
460
+ * schedule, and a credential belongs in a **header** (`X-API-Key`, `X-Session-Token`,
461
+ * `X-Share-Token`): the Tile API reads one from the query too, for a request that cannot set a
462
+ * header, and a key written into a URL template lands in every log, cache and `Referer` that URL
463
+ * reaches. A header cannot be baked into a URL template, so the place a credential is attached
464
+ * is MapLibre's `transformRequest` hook.
465
+ *
466
+ * That makes this function a published contract rather than an integration detail: without
467
+ * it there is no supported way to authenticate a Mountaya tile request, and every consumer
468
+ * would otherwise reinvent it, most of them by leaking the key somewhere.
469
+ */
470
+ /**
471
+ * TransformedRequest is the part of MapLibre's `RequestParameters` a transform answers.
472
+ *
473
+ * Kept structural so the package does not force a `maplibre-gl` import into a consumer that
474
+ * only wants the type.
475
+ */
476
+ interface TransformedRequest {
477
+ readonly url: string;
478
+ readonly headers?: Record<string, string> | undefined;
479
+ /**
480
+ * Whether the page's cookies ride the request.
481
+ *
482
+ * The member is typed as MapLibre types it, so a transform is handed to MapLibre as it is. A
483
+ * request {@link createTransformRequest} claims without the cookie flag carries `"omit"`, the
484
+ * third value `fetch` takes: MapLibre hands the member to `fetch` as written and names only
485
+ * the two values that send cookies somewhere.
486
+ */
487
+ readonly credentials?: "same-origin" | "include" | undefined;
488
+ }
489
+ /**
490
+ * RequestTransform is MapLibre's `transformRequest` hook, as {@link createTransformRequest}
491
+ * answers it and as a host's own transform is chained behind it through `next`.
492
+ *
493
+ * @param url The URL MapLibre is about to fetch.
494
+ * @param resourceType What MapLibre fetches it as: `Tile`, `Style`, `Glyphs`, `SpriteImage`
495
+ * and the rest of its own vocabulary.
496
+ * @returns The request to make: the URL, and the headers and cookie policy to make it with.
497
+ */
498
+ type RequestTransform = (url: string, resourceType?: string) => TransformedRequest;
499
+ /**
500
+ * Credentials a browser may legitimately hold.
501
+ *
502
+ * A secret key is absent by construction. It mints session tokens server-side and can
503
+ * never reach a map, so there is no field here to put one in: the mistake is unavailable
504
+ * rather than merely discouraged, and a secret key pasted into the publishable key's place is
505
+ * refused where the credential is handed over, with every other key or token that cannot be
506
+ * sent (see {@link createTransformRequest}).
507
+ */
508
+ interface MapCredential {
509
+ readonly publishableKey?: string | undefined;
510
+ /**
511
+ * Accompanies the publishable key; it does not replace it.
512
+ *
513
+ * A string, or a function called on every request the transform claims, never while it is
514
+ * built and never for a request bound elsewhere. A function is how one map follows a session
515
+ * token that rotates: each new tile, sprite and glyph request carries the token current at
516
+ * that request, and one already sent completes with the token it carried. While it answers
517
+ * `undefined`, the key goes out alone. A function that throws, or that answers neither a string
518
+ * nor `undefined`, is refused from the request it was read for, as
519
+ * {@link createTransformRequest} states.
520
+ */
521
+ readonly sessionToken?: string | (() => string | undefined) | undefined;
522
+ /** Replaces the key entirely, for a share-link visitor. Read-only by nature. */
523
+ readonly shareToken?: string | undefined;
524
+ /**
525
+ * Sends the browser's own session cookie with the request.
526
+ *
527
+ * For an application whose users are already signed in to Mountaya, or that fronts the
528
+ * API behind its own sign-in. The cookie is httpOnly, so there is no header a browser
529
+ * could build instead, which is the same reason `@mountaya/client` carries a CookieCredential.
530
+ *
531
+ * It combines with `shareToken`, and that pairing is load-bearing rather than merely
532
+ * allowed: the token authorizes the shared resource, while the cookie lets the API
533
+ * resolve the SIGNED-IN VIEWER's own access, so a viewer whose organization's agreement
534
+ * includes an analysis is served it on a shared itinerary. The token stays the sole
535
+ * authorization; the session never outranks it.
536
+ *
537
+ * Without it the page's cookies stay off every request the transform claims, one bound for the
538
+ * page's own origin included: the request carries `credentials: "omit"`, so a publishable key
539
+ * or a share token is never joined by a session the page happens to hold there. A transform
540
+ * chained through `next` does not change that: on a claimed request this flag alone decides.
541
+ *
542
+ * @default false
543
+ */
544
+ readonly cookie?: boolean | undefined;
545
+ }
546
+ /**
547
+ * TransformRequestOptions is what {@link createTransformRequest} takes: the credential, the
548
+ * origins it is sent to, the credential scoped to one resource's paths, and the transform a
549
+ * request the credential does not claim is handed on to.
550
+ */
551
+ interface TransformRequestOptions extends MapCredential {
552
+ /**
553
+ * Origins that count as Mountaya and so receive the credential.
554
+ *
555
+ * An entry is read as a `baseUrls` entry is, parsed and never compared as written: a trailing
556
+ * slash, the host's case and a default port are nothing, and an entry that carries a path
557
+ * claims that path and what lies under it.
558
+ *
559
+ * @default The public tile host, `https://tiles.mountaya.com`, unless `baseUrls` is given.
560
+ */
561
+ readonly origins?: readonly string[] | undefined;
562
+ /**
563
+ * Base URLs that count as Mountaya: an origin, with the path the Tile API is mounted under.
564
+ *
565
+ * An entry claims a request whose origin is the entry's and whose path is the entry's or lies
566
+ * under it at a segment boundary. `https://example.com/tiles` claims
567
+ * `https://example.com/tiles/v1/zones`, and neither `https://example.com/tiles-private` nor
568
+ * `https://example.com.evil.net/tiles`. Both sides are parsed first, so a trailing slash, the
569
+ * host's case, a default port and dot segments are nothing, and only an `http` or `https`
570
+ * request is ever claimed.
571
+ *
572
+ * An entry is an `http` or `https` URL with no username or password, a path starting with one
573
+ * `/` on the page's own origin, or `""` for that origin whole. Its query and fragment are not
574
+ * read.
575
+ *
576
+ * The page's own origin is the origin of the page's address, `location`, which a `<base>`
577
+ * element does not move. A document whose address names no origin, at `about:blank` or under
578
+ * `file:`, has none of its own, so a path or `""` claims nothing there. A relative request is
579
+ * read as the browser resolves it, against the document's base URL where a document exists
580
+ * and against `location` otherwise, so one a `<base>` element sends to another host is bound
581
+ * for that host and no path or `""` claims it. A relative request the transform claims leaves
582
+ * as the absolute URL it resolved to: the credential reaches the address its claim was read
583
+ * against, whoever fetches the request.
584
+ *
585
+ * Where there is no page at all, as in Node, nothing resolves a relative URL: a path or `""`
586
+ * claims relative requests alone, and one it claims leaves as written.
587
+ *
588
+ * An origin cannot express a tile API mounted under a path, which is what a reverse proxy in
589
+ * front of the API produces. Supplying this narrows the match: `origins` stops
590
+ * defaulting, so a credential scoped to `https://example.com/tiles` is sent neither to
591
+ * `https://example.com/anything-else` nor to the public tile host.
592
+ */
593
+ readonly baseUrls?: readonly string[] | undefined;
594
+ /**
595
+ * A BCP 47 tag sent as `Accept-Language`.
596
+ *
597
+ * Tile labels and legends are localized server-side, so a map that does not state a
598
+ * language is labelled in whatever the browser happens to prefer, which is rarely the
599
+ * language the rest of the application is rendering in.
600
+ */
601
+ readonly language?: string | undefined;
602
+ /**
603
+ * A second credential for one path prefix, where the default credential covers the rest.
604
+ *
605
+ * One map then paints a resource under a credential of its own beside layers the default
606
+ * credential reads. A share view needs no split: a share token reaches the overlays, the
607
+ * terrains and the layers manifest as well as the shared resource, so a share view states the
608
+ * token as its default credential and every tile it draws is sent under it.
609
+ *
610
+ * `pathPrefix` is matched against whichever origin or base URL claimed the request, so
611
+ * it stays a path and does not have to repeat the host. It takes a request whose path under
612
+ * that claim is the prefix or lies under it at a segment boundary: `/v1/itineraries/abc`
613
+ * takes `/v1/itineraries/abc/12/2093/1425` and not `/v1/itineraries/abcdef`. A trailing slash
614
+ * is nothing.
615
+ */
616
+ readonly scoped?: {
617
+ readonly pathPrefix: string;
618
+ readonly credential: MapCredential;
619
+ } | undefined;
620
+ /**
621
+ * A transform of the application's own, called first: this one reads its claim from the
622
+ * request that transform answers.
623
+ *
624
+ * The URL it answers is the one a claim is read from, and a header it sets stands over the
625
+ * same header set here. Its `credentials` stands on a request the transform does not claim. On
626
+ * a claimed request the credential decides whether the page's cookies ride, and what this
627
+ * stated is replaced: `"include"` under `cookie`, and `"omit"` otherwise.
628
+ */
629
+ readonly next?: RequestTransform | undefined;
630
+ }
631
+ /**
632
+ * createTransformRequest builds the function to hand MapLibre.
633
+ *
634
+ * ```ts
635
+ * const map = new maplibregl.Map({
636
+ * container,
637
+ * transformRequest: createTransformRequest({ publishableKey: "pk_…" }),
638
+ * });
639
+ * ```
640
+ *
641
+ * **The credential goes only to Mountaya origins.** That check is the whole security
642
+ * posture of this function, not a nicety. `transformRequest` is called for *every* request
643
+ * MapLibre makes (basemap tiles, fonts and sprites from third parties included), so a
644
+ * transform that attached the header unconditionally would hand a publishable key to every
645
+ * other host in the style. Keys are scoped and rate-limited rather than secret, but they
646
+ * are still yours, and a leaked one is counted against your organization's agreement.
647
+ *
648
+ * **A session token held as a function is read per request.** The transform calls it for each
649
+ * request it claims, for the default credential and the scoped one alike, so one transform
650
+ * follows a token that rotates for the map's whole life:
651
+ *
652
+ * ```ts
653
+ * createTransformRequest({ publishableKey: "pk_…", sessionToken: () => session.token });
654
+ * ```
655
+ *
656
+ * **The page's cookies ride only under the cookie flag.** Every request the transform claims
657
+ * states its `credentials`: `"include"` under `cookie`, and `"omit"` otherwise, so a key or a
658
+ * share token sent to the page's own origin is never joined by the page's session. What a
659
+ * transform chained through `next` stated stands on the requests this one does not claim.
660
+ *
661
+ * **A relative request leaves for the address its claim was read against.** It is resolved as
662
+ * the browser resolves it, and one the transform claims is handed on as that absolute URL.
663
+ *
664
+ * **Every claimed request names the SDK**, as `X-Mountaya-Client: mountaya-typescript/<version>`
665
+ * beside the credential, and under no credential as well; a request the transform does not
666
+ * claim carries nothing of it. That header is also what keeps a raster tile on `fetch`. MapLibre
667
+ * loads one through an image element when the map is built with `refreshExpiredTiles: false` and
668
+ * the request states no header beyond `accept`, and an image element sends the page's cookies to
669
+ * the page's own origin whatever `credentials` says.
670
+ *
671
+ * **A credential that cannot be sent is refused before any request.** A key or a token that is
672
+ * empty or whitespace alone, holds a character no request header carries, or does not start with
673
+ * its prefix (`pk_`, `sess_`, `share_`) is refused as the client refuses it, and a secret key in
674
+ * the publishable key's place above all: it would ride every tile request the page makes. A
675
+ * session token a function answers is held to the same checks at each request it is read for.
676
+ *
677
+ * @throws `MountayaElementsError` from the call itself, for an entry of `origins` or `baseUrls`
678
+ * or a `scoped.pathPrefix` that names no place, a key, a token or a `language` that cannot be
679
+ * sent, the default credential's or the scoped one's, each named and never quoted; and from
680
+ * the request a session token's function was read for, where that function throws (what it
681
+ * threw is the error's `cause`), answers neither a string nor `undefined`, or answers a token
682
+ * that cannot be sent.
683
+ */
684
+ declare const createTransformRequest: (options?: TransformRequestOptions) => RequestTransform;
685
+
686
+ /**
687
+ * The options a `MountayaMap` is constructed with, and the renderer types they name.
688
+ *
689
+ * They sit apart from `types.ts` because these are the declarations that name `maplibre-gl`: a
690
+ * camera boundary may be MapLibre's own bounds shape, a complete style is MapLibre's style
691
+ * document, and the raw map is the MapLibre instance itself. `types.ts` holds the vocabulary the
692
+ * renderer-free entries share, `./search` among them, and a consumer of one of those entries
693
+ * type-checks without the renderer installed only while that module names none of it.
694
+ */
695
+
696
+ /** Constraints on where and how far the camera may move. */
697
+ interface CameraConstraints {
698
+ /**
699
+ * The zoom window: the lowest and the highest zoom the camera reaches. A limit left out keeps
700
+ * the one the map holds, and a limit of `null` releases it: the floor goes back to -2 and the
701
+ * ceiling to 22, the window a map is built with when it is given none.
702
+ *
703
+ * Each limit is a finite number, the floor from -2 up, which is MapLibre's own. The floor lies
704
+ * at or under the ceiling: the one stated beside it, or the one the map holds when a call
705
+ * states the floor alone. A window that breaks either rule is refused with
706
+ * `MountayaElementsError`, naming the limit.
707
+ */
708
+ readonly zoom?: {
709
+ readonly min?: number | null | undefined;
710
+ readonly max?: number | null | undefined;
711
+ } | undefined;
712
+ /**
713
+ * The box the camera may not pan out of, or `null` to lift the lock. Left out, the lock the
714
+ * map holds stays.
715
+ */
716
+ readonly maxBounds?: BoundingBox | LngLatBoundsLike | null | undefined;
717
+ }
718
+ /**
719
+ * MapLibreOptions is what the `maplibre` option takes: MapLibre's own `MapOptions`, less the keys
720
+ * a `MountayaMap` states for itself.
721
+ *
722
+ * `container` and `style` are options of {@link MountayaMapOptions} already, and
723
+ * `transformRequest` is one too, because it decides which credential every tile, sprite and
724
+ * glyph request carries. The camera's opening pose (`center`, `zoom`, `bearing`, `pitch`) and
725
+ * its pan lock (`maxBounds`) are options of the map too, read and refused by name before the
726
+ * renderer is built: stated here they would skip that read. Left in this type, a key written
727
+ * here would read as a second way to say each. `minZoom` and `maxZoom` stay, since the map's
728
+ * `constraints.zoom` is read against them.
729
+ *
730
+ * @example
731
+ * ```ts
732
+ * import type { Mountaya } from "@mountaya/client";
733
+ * import { MountayaMap } from "@mountaya/elements";
734
+ *
735
+ * declare const client: Mountaya;
736
+ *
737
+ * const map = new MountayaMap({
738
+ * client,
739
+ * container: "map",
740
+ * maplibre: { canvasContextAttributes: { preserveDrawingBuffer: true }, maxPitch: 70 },
741
+ * });
742
+ * ```
743
+ */
744
+ type MapLibreOptions = Omit<MapOptions, "bearing" | "center" | "container" | "maxBounds" | "pitch" | "style" | "transformRequest" | "zoom">;
745
+ /**
746
+ * MountayaMapOptions is everything `new MountayaMap(...)` takes.
747
+ *
748
+ * A container and a client are the whole ask. Every other option is an absence with a behaviour,
749
+ * stated on the option, so a map constructed with two lines draws.
750
+ */
751
+ interface MountayaMapOptions {
752
+ /**
753
+ * The element to render into, or its id.
754
+ *
755
+ * It needs a size of its own in CSS: MapLibre sizes the canvas to it, and a container with no
756
+ * height draws nothing and throws nothing. In development the map says so on the console once
757
+ * it has loaded.
758
+ */
759
+ readonly container: string | HTMLElement;
760
+ /**
761
+ * The client this map fetches its specifications through.
762
+ *
763
+ * The map itself never calls `fetch`: it holds the client and lets it do that, which is what
764
+ * keeps one credential, one retry policy and one error taxonomy across both packages instead
765
+ * of two that drift.
766
+ *
767
+ * Its credential is read per request. A read the map makes through the client carries the
768
+ * credential the client holds at that read. A request MapLibre makes to the client's tile
769
+ * origin carries the client's key, share token and cookie flag as they stood when the map was
770
+ * built, and its session token as it stands at that request, so a client whose session token
771
+ * is a function keeps one map alive through every rotation.
772
+ */
773
+ readonly client: Mountaya;
774
+ /**
775
+ * Overrides the credential MapLibre attaches to its own tile, sprite and glyph requests.
776
+ *
777
+ * Supply one only to render with a different credential from the one fetching specifications,
778
+ * such as a share-token map inside an authenticated application. A session token given as a
779
+ * function is called for each request the map claims (one bound for the client's tile origin),
780
+ * never while the map is built and never for a request bound elsewhere, so the override follows
781
+ * a token that rotates as the client's own does. The key, the share token and the cookie flag
782
+ * are read once, as the map is built. A `transformRequest` option replaces the transform this
783
+ * credential is attached by, and the credential with it.
784
+ *
785
+ * A key or a token that cannot be sent is refused with `MountayaElementsError` before the map
786
+ * is built, as the client refuses one: empty or whitespace alone, holding a character no
787
+ * request header carries, or without its prefix, a secret key in the publishable key's place
788
+ * above all. A session token a function answers is held to the same checks at each request.
789
+ *
790
+ * @default The client's own credential, which is almost always right.
791
+ */
792
+ readonly credential?: MapCredential | undefined;
793
+ /**
794
+ * Replaces the transform the map derives from its client and its `credential`.
795
+ *
796
+ * MapLibre calls it for every request it makes, a third-party base map and its fonts included,
797
+ * with the URL and the kind of resource asked for. It answers the request to send in its
798
+ * place, or `undefined` to send the request as it is. Supply one for what the credential
799
+ * projection cannot know: an origin the client does not speak to, a share token scoped to one
800
+ * path, a published-surface opt-in. `createTransformRequest` builds one from a credential and
801
+ * the origins allowed to receive it.
802
+ *
803
+ * The function is read once, as the map is built, and the client's credential is then read by
804
+ * nothing on MapLibre's side, so a transform that follows a rotating token reads the token
805
+ * inside the function.
806
+ *
807
+ * @default The transform derived from `client` and `credential`: the credential, sent to the
808
+ * client's tile origin alone, with the client's language.
809
+ */
810
+ readonly transformRequest?: ((url: string, resourceType?: string) => TransformedRequest | undefined) | undefined;
811
+ /**
812
+ * Where the camera opens, as `[longitude, latitude]`.
813
+ *
814
+ * A map that knows what it is about to draw is better off framing it (`easeIntoZoomRange` and
815
+ * `fitBounds` both take the geometry) than guessing a centre here.
816
+ *
817
+ * Two finite numbers, the latitude from -90 to 90. Anything else is refused with
818
+ * `MountayaElementsError` before the map is built, as a `zoom`, a `bearing` or a `pitch` that
819
+ * is no finite number is.
820
+ *
821
+ * @default MapLibre's own, `[0, 0]`.
822
+ */
823
+ readonly center?: [number, number] | undefined;
824
+ /**
825
+ * The zoom the camera opens at. It is a finite number, or the map is refused as `center`
826
+ * states.
827
+ *
828
+ * @default MapLibre's own, 0.
829
+ */
830
+ readonly zoom?: number | undefined;
831
+ /**
832
+ * The compass bearing the camera opens at, in degrees clockwise from north. It is a finite
833
+ * number, or the map is refused as `center` states.
834
+ *
835
+ * @default 0
836
+ */
837
+ readonly bearing?: number | undefined;
838
+ /**
839
+ * The tilt the camera opens at, in degrees off vertical. It is a finite number, or the map is
840
+ * refused as `center` states. A tilt past the map's ceiling (MapLibre's `maxPitch`, 60 unless
841
+ * the `maplibre` option raises it) is held at that ceiling.
842
+ *
843
+ * @default 0
844
+ */
845
+ readonly pitch?: number | undefined;
846
+ /**
847
+ * The slug of the catalogue terrain the base map starts on.
848
+ *
849
+ * @default The first terrain the manifest lists.
850
+ */
851
+ readonly terrain?: string | undefined;
852
+ /**
853
+ * The rendition of a catalogue terrain the base map draws, as the layers manifest lists it.
854
+ *
855
+ * The terrain's own light or dark variant, which is the host's choice and never read off the
856
+ * page's colour scheme. `setTerrainVariant` switches it afterwards. A value that is neither
857
+ * `"light"` nor `"dark"` is refused with `MountayaElementsError` before the map is built.
858
+ *
859
+ * @default "light"
860
+ */
861
+ readonly terrainVariant?: TerrainVariant | undefined;
862
+ /**
863
+ * The language labels are drawn in.
864
+ *
865
+ * Read by `clampMapLanguage`: by its primary subtag, and English when the tiles carry no labels
866
+ * in it.
867
+ *
868
+ * @default The client's language, the one it sends as `Accept-Language`, and the browser's
869
+ * where the client sends none.
870
+ */
871
+ readonly language?: MapLanguage | undefined;
872
+ /**
873
+ * Where a device fix comes from.
874
+ *
875
+ * Supply one to serve the fix from a native shell the map is embedded in, and supply
876
+ * `inertGeolocation` to state that this product does not locate people. Every surface already
877
+ * handles that answer, because it is the one a browser without the capability gives.
878
+ *
879
+ * @default The browser's own APIs, which is what an application in a browser wants.
880
+ */
881
+ readonly geolocation?: GeolocationSeam | undefined;
882
+ /**
883
+ * Glyphs for markers and, in `@mountaya/elements-react`, for controls.
884
+ *
885
+ * @default Lucide.
886
+ */
887
+ readonly icons?: IconProvider | undefined;
888
+ /**
889
+ * The limits the camera may not leave: a zoom floor and ceiling, and a boundary.
890
+ *
891
+ * Omitted, the camera is unconstrained, which is the right answer for a map a reader owns. An
892
+ * embed states them, because how far out of a published view a visitor may travel is the
893
+ * publisher's decision. `setConstraints` changes them afterwards, and refuses what the
894
+ * constructor refuses: a boundary with no width or no height, or with an edge at no finite
895
+ * coordinate, leaves the camera nowhere to stand, and throws `MountayaElementsError` before
896
+ * the map is built. So does a zoom window the map cannot hold ({@link CameraConstraints.zoom}).
897
+ * The window is part of what the map is built with, so the camera opens inside it.
898
+ */
899
+ readonly constraints?: CameraConstraints | undefined;
900
+ /**
901
+ * Whether the map's credit line is drawn in its compact form: a button at the canvas's corner
902
+ * that opens the credits. `true` shows the credits open as the map loads and closes them once
903
+ * the reader first drags the map; `"collapsed"` keeps them closed from the start, one press of
904
+ * the button away; `false` draws them in full whatever the width.
905
+ *
906
+ * Two maps of different widths in one product show their credits alike only when this is
907
+ * stated: left out, the form follows the canvas, compact at 640 pixels wide or less and in full
908
+ * on a wider one. It shapes the credit line and never removes it; the `maplibre` option's
909
+ * `attributionControl` is what replaces the credit line. Read once, as the map is built.
910
+ *
911
+ * @default Compact on a canvas 640 pixels wide or less, in full on a wider one.
912
+ */
913
+ readonly compactAttribution?: boolean | "collapsed" | undefined;
914
+ /**
915
+ * A complete style to start on, instead of a terrain from the manifest.
916
+ *
917
+ * The escape hatch for a map whose base map is not one of the catalogue's. `setTerrain` still
918
+ * works and replaces it.
919
+ *
920
+ * @default The first terrain the manifest lists, in the `terrainVariant` asked for.
921
+ */
922
+ readonly style?: string | StyleSpecification | undefined;
923
+ /**
924
+ * Changes how the map PAINTS, without re-assembling a style.
925
+ *
926
+ * A patch rather than a replacement, folded over the shipped defaults with the same merge every
927
+ * strings bundle resolves through, so `{ itinerary: { casingColor: "#f8f9fa" } }` changes the
928
+ * halo and leaves every width stop, dash and stacking rank exactly where they were. The two
929
+ * other routes, replacing the whole style or re-assembling every layer specification from the
930
+ * published constants, are not what a brand asks for.
931
+ *
932
+ * It cannot be a `--mtya-*` custom property, and that is the one thing worth knowing about this
933
+ * seam: MapLibre evaluates paint expressions inside its own renderer against no DOM element, so
934
+ * `var(--mtya-accent)` arrives as a string it cannot read and the layer draws in MapLibre's
935
+ * fallback. The tokens theme the chrome around the canvas; this themes what is drawn in it.
936
+ */
937
+ readonly paint?: MapPaintOverrides | undefined;
938
+ /**
939
+ * MapLibre's own options, for anything this façade does not wrap.
940
+ *
941
+ * Applied before the options the map states for itself, so they add to them and replace none:
942
+ * `container`, `style`, `transformRequest`, the opening pose and the pan lock are not keys of
943
+ * this type at all ({@link MapLibreOptions}). The one default they do replace is the attribution
944
+ * control, which is named before them on purpose: `{ attributionControl: false }` removes the
945
+ * map's own credit line, and takes responsibility for the tile licences with it.
946
+ *
947
+ * Handed to MapLibre as written, and read by it, with one kind of value held back: a number
948
+ * that is not finite (`NaN`, `Infinity`, `-Infinity`) anywhere among them, a member of a list
949
+ * or of a nested object included, is refused before the renderer is built, with a
950
+ * `MountayaElementsError` that names the path (`maplibre.maxPitch`). MapLibre answers one with
951
+ * an error of its own that names no option, or with a map built over it. Every other rule of
952
+ * these options is MapLibre's own, and so are the words of its refusals.
953
+ *
954
+ * Read once, as the map is built.
955
+ *
956
+ * @default No option beyond the map's own.
957
+ */
958
+ readonly maplibre?: MapLibreOptions | undefined;
959
+ }
960
+ /** The MapLibre map underneath, for anything the façade does not wrap. */
961
+ type RawMap = Map;
962
+
963
+ /**
964
+ * MountayaMap: a Mountaya map in one constructor.
965
+ *
966
+ * The package's headline object. The application installs `maplibre-gl` as a peer, writes one
967
+ * `new MountayaMap({ container, client })` and has a working map: the renderer is constructed,
968
+ * the credential is attached to the requests MapLibre makes for itself, the base map comes from
969
+ * the layers manifest, and every layer added afterwards lands at its deterministic rank rather
970
+ * than on top of whatever was already there.
971
+ *
972
+ * Three MapLibre behaviours are handled here because every integrator otherwise meets them
973
+ * as bugs rather than as documentation:
974
+ *
975
+ * 1. **`setStyle` wipes every source and layer.** Switching the base map is a `setStyle`,
976
+ * so an overlay added before the switch is simply gone afterwards. The façade keeps the
977
+ * DESIRED set separately from the LIVE set and replays it on `style.load`, carrying the
978
+ * layers a caller added by hand over with the sources they draw from, which is why
979
+ * `setTerrain` does not silently empty the map.
980
+ * 2. **Layer order is add order.** MapLibre appends, so a hillshade toggled on after an
981
+ * itinerary draws over the itinerary. Every insert here resolves its anchor from `LayerRank`.
982
+ * 3. **A layer outside the current zoom range renders nothing, silently.** Toggling such
983
+ * an overlay reads as a dead control, so the camera eases into range instead.
984
+ *
985
+ * This class does not call `fetch`. It holds the client and lets it fetch.
986
+ */
987
+
988
+ /**
989
+ * The zoom easing that brings an out-of-range overlay into view.
990
+ *
991
+ * Exported because an out-of-zoom layer renders and reports nothing, so every consumer
992
+ * driving its own map ends up writing this ease, and two durations for one motion read as
993
+ * two different animations to a user switching between surfaces.
994
+ */
995
+ declare const ZOOM_EASE_MS = 250;
996
+ /**
997
+ * The source id of the Street View coverage raster, Google's own blue overlay of where panoramas
998
+ * exist ({@link MountayaMap.setStreetviewCoverage}).
999
+ *
1000
+ * Published, with the layer id and the tile address, because the ids are the only handle on a
1001
+ * layer this class adds and removes inside a deferred callback: a surface driving its own pegman,
1002
+ * or a test double standing in for this class, reads the three the real mount uses.
1003
+ */
1004
+ declare const STREETVIEW_COVERAGE_SOURCE = "sv-coverage";
1005
+ /** The layer id of the Street View coverage raster ({@link STREETVIEW_COVERAGE_SOURCE}). */
1006
+ declare const STREETVIEW_COVERAGE_LAYER = "sv-coverage-layer";
1007
+ /**
1008
+ * The address the Street View coverage raster's tiles are read from.
1009
+ *
1010
+ * Google serves these tiles with no key: only the panorama itself and the coverage lookup need a
1011
+ * Maps key. Showing them on a map is subject to Google's terms, which are the integrator's to
1012
+ * meet.
1013
+ */
1014
+ declare const STREETVIEW_COVERAGE_TILES = "https://mts1.googleapis.com/vt?hl=en-US&lyrs=svv&style=40,18&x={x}&y={y}&z={z}";
1015
+ /**
1016
+ * MountayaMap is a Mountaya map on MapLibre: a container and a client draw a base map from the
1017
+ * layers manifest, and every layer added afterwards lands at its rank in {@link LayerRank}.
1018
+ *
1019
+ * It keeps what each slot asks for apart from what the style shows, so a base-map switch
1020
+ * ({@link MountayaMap.setTerrain}, {@link MountayaMap.setStyle}) draws every slot again, and a
1021
+ * map whose WebGL context is lost comes back whole. The renderer is {@link MountayaMap.raw}: a
1022
+ * source or a layer written there stays outside the rank registry and goes with the next
1023
+ * switch.
1024
+ *
1025
+ * The constructor throws {@link MountayaElementsError} for an option MapLibre cannot hold: a
1026
+ * camera pose, a zoom window or a pan lock it refuses, a number among `maplibre` that is not
1027
+ * finite, or a `terrainVariant` that is neither `"light"` nor `"dark"`. No renderer is built
1028
+ * then.
1029
+ *
1030
+ * @example
1031
+ * ```ts
1032
+ * import type { Mountaya } from "@mountaya/client";
1033
+ * import { MountayaMap } from "@mountaya/elements";
1034
+ *
1035
+ * declare const client: Mountaya;
1036
+ * declare const itineraryId: string;
1037
+ *
1038
+ * const map = new MountayaMap({ client, container: "map" });
1039
+ * await map.setItinerary(itineraryId, { fit: true });
1040
+ * ```
1041
+ */
1042
+ declare class MountayaMap {
1043
+ /**
1044
+ * The MapLibre map underneath.
1045
+ *
1046
+ * Deliberately public and deliberately named `raw`. A façade that hides its subject turns
1047
+ * every unwrapped capability into a feature request; naming the escape hatch means what this
1048
+ * class does not cover is a property access rather than a fork. Reaching for it is normal, but
1049
+ * a call that mutates sources or layers through it steps outside the rank registry, so its
1050
+ * result will not survive the next `setTerrain`.
1051
+ */
1052
+ readonly raw: RawMap;
1053
+ /**
1054
+ * Where a device fix comes from. The browser's own APIs unless the caller supplied a seam.
1055
+ *
1056
+ * Published rather than private, because the editor client and the studio's own tools both
1057
+ * ask it questions this class has no verb for (whether asking would prompt, and which reason
1058
+ * a refusal carried), and routing those through methods here would be wrappers over one object
1059
+ * the caller can simply hold.
1060
+ */
1061
+ readonly geolocation: GeolocationSeam;
1062
+ /** The glyph set markers draw from. Lucide unless the caller supplied their own. */
1063
+ readonly icons: IconProvider;
1064
+ private readonly client;
1065
+ /**
1066
+ * The element the map was built in, as the `container` option names it, and null where an id
1067
+ * names no element of the document. Read once the map has loaded, by the probe that says a
1068
+ * container with no size in development ({@link warnOnCollapsedContainer}).
1069
+ */
1070
+ private readonly container;
1071
+ /**
1072
+ * The requests made of each slot, and what each slot asks for: the DESIRED content, which
1073
+ * survives a style reload. `setStyle` destroys every source and layer on the map; it does not
1074
+ * destroy the caller's intent, so intent is kept there and replayed. Losing this distinction is
1075
+ * exactly the "my overlays vanished when I changed the base map" report.
1076
+ */
1077
+ private readonly requests;
1078
+ /** The LIVE registrations, wiped and rebuilt on every style reload. */
1079
+ private readonly mounted;
1080
+ /** Which of the live layers are ours, and at what rank. The anchor resolver reads it. */
1081
+ private readonly layerRankById;
1082
+ /**
1083
+ * The layers of the caller's own added while no style could take them, by id and in the order
1084
+ * each was last asked for: what {@link addLayer} was handed before any style had parsed, or while
1085
+ * MapLibre built one from scratch ({@link BaseMapSwitchEngine.isRebuilding}), until the next
1086
+ * style that loads takes it ({@link placePendingLayers}) or {@link removeLayer} withdraws it.
1087
+ */
1088
+ private readonly pendingLayers;
1089
+ /**
1090
+ * The layers of the caller's own, by id, each with the rank it was last added at: every layer
1091
+ * {@link addLayer} placed or holds until a style takes it, until {@link removeLayer} takes it off.
1092
+ * What a base-map switch carries over to the style it brings in ({@link carryOwnLayers}).
1093
+ */
1094
+ private readonly ownLayers;
1095
+ /**
1096
+ * The layers of the caller's own a base-map switch carried over and the map has not placed again
1097
+ * yet, by id, each as the style the switch left held it: read as the style the switch asked for
1098
+ * landed, and placed again at their ranks as that style's content is drawn again
1099
+ * ({@link placeCarriedLayers}).
1100
+ */
1101
+ private carriedLayers;
1102
+ /** Markers are DOM elements owned by the map container, so they survive `setStyle`. */
1103
+ private readonly markers;
1104
+ /**
1105
+ * Layers the caller has hidden, by id.
1106
+ *
1107
+ * Held as intent rather than read back off the style, for the same reason `desired`
1108
+ * exists: `setStyle` wipes every layer, and the replay re-adds them at their manifest
1109
+ * default. Without this a POI category switched off would come back the next time the
1110
+ * user changed base map, visibly, and with nothing to blame.
1111
+ */
1112
+ private readonly hiddenLayerIds;
1113
+ /**
1114
+ * Whether the map shows the restricted stretches of the itineraries it draws: a host's word,
1115
+ * kept for every stretch drawn from here on, a base-map switch included
1116
+ * ({@link setAccessRestrictionsVisibility}).
1117
+ */
1118
+ private accessRestrictionsVisible;
1119
+ /**
1120
+ * The markers pinned, in the order they stack, each with what it was built from, so `editMarker`
1121
+ * has something to merge onto ({@link markersAdded}).
1122
+ */
1123
+ private pinned;
1124
+ /**
1125
+ * What the preview, the highlight and the emphasis hold, for the same reason: `edit` needs a
1126
+ * base to patch ({@link geometrySlotsAfter}).
1127
+ */
1128
+ private geometrySlots;
1129
+ /**
1130
+ * How many times the search highlight was asked for, so a drawing that loads after a later call
1131
+ * draws nothing ({@link setSearchHighlight}).
1132
+ */
1133
+ private searchHighlightAsked;
1134
+ /**
1135
+ * The map's listeners, typed by MapLibre's own events, and the deferral to the style a
1136
+ * base-map switch brings in ({@link MapEvents}).
1137
+ *
1138
+ * `on` and `once` attach a listener of the renderer that outlives every base-map switch and
1139
+ * comes off as the map is destroyed, where a handler handed to `map.raw.on` is the caller's to
1140
+ * detach. The map's own events (`moveend`, `click`, `styleload`) are {@link on}'s, already
1141
+ * typed and with longitudes read into [-180, 180].
1142
+ *
1143
+ * `afterStyleLoad` is how a caller driving its own layers defers to the style a switch brings
1144
+ * in: it is answered out of the state the map keeps as it switches, so a second engine over
1145
+ * the same renderer never learns of a switch and runs its work against the style being torn
1146
+ * down. A base-map switch that waits for a lost WebGL context to return is a switch announced
1147
+ * too: `isStyleReloading()` answers true from the step it starts to wait in, and work deferred
1148
+ * through `afterStyleLoad` is held until the style the switch brings in has loaded.
1149
+ */
1150
+ readonly events: MapEvents;
1151
+ /** The engine behind {@link events}, whose reloads and teardown are the map's own. */
1152
+ private readonly eventEngine;
1153
+ /** Every drawn Data API result, by slot id: the input, the result and the draw options. */
1154
+ private readonly analyses;
1155
+ /** The in-flight query per slot, so a re-call cancels its own rather than everyone's. */
1156
+ private readonly analysisAborts;
1157
+ private analysisSeq;
1158
+ private readonly listeners;
1159
+ /**
1160
+ * The instant pinned for the classic overlay the server stamps ({@link setInstant}), or null with
1161
+ * none pinned, under which every overlay is drawn from the manifest's own addresses.
1162
+ */
1163
+ private instant;
1164
+ /**
1165
+ * The rendition of a catalogue terrain the host asked for last, with the `terrainVariant`
1166
+ * option or {@link setTerrainVariant}: the variant {@link setTerrain} reads the style of from
1167
+ * the manifest, and the one {@link getTerrainVariant} answers where no catalogue terrain says.
1168
+ * A switch that fails leaves it as the host stated it.
1169
+ */
1170
+ private terrainVariant;
1171
+ /**
1172
+ * The manifest read in flight or answered, shared by every reader. A read that failed is
1173
+ * dropped as it fails, so the next reader asks again.
1174
+ */
1175
+ private manifest;
1176
+ /**
1177
+ * The manifest once it has resolved, so `getLayers` can answer without waiting.
1178
+ *
1179
+ * Held beside the promise rather than instead of it: the promise is what de-duplicates
1180
+ * concurrent readers, and this is what lets a reader who is not the first answer in the same
1181
+ * tick. A caller re-reading the catalogue on every mount would otherwise be handed a promise
1182
+ * that resolves a microtask later even though the value has been in memory for minutes.
1183
+ */
1184
+ private resolvedManifest;
1185
+ /**
1186
+ * The organization whose studio scope the manifest is read for, sent as `organization_id`, or
1187
+ * null for the read that names none. {@link setLayersOrganization} moves it.
1188
+ */
1189
+ private layersOrganization;
1190
+ /**
1191
+ * The slug a {@link setTerrain} that is the latest base-map request was handed, while it reads
1192
+ * the manifest: null for the manifest's first terrain, and undefined once it has found its
1193
+ * terrain or refused, or while no such call stands. A {@link setTerrainVariant} asks for it
1194
+ * again.
1195
+ */
1196
+ private terrainRequest;
1197
+ /**
1198
+ * The slug the latest {@link setTerrain} was handed, null for the manifest's first terrain,
1199
+ * and undefined once the manifest refused it or a style of the host's own was asked for since.
1200
+ * A {@link setTerrainVariant} on a map that shows no base map asks for it again.
1201
+ */
1202
+ private terrainLastAsked;
1203
+ /** The base-map switch, and what the map does as its WebGL context is lost and returns. */
1204
+ private readonly baseMap;
1205
+ /**
1206
+ * The latest base-map request, by a token no other shares. {@link setTerrain} reads the manifest
1207
+ * before it swaps while {@link setStyle} swaps at once, so a terrain switch that finds a later
1208
+ * switch asked for once the manifest answers yields to it rather than swapping the base map back.
1209
+ */
1210
+ private baseMapRequestCount;
1211
+ /**
1212
+ * What each list getter last answered, by the getter and its argument, until the next
1213
+ * `displaychange` ({@link reportDisplayChange}).
1214
+ *
1215
+ * A getter read twice between two changes answers one array, which is what lets a reader hand
1216
+ * it to a store that compares snapshots by identity.
1217
+ */
1218
+ private readonly displayAnswers;
1219
+ private language;
1220
+ /**
1221
+ * Where the pointer last moved to, until the next animation frame reads it for `featurehover`.
1222
+ * `null` once read, and while nothing listens.
1223
+ */
1224
+ private hoverPosition;
1225
+ /** The animation frame the `featurehover` hit-test waits on, or `null` when none is asked. */
1226
+ private hoverFrame;
1227
+ private destroyed;
1228
+ /** The organization the map's read answered, or `null` until a load of it does. */
1229
+ private organization;
1230
+ /**
1231
+ * The refusals of access that stand, by the source each came from and null for one that names
1232
+ * none ({@link accessStandingAfter}). Kept from the map's construction, listened to or not, so
1233
+ * {@link isAccessRequired} answers a host handed the map after a refusal landed.
1234
+ */
1235
+ private refusals;
1236
+ /**
1237
+ * The credential each request the map's own transform claims left with, which a refusal of the
1238
+ * request is read against ({@link SentCredentialsEngine}). Undefined under a `transformRequest` of
1239
+ * the host's own, whose credential the map cannot read.
1240
+ */
1241
+ private sentCredentials;
1242
+ /**
1243
+ * The waits on the style that are still open, each by the callback that settles it.
1244
+ *
1245
+ * The event engine drops the work it holds for a style when the map is torn down, since that
1246
+ * work would add to a style that is never coming. A call awaiting one of these is owed an
1247
+ * answer all the same, so {@link destroy} settles them, and each call then finds its request
1248
+ * superseded and draws nothing.
1249
+ */
1250
+ private readonly styleWaits;
1251
+ /**
1252
+ * The resolved paint every layer this map stands up is drawn with.
1253
+ *
1254
+ * `MapPaint` rather than the patch: resolution happens once at construction, so what the layer
1255
+ * builders and the rank resolver read is a complete palette with no folding left to do.
1256
+ */
1257
+ private readonly paint;
1258
+ /**
1259
+ * Builds the renderer in `options.container` and asks for the base map: the `style` given, or
1260
+ * the catalogue terrain `terrain` names (the manifest's first by default).
1261
+ *
1262
+ * @param options What the map draws with and where, {@link MountayaMapOptions}.
1263
+ * @throws {MountayaElementsError} For an option MapLibre cannot hold, as the class states. No
1264
+ * renderer is built then.
1265
+ */
1266
+ constructor(options: MountayaMapOptions);
1267
+ /**
1268
+ * Draws one itinerary, and frames it when `fit` asks. Replaces whichever was drawn before;
1269
+ * `null` clears.
1270
+ *
1271
+ * The latest call wins, whatever order the loads answer in: a load an earlier call started
1272
+ * draws nothing once a later call or a clear has been made, so `setItinerary("A")` then
1273
+ * `setItinerary("B")` leaves B drawn even when A answers last. A base-map switch made while a
1274
+ * load is in flight draws the latest call too, and never a superseded one. Every `set`, `add`
1275
+ * and toggle on this map that loads before it draws keeps the same rule, and a Data API `add`
1276
+ * or `edit` whose result is cleared or removed while its query is in flight has that query
1277
+ * cancelled.
1278
+ *
1279
+ * The answer says which happened. `drawn` is true when this call's itinerary is the one on the
1280
+ * map as the call resolves, and false when the call drew nothing: a later call or a clear
1281
+ * superseded it, the map was destroyed, or the call was itself the clear. A call superseded
1282
+ * while it holds its specification and waits on the style resolves as it is superseded, with
1283
+ * that style still to load, and one superseded while its read is out resolves as the read
1284
+ * answers.
1285
+ *
1286
+ * `fit` frames the camera on the itinerary in the step this call's drawing reaches the map,
1287
+ * and never for a call that drew nothing. The box is the one the itinerary's geometry spans,
1288
+ * which the map reads through its client beside the specification, and only when `fit` is
1289
+ * asked for: a call with no `fit` makes the one read. An itinerary whose segments hold no
1290
+ * geometry yet is drawn and frames nothing, and a base-map switch replays the drawing and
1291
+ * leaves the camera where it is. `fit` takes the itinerary's id. An itinerary's specification
1292
+ * states no bounds (a collection's is the one that carries a `bbox`, which
1293
+ * {@link setCollection} frames), so one handed over with `fit` is refused with nothing drawn:
1294
+ * frame it with {@link fitBounds} from bounds you hold.
1295
+ *
1296
+ * `signal` withdraws the call. It is handed to every read the call makes through the client,
1297
+ * and an abort made while the call is loading or waiting on the style rejects with the signal's
1298
+ * reason as the signal aborts, whether or not that style ever loads. The call draws nothing,
1299
+ * frames nothing and leaves the slot as it was: what the slot had drawn stays drawn, and a call
1300
+ * this one superseded, still loading or waiting on the style, has the slot back and draws as if
1301
+ * this one had not been made. That earlier call stays unresolved for as long as this one may
1302
+ * still give the slot back: until this one has drawn, been withdrawn or ended, or until a call
1303
+ * carrying no signal, or a clear, takes the slot for good, which resolves it with
1304
+ * `{ drawn: false }` at once. A call aborted after a later one superseded it has no slot to
1305
+ * give back. A signal that has already aborted rejects at once, with nothing read and nothing
1306
+ * cleared, and an abort made once the itinerary is drawn changes nothing.
1307
+ *
1308
+ * A read the client fails is no withdrawal. The call rejects with the client's error, the slot
1309
+ * keeps what it had drawn, and a call this one superseded stays superseded.
1310
+ *
1311
+ * @param itinerary The itinerary's id, a specification already held, or `null` to clear.
1312
+ * @param options `fit` frames the itinerary once it is drawn, and `signal` withdraws the call.
1313
+ * @returns Whether this call's itinerary is the one drawn.
1314
+ * @throws {MountayaElementsError} When `fit` is asked for with a specification, when it is
1315
+ * neither a boolean nor an object of options, and when it states options {@link fitBounds}
1316
+ * refuses. Nothing is read, drawn or cleared.
1317
+ * @throws The signal's reason, when `signal` aborts before the itinerary is drawn, and
1318
+ * whatever a read through the client rejects with.
1319
+ *
1320
+ * @example
1321
+ * ```ts
1322
+ * import type { MountayaMap } from "@mountaya/elements";
1323
+ *
1324
+ * declare const map: MountayaMap;
1325
+ * declare const itineraryId: string;
1326
+ * declare const signal: AbortSignal;
1327
+ *
1328
+ * // Drawn, and framed with no ease: this is where the itinerary opens.
1329
+ * const { drawn } = await map.setItinerary(itineraryId, {
1330
+ * fit: { duration: 0, maxZoom: 15, padding: 48 },
1331
+ * signal,
1332
+ * });
1333
+ * ```
1334
+ */
1335
+ setItinerary(itinerary: Renderable, options?: ItineraryDrawOptions): Promise<{
1336
+ readonly drawn: boolean;
1337
+ }>;
1338
+ /**
1339
+ * Draws one collection: every itinerary and zone it holds. Replaces whichever was drawn
1340
+ * before; `null` clears.
1341
+ *
1342
+ * The latest call wins, whatever order the loads answer in, and the answer says which happened,
1343
+ * as {@link setItinerary} states: `drawn` is true when this call's collection is the one on the
1344
+ * map as the call resolves.
1345
+ *
1346
+ * `fit` frames the camera on the collection in the step this call's drawing reaches the map,
1347
+ * and never for a call that drew nothing, as it frames an itinerary. The box is the
1348
+ * specification's own `bbox`, the extent of the itineraries the collection's tiles draw, so the
1349
+ * fit reads nothing more, and a specification already held frames the same way. A
1350
+ * specification whose `bbox` is null or absent (its tiles draw no itinerary) is drawn and
1351
+ * frames nothing, and a base-map switch replays the drawing and leaves the camera where it is.
1352
+ *
1353
+ * `signal` withdraws the call, as it withdraws {@link setItinerary}: it is handed to the read,
1354
+ * and an abort made before the collection is drawn rejects with the signal's reason and leaves
1355
+ * the slot as it was.
1356
+ *
1357
+ * @param collection The collection's id, a specification already held, or `null` to clear.
1358
+ * @param options `fit` frames the collection once it is drawn, and `signal` withdraws the call.
1359
+ * @returns Whether this call's collection is the one drawn.
1360
+ * @throws {MountayaElementsError} When `fit` is neither a boolean nor an object of options,
1361
+ * and when it states options {@link fitBounds} refuses. Nothing is read, drawn or cleared.
1362
+ * @throws The signal's reason, when `signal` aborts before the collection is drawn, and
1363
+ * whatever the read through the client rejects with.
1364
+ *
1365
+ * @example
1366
+ * ```ts
1367
+ * import type { MountayaMap } from "@mountaya/elements";
1368
+ *
1369
+ * declare const map: MountayaMap;
1370
+ * declare const collectionId: string;
1371
+ *
1372
+ * // Drawn, and framed with no ease on every itinerary it holds.
1373
+ * const { drawn } = await map.setCollection(collectionId, {
1374
+ * fit: { duration: 0, padding: 48 },
1375
+ * });
1376
+ * ```
1377
+ */
1378
+ setCollection(collection: Renderable, options?: CollectionDrawOptions): Promise<{
1379
+ readonly drawn: boolean;
1380
+ }>;
1381
+ /**
1382
+ * clearItinerary, clearCollection and clearOverlay are the explicit clears, one per `set`.
1383
+ *
1384
+ * `set*(null)` does the same thing; these are the readable form, and the form that pairs with
1385
+ * `remove*` on the `add` families.
1386
+ *
1387
+ * **None of these three has an `edit`, deliberately.** An itinerary, a collection and an
1388
+ * overlay are each named by an id or a slug and nothing else: there is no structured input to
1389
+ * merge a partial onto, so `editItinerary(id)` would be `setItinerary(id)` under a second name.
1390
+ * `edit` earns its place only where the resource holds an input worth patching: the analysis
1391
+ * results, the preview, the highlight and a marker.
1392
+ */
1393
+ clearItinerary(): void;
1394
+ /** Clears the collection drawn, as `setCollection(null)` does. */
1395
+ clearCollection(): void;
1396
+ /** Clears the classic overlay drawn, as `setOverlay(null)` does. */
1397
+ clearOverlay(): void;
1398
+ /**
1399
+ * Toggles the aggregate itineraries layer: the itineraries of the credential's own scope, every
1400
+ * one of its organization's under a key or a share token, and a signed-in person's personal
1401
+ * space under their session. A map that follows another studio scope reads the layers catalog
1402
+ * for it instead ({@link MountayaMap.setLayersOrganization}).
1403
+ */
1404
+ setItineraries(on: boolean): Promise<void>;
1405
+ /**
1406
+ * Toggles the zones layer: the zones of the credential's own scope, as
1407
+ * {@link MountayaMap.setItineraries} reads it.
1408
+ */
1409
+ setZones(on: boolean): Promise<void>;
1410
+ /**
1411
+ * Switches the base map, by terrain slug.
1412
+ *
1413
+ * This is a `setStyle` underneath, so MapLibre destroys every source and layer first. The
1414
+ * façade replays the desired content once the new style loads, which is what makes the
1415
+ * switch look like a base-map change rather than like the map emptying itself. Passing
1416
+ * `null` selects the manifest's first terrain, which is what a map with no explicit
1417
+ * choice starts on. The terrain is drawn in the variant the host asked for last, with the
1418
+ * `terrainVariant` option or {@link setTerrainVariant}.
1419
+ *
1420
+ * The latest base-map request wins: a `setTerrain` or {@link setStyle} asked for while this one
1421
+ * reads the manifest is the one shown, and this one resolves without swapping.
1422
+ *
1423
+ * A style document that cannot be fetched is no rejection here: the failure is MapLibre's, and
1424
+ * arrives on the `error` event, or on `accessrequired` when the API refused it. The call then
1425
+ * resolves with the base map the reader had still on the map and everything drawn on it in
1426
+ * place, {@link getTerrain} keeps naming that one, and the terrain that failed can be asked
1427
+ * for again.
1428
+ *
1429
+ * The call gives up the same way on a document that is only slow, when the map reports an
1430
+ * error of its own and settles before the document lands: a tile of the style still shown
1431
+ * that fails. The document then arrives after the call resolved. The map takes it as the base
1432
+ * map it is: {@link getTerrain} names its terrain from then on, everything drawn is replayed
1433
+ * onto it, and `styleload` is emitted. A base-map request made in between is the later one
1434
+ * and wins: the terrain still shown, asked for again, is asked of MapLibre again, which drops
1435
+ * the slow document.
1436
+ *
1437
+ * A switch asked for before the style the map was built with has loaded, or failed to, waits
1438
+ * for that style, and {@link getTerrain} names the terrain on its way meanwhile. One asked for
1439
+ * after that style failed, from an `error` handler included, waits on nothing.
1440
+ *
1441
+ * A switch asked for while the map's WebGL context is lost is made once the context is back
1442
+ * and the style the map had has loaded again, since MapLibre sets that style over any other as
1443
+ * the context returns. The call settles once its switch is made, {@link getTerrain} names the
1444
+ * terrain asked for throughout, and the latest request made meanwhile is the one made. A
1445
+ * switch whose document was on its way as the context was lost is made again the same way.
1446
+ * MapLibre sets a style again only where the style on the map had loaded as the context was
1447
+ * lost. Where it had not (the style the map was built with failed to load, or a style was
1448
+ * still being built), the switch is made as the context returns, from its document alone.
1449
+ * Work queued through `events.afterStyleLoad` while the switch waits is held for the style the
1450
+ * switch brings in, as it is behind a switch made at once, and never runs on the style the
1451
+ * context brings back.
1452
+ *
1453
+ * **An unknown slug throws, on purpose.** A slug the manifest does not hold throws
1454
+ * {@link MountayaElementsNotFoundError}, naming the slugs it does hold: the slug here is an
1455
+ * argument a developer wrote, and a typo is worth failing on. `resolveBaseTerrain` in
1456
+ * `@mountaya/studio` gives the other answer to the same question and falls back to the
1457
+ * manifest's first terrain, since the slug a studio holds is a stored preference read against
1458
+ * a manifest that can change. The difference is deliberate, and the answers are not to be
1459
+ * merged.
1460
+ *
1461
+ * @param slug The terrain's slug as the manifest spells it, or `null` for the manifest's first
1462
+ * terrain.
1463
+ * @throws {MountayaElementsNotFoundError} When the manifest holds no terrain named `slug`, or
1464
+ * lists none at all.
1465
+ * @throws {MountayaElementsError} When the map is destroyed before a switch that waits for a
1466
+ * lost WebGL context to return is made.
1467
+ */
1468
+ setTerrain(slug: string | null): Promise<void>;
1469
+ /**
1470
+ * Swaps the base style for one you name, keeping everything drawn on top of it.
1471
+ *
1472
+ * {@link setTerrain} covers the catalogue; this covers the style that is not in it: your
1473
+ * own cartography, a third-party base map, or a catalogue terrain whose fetched style
1474
+ * document you need to amend on the way in. `transformStyle` is MapLibre's own hook: it
1475
+ * receives the style after it is fetched and before it is committed, which is the only point
1476
+ * at which a source can be added to the style document itself rather than to the map on top
1477
+ * of it. Injecting a DEM for 3D relief is that case. Its `previous` is the style on the map as
1478
+ * MapLibre serializes it, every source and layer drawn onto it included, less the one source
1479
+ * the map marks a switch with, so a hook that carries the sources of `previous` over carries
1480
+ * no marker of the map's.
1481
+ *
1482
+ * Going through here rather than through `map.raw.setStyle` is what keeps the map's
1483
+ * contents. MapLibre destroys every source and layer on a swap, so a bare `setStyle` leaves
1484
+ * the itinerary, the overlays and the enrichments gone, silently, because nothing errors
1485
+ * when a layer simply is not there. This announces the swap, waits for the new style, and
1486
+ * replays the desired set onto it.
1487
+ *
1488
+ * Layers you added yourself with {@link addLayer} are carried over with the sources they draw
1489
+ * from, as {@link addLayer} states, and everything this package drew comes back on its own.
1490
+ *
1491
+ * The latest base-map request wins, as {@link setTerrain} states: a terrain switch still reading
1492
+ * the manifest when this is called resolves without swapping.
1493
+ *
1494
+ * A style that cannot be fetched is reported as {@link setTerrain} states it, on `error`, and
1495
+ * the style on the map stays. A style MapLibre refuses as it is handed over rejects with
1496
+ * MapLibre's own error. Either way {@link getTerrain} goes back to the terrain still shown. A
1497
+ * style that arrives after the call gave up on it, and a call made before the style the map
1498
+ * was built with has loaded, are handled as {@link setTerrain} states too.
1499
+ *
1500
+ * A `transformStyle` that throws rejects the call with what it threw. The style on the map
1501
+ * stays, with everything drawn on it, {@link getTerrain} keeps naming the terrain still shown,
1502
+ * and neither `styleload` nor `error` is emitted: the failure is the call's own. What was asked
1503
+ * for while the document was fetched is drawn onto the style that stayed, and the map takes
1504
+ * the next switch as it takes any.
1505
+ *
1506
+ * A switch asked for while the map's WebGL context is lost is made once the context is back, and
1507
+ * the call settles then, as {@link setTerrain} states. A `transformStyle` then reads, as its
1508
+ * `previous`, the style the context brought back, and `undefined` where MapLibre brought none
1509
+ * back. Work queued through `events.afterStyleLoad` right behind the call runs on the style the
1510
+ * switch brings in, as it does on a map that holds its context.
1511
+ *
1512
+ * A switch asked for after the style the map was built with failed to load is made from the
1513
+ * document alone, and its `transformStyle` reads `undefined` as `previous`: no style has
1514
+ * loaded on the map for the hook to be handed.
1515
+ *
1516
+ * @throws What `transformStyle` threw, as thrown.
1517
+ * @throws {MountayaElementsError} When the map is destroyed before a switch that waits for a
1518
+ * lost WebGL context to return is made.
1519
+ */
1520
+ setStyle(style: StyleSpecification | string, options?: {
1521
+ readonly transformStyle?: TransformStyleFunction | undefined;
1522
+ }): Promise<void>;
1523
+ /**
1524
+ * The slug of the catalogue terrain the base map is on, or `null` when it is on none: before
1525
+ * the first terrain is found in the manifest, and under a style of the host's own (the `style`
1526
+ * option, {@link setStyle}).
1527
+ *
1528
+ * It answers the latest {@link setTerrain} from the moment that call finds its terrain in the
1529
+ * manifest, while the style is still on its way, so a picker marks the terrain the map is
1530
+ * switching to and never the one it is leaving. A switch whose style does not arrive gives the
1531
+ * answer back to the base map still shown, and takes it again if the style arrives after all
1532
+ * ({@link setTerrain}). A switch that waits for a lost WebGL context to return keeps the
1533
+ * answer while it waits.
1534
+ *
1535
+ * @returns The terrain's slug as the manifest spells it, or `null`.
1536
+ */
1537
+ getTerrain(): string | null;
1538
+ /**
1539
+ * Switches the base map to the light or the dark variant of its catalogue terrain, apart from
1540
+ * any colour scheme of the page around it.
1541
+ *
1542
+ * The variant is the terrain's own rendition, as the layers manifest lists it: which one a map
1543
+ * draws is the host's call, made here or with the `terrainVariant` option, and never read off
1544
+ * the page's colour scheme. The terrain {@link getTerrain} names, or the one a
1545
+ * {@link setTerrain} still reading the manifest asks for, is asked for again in this variant
1546
+ * through the same switch {@link setTerrain} makes, so everything drawn is replayed onto it and
1547
+ * {@link getTerrain} keeps naming it. On a map that shows no base map, because the document of
1548
+ * the terrain it was built with or last asked for did not arrive, or the manifest could not be
1549
+ * read for it, that terrain is asked for again. A terrain whose two variants are one style, and
1550
+ * the variant already drawn, ask the renderer for nothing.
1551
+ *
1552
+ * The variant stands as the host's word, whatever the switch does: every later
1553
+ * {@link setTerrain} draws its terrain in it, after a {@link setStyle} as well. A document of
1554
+ * the variant that does not arrive is handled as {@link setTerrain} states,
1555
+ * {@link getTerrainVariant} names the variant still drawn, and the same call made again asks for
1556
+ * it again.
1557
+ *
1558
+ * Under a style of the host's own (the `style` option, {@link setStyle}), and on a map that
1559
+ * shows no base map because the manifest refused the terrain asked for last as unknown, nothing
1560
+ * is switched, and the next {@link setTerrain} draws its terrain in this variant.
1561
+ *
1562
+ * @param variant `"light"` or `"dark"`.
1563
+ * @throws {MountayaElementsError} When `variant` is neither. Nothing changes.
1564
+ * @throws {MountayaElementsNotFoundError} As {@link setTerrain} throws, for the terrain asked
1565
+ * for again. That and a manifest read that fails leave the base map as it is, and the variant
1566
+ * stands for the next {@link setTerrain}.
1567
+ */
1568
+ setTerrainVariant(variant: TerrainVariant): Promise<void>;
1569
+ /**
1570
+ * The variant of a catalogue terrain the map draws: the variant of the terrain
1571
+ * {@link getTerrain} names, on its way or shown, and otherwise the variant the next
1572
+ * {@link setTerrain} draws in, which is the one the host asked for last. `"light"` unless the
1573
+ * host asked for dark.
1574
+ *
1575
+ * A terrain whose two variants are one style is drawn in the variant asked for last. A switch
1576
+ * whose document does not arrive gives the answer back to the variant still drawn, and takes it
1577
+ * again if the document arrives after all, as {@link getTerrain} does.
1578
+ */
1579
+ getTerrainVariant(): TerrainVariant;
1580
+ /**
1581
+ * What the map credits: Mountaya, always and first, then each source of the style it shows
1582
+ * that a layer draws at the camera's zoom, by the credit that source states, in the order the
1583
+ * style lists its sources. Each credit is listed once, compared by its exact text, so a
1584
+ * Mountaya source stating Mountaya's credit adds nothing, and a credit that is blank is left
1585
+ * out.
1586
+ *
1587
+ * A credit is markup, which the renderer's own credit line renders as such. A host that draws
1588
+ * its own credit line, having turned the renderer's off (`maplibre: { attributionControl: false }`),
1589
+ * reads the credits it owes here, and reads them again as the camera, the style or a source
1590
+ * moves. The credit of a source the renderer reads from its TileJSON is listed once that
1591
+ * TileJSON has arrived.
1592
+ *
1593
+ * @returns The credits, each as its source states it. Before a style has loaded, and once the
1594
+ * map is destroyed, the map draws no source, and Mountaya's credit is the one listed.
1595
+ */
1596
+ getCredits(): readonly string[];
1597
+ /**
1598
+ * terrainToAskAgain answers the terrain a {@link setTerrainVariant} asks for again: the one a
1599
+ * {@link setTerrain} still reading the manifest asks for, the one {@link getTerrain} names, or,
1600
+ * on a map that shows no base map, the one asked for last that the manifest did not refuse.
1601
+ * Undefined where none stands, under a style of the host's own included.
1602
+ */
1603
+ private terrainToAskAgain;
1604
+ /**
1605
+ * Draws one classic overlay, by slug. Replaces whichever was drawn before; `null` clears.
1606
+ *
1607
+ * Classic overlays are exclusive by contract: slope, snow depth and avalanche risk each
1608
+ * repaint the same ground, so two at once is a muddle rather than a composition. Overlays
1609
+ * that *do* compose are enrichments, and they take `addEnrichment` instead. The manifest
1610
+ * says which is which; this is not a convention a caller has to remember.
1611
+ *
1612
+ * @throws {MountayaElementsNotFoundError} When the manifest holds no classic overlay named
1613
+ * `slug`. An enrichment's slug is refused too, since drawn here it would take the slot
1614
+ * classic overlays share. The message names the classic overlays it does hold.
1615
+ */
1616
+ setOverlay(slug: string | null): Promise<void>;
1617
+ /**
1618
+ * Draws one classic overlay you already hold, without reading the manifest.
1619
+ *
1620
+ * {@link setOverlay} names a slug and resolves it against `/v1/tile-layers`; this takes the
1621
+ * resolved entry. The path for an application that already holds the manifest (read
1622
+ * through a query client, a store, or a payload rendered on a server), for which the slug
1623
+ * form buys a second read of bytes that are in hand, and a first one on a map that would
1624
+ * otherwise never need the manifest at all.
1625
+ *
1626
+ * {@link setSpecification} also draws bytes you hold, and is the wrong tool here: it
1627
+ * mounts under a name of yours, so the overlay lands beside this package's overlay slot
1628
+ * rather than in it. What that costs is every behaviour attached to the slot:
1629
+ * {@link clearOverlay} and `setOverlay(null)` stop clearing it, and a later overlay stacks
1630
+ * on top instead of replacing it, which is the one composition classic overlays exist to
1631
+ * prevent. Going through here keeps all of it.
1632
+ *
1633
+ * The overlay names its own slot, so there is no slug to pass. The camera eases into the
1634
+ * layers' zoom window exactly as the slug form does.
1635
+ */
1636
+ setOverlaySpecification(overlay: Overlay, options?: MountOptions): Promise<void>;
1637
+ /**
1638
+ * Adds one enrichment overlay on top of whatever is already drawn.
1639
+ *
1640
+ * `add`, not `set`, because enrichments stack: hillshade under a slope overlay under an
1641
+ * itinerary is a legitimate and common composition. Each holds its own slot, so adding a
1642
+ * second does not disturb the first.
1643
+ *
1644
+ * @throws {MountayaElementsNotFoundError} When the manifest holds no enrichment named `slug`.
1645
+ * A classic overlay's slug is refused too, since added here it would stack with the one
1646
+ * {@link setOverlay} draws. The message names the enrichments it does hold.
1647
+ */
1648
+ addEnrichment(slug: string): Promise<void>;
1649
+ /**
1650
+ * Adds one enrichment overlay you already hold, without reading the manifest.
1651
+ *
1652
+ * The no-fetch sibling of {@link addEnrichment}, for the same holder of the manifest
1653
+ * {@link setOverlaySpecification} serves, and it stacks the same way.
1654
+ *
1655
+ * The slot is named from `overlay.slug` rather than from a second argument, deliberately.
1656
+ * That slug is the handle {@link removeEnrichment}, {@link clearEnrichments} and
1657
+ * {@link getEnrichments} answer by, and the slug form can only ever mount under the
1658
+ * manifest's own spelling: it found the overlay by matching it. A separate argument would
1659
+ * let the two paths disagree, and the disagreement draws one overlay's sources under
1660
+ * another's name: `getEnrichments()` then reports a slug whose drawing is something else,
1661
+ * and removing it removes the wrong thing. Deriving makes that unrepresentable.
1662
+ *
1663
+ * {@link setSpecification} would cost the same slot behaviours here as it does for a
1664
+ * classic overlay, plus the enrichment roster: a specification mounted by name is not an
1665
+ * enrichment and none of the three verbs above sees it.
1666
+ */
1667
+ addEnrichmentSpecification(overlay: Overlay, options?: MountOptions): Promise<void>;
1668
+ /**
1669
+ * Removes one enrichment, by the slug {@link addEnrichment} was handed, and an
1670
+ * {@link addEnrichment} of it still reading the manifest draws nothing. A slug not drawn
1671
+ * changes nothing.
1672
+ */
1673
+ removeEnrichment(slug: string): void;
1674
+ /** Removes every enrichment, the ones still being found in the manifest included. */
1675
+ clearEnrichments(): void;
1676
+ /**
1677
+ * The enrichment slugs currently drawn, in the order they were added.
1678
+ *
1679
+ * @returns The slugs, as one frozen array until the next `displaychange`.
1680
+ */
1681
+ getEnrichments(): readonly string[];
1682
+ /**
1683
+ * Pins the instant the map draws the classic overlay the server stamps for, or none with null.
1684
+ *
1685
+ * The classic overlay whose time the catalogue says the server resolves
1686
+ * (`capabilities.server.timestamp`) asks each of its tiles for the instant pinned last, its
1687
+ * addresses stamped as `timestampedSources` of `@mountaya/elements/layers` stamps them. The
1688
+ * overlay drawn is asked again in place, its layers where they stand, one drawn later is stamped
1689
+ * as it is drawn, and a base-map switch draws it again for the instant pinned. With none pinned
1690
+ * it is drawn from the manifest's own addresses: the server's present, which a device clock set
1691
+ * wrong cannot push outside the time the Tile API draws for. An enrichment, and a classic overlay
1692
+ * whose time the client resolves, are drawn as the manifest writes them whatever is pinned, and a
1693
+ * pin outlives the overlay it was asked for.
1694
+ *
1695
+ * An Invalid Date names no instant and pins none. A stamped tile the API refuses is told as any
1696
+ * refusal is, as `accessrequired` with the address the tile was asked at, the instant included.
1697
+ *
1698
+ * @param instant The instant to pin, or null for none.
1699
+ *
1700
+ * @example
1701
+ * ```ts
1702
+ * import { MountayaMap } from "@mountaya/elements";
1703
+ *
1704
+ * declare const map: MountayaMap;
1705
+ *
1706
+ * await map.setOverlay("snow-depth");
1707
+ * await map.setInstant(new Date("2026-03-14T09:00:00Z"));
1708
+ * ```
1709
+ */
1710
+ setInstant(instant: Date | null): Promise<void>;
1711
+ /**
1712
+ * The instant pinned for the classic overlay the server stamps ({@link setInstant}), or null
1713
+ * with none pinned.
1714
+ *
1715
+ * @returns A date of the caller's own.
1716
+ */
1717
+ getInstant(): Date | null;
1718
+ /**
1719
+ * stampDrawnOverlay asks the classic overlay on the style for the instant pinned, by swapping
1720
+ * its sources' tiles in place, so it fetches its tiles again with no remove and add and its
1721
+ * layers stay where they are. While a base-map switch fetches its document, that is the overlay
1722
+ * the style before it still shows. An overlay the server does not stamp is left as it is drawn.
1723
+ */
1724
+ private stampDrawnOverlay;
1725
+ /**
1726
+ * Draws a specification you already hold, under a name of your choosing.
1727
+ *
1728
+ * The path for an application that reads through its own cache (a query client, a store,
1729
+ * a payload rendered on a server), and therefore has the bytes in hand before the map asks
1730
+ * for them. Nothing is fetched: the specification is the argument. Every other `set` here
1731
+ * takes an id and resolves it, which buys a second round trip for something already held.
1732
+ *
1733
+ * What this adds over calling `applySpecification` against `map.raw` is the two things
1734
+ * that are cheap here and expensive to rediscover. Every layer lands at its `LayerRank`,
1735
+ * so a specification mounted after an itinerary draws beneath it rather than over it, whichever
1736
+ * order the two arrived in. And the intent is remembered rather than only the layers, so
1737
+ * `setTerrain` replays it, where a specification applied directly is destroyed by the
1738
+ * next base-map switch and never comes back, silently, because nothing errors when a layer
1739
+ * simply is not there any more.
1740
+ *
1741
+ * The name is yours and cannot collide with anything this package draws: slots taken here
1742
+ * are namespaced, so `"itinerary"` names your specification and leaves `setItinerary`'s
1743
+ * untouched. Mounting the same name again replaces what it held rather than stacking a
1744
+ * second copy, which is what makes this safe to call on every render.
1745
+ *
1746
+ * The camera is left where it is, as it is for every other `set`. A layer draws over a zoom
1747
+ * window and renders nothing outside it, so pair this with {@link easeIntoZoomRange} when the
1748
+ * mount is a user switching something on and expecting to see it.
1749
+ *
1750
+ * Layers mounted this way answer to {@link setLayerVisibility} like any other, by their id
1751
+ * in the specification, and that choice survives a base-map switch too.
1752
+ *
1753
+ * `onMounted` is where anything the specification does not carry gets attached (a
1754
+ * companion layer, a paint fold over the ids the manifest assigned), because it fires on
1755
+ * the replay as well as on the mount, and the replay is where a caller doing it by hand
1756
+ * loses that work.
1757
+ */
1758
+ setSpecification(name: string, specification: TileSpecification, options?: MountOptions): Promise<void>;
1759
+ /** Removes the specification drawn under `name`. A name holding nothing is a no-op. */
1760
+ removeSpecification(name: string): void;
1761
+ /** Removes every specification mounted by name, leaving this package's own slots drawn. */
1762
+ clearSpecifications(): void;
1763
+ /**
1764
+ * The names currently drawn, in the order they were mounted.
1765
+ *
1766
+ * @returns The names, as one frozen array until the next `displaychange`.
1767
+ */
1768
+ getSpecifications(): readonly string[];
1769
+ /**
1770
+ * Adds a layer of your own at a Mountaya rank, so it lands where that kind of layer belongs.
1771
+ *
1772
+ * The escape hatch for content this package does not model: a highlight, a corridor, a
1773
+ * second itinerary drawn from a source you registered yourself. `map.raw.addLayer` also works
1774
+ * and puts the layer on top of everything including the labels; this puts it in the stack
1775
+ * and, just as importantly, records it here.
1776
+ *
1777
+ * **One registry is the point.** Anchoring reads the ranks of the layers already placed and
1778
+ * returns "on top" when it finds nothing ranked above. Two callers ordering against two
1779
+ * registries therefore each place correctly within their own set and wrongly against the
1780
+ * other's, and the result is an itinerary drawn under its own overlay, which renders as a
1781
+ * wrong-looking map rather than as an error, and is why this is offered instead of left to
1782
+ * `map.raw`. Layers added here are also queryable through {@link featuresAt}.
1783
+ *
1784
+ * Carried over a base-map switch as the map's own content is: the source the layer draws from
1785
+ * goes into the style {@link setStyle} or {@link setTerrain} brings in, where that style names
1786
+ * none under its id and it is none of the map's own, and the layer is drawn again on it at its
1787
+ * rank, hidden where it was hidden, as the style before held it, its edits included. A switch
1788
+ * carries the layers on the style as it is made: one added while it fetches its document goes
1789
+ * with the style still shown, as the next paragraph states, and is the caller's to add again
1790
+ * once the switch resolves. Adding an id already in the style re-ranks it instead of throwing,
1791
+ * so a caller replaying its own layers need not check first: the layer goes to the rank it is
1792
+ * added at, and stays where it is when that is the rank it has.
1793
+ *
1794
+ * On a map whose style has loaded the layer is placed in the step of the call, whether or not
1795
+ * that style's tiles have loaded. While a base-map switch fetches its document that style is
1796
+ * the one still shown, which the switch then replaces.
1797
+ *
1798
+ * Added before any style has loaded, the layer waits for the first that does. It is placed as
1799
+ * that style loads, ahead of the `styleload` that reports it, and `displaychange` is emitted
1800
+ * then. Of several adds of one id made while it waits the last is the one placed, and
1801
+ * {@link removeLayer} withdraws it. A layer the style refuses as it is placed from that wait is
1802
+ * reported on `error`, since no call is there to throw to.
1803
+ *
1804
+ * It waits the same way while MapLibre builds a style from scratch, which takes no layer
1805
+ * until it has loaded: a switch MapLibre cannot apply as a change to the style shown, and the
1806
+ * style it sets again as a lost WebGL context returns.
1807
+ */
1808
+ addLayer(layer: AddLayerObject, rank: LayerRank): void;
1809
+ /**
1810
+ * Removes a layer added by {@link addLayer}, and forgets its rank and visibility.
1811
+ *
1812
+ * A no-op for a layer that is already gone, which is what a caller needs in order to
1813
+ * resync this registry after removing something through `map.raw` or after a style swap
1814
+ * wiped it.
1815
+ *
1816
+ * A layer removed while the WebGL context is lost stays off the style the context brings
1817
+ * back, which holds every other layer it held as the context was lost.
1818
+ */
1819
+ removeLayer(id: string): void;
1820
+ /**
1821
+ * Merges an edit onto the paint and the layout of a layer the map places: one added by
1822
+ * {@link addLayer}, or one of a drawing of the map's own. Each property the edit states replaces
1823
+ * the one the layer holds, or is added where it held none, and the layer stays where it is
1824
+ * among the others.
1825
+ *
1826
+ * A property stated as `undefined` names nothing, and the layer keeps the value it holds, so a
1827
+ * caller forwards a value it may not have. One stated as `null` goes back to MapLibre's default
1828
+ * for it. `false`, `0` and the empty string are values like any other.
1829
+ *
1830
+ * A layer {@link addLayer} holds while no style can take it is placed with the edit. A layer the
1831
+ * map placed before its WebGL context was lost takes the edit as the context returns. A layer of
1832
+ * your own is carried over a base-map switch with its edits, as {@link addLayer} states; a
1833
+ * layer of a drawing of the map's own is drawn again from what the drawing asks for each time
1834
+ * the map draws it again, a base-map switch included, so the edit lasts until then. The base
1835
+ * map's own layers are the style's, and `map.raw` sets theirs.
1836
+ *
1837
+ * @example
1838
+ * ```ts
1839
+ * import { LayerRank, type MountayaMap } from "@mountaya/elements";
1840
+ *
1841
+ * declare const map: MountayaMap;
1842
+ *
1843
+ * map.addLayer(
1844
+ * { id: "corridor", paint: { "line-color": "#228be6" }, source: "corridor", type: "line" },
1845
+ * LayerRank.POI,
1846
+ * );
1847
+ * map.editLayer("corridor", { paint: { "line-color": "#e64980", "line-opacity": 0.8 } });
1848
+ * ```
1849
+ *
1850
+ * @throws {MountayaElementsError} When the edit's layout states a `visibility`:
1851
+ * {@link setLayerVisibility} shows and hides a layer. Nothing changes.
1852
+ * @throws {MountayaElementsNotFoundError} When the map places no layer under `id`. Nothing
1853
+ * changes.
1854
+ */
1855
+ editLayer(id: string, patch: LayerPatch): void;
1856
+ /**
1857
+ * Shows or hides Google's Street View coverage raster: where a panorama exists.
1858
+ *
1859
+ * What a pegman control turns on for the length of a drag, so the user can see where the
1860
+ * figure may be dropped before letting go. It bands at {@link LayerRank.STREETVIEW_COVERAGE},
1861
+ * a backdrop above terrain and generic overlays and beneath zones, POIs and itineraries,
1862
+ * so switching it on never hides the content the drop is aimed at.
1863
+ *
1864
+ * The tiles are keyless: coverage is served without a credential, and only the panorama
1865
+ * itself and the coverage lookup need a Maps key. So this draws with no key of yours and
1866
+ * none of this package's. Showing Google's coverage is subject to Google's terms, which are the
1867
+ * integrator's to meet.
1868
+ *
1869
+ * `raster-fade-duration` is pinned to 0, which is not a preference. A raster layer renders
1870
+ * to a per-tile texture draped onto the terrain mesh, and a draped raster honours its
1871
+ * fade-in, so over the default 300 ms ramp a coverage shown for the length of a drag can
1872
+ * finish fading up after the drag has ended, having painted nothing the user saw.
1873
+ *
1874
+ * **Not replayed across a style swap**, unlike the overlays this class draws and for the
1875
+ * same reason {@link addLayer} is not: this is transient, scoped to a gesture, and a
1876
+ * coverage that reappeared after a base-map switch the user made mid-drag would be a
1877
+ * decoration nobody asked for. Ask again after the swap.
1878
+ *
1879
+ * A lost WebGL context is no swap. A coverage shown as the context is lost is shown again as
1880
+ * it returns, one first shown while it is lost is placed on the style that returns, under the
1881
+ * paint it was asked for, and one hidden meanwhile stays off. Where a base-map switch waits
1882
+ * for the context too, a coverage asked for behind it is placed on the style the switch
1883
+ * brings in, as it is behind a switch made at once.
1884
+ *
1885
+ * `paint` merges over the defaults above, for the one thing a caller cannot do from the
1886
+ * outside: this layer is added and removed inside a deferred callback, so there is no
1887
+ * moment at which `setPaintProperty` can be called against it reliably. A surface that
1888
+ * tints its base map (a dark scheme rotating the raster's hue so keyless Google tiles do
1889
+ * not glare against it) has to state that as part of the request. Anything it does not
1890
+ * name keeps the default, so `raster-fade-duration` cannot be lost by accident.
1891
+ */
1892
+ setStreetviewCoverage(visible: boolean, paint?: RasterPaint): void;
1893
+ /**
1894
+ * placeStreetviewCoverage adds the Street View coverage's source and its layer to the style,
1895
+ * under `paint` over the defaults, and writes nothing where the coverage is shown already.
1896
+ */
1897
+ private placeStreetviewCoverage;
1898
+ /**
1899
+ * Draws routed directions between waypoints.
1900
+ *
1901
+ * A {@link clearDirections} made while the query is in flight cancels it, and this rejects
1902
+ * with the client's `AbortError`.
1903
+ */
1904
+ addDirections(input: DirectionsInput | DirectionsResult, options?: DrawOptions): Promise<AnalysisHandle<DirectionsResult>>;
1905
+ /**
1906
+ * Re-runs one directions result with `patch` merged onto the input it was drawn from. An empty
1907
+ * patch restyles it from the result held, asking nothing. A member the patch or the options
1908
+ * state as `undefined` leaves the one held.
1909
+ *
1910
+ * @throws {MountayaElementsNotFoundError} When nothing is drawn under `id`.
1911
+ * @throws {MountayaElementsError} When the patch names a field and the drawing was made from a
1912
+ * result handed over, which holds no input to merge the patch onto.
1913
+ */
1914
+ editDirections(id: AnalysisId, patch: Partial<DirectionsInput>, options?: DrawOptions): Promise<DirectionsResult>;
1915
+ /**
1916
+ * Removes one result, by the id {@link addDirections} answered, and cancels its query while it
1917
+ * is in flight. An id not drawn changes nothing.
1918
+ */
1919
+ removeDirections(id: AnalysisId): void;
1920
+ /**
1921
+ * Removes every directions result, and cancels the {@link addDirections} calls still waiting on
1922
+ * their query: each rejects with the client's `AbortError` and draws nothing.
1923
+ */
1924
+ clearDirections(): void;
1925
+ /**
1926
+ * Draws a set of suggested itineraries: the first solid, the rest dashed alternatives.
1927
+ *
1928
+ * A {@link clearSuggestions} made while the query is in flight cancels it, and this rejects
1929
+ * with the client's `AbortError`.
1930
+ */
1931
+ addSuggestions(input: SuggestionsInput | SuggestionsResult, options?: SuggestionDrawOptions): Promise<AnalysisHandle<SuggestionsResult>>;
1932
+ /**
1933
+ * Re-runs or restyles one suggestion set.
1934
+ *
1935
+ * `{ chosen: 2 }` alone redraws from the result already held rather than asking the API
1936
+ * again: picking a different candidate is a styling change, and re-running would both
1937
+ * cost a query and return a different set of itineraries, since suggestions are seeded.
1938
+ * A member the patch or the options state as `undefined` leaves the one held.
1939
+ *
1940
+ * @throws {MountayaElementsNotFoundError} When nothing is drawn under `id`.
1941
+ * @throws {MountayaElementsError} When the patch names a field and the drawing was made from a
1942
+ * result handed over, which holds no input to merge the patch onto.
1943
+ */
1944
+ editSuggestions(id: AnalysisId, patch?: Partial<SuggestionsInput>, options?: SuggestionDrawOptions): Promise<SuggestionsResult>;
1945
+ /**
1946
+ * Removes one result, by the id {@link addSuggestions} answered, and cancels its query while it
1947
+ * is in flight. An id not drawn changes nothing.
1948
+ */
1949
+ removeSuggestions(id: AnalysisId): void;
1950
+ /**
1951
+ * Removes every suggestion set, and cancels the {@link addSuggestions} calls still waiting on
1952
+ * their query: each rejects with the client's `AbortError` and draws nothing.
1953
+ */
1954
+ clearSuggestions(): void;
1955
+ /**
1956
+ * Draws reachability bands around one or more origins.
1957
+ *
1958
+ * A {@link clearIsochrones} made while the query is in flight cancels it, and this rejects
1959
+ * with the client's `AbortError`.
1960
+ */
1961
+ addIsochrones(input: IsochronesInput | IsochronesResult, options?: DrawOptions): Promise<AnalysisHandle<IsochronesResult>>;
1962
+ /**
1963
+ * Re-runs one isochrone set with `patch` merged onto the input it was drawn from. An empty
1964
+ * patch restyles it from the result held, asking nothing. A member the patch or the options
1965
+ * state as `undefined` leaves the one held.
1966
+ *
1967
+ * @throws {MountayaElementsNotFoundError} When nothing is drawn under `id`.
1968
+ * @throws {MountayaElementsError} When the patch names a field and the drawing was made from a
1969
+ * result handed over, which holds no input to merge the patch onto.
1970
+ */
1971
+ editIsochrones(id: AnalysisId, patch: Partial<IsochronesInput>, options?: DrawOptions): Promise<IsochronesResult>;
1972
+ /**
1973
+ * Removes one result, by the id {@link addIsochrones} answered, and cancels its query while it
1974
+ * is in flight. An id not drawn changes nothing.
1975
+ */
1976
+ removeIsochrones(id: AnalysisId): void;
1977
+ /**
1978
+ * Removes every isochrone set, and cancels the {@link addIsochrones} calls still waiting on their
1979
+ * query: each rejects with the client's `AbortError` and draws nothing.
1980
+ */
1981
+ clearIsochrones(): void;
1982
+ /**
1983
+ * Draws geocoding hits as labelled points.
1984
+ *
1985
+ * A {@link clearPlaces} made while the query is in flight cancels it, and this rejects with
1986
+ * the client's `AbortError`.
1987
+ */
1988
+ addPlaces(input: GeocodeInput | GeocodeResult, options?: DrawOptions): Promise<AnalysisHandle<GeocodeResult>>;
1989
+ /**
1990
+ * Re-runs one place search with `patch` merged onto the input it was drawn from. An empty patch
1991
+ * restyles it from the result held, asking nothing. A member the patch or the options state as
1992
+ * `undefined` leaves the one held.
1993
+ *
1994
+ * @throws {MountayaElementsNotFoundError} When nothing is drawn under `id`.
1995
+ * @throws {MountayaElementsError} When the patch names a field and the drawing was made from a
1996
+ * result handed over, which holds no input to merge the patch onto.
1997
+ */
1998
+ editPlaces(id: AnalysisId, patch: Partial<GeocodeInput>, options?: DrawOptions): Promise<GeocodeResult>;
1999
+ /**
2000
+ * Removes one result, by the id {@link addPlaces} answered, and cancels its query while it is in
2001
+ * flight. An id not drawn changes nothing.
2002
+ */
2003
+ removePlaces(id: AnalysisId): void;
2004
+ /**
2005
+ * Removes every place search result, and cancels the {@link addPlaces} calls still waiting on
2006
+ * their query: each rejects with the client's `AbortError` and draws nothing.
2007
+ */
2008
+ clearPlaces(): void;
2009
+ /**
2010
+ * Draws a time-distance matrix as connectors between its locations.
2011
+ *
2012
+ * The one method here that draws something the API did not return: a matrix answers grids
2013
+ * of numbers and no geometry at all, so the connectors are synthesised: a straight line
2014
+ * per solved pair, weighted by what the router said the journey costs. They are not
2015
+ * itineraries, and the features say so. The grid comes back in `result` either way.
2016
+ *
2017
+ * The input is always what is handed over, since the connectors run between its locations and
2018
+ * a result holds none. A result you already hold for that input rides in `options.result`:
2019
+ * the matrix is drawn from it and the client is asked nothing, where every other `add` takes
2020
+ * its result in place of the input. The input is kept either way, so {@link editMatrix} has
2021
+ * one to merge its patch onto.
2022
+ *
2023
+ * A {@link clearMatrix} made while the query is in flight cancels it, and this rejects with the
2024
+ * client's `AbortError`.
2025
+ *
2026
+ * @param input The matrix to solve: its locations, and the metrics to weigh each pair by.
2027
+ * @param options `fit` frames the matrix once it is drawn, and `result` is a result already
2028
+ * held for `input`, drawn with no query.
2029
+ * @returns The id the matrix is drawn under, and its result: the client's answer, or
2030
+ * `options.result` as it was handed over.
2031
+ * @throws {MountayaElementsError} When a result is handed over in place of the input. Nothing
2032
+ * is drawn or asked.
2033
+ */
2034
+ addMatrix(input: MatrixInput, options?: MatrixDrawOptions): Promise<AnalysisHandle<MatrixResult>>;
2035
+ /**
2036
+ * Re-runs one matrix with `patch` merged onto the input it was drawn from. An empty patch
2037
+ * restyles it from the result held, asking nothing. A member the patch or the options state as
2038
+ * `undefined` leaves the one held.
2039
+ *
2040
+ * A matrix always holds its input, one drawn from a result handed over in `options.result`
2041
+ * included, so a patch always has an input to merge onto, and the re-run asks the client.
2042
+ *
2043
+ * @throws {MountayaElementsNotFoundError} When nothing is drawn under `id`.
2044
+ */
2045
+ editMatrix(id: AnalysisId, patch: Partial<MatrixInput>, options?: DrawOptions): Promise<MatrixResult>;
2046
+ /**
2047
+ * Removes one result, by the id {@link addMatrix} answered, and cancels its query while it is in
2048
+ * flight. An id not drawn changes nothing.
2049
+ */
2050
+ removeMatrix(id: AnalysisId): void;
2051
+ /**
2052
+ * Removes every matrix, and cancels the {@link addMatrix} calls still waiting on their query:
2053
+ * each rejects with the client's `AbortError` and draws nothing.
2054
+ */
2055
+ clearMatrix(): void;
2056
+ /**
2057
+ * Draws the result of a points-of-interest query. One at a time, so this replaces.
2058
+ *
2059
+ * Distinct from `addEnrichment("pois")`, which draws the tiled POI overlay from the
2060
+ * layers manifest. That one is a base layer of everything nearby; this one is the answer
2061
+ * to a question you asked, and the two can be on at once.
2062
+ */
2063
+ setPointsOfInterest(input: PoisInput | PoisResult, options?: DrawOptions): Promise<PoisResult>;
2064
+ /**
2065
+ * Re-runs the POI query with `patch` merged onto the input it was drawn from. An empty patch
2066
+ * restyles it from the result held, asking nothing. A member the patch or the options state as
2067
+ * `undefined` leaves the one held.
2068
+ *
2069
+ * @throws {MountayaElementsNotFoundError} When no query result is drawn.
2070
+ * @throws {MountayaElementsError} When the patch names a field and the drawing was made from a
2071
+ * result handed over, which holds no input to merge the patch onto.
2072
+ */
2073
+ editPointsOfInterest(patch: Partial<PoisInput>, options?: DrawOptions): Promise<PoisResult>;
2074
+ /** Removes the points of interest drawn, and cancels their query while it is in flight. */
2075
+ clearPointsOfInterest(): void;
2076
+ /**
2077
+ * Draws one unsaved geometry, an itinerary being planned. `null` clears.
2078
+ *
2079
+ * A geometry is read by identity: the one drawn, handed again, is not sent to the
2080
+ * renderer again, so a recolour costs no re-tiling, and a geometry that moves is a new object.
2081
+ */
2082
+ setPreview(geometry: Geometry | null, options?: {
2083
+ readonly color?: string | undefined;
2084
+ }): void;
2085
+ /**
2086
+ * Changes the preview's geometry, its colour, or both, keeping whatever is not named.
2087
+ *
2088
+ * The colour case is the one worth having: recolouring an itinerary as it becomes valid, or as
2089
+ * the user picks a segment group, should not mean re-passing a geometry that has not
2090
+ * moved, and re-passing it would rebuild the source on every recolour.
2091
+ */
2092
+ editPreview(patch: {
2093
+ readonly geometry?: Geometry | undefined;
2094
+ readonly color?: string | undefined;
2095
+ }): void;
2096
+ /** Clears the unsaved geometry {@link setPreview} draws, as `setPreview(null)` does. */
2097
+ clearPreview(): void;
2098
+ /**
2099
+ * Draws one highlighted feature, the one a reader chose. `null` clears. A result picked from a
2100
+ * search is drawn by {@link setSearchHighlight}, apart from this one.
2101
+ *
2102
+ * A point, which is what a place or a point of interest is, is drawn as a circle. A line or an
2103
+ * area is drawn as the itinerary's own cased line, an area by its outline. Asked for before the
2104
+ * first style has loaded it is drawn once that style can take it, and asked for while a
2105
+ * base-map switch fetches its document it is drawn at once on the base map still shown, then
2106
+ * again on the style that arrives, as {@link setPreview} and {@link setEmphasis} are. The
2107
+ * feature's geometry is read by identity, as {@link setPreview} reads its own.
2108
+ */
2109
+ setHighlight(feature: Feature | null, options?: {
2110
+ readonly color?: string | undefined;
2111
+ }): void;
2112
+ /**
2113
+ * Changes the highlighted feature, its colour, or both, keeping whatever is not named. A new
2114
+ * colour reaches the drawn layers at once, with nothing rebuilt.
2115
+ */
2116
+ editHighlight(patch: {
2117
+ readonly feature?: Feature | undefined;
2118
+ readonly color?: string | undefined;
2119
+ }): void;
2120
+ /** Clears the geometry {@link setHighlight} draws, as `setHighlight(null)` does. */
2121
+ clearHighlight(): void;
2122
+ /**
2123
+ * Draws the result a reader picked from a search, above everything else on the map, in the
2124
+ * accent the map is drawn under (`--mtya-accent` at its container). `null` takes it down.
2125
+ *
2126
+ * A place is the point-of-interest pin carrying a point, or the map pin where the glyph set holds
2127
+ * no point; a point of interest is its category's own pin in its category's colour, the pin the
2128
+ * tiles draw it with, or a place's pin where it names no category `poiCategoryStyles` holds (one
2129
+ * the Data API names after this package was built); and a way is its line, haloed and cased,
2130
+ * with its two ends, else its extent washed and outlined dashed, across the antimeridian where
2131
+ * it crosses it, else a pin at its anchor. `pickTarget` from `@mountaya/elements/search`
2132
+ * answers what a pick marks.
2133
+ *
2134
+ * One is drawn at a time: a call replaces the result drawn before it, and one made before the
2135
+ * drawing of an earlier call has loaded leaves that drawing undrawn. The result is drawn again on
2136
+ * every base map a switch brings in, and apart from {@link setHighlight}, so lighting a feature
2137
+ * leaves the picked result where it is. The drawing is loaded the first time a result is drawn,
2138
+ * so a map that never draws one never loads it, and a failure to draw it is reported on `error`.
2139
+ */
2140
+ setSearchHighlight(payload: SearchHighlight | null): void;
2141
+ /**
2142
+ * Lights one stretch of what is already drawn: the leg a reader is pointing at.
2143
+ *
2144
+ * Its own slot rather than {@link setHighlight}'s, and that separation is the whole reason it
2145
+ * exists. Highlight belongs to a choice: a feature a reader chose stays lit while they decide
2146
+ * what to do with it. Emphasis belongs to the pointer, and it changes on every row a cursor
2147
+ * crosses. Sharing one slot means every hover over a table wipes out the search result the
2148
+ * reader was still looking at, which is not a conflict either caller can see coming.
2149
+ *
2150
+ * A geometry rather than a feature id, because the elements know the leg's own line and the
2151
+ * tiles it would have to be matched against may not have loaded, the same reason a segment's
2152
+ * span on the chart is measured from its geometry rather than found by projection.
2153
+ *
2154
+ * `null` clears. Drawn at the itinerary line's rank, so it sits over the route and under the
2155
+ * markers, and it is torn down with everything else on `destroy()`. The feature's geometry is
2156
+ * read by identity, as {@link setPreview} reads its own.
2157
+ */
2158
+ setEmphasis(feature: Feature | null, options?: {
2159
+ readonly color?: string | undefined;
2160
+ }): void;
2161
+ /** Clears the geometry {@link setEmphasis} draws, as `setEmphasis(null)` does. */
2162
+ clearEmphasis(): void;
2163
+ /**
2164
+ * What one geometry slot holds: the geometry it draws, `null` where it draws none, and the
2165
+ * colour it draws in. `"preview"` is what {@link setPreview} draws, `"highlight"` what
2166
+ * {@link setHighlight} draws and `"emphasis"` what {@link setEmphasis} draws.
2167
+ *
2168
+ * It answers the latest write of the slot from the step of the call, whether or not a style has
2169
+ * loaded to draw it on. A slot no call wrote, and one cleared, holds no geometry and its own
2170
+ * colour. The geometry is the one the write was handed, by identity, and a highlight or an
2171
+ * emphasis holds its feature's geometry.
2172
+ *
2173
+ * @param slot `"preview"`, `"highlight"` or `"emphasis"`.
2174
+ * @throws {MountayaElementsError} When `slot` is none of them.
2175
+ */
2176
+ getGeometry(slot: GeometrySlot): {
2177
+ readonly color: string;
2178
+ readonly geometry: Geometry | null;
2179
+ };
2180
+ /**
2181
+ * Pins a marker, on top of the markers already pinned. An id already in use is replaced, so
2182
+ * this is safe to call on every render.
2183
+ *
2184
+ * A `render` that throws is thrown from here, and changes nothing: no marker is pinned for a
2185
+ * new id, and the marker already pinned under an id in use stays as it was. So does a position
2186
+ * the renderer cannot hold. An altitude after the longitude and the latitude is ignored.
2187
+ *
2188
+ * @throws {MountayaElementsError} When `lngLat` is not two finite numbers with a latitude from
2189
+ * -90 to 90, alone or followed by an altitude. Nothing changes.
2190
+ * @throws What `render` throws, as thrown. Nothing changes.
2191
+ */
2192
+ addMarker(marker: MarkerOptions): void;
2193
+ /**
2194
+ * pinMarker draws the marker pinned under `id` once a change of the markers stands, and records
2195
+ * the markers as the change leaves them.
2196
+ *
2197
+ * The change was read before anything is drawn, and the element is built before anything is
2198
+ * taken off the map: a position refused, or a `render` that throws, leaves the marker pinned
2199
+ * under this id, and what it was built from, as they were. A marker that keeps its place takes
2200
+ * the place of the element it replaces among the others; any other is drawn on top of them.
2201
+ */
2202
+ private pinMarker;
2203
+ /**
2204
+ * Changes one marker, keeping whatever the patch does not name.
2205
+ *
2206
+ * A marker is rebuilt rather than mutated, because its glyph, colour and popup are baked
2207
+ * into the DOM element at construction. That is invisible to the caller: the id, and so
2208
+ * the identity, is what survives, and so does its place among the other markers.
2209
+ *
2210
+ * A member the patch states as `undefined` names nothing, and the marker keeps the one it
2211
+ * holds ({@link statedMembers}). {@link addMarker} under the same id replaces the marker
2212
+ * whole, which is how a glyph, a label or a handler is taken off one.
2213
+ *
2214
+ * @throws {MountayaElementsNotFoundError} When no marker is pinned under `id`.
2215
+ * @throws {MountayaElementsError} When the patch states a `lngLat` {@link addMarker} refuses.
2216
+ * The marker stays as it was.
2217
+ */
2218
+ editMarker(id: string, patch: Partial<Omit<MarkerOptions, "id">>): void;
2219
+ /**
2220
+ * Takes the marker pinned under `id` off the map and forgets what it was built from, so a
2221
+ * later {@link editMarker} of that id throws. An id nothing is pinned under is a no-op.
2222
+ */
2223
+ removeMarker(id: string): void;
2224
+ /** Removes every marker {@link addMarker} placed. */
2225
+ clearMarkers(): void;
2226
+ /**
2227
+ * The camera as it stands: its centre, zoom, bearing and pitch.
2228
+ *
2229
+ * Read off the renderer's own pose, which the renderer keeps once it is removed, so a
2230
+ * destroyed map answers the pose it ended on.
2231
+ */
2232
+ getCamera(): Camera;
2233
+ /**
2234
+ * The zoom window the camera is held to: the lowest zoom it may reach and the highest.
2235
+ *
2236
+ * The window the map is built with (its `constraints`, or a floor of -2 and a ceiling of 22
2237
+ * when it is given none), as `setConstraints` on the map, or on a client over it, last moved
2238
+ * it. `zoomlimitschange` tells each move. Read off the renderer, which keeps the window once
2239
+ * it is removed, so a destroyed map answers the window it ended on.
2240
+ */
2241
+ getZoomLimits(): {
2242
+ readonly max: number;
2243
+ readonly min: number;
2244
+ };
2245
+ /**
2246
+ * Moves the camera immediately, with no animation.
2247
+ *
2248
+ * A member the pose leaves out, or states as `undefined`, stays where the camera has it.
2249
+ *
2250
+ * @throws {MountayaElementsError} When a member the pose states is no finite number, and when
2251
+ * the centre's latitude lies past a pole. Nothing moves.
2252
+ */
2253
+ jumpTo(pose: CameraPose): void;
2254
+ /**
2255
+ * Moves the camera with the curved, zoom-out-and-in flight MapLibre calls a fly.
2256
+ *
2257
+ * A member the pose leaves out, or states as `undefined`, stays where the camera has it.
2258
+ *
2259
+ * @throws {MountayaElementsError} When a member the pose states is no finite number, and when
2260
+ * the centre's latitude lies past a pole. Nothing moves.
2261
+ */
2262
+ flyTo(pose: CameraPose): void;
2263
+ /**
2264
+ * Moves the camera with a straight ease. The default for a programmatic move.
2265
+ *
2266
+ * A member the pose leaves out, or states as `undefined`, stays where the camera has it.
2267
+ *
2268
+ * @throws {MountayaElementsError} When a member the pose states is no finite number, and when
2269
+ * the centre's latitude lies past a pole. Nothing moves.
2270
+ */
2271
+ easeTo(pose: CameraPose): void;
2272
+ /**
2273
+ * Moves the camera to frame a box, with the padding, zoom ceiling and duration `options` give.
2274
+ *
2275
+ * The camera lands where the contract's fit computes it, as `cameraForBounds` of
2276
+ * `@mountaya/elements/camera` answers it for the canvas and the zoom window the map holds:
2277
+ * facing north, at the highest zoom at which the box fits the canvas less its padding, held
2278
+ * under the ceiling and within the zoom window, and centred on the box moved by half the
2279
+ * difference of opposite paddings at that zoom. It flies there as MapLibre flies its own fit,
2280
+ * keeping the pitch. A member left out, or stated as `undefined`, takes its default: no padding,
2281
+ * the zoom window's ceiling, and the duration MapLibre gives the flight. A padding that leaves
2282
+ * the canvas no room to frame the box in moves nothing.
2283
+ *
2284
+ * A `BoundingBox` is read in canonical form ({@link normalizeBoundingBox}): a box drawn from its
2285
+ * north-east corner is framed the right way round, and a box that crosses the antimeridian,
2286
+ * written with its east edge past 180 as `boundsOf` writes it, is framed across the line rather
2287
+ * than up to it. Any other shape MapLibre takes for bounds is read by its corners as MapLibre
2288
+ * reads them, a south-west corner east of the north-east one across the antimeridian, then in
2289
+ * that form.
2290
+ *
2291
+ * @throws {MountayaElementsError} When `maxZoom` is no finite number, and when `duration`, or
2292
+ * `padding` on any side, is no finite number from 0 up. Nothing moves.
2293
+ */
2294
+ fitBounds(bounds: BoundingBox | LngLatBoundsLike, options?: FitBoundsOptions): void;
2295
+ /**
2296
+ * Eases the camera into the zoom range a specification paints over.
2297
+ *
2298
+ * A layer declares the zooms it draws at, and outside that window it paints nothing and
2299
+ * reports nothing: no error, no empty tile, just a map that did not change. Switching such an
2300
+ * overlay on from too far out therefore reads as a dead control rather than as a zoom
2301
+ * problem, and this is the move that answers it.
2302
+ *
2303
+ * The nearest bound is chosen, so the camera travels the shortest distance that makes the
2304
+ * content visible. A camera already inside the window is left alone, as is a window with
2305
+ * nothing in it (a specification with no layer, or a range whose maximum sits below its
2306
+ * minimum). A lurch to a zoom that satisfies neither bound would be worse than the blank the
2307
+ * caller can at least explain.
2308
+ *
2309
+ * Takes a whole specification or the bare window, because both are what a caller holds. A
2310
+ * specification's window is its LAYERS', from the lowest `zoom_min` to the highest
2311
+ * `zoom_max` ({@link paintZoomRange}): a source's own `zoom_max` is where its tiles stop being
2312
+ * served, and the map overzooms past it, so a camera at 18 over a source served to 15 is
2313
+ * inside a window whose layers draw to 22. A {@link ZoomRange} is what a caller reads off one
2314
+ * layer of the manifest, or off a layer of their own they placed with {@link addLayer}.
2315
+ *
2316
+ * `setOverlay` and `addEnrichment` already do this with the overlay they resolved. It is
2317
+ * public for the other direction: a specification you mounted yourself through
2318
+ * {@link setSpecification} carries the same windows and the same silence outside them.
2319
+ */
2320
+ easeIntoZoomRange(target: TileSpecification | ZoomRange): void;
2321
+ /**
2322
+ * Eases the camera one zoom level in from the zoom it stands at, unrounded and within the zoom
2323
+ * window the map holds. The centre, the bearing and the pitch stay.
2324
+ */
2325
+ zoomIn(): void;
2326
+ /**
2327
+ * Eases the camera one zoom level out from the zoom it stands at, unrounded and within the zoom
2328
+ * window the map holds. The centre, the bearing and the pitch stay.
2329
+ */
2330
+ zoomOut(): void;
2331
+ /**
2332
+ * Rotates back to north, and levels the pitch: what a compass control means by reset. The centre
2333
+ * and the zoom stay.
2334
+ */
2335
+ resetNorth(): void;
2336
+ /**
2337
+ * Sets the limits the camera may not leave: a zoom floor, a zoom ceiling and a pan lock. A
2338
+ * member left out keeps its current limit, and a member of `null` releases it: a `maxBounds`
2339
+ * of `null` lifts the lock, and a zoom limit of `null` goes back to the one a map is built
2340
+ * with when it is given none, a floor of -2 and a ceiling of 22.
2341
+ *
2342
+ * A `BoundingBox` lock is read in canonical form ({@link normalizeBoundingBox}), so a box that
2343
+ * crosses the antimeridian is locked across the line rather than cut at it. Any other shape
2344
+ * MapLibre takes for bounds is read as MapLibre reads it, corners in the order they are written,
2345
+ * so a pair whose west corner lies east of its east corner is locked across the line too.
2346
+ *
2347
+ * A lock a turn or more wide, of either kind, covers every longitude, and is handed to MapLibre
2348
+ * as the whole world a hair under a turn wide, centred on the lock, as
2349
+ * {@link maxBoundsLongitudes} writes it: MapLibre throws on a lock exactly a turn wide, whose
2350
+ * edges it wraps onto one meridian. Every narrower lock in MapLibre's own shapes is handed to
2351
+ * it as it is.
2352
+ *
2353
+ * A lock with no area is refused, and the call applies nothing, its zoom limits included: a
2354
+ * lock whose west and east edges are one meridian, or whose south and north edges are one
2355
+ * parallel, leaves the camera nowhere to stand, and MapLibre divides by that width and that
2356
+ * height. So is a lock with an edge at no finite coordinate, such as one holding NaN, and one
2357
+ * in MapLibre's own shapes that MapLibre cannot read, such as a corner past a pole. Each
2358
+ * refusal quotes the lock as it is written.
2359
+ *
2360
+ * A zoom window is applied whatever window is in place, a window above the current ceiling
2361
+ * included. One the map cannot hold is refused, and the call applies nothing, its lock
2362
+ * included: a limit that is no finite number, a floor under -2, and a floor above the ceiling,
2363
+ * the one stated beside it or the one the map holds when the floor is stated alone. A window
2364
+ * that moves is told as `zoomlimitschange`.
2365
+ *
2366
+ * @throws {MountayaElementsError} When `maxBounds` has no width, no height or an edge at no
2367
+ * finite coordinate, when MapLibre cannot read it, and when `zoom` names a window the map
2368
+ * cannot hold. Each refusal names what it refuses.
2369
+ */
2370
+ setConstraints(constraints: CameraConstraints): void;
2371
+ /**
2372
+ * Sets the language labels are drawn in.
2373
+ *
2374
+ * Applied to the live style and remembered, so it survives a `setTerrain`. The language is
2375
+ * read from a tag by `clampMapLanguage`, by its primary subtag, so `fr-CA` labels in French,
2376
+ * and a tag naming a language the tiles do not carry labels in English rather than throwing:
2377
+ * a map with English labels is a better answer to "ga-IE" than no map.
2378
+ */
2379
+ setLanguage(language: string): void;
2380
+ /**
2381
+ * The language labels are drawn in: the one {@link setLanguage} or the `language` option asked
2382
+ * for, as the tiles carry it.
2383
+ */
2384
+ getLanguage(): MapLanguage;
2385
+ /**
2386
+ * Reads the organization the map's client's publishable key belongs to, which the map's
2387
+ * watermark, its defaults and its accent are drawn from, as the hosted embed's are.
2388
+ *
2389
+ * The read is made once per key and shared with every map whose client holds that key, for as
2390
+ * long as the process lives: a read in flight is waited on and an answer is kept. It is
2391
+ * `postOrganizationLookup`, the key in its body and no credential sent. A read that fails is
2392
+ * kept by nobody, so the next load reads again, and one that reaches the client's own time
2393
+ * budget fails as any read does, so no load waits past one call's budget.
2394
+ *
2395
+ * @returns The organization.
2396
+ * @throws {MountayaElementsError} Where the client holds no publishable key, as one holding only
2397
+ * a share token, a secret key or a browser's cookies does, which reads nothing; and where the
2398
+ * map is closed holding no organization, or closes while the read is waiting.
2399
+ * @throws The read's own failure, where it fails or times out.
2400
+ */
2401
+ loadOrganization(): Promise<Organization>;
2402
+ /**
2403
+ * The organization the map's last load answered, or `null` before one did. A closed map keeps
2404
+ * the one it held.
2405
+ */
2406
+ getOrganization(): Organization | null;
2407
+ /**
2408
+ * The pixel a coordinate is drawn at, from the canvas's top-left corner. A destroyed map has
2409
+ * no projection, and answers `[NaN, NaN]`.
2410
+ */
2411
+ project(lngLat: [number, number]): [number, number];
2412
+ /**
2413
+ * The coordinate drawn at a pixel of the canvas. A destroyed map has no projection, and
2414
+ * answers `[NaN, NaN]`.
2415
+ */
2416
+ unproject(point: [number, number]): [number, number];
2417
+ /**
2418
+ * The features this map drew at a screen point, topmost first.
2419
+ *
2420
+ * Scoped to the layers this map added, in every band of {@link LayerRank}, never the whole
2421
+ * style. An unscoped `queryRenderedFeatures` answers base-map roads and landuse polygons too,
2422
+ * which is a confusing result for "what did I click on". Each feature is answered as a
2423
+ * {@link QueriedFeature}: its id, its properties, its geometry and the layer that drew it, once
2424
+ * for each layer that drew it.
2425
+ */
2426
+ featuresAt(point: [number, number]): QueriedFeature[];
2427
+ /** The POI features rendered at a screen point, as {@link featuresAt} answers them. */
2428
+ poisAt(point: [number, number]): QueriedFeature[];
2429
+ /** The zone features rendered at a screen point, as {@link featuresAt} answers them. */
2430
+ zonesAt(point: [number, number]): QueriedFeature[];
2431
+ /**
2432
+ * The itinerary features (routed lines and waypoints) rendered at a screen point, as
2433
+ * {@link featuresAt} answers them.
2434
+ */
2435
+ itinerariesAt(point: [number, number]): QueriedFeature[];
2436
+ /**
2437
+ * Ground elevation at a coordinate, in meters.
2438
+ *
2439
+ * Answered by the Data API through the injected client rather than read off the map: the
2440
+ * terrain raster a map renders is a shaded image, not a height field, so there is nothing
2441
+ * on the client to sample. `null` when the point falls outside DEM coverage.
2442
+ *
2443
+ * Selects the one field it reads. A terrain sample also carries slope, aspect, its octant,
2444
+ * a steepness band and a distance, and this method answers a number, so the default full
2445
+ * selection would spend five fields per call on values nothing here can reach.
2446
+ */
2447
+ elevationAt(lngLat: [number, number]): Promise<number | null>;
2448
+ /**
2449
+ * Full-text search across places, POIs, ways and the caller's own itineraries, collections
2450
+ * and zones.
2451
+ *
2452
+ * A pass-through to the Data API, holding nothing. It is here because a search box on a
2453
+ * map is a map concern and because the alternative is worse: a consumer already holding a
2454
+ * `MountayaMap` would otherwise thread the client through to the control that needs it,
2455
+ * for the one call that turns a query into somewhere to fly.
2456
+ *
2457
+ * No `select`, unlike {@link elevationAt}. That one reads a single field and a full
2458
+ * selection would spend four more per call; a search result is read whole (every target's
2459
+ * rows, their geometry and the per-target errors) by whatever renders it.
2460
+ *
2461
+ * `signal` aborts the request. A typeahead issues one per keystroke and needs the ones it
2462
+ * has already replaced to stop, so this is the parameter that makes the method usable
2463
+ * rather than a convenience on it.
2464
+ */
2465
+ search(input: SearchInput, options?: {
2466
+ readonly signal?: AbortSignal | undefined;
2467
+ }): Promise<SearchResult>;
2468
+ /**
2469
+ * Asks for the device location through the geolocation seam, and frames it: the camera fits the
2470
+ * box the fix's accuracy spans ({@link fitBounds}), at zoom 16 at most, so a coarse fix frames
2471
+ * the area it may be anywhere in and a precise one a street. A fix that states no accuracy, or
2472
+ * one that is no finite number from 0 up, is framed as its position alone, at that ceiling.
2473
+ *
2474
+ * It still THROWS on a refusal, where the seam answers one, and that asymmetry is the API
2475
+ * rather than an oversight: this method's contract is "the camera is now on the device", so
2476
+ * there is no coordinate to return when it is not. A caller that wants to branch on the reason
2477
+ * reads `geolocation.locate()` itself, which is what the editor's own `tryGeolocate` does.
2478
+ *
2479
+ * A destroyed map has no camera to put on the device, so it refuses without asking the seam:
2480
+ * a fix asked of a browser may prompt the reader, and nothing would follow the prompt.
2481
+ *
2482
+ * @throws {MountayaElementsError} When the seam refuses a fix, with its reason, and when the
2483
+ * map is destroyed.
2484
+ */
2485
+ locate(options?: GeolocationFixOptions): Promise<[number, number]>;
2486
+ /**
2487
+ * setLayerVisibility shows or hides one layer of a drawn overlay, by its manifest id.
2488
+ *
2489
+ * The unit here is a LAYER, not an overlay, and that is the whole reason it exists: a
2490
+ * points-of-interest overlay is one slug carrying a layer per category, so offering the
2491
+ * categories separately means addressing them separately. `setOverlay` is the wrong verb
2492
+ * (it swaps the whole slug), and removing the layer is worse: re-adding it refetches tiles
2493
+ * the browser already holds, so a category toggled twice flickers.
2494
+ *
2495
+ * The choice survives a base-map switch. `setStyle` wipes every layer and the replay
2496
+ * re-adds them at their manifest default, so a hidden layer would otherwise reappear the
2497
+ * next time the user changed terrain.
2498
+ *
2499
+ * A layer the style does not carry is ignored rather than throwing: a caller reading
2500
+ * category ids out of the manifest is naming layers that may not be mounted yet, and the
2501
+ * intent is recorded either way so it applies when they are.
2502
+ */
2503
+ setLayerVisibility(layerId: string, visible: boolean): void;
2504
+ /**
2505
+ * isLayerVisible reports whether a layer is shown, that is not hidden by
2506
+ * {@link setLayerVisibility}.
2507
+ *
2508
+ * Answers the INTENT, not the live style, so it stays correct across a base-map switch and
2509
+ * before the layer it names has mounted. A picker rendering its own checkboxes needs the
2510
+ * same answer the map will apply, not the one the style happens to hold this frame.
2511
+ */
2512
+ isLayerVisible(layerId: string): boolean;
2513
+ /**
2514
+ * The manifest concept keys currently drawn, in the order their layers were mounted.
2515
+ *
2516
+ * A `key` is the wire's stable, human-readable slug for a map concept (`"parking"`,
2517
+ * `"hillshade"`), and it MAY repeat across several layers of one overlay when a concept takes
2518
+ * more than one to draw, a fill plus its symbol being the usual case. The spec's own field
2519
+ * description says clients group and toggle by it, which is what makes this the unit a
2520
+ * picker should offer rather than the layer.
2521
+ *
2522
+ * Read from the desired set rather than the live style, for the same reason
2523
+ * {@link isLayerVisible} answers intent: a picker built while a style reload is in flight
2524
+ * must list what the map is going to draw, not the gap.
2525
+ *
2526
+ * `rank` narrows the answer to one band, which is what a picker for a KIND of content
2527
+ * needs. A points-of-interest control offering `drawnLayerKeys()` unfiltered lists the
2528
+ * hillshade and the slope overlay beside the mountain huts, because a drawn key is a drawn
2529
+ * key. A key is listed when ANY of its layers ranks there: a concept drawn as a fill plus
2530
+ * its label is one row, not two.
2531
+ *
2532
+ * The empty key names no concept, and is never listed: the wire gives it to a layer that
2533
+ * belongs to none, an itinerary's own lines among them.
2534
+ *
2535
+ * @returns The keys, as one frozen array per `rank` until the next `displaychange`.
2536
+ */
2537
+ drawnLayerKeys(rank?: LayerRank): readonly string[];
2538
+ /**
2539
+ * The ids of the drawn layers carrying one manifest key. Empty for a key nothing draws, and for
2540
+ * the empty key, which names no concept: a layer carrying it is no key's, and the empty key
2541
+ * reads as shown ({@link isKeyVisible}).
2542
+ *
2543
+ * @returns The ids, as one frozen array per `key` until the next `displaychange`.
2544
+ */
2545
+ layerIdsForKey(key: string): readonly string[];
2546
+ /**
2547
+ * drawnSpecifications answers the tile specifications the map's slots ask for, in the order
2548
+ * each slot was first asked for: the content the manifest's keys name. A slot drawn from a
2549
+ * feature collection built here carries no key.
2550
+ */
2551
+ private drawnSpecifications;
2552
+ /**
2553
+ * Shows or hides every layer drawing one manifest concept.
2554
+ *
2555
+ * The form a picker wants. Toggling a concept that takes a fill AND a symbol through
2556
+ * {@link setLayerVisibility} means finding both ids and remembering that missing one leaves
2557
+ * a half-drawn feature (labels floating over nothing) rather than a hidden one.
2558
+ */
2559
+ setKeyVisibility(key: string, visible: boolean): void;
2560
+ /**
2561
+ * Whether a concept is shown. A key drawing nothing reads as visible, matching
2562
+ * {@link isLayerVisible}: nothing has been hidden, so nothing is.
2563
+ */
2564
+ isKeyVisible(key: string): boolean;
2565
+ /**
2566
+ * Shows or hides the restricted stretches of every itinerary the map draws: the stripes over
2567
+ * each stretch of a route that follows a way restricting who may pass, and the warning icon of
2568
+ * its kind. They are shown until a host hides them.
2569
+ *
2570
+ * The choice stands for every itinerary drawn from here on and across a base-map switch, and a
2571
+ * stretch's layers stay in the style while hidden, so showing them again fetches nothing. A
2572
+ * layer hidden by id ({@link setLayerVisibility}) stays hidden either way. An unchanged value is
2573
+ * a no-op.
2574
+ *
2575
+ * @param visible Whether the stretches are shown.
2576
+ */
2577
+ setAccessRestrictionsVisibility(visible: boolean): void;
2578
+ /** Whether the map shows the restricted stretches of the itineraries it draws. */
2579
+ isAccessRestrictionsVisible(): boolean;
2580
+ /**
2581
+ * Loads the layers manifest: every terrain, overlay and enrichment this credential may draw in
2582
+ * the studio scope {@link setLayersOrganization} names. {@link getLayers} answers the one
2583
+ * already loaded, with no read.
2584
+ *
2585
+ * It is the Tile API's own catalog, read under the `tiles` scope the tiles themselves need, so
2586
+ * a key that draws tiles draws a map from it. Under a publishable key or a share token it lists
2587
+ * only the overlays the organization's allowlist admits.
2588
+ *
2589
+ * Read through the client once, then held for the life of the scope and shared: `setTerrain`,
2590
+ * `setOverlay` and `addEnrichment` all resolve their slugs through it, so a map that switches
2591
+ * base maps reads the catalogue once. A caller building their own picker wants the same
2592
+ * object, which is why it is public and why every method here takes a slug. Each read that
2593
+ * lands is told as `layerschange`.
2594
+ *
2595
+ * A read that fails rejects every reader waiting on it, and is not kept: the next call reads
2596
+ * again. Kept, one failed read would fail every later `setTerrain`, `setOverlay` and
2597
+ * `addEnrichment` on the map, and every caller that retried would be handed the same rejection.
2598
+ *
2599
+ * A read that lands after the scope moved is another scope's catalogue: it is kept by nobody,
2600
+ * told to nobody, and every reader waiting on it is answered the current scope's instead.
2601
+ *
2602
+ * A destroyed map reads nothing more: it answers the manifest it holds, and refuses where it
2603
+ * holds none.
2604
+ *
2605
+ * @throws {MountayaElementsError} When the map is destroyed and holds no manifest, as the
2606
+ * promise's rejection.
2607
+ */
2608
+ loadLayers(): Promise<Layers>;
2609
+ /**
2610
+ * The layers manifest if it has already resolved, and `undefined` if it has not.
2611
+ *
2612
+ * **It never fetches.** Nothing read yet answers `undefined`, and the caller decides whether
2613
+ * that is a reason to wait on {@link loadLayers} or a reason to render nothing for now, the same
2614
+ * contract `StudioCache.get` states, so the two "read what is already held" surfaces in this
2615
+ * family read the same way.
2616
+ *
2617
+ * The reason it exists is the second mount rather than the first. A surface that mounts a
2618
+ * picker, unmounts it and mounts it again would otherwise render once with no catalogue every
2619
+ * time, because a promise resolves a microtask later however long its value has been in
2620
+ * memory. A studio opening and closing panels does that repeatedly, and the flash of an empty
2621
+ * overlay list reads as a bug rather than as a load.
2622
+ */
2623
+ getLayers(): Layers | undefined;
2624
+ /**
2625
+ * Names the studio scope the layers manifest is read for: an organization, sent as
2626
+ * `organization_id`, or null for the read that names none.
2627
+ *
2628
+ * Every tile URL the manifest hands out for a named scope names it too, an overlay's and the
2629
+ * itinerary and zone layers' alike, and the Tile API draws each tile in that scope alone. Under
2630
+ * a person's own session (Mountaya's console) that is the overlays the scope draws, and the
2631
+ * itineraries and zones the scope holds: the person's own when none is named, an
2632
+ * organization's when it is, never another space's. So a manifest read for one scope is no
2633
+ * catalogue for another. Under a publishable key or a share token the scope may name only the
2634
+ * credential's own organization, and the manifest is that organization's allowlist whether it
2635
+ * is named or not. Moving the scope drops the manifest held, which {@link getLayers} then
2636
+ * answers as undefined and `layerschange` tells, and the next {@link loadLayers} reads it for
2637
+ * the new scope. A read still out for the scope before is dropped as it lands. Naming the scope
2638
+ * the map already reads for, or an empty string where none is named, changes nothing.
2639
+ *
2640
+ * What the map already draws stays drawn: an overlay, an itinerary layer or a zone layer keeps
2641
+ * the tile URLs of the scope it was resolved in, so a caller redraws what it still wants once
2642
+ * the new manifest has landed.
2643
+ *
2644
+ * @param organizationId The organization whose scope the manifest is read for, or null for
2645
+ * the read that names none.
2646
+ */
2647
+ setLayersOrganization(organizationId: string | null): void;
2648
+ /**
2649
+ * Whether a refusal of access stands now: true from the first refusal `accessrequired` reports
2650
+ * until `accessrestored` reports the last of them over, and false otherwise.
2651
+ *
2652
+ * It is the standing answer the two events report the changes of. The map keeps it from its
2653
+ * construction, listened to or not, since the first refusal can land before a host has attached
2654
+ * a handler: read it once as you start listening, then follow the two events. It is already true
2655
+ * as `accessrequired` is told, and already false as `accessrestored` is. A destroyed map answers
2656
+ * what it ended on.
2657
+ */
2658
+ isAccessRequired(): boolean;
2659
+ /**
2660
+ * Resolves once the map is ready to take sources and layers, and at once for a destroyed map,
2661
+ * which is waiting on no style.
2662
+ */
2663
+ whenReady(): Promise<void>;
2664
+ /**
2665
+ * Subscribes to a map event. Returns the unsubscribe, so a caller never has to keep the
2666
+ * handler around to detach it, the mistake that leaks listeners in every React codebase.
2667
+ *
2668
+ * Every handler of an event is told, in the order they subscribed. One that throws stops
2669
+ * neither the handlers after it nor the call that reported the event: the first error of a
2670
+ * round is thrown again on a microtask, where the page's own handling of an uncaught error
2671
+ * sees it.
2672
+ *
2673
+ * @param event The event, such as `"moveend"`, `"click"` or `"styleload"`.
2674
+ * @param handler Called with the event's payload.
2675
+ * @returns An unsubscribe that detaches this handler and no other.
2676
+ */
2677
+ on<E extends MountayaMapEvent>(event: E, handler: (payload: MountayaMapEvents[E]) => void): Unsubscribe;
2678
+ /**
2679
+ * Tears the map down. Idempotent: calling it twice is not an error.
2680
+ *
2681
+ * A call still in flight draws nothing once it resumes: a specification being fetched, a Data
2682
+ * API query an add or an edit is waiting on, a terrain switch still reading the manifest, and
2683
+ * a call that has its answer and is waiting on the style to load. Each resolves as a
2684
+ * superseded one does, and none reaches the renderer that was removed. A hit-test waiting on
2685
+ * its animation frame is dropped with them.
2686
+ *
2687
+ * **From here on the map is inert.** No method reaches the renderer, throws, or is left
2688
+ * pending, and none reads through the client for a drawing nobody will see:
2689
+ *
2690
+ * - A `set`, an `add` of an overlay or a specification, a toggle and a base-map switch resolve
2691
+ * at once, {@link setItinerary} with `{ drawn: false }`.
2692
+ * - Every `clear`, `remove`, `edit` of a marker or a slot, camera move and visibility write
2693
+ * does nothing.
2694
+ * - A getter keeps answering what the map showed as it was destroyed: its language, the slots
2695
+ * it had drawn, the layers it had hidden, and its camera, which {@link getCamera} reads off
2696
+ * the pose the renderer ended on. {@link featuresAt} and its siblings answer no feature, and
2697
+ * {@link project} and {@link unproject} `[NaN, NaN]`.
2698
+ * - No event is emitted, and {@link on} attaches nothing.
2699
+ *
2700
+ * What stays is what never was the renderer's. {@link elevationAt} and {@link search} read
2701
+ * through the client as before. A Data API `add` handed an input, and an `edit` that changes a
2702
+ * query, still ask the client, since the result they resolve to is the query's own, and they
2703
+ * draw and record nothing. {@link loadLayers} reads no manifest: it answers the one the map
2704
+ * holds, and rejects where it holds none. {@link locate} rejects without asking the device,
2705
+ * having no camera to move.
2706
+ */
2707
+ destroy(): void;
2708
+ /**
2709
+ * buildTransformRequest derives MapLibre's credential hook from the injected client.
2710
+ *
2711
+ * Reading it off the client rather than asking for it again is what keeps one credential
2712
+ * in one place. The client's own projection refuses to hand over a secret key, so a map
2713
+ * built from a server-side client authenticates as nobody rather than leaking one.
2714
+ *
2715
+ * All three values come off the same transport for that reason: the credential, the
2716
+ * origin allowed to receive it, and the language the labels are rendered in. A tile's
2717
+ * server-rendered legend and a validation sentence from the REST call beside it then
2718
+ * arrive in one language rather than two, which is not something a caller can fix from
2719
+ * outside, because the map is what talks to MapLibre.
2720
+ *
2721
+ * The client's session token is read off `mapCredential` on every request the transform
2722
+ * claims, so a client holding its token as a function sends each new tile, sprite and glyph
2723
+ * request with the token current at that request, as its REST calls do. The rest of the
2724
+ * projection is read once, here: it is the client's credential, which a client holds for its
2725
+ * life. An explicit `credential` option is the caller's, and its own function, if it holds
2726
+ * one, is what is read per request.
2727
+ *
2728
+ * MapLibre is handed the transform through {@link sentCredentials}, which keeps the credential
2729
+ * each request it claims leaves with, so a refusal of a credential the map has replaced since is
2730
+ * told to nobody.
2731
+ *
2732
+ * @throws {MountayaElementsError} When the `credential` option holds a key or a token that
2733
+ * cannot be sent, and when the client's Tile API address names no place a request can be
2734
+ * matched against, whose refusal by the transform is the `cause`.
2735
+ */
2736
+ private buildTransformRequest;
2737
+ private bindMapEvents;
2738
+ /**
2739
+ * onceDispatched runs `report` for a click or a right-click once every listener of the gesture
2740
+ * has run, unless one of them took it or the map was destroyed meanwhile.
2741
+ *
2742
+ * MapLibre calls every listener of an event whatever one of them prevents, in the order they
2743
+ * were attached, and this map's own are attached first, as it is built. An edit engine that
2744
+ * handles a click marks it with `preventDefault` from a listener attached later, so the mark
2745
+ * is readable only after the dispatch: a microtask later, which is still inside the task the
2746
+ * reader's gesture arrived in.
2747
+ */
2748
+ private onceDispatched;
2749
+ /**
2750
+ * reportFeatureHover runs the one hit-test a frame's pointer moves asked for, at the position
2751
+ * the pointer ended the frame on, and tells the `featurehover` listeners what it found.
2752
+ *
2753
+ * It asks about the itinerary's layers alone ({@link itinerariesAt}): the routed lines and the
2754
+ * waypoints are what a hover follows, and a query across every ranked layer the map holds, the
2755
+ * overlays and the points of interest among them, would cost each frame a hit-test over
2756
+ * layers no listener reads. A listener that ended before the frame arrived is told nothing.
2757
+ */
2758
+ private reportFeatureHover;
2759
+ /**
2760
+ * refusalHeard tells a refusal of access one of the map's own requests met, and answers whether
2761
+ * it told it.
2762
+ *
2763
+ * A refusal of a credential the map has replaced since ({@link refusesSupersededCredential}) is
2764
+ * told to nobody and starts no standing refusal, whatever stands already. Every other refusal
2765
+ * stands for its source, or for none, and is told as `accessrequired`.
2766
+ *
2767
+ * @param status The refusal's status.
2768
+ * @param url The address refused, as the refusal is told with it.
2769
+ * @param source The source whose tile was refused, or null for a request that names none.
2770
+ * @param superseded Whether the request left under a credential other than the one the map
2771
+ * sends now.
2772
+ * @returns Whether the refusal was told.
2773
+ */
2774
+ private refusalHeard;
2775
+ /**
2776
+ * answerAccess moves the refusals of access that stand by what the map heard, and tells
2777
+ * `accessrestored` where that ended the last of them. The source a tile belongs to is read off the
2778
+ * style as the answer arrives, so a source that left the style takes its refusal with it.
2779
+ */
2780
+ private answerAccess;
2781
+ /** cancelFeatureHover drops the hit-test waiting on its frame and the position it would read. */
2782
+ private cancelFeatureHover;
2783
+ /**
2784
+ * reportBaseMapFailure tells the map's listeners that the base map the constructor asked for
2785
+ * did not arrive.
2786
+ *
2787
+ * A refusal of access is the layers manifest's, the one read on that path the API answers with
2788
+ * a status, and it is reported as `accessrequired` with the manifest's address, as a refused
2789
+ * tile is with its own. Every other failure (the manifest unreachable, a terrain it does not
2790
+ * list, a style that does not parse) is reported as `error`.
2791
+ */
2792
+ private reportBaseMapFailure;
2793
+ /**
2794
+ * applyConstraints hands MapLibre the limits a call names: a zoom window already read against
2795
+ * the one the map holds ({@link readZoomLimits}), and a pan lock already written as
2796
+ * `setMaxBounds` takes it, or `null` to lift the lock. A limit left `undefined` keeps its
2797
+ * current value.
2798
+ *
2799
+ * The window is written far limit first. MapLibre refuses a floor above the ceiling it holds,
2800
+ * so a window above the current one has its ceiling raised before its floor.
2801
+ */
2802
+ /**
2803
+ * collapseCredits closes the compact credit line the first time the renderer opens it, so a
2804
+ * map built with `compactAttribution: "collapsed"` shows the button alone from the start.
2805
+ *
2806
+ * The renderer opens a compact credit line as it compacts it, and closes it at the reader's
2807
+ * first drag: there is no option for a line closed from the start. It compacts the line as the
2808
+ * control is added, or, while the style has stated no credit yet, as the first credit arrives
2809
+ * with the style or a source, so the line is closed at once where it is open already and
2810
+ * otherwise in the step that opens it, after the control's own listener. Once closed, the
2811
+ * button is the reader's: a line they open stays open.
2812
+ */
2813
+ private collapseCredits;
2814
+ private applyConstraints;
2815
+ /**
2816
+ * placeLayer puts a layer in the style at a rank, or moves one already there to it, and
2817
+ * answers whether anything moved. {@link addLayer} is this with the change reported.
2818
+ */
2819
+ private placeLayer;
2820
+ /**
2821
+ * placePendingLayers places the layers of the caller's own that waited for a style
2822
+ * ({@link pendingLayers}), in the order each was last asked for, and reports one change for
2823
+ * all of them.
2824
+ *
2825
+ * It runs as a style loads, inside the renderer's own dispatch and with no call of the
2826
+ * caller's on the stack. A layer the style refuses is reported on `error`, and the layers
2827
+ * after it are placed all the same. A layer {@link editLayer} edited while it waited is placed,
2828
+ * then edited.
2829
+ */
2830
+ private placePendingLayers;
2831
+ /**
2832
+ * ownLayersCarrier answers the `transformStyle` a base-map switch hands MapLibre to carry the
2833
+ * layers of the caller's own over to the style it brings in, or undefined where it has none to
2834
+ * carry: no such layer is on the style as the switch is made, and none an earlier switch carried
2835
+ * waits to be placed again.
2836
+ *
2837
+ * The switch carries the layers it finds as it is made, so one added while it fetches its
2838
+ * document is left to the caller ({@link addLayer}), and one removed meanwhile is not carried.
2839
+ * The hook reads the layers off the style the switch leaves as the style it asked for lands, and
2840
+ * writes the sources they draw from into that style ({@link carryOwnLayers}). The layers
2841
+ * themselves are placed again as the style's content is drawn again ({@link placeCarriedLayers}).
2842
+ */
2843
+ private ownLayersCarrier;
2844
+ /**
2845
+ * drawnSources answers the sources the map draws itself: every slot's, on the style or held aside
2846
+ * while a switch fetches its document, and the Street View coverage's.
2847
+ */
2848
+ private drawnSources;
2849
+ /**
2850
+ * placeCarriedLayers places again the layers of the caller's own a base-map switch carried over,
2851
+ * each at the rank it was added at and hidden where it was hidden, once the content they may draw
2852
+ * from is drawn again. A layer whose source the style does not hold is left off, and one the style
2853
+ * refuses is reported on `error`, since no call is there to throw to.
2854
+ */
2855
+ private placeCarriedLayers;
2856
+ /**
2857
+ * dropLayer takes a layer off the style and forgets its rank and visibility, and answers
2858
+ * whether there was anything to take or forget. {@link removeLayer} is this with the change
2859
+ * reported.
2860
+ */
2861
+ private dropLayer;
2862
+ /**
2863
+ * reportDisplayChange tells the `displaychange` listeners, having dropped what the list
2864
+ * getters last answered ({@link displayAnswers}) so a handler reads the change.
2865
+ */
2866
+ private reportDisplayChange;
2867
+ /**
2868
+ * displayAnswer answers a list getter with the array it last answered, and reads and keeps
2869
+ * the list when a `displaychange` has dropped it. The array is frozen, since every reader
2870
+ * between two changes holds the same one.
2871
+ */
2872
+ private displayAnswer;
2873
+ /**
2874
+ * writeLayerVisibility records whether one layer is hidden and writes it to the style, and
2875
+ * answers whether the record changed.
2876
+ */
2877
+ private writeLayerVisibility;
2878
+ /**
2879
+ * writeLayerPatch writes an edit onto a layer the style holds: each paint and layout property it
2880
+ * states, as it states it.
2881
+ */
2882
+ private writeLayerPatch;
2883
+ /** dropMarkers takes every marker off the map and forgets what each was built from. */
2884
+ private dropMarkers;
2885
+ /**
2886
+ * listening reports whether anyone is subscribed, so a handler can skip the WORK of
2887
+ * building a payload rather than only the delivery of it.
2888
+ *
2889
+ * `emit` already drops an event with no listeners, which is enough when the payload is a
2890
+ * couple of coordinates. It is not enough when the payload costs a hit-test across every
2891
+ * layer on the map: arguments are evaluated before the call, so the expensive part has
2892
+ * already run by the time `emit` decides nobody wanted it.
2893
+ */
2894
+ private listening;
2895
+ /**
2896
+ * emit tells every listener of an event, in the order they subscribed.
2897
+ *
2898
+ * A listener that throws stops neither the listeners after it nor whatever told them: several
2899
+ * events are told from inside a command, and a throw that left through it would become the
2900
+ * command's outcome and stop it part-way. The first fault of a round is handed to the runtime
2901
+ * as an uncaught error on a microtask, once every listener is told ({@link notifyListeners}).
2902
+ * A listener that unsubscribes while it is told, the common case for a once-only one, changes
2903
+ * the round for nobody.
2904
+ */
2905
+ private emit;
2906
+ /**
2907
+ * whenStyleLoaded resolves once the style is ready to take sources and layers.
2908
+ *
2909
+ * Delegated to the event engine rather than waiting on `style.load` directly, because
2910
+ * `style.load` fires only on a full (re)load. A source whose tiles are still settling
2911
+ * drops `isStyleLoaded()` to false without a restyle, and a bare `once("style.load")`
2912
+ * would park there forever; the engine falls through to `idle` in exactly that case.
2913
+ */
2914
+ private whenStyleLoaded;
2915
+ /**
2916
+ * whenStyleTakes is {@link whenReady} for a mount: it resolves once the style can take the
2917
+ * mount's layers, and at once when the mount is withdrawn from its slot meanwhile
2918
+ * ({@link SlotRequestEngine.withdrawMount}, {@link unmount}).
2919
+ *
2920
+ * @param pending The mount that waits, which holds the way to end this wait until it ends.
2921
+ * @returns Whether the style ended the wait, which a wait that was not needed counts as. False
2922
+ * when a withdrawal ended it, with the style still to load.
2923
+ */
2924
+ private whenStyleTakes;
2925
+ /**
2926
+ * hasNoStyleToWriteTo reports whether a swap is on its way and the style on the map does not
2927
+ * report loaded, so a mount waits for the swap to end.
2928
+ *
2929
+ * That is the case once MapLibre has dropped the style before the swap, where a source or a
2930
+ * layer has nothing to be added to until the swap's own style loads. It is also the case while
2931
+ * the style before the swap is whole and its tiles, or a source just added, are still loading:
2932
+ * `isStyleLoaded()` answers false for both, and a mount waits in both.
2933
+ *
2934
+ * Narrower than "a swap is on its way", on purpose. MapLibre keeps the style it has while it
2935
+ * fetches the document of the next: a write made once that style reports loaded lands, is
2936
+ * wiped as the document arrives, and is drawn again by the replay. Waiting there as well would
2937
+ * tie every mount to a reload that a document equal to the style shown never ends.
2938
+ */
2939
+ private hasNoStyleToWriteTo;
2940
+ /**
2941
+ * setSlot resolves a Renderable to a specification and mounts it into one slot, and resolves
2942
+ * whether it drew. A load a later request for the slot superseded, or a clear, draws nothing
2943
+ * ({@link SlotRequestEngine}), and so does a clear itself and any call on a destroyed map.
2944
+ *
2945
+ * `signal` withdraws the call: it is handed to the read, and an abort made before the content
2946
+ * is drawn rejects with the signal's reason, the slot going back to the request the call
2947
+ * superseded ({@link SlotRequestEngine.giveBack}).
2948
+ *
2949
+ * `onDrawn` is called in the step the content reaches the map ({@link mount}), which is where
2950
+ * a call frames what it drew: a step later another request may hold the slot.
2951
+ */
2952
+ private setSlot;
2953
+ /**
2954
+ * itineraryBounds reads one itinerary through the client and answers the box its geometry
2955
+ * spans, as {@link fitBounds} takes it.
2956
+ *
2957
+ * @param id The itinerary's id.
2958
+ * @param signal The call's own signal, handed to the read.
2959
+ * @returns The box, or null when no segment of the itinerary holds geometry yet.
2960
+ */
2961
+ private itineraryBounds;
2962
+ /**
2963
+ * toggleSlot draws or clears a slot whose content needs no id. A load switched off, or
2964
+ * superseded, while it was in flight draws nothing ({@link SlotRequestEngine}).
2965
+ */
2966
+ private toggleSlot;
2967
+ /**
2968
+ * reportSlotChange emits `displaychange` when what a tile slot asks for changed. A slot
2969
+ * restating the sources it already holds changed nothing, and a GeoJSON slot (a preview, a
2970
+ * highlight, an emphasis, a Data API result) is not reported: it moves with the pointer, and
2971
+ * none of the display getters reads it.
2972
+ */
2973
+ private reportSlotChange;
2974
+ /**
2975
+ * mount records what a slot wants drawn and draws it, replacing whatever it held, and resolves
2976
+ * whether it drew.
2977
+ *
2978
+ * The one place intent becomes live layers, for both kinds. Recording BEFORE drawing is
2979
+ * what makes the replay complete: a slot is in `desired` from the moment it is asked for,
2980
+ * so a `setTerrain` that lands mid-flight still replays it.
2981
+ *
2982
+ * `claim` is the request the content was loaded under, when a load came first; a mount with no
2983
+ * load behind it is a request of its own, and reports the one change it makes from what the slot
2984
+ * asked for before it. A later request for the slot, or a clear, made while the style loads
2985
+ * supersedes it: it draws nothing, and the replay does not draw it either, since the slot has
2986
+ * asked again for what it held before ({@link SlotRequestEngine.pending}). It resolves as it is
2987
+ * superseded, with the style still to load.
2988
+ *
2989
+ * `onDrawn` is called once, in the step the content reaches the style and ahead of the
2990
+ * caller's own `onMounted` hook. A replay calls nothing: it draws what a mount already drew.
2991
+ */
2992
+ private mount;
2993
+ /**
2994
+ * mountedSpecification describes what a slot has just drawn, for the caller's hook.
2995
+ *
2996
+ * Read back out of `mounted` rather than assembled from the specification: those are the
2997
+ * ids that actually reached the style, which is what a companion layer has to anchor
2998
+ * against. A GeoJSON slot has no specification to report and never carries a hook, so this
2999
+ * is only ever asked about a tile one.
3000
+ */
3001
+ private mountedSpecification;
3002
+ /**
3003
+ * draw renders one desired entry, dispatching on its kind. The only place that branches.
3004
+ *
3005
+ * `live` is what the slot has on the style, which a GeoJSON slot is written onto in place
3006
+ * ({@link applyGeoJson}). A tile slot is drawn afresh, its caller having taken the old one off.
3007
+ */
3008
+ private draw;
3009
+ /**
3010
+ * stampedSpecification answers the specification a tile slot is drawn from: its own, with the
3011
+ * addresses of the classic overlay the server stamps carrying the instant pinned, as
3012
+ * `timestampedSources` of `@mountaya/elements/layers` stamps them. With none pinned, and for every
3013
+ * other slot, it is the slot's own specification, the manifest's addresses as written.
3014
+ */
3015
+ private stampedSpecification;
3016
+ /**
3017
+ * applyRanked adds a specification with every layer at its deterministic rank.
3018
+ *
3019
+ * The rank is recorded from inside the anchor callback, which runs immediately before
3020
+ * each `addLayer`. That ordering is load-bearing and subtle enough to state: a
3021
+ * specification whose layers are listed points-first would otherwise place the line above
3022
+ * the points, because the resolver would not yet know the points are ours. Recording
3023
+ * early is safe because `beforeIdForRank` only consults ids that are in the LIVE style,
3024
+ * and a layer being added is not yet one of them.
3025
+ */
3026
+ private applyRanked;
3027
+ /**
3028
+ * applyGeoJson stands one feature collection up as a source plus its layers, all at one
3029
+ * rank, or brings what the slot has already drawn in line with it.
3030
+ *
3031
+ * One rank for the whole set, unlike a tile specification whose layers rank individually:
3032
+ * these are this map's own layers over its own source, so their order among themselves is the
3033
+ * order they are listed in, and the rank places the group relative to everything else.
3034
+ *
3035
+ * A slot that is drawn is written in place. Its source takes the new collection through
3036
+ * `setData` when the collection changed, a layer whose paint changed takes each changed
3037
+ * property through `setPaintProperty`, and a layer the entry no longer lists is removed, so a
3038
+ * preview that moves with the pointer and a line that changes colour rebuild nothing. A layer
3039
+ * that differs in more than its paint is rebuilt at its rank.
3040
+ *
3041
+ * @param desired What the slot wants drawn.
3042
+ * @param live What the slot has on the style, or undefined when it has nothing.
3043
+ * @returns What the slot has on the style from here on.
3044
+ */
3045
+ private applyGeoJson;
3046
+ /**
3047
+ * repaint writes onto a live layer each paint property that changed between two
3048
+ * specifications of it, and none that did not.
3049
+ */
3050
+ private repaint;
3051
+ /**
3052
+ * unmount takes a slot's layers off the map. A removal, one that does not keep the slot's intent
3053
+ * for a re-mount, also supersedes every load and mount still in flight for the slot, so none of
3054
+ * them draws once it lands ({@link SlotRequestEngine}, {@link SlotRequestEngine.pending}), and
3055
+ * each is answered as the slot is cleared.
3056
+ */
3057
+ private unmount;
3058
+ /**
3059
+ * addAnalysis runs one operation, draws it, and records everything `edit` will need.
3060
+ *
3061
+ * What is stored beside the drawing is the point: the KIND, so `clear` can find its own;
3062
+ * the INPUT, so `edit` has something to merge a partial onto; and the RESULT, so a
3063
+ * restyle that changes nothing about the query (picking a different suggestion) can
3064
+ * redraw without asking again.
3065
+ *
3066
+ * The slot is claimed before the query leaves, so a clear made while it is in flight cancels it,
3067
+ * and the add rejects with the `AbortError` the client reports, as a superseded edit does. An
3068
+ * answer that lands all the same is neither recorded nor drawn ({@link SlotRequestEngine}), and
3069
+ * the handle still carries it.
3070
+ *
3071
+ * `answered` is the result of `input` when the caller already holds it beside the input: the
3072
+ * query is not run, and the input is recorded all the same.
3073
+ *
3074
+ * @throws {MountayaElementsError} When `options.fit` is neither a boolean nor an object of
3075
+ * options, and when it states options {@link fitBounds} refuses ({@link readFit}). Nothing
3076
+ * is asked, claimed or drawn.
3077
+ */
3078
+ private addAnalysis;
3079
+ /** drawAnswer is {@link addAnalysis} once its options are read: the query, then the drawing. */
3080
+ private drawAnswer;
3081
+ /**
3082
+ * editAnalysis merges a partial input onto the stored one and redraws.
3083
+ *
3084
+ * The merge is what makes `edit` worth having: widening a range is one field rather than
3085
+ * the whole input restated, and restating it is what `add` is for.
3086
+ *
3087
+ * A patch with no fields redraws from the result already held. That is not a no-op: it
3088
+ * is how a restyle works, and for suggestions it is the only correct behaviour, since
3089
+ * re-running a seeded query would answer a different set of itineraries than the one whose
3090
+ * candidate the user just picked.
3091
+ *
3092
+ * A member stated as `undefined` is no field: the patch and the options are both read through
3093
+ * {@link statedMembers}, so the input and the draw options the analysis holds stay as they are
3094
+ * under it. An option is switched off by its own value, `fit: false`.
3095
+ *
3096
+ * A removal or a clear made while a re-run's query is in flight cancels the query, and an answer
3097
+ * that lands all the same finds nothing to redraw: it is neither recorded nor drawn, and the edit
3098
+ * still resolves to it. A re-run is a request for its slot like any `set` or `add` ({@link
3099
+ * SlotRequestEngine}), so one a later `set`, `add` or re-run superseded draws nothing over it
3100
+ * either. A restyle made while the query is out is no such request: it redraws the result held at
3101
+ * once, and the re-run keeps its options when it lands. A re-run whose query fails leaves the
3102
+ * result held as the one drawn, a first draw still waiting on the style included.
3103
+ *
3104
+ * @throws {MountayaElementsNotFoundError} When no analysis is held under `id`.
3105
+ * @throws {MountayaElementsError} When the patch names a field and the analysis was drawn from
3106
+ * a result, which holds no input to merge it onto, and when `options.fit` is one
3107
+ * {@link readFit} refuses. The analysis stays as it is drawn, and nothing is asked.
3108
+ */
3109
+ private editAnalysis;
3110
+ /**
3111
+ * runAnalysis calls the operation, cancelling whatever this slot had in flight.
3112
+ *
3113
+ * Per SLOT rather than globally, so two independent isochrones do not cancel each other.
3114
+ * Without it, two `edit` calls race and the SLOWER one wins: the drawing settles on an
3115
+ * input that is not the last one asked for, intermittently and never in a test.
3116
+ */
3117
+ private runAnalysis;
3118
+ /**
3119
+ * drawAnalysis converts a result to GeoJSON and mounts it at its rank, under the request whose
3120
+ * query answered it when there is one ({@link mount}).
3121
+ */
3122
+ private drawAnalysis;
3123
+ private removeAnalysis;
3124
+ /**
3125
+ * clearAnalysis removes every result of one kind, the adds still waiting on their query
3126
+ * included: an add holds a claim on its slot from the moment it is made, and is recorded in
3127
+ * `analyses` only once its query answers.
3128
+ */
3129
+ private clearAnalysis;
3130
+ /**
3131
+ * replay re-draws every desired slot onto a freshly-loaded style.
3132
+ *
3133
+ * The other half of the `setStyle` problem. Slots are replayed in insertion order, but
3134
+ * order does not decide the outcome (each layer still resolves its own rank anchor), so
3135
+ * the stacking self-heals rather than depending on the replay sequence.
3136
+ *
3137
+ * Run as well after a switch whose style did not arrive, onto the style that stayed. There
3138
+ * it draws the slots that are not on that style as they ask, the ones asked for or changed
3139
+ * while the switch was on its way, and leaves alone every slot that stayed drawn, its
3140
+ * `onMounted` hook included.
3141
+ */
3142
+ private replay;
3143
+ /**
3144
+ * forgetLive forgets what the registry held of the style before the one a base-map switch
3145
+ * brought in: that style is gone, and the replay draws every slot onto the one that loaded.
3146
+ */
3147
+ private forgetLive;
3148
+ /**
3149
+ * keepLive gives the registry back to the style a base-map switch left on the map, from what
3150
+ * that style held as the switch began.
3151
+ *
3152
+ * Every layer that was drawn is still drawn, so each slot gets back what it had on the style
3153
+ * and each layer its rank. Left empty, the registry would answer no feature for a layer the
3154
+ * reader is looking at, and a clear would remove nothing. A slot that stopped asking for what
3155
+ * it had drawn while the switch was on its way is the exception: its old layers come off the
3156
+ * style here, and the replay that follows draws what it asks for instead.
3157
+ */
3158
+ private keepLive;
3159
+ /**
3160
+ * returnFromLostContext brings the registry in line with the style MapLibre set again as the
3161
+ * WebGL context returned, and draws what that style does not hold.
3162
+ *
3163
+ * The style is the one kept aside as the context was lost. A slot that still asks for what it
3164
+ * had drawn then is on it, and gets its layers and their ranks back. A slot cleared or asked
3165
+ * for again since is on it as it was, so its old layers come off, and the replay draws what it
3166
+ * asks for now, as it draws every slot first asked for while the context was lost. A layer
3167
+ * hidden then and shown since is shown again, and the replay hides the ones hidden since.
3168
+ *
3169
+ * A layer of the caller's own added while the context was lost is not on the style, and is the
3170
+ * caller's to add again on the `styleload` that follows. One
3171
+ * removed meanwhile is on the style, as the Street View coverage is once hidden, and comes
3172
+ * off it: an add of that id on the `styleload` that follows places the layer it is handed. A
3173
+ * layer edited meanwhile is on the style as it was at the loss, and takes the edit.
3174
+ * A coverage first shown meanwhile, and one hidden meanwhile and asked for again, is placed
3175
+ * here, under the paint of that request.
3176
+ */
3177
+ private returnFromLostContext;
3178
+ /**
3179
+ * liveOf answers what a slot has on the style it is about to be written to: what the registry
3180
+ * holds for it, or, while a base-map switch is on its way and the style before it still
3181
+ * stands, what the slot had drawn as the switch began ({@link BaseMapSwitchEngine.heldLive}).
3182
+ */
3183
+ private liveOf;
3184
+ /** applyVisibility writes one layout property, skipping a layer the style does not carry. */
3185
+ private applyVisibility;
3186
+ /**
3187
+ * readOverlayForSlot reads the overlay a slug names off the manifest still being read, holding
3188
+ * the slot it is drawn into meanwhile, for {@link setOverlay} and {@link addEnrichment}.
3189
+ *
3190
+ * The slot is claimed as a request that can still be given back ({@link
3191
+ * SlotRequestEngine.supersede}): a slug the manifest does not hold gives the slot back as it is
3192
+ * refused, so an overlay that waited on the style in it is drawn as if the call had not been
3193
+ * made. A refusal then depends on the slug alone, and never on whether the manifest had answered
3194
+ * when the call was made.
3195
+ *
3196
+ * @returns The overlay, or null where a later request for the slot, or a clear, was made while
3197
+ * the manifest was read.
3198
+ * @throws {MountayaElementsNotFoundError} As {@link requireOverlay} throws. The slot is given
3199
+ * back first.
3200
+ */
3201
+ private readOverlayForSlot;
3202
+ /**
3203
+ * writeGeometrySlot records one write of the preview, the highlight or the emphasis, and draws
3204
+ * what the slot holds after it, or takes the slot down where it holds no geometry.
3205
+ */
3206
+ private writeGeometrySlot;
3207
+ /**
3208
+ * setGeoJsonSlot draws one geometry into a named slot, through the same path as everything
3209
+ * else.
3210
+ *
3211
+ * What the slot asks for is recorded at once, which is what makes it survive the next
3212
+ * `setTerrain`. The write to the style waits for a style that can take it, as every other
3213
+ * mount does: before the first style has loaded MapLibre refuses a source outright. On a
3214
+ * settled style the write is made on the spot.
3215
+ *
3216
+ * While a base-map switch fetches its document the base map before it is the one still shown,
3217
+ * and the write is made onto it at once when it reports loaded, as a tile slot set then is
3218
+ * drawn ({@link hasNoStyleToWriteTo}): the reader sees the geometry now, and the replay draws
3219
+ * it again on the style that arrives. It waits for the switch to end only while that base map
3220
+ * has no style to write to.
3221
+ *
3222
+ * A slot already drawn is written in place ({@link applyGeoJson}): its geometry through
3223
+ * `setData`, its colour through `setPaintProperty`, so a preview that moves with the pointer
3224
+ * and a line that changes colour rebuild neither the source nor a layer.
3225
+ */
3226
+ private setGeoJsonSlot;
3227
+ /**
3228
+ * drawGeoJsonSlot records what a slot drawn from a feature collection built here asks for, and
3229
+ * writes it onto the style, on the terms {@link setGeoJsonSlot} states: at once on a style that
3230
+ * can take it, else once one can.
3231
+ */
3232
+ private drawGeoJsonSlot;
3233
+ private markerElement;
3234
+ /**
3235
+ * specificationSlot namespaces a caller's name, and refuses one that names nothing.
3236
+ *
3237
+ * The refusal is worth a throw rather than a silent slot: the name is the whole handle a
3238
+ * caller has on what they mounted, so an empty one leaves a specification drawn that
3239
+ * `removeSpecification` and `getSpecifications` can only address by the same emptiness.
3240
+ */
3241
+ private specificationSlot;
3242
+ /**
3243
+ * applyLanguage relabels the BASE style, and only the base style.
3244
+ *
3245
+ * The walk is `applyLanguageToStyle`, which is exported so a consumer driving their own
3246
+ * MapLibre map relabels through the same code rather than through a second copy that
3247
+ * decides "is this a label" differently. The skip is what this class adds to it: every
3248
+ * layer in the rank registry is one this map placed, drawing from a source the base style knows
3249
+ * nothing about, so its label is never the base map's `name`.
3250
+ */
3251
+ private applyLanguage;
3252
+ /**
3253
+ * queryAt asks the renderer what a point query reads at a screen point, over the layers
3254
+ * {@link queryLayerIds} names, and answers each feature as a {@link QueriedFeature}.
3255
+ */
3256
+ private queryAt;
3257
+ /**
3258
+ * controlMove moves the camera as a control asks, to the target {@link controlMoveTarget}
3259
+ * answers, handing the renderer the members that move so it keeps every other.
3260
+ */
3261
+ private controlMove;
3262
+ /**
3263
+ * toBoundingBox reads any box {@link fitBounds} takes into the canonical
3264
+ * `[west, south, east, north]` the contract's fit reads.
3265
+ *
3266
+ * A `BoundingBox` is normalized: one drawn from its north-east corner arrives inverted on both
3267
+ * axes, and read as written it would frame the complement, which looks like the camera flying
3268
+ * to the other side of the world. Any other shape is read by its corners as MapLibre's own fit
3269
+ * reads them, a south-west corner east of the north-east one crossing the antimeridian, and
3270
+ * normalized after. Either way a box across the line keeps its east edge past 180, which is how
3271
+ * it is framed across the line rather than up to it.
3272
+ */
3273
+ private toBoundingBox;
3274
+ }
3275
+
3276
+ export { MountayaMap as M, STREETVIEW_COVERAGE_LAYER as S, ZOOM_EASE_MS as Z, MapEventEngine as b, STREETVIEW_COVERAGE_SOURCE as g, STREETVIEW_COVERAGE_TILES as h, createTransformRequest as k };
3277
+ export type { CameraConstraints as C, GeometrySlot as G, LayerPatch as L, RawMap as R, TerrainVariant as T, MapCredential as a, MapEvents as c, MapLibreOptions as d, MountayaMapOptions as e, RequestTransform as f, TransformRequestOptions as i, TransformedRequest as j };