@mapvx/web-js 3.5.0-dev.1 → 3.5.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/controllers/routeController.js +221 -47
  2. package/dist/cjs/controllers/routeController.js.map +1 -1
  3. package/dist/cjs/domain/models/animation.js.map +1 -1
  4. package/dist/cjs/domain/models/marker.js +31 -0
  5. package/dist/cjs/domain/models/marker.js.map +1 -1
  6. package/dist/cjs/domain/models/routeInstance.js.map +1 -1
  7. package/dist/cjs/logger/sentry.js +1 -1
  8. package/dist/cjs/map/map.js +18 -10
  9. package/dist/cjs/map/map.js.map +1 -1
  10. package/dist/cjs/utils/loadGlb.js +55 -20
  11. package/dist/cjs/utils/loadGlb.js.map +1 -1
  12. package/dist/cjs/utils/three.js +70 -34
  13. package/dist/cjs/utils/three.js.map +1 -1
  14. package/dist/es/controllers/routeController.d.ts +14 -0
  15. package/dist/es/controllers/routeController.d.ts.map +1 -1
  16. package/dist/es/controllers/routeController.js +221 -47
  17. package/dist/es/controllers/routeController.js.map +1 -1
  18. package/dist/es/domain/models/animation.d.ts +19 -0
  19. package/dist/es/domain/models/animation.d.ts.map +1 -1
  20. package/dist/es/domain/models/animation.js.map +1 -1
  21. package/dist/es/domain/models/marker.d.ts +27 -0
  22. package/dist/es/domain/models/marker.d.ts.map +1 -1
  23. package/dist/es/domain/models/marker.js +31 -0
  24. package/dist/es/domain/models/marker.js.map +1 -1
  25. package/dist/es/domain/models/routeInstance.d.ts +11 -0
  26. package/dist/es/domain/models/routeInstance.d.ts.map +1 -1
  27. package/dist/es/domain/models/routeInstance.js.map +1 -1
  28. package/dist/es/logger/sentry.js +1 -1
  29. package/dist/es/map/map.d.ts +9 -0
  30. package/dist/es/map/map.d.ts.map +1 -1
  31. package/dist/es/map/map.js +18 -10
  32. package/dist/es/map/map.js.map +1 -1
  33. package/dist/es/utils/loadGlb.d.ts +41 -0
  34. package/dist/es/utils/loadGlb.d.ts.map +1 -1
  35. package/dist/es/utils/loadGlb.js +55 -21
  36. package/dist/es/utils/loadGlb.js.map +1 -1
  37. package/dist/es/utils/three.d.ts +37 -8
  38. package/dist/es/utils/three.d.ts.map +1 -1
  39. package/dist/es/utils/three.js +68 -32
  40. package/dist/es/utils/three.js.map +1 -1
  41. package/dist/umd/index.js +548 -205
  42. package/dist/umd/index.js.map +1 -1
  43. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -11249,7 +11249,7 @@ const extractSafariExtensionDetails = (func, filename) => {
11249
11249
  // exists only for the type-checker, so in the ES/CJS builds the identifier is
11250
11250
  // genuinely absent and a direct comparison throws ReferenceError at module load.
11251
11251
  // `typeof` is the only safe way to probe a possibly-undeclared global.
11252
- var sentry_SDK_VERSION = false ? 0 : "3.5.0-dev.1";
11252
+ var sentry_SDK_VERSION = false ? 0 : "3.5.0-dev.3";
11253
11253
  var DSN = false ? 0 : "https://872f598f020e3cd73a0933b562d24c81@sentry.mapvx.app/5";
11254
11254
 
11255
11255
  /**
@@ -11888,14 +11888,17 @@ function getBoundingBox(points) {
11888
11888
  function marker_typeof(o) { "@babel/helpers - typeof"; return marker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, marker_typeof(o); }
11889
11889
  function marker_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11890
11890
  function marker_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? marker_ownKeys(Object(t), !0).forEach(function (r) { marker_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : marker_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11891
- function marker_defineProperty(e, r, t) { return (r = marker_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11892
11891
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
11893
11892
  function _possibleConstructorReturn(t, e) { if (e && ("object" == marker_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
11894
11893
  function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
11895
11894
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11895
+ function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
11896
+ function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
11897
+ function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
11896
11898
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
11897
11899
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
11898
11900
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
11901
+ function marker_defineProperty(e, r, t) { return (r = marker_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
11899
11902
  function marker_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11900
11903
  function marker_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, marker_toPropertyKey(o.key), o); } }
11901
11904
  function marker_createClass(e, r, t) { return r && marker_defineProperties(e.prototype, r), t && marker_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -12248,21 +12251,6 @@ var MarkerUtils = /*#__PURE__*/function () {
12248
12251
  * ```
12249
12252
  */
12250
12253
  var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12251
- /**
12252
- * Unique identifier for the marker attribute.
12253
- * Used for marker management and identification.
12254
- */
12255
-
12256
- /**
12257
- * Geographic coordinates of the marker attribute.
12258
- * @see {@link LatLng} for coordinate structure
12259
- */
12260
-
12261
- /**
12262
- * Identifier of the floor where the marker attribute is located.
12263
- * Used for indoor navigation and floor-specific marker management.
12264
- */
12265
-
12266
12254
  /**
12267
12255
  * Resolved icon dimensions (defaults to {@link DEFAULT_ICON_SIZE_PX} square
12268
12256
  * when unspecified), matching whatever `MarkerUtils.createMarkerElement`
@@ -12338,6 +12326,33 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12338
12326
  anchor: (_markerConfig$anchor = markerConfig.anchor) !== null && _markerConfig$anchor !== void 0 ? _markerConfig$anchor : "center",
12339
12327
  offset: [0, 0]
12340
12328
  }]);
12329
+ /**
12330
+ * Unique identifier for the marker attribute.
12331
+ * Used for marker management and identification.
12332
+ */
12333
+ /**
12334
+ * Geographic coordinates of the marker attribute.
12335
+ * @see {@link LatLng} for coordinate structure
12336
+ */
12337
+ /**
12338
+ * Identifier of the floor where the marker attribute is located.
12339
+ * Used for indoor navigation and floor-specific marker management.
12340
+ */
12341
+ /**
12342
+ * True while this marker is hidden on purpose, via {@link hide} (or {@link changeFloor}
12343
+ * resolving to a floor this marker is not on).
12344
+ *
12345
+ * DOM connectivity cannot answer this: {@link hide} works by calling maplibre's
12346
+ * `Marker.remove()`, which detaches the element, so a hidden marker and one that never got
12347
+ * attached look identical from `getElement().isConnected`. Anything that re-attaches a marker
12348
+ * it does not own — the route animation re-attaches its arrow when a step transition drops it —
12349
+ * has to consult this flag, or it silently un-hides the marker on its next frame.
12350
+ *
12351
+ * Any attach clears it — see the {@link addTo} override — so "attached" and "not hidden"
12352
+ * never disagree, whichever entry point put the marker back on the map.
12353
+ * @internal
12354
+ */
12355
+ marker_defineProperty(_this, "hiddenOnPurpose", false);
12341
12356
  _this.setLngLat([markerConfig.coordinate.lng, markerConfig.coordinate.lat]);
12342
12357
  _this.setRotationAlignment((_markerConfig$rotatio = markerConfig.rotationAlignment) !== null && _markerConfig$rotatio !== void 0 ? _markerConfig$rotatio : "viewport");
12343
12358
  _this.setPitchAlignment("viewport");
@@ -12499,6 +12514,7 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12499
12514
  }, {
12500
12515
  key: "hide",
12501
12516
  value: function hide() {
12517
+ this.hiddenOnPurpose = true;
12502
12518
  this.remove();
12503
12519
  }
12504
12520
 
@@ -12519,6 +12535,24 @@ var MarkerAttribute = /*#__PURE__*/function (_Marker) {
12519
12535
  this.addTo(map);
12520
12536
  }
12521
12537
 
12538
+ /**
12539
+ * Attaches the marker, clearing {@link hiddenOnPurpose}.
12540
+ *
12541
+ * Overridden so every attach path agrees on visibility: {@link show}, {@link addToMap} and a
12542
+ * direct `addTo` all funnel through here, so a marker cannot end up on the map while still
12543
+ * flagged as deliberately hidden — which would make the route animation refuse to restore an
12544
+ * arrow that is in fact visible.
12545
+ *
12546
+ * @param map - The map instance to attach the marker to.
12547
+ * @returns This marker, for chaining, as maplibre's `Marker.addTo` does.
12548
+ */
12549
+ }, {
12550
+ key: "addTo",
12551
+ value: function addTo(map) {
12552
+ this.hiddenOnPurpose = false;
12553
+ return _superPropGet(MarkerAttribute, "addTo", this, 3)([map]);
12554
+ }
12555
+
12522
12556
  /**
12523
12557
  * Hides marker if currentFloor is different from the marker floor.
12524
12558
  * Used for floor-based marker visibility management.
@@ -13280,6 +13314,32 @@ var DEFAULT_AUTO_FIT_PADDING = {
13280
13314
  left: 150
13281
13315
  };
13282
13316
 
13317
+ /**
13318
+ * Longest gap between two frames, in milliseconds, that still counts as
13319
+ * animation time.
13320
+ *
13321
+ * The frame loop charges the marker for however much wall clock has elapsed,
13322
+ * which is what makes a step take `stepTime` at any frame rate. A gap larger
13323
+ * than any frame rate can explain is not slow rendering, though — it is time
13324
+ * the animation did not run at all. `requestAnimationFrame` does not fire in a
13325
+ * backgrounded tab, so the first frame after the page comes back carries the
13326
+ * entire absence, and charging it advanced the draw by the whole gap: one
13327
+ * frame 10 s late at 50 m/s consumed exactly a hundred vertices in a single
13328
+ * `setData`, with the camera following the line as it jumped.
13329
+ *
13330
+ * Such a gap is therefore not charged (see `animateStep`). This is deliberately
13331
+ * NOT a clamp on how far one frame may advance: clamping would cap the catch-up
13332
+ * and hand back the frame-rate independence this loop exists to provide, and it
13333
+ * would still be wrong — the marker would sprint to catch up through time
13334
+ * nobody watched. Skipping the gap instead is what a pause does, which is what
13335
+ * an absence is.
13336
+ *
13337
+ * 500 ms is two frames per second. Real rendering does not sustain anything
13338
+ * near that low, so the threshold only ever separates absence from rendering,
13339
+ * and never shortens the catch-up of a genuinely slow frame.
13340
+ */
13341
+ var MAX_FRAME_GAP_MS = 500;
13342
+
13283
13343
  /**
13284
13344
  * Represents the controller for routes on the map.
13285
13345
  * Supports multiple simultaneous routes with independent customizations,
@@ -13310,12 +13370,18 @@ var RouteController = /*#__PURE__*/function () {
13310
13370
 
13311
13371
  /**
13312
13372
  * Add MapLibre sources and layers for a single route instance.
13373
+ *
13374
+ * All three sources set `lineMetrics`: maplibre computes `line-progress` only
13375
+ * when a source asks it to, and `preparePaintForLayer` emits a
13376
+ * `line-progress` gradient for a GradientStyle. Without it, a consumer
13377
+ * setting a gradient route style silently got no gradient at all.
13313
13378
  */
13314
13379
  }, {
13315
13380
  key: "addSourcesAndLayersForRoute",
13316
13381
  value: function addSourcesAndLayersForRoute(instance) {
13317
13382
  this.map.addSource(instance.aheadId, {
13318
13383
  type: "geojson",
13384
+ lineMetrics: true,
13319
13385
  data: instance.aheadSourceData
13320
13386
  });
13321
13387
  this.map.addLayer({
@@ -13329,6 +13395,7 @@ var RouteController = /*#__PURE__*/function () {
13329
13395
  });
13330
13396
  this.map.addSource(instance.behindId, {
13331
13397
  type: "geojson",
13398
+ lineMetrics: true,
13332
13399
  data: instance.behindSourceData
13333
13400
  });
13334
13401
  this.map.addLayer({
@@ -13342,6 +13409,7 @@ var RouteController = /*#__PURE__*/function () {
13342
13409
  });
13343
13410
  this.map.addSource(instance.currentId, {
13344
13411
  type: "geojson",
13412
+ lineMetrics: true,
13345
13413
  data: instance.currentSourceData
13346
13414
  });
13347
13415
  this.map.addLayer({
@@ -13701,9 +13769,12 @@ var RouteController = /*#__PURE__*/function () {
13701
13769
  value: function updateLayerFilter(layerId, floorId) {
13702
13770
  var newFloorId = floorId !== null && floorId !== void 0 ? floorId : this.mapvxMap.getCurrentFloor();
13703
13771
  if (newFloorId === undefined) return;
13704
- if (this.map.getStyle().layers.some(function (layer) {
13705
- return layer.id === layerId;
13706
- })) {
13772
+ // `getLayer` is a map lookup; `getStyle()` serialises every source and
13773
+ // layer in the style just to answer the same question. This runs three
13774
+ // times per route per floor change, and each preceding `setFilter`
13775
+ // invalidates maplibre's serialised-layer cache, so the later calls used to
13776
+ // re-serialise from scratch.
13777
+ if (this.map.getLayer(layerId) != null) {
13707
13778
  this.map.setFilter(layerId, ["==", ["get", "floor_key"], newFloorId]);
13708
13779
  }
13709
13780
  }
@@ -13822,13 +13893,20 @@ var RouteController = /*#__PURE__*/function () {
13822
13893
  }, {
13823
13894
  key: "updateRouteMarkerVisibility",
13824
13895
  value: function updateRouteMarkerVisibility(floorId) {
13896
+ // An outdoor step gives its marker an empty floorId, which never equals a
13897
+ // real floor key — so on a venue with buildings the route arrow used to be
13898
+ // hidden the moment the map filtered by one, and only reappeared because
13899
+ // the animation re-attached the marker on its next frame. Outdoors is an
13900
+ // allowance markers and circles already make; the route arrow makes it too.
13901
+ var isOutdoor = this.mapvxMap.isOutdoorFloor(floorId);
13825
13902
  var _iterator7 = routeController_createForOfIteratorHelper(this.routes.values()),
13826
13903
  _step7;
13827
13904
  try {
13828
13905
  for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
13829
- var _instance$routeMarker, _instance$routeMarker2, _instance$routeMarker3;
13906
+ var _instance$routeMarker, _instance$routeMarker2, _instance$routeMarker3, _instance$routeMarker4;
13830
13907
  var instance = _step7.value;
13831
- ((_instance$routeMarker = instance.routeMarker) === null || _instance$routeMarker === void 0 ? void 0 : _instance$routeMarker.floorId) === floorId ? (_instance$routeMarker2 = instance.routeMarker) === null || _instance$routeMarker2 === void 0 ? void 0 : _instance$routeMarker2.show(this.map) : (_instance$routeMarker3 = instance.routeMarker) === null || _instance$routeMarker3 === void 0 ? void 0 : _instance$routeMarker3.hide();
13908
+ var markerFloorId = (_instance$routeMarker = (_instance$routeMarker2 = instance.routeMarker) === null || _instance$routeMarker2 === void 0 ? void 0 : _instance$routeMarker2.floorId) !== null && _instance$routeMarker !== void 0 ? _instance$routeMarker : "";
13909
+ markerFloorId === floorId || isOutdoor && markerFloorId === "" ? (_instance$routeMarker3 = instance.routeMarker) === null || _instance$routeMarker3 === void 0 ? void 0 : _instance$routeMarker3.show(this.map) : (_instance$routeMarker4 = instance.routeMarker) === null || _instance$routeMarker4 === void 0 ? void 0 : _instance$routeMarker4.hide();
13832
13910
  }
13833
13911
  } catch (err) {
13834
13912
  _iterator7.e(err);
@@ -13840,10 +13918,10 @@ var RouteController = /*#__PURE__*/function () {
13840
13918
  key: "updatePlaceFloorForRouting",
13841
13919
  value: function updatePlaceFloorForRouting(instance, placeId, floorKey) {
13842
13920
  if (placeId && floorKey) {
13843
- var _instance$routeMarker4;
13921
+ var _instance$routeMarker5;
13844
13922
  this.mapvxMap.updatePlaceAndFloorForRouting(placeId, floorKey);
13845
13923
  this.updateRouteLayers(floorKey);
13846
- (_instance$routeMarker4 = instance.routeMarker) === null || _instance$routeMarker4 === void 0 || _instance$routeMarker4.setFloor(floorKey);
13924
+ (_instance$routeMarker5 = instance.routeMarker) === null || _instance$routeMarker5 === void 0 || _instance$routeMarker5.setFloor(floorKey);
13847
13925
  this.updateRouteMarkerVisibility(floorKey);
13848
13926
  }
13849
13927
  }
@@ -13858,8 +13936,8 @@ var RouteController = /*#__PURE__*/function () {
13858
13936
  key: "startAnimating",
13859
13937
  value: function startAnimating(route, drawConfig, animationConfig) {
13860
13938
  var _animationConfig$auto,
13861
- _animationConfig$call,
13862
- _this2 = this;
13939
+ _this2 = this,
13940
+ _animationConfig$call;
13863
13941
  var instance = createRouteInstance(route);
13864
13942
  this.routes.set(instance.id, instance);
13865
13943
  this.lastAddedRouteId = instance.id;
@@ -13897,10 +13975,13 @@ var RouteController = /*#__PURE__*/function () {
13897
13975
  this.mapvxMap.fitRouteByPlace(route, firstStep.startInsidePlace, fitOptions);
13898
13976
  }
13899
13977
  }
13900
- (_animationConfig$call = animationConfig.callBack) === null || _animationConfig$call === void 0 || _animationConfig$call.call(animationConfig, {
13901
- isFinished: false,
13902
- step: firstStep
13903
- });
13978
+
13979
+ // The conditions go in before the consumer hears about the start, for the same reason
13980
+ // `restartAnimation` orders it that way. `animationStatus` is already "STARTED" here, so a
13981
+ // consumer that pauses from inside this callback — showing a modal per step, say — passed
13982
+ // `internalPause`'s status guard and then died on its `instance.conditions == null` check:
13983
+ // the pause was dropped in silence, the loop kept running, and because the status stayed
13984
+ // "STARTED" the matching `resumeAnimation()` bailed out too.
13904
13985
  instance.conditions = {
13905
13986
  index: 0,
13906
13987
  coordinatesIndex: 0,
@@ -13917,13 +13998,17 @@ var RouteController = /*#__PURE__*/function () {
13917
13998
  return _this2.prepareForNextStep(time, instance);
13918
13999
  }
13919
14000
  };
14001
+ (_animationConfig$call = animationConfig.callBack) === null || _animationConfig$call === void 0 || _animationConfig$call.call(animationConfig, {
14002
+ isFinished: false,
14003
+ step: firstStep
14004
+ });
13920
14005
  this.syncRouteCollision();
13921
14006
  }
13922
14007
  }, {
13923
14008
  key: "clearRouteInstance",
13924
14009
  value: function clearRouteInstance(instance) {
13925
- var _instance$routeMarker5;
13926
- (_instance$routeMarker5 = instance.routeMarker) === null || _instance$routeMarker5 === void 0 || _instance$routeMarker5.remove();
14010
+ var _instance$routeMarker6;
14011
+ (_instance$routeMarker6 = instance.routeMarker) === null || _instance$routeMarker6 === void 0 || _instance$routeMarker6.remove();
13927
14012
  instance.routeMarker = undefined;
13928
14013
  this.setSourceData(instance, instance.aheadId, []);
13929
14014
  this.setSourceData(instance, instance.behindId, []);
@@ -14046,9 +14131,9 @@ var RouteController = /*#__PURE__*/function () {
14046
14131
  value: function restartAnimation(routeId) {
14047
14132
  var _this$setMarkerRotati,
14048
14133
  _instance$animationCo,
14134
+ _this4 = this,
14049
14135
  _instance$animationCo3,
14050
- _instance$animationCo4,
14051
- _this4 = this;
14136
+ _instance$animationCo4;
14052
14137
  var instance = this.resolveInstance(routeId);
14053
14138
  if (!instance) {
14054
14139
  throw new Error("Does not exist animated route to restart");
@@ -14086,10 +14171,15 @@ var RouteController = /*#__PURE__*/function () {
14086
14171
  this.mapvxMap.fitRouteByPlace(instance.route, firstStep.startInsidePlace, fitOptions);
14087
14172
  }
14088
14173
  }
14089
- (_instance$animationCo3 = (_instance$animationCo4 = instance.animationConfig).callBack) === null || _instance$animationCo3 === void 0 || _instance$animationCo3.call(_instance$animationCo4, {
14090
- isFinished: false,
14091
- step: firstStep
14092
- });
14174
+
14175
+ // The new conditions go in before the consumer hears about the restart.
14176
+ // Invoking the callback first left `instance.conditions` pointing at the
14177
+ // previous run, so a consumer that pauses from inside it — showing a modal
14178
+ // per step, say — cancelled a frame id that had already fired, marked the
14179
+ // instance PAUSED, and then had a live loop installed underneath it. The
14180
+ // next resume passed the "not paused" guard and started a second loop on
14181
+ // the same instance; each schedules its own successor, so the doubling was
14182
+ // permanent.
14093
14183
  instance.conditions = {
14094
14184
  index: 0,
14095
14185
  coordinatesIndex: 0,
@@ -14106,6 +14196,10 @@ var RouteController = /*#__PURE__*/function () {
14106
14196
  return _this4.prepareForNextStep(time, instance);
14107
14197
  }
14108
14198
  };
14199
+ (_instance$animationCo3 = (_instance$animationCo4 = instance.animationConfig).callBack) === null || _instance$animationCo3 === void 0 || _instance$animationCo3.call(_instance$animationCo4, {
14200
+ isFinished: false,
14201
+ step: firstStep
14202
+ });
14109
14203
  }
14110
14204
 
14111
14205
  /**
@@ -14134,8 +14228,8 @@ var RouteController = /*#__PURE__*/function () {
14134
14228
  key: "addStepAnimation",
14135
14229
  value: function addStepAnimation(route, drawConfig, animationConfig) {
14136
14230
  var _animationConfig$auto3,
14137
- _animationConfig$call2,
14138
- _this5 = this;
14231
+ _this5 = this,
14232
+ _animationConfig$call4;
14139
14233
  var instance = createRouteInstance(route);
14140
14234
  this.routes.set(instance.id, instance);
14141
14235
  this.lastAddedRouteId = instance.id;
@@ -14171,10 +14265,12 @@ var RouteController = /*#__PURE__*/function () {
14171
14265
  this.mapvxMap.fitRouteByPlace(route, firstStep.startInsidePlace, fitOptions);
14172
14266
  }
14173
14267
  }
14174
- (_animationConfig$call2 = animationConfig.callBack) === null || _animationConfig$call2 === void 0 || _animationConfig$call2.call(animationConfig, {
14175
- isFinished: false,
14176
- step: firstStep
14177
- });
14268
+
14269
+ // The conditions go in before the consumer hears about the route, as they
14270
+ // do in `startAnimating`. Invoking the callback first left `conditions`
14271
+ // undefined, so a consumer advancing the route from it — the step-by-step
14272
+ // integration draws its first step this way — hit `nextStepAnimation`'s
14273
+ // null check and got an exception instead of a step.
14178
14274
  instance.conditions = {
14179
14275
  index: 0,
14180
14276
  coordinatesIndex: 0,
@@ -14199,8 +14295,16 @@ var RouteController = /*#__PURE__*/function () {
14199
14295
  _this5.setSourceData(instance, instance.aheadId, aheadSteps);
14200
14296
  _this5.setCurrentSourceData(instance, step);
14201
14297
  instance.conditions.index = index;
14298
+
14299
+ // The status settles before either callback, as everywhere else: no frame
14300
+ // is live once `animateStep` hands over to `onFinish`, so "WAITING" is
14301
+ // already true here. Writing it afterwards overwrote the "ANIMATING" of a
14302
+ // consumer that chained the next step from this callback, and the
14303
+ // following `nextStepAnimation` then skipped its cancel and installed a
14304
+ // second self-sustaining loop on the same instance.
14305
+ instance.stepAnimationStatus = "WAITING";
14202
14306
  if (index < route.steps.length) {
14203
- var _animationConfig$auto5, _animationConfig$call3;
14307
+ var _animationConfig$auto5, _animationConfig$call2;
14204
14308
  var nextStep = route.steps[index];
14205
14309
 
14206
14310
  // Auto-fit by place if enabled and place changed
@@ -14215,20 +14319,23 @@ var RouteController = /*#__PURE__*/function () {
14215
14319
  _this5.mapvxMap.fitRouteByPlace(instance.route, stepPlaceId, _fitOptions);
14216
14320
  }
14217
14321
  }
14218
- (_animationConfig$call3 = animationConfig.callBack) === null || _animationConfig$call3 === void 0 || _animationConfig$call3.call(animationConfig, {
14322
+ (_animationConfig$call2 = animationConfig.callBack) === null || _animationConfig$call2 === void 0 || _animationConfig$call2.call(animationConfig, {
14219
14323
  isFinished: false,
14220
14324
  step: nextStep
14221
14325
  });
14222
14326
  } else {
14223
- var _animationConfig$call4;
14224
- (_animationConfig$call4 = animationConfig.callBack) === null || _animationConfig$call4 === void 0 || _animationConfig$call4.call(animationConfig, {
14327
+ var _animationConfig$call3;
14328
+ (_animationConfig$call3 = animationConfig.callBack) === null || _animationConfig$call3 === void 0 || _animationConfig$call3.call(animationConfig, {
14225
14329
  isFinished: true,
14226
14330
  step: null
14227
14331
  });
14228
14332
  }
14229
- instance.stepAnimationStatus = "WAITING";
14230
14333
  }
14231
14334
  };
14335
+ (_animationConfig$call4 = animationConfig.callBack) === null || _animationConfig$call4 === void 0 || _animationConfig$call4.call(animationConfig, {
14336
+ isFinished: false,
14337
+ step: firstStep
14338
+ });
14232
14339
  this.syncRouteCollision();
14233
14340
  }
14234
14341
 
@@ -14347,7 +14454,7 @@ var RouteController = /*#__PURE__*/function () {
14347
14454
  }, {
14348
14455
  key: "centerOnCurrentStep",
14349
14456
  value: function centerOnCurrentStep(routeId) {
14350
- var _instance$routeMarker6;
14457
+ var _instance$routeMarker7;
14351
14458
  var instance = this.resolveInstance(routeId);
14352
14459
  if (!instance) {
14353
14460
  throw new Error("Error: Does not exist step animation");
@@ -14358,7 +14465,7 @@ var RouteController = /*#__PURE__*/function () {
14358
14465
  if (instance.conditions == null || instance.animationConfig == null || instance.route == null) {
14359
14466
  throw new Error("Error: conditions, animationConfig or route should not be null at this point");
14360
14467
  }
14361
- var currentMarkerPosition = (_instance$routeMarker6 = instance.routeMarker) === null || _instance$routeMarker6 === void 0 ? void 0 : _instance$routeMarker6.getLngLat();
14468
+ var currentMarkerPosition = (_instance$routeMarker7 = instance.routeMarker) === null || _instance$routeMarker7 === void 0 ? void 0 : _instance$routeMarker7.getLngLat();
14362
14469
  if (currentMarkerPosition) {
14363
14470
  this.map.panTo(currentMarkerPosition);
14364
14471
  } else {
@@ -14413,12 +14520,19 @@ var RouteController = /*#__PURE__*/function () {
14413
14520
  });
14414
14521
  } else {
14415
14522
  var _instance$animationCo11, _instance$animationCo12;
14416
- // finishes animation
14523
+ // The status settles before the consumer hears that the route finished,
14524
+ // for the same reason `startAnimating` and `restartAnimation` order it
14525
+ // that way. A consumer that relaunches from this callback — looping a
14526
+ // kiosk demo is the ordinary case — got its fresh "STARTED" overwritten
14527
+ // by the "FINISHED" written afterwards, and was left with a live loop the
14528
+ // controller believed was over: `pauseAnimation` and `stopAnimation` both
14529
+ // bailed on the status guard, and the next `restartAnimation` skipped its
14530
+ // cancel and installed a second self-sustaining loop.
14531
+ instance.animationStatus = "FINISHED";
14417
14532
  (_instance$animationCo11 = (_instance$animationCo12 = instance.animationConfig).callBack) === null || _instance$animationCo11 === void 0 || _instance$animationCo11.call(_instance$animationCo12, {
14418
14533
  isFinished: true,
14419
14534
  step: null
14420
14535
  });
14421
- instance.animationStatus = "FINISHED";
14422
14536
  }
14423
14537
  }
14424
14538
  }, {
@@ -14431,19 +14545,25 @@ var RouteController = /*#__PURE__*/function () {
14431
14545
  var _instance$conditions = instance.conditions,
14432
14546
  startTime = _instance$conditions.startTime,
14433
14547
  resetTime = _instance$conditions.resetTime,
14434
- progress = _instance$conditions.progress;
14548
+ progress = _instance$conditions.progress,
14549
+ waitStartTime = _instance$conditions.waitStartTime;
14435
14550
  var _instance$conditions2 = instance.conditions,
14436
14551
  coordinatesIndex = _instance$conditions2.coordinatesIndex,
14437
14552
  iconRotation = _instance$conditions2.iconRotation,
14438
14553
  index = _instance$conditions2.index,
14439
14554
  onFinish = _instance$conditions2.onFinish,
14440
- rotatingIcon = _instance$conditions2.rotatingIcon,
14441
- waitStartTime = _instance$conditions2.waitStartTime;
14555
+ rotatingIcon = _instance$conditions2.rotatingIcon;
14442
14556
  var _instance$animationCo13 = instance.animationConfig,
14443
14557
  stepTime = _instance$animationCo13.stepTime,
14444
14558
  minimumSpeed = _instance$animationCo13.minimumSpeed,
14445
14559
  iconRotationTime = _instance$animationCo13.iconRotationTime,
14446
14560
  changeFloorTime = _instance$animationCo13.changeFloorTime;
14561
+
14562
+ // How long this frame took to arrive. Recorded before any early return, so
14563
+ // the next frame measures from the last one delivered rather than from the
14564
+ // last one that drew.
14565
+ var previousFrameTime = instance.conditions.lastFrameTime;
14566
+ instance.conditions.lastFrameTime = timestamp;
14447
14567
  if (startTime == null) {
14448
14568
  instance.conditions.startTime = timestamp;
14449
14569
  instance.conditions.animationId = requestAnimationFrame(function (time) {
@@ -14456,10 +14576,35 @@ var RouteController = /*#__PURE__*/function () {
14456
14576
  instance.conditions.startTime = startTime;
14457
14577
  resetTime = false;
14458
14578
  instance.conditions.resetTime = resetTime;
14579
+ } else if (previousFrameTime != null && timestamp - previousFrameTime > MAX_FRAME_GAP_MS) {
14580
+ // Absence, not slow rendering: see MAX_FRAME_GAP_MS. Shift the clock
14581
+ // forward by the gap instead of charging it, exactly as resuming from a
14582
+ // pause does above, so this frame redraws where the last one left off
14583
+ // and the next resumes from there.
14584
+ var gap = timestamp - previousFrameTime;
14585
+ // What the previous frame had charged. Equal to `progress` whenever the
14586
+ // two are in step, but the rotation branches above set `startTime` to
14587
+ // the frame timestamp without resetting `progress`, so reading the
14588
+ // stored value would carry a whole rotation's worth of time into the
14589
+ // first frame back. Recomputed instead, which is 0 in exactly that case.
14590
+ progress = previousFrameTime - startTime;
14591
+ instance.conditions.progress = progress;
14592
+ startTime = timestamp - progress;
14593
+ instance.conditions.startTime = startTime;
14594
+ // The floor-change wait runs on the raw timestamp rather than on
14595
+ // `progress`, so it needs the same shift or an absence would satisfy it
14596
+ // outright.
14597
+ if (waitStartTime != null) {
14598
+ waitStartTime += gap;
14599
+ instance.conditions.waitStartTime = waitStartTime;
14600
+ }
14459
14601
  } else {
14460
14602
  progress = timestamp - startTime;
14461
14603
  instance.conditions.progress = progress;
14462
14604
  }
14605
+
14606
+ // Not const: the segment loop below rewinds it as it charges the clock for
14607
+ // each segment it consumes within the frame.
14463
14608
  var progressInSeconds = progress / 1000;
14464
14609
  var step = instance.route.steps[index];
14465
14610
  if (step.coordinates.length <= 0) {
@@ -14469,7 +14614,6 @@ var RouteController = /*#__PURE__*/function () {
14469
14614
  var start = step.coordinates[coordinatesIndex];
14470
14615
  var end = step.coordinates[coordinatesIndex + 1];
14471
14616
  if (start != null && end != null) {
14472
- var _instance$routeMarker8;
14473
14617
  if (rotatingIcon) {
14474
14618
  var angle = NavFunctions.bearingInDegBetween(start, end);
14475
14619
  if (iconRotationTime === 0 || instance.conditions.nextFloorFirstStepIndex === index || Math.abs(angle - instance.conditions.iconRotation) < 15) {
@@ -14521,43 +14665,101 @@ var RouteController = /*#__PURE__*/function () {
14521
14665
  return;
14522
14666
  }
14523
14667
  }
14524
- var distance = NavFunctions.distance(start, end);
14525
14668
  var speed = Math.max(step.distance / stepTime, minimumSpeed !== null && minimumSpeed !== void 0 ? minimumSpeed : 0);
14526
- if (speed * progressInSeconds > distance) {
14527
- instance.currentSourceData.geometry.coordinates.push([end.lng, end.lat]);
14528
- var _source = this.map.getSource(instance.currentId);
14529
- _source === null || _source === void 0 || _source.setData(instance.currentSourceData);
14530
- if (coordinatesIndex + 2 < step.coordinates.length) {
14531
- var next = step.coordinates[coordinatesIndex + 2];
14532
- if (!compareLatLng(end, next)) {
14533
- if (instance.conditions.isStepByStep) {
14534
- instance.conditions.rotatingIcon = true;
14535
- } else {
14536
- var _instance$routeMarker7;
14537
- var nextAngle = NavFunctions.bearingInDegBetween(end, next);
14538
- instance.conditions.iconRotation = nextAngle;
14539
- (_instance$routeMarker7 = instance.routeMarker) === null || _instance$routeMarker7 === void 0 || _instance$routeMarker7.setRotation(nextAngle);
14540
- }
14541
- }
14542
- instance.conditions.startTime = timestamp;
14543
- instance.conditions.progress = 0;
14544
- instance.conditions.coordinatesIndex++;
14545
- instance.conditions.animationId = requestAnimationFrame(function (time) {
14546
- return _this8.animateStep(time, instance);
14547
- });
14548
- return;
14549
- } else {
14669
+
14670
+ // Consume every whole segment the elapsed time pays for inside this one
14671
+ // frame, carrying the sub-segment remainder into the next.
14672
+ //
14673
+ // Advancing a single vertex per frame — and restarting the clock at each
14674
+ // one, which threw the overshoot away — made a step's duration depend on
14675
+ // the frame rate: it cost `stepTime` plus up to one frame per vertex,
14676
+ // and once `speed * frameInterval` exceeded a segment's length it
14677
+ // ignored `stepTime` altogether and collapsed to `vertexCount / fps`.
14678
+ // Encoded polylines quantise near 1.1 m, so that regime was the common
14679
+ // one, not the corner case.
14680
+ var segmentStart = start;
14681
+ var segmentEnd = end;
14682
+ var segmentDistance = NavFunctions.distance(segmentStart, segmentEnd);
14683
+
14684
+ // Drop the previous frame's interpolated tip before committing anything.
14685
+ // Coordinates up to and including the current vertex are settled geometry
14686
+ // — exactly `coordinatesIndex + 1` of them — and the tip is a single
14687
+ // moving point after them, re-placed at the end of this frame. Appending
14688
+ // one per frame instead grew the drawn line with elapsed frames, well
14689
+ // past the polyline's own vertex count, and `setData` re-indexed every
14690
+ // one of those points on the next frame.
14691
+ var coordinates = instance.currentSourceData.geometry.coordinates;
14692
+ coordinates.length = Math.min(coordinates.length, instance.conditions.coordinatesIndex + 1);
14693
+ while (speed * progressInSeconds > segmentDistance) {
14694
+ coordinates.push([segmentEnd.lng, segmentEnd.lat]);
14695
+ if (instance.conditions.coordinatesIndex + 2 >= step.coordinates.length) {
14696
+ this.flushCurrentSourceData(instance);
14550
14697
  onFinish === null || onFinish === void 0 || onFinish(timestamp);
14551
14698
  return;
14552
14699
  }
14700
+
14701
+ // Charge the clock exactly what this segment cost instead of
14702
+ // restarting it, so no time is lost at a vertex.
14703
+ var segmentMs = segmentDistance / speed * 1000;
14704
+ startTime += segmentMs;
14705
+ progress -= segmentMs;
14706
+ instance.conditions.startTime = startTime;
14707
+ instance.conditions.progress = progress;
14708
+ progressInSeconds = progress / 1000;
14709
+ instance.conditions.coordinatesIndex++;
14710
+ var next = step.coordinates[instance.conditions.coordinatesIndex + 1];
14711
+ if (!compareLatLng(segmentEnd, next)) {
14712
+ var _instance$routeMarker8;
14713
+ if (instance.conditions.isStepByStep) {
14714
+ // Step-by-step mode animates the turn itself, on the rotation
14715
+ // branch of the next frame. Stop consuming segments and let it.
14716
+ //
14717
+ // The clock restarts here because the rotation branch measures its
14718
+ // own progress from `startTime`, and every other transition into it
14719
+ // resets too (see `prepareForNextStep` and the floor-change hand-off).
14720
+ // Carrying this frame's leftover sub-segment time over instead
14721
+ // started the turn already part-way through — or skipped it outright
14722
+ // once the remainder exceeded `iconRotationTime`. Before the segment
14723
+ // loop existed the per-vertex path reset it as well.
14724
+ instance.conditions.rotatingIcon = true;
14725
+ instance.conditions.startTime = timestamp;
14726
+ instance.conditions.progress = 0;
14727
+ this.flushCurrentSourceData(instance);
14728
+ instance.conditions.animationId = requestAnimationFrame(function (time) {
14729
+ return _this8.animateStep(time, instance);
14730
+ });
14731
+ return;
14732
+ }
14733
+ var nextAngle = NavFunctions.bearingInDegBetween(segmentEnd, next);
14734
+ instance.conditions.iconRotation = nextAngle;
14735
+ (_instance$routeMarker8 = instance.routeMarker) === null || _instance$routeMarker8 === void 0 || _instance$routeMarker8.setRotation(nextAngle);
14736
+ }
14737
+ segmentStart = segmentEnd;
14738
+ segmentEnd = next;
14739
+ segmentDistance = NavFunctions.distance(segmentStart, segmentEnd);
14553
14740
  }
14554
- var fraction = speed * progressInSeconds / distance;
14555
- var point = distance === 0 ? end : NavFunctions.intermediatePointBetween(start, end, Math.min(fraction, 1));
14556
- instance.currentSourceData.geometry.coordinates.push([point.lng, point.lat]);
14557
- var source = this.map.getSource(instance.currentId);
14558
- source === null || source === void 0 || source.setData(instance.currentSourceData);
14741
+ var fraction = speed * progressInSeconds / segmentDistance;
14742
+ var point = segmentDistance === 0 ? segmentEnd : NavFunctions.intermediatePointBetween(segmentStart, segmentEnd, Math.min(fraction, 1));
14743
+ coordinates.push([point.lng, point.lat]);
14744
+ this.flushCurrentSourceData(instance);
14559
14745
  this.setMarkerLngLat(instance, point);
14560
- (_instance$routeMarker8 = instance.routeMarker) === null || _instance$routeMarker8 === void 0 || _instance$routeMarker8.addTo(this.map);
14746
+ // Only when it has genuinely left the DOM. maplibre's `Marker.addTo`
14747
+ // opens with `remove()`, so re-attaching an attached marker tears down
14748
+ // and rebuilds 13 map listeners and detaches and re-appends the element.
14749
+ // Unconditionally, that ran every frame — and quietly undid
14750
+ // `updateRouteMarkerVisibility` hiding the arrow, which is the bug it was
14751
+ // really covering for.
14752
+ //
14753
+ // `isConnected` alone cannot express that: `hide()` detaches the element
14754
+ // through maplibre's `Marker.remove()`, so a marker hidden by a floor
14755
+ // change reads as disconnected and was re-attached on the very next
14756
+ // frame — the arrow reappeared on the wrong floor. Hidden-ness is an
14757
+ // intent, so it is read from the flag `hide()`/`show()` maintain, and
14758
+ // `isConnected` is left to answer only what it can: whether a marker
14759
+ // nobody hid has fallen out of the DOM (a step transition removing it).
14760
+ if (instance.routeMarker != null && !instance.routeMarker.hiddenOnPurpose && !instance.routeMarker.getElement().isConnected) {
14761
+ instance.routeMarker.addTo(this.map);
14762
+ }
14561
14763
  instance.conditions.animationId = requestAnimationFrame(function (time) {
14562
14764
  return _this8.animateStep(time, instance);
14563
14765
  });
@@ -14567,6 +14769,21 @@ var RouteController = /*#__PURE__*/function () {
14567
14769
  return;
14568
14770
  }
14569
14771
  }
14772
+
14773
+ /**
14774
+ * Pushes the in-progress segment's geometry to its map source.
14775
+ *
14776
+ * Called once per frame rather than once per vertex crossed: `setData`
14777
+ * rebuilds the whole geojson-vt index and reloads every in-view tile, so its
14778
+ * cost is a large fixed one per call and is worth paying only once, with the
14779
+ * frame's final geometry.
14780
+ */
14781
+ }, {
14782
+ key: "flushCurrentSourceData",
14783
+ value: function flushCurrentSourceData(instance) {
14784
+ var source = this.map.getSource(instance.currentId);
14785
+ source === null || source === void 0 || source.setData(instance.currentSourceData);
14786
+ }
14570
14787
  }, {
14571
14788
  key: "setMarkerLngLat",
14572
14789
  value: function setMarkerLngLat(instance, point) {
@@ -19492,37 +19709,83 @@ function three_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19492
19709
 
19493
19710
  /** Runtime handle to the deck.gl classes used by the 3D scene. */
19494
19711
 
19495
- var threePromise;
19496
- var deckPromise;
19712
+ /**
19713
+ * Memoizes a dynamic-import chain, caching only a FULFILLED result.
19714
+ *
19715
+ * A plain `cached ??= import(...)` also memoizes a *rejection*, so one transient chunk-fetch
19716
+ * failure (a dropped connection, a cache-busted deploy mid-session) permanently disables the
19717
+ * feature for the rest of the page's life: every retry receives the same rejected promise and
19718
+ * fails identically. The 3D scene retries on its own — `reloadScene3DModelsForLod` reloads GLB
19719
+ * templates on every zoom-in past the LOD threshold — so a sticky rejection turns a blip into
19720
+ * models that never come back until the user reloads.
19721
+ *
19722
+ * Concurrent callers still share one in-flight import (that is the point of the cache); only the
19723
+ * rejected promise is evicted, and the error is re-thrown so every current caller still sees it.
19724
+ *
19725
+ * Exported only so the eviction behaviour can be tested directly — the loaders below wrap real
19726
+ * dynamic `import()` calls, which a unit test cannot fail on demand.
19727
+ *
19728
+ * @param load Builds the import promise. Called again on the first retry after a failure.
19729
+ * @returns An accessor that imports at most once per successful load.
19730
+ * @internal
19731
+ */
19732
+ function memoizeImport(load) {
19733
+ var cached;
19734
+ return function () {
19735
+ cached !== null && cached !== void 0 ? cached : cached = load()["catch"](function (error) {
19736
+ // Evict BEFORE re-throwing so the next call starts a fresh import. Safe to assign here:
19737
+ // a promise never settles synchronously, so `cached` is already assigned by now.
19738
+ cached = undefined;
19739
+ throw error;
19740
+ });
19741
+ return cached;
19742
+ };
19743
+ }
19497
19744
 
19498
19745
  /**
19499
19746
  * Dynamically imports Three.js and the GLTF/DRACO/KTX2 loaders once and caches the result.
19500
19747
  * Subsequent calls return the same promise, so a single Three.js instance is shared.
19748
+ * A failed import is not cached — see {@link memoizeImport}.
19501
19749
  */
19502
- function loadThree() {
19503
- threePromise !== null && threePromise !== void 0 ? threePromise : threePromise = Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 912, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 833, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 303, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 373, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 502, 23))]).then(function (_ref) {
19504
- var _ref2 = three_slicedToArray(_ref, 5),
19750
+ var loadThree = memoizeImport(function () {
19751
+ return Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 912, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 833, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 303, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 373, 23))]).then(function (_ref) {
19752
+ var _ref2 = three_slicedToArray(_ref, 4),
19505
19753
  three = _ref2[0],
19506
19754
  gltf = _ref2[1],
19507
19755
  draco = _ref2[2],
19508
- ktx2 = _ref2[3],
19509
- meshopt = _ref2[4];
19756
+ ktx2 = _ref2[3];
19510
19757
  return {
19511
19758
  THREE: three,
19512
19759
  GLTFLoader: gltf.GLTFLoader,
19513
19760
  DRACOLoader: draco.DRACOLoader,
19514
- KTX2Loader: ktx2.KTX2Loader,
19515
- MeshoptDecoder: meshopt.MeshoptDecoder
19761
+ KTX2Loader: ktx2.KTX2Loader
19516
19762
  };
19517
19763
  });
19518
- return threePromise;
19519
- }
19764
+ });
19765
+
19766
+ /**
19767
+ * Dynamically imports the singleton meshopt decoder once and caches the result.
19768
+ *
19769
+ * Deliberately NOT part of {@link loadThree}'s import chain: only GLBs compressed with
19770
+ * `EXT_meshopt_compression` need it, so keeping it out of the eager `Promise.all` keeps the
19771
+ * decoder module (and its WASM instantiation) off the critical path of the first 3D frame.
19772
+ * It is fetched on the first meshopt buffer decode instead — see the lazy wrapper in
19773
+ * `loadGlb.ts`. That moves the fetch inside `parse()`, competing with hundreds of MB of GLB
19774
+ * downloads, so not caching a failed import (see {@link memoizeImport}) matters more here than
19775
+ * for the eager loaders.
19776
+ */
19777
+ var loadMeshoptDecoder = memoizeImport(function () {
19778
+ return Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 502, 23)).then(function (meshopt) {
19779
+ return meshopt.MeshoptDecoder;
19780
+ });
19781
+ });
19520
19782
 
19521
19783
  /**
19522
19784
  * Dynamically imports the deck.gl overlay and layer classes once and caches the result.
19785
+ * A failed import is not cached — see {@link memoizeImport}.
19523
19786
  */
19524
- function loadDeck() {
19525
- deckPromise !== null && deckPromise !== void 0 ? deckPromise : deckPromise = Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 452, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 741, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 589, 23))]).then(function (_ref3) {
19787
+ var loadDeck = memoizeImport(function () {
19788
+ return Promise.all([Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 452, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 741, 23)), Promise.resolve(/* import() */).then(__webpack_require__.t.bind(__webpack_require__, 589, 23))]).then(function (_ref3) {
19526
19789
  var _ref4 = three_slicedToArray(_ref3, 3),
19527
19790
  mapbox = _ref4[0],
19528
19791
  geoLayers = _ref4[1],
@@ -19535,31 +19798,104 @@ function loadDeck() {
19535
19798
  TextLayer: layers.TextLayer
19536
19799
  };
19537
19800
  });
19538
- return deckPromise;
19539
- }
19801
+ });
19540
19802
  ;// ./src/utils/loadGlb.ts
19541
- function loadGlb_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return loadGlb_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (loadGlb_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, loadGlb_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, loadGlb_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), loadGlb_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", loadGlb_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), loadGlb_regeneratorDefine2(u), loadGlb_regeneratorDefine2(u, o, "Generator"), loadGlb_regeneratorDefine2(u, n, function () { return this; }), loadGlb_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (loadGlb_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
19542
- function loadGlb_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } loadGlb_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { loadGlb_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, loadGlb_regeneratorDefine2(e, r, n, t); }
19543
19803
  function loadGlb_slicedToArray(r, e) { return loadGlb_arrayWithHoles(r) || loadGlb_iterableToArrayLimit(r, e) || loadGlb_unsupportedIterableToArray(r, e) || loadGlb_nonIterableRest(); }
19544
19804
  function loadGlb_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19545
19805
  function loadGlb_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return loadGlb_arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? loadGlb_arrayLikeToArray(r, a) : void 0; } }
19546
19806
  function loadGlb_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
19547
19807
  function loadGlb_iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
19548
19808
  function loadGlb_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19809
+ function loadGlb_regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return loadGlb_regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (loadGlb_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, loadGlb_regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, loadGlb_regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), loadGlb_regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", loadGlb_regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), loadGlb_regeneratorDefine2(u), loadGlb_regeneratorDefine2(u, o, "Generator"), loadGlb_regeneratorDefine2(u, n, function () { return this; }), loadGlb_regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (loadGlb_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
19810
+ function loadGlb_regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } loadGlb_regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { loadGlb_regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, loadGlb_regeneratorDefine2(e, r, n, t); }
19549
19811
  function loadGlb_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
19550
19812
  function loadGlb_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { loadGlb_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { loadGlb_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
19813
+ function loadGlb_typeof(o) { "@babel/helpers - typeof"; return loadGlb_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, loadGlb_typeof(o); }
19551
19814
 
19552
19815
 
19553
19816
 
19817
+ /**
19818
+ * The subset of the meshopt decoder contract `GLTFLoader` actually exercises when
19819
+ * `decodeGltfBufferAsync` is present: it checks `supported`, then calls `decodeGltfBufferAsync`
19820
+ * for each `EXT_meshopt_compression` buffer view (never touching `ready`/`decodeGltfBuffer`).
19821
+ *
19822
+ * The signature is derived from the module type again, now that
19823
+ * `src/types/three-addons.d.ts` declares the decoder's shape directly instead of forwarding to
19824
+ * `@types/three`'s unresolvable `export * from "meshoptimizer/decoder"` — which `skipLibCheck`
19825
+ * swallowed, collapsing the lookup to `any`. Deriving keeps this interface and the delegation
19826
+ * call in `createLazyMeshoptDecoder` checked against a single definition; hand-writing it here
19827
+ * left the delegation itself unchecked, because the value it delegates to was still `any`.
19828
+ *
19829
+ * That definition is transcribed from three's JS, so it is an assertion about that file rather
19830
+ * than a derivation from it: a three.js change needs the `.d.ts` updated by hand. What is
19831
+ * compiler-enforced is that this shim and its consumers agree with it.
19832
+ * @internal
19833
+ */
19834
+
19835
+ /**
19836
+ * Builds a stand-in meshopt decoder that defers importing the real module (and instantiating its
19837
+ * WASM) until the first `EXT_meshopt_compression` buffer actually needs decoding. GLBs without the
19838
+ * extension never trigger the import, so the decoder stays off the critical path of the first 3D
19839
+ * frame — it used to be part of the eager three.js import chain, delaying every scene load.
19840
+ *
19841
+ * `supported` mirrors the real module's own gate — it returns a bare `{ supported: false }` when
19842
+ * `typeof WebAssembly !== "object"` — so the answer is reproduced synchronously here without
19843
+ * importing anything. Reporting a flat `true` instead would break the platforms it claims to
19844
+ * support: `GLTFLoader` reads `supported` before deciding to decode, and on `false` with meshopt
19845
+ * merely OPTIONAL it returns `null` and falls back to the GLB's uncompressed buffer
19846
+ * (`GLTFLoader.js` `GLTFMeshoptCompression.loadBufferView`). Claiming support on a WASM-less
19847
+ * platform discards that fallback and fails the whole asset with a `TypeError` from this shim,
19848
+ * since `decodeGltfBufferAsync` does not exist on the real module there.
19849
+ *
19850
+ * @param load Injectable module loader, for tests. Defaults to the cached {@link loadMeshoptDecoder}.
19851
+ * @internal
19852
+ */
19853
+ function createLazyMeshoptDecoder() {
19854
+ var load = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : loadMeshoptDecoder;
19855
+ return {
19856
+ // Same condition the real decoder uses, evaluated without loading it.
19857
+ supported: (typeof WebAssembly === "undefined" ? "undefined" : loadGlb_typeof(WebAssembly)) === "object",
19858
+ decodeGltfBufferAsync: function () {
19859
+ var _decodeGltfBufferAsync = loadGlb_asyncToGenerator(/*#__PURE__*/loadGlb_regenerator().m(function _callee(count, size, source, mode, filter) {
19860
+ var decoder;
19861
+ return loadGlb_regenerator().w(function (_context) {
19862
+ while (1) switch (_context.n) {
19863
+ case 0:
19864
+ _context.n = 1;
19865
+ return load();
19866
+ case 1:
19867
+ decoder = _context.v;
19868
+ _context.n = 2;
19869
+ return decoder.ready;
19870
+ case 2:
19871
+ return _context.a(2, decoder.decodeGltfBufferAsync(count, size, source, mode, filter));
19872
+ }
19873
+ }, _callee);
19874
+ }));
19875
+ function decodeGltfBufferAsync(_x, _x2, _x3, _x4, _x5) {
19876
+ return _decodeGltfBufferAsync.apply(this, arguments);
19877
+ }
19878
+ return decodeGltfBufferAsync;
19879
+ }()
19880
+ };
19881
+ }
19882
+
19554
19883
  /**
19555
19884
  * Lazily-initialized, cached GLTF loader configured with Draco + KTX2 support.
19556
19885
  *
19557
19886
  * The loaders (and their WebGLRenderer for KTX2 support detection) are heavy and pull in Three.js,
19558
19887
  * so they are created on first use inside the dynamic-import boundary rather than at module load.
19559
- */
19560
- var gltfLoaderPromise;
19561
- function getGltfLoader() {
19562
- gltfLoaderPromise !== null && gltfLoaderPromise !== void 0 ? gltfLoaderPromise : gltfLoaderPromise = loadThree().then(function (mod) {
19888
+ *
19889
+ * Memoized through {@link memoizeImport} for the same reason the loaders in `three.ts` are: a plain
19890
+ * `cached ??=` also caches a rejection. Fixing the three loaders was not enough, because this is a
19891
+ * SECOND cache wrapped around `loadThree()` — so a transient failure was evicted there and then
19892
+ * replayed from here forever, and `loadGlbRoot` awaits both, meaning every GLB kept failing with
19893
+ * the stale error long after `loadThree()` had recovered. Not only network: the `.then` below
19894
+ * constructs a `WebGLRenderer` for KTX2 support detection, and a failed context creation was
19895
+ * cached just the same.
19896
+ */
19897
+ var getGltfLoader = memoizeImport(function () {
19898
+ return loadThree().then(function (mod) {
19563
19899
  var dracoLoader = new mod.DRACOLoader();
19564
19900
  dracoLoader.setDecoderPath(DEFAULT_DRACO_DECODER_PATH);
19565
19901
  var gltfLoader = new mod.GLTFLoader();
@@ -19571,15 +19907,15 @@ function getGltfLoader() {
19571
19907
  antialias: true
19572
19908
  }));
19573
19909
 
19574
- // Enable EXT_meshopt_compression so meshopt-compressed GLBs decode. The decoder is a WASM
19575
- // singleton; GLTFLoader awaits its `.ready` promise internally before parsing. Assets that
19576
- // don't use the extension are unaffected. This lets the offline pipeline pick meshopt (often
19577
- // smaller than Draco for the scene's meshes) without a runtime change.
19578
- gltfLoader.setMeshoptDecoder(mod.MeshoptDecoder);
19910
+ // Enable EXT_meshopt_compression so meshopt-compressed GLBs decode, without paying for the
19911
+ // decoder module up front: the lazy stand-in imports it (and instantiates its WASM) only when
19912
+ // the first meshopt-compressed buffer is actually decoded. Assets that don't use the extension
19913
+ // never load it. The cast is safe — with `decodeGltfBufferAsync` present, GLTFLoader touches
19914
+ // only `supported` and `decodeGltfBufferAsync` (see LazyMeshoptDecoder).
19915
+ gltfLoader.setMeshoptDecoder(createLazyMeshoptDecoder());
19579
19916
  return gltfLoader;
19580
19917
  });
19581
- return gltfLoaderPromise;
19582
- }
19918
+ });
19583
19919
 
19584
19920
  /**
19585
19921
  * Default per-asset timeout for {@link loadGlbRoot}.
@@ -19644,11 +19980,11 @@ function assertGlbBufferComplete(buffer, url) {
19644
19980
  * @returns Root `THREE.Group` from the loaded glTF scene
19645
19981
  * @group Utils
19646
19982
  */
19647
- function loadGlbRoot(_x) {
19983
+ function loadGlbRoot(_x6) {
19648
19984
  return _loadGlbRoot.apply(this, arguments);
19649
19985
  }
19650
19986
  function _loadGlbRoot() {
19651
- _loadGlbRoot = loadGlb_asyncToGenerator(/*#__PURE__*/loadGlb_regenerator().m(function _callee(url) {
19987
+ _loadGlbRoot = loadGlb_asyncToGenerator(/*#__PURE__*/loadGlb_regenerator().m(function _callee2(url) {
19652
19988
  var options,
19653
19989
  _options$timeoutMs,
19654
19990
  timeoutMs,
@@ -19662,16 +19998,16 @@ function _loadGlbRoot() {
19662
19998
  load,
19663
19999
  timer,
19664
20000
  timeout,
19665
- _args = arguments;
19666
- return loadGlb_regenerator().w(function (_context) {
19667
- while (1) switch (_context.p = _context.n) {
20001
+ _args2 = arguments;
20002
+ return loadGlb_regenerator().w(function (_context2) {
20003
+ while (1) switch (_context2.p = _context2.n) {
19668
20004
  case 0:
19669
- options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
20005
+ options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {};
19670
20006
  _options$timeoutMs = options.timeoutMs, timeoutMs = _options$timeoutMs === void 0 ? DEFAULT_GLB_LOAD_TIMEOUT_MS : _options$timeoutMs, onProgress = options.onProgress;
19671
- _context.n = 1;
20007
+ _context2.n = 1;
19672
20008
  return Promise.all([getGltfLoader(), loadThree()]);
19673
20009
  case 1:
19674
- _yield$Promise$all = _context.v;
20010
+ _yield$Promise$all = _context2.v;
19675
20011
  _yield$Promise$all2 = loadGlb_slicedToArray(_yield$Promise$all, 2);
19676
20012
  gltfLoader = _yield$Promise$all2[0];
19677
20013
  three = _yield$Promise$all2[1].THREE;
@@ -19705,31 +20041,31 @@ function _loadGlbRoot() {
19705
20041
  }, onError);
19706
20042
  });
19707
20043
  if (!(!Number.isFinite(timeoutMs) || timeoutMs <= 0)) {
19708
- _context.n = 5;
20044
+ _context2.n = 5;
19709
20045
  break;
19710
20046
  }
19711
- _context.p = 2;
19712
- _context.n = 3;
20047
+ _context2.p = 2;
20048
+ _context2.n = 3;
19713
20049
  return load;
19714
20050
  case 3:
19715
- return _context.a(2, _context.v);
20051
+ return _context2.a(2, _context2.v);
19716
20052
  case 4:
19717
- _context.p = 4;
20053
+ _context2.p = 4;
19718
20054
  settled = true;
19719
- return _context.f(4);
20055
+ return _context2.f(4);
19720
20056
  case 5:
19721
20057
  timeout = new Promise(function (_resolve, reject) {
19722
20058
  timer = setTimeout(function () {
19723
20059
  return reject(new Error("Timed out loading GLB after ".concat(timeoutMs, "ms: ").concat(url)));
19724
20060
  }, timeoutMs);
19725
20061
  });
19726
- _context.p = 6;
19727
- _context.n = 7;
20062
+ _context2.p = 6;
20063
+ _context2.n = 7;
19728
20064
  return Promise.race([load, timeout]);
19729
20065
  case 7:
19730
- return _context.a(2, _context.v);
20066
+ return _context2.a(2, _context2.v);
19731
20067
  case 8:
19732
- _context.p = 8;
20068
+ _context2.p = 8;
19733
20069
  settled = true;
19734
20070
  clearTimeout(timer);
19735
20071
  // Cancels the underlying fetch (and, by never delivering its buffer, the Draco/KTX2 decode)
@@ -19737,11 +20073,11 @@ function _loadGlbRoot() {
19737
20073
  // unattended — otherwise GLB_LOAD_CONCURRENCY only bounds how many loads the caller awaits,
19738
20074
  // not how many are truly in flight. A no-op if `load` already won the race.
19739
20075
  fileLoader.abort();
19740
- return _context.f(8);
20076
+ return _context2.f(8);
19741
20077
  case 9:
19742
- return _context.a(2);
20078
+ return _context2.a(2);
19743
20079
  }
19744
- }, _callee, null, [[6,, 8, 9], [2,, 4, 5]]);
20080
+ }, _callee2, null, [[6,, 8, 9], [2,, 4, 5]]);
19745
20081
  }));
19746
20082
  return _loadGlbRoot.apply(this, arguments);
19747
20083
  }
@@ -22574,9 +22910,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22574
22910
  }, {
22575
22911
  key: "addMarker",
22576
22912
  value: function addMarker(marker) {
22577
- var _this11 = this;
22578
22913
  try {
22579
- var _marker$maxLabelWidth, _this$innerFloors$fin4, _this$innerFloors$fin5;
22914
+ var _marker$maxLabelWidth;
22580
22915
  // Check if a marker with the same ID already exists and remove it
22581
22916
  if (marker.id) {
22582
22917
  var existingMarkerIndex = this.markers.findIndex(function (m) {
@@ -22595,10 +22930,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22595
22930
  var markerCreated = new MarkerAttribute(map_objectSpread(map_objectSpread({}, marker), {}, {
22596
22931
  maxLabelWidthPx: (_marker$maxLabelWidth = marker.maxLabelWidthPx) !== null && _marker$maxLabelWidth !== void 0 ? _marker$maxLabelWidth : this.markerLayoutConfig.maxLabelWidthPx
22597
22932
  }));
22598
- var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin4 = (_this$innerFloors$fin5 = this.innerFloors.find(function (floor) {
22599
- return floor.key === _this11.currentFloor;
22600
- })) === null || _this$innerFloors$fin5 === void 0 ? void 0 : _this$innerFloors$fin5.reachableFromGPS) !== null && _this$innerFloors$fin4 !== void 0 ? _this$innerFloors$fin4 : false);
22601
- markerCreated.changeFloor(this.currentFloor, this.map, isOutdoor);
22933
+ markerCreated.changeFloor(this.currentFloor, this.map, this.isOutdoorFloor(this.currentFloor));
22602
22934
  this.markers.push(markerCreated);
22603
22935
  this.markerLayoutController.scheduleRelayout();
22604
22936
  this.logEvent("addMarker");
@@ -22913,11 +23245,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
22913
23245
  }, {
22914
23246
  key: "circleFeatureCollection",
22915
23247
  value: function circleFeatureCollection() {
22916
- var _this$currentFloor3, _this$innerFloors$fin6, _this$innerFloors$fin7;
23248
+ var _this$currentFloor3;
22917
23249
  var floorId = (_this$currentFloor3 = this.currentFloor) !== null && _this$currentFloor3 !== void 0 ? _this$currentFloor3 : "";
22918
- var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin6 = (_this$innerFloors$fin7 = this.innerFloors.find(function (floor) {
22919
- return floor.key === floorId;
22920
- })) === null || _this$innerFloors$fin7 === void 0 ? void 0 : _this$innerFloors$fin7.reachableFromGPS) !== null && _this$innerFloors$fin6 !== void 0 ? _this$innerFloors$fin6 : false);
23250
+ var isOutdoor = this.isOutdoorFloor(floorId);
22921
23251
  var features = this.circles.filter(function (circle) {
22922
23252
  var _circle$floorId;
22923
23253
  if (circle.hidden) return false;
@@ -23134,14 +23464,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23134
23464
  }, {
23135
23465
  key: "updateMarkersTo",
23136
23466
  value: function updateMarkersTo(floorId) {
23137
- var _this$innerFloors$fin8,
23138
- _this$innerFloors$fin9,
23139
- _this12 = this;
23140
- var isOutdoor = !this.parentPlace || ((_this$innerFloors$fin8 = (_this$innerFloors$fin9 = this.innerFloors.find(function (floor) {
23141
- return floor.key === floorId;
23142
- })) === null || _this$innerFloors$fin9 === void 0 ? void 0 : _this$innerFloors$fin9.reachableFromGPS) !== null && _this$innerFloors$fin8 !== void 0 ? _this$innerFloors$fin8 : false);
23467
+ var _this11 = this;
23468
+ var isOutdoor = this.isOutdoorFloor(floorId);
23143
23469
  this.markers.forEach(function (e) {
23144
- e.changeFloor(floorId, _this12.map, isOutdoor);
23470
+ e.changeFloor(floorId, _this11.map, isOutdoor);
23145
23471
  });
23146
23472
  this.markerLayoutController.scheduleRelayout();
23147
23473
  }
@@ -23150,18 +23476,18 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23150
23476
  value: function updateFiltersTo(floorId) {
23151
23477
  var _this$map$getStyle$la3,
23152
23478
  _this$map$getStyle3,
23153
- _this13 = this,
23154
- _this$innerFloors$fin0;
23479
+ _this12 = this,
23480
+ _this$innerFloors$fin4;
23155
23481
  if (!this.map) return;
23156
23482
  var layers = (_this$map$getStyle$la3 = (_this$map$getStyle3 = this.map.getStyle()) === null || _this$map$getStyle3 === void 0 ? void 0 : _this$map$getStyle3.layers) !== null && _this$map$getStyle$la3 !== void 0 ? _this$map$getStyle$la3 : [];
23157
23483
  layers.filter(function (l) {
23158
23484
  return l.id.startsWith("base-indoor-");
23159
23485
  }).forEach(function (l) {
23160
- _this13.map.removeLayer(l.id);
23486
+ _this12.map.removeLayer(l.id);
23161
23487
  });
23162
- var baseFloorId = (_this$innerFloors$fin0 = this.innerFloors.find(function (floor) {
23488
+ var baseFloorId = (_this$innerFloors$fin4 = this.innerFloors.find(function (floor) {
23163
23489
  return floor.key === floorId;
23164
- })) === null || _this$innerFloors$fin0 === void 0 ? void 0 : _this$innerFloors$fin0.baseFloor;
23490
+ })) === null || _this$innerFloors$fin4 === void 0 ? void 0 : _this$innerFloors$fin4.baseFloor;
23165
23491
  var indoorLayers = layers.filter(function (layer) {
23166
23492
  return layer.id.startsWith("indoor-");
23167
23493
  });
@@ -23175,7 +23501,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23175
23501
  // resolved are skipped, so a filter this class wrote is never mistaken for a
23176
23502
  // declared one.
23177
23503
  indoorLayers.forEach(function (layer) {
23178
- return _this13.captureDeclaredBaseFilter(layer.id);
23504
+ return _this12.captureDeclaredBaseFilter(layer.id);
23179
23505
  });
23180
23506
  if (baseFloorId != undefined) {
23181
23507
  var _indoorLayers$;
@@ -23185,13 +23511,13 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23185
23511
  }).forEach(function (layer) {
23186
23512
  var baseLayer = deepClone(layer);
23187
23513
  baseLayer.id = "base-" + layer.id;
23188
- _this13.baseFilters[baseLayer.id] = _this13.baseFilters[layer.id];
23189
- _this13.map.addLayer(baseLayer, firstLayerId);
23190
- _this13.applyLayerFilters(baseLayer, baseFloorId);
23514
+ _this12.baseFilters[baseLayer.id] = _this12.baseFilters[layer.id];
23515
+ _this12.map.addLayer(baseLayer, firstLayerId);
23516
+ _this12.applyLayerFilters(baseLayer, baseFloorId);
23191
23517
  });
23192
23518
  }
23193
23519
  indoorLayers.forEach(function (layer) {
23194
- _this13.applyLayerFilters(layer, floorId);
23520
+ _this12.applyLayerFilters(layer, floorId);
23195
23521
  });
23196
23522
  }
23197
23523
 
@@ -23263,6 +23589,23 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23263
23589
  value: function getInnerFloors() {
23264
23590
  return this.innerFloors;
23265
23591
  }
23592
+
23593
+ /**
23594
+ * Whether `floorId` shows the venue's outdoors, and so whether entities that
23595
+ * carry no floor of their own belong on screen with it.
23596
+ *
23597
+ * A map without a parent place is outdoors throughout; inside one, only a
23598
+ * floor reachable from GPS is. Markers, circles and the route marker all hang
23599
+ * their visibility on this, so they answer it the same way.
23600
+ */
23601
+ }, {
23602
+ key: "isOutdoorFloor",
23603
+ value: function isOutdoorFloor(floorId) {
23604
+ var _this$innerFloors$fin5, _this$innerFloors$fin6;
23605
+ return !this.parentPlace || ((_this$innerFloors$fin5 = (_this$innerFloors$fin6 = this.innerFloors.find(function (floor) {
23606
+ return floor.key === floorId;
23607
+ })) === null || _this$innerFloors$fin6 === void 0 ? void 0 : _this$innerFloors$fin6.reachableFromGPS) !== null && _this$innerFloors$fin5 !== void 0 ? _this$innerFloors$fin5 : false);
23608
+ }
23266
23609
  }, {
23267
23610
  key: "updateCamera",
23268
23611
  value: function updateCamera(newCamera, callback) {
@@ -23744,17 +24087,17 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23744
24087
  }, {
23745
24088
  key: "defaultClickListener",
23746
24089
  value: function defaultClickListener() {
23747
- var _this14 = this;
24090
+ var _this13 = this;
23748
24091
  this.map.on("click", /*#__PURE__*/function () {
23749
24092
  var _ref4 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee3(e) {
23750
24093
  var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref5, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator3, _step3, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t3;
23751
24094
  return map_regenerator().w(function (_context3) {
23752
24095
  while (1) switch (_context3.p = _context3.n) {
23753
24096
  case 0:
23754
- features = _this14.map.queryRenderedFeatures(e.point); // Filter room features by current floor
24097
+ features = _this13.map.queryRenderedFeatures(e.point); // Filter room features by current floor
23755
24098
  roomFeatures = features.filter(function (feature) {
23756
24099
  var _feature$properties;
23757
- return feature.properties["class"] === "room" && ((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.floor_key) === _this14.currentFloor;
24100
+ return feature.properties["class"] === "room" && ((_feature$properties = feature.properties) === null || _feature$properties === void 0 ? void 0 : _feature$properties.floor_key) === _this13.currentFloor;
23758
24101
  });
23759
24102
  touchedFeature = roomFeatures[0];
23760
24103
  ref = touchedFeature === null || touchedFeature === void 0 ? void 0 : touchedFeature.properties.ref;
@@ -23765,14 +24108,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23765
24108
  console.log("touchedFeature", ref);
23766
24109
 
23767
24110
  // First, search in current subPlaces
23768
- clickedPlace = _this14.subPlaces.find(function (subPlace) {
24111
+ clickedPlace = _this13.subPlaces.find(function (subPlace) {
23769
24112
  return subPlace.mapvxId === ref;
23770
24113
  }); // If not found, search in subplaces of potential parent places
23771
24114
  if (!(clickedPlace === undefined)) {
23772
24115
  _context3.n = 7;
23773
24116
  break;
23774
24117
  }
23775
- _iterator3 = map_createForOfIteratorHelper(_this14.potentialParentPlaces);
24118
+ _iterator3 = map_createForOfIteratorHelper(_this13.potentialParentPlaces);
23776
24119
  _context3.p = 1;
23777
24120
  _iterator3.s();
23778
24121
  case 2:
@@ -23781,7 +24124,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23781
24124
  break;
23782
24125
  }
23783
24126
  potentialParentPlace = _step3.value;
23784
- cachedSubPlaces = _this14.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
24127
+ cachedSubPlaces = _this13.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
23785
24128
  if (!cachedSubPlaces) {
23786
24129
  _context3.n = 3;
23787
24130
  break;
@@ -23813,14 +24156,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23813
24156
  _context3.n = 10;
23814
24157
  break;
23815
24158
  }
23816
- cachedPlaces = _this14.repository.getCachedPlaces([ref]);
24159
+ cachedPlaces = _this13.repository.getCachedPlaces([ref]);
23817
24160
  if (!(cachedPlaces.length === 0)) {
23818
24161
  _context3.n = 9;
23819
24162
  break;
23820
24163
  }
23821
24164
  console.log("fetching place detail from server", ref);
23822
24165
  _context3.n = 8;
23823
- return _this14.repository.fetchAndParsePlaceDetail({
24166
+ return _this13.repository.fetchAndParsePlaceDetail({
23824
24167
  id: ref
23825
24168
  });
23826
24169
  case 8:
@@ -23833,8 +24176,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23833
24176
  case 10:
23834
24177
  console.log("clickedPlace", (_clickedPlace = clickedPlace) === null || _clickedPlace === void 0 ? void 0 : _clickedPlace.title);
23835
24178
  clickedPlaceId = (_ref5 = (_clickedPlace$mapvxId = (_clickedPlace2 = clickedPlace) === null || _clickedPlace2 === void 0 ? void 0 : _clickedPlace2.mapvxId) !== null && _clickedPlace$mapvxId !== void 0 ? _clickedPlace$mapvxId : (_clickedPlace3 = clickedPlace) === null || _clickedPlace3 === void 0 ? void 0 : _clickedPlace3.clientId) !== null && _ref5 !== void 0 ? _ref5 : "";
23836
- if (clickedPlace !== undefined && _this14.clickCallback) {
23837
- _this14.clickCallback(clickedPlaceId);
24179
+ if (clickedPlace !== undefined && _this13.clickCallback) {
24180
+ _this13.clickCallback(clickedPlaceId);
23838
24181
  }
23839
24182
  case 11:
23840
24183
  return _context3.a(2);
@@ -23849,29 +24192,29 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
23849
24192
  }, {
23850
24193
  key: "onHover",
23851
24194
  value: function onHover() {
23852
- var _this15 = this;
24195
+ var _this14 = this;
23853
24196
  if (!this.enableHover) return;
23854
24197
  this.map.on("mousemove", "hoverable", function (e) {
23855
24198
  var _e$features;
23856
24199
  var feature = (_e$features = e.features) === null || _e$features === void 0 ? void 0 : _e$features.find(function (feature) {
23857
24200
  var _feature$properties$r, _feature$properties2;
23858
- return ((_feature$properties$r = feature.properties.ref) === null || _feature$properties$r === void 0 ? void 0 : _feature$properties$r.length) > 0 && ((_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.floor_key) === _this15.currentFloor;
24201
+ return ((_feature$properties$r = feature.properties.ref) === null || _feature$properties$r === void 0 ? void 0 : _feature$properties$r.length) > 0 && ((_feature$properties2 = feature.properties) === null || _feature$properties2 === void 0 ? void 0 : _feature$properties2.floor_key) === _this14.currentFloor;
23859
24202
  });
23860
24203
  var ref = feature === null || feature === void 0 ? void 0 : feature.properties.ref;
23861
24204
  if (ref != null && typeof ref === "string" && ref.length > 0) {
23862
- _this15.hoveredId = ref;
23863
- _this15.updateFiltersTo(_this15.currentFloor);
23864
- } else if (ref === undefined && _this15.hoveredId !== "unselected") {
23865
- _this15.hoveredId = "unselected";
23866
- _this15.updateFiltersTo(_this15.currentFloor);
24205
+ _this14.hoveredId = ref;
24206
+ _this14.updateFiltersTo(_this14.currentFloor);
24207
+ } else if (ref === undefined && _this14.hoveredId !== "unselected") {
24208
+ _this14.hoveredId = "unselected";
24209
+ _this14.updateFiltersTo(_this14.currentFloor);
23867
24210
  }
23868
24211
  });
23869
24212
 
23870
24213
  // When the mouse leaves the state-fill layer, update the feature state of the
23871
24214
  // previously hovered feature.
23872
24215
  this.map.on("mouseleave", "hoverable", function () {
23873
- _this15.hoveredId = "unselected";
23874
- _this15.updateFiltersTo(_this15.currentFloor);
24216
+ _this14.hoveredId = "unselected";
24217
+ _this14.updateFiltersTo(_this14.currentFloor);
23875
24218
  });
23876
24219
  }
23877
24220
  }, {
@@ -24272,7 +24615,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24272
24615
  }, {
24273
24616
  key: "addUserLocationTracking",
24274
24617
  value: function addUserLocationTracking(enableHighAccuracy, geoLocation, icon) {
24275
- var _this16 = this;
24618
+ var _this15 = this;
24276
24619
  var initialCoordinate = {
24277
24620
  lat: 0.0,
24278
24621
  lng: 0.0
@@ -24296,7 +24639,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24296
24639
  this.markerLayoutController.scheduleRelayout();
24297
24640
  var updateMarker = function updateMarker(position) {
24298
24641
  marker.setLngLat([position.coords.longitude, position.coords.latitude]);
24299
- _this16.markerLayoutController.scheduleRelayout();
24642
+ _this15.markerLayoutController.scheduleRelayout();
24300
24643
  };
24301
24644
  this.geoLocation = geoLocation !== null && geoLocation !== void 0 ? geoLocation : navigator.geolocation;
24302
24645
  this.watchPositionID = this.geoLocation.watchPosition(updateMarker, function (error) {
@@ -24392,7 +24735,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24392
24735
  key: "onWebGLContextLost",
24393
24736
  value: function onWebGLContextLost(e) {
24394
24737
  var _this$map2,
24395
- _this17 = this;
24738
+ _this16 = this;
24396
24739
  e.originalEvent.preventDefault();
24397
24740
  console.warn("Contexto WebGL perdido 😢");
24398
24741
 
@@ -24403,8 +24746,8 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24403
24746
  var _ext$restoreContext;
24404
24747
  canvas.addEventListener("webglcontextrestored", function () {
24405
24748
  console.debug("Contexto WebGL restaurado, forzando re-render");
24406
- _this17.map.triggerRepaint(); // forzar repaint
24407
- _this17.failedTiles.clear();
24749
+ _this16.map.triggerRepaint(); // forzar repaint
24750
+ _this16.failedTiles.clear();
24408
24751
  }, {
24409
24752
  once: true
24410
24753
  });
@@ -24480,7 +24823,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24480
24823
  }, {
24481
24824
  key: "subscribeToFailedTiles",
24482
24825
  value: function subscribeToFailedTiles() {
24483
- var _this18 = this;
24826
+ var _this17 = this;
24484
24827
  if (this.retryTimer) return;
24485
24828
 
24486
24829
  // Store bound functions for proper cleanup
@@ -24497,23 +24840,23 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24497
24840
  // exactly when tiles fail — gating on it would skip every tick during a
24498
24841
  // bad-network burst. The queue is left untouched so the tiles queued
24499
24842
  // mid-swap are still retried on the next tick.
24500
- if (!_this18.hasStyle()) {
24843
+ if (!_this17.hasStyle()) {
24501
24844
  return;
24502
24845
  }
24503
- if (!_this18.map.getSource("indoorequal")) {
24504
- _this18.failedTiles.clear();
24846
+ if (!_this17.map.getSource("indoorequal")) {
24847
+ _this17.failedTiles.clear();
24505
24848
  return;
24506
24849
  }
24507
- var source = _this18.map.getSource("indoorequal");
24850
+ var source = _this17.map.getSource("indoorequal");
24508
24851
  if (!source || source.type !== "vector") {
24509
- _this18.failedTiles.clear();
24852
+ _this17.failedTiles.clear();
24510
24853
  return;
24511
24854
  }
24512
24855
 
24513
24856
  // Process tiles and remove invalid ones
24514
24857
  var tilesToRetry = [];
24515
24858
  var tilesToRemove = [];
24516
- _this18.failedTiles.forEach(function (tile) {
24859
+ _this17.failedTiles.forEach(function (tile) {
24517
24860
  // Check if tile is still valid before attempting reload
24518
24861
  if (!tile || tile.state === "unloaded" || tile.state === "loading") {
24519
24862
  tilesToRemove.push(tile);
@@ -24531,14 +24874,14 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24531
24874
 
24532
24875
  // Remove invalid tiles from the set
24533
24876
  tilesToRemove.forEach(function (tile) {
24534
- return _this18.failedTiles["delete"](tile);
24877
+ return _this17.failedTiles["delete"](tile);
24535
24878
  });
24536
24879
 
24537
24880
  // Attempt to reload valid failed tiles
24538
24881
  var now = Date.now();
24539
24882
  tilesToRetry.forEach(function (tile) {
24540
- var _this18$tileRetryStat;
24541
- var retry = (_this18$tileRetryStat = _this18.tileRetryState.get(tile)) !== null && _this18$tileRetryStat !== void 0 ? _this18$tileRetryStat : {
24883
+ var _this17$tileRetryStat;
24884
+ var retry = (_this17$tileRetryStat = _this17.tileRetryState.get(tile)) !== null && _this17$tileRetryStat !== void 0 ? _this17$tileRetryStat : {
24542
24885
  attempts: 0,
24543
24886
  nextAttemptAt: 0,
24544
24887
  pending: false
@@ -24549,16 +24892,16 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24549
24892
  var onFailure = function onFailure(error) {
24550
24893
  var attempts = retry.attempts + 1;
24551
24894
  if (attempts >= MAX_TILE_RETRIES) {
24552
- _this18.debugLog("Tile reload failed ".concat(attempts, " times, dropping it from the retry queue"), error);
24553
- _this18.failedTiles["delete"](tile);
24554
- _this18.tileRetryState["delete"](tile);
24895
+ _this17.debugLog("Tile reload failed ".concat(attempts, " times, dropping it from the retry queue"), error);
24896
+ _this17.failedTiles["delete"](tile);
24897
+ _this17.tileRetryState["delete"](tile);
24555
24898
  return;
24556
24899
  }
24557
24900
 
24558
24901
  // Stay in the queue and try again once the backoff has elapsed.
24559
24902
  var backoffMs = TILE_RETRY_BASE_DELAY_MS * Math.pow(2, attempts - 1);
24560
- _this18.debugLog("Tile reload failed (attempt ".concat(attempts, "/").concat(MAX_TILE_RETRIES, "), retrying in ").concat(backoffMs, "ms"), error);
24561
- _this18.tileRetryState.set(tile, {
24903
+ _this17.debugLog("Tile reload failed (attempt ".concat(attempts, "/").concat(MAX_TILE_RETRIES, "), retrying in ").concat(backoffMs, "ms"), error);
24904
+ _this17.tileRetryState.set(tile, {
24562
24905
  attempts: attempts,
24563
24906
  nextAttemptAt: Date.now() + backoffMs,
24564
24907
  pending: false
@@ -24567,7 +24910,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24567
24910
  try {
24568
24911
  // Verify tile still exists and is in a retryable state
24569
24912
  if (tile && (tile.state === "errored" || tile.state === "expired")) {
24570
- _this18.tileRetryState.set(tile, map_objectSpread(map_objectSpread({}, retry), {}, {
24913
+ _this17.tileRetryState.set(tile, map_objectSpread(map_objectSpread({}, retry), {}, {
24571
24914
  pending: true
24572
24915
  }));
24573
24916
  // loadTile is async, so a rejection escapes this try/catch and has to be handled
@@ -24577,7 +24920,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
24577
24920
  // Loaded: forget the attempt history so a later failure starts from zero. The
24578
24921
  // tile leaves the queue through the tilesToRemove branch on the next tick,
24579
24922
  // once its state is no longer errored/expired.
24580
- _this18.tileRetryState["delete"](tile);
24923
+ _this17.tileRetryState["delete"](tile);
24581
24924
  })["catch"](onFailure);
24582
24925
  }
24583
24926
  } catch (error) {