@mountaya/elements 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +273 -0
- package/LICENCE.fr.txt +280 -0
- package/LICENSE.txt +262 -0
- package/README.md +1510 -2
- package/THIRD-PARTY-NOTICES.txt +103 -0
- package/dist/agent/index.cjs +1211 -0
- package/dist/agent/index.cjs.map +1 -0
- package/dist/agent/index.d.cts +1966 -0
- package/dist/agent/index.d.ts +1966 -0
- package/dist/agent/index.js +1181 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/camera/index.cjs +2512 -0
- package/dist/camera/index.cjs.map +1 -0
- package/dist/camera/index.d.cts +1723 -0
- package/dist/camera/index.d.ts +1723 -0
- package/dist/camera/index.js +2443 -0
- package/dist/camera/index.js.map +1 -0
- package/dist/chunk-5pTPpv4v.d.cts +897 -0
- package/dist/chunk-5pTPpv4v.d.ts +897 -0
- package/dist/chunk-6JzFMFHh.d.ts +119 -0
- package/dist/chunk-6qyuJVvt.d.ts +513 -0
- package/dist/chunk-9fp0lDic.cjs +583 -0
- package/dist/chunk-9fp0lDic.cjs.map +1 -0
- package/dist/chunk-A48H1rDg.d.cts +73 -0
- package/dist/chunk-A48H1rDg.d.ts +73 -0
- package/dist/chunk-B-m1AchR.cjs +57 -0
- package/dist/chunk-B-m1AchR.cjs.map +1 -0
- package/dist/chunk-B-qFTf04.d.ts +216 -0
- package/dist/chunk-B0YROiZh.d.cts +1475 -0
- package/dist/chunk-B14wgOvH.d.cts +68 -0
- package/dist/chunk-B19l3j9r.cjs +150 -0
- package/dist/chunk-B19l3j9r.cjs.map +1 -0
- package/dist/chunk-B2PtjVKg.cjs +86 -0
- package/dist/chunk-B2PtjVKg.cjs.map +1 -0
- package/dist/chunk-B56Oyb7W.cjs +70 -0
- package/dist/chunk-B56Oyb7W.cjs.map +1 -0
- package/dist/chunk-B5WGMQwK.cjs +113 -0
- package/dist/chunk-B5WGMQwK.cjs.map +1 -0
- package/dist/chunk-B98mKrdu.d.cts +302 -0
- package/dist/chunk-BB0PmqIM.d.cts +44 -0
- package/dist/chunk-BBikve0Z.cjs +269 -0
- package/dist/chunk-BBikve0Z.cjs.map +1 -0
- package/dist/chunk-BHeXmM0X.js +37 -0
- package/dist/chunk-BHeXmM0X.js.map +1 -0
- package/dist/chunk-BI8WZLpU.cjs +281 -0
- package/dist/chunk-BI8WZLpU.cjs.map +1 -0
- package/dist/chunk-BIEc_SkR.cjs +29 -0
- package/dist/chunk-BIEc_SkR.cjs.map +1 -0
- package/dist/chunk-BJ6L6_W9.cjs +553 -0
- package/dist/chunk-BJ6L6_W9.cjs.map +1 -0
- package/dist/chunk-BJ91UCbB.js +11 -0
- package/dist/chunk-BJ91UCbB.js.map +1 -0
- package/dist/chunk-BJEZWTKj.cjs +166 -0
- package/dist/chunk-BJEZWTKj.cjs.map +1 -0
- package/dist/chunk-BJz54mfg.cjs +10 -0
- package/dist/chunk-BJz54mfg.cjs.map +1 -0
- package/dist/chunk-BNX5LAfN.d.cts +912 -0
- package/dist/chunk-BP6KgA86.js +35 -0
- package/dist/chunk-BP6KgA86.js.map +1 -0
- package/dist/chunk-BRnjQq6K.d.cts +157 -0
- package/dist/chunk-BSiMEwPS.js +46 -0
- package/dist/chunk-BSiMEwPS.js.map +1 -0
- package/dist/chunk-BTPjDw_y.cjs +16 -0
- package/dist/chunk-BTPjDw_y.cjs.map +1 -0
- package/dist/chunk-BTUUABGI.js +17 -0
- package/dist/chunk-BTUUABGI.js.map +1 -0
- package/dist/chunk-BUeL9y7s.cjs +45 -0
- package/dist/chunk-BUeL9y7s.cjs.map +1 -0
- package/dist/chunk-BWMuCNc9.cjs +172 -0
- package/dist/chunk-BWMuCNc9.cjs.map +1 -0
- package/dist/chunk-BWjRfhpF.js +126 -0
- package/dist/chunk-BWjRfhpF.js.map +1 -0
- package/dist/chunk-BZ5KyZXI.d.ts +302 -0
- package/dist/chunk-B_4SVmvh.js +94 -0
- package/dist/chunk-B_4SVmvh.js.map +1 -0
- package/dist/chunk-BcTUuZQ3.js +95 -0
- package/dist/chunk-BcTUuZQ3.js.map +1 -0
- package/dist/chunk-BdkqSsJe.cjs +140 -0
- package/dist/chunk-BdkqSsJe.cjs.map +1 -0
- package/dist/chunk-BfktMVmI.js +70 -0
- package/dist/chunk-BfktMVmI.js.map +1 -0
- package/dist/chunk-BfzQb0EK.cjs +6 -0
- package/dist/chunk-BhWfT-22.d.cts +808 -0
- package/dist/chunk-BjJcqX5J.cjs +60 -0
- package/dist/chunk-BjJcqX5J.cjs.map +1 -0
- package/dist/chunk-Bk0L8g5J.d.cts +77 -0
- package/dist/chunk-Bk0L8g5J.d.ts +77 -0
- package/dist/chunk-Bl4_uVa6.cjs +11 -0
- package/dist/chunk-Bl4_uVa6.cjs.map +1 -0
- package/dist/chunk-BlKF4lrp.js +43 -0
- package/dist/chunk-BlKF4lrp.js.map +1 -0
- package/dist/chunk-Bm1FieGR.js +4 -0
- package/dist/chunk-Bm1FieGR.js.map +1 -0
- package/dist/chunk-Bn6ZbxkS.cjs +27 -0
- package/dist/chunk-BpN3hr6a.cjs +541 -0
- package/dist/chunk-BpN3hr6a.cjs.map +1 -0
- package/dist/chunk-Bq_WHTfd.d.cts +119 -0
- package/dist/chunk-Bqt4LBBz.cjs +648 -0
- package/dist/chunk-Bqt4LBBz.cjs.map +1 -0
- package/dist/chunk-Bqt97zwf.d.cts +54 -0
- package/dist/chunk-Bqt97zwf.d.ts +54 -0
- package/dist/chunk-BsBiN4w6.d.cts +245 -0
- package/dist/chunk-BvTpOUoC.cjs +207 -0
- package/dist/chunk-BvTpOUoC.cjs.map +1 -0
- package/dist/chunk-BwK6Hl3q.cjs +446 -0
- package/dist/chunk-BwK6Hl3q.cjs.map +1 -0
- package/dist/chunk-BxDQZDXR.d.cts +76 -0
- package/dist/chunk-BxDQZDXR.d.ts +76 -0
- package/dist/chunk-BxUio8kX.js +20 -0
- package/dist/chunk-BxUio8kX.js.map +1 -0
- package/dist/chunk-BxaocpFi.d.cts +1 -0
- package/dist/chunk-Bywi0K1N.js +36 -0
- package/dist/chunk-Bywi0K1N.js.map +1 -0
- package/dist/chunk-C-IlmkDl.js +59 -0
- package/dist/chunk-C-IlmkDl.js.map +1 -0
- package/dist/chunk-C5PtVewq.d.ts +389 -0
- package/dist/chunk-C5dpC7mQ.js +19 -0
- package/dist/chunk-C5dpC7mQ.js.map +1 -0
- package/dist/chunk-C5q1sgSa.js +46 -0
- package/dist/chunk-C5q1sgSa.js.map +1 -0
- package/dist/chunk-C6fU9G5I.cjs +221 -0
- package/dist/chunk-C6fU9G5I.cjs.map +1 -0
- package/dist/chunk-C71dpWUK.js +5 -0
- package/dist/chunk-C71dpWUK.js.map +1 -0
- package/dist/chunk-C82N1gQX.d.ts +1831 -0
- package/dist/chunk-C8HdaHpu.js +118 -0
- package/dist/chunk-C8HdaHpu.js.map +1 -0
- package/dist/chunk-C8ZGryck.js +236 -0
- package/dist/chunk-C8ZGryck.js.map +1 -0
- package/dist/chunk-C95NG0oD.cjs +43 -0
- package/dist/chunk-C95NG0oD.cjs.map +1 -0
- package/dist/chunk-C9aR8DXb.js +9 -0
- package/dist/chunk-C9aR8DXb.js.map +1 -0
- package/dist/chunk-CAUZnoCs.d.ts +525 -0
- package/dist/chunk-CBXWWuM9.cjs +82 -0
- package/dist/chunk-CBXWWuM9.cjs.map +1 -0
- package/dist/chunk-CC_Kquu7.d.cts +125 -0
- package/dist/chunk-CC_Kquu7.d.ts +125 -0
- package/dist/chunk-CCp85vXg.cjs +60 -0
- package/dist/chunk-CCp85vXg.cjs.map +1 -0
- package/dist/chunk-CEcB1_uK.js +39 -0
- package/dist/chunk-CEcB1_uK.js.map +1 -0
- package/dist/chunk-CFIo021l.d.cts +216 -0
- package/dist/chunk-CH_IZoJE.js +33 -0
- package/dist/chunk-CH_IZoJE.js.map +1 -0
- package/dist/chunk-CHrasH_g.cjs +25 -0
- package/dist/chunk-CHrasH_g.cjs.map +1 -0
- package/dist/chunk-CJVoSaAE.cjs +3 -0
- package/dist/chunk-CJp8nGcb.js +96 -0
- package/dist/chunk-CJp8nGcb.js.map +1 -0
- package/dist/chunk-CJwUtkOt.js +112 -0
- package/dist/chunk-CJwUtkOt.js.map +1 -0
- package/dist/chunk-CKhCOVIf.d.cts +751 -0
- package/dist/chunk-CKiVSRYg.js +50 -0
- package/dist/chunk-CKiVSRYg.js.map +1 -0
- package/dist/chunk-CKtd19eD.cjs +59 -0
- package/dist/chunk-CKtd19eD.cjs.map +1 -0
- package/dist/chunk-CL92KE3j.d.ts +3188 -0
- package/dist/chunk-CLqUlkAe.js +54 -0
- package/dist/chunk-CLqUlkAe.js.map +1 -0
- package/dist/chunk-CMG5OV0q.cjs +4741 -0
- package/dist/chunk-CMG5OV0q.cjs.map +1 -0
- package/dist/chunk-CN_TKSgm.js +10 -0
- package/dist/chunk-CN_TKSgm.js.map +1 -0
- package/dist/chunk-CNe6MtqV.cjs +29 -0
- package/dist/chunk-CNe6MtqV.cjs.map +1 -0
- package/dist/chunk-COQkDTC5.js +83 -0
- package/dist/chunk-COQkDTC5.js.map +1 -0
- package/dist/chunk-CPBl6K4M.cjs +168 -0
- package/dist/chunk-CPBl6K4M.cjs.map +1 -0
- package/dist/chunk-CPx0ZYFB.d.ts +3 -0
- package/dist/chunk-CQQhcP_C.d.ts +197 -0
- package/dist/chunk-CTNoajFh.d.cts +389 -0
- package/dist/chunk-CTd-qgJc.cjs +384 -0
- package/dist/chunk-CTd-qgJc.cjs.map +1 -0
- package/dist/chunk-CW80YYtU.cjs +1056 -0
- package/dist/chunk-CW80YYtU.cjs.map +1 -0
- package/dist/chunk-CWpqBgkF.d.cts +24 -0
- package/dist/chunk-CWpqBgkF.d.ts +24 -0
- package/dist/chunk-CXjRArgy.d.ts +3 -0
- package/dist/chunk-CXonfH3-.cjs +14 -0
- package/dist/chunk-CXonfH3-.cjs.map +1 -0
- package/dist/chunk-CYcouGXN.d.ts +825 -0
- package/dist/chunk-CZDAzEBw.cjs +1621 -0
- package/dist/chunk-CZDAzEBw.cjs.map +1 -0
- package/dist/chunk-C_fQFr70.d.cts +159 -0
- package/dist/chunk-C_fQFr70.d.ts +159 -0
- package/dist/chunk-CbOtHnnB.cjs +359 -0
- package/dist/chunk-CbOtHnnB.cjs.map +1 -0
- package/dist/chunk-CdA6ZMGk.d.cts +825 -0
- package/dist/chunk-Ce1_thm7.js +146 -0
- package/dist/chunk-Ce1_thm7.js.map +1 -0
- package/dist/chunk-CeD8Hw0j.d.cts +3188 -0
- package/dist/chunk-CeiTuMyt.d.cts +525 -0
- package/dist/chunk-Ch1OLzLi.js +1 -0
- package/dist/chunk-Cizu_j1N.cjs +87 -0
- package/dist/chunk-Cizu_j1N.cjs.map +1 -0
- package/dist/chunk-CjDe9z6A.d.cts +427 -0
- package/dist/chunk-Cl1etdlu.js +63 -0
- package/dist/chunk-Cl1etdlu.js.map +1 -0
- package/dist/chunk-CmoVJDoz.js +4 -0
- package/dist/chunk-CmoVJDoz.js.map +1 -0
- package/dist/chunk-CnLucxjG.cjs +197 -0
- package/dist/chunk-CnLucxjG.cjs.map +1 -0
- package/dist/chunk-CsWjBmdi.cjs +56 -0
- package/dist/chunk-CsWjBmdi.cjs.map +1 -0
- package/dist/chunk-CuseO5MZ.d.cts +3 -0
- package/dist/chunk-CvMHibbA.d.ts +427 -0
- package/dist/chunk-CwDeiN5U.js +870 -0
- package/dist/chunk-CwDeiN5U.js.map +1 -0
- package/dist/chunk-Cwdmx4tG.js +1 -0
- package/dist/chunk-D-4MxHTt.d.cts +105 -0
- package/dist/chunk-D-4MxHTt.d.ts +105 -0
- package/dist/chunk-D0LF-99V.js +1093 -0
- package/dist/chunk-D0LF-99V.js.map +1 -0
- package/dist/chunk-D1fe-0c_.js +367 -0
- package/dist/chunk-D1fe-0c_.js.map +1 -0
- package/dist/chunk-D21fEI6A.d.ts +1926 -0
- package/dist/chunk-D39gAxya.cjs +89 -0
- package/dist/chunk-D39gAxya.cjs.map +1 -0
- package/dist/chunk-D6KdIW5e.cjs +228 -0
- package/dist/chunk-D6KdIW5e.cjs.map +1 -0
- package/dist/chunk-D6qHYbgW.d.cts +36 -0
- package/dist/chunk-D89E-w70.d.ts +44 -0
- package/dist/chunk-D8bdTysL.js +552 -0
- package/dist/chunk-D8bdTysL.js.map +1 -0
- package/dist/chunk-D96QJT24.cjs +109 -0
- package/dist/chunk-D96QJT24.cjs.map +1 -0
- package/dist/chunk-DAmkQl-i.js +119 -0
- package/dist/chunk-DAmkQl-i.js.map +1 -0
- package/dist/chunk-DEfsb2lc.cjs +10 -0
- package/dist/chunk-DEfsb2lc.cjs.map +1 -0
- package/dist/chunk-DIFjT5-V.d.cts +66 -0
- package/dist/chunk-DJpUw8TN.d.ts +912 -0
- package/dist/chunk-DK6lm2IZ.cjs +11 -0
- package/dist/chunk-DK6lm2IZ.cjs.map +1 -0
- package/dist/chunk-DKqgr31j.cjs +61 -0
- package/dist/chunk-DKqgr31j.cjs.map +1 -0
- package/dist/chunk-DLZ0QYm9.js +37 -0
- package/dist/chunk-DLZ0QYm9.js.map +1 -0
- package/dist/chunk-DLjS0uaC.js +4 -0
- package/dist/chunk-DLjS0uaC.js.map +1 -0
- package/dist/chunk-DMokwmOV.cjs +49 -0
- package/dist/chunk-DMokwmOV.cjs.map +1 -0
- package/dist/chunk-DMvWgBZL.d.cts +1831 -0
- package/dist/chunk-DNfGfIF3.js +31 -0
- package/dist/chunk-DNfGfIF3.js.map +1 -0
- package/dist/chunk-DQbSRe8D.d.ts +245 -0
- package/dist/chunk-DSGkP8_y.js +45 -0
- package/dist/chunk-DSGkP8_y.js.map +1 -0
- package/dist/chunk-DTctvfSd.d.cts +197 -0
- package/dist/chunk-DWe7igyw.cjs +206 -0
- package/dist/chunk-DWe7igyw.cjs.map +1 -0
- package/dist/chunk-DWsMP5JR.d.ts +68 -0
- package/dist/chunk-DWsm3HIW.d.cts +120 -0
- package/dist/chunk-DWsm3HIW.d.ts +120 -0
- package/dist/chunk-DXABHjLa.cjs +3 -0
- package/dist/chunk-D_BeqSbc.cjs +42 -0
- package/dist/chunk-D_BeqSbc.cjs.map +1 -0
- package/dist/chunk-D_svQNdW.d.ts +66 -0
- package/dist/chunk-Dav4xWrp.js +330 -0
- package/dist/chunk-Dav4xWrp.js.map +1 -0
- package/dist/chunk-DbCPhepL.js +293 -0
- package/dist/chunk-DbCPhepL.js.map +1 -0
- package/dist/chunk-DcrTy-y2.cjs +43 -0
- package/dist/chunk-DcrTy-y2.cjs.map +1 -0
- package/dist/chunk-Ddv484ld.js +487 -0
- package/dist/chunk-Ddv484ld.js.map +1 -0
- package/dist/chunk-De0bjnhY.cjs +88 -0
- package/dist/chunk-De0bjnhY.cjs.map +1 -0
- package/dist/chunk-De2FmNPu.cjs +32 -0
- package/dist/chunk-De2FmNPu.cjs.map +1 -0
- package/dist/chunk-DeSjQXiI.d.ts +157 -0
- package/dist/chunk-Den0Ta6C.js +132 -0
- package/dist/chunk-Den0Ta6C.js.map +1 -0
- package/dist/chunk-DiDKEeEa.js +8 -0
- package/dist/chunk-DiDKEeEa.js.map +1 -0
- package/dist/chunk-Dj60k5PU.js +197 -0
- package/dist/chunk-Dj60k5PU.js.map +1 -0
- package/dist/chunk-DjnYQBCN.js +4705 -0
- package/dist/chunk-DjnYQBCN.js.map +1 -0
- package/dist/chunk-Dk9VKvyq.d.ts +1 -0
- package/dist/chunk-Dor1ERI9.cjs +85 -0
- package/dist/chunk-Dor1ERI9.cjs.map +1 -0
- package/dist/chunk-DpMouOoH.js +451 -0
- package/dist/chunk-DpMouOoH.js.map +1 -0
- package/dist/chunk-DposgdNL.cjs +52 -0
- package/dist/chunk-DposgdNL.cjs.map +1 -0
- package/dist/chunk-DqLTG_5Q.d.cts +3 -0
- package/dist/chunk-Dr5MCIpS.d.cts +63 -0
- package/dist/chunk-Dr5MCIpS.d.ts +63 -0
- package/dist/chunk-DrudttCC.cjs +4 -0
- package/dist/chunk-DsDYVJQC.js +173 -0
- package/dist/chunk-DsDYVJQC.js.map +1 -0
- package/dist/chunk-Dw8ur6FJ.js +27 -0
- package/dist/chunk-Dw8ur6FJ.js.map +1 -0
- package/dist/chunk-DwG6M_0v.js +64 -0
- package/dist/chunk-DwG6M_0v.js.map +1 -0
- package/dist/chunk-Dy9a5ibO.js +284 -0
- package/dist/chunk-Dy9a5ibO.js.map +1 -0
- package/dist/chunk-DyayZlQJ.js +157 -0
- package/dist/chunk-DyayZlQJ.js.map +1 -0
- package/dist/chunk-DyhJZC2i.js +126 -0
- package/dist/chunk-DyhJZC2i.js.map +1 -0
- package/dist/chunk-F9zBzmmG.cjs +45 -0
- package/dist/chunk-F9zBzmmG.cjs.map +1 -0
- package/dist/chunk-FyCYofv2.js +116 -0
- package/dist/chunk-FyCYofv2.js.map +1 -0
- package/dist/chunk-GHJRjAk2.js +1 -0
- package/dist/chunk-H14isiSf.d.ts +751 -0
- package/dist/chunk-HIJzXoN4.js +7 -0
- package/dist/chunk-HIJzXoN4.js.map +1 -0
- package/dist/chunk-Id_8kRtu.d.ts +36 -0
- package/dist/chunk-KN60yxBQ.js +5 -0
- package/dist/chunk-KN60yxBQ.js.map +1 -0
- package/dist/chunk-NM5yg6bh.cjs +82 -0
- package/dist/chunk-NM5yg6bh.cjs.map +1 -0
- package/dist/chunk-OXr3zJfM.cjs +119 -0
- package/dist/chunk-OXr3zJfM.cjs.map +1 -0
- package/dist/chunk-QGqgNC4z.d.ts +928 -0
- package/dist/chunk-QJBtJrZ0.js +36 -0
- package/dist/chunk-QJBtJrZ0.js.map +1 -0
- package/dist/chunk-QKWhxfPv.d.cts +361 -0
- package/dist/chunk-QKWhxfPv.d.ts +361 -0
- package/dist/chunk-QXW7b4Ev.d.cts +410 -0
- package/dist/chunk-RHZrxUrM.cjs +39 -0
- package/dist/chunk-RHZrxUrM.cjs.map +1 -0
- package/dist/chunk-RTxe2i66.js +91 -0
- package/dist/chunk-RTxe2i66.js.map +1 -0
- package/dist/chunk-RrKkJb6P.js +16 -0
- package/dist/chunk-RrKkJb6P.js.map +1 -0
- package/dist/chunk-VOJqpcnM.cjs +181 -0
- package/dist/chunk-VOJqpcnM.cjs.map +1 -0
- package/dist/chunk-VljGTrid.js +1 -0
- package/dist/chunk-X3UVwUEK.d.cts +513 -0
- package/dist/chunk-X9K2WChn.cjs +28 -0
- package/dist/chunk-X9K2WChn.cjs.map +1 -0
- package/dist/chunk-YrtOx6oy.js +251 -0
- package/dist/chunk-YrtOx6oy.js.map +1 -0
- package/dist/chunk-bY7ySujI.d.cts +928 -0
- package/dist/chunk-bYf1sBz5.d.cts +11 -0
- package/dist/chunk-bYf1sBz5.d.ts +11 -0
- package/dist/chunk-blfknWoM.d.cts +1926 -0
- package/dist/chunk-blqsohAb.js +113 -0
- package/dist/chunk-blqsohAb.js.map +1 -0
- package/dist/chunk-cDMCjodI.cjs +58 -0
- package/dist/chunk-cDMCjodI.cjs.map +1 -0
- package/dist/chunk-cWjE3qd6.cjs +10 -0
- package/dist/chunk-cWjE3qd6.cjs.map +1 -0
- package/dist/chunk-dfOgV3fu.js +26 -0
- package/dist/chunk-dfOgV3fu.js.map +1 -0
- package/dist/chunk-f9cTwUX1.cjs +125 -0
- package/dist/chunk-f9cTwUX1.cjs.map +1 -0
- package/dist/chunk-fHVYEZs4.cjs +28 -0
- package/dist/chunk-fHVYEZs4.cjs.map +1 -0
- package/dist/chunk-fWRUMgRI.js +22 -0
- package/dist/chunk-fWRUMgRI.js.map +1 -0
- package/dist/chunk-fozLXfHY.d.cts +55 -0
- package/dist/chunk-fozLXfHY.d.ts +55 -0
- package/dist/chunk-gWmB1l3A.cjs +3122 -0
- package/dist/chunk-gWmB1l3A.cjs.map +1 -0
- package/dist/chunk-gbj2R-_w.js +58 -0
- package/dist/chunk-gbj2R-_w.js.map +1 -0
- package/dist/chunk-iIWxsAXd.js +59 -0
- package/dist/chunk-iIWxsAXd.js.map +1 -0
- package/dist/chunk-lItIuOIS.cjs +137 -0
- package/dist/chunk-lItIuOIS.cjs.map +1 -0
- package/dist/chunk-m6Rh4PCe.cjs +798 -0
- package/dist/chunk-m6Rh4PCe.cjs.map +1 -0
- package/dist/chunk-o3IRANDf.cjs +99 -0
- package/dist/chunk-o3IRANDf.cjs.map +1 -0
- package/dist/chunk-obUcg3Sk.d.ts +808 -0
- package/dist/chunk-ohsf-6Rn.js +600 -0
- package/dist/chunk-ohsf-6Rn.js.map +1 -0
- package/dist/chunk-pBleU6Nv.js +3061 -0
- package/dist/chunk-pBleU6Nv.js.map +1 -0
- package/dist/chunk-px4e99cy.js +71 -0
- package/dist/chunk-px4e99cy.js.map +1 -0
- package/dist/chunk-qwYDLeXc.cjs +99 -0
- package/dist/chunk-qwYDLeXc.cjs.map +1 -0
- package/dist/chunk-rF_859Qk.cjs +101 -0
- package/dist/chunk-rF_859Qk.cjs.map +1 -0
- package/dist/chunk-rLJkqJ5j.d.ts +1475 -0
- package/dist/chunk-twQItIRg.cjs +338 -0
- package/dist/chunk-twQItIRg.cjs.map +1 -0
- package/dist/chunk-vnPrMVjY.js +10 -0
- package/dist/chunk-vnPrMVjY.js.map +1 -0
- package/dist/chunk-ws3bVwaS.d.ts +410 -0
- package/dist/chunk-xh3UkuVs.cjs +246 -0
- package/dist/chunk-xh3UkuVs.cjs.map +1 -0
- package/dist/chunk-yMzRr26E.js +153 -0
- package/dist/chunk-yMzRr26E.js.map +1 -0
- package/dist/collab/index.cjs +831 -0
- package/dist/collab/index.cjs.map +1 -0
- package/dist/collab/index.d.cts +824 -0
- package/dist/collab/index.d.ts +824 -0
- package/dist/collab/index.js +819 -0
- package/dist/collab/index.js.map +1 -0
- package/dist/data/index.cjs +39 -0
- package/dist/data/index.d.cts +6 -0
- package/dist/data/index.d.ts +6 -0
- package/dist/data/index.js +7 -0
- package/dist/editor/index.cjs +2713 -0
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.d.cts +10 -0
- package/dist/editor/index.d.ts +10 -0
- package/dist/editor/index.js +2702 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/errors/index.cjs +11 -0
- package/dist/errors/index.d.cts +2 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +1 -0
- package/dist/geo/index.cjs +68 -0
- package/dist/geo/index.d.cts +6 -0
- package/dist/geo/index.d.ts +6 -0
- package/dist/geo/index.js +11 -0
- package/dist/i18n/fr/index.cjs +333 -0
- package/dist/i18n/fr/index.cjs.map +1 -0
- package/dist/i18n/fr/index.d.cts +18 -0
- package/dist/i18n/fr/index.d.ts +18 -0
- package/dist/i18n/fr/index.js +328 -0
- package/dist/i18n/fr/index.js.map +1 -0
- package/dist/i18n/index.cjs +451 -0
- package/dist/i18n/index.cjs.map +1 -0
- package/dist/i18n/index.d.cts +268 -0
- package/dist/i18n/index.d.ts +268 -0
- package/dist/i18n/index.js +430 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/icons/index.cjs +37 -0
- package/dist/icons/index.d.cts +4 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +8 -0
- package/dist/index.cjs +517 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +174 -0
- package/dist/index.d.ts +174 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/layers/index.cjs +83 -0
- package/dist/layers/index.d.cts +3 -0
- package/dist/layers/index.d.ts +3 -0
- package/dist/layers/index.js +5 -0
- package/dist/map-client/index.cjs +5 -0
- package/dist/map-client/index.d.cts +6 -0
- package/dist/map-client/index.d.ts +6 -0
- package/dist/map-client/index.js +0 -0
- package/dist/maplibre-worker.mjs +12 -0
- package/dist/navigation/index.cjs +612 -0
- package/dist/navigation/index.cjs.map +1 -0
- package/dist/navigation/index.d.cts +551 -0
- package/dist/navigation/index.d.ts +551 -0
- package/dist/navigation/index.js +599 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/profile/index.cjs +177 -0
- package/dist/profile/index.d.cts +8 -0
- package/dist/profile/index.d.ts +8 -0
- package/dist/profile/index.js +10 -0
- package/dist/seams/index.cjs +15 -0
- package/dist/seams/index.d.cts +4 -0
- package/dist/seams/index.d.ts +4 -0
- package/dist/seams/index.js +4 -0
- package/dist/search/index.cjs +39 -0
- package/dist/search/index.d.cts +6 -0
- package/dist/search/index.d.ts +6 -0
- package/dist/search/index.js +3 -0
- package/dist/style/index.cjs +34 -0
- package/dist/style/index.d.cts +5 -0
- package/dist/style/index.d.ts +5 -0
- package/dist/style/index.js +5 -0
- package/dist/styles.css +11 -0
- package/dist/testing/index.cjs +444 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +217 -0
- package/dist/testing/index.d.ts +217 -0
- package/dist/testing/index.js +435 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/timezone/index.cjs +1953 -0
- package/dist/timezone/index.cjs.map +1 -0
- package/dist/timezone/index.d.cts +28 -0
- package/dist/timezone/index.d.ts +28 -0
- package/dist/timezone/index.js +1948 -0
- package/dist/timezone/index.js.map +1 -0
- package/dist/units/index.cjs +29 -0
- package/dist/units/index.d.cts +3 -0
- package/dist/units/index.d.ts +3 -0
- package/dist/units/index.js +3 -0
- package/dist/video/index.cjs +1713 -0
- package/dist/video/index.cjs.map +1 -0
- package/dist/video/index.d.cts +846 -0
- package/dist/video/index.d.ts +846 -0
- package/dist/video/index.js +1689 -0
- package/dist/video/index.js.map +1 -0
- package/dist/view/index.cjs +7 -0
- package/dist/view/index.d.cts +3 -0
- package/dist/view/index.d.ts +3 -0
- package/dist/view/index.js +1 -0
- package/package.json +433 -4
- package/src/agent/engines/session.ts +2255 -0
- package/src/agent/index.ts +109 -0
- package/src/agent/rules/agentError.ts +128 -0
- package/src/agent/rules/boundedInputJson.ts +53 -0
- package/src/agent/rules/conversation.ts +629 -0
- package/src/agent/rules/conversationFaults.ts +349 -0
- package/src/agent/rules/conversationHost.ts +390 -0
- package/src/agent/rules/dispatcher.ts +102 -0
- package/src/agent/rules/errorCodes.ts +78 -0
- package/src/agent/rules/errorStatus.ts +65 -0
- package/src/agent/rules/scriptedTransport.ts +390 -0
- package/src/agent/rules/stickToBottom.ts +38 -0
- package/src/agent/rules/toolResultPayload.ts +197 -0
- package/src/auth/rules/clientHeader.ts +22 -0
- package/src/auth/rules/sentCredential.ts +76 -0
- package/src/auth/rules/transformRequest.ts +803 -0
- package/src/camera/engines/videoFlight.ts +1758 -0
- package/src/camera/index.ts +157 -0
- package/src/camera/rules/clearance.ts +1099 -0
- package/src/camera/rules/fit.ts +132 -0
- package/src/camera/rules/modes.ts +1019 -0
- package/src/camera/rules/plan.ts +478 -0
- package/src/camera/rules/planner.ts +129 -0
- package/src/camera/rules/poseRanges.ts +38 -0
- package/src/camera/rules/presets.ts +185 -0
- package/src/camera/rules/profileSamples.ts +243 -0
- package/src/camera/rules/route.ts +596 -0
- package/src/camera/rules/routeContent.ts +105 -0
- package/src/camera/rules/spline.ts +765 -0
- package/src/camera/rules/sweptViewports.ts +39 -0
- package/src/camera/rules/track.ts +1412 -0
- package/src/camera/rules/vocabulary.ts +130 -0
- package/src/camera/rules/zoom.ts +216 -0
- package/src/collab/engines/session.ts +1902 -0
- package/src/collab/engines/trailingThrottle.ts +151 -0
- package/src/collab/index.ts +52 -0
- package/src/collab/rules/dispatch.ts +143 -0
- package/src/collab/rules/peerNames.ts +51 -0
- package/src/collab/rules/scriptedTransport.ts +244 -0
- package/src/compose/engines/baseMapSwitch.ts +1136 -0
- package/src/compose/engines/events.ts +962 -0
- package/src/compose/engines/mountayaMap.ts +5648 -0
- package/src/compose/engines/sentCredentials.ts +146 -0
- package/src/compose/engines/slotRequests.ts +413 -0
- package/src/compose/rules/accessRefusal.ts +109 -0
- package/src/compose/rules/accessStanding.ts +75 -0
- package/src/compose/rules/analysisKinds.ts +331 -0
- package/src/compose/rules/analysisLayers.ts +176 -0
- package/src/compose/rules/cameraMoves.ts +38 -0
- package/src/compose/rules/carriedLayers.ts +87 -0
- package/src/compose/rules/developmentWarnings.ts +167 -0
- package/src/compose/rules/fitBox.ts +67 -0
- package/src/compose/rules/fitCamera.ts +54 -0
- package/src/compose/rules/geoJsonSlot.ts +61 -0
- package/src/compose/rules/geometrySlots.ts +155 -0
- package/src/compose/rules/glyphNode.ts +62 -0
- package/src/compose/rules/layerKeys.ts +92 -0
- package/src/compose/rules/layerOrder.ts +85 -0
- package/src/compose/rules/layersManifest.ts +26 -0
- package/src/compose/rules/mapOptions.ts +300 -0
- package/src/compose/rules/maplibreWorkerVersion.gen.ts +8 -0
- package/src/compose/rules/markerPin.ts +122 -0
- package/src/compose/rules/markerRegistry.ts +85 -0
- package/src/compose/rules/markerSprite.ts +382 -0
- package/src/compose/rules/maxBounds.ts +120 -0
- package/src/compose/rules/overlayLookup.ts +49 -0
- package/src/compose/rules/paintDiff.ts +38 -0
- package/src/compose/rules/panLock.ts +77 -0
- package/src/compose/rules/patch.ts +124 -0
- package/src/compose/rules/queriedFeature.ts +55 -0
- package/src/compose/rules/queryLayers.ts +46 -0
- package/src/compose/rules/searchHighlight.ts +313 -0
- package/src/compose/rules/slotNames.ts +19 -0
- package/src/compose/rules/stripeImage.ts +253 -0
- package/src/compose/rules/swapMarker.ts +66 -0
- package/src/compose/rules/terrainVariant.ts +88 -0
- package/src/compose/rules/types.ts +559 -0
- package/src/compose/rules/urlHash.ts +19 -0
- package/src/compose/rules/viewOptions.ts +451 -0
- package/src/compose/rules/workerUrl.ts +131 -0
- package/src/data/engines/itineraryResource.ts +643 -0
- package/src/data/index.ts +78 -0
- package/src/data/rules/adapt.ts +473 -0
- package/src/data/rules/editModes.ts +51 -0
- package/src/data/rules/itinerary.ts +168 -0
- package/src/data/rules/nullable.ts +63 -0
- package/src/data/rules/roadAccess.ts +169 -0
- package/src/data/rules/segmentGroups.ts +309 -0
- package/src/data/rules/selectors.ts +95 -0
- package/src/data/rules/zones.ts +79 -0
- package/src/draw/engines/boundaryEngine.ts +1003 -0
- package/src/draw/engines/framedAdapter.ts +198 -0
- package/src/draw/engines/pointerCursor.ts +205 -0
- package/src/draw/engines/segmentEngine.ts +1405 -0
- package/src/draw/engines/snapIndex.ts +254 -0
- package/src/draw/engines/waypointEngine.ts +574 -0
- package/src/draw/engines/zoneEngine.ts +1137 -0
- package/src/draw/rules/drawFrame.ts +123 -0
- package/src/draw/rules/insertVertex.ts +226 -0
- package/src/draw/rules/screenSpace.ts +62 -0
- package/src/draw/rules/seeds.ts +185 -0
- package/src/draw/rules/snap.ts +115 -0
- package/src/draw/rules/snapCameraKey.ts +50 -0
- package/src/draw/rules/terraDrawShared.ts +214 -0
- package/src/draw/rules/zoneOutline.ts +213 -0
- package/src/editing/engines/cursor.ts +505 -0
- package/src/editing/engines/draftMarker.ts +149 -0
- package/src/editing/rules/accent.ts +11 -0
- package/src/editing/rules/engine.ts +288 -0
- package/src/editing/rules/placement.ts +22 -0
- package/src/editing/rules/positions.ts +89 -0
- package/src/editing/rules/sources.ts +9 -0
- package/src/editing/rules/types.ts +457 -0
- package/src/editing/rules/vocabulary.ts +10 -0
- package/src/editing/rules/waypointCursor.ts +228 -0
- package/src/editor/engines/directionArrows.ts +459 -0
- package/src/editor/engines/directions.ts +1383 -0
- package/src/editor/engines/editorClient.ts +134 -0
- package/src/editor/engines/eventScope.ts +59 -0
- package/src/editor/engines/frameLoop.ts +159 -0
- package/src/editor/engines/itineraryPreview.ts +272 -0
- package/src/editor/engines/mapLockGuard.ts +66 -0
- package/src/editor/engines/overlayRenderer.ts +2696 -0
- package/src/editor/engines/peerDraft.ts +760 -0
- package/src/editor/engines/poiPick.ts +305 -0
- package/src/editor/engines/pointPick.ts +84 -0
- package/src/editor/engines/roadAccessLine.ts +140 -0
- package/src/editor/engines/searchHighlight.ts +183 -0
- package/src/editor/engines/viewClient.ts +4091 -0
- package/src/editor/engines/zoneBadges.ts +503 -0
- package/src/editor/index.ts +97 -0
- package/src/editor/rules/accentColor.ts +116 -0
- package/src/editor/rules/camera.ts +121 -0
- package/src/editor/rules/contract.ts +120 -0
- package/src/editor/rules/icons.ts +825 -0
- package/src/editor/rules/markerElements.ts +244 -0
- package/src/editor/rules/style.ts +51 -0
- package/src/editor/rules/terrain.ts +98 -0
- package/src/editor/rules/tileWarm.ts +191 -0
- package/src/editor/rules/tilesReload.ts +158 -0
- package/src/editor/rules/zoneBadgePlacement.ts +1832 -0
- package/src/editor/rules/zoneTimeStyling.ts +119 -0
- package/src/errors/index.ts +25 -0
- package/src/errors/rules/errors.ts +158 -0
- package/src/errors/rules/print.ts +129 -0
- package/src/geo/index.ts +89 -0
- package/src/geo/rules/boundaries.ts +105 -0
- package/src/geo/rules/camera.ts +496 -0
- package/src/geo/rules/corridor.ts +242 -0
- package/src/geo/rules/elevationTiles.ts +269 -0
- package/src/geo/rules/formatLngLat.ts +63 -0
- package/src/geo/rules/geodesy.ts +125 -0
- package/src/geo/rules/geometry.ts +362 -0
- package/src/geo/rules/lineWalk.ts +77 -0
- package/src/geo/rules/longitude.ts +99 -0
- package/src/geo/rules/searchLimits.ts +22 -0
- package/src/geo/rules/segmentGeometry.ts +80 -0
- package/src/geo/rules/terrain.ts +107 -0
- package/src/geo/rules/tuples.ts +124 -0
- package/src/geo/rules/types.ts +54 -0
- package/src/geo/rules/webMercator.ts +57 -0
- package/src/i18n/fr/index.ts +17 -0
- package/src/i18n/fr/rules/fr.ts +85 -0
- package/src/i18n/fr/rules/words.gen.ts +277 -0
- package/src/i18n/index.ts +82 -0
- package/src/i18n/rules/bundle.ts +378 -0
- package/src/i18n/rules/config.ts +71 -0
- package/src/i18n/rules/dates.ts +165 -0
- package/src/i18n/rules/endonyms.gen.ts +19 -0
- package/src/i18n/rules/language.ts +92 -0
- package/src/i18n/rules/localizedName.ts +33 -0
- package/src/i18n/rules/merge.ts +106 -0
- package/src/i18n/rules/scope.ts +127 -0
- package/src/i18n/rules/strings.ts +632 -0
- package/src/i18n/rules/videoOverlay.ts +121 -0
- package/src/i18n/rules/wordForms.ts +95 -0
- package/src/i18n/rules/words.gen.ts +277 -0
- package/src/icons/index.ts +54 -0
- package/src/icons/rules/activities.ts +40 -0
- package/src/icons/rules/amenities.ts +250 -0
- package/src/icons/rules/artwork.gen.ts +83 -0
- package/src/icons/rules/artwork.ts +47 -0
- package/src/icons/rules/fallback.ts +21 -0
- package/src/icons/rules/lucideMarkers.gen.ts +112 -0
- package/src/icons/rules/lucideUi.gen.ts +197 -0
- package/src/icons/rules/paint.ts +107 -0
- package/src/icons/rules/parse.ts +475 -0
- package/src/icons/rules/provider.ts +373 -0
- package/src/icons/rules/sprites.ts +54 -0
- package/src/icons/rules/ui.ts +348 -0
- package/src/icons/rules/waypoints.ts +215 -0
- package/src/index.ts +993 -0
- package/src/layers/engines/layersSelection.ts +515 -0
- package/src/layers/engines/readoutEngine.ts +131 -0
- package/src/layers/index.ts +151 -0
- package/src/layers/rules/analysis.ts +135 -0
- package/src/layers/rules/enrichment.ts +30 -0
- package/src/layers/rules/geoJson.ts +270 -0
- package/src/layers/rules/hover.ts +67 -0
- package/src/layers/rules/itineraries.ts +182 -0
- package/src/layers/rules/layersPanel.ts +237 -0
- package/src/layers/rules/order.ts +194 -0
- package/src/layers/rules/overlayInstant.ts +49 -0
- package/src/layers/rules/overlays.ts +52 -0
- package/src/layers/rules/poiPanel.ts +119 -0
- package/src/layers/rules/pois.ts +114 -0
- package/src/layers/rules/readout.ts +340 -0
- package/src/layers/rules/streetView.ts +16 -0
- package/src/layers/rules/tileTimestamp.ts +146 -0
- package/src/layers/rules/timeSlider.ts +192 -0
- package/src/layers/rules/timeWindow.ts +123 -0
- package/src/layers/rules/zones.ts +43 -0
- package/src/layers/rules/zoom.ts +77 -0
- package/src/map-client/index.ts +71 -0
- package/src/map-client/rules/mapClient.ts +1945 -0
- package/src/navigation/engines/navigation.ts +493 -0
- package/src/navigation/index.ts +51 -0
- package/src/navigation/rules/followedRoute.ts +78 -0
- package/src/navigation/rules/instructions.ts +89 -0
- package/src/navigation/rules/itineraryRoute.ts +232 -0
- package/src/navigation/rules/offRoute.ts +41 -0
- package/src/navigation/rules/progress.ts +230 -0
- package/src/navigation/rules/prompts.ts +217 -0
- package/src/navigation/rules/routeRequest.ts +98 -0
- package/src/navigation/rules/status.ts +142 -0
- package/src/navigation/rules/steps.ts +234 -0
- package/src/navigation/rules/types.ts +83 -0
- package/src/profile/index.ts +307 -0
- package/src/profile/rules/amenityBadge.ts +35 -0
- package/src/profile/rules/amenityFilter.ts +74 -0
- package/src/profile/rules/amenityStacks.ts +66 -0
- package/src/profile/rules/axis.ts +89 -0
- package/src/profile/rules/axisCulling.ts +83 -0
- package/src/profile/rules/axisLookup.ts +180 -0
- package/src/profile/rules/climbs.ts +292 -0
- package/src/profile/rules/cursorMarker.ts +122 -0
- package/src/profile/rules/cursorReadout.ts +104 -0
- package/src/profile/rules/curvePlacement.ts +216 -0
- package/src/profile/rules/dock.ts +293 -0
- package/src/profile/rules/elevation.ts +1263 -0
- package/src/profile/rules/instant.ts +89 -0
- package/src/profile/rules/intl.ts +237 -0
- package/src/profile/rules/legEmphasis.ts +53 -0
- package/src/profile/rules/profileColors.ts +66 -0
- package/src/profile/rules/profileLayout.ts +59 -0
- package/src/profile/rules/profileSlices.ts +55 -0
- package/src/profile/rules/routeProfile.ts +475 -0
- package/src/profile/rules/rowMatch.ts +50 -0
- package/src/profile/rules/scale.ts +646 -0
- package/src/profile/rules/scaleFrame.ts +171 -0
- package/src/profile/rules/sectionChips.ts +83 -0
- package/src/profile/rules/sections.ts +923 -0
- package/src/profile/rules/slopeRamp.ts +160 -0
- package/src/profile/rules/statStrip.ts +103 -0
- package/src/profile/rules/steepness.ts +51 -0
- package/src/profile/rules/tableCells.ts +269 -0
- package/src/profile/rules/tableCursor.ts +87 -0
- package/src/profile/rules/unitPatterns.ts +335 -0
- package/src/profile/rules/units.ts +1025 -0
- package/src/profile/rules/waypointCard.ts +590 -0
- package/src/profile/rules/webAddress.ts +130 -0
- package/src/profile/rules/windowSpans.ts +65 -0
- package/src/rules/asciiFold.ts +17 -0
- package/src/rules/inDevelopment.ts +54 -0
- package/src/rules/listeners.ts +62 -0
- package/src/rules/timers.ts +9 -0
- package/src/rules/types.ts +22 -0
- package/src/rules/uuid.ts +87 -0
- package/src/seams/engines/geolocateControl.ts +286 -0
- package/src/seams/index.ts +50 -0
- package/src/seams/rules/clock.ts +169 -0
- package/src/seams/rules/geolocation.ts +165 -0
- package/src/seams/rules/segmentRoute.ts +187 -0
- package/src/search/engines/search.ts +1093 -0
- package/src/search/index.ts +99 -0
- package/src/search/rules/describe.ts +383 -0
- package/src/search/rules/filters.ts +195 -0
- package/src/search/rules/highlight.ts +270 -0
- package/src/search/rules/pick.ts +90 -0
- package/src/search/rules/rows.ts +258 -0
- package/src/search/rules/searchFocus.ts +27 -0
- package/src/search/rules/searchViewport.ts +44 -0
- package/src/search/rules/shown.ts +77 -0
- package/src/search/rules/types.ts +340 -0
- package/src/stream/rules/reconnectSchedule.ts +83 -0
- package/src/style/engines/organizationRead.ts +80 -0
- package/src/style/index.ts +63 -0
- package/src/style/rules/apply.ts +268 -0
- package/src/style/rules/attribution.ts +119 -0
- package/src/style/rules/itineraryLine.ts +142 -0
- package/src/style/rules/language.ts +668 -0
- package/src/style/rules/layout.gen.ts +27 -0
- package/src/style/rules/organization.ts +96 -0
- package/src/style/rules/paint.ts +143 -0
- package/src/style/rules/panelLayout.ts +51 -0
- package/src/style/rules/roadAccessColors.ts +29 -0
- package/src/style/rules/roadAccessLine.ts +267 -0
- package/src/style/rules/segmentColors.ts +207 -0
- package/src/testing/catalogs.ts +103 -0
- package/src/testing/index.ts +30 -0
- package/src/testing/mapClient.ts +241 -0
- package/src/testing/mountayaMap.ts +741 -0
- package/src/timezone/index.ts +14 -0
- package/src/timezone/rules/viewport.ts +875 -0
- package/src/units/index.ts +55 -0
- package/src/units/rules/conversions.ts +620 -0
- package/src/units/rules/preferenceChoices.ts +124 -0
- package/src/units/rules/preferences.ts +77 -0
- package/src/units/rules/rounding.ts +69 -0
- package/src/video/engines/videoRun.ts +654 -0
- package/src/video/engines/viewClient.ts +6 -0
- package/src/video/index.ts +83 -0
- package/src/video/profileOverlay/rules/contract.ts +210 -0
- package/src/video/profileOverlay/rules/curve.ts +216 -0
- package/src/video/profileOverlay/rules/draw.ts +410 -0
- package/src/video/profileOverlay/rules/fonts.ts +54 -0
- package/src/video/profileOverlay/rules/graphDesign.ts +690 -0
- package/src/video/profileOverlay/rules/minimalDesign.ts +144 -0
- package/src/video/profileOverlay/rules/registry.ts +23 -0
- package/src/video/profileOverlay/rules/staticLayer.ts +582 -0
- package/src/video/profileOverlay/rules/stripDesign.ts +327 -0
- package/src/video/profileOverlay/rules/types.ts +78 -0
- package/src/video/rules/videoConstants.ts +250 -0
- package/src/video/rules/videoEncoder.ts +277 -0
- package/src/video/rules/videoFrames.ts +99 -0
- package/src/video/rules/videoPreview.ts +185 -0
- package/src/video/rules/videoRecorder.ts +746 -0
- package/src/video/rules/videoWatermark.ts +155 -0
- package/src/video/rules/watermarkMark.ts +40 -0
- package/src/view/engines/viewClient.ts +6 -0
- package/src/view/index.ts +20 -0
|
@@ -0,0 +1,923 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cutting an itinerary's distance axis at the places along it, and stating each stretch.
|
|
3
|
+
*
|
|
4
|
+
* **A row is a segment.** The itinerary's own authored legs, in chain order, each with the
|
|
5
|
+
* figures the server computed for it. One array, two renderings: a strip of chips under a chart
|
|
6
|
+
* and a table of rows beside it, so a leg stated in one and the same leg stated in the other
|
|
7
|
+
* cannot disagree, which is the reason the derivation lives here rather than in either element.
|
|
8
|
+
*
|
|
9
|
+
* A row is never cut at a PROJECTED WAYPOINT. That would fail in three ways at once: it would
|
|
10
|
+
* re-derive, from a DEM-sampled hysteresis walk, figures the API already stores per segment; it
|
|
11
|
+
* would need a proximity radius to place a boundary, which on a loop puts the start and the
|
|
12
|
+
* finish at the same meter; and it would name a leg after the place that ends it. A segment
|
|
13
|
+
* carries its own name, its own colour, and a duration no projection could ever answer.
|
|
14
|
+
*
|
|
15
|
+
* **The waypoints mark the itinerary rather than divide it.** {@link resolveWaypoints} and
|
|
16
|
+
* {@link dividesRoute} place the pins on the curve, the names under the distance axis, and the
|
|
17
|
+
* drop lines between the two. A place marks the itinerary; a segment divides it.
|
|
18
|
+
*
|
|
19
|
+
* Nothing here fetches, and nothing here names a wire type. A caller holding an itinerary maps
|
|
20
|
+
* its segments onto {@link ItinerarySegmentInput} at the edge (`itinerarySegments` on
|
|
21
|
+
* `@mountaya/elements/data` is that mapping), and a caller holding nothing but GeoJSON states
|
|
22
|
+
* the same shape by hand.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { GeometryCollection } from "geojson";
|
|
26
|
+
|
|
27
|
+
import type { WaypointPropertyFormat } from "../../icons/rules/amenities.js";
|
|
28
|
+
import {
|
|
29
|
+
type CumulativeElevation,
|
|
30
|
+
type ElevationSeries,
|
|
31
|
+
elevationAt,
|
|
32
|
+
geometriesOf,
|
|
33
|
+
MARKER_BELONGING_METERS,
|
|
34
|
+
MARKER_PROXIMITY_METERS,
|
|
35
|
+
type MarkerPass,
|
|
36
|
+
type MarkerToProject,
|
|
37
|
+
markerPasses,
|
|
38
|
+
type ProfileInput,
|
|
39
|
+
type ProfileTotals,
|
|
40
|
+
profileLength,
|
|
41
|
+
projectMarkers,
|
|
42
|
+
rangeTotals,
|
|
43
|
+
} from "./elevation.js";
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* What one stretch of itinerary measures. Meters throughout, and every field nullable, because an
|
|
47
|
+
* itinerary with no third coordinate has a length and nothing else.
|
|
48
|
+
*/
|
|
49
|
+
export interface ItinerarySegmentRowMetrics {
|
|
50
|
+
/** Meters from the start of the itinerary to the end of this leg. */
|
|
51
|
+
readonly distance: number | null;
|
|
52
|
+
/** Meters covered by this leg alone. */
|
|
53
|
+
readonly sectionDistance: number | null;
|
|
54
|
+
/** Meters climbed from the start of the itinerary to the end of this leg. */
|
|
55
|
+
readonly ascent: number | null;
|
|
56
|
+
/** Meters lost from the start of the itinerary to the end of this leg, stated positive. */
|
|
57
|
+
readonly descent: number | null;
|
|
58
|
+
/** Meters climbed by this leg alone. */
|
|
59
|
+
readonly sectionAscent: number | null;
|
|
60
|
+
/**
|
|
61
|
+
* Meters lost by this leg alone, stated POSITIVE.
|
|
62
|
+
*
|
|
63
|
+
* The wire's convention, and the renderer's business: a cell showing `+595 m | -34 m` writes
|
|
64
|
+
* the minus itself, and a value that arrived already negative would print two of them.
|
|
65
|
+
*/
|
|
66
|
+
readonly sectionDescent: number | null;
|
|
67
|
+
/**
|
|
68
|
+
* The leg's altitude band, in meters above sea level.
|
|
69
|
+
*
|
|
70
|
+
* A RANGE rather than a single elevation at the place the leg ends. A leg has no one altitude,
|
|
71
|
+
* and the pair is what a reader wants: how low it drops and how high it climbs, which two
|
|
72
|
+
* numbers answer and one cannot.
|
|
73
|
+
*/
|
|
74
|
+
readonly altitudeMin: number | null;
|
|
75
|
+
readonly altitudeMax: number | null;
|
|
76
|
+
/**
|
|
77
|
+
* Seconds the leg is expected to take.
|
|
78
|
+
*
|
|
79
|
+
* Stated, never derived: a duration is a speed decision (the activity, the athlete, the
|
|
80
|
+
* surface), and geometry implies none of it. The API stores one per segment.
|
|
81
|
+
*/
|
|
82
|
+
readonly duration: number | null;
|
|
83
|
+
/**
|
|
84
|
+
* The leg's terrain grade, as the caller's taxonomy spells it.
|
|
85
|
+
*
|
|
86
|
+
* Stated, never derived, for the reason {@link ItineraryCharacteristics} gives for the
|
|
87
|
+
* itinerary-wide pair: reducing a leg's difficulty spans to one grade means RANKING them, and
|
|
88
|
+
* ranking needs a taxonomy this entry point deliberately does not carry. A consumer who holds
|
|
89
|
+
* one states the answer here.
|
|
90
|
+
*/
|
|
91
|
+
readonly difficulty: string | null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Authoritative figures for one section, overriding the ones derived from the geometry.
|
|
96
|
+
*
|
|
97
|
+
* The same shape and the same reason as the itinerary-level override: ascent summed from
|
|
98
|
+
* DEM-sampled coordinates over-reports, because every meter of sampling noise is counted once
|
|
99
|
+
* going up and once coming back down. The derived figures apply a hysteresis and are still an
|
|
100
|
+
* estimate, so an application holding server-computed metrics states those here and its table
|
|
101
|
+
* agrees with the rest of its product. Anything omitted stays derived.
|
|
102
|
+
*
|
|
103
|
+
* A stated CUMULATIVE resets the running total, so the rows after it follow the figure you
|
|
104
|
+
* stated rather than drifting back to the derived one.
|
|
105
|
+
*/
|
|
106
|
+
export type ItinerarySegmentRowOverride = {
|
|
107
|
+
readonly [K in keyof ItinerarySegmentRowMetrics]?: ItinerarySegmentRowMetrics[K];
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Cut-off and stop timing for a place, as an element reads it.
|
|
112
|
+
*
|
|
113
|
+
* A cut-off is an absolute instant and nothing else: one spelling of one rule, so no renderer
|
|
114
|
+
* decides between two of them.
|
|
115
|
+
*/
|
|
116
|
+
export interface WaypointTimingDetail {
|
|
117
|
+
/** RFC 3339 instant by which the place must be left. */
|
|
118
|
+
readonly cutoffAt?: string | undefined;
|
|
119
|
+
/** Seconds expected to be spent here. */
|
|
120
|
+
readonly stopDuration?: number | undefined;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** How to reach a place. Flat and single-line. */
|
|
124
|
+
export interface WaypointContactDetail {
|
|
125
|
+
readonly website?: string | undefined;
|
|
126
|
+
readonly phone?: string | undefined;
|
|
127
|
+
readonly email?: string | undefined;
|
|
128
|
+
readonly address?: string | undefined;
|
|
129
|
+
readonly openingHours?: string | undefined;
|
|
130
|
+
readonly bookingUrl?: string | undefined;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** A photograph of a place, referenced by URL. */
|
|
134
|
+
export interface WaypointPhotoDetail {
|
|
135
|
+
readonly url: string;
|
|
136
|
+
readonly caption?: string | undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** A labelled external link attached to a place. */
|
|
140
|
+
export interface WaypointLinkDetail {
|
|
141
|
+
readonly label: string;
|
|
142
|
+
readonly url: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** Photos and links attached to a place. Each list is absent rather than empty. */
|
|
146
|
+
export interface WaypointMediaDetail {
|
|
147
|
+
readonly photos?: readonly WaypointPhotoDetail[] | undefined;
|
|
148
|
+
readonly links?: readonly WaypointLinkDetail[] | undefined;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* How a custom field's value should be rendered, so a renderer never guesses from content.
|
|
153
|
+
*
|
|
154
|
+
* The vocabulary `WAYPOINT_PROPERTY_FORMATS` lists, read from it and not restated: a format a
|
|
155
|
+
* field picker offers is a format a row can state.
|
|
156
|
+
*/
|
|
157
|
+
export type WaypointPropertyFormatDetail = WaypointPropertyFormat;
|
|
158
|
+
|
|
159
|
+
/** A customer-defined fact about a place: a machine key, a reader's label, and a value. */
|
|
160
|
+
export interface WaypointPropertyDetail {
|
|
161
|
+
readonly key: string;
|
|
162
|
+
readonly label: string;
|
|
163
|
+
readonly value: string;
|
|
164
|
+
/** Absent is equivalent to `text`. */
|
|
165
|
+
readonly format?: WaypointPropertyFormatDetail | undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* What a waypoint says about the PLACE it marks, as an element reads it.
|
|
170
|
+
*
|
|
171
|
+
* Distinct from the wire's own five fields, and structural rather than aliased onto them: the
|
|
172
|
+
* same rule the rest of this module keeps, and for a reason beyond tidiness. The wire spells
|
|
173
|
+
* "nothing here" four different ways: an absent key, an explicit null, an empty array, and an
|
|
174
|
+
* object whose every member is null, which is what a partial write actually stores. An element
|
|
175
|
+
* that had to handle all four at every badge would be handling one of them wrong. Here,
|
|
176
|
+
* everything is optional and, where present, non-empty: a renderer asks whether the key is
|
|
177
|
+
* there and has its answer.
|
|
178
|
+
*
|
|
179
|
+
* `itineraryWaypoints` on `@mountaya/elements/data` is the one mapping between the two, which
|
|
180
|
+
* is also where a wire change that this shape cannot absorb fails to compile.
|
|
181
|
+
*
|
|
182
|
+
* `amenities` stays a list of plain strings for the same reason {@link WaypointBase.glyph}
|
|
183
|
+
* does: this layer names glyphs and vocabularies, it does not close them. `amenityGlyph` on
|
|
184
|
+
* `@mountaya/elements/icons` turns one into the glyph an installed set answers, and holds the
|
|
185
|
+
* closed vocabulary against the API on its own.
|
|
186
|
+
*/
|
|
187
|
+
export interface WaypointDetails {
|
|
188
|
+
/** Services available at the place. Present only when non-empty. */
|
|
189
|
+
readonly amenities?: readonly string[] | undefined;
|
|
190
|
+
/** The author's free-text note about the place. */
|
|
191
|
+
readonly description?: string | undefined;
|
|
192
|
+
/** Cut-off and stop timing. */
|
|
193
|
+
readonly timing?: WaypointTimingDetail | undefined;
|
|
194
|
+
/** How to reach the place. */
|
|
195
|
+
readonly contact?: WaypointContactDetail | undefined;
|
|
196
|
+
/** Photos and links attached to the place. */
|
|
197
|
+
readonly media?: WaypointMediaDetail | undefined;
|
|
198
|
+
/** Customer-defined fields, in the order they should be shown. */
|
|
199
|
+
readonly properties?: readonly WaypointPropertyDetail[] | undefined;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface WaypointBase {
|
|
203
|
+
readonly id: string;
|
|
204
|
+
/**
|
|
205
|
+
* The place's name.
|
|
206
|
+
*
|
|
207
|
+
* Also the default answer to whether this waypoint divides the itinerary: a named place ends
|
|
208
|
+
* a section, an unnamed one is decoration. That is what lets an itinerary carry twenty service
|
|
209
|
+
* pins and seven rows with no flags anywhere, and it matches what an itinerary stores,
|
|
210
|
+
* where a point of interest has a name and a bare marker usually does not.
|
|
211
|
+
*/
|
|
212
|
+
readonly name?: string | undefined;
|
|
213
|
+
/** Any CSS colour, painted as given. This is data, not a theme token. */
|
|
214
|
+
readonly color?: string | undefined;
|
|
215
|
+
/** Names a glyph in the icon provider, for the pin drawn on the curve. */
|
|
216
|
+
readonly glyph?: string | undefined;
|
|
217
|
+
/**
|
|
218
|
+
* Whether this waypoint ends a section: the axis label, the chip boundary, the table row.
|
|
219
|
+
*
|
|
220
|
+
* Defaults to whether it has a name. Set it to override that in either direction: a named
|
|
221
|
+
* service point that should not make a row, or an unnamed one that should.
|
|
222
|
+
*/
|
|
223
|
+
readonly divides?: boolean | undefined;
|
|
224
|
+
/** Whether a pin is drawn on the curve. Defaults to true. */
|
|
225
|
+
readonly pin?: boolean | undefined;
|
|
226
|
+
/**
|
|
227
|
+
* Authoritative figures for the section ending here. Ignored unless it divides.
|
|
228
|
+
*
|
|
229
|
+
* {@link itineraryWaypointRows} states them over the derived ones, field by field: the section's
|
|
230
|
+
* `sectionDistance`, `sectionAscent` and `sectionDescent`, and the running `distance`, `ascent`
|
|
231
|
+
* and `descent`. A stated figure carries into the running totals of the rows after it. The
|
|
232
|
+
* altitude band, the duration and the difficulty have no cell on a place's row, which states
|
|
233
|
+
* one altitude, so they are not read.
|
|
234
|
+
*
|
|
235
|
+
* A place the route passes more than once takes a row per pass and states these figures on
|
|
236
|
+
* one of them: its primary pass, the one the authored order gives it in
|
|
237
|
+
* {@link resolveWaypoints}. Every other row of the place reads the derived figures.
|
|
238
|
+
*/
|
|
239
|
+
readonly metrics?: ItinerarySegmentRowOverride | undefined;
|
|
240
|
+
/**
|
|
241
|
+
* What this waypoint says about the place it marks.
|
|
242
|
+
*
|
|
243
|
+
* Absent for a waypoint that is only a mark on the curve, which is every waypoint a caller
|
|
244
|
+
* builds by hand. `itineraryWaypoints` fills it from the stored record.
|
|
245
|
+
*/
|
|
246
|
+
readonly details?: WaypointDetails | undefined;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* A waypoint given as a coordinate, projected onto the itinerary.
|
|
251
|
+
*
|
|
252
|
+
* Projected rather than snapped, so a hut beside the path rather than exactly on it still
|
|
253
|
+
* finds its place, and an itinerary that doubles back past one is marked at each close pass.
|
|
254
|
+
*/
|
|
255
|
+
export interface WaypointAt extends WaypointBase {
|
|
256
|
+
readonly lngLat: readonly [number, number];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* A waypoint given directly at a distance in meters from the itinerary's start.
|
|
261
|
+
*
|
|
262
|
+
* Exact by construction, where a coordinate has to be projected. An official kilometer marker
|
|
263
|
+
* is this arm; a place on the map is the other.
|
|
264
|
+
*/
|
|
265
|
+
export interface WaypointOn extends WaypointBase {
|
|
266
|
+
readonly distance: number;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* A place on an itinerary, as an element draws it.
|
|
271
|
+
*
|
|
272
|
+
* Distinct from the wire's own waypoint record, which is what an itinerary STORES (a nullable
|
|
273
|
+
* name, a nullable point, an ordinal position, an icon and a revision). This is what an element
|
|
274
|
+
* needs to draw one, and it accepts a distance as well as a coordinate because the two arms
|
|
275
|
+
* answer different questions.
|
|
276
|
+
*/
|
|
277
|
+
export type Waypoint = WaypointAt | WaypointOn;
|
|
278
|
+
|
|
279
|
+
/** A waypoint resolved to one pass along the itinerary. */
|
|
280
|
+
export interface PlacedWaypoint {
|
|
281
|
+
/**
|
|
282
|
+
* Unique per row: `id#pass`, counting the passes of the waypoint's id from zero, across every
|
|
283
|
+
* waypoint given that id.
|
|
284
|
+
*/
|
|
285
|
+
readonly key: string;
|
|
286
|
+
readonly waypoint: Waypoint;
|
|
287
|
+
/** Meters from the start of the itinerary. */
|
|
288
|
+
readonly distance: number;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** One table row, and one chip under a chart: the stretch ending at a dividing waypoint. */
|
|
292
|
+
export interface ItinerarySegmentRow {
|
|
293
|
+
readonly key: string;
|
|
294
|
+
/** The segment's own id, as the caller gave it. */
|
|
295
|
+
readonly id: string;
|
|
296
|
+
/** The ids this row stands in for, when it is a collapsed group. Carried through from the leg. */
|
|
297
|
+
readonly memberIds?: readonly string[] | undefined;
|
|
298
|
+
readonly name: string;
|
|
299
|
+
readonly color?: string | undefined;
|
|
300
|
+
/** The row's position in the table, from zero. */
|
|
301
|
+
readonly index: number;
|
|
302
|
+
/**
|
|
303
|
+
* Where the leg starts and ends on the itinerary's distance axis, in meters.
|
|
304
|
+
*
|
|
305
|
+
* Always DERIVED from the leg's own geometry, never overridden: these are the drawing
|
|
306
|
+
* inputs. `metrics.sectionDistance` is what a cell states, and a caller stating an official
|
|
307
|
+
* figure there must not slide the sparkline's highlight off the curve it is drawn over.
|
|
308
|
+
*/
|
|
309
|
+
readonly from: number;
|
|
310
|
+
readonly to: number;
|
|
311
|
+
readonly metrics: ItinerarySegmentRowMetrics;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Reads the placement arm a waypoint was given as. */
|
|
315
|
+
const distanceOf = (waypoint: Waypoint): number | null =>
|
|
316
|
+
"distance" in waypoint ? waypoint.distance : null;
|
|
317
|
+
|
|
318
|
+
/** A waypoint divides unless it says otherwise; unnamed, it does not unless it says so. */
|
|
319
|
+
export const dividesRoute = (waypoint: Waypoint): boolean =>
|
|
320
|
+
waypoint.divides ?? waypoint.name !== undefined;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* resolveWaypoints places a caller's waypoints on the itinerary's distance axis, in itinerary
|
|
324
|
+
* order.
|
|
325
|
+
*
|
|
326
|
+
* Coordinates go through ONE walk of the geometry rather than one per waypoint: the walk is
|
|
327
|
+
* the expensive half, and an itinerary with twenty places would otherwise be walked twenty times.
|
|
328
|
+
* Distances pass straight through, because they are already on the axis.
|
|
329
|
+
*
|
|
330
|
+
* **A place the route genuinely passes twice is marked twice, and a loop's start and finish are
|
|
331
|
+
* not that.** Those are the two cases this has to tell apart, and the projection alone cannot:
|
|
332
|
+
* on a circular itinerary the first and last waypoints sit within meters of each other, so EACH
|
|
333
|
+
* projects to both zero and the total, and drawing all four placements labels a loop
|
|
334
|
+
* `Chamonix (Finish)` at 0 km.
|
|
335
|
+
*
|
|
336
|
+
* The authored order is what separates them, and it separates them in two steps:
|
|
337
|
+
*
|
|
338
|
+
* 1. **A primary pass per waypoint, assigned by a forward sweep.** Walking the waypoints in the
|
|
339
|
+
* order the author listed them, each takes the first of its own passes at or after the one
|
|
340
|
+
* before it took. That is how a roadbook is read (the places come in order, and each is the
|
|
341
|
+
* next time the route reaches it), and it puts the finish at the total rather than at zero
|
|
342
|
+
* without a radius to tune or a tie to break.
|
|
343
|
+
* 2. **Extra rows only for a pass no waypoint claimed.** A lone hut on a lollipop's stem projects
|
|
344
|
+
* twice and no second waypoint stands at either, so its second pass survives as its own row.
|
|
345
|
+
* The loop's spare placements do not: each sits on a pass another waypoint took as its primary.
|
|
346
|
+
*
|
|
347
|
+
* A waypoint whose every pass lies behind the sweep falls back to its last one rather than
|
|
348
|
+
* vanishing, and the sweep never moves backwards.
|
|
349
|
+
*
|
|
350
|
+
* Each waypoint is the one at its place in the list: two given the same id are two waypoints,
|
|
351
|
+
* each placed on its own, and their keys count that id's passes across both, so no two keys are
|
|
352
|
+
* alike. A distance that is not a number places nothing.
|
|
353
|
+
*
|
|
354
|
+
* @param input The itinerary's geometry, which a coordinate is projected onto.
|
|
355
|
+
* @param waypoints The waypoints, in the order their author listed them.
|
|
356
|
+
* @param proximityMeters How near the itinerary must pass a place for the approach to count.
|
|
357
|
+
* @default proximityMeters {@link MARKER_PROXIMITY_METERS}
|
|
358
|
+
* @returns One placement per pass, in itinerary order.
|
|
359
|
+
*/
|
|
360
|
+
export const resolveWaypoints = (
|
|
361
|
+
input: ProfileInput | null | undefined,
|
|
362
|
+
waypoints: readonly Waypoint[],
|
|
363
|
+
proximityMeters: number = MARKER_PROXIMITY_METERS,
|
|
364
|
+
): PlacedWaypoint[] =>
|
|
365
|
+
placeWaypointPasses(input, waypoints, proximityMeters).map(({ distance, key, waypoint }) => ({
|
|
366
|
+
distance,
|
|
367
|
+
key,
|
|
368
|
+
waypoint,
|
|
369
|
+
}));
|
|
370
|
+
|
|
371
|
+
/** A placement, and whether it is the pass the authored order gives its waypoint. */
|
|
372
|
+
interface PlacedWaypointPass extends PlacedWaypoint {
|
|
373
|
+
/**
|
|
374
|
+
* Whether this is the waypoint's primary pass, the one the forward sweep assigns it. Every
|
|
375
|
+
* other placement of the waypoint is a pass no waypoint claimed.
|
|
376
|
+
*/
|
|
377
|
+
readonly primary: boolean;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* placeWaypointPasses places a caller's waypoints as {@link resolveWaypoints} states, and says of
|
|
382
|
+
* each placement whether it is its waypoint's primary pass.
|
|
383
|
+
*
|
|
384
|
+
* The flag stays inside this module. A waypoint's stated figures belong to one pass of the place,
|
|
385
|
+
* the one its author listed it for, and {@link itineraryWaypointRows} reads it here to tell that
|
|
386
|
+
* pass from a spare one.
|
|
387
|
+
*/
|
|
388
|
+
const placeWaypointPasses = (
|
|
389
|
+
input: ProfileInput | null | undefined,
|
|
390
|
+
waypoints: readonly Waypoint[],
|
|
391
|
+
proximityMeters: number,
|
|
392
|
+
): PlacedWaypointPass[] => {
|
|
393
|
+
// A waypoint is the one at its place in the list, never the one its id names: two given one id
|
|
394
|
+
// are two waypoints, each placed by its own arm, and only their keys count passes of the id
|
|
395
|
+
// across both, so every key stays unique. A marker is projected under its place in the list,
|
|
396
|
+
// written as a string because that is what a marker's id is.
|
|
397
|
+
const markerOf = (waypoint: WaypointAt, index: number): MarkerToProject => ({
|
|
398
|
+
id: String(index),
|
|
399
|
+
lngLat: waypoint.lngLat,
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
// Every distance each waypoint could sit at, in itinerary order. A stated distance is already
|
|
403
|
+
// on the axis and admits exactly one, and one that is no number admits none; a coordinate
|
|
404
|
+
// admits one per close approach.
|
|
405
|
+
const candidates: number[][] = waypoints.map((waypoint) => {
|
|
406
|
+
const distance = distanceOf(waypoint);
|
|
407
|
+
|
|
408
|
+
return distance === null || Number.isNaN(distance) ? [] : [distance];
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
const toProject = waypoints.flatMap((waypoint, index) =>
|
|
412
|
+
"lngLat" in waypoint ? [markerOf(waypoint, index)] : [],
|
|
413
|
+
);
|
|
414
|
+
for (const projection of projectMarkers(input, toProject, proximityMeters)) {
|
|
415
|
+
candidates[Number(projection.id)]?.push(projection.distance);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// A place the tight radius found no pass for, placed at the single nearest point on the line.
|
|
419
|
+
//
|
|
420
|
+
// The radius says how many times the itinerary passes a place, not whether the place is one of
|
|
421
|
+
// its own, and read as the latter it drops real aid stations, because an aid station is a
|
|
422
|
+
// building in a village and the trail goes past the village. Four of the Tour du Mont-Blanc's
|
|
423
|
+
// seventeen sit 105 to 254 meters out, and no surface would draw them. The second, far wider
|
|
424
|
+
// pass runs only for the ones that came back empty, so every other place keeps its passes,
|
|
425
|
+
// and it takes the nearest approach ALONE: a place this far off the line has one sensible
|
|
426
|
+
// position, not two.
|
|
427
|
+
const orphans = waypoints.flatMap((waypoint, index) =>
|
|
428
|
+
"lngLat" in waypoint && candidates[index]?.length === 0 ? [markerOf(waypoint, index)] : [],
|
|
429
|
+
);
|
|
430
|
+
// Every wide pass is weighed by how near it came, and the nearest one is the candidate. The
|
|
431
|
+
// first one the route reaches may run kilometers earlier, along the far side of a valley.
|
|
432
|
+
const nearest = new Map<string, MarkerPass>();
|
|
433
|
+
for (const pass of markerPasses(input, orphans, MARKER_BELONGING_METERS)) {
|
|
434
|
+
const held = nearest.get(pass.id);
|
|
435
|
+
if (held === undefined || pass.meters < held.meters) {
|
|
436
|
+
nearest.set(pass.id, pass);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
for (const pass of nearest.values()) {
|
|
440
|
+
candidates[Number(pass.id)]?.push(pass.distance);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
for (const list of candidates) {
|
|
444
|
+
list.sort((a, b) => a - b);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// Step 1: the forward sweep. `reached` is how far the itinerary has been read to, so a place
|
|
448
|
+
// listed after another cannot be placed before it while it has a later pass to take.
|
|
449
|
+
const primaries: (number | undefined)[] = [];
|
|
450
|
+
let reached = Number.NEGATIVE_INFINITY;
|
|
451
|
+
for (const list of candidates) {
|
|
452
|
+
const primary = list.find((distance) => distance >= reached) ?? list[list.length - 1];
|
|
453
|
+
primaries.push(primary);
|
|
454
|
+
if (primary !== undefined) {
|
|
455
|
+
reached = Math.max(reached, primary);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
const claimed = primaries.filter((primary) => primary !== undefined);
|
|
460
|
+
const isClaimed = (distance: number): boolean =>
|
|
461
|
+
claimed.some((primary) => Math.abs(primary - distance) <= proximityMeters);
|
|
462
|
+
|
|
463
|
+
// Step 2: primaries, plus any pass no waypoint claimed. Both go through one list so the sort
|
|
464
|
+
// below orders them together, each placement carrying its waypoint's place in the list.
|
|
465
|
+
const placed: (Omit<PlacedWaypointPass, "key"> & { readonly listed: number })[] = [];
|
|
466
|
+
for (const [listed, waypoint] of waypoints.entries()) {
|
|
467
|
+
const primary = primaries[listed];
|
|
468
|
+
if (primary === undefined) {
|
|
469
|
+
continue;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
placed.push({ distance: primary, listed, primary: true, waypoint });
|
|
473
|
+
|
|
474
|
+
// A place the wide pass placed holds one candidate, its nearest approach, so it takes one
|
|
475
|
+
// row here by construction.
|
|
476
|
+
for (const distance of candidates[listed] ?? []) {
|
|
477
|
+
if (distance !== primary && !isClaimed(distance)) {
|
|
478
|
+
placed.push({ distance, listed, primary: false, waypoint });
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
placed.sort((a, b) => a.distance - b.distance || a.listed - b.listed);
|
|
484
|
+
|
|
485
|
+
const passes = new Map<string, number>();
|
|
486
|
+
|
|
487
|
+
return placed.map(({ distance, primary, waypoint }) => {
|
|
488
|
+
const pass = passes.get(waypoint.id) ?? 0;
|
|
489
|
+
passes.set(waypoint.id, pass + 1);
|
|
490
|
+
|
|
491
|
+
return { distance, key: `${waypoint.id}#${pass}`, primary, waypoint };
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* One authored leg, in the vocabulary an element draws in.
|
|
497
|
+
*
|
|
498
|
+
* Deliberately NOT the wire type. `ItinerarySegment` carries many snake_case columns, an
|
|
499
|
+
* ordinal `position`, a revision and turn-by-turn steps; a chart needs four things. Mapping at
|
|
500
|
+
* the edge (`itinerarySegments` on `@mountaya/elements/data`) is what keeps the API's shape out
|
|
501
|
+
* of a component's props, and what lets a caller with no Mountaya itinerary at all state these
|
|
502
|
+
* four fields by hand and get the same table.
|
|
503
|
+
*/
|
|
504
|
+
export interface ItinerarySegmentInput {
|
|
505
|
+
/** The caller's own id. Reported by `onSegmentClick`, and what `highlighted` matches. */
|
|
506
|
+
readonly id: string;
|
|
507
|
+
/**
|
|
508
|
+
* The ids this leg stands in for, when it stands in for several.
|
|
509
|
+
*
|
|
510
|
+
* A collapsed group is ONE row carrying the group's own synthetic id, which is not an id
|
|
511
|
+
* anything outside this vocabulary has heard of, so a map reporting the leg under its cursor
|
|
512
|
+
* names a member, and a row matched on `id` alone never lights. Listing the members is what
|
|
513
|
+
* closes that: `highlighted` and the map's own hover both match here as well as on `id`.
|
|
514
|
+
*
|
|
515
|
+
* Absent on an ordinary leg, which stands in for nothing but itself.
|
|
516
|
+
*/
|
|
517
|
+
readonly memberIds?: readonly string[] | undefined;
|
|
518
|
+
readonly name?: string | undefined;
|
|
519
|
+
/** Any CSS colour. Paints this leg's stretch of the sparkline. */
|
|
520
|
+
readonly color?: string | undefined;
|
|
521
|
+
/**
|
|
522
|
+
* The leg's own geometry.
|
|
523
|
+
*
|
|
524
|
+
* What makes its span on the distance axis EXACT rather than projected: the axis is the legs
|
|
525
|
+
* concatenated head-to-tail, so a leg's stretch is the length of its own lines, measured by
|
|
526
|
+
* the same rule. A leg without geometry occupies no distance and states only what it is given.
|
|
527
|
+
*/
|
|
528
|
+
readonly geojson?: ProfileInput | null | undefined;
|
|
529
|
+
/**
|
|
530
|
+
* The server's figures for this leg, overriding what the geometry implies.
|
|
531
|
+
*
|
|
532
|
+
* This is the usual case rather than the exception, and it is the whole reason a segment beats
|
|
533
|
+
* a projected waypoint: `distance`, `ascent`, `descent` and the altitude band are computed
|
|
534
|
+
* server-side and stored per segment, where the geometry can only estimate them from a DEM.
|
|
535
|
+
*/
|
|
536
|
+
readonly metrics?: ItinerarySegmentRowOverride | undefined;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* chainGeometry concatenates a chain's legs into the one geometry a profile walks.
|
|
541
|
+
*
|
|
542
|
+
* The chain is the itinerary, so it is also the curve. A caller holding legs (an editor whose
|
|
543
|
+
* geometry changes as it is drawn, a chain assembled from directions) hands them over once and
|
|
544
|
+
* gets the sections AND the line they belong to, measured off the same array. Deriving the two
|
|
545
|
+
* from separate inputs would let a chart's chips sit over a curve they do not describe.
|
|
546
|
+
*
|
|
547
|
+
* In chain order and head-to-tail, matching what {@link itinerarySegmentRows} measures: a leg's
|
|
548
|
+
* stretch on the axis is the length of its own lines, and the jump between two legs costs no
|
|
549
|
+
* distance. A leg carrying a `Feature` or a `FeatureCollection` is unwrapped rather than
|
|
550
|
+
* rejected, for the reason `geometriesOf` states.
|
|
551
|
+
*
|
|
552
|
+
* @returns The chain's geometry, or `null` when no leg carries geometry, so a caller renders
|
|
553
|
+
* the same empty state a missing itinerary gets rather than an empty collection that reads as
|
|
554
|
+
* a zero-length one.
|
|
555
|
+
*/
|
|
556
|
+
export const chainGeometry = (
|
|
557
|
+
segments: readonly ItinerarySegmentInput[],
|
|
558
|
+
): GeometryCollection | null => {
|
|
559
|
+
const geometries = segments.flatMap((segment) => geometriesOf(segment.geojson));
|
|
560
|
+
|
|
561
|
+
return geometries.length === 0 ? null : { geometries, type: "GeometryCollection" };
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* itinerarySegmentRows states each of the itinerary's legs, in chain order.
|
|
566
|
+
*
|
|
567
|
+
* **Two answers per figure, and they are kept apart on purpose.** `from`/`to` are DERIVED from
|
|
568
|
+
* each leg's own geometry and are never overridable: they are the drawing inputs, and a
|
|
569
|
+
* sparkline highlight that moved because someone stated an official distance would light the
|
|
570
|
+
* wrong stretch of curve. `metrics.*` are STATED, falling back to the geometry only where the
|
|
571
|
+
* caller gave nothing. So a leg whose stored distance disagrees with its geometry by a few
|
|
572
|
+
* meters prints the server's number and still lights exactly its own stretch.
|
|
573
|
+
*
|
|
574
|
+
* The derived half is read off ONE continuous cumulative scan, never by measuring each leg on
|
|
575
|
+
* its own. The elevation hysteresis carries a reference elevation forward across samples;
|
|
576
|
+
* restarting it at every boundary clips the threshold off each end of every leg, and the legs
|
|
577
|
+
* then sum to less than the itinerary does. One scan is what makes the last row's cumulative
|
|
578
|
+
* ascent equal the itinerary's, which is the only reason a table and the chart above it agree.
|
|
579
|
+
*
|
|
580
|
+
* Cumulatives are CARRIED rather than re-read, so a stated figure resets the running total for
|
|
581
|
+
* every row after it instead of the next row drifting back to the derived one.
|
|
582
|
+
*/
|
|
583
|
+
export const itinerarySegmentRows = (
|
|
584
|
+
series: ElevationSeries,
|
|
585
|
+
cumulative: CumulativeElevation,
|
|
586
|
+
segments: readonly ItinerarySegmentInput[],
|
|
587
|
+
): ItinerarySegmentRow[] => {
|
|
588
|
+
const rows: ItinerarySegmentRow[] = [];
|
|
589
|
+
let from = 0;
|
|
590
|
+
let travelled = 0;
|
|
591
|
+
let climbed: number | null = null;
|
|
592
|
+
let dropped: number | null = null;
|
|
593
|
+
|
|
594
|
+
for (const segment of segments) {
|
|
595
|
+
// Clamped to the series' own total: a chain whose stored geometry runs slightly past what
|
|
596
|
+
// the profile walked would otherwise put the last row's highlight off the end of the curve.
|
|
597
|
+
const length = profileLength(segment.geojson);
|
|
598
|
+
const to = Math.min(series.totalDistance, from + length);
|
|
599
|
+
// A leg with no geometry has no stretch to measure, so it derives nothing: a `0 m` of
|
|
600
|
+
// distance or climb is a number a reader will believe, and the altitude where the leg
|
|
601
|
+
// before it ended is not this leg's.
|
|
602
|
+
const legTotals: ProfileTotals | null =
|
|
603
|
+
length > 0 ? rangeTotals(series, cumulative, { from, to }) : null;
|
|
604
|
+
const stated = segment.metrics;
|
|
605
|
+
|
|
606
|
+
// The leg's own figures, stated over derived.
|
|
607
|
+
const sectionDistance = stated?.sectionDistance ?? (legTotals === null ? null : to - from);
|
|
608
|
+
const sectionAscent = stated?.sectionAscent ?? legTotals?.ascent ?? null;
|
|
609
|
+
const sectionDescent = stated?.sectionDescent ?? legTotals?.descent ?? null;
|
|
610
|
+
|
|
611
|
+
// **The running totals carry the EFFECTIVE figures, not the derived ones.** A cumulative
|
|
612
|
+
// column has to be the sum of the deltas printed beside it; carrying the geometry's answer
|
|
613
|
+
// while printing the server's makes the two columns of one row contradict each other, and
|
|
614
|
+
// the last row then states a total the table itself disagrees with. Server-stored distances
|
|
615
|
+
// routinely exceed what a simplified geometry measures, so this is the common case rather
|
|
616
|
+
// than the edge one.
|
|
617
|
+
travelled += sectionDistance ?? 0;
|
|
618
|
+
// Null until something contributes, so a 2D itinerary keeps having no ascent rather than
|
|
619
|
+
// reporting 0 m: a number a reader will believe.
|
|
620
|
+
climbed = sectionAscent === null ? climbed : (climbed ?? 0) + sectionAscent;
|
|
621
|
+
dropped = sectionDescent === null ? dropped : (dropped ?? 0) + sectionDescent;
|
|
622
|
+
|
|
623
|
+
// **Field by field, never a spread.** `{ ...derived, ...stated }` lets an explicitly-absent
|
|
624
|
+
// key overwrite a derived figure with `undefined`, and the symptom is a cell that silently
|
|
625
|
+
// disappears when a caller passes a partially-filled object.
|
|
626
|
+
//
|
|
627
|
+
// A stated cumulative wins outright and RESETS the running total, so the rows after an
|
|
628
|
+
// official figure follow it rather than drifting back.
|
|
629
|
+
const metrics: ItinerarySegmentRowMetrics = {
|
|
630
|
+
altitudeMax: stated?.altitudeMax ?? legTotals?.elevationMax ?? null,
|
|
631
|
+
altitudeMin: stated?.altitudeMin ?? legTotals?.elevationMin ?? null,
|
|
632
|
+
ascent: stated?.ascent ?? climbed,
|
|
633
|
+
descent: stated?.descent ?? dropped,
|
|
634
|
+
// Neither has a derived counterpart: a duration is a speed decision, and a difficulty
|
|
635
|
+
// needs a taxonomy this entry point deliberately does not carry.
|
|
636
|
+
difficulty: stated?.difficulty ?? null,
|
|
637
|
+
distance: stated?.distance ?? travelled,
|
|
638
|
+
duration: stated?.duration ?? null,
|
|
639
|
+
sectionAscent,
|
|
640
|
+
sectionDescent,
|
|
641
|
+
sectionDistance,
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
travelled = metrics.distance ?? travelled;
|
|
645
|
+
climbed = metrics.ascent ?? climbed;
|
|
646
|
+
dropped = metrics.descent ?? dropped;
|
|
647
|
+
|
|
648
|
+
rows.push({
|
|
649
|
+
color: segment.color,
|
|
650
|
+
from,
|
|
651
|
+
id: segment.id,
|
|
652
|
+
index: rows.length,
|
|
653
|
+
// The caller's id, unmodified. A chain has each leg once, so there is no pass to fold in
|
|
654
|
+
// the way a doubling-back waypoint needs, and a stable key is what lets a memoized row
|
|
655
|
+
// survive a hover.
|
|
656
|
+
key: segment.id,
|
|
657
|
+
...(segment.memberIds === undefined ? {} : { memberIds: segment.memberIds }),
|
|
658
|
+
metrics,
|
|
659
|
+
name: segment.name ?? "",
|
|
660
|
+
to,
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
from = to;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
return rows;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* The figures an itinerary states about itself as a whole, each one the caller's to give or leave
|
|
671
|
+
* out.
|
|
672
|
+
*/
|
|
673
|
+
export interface ItineraryCharacteristics {
|
|
674
|
+
/** Meters, along the ground. */
|
|
675
|
+
readonly distance?: number | null | undefined;
|
|
676
|
+
/** Seconds. */
|
|
677
|
+
readonly duration?: number | null | undefined;
|
|
678
|
+
/** Meters climbed, positive. */
|
|
679
|
+
readonly ascent?: number | null | undefined;
|
|
680
|
+
/** Meters lost, stated positive: the wire's convention. */
|
|
681
|
+
readonly descent?: number | null | undefined;
|
|
682
|
+
/** Meters above sea level. */
|
|
683
|
+
readonly altitudeMin?: number | null | undefined;
|
|
684
|
+
readonly altitudeMax?: number | null | undefined;
|
|
685
|
+
/** Degrees, negative: the steepest descending gradient. */
|
|
686
|
+
readonly slopeMin?: number | null | undefined;
|
|
687
|
+
/** Degrees, positive: the steepest ascending gradient. */
|
|
688
|
+
readonly slopeMax?: number | null | undefined;
|
|
689
|
+
/**
|
|
690
|
+
* The itinerary's easiest and hardest terrain.
|
|
691
|
+
*
|
|
692
|
+
* A free string rather than a union, because the taxonomy is the caller's: SAC hiking
|
|
693
|
+
* grades, an MTB scale, a race's own colour bands. The elements state it and never rank it.
|
|
694
|
+
*/
|
|
695
|
+
readonly trailDifficultyMin?: string | null | undefined;
|
|
696
|
+
readonly trailDifficultyMax?: string | null | undefined;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* The whole itinerary's figures, derived and stated together.
|
|
701
|
+
*
|
|
702
|
+
* The bridge between what the geometry implies and what an application knows. `ProfileTotals`
|
|
703
|
+
* is what `profileTotals` computes and keeps its own six field names; this is what a surface
|
|
704
|
+
* renders, and it carries the three quantities no geometry can answer.
|
|
705
|
+
*/
|
|
706
|
+
export interface ResolvedCharacteristics extends ItineraryCharacteristics {
|
|
707
|
+
readonly distance: number | null;
|
|
708
|
+
readonly ascent: number | null;
|
|
709
|
+
readonly descent: number | null;
|
|
710
|
+
readonly altitudeMin: number | null;
|
|
711
|
+
readonly altitudeMax: number | null;
|
|
712
|
+
readonly slopeMax: number | null;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* resolveCharacteristics folds a caller's stated figures over the derived ones.
|
|
717
|
+
*
|
|
718
|
+
* Field by field, never a spread, for the reason a segment row's figures are folded that way: a
|
|
719
|
+
* key a caller holds as `undefined` would overwrite a derived figure with nothing. It maps the two
|
|
720
|
+
* vocabularies in exactly one place: `elevationMin` is `altitudeMin`, `gradeMax` is `slopeMax`,
|
|
721
|
+
* and nothing else in the package has to know that they were ever spelled twice.
|
|
722
|
+
*
|
|
723
|
+
* @param derived The figures the series implies, as {@link profileTotals} states them.
|
|
724
|
+
* @param stated The figures an application holds, or nothing.
|
|
725
|
+
* @returns Every figure, stated over derived. The duration, the steepest descent and the terrain
|
|
726
|
+
* grades have no derived counterpart, so each is the stated one or null.
|
|
727
|
+
*/
|
|
728
|
+
export const resolveCharacteristics = (
|
|
729
|
+
derived: ProfileTotals,
|
|
730
|
+
stated: ItineraryCharacteristics | undefined,
|
|
731
|
+
): ResolvedCharacteristics => ({
|
|
732
|
+
altitudeMax: stated?.altitudeMax ?? derived.elevationMax,
|
|
733
|
+
altitudeMin: stated?.altitudeMin ?? derived.elevationMin,
|
|
734
|
+
ascent: stated?.ascent ?? derived.ascent,
|
|
735
|
+
descent: stated?.descent ?? derived.descent,
|
|
736
|
+
distance: stated?.distance ?? derived.distance,
|
|
737
|
+
duration: stated?.duration ?? null,
|
|
738
|
+
slopeMax: stated?.slopeMax ?? derived.gradeMax,
|
|
739
|
+
slopeMin: stated?.slopeMin ?? null,
|
|
740
|
+
trailDifficultyMax: stated?.trailDifficultyMax ?? null,
|
|
741
|
+
trailDifficultyMin: stated?.trailDifficultyMin ?? null,
|
|
742
|
+
});
|
|
743
|
+
|
|
744
|
+
/** What one waypoint row states, as figures rather than as strings. */
|
|
745
|
+
export interface ItineraryWaypointRowMetrics {
|
|
746
|
+
/** Meters from the start of the itinerary to this place. */
|
|
747
|
+
readonly distance: number;
|
|
748
|
+
/**
|
|
749
|
+
* Meters covered since the previous place, or since the start for the first row.
|
|
750
|
+
*
|
|
751
|
+
* Nullable for the same reason the distance on a segment row is: an itinerary with no
|
|
752
|
+
* geometry has no length to measure a stretch of.
|
|
753
|
+
*/
|
|
754
|
+
readonly sectionDistance: number | null;
|
|
755
|
+
/** Meters climbed from the start of the itinerary to this place. */
|
|
756
|
+
readonly ascent: number | null;
|
|
757
|
+
/** Meters lost from the start of the itinerary to this place, stated positive. */
|
|
758
|
+
readonly descent: number | null;
|
|
759
|
+
/** Meters climbed since the previous place. */
|
|
760
|
+
readonly sectionAscent: number | null;
|
|
761
|
+
/** Meters lost since the previous place, stated POSITIVE: the wire's convention. */
|
|
762
|
+
readonly sectionDescent: number | null;
|
|
763
|
+
/**
|
|
764
|
+
* Altitude AT the place, in meters above sea level.
|
|
765
|
+
*
|
|
766
|
+
* A single reading, where a segment row states a band. A place is a point: "how high is the
|
|
767
|
+
* refuge" has one answer, and a min/max pair over the leg that reaches it would answer a
|
|
768
|
+
* different question.
|
|
769
|
+
*/
|
|
770
|
+
readonly altitude: number | null;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/** One row of a waypoint-first table: the place, and the stretch that reaches it. */
|
|
774
|
+
export interface ItineraryWaypointRow {
|
|
775
|
+
/** Unique per row: `id#pass`, counting this waypoint's passes from zero. */
|
|
776
|
+
readonly key: string;
|
|
777
|
+
/** The waypoint's own id, as the caller gave it. Not unique across rows on a loop. */
|
|
778
|
+
readonly id: string;
|
|
779
|
+
readonly name?: string | undefined;
|
|
780
|
+
readonly color?: string | undefined;
|
|
781
|
+
readonly glyph?: string | undefined;
|
|
782
|
+
/** The row's position in the table, from zero. */
|
|
783
|
+
readonly index: number;
|
|
784
|
+
/** Where the reaching stretch starts on the distance axis, in meters. */
|
|
785
|
+
readonly from: number;
|
|
786
|
+
/** Where it ends, which is where the place sits. */
|
|
787
|
+
readonly to: number;
|
|
788
|
+
/** What the place says about itself. */
|
|
789
|
+
readonly details?: WaypointDetails | undefined;
|
|
790
|
+
readonly metrics: ItineraryWaypointRowMetrics;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* The figures a waypoint's stated metrics and a waypoint row share, which are the ones a stated
|
|
795
|
+
* figure reaches a row through.
|
|
796
|
+
*/
|
|
797
|
+
const WAYPOINT_ROW_FIGURES = [
|
|
798
|
+
"ascent",
|
|
799
|
+
"descent",
|
|
800
|
+
"distance",
|
|
801
|
+
"sectionAscent",
|
|
802
|
+
"sectionDescent",
|
|
803
|
+
"sectionDistance",
|
|
804
|
+
] as const satisfies readonly (keyof ItinerarySegmentRowOverride &
|
|
805
|
+
keyof ItineraryWaypointRowMetrics)[];
|
|
806
|
+
|
|
807
|
+
/** Whether a waypoint's stated metrics hold a figure a waypoint row has a cell for. */
|
|
808
|
+
const statesRowFigure = (stated: ItinerarySegmentRowOverride | undefined): boolean =>
|
|
809
|
+
stated !== undefined && WAYPOINT_ROW_FIGURES.some((figure) => (stated[figure] ?? null) !== null);
|
|
810
|
+
|
|
811
|
+
/** Adds a section's figure to a running total, keeping an absent figure absent. */
|
|
812
|
+
const carry = (total: number | null, section: number | null): number | null =>
|
|
813
|
+
section === null ? total : (total ?? 0) + section;
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* itineraryWaypointRows cuts an itinerary at its places, one row per place per pass.
|
|
817
|
+
*
|
|
818
|
+
* The twin of {@link itinerarySegmentRows}, and deliberately NOT a replacement for it. A segment
|
|
819
|
+
* is what the itinerary's author drew; a waypoint is what they marked. A roadbook wants the
|
|
820
|
+
* first, a race course wants the second, and one table cannot be both: rows cut at projected
|
|
821
|
+
* waypoints need a proximity radius to place a boundary, and on a loop that radius puts the
|
|
822
|
+
* start and the finish at the same meter.
|
|
823
|
+
*
|
|
824
|
+
* **Passes are what make that safe here.** `resolveWaypoints` already keys a placement
|
|
825
|
+
* `id#pass`, so a loop passing Chamonix twice yields two rows by construction rather than
|
|
826
|
+
* by tuning a threshold. There is nothing to collapse and no radius to choose.
|
|
827
|
+
*
|
|
828
|
+
* **The figures come off ONE cumulative scan**, through the same `rangeTotals` the segment rows
|
|
829
|
+
* read. That is what keeps a table and the chart above it in agreement: the last row's cumulative
|
|
830
|
+
* ascent equals `profileTotals(series).ascent` exactly, because both are differences of readings
|
|
831
|
+
* taken from one hysteresis walk rather than sums of independently-measured stretches.
|
|
832
|
+
*
|
|
833
|
+
* **A dividing waypoint's stated `metrics` win over the scan, field by field**, for the six
|
|
834
|
+
* figures the two shapes share. From the first row that states one, the running totals are
|
|
835
|
+
* carried as {@link itinerarySegmentRows} carries them: each is the row before's total plus this
|
|
836
|
+
* row's section, and a stated cumulative resets it, so the rows after an official figure follow
|
|
837
|
+
* it. `from` and `to` stay where the place stands on the curve. The rows before the first stated
|
|
838
|
+
* figure read the scan digit for digit.
|
|
839
|
+
*
|
|
840
|
+
* **A place the route passes more than once states its `metrics` on one row**: its primary pass,
|
|
841
|
+
* the one the authored order gives it in {@link resolveWaypoints}. Every other row of the place
|
|
842
|
+
* reads the scan, or the carry after a stated figure, as a waypoint with no `metrics` does. So an
|
|
843
|
+
* official cumulative resets the running totals once, and a finish that shares its place with
|
|
844
|
+
* the start states its total on the finish row.
|
|
845
|
+
*
|
|
846
|
+
* A place's `altitude` is the curve's at its distance, read between the two samples either side.
|
|
847
|
+
*
|
|
848
|
+
* Every placed waypoint becomes a row, including the ones that do not divide the itinerary. A
|
|
849
|
+
* table whose rows ARE the places has no second class of place to hide: `dividesRoute` answers
|
|
850
|
+
* which of them cut the SEGMENT chain, which is a different question and not this one.
|
|
851
|
+
*/
|
|
852
|
+
export const itineraryWaypointRows = (
|
|
853
|
+
geojson: ProfileInput | null | undefined,
|
|
854
|
+
series: ElevationSeries,
|
|
855
|
+
cumulative: CumulativeElevation,
|
|
856
|
+
waypoints: readonly Waypoint[],
|
|
857
|
+
): ItineraryWaypointRow[] => {
|
|
858
|
+
const placed = placeWaypointPasses(geojson, waypoints, MARKER_PROXIMITY_METERS);
|
|
859
|
+
|
|
860
|
+
// Where the previous row ended, which is where this one's reaching stretch begins. The first
|
|
861
|
+
// row reaches from the itinerary's start, so a table's first figure is the distance to the
|
|
862
|
+
// first place rather than zero.
|
|
863
|
+
let previous = 0;
|
|
864
|
+
// The running totals the row before stated, and whether a stated figure stands at or before
|
|
865
|
+
// the row being built. Until one does, every row reads the scan.
|
|
866
|
+
let before: Pick<ItineraryWaypointRowMetrics, "ascent" | "descent" | "distance"> = {
|
|
867
|
+
ascent: null,
|
|
868
|
+
descent: null,
|
|
869
|
+
distance: 0,
|
|
870
|
+
};
|
|
871
|
+
let follows = false;
|
|
872
|
+
|
|
873
|
+
return placed.map((entry, index) => {
|
|
874
|
+
const to = entry.distance;
|
|
875
|
+
const from = previous;
|
|
876
|
+
previous = to;
|
|
877
|
+
|
|
878
|
+
// Two readings off ONE scan: the stretch that reaches this place, and everything up to it.
|
|
879
|
+
// `rangeTotals` is the same reader `itinerarySegmentRows` uses, which is what makes the last
|
|
880
|
+
// row's running ascent equal `profileTotals(series).ascent` exactly.
|
|
881
|
+
const reaching = rangeTotals(series, cumulative, { from, to });
|
|
882
|
+
const running = rangeTotals(series, cumulative, { from: 0, to });
|
|
883
|
+
const { waypoint } = entry;
|
|
884
|
+
// One row per place states its figures: the primary pass. A spare pass of the same place
|
|
885
|
+
// reads the scan or the carry, so an official cumulative resets the totals once.
|
|
886
|
+
const stated = entry.primary && dividesRoute(waypoint) ? waypoint.metrics : undefined;
|
|
887
|
+
follows ||= statesRowFigure(stated);
|
|
888
|
+
|
|
889
|
+
// The section's own figures, stated over derived.
|
|
890
|
+
const sectionDistance = stated?.sectionDistance ?? reaching.distance;
|
|
891
|
+
const sectionAscent = stated?.sectionAscent ?? reaching.ascent;
|
|
892
|
+
const sectionDescent = stated?.sectionDescent ?? reaching.descent;
|
|
893
|
+
|
|
894
|
+
before = follows
|
|
895
|
+
? {
|
|
896
|
+
ascent: stated?.ascent ?? carry(before.ascent, sectionAscent),
|
|
897
|
+
descent: stated?.descent ?? carry(before.descent, sectionDescent),
|
|
898
|
+
distance: stated?.distance ?? before.distance + (sectionDistance ?? 0),
|
|
899
|
+
}
|
|
900
|
+
: { ascent: running.ascent, descent: running.descent, distance: to };
|
|
901
|
+
|
|
902
|
+
return {
|
|
903
|
+
...(waypoint.color === undefined ? {} : { color: waypoint.color }),
|
|
904
|
+
...(waypoint.details === undefined ? {} : { details: waypoint.details }),
|
|
905
|
+
from,
|
|
906
|
+
...(waypoint.glyph === undefined ? {} : { glyph: waypoint.glyph }),
|
|
907
|
+
id: waypoint.id,
|
|
908
|
+
index,
|
|
909
|
+
key: entry.key,
|
|
910
|
+
metrics: {
|
|
911
|
+
altitude: elevationAt(series.points, to),
|
|
912
|
+
ascent: before.ascent,
|
|
913
|
+
descent: before.descent,
|
|
914
|
+
distance: before.distance,
|
|
915
|
+
sectionAscent,
|
|
916
|
+
sectionDescent,
|
|
917
|
+
sectionDistance,
|
|
918
|
+
},
|
|
919
|
+
...(waypoint.name === undefined ? {} : { name: waypoint.name }),
|
|
920
|
+
to,
|
|
921
|
+
};
|
|
922
|
+
});
|
|
923
|
+
};
|