@mapvx/web-components 0.0.20 → 0.0.22

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 (33) hide show
  1. package/dist/cjs/back_arrow-DNrh84z6.cjs +2 -0
  2. package/dist/cjs/base-floor-selector-DHIQdC2s.cjs +2 -0
  3. package/dist/cjs/class-map-BGLcy4Zq.cjs +12 -0
  4. package/dist/cjs/compact-floor-selector-BCLDxKto.cjs +151 -0
  5. package/dist/cjs/{consume-CE1TVLg-.cjs → consume-vuXzE_ul.cjs} +2 -2
  6. package/dist/cjs/custom-map-CqKD5Fum.cjs +90 -0
  7. package/dist/cjs/floor-selector-Bp_umxgG.cjs +15 -0
  8. package/dist/cjs/{lazy-load-DHtTuPrp.cjs → lazy-load-DWZU-puG.cjs} +2 -2
  9. package/dist/cjs/map-view-with-modal.cjs +45 -4
  10. package/dist/cjs/maplibre-gl-BNL6ASmq.cjs +2 -0
  11. package/dist/cjs/qr-modal-7T6NzJv6.cjs +16 -0
  12. package/dist/cjs/{route-options-H5wyZZ4h.cjs → route-options-DdF4AtDx.cjs} +3 -3
  13. package/dist/cjs/route-view-totems.cjs +7 -6
  14. package/dist/es/assets/back_arrow-B4vxoqtW.js +4 -0
  15. package/dist/es/assets/compact-floor-selector-D-LPjNVW.js +253 -0
  16. package/dist/es/assets/{components-y75xh-dL.js → components-BGe90NOX.js} +199 -44
  17. package/dist/es/assets/map-view-with-modal-CwE9e04X.js +274 -0
  18. package/dist/es/assets/maplibre-gl-BKzNcqp_.js +4 -0
  19. package/dist/es/assets/{route-view-totems-C8X6pCW7.js → route-view-totems-Cu8sG0kp.js} +19 -19
  20. package/dist/es/assets/{utils-C2SiQIHC.js → utils-4sQ3ZnpP.js} +345 -42
  21. package/dist/es/index.js +2 -2
  22. package/dist/es/route-view-totems.js +2 -2
  23. package/dist/iife/map-view-with-modal.js +290 -7
  24. package/dist/iife/route-view-totems.js +100 -17
  25. package/package.json +8 -7
  26. package/dist/cjs/back_arrow-Cb1GjmUe.cjs +0 -2
  27. package/dist/cjs/custom-map-C_Cpnb0N.cjs +0 -8
  28. package/dist/cjs/floor-selector-D6YcNzdw.cjs +0 -20
  29. package/dist/cjs/maplibre-gl-P-Xd6Hdn.cjs +0 -2
  30. package/dist/cjs/qr-modal-CkWqbgpG.cjs +0 -16
  31. package/dist/es/assets/back_arrow-CUOAm8Zc.js +0 -4
  32. package/dist/es/assets/map-view-with-modal-B5Mk49H1.js +0 -140
  33. package/dist/es/assets/maplibre-gl-KgJ_zm92.js +0 -4
@@ -1,5 +1,5 @@
1
- import { i, s as sdkContext } from './components-y75xh-dL.js';
2
- import { R as RollbarController } from './route-view-totems-C8X6pCW7.js';
1
+ import { i, s as sdkContext } from './components-BGe90NOX.js';
2
+ import { R as RollbarController } from './route-view-totems-Cu8sG0kp.js';
3
3
 
4
4
  var dist = {exports: {}};
5
5
 
