@mappedin/mappedin-js 6.22.0 → 6.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +2 -2
- package/lib/esm/{GLTFExporter-OLQZHCIZ.js → GLTFExporter-6QDTTLXC.js} +1 -1
- package/lib/esm/{GLTFLoader-HBIO7H5X.js → GLTFLoader-IXRZMMXA.js} +1 -1
- package/lib/esm/{chunk-WQRLPX6X.js → chunk-7S4YASHU.js} +55 -55
- package/lib/esm/chunk-EJ222AP2.js +660 -0
- package/lib/esm/{chunk-JVDXHWBF.js → chunk-FZGRE4ZA.js} +1 -1
- package/lib/esm/{chunk-NGRMTFSH.js → chunk-SCXZVR4R.js} +1 -1
- package/lib/esm/{chunk-HYINSTT6.js → chunk-WMWAXV3L.js} +18 -18
- package/lib/esm/index.d.ts +129 -36
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-AMP3NR2S.js → inspector-G6D6KDLX.js} +2 -2
- package/lib/esm/{internal-IGFIO7YL.js → internal-UZ3JUV4F.js} +1 -1
- package/lib/esm/{src-PNDJGPPX.js → src-VJIN6IYN.js} +1 -1
- package/lib/esm/{text3d-4ZJNCN6Y.js → text3d-W6EBZB5H.js} +1 -1
- package/package.json +1 -1
- package/lib/esm/chunk-Q25YCNKX.js +0 -660
package/lib/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mappedin_mvf_v28 from "@mappedin/mvf-v2";
|
|
2
2
|
import { AnnotationCollection, AnnotationSymbol, AreaCollection, AreaId, BaseTextAreaProperties, Category, CategoryId, Connection as Connection$1, Details, EnterpriseCategory as EnterpriseCategory$1, EnterpriseCategoryId, EnterpriseLocation as EnterpriseLocation$1, EnterpriseLocationId, EnterpriseLocationInstance, EnterpriseTexture, EnterpriseVenue as EnterpriseVenue$1, EnterpriseVenueType, EntranceCollection, EntranceFeature, Facade as Facade$1, Feature as Feature$1, FeatureCollection as FeatureCollection$1, FloatingFloorTextProperties, FloorCollection, FloorId, FloorProperties, FloorStack as FloorStack$1, FloorTextCommonProperties, Geometry as Geometry$1, Hyperlink as Hyperlink$1, Image, Language, LineStringStyle, LineStringStyle as TMVFLineStringStyle, Location, LocationId, LocationLink, LocationSocial, LocationSocial as LocationSocial$1, LocationState, LocationState as LocationState$1, MVFv2_STANDARD_MVFv3, MultiPolygon as MultiPolygon$1, NavigationFlagDeclarations, NodeCollection, NodeId, ObstructionCollection, ObstructionCollection as ObstructionCollection$1, ObstructionFeature, ObstructionId, OpeningHoursSpecification, OperationHours, OperationHours as OperationHours$1, ParsedMVF, ParsedMVF as TMVF, ParsedMVFLocalePack, Point as Point$1, PointStyle, PointStyle as TMVFPointStyle, Polygon as Polygon$1, PolygonStyle, PolygonStyle as TMVFPolygonStyle, SiblingGroup, SiblingGroup as SiblingGroup$1, SpaceCollection, SpaceCollection as SpaceCollection$1, SpaceFeature, SpaceId, SpaceProperties, Style as TMVFStyle, StyleCollection, StyleCollection as TMVFStyleCollection, TilesetStyle } from "@mappedin/mvf-v2";
|
|
3
3
|
import { MVFv2_STANDARD_MVFv3 as MVFv2_STANDARD_MVFv3$1, ParsedMVF as ParsedMVF$1, RawMVF } from "@mappedin/mvf-v2/no-validator-lite";
|
|
4
4
|
import * as _mappedin_renderer_three0 from "@mappedin/renderer-three";
|
|
@@ -8,7 +8,7 @@ import { Group, Tween } from "@tweenjs/tween.js";
|
|
|
8
8
|
import { CustomLayerInterface, IControl, Map as Map$1, MapEventType } from "@mappedin/outdoor-context";
|
|
9
9
|
import { ANIMATION_TWEENS, PathWidth as PathWidth$2, PathWidth as PathWidth$3, enableTestMode } from "@mappedin/renderer-shared";
|
|
10
10
|
import { MatchInfo, SearchResult as SearchResult$1, Suggestion, Suggestion as Suggestion$1 } from "minisearch";
|
|
11
|
-
import * as
|
|
11
|
+
import * as three1 from "three";
|
|
12
12
|
import { AmbientLight, BatchedMesh, BatchedMeshGeometryRange, Box3, BufferAttribute, BufferGeometry, Camera as Camera$1, Color, DirectionalLight, Group as Group$1, Intersection, LineSegments, Matrix4, Mesh, MeshLambertMaterial, MeshLambertMaterialParameters, Object3D, Object3DEventMap, PerspectiveCamera, Plane, PlaneGeometry, Raycaster, Scene, ShaderMaterial, Texture, TubeGeometry, Vector2, Vector3, WebGLRenderer } from "three";
|
|
13
13
|
import { BatchedText, BatchedText as BatchedText$1, Text, Text as Text$1 } from "troika-three-text";
|
|
14
14
|
import "../../renderer-three/src/styles/interactions.scss";
|
|
@@ -4256,8 +4256,12 @@ declare class TokenManager {
|
|
|
4256
4256
|
/**
|
|
4257
4257
|
* Get an access token for the current set of API keys. If an access token was passed in, that
|
|
4258
4258
|
* will be returned instead.
|
|
4259
|
+
* @param forceRefresh - When `true`, bypass any cached token and fetch a fresh one. Useful for
|
|
4260
|
+
* recovering from a rejected (e.g. expired) token even if the local expiry bookkeeping still
|
|
4261
|
+
* considers it valid.
|
|
4262
|
+
* @default forceRefresh false
|
|
4259
4263
|
*/
|
|
4260
|
-
getAccessTokenAsync(): Promise<TokenWithExpiration>;
|
|
4264
|
+
getAccessTokenAsync(forceRefresh?: boolean): Promise<TokenWithExpiration>;
|
|
4261
4265
|
/**
|
|
4262
4266
|
* Get SAS tokens for all maps. If any SAS token are expired, all SAS tokens will be refreshed.
|
|
4263
4267
|
*/
|
|
@@ -5235,7 +5239,14 @@ declare class FloorObject implements FloorProperties {
|
|
|
5235
5239
|
buildGapFootprint(gapHeight: number, ceilingCuts: Feature$1<Polygon$1, any>[]): void;
|
|
5236
5240
|
getFootprintStyle(): LineStringStyleWithTopColor;
|
|
5237
5241
|
buildFootprint(): void;
|
|
5238
|
-
|
|
5242
|
+
/**
|
|
5243
|
+
* Toggle the consumer geometryText batch (`geometryText-${id}` — labelAll / Text3D.add).
|
|
5244
|
+
* Delegates to Text3DSystem.setBatchVisible so a toggle issued before the lazily-built batch
|
|
5245
|
+
* exists survives.
|
|
5246
|
+
*/
|
|
5247
|
+
setGeometryTextBatchVisible(visible: boolean): void;
|
|
5248
|
+
/** Toggle the baked floorText batch (`floortext-${id}`). Same durable-intent mechanism. */
|
|
5249
|
+
setFloorTextBatchVisible(visible: boolean): void;
|
|
5239
5250
|
}
|
|
5240
5251
|
//#endregion
|
|
5241
5252
|
//#region src/api-geojson/floor-stack-object.d.ts
|
|
@@ -9123,6 +9134,12 @@ declare const floorStateSchemaPartial: ZodObject<{
|
|
|
9123
9134
|
}, $strip>>;
|
|
9124
9135
|
text3d: ZodOptional<ZodObject<{
|
|
9125
9136
|
visible: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
9137
|
+
geometryText: ZodOptional<ZodDefault<ZodObject<{
|
|
9138
|
+
visible: ZodDefault<ZodBoolean>;
|
|
9139
|
+
}, $strip>>>;
|
|
9140
|
+
floorText: ZodOptional<ZodDefault<ZodObject<{
|
|
9141
|
+
visible: ZodDefault<ZodBoolean>;
|
|
9142
|
+
}, $strip>>>;
|
|
9126
9143
|
}, $strip>>;
|
|
9127
9144
|
models: ZodOptional<ZodObject<{
|
|
9128
9145
|
type: ZodOptional<ZodDefault<ZodLiteral<"floor.models">>>;
|
|
@@ -9201,6 +9218,12 @@ declare const floorStateSchemaStrict: ZodObject<{
|
|
|
9201
9218
|
}, $strict>;
|
|
9202
9219
|
text3d: ZodObject<{
|
|
9203
9220
|
visible: ZodDefault<ZodBoolean>;
|
|
9221
|
+
geometryText: ZodDefault<ZodObject<{
|
|
9222
|
+
visible: ZodDefault<ZodBoolean>;
|
|
9223
|
+
}, $strip>>;
|
|
9224
|
+
floorText: ZodDefault<ZodObject<{
|
|
9225
|
+
visible: ZodDefault<ZodBoolean>;
|
|
9226
|
+
}, $strip>>;
|
|
9204
9227
|
}, $strict>;
|
|
9205
9228
|
models: ZodObject<{
|
|
9206
9229
|
type: ZodDefault<ZodLiteral<"floor.models">>;
|
|
@@ -9379,7 +9402,9 @@ declare const markerStateSchema: ZodObject<{
|
|
|
9379
9402
|
declare const markerStateSchemaPartial: ZodObject<{
|
|
9380
9403
|
type: ZodOptional<ZodDefault<ZodLiteral<"marker">>>;
|
|
9381
9404
|
enabled: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
9405
|
+
interactive: ZodOptional<ZodDefault<ZodUnion<readonly [ZodBoolean, ZodLiteral<"pointer-events-auto">]>>>;
|
|
9382
9406
|
rank: ZodOptional<ZodCustom<TCollisionRankingTier | "initial", TCollisionRankingTier | "initial">>;
|
|
9407
|
+
occlude: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
9383
9408
|
placement: ZodOptional<ZodOptional<ZodUnion<readonly [ZodEnum<{
|
|
9384
9409
|
hidden: "hidden";
|
|
9385
9410
|
top: "top";
|
|
@@ -9403,7 +9428,6 @@ declare const markerStateSchemaPartial: ZodObject<{
|
|
|
9403
9428
|
"bottom-left": "bottom-left";
|
|
9404
9429
|
"bottom-right": "bottom-right";
|
|
9405
9430
|
}>>]>>>;
|
|
9406
|
-
interactive: ZodOptional<ZodDefault<ZodUnion<readonly [ZodBoolean, ZodLiteral<"pointer-events-auto">]>>>;
|
|
9407
9431
|
dynamicResize: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
9408
9432
|
zIndex: ZodOptional<ZodOptional<ZodNumber>>;
|
|
9409
9433
|
lowPriorityPin: ZodOptional<ZodOptional<ZodObject<{
|
|
@@ -9412,7 +9436,6 @@ declare const markerStateSchemaPartial: ZodObject<{
|
|
|
9412
9436
|
color: ZodOptional<ZodString>;
|
|
9413
9437
|
}, $strip>>>;
|
|
9414
9438
|
contentHTML: ZodOptional<ZodString>;
|
|
9415
|
-
occlude: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
9416
9439
|
animated: ZodOptional<ZodDefault<ZodBoolean>>;
|
|
9417
9440
|
}, $strip>;
|
|
9418
9441
|
/**
|
|
@@ -10859,7 +10882,9 @@ type TEvents = {
|
|
|
10859
10882
|
*/
|
|
10860
10883
|
'outdoor-view-loaded': undefined;
|
|
10861
10884
|
/**
|
|
10862
|
-
* Emitted when the outdoor
|
|
10885
|
+
* Emitted when the outdoor stylesheet finishes loading — on initial outdoor
|
|
10886
|
+
* load and again after `Outdoor.setStyle`. Does not fire for runtime style
|
|
10887
|
+
* mutations such as layer filters used by outdoor building covering.
|
|
10863
10888
|
*/
|
|
10864
10889
|
'outdoor-style-loaded': undefined;
|
|
10865
10890
|
/**
|
|
@@ -13009,8 +13034,8 @@ declare class Area extends DetailedMapData<AreaCollection['features'][number]> i
|
|
|
13009
13034
|
*/
|
|
13010
13035
|
get geoJSON(): {
|
|
13011
13036
|
properties: null;
|
|
13012
|
-
type:
|
|
13013
|
-
geometry:
|
|
13037
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
13038
|
+
geometry: _mappedin_mvf_v28.Polygon;
|
|
13014
13039
|
};
|
|
13015
13040
|
/** @internal */
|
|
13016
13041
|
get focusTarget(): this;
|
|
@@ -13112,8 +13137,8 @@ declare class Door extends DetailedMapData<EntranceFeature> implements IGeoJSOND
|
|
|
13112
13137
|
*/
|
|
13113
13138
|
get geoJSON(): {
|
|
13114
13139
|
properties: null;
|
|
13115
|
-
type:
|
|
13116
|
-
geometry:
|
|
13140
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
13141
|
+
geometry: _mappedin_mvf_v28.LineString;
|
|
13117
13142
|
};
|
|
13118
13143
|
/** @internal */
|
|
13119
13144
|
get focusTarget(): Coordinate;
|
|
@@ -13249,8 +13274,8 @@ declare class Space extends DetailedMapData<SpaceFeature> implements IGeoJSONDat
|
|
|
13249
13274
|
*/
|
|
13250
13275
|
get geoJSON(): {
|
|
13251
13276
|
properties: null;
|
|
13252
|
-
type:
|
|
13253
|
-
geometry:
|
|
13277
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
13278
|
+
geometry: _mappedin_mvf_v28.Point | _mappedin_mvf_v28.LineString | _mappedin_mvf_v28.Polygon;
|
|
13254
13279
|
};
|
|
13255
13280
|
/** @internal */
|
|
13256
13281
|
get focusTarget(): this | Coordinate;
|
|
@@ -13336,7 +13361,7 @@ declare class PointOfInterest extends DetailedMapData<FeatureCollection$1<Point$
|
|
|
13336
13361
|
*/
|
|
13337
13362
|
get geoJSON(): {
|
|
13338
13363
|
properties: null;
|
|
13339
|
-
type:
|
|
13364
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
13340
13365
|
geometry: Point$1;
|
|
13341
13366
|
};
|
|
13342
13367
|
/**
|
|
@@ -13450,8 +13475,8 @@ declare class Annotation extends DetailedMapData<AnnotationCollection['features'
|
|
|
13450
13475
|
*/
|
|
13451
13476
|
get geoJSON(): {
|
|
13452
13477
|
properties: null;
|
|
13453
|
-
type:
|
|
13454
|
-
geometry:
|
|
13478
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
13479
|
+
geometry: _mappedin_mvf_v28.Point;
|
|
13455
13480
|
};
|
|
13456
13481
|
/** @internal */
|
|
13457
13482
|
get focusTarget(): Coordinate;
|
|
@@ -13667,8 +13692,8 @@ declare class MapObject extends DetailedMapData<ObstructionFeature> implements I
|
|
|
13667
13692
|
*/
|
|
13668
13693
|
get geoJSON(): {
|
|
13669
13694
|
properties: null;
|
|
13670
|
-
type:
|
|
13671
|
-
geometry:
|
|
13695
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
13696
|
+
geometry: _mappedin_mvf_v28.LineString | _mappedin_mvf_v28.Polygon;
|
|
13672
13697
|
};
|
|
13673
13698
|
/** @internal */
|
|
13674
13699
|
get anchorTarget(): Coordinate;
|
|
@@ -13981,8 +14006,8 @@ declare class Node extends BaseMetaData implements IGeoJSONData, IFocusable, IAn
|
|
|
13981
14006
|
*/
|
|
13982
14007
|
get geoJSON(): {
|
|
13983
14008
|
properties: null;
|
|
13984
|
-
type:
|
|
13985
|
-
geometry:
|
|
14009
|
+
type: _mappedin_mvf_v28.FeatureType;
|
|
14010
|
+
geometry: _mappedin_mvf_v28.Point;
|
|
13986
14011
|
};
|
|
13987
14012
|
/** @internal */
|
|
13988
14013
|
get focusTarget(): Coordinate;
|
|
@@ -14705,9 +14730,9 @@ declare class EnterpriseVenue extends BaseMetaData implements EnterpriseVenue$1
|
|
|
14705
14730
|
//#endregion
|
|
14706
14731
|
//#region src/query/types.d.ts
|
|
14707
14732
|
/**
|
|
14708
|
-
*
|
|
14733
|
+
* The map data object types that can be passed in the `include` array of a {@link Query.nearest} search.
|
|
14709
14734
|
*/
|
|
14710
|
-
type TQueriables = PointOfInterest | Door | Annotation | Node | Space | EnterpriseLocation;
|
|
14735
|
+
type TQueriables = PointOfInterest | Door | Annotation | Node | Space | EnterpriseLocation | MapObject | LocationProfile | Connection | Area | Facade;
|
|
14711
14736
|
/**
|
|
14712
14737
|
* Types that can be returned from Query.at() - geometry objects at a coordinate
|
|
14713
14738
|
*/
|
|
@@ -16038,7 +16063,7 @@ declare class MapData {
|
|
|
16038
16063
|
* console.log(`Current language: ${language.name} (${language.code})`);
|
|
16039
16064
|
* ```
|
|
16040
16065
|
*/
|
|
16041
|
-
get currentLanguage():
|
|
16066
|
+
get currentLanguage(): _mappedin_mvf_v28.Language | undefined;
|
|
16042
16067
|
/**
|
|
16043
16068
|
* Gets the natural bearing of the map.
|
|
16044
16069
|
*
|
|
@@ -17312,7 +17337,7 @@ declare class ModelComponent {
|
|
|
17312
17337
|
/**
|
|
17313
17338
|
* The model scene that was loaded from GLB, minus the hole-fill-mesh business.
|
|
17314
17339
|
*/
|
|
17315
|
-
get modelScene(): Object3D<
|
|
17340
|
+
get modelScene(): Object3D<three1.Object3DEventMap> | Geometry3DObject3D | undefined;
|
|
17316
17341
|
position: Vector3;
|
|
17317
17342
|
get altitude(): number;
|
|
17318
17343
|
set altitude(value: number);
|
|
@@ -17842,7 +17867,7 @@ declare class CustomGeometryComponent {
|
|
|
17842
17867
|
get opacity(): number;
|
|
17843
17868
|
color: Color;
|
|
17844
17869
|
setColor(color: string): void;
|
|
17845
|
-
get position():
|
|
17870
|
+
get position(): three1.Vector3;
|
|
17846
17871
|
get altitude(): number;
|
|
17847
17872
|
set altitude(value: number);
|
|
17848
17873
|
get renderOrder(): number;
|
|
@@ -19241,7 +19266,7 @@ declare class CameraSystem extends PubSub<CameraEvents> {
|
|
|
19241
19266
|
convertZoomLevelToAltitude: (zoomLevel: number) => number;
|
|
19242
19267
|
private completeTween;
|
|
19243
19268
|
static CAMERA_FRAME_PADDING_SIDES: readonly ["top", "bottom", "left", "right"];
|
|
19244
|
-
debugContainer: Object3D<
|
|
19269
|
+
debugContainer: Object3D<three1.Object3DEventMap>;
|
|
19245
19270
|
getCameraFrameForCoordinates(pointCloud: Vector3[], options: CameraFocusOnOptions & {
|
|
19246
19271
|
padding: InsetPadding$2;
|
|
19247
19272
|
}): {
|
|
@@ -19883,6 +19908,37 @@ declare class GeometryInFocusSystem extends PubSub<{
|
|
|
19883
19908
|
}
|
|
19884
19909
|
//#endregion
|
|
19885
19910
|
//#region ../renderer-three/src/systems/outdoor-layers/system.d.ts
|
|
19911
|
+
/**
|
|
19912
|
+
* Hides OSM basemap features (buildings) sitting under indoor footprints by writing a single cumulative
|
|
19913
|
+
* exclusion filter (`['!', ['in', ['id'], ['literal', ids]]]`) onto the target MapLibre layers.
|
|
19914
|
+
*
|
|
19915
|
+
* The design is dictated by how vector tiles and features relate:
|
|
19916
|
+
* - Tiles are a fixed `z/x/y` world grid; a tile's bounds are pure arithmetic (`tileToLngLatBBox`).
|
|
19917
|
+
* Footprints are world-fixed too, so the tiles that can contain a covered building are static —
|
|
19918
|
+
* only a tile overlapping a footprint can add a match (`#isTileRelevant` gate on `sourcedata`).
|
|
19919
|
+
* - Features live *inside* tiles, so new geometry only arrives via a tile load — hence recompute is
|
|
19920
|
+
* driven by `sourcedata` (with `e.tile`), not the camera. Do not gate on MapLibre `load`: that event
|
|
19921
|
+
* fires once on first settle and never again; `sourcedata` already covers pre- and post-load tiles,
|
|
19922
|
+
* and `queryRenderedFeatures` returns `[]` (safe no-op) before the style exists.
|
|
19923
|
+
* - A feature larger than a tile is clipped into per-tile fragments that all share one `id`, and
|
|
19924
|
+
* `queryRenderedFeatures` returns them per-tile (duplicate ids). So a non-match by id can flip to a
|
|
19925
|
+
* match once a *different, later-rendered* fragment arrives — non-matches must stay retryable, and
|
|
19926
|
+
* they cannot be cached by id alone.
|
|
19927
|
+
* - The layer filter is applied at bucket-populate, so a hidden feature drops out of
|
|
19928
|
+
* `queryRenderedFeatures`. `#matchedFeatureIds` is therefore the *only* record of what's hidden: it
|
|
19929
|
+
* accumulates, every `setFilter` writes the full cumulative set, and it resets only on genuine
|
|
19930
|
+
* invalidation (new polygons / style change) — otherwise prior matches un-hide and the
|
|
19931
|
+
* `setFilter → source reload → sourcedata` loop never converges.
|
|
19932
|
+
* - `queryRenderedFeatures` reflects *rendered* tiles, but `sourcedata` fires on *load*; the gap is
|
|
19933
|
+
* render lag, covered by {@link OUTDOOR_COVERING_DEBOUNCE_MS} that coalesces the tile stream.
|
|
19934
|
+
* The window stays short because matches accumulate and `setFilter` is skipped when nothing new
|
|
19935
|
+
* matched — a short debounce only batches tile arrivals, it cannot un-hide or thrash.
|
|
19936
|
+
* - The per-footprint sweep is chunked one-polygon-per-`idleQueue`-job so a many-footprint venue never
|
|
19937
|
+
* blocks the frame in a single synchronous pass. A live compute session is aborted (partial matches
|
|
19938
|
+
* rolled back, queue cleared) when a new compute takes over, so a novel tile is never lost to a
|
|
19939
|
+
* dropped in-flight request; the cumulative `setFilter` still runs once, in the queue's
|
|
19940
|
+
* `onComplete`, and only on successful completion (never after abort).
|
|
19941
|
+
*/
|
|
19886
19942
|
declare class OutdoorLayers extends PubSub<{}> {
|
|
19887
19943
|
#private;
|
|
19888
19944
|
idleQueue: IdleQueue;
|
|
@@ -19949,9 +20005,28 @@ declare class Text3DSystem extends PubSub<{
|
|
|
19949
20005
|
textSet: Set<string>;
|
|
19950
20006
|
batchedTextMap: Map<GroupContainerObject3D, Promise<BatchedText>>;
|
|
19951
20007
|
private resolvedBatchedTextMap;
|
|
20008
|
+
/**
|
|
20009
|
+
* Desired `BatchedText.visible` per parent group. Batches are created lazily over render
|
|
20010
|
+
* frames, so a toggle issued before the batch exists must be remembered here (not on the
|
|
20011
|
+
* generic GroupContainer) and applied at creation. Default when unset: `true`.
|
|
20012
|
+
*/
|
|
20013
|
+
private batchVisibleByGroup;
|
|
19952
20014
|
useWorker: boolean;
|
|
19953
20015
|
remove(id: string): void;
|
|
19954
20016
|
getBatchedText(group: GroupContainerObject3D): BatchedText | undefined;
|
|
20017
|
+
/**
|
|
20018
|
+
* Desired visibility for the `BatchedText` parented to `group`. Survives until the batch is
|
|
20019
|
+
* created; also applies immediately if a batch (or its promise) already exists.
|
|
20020
|
+
* @param group - Parent group container that owns the batch
|
|
20021
|
+
* @param visible - Whether the batch should be visible
|
|
20022
|
+
*/
|
|
20023
|
+
setBatchVisible(group: GroupContainerObject3D, visible: boolean): void;
|
|
20024
|
+
/**
|
|
20025
|
+
* Returns the durable desired visibility for `group`'s batch (`true` when never set).
|
|
20026
|
+
* @param group - Parent group container that owns the batch
|
|
20027
|
+
* @returns Desired batch visibility
|
|
20028
|
+
*/
|
|
20029
|
+
getBatchVisible(group: GroupContainerObject3D): boolean;
|
|
19955
20030
|
constructor(rendererState: RendererState, convertTo3DMapPosition: Core['convertTo3DMapPosition'], useWorker?: boolean);
|
|
19956
20031
|
update(cameraRotationRadians: number): Promise<void[] | undefined>;
|
|
19957
20032
|
/**
|
|
@@ -21507,6 +21582,14 @@ type RendererCoreOptions$2 = Partial<{
|
|
|
21507
21582
|
style?: string;
|
|
21508
21583
|
enabled: boolean;
|
|
21509
21584
|
lowDpi?: boolean;
|
|
21585
|
+
/**
|
|
21586
|
+
* Called when an outdoor tile request is rejected with an auth error (HTTP 401/403),
|
|
21587
|
+
* typically because the tiles token has expired. Should resolve to a fresh tiles token
|
|
21588
|
+
* (or `undefined` if one cannot be obtained). The renderer swaps the new token into the
|
|
21589
|
+
* tile request headers and reloads the outdoor source so the basemap recovers without a
|
|
21590
|
+
* page reload.
|
|
21591
|
+
*/
|
|
21592
|
+
refreshToken?: () => Promise<string | undefined>;
|
|
21510
21593
|
};
|
|
21511
21594
|
gl?: WebGLRenderingContext;
|
|
21512
21595
|
map?: Map$1;
|
|
@@ -21942,7 +22025,9 @@ type MapEvent = {
|
|
|
21942
22025
|
*/
|
|
21943
22026
|
'outdoor-view-loaded': undefined;
|
|
21944
22027
|
/**
|
|
21945
|
-
* If outdoor view is enabled,
|
|
22028
|
+
* If outdoor view is enabled, fired when the outdoor stylesheet finishes
|
|
22029
|
+
* loading (initial load and after `setStyle`). Not fired for runtime style
|
|
22030
|
+
* mutations such as `setFilter` from outdoor building covering.
|
|
21946
22031
|
*/
|
|
21947
22032
|
'outdoor-style-loaded': undefined;
|
|
21948
22033
|
/**
|
|
@@ -22232,21 +22317,29 @@ declare const MAPPEDIN_COLORS: {
|
|
|
22232
22317
|
//#endregion
|
|
22233
22318
|
//#region ../packages/common/Mappedin.Logger.d.ts
|
|
22234
22319
|
/**
|
|
22235
|
-
* SDK logging verbosity. Ordered from most verbose to least
|
|
22236
|
-
* enables that level plus every level after it.
|
|
22320
|
+
* SDK logging verbosity. Ordered from most verbose to least (`debug < info < warn < error`) —
|
|
22321
|
+
* selecting a level enables that level plus every level after it. `SILENT` suppresses all output.
|
|
22237
22322
|
*/
|
|
22238
22323
|
declare enum E_SDK_LOG_LEVEL {
|
|
22324
|
+
/** @deprecated Renamed to {@link E_SDK_LOG_LEVEL.DEBUG}. Kept as an alias for back-compat. */
|
|
22239
22325
|
LOG = 0,
|
|
22240
|
-
|
|
22241
|
-
|
|
22242
|
-
|
|
22326
|
+
DEBUG = 0,
|
|
22327
|
+
INFO = 1,
|
|
22328
|
+
WARN = 2,
|
|
22329
|
+
ERROR = 3,
|
|
22330
|
+
SILENT = 4,
|
|
22243
22331
|
}
|
|
22332
|
+
type TLogLevelName = 'debug' | 'info' | 'log' | 'warn' | 'error' | 'silent';
|
|
22333
|
+
/** Resolve a case-insensitive level name to an {@link E_SDK_LOG_LEVEL}; `undefined` if unrecognized. */
|
|
22334
|
+
declare function parseLogLevel(level: string): E_SDK_LOG_LEVEL | undefined;
|
|
22244
22335
|
/**
|
|
22245
22336
|
* Set the SDK's global log verbosity. Lower levels include all higher-numbered levels;
|
|
22246
|
-
* `SILENT` suppresses all output.
|
|
22247
|
-
* @param level - The desired verbosity
|
|
22337
|
+
* `SILENT` suppresses all output. Defaults to `INFO` (`DEBUG` is opt-in).
|
|
22338
|
+
* @param level - The desired verbosity: a case-insensitive level name (`'debug'`, `'info'`,
|
|
22339
|
+
* `'warn'`, `'error'`, `'silent'`) or an {@link E_SDK_LOG_LEVEL} value. An unrecognized or
|
|
22340
|
+
* out-of-range value warns rather than silently no-ops.
|
|
22248
22341
|
*/
|
|
22249
|
-
declare function setLoggerLevel(level: E_SDK_LOG_LEVEL): void;
|
|
22342
|
+
declare function setLoggerLevel(level: E_SDK_LOG_LEVEL | TLogLevelName): void;
|
|
22250
22343
|
//#endregion
|
|
22251
22344
|
//#region src/utils/convert-renderer-core-options.d.ts
|
|
22252
22345
|
/**
|
|
@@ -22765,4 +22858,4 @@ declare const getVersion: () => string | undefined;
|
|
|
22765
22858
|
*/
|
|
22766
22859
|
declare const show3dMapGeojson: (el: HTMLElement, mapData: MapData, options?: TShow3DMapOptions) => Promise<MapView>;
|
|
22767
22860
|
//#endregion
|
|
22768
|
-
export { ACTION_TYPE, ANIMATION_TWEENS, type AddText3DOptions, type AddText3DPointOptions, type Analytics, Annotation, Area, type AutoElements, BBox, BEARING_TYPE, CONNECTION_TYPE, type Camera, type CameraBounds, type CameraTransform, type CaptureEventsPayloadMap, type ColorString, Connection, Coordinate, DOORS, type Debug, type DebugState, DetailedMapData, Directions, Door, E_SDK_LOG_LEVEL, type EasingCurve, EnterpriseCategory, EnterpriseLocation, EnterpriseVenue, type EnvMapOptions, type Environment, type Exporter, Facade, Feature, FeatureCollection, Floor, FloorStack, type FootprintConfig, GeoJSON$1 as GeoJSON, GeoJsonGeometryTypes, GeoJsonObject, GeoJsonProperties, GeoJsonTypes, Geometry, GeometryCollection, GeometryObject, type GlobalState, Hyperlink, type IAnchorable, type IFocusable, type IGeoJSONData, type INavigatable, type ISystemPlugin, type Image3D, type Image3DView, ImageMetaData, type InitializeModelState, type InitializeText3DState, type InsetPadding, type InsetPaddingOption, type InterpolateOn, type Interpolation, type Label, type LabelAppearance, type LabelTextPlacement, type Labels, LineString, type LineStyle, LocationCategory, LocationProfile, type LocationSocial, type LocationState, MAPPEDIN_COLORS, type MapData, type MapDataElements, type MapElementToGetRenderedState, type MapElementToGetState, type MapElementToUpdateState, type MapElementsWithState, type MapFeatureOfType, MapObject, MapView, type MapViewElements, type MapViewState, type MappedinError, type MappedinRenderError, type Marker, type Markers, type MatchInfo, type Model, type Models, type MultiFloorViewEffectState, MultiLineString, MultiPoint, MultiPolygon, type Navigation, type NavigationState, Node, type OpeningHours, type OperationHours, type Outdoor, type OutlinesOptions, type PaintStyle, type Path, type PathSegment$1 as PathSegment, type PathWidth, type Paths, type PixelWidth, type Places, Point, PointOfInterest, Polygon, type Position, type PubSub, type Query, type RendererCoreOptions, type Search, type SearchOptions, type SearchResult, type SearchResultEnterpriseCategory, type SearchResultEnterpriseLocations, type SearchResultItem, type SearchResultPlaces, type Shading, type Shape, type Shapes, type SiblingGroup, Space, type Style, type Suggestion, type TActionType, type TAddImageOptions, type TAddLabelOptions, type TAddMarkerOptions, type TAddModel, type TAddModelOptions, type TAddPathOptions, type TAddText3DAnchorableOptions, type TAddText3DOptions, type TAnalyticsUpdateState, type TAnimateStateResult, type TAnimationOptions, type TAntialiasingOptions, type TBearingType, type TCameraAnimationOptions, type TCameraInteractionsSetOptions, type TCameraTarget, type TCancellablePromise, type TClickPayload, type TCollisionRankingTier, type TConnectionPathOptions, type TConnectionType, type TCoordinateParams, type TCreateMarker, type TDirectionInstruction, type TDirectionInstructionAction, type TDirectionZone, type TDoorsState, type TDoorsUpdateState, type TEasingFunction, type TEventPayload, type TEvents, type TExperimentalDashOptions, type TFacadeState, type TFacadeUpdateState, type TFindNearestOptions, type TFindNearestResult, type TFindPreferredLanguageInVenueOptions, type TFloorAltitudeData, type TFloorChangePayload, type TFloorChangeReason, type TFloorState, type TFloorUpdateState, type TFocusOnOptions, type TFocusTarget, type TGeometryState, type TGeometryUpdateState, type TGetDirectionsOptions, type TGetMapDataOptions, type TGetMapDataSharedOptions, type TGetMapDataWithAccessTokenOptions, type TGetMapDataWithCredentialsOptions, type TGetState, type THoverPayload, type THydrateMapDataBundle, type TImage3DState as TImageState, type TImage3DUpdateState as TImageUpdateState, type TLabelState, type TLabelUpdateState, type TMVF, type TMVFLineStringStyle, type TMVFPointStyle, type TMVFPolygonStyle, type TMVFStyle, type TMVFStyleCollection, type TMapDataEvents, type TMapDataObjectTypes, type TMapFeatureTypes, type TMapViewObjectTypes, type TMarkerPlacement, type TMarkerState, type TMarkerUpdateState, type TModelState, type TModelUpdateState, type TMultiFloorViewOptions, type TNavigationMarker, type TNavigationMarkerType, type TNavigationOptions, type TNavigationPathOptions, type TNavigationTarget, type TOutsideThresholdPathStyle, type TPathSectionHighlightOptions, type TPathState, type TPathUpdateState, type TQueriables, type TQueryAtResult, type RendererState as TRendererState, type TSearchOptions, type TSetFloorOptions, type TShapeState, type TShapeUpdateState, type TShow3DMapOptions, type TSpaceType, type TStateChangedInternalPayload, type TTakeScreenshotOptions, type TTetheredOptions as TTetherOptions, type TText3DState, type TText3DUpdateState, type TTrackCoordinateOptions, type TTravelledOptions, type TUpdateState, type TWallsState, type TWallsUpdateState, TWatermarkOptions, type Text3D, type Text3DView, type UpdateGlobalState, type VisibilityState, WALLS, type WithState, MAPPEDIN_LAYER_ID as __INTERNAL__MAPPEDIN_LAYER_ID, MapLibreOverlay as __INTERNAL__MapLibreOverlay, Core as __INTERNAL__RendererCore, convertToRendererCoreOptions as __INTERNAL__convertToRendererCoreOptions, __setWatermarkOnClickFn, checkWorkerUrls, disableText3DWorker, enableTestMode, findPreferredLanguageInVenue, forceEnterpriseLocations, getMapData, getMapDataEnterprise, getMultiFloorState, getVersion, hydrateMapData, hydrateMapDataFromMVF, parseMVFv2 as parseMVF, preloadFont, setLoggerLevel, setUseEnterpriseAPI, setWorkersUrl, shouldForceEnterpriseLocations, show3dMap, show3dMapGeojson, unzipAndParseMVFv2, unzipMVFv2 as unzipMVF };
|
|
22861
|
+
export { ACTION_TYPE, ANIMATION_TWEENS, type AddText3DOptions, type AddText3DPointOptions, type Analytics, Annotation, Area, type AutoElements, BBox, BEARING_TYPE, CONNECTION_TYPE, type Camera, type CameraBounds, type CameraTransform, type CaptureEventsPayloadMap, type ColorString, Connection, Coordinate, DOORS, type Debug, type DebugState, DetailedMapData, Directions, Door, E_SDK_LOG_LEVEL, type EasingCurve, EnterpriseCategory, EnterpriseLocation, EnterpriseVenue, type EnvMapOptions, type Environment, type Exporter, Facade, Feature, FeatureCollection, Floor, FloorStack, type FootprintConfig, GeoJSON$1 as GeoJSON, GeoJsonGeometryTypes, GeoJsonObject, GeoJsonProperties, GeoJsonTypes, Geometry, GeometryCollection, GeometryObject, type GlobalState, Hyperlink, type IAnchorable, type IFocusable, type IGeoJSONData, type INavigatable, type ISystemPlugin, type Image3D, type Image3DView, ImageMetaData, type InitializeModelState, type InitializeText3DState, type InsetPadding, type InsetPaddingOption, type InterpolateOn, type Interpolation, type Label, type LabelAppearance, type LabelTextPlacement, type Labels, LineString, type LineStyle, LocationCategory, LocationProfile, type LocationSocial, type LocationState, MAPPEDIN_COLORS, type MapData, type MapDataElements, type MapElementToGetRenderedState, type MapElementToGetState, type MapElementToUpdateState, type MapElementsWithState, type MapFeatureOfType, MapObject, MapView, type MapViewElements, type MapViewState, type MappedinError, type MappedinRenderError, type Marker, type Markers, type MatchInfo, type Model, type Models, type MultiFloorViewEffectState, MultiLineString, MultiPoint, MultiPolygon, type Navigation, type NavigationState, Node, type OpeningHours, type OperationHours, type Outdoor, type OutlinesOptions, type PaintStyle, type Path, type PathSegment$1 as PathSegment, type PathWidth, type Paths, type PixelWidth, type Places, Point, PointOfInterest, Polygon, type Position, type PubSub, type Query, type RendererCoreOptions, type Search, type SearchOptions, type SearchResult, type SearchResultEnterpriseCategory, type SearchResultEnterpriseLocations, type SearchResultItem, type SearchResultPlaces, type Shading, type Shape, type Shapes, type SiblingGroup, Space, type Style, type Suggestion, type TActionType, type TAddImageOptions, type TAddLabelOptions, type TAddMarkerOptions, type TAddModel, type TAddModelOptions, type TAddPathOptions, type TAddText3DAnchorableOptions, type TAddText3DOptions, type TAnalyticsUpdateState, type TAnimateStateResult, type TAnimationOptions, type TAntialiasingOptions, type TBearingType, type TCameraAnimationOptions, type TCameraInteractionsSetOptions, type TCameraTarget, type TCancellablePromise, type TClickPayload, type TCollisionRankingTier, type TConnectionPathOptions, type TConnectionType, type TCoordinateParams, type TCreateMarker, type TDirectionInstruction, type TDirectionInstructionAction, type TDirectionZone, type TDoorsState, type TDoorsUpdateState, type TEasingFunction, type TEventPayload, type TEvents, type TExperimentalDashOptions, type TFacadeState, type TFacadeUpdateState, type TFindNearestOptions, type TFindNearestResult, type TFindPreferredLanguageInVenueOptions, type TFloorAltitudeData, type TFloorChangePayload, type TFloorChangeReason, type TFloorState, type TFloorUpdateState, type TFocusOnOptions, type TFocusTarget, type TGeometryState, type TGeometryUpdateState, type TGetDirectionsOptions, type TGetMapDataOptions, type TGetMapDataSharedOptions, type TGetMapDataWithAccessTokenOptions, type TGetMapDataWithCredentialsOptions, type TGetState, type THoverPayload, type THydrateMapDataBundle, type TImage3DState as TImageState, type TImage3DUpdateState as TImageUpdateState, type TLabelState, type TLabelUpdateState, type TLogLevelName, type TMVF, type TMVFLineStringStyle, type TMVFPointStyle, type TMVFPolygonStyle, type TMVFStyle, type TMVFStyleCollection, type TMapDataEvents, type TMapDataObjectTypes, type TMapFeatureTypes, type TMapViewObjectTypes, type TMarkerPlacement, type TMarkerState, type TMarkerUpdateState, type TModelState, type TModelUpdateState, type TMultiFloorViewOptions, type TNavigationMarker, type TNavigationMarkerType, type TNavigationOptions, type TNavigationPathOptions, type TNavigationTarget, type TOutsideThresholdPathStyle, type TPathSectionHighlightOptions, type TPathState, type TPathUpdateState, type TQueriables, type TQueryAtResult, type RendererState as TRendererState, type TSearchOptions, type TSetFloorOptions, type TShapeState, type TShapeUpdateState, type TShow3DMapOptions, type TSpaceType, type TStateChangedInternalPayload, type TTakeScreenshotOptions, type TTetheredOptions as TTetherOptions, type TText3DState, type TText3DUpdateState, type TTrackCoordinateOptions, type TTravelledOptions, type TUpdateState, type TWallsState, type TWallsUpdateState, TWatermarkOptions, type Text3D, type Text3DView, type UpdateGlobalState, type VisibilityState, WALLS, type WithState, MAPPEDIN_LAYER_ID as __INTERNAL__MAPPEDIN_LAYER_ID, MapLibreOverlay as __INTERNAL__MapLibreOverlay, Core as __INTERNAL__RendererCore, convertToRendererCoreOptions as __INTERNAL__convertToRendererCoreOptions, __setWatermarkOnClickFn, checkWorkerUrls, disableText3DWorker, enableTestMode, findPreferredLanguageInVenue, forceEnterpriseLocations, getMapData, getMapDataEnterprise, getMultiFloorState, getVersion, hydrateMapData, hydrateMapDataFromMVF, parseLogLevel, parseMVFv2 as parseMVF, preloadFont, setLoggerLevel, setUseEnterpriseAPI, setWorkersUrl, shouldForceEnterpriseLocations, show3dMap, show3dMapGeojson, unzipAndParseMVFv2, unzipMVFv2 as unzipMVF };
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as
|
|
1
|
+
import{A as D,B as E,C as F,D as G,E as N,F as O,I as P,J as Q,K as R,L as S,M as T,N as U,O as V,P as W,Q as X,R as Y,S as Z,T as _,U as $,V as aa,W as ba,X as ca,a as d,b as e,c as f,d as g,e as h,f as i,g as j,h as k,i as l,j as m,k as n,l as o,m as p,n as q,o as r,p as s,q as t,r as u,s as v,t as w,u as x,v as y,w as z,x as A,y as B,z as C}from"./chunk-EJ222AP2.js";import{v as L,x as M}from"./chunk-WMWAXV3L.js";import{Ea as J,Q as H,Z as I,a,b,d as c,ob as K}from"./chunk-7S4YASHU.js";import"./chunk-SCXZVR4R.js";import"./chunk-FZGRE4ZA.js";import"./chunk-PWEV3AFA.js";export{z as ACTION_TYPE,H as ANIMATION_TWEENS,q as Annotation,j as Area,A as BEARING_TYPE,B as CONNECTION_TYPE,n as Connection,d as Coordinate,D as DOORS,h as DetailedMapData,E as Directions,k as Door,a as E_SDK_LOG_LEVEL,u as EnterpriseCategory,t as EnterpriseLocation,v as EnterpriseVenue,s as Facade,m as Floor,r as FloorStack,f as Hyperlink,g as ImageMetaData,G as LocationCategory,F as LocationProfile,i as MAPPEDIN_COLORS,o as MapObject,Q as MapView,e as Node,p as PointOfInterest,l as Space,C as WALLS,J as __INTERNAL__MAPPEDIN_LAYER_ID,M as __INTERNAL__MapLibreOverlay,L as __INTERNAL__RendererCore,S as __INTERNAL__convertToRendererCoreOptions,U as __setWatermarkOnClickFn,$ as checkWorkerUrls,O as disableText3DWorker,I as enableTestMode,T as findPreferredLanguageInVenue,X as forceEnterpriseLocations,Z as getMapData,_ as getMapDataEnterprise,N as getMultiFloorState,ba as getVersion,R as hydrateMapData,V as hydrateMapDataFromMVF,b as parseLogLevel,w as parseMVF,K as preloadFont,c as setLoggerLevel,W as setUseEnterpriseAPI,P as setWorkersUrl,Y as shouldForceEnterpriseLocations,aa as show3dMap,ca as show3dMapGeojson,y as unzipAndParseMVFv2,x as unzipMVF};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as N,H as ee,i as O,q as $,r as P}from"./chunk-Q25YCNKX.js";import"./chunk-HYINSTT6.js";import{i as S}from"./chunk-WQRLPX6X.js";import"./chunk-NGRMTFSH.js";import{a as y}from"./chunk-JVDXHWBF.js";import"./chunk-PWEV3AFA.js";y();y();y();y();var M=class n{constructor(e,i,t,o,r="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},Y=class extends M{constructor(e,i,t){super(e,i,t,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function V(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var be={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:V,toHexString:V},D={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},ve={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=D.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},ye={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=D.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},Ce=[be,D,ve,ye];function xe(n){return Ce.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,o){super(e,i,t,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=xe(this.initialValue),this._rgbScale=o,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let r=V(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},I=class extends M{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},X=class extends M{constructor(e,i,t,o,r,l){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(r);let s=l!==void 0;this.step(s?l:this._getImplicitStep(),s),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let i=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let x=parseFloat(this.$input.value);isNaN(x)||(this._snapClampSetValue(x+b),this.$input.value=this.getValue())},o=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},r=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,s,c,f,d,a,p=5,h=b=>{s=b.clientX,c=f=b.clientY,l=!0,d=this.getValue(),a=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let x=b.clientX-s,L=b.clientY-c;Math.abs(L)>p?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(x)>p&&m()}if(!l){let x=b.clientY-f;a-=x*this._step*this._arrowKeyMultiplier(b),d+a>this._max?a=this._max-d:d+a<this._min&&(a=this._min-d),this._snapClampSetValue(d+a)}f=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},v=()=>{this._inputFocused=!0},u=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",h),this.$input.addEventListener("focus",v),this.$input.addEventListener("blur",u)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(u,b,x,L,_)=>(u-b)/(x-b)*(_-L)+L,i=u=>{let b=this.$slider.getBoundingClientRect(),x=e(u,b.left,b.right,this._min,this._max);this._snapClampSetValue(x)},t=u=>{this._setDraggingStyle(!0),i(u.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",r)},o=u=>{i(u.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r)},l=!1,s,c,f=u=>{u.preventDefault(),this._setDraggingStyle(!0),i(u.touches[0].clientX),l=!1},d=u=>{u.touches.length>1||(this._hasScrollBar?(s=u.touches[0].clientX,c=u.touches[0].clientY,l=!0):f(u),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",p))},a=u=>{if(l){let b=u.touches[0].clientX-s,x=u.touches[0].clientY-c;Math.abs(b)>Math.abs(x)?f(u):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p))}else u.preventDefault(),i(u.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p)},h=this._callOnFinishChange.bind(this),g=400,m,v=u=>{if(Math.abs(u.deltaX)<Math.abs(u.deltaY)&&this._hasScrollBar)return;u.preventDefault();let x=this._normalizeMouseWheel(u)*this._step;this._snapClampSetValue(this.getValue()+x),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(h,g)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",v,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${i}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},W=class extends M{constructor(e,i,t,o){super(e,i,t,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},K=class extends M{constructor(e,i,t){super(e,i,t,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",o=>{o.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},Ae=`.lil-gui {
|
|
1
|
+
import{G as N,H as ee,i as O,q as $,r as P}from"./chunk-EJ222AP2.js";import"./chunk-WMWAXV3L.js";import{j as S}from"./chunk-7S4YASHU.js";import"./chunk-SCXZVR4R.js";import{a as y}from"./chunk-FZGRE4ZA.js";import"./chunk-PWEV3AFA.js";y();y();y();y();var M=class n{constructor(e,i,t,o,r="div"){this.parent=e,this.object=i,this.property=t,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement(r),this.domElement.classList.add("controller"),this.domElement.classList.add(o),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement("div"),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",l=>l.stopPropagation()),this.domElement.addEventListener("keyup",l=>l.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(t)}name(e){return this._name=e,this.$name.textContent=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let i=this.parent.add(this.object,this.property,e);return i.name(this._name),this.destroy(),i}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.getValue()!==e&&(this.object[this.property]=e,this._callOnChange(),this.updateDisplay()),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},Y=class extends M{constructor(e,i,t){super(e,i,t,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function V(n){let e,i;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),i?"#"+i:!1}var be={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:V,toHexString:V},D={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},ve={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,i=1){let t=D.fromHexString(n);e[0]=(t>>16&255)/255*i,e[1]=(t>>8&255)/255*i,e[2]=(t&255)/255*i},toHexString([n,e,i],t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},ye={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,i=1){let t=D.fromHexString(n);e.r=(t>>16&255)/255*i,e.g=(t>>8&255)/255*i,e.b=(t&255)/255*i},toHexString({r:n,g:e,b:i},t=1){t=255/t;let o=n*t<<16^e*t<<8^i*t<<0;return D.toHexString(o)}},Ce=[be,D,ve,ye];function xe(n){return Ce.find(e=>e.match(n))}var J=class extends M{constructor(e,i,t,o){super(e,i,t,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=xe(this.initialValue),this._rgbScale=o,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let r=V(this.$text.value);r&&this._setValueFromHexString(r)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let i=this._format.fromHexString(e);this.setValue(i)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},I=class extends M{constructor(e,i,t){super(e,i,t,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",o=>{o.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},X=class extends M{constructor(e,i,t,o,r,l){super(e,i,t,"number"),this._initInput(),this.min(o),this.max(r);let s=l!==void 0;this.step(s?l:this._getImplicitStep(),s),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,i=!0){return this._step=e,this._stepExplicit=i,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let i=(e-this._min)/(this._max-this._min);i=Math.max(0,Math.min(i,1)),this.$fill.style.width=i*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let i=()=>{let b=parseFloat(this.$input.value);isNaN(b)||(this._stepExplicit&&(b=this._snap(b)),this.setValue(this._clamp(b)))},t=b=>{let x=parseFloat(this.$input.value);isNaN(x)||(this._snapClampSetValue(x+b),this.$input.value=this.getValue())},o=b=>{b.key==="Enter"&&this.$input.blur(),b.code==="ArrowUp"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b))),b.code==="ArrowDown"&&(b.preventDefault(),t(this._step*this._arrowKeyMultiplier(b)*-1))},r=b=>{this._inputFocused&&(b.preventDefault(),t(this._step*this._normalizeMouseWheel(b)))},l=!1,s,c,f,d,a,p=5,h=b=>{s=b.clientX,c=f=b.clientY,l=!0,d=this.getValue(),a=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",m)},g=b=>{if(l){let x=b.clientX-s,L=b.clientY-c;Math.abs(L)>p?(b.preventDefault(),this.$input.blur(),l=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(x)>p&&m()}if(!l){let x=b.clientY-f;a-=x*this._step*this._arrowKeyMultiplier(b),d+a>this._max?a=this._max-d:d+a<this._min&&(a=this._min-d),this._snapClampSetValue(d+a)}f=b.clientY},m=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",m)},v=()=>{this._inputFocused=!0},u=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",i),this.$input.addEventListener("keydown",o),this.$input.addEventListener("wheel",r,{passive:!1}),this.$input.addEventListener("mousedown",h),this.$input.addEventListener("focus",v),this.$input.addEventListener("blur",u)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(u,b,x,L,_)=>(u-b)/(x-b)*(_-L)+L,i=u=>{let b=this.$slider.getBoundingClientRect(),x=e(u,b.left,b.right,this._min,this._max);this._snapClampSetValue(x)},t=u=>{this._setDraggingStyle(!0),i(u.clientX),window.addEventListener("mousemove",o),window.addEventListener("mouseup",r)},o=u=>{i(u.clientX)},r=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",r)},l=!1,s,c,f=u=>{u.preventDefault(),this._setDraggingStyle(!0),i(u.touches[0].clientX),l=!1},d=u=>{u.touches.length>1||(this._hasScrollBar?(s=u.touches[0].clientX,c=u.touches[0].clientY,l=!0):f(u),window.addEventListener("touchmove",a,{passive:!1}),window.addEventListener("touchend",p))},a=u=>{if(l){let b=u.touches[0].clientX-s,x=u.touches[0].clientY-c;Math.abs(b)>Math.abs(x)?f(u):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p))}else u.preventDefault(),i(u.touches[0].clientX)},p=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",p)},h=this._callOnFinishChange.bind(this),g=400,m,v=u=>{if(Math.abs(u.deltaX)<Math.abs(u.deltaY)&&this._hasScrollBar)return;u.preventDefault();let x=this._normalizeMouseWheel(u)*this._step;this._snapClampSetValue(this.getValue()+x),this.$input.value=this.getValue(),clearTimeout(m),m=setTimeout(h,g)};this.$slider.addEventListener("mousedown",t),this.$slider.addEventListener("touchstart",d,{passive:!1}),this.$slider.addEventListener("wheel",v,{passive:!1})}_setDraggingStyle(e,i="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${i}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:i,deltaY:t}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(i=0,t=-e.wheelDelta/120,t*=this._stepExplicit?1:10),i+-t}_arrowKeyMultiplier(e){let i=this._stepExplicit?1:10;return e.shiftKey?i*=10:e.altKey&&(i/=10),i}_snap(e){let i=Math.round(e/this._step)*this._step;return parseFloat(i.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},W=class extends M{constructor(e,i,t,o){super(e,i,t,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.options(o)}options(e){return this._values=Array.isArray(e)?e:Object.values(e),this._names=Array.isArray(e)?e:Object.keys(e),this.$select.replaceChildren(),this._names.forEach(i=>{let t=document.createElement("option");t.textContent=i,this.$select.appendChild(t)}),this.updateDisplay(),this}updateDisplay(){let e=this.getValue(),i=this._values.indexOf(e);return this.$select.selectedIndex=i,this.$display.textContent=i===-1?e:this._names[i],this}},K=class extends M{constructor(e,i,t){super(e,i,t,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("spellcheck","false"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",o=>{o.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},Ae=`.lil-gui {
|
|
2
2
|
font-family: var(--font-family);
|
|
3
3
|
font-size: var(--font-size);
|
|
4
4
|
line-height: 1;
|
|
@@ -479,4 +479,4 @@ import{G as N,H as ee,i as O,q as $,r as P}from"./chunk-Q25YCNKX.js";import"./ch
|
|
|
479
479
|
<span style="font-weight: 500; color: #FFFFFF; font-size: 16px;">${d.name}</span>
|
|
480
480
|
<br>
|
|
481
481
|
<span style="color: #FFFFFF; font-size: 12px; font-weight: 400;">Node</span>
|
|
482
|
-
</div>`,{rank:"always-visible"});f.add(p),n.push(h)}})})}return()=>{n.forEach(c=>o.Markers.remove(c))}}}}var T={duration:300,easing:"ease-in-out"},H=Ee();y();var w={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function ke(n){n.add(w.options.places.fields,"name").name("Places: Name"),n.add(w.options.places.fields,"description").name("Places: Description"),n.add(w.options.places.fields,"link").name("Places: Link"),n.add(w.options.places.fields,"category").name("Places: Category"),n.add(w.options.places,"limit"),n.add(w.options.locations.fields,"name").name("Locations: Name"),n.add(w.options.locations.fields,"tag").name("Locations: Tag"),n.add(w.options.locations.fields,"description").name("Locations: Description"),n.add(w.options.places,"limit"),n.add(w.options.categories.fields,"name").name("Categories: Name")}function ne(n,e,i){let t=new S,o=i.addFolder("Search");o.open();let r=o.add(w,"search").onChange(async d=>{let a=await e.Search.query(d,w.options);a&&(w.results=a,s(a,t))}),l=document.createElement("div");l.style.marginLeft="10px",r.domElement.parentElement?.appendChild(l);let{renderSearch:s,close:c}=Me(n,e,l,r.$input),f=o.addFolder("Advanced");return f.close(),ke(f),document.addEventListener("keydown",d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"?(d.preventDefault(),o._closed&&o.open(),r.$input.focus()):d.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function Me(n,e,i,t){let o,r;t.addEventListener("input",async s=>{s instanceof InputEvent&&(s.inputType==="insertText"||s.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{let c=await e.Search.suggest(t.value);c&&c.length>0&&l(c[0]?.suggestion)},100))});function l(s){if(!s){t.placeholder="";return}let c=t.value;t.value=s,t.setSelectionRange(c.length,s.length)}return{renderSearch(s,c){if(s.places.length===0&&s.enterpriseCategories?.length===0&&s.enterpriseLocations?.length===0){i.textContent="No results found.";return}r=Le(i,s,n,c)},close(){r.destroy()}}}function Le(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,U.dropdownContainer);let r=document.createElement("ul");r.className="options-list",Object.assign(r.style,U.optionsList),r.style.display="block";let l=[],s=(p,h)=>{if(h&&h.length>0){let g=document.createElement("li");g.textContent=p,Object.assign(g.style,U.sectionHeader),r.appendChild(g),h.forEach((m,v)=>{let u=document.createElement("li");u.textContent=`${"name"in m.item?m.item.name:""} (${m.type})`,Object.assign(u.style,U.option),u.tabIndex=0,u.addEventListener("focus",()=>{f(l.indexOf(u))}),u.addEventListener("mouseover",()=>{u.style.backgroundColor="#f0f0f0"}),u.addEventListener("mouseout",()=>{u.style.backgroundColor=""}),u.addEventListener("click",()=>{}),u.setAttribute("data-type",p),u.setAttribute("data-index",v.toString()),r.appendChild(u),l.push(u)})}};s("enterpriseLocations",e.enterpriseLocations),s("enterpriseCategories",e.enterpriseCategories),s("Places",e.places),o.appendChild(r),n.appendChild(o);let c=[],f=p=>{c.forEach(u=>u()),c=[],l.forEach((u,b)=>{b===p?u.style.backgroundColor="#e0e0e0":u.style.backgroundColor=""});let h=l[p],g=h.getAttribute("data-type"),m=parseInt(h.getAttribute("data-index")||"0",10);if(!g)return;let{item:v}=e[g.toLowerCase()][m];t.publish("highlight",v)},d=p=>{!o.contains(p.target)&&p.target!==n&&a()};document.addEventListener("click",d);let a=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var U={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function oe(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=ne(n,e,i);o.on("highlight",d=>{if(d){t.forEach(p=>p()),t=[];let a=d instanceof $?d.spaces[0]:d;if(n.Camera.focusOn(d),a&&!O.is(a))return;t.push(H.highlightCard(n,a,{focus:!0}))}else t.forEach(a=>a()),t=[]});let r=i.addFolder("Click \u{1F447}").close(),{sub:l}=$e(n,r);l.on("click",d=>{t.forEach(a=>a()),t=[],d.spaces?.[0]&&(t=[H.highlightCard(n,d.spaces[0])])});let s=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Se(n,s),f;c.on("hover",d=>{d.spaces?.[0]?(f?.(),t.length===0&&(f=H.highlightCard(n,d.spaces[0]))):(f?.(),f=void 0)})}function $e(n,e){let i=new S,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),r=[];function l(){r.forEach(c=>c()),r.length=0}let s=0;return n.on("click",c=>{let{labels:f,coordinate:d}=c;l(),i.publish("click",c),clearInterval(s),o.load(JSON.stringify([d.longitude,d.latitude]));let a=f?.[0];if(a!=null){let h=F(n,a,e);if(!h)return;r.push(h.destroy),h.labelItemFolder.openAnimated()}let p=c.spaces?.[0]??c.objects?.[0];if(p){let h={...p,...n.getState(p),isInView:!1,isInViewCheck:G(n,p.id)},{cleanup:g}=B(n,h,e);s=setInterval(()=>{h.isInView=n.isInView(a||p)},500),r.push(g)}}),{sub:i}}function Se(n,e){let i=new S;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(s=>{n.setHoverColor(s)});let r=[];function l(){r.forEach(s=>s()),r.length=0}return n.on("hover",s=>{let{coordinate:c,spaces:f,objects:d,markers:a,labels:p}=s;l(),i.publish("hover",s),o.load(JSON.stringify([c.longitude,c.latitude]));let h=f?.[0]??d?.[0]??a?.[0]??p?.[0];if(!h)return;let g=n.getState(h);g&&(t.type=g.type,t.id=h.id)}),{sub:i}}function G(n,e){return function(){console.log("isInView",n.isInView(e))}}function re(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(h=>{this.labels[h.id]=h}),c()},removeAllLabels(){i.Labels.removeAll().forEach(h=>{delete this.labels[h.id]}),c()}},{addLabel:o,destroy:r}=Te(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.labels[m.id],s.get(m.id)?.destroy()}function h(m){let v=F(i,m,l,{onRemove:b=>{p(b)}});if(!v)return;let{labelItemFolder:u}=v;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let v=t.labels[m];h(v)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.labels[h.id]=h;c()}return{populatelabels:a,destroy(){r()}}}function Ie(n,e,i,t,o){let{interactive:r,enabled:l,rank:s,anchor:c,dynamicResize:f,zIndex:d,contentHTML:a,lowPriorityPin:p}=t;if(r==null||l==null)throw new Error("incomplete marker state");let h={interactive:r,enabled:l,rank:s||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:f||!1,zIndex:d||0,contentHTML:a||"",lowPriorityPin:{enabled:p?.enabled??!0,size:p?.size??8,color:E(p?.color??"#666")},remove(){n.Markers.remove(e),o?.(e),i.destroy()},isInView:G(n,e.id)};i.onChange(m=>{let v={interactive:h.interactive,enabled:h.enabled,rank:h.rank,dynamicResize:h.dynamicResize,contentHTML:h.contentHTML,lowPriorityPin:{enabled:h.lowPriorityPin.enabled,size:h.lowPriorityPin.size,color:h.lowPriorityPin.color}};h.rank==="always-visible"&&(v.zIndex=h.zIndex),n.updateState(e,v)}),i.add(h,"interactive"),i.add(h,"enabled"),i.add(h,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(h,"anchor").name("anchor (read-only)").disable(),i.add(h,"dynamicResize").name("dynamic resize"),h.rank==="always-visible"&&i.add(h,"zIndex",0,1e3,1).name("z-index"),i.add(h,"contentHTML").name("content HTML");let g=i.addFolder("Low Priority Pin");g.add(h.lowPriorityPin,"enabled"),g.add(h.lowPriorityPin,"size",1,20,1),g.addColor(h.lowPriorityPin,"color"),g.close(),i.add(h,"isInView"),i.add(h,"remove")}function De(n,e,i,t,o){let{appearance:r,interactive:l}=t;if(!r||r.margin==null||l==null)throw new Error("incomplte label state");let s={text:e.text,interactive:l,appearance:{...r,margin:r.margin||0,pinColor:r.pinColor?E(r.pinColor):"black",textColor:r.textColor?E(r.textColor):"black"},remove(){n.Labels.remove(e),o?.(e),i.destroy()},isInView:G(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:s.appearance,interactive:s.interactive})}),i.add(s.appearance,"margin",0,20).name("margin"),i.add(s,"text"),i.add(s,"interactive"),i.addColor(s.appearance,"pinColor").name("pin color"),i.addColor(s.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(s.appearance,"textColor").name("text color"),i.addColor(s.appearance,"textOutlineColor").name("text outline color"),i.add(s,"isInView"),i.add(s,"remove")}function F(n,e,i,{onRemove:t}={}){let o=n.getState(e);if(!o)throw new Error(`error getting state for entity: ${e.id}`);let r=o.type===N?e.text?.substring(0,12)||"Label":`Marker ${e.id.toString().substring(0,8)}`,l=i.addFolder(r);if(l.close(),o.type===N)De(n,e,l,o,t);else if(o.type===ee)Ie(n,e,l,o,t);else throw new Error(`unsupported entity type: ${o.type}`);return{labelItemFolder:l,destroy(){l.destroy()}}}function Te(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var se={};y();function ae(n,e,i){let t=n.addFolder("Camera \u{1F4F7}"),o=e.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(r);let l=()=>e.getDimensions(),[s,c,f,d]=i?.padding??[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],a={center_lat:o.latitude,center_lon:o.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i?.padding?"pixel":e.Camera.screenOffsets.type,inset_top:s,inset_left:d,inset_right:c,inset_bottom:f,animateOnLoad:!0,visualizeInset:!!(s||c||f||d),"Focus on click":i?.focusOnClick??!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function p(){a.inset_type=e.Camera.screenOffsets.type,a.inset_left=e.Camera.screenOffsets.left,a.inset_top=e.Camera.screenOffsets.top,a.inset_right=e.Camera.screenOffsets.right,a.inset_bottom=e.Camera.screenOffsets.bottom;let{width:C,height:k}=l();a.inset_type==="portion"?Object.assign(r.style,{left:a.inset_left*C+"px",top:a.inset_top*k+"px",bottom:a.inset_bottom*k+"px",right:a.inset_right*C+"px"}):Object.assign(r.style,{left:a.inset_left+"px",top:a.inset_top+"px",bottom:a.inset_bottom+"px",right:a.inset_right+"px"})}t.add(a,"center_lat").listen().disable(),t.add(a,"center_lon").listen().disable(),t.add(a,"zoomLevel",16,22,.5).listen().disable(),t.add(a,"pitch").listen().disable(),t.add(a,"bearing").listen().disable(),t.add(a,"minZoomLevel",5,22,.5).onChange(C=>{e.Camera.setMinZoomLevel(C)}),t.add(a,"maxZoomLevel",10,22,.5).onChange(C=>{e.Camera.setMaxZoomLevel(C)}),t.add(a,"animateOnLoad"),t.add(a,"visualizeInset").onChange(q),q(a.visualizeInset);let h,g,m,v;function u(){let{width:C,height:k}=l(),R=e.Camera.screenOffsets.type,j=a.inset_type;R!==j&&(j==="portion"&&R==="pixel"?(a.inset_top=C>0?Math.min(a.inset_top/k,1):0,a.inset_bottom=C>0?Math.min(a.inset_bottom/k,1):0,a.inset_left=k>0?Math.min(a.inset_left/C,1):0,a.inset_right=k>0?Math.min(a.inset_right/C,1):0):j==="pixel"&&R==="portion"&&(a.inset_top=Math.round(a.inset_top*k),a.inset_bottom=Math.round(a.inset_bottom*k),a.inset_left=Math.round(a.inset_left*C),a.inset_right=Math.round(a.inset_right*C))),h&&h.destroy(),g&&g.destroy(),m&&m.destroy(),v&&v.destroy(),a.inset_type==="portion"?(h=t.add(a,"inset_top",0,1,.01).onChange(_),g=t.add(a,"inset_bottom",0,1,.01).onChange(_),m=t.add(a,"inset_left",0,1,.01).onChange(_),v=t.add(a,"inset_right",0,1,.01).onChange(_)):(h=t.add(a,"inset_top",0,k,1).onChange(_),g=t.add(a,"inset_bottom",0,k,1).onChange(_),m=t.add(a,"inset_left",0,C,1).onChange(_),v=t.add(a,"inset_right",0,C,1).onChange(_))}t.add(a,"inset_type",["pixel","portion"]).onChange(()=>{u(),_()}),u();let b=Oe(e);t.add(a,"Focus on click").onChange(C=>{C?e.on("click",b):e.off("click",b)}),a["Focus on click"]&&e.on("click",b),t.add(a,"Focus on current floor");let x=C=>{t._closed||(a.center_lat=C.center.latitude,a.center_lon=C.center.longitude,a.zoomLevel=C.zoomLevel,a.bearing=C.bearing,a.pitch=C.pitch)};e.on("camera-change",x);let L=[()=>{e.off("camera-change",x)}];function _(){e.Camera.setScreenOffsets({top:a.inset_top,left:a.inset_left,right:a.inset_right,bottom:a.inset_bottom,type:a.inset_type}),p()}(a.inset_top||a.inset_right||a.inset_bottom||a.inset_left)&&_();function q(C){p(),C?r.style.display="block":r.style.display="none"}return()=>({destroy(){t.destroy(),ie(L)}})}function Oe(n){return function(i){let{spaces:t,objects:o}=i,r=t?.[0]??o?.[0];r&&n.Camera.focusOn(r)}}y();function le(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(h=>{delete this.markers[h.id]}),c()}},{addMarker:o,destroy:r}=Pe(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.markers[m.id],s.get(m.id)?.destroy()}function h(m){let v=F(i,m,l,{onRemove:b=>{p(b)}});if(!v)return;let{labelItemFolder:u}=v;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let v=t.markers[m];h(v)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.markers[h.id]=h;c()}return{populateMarkers:a,destroy(){r()}}}function Pe(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(r){if(i._closed||!t.onClick)return;let l={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(l.zIndex=t.zIndex),e.Markers.add(r,t.contentHTML,l)}}}y();function de(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}y();function ce(n,e,i){n.close();let t={language:i.currentLanguage?.code??"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o?.languages.map(r=>r.code)).onChange(r=>{i.changeLanguage(r)})}y();function he(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,r={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(r,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(r,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(r,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(r)}y();function ue(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}y();function pe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let o=localStorage.getItem("directionsMethod"),r=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",s={enabled:!1,method:o||"dp-optimal",radius:r?parseFloat(r):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,f,d;t.add(s,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(s,"startCoordinate").name("Start").disable().listen(),t.add(s,"endCoordinate").name("End").disable().listen(),t.add(s,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&f&&s.enabled&&h(c,f)}),t.add(s,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"pathInfo").name("Path Info").disable().listen();let a={clear:()=>p()};t.add(a,"clear").name("Clear Path");function p(){c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function h(m,v){d&&(e.Paths.remove(d),d=void 0);try{let u=await e.getDirections(m,v,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:s.method,radius:s.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:s.includeDoorBufferNodes}});if(u){d=e.Paths.add(u.coordinates,{interactive:!0,color:"green",width:1});let x=u.distance?.toFixed(2)||"N/A";s.pathInfo=`${u.coordinates.length} pts, ${x}m`}else s.pathInfo="No path found"}catch(u){s.pathInfo=`Error: ${u instanceof Error?u.message:"Unknown"}`}}let g=async m=>{if(s.enabled)if(c){let v=m.coordinate;f=v,s.endCoordinate=`${v.latitude.toFixed(6)}, ${v.longitude.toFixed(6)}`,s.pathInfo="Calculating...",await h(c,f),c=void 0,f=void 0}else{let v=m.coordinate;c=v,s.startCoordinate=`${v.latitude.toFixed(6)}, ${v.longitude.toFixed(6)}`,s.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}y();function fe(n,e){let i=n.addFolder("Spaces Open To Below Visual Effect").close(),t=e.getGlobalState().multiFloorView,o={enabled:t.spacesOpenToBelowVisualEffectEnabled,darkenAmount:t.spacesOpenToBelowVisualEffectDarkenAmount,darkenUseDepth:t.spacesOpenToBelowVisualEffectDarkenUseDepth,desaturateAmount:t.spacesOpenToBelowVisualEffectDesaturateAmount,desaturateUseDepth:t.spacesOpenToBelowVisualEffectDesaturateUseDepth,washOutAmount:t.spacesOpenToBelowVisualEffectWashOutAmount,washOutUseDepth:t.spacesOpenToBelowVisualEffectWashOutUseDepth};function r(){e.updateGlobalState({multiFloorView:{spacesOpenToBelowVisualEffectEnabled:o.enabled,spacesOpenToBelowVisualEffectDarkenAmount:o.darkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:o.darkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:o.desaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:o.desaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:o.washOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:o.washOutUseDepth}})}i.add(o,"enabled").name("Enabled").onChange(()=>r());let l=i.addFolder("Darken");l.add(o,"darkenAmount",0,1,.01).name("Amount").onChange(()=>r()),l.add(o,"darkenUseDepth").name("Use Depth").onChange(()=>r());let s=i.addFolder("Desaturate");s.add(o,"desaturateAmount",0,1,.01).name("Amount").onChange(()=>r()),s.add(o,"desaturateUseDepth").name("Use Depth").onChange(()=>r());let c=i.addFolder("Wash Out");c.add(o,"washOutAmount",0,1,.01).name("Amount").onChange(()=>r()),c.add(o,"washOutUseDepth").name("Use Depth").onChange(()=>r())}function me(n,e,i){ze();let t=new z({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),oe(e,n,t),ae(t,e,i?.camera);let o=t.addFolder("Levels").close(),r=t.addFolder("Scene Controls");r.close();let l=t.addFolder("Labels");ue(t,e,n);let s=t.addFolder("Markers");de(t,e);let c=t.addFolder("misc");he(t,e,n),fe(t,e),pe(t,e,n),ce(c,e,n);let f={level:e.currentFloor.id},{populatelabels:d}=re(l,n,e),{populateMarkers:a}=le(s,n,e),p=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),h=o.add(f,"level",p).onChange(g=>{e.setFloor(g),f.level=e.currentFloor.id,h.updateDisplay()});return e.on("floor-change-start",g=>{o.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:r,populateMarkers:a}}var ge="mappedin-sdk-debug-css";function ze(){if(document.getElementById(ge))return;let n=document.createElement("style");n.id=ge,n.textContent=se,document.head.appendChild(n)}var Q=class{_enabled=!1;mv;api;mapData;scenegraphVisualizerMounted=!1;storeStateToLocalStorageEnabled=!1;constructor(e,i){this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=me(this.mapData,this.mv,e);i.onOpenClose(async t=>{if(t===i&&!t._closed&&!this.scenegraphVisualizerMounted){this.scenegraphVisualizerMounted=!0;try{let{mountSceneGraphVisualizer:o}=await import("./src-PNDJGPPX.js");o(this.api.core,i)}catch{}}}),this.api.getMapDataInternal()?.spaces.forEach(t=>{this.mv.updateState(t,{interactive:!0})})}get enabled(){return this._enabled}};export{Q as Inspector};
|
|
482
|
+
</div>`,{rank:"always-visible"});f.add(p),n.push(h)}})})}return()=>{n.forEach(c=>o.Markers.remove(c))}}}}var T={duration:300,easing:"ease-in-out"},H=Ee();y();var w={search:"",results:void 0,options:{places:{fields:{name:!0,description:!0,link:!0,category:!0},limit:5},locations:{fields:{name:!0,tag:!0,description:!0},limit:5},categories:{fields:{name:!0},limit:5}}};function ke(n){n.add(w.options.places.fields,"name").name("Places: Name"),n.add(w.options.places.fields,"description").name("Places: Description"),n.add(w.options.places.fields,"link").name("Places: Link"),n.add(w.options.places.fields,"category").name("Places: Category"),n.add(w.options.places,"limit"),n.add(w.options.locations.fields,"name").name("Locations: Name"),n.add(w.options.locations.fields,"tag").name("Locations: Tag"),n.add(w.options.locations.fields,"description").name("Locations: Description"),n.add(w.options.places,"limit"),n.add(w.options.categories.fields,"name").name("Categories: Name")}function ne(n,e,i){let t=new S,o=i.addFolder("Search");o.open();let r=o.add(w,"search").onChange(async d=>{let a=await e.Search.query(d,w.options);a&&(w.results=a,s(a,t))}),l=document.createElement("div");l.style.marginLeft="10px",r.domElement.parentElement?.appendChild(l);let{renderSearch:s,close:c}=Me(n,e,l,r.$input),f=o.addFolder("Advanced");return f.close(),ke(f),document.addEventListener("keydown",d=>{(d.metaKey||d.ctrlKey)&&d.key==="k"?(d.preventDefault(),o._closed&&o.open(),r.$input.focus()):d.key==="Escape"&&(c(),t.publish("highlight",void 0))}),{pubsub:t}}function Me(n,e,i,t){let o,r;t.addEventListener("input",async s=>{s instanceof InputEvent&&(s.inputType==="insertText"||s.inputType==="insertCompositionText")&&(clearTimeout(o),o=setTimeout(async()=>{let c=await e.Search.suggest(t.value);c&&c.length>0&&l(c[0]?.suggestion)},100))});function l(s){if(!s){t.placeholder="";return}let c=t.value;t.value=s,t.setSelectionRange(c.length,s.length)}return{renderSearch(s,c){if(s.places.length===0&&s.enterpriseCategories?.length===0&&s.enterpriseLocations?.length===0){i.textContent="No results found.";return}r=Le(i,s,n,c)},close(){r.destroy()}}}function Le(n,e,i,t){n.innerHTML="";let o=document.createElement("div");Object.assign(o.style,U.dropdownContainer);let r=document.createElement("ul");r.className="options-list",Object.assign(r.style,U.optionsList),r.style.display="block";let l=[],s=(p,h)=>{if(h&&h.length>0){let g=document.createElement("li");g.textContent=p,Object.assign(g.style,U.sectionHeader),r.appendChild(g),h.forEach((m,v)=>{let u=document.createElement("li");u.textContent=`${"name"in m.item?m.item.name:""} (${m.type})`,Object.assign(u.style,U.option),u.tabIndex=0,u.addEventListener("focus",()=>{f(l.indexOf(u))}),u.addEventListener("mouseover",()=>{u.style.backgroundColor="#f0f0f0"}),u.addEventListener("mouseout",()=>{u.style.backgroundColor=""}),u.addEventListener("click",()=>{}),u.setAttribute("data-type",p),u.setAttribute("data-index",v.toString()),r.appendChild(u),l.push(u)})}};s("enterpriseLocations",e.enterpriseLocations),s("enterpriseCategories",e.enterpriseCategories),s("Places",e.places),o.appendChild(r),n.appendChild(o);let c=[],f=p=>{c.forEach(u=>u()),c=[],l.forEach((u,b)=>{b===p?u.style.backgroundColor="#e0e0e0":u.style.backgroundColor=""});let h=l[p],g=h.getAttribute("data-type"),m=parseInt(h.getAttribute("data-index")||"0",10);if(!g)return;let{item:v}=e[g.toLowerCase()][m];t.publish("highlight",v)},d=p=>{!o.contains(p.target)&&p.target!==n&&a()};document.addEventListener("click",d);let a=()=>{n.innerHTML="",document.removeEventListener("click",d)};return{destroy(){n.innerHTML="",t.publish("highlight",void 0)}}}var U={dropdownContainer:{position:"absolute",color:"#202020"},optionsList:{display:"block",zIndex:"1002",position:"relative",maxHeight:"200px",overflowY:"auto",border:"1px solid #ccc",backgroundColor:"#fff",listStyleType:"none",margin:"0",padding:"0"},sectionHeader:{fontWeight:"bold",padding:"5px",backgroundColor:"#f0f0f0"},option:{padding:"5px",cursor:"pointer"}};function oe(n,e,i){i.domElement.id="interactionPanel";let t=[],{pubsub:o}=ne(n,e,i);o.on("highlight",d=>{if(d){t.forEach(p=>p()),t=[];let a=d instanceof $?d.spaces[0]:d;if(n.Camera.focusOn(d),a&&!O.is(a))return;t.push(H.highlightCard(n,a,{focus:!0}))}else t.forEach(a=>a()),t=[]});let r=i.addFolder("Click \u{1F447}").close(),{sub:l}=$e(n,r);l.on("click",d=>{t.forEach(a=>a()),t=[],d.spaces?.[0]&&(t=[H.highlightCard(n,d.spaces[0])])});let s=i.addFolder("Hover \u{1F681}").close(),{sub:c}=Se(n,s),f;c.on("hover",d=>{d.spaces?.[0]?(f?.(),t.length===0&&(f=H.highlightCard(n,d.spaces[0]))):(f?.(),f=void 0)})}function $e(n,e){let i=new S,t={position:"",hoverColor:E(n.getHoverColor())},o=e.add(t,"position").disable(),r=[];function l(){r.forEach(c=>c()),r.length=0}let s=0;return n.on("click",c=>{let{labels:f,coordinate:d}=c;l(),i.publish("click",c),clearInterval(s),o.load(JSON.stringify([d.longitude,d.latitude]));let a=f?.[0];if(a!=null){let h=F(n,a,e);if(!h)return;r.push(h.destroy),h.labelItemFolder.openAnimated()}let p=c.spaces?.[0]??c.objects?.[0];if(p){let h={...p,...n.getState(p),isInView:!1,isInViewCheck:G(n,p.id)},{cleanup:g}=B(n,h,e);s=setInterval(()=>{h.isInView=n.isInView(a||p)},500),r.push(g)}}),{sub:i}}function Se(n,e){let i=new S;n.setHoverColor("#1f3a7a");let t={position:"",hoverColor:E(n.getHoverColor()),intersected:"",type:"",id:""},o=e.add(t,"position").disable();e.add(t,"id").disable().listen(),e.add(t,"type").disable().listen(),e.addColor(t,"hoverColor").onChange(s=>{n.setHoverColor(s)});let r=[];function l(){r.forEach(s=>s()),r.length=0}return n.on("hover",s=>{let{coordinate:c,spaces:f,objects:d,markers:a,labels:p}=s;l(),i.publish("hover",s),o.load(JSON.stringify([c.longitude,c.latitude]));let h=f?.[0]??d?.[0]??a?.[0]??p?.[0];if(!h)return;let g=n.getState(h);g&&(t.type=g.type,t.id=h.id)}),{sub:i}}function G(n,e){return function(){console.log("isInView",n.isInView(e))}}function re(n,e,i){let t={labels:{},all(){i.Labels.__EXPERIMENTAL__all().forEach(h=>{this.labels[h.id]=h}),c()},removeAllLabels(){i.Labels.removeAll().forEach(h=>{delete this.labels[h.id]}),c()}},{addLabel:o,destroy:r}=Te(n,i);n.add(t,"all"),n.add(t,"removeAllLabels");let l=n.addFolder("Label List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.labels[m.id],s.get(m.id)?.destroy()}function h(m){let v=F(i,m,l,{onRemove:b=>{p(b)}});if(!v)return;let{labelItemFolder:u}=v;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("Label");for(let m in t.labels){let v=t.labels[m];h(v)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({labels:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.labels[h.id]=h;c()}return{populatelabels:a,destroy(){r()}}}function Ie(n,e,i,t,o){let{interactive:r,enabled:l,rank:s,anchor:c,dynamicResize:f,zIndex:d,contentHTML:a,lowPriorityPin:p}=t;if(r==null||l==null)throw new Error("incomplete marker state");let h={interactive:r,enabled:l,rank:s||"medium",anchor:Array.isArray(c)?c.join(", "):c||"center",dynamicResize:f||!1,zIndex:d||0,contentHTML:a||"",lowPriorityPin:{enabled:p?.enabled??!0,size:p?.size??8,color:E(p?.color??"#666")},remove(){n.Markers.remove(e),o?.(e),i.destroy()},isInView:G(n,e.id)};i.onChange(m=>{let v={interactive:h.interactive,enabled:h.enabled,rank:h.rank,dynamicResize:h.dynamicResize,contentHTML:h.contentHTML,lowPriorityPin:{enabled:h.lowPriorityPin.enabled,size:h.lowPriorityPin.size,color:h.lowPriorityPin.color}};h.rank==="always-visible"&&(v.zIndex=h.zIndex),n.updateState(e,v)}),i.add(h,"interactive"),i.add(h,"enabled"),i.add(h,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(h,"anchor").name("anchor (read-only)").disable(),i.add(h,"dynamicResize").name("dynamic resize"),h.rank==="always-visible"&&i.add(h,"zIndex",0,1e3,1).name("z-index"),i.add(h,"contentHTML").name("content HTML");let g=i.addFolder("Low Priority Pin");g.add(h.lowPriorityPin,"enabled"),g.add(h.lowPriorityPin,"size",1,20,1),g.addColor(h.lowPriorityPin,"color"),g.close(),i.add(h,"isInView"),i.add(h,"remove")}function De(n,e,i,t,o){let{appearance:r,interactive:l}=t;if(!r||r.margin==null||l==null)throw new Error("incomplte label state");let s={text:e.text,interactive:l,appearance:{...r,margin:r.margin||0,pinColor:r.pinColor?E(r.pinColor):"black",textColor:r.textColor?E(r.textColor):"black"},remove(){n.Labels.remove(e),o?.(e),i.destroy()},isInView:G(n,e.id)};i.onChange(c=>{n.updateState(e,{appearance:s.appearance,interactive:s.interactive})}),i.add(s.appearance,"margin",0,20).name("margin"),i.add(s,"text"),i.add(s,"interactive"),i.addColor(s.appearance,"pinColor").name("pin color"),i.addColor(s.appearance,"pinOutlineColor").name("pin outline color"),i.addColor(s.appearance,"textColor").name("text color"),i.addColor(s.appearance,"textOutlineColor").name("text outline color"),i.add(s,"isInView"),i.add(s,"remove")}function F(n,e,i,{onRemove:t}={}){let o=n.getState(e);if(!o)throw new Error(`error getting state for entity: ${e.id}`);let r=o.type===N?e.text?.substring(0,12)||"Label":`Marker ${e.id.toString().substring(0,8)}`,l=i.addFolder(r);if(l.close(),o.type===N)De(n,e,l,o,t);else if(o.type===ee)Ie(n,e,l,o,t);else throw new Error(`unsupported entity type: ${o.type}`);return{labelItemFolder:l,destroy(){l.destroy()}}}function Te(n,e){let i=n.addFolder("Add"),t={onClick:!1,margin:6,text:"New Label!",interactive:!0,marginForegroundColor:E("skyblue"),marginBackgroundColor:E("coral"),textForegroundColor:E("slategray"),textBackgroundColor:E("white")};return i.add(t,"onClick"),i.add(t,"margin"),i.add(t,"interactive"),i.add(t,"text"),{destroy(){i.destroy()},addLabel(o){return i._closed||!t.onClick?void 0:e.Labels.add(o,t.text,{appearance:{margin:t.margin,pinColor:t.marginForegroundColor,pinOutlineColor:t.marginBackgroundColor,textColor:t.textForegroundColor,textOutlineColor:t.textBackgroundColor},interactive:t.interactive})}}}var se={};y();function ae(n,e,i){let t=n.addFolder("Camera \u{1F4F7}"),o=e.Camera.center.toJSON(),r=document.createElement("div");Object.assign(r.style,{display:"none",position:"absolute",left:"0px",zIndex:999,top:"0px",bottom:"0px",right:"0px",backgroundColor:"aqua",pointerEvents:"none",opacity:.5}),e.container.appendChild(r);let l=()=>e.getDimensions(),[s,c,f,d]=i?.padding??[e.Camera.screenOffsets.top,e.Camera.screenOffsets.right,e.Camera.screenOffsets.bottom,e.Camera.screenOffsets.left],a={center_lat:o.latitude,center_lon:o.longitude,zoomLevel:e.Camera.zoomLevel,pitch:e.Camera.pitch,bearing:e.Camera.bearing,minZoomLevel:e.Camera.minZoomLevel,maxZoomLevel:e.Camera.maxZoomLevel,inset_type:i?.padding?"pixel":e.Camera.screenOffsets.type,inset_top:s,inset_left:d,inset_right:c,inset_bottom:f,animateOnLoad:!0,visualizeInset:!!(s||c||f||d),"Focus on click":i?.focusOnClick??!1,"Focus on current floor":()=>{e.Camera.focusOn([e.currentFloor],{screenOffsets:{top:20,left:20,right:20,bottom:20}})}};function p(){a.inset_type=e.Camera.screenOffsets.type,a.inset_left=e.Camera.screenOffsets.left,a.inset_top=e.Camera.screenOffsets.top,a.inset_right=e.Camera.screenOffsets.right,a.inset_bottom=e.Camera.screenOffsets.bottom;let{width:C,height:k}=l();a.inset_type==="portion"?Object.assign(r.style,{left:a.inset_left*C+"px",top:a.inset_top*k+"px",bottom:a.inset_bottom*k+"px",right:a.inset_right*C+"px"}):Object.assign(r.style,{left:a.inset_left+"px",top:a.inset_top+"px",bottom:a.inset_bottom+"px",right:a.inset_right+"px"})}t.add(a,"center_lat").listen().disable(),t.add(a,"center_lon").listen().disable(),t.add(a,"zoomLevel",16,22,.5).listen().disable(),t.add(a,"pitch").listen().disable(),t.add(a,"bearing").listen().disable(),t.add(a,"minZoomLevel",5,22,.5).onChange(C=>{e.Camera.setMinZoomLevel(C)}),t.add(a,"maxZoomLevel",10,22,.5).onChange(C=>{e.Camera.setMaxZoomLevel(C)}),t.add(a,"animateOnLoad"),t.add(a,"visualizeInset").onChange(q),q(a.visualizeInset);let h,g,m,v;function u(){let{width:C,height:k}=l(),R=e.Camera.screenOffsets.type,j=a.inset_type;R!==j&&(j==="portion"&&R==="pixel"?(a.inset_top=C>0?Math.min(a.inset_top/k,1):0,a.inset_bottom=C>0?Math.min(a.inset_bottom/k,1):0,a.inset_left=k>0?Math.min(a.inset_left/C,1):0,a.inset_right=k>0?Math.min(a.inset_right/C,1):0):j==="pixel"&&R==="portion"&&(a.inset_top=Math.round(a.inset_top*k),a.inset_bottom=Math.round(a.inset_bottom*k),a.inset_left=Math.round(a.inset_left*C),a.inset_right=Math.round(a.inset_right*C))),h&&h.destroy(),g&&g.destroy(),m&&m.destroy(),v&&v.destroy(),a.inset_type==="portion"?(h=t.add(a,"inset_top",0,1,.01).onChange(_),g=t.add(a,"inset_bottom",0,1,.01).onChange(_),m=t.add(a,"inset_left",0,1,.01).onChange(_),v=t.add(a,"inset_right",0,1,.01).onChange(_)):(h=t.add(a,"inset_top",0,k,1).onChange(_),g=t.add(a,"inset_bottom",0,k,1).onChange(_),m=t.add(a,"inset_left",0,C,1).onChange(_),v=t.add(a,"inset_right",0,C,1).onChange(_))}t.add(a,"inset_type",["pixel","portion"]).onChange(()=>{u(),_()}),u();let b=Oe(e);t.add(a,"Focus on click").onChange(C=>{C?e.on("click",b):e.off("click",b)}),a["Focus on click"]&&e.on("click",b),t.add(a,"Focus on current floor");let x=C=>{t._closed||(a.center_lat=C.center.latitude,a.center_lon=C.center.longitude,a.zoomLevel=C.zoomLevel,a.bearing=C.bearing,a.pitch=C.pitch)};e.on("camera-change",x);let L=[()=>{e.off("camera-change",x)}];function _(){e.Camera.setScreenOffsets({top:a.inset_top,left:a.inset_left,right:a.inset_right,bottom:a.inset_bottom,type:a.inset_type}),p()}(a.inset_top||a.inset_right||a.inset_bottom||a.inset_left)&&_();function q(C){p(),C?r.style.display="block":r.style.display="none"}return()=>({destroy(){t.destroy(),ie(L)}})}function Oe(n){return function(i){let{spaces:t,objects:o}=i,r=t?.[0]??o?.[0];r&&n.Camera.focusOn(r)}}y();function le(n,e,i){let t={markers:{},removeAllMarkers(){i.Markers.removeAll().forEach(h=>{delete this.markers[h.id]}),c()}},{addMarker:o,destroy:r}=Pe(n,i);n.add(t,"removeAllMarkers");let l=n.addFolder("Marker List");n.close();let s=new Map,{rerender:c}=f();function f(){function p(m){delete t.markers[m.id],s.get(m.id)?.destroy()}function h(m){let v=F(i,m,l,{onRemove:b=>{p(b)}});if(!v)return;let{labelItemFolder:u}=v;s.set(m.id,u)}function g(){l.destroy(),l=n.addFolder("marker");for(let m in t.markers){let v=t.markers[m];h(v)}}return{rerender:g,add:h,remove:p}}n.domElement.classList.add("list-items");let d;i.on("click",({markers:p,coordinate:h})=>{if(!n._closed)if(p?.[0]){d?.close();let g=s.get(p[0].id);if(n.open(),!g)return;g?.open(),g?.domElement.scrollIntoView({block:"start"}),g?.domElement.focus(),d=g}else o(h)});function a(p){for(let h of p)t.markers[h.id]=h;c()}return{populateMarkers:a,destroy(){r()}}}function Pe(n,e){let i=n.addFolder("Add"),t={onClick:!1,interactive:!0,rank:"medium",anchor:"center",dynamicResize:!1,enabled:!0,zIndex:0,lowPriorityPin:{enabled:!0,size:8,color:"#666"},contentHTML:'<div style="padding: 8px; background: white; border: 2px solid #333; border-radius: 4px;">New Marker</div>'};i.add(t,"onClick"),i.add(t,"interactive"),i.add(t,"enabled"),i.add(t,"rank",["medium","high","always-visible","initial"]).name("rank"),i.add(t,"anchor",["center","top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]).name("anchor"),i.add(t,"dynamicResize").name("dynamic resize"),i.add(t,"zIndex",0,1e3,1).name("z-index (always-visible only)"),i.add(t,"contentHTML").name("content HTML");let o=i.addFolder("Low Priority Pin");return o.add(t.lowPriorityPin,"enabled"),o.add(t.lowPriorityPin,"size",1,20,1),o.addColor(t.lowPriorityPin,"color"),o.close(),{destroy(){i.destroy()},addMarker(r){if(i._closed||!t.onClick)return;let l={interactive:t.interactive,enabled:t.enabled,rank:t.rank,anchor:t.anchor,dynamicResize:t.dynamicResize,lowPriorityPin:{enabled:t.lowPriorityPin.enabled,size:t.lowPriorityPin.size,color:t.lowPriorityPin.color}};return t.rank==="always-visible"&&(l.zIndex=t.zIndex),e.Markers.add(r,t.contentHTML,l)}}}y();function de(n,e){let i=n.addFolder("Walls").close(),t={visible:!0,topColor:"#b1fa87",color:"#e8e8e8",texture:{url:""},topTexture:{url:""}};i.add(t,"visible").onChange(l=>{e.updateState("exterior-walls",{visible:l})}),i.addColor(t,"topColor").onChange(l=>{e.updateState("exterior-walls",{topColor:l})}),i.addColor(t,"color").onChange(l=>{e.updateState("exterior-walls",{color:l})}),i.addFolder("Texture - side").add(t.texture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{texture:{url:l}})}),i.addFolder("Texture - top").add(t.topTexture,"url").onFinishChange(l=>{e.updateState("exterior-walls",{topTexture:{url:l}})}),e.updateState("exterior-walls",{topColor:t.topColor}),e.updateState("exterior-walls",{color:t.color})}y();function ce(n,e,i){n.close();let t={language:i.currentLanguage?.code??"en"},o=i.getByType("enterprise-venue");n.add(t,"language",o?.languages.map(r=>r.code)).onChange(r=>{i.changeLanguage(r)})}y();function he(n,e,i){let t=n.addFolder("Debug");t.close();let o=e.Debug.state,r={showPolygonLabelTextAreaMesh:o.showPolygonLabelTextAreaMesh,showCollisionBoxes:o.showCollisionBoxes,showEnvMap:o.showEnvMap};t.add(r,"showPolygonLabelTextAreaMesh").onChange(l=>{e.Debug.update({showPolygonLabelTextAreaMesh:l})}).name("Show Flat Label Text Area Mesh"),t.add(r,"showCollisionBoxes").onChange(l=>{e.Debug.update({showCollisionBoxes:l})}).name("Show Collision Boxes"),t.add(r,"showEnvMap").onChange(l=>{e.Debug.update({showEnvMap:l})}).name("Show Environment Map"),e.Debug.update(r)}y();function ue(n,e,i){let t=n.addFolder("Text3D").close(),o={all:()=>{e.Text3D.labelAll()},removeAll:()=>{e.Text3D.removeAll()}};t.add(o,"all").name("Show All"),t.add(o,"removeAll").name("Remove All")}y();function pe(n,e,i){let t=n.addFolder("Directions \u{1F5FA}\uFE0F");t.close();let o=localStorage.getItem("directionsMethod"),r=localStorage.getItem("directionsRadius"),l=localStorage.getItem("directionsIncludeDoorBufferNodes")==="true",s={enabled:!1,method:o||"dp-optimal",radius:r?parseFloat(r):.75,includeDoorBufferNodes:l,startCoordinate:"",endCoordinate:"",pathInfo:""},c,f,d;t.add(s,"enabled").name("Enable Click-to-Route").onChange(m=>{m||(c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0))}),t.add(s,"startCoordinate").name("Start").disable().listen(),t.add(s,"endCoordinate").name("End").disable().listen(),t.add(s,"method",{"Greedy LOS":"greedy-los",RDP:"rdp","DP Optimal":"dp-optimal"}).name("Smoothing Method").onChange(m=>{localStorage.setItem("directionsMethod",m),c&&f&&s.enabled&&h(c,f)}),t.add(s,"radius",.1,5,.1).name("Smoothing Radius").onChange(m=>{localStorage.setItem("directionsRadius",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"includeDoorBufferNodes").name("Door Buffers").onChange(m=>{localStorage.setItem("directionsIncludeDoorBufferNodes",String(m)),c&&f&&s.enabled&&h(c,f)}),t.add(s,"pathInfo").name("Path Info").disable().listen();let a={clear:()=>p()};t.add(a,"clear").name("Clear Path");function p(){c=void 0,f=void 0,s.startCoordinate="",s.endCoordinate="",s.pathInfo="",d&&(e.Paths.remove(d),d=void 0)}async function h(m,v){d&&(e.Paths.remove(d),d=void 0);try{let u=await e.getDirections(m,v,{smoothing:{enabled:!0,__EXPERIMENTAL_METHOD:s.method,radius:s.radius,__EXPERIMENTAL_INCLUDE_DOOR_BUFFER_NODES:s.includeDoorBufferNodes}});if(u){d=e.Paths.add(u.coordinates,{interactive:!0,color:"green",width:1});let x=u.distance?.toFixed(2)||"N/A";s.pathInfo=`${u.coordinates.length} pts, ${x}m`}else s.pathInfo="No path found"}catch(u){s.pathInfo=`Error: ${u instanceof Error?u.message:"Unknown"}`}}let g=async m=>{if(s.enabled)if(c){let v=m.coordinate;f=v,s.endCoordinate=`${v.latitude.toFixed(6)}, ${v.longitude.toFixed(6)}`,s.pathInfo="Calculating...",await h(c,f),c=void 0,f=void 0}else{let v=m.coordinate;c=v,s.startCoordinate=`${v.latitude.toFixed(6)}, ${v.longitude.toFixed(6)}`,s.pathInfo="Click to set end..."}};return e.on("click",g),{destroy(){e.off("click",g),t.destroy()}}}y();function fe(n,e){let i=n.addFolder("Spaces Open To Below Visual Effect").close(),t=e.getGlobalState().multiFloorView,o={enabled:t.spacesOpenToBelowVisualEffectEnabled,darkenAmount:t.spacesOpenToBelowVisualEffectDarkenAmount,darkenUseDepth:t.spacesOpenToBelowVisualEffectDarkenUseDepth,desaturateAmount:t.spacesOpenToBelowVisualEffectDesaturateAmount,desaturateUseDepth:t.spacesOpenToBelowVisualEffectDesaturateUseDepth,washOutAmount:t.spacesOpenToBelowVisualEffectWashOutAmount,washOutUseDepth:t.spacesOpenToBelowVisualEffectWashOutUseDepth};function r(){e.updateGlobalState({multiFloorView:{spacesOpenToBelowVisualEffectEnabled:o.enabled,spacesOpenToBelowVisualEffectDarkenAmount:o.darkenAmount,spacesOpenToBelowVisualEffectDarkenUseDepth:o.darkenUseDepth,spacesOpenToBelowVisualEffectDesaturateAmount:o.desaturateAmount,spacesOpenToBelowVisualEffectDesaturateUseDepth:o.desaturateUseDepth,spacesOpenToBelowVisualEffectWashOutAmount:o.washOutAmount,spacesOpenToBelowVisualEffectWashOutUseDepth:o.washOutUseDepth}})}i.add(o,"enabled").name("Enabled").onChange(()=>r());let l=i.addFolder("Darken");l.add(o,"darkenAmount",0,1,.01).name("Amount").onChange(()=>r()),l.add(o,"darkenUseDepth").name("Use Depth").onChange(()=>r());let s=i.addFolder("Desaturate");s.add(o,"desaturateAmount",0,1,.01).name("Amount").onChange(()=>r()),s.add(o,"desaturateUseDepth").name("Use Depth").onChange(()=>r());let c=i.addFolder("Wash Out");c.add(o,"washOutAmount",0,1,.01).name("Amount").onChange(()=>r()),c.add(o,"washOutUseDepth").name("Use Depth").onChange(()=>r())}function me(n,e,i){ze();let t=new z({title:"SDK Controls"});t.domElement.classList.add("mappedin-js-inspector"),oe(e,n,t),ae(t,e,i?.camera);let o=t.addFolder("Levels").close(),r=t.addFolder("Scene Controls");r.close();let l=t.addFolder("Labels");ue(t,e,n);let s=t.addFolder("Markers");de(t,e);let c=t.addFolder("misc");he(t,e,n),fe(t,e),pe(t,e,n),ce(c,e,n);let f={level:e.currentFloor.id},{populatelabels:d}=re(l,n,e),{populateMarkers:a}=le(s,n,e),p=n.getByType("floor").reduce((g,m)=>(g[m.name]=m.id,g),{}),h=o.add(f,"level",p).onChange(g=>{e.setFloor(g),f.level=e.currentFloor.id,h.updateDisplay()});return e.on("floor-change-start",g=>{o.controllers[0].setValue(g.floor.id)}),n.getByType("space").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),n.getByType("object").forEach(g=>{e.updateState(g,{interactive:!0})}),e.setHoverColor("#a2b7e6"),e.Camera.setMaxZoomLevel(20),{populatelabels:d,sceneFolder:r,populateMarkers:a}}var ge="mappedin-sdk-debug-css";function ze(){if(document.getElementById(ge))return;let n=document.createElement("style");n.id=ge,n.textContent=se,document.head.appendChild(n)}var Q=class{_enabled=!1;mv;api;mapData;scenegraphVisualizerMounted=!1;storeStateToLocalStorageEnabled=!1;constructor(e,i){this.mv=e,this.api=i,this.mapData=this.api.getMapData()}setMapData(e){this.mapData=e}async enable(e={}){if(this._enabled)return;if(this._enabled=!0,!this.mapData)throw new Error("Please set mapData before enable debug.");let{sceneFolder:i}=me(this.mapData,this.mv,e);i.onOpenClose(async t=>{if(t===i&&!t._closed&&!this.scenegraphVisualizerMounted){this.scenegraphVisualizerMounted=!0;try{let{mountSceneGraphVisualizer:o}=await import("./src-VJIN6IYN.js");o(this.api.core,i)}catch{}}}),this.api.getMapDataInternal()?.spaces.forEach(t=>{this.mv.updateState(t,{interactive:!0})})}get enabled(){return this._enabled}};export{Q as Inspector};
|