@tomtom-org/maps-sdk 1.0.0-rc.3 → 1.0.0-rc.5
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 +205 -0
- package/README.md +5 -3
- package/THIRD_PARTY.txt +2 -2
- package/core/dist/core.es.js +1 -1
- package/core/dist/index.d.ts +644 -95
- package/map/dist/THIRD_PARTY.txt +1 -1
- package/map/dist/chunks/maplibre-gl-DudBHU-O.js +1 -0
- package/map/dist/index.d.ts +2617 -1872
- package/map/dist/map.es.js +3 -3
- package/map/dist/third-party.json +1 -1
- package/package.json +6 -5
- package/services/dist/THIRD_PARTY.txt +1 -1
- package/services/dist/index.d.ts +275 -110
- package/services/dist/services.es.js +1 -1
- package/services/dist/third-party.json +1 -1
- package/map/dist/chunks/maplibre-gl-Dp2tuNKx.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,210 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.5
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2799](https://github.com/tomtom-internal/maps-sdk-js/pull/2799) [`0661ea4`](https://github.com/tomtom-internal/maps-sdk-js/commit/0661ea49050f1769653ea81f4da8d0b3a038c53d) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core: `formatDuration` returns a `string` for any `number`, so you can pass its result where a `string` is required with no fallback
|
|
8
|
+
|
|
9
|
+
- **Breaking:** core: `0` gives `"0 min"` and any other duration under 30 seconds gives `"< 1 min"`, in your minute units, where it returned `undefined`. Only `undefined` still returns `undefined`, so where `undefined` hid a label for no delay or no wait, test the seconds before you format them
|
|
10
|
+
- map: `RoutingModule` still leaves out a traffic delay, a jam delay, a stop's wait and a duration difference that round to no minutes, and a summary bubble on a route under 30 seconds reads `"< 1 min"`
|
|
11
|
+
- examples: the route, traffic and store examples drop their fallbacks for a short duration
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#2798](https://github.com/tomtom-internal/maps-sdk-js/pull/2798) [`f5e7999`](https://github.com/tomtom-internal/maps-sdk-js/commit/f5e79999c0499e9b20a95b9b6cc8c1bc9f3e6f9a) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: `calculatePaddedBBox`, `calculatePaddedCenter` and `calculateFittingBBox` cut an element short of the map's full width and height from the side that leaves the most of the map visible, so a toolbar inset from the map edges leaves the area below it visible rather than none
|
|
16
|
+
|
|
17
|
+
- map: this changes the result for any such element whose closest map edge is not that side, whether it floats, sits in a corner or touches one edge. A 600 × 150 px panel against the left edge of a 1280 × 720 px map cuts from the top, and a short panel in the top-right corner cuts from the top rather than the right
|
|
18
|
+
- map: an element spanning the map's full width or height cuts as before. If two sides leave the same area, the side nearest a map edge wins
|
|
19
|
+
|
|
20
|
+
- [#2803](https://github.com/tomtom-internal/maps-sdk-js/pull/2803) [`1a62c72`](https://github.com/tomtom-internal/maps-sdk-js/commit/1a62c72eb372d037397bb88485ea731763f3e554) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - The README links the repository's security policy page, which sends a vulnerability report to TomTom's HackerOne program
|
|
21
|
+
|
|
22
|
+
- [#2807](https://github.com/tomtom-internal/maps-sdk-js/pull/2807) [`8962157`](https://github.com/tomtom-internal/maps-sdk-js/commit/8962157661412b72bc3053e7bcde936063ed3f78) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: waypoint labels win over the route's section icons, and the section focus ring outlines the route instead of crossing it
|
|
23
|
+
- A tunnel, closed-to-vehicles, ferry, toll-road or traffic icon under a stop's name gives way to it, as it does to the pin, rather than pushing the name aside.
|
|
24
|
+
- `setSectionFocus` draws its ring under the route's own lines, so on a road that doubles back, or where focused sections meet end to end, the route covers the ring rather than the ring crossing it.
|
|
25
|
+
|
|
26
|
+
- [#2797](https://github.com/tomtom-internal/maps-sdk-js/pull/2797) [`387694f`](https://github.com/tomtom-internal/maps-sdk-js/commit/387694ff1ba9d081c9f39d2c64ad4cb8f31abd06) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - services: `geocode` and `discoverPlaces` take a bare query string, the same as `{ query }`, as `geocodeOne` and `discoverOnePlace` already do
|
|
27
|
+
|
|
28
|
+
- services: `discoverPlaces('coffee')` runs a fuzzy search and is typed as one
|
|
29
|
+
|
|
30
|
+
## 1.0.0-rc.4
|
|
31
|
+
|
|
32
|
+
### Major Changes
|
|
33
|
+
|
|
34
|
+
- [#2748](https://github.com/tomtom-internal/maps-sdk-js/pull/2748) [`2597ffe`](https://github.com/tomtom-internal/maps-sdk-js/commit/2597ffeaff5f42079109938b277590c95726ca33) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core, services: a route or leg summary's `trafficDelayInSeconds` and `trafficLengthInMeters` are optional, present only when the routing service sends them, rather than `0` when it leaves them out
|
|
35
|
+
|
|
36
|
+
- core: `trafficDelayInSeconds` is the delay of the traffic events along `trafficLengthInMeters`. For the gap to free-flow, use `Math.max(0, liveTrafficIncidentsTravelTimeInSeconds - noTrafficTravelTimeInSeconds)`, with `computeTravelTimeFor: 'all'`
|
|
37
|
+
- agent-toolkit: the route shape `analyseData`, `processData`, `clusterIncidents` and `createTracker` give the model says what `trafficDelayInSeconds` measures and how to work out the gap to free-flow
|
|
38
|
+
- examples: `react-route-planner` shows the traffic delay against free flow, and the delay of the traffic events on a row of its own
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- [#2724](https://github.com/tomtom-internal/maps-sdk-js/pull/2724) [`2cf2e55`](https://github.com/tomtom-internal/maps-sdk-js/commit/2cf2e554793280c067cef0f3864486eb617711ce) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core: the bbox utilities read and return a box crossing the antimeridian as `west > east`, as RFC 7946 and the services do, so fitting the map to results around Fiji frames Fiji rather than the whole world
|
|
43
|
+
|
|
44
|
+
- **Breaking:** core: `bboxFromCoordsArray`, and `bboxFromGeoJSON` on points, return the box across the antimeridian when it is narrower than the one from the lowest to the highest longitude. A tie, or input spanning -180 to 180, keeps the latter, so every country in the world still gives `[-180, …, 180]`
|
|
45
|
+
- **Breaking:** core: `bboxFromGeoJSON` reads a line or ring along its edges, which don't wrap, so a ring past 180 gives the box across the antimeridian and one from -100 to 100 stays `[-100, …, 100]`
|
|
46
|
+
- **Breaking:** core: `bboxFromBBoxes`, and `bboxFromGeoJSON` on several features or parts, return the narrowest box containing every input, so merging a box across the antimeridian with another keeps both
|
|
47
|
+
- **Breaking:** core: `polygonFromBBox` draws a box across the antimeridian with its east edge at `east + 360`, around the box rather than the rest of the world, and `bboxFromGeoJSON` reads that ring back as the same box
|
|
48
|
+
- map: `TomTomMap.getBBox` with padding returns a view across the antimeridian as `west > east`, and a view wider than 180° whole
|
|
49
|
+
- services: `geometrySearch` ranks a polygon across the antimeridian by its own width when it keeps the largest 50
|
|
50
|
+
- agent-toolkit: `getTrafficAreaAnalytics` reads a `bbox` across the antimeridian as the area it covers, and the tools describe a bbox as `[west, south, east, north]`. It needs SDK 1.0.0-rc.4
|
|
51
|
+
|
|
52
|
+
- [#2752](https://github.com/tomtom-internal/maps-sdk-js/pull/2752) [`52ac9b4`](https://github.com/tomtom-internal/maps-sdk-js/commit/52ac9b4b89fa5c8019b24725c8074d3ed3e24a20) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core: `Language` holds every language the map labels carry, so `map.setLanguage('hi-IN')` labels the map in Hindi, and the services send each API a code it takes
|
|
53
|
+
|
|
54
|
+
- **Breaking:** core: `Language` and `languages` gain `ca-ES`, `et-EE`, `eu-ES`, `gl-ES`, `he-IL`, `hi-IN`, `hr-HR`, `ja-JP`, `kk-KZ`, `lv-LV`, `ro-RO`, `sr-RS` and `uk-UA`, so a `Record<Language, …>` of your own needs an entry for each
|
|
55
|
+
- map: the map labels in each of them, and the traffic incident descriptions in Catalan, Estonian, Hebrew, Japanese, Latvian and Romanian
|
|
56
|
+
- services: a behaviour change. `zh-Hans` goes out as `zh-CN` and `zh-Hant` as `zh-TW`, so every service but traffic incidents, which lack Simplified Chinese, answers in that script, where it picked the script by place and answered Singapore in English. Search, geocoding, suggestions and POI categories take both, where they answered each with a 400
|
|
57
|
+
- services: search, geocoding and suggestions answer `hi-IN` and `ja-JP` in local names, and POI categories in English. All four answer `en-CA` in British English and `es-MX` in Latin American Spanish, where they answered each with a 400. POI categories take `ngt` and `ngt-Latn` too
|
|
58
|
+
- services: `trafficIncidentDetails` takes every `Language`, answering in the nearest language the incident tiles have, or in English, where it answered one it lacks, such as `en-AU` or `pt-BR`, with a 406
|
|
59
|
+
- examples: `map-language` offers Hebrew, Hindi, Japanese, Serbian and Ukrainian
|
|
60
|
+
|
|
61
|
+
- [#2738](https://github.com/tomtom-internal/maps-sdk-js/pull/2738) [`6170ae7`](https://github.com/tomtom-internal/maps-sdk-js/commit/6170ae7d8e350c299e48d51d4a0a7824ec1bfb5a) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** core: `main-when-available` uses a place's first untyped entry point when none is typed `'main'`, so a reverse geocoded place routes to the road-snapped point the service returns rather than to the queried point
|
|
62
|
+
|
|
63
|
+
- **Breaking:** core: `getPosition(place, { useEntryPoint: 'main-when-available' })` returns that entry point's position. A place whose entry points are all `'minor'` keeps its own position
|
|
64
|
+
- **Breaking:** services: `calculateRoute` with `useEntryPoints: 'main-when-available'` sends such a stop at that entry point
|
|
65
|
+
- **Breaking:** map: `RoutingModule` with `waypoints.entryPoints: 'main-when-available'` draws such a waypoint at that entry point
|
|
66
|
+
|
|
67
|
+
- [#2729](https://github.com/tomtom-internal/maps-sdk-js/pull/2729) [`77ef508`](https://github.com/tomtom-internal/maps-sdk-js/commit/77ef5080de0f74301d781e84f65628e5673797e6) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: `styling.layers.query` selects style layers by exact id, derives a paint or layout value from the one beneath it, and narrows a layer's filter with one more clause, all kept across style switches; `POIsModule` hides or shows single POIs by id, which makes `filters.categories` optional
|
|
68
|
+
|
|
69
|
+
- map: `LayerQuery` takes `ids`, the exact style layer ids to select
|
|
70
|
+
- map: `setPaint` and `setLayout` take a function `(valueUnder, layerId) => value` for any property, worked out from the style's own value, or the one a knob set, and again whenever that value changes
|
|
71
|
+
- map: `addFilterClause` and `removeFilterClause` add a clause to a layer's filter, `and`-ed with the style's own and with the filters other modules add, instead of replacing it as `setFilter` does
|
|
72
|
+
- map: `POIsModule`'s `filters.ids` takes a `ValuesFilter` of POI ids, beside `filters.categories`
|
|
73
|
+
- **Breaking:** map: `POIsModuleConfig`'s `filters.categories` is optional, so `filters` can hold `ids` alone. Code reading `config.filters.categories` must handle `undefined`
|
|
74
|
+
- examples: `map-styling-playground` adds a motorway name halo derived from the one beneath it and a road name filter clause, and `poi-filters` hides a POI you click
|
|
75
|
+
|
|
76
|
+
- [#2757](https://github.com/tomtom-internal/maps-sdk-js/pull/2757) [`2478847`](https://github.com/tomtom-internal/maps-sdk-js/commit/2478847effe8a949fdce057874c236cf20e66dad) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: add a MapLibre custom layer with `map.addCustomLayer`, which keeps it in its place through style switches and lets its objects take clicks and hovers
|
|
77
|
+
- `beforeLayerConfig` places it as on a module. The new `'lowest3D'` anchor, `mapStyleLayerIDs.lowest3D`, puts a 3D layer under the style's 3D buildings, otherwise under the POIs, and module layers placed before `lowestLabel` stay below it, even the ones added later. Module layers at `'poi'` or `'top'` stay above it, also where it falls back to the POIs or the top
|
|
78
|
+
- An id the map already has throws, until that layer's `remove()`
|
|
79
|
+
- After every `setStyle`, before the modules restore, the layer goes back to its place, added again if the switch dropped it, and the module layers go back over or under it as they were. `remove()` takes it off for good
|
|
80
|
+
- A `hitTest` returns the objects under the pointer, topmost first. They join the map's user events in layer order, so the layer's `events`, priority, the hover cursor and the event states work as on a module's features, with `setState` to draw the states
|
|
81
|
+
|
|
82
|
+
- [#2766](https://github.com/tomtom-internal/maps-sdk-js/pull/2766) [`22215a6`](https://github.com/tomtom-internal/maps-sdk-js/commit/22215a65286f7a6bd274c2aa6bb75cf81e5fee1e) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: drag features on every module and scope with the new `dragstart`, `drag` and `dragend` events, such as a route's waypoints, its lines or a place's pin
|
|
83
|
+
|
|
84
|
+
- map: a drag handler makes its features draggable with the mouse or one finger. They show the new `cursorOnDraggable` cursor, `'grab'` by default, the map doesn't pan under the drag, and the release fires no `click`
|
|
85
|
+
- map: `RoutingModule` reports the drag on `events.waypoints` and `events.mainLines` and plans nothing, so you call `calculateRoute` and `showRoutes` with the moved or inserted stop, or let the route dragging plugin do it
|
|
86
|
+
- **Breaking:** map: `EventType` also holds the three drag types, so a `switch` or a `Record` over it needs them. Event states keep to the click and hover types, as `EventState` and `SetEventStateOptions.state` now say on their own
|
|
87
|
+
- examples: `react-route-planner` drags stops on the map and pulls new ones onto the route line through the route dragging plugin, re-planning the route as you drag
|
|
88
|
+
|
|
89
|
+
- [#2757](https://github.com/tomtom-internal/maps-sdk-js/pull/2757) [`2478847`](https://github.com/tomtom-internal/maps-sdk-js/commit/2478847effe8a949fdce057874c236cf20e66dad) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: line up a custom layer's three.js or WebGL scene with the map, in metres around a place, with `localFrameMatrix`
|
|
90
|
+
- It turns `defaultProjectionData.mainMatrix` into a `Float64Array`, composed in double precision, which a three.js camera or a WebGL uniform takes
|
|
91
|
+
- `centerLatitude` scales heights at the map centre's latitude, as MapLibre scales its 3D buildings and terrain, and `units: 'mercatorMeters'` takes geometry authored in EPSG:3857 metres
|
|
92
|
+
|
|
93
|
+
- [#2775](https://github.com/tomtom-internal/maps-sdk-js/pull/2775) [`21cda10`](https://github.com/tomtom-internal/maps-sdk-js/commit/21cda10b55fb241f20387a93fa1a7090a4f7c851) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: `SectionLinePattern`, deprecated in 1.0.0-rc.3, is removed. Use `LinePattern`, the same type, which geometries and reachable range borders share too
|
|
94
|
+
|
|
95
|
+
- [#2756](https://github.com/tomtom-internal/maps-sdk-js/pull/2756) [`1da0aa4`](https://github.com/tomtom-internal/maps-sdk-js/commit/1da0aa4de06db25efe6a11c392cc73e10a77a229) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: `TomTomMap` takes a `transformRequest` that holds or rewrites each map request after the SDK's own, and may return a promise, so an app can wait for its proxy session or point tiles at its own cache
|
|
96
|
+
|
|
97
|
+
- map: `transformRequest`, typed `MapRequestTransform`, gets the request the SDK built, with its URL, headers and credentials, and stays in place through `setLanguage` and `setGeopoliticalView`
|
|
98
|
+
- **Breaking:** map: the map no longer awaits `globalThis.__DEMOS_PROXY_ENSURE_SESSION__` before its requests. An app that set it passes the same function as `transformRequest` instead: `transformRequest: async (request) => { await ensureSession(); return request; }`
|
|
99
|
+
- examples: `map-request-transform` holds the map's tile requests behind a toggle and counts them
|
|
100
|
+
|
|
101
|
+
- [#2726](https://github.com/tomtom-internal/maps-sdk-js/pull/2726) [`eae0ebd`](https://github.com/tomtom-internal/maps-sdk-js/commit/eae0ebd9ca51c18ad9b4d3edeb3cd8d062834189) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: when the map's style fails to load, a module's `create()` or `get()` rejects with the style's `TomTomMapError`, the one the error handlers get, so an `await` on it lands in your `catch` instead of waiting forever
|
|
102
|
+
|
|
103
|
+
- **Breaking:** map: after a style load fails, a module call that waits for the map, such as `showRoutes` or `show`, rejects with that error too, until a `setStyle` loads a style. Once one loads, create again only the modules whose `create()` or `get()` rejected: the others restore themselves
|
|
104
|
+
- map: a style, tile, sprite or glyph request that gets no response, offline or blocked, reaches the error handlers as `NETWORK_NOT_AVAILABLE`, which can be retried, instead of `STYLE_LOAD_FAILED` or `INTERNAL`
|
|
105
|
+
- examples: `multiple-maps-landmarks` logs a map whose style fails to load instead of leaving an unhandled rejection
|
|
106
|
+
|
|
107
|
+
- [#2660](https://github.com/tomtom-internal/maps-sdk-js/pull/2660) [`e6ab97c`](https://github.com/tomtom-internal/maps-sdk-js/commit/e6ab97cffc81eaa8fe417cde4a12e38829f70626) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: `calculateRoute` returns the curves of each route as `sections.curve` and the winding stretches they make up as `sections.curvyStretch` when its `sectionTypes` names them, so you can keep a motion-sick passenger off winding roads or send a motorcyclist down them
|
|
108
|
+
|
|
109
|
+
- **Breaking:** core: `SectionType`, `sectionTypes`, `inputSectionTypes` and `inputSectionTypesWithGuidance` include `'curve'` and `'curvyStretch'`. A `Record<SectionType, …>` needs an entry for each
|
|
110
|
+
- **Breaking:** services: `InputSectionType` includes them too
|
|
111
|
+
- **Breaking:** map: `DrawnSectionType`, `GeneratedSectionType`, `drawnSectionTypes` and `generatedSectionTypes` include them, so a `Record<DrawnSectionType, …>` needs an entry for each. `SectionKnobName` includes `'kerb'`, so a `Record<SectionKnobName, …>` needs one for it
|
|
112
|
+
- core: each curve has its `headingChangeInDegrees`, positive to the right, its `radiusInMeters` where it turns tightest, its `lengthInMeters` and a `curvinessScore`, its arc weighted by how tight it is as roadcurvature.com scores roads, a `severity` from 0 to 1, how much a driver slows down for it from the speed limit on the road into it, weighing its radius, how far it turns and whether it's a turn at a junction, and on a route with guidance the `maneuver` of a junction instruction on it. An instruction that keeps to the road, such as "Turn left to stay on the SS38" at a hairpin, names none
|
|
113
|
+
- core: each curvy stretch groups three or more curves within 500 m of each other, ended by a curve with a maneuver, with its `curveCount`, `hairpinCount` (its hairpins, curves turning 140° or more on a radius of 40 m or less, which the new `isHairpin` tells), `lengthInMeters`, `minRadiusInMeters` and `curvinessScore`, its curves' scores added up
|
|
114
|
+
- core: `getCurveSections` and `getCurvyStretchSections` find them with thresholds of your own. A curve's `severity` reads the route's `speedLimit` sections, so ask for them along with the curves
|
|
115
|
+
- services: `calculateRoute` takes those thresholds as `curveDetection`, a `CurveDetectionOptions` with the turn, radius and straight that make a curve and the curve count and gap that make a curvy stretch
|
|
116
|
+
- core: the new `withCurveSections` finds a route's curves and curvy stretches again with other thresholds, keeping its other sections, so you can tune them on routes you already have, with no new request
|
|
117
|
+
- core: `compareRoutes` and `getSectionsWithin` weigh `curve` and `curvyStretch` when you pass no `types`, on routes that carry them
|
|
118
|
+
- services: the SDK finds `curve` and `curvyStretch` in the route's geometry, only when a `sectionTypes` list names them, so a `calculateRoute` without `sectionTypes` does no more work than before. `inputSectionTypes` and `inputSectionTypesWithGuidance` name them, so a list built from those finds them too. It never sends them to the routing API
|
|
119
|
+
- core: the new `defaultSectionTypes` names the sections a `calculateRoute` without `sectionTypes` returns, so `sectionTypes: [...defaultSectionTypes, 'curve', 'curvyStretch']` keeps them all and adds the curves
|
|
120
|
+
- map: the routing module draws `curve` and `curvyStretch` as bands when you switch them on with `sections.curve: { visible: true }`, at the width of every other section band. The curves draw rose, a colour no traffic delay takes, deeper the higher their `severity`, above the stretch they make up, which draws the same rose fainter
|
|
121
|
+
- map: from zoom 12, a curve of 60 m radius or less carries a kerb, short stripes of a tint of its colour, nearly white on a light map and nearly black on a dark one. The new `sections.curve.kerb.color` knob sets the stripes' colour, and `sections.curve.kerb.visible: false` draws one plain line. `layers.sections.curve` takes the kerb as `routeSectionCurveKerb`
|
|
122
|
+
- examples: the new `route-curves` example ranks a mountain trip's routes by how winding they are and takes the straightest or the curviest. It shows all their curves, the open-road bends, the turns in towns, the curvy stretches each route has of its own, the curves in tunnels or the hairpins, with their speed limit signs, names how hard a curve you click is, and tells where a curvy stretch you click anywhere along starts, how long it takes and which towns it runs between. Its sliders, folded away under the picker, set what counts as a curve and a curvy stretch, and find them again on the routes shown. The `route-sections-playground` picker adds the Stelvio Pass, and `map-styling-playground` draws a route's curves over Twin Peaks
|
|
123
|
+
- examples: `react-route-planner` adds a Curvy roads lane and counts each alternative's curvy stretches of its own, and a Curvy route draws its curves and curvy stretches
|
|
124
|
+
|
|
125
|
+
- [#2722](https://github.com/tomtom-internal/maps-sdk-js/pull/2722) [`9eff3f9`](https://github.com/tomtom-internal/maps-sdk-js/commit/9eff3f9f11ae3c358e0df83e9241cfb4a00f7282) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** map: the `maplibre-gl` peer dependency moves up to `^6.15.0`
|
|
126
|
+
- **Breaking:** services: the `zod` peer dependency moves up to `^4.6.7`.
|
|
127
|
+
- services: `geometryData` reports a `geometries` list over 20 as one issue on that field, not as a union mismatch.
|
|
128
|
+
|
|
129
|
+
- [#2786](https://github.com/tomtom-internal/maps-sdk-js/pull/2786) [`aba3679`](https://github.com/tomtom-internal/maps-sdk-js/commit/aba36798344f38c50ef4b4e4ec94737e30d15785) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: along-route results from `discoverPlaces({ route })` carry their detour as typed `AlongRoutePlaceProps`, `detourTimeInSeconds` and `detourDistanceInMeters`, so you read them without a cast
|
|
130
|
+
|
|
131
|
+
- **Breaking:** services: the untyped `properties.detourTime`, `detourDistance` and `detourOffset` are now `detourTimeInSeconds`, `detourDistanceInMeters` and `detourOffsetInMeters`. Either detour can be negative, when the route through the place is faster or shorter than the original
|
|
132
|
+
- services: `detourOffsetInMeters` comes with results sorted by `'detourOffset'`
|
|
133
|
+
- examples: `nodejs-along-route-search` prints each charger's detour
|
|
134
|
+
|
|
135
|
+
- [#2751](https://github.com/tomtom-internal/maps-sdk-js/pull/2751) [`6d77703`](https://github.com/tomtom-internal/maps-sdk-js/commit/6d777037d17e27262728700e190cfce76a641142) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: `geocodeOne` and `discoverOnePlace` reject with an `SDKError` coded `NOT_FOUND` when nothing matches, naming the `'Geocode'` or `'FuzzySearch'` service, so you can branch on `error.code` as for any other failed call
|
|
136
|
+
|
|
137
|
+
- The message is unchanged. A `catch` that filters on `instanceof SDKError` now receives a miss too, where it used to get a plain `Error`.
|
|
138
|
+
|
|
139
|
+
- [#2750](https://github.com/tomtom-internal/maps-sdk-js/pull/2750) [`94d3c8e`](https://github.com/tomtom-internal/maps-sdk-js/commit/94d3c8ea13a3b02631f152a03dd30af42ae5fd55) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: request validation rejects a parameter the service doesn't know, and names it, so a misplaced key such as a top-level `poiCategories` fails with `INVALID_REQUEST` instead of being dropped silently
|
|
140
|
+
|
|
141
|
+
- **Breaking:** services: an unknown parameter rejects with an `unrecognized_keys` issue, and one the service takes inside an object parameter points there: `poiCategories is not a parameter of AlongRouteSearch. Did you mean filters.poiCategories?`. The check reads only the parameters you pass, not the global configuration, and a parameter set to `undefined` counts as absent. `validateRequest: false` skips it
|
|
142
|
+
- **Breaking:** services: an along-route `discoverPlaces` with neither a `query` nor a filter other than `indexes` rejects in validation, rather than with the API's `400 "The requested route cannot be calculated"`
|
|
143
|
+
- services: `calculateRoute` validates `useEntryPoints`, `extendedRouteRepresentations` and `guidance`
|
|
144
|
+
|
|
145
|
+
- [#2777](https://github.com/tomtom-internal/maps-sdk-js/pull/2777) [`158afa7`](https://github.com/tomtom-internal/maps-sdk-js/commit/158afa707ae299e93d9e55044595b1f2ee3183ab) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: a request a service can't build, such as a geometry type geometry search doesn't take sent with `validateRequest: false`, rejects with an `SDKError` coded `INVALID_REQUEST` instead of a plain `Error`, so you can branch on `error.code` as for any other failed call
|
|
146
|
+
|
|
147
|
+
- What the request builder threw is on `cause`, and the message is unchanged.
|
|
148
|
+
- If the parameters passed validation and the request still can't be built, the code is `INTERNAL`.
|
|
149
|
+
|
|
150
|
+
- [#2749](https://github.com/tomtom-internal/maps-sdk-js/pull/2749) [`669e18c`](https://github.com/tomtom-internal/maps-sdk-js/commit/669e18c9e98582fa66ec1193fbac6061a8090948) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: a rate-limited (`429`) call backs off 447 ms before its first retry by default instead of retrying at once, and each wait is drawn between half and all of the backoff, so clients rate-limited together don't retry together
|
|
151
|
+
|
|
152
|
+
- [#2744](https://github.com/tomtom-internal/maps-sdk-js/pull/2744) [`d899f3f`](https://github.com/tomtom-internal/maps-sdk-js/commit/d899f3ffc413ef6182564d46deb67ec026ec7fc0) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - **Breaking:** services: `when` takes a `localDateTime`, a wall-clock time such as `'2026-10-19T08:15:00'` that the routing API reads in the origin's time zone, so you can route at 08:15 in Tokyo from a browser anywhere without a UTC offset
|
|
153
|
+
|
|
154
|
+
- With `arriveBy`, `calculateRoute` reads a `localDateTime` in the time zone of the route's final destination. `calculateReachableRange` takes it with `departAt`
|
|
155
|
+
- The format is `YYYY-MM-DDTHH:mm:ss`, typed as `LocalDateTime`. Request validation rejects a time without seconds, with an offset or a `Z`, a date that doesn't exist, and a `when` with both or neither of `date` and `localDateTime`
|
|
156
|
+
- **Breaking:** `DepartArriveParams` is a union of `{ date }` and `{ localDateTime }`, so code reading `when.date` off it gets `Date | undefined`. Narrow it first, for example with `Extract<DepartArriveParams, { date: Date }>`. Passing `{ option, date }` is unchanged
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- [#2697](https://github.com/tomtom-internal/maps-sdk-js/pull/2697) [`3d9c9a3`](https://github.com/tomtom-internal/maps-sdk-js/commit/3d9c9a34b897cf8eb791096620ed3e18dead1966) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: the style's 3D buildings have softened corners, rounded over the last metre of their walls, and the new `buildings3D.roundedCornerDistanceMeters` knob of `StylingFoundationsModule` sets how far the rounding reaches
|
|
161
|
+
|
|
162
|
+
- map: `0` gives the sharp corners back, and a few metres rounds the buildings. A style that sets its own `fill-extrusion-rounded-corner-distance` keeps it
|
|
163
|
+
- examples: `map-styling-playground` adds a 3D buildings section with the knob
|
|
164
|
+
|
|
165
|
+
- [#2768](https://github.com/tomtom-internal/maps-sdk-js/pull/2768) [`377e6db`](https://github.com/tomtom-internal/maps-sdk-js/commit/377e6db35cf111ae7dee92f5773cea951e8f93ed) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core: `aggregateIntoCells` groups your points into hexagons, squares or your own polygons, such as districts, and gives each cell the median, mean, count, sum, min or max of a value, as GeoJSON polygons any map module draws
|
|
166
|
+
|
|
167
|
+
- core: each point's grid cell comes from its coordinates, so large data sets stay fast, and the cells across the antimeridian stay side by side. `minCount` leaves out the cells with too few points, and `gridOrigin` keeps the cells in place while your points change
|
|
168
|
+
- map: `TrafficAreaAnalyticsModule` finds each tile's hexagon or square from its coordinates on the same cell grid, instead of testing it against every cell, and draws the same cells as before
|
|
169
|
+
- examples: `byod-geojson-cells-custom-module` colours Berlin by the median asking price per square metre in each hexagon or square
|
|
170
|
+
|
|
171
|
+
- [#2746](https://github.com/tomtom-internal/maps-sdk-js/pull/2746) [`1d0f01d`](https://github.com/tomtom-internal/maps-sdk-js/commit/1d0f01d454e1906311653ba27e3cd28ead030a00) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core: `servesGeopoliticalView(view, api)` tells whether the SDK sends a geopolitical view to an API, so you can label a result with the view its request carried
|
|
172
|
+
|
|
173
|
+
- core: `GeopoliticalViewAPI` names the APIs it answers for: `'mapTiles'`, `'search'`, `'placeDetails'`, `'reverseGeocoding'` and `'geocoding'`
|
|
174
|
+
- map, services: the map's tiles and every search, place details, reverse geocoding and geocoding request decide which view to send from it, so your label and the request always agree
|
|
175
|
+
- examples: `geopolitical-views-playground` labels each address with the view its reverse geocoding request carried
|
|
176
|
+
|
|
177
|
+
- [#2709](https://github.com/tomtom-internal/maps-sdk-js/pull/2709) [`d7c6017`](https://github.com/tomtom-internal/maps-sdk-js/commit/d7c6017d33623dfdd8f7157e34c846beed0e3518) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core, services, map: exported classes keep their names in the minified bundles, so `SDKError.name` is `'SDKError'`, `TomTomConfig.name` is `'TomTomConfig'` and `RoutingModule.name` is `'RoutingModule'`
|
|
178
|
+
|
|
179
|
+
- [#2747](https://github.com/tomtom-internal/maps-sdk-js/pull/2747) [`aa774bd`](https://github.com/tomtom-internal/maps-sdk-js/commit/aa774bd738ad7af7a8f9cd37b9036eb25ec3b158) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: Add your own credits to the map's attribution with `attribution: { credits }` on `TomTomMap`. They show next to TomTom's and stay across style switches.
|
|
180
|
+
|
|
181
|
+
- examples: `byod-geojson-heatmap-custom-module` credits its listed-buildings dataset in the map's attribution
|
|
182
|
+
|
|
183
|
+
- [#2727](https://github.com/tomtom-internal/maps-sdk-js/pull/2727) [`38c246a`](https://github.com/tomtom-internal/maps-sdk-js/commit/38c246acc98f827acb8ad9c039330d381a933f43) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: `setMapColors` paints city parks and sport grounds with `park` on every standard style, where `streetDark` and the mono styles gave them `artificial`'s colour
|
|
184
|
+
|
|
185
|
+
- map: with `park` left unset, the parks keep the style's own colour whatever `artificial` is set to
|
|
186
|
+
|
|
187
|
+
- [#2754](https://github.com/tomtom-internal/maps-sdk-js/pull/2754) [`7521d57`](https://github.com/tomtom-internal/maps-sdk-js/commit/7521d571a8528cc02badcc74b271cb7428c77aab) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: `TrafficIncidentDetailsModule` fades every incident outside the focus set with the new `highlight.unfocusedOpacityFactor`, so the incidents you focus are the ones that stand out
|
|
188
|
+
|
|
189
|
+
- map: it fades their lines, icons and delay text while a focus is set, multiplies `line.opacity`, leaves a hovered or clicked incident at full strength and survives a style change. It's `1` by default, which leaves them as they are, and the `highlight.unfocusedOpacityFactor` knob sets it by id
|
|
190
|
+
- examples: `traffic-incident-details` fades the other incidents when you click one
|
|
191
|
+
|
|
192
|
+
- [#2716](https://github.com/tomtom-internal/maps-sdk-js/pull/2716) [`f58a405`](https://github.com/tomtom-internal/maps-sdk-js/commit/f58a4058a7564b1e5ccaf0467b91df306914bf54) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - map: the map language labels the map in `zh-Hant`, `zh-Hans`, `ko-Latn-KR`, `ru-Latn-RU`, `ngt-Latn` and `nb-NO` too, where those showed the local name or the wrong script
|
|
193
|
+
|
|
194
|
+
- examples: `map-language` offers Simplified and Traditional Chinese
|
|
195
|
+
|
|
196
|
+
- [#2736](https://github.com/tomtom-internal/maps-sdk-js/pull/2736) [`a67b68d`](https://github.com/tomtom-internal/maps-sdk-js/commit/a67b68d05fc97280748c14ed433dbc55e437d6c5) Thanks [@AlvaroGraca-TomTom](https://github.com/AlvaroGraca-TomTom)! - map: with a proxy `commonBaseURL`, the map sends credentials and TomTom headers only to URLs on the proxy's own origin and under its path, not to a host or path that only starts with the same text
|
|
197
|
+
|
|
198
|
+
- [#2742](https://github.com/tomtom-internal/maps-sdk-js/pull/2742) [`2fcc1ab`](https://github.com/tomtom-internal/maps-sdk-js/commit/2fcc1abc07bcdf89aff3942ff1207637ed00f419) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - core, services, map: the `license` field reads `SEE LICENSE IN LICENSE.txt`, the form npm and license scanners recognise, so they point to the package's own `LICENSE.txt` instead of reporting an unknown license
|
|
199
|
+
|
|
200
|
+
- [#2714](https://github.com/tomtom-internal/maps-sdk-js/pull/2714) [`ae29916`](https://github.com/tomtom-internal/maps-sdk-js/commit/ae29916a1389e3d9ba9a5c378ea85c141d435389) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - services: `getSearchSuggestions` validates its own parameters before sending either request, so an invalid `filters.boundingBox` rejects under that name rather than `geoBias`, and an invalid call costs no request
|
|
201
|
+
|
|
202
|
+
- [#2717](https://github.com/tomtom-internal/maps-sdk-js/pull/2717) [`d089a5c`](https://github.com/tomtom-internal/maps-sdk-js/commit/d089a5c3f7d1ce419a18a0dc8a26607b2f5263d3) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - services: geometry search sends a closed polygon ring of 50 vertices whole and samples a longer one to 50 evenly spaced vertices, where a ring just over a multiple of 50 sent as few as 26
|
|
203
|
+
|
|
204
|
+
- [#2766](https://github.com/tomtom-internal/maps-sdk-js/pull/2766) [`22215a6`](https://github.com/tomtom-internal/maps-sdk-js/commit/22215a65286f7a6bd274c2aa6bb75cf81e5fee1e) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - services: `createLatestRequest({ supersede: 'on-answer' })` shows each answer of requests that start faster than they answer, such as a route re-planned during a drag, and never an older answer after a newer one
|
|
205
|
+
|
|
206
|
+
- [#2705](https://github.com/tomtom-internal/maps-sdk-js/pull/2705) [`4ff91a2`](https://github.com/tomtom-internal/maps-sdk-js/commit/4ff91a2a6c9e62e5c3ec8db8f15e12d692d86aa3) Thanks [@DanielForniessoria-TomTom](https://github.com/DanielForniessoria-TomTom)! - services: along-route `discoverPlaces` rejects a `maxDetourTimeSeconds` above `3600`, the service's maximum, in request validation rather than after a round trip
|
|
207
|
+
|
|
3
208
|
## 1.0.0-rc.3
|
|
4
209
|
|
|
5
210
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -67,8 +67,8 @@ It's built on [MapLibre GL JS](https://docs.tomtom.com/maps-sdk-js/guides/map/ab
|
|
|
67
67
|
- **Node.js 22+** at install time, the minimum the package declares, whether or not you target the browser. Any package manager works: npm, pnpm or Yarn.
|
|
68
68
|
- **A browser with WebGL** for the Map bundle.
|
|
69
69
|
- **A bundler** such as Vite or webpack, because the SDK ships as ES modules. Under Vite, `TomTomMap` sets up MapLibre's web worker on its own; [Vite projects](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup#vite-projects) says when another bundler, such as webpack, needs it set up by hand.
|
|
70
|
-
- **Peer dependencies**, installed by the commands above: MapLibre GL JS 6.
|
|
71
|
-
- **TypeScript is optional**: the type definitions ship with the package
|
|
70
|
+
- **Peer dependencies**, installed by the commands above: MapLibre GL JS 6.15+, Turf 7, culori 4, Lodash 4 and Zod 4.
|
|
71
|
+
- **TypeScript is optional**: the SDK's own type definitions ship with the package. The GeoJSON types come from `@types/geojson`, which you install yourself under pnpm ([TypeScript support](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup#typescript-support)).
|
|
72
72
|
|
|
73
73
|
[Project setup](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup) has the full requirements and the [React, Vue and Node.js](https://docs.tomtom.com/maps-sdk-js/introduction/project-setup#framework-specific-setup) setups.
|
|
74
74
|
|
|
@@ -129,8 +129,9 @@ Separate packages, each declaring the SDK as a peer dependency:
|
|
|
129
129
|
| [**Map Theme**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/map-theme) | Themes the map from a brand's swatches, your page's CSS, a logo or a photo |
|
|
130
130
|
| [**Map Effects**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/map-effects) | Post-processing such as bloom, depth of field, colour grading and vignette, on any style |
|
|
131
131
|
| [**Fly-over**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/flyover) | A camera that flies along a route, framing the junctions ahead |
|
|
132
|
+
| [**Route dragging**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/route-dragging) | Lets your users edit a route by dragging its stops and its line, re-planned as they drag |
|
|
132
133
|
| [**Viewport places**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/viewport-places) | Keeps search results for the visible map area on the map as it moves |
|
|
133
|
-
| [**Landmarks 3D**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/landmarks-3d) | Detailed 3D models of recognizable buildings, in Private Preview |
|
|
134
|
+
| [**Landmarks 3D**](https://docs.tomtom.com/maps-sdk-js/guides/plugins/landmarks-3d) | Detailed 3D models of recognizable buildings, in Private Preview, and the base map's buildings in 3D with windows, lights and shadows |
|
|
134
135
|
|
|
135
136
|
## Coming from MapLibre GL JS
|
|
136
137
|
|
|
@@ -150,6 +151,7 @@ Where the SDK has a feature for the job, prefer it. It survives style switches a
|
|
|
150
151
|
- [**Where your API key runs**](https://docs.tomtom.com/maps-sdk-js/guides/security/where-your-api-key-runs): anyone who opens the page can read a key used from the browser, but not one used from Node.js.
|
|
151
152
|
- [**Proxying your API calls**](https://docs.tomtom.com/maps-sdk-js/guides/security/proxying-api-calls): keep the key on your server by routing the SDK's requests through your own proxy, then [harden that proxy](https://docs.tomtom.com/maps-sdk-js/guides/security/hardening-your-proxy).
|
|
152
153
|
- [**What the SDK sends, and where**](https://docs.tomtom.com/maps-sdk-js/guides/security/what-the-sdk-sends): the data your users' browsers send to TomTom, for your privacy notice.
|
|
154
|
+
- [**Reporting a vulnerability**](https://github.com/tomtom-international/maps-sdk-js/security/policy): report it privately, never in a public issue. When we fix one, we publish a GitHub security advisory and deprecate the affected versions on npm.
|
|
153
155
|
|
|
154
156
|
## Resources for AI agents
|
|
155
157
|
|
package/THIRD_PARTY.txt
CHANGED
|
@@ -152,7 +152,7 @@ terms above.
|
|
|
152
152
|
---
|
|
153
153
|
|
|
154
154
|
Name: maplibre-gl
|
|
155
|
-
Version: 6.
|
|
155
|
+
Version: 6.15.0
|
|
156
156
|
License: BSD-3-Clause
|
|
157
157
|
Bundled: false (peer dependency)
|
|
158
158
|
Required by: map
|
|
@@ -283,7 +283,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
283
283
|
---
|
|
284
284
|
|
|
285
285
|
Name: zod
|
|
286
|
-
Version: 4.6.
|
|
286
|
+
Version: 4.6.7
|
|
287
287
|
License: MIT
|
|
288
288
|
Bundled: false (peer dependency)
|
|
289
289
|
Required by: services
|
package/core/dist/core.es.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{distance,nearestPointOnLine}from"@turf/turf";import{isNil}from"lodash-es";var definedFields=A=>Object.fromEntries(Object.entries(A??{}).filter(([,A])=>void 0!==A)),pickKeys=(A,E)=>Object.fromEntries(E.filter(E=>E in A).map(E=>[E,A[E]])),DEFAULT_COMMON_BASE_URL="https://api.tomtom.com",defaultRetryConfig={initialWaitMs:.447,backoffFactor:1.618,timeoutMs:4e4},defaultConfig={commonBaseURL:"https://api.tomtom.com",apiKey:"",retry:defaultRetryConfig},withRetryDefaults=(...A)=>A.reduce((A,E)=>({...A,...definedFields(E)}),{...defaultRetryConfig}),copyOfDefaultConfig=()=>({...defaultConfig,retry:withRetryDefaults()}),TomTomConfig=class A{static{this.instance=new A}constructor(){this.config=copyOfDefaultConfig()}put(A){this.config={...this.config,...A,...A.retry&&{retry:withRetryDefaults(A.retry)}}}reset(){this.config=copyOfDefaultConfig()}get(){return this.config}},mergeFromGlobal=(A={})=>{const E=TomTomConfig.instance.get(),R={...E,...A};return{...R,retry:R.retry&&withRetryDefaults(E.retry,A.retry)}},isProxyCredentialsMode=(A=TomTomConfig.instance.get())=>!A.apiKey&&"https://api.tomtom.com"!==(A.commonBaseURL??"https://api.tomtom.com"),LOOPBACK_IPV4=/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,isSecureBaseURL=A=>{let E;try{E=new URL(A)}catch{return!0}if("https:"===E.protocol)return!0;const{hostname:R}=E;return"http:"===E.protocol&&("localhost"===R||R.endsWith(".localhost")||"[::1]"===R||LOOPBACK_IPV4.test(R))},insecureBaseURLMessage=A=>`commonBaseURL ${A} is not https:, so requests to it would carry the API key in the clear; only loopback addresses may use http:.`,geopoliticalViews=["Unified","AE","AR","BN","CL","CN","DZ","IL","IN","KR","MA","MY","PH","PK","RS","RU","TR","TW","US","VN"],languages=["ngt","ngt-Latn","ar","bg-BG","zh-Hant","zh-Hans","cs-CZ","da-DK","nl-NL","en-AU","en-CA","en-GB","en-NZ","en-US","fi-FI","fr-FR","de-DE","el-GR","hu-HU","id-ID","it-IT","ko-KR","ko-Latn-KR","lt-LT","ms-MY","nb-NO","pl-PL","pt-BR","pt-PT","ru-RU","ru-Latn-RU","ru-Cyrl-RU","sk-SK","sl-SI","es-ES","es-MX","sv-SE","th-TH","tr-TR"],chargingPointCapabilities=["ChargingProfileCapable","ChargingPreferencesCapable","ChipCardSupport","ContactlessCardSupport","CreditCardPayable","DebitCardPayable","PedTerminal","RemoteStartStopCapable","Reservable","RfidReader","StartSessionConnectorRequired","TokenGroupCapable","UnlockCapable","PlugAndCharge","Unknown"],chargingPointRestrictions=["EvOnly","Plugged","Disabled","Customers","Motorcycles"],connectorTypes=["StandardHouseholdCountrySpecific","IEC62196Type1","IEC62196Type1CCS","IEC62196Type2CableAttached","IEC62196Type2Outlet","IEC62196Type2CCS","IEC62196Type3","Chademo","GBT20234Part2","GBT20234Part3","IEC60309AC3PhaseRed","IEC60309AC1PhaseBlue","IEC60309DCWhite","Tesla"],currentTypes=["AC1","AC3","DC"],geographyTypes=["Country","CountrySubdivision","CountrySecondarySubdivision","CountryTertiarySubdivision","Municipality","MunicipalitySubdivision","MunicipalitySecondarySubdivision","Neighbourhood","PostalCodeArea"],placeTypes=["POI","Street","Geography","Point Address","Address Range","Cross Street"],poiCategories=["ABORIGINAL_LAND","ADVENTURE_SPORTS_FACILITY","ADVENTURE_VEHICLE_TRAIL","ADVERTISING_COMPANY","AFGHAN_RESTAURANT","AFRICAN_RESTAURANT","AGRICULTURAL_SUPPLIES","AGRICULTURAL_TECHNOLOGY","AGRICULTURE","AIRFIELD","AIRLINE_ACCESS","AIRLINE_COMPANY","AIRPORT","AMBULANCE_UNIT","AMERICAN_RESTAURANT","AMPHITHEATER","AMUSEMENT_PARK","AMUSEMENT_PARK_GENERIC","AMUSEMENT_PLACE","ANIMAL_SERVICE","ANIMAL_SHELTER","ANTIQUE_ART_SHOP","APARTMENT_RENTAL","AQUATIC_ZOO","ARABIAN_RESTAURANT","ARBORETA_AND_BOTANICAL_GARDENS","ARCH","ARMENIAN_RESTAURANT","ART_SCHOOL","ASIAN_RESTAURANT","ATHLETICS_TRACK","ATM","ATV_DEALER","AUSTRALIAN_RESTAURANT","AUSTRIAN_RESTAURANT","AUTOMOBILE_COMPANY","AUTOMOBILE_MANUFACTURING","BAGS_LEATHERWEAR","BAKERY","BANDB_OR_GUEST_HOUSE","BANK","BANQUET_ROOMS","BAR","BARBECUE_RESTAURANT","BASEBALL_PARK","BASKETBALL_ARENA","BASQUE_RESTAURANT","BATTLEFIELD","BAY","BEACH","BEACH_CLUB","BEAUTY_SALON","BEAUTY_SUPPLIES","BELGIAN_RESTAURANT","BETTING_STATION","BISTRO","BLOOD_BANK","BOATING_EQUIPMENT_AND_ACCESSORIES","BOAT_DEALER","BOAT_LAUNCHING_RAMP","BODYSHOP","BOLIVIAN_RESTAURANT","BOOK_SHOP","BORDER_CONTROL","BOWLING_CENTER","BRAZILIAN_RESTAURANT","BRIDGE","BRITISH_RESTAURANT","BUFFET_RESTAURANT","BUILDING","BULGARIAN_RESTAURANT","BUNGALOW_RENTAL","BURMESE_RESTAURANT","BUSINESS_PARK","BUSINESS_SERVICES","BUS_CHARTER_COMPANY","BUS_DEALER","BUS_LINES","BUS_STOP","BUTCHER","CABARET_THEATER","CABINS_LODGES","CABLE_AND_TELEPHONE_COMPANY","CAFE","CAFETERIA","CAFE_PUB","CALIFORNIAN_RESTAURANT","CAMBODIAN_RESTAURANT","CAMERAS_AND_PHOTOGRAPHY","CAMPING_GROUND","CANADIAN_RESTAURANT","CANNABIS_SHOP","CAPE","CARAVAN_SITE","CARIBBEAN_RESTAURANT","CARPET_FLOOR_COVERINGS","CAR_DEALER","CAR_GLASS_REPLACEMENT_SHOP","CAR_RENTAL","CAR_REPAIR_AND_SERVICE","CAR_WASH","CAR_WASH_GENERIC","CASINO_AND_GAMBLING","CATERING_SERVICES","CAVE","CEMETERY","CHALET_RENTAL","CHARGING_LOCATION","CHEMICAL_COMPANY","CHICKEN_RESTAURANT","CHILDCARE","CHILDREN_S_CLOTHES","CHILEAN_RESTAURANT","CHINESE_RESTAURANT","CHRISTMAS_OR_HOLIDAY_SHOP","CHURCH","CINEMA","CLEANING_SERVICES","CLOTHING_SHOP","CLUB_AND_ASSOCIATION","COCKTAIL_BAR","COFFEE_SHOP","COLLEGE_OR_UNIVERSITY","COLLEGE_OR_UNIVERSITY_GENERIC","COLOMBIAN_RESTAURANT","COMEDY_CLUB","COMMERCIAL_BUILDING","COMMUNITY_CENTER","COMPANY","COMPUTER_AND_COMPUTER_SUPPLIES","COMPUTER_AND_DATA_SERVICES","CONCERT_HALL","CONSTRUCTION_COMPANY","CONSTRUCTION_MATERIAL_AND_EQUIPMENT","CONSUMER_ELECTRONICS","CONVENIENCE_STORE","CORSICAN_RESTAURANT","COTTAGE_RENTAL","COURIER_DROP_BOX","COURTHOUSE","COVE","CREOLE_RESTAURANT","CREPERIE","CRICKET_GROUND","CUBAN_RESTAURANT","CULTURAL_CENTER","CURTAINS_TEXTILES","CZECH_RESTAURANT","C_DS_DVD_VIDEOS","DAM","DANCE_STUDIO_AND_SCHOOL","DANISH_RESTAURANT","DELICATESSEN","DELIVERY_SERVICE","DENTIST","DEPARTMENT_STORE","DINNER_THEATER","DISCO_CLUB","DIVERSIFIED_FINANCIALS","DOCTOR","DONGBEI_RESTAURANT","DOUGHNUT_RESTAURANT","DO_IT_YOURSELF_CENTERS","DRIVE_IN_MOVIES","DRIVE_THROUGH_BOTTLE_SHOP","DRIVING_SCHOOL","DRUG_STORE","DRY_CLEANER","DUNE","DUTCH_RESTAURANT","EGYPTIAN_RESTAURANT","ELECTRICAL_APPLIANCES_SHOP","ELECTRONICS_COMPANY","EMBASSY","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","ENGLISH_RESTAURANT","ENTERTAINMENT","EQUIPMENT_RENTAL","ETHIOPIAN_RESTAURANT","EXCHANGE","EXHIBITION_CONVENTION_CENTER","FACTORY_OUTLET","FAIRGROUND","FARM","FARMERS_MARKET","FAST_FOOD","FERRY_TERMINAL","FINNISH_RESTAURANT","FIRE_STATION","FISHING_AND_HUNTING_AREA","FISHMONGER","FITNESS_CLUB_AND_CENTER","FLATS_OR_APARTMENT_COMPLEX","FLORISTS","FLYING_CLUB","FONDUE_RESTAURANT","FOOD_AND_DRINKS_SHOP","FOOD_MARKET","FOOTBALL_STADIUM","FOOTWEAR_SHOE_REPAIRS","FOREIGN_EXCHANGE","FOREST_AREA","FRENCH_RESTAURANT","FUEL_STATION","FUNERAL_SERVICE_AND_MORTUARIES","FURNITURE_HOME_FURNISHINGS","FUSION_RESTAURANT","GARDEN_CENTERS_SERVICES","GENERAL_HOSPITAL_AND_POLYCLINIC","GENERAL_PRACTITIONER","GERMAN_RESTAURANT","GIFTS_CARDS_NOVELTIES_SOUVENIRS","GLASSWARE_CERAMIC_SHOP","GLASS_WINDOWS_STORE","GOLD_EXCHANGE","GOLF_COURSE","GOVERNMENT_OFFICE","GREEK_RESTAURANT","GREENGROCER","GRILL_RESTAURANT","GROCERY_STORE","GURUDWARA","HAIRDRESSER","HAMBURGER_RESTAURANT","HARBOR","HARDWARE_STORE","HAWAIIAN_RESTAURANT","HEALTHCARE_SERVICE","HELIPORT_OR_HELIPAD","HIGH_SCHOOL","HIKING_TRAIL","HILL","HISTORICAL_PARK","HISTORIC_SITE","HOBBY_SHOP","HOCKEY_CLUB","HOLIDAY_RENTAL","HOME_APPLIANCE_REPAIR","HORSE_RACING_TRACK","HORSE_RIDING","HORSE_RIDING_TRAIL","HORTICULTURE","HOSPITAL","HOSPITAL_FOR_WOMEN_AND_CHILDREN","HOSPITAL_OF_CHINESE_MEDICINE","HOSTEL","HOTEL","HOTEL_OR_MOTEL","HOT_POT_RESTAURANT","HOUSE_AND_GARDEN_FURNITURE_AND_FITTINGS","HUNAN_RESTAURANT","HUNGARIAN_RESTAURANT","ICE_CREAM_PARLOR","ICE_HOCKEY_ARENA","ICE_RINK","IMPORT_OR_EXPORT_AND_DISTRIBUTION","INDIAN_RESTAURANT","INDONESIAN_RESTAURANT","INDUSTRIAL_BUILDING","INFORMAL_MARKET","INSURANCE_COMPANY","INTERNATIONAL_RAILROAD_STATION","INTERNATIONAL_RESTAURANT","INTERNET_CAFE","INVESTMENT_ADVISOR","IRANIAN_RESTAURANT","IRISH_RESTAURANT","ISLAND","ISRAELI_RESTAURANT","ITALIAN_RESTAURANT","JAMAICAN_RESTAURANT","JAPANESE_RESTAURANT","JAZZ_CLUB","JEWELRY_CLOCKS_WATCHES","JEWISH_RESTAURANT","JUICE_BAR","JUNIOR_COLLEGE_OR_COMMUNITY_COLLEGE","KARAOKE_CLUB","KITCHENS_BATHROOMS","KOREAN_RESTAURANT","KOSHER_RESTAURANT","LANGUAGE_SCHOOL","LATIN_AMERICAN_RESTAURANT","LAUNDRY","LEBANESE_RESTAURANT","LEGAL_SERVICES","LEISURE_CENTER","LIGHTING_SHOPS","LOCALE","LOCAL_SPECIALITIES_SHOP","LOTTERY_SHOP","MALL","MANUFACTURING_COMPANY","MANUFACTURING_FACILITY","MARINA","MARINA_GENERIC","MARKETPLACE","MARSH","MAUSOLEUM_OR_GRAVE","MECHANICAL_ENGINEERING","MEDIA_FACILITY","MEDICAL_SUPPLIES_EQUIPMENT","MEDICINAL_AND_RECREATIONAL_DISPENSARY","MEDICINAL_MARIJUANA_DISPENSARY","MEDITERRANEAN_RESTAURANT","MEMORIAL","MEN_S_CLOTHING","MEXICAN_RESTAURANT","MICROBREWERY","MIDDLE_EASTERN_RESTAURANT","MIDDLE_SCHOOL","MILITARY_AIRPORT","MINERAL_OR_HOT_SPRINGS","MINING_COMPANY","MOBILE_PHONE_SHOP","MONGOLIAN_RESTAURANT","MONUMENT","MOROCCAN_RESTAURANT","MOSQUE","MOTEL","MOTORCYCLE_DEALER","MOTORCYCLE_REPAIR","MOTORING_ORGANIZATION_OFFICE","MOTOR_RACING_STADIUM","MOUNTAIN_BIKE_TRAIL","MOUNTAIN_PASS","MOUNTAIN_PEAK","MOVIE_THEATER","MOVING_AND_STORAGE_COMPANY","MULTI_PURPOSE_STADIUM","MUSEUM","MUSIC_CENTER","MUSIC_INSTRUMENTS_STORE","NAIL_SALON","NATIONAL_RAILROAD_STATION","NATURAL_FEATURE","NATURAL_TOURIST_ATTRACTION","NEPALESE_RESTAURANT","NETBALL_STADIUM","NEWSAGENTS_TOBACCONISTS","NIGHTLIFE","NON_GOVERNMENTAL_ORGANIZATION","NORWEGIAN_RESTAURANT","OASIS","OBSERVATORY","OFFICE_EQUIPMENT","OIL_AND_NATURAL_GAS","OPEN_CAR_PARKING_AREA","OPEN_CAR_PARKING_AREA_GENERIC","OPERA_HOUSE","OPTICIAN","ORGANIC_FOOD_RESTAURANT","ORIENTAL_RESTAURANT","PAGODA","PAINTING_DECORATING","PAKISTANI_RESTAURANT","PAN","PARK","PARKING_GARAGE","PARKWAY","PARK_AND_RECREATION_AREA","PASSENGER_TRANSPORT_TICKET_OFFICE","PAWN_SHOP","PEDESTRIAN_SUBWAY","PERSONAL_CARE_FACILITY","PERSONAL_SERVICE","PERUVIAN_RESTAURANT","PET_SUPPLIES","PHARMACEUTICAL_COMPANY","PHARMACY","PHILIPPINE_RESTAURANT","PHOTOCOPY_SHOP","PHOTO_LAB_OR_DEVELOPMENT","PICNIC_AREA","PIZZERIA","PLAIN_OR_FLAT","PLANETARIUM","PLATEAU","POLICE_STATION","POLISH_RESTAURANT","PORTUGUESE_RESTAURANT","PORT_WAREHOUSE_FACILITY","POST_OFFICE","PRE_SCHOOL","PRIMARY_PRODUCER","PRIMARY_RESOURCE_UTILITY","PRIMARY_SCHOOL","PRISON","PRIVATE_AIRPORT","PROTECTED_LAND","PUB","PUBLIC_AIRPORT","PUBLIC_AMENITY","PUBLIC_BATHROOM","PUBLIC_CALL_BOX","PUBLIC_LIBRARY","PUBLIC_MARKET","PUBLIC_TRANSPORT_STOP","PUBLISHING_TECHNOLOGIES","QUARRY","RACE_TRACK","RAILWAY_STATION","RAPIDS","REAL_ESTATE_AGENT","REAL_ESTATE_COMPANY","RECREATIONAL_CAMPING_GROUND","RECREATIONAL_MARIJUANA_DISPENSARY","RECREATIONAL_VEHICLE_DEALER","RECREATION_AREA","RECYCLING_SHOP","REEF","RELIGIOUS_SITE","RENTAL_CAR_PARKING","RESCUE_SERVICE","RESEARCH_FACILITY","RESERVOIR","RESIDENTIAL_ACCOMMODATION","RESIDENTIAL_ENTRANCE","RESORT","RESTAURANT","RESTAURANT_AREA","REST_AREA","REST_CAMP","RETAIL_OUTLET","RETIREMENT_COMMUNITY","RIDGE","RIVER_CROSSING","ROCKS","ROCK_CLIMBING_TRAIL","RUGBY_GROUND","RUSSIAN_RESTAURANT","SALAD_BAR","SANDWICH_RESTAURANT","SAUNA_SOLARIUM_MASSAGE","SCANDINAVIAN_RESTAURANT","SCHOOL","SCHOOL_BUS_COMPANY","SCHOOL_GENERIC","SEAFOOD","SECURED_ENTRANCE","SECURITY_PRODUCTS","SENIOR_HIGH_SCHOOL","SERVICE_COMPANY","SHANDONG_RESTAURANT","SHOPPING_SERVICE","SHOP_OR_STORE","SICHUAN_RESTAURANT","SKI_RESORT","SNACKS_RESTAURANT","SOCCER_STADIUM","SOFTWARE_COMPANY","SOUL_FOOD","SOUP_RESTAURANT","SPANISH_RESTAURANT","SPECIALIST","SPECIALTY_CLOTHING_SHOP","SPECIALTY_FOODS","SPECIAL_HOSPITAL","SPORTS_CENTER","SPORTS_CENTER_GENERIC","SPORTS_EQUIPMENT_AND_CLOTHING","SQUASH_COURT","STADIUM","STATION_ACCESS","STATUE","STEAK_HOUSE","STOCK_EXCHANGE","STREETCAR_STOP","SUBWAY_ENTRANCE","SUBWAY_STATION","SUPERMARKET","SUSHI_RESTAURANT","SWEDISH_RESTAURANT","SWIMMING_POOL","SWISS_RESTAURANT","SYNAGOG","SYRIAN_RESTAURANT","TAILOR_SHOP","TAIWANESE_RESTAURANT","TAKEOUT_FOOD","TAPAS_RESTAURANT","TAXI_LIMOUSINE_AND_SHUTTLE_SERVICE","TAXI_STAND","TAX_SERVICES","TEA_HOUSE","TELECOMMUNICATIONS","TEMPLE","TENNIS_COURT","TEPPANYAKI_RESTAURANT","THAI_RESTAURANT","THEATER","THEATER_GENERIC","THEMATIC_SPORT_CENTER","TIBETAN_RESTAURANT","TIRE_SERVICE","TOLL_GATE","TOURIST_ATTRACTION","TOURIST_INFORMATION","TOWER","TOYS_GAMES_SHOP","TRAFFIC_CONTROL_DEPARTMENT","TRAFFIC_CONTROL_DEPARTMENT_GENERIC","TRAIL_SYSTEM","TRANSPORT_ACCESS","TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION","TRANSPORT_COMPANY","TRAVEL_AGENT","TRUCK_DEALER","TRUCK_REPAIR_AND_SERVICE","TRUCK_STOP","TUNISIAN_RESTAURANT","TUNNEL","TURKISH_RESTAURANT","URBAN_STATION","VALLEY","VAN_DEALER","VARIETY_STORE","VEGETARIAN_RESTAURANT","VEHICLE_DEALER","VEHICLE_REPAIR","VENEZUELAN_RESTAURANT","VETERINARY","VIDEO_RENTAL_SHOP","VIETNAMESE_RESTAURANT","VIEWPOINT","VILLA_RENTAL","VOCATIONAL_SCHOOL","WATER_HOLE","WATER_SPORT","WEDDING_SERVICES","WEIGH_STATION","WEIGH_STATION_GENERIC","WELFARE_ORGANIZATION","WELL","WESTERN_RESTAURANT","WHOLESALE_CLUB","WILDERNESS_AREA","WILDLIFE_PARK","WINERY","WINE_SPIRITS","WOMEN_S_CLOTHING","YACHT_BASIN","ZOO","ZOOS_ARBORETA_BOTANICAL_GARDEN"],budgetTypes=["timeMinutes","distanceKM"],budgetUnits={timeMinutes:"min",distanceKM:"km"},avoidableTypes=["tollRoads","motorways","ferries","unpavedRoads","carpools","alreadyUsedRoads","borderCrossings","tunnels","carTrains","lowEmissionZones"],inputSectionTypes=["carpool","carTrain","country","ferry","importantRoadStretch","lowEmissionZone","motorway","pedestrian","roadShields","speedLimit","toll","tollRoad","tollVignette","traffic","tunnel","unpaved","urban","vehicleRestricted"],inputSectionTypesWithGuidance=/* @__PURE__ */(()=>[...inputSectionTypes,"lanes"])(),sectionTypes=/* @__PURE__ */(()=>[...inputSectionTypesWithGuidance,"leg","distinct"])(),sdkErrorCodes=["INVALID_REQUEST","INSECURE_BASE_URL","INVALID_CREDENTIALS","INSUFFICIENT_PERMISSIONS","NOT_FOUND","RATE_LIMITED","LIVE_SERVICE_NOT_AVAILABLE","NETWORK_NOT_AVAILABLE","ABORTED","WEBGL_UNSUPPORTED","WEBGL_CONTEXT_LOST","STYLE_LOAD_FAILED","INTERNAL"],areaAnalyticsMetricKeys=["speed","freeFlowSpeed","congestionLevel","travelTime","networkLength"],trafficIncidentRequestCategories=["accident","broken-down-vehicle","danger","flooding","fog","frost","jam","lane-closed","other","rain","road-closed","roadworks","wind"],fullTrafficIncidentCategories=/* @__PURE__ */(()=>[...trafficIncidentRequestCategories,"animals-on-road","narrow-lanes"])(),trafficIncidentTimeValidities=["present","future"],isBBoxWithArea=A=>!!A&&A.length>=4&&A[3]!==A[1]&&A[2]!==A[0],bboxOnlyIfWithArea=A=>isBBoxWithArea(A)?A:void 0,bboxExpandedWithPosition=(A,E)=>A?.length>=2?bboxExpandedWithBBox([A[0],A[1],A[0],A[1]],E):void 0,bboxExpandedWithBBox=(A,E)=>E&&A?[E[0]>A[0]?A[0]:E[0],E[1]>A[1]?A[1]:E[1],E[2]<A[2]?A[2]:E[2],E[3]<A[3]?A[3]:E[3]]:A||E,bboxFromBBoxes=A=>A?.length?A.reduce((A,E)=>bboxExpandedWithBBox(E,A)):void 0,bboxFromCoordsArray=A=>{const E=A?.length;if(!E)return;let R;const T=Math.ceil(E/1e3);for(let e=0;e<E;e+=T)R=bboxExpandedWithPosition(A[e],R);return 1===T?R:bboxExpandedWithPosition(A[E-1],R)},bboxFromGeoJSON=A=>{if(!A)return;if(Array.isArray(A))return"number"==typeof A[0]?A.length>=4?A:void 0:bboxFromBBoxes(A.map(A=>bboxFromGeoJSON(A)));const{bbox:E}=A;if(E)return 6===E.length?[E[0],E[1],E[3],E[4]]:E;switch(A.type){case"Feature":return bboxFromGeoJSON(A.geometry);case"FeatureCollection":return bboxFromBBoxes(A.features.map(bboxFromGeoJSON));case"GeometryCollection":return bboxFromBBoxes(A.geometries.map(bboxFromGeoJSON));case"Point":return bboxExpandedWithPosition(A.coordinates);case"LineString":case"MultiPoint":return bboxFromCoordsArray(A.coordinates);case"MultiLineString":case"Polygon":return bboxFromBBoxes(A.coordinates.map(bboxFromCoordsArray));case"MultiPolygon":return bboxFromBBoxes(A.coordinates.flatMap(A=>A.map(bboxFromCoordsArray)));default:return}},bboxCenter=([A,E,R,T])=>{const e=(A+(A>R?R+360:R))/2;return[e>180?e-360:e,(E+T)/2]},polygonFromBBox=A=>{const[E,R,T,e]=A;return{type:"Feature",geometry:{type:"Polygon",coordinates:[[[E,R],[T,R],[T,e],[E,e],[E,R]]]},properties:{}}},generateId=()=>Date.now().toString(36)+Math.random().toString(36).substring(2),getPosition=(A,E)=>{if(A){if(Array.isArray(A))return A;if(A.coordinates)return A.coordinates;if(A.geometry)return"main-when-available"===E?.useEntryPoint?(R=A,R?.properties?.entryPoints?.find(A=>"main"===A.type))?.position??A.geometry.coordinates:A.geometry.coordinates}var R;return null},getPositionStrict=(A,E)=>{const R=getPosition(A,E);if(!R)throw new Error(`The received object does not have lng-lat coordinates: ${JSON.stringify(A)}`);return R},toPointGeometry=A=>({type:"Point",coordinates:A}),clamp=(A,E,R)=>Math.max(E,Math.min(A,R)),projectAlongRouteLocation=(A,E)=>nearestPointOnLine(A,getPositionStrict(E)).properties.totalDistance,findInsertionSlot=(A,E)=>{for(let R=0;R<A.length-1;R++)if(E>=A[R]&&E<=A[R+1])return R+1;return E<A[0]?0:A.length},slotNewWaypoints=(A,E,R)=>{if(!R.length||A.geometry.coordinates.length<2||E.length<2)return R.map(()=>({slot:0,location:0}));const T=E.map(E=>projectAlongRouteLocation(A,E));return R.map(E=>{const R=projectAlongRouteLocation(A,E);return{slot:findInsertionSlot(T,R),location:R}})},findBestWaypointInsertionIndex=(A,E,R)=>findBestWaypointInsertionIndices(A,E,[R])[0],findBestWaypointInsertionIndices=(A,E,R)=>slotNewWaypoints(A,E,R).map(({slot:A})=>A),withInsertedWaypoint=(A,E,R)=>withInsertedWaypoints(A,E,[R]),withInsertedWaypoints=(A,E,R)=>{const T=Array.from({length:E.length+1},()=>[]),e=slotNewWaypoints(A,E,R);for(const[t,{slot:N,location:_}]of e.entries())T[N].push({waypoint:R[t],location:_,inputIndex:t});for(const t of T)t.sort((A,E)=>A.location-E.location||A.inputIndex-E.inputIndex);const I=[];for(let t=0;t<E.length;t++){for(const A of T[t])I.push(A.waypoint);I.push(E[t])}for(const t of T[E.length])I.push(t.waypoint);return I},progressValuesOf=({distanceInMeters:A,travelTimeInSeconds:E})=>void 0===A||void 0===E?void 0:{distanceInMeters:A,travelTimeInSeconds:E},progressBetween=(A,E,R)=>({distanceInMeters:A.distanceInMeters+R*(E.distanceInMeters-A.distanceInMeters),travelTimeInSeconds:A.travelTimeInSeconds+R*(E.travelTimeInSeconds-A.travelTimeInSeconds)}),calculateProgressAtRoutePoint=(A,E)=>{const{progress:R}=A.properties;if(!R||0===R.length)return;const T=A.geometry.coordinates.length;if(E<0||E>=T)return;const e=findBracketingProgressPoints(R,"pointIndex",E);if(!e)return;const{lower:I,lowerValue:t,upper:N,upperValue:_}=e,S=progressValuesOf(I),n=progressValuesOf(N);if(!S||!n)return;if(t===_)return S;const o=lengthShareOfBracket(A.geometry.coordinates,t,E,_);return progressBetween(S,n,o)},getRouteProgressBetween=(A,E,R)=>{const T=calculateProgressAtRoutePoint(A,E),e=calculateProgressAtRoutePoint(A,R);if(T&&e)return{start:T,end:e,delta:{distanceInMeters:e.distanceInMeters-T.distanceInMeters,travelTimeInSeconds:e.travelTimeInSeconds-T.travelTimeInSeconds}}},getRouteProgressForSection=(A,E)=>getRouteProgressBetween(A,E.startPointIndex,E.endPointIndex),getSectionBBox=(A,E)=>{const R=A.geometry.coordinates;if(!R||0===R.length||E.startPointIndex<0||E.endPointIndex>=R.length||E.startPointIndex>E.endPointIndex)return;const T=Math.floor((E.startPointIndex+E.endPointIndex)/2);return bboxFromCoordsArray([R[E.startPointIndex],R[T],R[E.endPointIndex]])},getSectionOverlap=(A,E)=>{const R=Math.max(A.startPointIndex,E.startPointIndex),T=Math.min(A.endPointIndex,E.endPointIndex);return T>R?{startPointIndex:R,endPointIndex:T}:void 0},metersWithin=(A,E,R=[{startPointIndex:0,endPointIndex:A.length-1}])=>R.reduce((R,T)=>{const e=getSectionOverlap(T,E);return R+(e?A[e.endPointIndex]-A[e.startPointIndex]:0)},0),firstIndexPast=(A,E,R)=>{let T=A,e=0,I=A;for(;e<I;){const A=e+I>>>1;let t=A;for(;t<I&&void 0===E(t);)t++;const N=t<I?E(t):void 0;void 0===N?I=A:R(N)?(T=t,I=A):e=t+1}return T},findBracketingProgressPoints=(A,E,R)=>{const T=R=>A[R][E],e=A[firstIndexPast(A.length,T,A=>A>=R)];let I=firstIndexPast(A.length,T,A=>A>R)-1;for(;I>=0&&void 0===A[I][E];)I--;const t=A[I],N=t?.[E],_=e?.[E];return void 0!==N&&void 0!==_?{lower:t,lowerValue:N,upper:e,upperValue:_}:void 0},metersAlongLineCache=/* @__PURE__ */new WeakMap,RADIANS_PER_DEGREE=Math.PI/180,metersAlongLine=A=>{const E=metersAlongLineCache.get(A);if(E?.length===A.length)return E;const R=new Float64Array(A.length);let[T=0,e=0]=A[0]??[],I=Math.cos(e*RADIANS_PER_DEGREE);for(let t=1;t<A.length;t++){const[E,N]=A[t],_=Math.cos(N*RADIANS_PER_DEGREE),S=Math.sin((N-e)*RADIANS_PER_DEGREE/2),n=Math.sin((E-T)*RADIANS_PER_DEGREE/2),o=S*S+n*n*I*_;R[t]=R[t-1]+12742017.6*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)),T=E,e=N,I=_}return metersAlongLineCache.set(A,R),R},segmentAtMeters=(A,E,R,T)=>{const e=firstIndexPast(A.length,E=>A[E],A=>A>=E),I=clamp(e-1,R,T-1),t=A[I+1]-A[I];return{pathIndex:I,share:t>0?clamp((E-A[I])/t,0,1):0}},positionBetween=(A,E,R)=>[A[0]+R*(E[0]-A[0]),A[1]+R*(E[1]-A[1])],lengthShareOfBracket=(A,E,R,T)=>{const e=metersAlongLine(A),I=e[T]-e[E];return I>0?(e[R]-e[E])/I:(R-E)/(T-E)},interpolateProgressAtPathIndex=(A,E,R)=>{const T=A.geometry.coordinates,e=Math.min(E+1,T.length-1),I=calculateProgressAtRoutePoint(A,E),t=calculateProgressAtRoutePoint(A,e);if(I&&t)return{position:positionBetween(T[E],T[e],R),...progressBetween(I,t,R)}},coordinateAtProgressPoint=(A,E)=>{const R=progressValuesOf(E);return R&&{position:A[E.pointIndex],...R}},resolveCoordinateAtProgress=(A,E,R)=>{const{progress:T}=A.properties,e=T?.at(-1);if(!T||!e)return;const I=A.geometry.coordinates,t=T[0],N=t[E],_=e[E];if(void 0===N||void 0===_)return;if(R<=N)return coordinateAtProgressPoint(I,t);if(R>=_)return coordinateAtProgressPoint(I,e);const S=((A,E,R,T)=>{const e=findBracketingProgressPoints(A,R,T);if(!e)return;const{lower:I,lowerValue:t,upper:N,upperValue:_}=e,S=t===_?0:(T-t)/(_-t),n=metersAlongLine(E),o=n[N.pointIndex]-n[I.pointIndex];if(0===o){const A=I.pointIndex+S*(N.pointIndex-I.pointIndex),E=Math.floor(A);return{pathIndex:E,progressRatioTowardsNextPathPoint:A-E}}const O=n[I.pointIndex]+S*o,r=segmentAtMeters(n,O,I.pointIndex,N.pointIndex);return{pathIndex:r.pathIndex,progressRatioTowardsNextPathPoint:r.share}})(T,I,E,R);return void 0!==S?interpolateProgressAtPathIndex(A,S.pathIndex,S.progressRatioTowardsNextPathPoint):void 0},getCoordinateAtRouteProgress=(A,E)=>{if("traveledTimeInSeconds"in E)return resolveCoordinateAtProgress(A,"travelTimeInSeconds",E.traveledTimeInSeconds);if("traveledDistanceInMeters"in E)return resolveCoordinateAtProgress(A,"distanceInMeters",E.traveledDistanceInMeters);const R=A.properties.summary.departureTime;if(!R)return;const T=(E.clockTime.getTime()-R.getTime())/1e3;return T<0?void 0:resolveCoordinateAtProgress(A,"travelTimeInSeconds",T)},getProgressAtNearestRoutePoint=(A,E)=>{const{progress:R}=A.properties,T=A.geometry.coordinates;if(!R?.length||T.length<2)return;const e=nearestPointOnLine(A,getPositionStrict(E)),I=e.properties.segmentIndex,t=Math.min(I+1,T.length-1),N=((A,E,R)=>{const T=R[0]-A[0],e=R[1]-A[1],I=T*T+e*e;if(0===I)return 0;const t=((E[0]-A[0])*T+(E[1]-A[1])*e)/I;return clamp(t,0,1)})(T[I],e.geometry.coordinates,T[t]);return interpolateProgressAtPathIndex(A,I,N)},bucket=A=>Math.round(1e5*A),vertexHash=(A,E)=>Math.imul(Math.imul(A,2654435761)^E,2246822507),holds=(A,E,R,T,e,I)=>A[E]===R&&A[E+1]===T&&A[E+2]===e&&A[E+3]===I,slotOf=(A,E,R,T,e,I,t)=>{const N=vertexHash(T,e)+vertexHash(I,t);let _=6*((N^N>>>15)&A.length/6-1);for(;A[_+4]&&!holds(A,_,T,e,I,t)&&!holds(A,_,I,t,T,e);)_=(_+6)%A.length;return A[_+4]||(A[_]=T,A[_+1]=e,A[_+2]=I,A[_+3]=t,A[_+4]=E+1,A[_+5]=R),_},getDistinctSections=(A,{minLengthInMeters:E=0}={})=>{const R=Array.isArray(A)?A:A.features,{firsts:T,shared:e}=(A=>{const E=new Int32Array(6*2**Math.ceil(Math.log2(1.5*A.reduce((A,E)=>A+E.length,0)+1))),R=A.map(A=>new Int32Array(Math.max(A.length-1,0))),T=R.map(A=>new Uint8Array(A.length)),e=(A,E)=>{T[A][R[A][E]]=1};return A.forEach((T,I)=>{const t=R[I];let N;const[_=0,S=0]=T[0]??[];let n=bucket(_),o=bucket(S);for(let R=0;R<t.length;R++){const _=n,S=o;if(n=bucket(T[R+1][0]),o=bucket(T[R+1][1]),_===n&&S===o){t[R]=-1;continue}t[R]=R;const O=N&&A[N.route][N.vertex+N.step];if(N&&O&&bucket(O[0])===n&&bucket(O[1])===o){e(I,R),e(N.route,Math.min(N.vertex,N.vertex+N.step)),N.vertex+=N.step;continue}const r=slotOf(E,I,R,_,S,n,o),C=E[r+4]-1,i=E[r+5];if(N=void 0,C===I){t[R]=i;continue}e(I,R),e(C,i);const s=E[r]===_&&E[r+1]===S;N={route:C,vertex:s?i+1:i,step:s?1:-1}}}),{firsts:R,shared:T}})(R.map(A=>A.geometry.coordinates));return R.map((A,R)=>{const I=T[R],t=e[R],N=metersAlongLine(A.geometry.coordinates),_=[];let S;for(let T=0;T<=I.length;T++){if(-1===I[T])continue;if(T<I.length&&!t[I[T]]){S??=T;continue}if(void 0===S)continue;const A=N[T]-N[S];A>=E&&_.push({id:generateId(),startPointIndex:S,endPointIndex:T,lengthInMeters:A}),S=void 0}return _})},TOMTOM_USER_AGENT_SDK_NAME="MapsSDKJS",generateTomTomHeaders=A=>!1===A.sendUserAgentHeader?{}:{"tomtom-user-agent":A["tomtom-user-agent"]??"MapsSDKJS/1.0.0-rc.3"},getImportantRoads=(A,{within:E,minLengthInMeters:R=0}={})=>{const T=metersAlongLine(A.geometry.coordinates),e=/* @__PURE__ */new Map,I=[...A.properties.sections.importantRoadStretch??[]].sort((A,E)=>A.startPointIndex-E.startPointIndex);for(const t of I){const A=metersWithin(T,t,E);if(!A)continue;const{index:R,roadNumbers:I=[],streetName:N}=t,_=I[0]??N,S=_??R,n=e.get(S);n?(n.index=Math.min(n.index,R),n.roadNumbers=[.../* @__PURE__ */new Set([...n.roadNumbers,...I])],n.streetName??=N,n.lengthInMeters+=A,n.sections.push(t)):e.set(S,{index:R,..._&&{name:_},roadNumbers:I,...N&&{streetName:N},lengthInMeters:A,sections:[t]})}return[...e.values()].filter(A=>A.lengthInMeters>=R)},getInstructionLanes=(A,E)=>{const R=A.properties.guidance?.instructions??[];if(R.find(A=>A.pathPointIndex===E.pathPointIndex)?.maneuver!==E.maneuver)return;const T=({startPointIndex:E,endPointIndex:T})=>{const e=R.findLast(({pathPointIndex:A})=>E<=A&&A<=T);if(e)return e.pathPointIndex;const I=R.find(({pathPointIndex:A})=>A>T),t=A.geometry.coordinates[T];return I&&t&&distance(t,I.maneuverPoint,{units:"meters"})<=100?I.pathPointIndex:void 0};let e;for(const I of A.properties.sections.lanes??[])(!e||I.endPointIndex>e.endPointIndex)&&T(I)===E.pathPointIndex&&(e=I);return e},poiCategoriesToID={TRAFFIC_CONTROL_DEPARTMENT:7301,TRAFFIC_CONTROL_DEPARTMENT_GENERIC:7301002,TRAIL_SYSTEM:7302,MOUNTAIN_BIKE_TRAIL:7302002,ADVENTURE_VEHICLE_TRAIL:7302003,HIKING_TRAIL:7302004,HORSE_RIDING_TRAIL:7302005,ROCK_CLIMBING_TRAIL:7302006,RESIDENTIAL_ACCOMMODATION:7303,RETIREMENT_COMMUNITY:7303002,FLATS_OR_APARTMENT_COMPLEX:7303003,HOLIDAY_RENTAL:7304,COTTAGE_RENTAL:7304002,VILLA_RENTAL:7304003,BUNGALOW_RENTAL:7304004,CHALET_RENTAL:7304005,APARTMENT_RENTAL:7304006,ADVENTURE_SPORTS_FACILITY:7305,HELIPORT_OR_HELIPAD:7308,CHARGING_LOCATION:7309,VEHICLE_REPAIR:7310,BODYSHOP:7310002,CAR_GLASS_REPLACEMENT_SHOP:7310003,CAR_REPAIR_AND_SERVICE:7310004,TIRE_SERVICE:7310007,MOTORCYCLE_REPAIR:7310008,TRUCK_REPAIR_AND_SERVICE:7310009,FUEL_STATION:7311,CAR_RENTAL:7312,PARKING_GARAGE:7313,HOTEL_OR_MOTEL:7314,BANDB_OR_GUEST_HOUSE:7314002,HOTEL:7314003,HOSTEL:7314004,RESORT:7314005,MOTEL:7314006,CABINS_LODGES:7314007,REST_CAMP:7314008,RESTAURANT:7315,AFRICAN_RESTAURANT:7315002,AMERICAN_RESTAURANT:7315003,AUSTRIAN_RESTAURANT:7315004,BARBECUE_RESTAURANT:7315005,BELGIAN_RESTAURANT:7315006,BISTRO:7315007,BRITISH_RESTAURANT:7315008,CALIFORNIAN_RESTAURANT:7315009,CANADIAN_RESTAURANT:7315010,CARIBBEAN_RESTAURANT:7315011,CHINESE_RESTAURANT:7315012,CREPERIE:7315013,DUTCH_RESTAURANT:7315014,FAST_FOOD:7315015,PHILIPPINE_RESTAURANT:7315016,FRENCH_RESTAURANT:7315017,GERMAN_RESTAURANT:7315018,GREEK_RESTAURANT:7315019,GRILL_RESTAURANT:7315020,HAWAIIAN_RESTAURANT:7315021,HUNGARIAN_RESTAURANT:7315022,INDIAN_RESTAURANT:7315023,INDONESIAN_RESTAURANT:7315024,ITALIAN_RESTAURANT:7315025,JAPANESE_RESTAURANT:7315026,JEWISH_RESTAURANT:7315027,KOREAN_RESTAURANT:7315028,LATIN_AMERICAN_RESTAURANT:7315029,LEBANESE_RESTAURANT:7315030,MEDITERRANEAN_RESTAURANT:7315032,MEXICAN_RESTAURANT:7315033,MIDDLE_EASTERN_RESTAURANT:7315034,ORIENTAL_RESTAURANT:7315035,PIZZERIA:7315036,POLISH_RESTAURANT:7315037,PORTUGUESE_RESTAURANT:7315038,RUSSIAN_RESTAURANT:7315040,SANDWICH_RESTAURANT:7315042,SEAFOOD:7315043,SPANISH_RESTAURANT:7315044,STEAK_HOUSE:7315045,SWISS_RESTAURANT:7315047,THAI_RESTAURANT:7315048,TURKISH_RESTAURANT:7315049,VEGETARIAN_RESTAURANT:7315050,VIETNAMESE_RESTAURANT:7315051,HUNAN_RESTAURANT:7315052,SHANDONG_RESTAURANT:7315053,SICHUAN_RESTAURANT:7315056,DONGBEI_RESTAURANT:7315057,HOT_POT_RESTAURANT:7315058,TAIWANESE_RESTAURANT:7315059,WESTERN_RESTAURANT:7315060,PERUVIAN_RESTAURANT:7315061,ASIAN_RESTAURANT:7315062,CREOLE_RESTAURANT:7315063,SOUL_FOOD:7315064,IRISH_RESTAURANT:7315065,JAMAICAN_RESTAURANT:7315066,KOSHER_RESTAURANT:7315067,CZECH_RESTAURANT:7315068,HAMBURGER_RESTAURANT:7315069,CHICKEN_RESTAURANT:7315070,FUSION_RESTAURANT:7315071,BRAZILIAN_RESTAURANT:7315072,INTERNATIONAL_RESTAURANT:7315073,MOROCCAN_RESTAURANT:7315074,ORGANIC_FOOD_RESTAURANT:7315075,TAPAS_RESTAURANT:7315076,ICE_CREAM_PARLOR:7315078,DOUGHNUT_RESTAURANT:7315079,AFGHAN_RESTAURANT:7315081,ARABIAN_RESTAURANT:7315083,ARMENIAN_RESTAURANT:7315085,AUSTRALIAN_RESTAURANT:7315086,BASQUE_RESTAURANT:7315087,BOLIVIAN_RESTAURANT:7315088,BULGARIAN_RESTAURANT:7315090,BURMESE_RESTAURANT:7315091,CAMBODIAN_RESTAURANT:7315092,CHILEAN_RESTAURANT:7315093,COLOMBIAN_RESTAURANT:7315094,CORSICAN_RESTAURANT:7315095,CUBAN_RESTAURANT:7315096,DANISH_RESTAURANT:7315098,EGYPTIAN_RESTAURANT:7315100,ENGLISH_RESTAURANT:7315101,ETHIOPIAN_RESTAURANT:7315102,FINNISH_RESTAURANT:7315104,IRANIAN_RESTAURANT:7315105,ISRAELI_RESTAURANT:7315106,MONGOLIAN_RESTAURANT:7315110,NEPALESE_RESTAURANT:7315111,NORWEGIAN_RESTAURANT:7315112,SCANDINAVIAN_RESTAURANT:7315114,SWEDISH_RESTAURANT:7315119,SYRIAN_RESTAURANT:7315120,TEPPANYAKI_RESTAURANT:7315121,TIBETAN_RESTAURANT:7315122,TUNISIAN_RESTAURANT:7315123,VENEZUELAN_RESTAURANT:7315125,PAKISTANI_RESTAURANT:7315127,FONDUE_RESTAURANT:7315134,SNACKS_RESTAURANT:7315139,SOUP_RESTAURANT:7315140,BUFFET_RESTAURANT:7315142,SALAD_BAR:7315143,TAKEOUT_FOOD:7315145,BANQUET_ROOMS:7315146,CAFETERIA:7315147,SUSHI_RESTAURANT:7315148,JUICE_BAR:7315149,TOURIST_INFORMATION:7316,MUSEUM:7317,THEATER:7318,CONCERT_HALL:7318002,MUSIC_CENTER:7318003,OPERA_HOUSE:7318004,THEATER_GENERIC:7318005,CABARET_THEATER:7318006,AMPHITHEATER:7318007,DINNER_THEATER:7318008,CULTURAL_CENTER:7319,SPORTS_CENTER:7320,FITNESS_CLUB_AND_CENTER:7320002,HORSE_RIDING:7320003,SPORTS_CENTER_GENERIC:7320004,THEMATIC_SPORT_CENTER:7320005,SQUASH_COURT:7320006,HOSPITAL:7321,GENERAL_HOSPITAL_AND_POLYCLINIC:7321002,SPECIAL_HOSPITAL:7321003,HOSPITAL_OF_CHINESE_MEDICINE:7321004,HOSPITAL_FOR_WOMEN_AND_CHILDREN:7321005,POLICE_STATION:7322,POST_OFFICE:7324,PHARMACY:7326,DEPARTMENT_STORE:7327,BANK:7328,MARKETPLACE:7332,INFORMAL_MARKET:7332002,PUBLIC_MARKET:7332003,FARMERS_MARKET:7332004,SUPERMARKET:7332005,AGRICULTURE:7335,HORTICULTURE:7335002,PRIMARY_PRODUCER:7335003,FARM:7335004,VIEWPOINT:7337,SWIMMING_POOL:7338,RELIGIOUS_SITE:7339,CHURCH:7339002,MOSQUE:7339003,SYNAGOG:7339004,TEMPLE:7339005,GURUDWARA:7339006,PAGODA:7339008,CASINO_AND_GAMBLING:7341,CINEMA:7342,MOVIE_THEATER:7342002,DRIVE_IN_MOVIES:7342003,MARINA:7347,MARINA_GENERIC:7347002,YACHT_BASIN:7347003,WINERY:7349,FERRY_TERMINAL:7352,TRUCK_STOP:7358,WEIGH_STATION:7359,WEIGH_STATION_GENERIC:7359002,CAMPING_GROUND:7360,RECREATIONAL_CAMPING_GROUND:7360002,CARAVAN_SITE:7360003,COMMUNITY_CENTER:7363,EMBASSY:7365,BORDER_CONTROL:7366,GOVERNMENT_OFFICE:7367,MOTORING_ORGANIZATION_OFFICE:7368,OPEN_CAR_PARKING_AREA:7369,OPEN_CAR_PARKING_AREA_GENERIC:7369002,SCHOOL:7372,SCHOOL_GENERIC:7372002,CHILDCARE:7372003,PRE_SCHOOL:7372004,PRIMARY_SCHOOL:7372005,HIGH_SCHOOL:7372006,SENIOR_HIGH_SCHOOL:7372007,VOCATIONAL_SCHOOL:7372008,LANGUAGE_SCHOOL:7372010,ART_SCHOOL:7372012,MIDDLE_SCHOOL:7372014,DRIVING_SCHOOL:7372016,MALL:7373,STADIUM:7374,ATHLETICS_TRACK:7374002,CRICKET_GROUND:7374003,SOCCER_STADIUM:7374004,HORSE_RACING_TRACK:7374005,MULTI_PURPOSE_STADIUM:7374006,RUGBY_GROUND:7374007,ICE_HOCKEY_ARENA:7374008,BASEBALL_PARK:7374009,FOOTBALL_STADIUM:7374010,MOTOR_RACING_STADIUM:7374011,BASKETBALL_ARENA:7374012,RACE_TRACK:7374013,NETBALL_STADIUM:7374014,TOLL_GATE:7375,TOURIST_ATTRACTION:7376,BUILDING:7376002,MONUMENT:7376003,NATURAL_TOURIST_ATTRACTION:7376004,OBSERVATORY:7376005,PLANETARIUM:7376006,DAM:7376007,TUNNEL:7376008,TOWER:7376009,BRIDGE:7376010,MAUSOLEUM_OR_GRAVE:7376011,ARCH:7376012,STATUE:7376013,WATER_HOLE:7376014,COLLEGE_OR_UNIVERSITY:7377,COLLEGE_OR_UNIVERSITY_GENERIC:7377002,JUNIOR_COLLEGE_OR_COMMUNITY_COLLEGE:7377003,BUSINESS_PARK:7378,RAILWAY_STATION:7380,INTERNATIONAL_RAILROAD_STATION:7380002,NATIONAL_RAILROAD_STATION:7380003,URBAN_STATION:7380004,SUBWAY_STATION:7380005,AIRPORT:7383,PUBLIC_AIRPORT:7383002,PRIVATE_AIRPORT:7383003,MILITARY_AIRPORT:7383004,AIRFIELD:7383005,COURIER_DROP_BOX:7388,TRANSPORT_ACCESS:7389,AIRLINE_ACCESS:7389002,STATION_ACCESS:7389003,SECURED_ENTRANCE:7389004,SUBWAY_ENTRANCE:7389999,EMERGENCY_MEDICAL_SERVICE:7391,FIRE_STATION:7392,REST_AREA:7395,ATM:7397,NATURAL_FEATURE:8099,MOUNTAIN_PEAK:8099002,CAVE:8099003,RIDGE:8099004,DUNE:8099005,VALLEY:8099006,PLAIN_OR_FLAT:8099007,PLATEAU:8099008,PAN:8099009,WELL:8099010,OASIS:8099011,ROCKS:8099012,RESERVOIR:8099013,REEF:8099014,RAPIDS:8099015,BAY:8099016,COVE:8099017,HARBOR:8099018,CAPE:8099020,MINERAL_OR_HOT_SPRINGS:8099021,ISLAND:8099022,MARSH:8099023,RIVER_CROSSING:8099024,HILL:8099025,QUARRY:8099026,LOCALE:8099027,PRIMARY_RESOURCE_UTILITY:9150,TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:9151,NON_GOVERNMENTAL_ORGANIZATION:9152,WELFARE_ORGANIZATION:9153,PRISON:9154,CAR_WASH:9155,CAR_WASH_GENERIC:9155002,MANUFACTURING_FACILITY:9156,RESEARCH_FACILITY:9157,MEDIA_FACILITY:9158,PORT_WAREHOUSE_FACILITY:9159,EXCHANGE:9160,STOCK_EXCHANGE:9160002,GOLD_EXCHANGE:9160003,FOREIGN_EXCHANGE:9160004,COMPANY:9352,SERVICE_COMPANY:9352002,ADVERTISING_COMPANY:9352003,COMPUTER_AND_DATA_SERVICES:9352004,SOFTWARE_COMPANY:9352005,DIVERSIFIED_FINANCIALS:9352006,INSURANCE_COMPANY:9352007,DELIVERY_SERVICE:9352008,REAL_ESTATE_COMPANY:9352009,MANUFACTURING_COMPANY:9352011,AGRICULTURAL_TECHNOLOGY:9352012,AUTOMOBILE_COMPANY:9352013,CHEMICAL_COMPANY:9352014,ELECTRONICS_COMPANY:9352015,MECHANICAL_ENGINEERING:9352016,PHARMACEUTICAL_COMPANY:9352018,PUBLISHING_TECHNOLOGIES:9352019,TELECOMMUNICATIONS:9352020,TAX_SERVICES:9352022,LEGAL_SERVICES:9352023,TRANSPORT_COMPANY:9352024,BUS_CHARTER_COMPANY:9352025,TAXI_LIMOUSINE_AND_SHUTTLE_SERVICE:9352026,BUS_LINES:9352027,SCHOOL_BUS_COMPANY:9352028,CLEANING_SERVICES:9352029,OIL_AND_NATURAL_GAS:9352030,MINING_COMPANY:9352031,CONSTRUCTION_COMPANY:9352032,MOVING_AND_STORAGE_COMPANY:9352033,AIRLINE_COMPANY:9352034,FUNERAL_SERVICE_AND_MORTUARIES:9352036,INVESTMENT_ADVISOR:9352037,EQUIPMENT_RENTAL:9352038,BUSINESS_SERVICES:9352039,CABLE_AND_TELEPHONE_COMPANY:9352040,AUTOMOBILE_MANUFACTURING:9352041,IMPORT_OR_EXPORT_AND_DISTRIBUTION:9352042,CATERING_SERVICES:9352043,HOME_APPLIANCE_REPAIR:9352044,ANIMAL_SHELTER:9352045,WEDDING_SERVICES:9352046,BEACH:9357,RESTAURANT_AREA:9359,ICE_RINK:9360,SHOP_OR_STORE:9361,BOOK_SHOP:9361002,C_DS_DVD_VIDEOS:9361003,CHILDREN_S_CLOTHES:9361004,FOOTWEAR_SHOE_REPAIRS:9361005,CLOTHING_SHOP:9361006,MEN_S_CLOTHING:9361007,WOMEN_S_CLOTHING:9361008,CONVENIENCE_STORE:9361009,DRY_CLEANER:9361010,CAMERAS_AND_PHOTOGRAPHY:9361011,COMPUTER_AND_COMPUTER_SUPPLIES:9361012,CONSUMER_ELECTRONICS:9361013,OFFICE_EQUIPMENT:9361014,REAL_ESTATE_AGENT:9361015,FACTORY_OUTLET:9361016,FLORISTS:9361017,BAKERY:9361018,BUTCHER:9361019,FISHMONGER:9361020,FOOD_MARKET:9361021,GREENGROCER:9361022,GROCERY_STORE:9361023,FOOD_AND_DRINKS_SHOP:9361024,WINE_SPIRITS:9361025,GIFTS_CARDS_NOVELTIES_SOUVENIRS:9361026,HAIRDRESSER:9361027,CARPET_FLOOR_COVERINGS:9361028,CURTAINS_TEXTILES:9361029,DO_IT_YOURSELF_CENTERS:9361030,HOUSE_AND_GARDEN_FURNITURE_AND_FITTINGS:9361031,GARDEN_CENTERS_SERVICES:9361032,KITCHENS_BATHROOMS:9361033,LIGHTING_SHOPS:9361034,PAINTING_DECORATING:9361035,JEWELRY_CLOCKS_WATCHES:9361036,NEWSAGENTS_TOBACCONISTS:9361037,OPTICIAN:9361038,SPORTS_EQUIPMENT_AND_CLOTHING:9361039,TOYS_GAMES_SHOP:9361040,TRAVEL_AGENT:9361041,CONSTRUCTION_MATERIAL_AND_EQUIPMENT:9361042,MEDICAL_SUPPLIES_EQUIPMENT:9361043,VIDEO_RENTAL_SHOP:9361044,LAUNDRY:9361045,PHOTO_LAB_OR_DEVELOPMENT:9361046,PHOTOCOPY_SHOP:9361047,ANIMAL_SERVICE:9361048,ANTIQUE_ART_SHOP:9361049,BEAUTY_SUPPLIES:9361050,DRUG_STORE:9361051,ELECTRICAL_APPLIANCES_SHOP:9361052,HOBBY_SHOP:9361053,FURNITURE_HOME_FURNISHINGS:9361054,GLASSWARE_CERAMIC_SHOP:9361055,LOCAL_SPECIALITIES_SHOP:9361056,RECYCLING_SHOP:9361057,BAGS_LEATHERWEAR:9361058,MUSIC_INSTRUMENTS_STORE:9361059,DELICATESSEN:9361060,SPECIALTY_FOODS:9361061,SHOPPING_SERVICE:9361062,RETAIL_OUTLET:9361063,PET_SUPPLIES:9361064,WHOLESALE_CLUB:9361066,BEAUTY_SALON:9361067,NAIL_SALON:9361068,HARDWARE_STORE:9361069,PAWN_SHOP:9361070,LOTTERY_SHOP:9361071,BETTING_STATION:9361072,AGRICULTURAL_SUPPLIES:9361073,MOBILE_PHONE_SHOP:9361075,DRIVE_THROUGH_BOTTLE_SHOP:9361076,TAILOR_SHOP:9361077,SECURITY_PRODUCTS:9361078,SPECIALTY_CLOTHING_SHOP:9361079,GLASS_WINDOWS_STORE:9361080,VARIETY_STORE:9361081,CHRISTMAS_OR_HOLIDAY_SHOP:9361082,BOATING_EQUIPMENT_AND_ACCESSORIES:9361083,PARK_AND_RECREATION_AREA:9362,BATTLEFIELD:9362002,CEMETERY:9362003,HISTORIC_SITE:9362004,HISTORICAL_PARK:9362005,MEMORIAL:9362007,PARK:9362008,PARKWAY:9362009,RECREATION_AREA:9362011,WILDERNESS_AREA:9362014,FOREST_AREA:9362015,FISHING_AND_HUNTING_AREA:9362016,FAIRGROUND:9362017,SKI_RESORT:9362026,BOAT_LAUNCHING_RAMP:9362032,PICNIC_AREA:9362033,PROTECTED_LAND:9362037,COURTHOUSE:9363,CANNABIS_SHOP:9364,MEDICINAL_MARIJUANA_DISPENSARY:9364002,RECREATIONAL_MARIJUANA_DISPENSARY:9364003,MEDICINAL_AND_RECREATIONAL_DISPENSARY:9364004,TENNIS_COURT:9369,WATER_SPORT:9371,DOCTOR:9373,GENERAL_PRACTITIONER:9373002,SPECIALIST:9373003,DENTIST:9374,VETERINARY:9375,CAFE_PUB:9376,CAFE:9376002,PUB:9376003,INTERNET_CAFE:9376004,TEA_HOUSE:9376005,COFFEE_SHOP:9376006,MICROBREWERY:9376007,EXHIBITION_CONVENTION_CENTER:9377,LEISURE_CENTER:9378,BOWLING_CENTER:9378002,DANCE_STUDIO_AND_SCHOOL:9378003,FLYING_CLUB:9378004,SAUNA_SOLARIUM_MASSAGE:9378005,NIGHTLIFE:9379,DISCO_CLUB:9379002,BAR:9379004,COCKTAIL_BAR:9379006,JAZZ_CLUB:9379008,COMEDY_CLUB:9379009,KARAOKE_CLUB:9379010,COMMERCIAL_BUILDING:9382,INDUSTRIAL_BUILDING:9383,ABORIGINAL_LAND:9389,HEALTHCARE_SERVICE:9663,PERSONAL_SERVICE:9663002,PERSONAL_CARE_FACILITY:9663003,BLOOD_BANK:9663004,AMBULANCE_UNIT:9663005,ENTERTAINMENT:9900,AMUSEMENT_PARK:9902,AMUSEMENT_PARK_GENERIC:9902003,AMUSEMENT_PLACE:9902004,VEHICLE_DEALER:9910,CAR_DEALER:9910002,MOTORCYCLE_DEALER:9910003,BOAT_DEALER:9910004,RECREATIONAL_VEHICLE_DEALER:9910005,TRUCK_DEALER:9910006,VAN_DEALER:9910007,BUS_DEALER:9910008,ATV_DEALER:9910009,GOLF_COURSE:9911,PUBLIC_LIBRARY:9913,ZOOS_ARBORETA_BOTANICAL_GARDEN:9927,ARBORETA_AND_BOTANICAL_GARDENS:9927002,ZOO:9927003,AQUATIC_ZOO:9927004,WILDLIFE_PARK:9927005,RENTAL_CAR_PARKING:9930,PUBLIC_AMENITY:9932,PASSENGER_TRANSPORT_TICKET_OFFICE:9932002,PEDESTRIAN_SUBWAY:9932003,PUBLIC_CALL_BOX:9932004,PUBLIC_BATHROOM:9932005,RESCUE_SERVICE:9932006,MOUNTAIN_PASS:9935,CLUB_AND_ASSOCIATION:9937,BEACH_CLUB:9937002,HOCKEY_CLUB:9937003,PUBLIC_TRANSPORT_STOP:9942,BUS_STOP:9942002,TAXI_STAND:9942003,STREETCAR_STOP:9942004,EMERGENCY_ROOM:9956,RESIDENTIAL_ENTRANCE:9999},poiIDsToCategories=/* @__PURE__ */(()=>Object.fromEntries(Object.entries(poiCategoriesToID).map(([A,E])=>[E,A])))(),getRoutePlanningLocationType=A=>Array.isArray(A)?Array.isArray(A[0])?"path":"waypoint":"Feature"===A.type&&"LineString"===A.geometry.type?"path":"waypoint",sdkErrorCodeForStatus=A=>401===A?"INVALID_CREDENTIALS":403===A?"INSUFFICIENT_PERMISSIONS":404===A?"NOT_FOUND":429===A?"RATE_LIMITED":A>=500?"LIVE_SERVICE_NOT_AVAILABLE":A>=400?"INVALID_REQUEST":"INTERNAL",retryableCodes=/* @__PURE__ */new Set(["RATE_LIMITED","LIVE_SERVICE_NOT_AVAILABLE","NETWORK_NOT_AVAILABLE"]),canRetrySDKErrorCode=A=>retryableCodes.has(A),getSectionsWithin=(A,{within:E,types:R=sectionTypes}={})=>{const T=metersAlongLine(A.geometry.coordinates),e={};for(const I of R){const R=A.properties.sections[I]??[],t=[],N=[];let _=0;for(const A of R){const{startPointIndex:R=0,endPointIndex:e=0}=A,I=metersWithin(T,{startPointIndex:R,endPointIndex:e},E);I>0&&(t.push(A),N.push(I/(T[e]-T[R])),_+=I)}t.length&&(e[I]={sections:t,shares:N,lengthInMeters:_})}return e},compareRoutes=(A,E,{types:R=inputSectionTypesWithGuidance}={})=>{const[T,e]=getDistinctSections([A,E]);return{distinct:T,referenceDistinct:e,adds:getSectionsWithin(A,{within:T,types:R}),avoids:getSectionsWithin(E,{within:e,types:R})}},indexedMagnitudes=["unknown","minor","moderate","major","indefinite"],iconCategoryMap={1:"accident",2:"fog",3:"danger",4:"rain",5:"frost",6:"jam",7:"lane-closed",8:"road-closed",9:"roadworks",10:"wind",11:"flooding",12:"animals-on-road",13:"narrow-lanes",14:"broken-down-vehicle"},categoryToIconMap=/* @__PURE__ */(()=>Object.fromEntries(Object.entries(iconCategoryMap).map(([A,E])=>[E,Number(A)])))(),iconToTrafficIncidentCategory=A=>iconCategoryMap[A]??"other",trafficIncidentToIconCategory=A=>categoryToIconMap[A]??0,minuteUnits=A=>A?.minutes??"min",formatDuration=(A,E)=>{if(A){const T=Math.abs(A)/3600;let e=Math.floor(T),I=Math.round(T%1*60);60===I&&(I=0,e++);const t={...TomTomConfig.instance.get().displayUnits?.time,...E};if(e)return`${e} ${R=t,R?.hours??"hr"} ${I.toString().padStart(2,"0")} ${minuteUnits(t)}`;if(I)return`${I.toString()} ${minuteUnits(t)}`}var R},MILE_IN_METERS=1609.344,meterUnits=A=>A?.meters??"m",kmUnits=A=>A?.kilometers??"km",roundHalfAwayFromZero=A=>Math.sign(A)*Math.round(Math.abs(A)),formatFeet=(A,E)=>{const R=E.feet??"ft",T=A/.3048,e=Math.abs(T);return e<30?`${roundHalfAwayFromZero(T)} ${R}`:e<500?`${10*roundHalfAwayFromZero(T/10)} ${R}`:`${100*roundHalfAwayFromZero(T/100)} ${R}`},formatYards=(A,E)=>{const R=E.yards??"yd",T=A/.9144;return Math.abs(T)<10?`${roundHalfAwayFromZero(T)} ${R}`:`${10*roundHalfAwayFromZero(T/10)} ${R}`},QUARTER_MILE_GLYPHS=["","¼","½","¾"],formatImperial=(A,E,R)=>{const T=A/1609.344;return Math.abs(T)<.125?R(A,E):((A,E)=>{const R=Math.abs(A);if(R>=10)return`${roundHalfAwayFromZero(A)} ${E}`;const T=R<3?1:2,e=Number.parseInt(R.toString()),I=Math.round(4*(R-e)/T)*T,t=A<0?"-":"";return I%4?`${t}${e||""}${QUARTER_MILE_GLYPHS[I]} ${E}`:`${t}${e+I/4} ${E}`})(T,E.miles??"mi")},formatDistance=(A,E)=>{if(isNil(A))return"";const R={...TomTomConfig.instance.get().displayUnits?.distance,...E};switch(R?.type??"metric"){case"metric":return((A,E)=>{const R=Math.abs(A);if(R<10)return`${roundHalfAwayFromZero(10*A)/10} ${meterUnits(E)}`;if(R<500)return`${10*roundHalfAwayFromZero(A/10)} ${meterUnits(E)}`;if(R<1e3){const R=100*roundHalfAwayFromZero(A/100);return 1e3===R||-1e3===R?`${A<0?"-":""}1 ${kmUnits(E)}`:`${R} ${meterUnits(E)}`}return R<1e4?`${100*roundHalfAwayFromZero(A/100)/1e3} ${kmUnits(E)}`:`${roundHalfAwayFromZero(A/1e3)} ${kmUnits(E)}`})(A,R);case"imperial_us":return formatImperial(A,R,formatFeet);case"imperial_uk":return formatImperial(A,R,formatYards)}};export{DEFAULT_COMMON_BASE_URL,MILE_IN_METERS,TOMTOM_USER_AGENT_SDK_NAME,TomTomConfig,areaAnalyticsMetricKeys,avoidableTypes,bboxCenter,bboxFromBBoxes,bboxFromCoordsArray,bboxFromGeoJSON,bboxOnlyIfWithArea,budgetTypes,budgetUnits,calculateProgressAtRoutePoint,canRetrySDKErrorCode,chargingPointCapabilities,chargingPointRestrictions,clamp,compareRoutes,connectorTypes,currentTypes,defaultConfig,definedFields,findBestWaypointInsertionIndex,findBestWaypointInsertionIndices,formatDistance,formatDuration,fullTrafficIncidentCategories,generateId,generateTomTomHeaders,geographyTypes,geopoliticalViews,getCoordinateAtRouteProgress,getDistinctSections,getImportantRoads,getInstructionLanes,getPosition,getPositionStrict,getProgressAtNearestRoutePoint,getRoutePlanningLocationType,getRouteProgressBetween,getRouteProgressForSection,getSectionBBox,getSectionOverlap,getSectionsWithin,iconToTrafficIncidentCategory,indexedMagnitudes,inputSectionTypes,inputSectionTypesWithGuidance,insecureBaseURLMessage,isBBoxWithArea,isProxyCredentialsMode,isSecureBaseURL,languages,mergeFromGlobal,metersAlongLine,metersWithin,pickKeys,placeTypes,poiCategories,poiCategoriesToID,poiIDsToCategories,polygonFromBBox,positionBetween,sdkErrorCodeForStatus,sdkErrorCodes,sectionTypes,segmentAtMeters,toPointGeometry,trafficIncidentRequestCategories,trafficIncidentTimeValidities,trafficIncidentToIconCategory,withInsertedWaypoint,withInsertedWaypoints};
|
|
1
|
+
import{booleanPointInPolygon,distance,lengthToDegrees,nearestPointOnLine}from"@turf/turf";import{isNil,mean,sum}from"lodash-es";var definedFields=e=>Object.fromEntries(Object.entries(e??{}).filter(([,e])=>void 0!==e)),pickKeys=(e,t)=>Object.fromEntries(t.filter(t=>t in e).map(t=>[t,e[t]])),DEFAULT_COMMON_BASE_URL="https://api.tomtom.com",defaultRetryConfig={initialWaitMs:447,backoffFactor:1.618,timeoutMs:4e4},defaultConfig={commonBaseURL:"https://api.tomtom.com",apiKey:"",retry:defaultRetryConfig},withRetryDefaults=(...e)=>e.reduce((e,t)=>({...e,...definedFields(t)}),{...defaultRetryConfig}),copyOfDefaultConfig=()=>({...defaultConfig,retry:withRetryDefaults()}),TomTomConfig=class TomTomConfig{static{this.instance=new TomTomConfig}constructor(){this.config=copyOfDefaultConfig()}put(e){this.config={...this.config,...e,...e.retry&&{retry:withRetryDefaults(e.retry)}}}reset(){this.config=copyOfDefaultConfig()}get(){return this.config}},mergeFromGlobal=(e={})=>{const t=TomTomConfig.instance.get(),A={...t,...e};return{...A,retry:A.retry&&withRetryDefaults(t.retry,e.retry)}},isProxyCredentialsMode=(e=TomTomConfig.instance.get())=>!e.apiKey&&"https://api.tomtom.com"!==(e.commonBaseURL??"https://api.tomtom.com"),LOOPBACK_IPV4=/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,isSecureBaseURL=e=>{let t;try{t=new URL(e)}catch{return!0}if("https:"===t.protocol)return!0;const{hostname:A}=t;return"http:"===t.protocol&&("localhost"===A||A.endsWith(".localhost")||"[::1]"===A||LOOPBACK_IPV4.test(A))},insecureBaseURLMessage=e=>`commonBaseURL ${e} is not https:, so requests to it would carry the API key in the clear; only loopback addresses may use http:.`,geopoliticalViews=["Unified","AE","AR","BN","CL","CN","DZ","IL","IN","KR","MA","MY","PH","PK","RS","RU","TR","TW","US","VN"],languages=["ngt","ngt-Latn","ar","eu-ES","bg-BG","ca-ES","zh-Hant","zh-Hans","hr-HR","cs-CZ","da-DK","nl-NL","en-AU","en-CA","en-GB","en-NZ","en-US","et-EE","fi-FI","fr-FR","gl-ES","de-DE","el-GR","he-IL","hi-IN","hu-HU","id-ID","it-IT","ja-JP","kk-KZ","ko-KR","ko-Latn-KR","lv-LV","lt-LT","ms-MY","nb-NO","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","ru-Latn-RU","ru-Cyrl-RU","sr-RS","sk-SK","sl-SI","es-ES","es-MX","sv-SE","th-TH","tr-TR","uk-UA"],chargingPointCapabilities=["ChargingProfileCapable","ChargingPreferencesCapable","ChipCardSupport","ContactlessCardSupport","CreditCardPayable","DebitCardPayable","PedTerminal","RemoteStartStopCapable","Reservable","RfidReader","StartSessionConnectorRequired","TokenGroupCapable","UnlockCapable","PlugAndCharge","Unknown"],chargingPointRestrictions=["EvOnly","Plugged","Disabled","Customers","Motorcycles"],connectorTypes=["StandardHouseholdCountrySpecific","IEC62196Type1","IEC62196Type1CCS","IEC62196Type2CableAttached","IEC62196Type2Outlet","IEC62196Type2CCS","IEC62196Type3","Chademo","GBT20234Part2","GBT20234Part3","IEC60309AC3PhaseRed","IEC60309AC1PhaseBlue","IEC60309DCWhite","Tesla"],currentTypes=["AC1","AC3","DC"],geographyTypes=["Country","CountrySubdivision","CountrySecondarySubdivision","CountryTertiarySubdivision","Municipality","MunicipalitySubdivision","MunicipalitySecondarySubdivision","Neighbourhood","PostalCodeArea"],placeTypes=["POI","Street","Geography","Point Address","Address Range","Cross Street"],poiCategories=["ABORIGINAL_LAND","ADVENTURE_SPORTS_FACILITY","ADVENTURE_VEHICLE_TRAIL","ADVERTISING_COMPANY","AFGHAN_RESTAURANT","AFRICAN_RESTAURANT","AGRICULTURAL_SUPPLIES","AGRICULTURAL_TECHNOLOGY","AGRICULTURE","AIRFIELD","AIRLINE_ACCESS","AIRLINE_COMPANY","AIRPORT","AMBULANCE_UNIT","AMERICAN_RESTAURANT","AMPHITHEATER","AMUSEMENT_PARK","AMUSEMENT_PARK_GENERIC","AMUSEMENT_PLACE","ANIMAL_SERVICE","ANIMAL_SHELTER","ANTIQUE_ART_SHOP","APARTMENT_RENTAL","AQUATIC_ZOO","ARABIAN_RESTAURANT","ARBORETA_AND_BOTANICAL_GARDENS","ARCH","ARMENIAN_RESTAURANT","ART_SCHOOL","ASIAN_RESTAURANT","ATHLETICS_TRACK","ATM","ATV_DEALER","AUSTRALIAN_RESTAURANT","AUSTRIAN_RESTAURANT","AUTOMOBILE_COMPANY","AUTOMOBILE_MANUFACTURING","BAGS_LEATHERWEAR","BAKERY","BANDB_OR_GUEST_HOUSE","BANK","BANQUET_ROOMS","BAR","BARBECUE_RESTAURANT","BASEBALL_PARK","BASKETBALL_ARENA","BASQUE_RESTAURANT","BATTLEFIELD","BAY","BEACH","BEACH_CLUB","BEAUTY_SALON","BEAUTY_SUPPLIES","BELGIAN_RESTAURANT","BETTING_STATION","BISTRO","BLOOD_BANK","BOATING_EQUIPMENT_AND_ACCESSORIES","BOAT_DEALER","BOAT_LAUNCHING_RAMP","BODYSHOP","BOLIVIAN_RESTAURANT","BOOK_SHOP","BORDER_CONTROL","BOWLING_CENTER","BRAZILIAN_RESTAURANT","BRIDGE","BRITISH_RESTAURANT","BUFFET_RESTAURANT","BUILDING","BULGARIAN_RESTAURANT","BUNGALOW_RENTAL","BURMESE_RESTAURANT","BUSINESS_PARK","BUSINESS_SERVICES","BUS_CHARTER_COMPANY","BUS_DEALER","BUS_LINES","BUS_STOP","BUTCHER","CABARET_THEATER","CABINS_LODGES","CABLE_AND_TELEPHONE_COMPANY","CAFE","CAFETERIA","CAFE_PUB","CALIFORNIAN_RESTAURANT","CAMBODIAN_RESTAURANT","CAMERAS_AND_PHOTOGRAPHY","CAMPING_GROUND","CANADIAN_RESTAURANT","CANNABIS_SHOP","CAPE","CARAVAN_SITE","CARIBBEAN_RESTAURANT","CARPET_FLOOR_COVERINGS","CAR_DEALER","CAR_GLASS_REPLACEMENT_SHOP","CAR_RENTAL","CAR_REPAIR_AND_SERVICE","CAR_WASH","CAR_WASH_GENERIC","CASINO_AND_GAMBLING","CATERING_SERVICES","CAVE","CEMETERY","CHALET_RENTAL","CHARGING_LOCATION","CHEMICAL_COMPANY","CHICKEN_RESTAURANT","CHILDCARE","CHILDREN_S_CLOTHES","CHILEAN_RESTAURANT","CHINESE_RESTAURANT","CHRISTMAS_OR_HOLIDAY_SHOP","CHURCH","CINEMA","CLEANING_SERVICES","CLOTHING_SHOP","CLUB_AND_ASSOCIATION","COCKTAIL_BAR","COFFEE_SHOP","COLLEGE_OR_UNIVERSITY","COLLEGE_OR_UNIVERSITY_GENERIC","COLOMBIAN_RESTAURANT","COMEDY_CLUB","COMMERCIAL_BUILDING","COMMUNITY_CENTER","COMPANY","COMPUTER_AND_COMPUTER_SUPPLIES","COMPUTER_AND_DATA_SERVICES","CONCERT_HALL","CONSTRUCTION_COMPANY","CONSTRUCTION_MATERIAL_AND_EQUIPMENT","CONSUMER_ELECTRONICS","CONVENIENCE_STORE","CORSICAN_RESTAURANT","COTTAGE_RENTAL","COURIER_DROP_BOX","COURTHOUSE","COVE","CREOLE_RESTAURANT","CREPERIE","CRICKET_GROUND","CUBAN_RESTAURANT","CULTURAL_CENTER","CURTAINS_TEXTILES","CZECH_RESTAURANT","C_DS_DVD_VIDEOS","DAM","DANCE_STUDIO_AND_SCHOOL","DANISH_RESTAURANT","DELICATESSEN","DELIVERY_SERVICE","DENTIST","DEPARTMENT_STORE","DINNER_THEATER","DISCO_CLUB","DIVERSIFIED_FINANCIALS","DOCTOR","DONGBEI_RESTAURANT","DOUGHNUT_RESTAURANT","DO_IT_YOURSELF_CENTERS","DRIVE_IN_MOVIES","DRIVE_THROUGH_BOTTLE_SHOP","DRIVING_SCHOOL","DRUG_STORE","DRY_CLEANER","DUNE","DUTCH_RESTAURANT","EGYPTIAN_RESTAURANT","ELECTRICAL_APPLIANCES_SHOP","ELECTRONICS_COMPANY","EMBASSY","EMERGENCY_MEDICAL_SERVICE","EMERGENCY_ROOM","ENGLISH_RESTAURANT","ENTERTAINMENT","EQUIPMENT_RENTAL","ETHIOPIAN_RESTAURANT","EXCHANGE","EXHIBITION_CONVENTION_CENTER","FACTORY_OUTLET","FAIRGROUND","FARM","FARMERS_MARKET","FAST_FOOD","FERRY_TERMINAL","FINNISH_RESTAURANT","FIRE_STATION","FISHING_AND_HUNTING_AREA","FISHMONGER","FITNESS_CLUB_AND_CENTER","FLATS_OR_APARTMENT_COMPLEX","FLORISTS","FLYING_CLUB","FONDUE_RESTAURANT","FOOD_AND_DRINKS_SHOP","FOOD_MARKET","FOOTBALL_STADIUM","FOOTWEAR_SHOE_REPAIRS","FOREIGN_EXCHANGE","FOREST_AREA","FRENCH_RESTAURANT","FUEL_STATION","FUNERAL_SERVICE_AND_MORTUARIES","FURNITURE_HOME_FURNISHINGS","FUSION_RESTAURANT","GARDEN_CENTERS_SERVICES","GENERAL_HOSPITAL_AND_POLYCLINIC","GENERAL_PRACTITIONER","GERMAN_RESTAURANT","GIFTS_CARDS_NOVELTIES_SOUVENIRS","GLASSWARE_CERAMIC_SHOP","GLASS_WINDOWS_STORE","GOLD_EXCHANGE","GOLF_COURSE","GOVERNMENT_OFFICE","GREEK_RESTAURANT","GREENGROCER","GRILL_RESTAURANT","GROCERY_STORE","GURUDWARA","HAIRDRESSER","HAMBURGER_RESTAURANT","HARBOR","HARDWARE_STORE","HAWAIIAN_RESTAURANT","HEALTHCARE_SERVICE","HELIPORT_OR_HELIPAD","HIGH_SCHOOL","HIKING_TRAIL","HILL","HISTORICAL_PARK","HISTORIC_SITE","HOBBY_SHOP","HOCKEY_CLUB","HOLIDAY_RENTAL","HOME_APPLIANCE_REPAIR","HORSE_RACING_TRACK","HORSE_RIDING","HORSE_RIDING_TRAIL","HORTICULTURE","HOSPITAL","HOSPITAL_FOR_WOMEN_AND_CHILDREN","HOSPITAL_OF_CHINESE_MEDICINE","HOSTEL","HOTEL","HOTEL_OR_MOTEL","HOT_POT_RESTAURANT","HOUSE_AND_GARDEN_FURNITURE_AND_FITTINGS","HUNAN_RESTAURANT","HUNGARIAN_RESTAURANT","ICE_CREAM_PARLOR","ICE_HOCKEY_ARENA","ICE_RINK","IMPORT_OR_EXPORT_AND_DISTRIBUTION","INDIAN_RESTAURANT","INDONESIAN_RESTAURANT","INDUSTRIAL_BUILDING","INFORMAL_MARKET","INSURANCE_COMPANY","INTERNATIONAL_RAILROAD_STATION","INTERNATIONAL_RESTAURANT","INTERNET_CAFE","INVESTMENT_ADVISOR","IRANIAN_RESTAURANT","IRISH_RESTAURANT","ISLAND","ISRAELI_RESTAURANT","ITALIAN_RESTAURANT","JAMAICAN_RESTAURANT","JAPANESE_RESTAURANT","JAZZ_CLUB","JEWELRY_CLOCKS_WATCHES","JEWISH_RESTAURANT","JUICE_BAR","JUNIOR_COLLEGE_OR_COMMUNITY_COLLEGE","KARAOKE_CLUB","KITCHENS_BATHROOMS","KOREAN_RESTAURANT","KOSHER_RESTAURANT","LANGUAGE_SCHOOL","LATIN_AMERICAN_RESTAURANT","LAUNDRY","LEBANESE_RESTAURANT","LEGAL_SERVICES","LEISURE_CENTER","LIGHTING_SHOPS","LOCALE","LOCAL_SPECIALITIES_SHOP","LOTTERY_SHOP","MALL","MANUFACTURING_COMPANY","MANUFACTURING_FACILITY","MARINA","MARINA_GENERIC","MARKETPLACE","MARSH","MAUSOLEUM_OR_GRAVE","MECHANICAL_ENGINEERING","MEDIA_FACILITY","MEDICAL_SUPPLIES_EQUIPMENT","MEDICINAL_AND_RECREATIONAL_DISPENSARY","MEDICINAL_MARIJUANA_DISPENSARY","MEDITERRANEAN_RESTAURANT","MEMORIAL","MEN_S_CLOTHING","MEXICAN_RESTAURANT","MICROBREWERY","MIDDLE_EASTERN_RESTAURANT","MIDDLE_SCHOOL","MILITARY_AIRPORT","MINERAL_OR_HOT_SPRINGS","MINING_COMPANY","MOBILE_PHONE_SHOP","MONGOLIAN_RESTAURANT","MONUMENT","MOROCCAN_RESTAURANT","MOSQUE","MOTEL","MOTORCYCLE_DEALER","MOTORCYCLE_REPAIR","MOTORING_ORGANIZATION_OFFICE","MOTOR_RACING_STADIUM","MOUNTAIN_BIKE_TRAIL","MOUNTAIN_PASS","MOUNTAIN_PEAK","MOVIE_THEATER","MOVING_AND_STORAGE_COMPANY","MULTI_PURPOSE_STADIUM","MUSEUM","MUSIC_CENTER","MUSIC_INSTRUMENTS_STORE","NAIL_SALON","NATIONAL_RAILROAD_STATION","NATURAL_FEATURE","NATURAL_TOURIST_ATTRACTION","NEPALESE_RESTAURANT","NETBALL_STADIUM","NEWSAGENTS_TOBACCONISTS","NIGHTLIFE","NON_GOVERNMENTAL_ORGANIZATION","NORWEGIAN_RESTAURANT","OASIS","OBSERVATORY","OFFICE_EQUIPMENT","OIL_AND_NATURAL_GAS","OPEN_CAR_PARKING_AREA","OPEN_CAR_PARKING_AREA_GENERIC","OPERA_HOUSE","OPTICIAN","ORGANIC_FOOD_RESTAURANT","ORIENTAL_RESTAURANT","PAGODA","PAINTING_DECORATING","PAKISTANI_RESTAURANT","PAN","PARK","PARKING_GARAGE","PARKWAY","PARK_AND_RECREATION_AREA","PASSENGER_TRANSPORT_TICKET_OFFICE","PAWN_SHOP","PEDESTRIAN_SUBWAY","PERSONAL_CARE_FACILITY","PERSONAL_SERVICE","PERUVIAN_RESTAURANT","PET_SUPPLIES","PHARMACEUTICAL_COMPANY","PHARMACY","PHILIPPINE_RESTAURANT","PHOTOCOPY_SHOP","PHOTO_LAB_OR_DEVELOPMENT","PICNIC_AREA","PIZZERIA","PLAIN_OR_FLAT","PLANETARIUM","PLATEAU","POLICE_STATION","POLISH_RESTAURANT","PORTUGUESE_RESTAURANT","PORT_WAREHOUSE_FACILITY","POST_OFFICE","PRE_SCHOOL","PRIMARY_PRODUCER","PRIMARY_RESOURCE_UTILITY","PRIMARY_SCHOOL","PRISON","PRIVATE_AIRPORT","PROTECTED_LAND","PUB","PUBLIC_AIRPORT","PUBLIC_AMENITY","PUBLIC_BATHROOM","PUBLIC_CALL_BOX","PUBLIC_LIBRARY","PUBLIC_MARKET","PUBLIC_TRANSPORT_STOP","PUBLISHING_TECHNOLOGIES","QUARRY","RACE_TRACK","RAILWAY_STATION","RAPIDS","REAL_ESTATE_AGENT","REAL_ESTATE_COMPANY","RECREATIONAL_CAMPING_GROUND","RECREATIONAL_MARIJUANA_DISPENSARY","RECREATIONAL_VEHICLE_DEALER","RECREATION_AREA","RECYCLING_SHOP","REEF","RELIGIOUS_SITE","RENTAL_CAR_PARKING","RESCUE_SERVICE","RESEARCH_FACILITY","RESERVOIR","RESIDENTIAL_ACCOMMODATION","RESIDENTIAL_ENTRANCE","RESORT","RESTAURANT","RESTAURANT_AREA","REST_AREA","REST_CAMP","RETAIL_OUTLET","RETIREMENT_COMMUNITY","RIDGE","RIVER_CROSSING","ROCKS","ROCK_CLIMBING_TRAIL","RUGBY_GROUND","RUSSIAN_RESTAURANT","SALAD_BAR","SANDWICH_RESTAURANT","SAUNA_SOLARIUM_MASSAGE","SCANDINAVIAN_RESTAURANT","SCHOOL","SCHOOL_BUS_COMPANY","SCHOOL_GENERIC","SEAFOOD","SECURED_ENTRANCE","SECURITY_PRODUCTS","SENIOR_HIGH_SCHOOL","SERVICE_COMPANY","SHANDONG_RESTAURANT","SHOPPING_SERVICE","SHOP_OR_STORE","SICHUAN_RESTAURANT","SKI_RESORT","SNACKS_RESTAURANT","SOCCER_STADIUM","SOFTWARE_COMPANY","SOUL_FOOD","SOUP_RESTAURANT","SPANISH_RESTAURANT","SPECIALIST","SPECIALTY_CLOTHING_SHOP","SPECIALTY_FOODS","SPECIAL_HOSPITAL","SPORTS_CENTER","SPORTS_CENTER_GENERIC","SPORTS_EQUIPMENT_AND_CLOTHING","SQUASH_COURT","STADIUM","STATION_ACCESS","STATUE","STEAK_HOUSE","STOCK_EXCHANGE","STREETCAR_STOP","SUBWAY_ENTRANCE","SUBWAY_STATION","SUPERMARKET","SUSHI_RESTAURANT","SWEDISH_RESTAURANT","SWIMMING_POOL","SWISS_RESTAURANT","SYNAGOG","SYRIAN_RESTAURANT","TAILOR_SHOP","TAIWANESE_RESTAURANT","TAKEOUT_FOOD","TAPAS_RESTAURANT","TAXI_LIMOUSINE_AND_SHUTTLE_SERVICE","TAXI_STAND","TAX_SERVICES","TEA_HOUSE","TELECOMMUNICATIONS","TEMPLE","TENNIS_COURT","TEPPANYAKI_RESTAURANT","THAI_RESTAURANT","THEATER","THEATER_GENERIC","THEMATIC_SPORT_CENTER","TIBETAN_RESTAURANT","TIRE_SERVICE","TOLL_GATE","TOURIST_ATTRACTION","TOURIST_INFORMATION","TOWER","TOYS_GAMES_SHOP","TRAFFIC_CONTROL_DEPARTMENT","TRAFFIC_CONTROL_DEPARTMENT_GENERIC","TRAIL_SYSTEM","TRANSPORT_ACCESS","TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION","TRANSPORT_COMPANY","TRAVEL_AGENT","TRUCK_DEALER","TRUCK_REPAIR_AND_SERVICE","TRUCK_STOP","TUNISIAN_RESTAURANT","TUNNEL","TURKISH_RESTAURANT","URBAN_STATION","VALLEY","VAN_DEALER","VARIETY_STORE","VEGETARIAN_RESTAURANT","VEHICLE_DEALER","VEHICLE_REPAIR","VENEZUELAN_RESTAURANT","VETERINARY","VIDEO_RENTAL_SHOP","VIETNAMESE_RESTAURANT","VIEWPOINT","VILLA_RENTAL","VOCATIONAL_SCHOOL","WATER_HOLE","WATER_SPORT","WEDDING_SERVICES","WEIGH_STATION","WEIGH_STATION_GENERIC","WELFARE_ORGANIZATION","WELL","WESTERN_RESTAURANT","WHOLESALE_CLUB","WILDERNESS_AREA","WILDLIFE_PARK","WINERY","WINE_SPIRITS","WOMEN_S_CLOTHING","YACHT_BASIN","ZOO","ZOOS_ARBORETA_BOTANICAL_GARDEN"],budgetTypes=["timeMinutes","distanceKM"],budgetUnits={timeMinutes:"min",distanceKM:"km"},avoidableTypes=["tollRoads","motorways","ferries","unpavedRoads","carpools","alreadyUsedRoads","borderCrossings","tunnels","carTrains","lowEmissionZones"],geometrySectionTypes=["curve","curvyStretch"],apiSectionTypes=["carpool","carTrain","country","ferry","importantRoadStretch","lowEmissionZone","motorway","pedestrian","roadShields","speedLimit","toll","tollRoad","tollVignette","traffic","tunnel","unpaved","urban","vehicleRestricted"],defaultSectionTypes=/* @__PURE__ */(()=>[...apiSectionTypes,"lanes"])(),inputSectionTypes=/* @__PURE__ */(()=>[...apiSectionTypes,...geometrySectionTypes])(),inputSectionTypesWithGuidance=/* @__PURE__ */(()=>[...inputSectionTypes,"lanes"])(),sectionTypes=/* @__PURE__ */(()=>[...inputSectionTypesWithGuidance,"leg","distinct"])(),sdkErrorCodes=["INVALID_REQUEST","INSECURE_BASE_URL","INVALID_CREDENTIALS","INSUFFICIENT_PERMISSIONS","NOT_FOUND","RATE_LIMITED","LIVE_SERVICE_NOT_AVAILABLE","NETWORK_NOT_AVAILABLE","ABORTED","WEBGL_UNSUPPORTED","WEBGL_CONTEXT_LOST","STYLE_LOAD_FAILED","INTERNAL"],areaAnalyticsMetricKeys=["speed","freeFlowSpeed","congestionLevel","travelTime","networkLength"],trafficIncidentRequestCategories=["accident","broken-down-vehicle","danger","flooding","fog","frost","jam","lane-closed","other","rain","road-closed","roadworks","wind"],fullTrafficIncidentCategories=/* @__PURE__ */(()=>[...trafficIncidentRequestCategories,"animals-on-road","narrow-lanes"])(),trafficIncidentTimeValidities=["present","future"],isBBoxWithArea=e=>!!e&&e.length>=4&&e[3]!==e[1]&&e[2]!==e[0],bboxOnlyIfWithArea=e=>isBBoxWithArea(e)?e:void 0,unwrappedEast=([e,,t])=>e>t?t+360:t,bboxLongitudeSpan=e=>unwrappedEast(e)-e[0],toBBox=(e,t,A,E)=>e>A?[180===e?-180:e,t,-180===A?180:A,E]:[e,t,A,E],wrapLongitude=e=>e>180?e-360:e<-180?e+360:e,longitudeRanges=e=>{if(bboxLongitudeSpan(e)>=360)return[[-180,180]];const t=wrapLongitude(e[0]),A=wrapLongitude(e[2]);return t>A?[[t,180],[-180,A]]:[[t,A]]},bboxFromBBoxes=e=>{const t=e?.filter(e=>!!e)??[];if(t.length<=1)return t[0];let A=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(const I of t)A=Math.min(A,I[1]),E=Math.max(E,I[3]);const R=(e=>{const t=[];for(const[A,E]of e.flatMap(longitudeRanges).sort((e,t)=>e[0]-t[0])){const e=t.at(-1);e&&A<=e[1]?e[1]=Math.max(e[1],E):t.push([A,E])}return t})(t);let n=R.length-1,T=R[0][0]+360-R[n][1];for(let I=0;I<R.length-1;I++){const e=R[I+1][0]-R[I][1];e>T&&(T=e,n=I)}return toBBox(R[(n+1)%R.length][0],A,R[n][1],E)},positionsExtent=(e,t)=>{const A=e?.length;if(!A)return;const E={west:Number.POSITIVE_INFINITY,east:Number.NEGATIVE_INFINITY,crossingWest:Number.POSITIVE_INFINITY,crossingEast:Number.NEGATIVE_INFINITY,south:Number.POSITIVE_INFINITY,north:Number.NEGATIVE_INFINITY},R=e=>{if(!e||e.length<2)return;const A=t(e[0]);E.west=Math.min(E.west,A),E.east=Math.max(E.east,A),A<0?E.crossingEast=Math.max(E.crossingEast,A):E.crossingWest=Math.min(E.crossingWest,A),E.south=Math.min(E.south,e[1]),E.north=Math.max(E.north,e[1])},n=Math.ceil(A/1e3);for(let T=0;T<A;T+=n)R(e[T]);return n>1&&R(e[A-1]),E.south===Number.POSITIVE_INFINITY?void 0:E},bboxFromCoordsArray=e=>{const t=positionsExtent(e,wrapLongitude);if(!t)return;const{west:A,south:E,east:R,north:n,crossingWest:T,crossingEast:I}=t,o=R-A,r=I+360-T;return Number.isFinite(r)&&o<360&&r<o?toBBox(T,E,I,n):[A,E,R,n]},bboxFromLine=e=>{const t=positionsExtent(e,e=>e);if(!t)return;const{west:A,south:E,east:R,north:n}=t;if(R-A>=360)return[-180,E,180,n];const T=wrapLongitude(A),I=R+(T-A);return toBBox(T,E,I>180?I-360:I,n)},bboxFromGeoJSON=e=>{if(!e)return;if(Array.isArray(e))return"number"==typeof e[0]?e.length>=4?e:void 0:bboxFromBBoxes(e.map(e=>bboxFromGeoJSON(e)));const{bbox:t}=e;if(t)return 6===t.length?[t[0],t[1],t[3],t[4]]:t;switch(e.type){case"Feature":return bboxFromGeoJSON(e.geometry);case"FeatureCollection":return bboxFromBBoxes(e.features.map(bboxFromGeoJSON));case"GeometryCollection":return bboxFromBBoxes(e.geometries.map(bboxFromGeoJSON));case"Point":return bboxFromCoordsArray([e.coordinates]);case"MultiPoint":return bboxFromCoordsArray(e.coordinates);case"LineString":return bboxFromLine(e.coordinates);case"MultiLineString":case"Polygon":return bboxFromBBoxes(e.coordinates.map(bboxFromLine));case"MultiPolygon":return bboxFromBBoxes(e.coordinates.flatMap(e=>e.map(bboxFromLine)));default:return}},bboxCenter=e=>{const[t,A,,E]=e,R=(t+unwrappedEast(e))/2;return[R>180?R-360:R,(A+E)/2]},polygonFromBBox=e=>{const[t,A,,E]=e,R=unwrappedEast(e);return{type:"Feature",geometry:{type:"Polygon",coordinates:[[[t,A],[R,A],[R,E],[t,E],[t,A]]]},properties:{}}},MAX_MERCATOR_LATITUDE=85.051129,getPosition=(e,t)=>{if(e){if(Array.isArray(e))return e;if(e.coordinates)return e.coordinates;if(e.geometry)return"main-when-available"===t?.useEntryPoint?(e=>{const t=e?.properties?.entryPoints;return t?.find(e=>"main"===e.type)??t?.find(e=>!e.type)})(e)?.position??e.geometry.coordinates:e.geometry.coordinates}return null},getPositionStrict=(e,t)=>{const A=getPosition(e,t);if(!A)throw new Error(`The received object does not have lng-lat coordinates: ${JSON.stringify(e)}`);return A},toPointGeometry=e=>({type:"Point",coordinates:e}),clamp=(e,t,A)=>Math.max(t,Math.min(e,A)),projectAlongRouteLocation=(e,t)=>nearestPointOnLine(e,getPositionStrict(t)).properties.totalDistance,findInsertionSlot=(e,t)=>{for(let A=0;A<e.length-1;A++)if(t>=e[A]&&t<=e[A+1])return A+1;return t<e[0]?0:e.length},slotNewWaypoints=(e,t,A)=>{if(!A.length||e.geometry.coordinates.length<2||t.length<2)return A.map(()=>({slot:0,location:0}));const E=t.map(t=>projectAlongRouteLocation(e,t));return A.map(t=>{const A=projectAlongRouteLocation(e,t);return{slot:findInsertionSlot(E,A),location:A}})},findBestWaypointInsertionIndex=(e,t,A)=>findBestWaypointInsertionIndices(e,t,[A])[0],findBestWaypointInsertionIndices=(e,t,A)=>slotNewWaypoints(e,t,A).map(({slot:e})=>e),withInsertedWaypoint=(e,t,A)=>withInsertedWaypoints(e,t,[A]),withInsertedWaypoints=(e,t,A)=>{const E=Array.from({length:t.length+1},()=>[]),R=slotNewWaypoints(e,t,A);for(const[T,{slot:I,location:o}]of R.entries())E[I].push({waypoint:A[T],location:o,inputIndex:T});for(const T of E)T.sort((e,t)=>e.location-t.location||e.inputIndex-t.inputIndex);const n=[];for(let T=0;T<t.length;T++){for(const e of E[T])n.push(e.waypoint);n.push(t[T])}for(const T of E[t.length])n.push(T.waypoint);return n},progressValuesOf=({distanceInMeters:e,travelTimeInSeconds:t})=>void 0===e||void 0===t?void 0:{distanceInMeters:e,travelTimeInSeconds:t},progressBetween=(e,t,A)=>({distanceInMeters:e.distanceInMeters+A*(t.distanceInMeters-e.distanceInMeters),travelTimeInSeconds:e.travelTimeInSeconds+A*(t.travelTimeInSeconds-e.travelTimeInSeconds)}),calculateProgressAtRoutePoint=(e,t)=>{const{progress:A}=e.properties;if(!A||0===A.length)return;const E=e.geometry.coordinates.length;if(t<0||t>=E)return;const R=findBracketingProgressPoints(A,"pointIndex",t);if(!R)return;const{lower:n,lowerValue:T,upper:I,upperValue:o}=R,r=progressValuesOf(n),N=progressValuesOf(I);if(!r||!N)return;if(T===o)return r;const _=lengthShareOfBracket(e.geometry.coordinates,T,t,o);return progressBetween(r,N,_)},getRouteProgressBetween=(e,t,A)=>{const E=calculateProgressAtRoutePoint(e,t),R=calculateProgressAtRoutePoint(e,A);if(E&&R)return{start:E,end:R,delta:{distanceInMeters:R.distanceInMeters-E.distanceInMeters,travelTimeInSeconds:R.travelTimeInSeconds-E.travelTimeInSeconds}}},getRouteProgressForSection=(e,t)=>getRouteProgressBetween(e,t.startPointIndex,t.endPointIndex),getSectionBBox=(e,t)=>{const A=e.geometry.coordinates;if(!A||0===A.length||t.startPointIndex<0||t.endPointIndex>=A.length||t.startPointIndex>t.endPointIndex)return;const E=Math.floor((t.startPointIndex+t.endPointIndex)/2);return bboxFromCoordsArray([A[t.startPointIndex],A[E],A[t.endPointIndex]])},getSectionOverlap=(e,t)=>{const A=Math.max(e.startPointIndex,t.startPointIndex),E=Math.min(e.endPointIndex,t.endPointIndex);return E>A?{startPointIndex:A,endPointIndex:E}:void 0},metersWithin=(e,t,A=[{startPointIndex:0,endPointIndex:e.length-1}])=>A.reduce((A,E)=>{const R=getSectionOverlap(E,t);return A+(R?e[R.endPointIndex]-e[R.startPointIndex]:0)},0),firstIndexPast=(e,t,A)=>{let E=e,R=0,n=e;for(;R<n;){const e=R+n>>>1;let T=e;for(;T<n&&void 0===t(T);)T++;const I=T<n?t(T):void 0;void 0===I?n=e:A(I)?(E=T,n=e):R=T+1}return E},findBracketingProgressPoints=(e,t,A)=>{const E=A=>e[A][t],R=e[firstIndexPast(e.length,E,e=>e>=A)];let n=firstIndexPast(e.length,E,e=>e>A)-1;for(;n>=0&&void 0===e[n][t];)n--;const T=e[n],I=T?.[t],o=R?.[t];return void 0!==I&&void 0!==o?{lower:T,lowerValue:I,upper:R,upperValue:o}:void 0},metersAlongLineCache=/* @__PURE__ */new WeakMap,EARTH_RADIUS_IN_METERS=6371008.8,RADIANS_PER_DEGREE=Math.PI/180,metersAlongLine=e=>{const t=metersAlongLineCache.get(e);if(t?.length===e.length)return t;const A=new Float64Array(e.length);let[E=0,R=0]=e[0]??[],n=Math.cos(R*RADIANS_PER_DEGREE);for(let T=1;T<e.length;T++){const[t,I]=e[T],o=Math.cos(I*RADIANS_PER_DEGREE),r=Math.sin((I-R)*RADIANS_PER_DEGREE/2),N=Math.sin((t-E)*RADIANS_PER_DEGREE/2),_=r*r+N*N*n*o;A[T]=A[T-1]+12742017.6*Math.atan2(Math.sqrt(_),Math.sqrt(1-_)),E=t,R=I,n=o}return metersAlongLineCache.set(e,A),A},segmentAtMeters=(e,t,A,E)=>{const R=firstIndexPast(e.length,t=>e[t],e=>e>=t),n=clamp(R-1,A,E-1),T=e[n+1]-e[n];return{pathIndex:n,share:T>0?clamp((t-e[n])/T,0,1):0}},positionBetween=(e,t,A)=>[e[0]+A*(t[0]-e[0]),e[1]+A*(t[1]-e[1])],lengthShareOfBracket=(e,t,A,E)=>{const R=metersAlongLine(e),n=R[E]-R[t];return n>0?(R[A]-R[t])/n:(A-t)/(E-t)},interpolateProgressAtPathIndex=(e,t,A)=>{const E=e.geometry.coordinates,R=Math.min(t+1,E.length-1),n=calculateProgressAtRoutePoint(e,t),T=calculateProgressAtRoutePoint(e,R);if(n&&T)return{position:positionBetween(E[t],E[R],A),...progressBetween(n,T,A)}},coordinateAtProgressPoint=(e,t)=>{const A=progressValuesOf(t);return A&&{position:e[t.pointIndex],...A}},resolveCoordinateAtProgress=(e,t,A)=>{const{progress:E}=e.properties,R=E?.at(-1);if(!E||!R)return;const n=e.geometry.coordinates,T=E[0],I=T[t],o=R[t];if(void 0===I||void 0===o)return;if(A<=I)return coordinateAtProgressPoint(n,T);if(A>=o)return coordinateAtProgressPoint(n,R);const r=((e,t,A,E)=>{const R=findBracketingProgressPoints(e,A,E);if(!R)return;const{lower:n,lowerValue:T,upper:I,upperValue:o}=R,r=T===o?0:(E-T)/(o-T),N=metersAlongLine(t),_=N[I.pointIndex]-N[n.pointIndex];if(0===_){const e=n.pointIndex+r*(I.pointIndex-n.pointIndex),t=Math.floor(e);return{pathIndex:t,progressRatioTowardsNextPathPoint:e-t}}const S=N[n.pointIndex]+r*_,i=segmentAtMeters(N,S,n.pointIndex,I.pointIndex);return{pathIndex:i.pathIndex,progressRatioTowardsNextPathPoint:i.share}})(E,n,t,A);return void 0!==r?interpolateProgressAtPathIndex(e,r.pathIndex,r.progressRatioTowardsNextPathPoint):void 0},getCoordinateAtRouteProgress=(e,t)=>{if("traveledTimeInSeconds"in t)return resolveCoordinateAtProgress(e,"travelTimeInSeconds",t.traveledTimeInSeconds);if("traveledDistanceInMeters"in t)return resolveCoordinateAtProgress(e,"distanceInMeters",t.traveledDistanceInMeters);const A=e.properties.summary.departureTime;if(!A)return;const E=(t.clockTime.getTime()-A.getTime())/1e3;return E<0?void 0:resolveCoordinateAtProgress(e,"travelTimeInSeconds",E)},getProgressAtNearestRoutePoint=(e,t)=>{const{progress:A}=e.properties,E=e.geometry.coordinates;if(!A?.length||E.length<2)return;const R=nearestPointOnLine(e,getPositionStrict(t)),n=R.properties.segmentIndex,T=Math.min(n+1,E.length-1),I=((e,t,A)=>{const E=A[0]-e[0],R=A[1]-e[1],n=E*E+R*R;if(0===n)return 0;const T=((t[0]-e[0])*E+(t[1]-e[1])*R)/n;return clamp(T,0,1)})(E[n],R.geometry.coordinates,E[T]);return interpolateProgressAtPathIndex(e,n,I)},SQRT_3=/* @__PURE__ */Math.sqrt(3),HEXAGON_ANGLES=/* @__PURE__ */(()=>[0,1,2,3,4,5].map(e=>2*Math.PI/6*e))(),HEXAGON_COSINES=/* @__PURE__ */(()=>HEXAGON_ANGLES.map(Math.cos))(),HEXAGON_SINES=/* @__PURE__ */(()=>HEXAGON_ANGLES.map(Math.sin))(),hexagonRowHeight=e=>SQRT_3/2*e.height,hexagonColumnOffset=(e,t)=>1&t?hexagonRowHeight(e)/2:0,hexagonCentre=(e,{column:t,row:A})=>[e.origin[0]+t*e.width*.75,e.origin[1]+A*hexagonRowHeight(e)-hexagonColumnOffset(e,t)],hexagonInColumn=(e,t,A)=>({column:t,row:Math.round((A-e.origin[1]+hexagonColumnOffset(e,t))/hexagonRowHeight(e))}),latticeCellOf=(e,t)=>"hex"===e.shape?((e,t)=>{const A=Math.round((t[0]-e.origin[0])/(.75*e.width)),E=A=>((e,t,[A,E])=>{const R=Math.abs(A-t[0])/(e.width/2),n=Math.abs(E-t[1])/(e.height/2);return Math.max(R+n/SQRT_3,2*n/SQRT_3)})(e,hexagonCentre(e,A),t);let R=hexagonInColumn(e,A,t[1]);for(const n of[A-1,A+1]){const A=hexagonInColumn(e,n,t[1]);E(A)<E(R)&&(R=A)}return R})(e,t):{column:Math.floor((t[0]-e.origin[0])/e.width+.5),row:Math.floor((t[1]-e.origin[1])/e.height+.5)},latticeCellPolygon=(e,t)=>{if("hex"===e.shape){const[A,E]=hexagonCentre(e,t),R=HEXAGON_COSINES.map((t,R)=>[A+e.width/2*t,E+e.height/2*HEXAGON_SINES[R]]);return{type:"Polygon",coordinates:[[...R,[...R[0]]]]}}const A=e.origin[0]+(t.column-.5)*e.width,E=e.origin[1]+(t.row-.5)*e.height;return polygonFromBBox([A,E,A+e.width,E+e.height]).geometry},inBBox=([e,t,A,E],[R,n])=>n>=t&&n<=E&&(e>A?R>=e||R<=A:R>=e&&R<=A),inPolygon=(e,t,[A,E])=>booleanPointInPolygon([A,E],e)||t[0]>t[2]&&(booleanPointInPolygon([A+360,E],e)||booleanPointInPolygon([A-360,E],e)),statisticOf={count:e=>e.length,sum:sum,mean:mean,median:e=>{const t=Float64Array.from(e).sort(),A=Math.floor(t.length/2);return t.length%2?t[A]:(t[A-1]+t[A])/2},min:e=>e.reduce((e,t)=>Math.min(e,t),Number.POSITIVE_INFINITY),max:e=>e.reduce((e,t)=>Math.max(e,t),Number.NEGATIVE_INFINITY)},aggregateIntoCells=(e,t)=>{const A=t,E=void 0===(R=A.value)?()=>0:"function"==typeof R?R:e=>e.properties?.[R];var R;const n=[];for(const r of e.features){const e=E(r),t=r.geometry?.coordinates;"number"==typeof e&&Number.isFinite(e)&&Number.isFinite(t?.[0])&&Number.isFinite(t?.[1])&&n.push({position:t,value:e})}const T=(e=>"string"==typeof e.grid)(A)?((e,t)=>{const{cellSizeKM:A}=t;if(!(A>0&&Number.isFinite(A)))throw new Error(`cellSizeKM must be a positive number, got ${A}`);if(!e.length)return[];const E=(({grid:e,cellSizeKM:t,gridOrigin:A},E)=>{const R=bboxFromCoordsArray(E),n=A??(R?bboxCenter(R):E[0]),T=lengthToDegrees(t,"kilometers"),I=clamp(n[1],-85.051129,85.051129),o="hex"===e?2:1;return{shape:e,origin:n,width:T/Math.cos(I*RADIANS_PER_DEGREE)*o,height:T*o}})(t,e.map(({position:e})=>e)),R=E.origin[0],n=/* @__PURE__ */new Map;for(const{position:T,value:I}of e){const e=T[0]-360*Math.round((T[0]-R)/360),t=latticeCellOf(E,[e,T[1]]),A=`${E.shape}:${t.column}:${t.row}`;let o=n.get(A);o||(o={cell:{type:"Feature",id:A,geometry:latticeCellPolygon(E,t),properties:{}},values:[]},n.set(A,o)),o.values.push(I)}return[...n.values()]})(n,A):((e,t)=>{const A=t.features.map(e=>({bbox:bboxFromGeoJSON(e),bin:{cell:e,values:[]}}));for(const{position:E,value:R}of e)for(const{bbox:e,bin:t}of A)e&&inBBox(e,E)&&inPolygon(t.cell,e,E)&&t.values.push(R);return A.map(({bin:e})=>e)})(n,A.grid),I=A.stats??["count"],o=Math.max(A.minCount??1,1);return{type:"FeatureCollection",features:T.filter(({values:e})=>e.length>=o).map(({cell:e,values:t})=>({...e,properties:{...e.properties,...Object.fromEntries(I.map(e=>[e,statisticOf[e](t)]))}}))}},generateId=()=>Date.now().toString(36)+Math.random().toString(36).substring(2),MIN_PROGRESS=5*Math.PI/180,MAX_TURN_BACK=10*Math.PI/180,NO_JUNCTION=/^(DEPART|ARRIVE|WAYPOINT|CROSS_BORDER|TOLLGATE)/,roadNamesOf=e=>[e?.streetName?.text,...(e?.roadShields??[]).map(e=>e.roadNumber.text)].filter(e=>!!e),followsTheRoad=({maneuver:e,maneuverView:t,previousRoadInfo:A,nextRoadInfo:E})=>{if(e.includes("ROUNDABOUT")||e.includes("UTURN"))return!1;if(t&&!t.offRouteAngles.length)return!0;const R=roadNamesOf(A);return roadNamesOf(E).some(e=>R.includes(e))},curvinessWeight=e=>e<30?2:e<60?1.6:e<100?1.3:e<175?1:0,SLOW_JUNCTION=/^(?:TURN|SHARP|MAKE_UTURN|.*ROUNDABOUT)/,severityOf=(e,t,A,E)=>{const R=e+.75/Math.tan(Math.min(Math.abs(t),Math.PI)/4)**2,n=3.6*Math.sqrt(3*R),T=E&&SLOW_JUNCTION.test(E)?Math.min(n,20):n;return Math.max(0,1-(T/A)**2)},turnBetween=(e,t)=>{const A=t-e;return A>Math.PI?A-2*Math.PI:A<=-Math.PI?A+2*Math.PI:A},bearing=(e,t)=>{const A=turnBetween(e[0]*RADIANS_PER_DEGREE,t[0]*RADIANS_PER_DEGREE);return Math.atan2(A*Math.cos((e[1]+t[1])/2*RADIANS_PER_DEGREE),(t[1]-e[1])*RADIANS_PER_DEGREE)},turnsBack=({meters:e,turns:t},A,E,R,n)=>{let T=0;for(let I=A;I>0&&I<t.length-1;I+=E){if(Math.abs(e[I]-e[A])>n)return!1;if(T+=R*t[I],T<-MAX_TURN_BACK)return!0;if(T>MAX_TURN_BACK)return!1}return!1},turnWithin=({along:e},t,A,E,R)=>{const n=bearing(t[A],t[E]);let T=0,I=A;for(let o=A;o<E;o++){for(;I<E&&e[I]-e[o]<5;)I++;if(e[I]-e[o]<5)break;T=Math.max(T,R*turnBetween(n,bearing(t[o],t[I])))}return T},fittedRadius=(e,t,A)=>{if(A-t<2)return;const[E,R]=e[t],n=6371008.8*Math.cos(R*RADIANS_PER_DEGREE),T=e.slice(t,A+1).map(([e,t])=>[turnBetween(E*RADIANS_PER_DEGREE,e*RADIANS_PER_DEGREE)*n,(t-R)*RADIANS_PER_DEGREE*6371008.8]),I=T.reduce((e,[t])=>e+t,0)/T.length,o=T.reduce((e,[,t])=>e+t,0)/T.length;let r=0,N=0,_=0,S=0,i=0;for(const[C,L]of T){const e=C-I,t=L-o;r+=e*e,N+=e*t,_+=t*t,S+=e*(e*e+t*t),i+=t*(e*e+t*t)}const s=r*_-N*N;if(s<=1e-6*(r+_)**2)return;const O=(S*_-i*N)/(2*s),a=(i*r-S*N)/(2*s);return Math.sqrt(O*O+a*a+(r+_)/T.length)},runFrom=(e,t,A,E,R)=>{let n=A,T=A;for(let I=A+1;I<e.length-1;I++){const A=E*e[I];if(A>E*e[n]&&(n=I),A-E*e[T]>=MIN_PROGRESS&&(T=I),E*e[n]-A>MAX_TURN_BACK)return{last:n,next:n+1};if(t[I]-t[T]>R)return{last:n,next:I}}return{last:n,next:e.length-1}},sharpestPart=({meters:e,turns:t},{sign:A,first:E,last:R},n)=>{let T=0,I=Number.POSITIVE_INFINITY,o=E,r=Number.NEGATIVE_INFINITY;const N={first:E,last:E};for(let _=E;_<=R;_++){const E=T-n*e[_];E<I&&(I=E,o=_),T+=A*t[_];const R=T-n*e[_]-I;R>r&&(r=R,N.first=o,N.last=_)}return N},fittedRadiusOf=(e,t,A,E,R)=>{const{indexes:n}=e,T=(({meters:e,turns:t},A,E,R)=>{const n=.8*Math.abs(R),T=Math.sign(R),I={first:A,last:E};let o=A,r=0;for(let N=A;N<=E;N++){for(r+=T*t[N];o<N&&r-T*t[o]>=n;)r-=T*t[o++];r>=n&&e[N]-e[o]<e[I.last]-e[I.first]&&(I.first=o,I.last=N)}return I})(e,A,E,R),I=T.first===T.last,o=I?Math.max(A,T.first-1):T.first,r=I?Math.min(E,T.last+1):T.last;return fittedRadius(t,n[o],n[r])??fittedRadius(t,n[A],n[E])},headingOf=(e,t,{sign:A,first:E,last:R},n)=>{const{indexes:T,turns:I}=e;let o=0;for(let r=E;r<=R;r++)o+=I[r];return turnsBack(e,E-1,-1,A,n)&&(o+=A*turnWithin(e,t,T[E-1],T[E],-A)),turnsBack(e,R+1,1,A,n)&&(o+=A*turnWithin(e,t,T[R],T[R+1],A)),o},getCurveSections=(e,{minHeadingChangeInDegrees:t=40,maxRadiusInMeters:A=250,maxStraightInMeters:E=Math.max(40,.15*A)}={})=>{const R=e.properties.sections.leg.slice(0,-1).flatMap(e=>e.endPointIndex??[]),{coordinates:n}=e.geometry,T=((e,t)=>{const A=metersAlongLine(e),E=new Int32Array(e.length),R=new Float64Array(e.length);let n=0;for(let r=0;r<e.length;r++){const t=n?A[r]-R[n-1]:Number.POSITIVE_INFINITY;(t>=10||r===e.length-1&&t>0)&&(E[n]=r,R[n++]=A[r])}const T=new Float64Array(n);let I=n>1?bearing(e[E[0]],e[E[1]]):0,o=0;for(let r=1;r<n-1;r++){const A=bearing(e[E[r]],e[E[r+1]]);for(;o<t.length&&t[o]<=E[r-1];)o++;const R=o<t.length&&t[o]<E[r+1];T[r]=R?0:turnBetween(I,A),I=A}return{along:A,indexes:E.subarray(0,n),meters:R.subarray(0,n),turns:T}})(n,R),{along:I,indexes:o,meters:r}=T,N=((e,t)=>{let A=0;return E=>{const R=t[E]-150;for(;A<e.length&&t[e[A].endPointIndex]<R;)A++;let n=0;for(let t=A;t<e.length&&e[t].startPointIndex<=E;t++)n=Math.max(n,e[t].maxSpeedLimitInKmh);return n||80}})(e.properties.sections.speedLimit??[],I),_=(e=>{let t=0;return(A,E)=>{for(;t<e.length&&e[t].pathPointIndex<A;)t++;for(let R=t;R<e.length&&e[R].pathPointIndex<=E;R++){const t=e[R];if(!NO_JUNCTION.test(t.maneuver)&&!followsTheRoad(t))return t.maneuver}}})(e.properties.guidance?.instructions??[]);let S=0;const i=[],s=t*RADIANS_PER_DEGREE;for(const O of(({meters:e,turns:t},A,E)=>{const R=new Float64Array(t.length);for(let I=1;I<t.length;I++)R[I]=R[I-1]+t[I];const n=[];let T=1;for(;T<t.length-1;){if(0===t[T]){T++;continue}const I=t[T]>0?1:-1,o=T,{last:r,next:N}=runFrom(R,e,o,I,A);I*(R[r]-R[o-1])>=E&&n.push({sign:I,first:o,last:r}),T=N}return n})(T,E,s/2)){const{first:e,last:t}=sharpestPart(T,O,1/(2*A)),R=headingOf(T,n,{sign:O.sign,first:e,last:t},E),I=r[e]-r[e-1],o=r[t+1]-r[t],N=(Math.min(I,o,E)+(r[t]-r[e]))/Math.abs(R),_=fittedRadiusOf(T,n,e,t,R)??N,a=Math.max(I<=E?e-1:e,S),C=o<=E?t+1:t;Math.abs(R)<s||_>A||a>=C||(S=C,i.push({start:a,end:C,heading:R,radiusInMeters:_}))}return i.map(({start:e,end:t,heading:A,radiusInMeters:E},R)=>{const n=o[e],T=o[t],I=i[R+1]?.start===t,S=_(n,I?T-1:T);return{id:generateId(),startPointIndex:n,endPointIndex:T,headingChangeInDegrees:A/RADIANS_PER_DEGREE,radiusInMeters:E,lengthInMeters:r[t]-r[e],curvinessScore:curvinessWeight(E)*E*Math.abs(A),severity:severityOf(E,A,N(n),S),...S&&{maneuver:S}}})},isHairpin=e=>!e.maneuver&&Math.abs(e.headingChangeInDegrees)>=140&&e.radiusInMeters<=40,getCurvyStretchSections=(e,{curves:t=e.properties.sections.curve??getCurveSections(e),maxGapInMeters:A=500,minCurveCount:E=3}={})=>{const R=metersAlongLine(e.geometry.coordinates),n=[];let T=[];const I=()=>{const e=T.at(-1);if(e&&T.length>=E){const{startPointIndex:t}=T[0],{endPointIndex:A}=e;n.push({id:generateId(),startPointIndex:t,endPointIndex:A,curveCount:T.length,lengthInMeters:R[A]-R[t],hairpinCount:T.filter(isHairpin).length,minRadiusInMeters:Math.min(...T.map(e=>e.radiusInMeters)),curvinessScore:T.reduce((e,t)=>e+t.curvinessScore,0)})}T=[]};for(const o of t){if(o.maneuver){I();continue}const e=T.at(-1);e&&R[o.startPointIndex]-R[e.endPointIndex]>A&&I(),T.push(o)}return I(),n},withCurveSections=(e,{curve:t,curvyStretch:A}={})=>{const E=getCurveSections(e,t),R=getCurvyStretchSections(e,{...A,curves:E}),{curve:n,curvyStretch:T,...I}=e.properties.sections;return{...e,properties:{...e.properties,sections:{...I,...E.length&&{curve:E},...R.length&&{curvyStretch:R}}}}},bucket=e=>Math.round(1e5*e),vertexHash=(e,t)=>Math.imul(Math.imul(e,2654435761)^t,2246822507),holds=(e,t,A,E,R,n)=>e[t]===A&&e[t+1]===E&&e[t+2]===R&&e[t+3]===n,slotOf=(e,t,A,E,R,n,T)=>{const I=vertexHash(E,R)+vertexHash(n,T);let o=6*((I^I>>>15)&e.length/6-1);for(;e[o+4]&&!holds(e,o,E,R,n,T)&&!holds(e,o,n,T,E,R);)o=(o+6)%e.length;return e[o+4]||(e[o]=E,e[o+1]=R,e[o+2]=n,e[o+3]=T,e[o+4]=t+1,e[o+5]=A),o},getDistinctSections=(e,{minLengthInMeters:t=0}={})=>{const A=Array.isArray(e)?e:e.features,{firsts:E,shared:R}=(e=>{const t=new Int32Array(6*2**Math.ceil(Math.log2(1.5*e.reduce((e,t)=>e+t.length,0)+1))),A=e.map(e=>new Int32Array(Math.max(e.length-1,0))),E=A.map(e=>new Uint8Array(e.length)),R=(e,t)=>{E[e][A[e][t]]=1};return e.forEach((E,n)=>{const T=A[n];let I;const[o=0,r=0]=E[0]??[];let N=bucket(o),_=bucket(r);for(let A=0;A<T.length;A++){const o=N,r=_;if(N=bucket(E[A+1][0]),_=bucket(E[A+1][1]),o===N&&r===_){T[A]=-1;continue}T[A]=A;const S=I&&e[I.route][I.vertex+I.step];if(I&&S&&bucket(S[0])===N&&bucket(S[1])===_){R(n,A),R(I.route,Math.min(I.vertex,I.vertex+I.step)),I.vertex+=I.step;continue}const i=slotOf(t,n,A,o,r,N,_),s=t[i+4]-1,O=t[i+5];if(I=void 0,s===n){T[A]=O;continue}R(n,A),R(s,O);const a=t[i]===o&&t[i+1]===r;I={route:s,vertex:a?O+1:O,step:a?1:-1}}}),{firsts:A,shared:E}})(A.map(e=>e.geometry.coordinates));return A.map((e,A)=>{const n=E[A],T=R[A],I=metersAlongLine(e.geometry.coordinates),o=[];let r;for(let E=0;E<=n.length;E++){if(-1===n[E])continue;if(E<n.length&&!T[n[E]]){r??=E;continue}if(void 0===r)continue;const e=I[E]-I[r];e>=t&&o.push({id:generateId(),startPointIndex:r,endPointIndex:E,lengthInMeters:e}),r=void 0}return o})},viewsNotServed={mapTiles:["CN","RU"],search:["KR","US"],placeDetails:["KR","US"],reverseGeocoding:["KR","US"],geocoding:["AE","BN","CL","DZ","KR","MY","PH","US","VN"]},servesGeopoliticalView=(e,t)=>!viewsNotServed[t].includes(e),TOMTOM_USER_AGENT_SDK_NAME="MapsSDKJS",generateTomTomHeaders=e=>!1===e.sendUserAgentHeader?{}:{"tomtom-user-agent":e["tomtom-user-agent"]??"MapsSDKJS/1.0.0-rc.5"},getImportantRoads=(e,{within:t,minLengthInMeters:A=0}={})=>{const E=metersAlongLine(e.geometry.coordinates),R=/* @__PURE__ */new Map,n=[...e.properties.sections.importantRoadStretch??[]].sort((e,t)=>e.startPointIndex-t.startPointIndex);for(const T of n){const e=metersWithin(E,T,t);if(!e)continue;const{index:A,roadNumbers:n=[],streetName:I}=T,o=n[0]??I,r=o??A,N=R.get(r);N?(N.index=Math.min(N.index,A),N.roadNumbers=[.../* @__PURE__ */new Set([...N.roadNumbers,...n])],N.streetName??=I,N.lengthInMeters+=e,N.sections.push(T)):R.set(r,{index:A,...o&&{name:o},roadNumbers:n,...I&&{streetName:I},lengthInMeters:e,sections:[T]})}return[...R.values()].filter(e=>e.lengthInMeters>=A)},getInstructionLanes=(e,t)=>{const A=e.properties.guidance?.instructions??[];if(A.find(e=>e.pathPointIndex===t.pathPointIndex)?.maneuver!==t.maneuver)return;const E=({startPointIndex:t,endPointIndex:E})=>{const R=A.findLast(({pathPointIndex:e})=>t<=e&&e<=E);if(R)return R.pathPointIndex;const n=A.find(({pathPointIndex:e})=>e>E),T=e.geometry.coordinates[E];return n&&T&&distance(T,n.maneuverPoint,{units:"meters"})<=100?n.pathPointIndex:void 0};let R;for(const n of e.properties.sections.lanes??[])(!R||n.endPointIndex>R.endPointIndex)&&E(n)===t.pathPointIndex&&(R=n);return R},serviceLanguageCodes={"zh-Hans":"zh-CN","zh-Hant":"zh-TW"},serviceLanguage=e=>serviceLanguageCodes[e]??e,placesLanguageCodes={ngt:void 0,"en-CA":"en-GB","es-MX":"es-419","hi-IN":void 0,"ja-JP":void 0},placesLanguage=e=>Object.hasOwn(placesLanguageCodes,e)?placesLanguageCodes[e]:serviceLanguage(e),poiCategoriesLanguage=e=>"ngt-Latn"===e?void 0:placesLanguage(e),trafficIncidentLanguages={ngt:void 0,"ngt-Latn":void 0,ar:"ar","bg-BG":void 0,"ca-ES":"ca-ES","zh-Hant":"zh-TW","zh-Hans":void 0,"hr-HR":void 0,"cs-CZ":"cs-CZ","da-DK":"da-DK","nl-NL":"nl-NL","en-AU":"en-GB","en-CA":"en-GB","en-GB":"en-GB","en-NZ":"en-GB","en-US":"en-US","et-EE":"et-EE","eu-ES":void 0,"fi-FI":"fi-FI","fr-FR":"fr-FR","gl-ES":void 0,"de-DE":"de-DE","el-GR":"el-GR","he-IL":"he-IL","hi-IN":void 0,"hu-HU":"hu-HU","id-ID":"id-ID","it-IT":"it-IT","ja-JP":"ja-JP","kk-KZ":void 0,"ko-KR":"ko-KR","ko-Latn-KR":void 0,"lv-LV":"lv-LV","lt-LT":"lt-LT","ms-MY":void 0,"nb-NO":"nb-NO","pl-PL":"pl-PL","pt-BR":"pt-PT","pt-PT":"pt-PT","ro-RO":"ro-RO","ru-RU":"ru-RU","ru-Latn-RU":void 0,"ru-Cyrl-RU":"ru-RU","sr-RS":void 0,"sk-SK":"sk-SK","sl-SI":void 0,"es-ES":"es-ES","es-MX":"es-ES","sv-SE":"sv-SE","th-TH":"th-TH","tr-TR":"tr-TR","uk-UA":void 0},trafficIncidentLanguage=e=>e&&trafficIncidentLanguages[e],poiCategoriesToID={TRAFFIC_CONTROL_DEPARTMENT:7301,TRAFFIC_CONTROL_DEPARTMENT_GENERIC:7301002,TRAIL_SYSTEM:7302,MOUNTAIN_BIKE_TRAIL:7302002,ADVENTURE_VEHICLE_TRAIL:7302003,HIKING_TRAIL:7302004,HORSE_RIDING_TRAIL:7302005,ROCK_CLIMBING_TRAIL:7302006,RESIDENTIAL_ACCOMMODATION:7303,RETIREMENT_COMMUNITY:7303002,FLATS_OR_APARTMENT_COMPLEX:7303003,HOLIDAY_RENTAL:7304,COTTAGE_RENTAL:7304002,VILLA_RENTAL:7304003,BUNGALOW_RENTAL:7304004,CHALET_RENTAL:7304005,APARTMENT_RENTAL:7304006,ADVENTURE_SPORTS_FACILITY:7305,HELIPORT_OR_HELIPAD:7308,CHARGING_LOCATION:7309,VEHICLE_REPAIR:7310,BODYSHOP:7310002,CAR_GLASS_REPLACEMENT_SHOP:7310003,CAR_REPAIR_AND_SERVICE:7310004,TIRE_SERVICE:7310007,MOTORCYCLE_REPAIR:7310008,TRUCK_REPAIR_AND_SERVICE:7310009,FUEL_STATION:7311,CAR_RENTAL:7312,PARKING_GARAGE:7313,HOTEL_OR_MOTEL:7314,BANDB_OR_GUEST_HOUSE:7314002,HOTEL:7314003,HOSTEL:7314004,RESORT:7314005,MOTEL:7314006,CABINS_LODGES:7314007,REST_CAMP:7314008,RESTAURANT:7315,AFRICAN_RESTAURANT:7315002,AMERICAN_RESTAURANT:7315003,AUSTRIAN_RESTAURANT:7315004,BARBECUE_RESTAURANT:7315005,BELGIAN_RESTAURANT:7315006,BISTRO:7315007,BRITISH_RESTAURANT:7315008,CALIFORNIAN_RESTAURANT:7315009,CANADIAN_RESTAURANT:7315010,CARIBBEAN_RESTAURANT:7315011,CHINESE_RESTAURANT:7315012,CREPERIE:7315013,DUTCH_RESTAURANT:7315014,FAST_FOOD:7315015,PHILIPPINE_RESTAURANT:7315016,FRENCH_RESTAURANT:7315017,GERMAN_RESTAURANT:7315018,GREEK_RESTAURANT:7315019,GRILL_RESTAURANT:7315020,HAWAIIAN_RESTAURANT:7315021,HUNGARIAN_RESTAURANT:7315022,INDIAN_RESTAURANT:7315023,INDONESIAN_RESTAURANT:7315024,ITALIAN_RESTAURANT:7315025,JAPANESE_RESTAURANT:7315026,JEWISH_RESTAURANT:7315027,KOREAN_RESTAURANT:7315028,LATIN_AMERICAN_RESTAURANT:7315029,LEBANESE_RESTAURANT:7315030,MEDITERRANEAN_RESTAURANT:7315032,MEXICAN_RESTAURANT:7315033,MIDDLE_EASTERN_RESTAURANT:7315034,ORIENTAL_RESTAURANT:7315035,PIZZERIA:7315036,POLISH_RESTAURANT:7315037,PORTUGUESE_RESTAURANT:7315038,RUSSIAN_RESTAURANT:7315040,SANDWICH_RESTAURANT:7315042,SEAFOOD:7315043,SPANISH_RESTAURANT:7315044,STEAK_HOUSE:7315045,SWISS_RESTAURANT:7315047,THAI_RESTAURANT:7315048,TURKISH_RESTAURANT:7315049,VEGETARIAN_RESTAURANT:7315050,VIETNAMESE_RESTAURANT:7315051,HUNAN_RESTAURANT:7315052,SHANDONG_RESTAURANT:7315053,SICHUAN_RESTAURANT:7315056,DONGBEI_RESTAURANT:7315057,HOT_POT_RESTAURANT:7315058,TAIWANESE_RESTAURANT:7315059,WESTERN_RESTAURANT:7315060,PERUVIAN_RESTAURANT:7315061,ASIAN_RESTAURANT:7315062,CREOLE_RESTAURANT:7315063,SOUL_FOOD:7315064,IRISH_RESTAURANT:7315065,JAMAICAN_RESTAURANT:7315066,KOSHER_RESTAURANT:7315067,CZECH_RESTAURANT:7315068,HAMBURGER_RESTAURANT:7315069,CHICKEN_RESTAURANT:7315070,FUSION_RESTAURANT:7315071,BRAZILIAN_RESTAURANT:7315072,INTERNATIONAL_RESTAURANT:7315073,MOROCCAN_RESTAURANT:7315074,ORGANIC_FOOD_RESTAURANT:7315075,TAPAS_RESTAURANT:7315076,ICE_CREAM_PARLOR:7315078,DOUGHNUT_RESTAURANT:7315079,AFGHAN_RESTAURANT:7315081,ARABIAN_RESTAURANT:7315083,ARMENIAN_RESTAURANT:7315085,AUSTRALIAN_RESTAURANT:7315086,BASQUE_RESTAURANT:7315087,BOLIVIAN_RESTAURANT:7315088,BULGARIAN_RESTAURANT:7315090,BURMESE_RESTAURANT:7315091,CAMBODIAN_RESTAURANT:7315092,CHILEAN_RESTAURANT:7315093,COLOMBIAN_RESTAURANT:7315094,CORSICAN_RESTAURANT:7315095,CUBAN_RESTAURANT:7315096,DANISH_RESTAURANT:7315098,EGYPTIAN_RESTAURANT:7315100,ENGLISH_RESTAURANT:7315101,ETHIOPIAN_RESTAURANT:7315102,FINNISH_RESTAURANT:7315104,IRANIAN_RESTAURANT:7315105,ISRAELI_RESTAURANT:7315106,MONGOLIAN_RESTAURANT:7315110,NEPALESE_RESTAURANT:7315111,NORWEGIAN_RESTAURANT:7315112,SCANDINAVIAN_RESTAURANT:7315114,SWEDISH_RESTAURANT:7315119,SYRIAN_RESTAURANT:7315120,TEPPANYAKI_RESTAURANT:7315121,TIBETAN_RESTAURANT:7315122,TUNISIAN_RESTAURANT:7315123,VENEZUELAN_RESTAURANT:7315125,PAKISTANI_RESTAURANT:7315127,FONDUE_RESTAURANT:7315134,SNACKS_RESTAURANT:7315139,SOUP_RESTAURANT:7315140,BUFFET_RESTAURANT:7315142,SALAD_BAR:7315143,TAKEOUT_FOOD:7315145,BANQUET_ROOMS:7315146,CAFETERIA:7315147,SUSHI_RESTAURANT:7315148,JUICE_BAR:7315149,TOURIST_INFORMATION:7316,MUSEUM:7317,THEATER:7318,CONCERT_HALL:7318002,MUSIC_CENTER:7318003,OPERA_HOUSE:7318004,THEATER_GENERIC:7318005,CABARET_THEATER:7318006,AMPHITHEATER:7318007,DINNER_THEATER:7318008,CULTURAL_CENTER:7319,SPORTS_CENTER:7320,FITNESS_CLUB_AND_CENTER:7320002,HORSE_RIDING:7320003,SPORTS_CENTER_GENERIC:7320004,THEMATIC_SPORT_CENTER:7320005,SQUASH_COURT:7320006,HOSPITAL:7321,GENERAL_HOSPITAL_AND_POLYCLINIC:7321002,SPECIAL_HOSPITAL:7321003,HOSPITAL_OF_CHINESE_MEDICINE:7321004,HOSPITAL_FOR_WOMEN_AND_CHILDREN:7321005,POLICE_STATION:7322,POST_OFFICE:7324,PHARMACY:7326,DEPARTMENT_STORE:7327,BANK:7328,MARKETPLACE:7332,INFORMAL_MARKET:7332002,PUBLIC_MARKET:7332003,FARMERS_MARKET:7332004,SUPERMARKET:7332005,AGRICULTURE:7335,HORTICULTURE:7335002,PRIMARY_PRODUCER:7335003,FARM:7335004,VIEWPOINT:7337,SWIMMING_POOL:7338,RELIGIOUS_SITE:7339,CHURCH:7339002,MOSQUE:7339003,SYNAGOG:7339004,TEMPLE:7339005,GURUDWARA:7339006,PAGODA:7339008,CASINO_AND_GAMBLING:7341,CINEMA:7342,MOVIE_THEATER:7342002,DRIVE_IN_MOVIES:7342003,MARINA:7347,MARINA_GENERIC:7347002,YACHT_BASIN:7347003,WINERY:7349,FERRY_TERMINAL:7352,TRUCK_STOP:7358,WEIGH_STATION:7359,WEIGH_STATION_GENERIC:7359002,CAMPING_GROUND:7360,RECREATIONAL_CAMPING_GROUND:7360002,CARAVAN_SITE:7360003,COMMUNITY_CENTER:7363,EMBASSY:7365,BORDER_CONTROL:7366,GOVERNMENT_OFFICE:7367,MOTORING_ORGANIZATION_OFFICE:7368,OPEN_CAR_PARKING_AREA:7369,OPEN_CAR_PARKING_AREA_GENERIC:7369002,SCHOOL:7372,SCHOOL_GENERIC:7372002,CHILDCARE:7372003,PRE_SCHOOL:7372004,PRIMARY_SCHOOL:7372005,HIGH_SCHOOL:7372006,SENIOR_HIGH_SCHOOL:7372007,VOCATIONAL_SCHOOL:7372008,LANGUAGE_SCHOOL:7372010,ART_SCHOOL:7372012,MIDDLE_SCHOOL:7372014,DRIVING_SCHOOL:7372016,MALL:7373,STADIUM:7374,ATHLETICS_TRACK:7374002,CRICKET_GROUND:7374003,SOCCER_STADIUM:7374004,HORSE_RACING_TRACK:7374005,MULTI_PURPOSE_STADIUM:7374006,RUGBY_GROUND:7374007,ICE_HOCKEY_ARENA:7374008,BASEBALL_PARK:7374009,FOOTBALL_STADIUM:7374010,MOTOR_RACING_STADIUM:7374011,BASKETBALL_ARENA:7374012,RACE_TRACK:7374013,NETBALL_STADIUM:7374014,TOLL_GATE:7375,TOURIST_ATTRACTION:7376,BUILDING:7376002,MONUMENT:7376003,NATURAL_TOURIST_ATTRACTION:7376004,OBSERVATORY:7376005,PLANETARIUM:7376006,DAM:7376007,TUNNEL:7376008,TOWER:7376009,BRIDGE:7376010,MAUSOLEUM_OR_GRAVE:7376011,ARCH:7376012,STATUE:7376013,WATER_HOLE:7376014,COLLEGE_OR_UNIVERSITY:7377,COLLEGE_OR_UNIVERSITY_GENERIC:7377002,JUNIOR_COLLEGE_OR_COMMUNITY_COLLEGE:7377003,BUSINESS_PARK:7378,RAILWAY_STATION:7380,INTERNATIONAL_RAILROAD_STATION:7380002,NATIONAL_RAILROAD_STATION:7380003,URBAN_STATION:7380004,SUBWAY_STATION:7380005,AIRPORT:7383,PUBLIC_AIRPORT:7383002,PRIVATE_AIRPORT:7383003,MILITARY_AIRPORT:7383004,AIRFIELD:7383005,COURIER_DROP_BOX:7388,TRANSPORT_ACCESS:7389,AIRLINE_ACCESS:7389002,STATION_ACCESS:7389003,SECURED_ENTRANCE:7389004,SUBWAY_ENTRANCE:7389999,EMERGENCY_MEDICAL_SERVICE:7391,FIRE_STATION:7392,REST_AREA:7395,ATM:7397,NATURAL_FEATURE:8099,MOUNTAIN_PEAK:8099002,CAVE:8099003,RIDGE:8099004,DUNE:8099005,VALLEY:8099006,PLAIN_OR_FLAT:8099007,PLATEAU:8099008,PAN:8099009,WELL:8099010,OASIS:8099011,ROCKS:8099012,RESERVOIR:8099013,REEF:8099014,RAPIDS:8099015,BAY:8099016,COVE:8099017,HARBOR:8099018,CAPE:8099020,MINERAL_OR_HOT_SPRINGS:8099021,ISLAND:8099022,MARSH:8099023,RIVER_CROSSING:8099024,HILL:8099025,QUARRY:8099026,LOCALE:8099027,PRIMARY_RESOURCE_UTILITY:9150,TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:9151,NON_GOVERNMENTAL_ORGANIZATION:9152,WELFARE_ORGANIZATION:9153,PRISON:9154,CAR_WASH:9155,CAR_WASH_GENERIC:9155002,MANUFACTURING_FACILITY:9156,RESEARCH_FACILITY:9157,MEDIA_FACILITY:9158,PORT_WAREHOUSE_FACILITY:9159,EXCHANGE:9160,STOCK_EXCHANGE:9160002,GOLD_EXCHANGE:9160003,FOREIGN_EXCHANGE:9160004,COMPANY:9352,SERVICE_COMPANY:9352002,ADVERTISING_COMPANY:9352003,COMPUTER_AND_DATA_SERVICES:9352004,SOFTWARE_COMPANY:9352005,DIVERSIFIED_FINANCIALS:9352006,INSURANCE_COMPANY:9352007,DELIVERY_SERVICE:9352008,REAL_ESTATE_COMPANY:9352009,MANUFACTURING_COMPANY:9352011,AGRICULTURAL_TECHNOLOGY:9352012,AUTOMOBILE_COMPANY:9352013,CHEMICAL_COMPANY:9352014,ELECTRONICS_COMPANY:9352015,MECHANICAL_ENGINEERING:9352016,PHARMACEUTICAL_COMPANY:9352018,PUBLISHING_TECHNOLOGIES:9352019,TELECOMMUNICATIONS:9352020,TAX_SERVICES:9352022,LEGAL_SERVICES:9352023,TRANSPORT_COMPANY:9352024,BUS_CHARTER_COMPANY:9352025,TAXI_LIMOUSINE_AND_SHUTTLE_SERVICE:9352026,BUS_LINES:9352027,SCHOOL_BUS_COMPANY:9352028,CLEANING_SERVICES:9352029,OIL_AND_NATURAL_GAS:9352030,MINING_COMPANY:9352031,CONSTRUCTION_COMPANY:9352032,MOVING_AND_STORAGE_COMPANY:9352033,AIRLINE_COMPANY:9352034,FUNERAL_SERVICE_AND_MORTUARIES:9352036,INVESTMENT_ADVISOR:9352037,EQUIPMENT_RENTAL:9352038,BUSINESS_SERVICES:9352039,CABLE_AND_TELEPHONE_COMPANY:9352040,AUTOMOBILE_MANUFACTURING:9352041,IMPORT_OR_EXPORT_AND_DISTRIBUTION:9352042,CATERING_SERVICES:9352043,HOME_APPLIANCE_REPAIR:9352044,ANIMAL_SHELTER:9352045,WEDDING_SERVICES:9352046,BEACH:9357,RESTAURANT_AREA:9359,ICE_RINK:9360,SHOP_OR_STORE:9361,BOOK_SHOP:9361002,C_DS_DVD_VIDEOS:9361003,CHILDREN_S_CLOTHES:9361004,FOOTWEAR_SHOE_REPAIRS:9361005,CLOTHING_SHOP:9361006,MEN_S_CLOTHING:9361007,WOMEN_S_CLOTHING:9361008,CONVENIENCE_STORE:9361009,DRY_CLEANER:9361010,CAMERAS_AND_PHOTOGRAPHY:9361011,COMPUTER_AND_COMPUTER_SUPPLIES:9361012,CONSUMER_ELECTRONICS:9361013,OFFICE_EQUIPMENT:9361014,REAL_ESTATE_AGENT:9361015,FACTORY_OUTLET:9361016,FLORISTS:9361017,BAKERY:9361018,BUTCHER:9361019,FISHMONGER:9361020,FOOD_MARKET:9361021,GREENGROCER:9361022,GROCERY_STORE:9361023,FOOD_AND_DRINKS_SHOP:9361024,WINE_SPIRITS:9361025,GIFTS_CARDS_NOVELTIES_SOUVENIRS:9361026,HAIRDRESSER:9361027,CARPET_FLOOR_COVERINGS:9361028,CURTAINS_TEXTILES:9361029,DO_IT_YOURSELF_CENTERS:9361030,HOUSE_AND_GARDEN_FURNITURE_AND_FITTINGS:9361031,GARDEN_CENTERS_SERVICES:9361032,KITCHENS_BATHROOMS:9361033,LIGHTING_SHOPS:9361034,PAINTING_DECORATING:9361035,JEWELRY_CLOCKS_WATCHES:9361036,NEWSAGENTS_TOBACCONISTS:9361037,OPTICIAN:9361038,SPORTS_EQUIPMENT_AND_CLOTHING:9361039,TOYS_GAMES_SHOP:9361040,TRAVEL_AGENT:9361041,CONSTRUCTION_MATERIAL_AND_EQUIPMENT:9361042,MEDICAL_SUPPLIES_EQUIPMENT:9361043,VIDEO_RENTAL_SHOP:9361044,LAUNDRY:9361045,PHOTO_LAB_OR_DEVELOPMENT:9361046,PHOTOCOPY_SHOP:9361047,ANIMAL_SERVICE:9361048,ANTIQUE_ART_SHOP:9361049,BEAUTY_SUPPLIES:9361050,DRUG_STORE:9361051,ELECTRICAL_APPLIANCES_SHOP:9361052,HOBBY_SHOP:9361053,FURNITURE_HOME_FURNISHINGS:9361054,GLASSWARE_CERAMIC_SHOP:9361055,LOCAL_SPECIALITIES_SHOP:9361056,RECYCLING_SHOP:9361057,BAGS_LEATHERWEAR:9361058,MUSIC_INSTRUMENTS_STORE:9361059,DELICATESSEN:9361060,SPECIALTY_FOODS:9361061,SHOPPING_SERVICE:9361062,RETAIL_OUTLET:9361063,PET_SUPPLIES:9361064,WHOLESALE_CLUB:9361066,BEAUTY_SALON:9361067,NAIL_SALON:9361068,HARDWARE_STORE:9361069,PAWN_SHOP:9361070,LOTTERY_SHOP:9361071,BETTING_STATION:9361072,AGRICULTURAL_SUPPLIES:9361073,MOBILE_PHONE_SHOP:9361075,DRIVE_THROUGH_BOTTLE_SHOP:9361076,TAILOR_SHOP:9361077,SECURITY_PRODUCTS:9361078,SPECIALTY_CLOTHING_SHOP:9361079,GLASS_WINDOWS_STORE:9361080,VARIETY_STORE:9361081,CHRISTMAS_OR_HOLIDAY_SHOP:9361082,BOATING_EQUIPMENT_AND_ACCESSORIES:9361083,PARK_AND_RECREATION_AREA:9362,BATTLEFIELD:9362002,CEMETERY:9362003,HISTORIC_SITE:9362004,HISTORICAL_PARK:9362005,MEMORIAL:9362007,PARK:9362008,PARKWAY:9362009,RECREATION_AREA:9362011,WILDERNESS_AREA:9362014,FOREST_AREA:9362015,FISHING_AND_HUNTING_AREA:9362016,FAIRGROUND:9362017,SKI_RESORT:9362026,BOAT_LAUNCHING_RAMP:9362032,PICNIC_AREA:9362033,PROTECTED_LAND:9362037,COURTHOUSE:9363,CANNABIS_SHOP:9364,MEDICINAL_MARIJUANA_DISPENSARY:9364002,RECREATIONAL_MARIJUANA_DISPENSARY:9364003,MEDICINAL_AND_RECREATIONAL_DISPENSARY:9364004,TENNIS_COURT:9369,WATER_SPORT:9371,DOCTOR:9373,GENERAL_PRACTITIONER:9373002,SPECIALIST:9373003,DENTIST:9374,VETERINARY:9375,CAFE_PUB:9376,CAFE:9376002,PUB:9376003,INTERNET_CAFE:9376004,TEA_HOUSE:9376005,COFFEE_SHOP:9376006,MICROBREWERY:9376007,EXHIBITION_CONVENTION_CENTER:9377,LEISURE_CENTER:9378,BOWLING_CENTER:9378002,DANCE_STUDIO_AND_SCHOOL:9378003,FLYING_CLUB:9378004,SAUNA_SOLARIUM_MASSAGE:9378005,NIGHTLIFE:9379,DISCO_CLUB:9379002,BAR:9379004,COCKTAIL_BAR:9379006,JAZZ_CLUB:9379008,COMEDY_CLUB:9379009,KARAOKE_CLUB:9379010,COMMERCIAL_BUILDING:9382,INDUSTRIAL_BUILDING:9383,ABORIGINAL_LAND:9389,HEALTHCARE_SERVICE:9663,PERSONAL_SERVICE:9663002,PERSONAL_CARE_FACILITY:9663003,BLOOD_BANK:9663004,AMBULANCE_UNIT:9663005,ENTERTAINMENT:9900,AMUSEMENT_PARK:9902,AMUSEMENT_PARK_GENERIC:9902003,AMUSEMENT_PLACE:9902004,VEHICLE_DEALER:9910,CAR_DEALER:9910002,MOTORCYCLE_DEALER:9910003,BOAT_DEALER:9910004,RECREATIONAL_VEHICLE_DEALER:9910005,TRUCK_DEALER:9910006,VAN_DEALER:9910007,BUS_DEALER:9910008,ATV_DEALER:9910009,GOLF_COURSE:9911,PUBLIC_LIBRARY:9913,ZOOS_ARBORETA_BOTANICAL_GARDEN:9927,ARBORETA_AND_BOTANICAL_GARDENS:9927002,ZOO:9927003,AQUATIC_ZOO:9927004,WILDLIFE_PARK:9927005,RENTAL_CAR_PARKING:9930,PUBLIC_AMENITY:9932,PASSENGER_TRANSPORT_TICKET_OFFICE:9932002,PEDESTRIAN_SUBWAY:9932003,PUBLIC_CALL_BOX:9932004,PUBLIC_BATHROOM:9932005,RESCUE_SERVICE:9932006,MOUNTAIN_PASS:9935,CLUB_AND_ASSOCIATION:9937,BEACH_CLUB:9937002,HOCKEY_CLUB:9937003,PUBLIC_TRANSPORT_STOP:9942,BUS_STOP:9942002,TAXI_STAND:9942003,STREETCAR_STOP:9942004,EMERGENCY_ROOM:9956,RESIDENTIAL_ENTRANCE:9999},poiIDsToCategories=/* @__PURE__ */(()=>Object.fromEntries(Object.entries(poiCategoriesToID).map(([e,t])=>[t,e])))(),getRoutePlanningLocationType=e=>Array.isArray(e)?Array.isArray(e[0])?"path":"waypoint":"Feature"===e.type&&"LineString"===e.geometry.type?"path":"waypoint",sdkErrorCodeForStatus=e=>401===e?"INVALID_CREDENTIALS":403===e?"INSUFFICIENT_PERMISSIONS":404===e?"NOT_FOUND":429===e?"RATE_LIMITED":e>=500?"LIVE_SERVICE_NOT_AVAILABLE":e>=400?"INVALID_REQUEST":"INTERNAL",retryableCodes=/* @__PURE__ */new Set(["RATE_LIMITED","LIVE_SERVICE_NOT_AVAILABLE","NETWORK_NOT_AVAILABLE"]),canRetrySDKErrorCode=e=>retryableCodes.has(e),getSectionsWithin=(e,{within:t,types:A=sectionTypes}={})=>{const E=metersAlongLine(e.geometry.coordinates),R={};for(const n of A){const A=e.properties.sections[n]??[],T=[],I=[];let o=0;for(const e of A){const{startPointIndex:A=0,endPointIndex:R=0}=e,n=metersWithin(E,{startPointIndex:A,endPointIndex:R},t);n>0&&(T.push(e),I.push(n/(E[R]-E[A])),o+=n)}T.length&&(R[n]={sections:T,shares:I,lengthInMeters:o})}return R},compareRoutes=(e,t,{types:A=inputSectionTypesWithGuidance}={})=>{const[E,R]=getDistinctSections([e,t]);return{distinct:E,referenceDistinct:R,adds:getSectionsWithin(e,{within:E,types:A}),avoids:getSectionsWithin(t,{within:R,types:A})}},indexedMagnitudes=["unknown","minor","moderate","major","indefinite"],iconCategoryMap={1:"accident",2:"fog",3:"danger",4:"rain",5:"frost",6:"jam",7:"lane-closed",8:"road-closed",9:"roadworks",10:"wind",11:"flooding",12:"animals-on-road",13:"narrow-lanes",14:"broken-down-vehicle"},categoryToIconMap=/* @__PURE__ */(()=>Object.fromEntries(Object.entries(iconCategoryMap).map(([e,t])=>[t,Number(e)])))(),iconToTrafficIncidentCategory=e=>iconCategoryMap[e]??"other",trafficIncidentToIconCategory=e=>categoryToIconMap[e]??0,minuteUnits=e=>e?.minutes??"min";function formatDuration(e,t){if(isNil(e))return;const A=Math.abs(e)/3600;let E=Math.floor(A),R=Math.round(A%1*60);60===R&&(R=0,E++);const n={...TomTomConfig.instance.get().displayUnits?.time,...t};return E?`${E} ${T=n,T?.hours??"hr"} ${R.toString().padStart(2,"0")} ${minuteUnits(n)}`:R?`${R.toString()} ${minuteUnits(n)}`:`${e?"< 1":"0"} ${minuteUnits(n)}`;var T}var MILE_IN_METERS=1609.344,meterUnits=e=>e?.meters??"m",kmUnits=e=>e?.kilometers??"km",roundHalfAwayFromZero=e=>Math.sign(e)*Math.round(Math.abs(e)),formatFeet=(e,t)=>{const A=t.feet??"ft",E=e/.3048,R=Math.abs(E);return R<30?`${roundHalfAwayFromZero(E)} ${A}`:R<500?`${10*roundHalfAwayFromZero(E/10)} ${A}`:`${100*roundHalfAwayFromZero(E/100)} ${A}`},formatYards=(e,t)=>{const A=t.yards??"yd",E=e/.9144;return Math.abs(E)<10?`${roundHalfAwayFromZero(E)} ${A}`:`${10*roundHalfAwayFromZero(E/10)} ${A}`},QUARTER_MILE_GLYPHS=["","¼","½","¾"],formatImperial=(e,t,A)=>{const E=e/1609.344;return Math.abs(E)<.125?A(e,t):((e,t)=>{const A=Math.abs(e);if(A>=10)return`${roundHalfAwayFromZero(e)} ${t}`;const E=A<3?1:2,R=Number.parseInt(A.toString()),n=Math.round(4*(A-R)/E)*E,T=e<0?"-":"";return n%4?`${T}${R||""}${QUARTER_MILE_GLYPHS[n]} ${t}`:`${T}${R+n/4} ${t}`})(E,t.miles??"mi")},formatDistance=(e,t)=>{if(isNil(e))return"";const A={...TomTomConfig.instance.get().displayUnits?.distance,...t};switch(A?.type??"metric"){case"metric":return((e,t)=>{const A=Math.abs(e);if(A<10)return`${roundHalfAwayFromZero(10*e)/10} ${meterUnits(t)}`;if(A<500)return`${10*roundHalfAwayFromZero(e/10)} ${meterUnits(t)}`;if(A<1e3){const A=100*roundHalfAwayFromZero(e/100);return 1e3===A||-1e3===A?`${e<0?"-":""}1 ${kmUnits(t)}`:`${A} ${meterUnits(t)}`}return A<1e4?`${100*roundHalfAwayFromZero(e/100)/1e3} ${kmUnits(t)}`:`${roundHalfAwayFromZero(e/1e3)} ${kmUnits(t)}`})(e,A);case"imperial_us":return formatImperial(e,A,formatFeet);case"imperial_uk":return formatImperial(e,A,formatYards)}};export{DEFAULT_COMMON_BASE_URL,EARTH_RADIUS_IN_METERS,MAX_MERCATOR_LATITUDE,MILE_IN_METERS,RADIANS_PER_DEGREE,TOMTOM_USER_AGENT_SDK_NAME,TomTomConfig,aggregateIntoCells,areaAnalyticsMetricKeys,avoidableTypes,bboxCenter,bboxFromBBoxes,bboxFromCoordsArray,bboxFromGeoJSON,bboxLongitudeSpan,bboxOnlyIfWithArea,budgetTypes,budgetUnits,calculateProgressAtRoutePoint,canRetrySDKErrorCode,chargingPointCapabilities,chargingPointRestrictions,clamp,compareRoutes,connectorTypes,currentTypes,defaultConfig,defaultSectionTypes,definedFields,findBestWaypointInsertionIndex,findBestWaypointInsertionIndices,formatDistance,formatDuration,fullTrafficIncidentCategories,generateId,generateTomTomHeaders,geographyTypes,geometrySectionTypes,geopoliticalViews,getCoordinateAtRouteProgress,getCurveSections,getCurvyStretchSections,getDistinctSections,getImportantRoads,getInstructionLanes,getPosition,getPositionStrict,getProgressAtNearestRoutePoint,getRoutePlanningLocationType,getRouteProgressBetween,getRouteProgressForSection,getSectionBBox,getSectionOverlap,getSectionsWithin,iconToTrafficIncidentCategory,indexedMagnitudes,inputSectionTypes,inputSectionTypesWithGuidance,insecureBaseURLMessage,isBBoxWithArea,isHairpin,isProxyCredentialsMode,isSecureBaseURL,languages,latticeCellOf,latticeCellPolygon,mergeFromGlobal,metersAlongLine,metersWithin,pickKeys,placeTypes,placesLanguage,poiCategories,poiCategoriesLanguage,poiCategoriesToID,poiIDsToCategories,polygonFromBBox,positionBetween,sdkErrorCodeForStatus,sdkErrorCodes,sectionTypes,segmentAtMeters,servesGeopoliticalView,serviceLanguage,toPointGeometry,trafficIncidentLanguage,trafficIncidentRequestCategories,trafficIncidentTimeValidities,trafficIncidentToIconCategory,withCurveSections,withInsertedWaypoint,withInsertedWaypoints};
|