@@ -5696,10 +5696,12 @@ function requireDist () {
5696
5696
  CssElement: () => (/* reexport */ cssCustomization_namespaceObject.CssElement),
5697
5697
  CssScreen: () => (/* reexport */ cssCustomization_namespaceObject.CssScreen),
5698
5698
  CssTheme: () => (/* reexport */ cssCustomization_namespaceObject.CssTheme),
5699
+ DaysOfTheWeek: () => (/* reexport */ openingHours_namespaceObject.DaysOfTheWeek),
5699
5700
  DrawRouteConfiguration: () => (/* reexport */ routeConfiguration_namespaceObject.DrawRouteConfiguration),
5700
5701
  FitOptions: () => (/* reexport */ fitOptions_namespaceObject.FitOptions),
5701
5702
  GetRouteConfiguration: () => (/* reexport */ routeConfiguration_namespaceObject.GetRouteConfiguration),
5702
5703
  GradientStyle: () => (/* reexport */ routeStyle_namespaceObject.GradientStyle),
5704
+ HealthResponse: () => (/* reexport */ healthResponse_namespaceObject.HealthResponse),
5703
5705
  IdLocation: () => (/* reexport */ routeConfiguration_namespaceObject.IdLocation),
5704
5706
  InnerFloor: () => (/* reexport */ innerFloors_namespaceObject.InnerFloor),
5705
5707
  Institution: () => (/* reexport */ Institution),
@@ -5719,21 +5721,29 @@ function requireDist () {
5719
5721
  MultiLanguage: () => (/* reexport */ multilanguage_namespaceObject.MultiLanguage),
5720
5722
  NestedCategory: () => (/* reexport */ categories_namespaceObject.NestedCategory),
5721
5723
  OpeningHours: () => (/* reexport */ openingHours_namespaceObject.OpeningHours),
5724
+ OpeningTime: () => (/* reexport */ openingHours_namespaceObject.OpeningTime),
5722
5725
  PhoneCategory: () => (/* reexport */ categories_namespaceObject.PhoneCategory),
5723
5726
  PlaceCategory: () => (/* reexport */ categories_namespaceObject.PlaceCategory),
5724
5727
  ProductCategory: () => (/* reexport */ categories_namespaceObject.ProductCategory),
5725
5728
  Property: () => (/* reexport */ property_namespaceObject.Property),
5729
+ RealtimeSchedule: () => (/* reexport */ transport_namespaceObject.RealtimeSchedule),
5726
5730
  RouteLocation: () => (/* reexport */ routeConfiguration_namespaceObject.RouteLocation),
5727
5731
  RouteStyle: () => (/* reexport */ routeStyle_namespaceObject.RouteStyle),
5732
+ Schedule: () => (/* reexport */ transport_namespaceObject.Schedule),
5728
5733
  SolidStyle: () => (/* reexport */ routeStyle_namespaceObject.SolidStyle),
5729
5734
  TextCategory: () => (/* reexport */ categories_namespaceObject.TextCategory),
5730
5735
  TextPosition: () => (/* reexport */ TextPosition),
5731
5736
  UrlCategory: () => (/* reexport */ categories_namespaceObject.UrlCategory),
5732
5737
  initializeSDK: () => (/* reexport */ initializeSDK),
5733
5738
  isBasicWithIcon: () => (/* reexport */ isBasicWithIcon),
5734
- isBasicWithLogo: () => (/* reexport */ isBasicWithLogo)
5739
+ isBasicWithLogo: () => (/* reexport */ isBasicWithLogo),
5740
+ loadCustomization: () => (/* reexport */ loadCustomization)
5735
5741
  });
5736
5742
 
5743
+ // NAMESPACE OBJECT: ./src/interfaces/healthResponse.ts
5744
+ var healthResponse_namespaceObject = {};
5745
+ __webpack_require__.r(healthResponse_namespaceObject);
5746
+
5737
5747
  // NAMESPACE OBJECT: ./src/models/marker.ts
5738
5748
  var marker_namespaceObject = {};
5739
5749
  __webpack_require__.r(marker_namespaceObject);
@@ -5766,6 +5776,13 @@ function requireDist () {
5766
5776
  n: () => (PropertyUtils)
5767
5777
  });
5768
5778
 
5779
+ // NAMESPACE OBJECT: ./src/models/transport.ts
5780
+ var transport_namespaceObject = {};
5781
+ __webpack_require__.r(transport_namespaceObject);
5782
+ __webpack_require__.d(transport_namespaceObject, {
5783
+ Q: () => (LzTransport)
5784
+ });
5785
+
5769
5786
  // NAMESPACE OBJECT: ./src/map/map.ts
5770
5787
  var map_namespaceObject = {};
5771
5788
  __webpack_require__.r(map_namespaceObject);
