venue-js 1.4.0 → 1.4.1

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.
@@ -1,4 +1,4 @@
1
1
  export { QueryObserver } from '@tanstack/query-core';
2
- export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-X4qpYAhF.mjs';
2
+ export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-CrxL_5B7.mjs';
3
3
  import 'geojson';
4
4
  import 'fuse.js';
@@ -1,4 +1,4 @@
1
1
  export { QueryObserver } from '@tanstack/query-core';
2
- export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-X4qpYAhF.js';
2
+ export { b5 as ALL_FEATURE_TYPES, h as AmenityFeature, ay as AmenityFeaturePopulated, f as AmenityGeometry, g as AmenityProperties, e as AnchorFeature, az as AnchorFeaturePopulated, A as AnchorGeometry, d as AnchorProperties, Y as AnyRelationshipFeature, B as BaseRelationshipProperties, b0 as DEFAULT_BASE_URL, j as DetailFeature, D as DetailGeometry, i as DetailProperties, am as ElementFeature, ak as ElementGeometry, al as ElementProperties, H as ElevatorRelationshipFeature, aJ as ElevatorRelationshipFeaturePopulated, G as ElevatorRelationshipProperties, X as EscalatorRelationshipFeature, aH as EscalatorRelationshipFeaturePopulated, W as EscalatorRelationshipProperties, ab as EventFeature, a9 as EventGeometry, aa as EventProperties, aQ as FeaturePopulatedResponseMap, aY as FeatureQueryOptions, av as FeatureResponseMap, aw as FeatureType, aW as FilterParams, aV as FindParams, l as FixtureFeature, aA as FixtureFeaturePopulated, F as FixtureGeometry, k as FixtureProperties, b4 as GEOJSON_FEATURE_TYPES, a$ as IMDFUnitCategory, b1 as IMDF_FEATURE_TYPES, b2 as IMDF_UNIT_CATEGORIES, I as Id, c as ImdfFeature, a_ as InternalFilterByType, aZ as InternalFindById, n as KioskFeature, aB as KioskFeaturePopulated, K as KioskGeometry, m as KioskProperties, aj as LabelFeature, ah as LabelGeometry, ai as LabelProperties, p as LevelFeature, aC as LevelFeaturePopulated, L as LevelGeometry, o as LevelProperties, a as Media, M as MediaFile, b as Model3d, au as Model3dFeature, as as Model3dGeometry, aP as Model3dPopulated, at as Model3dProperties, b3 as NONIMDF_FEATURE_TYPES, aU as NavigateClient, r as OccupantFeature, aD as OccupantFeaturePopulated, O as OccupantGeometry, b7 as OccupantHelpers, q as OccupantProperties, u as OpeningFeature, aE as OpeningFeaturePopulated, s as OpeningGeometry, t as OpeningProperties, x as OpeningTypeAndId, ar as Page, ax as PolygonalFeature, aR as PopulatableFeatureType, aX as PopulatedParams, ag as PrivilegeFeature, ae as PrivilegeGeometry, af as PrivilegeProperties, ad as PromotionFeature, ac as PromotionProperties, N as RampRelationshipFeature, aI as RampRelationshipFeaturePopulated, J as RampRelationshipProperties, v as RelationshipCategories, w as RelationshipDirectionTypes, z as RelationshipFeature, aF as RelationshipFeaturePopulated, y as RelationshipGeometry, aT as SearchClient, $ as SectionFeature, aL as SectionFeaturePopulated, Z as SectionGeometry, _ as SectionProperties, S as SingleGeometry, aq as SponsoredContentFeature, an as SponsoredContentLegacyType, ao as SponsoredContentPlacementType, ap as SponsoredContentStrapiV4ApiResponse, aK as StairRelationshipFeaturePopulated, Q as StairsRelationshipFeature, P as StairsRelationshipProperties, a8 as TaxonomyFeature, aO as TaxonomyFeaturePopulated, a6 as TaxonomyGeometry, a7 as TaxonomyProperties, T as TransalatableString, E as TraversalRelationshipFeature, aG as TraversalRelationshipFeaturePopulated, C as TraversalRelationshipProperties, a2 as UnitFeature, aM as UnitFeaturePopulated, a0 as UnitGeometry, a1 as UnitProperties, U as UnitTypeAndId, aS as VenueClientOptions, V as VenueDataClient, a5 as VenueFeature, aN as VenueFeaturePopulated, a3 as VenueGeometry, a4 as VenueProperties, b6 as defaultFeatureQueryOptionsMap, bj as fetchDeliveryApi, bk as fetchPreviewApi, bi as getDataClient, bn as getNavigateClient, bm as getSearchClient, b8 as isValidCoordinate, be as isValidLineString, bb as isValidLineStringCoordinates, bc as isValidMultiPolygon, ba as isValidMultiPolygonCoordinates, bf as isValidPoint, bd as isValidPolygon, b9 as isValidPolygonCoordinates, bg as matchFilter, bh as matchFilters, bl as safeFetchFeature } from '../index-CrxL_5B7.js';
3
3
  import 'geojson';