@@ -7351,7 +7368,7 @@ function requireDist () {
7351
7368
  countly_default().init({
7352
7369
  app_key: logger_countly.apiKey,
7353
7370
  url: logger_countly.url,
7354
- app_version: "2.16.0",
7371
+ app_version: "2.19.0-beta.2",
7355
7372
  session_update: 10,
7356
7373
  debug: false,
7357
7374
  require_consent: false,
@@ -7947,6 +7964,10 @@ function requireDist () {
7947
7964
  * Tags for place
7948
7965
  */
7949
7966
 
7967
+ /**
7968
+ * Metadata of the place.
7969
+ */
7970
+
7950
7971
  /**
7951
7972
  * Creates a new place instance with the parameters specified in the data.
7952
7973
  * @hidden
@@ -7997,6 +8018,7 @@ function requireDist () {
7997
8018
  this.properties = PropertyUtils.parseProperties((_rawPlace$properties2 = rawPlace.properties) !== null && _rawPlace$properties2 !== void 0 ? _rawPlace$properties2 : []);
7998
8019
  this.parentId = rawPlace.parent_id;
7999
8020
  this.parentType = rawPlace.parent_type;
8021
+ this.metadata = rawPlace.metadata;
8000
8022
  }
8001
8023
 
8002
8024
  /**
@@ -8123,6 +8145,8 @@ function requireDist () {
8123
8145
  }
8124
8146
  return properties;
8125
8147
  } catch (err) {
8148
+ console.log(err);
8149
+ console.log(response);
8126
8150
  return [];
8127
8151
  }
8128
8152
  }
@@ -8279,7 +8303,7 @@ function requireDist () {
8279
8303
  var Requester = /*#__PURE__*/function () {
8280
8304
  function Requester(lang) {
8281
8305
  requester_classCallCheck(this, Requester);
8282
- requester_defineProperty(this, "baseUrl", "https://us-central1-project-1393626302506343732.cloudfunctions.net/sdk/");
8306
+ requester_defineProperty(this, "baseUrl", "https://api.mapvx.com/sdk/");
8283
8307
  requester_defineProperty(this, "baseUrlMapVx", "https://api.mapvx.com/api/");
8284
8308
  this.lang = lang;
8285
8309
  }
@@ -8295,7 +8319,7 @@ function requireDist () {
8295
8319
  }
8296
8320
 
8297
8321
  /**
8298
- * Fetch information from a url.
8322
+ * Make a request using {@link fetch}.
8299
8323
  * @param resourceUrl Path to endpoint
8300
8324
  * @param params should have the token included plus any extra parameter that the url needs
8301
8325
  * @param options option for fetch method
@@ -8918,24 +8942,61 @@ function requireDist () {
8918
8942
  }
8919
8943
  return fetchCssCustomization;
8920
8944
  }()
8945
+ }, {
8946
+ key: "postHealth",
8947
+ value: function () {
8948
+ var _postHealth = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(token, healthPingId, placeId, totemId, status) {
8949
+ var requestData, params, options;
8950
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8951
+ while (1) switch (_context16.prev = _context16.next) {
8952
+ case 0:
8953
+ requestData = JSON.stringify({
8954
+ healthPingId: healthPingId,
8955
+ placeId: placeId,
8956
+ totemId: totemId,
8957
+ status: status
8958
+ });
8959
+ params = {
8960
+ token: token
8961
+ };
8962
+ options = {
8963
+ method: "POST",
8964
+ headers: {
8965
+ accept: "application/json",
8966
+ "Content-Type": "application/json"
8967
+ },
8968
+ body: requestData
8969
+ };
8970
+ return _context16.abrupt("return", Requester.fetchFromUrl(this.baseUrlMapVx + "health", params, options));
8971
+ case 4:
8972
+ case "end":
8973
+ return _context16.stop();
8974
+ }
8975
+ }, _callee16, this);
8976
+ }));
8977
+ function postHealth(_x36, _x37, _x38, _x39, _x40) {
8978
+ return _postHealth.apply(this, arguments);
8979
+ }
8980
+ return postHealth;
8981
+ }()
8921
8982
  }], [{
8922
8983
  key: "fetchFromUrl",
8923
8984
  value: (function () {
8924
- var _fetchFromUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(resourceUrl, params, options) {
8985
+ var _fetchFromUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(resourceUrl, params, options) {
8925
8986
  var finalUrl;
8926
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
8927
- while (1) switch (_context16.prev = _context16.next) {
8987
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
8988
+ while (1) switch (_context17.prev = _context17.next) {
8928
8989
  case 0:
8929
8990
  finalUrl = new URL(resourceUrl);
8930
8991
  finalUrl.search = new URLSearchParams(params).toString();
8931
- return _context16.abrupt("return", fetch(finalUrl.toString(), options));
8992
+ return _context17.abrupt("return", fetch(finalUrl.toString(), options));
8932
8993
  case 3:
8933
8994
  case "end":
8934
- return _context16.stop();
8995
+ return _context17.stop();
8935
8996
  }
8936
- }, _callee16);
8997
+ }, _callee17);
8937
8998
  }));
8938
- function fetchFromUrl(_x36, _x37, _x38) {
8999
+ function fetchFromUrl(_x41, _x42, _x43) {
8939
9000
  return _fetchFromUrl.apply(this, arguments);
8940
9001
  }
8941
9002
  return fetchFromUrl;
@@ -9331,7 +9392,7 @@ function requireDist () {
9331
9392
  Error.captureStackTrace(error);
9332
9393
  }
9333
9394
  _this4.logWarning(error, {
9334
- functionName: "getcache",
9395
+ functionName: "getCachedPlaces",
9335
9396
  id: id
9336
9397
  });
9337
9398
  }
@@ -9947,6 +10008,44 @@ function requireDist () {
9947
10008
  }
9948
10009
  return fetchAndParseCssCustomization;
9949
10010
  }()
10011
+ }, {
10012
+ key: "postAndParseHealthPing",
10013
+ value: function () {
10014
+ var _postAndParseHealthPing = repository_asyncToGenerator(/*#__PURE__*/repository_regeneratorRuntime().mark(function _callee16(healthPingId, placeId, totemId, status) {
10015
+ var response, responseData, data;
10016
+ return repository_regeneratorRuntime().wrap(function _callee16$(_context16) {
10017
+ while (1) switch (_context16.prev = _context16.next) {
10018
+ case 0:
10019
+ _context16.next = 2;
10020
+ return this.requester.postHealth(this.token, healthPingId, placeId, totemId, status);
10021
+ case 2:
10022
+ response = _context16.sent;
10023
+ if (response.ok) {
10024
+ _context16.next = 8;
10025
+ break;
10026
+ }
10027
+ _context16.next = 6;
10028
+ return response.json();
10029
+ case 6:
10030
+ responseData = _context16.sent;
10031
+ throw new Error("Post failed with status ".concat(response.status, ": ").concat(responseData));
10032
+ case 8:
10033
+ _context16.next = 10;
10034
+ return response.json();
10035
+ case 10:
10036
+ data = _context16.sent;
10037
+ return _context16.abrupt("return", data);
10038
+ case 12:
10039
+ case "end":
10040
+ return _context16.stop();
10041
+ }
10042
+ }, _callee16, this);
10043
+ }));
10044
+ function postAndParseHealthPing(_x21, _x22, _x23, _x24) {
10045
+ return _postAndParseHealthPing.apply(this, arguments);
10046
+ }
10047
+ return postAndParseHealthPing;
10048
+ }()
9950
10049
  }]);
9951
10050
  }(Loggeable);
9952
10051
  function map_typeof(o) { "@babel/helpers - typeof"; return map_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; }, map_typeof(o); }
@@ -10424,6 +10523,22 @@ function requireDist () {
10424
10523
  throw new Error("Failed to remove marker");
10425
10524
  }
10426
10525
  }
10526
+ }, {
10527
+ key: "removeAllMarkers",
10528
+ value: function removeAllMarkers() {
10529
+ try {
10530
+ this.markers.forEach(function (marker) {
10531
+ marker.remove();
10532
+ });
10533
+ this.markers = [];
10534
+ this.logEvent("removeAllMarkers");
10535
+ } catch (error) {
10536
+ this.logWarning(error, {
10537
+ functionName: "removeAllMarkers"
10538
+ });
10539
+ throw new Error("Failed to remove all markers");
10540
+ }
10541
+ }
10427
10542
 
10428
10543
  /**
10429
10544
  * Use it to change the current layer
@@ -12040,6 +12155,38 @@ function requireDist () {
12040
12155
  }
12041
12156
  return getCssCustomization;
12042
12157
  }()
12158
+ }, {
12159
+ key: "notifyHealth",
12160
+ value: function () {
12161
+ var _notifyHealth = sdk_asyncToGenerator(/*#__PURE__*/sdk_regeneratorRuntime().mark(function _callee14(healthPingId, placeId, totemId, status) {
12162
+ var health;
12163
+ return sdk_regeneratorRuntime().wrap(function _callee14$(_context14) {
12164
+ while (1) switch (_context14.prev = _context14.next) {
12165
+ case 0:
12166
+ _context14.prev = 0;
12167
+ _context14.next = 3;
12168
+ return this.repository.postAndParseHealthPing(healthPingId, placeId, totemId, status);
12169
+ case 3:
12170
+ health = _context14.sent;
12171
+ return _context14.abrupt("return", health);
12172
+ case 7:
12173
+ _context14.prev = 7;
12174
+ _context14.t0 = _context14["catch"](0);
12175
+ this.logWarning(_context14.t0, {
12176
+ functionName: "notifyHealth"
12177
+ });
12178
+ throw new Error("Failed to notify health");
12179
+ case 11:
12180
+ case "end":
12181
+ return _context14.stop();
12182
+ }
12183
+ }, _callee14, this, [[0, 7]]);
12184
+ }));
12185
+ function notifyHealth(_x19, _x20, _x21, _x22) {
12186
+ return _notifyHealth.apply(this, arguments);
12187
+ }
12188
+ return notifyHealth;
12189
+ }()
12043
12190
  }], [{
12044
12191
  key: "getLang",
12045
12192
  value: function getLang() {
@@ -12047,6 +12194,113 @@ function requireDist () {
12047
12194
  }
12048
12195
  }]);
12049
12196
  }(Loggeable);