4
4
  import 'fuse.js';
@@ -794,7 +794,7 @@ var getSearchClient = ({ occupants, amenities }) => {
794
794
  var import_boolean_point_in_polygon4 = require("@turf/boolean-point-in-polygon");
795
795
 
796
796
  // src/data/navigate/graph/prepare.ts
797
- var import_lodash10 = __toESM(require("lodash"));
797
+ var import_lodash11 = __toESM(require("lodash"));
798
798
  var import_node_dijkstra = __toESM(require("node-dijkstra"));
799
799
  var import_distance3 = require("@turf/distance");
800
800
  var import_center5 = require("@turf/center");
@@ -918,7 +918,7 @@ var createElevatorNodeMap = (elevatorLikeRelationships, unitOpenings, options) =
918
918
  const level = levels.find((level2) => level2.id === destination.properties.level_id);
919
919
  return { opening, level };
920
920
  });
921
- const intermediaryOpeningAndLevels = intermediary.map((unitTypeAndId) => {
921
+ const intermediaryOpeningAndLevels = (intermediary || []).map((unitTypeAndId) => {
922
922
  const openings = unitOpenings[unitTypeAndId.id];
923
923
  const unit = units.find((unit2) => unit2.id === unitTypeAndId.id);
924
924
  const level = levels.find((level2) => level2.id === unit.properties.level_id);
@@ -962,11 +962,13 @@ var createEscalatorNodeMap = (relationships, options) => {
962
962
  const {
963
963
  properties: { direction, origin, destination }
964
964
  } = relationship;
965
- (0, import_set.default)(nodeMap, `${origin.id}.${destination.id}`, distanceOptions.baseDistance);
966
- if (direction === "undirected") {
967
- (0, import_set.default)(nodeMap, `${destination.id}.${origin.id}`, distanceOptions.baseDistance);
965
+ if (origin && destination) {
966
+ (0, import_set.default)(nodeMap, `${origin.id}.${destination.id}`, distanceOptions.baseDistance);
967
+ if (direction === "undirected") {
968
+ (0, import_set.default)(nodeMap, `${destination.id}.${origin.id}`, distanceOptions.baseDistance);
969
+ }
970
+ counter++;
968
971
  }
969
- counter++;
970
972
  }
971
973
  const t1 = performance.now();
972
974
  trace("nav", ` \u2502 \u251C\u2500 add ${counter} escalator relationships`, t1 - t0);
@@ -1019,7 +1021,9 @@ var createStairNodeMap = (elevatorLikeRelationships, unitOpenings, options) => {
1019
1021
  const intermediaryOpeningAndLevels = intermediary.map((unitTypeAndId) => {
1020
1022
  const openings2 = unitOpenings[unitTypeAndId.id];
1021
1023
  const unit = units.find((unit2) => unit2.id === unitTypeAndId.id);
1024
+ if (!unit) return [];
1022
1025
  const level = levels.find((level2) => level2.id === unit.properties.level_id);
1026
+ if (!level) return [];
1023
1027
  return openings2.map((opening) => ({ opening, level }));
1024
1028
  }).flat();
1025
1029
  const connections = [...intermediaryOpeningAndLevels, destinationOpeningAndLevel];
@@ -1091,17 +1095,19 @@ var createPOINodeMap = (features, getFeatureUnit, unitOpenings) => {
1091
1095
  features.forEach((feat) => {
1092
1096
  try {
1093
1097
  const locatedOnUnitId = getFeatureUnit(feat);
1094
- const openings = unitOpenings[locatedOnUnitId];
1095
- const center7 = (0, import_center4.center)(feat);
1096
- for (const opening of openings) {
1097
- try {
1098
- const openingCenter = (0, import_center4.center)(opening);
1099
- const dis = (0, import_distance2.distance)(center7, openingCenter, { units: "meters" }) + BASE_POI_BASEDISTANCE;
1100
- import_lodash9.default.set(nodeMap, `${opening.id}.${feat.id}`, dis);
1101
- import_lodash9.default.set(nodeMap, `${feat.id}.${opening.id}`, dis);
1102
- counter++;
1103
- } catch (err) {
1104
- console.log(err, opening);
1098
+ if (locatedOnUnitId) {
1099
+ const openings = unitOpenings[locatedOnUnitId] ?? [];
1100
+ const center7 = (0, import_center4.center)(feat);
1101
+ for (const opening of openings) {
1102
+ try {
1103
+ const openingCenter = (0, import_center4.center)(opening);
1104
+ const dis = (0, import_distance2.distance)(center7, openingCenter, { units: "meters" }) + BASE_POI_BASEDISTANCE;
1105
+ import_lodash9.default.set(nodeMap, `${opening.id}.${feat.id}`, dis);
1106
+ import_lodash9.default.set(nodeMap, `${feat.id}.${opening.id}`, dis);
1107
+ counter++;
1108
+ } catch (err) {
1109
+ console.log(err, opening);
1110
+ }
1105
1111
  }
1106
1112
  }
1107
1113
  } catch (err) {
@@ -1148,13 +1154,13 @@ var createUnitOpenings = (relationships, units, openings) => {
1148
1154
  });
1149
1155
  units.forEach((unit) => {
1150
1156
  const unitId = unit.id;
1151
- const connectedRelationshop = relationshipMap.get(unitId) || [];
1152
- const relationshipIntermediaryTypeAndId = connectedRelationshop.map(
1153
- (relationship) => relationship.properties.intermediary[0]
1157
+ const connectedRelationship = relationshipMap.get(unitId) || [];
1158
+ const relationshipIntermediaryTypeAndId = compact(connectedRelationship.map(
1159
+ (relationship) => relationship.properties.intermediary?.[0]
1154
1160
  // Assuming intermediary is always an array
1155
- );
1161
+ ));
1156
1162
  const relationshipIntermediary = relationshipIntermediaryTypeAndId.map(({ id }) => {
1157
- return openings.find((opening) => opening.id === id);
1163
+ return openings.find((opening) => !!opening && opening.id === id);
1158
1164
  });
1159
1165
  openingConnections[unitId] = (0, import_uniqBy.default)(
1160
1166
  [...openingConnections[unitId] || [], ...relationshipIntermediary],
@@ -1179,8 +1185,7 @@ var prepareGraph = (options) => {
1179
1185
  relationships = [],
1180
1186
  openings = [],
1181
1187
  units = [],
1182
- kiosks = [],
1183
- levels = []
1188
+ kiosks = []
1184
1189
  }
1185
1190
  } = options;
1186
1191
  const {
@@ -1189,7 +1194,7 @@ var prepareGraph = (options) => {
1189
1194
  ramp: rampRelationships = [],
1190
1195
  elevator: elevatorRelationships = [],
1191
1196
  stairs: stairsRelationships = []
1192
- } = import_lodash10.default.groupBy(relationships, "properties.category");
1197
+ } = import_lodash11.default.groupBy(relationships, "properties.category");
1193
1198
  const unitOpenings = createUnitOpenings(traversalRelationships, units, openings);
1194
1199
  const traversalNodeMap = createTraversalNodeMap(unitOpenings, options);
1195
1200
  const escalatorNodeMap = createEscalatorNodeMap(escalatorRelationships, options);
@@ -1204,7 +1209,7 @@ var prepareGraph = (options) => {
1204
1209
  unitOpenings,
1205
1210
  options
1206
1211
  );
1207
- const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids[0], unitOpenings);
1212
+ const amenityNodeMap = createPOINodeMap(amenities, (amenity) => amenity.properties.unit_ids?.[0] || null, unitOpenings);
1208
1213
  const anchorsNodeMap = createPOINodeMap(anchors, (anchor) => anchor.properties.unit_id, unitOpenings);
1209
1214
  const walkwayUnits = units.filter((unit) => unit.properties.category === "walkway");
1210
1215
  const kioskNodeMap = createPOINodeMap(kiosks, (kiosk) => findContainingUnit(kiosk, walkwayUnits)?.id, unitOpenings);
@@ -1248,7 +1253,7 @@ var prepareGraph = (options) => {
1248
1253
  };
1249
1254
 
1250
1255
  // src/data/navigate/steps/createStepUtils.ts
1251
- var import_lodash12 = require("lodash");
1256
+ var import_lodash13 = require("lodash");
1252
1257
  var import_intersectionBy = __toESM(require("lodash/intersectionBy"));
1253
1258
 
1254
1259
  // src/data/navigate/description/describe.ts
@@ -1272,7 +1277,7 @@ var describeHorizontalStep = (intermediary, toward, landmark) => {
1272
1277
  };
1273
1278
 
1274
1279
  // src/data/navigate/steps/path/index.ts
1275
- var import_lodash11 = __toESM(require("lodash"));
1280
+ var import_lodash12 = __toESM(require("lodash"));
1276
1281
 
1277
1282
  // src/data/navigate/constants.ts
1278
1283
  var OBSTACLE_FEATURE_TYPES = [
@@ -1915,7 +1920,7 @@ var createStepPathUtils = (options) => {
1915
1920
  const exceptionFeatureIds = [];
1916
1921
  const obstacles = findObstaclesFromWalkway(
1917
1922
  relatedWalkablePlatform,
1918
- import_lodash11.default.compact(exceptionFeatureIds)
1923
+ import_lodash12.default.compact(exceptionFeatureIds)
1919
1924
  );
1920
1925
  const line = findPathOnArea(from, to, {
1921
1926
  resolution,
@@ -1995,7 +2000,7 @@ var createStepUtils = (options) => {
1995
2000
  return intermediaryTypeAndId.map(({ id }) => findByIdSync(id));
1996
2001
  };
1997
2002
  const formatCategoryLabel = (category) => {
1998
- return (0, import_lodash12.capitalize)(category);
2003
+ return (0, import_lodash13.capitalize)(category);
1999
2004
  };
2000
2005
  const getNextStepIntermediary = (from, to, intermediary) => {
2001
2006
  if (to.type === "end") return to.name;
@@ -2254,7 +2259,9 @@ var createLandmarkUtils = (options) => {
2254
2259
  const locationType = occupant.properties.unit_id ? "unit" : "kiosk";
2255
2260
  const locationId = locationType === "unit" ? occupant.properties.unit_id : occupant.properties.kiosk_id;
2256
2261
  const location = locationType === "unit" ? findByIdSync(locationId) : findByIdSync(locationId);
2257
- const level = findByIdSync(location.properties.level_id);
2262
+ if (!location) return null;
2263
+ const level = location.properties.level_id ? findByIdSync(location.properties.level_id) : null;
2264
+ if (!level) return null;
2258
2265
  return {
2259
2266
  name: occupant.properties.name,
2260
2267
  point: (0, import_center8.center)(location.geometry).geometry.coordinates,
@@ -2264,7 +2271,7 @@ var createLandmarkUtils = (options) => {
2264
2271
  };
2265
2272
  };
2266
2273
  const landmarks = [
2267
- ...occupants.map(occupantToLandmark)
2274
+ ...compact(occupants.map(occupantToLandmark))
2268
2275
  ];
2269
2276
  const findNearbyLandmarks = (point2, levelId) => {
2270
2277
  if (point2 === null || levelId === null) return [];
@@ -2354,6 +2361,7 @@ var getNavigateClient = (options) => {
2354
2361
  trace("nav", "\u2713 findRoute", 0);
2355
2362
  const t02 = performance.now();
2356
2363
  const path = graph.path(routeOriginParam, routeDestinationParam);
2364
+ if (path === null) return { steps: [], distance: 0, duration: 0 };
2357
2365
  const t12 = performance.now();
2358
2366
  trace("nav", " \u251C\u2500 path (dijkstra)", t12 - t02);
2359
2367
  const waypoints = waypointUtils.toWaypoints(path);