12197
+ function update_css_slicedToArray(r, e) { return update_css_arrayWithHoles(r) || update_css_iterableToArrayLimit(r, e) || update_css_unsupportedIterableToArray(r, e) || update_css_nonIterableRest(); }
12198
+ function update_css_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."); }
12199
+ function update_css_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return update_css_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) ? update_css_arrayLikeToArray(r, a) : void 0; } }
12200
+ function update_css_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; }
12201
+ function update_css_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 = true, o = false; try { if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = true, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12202
+ function update_css_arrayWithHoles(r) { if (Array.isArray(r)) return r; }
12203
+ /**
12204
+ * Load a CSS customization of a project.
12205
+ *
12206
+ * This function create a new HTML Style Element and add it to the current document.
12207
+ * Also activate the customization adding the first theme name to the body of the document.
12208
+ *
12209
+ * @param data The CSS customization data.
12210
+ */
12211
+ function loadCustomization(data) {
12212
+ var style = document.createElement("style");
12213
+ style.textContent = "";
12214
+ for (var _i = 0, _Object$entries = Object.entries(data); _i < _Object$entries.length; _i++) {
12215
+ var _Object$entries$_i = update_css_slicedToArray(_Object$entries[_i], 2),
12216
+ themeName = _Object$entries$_i[0],
12217
+ themeData = _Object$entries$_i[1];
12218
+ var cssClass = loadTheme(themeName, themeData);
12219
+ style.textContent += cssClass;
12220
+ }
12221
+ document.head.appendChild(style);
12222
+ var firstThemeName = Object.keys(data).at(0);
12223
+ if (firstThemeName != null) {
12224
+ document.body.classList.add(firstThemeName);
12225
+ }
12226
+ }
12227
+
12228
+ /**
12229
+ * Process a theme.
12230
+ *
12231
+ * @param themeName The name of the Theme.
12232
+ * @param themeData The data of the Theme.
12233
+ * @returns A string with the processed theme to use on a CSS file.
12234
+ */
12235
+ function loadTheme(themeName, themeData) {
12236
+ var cssClass = ".".concat(themeName, " {\n");
12237
+ var definitions = themeData.definitions;
12238
+ if (definitions != null) {
12239
+ cssClass = loadDefinitions(definitions, cssClass);
12240
+ }
12241
+ for (var _i2 = 0, _Object$entries2 = Object.entries((_themeData$screens = themeData.screens) !== null && _themeData$screens !== void 0 ? _themeData$screens : {}); _i2 < _Object$entries2.length; _i2++) {
12242
+ var _themeData$screens;
12243
+ var _Object$entries2$_i = update_css_slicedToArray(_Object$entries2[_i2], 2),
12244
+ screenName = _Object$entries2$_i[0],
12245
+ screenData = _Object$entries2$_i[1];
12246
+ for (var _i3 = 0, _Object$entries3 = Object.entries(screenData); _i3 < _Object$entries3.length; _i3++) {
12247
+ var _Object$entries3$_i = update_css_slicedToArray(_Object$entries3[_i3], 2),
12248
+ componentName = _Object$entries3$_i[0],
12249
+ componentData = _Object$entries3$_i[1];
12250
+ for (var _i4 = 0, _Object$entries4 = Object.entries(componentData); _i4 < _Object$entries4.length; _i4++) {
12251
+ var _Object$entries4$_i = update_css_slicedToArray(_Object$entries4[_i4], 2),
12252
+ elementName = _Object$entries4$_i[0],
12253
+ elementData = _Object$entries4$_i[1];
12254
+ for (var _i5 = 0, _Object$entries5 = Object.entries(elementData); _i5 < _Object$entries5.length; _i5++) {
12255
+ var _Object$entries5$_i = update_css_slicedToArray(_Object$entries5[_i5], 2),
12256
+ propertyName = _Object$entries5$_i[0],
12257
+ propertyValue = _Object$entries5$_i[1];
12258
+ cssClass += " --".concat(screenName, "-").concat(componentName, "-").concat(elementName, "-").concat(propertyName, ": ").concat(propertyValue, ";\n");
12259
+ }
12260
+ }
12261
+ }
12262
+ }
12263
+ cssClass += "}\n";
12264
+ return cssClass;
12265
+ }
12266
+ /**
12267
+ * Process the definitions of a theme.
12268
+ *
12269
+ * @param definitions The definitions of the theme.
12270
+ * @param cssClass The string object that will contain the processed theme
12271
+ * @returns The cssClass string mutated with the processed definitions.
12272
+ */
12273
+ function loadDefinitions(definitions, cssClass) {
12274
+ for (var _i6 = 0, _Object$entries6 = Object.entries((_definitions$colors = definitions.colors) !== null && _definitions$colors !== void 0 ? _definitions$colors : {}); _i6 < _Object$entries6.length; _i6++) {
12275
+ var _definitions$colors;
12276
+ var _Object$entries6$_i = update_css_slicedToArray(_Object$entries6[_i6], 2),
12277
+ colorName = _Object$entries6$_i[0],
12278
+ colorData = _Object$entries6$_i[1];
12279
+ for (var _i7 = 0, _Object$entries7 = Object.entries(colorData); _i7 < _Object$entries7.length; _i7++) {
12280
+ var _Object$entries7$_i = update_css_slicedToArray(_Object$entries7[_i7], 2),
12281
+ colorIntensity = _Object$entries7$_i[0],
12282
+ colorValue = _Object$entries7$_i[1];
12283
+ cssClass += " --definitions-colors-".concat(colorName, "-").concat(colorIntensity, ": ").concat(colorValue, ";\n");
12284
+ }
12285
+ }
12286
+ for (var _i8 = 0, _Object$entries8 = Object.entries((_definitions$shadows = definitions.shadows) !== null && _definitions$shadows !== void 0 ? _definitions$shadows : {}); _i8 < _Object$entries8.length; _i8++) {
12287
+ var _definitions$shadows;
12288
+ var _Object$entries8$_i = update_css_slicedToArray(_Object$entries8[_i8], 2),
12289
+ shadowName = _Object$entries8$_i[0],
12290
+ shadowValue = _Object$entries8$_i[1];
12291
+ cssClass += " --definitions-shadows-".concat(shadowName, ": ").concat(shadowValue, ";\n");
12292
+ }
12293
+ for (var _i9 = 0, _Object$entries9 = Object.entries((_definitions$textFont = definitions.textFonts) !== null && _definitions$textFont !== void 0 ? _definitions$textFont : {}); _i9 < _Object$entries9.length; _i9++) {
12294
+ var _definitions$textFont;
12295
+ var _Object$entries9$_i = update_css_slicedToArray(_Object$entries9[_i9], 2),
12296
+ fontName = _Object$entries9$_i[0],
12297
+ fontValue = _Object$entries9$_i[1];
12298
+ cssClass += " --definitions-textFonts-".concat(fontName, ": ").concat(fontValue, ";\n");
12299
+ }
12300
+ return cssClass;
12301
+ }
12302
+
12303
+
12050
12304
 
12051
12305
 
12052
12306
 
@@ -12099,7 +12353,7 @@ class SDKController {
12099
12353
  this.host.addController(this);
12100
12354
  this.contextProvider = new i(this.host, {
12101
12355
  context: sdkContext,
12102
- initialValue: { enabledFloors: [], markers: [] }
12356
+ initialValue: { enabledFloors: [], markers: [], cameraInitialized: false }
12103
12357
  });
12104
12358
  }
12105
12359
  initialize(apiKey, locale, parentPlaceId) {
@@ -12180,7 +12434,8 @@ class SDKController {
12180
12434
  this.contextProvider.setValue({
12181
12435
  ...this.contextProvider.value,
12182
12436
  route,
12183
- enabledFloors
12437
+ enabledFloors,
12438
+ isRouteAnimating: false
12184
12439
  });
12185
12440
  } catch (error) {
12186
12441
  RollbarController.getInstance().warning("Error loading route", { error, originId, destinationId });
@@ -12293,8 +12548,11 @@ class SDKController {
12293
12548
  this.loadRoute(originId, destinationId, !!accessibleRoute);
12294
12549
  }
12295
12550
  setFloor(floorId) {
12296
- const { parentPlace } = this.contextProvider.value;
12551
+ const { parentPlace, currentFloor } = this.contextProvider.value;
12297
12552
  if (!parentPlace) return;
12553
+ if (currentFloor?.key === floorId) {
12554
+ return;
12555
+ }
12298
12556
  const floor = parentPlace.innerFloors.find((floor2) => floor2.key === floorId);
12299
12557
  if (!floor) return;
12300
12558
  this.contextProvider.setValue({
@@ -12314,9 +12572,31 @@ class SDKController {
12314
12572
  mapReady: ready
12315
12573
  });
12316
12574
  }
12575
+ setCameraInitialized(initialized) {
12576
+ this.contextProvider.setValue({
12577
+ ...this.contextProvider.value,
12578
+ cameraInitialized: initialized
12579
+ });
12580
+ }
12581
+ resetData() {
12582
+ this.contextProvider.setValue({
12583
+ ...this.contextProvider.value,
12584
+ originId: void 0,
12585
+ destinationId: void 0,
12586
+ destination: void 0,
12587
+ route: void 0,
12588
+ enabledFloors: this.enabledFloors,
12589
+ currentFloor: this.contextProvider.value.parentPlace?.innerFloors?.[0],
12590
+ markers: [],
12591
+ accessibleRoute: false,
12592
+ isRouteAnimating: false,
12593
+ cameraInitialized: false
12594
+ });
12595
+ this.host.requestUpdate();
12596
+ }
12317
12597
  }
12318
12598
 
12319
- const popupCSS = "@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.popup{background:#fff;filter:drop-shadow(0 1px 4px rgba(0,0,0,.2));padding:15px;border-radius:10px;border:1px solid #cccccc;min-width:180px;position:relative;transform:translateY(-50%)}.popup:after{content:\"\";position:absolute;bottom:-10px;left:50%;transform:translate(-50%);width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid white;z-index:1}.popup:before{content:\"\";position:absolute;bottom:-11px;left:50%;transform:translate(-50%);width:0;height:0;border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #cccccc;z-index:0}.popup-content{display:flex;flex-direction:column;gap:4px}.popup-logo{width:100%;object-fit:contain;object-position:center;height:60px;overflow:hidden;align-self:center;max-width:100%}.popup-name{position:relative;color:#000;text-align:center;letter-spacing:-1.1719905853px;margin-top:10px;max-width:250px;font:700 23px/23px Poppins,-apple-system,Roboto,Helvetica,sans-serif}.popup-category{color:#555;position:relative;color:#000;text-align:center;letter-spacing:-.5859952927px;white-space:nowrap;margin:5px 0 20px;font:400 12px/14px Poppins,-apple-system,Roboto,Helvetica,sans-serif}@media (max-width: 991px){.popup-category{margin-bottom:40px;white-space:initial}}";
12599
+ const popupCSS = "@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.popup{background:#fff;filter:drop-shadow(0 1px 4px rgba(0,0,0,.2));padding:15px;border-radius:10px;border:1px solid #cccccc;min-width:180px;position:relative;transform:translateY(-50%)}@media (max-width: 768px){.popup{padding:8px 0;min-width:160px;border-radius:8px}}.popup:after{content:\"\";position:absolute;bottom:-10px;left:50%;transform:translate(-50%);width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid white;z-index:1}.popup:before{content:\"\";position:absolute;bottom:-11px;left:50%;transform:translate(-50%);width:0;height:0;border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #cccccc;z-index:0}.popup-content{display:flex;flex-direction:column;gap:4px}.popup-logo{width:100%;object-fit:contain;object-position:center;height:60px;overflow:hidden;align-self:center;max-width:250px;max-height:100px}@media (max-width: 768px){.popup-logo{max-height:40px;max-width:120px}}.popup-name{position:relative;color:#000;text-align:center;letter-spacing:-1.1719905853px;margin-top:10px;max-width:250px;font:700 23px/23px Poppins,-apple-system,Roboto,Helvetica,sans-serif}@media (max-width: 768px){.popup-name{font-size:18px;line-height:18px;margin-top:6px;max-width:200px}}.popup-category{color:#555;position:relative;color:#000;text-align:center;letter-spacing:-.5859952927px;white-space:nowrap;margin:5px 0 20px;font:400 12px/14px Poppins,-apple-system,Roboto,Helvetica,sans-serif}@media (max-width: 991px){.popup-category{margin-bottom:40px;white-space:initial}}@media (max-width: 768px){.popup-category{margin-bottom:10px;white-space:initial;font-size:11px;line-height:13px}}";
12320
12600
 
12321
12601
  class PopupFactory {
12322
12602
  static create(data) {
@@ -12398,7 +12678,6 @@ class MarkerController {
12398
12678
  floorId = content.floorId;
12399
12679
  if (data instanceof distExports.LzPlace) {
12400
12680
  content.name = data.title;
12401
- content.category = data.localizedCategory ?? "";
12402
12681
  const service_tags = [
12403
12682
  "baños-general",
12404
12683
  "baño-accesible",
@@ -12427,6 +12706,20 @@ class MarkerController {
12427
12706
  } else {
12428
12707
  content.logo = data.logo?.light ?? "";
12429
12708
  }
12709
+ if (data.metadata?.category && data.metadata?.category?.length > 0) {
12710
+ let categories = [];
12711
+ data.metadata?.category?.forEach((category) => {
12712
+ const name = category;
12713
+ if (!categories.map((c) => c.toLocaleLowerCase()).includes(name.toLocaleLowerCase())) {
12714
+ categories.push(name);
12715
+ }
12716
+ });
12717
+ content.category = categories.join(", ");
12718
+ } else if (service && data.localizedCategory && data.category !== "1abcdefc29a36339150cf670") {
12719
+ content.category = data.localizedCategory;
12720
+ } else {
12721
+ content.category = "";
12722
+ }
12430
12723
  content.position = data.position;
12431
12724
  floorId = data.inFloor(floors)?.key;
12432
12725
  }
@@ -12457,7 +12750,7 @@ class MarkerController {
12457
12750
  });
12458
12751
  this.map?.setPlacesAsSelected(
12459
12752
  this.markersIds.map((m) => m.id),
12460
- "#9D55F9"
12753
+ "#3A0D7F"
12461
12754
  );
12462
12755
  const currentFloor = this.map?.getCurrentFloor();
12463
12756
  const coordinates = this.markersIds.filter((m) => m.floorId === currentFloor).map((m) => m.coordinate);
@@ -12509,9 +12802,8 @@ class RouteAnimationController {
12509
12802
  this.lzMap = map;
12510
12803
  }
12511
12804
  setCurrentFloor(floorId) {
12512
- this._currentMapFloor = floorId;
12513
12805
  const coordinates = this.route?.legs.flatMap(
12514
- (leg) => leg.steps.filter((step) => step.startInsideFloor === floorId).flatMap((step) => step.coordinates)
12806
+ (leg) => leg.steps.filter((step) => step.startInsideFloor === floorId || step.endInsideFloor === floorId).flatMap((step) => step.coordinates)
12515
12807
  ) ?? [];
12516
12808
  if (coordinates.length > 0) {
12517
12809
  this.lzMap?.fitCoordinates(coordinates, {
@@ -12523,6 +12815,7 @@ class RouteAnimationController {
12523
12815
  }
12524
12816
  });
12525
12817
  }
12818
+ this.handlers.onFloorChange(floorId);
12526
12819
  }
12527
12820
  setParentPlace(place) {
12528
12821
  this.parentPlace = place;
@@ -12533,26 +12826,27 @@ class RouteAnimationController {
12533
12826
  startRouteAnimation(route) {
12534
12827
  if (!this.connected || !this.lzMap || this.isAnimatingRoute) return;
12535
12828
  this.isAnimatingRoute = true;
12829
+ this.stepAnimationDate = /* @__PURE__ */ new Date();
12536
12830
  const animationConfig = {
12537
12831
  minimumSpeed: 20,
12538
12832
  callBack: (status) => {
12833
+ this.stepAnimationDate = /* @__PURE__ */ new Date();
12539
12834
  if (status.isFinished) {
12540
12835
  this.stopAnimatedRoute();
12541
12836
  this.handlers.onRouteAnimationFinished();
12837
+ return;
12542
12838
  }
12543
- const step = status.step;
12544
- if (!step || !this.parentPlace || !this._currentMapFloor) return;
12545
- const endFloor = step.endInsideFloor;
12546
- if (this._currentMapFloor != endFloor && endFloor) {
12547
- const lastFloor = this.parentPlace.innerFloors.find((floor) => floor.key === this._currentMapFloor);
12548
- const currentFloor = this.parentPlace.innerFloors.find((floor) => floor.key === endFloor);
12549
- this.setCurrentFloor(endFloor);
12550
- this.handlers.onFloorChange(endFloor);
12839
+ const startFloor = status.step?.startInsideFloor;
12840
+ const endFloor = status.step?.endInsideFloor;
12841
+ const newFloor = this.parentPlace?.innerFloors.find((floor) => floor.key === endFloor);
12842
+ if (this.isAnimatingRoute && startFloor && endFloor && startFloor !== endFloor) {
12843
+ const currentFloor = this.parentPlace?.innerFloors.find((floor) => floor.key === startFloor);
12551
12844
  this.lzMap?.pauseAnimateRoute();
12552
- const currrentDate = /* @__PURE__ */ new Date();
12553
- const timeDiff = currrentDate.getTime() - this.stepAnimationDate.getTime();
12554
- const isGoingUp = !!lastFloor && !!currentFloor && lastFloor.level < currentFloor.level;
12555
- const isElevator = step.elevatorStep;
12845
+ const currentDate = /* @__PURE__ */ new Date();
12846
+ const timeDiff = currentDate.getTime() - this.stepAnimationDate.getTime();
12847
+ this.stepAnimationDate = currentDate;
12848
+ const isGoingUp = !!currentFloor && !!newFloor && currentFloor.level < newFloor.level;
12849
+ const isElevator = status.step?.elevatorStep ?? false;
12556
12850
  let iconPath;
12557
12851
  if (isGoingUp) {
12558
12852
  iconPath = isElevator ? elevatorUpIcon : stairsUpIcon;
@@ -12561,7 +12855,7 @@ class RouteAnimationController {
12561
12855
  }
12562
12856
  const modal = {
12563
12857
  iconPath,
12564
- title: this.createChangeFloorMessage(isGoingUp, isElevator, currentFloor?.name ?? "")
12858
+ title: this.createChangeFloorMessage(isGoingUp, isElevator, newFloor?.name ?? "")
12565
12859
  };
12566
12860
  if (timeDiff > this.minUpdateTimeInterval) {
12567
12861
  this.showMapModal(modal);
@@ -12591,15 +12885,20 @@ class RouteAnimationController {
12591
12885
  if (firstFloor) {
12592
12886
  this.setCurrentFloor(firstFloor);
12593
12887
  }
12594
- this.lzMap.startAnimateRoute(route, drawingConfig, animationConfig);
12888
+ this.lzMap.startAnimateRouteV2(route, drawingConfig, animationConfig);
12595
12889
  this.route = route;
12596
12890
  this.handlers.onStartRouteAnimation();
12597
12891
  }
12598
12892
  removeRoute() {
12599
12893
  if (!this.lzMap) return;
12894
+ this.lzMap.pauseAnimateRoute();
12600
12895
  this.lzMap.removeRoute();
12601
12896
  this.route = void 0;
12897
+ if (this.animatedRoute) {
12898
+ clearTimeout(this.animatedRoute);
12899
+ }
12602
12900
  this.animatedRoute = void 0;
12901
+ this.isAnimatingRoute = false;
12603
12902
  }
12604
12903
  isAnimating() {
12605
12904
  return this.isAnimatingRoute;
@@ -12607,9 +12906,9 @@ class RouteAnimationController {
12607
12906
  stopAnimatedRoute() {
12608
12907
  if (this.isAnimatingRoute) {
12609
12908
  clearTimeout(this.animatedRoute);
12909
+ this.dismissChangeFloorAlert();
12610
12910
  this.animatedRoute = void 0;
12611
12911
  this.isAnimatingRoute = false;
12612
- this.dismissChangeFloorAlert();
12613
12912
  }
12614
12913
  }
12615
12914
  getCurrentRoute() {
@@ -12625,10 +12924,14 @@ class RouteAnimationController {
12625
12924
  }
12626
12925
  showMapModal(modal) {
12627
12926
  this.handlers.onShowMapModal(modal);
12628
- this.animatedRoute = setTimeout(() => {
12629
- this.lzMap?.resumeAnimateRoute();
12630
- this.dismissChangeFloorAlert();
12631
- }, this.minUpdateTimeInterval);
12927
+ this.host.requestUpdate();
12928
+ return new Promise((resolve) => {
12929
+ this.animatedRoute = setTimeout(() => {
12930
+ this.lzMap?.resumeAnimateRoute();
12931
+ this.dismissChangeFloorAlert();
12932
+ resolve();
12933
+ }, this.minUpdateTimeInterval);
12934
+ });
12632
12935
  }
12633
12936
  createChangeFloorMessage(isGoingUp, isElevator, floorName) {
12634
12937
  let isGoingUpStr;
@@ -12647,4 +12950,4 @@ class RouteAnimationController {
12647
12950
  }
12648
12951
 
12649
12952
  export { MarkerController as M, RouteAnimationController as R, SDKController as S };
12650
- //# sourceMappingURL=utils-C2SiQIHC.js.map
12953
+ //# sourceMappingURL=utils-4sQ3ZnpP.js.map
package/dist/es/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { b as RouteViewTotems } from './assets/route-view-totems-C8X6pCW7.js';
2
- export { M as MapViewWithModal } from './assets/map-view-with-modal-B5Mk49H1.js';
1
+ export { c as RouteViewTotems } from './assets/route-view-totems-Cu8sG0kp.js';
2
+ export { M as MapViewWithModal } from './assets/map-view-with-modal-CwE9e04X.js';
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- export { b as RouteViewTotems } from './assets/route-view-totems-C8X6pCW7.js';
2
- import './assets/utils-C2SiQIHC.js';
1
+ export { c as RouteViewTotems } from './assets/route-view-totems-Cu8sG0kp.js';
2
+ import './assets/utils-4sQ3ZnpP.js';
3
3
  //# sourceMappingURL=route-view-totems.js.map