@vertexvis/viewer 0.14.0 → 0.14.1-canary.2
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/dist/cjs/vertex-viewer-pin-group.cjs.entry.js +7 -4
- package/dist/cjs/vertex-viewer.cjs.entry.js +2 -0
- package/dist/collection/components/viewer-pin-group/viewer-pin-group.js +8 -5
- package/dist/collection/lib/interactions/baseInteractionHandler.js +3 -1
- package/dist/custom-elements/index.js +9 -4
- package/dist/esm/vertex-viewer-pin-group.entry.js +7 -4
- package/dist/esm/vertex-viewer.entry.js +2 -0
- package/dist/viewer/p-990f3efe.entry.js +4 -0
- package/dist/viewer/p-ef7c3c47.entry.js +4 -0
- package/dist/viewer/viewer.esm.js +1 -1
- package/package.json +7 -7
- package/dist/viewer/p-6e7e094a.entry.js +0 -4
- package/dist/viewer/p-7c755e0e.entry.js +0 -4
|
@@ -105,16 +105,19 @@ let ViewerPinGroup = class {
|
|
|
105
105
|
}
|
|
106
106
|
const computed = this.computePinPoints(this.pin);
|
|
107
107
|
const { pinPoint, labelPoint } = computed;
|
|
108
|
+
const handleSelectPin = () => {
|
|
109
|
+
var _a, _b;
|
|
110
|
+
(_a = this.pinController) === null || _a === void 0 ? void 0 : _a.setSelectedPinId((_b = this.pin) === null || _b === void 0 ? void 0 : _b.id);
|
|
111
|
+
};
|
|
108
112
|
return (index.h(index.Fragment, null, index.h("vertex-viewer-dom-element", { "data-testid": `drawn-pin-${this.pin.id}`, position: this.pin.worldPosition, onPointerDown: (e) => {
|
|
109
|
-
var _a, _b;
|
|
110
113
|
if (e.buttons !== 2) {
|
|
111
114
|
e.stopPropagation();
|
|
112
115
|
}
|
|
113
|
-
(
|
|
116
|
+
handleSelectPin();
|
|
114
117
|
this.handleAnchorPointerDown(e);
|
|
115
|
-
} }, this.leafNodesRendered && (index.h(PinRenderer, { pin: this.pin, selected: this.selected }))), model.isTextPin(this.pin) && (index.h(index.Fragment, null, index.h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint }), index.h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
118
|
+
} }, this.leafNodesRendered && (index.h(PinRenderer, { pin: this.pin, selected: this.selected }))), model.isTextPin(this.pin) && (index.h(index.Fragment, null, index.h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint, onPointerDown: handleSelectPin }), index.h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
116
119
|
this.labelEl = el;
|
|
117
|
-
}, elementBounds: this.elementBounds, pinController: this.pinController })))));
|
|
120
|
+
}, elementBounds: this.elementBounds, pinController: this.pinController, onPointerDown: handleSelectPin })))));
|
|
118
121
|
}
|
|
119
122
|
invalidateState() {
|
|
120
123
|
this.invalidateStateCounter = this.invalidateStateCounter + 1;
|
|
@@ -1045,6 +1045,8 @@ class BaseInteractionHandler {
|
|
|
1045
1045
|
this.keyboardControls = keyboardControls;
|
|
1046
1046
|
}
|
|
1047
1047
|
handleDownEvent(event) {
|
|
1048
|
+
// Prevent selection of any text while interacting with the model.
|
|
1049
|
+
event.preventDefault();
|
|
1048
1050
|
this.interactionTimer = window.setTimeout(() => {
|
|
1049
1051
|
this.downPosition = bundle_esm.point.create(event.screenX, event.screenY);
|
|
1050
1052
|
this.downPositionCanvas = this.getCanvasPosition(event);
|
|
@@ -59,20 +59,23 @@ export class ViewerPinGroup {
|
|
|
59
59
|
}
|
|
60
60
|
const computed = this.computePinPoints(this.pin);
|
|
61
61
|
const { pinPoint, labelPoint } = computed;
|
|
62
|
+
const handleSelectPin = () => {
|
|
63
|
+
var _a, _b;
|
|
64
|
+
(_a = this.pinController) === null || _a === void 0 ? void 0 : _a.setSelectedPinId((_b = this.pin) === null || _b === void 0 ? void 0 : _b.id);
|
|
65
|
+
};
|
|
62
66
|
return (h(Fragment, null,
|
|
63
67
|
h("vertex-viewer-dom-element", { "data-testid": `drawn-pin-${this.pin.id}`, position: this.pin.worldPosition, onPointerDown: (e) => {
|
|
64
|
-
var _a, _b;
|
|
65
68
|
if (e.buttons !== 2) {
|
|
66
69
|
e.stopPropagation();
|
|
67
70
|
}
|
|
68
|
-
(
|
|
71
|
+
handleSelectPin();
|
|
69
72
|
this.handleAnchorPointerDown(e);
|
|
70
73
|
} }, this.leafNodesRendered && (h(PinRenderer, { pin: this.pin, selected: this.selected }))),
|
|
71
74
|
isTextPin(this.pin) && (h(Fragment, null,
|
|
72
|
-
h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint }),
|
|
75
|
+
h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint, onPointerDown: handleSelectPin }),
|
|
73
76
|
h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
74
77
|
this.labelEl = el;
|
|
75
|
-
}, elementBounds: this.elementBounds, pinController: this.pinController })))));
|
|
78
|
+
}, elementBounds: this.elementBounds, pinController: this.pinController, onPointerDown: handleSelectPin })))));
|
|
76
79
|
}
|
|
77
80
|
invalidateState() {
|
|
78
81
|
this.invalidateStateCounter = this.invalidateStateCounter + 1;
|
|
@@ -273,4 +276,4 @@ export class ViewerPinGroup {
|
|
|
273
276
|
"leafNodesRendered": {}
|
|
274
277
|
}; }
|
|
275
278
|
}
|
|
276
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
279
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlld2VyLXBpbi1ncm91cC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jb21wb25lbnRzL3ZpZXdlci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UFLLENBQUUsV0FBVyxLQUFJLENBQUMsQ0FBQztJQUMzQyxNQUFNLFdBQVcsR0FBRyxDQUFBLEtBQUssYUFBTCxLQUFLLHVCQUFMLEtBQUssQ0FBRSxZQUFZLEtBQUksQ0FBQyxDQUFDO0lBRTdDLE9BQU87TUFDTCxRQUFRO01BQ1IsVUFBVSxFQUFFLHVCQUF1QixDQUFDLGNBQWMsRUFBRSxRQUFRLEVBQUU7UUFDNUQsS0FBSyxFQUFFLFVBQVU7UUFDakIsTUFBTSxFQUFFLFdBQVc7T0FDcEIsQ0FBQztLQUNILENBQUM7RUFDSixDQUFDO0VBY08sb0JBQW9CLENBQzFCLEVBQW1CLEVBQ25CLG9CQUFxQyxFQUNyQyxVQUFpQztJQUVqQyxNQUFNLEtBQUssR0FBRyxPQUFPLENBQUMsZUFBZSxDQUFDLEVBQUUsRUFBRSxvQkFBb0IsQ0FBQyxDQUFDO0lBQ2hFLE9BQU8sUUFBUSxDQUFDLGNBQWMsQ0FBQyxVQUFVLENBQUMsQ0FBQyx5QkFBeUIsQ0FBQyxLQUFLLENBQUMsQ0FBQztFQUM5RSxDQUFDOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBQ0YifQ==
|
|
@@ -106,6 +106,8 @@ export class BaseInteractionHandler {
|
|
|
106
106
|
this.keyboardControls = keyboardControls;
|
|
107
107
|
}
|
|
108
108
|
handleDownEvent(event) {
|
|
109
|
+
// Prevent selection of any text while interacting with the model.
|
|
110
|
+
event.preventDefault();
|
|
109
111
|
this.interactionTimer = window.setTimeout(() => {
|
|
110
112
|
this.downPosition = Point.create(event.screenX, event.screenY);
|
|
111
113
|
this.downPositionCanvas = this.getCanvasPosition(event);
|
|
@@ -276,4 +278,4 @@ export class BaseInteractionHandler {
|
|
|
276
278
|
: false;
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZUludGVyYWN0aW9uSGFuZGxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvaW50ZXJhY3Rpb25zL2Jhc2VJbnRlcmFjdGlvbkhhbmRsZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzVDLE9BQU8sRUFBYyxlQUFlLEVBQVksTUFBTSxrQkFBa0IsQ0FBQztBQUd6RSxPQUFPLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxRQUFRLENBQUM7QUFzQmhELE1BQU0sOEJBQThCLEdBQUcsQ0FBQyxHQUFHLEVBQUUsSUFBSSxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDckUsTUFBTSxpQkFBaUIsR0FBRyxFQUFFLENBQUM7QUFDN0IsTUFBTSxtQkFBbUIsR0FBRyxHQUFHLENBQUM7QUFFaEMsTUFBTSxPQUFnQixzQkFBc0I7RUFtQjFDLFlBQ1ksU0FBc0MsRUFDdEMsT0FBZ0MsRUFDaEMsU0FBc0MsRUFDeEMsaUJBQW9DLEVBQ3BDLHNCQUE4QyxFQUM5QyxlQUFnQyxFQUNoQyxjQUE4QixFQUM5QixnQkFBa0MsRUFDbEMsZ0JBQWtDLEVBQ2xDLFNBQXlCO0lBVHZCLGNBQVMsR0FBVCxTQUFTLENBQTZCO0lBQ3RDLFlBQU8sR0FBUCxPQUFPLENBQXlCO0lBQ2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CLEVBQUUsQ0FBQztJQUMzRCxNQUFNLFlBQVksR0FDaEIsWUFBWSxJQUFJLElBQUk7TUFDbEIsQ0FBQyxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsWUFBWSxDQUFDLElBQUksRUFBRSxZQUFZLENBQUMsR0FBRyxDQUFDO01BQ25ELENBQUMsQ0FBQyxTQUFTLENBQUM7SUFFaEIsT0FBTyxZQUFZLElBQUksSUFBSTtNQUN6QixDQUFDLENBQUMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxPQUFPLEVBQUUsS0FBSyxDQUFDLE9BQU8sQ0FBQyxFQUFFLFlBQVksQ0FBQztNQUMxRSxDQUFDLENBQUMsU0FBUyxDQUFDO0VBQ2hCLENBQUM7RUFFUyxPQUFPLENBQUMsS0FBZ0I7SUFDaEMsT0FBTyxNQUFNLENBQUMsWUFBWSxJQUFJLElBQUksSUFBSSxLQUFLLFlBQVksWUFBWTtNQUNqRSxDQUFDLENBQUMsS0FBSyxDQUFDLFdBQVcsS0FBSyxPQUFPO01BQy9CLENBQUMsQ0FBQyxLQUFLLENBQUM7RUFDWixDQUFDO0NBQ0YifQ==
|
|
@@ -103357,6 +103357,8 @@ class BaseInteractionHandler {
|
|
|
103357
103357
|
this.keyboardControls = keyboardControls;
|
|
103358
103358
|
}
|
|
103359
103359
|
handleDownEvent(event) {
|
|
103360
|
+
// Prevent selection of any text while interacting with the model.
|
|
103361
|
+
event.preventDefault();
|
|
103360
103362
|
this.interactionTimer = window.setTimeout(() => {
|
|
103361
103363
|
this.downPosition = point.create(event.screenX, event.screenY);
|
|
103362
103364
|
this.downPositionCanvas = this.getCanvasPosition(event);
|
|
@@ -110269,16 +110271,19 @@ let ViewerPinGroup = class extends HTMLElement$1 {
|
|
|
110269
110271
|
}
|
|
110270
110272
|
const computed = this.computePinPoints(this.pin);
|
|
110271
110273
|
const { pinPoint, labelPoint } = computed;
|
|
110274
|
+
const handleSelectPin = () => {
|
|
110275
|
+
var _a, _b;
|
|
110276
|
+
(_a = this.pinController) === null || _a === void 0 ? void 0 : _a.setSelectedPinId((_b = this.pin) === null || _b === void 0 ? void 0 : _b.id);
|
|
110277
|
+
};
|
|
110272
110278
|
return (h(Fragment, null, h("vertex-viewer-dom-element", { "data-testid": `drawn-pin-${this.pin.id}`, position: this.pin.worldPosition, onPointerDown: (e) => {
|
|
110273
|
-
var _a, _b;
|
|
110274
110279
|
if (e.buttons !== 2) {
|
|
110275
110280
|
e.stopPropagation();
|
|
110276
110281
|
}
|
|
110277
|
-
(
|
|
110282
|
+
handleSelectPin();
|
|
110278
110283
|
this.handleAnchorPointerDown(e);
|
|
110279
|
-
} }, this.leafNodesRendered && (h(PinRenderer, { pin: this.pin, selected: this.selected }))), isTextPin(this.pin) && (h(Fragment, null, h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint }), h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
110284
|
+
} }, this.leafNodesRendered && (h(PinRenderer, { pin: this.pin, selected: this.selected }))), isTextPin(this.pin) && (h(Fragment, null, h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint, onPointerDown: handleSelectPin }), h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
110280
110285
|
this.labelEl = el;
|
|
110281
|
-
}, elementBounds: this.elementBounds, pinController: this.pinController })))));
|
|
110286
|
+
}, elementBounds: this.elementBounds, pinController: this.pinController, onPointerDown: handleSelectPin })))));
|
|
110282
110287
|
}
|
|
110283
110288
|
invalidateState() {
|
|
110284
110289
|
this.invalidateStateCounter = this.invalidateStateCounter + 1;
|
|
@@ -101,16 +101,19 @@ let ViewerPinGroup = class {
|
|
|
101
101
|
}
|
|
102
102
|
const computed = this.computePinPoints(this.pin);
|
|
103
103
|
const { pinPoint, labelPoint } = computed;
|
|
104
|
+
const handleSelectPin = () => {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
(_a = this.pinController) === null || _a === void 0 ? void 0 : _a.setSelectedPinId((_b = this.pin) === null || _b === void 0 ? void 0 : _b.id);
|
|
107
|
+
};
|
|
104
108
|
return (h(Fragment, null, h("vertex-viewer-dom-element", { "data-testid": `drawn-pin-${this.pin.id}`, position: this.pin.worldPosition, onPointerDown: (e) => {
|
|
105
|
-
var _a, _b;
|
|
106
109
|
if (e.buttons !== 2) {
|
|
107
110
|
e.stopPropagation();
|
|
108
111
|
}
|
|
109
|
-
(
|
|
112
|
+
handleSelectPin();
|
|
110
113
|
this.handleAnchorPointerDown(e);
|
|
111
|
-
} }, this.leafNodesRendered && (h(PinRenderer, { pin: this.pin, selected: this.selected }))), isTextPin(this.pin) && (h(Fragment, null, h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint }), h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
114
|
+
} }, this.leafNodesRendered && (h(PinRenderer, { pin: this.pin, selected: this.selected }))), isTextPin(this.pin) && (h(Fragment, null, h("vertex-viewer-pin-label-line", { id: `pin-label-line-${(_a = this.pin) === null || _a === void 0 ? void 0 : _a.id}`, pinPoint: pinPoint, labelPoint: labelPoint, onPointerDown: handleSelectPin }), h("vertex-viewer-pin-label", { pin: this.pin, ref: (el) => {
|
|
112
115
|
this.labelEl = el;
|
|
113
|
-
}, elementBounds: this.elementBounds, pinController: this.pinController })))));
|
|
116
|
+
}, elementBounds: this.elementBounds, pinController: this.pinController, onPointerDown: handleSelectPin })))));
|
|
114
117
|
}
|
|
115
118
|
invalidateState() {
|
|
116
119
|
this.invalidateStateCounter = this.invalidateStateCounter + 1;
|
|
@@ -1041,6 +1041,8 @@ class BaseInteractionHandler {
|
|
|
1041
1041
|
this.keyboardControls = keyboardControls;
|
|
1042
1042
|
}
|
|
1043
1043
|
handleDownEvent(event) {
|
|
1044
|
+
// Prevent selection of any text while interacting with the model.
|
|
1045
|
+
event.preventDefault();
|
|
1044
1046
|
this.interactionTimer = window.setTimeout(() => {
|
|
1045
1047
|
this.downPosition = point.create(event.screenX, event.screenY);
|
|
1046
1048
|
this.downPositionCanvas = this.getCanvasPosition(event);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import{r as t,c as i,h as s,H as e,g as n}from"./p-2e581b2a.js";import{p as h,v as o,h as r,j as a,r as l,b as c,s as u,d}from"./p-70e5e8a8.js";import{l as v,m as w,n as f,t as p,g as m,p as g,o as y,q as b,S as C,r as P,s as T,u as I,x as D,y as k,z as x,B as S,W as E,C as M,E as O}from"./p-e42cb163.js";import{E as j,m as A,c as R,o as F,u as B,a as z,b as L}from"./p-083f427e.js";import{c as N}from"./p-07aeee89.js";import{p as $}from"./p-c2e3312b.js";import{C as K}from"./p-058632f4.js";import{g as W,c as V}from"./p-99352cf0.js";import{I as q,f as H,C as U,W as G,a as J,b as _,d as X,V as Y,e as Q,g as Z,h as tt,i as it,S as st}from"./p-6d379d4a.js";import{E as et}from"./p-df8fbe56.js";import{V as nt}from"./p-29986489.js";import"./p-dfe5a97d.js";class ht{constructor(t){this.viewer=t,this.handleInteractionStarted=()=>{this.invalidateStencilBuffer(),this.pendingInteractionFinished=new Promise((t=>{this.pendingInteractionFinishedResolver=t}))},this.handleInteractionFinished=()=>{var t;null===(t=this.pendingInteractionFinishedResolver)||void 0===t||t.call(this),this.pendingInteractionFinished=void 0,this.pendingInteractionFinishedResolver=void 0},this.invalidateStencilBuffer=()=>{this.pendingStencilBuffer=void 0},t.addEventListener("interactionStarted",this.handleInteractionStarted),t.addEventListener("interactionFinished",this.handleInteractionFinished),t.addEventListener("frameReceived",(()=>{this.invalidateStencilBuffer()}))}async fetch(){var t;const i=await this.viewer.isSceneReady()?await this.viewer.scene():void 0,s=null!=i&&(i.crossSectioning().current().sectionPlanes.length>0||null!=this.viewer.featureLines),e=null===(t=this.viewer.frame)||void 0===t?void 0:t.scene.camera;if(s&&null!=this.viewer.stream&&null!=e){const t=await this.viewer.stream.getStencilBuffer({includeDepthBuffer:!0}),{stencilBuffer:i,depthBuffer:s,imageAttributes:n}=v(t),[h,o]=await Promise.all([w(new Uint8Array(i)),w(new Uint8Array(s))]);return ot.fromPng(h,n,i,f.fromPng(o,e,n))}}latest(){return null==this.pendingStencilBuffer&&(this.pendingStencilBuffer=this.fetch()),this.pendingStencilBuffer}async latestAfterInteraction(){return await this.pendingInteractionFinished,this.latest()}}class ot{constructor(t,i,s,e,n){this.imageAttr=t,this.imageBytes=i,this.pixelBytes=s,this.imageChannels=e,this.depthBuffer=n}static fromPng(t,i,s,e){if(t.data instanceof Uint8Array){if(1!==t.channels)throw new Error("Expected stencil PNG to have 1 color channel");return new ot(i,s,t.data,t.channels,e)}throw new Error("Expected stencil PNG to have depth of 8-bit")}getValue(t){const{width:i,height:s}=this.imageAttr.imageRect,e=h.subtract(t,this.imageAttr.imageRect),n=1/this.imageAttr.imageScale,o=h.scale(e,n,n);if(o.x>=0&&o.y>=0&&o.x<i&&o.y<s){const t=Math.floor(o.x)+Math.floor(o.y)*i;return this.pixelBytes[t]}return 0}hitTest(t){return 0!==this.getValue(t)}snapToNearestPixel(t,i,s=(()=>!0)){const e=2*i,n=h.create(t.x-i,t.y-i),o=[];for(let r=0;r<e*e;r++){const a=r%e,l=Math.floor(r/e),c=h.add(n,{x:a,y:l});if(h.distance(c,t)<=i){const t=this.getValue(c);255===t&&s(t)&&o.push(c)}}const r=o.sort(((i,s)=>h.distance(i,t)-h.distance(s,t)))[0];return null!=r?h.create(Math.floor(r.x)+.5,Math.floor(r.y)+.5):t}}class rt{constructor(t,i,s){this.stream=t,this.configProvider=i,this.imageScaleProvider=s}predicate(t){return t.altKey&&!t.shiftKey}async fn(t){var i;const s=this.imageScaleProvider(),e=await this.stream.hitItems({point:h.scale(t.position,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1)},!0);null!=(null===(i=e.hitItems)||void 0===i?void 0:i.hits)&&e.hitItems.hits.length>0?await this.stream.flyTo({itemId:e.hitItems.hits[0].itemId,animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit results found for fly to part [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}class at{constructor(t,i,s,e,n,h,o,r,a,l,c){this.stream=t,this.cursors=i,this.getConfig=s,this.getScene=e,this.getFrame=n,this.getViewport=h,this.tapEmitter=o,this.doubleTapEmitter=r,this.longPressEmitter=a,this.interactionStartedEmitter=l,this.interactionFinishedEmitter=c,this.tap=this.tap.bind(this),this.doubleTap=this.doubleTap.bind(this),this.longPress=this.longPress.bind(this),this.emitTapEvent=this.emitTapEvent.bind(this)}addCursor(t,i){return this.cursors.add(t,i)}async getWorldPointFromViewport(t){const i=this.getViewport(),s=this.getFrame();if(null==s)throw new Error("Cannot get world point. Frame is undefined.");const e=await s.depthBuffer();return null!=e?i.transformPointToWorldSpace(t,e,.5):void 0}async getEntityTypeAtPoint(t){var i;const s=this.getViewport(),e=await(null===(i=this.getFrame())||void 0===i?void 0:i.featureMap());if(null!=e){const i=s.transformPointToFrame(t,e);return e.getEntityType(i)}return et.NO_GEOMETRY}getRayFromPoint(t){const i=this.getViewport(),s=this.getFrame();if(null!=s)return i.transformPointToRay(t,s.image,s.scene.camera);throw new Error("Cannot get camera. Frame is undefined.")}async tap(t,i={},s=0){this.emitTapEvent(this.tapEmitter.emit,t,i,s)}async doubleTap(t,i={},s=0){this.emitTapEvent(this.doubleTapEmitter.emit,t,i,s)}async longPress(t,i={},s=0){this.emitTapEvent(this.longPressEmitter.emit,t,i,s)}async beginInteraction(){this.isInteracting()||(this.interactionStartedEmitter.emit(),this.currentCamera=this.getScene().camera(),await this.stream.beginInteraction())}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),e=this.getViewport(),n=this.getFrame(),h=await(null==n?void 0:n.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=e&&null!=n?t({camera:this.currentCamera,viewport:e,scale:s.scale(),boundingBox:s.boundingBox(),frame:n,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}async twistCamera(...t){return this.transformCamera((({camera:i,viewport:s})=>{const e=o.normalize(o.subtract(i.lookAt,i.position));if(1===t.length&&"number"==typeof t[0]){const s=r.toRadians(-t[0]);return i.rotateAroundAxis(s,e)}if(1===t.length){const e=h.create(s.width/2,s.height/2),n=r.toDegrees(r.fromPoints(e,t[0])),a=null!=this.lastAngle?n-this.lastAngle:0;this.lastAngle=n;const l=o.normalize(o.subtract(i.lookAt,i.position)),c=r.toRadians(-a);return i.rotateAroundAxis(c,l)}return i}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:e,depthBuffer:n})=>{if(null==this.panData){const h=i.toFrameCamera(),o=h.direction,r=e.transformPointToRay(t,s.image,h),c=a.fromNormalAndCoplanarPoint(o,i.lookAt),u=l.intersectPlane(r,c);if(null==u)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;const d=null!=n?this.getWorldPoint(t,n,u):u,v=a.fromNormalAndCoplanarPoint(o,d);this.panData={hitPt:d,hitPlane:v,startingCamera:h}}if(null!=this.panData){const{hitPt:n,hitPlane:h,startingCamera:r}=this.panData,a=e.transformPointToRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(n,c);return i.update(r).moveBy(t)}}return i}))}async viewAll(){await this.getScene().camera().viewAll().render()}async rotateCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const e=o.normalize(i.up),n=o.normalize(o.subtract(i.lookAt,i.position)),h=o.cross(e,n),r=o.cross(n,h),a=o.normalize({x:t.x*h.x+t.y*r.x,y:t.x*h.y+t.y*r.y,z:t.x*h.z+t.y*r.z}),l=o.cross(a,n),c=3*Math.PI*t.x/s.width,u=3*Math.PI*t.y/s.height,d=Math.abs(c)+Math.abs(u);return i.rotateAroundAxis(d,l)}))}async rotateCameraAtPoint(t,i){return this.transformCamera((({camera:s,viewport:e,boundingBox:n,depthBuffer:h})=>{if(null==this.worldRotationPoint){const t=c.center(n);this.worldRotationPoint=null!=h?this.getWorldPoint(i,h,t):s.lookAt}const r=o.normalize(s.up),a=o.normalize(o.subtract(s.lookAt,s.position)),l=o.cross(r,a),u=o.cross(a,l),d=o.normalize({x:t.x*l.x+t.y*u.x,y:t.x*l.y+t.y*u.y,z:t.x*l.z+t.y*u.z}),v=o.cross(d,a),w=3*Math.PI*t.x/e.width,f=3*Math.PI*t.y/e.height,p=Math.abs(w)+Math.abs(f),m=s.rotateAroundAxisAtPoint(p,this.worldRotationPoint,v);return m.update({lookAt:o.add(o.scale(Math.abs(s.signedDistanceToBoundingBoxCenter())/o.magnitude(m.viewVector),m.viewVector),m.position)})}))}async zoomCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const e=i.viewVector,n=o.normalize(e),h=o.magnitude(e),r=o.add(i.position,o.scale(3*h*t/s.height,n));return i.update({position:r})}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:e,frame:n,depthBuffer:h})=>{const r=n.scene.camera,c=r.direction,u=s.toFrameCamera(),d=e.transformPointToRay(t,n.image,u);if(null==this.zoomData){const i=a.fromNormalAndCoplanarPoint(c,r.lookAt),e=l.intersectPlane(d,i);if(null==e)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const n=null!=h?this.getWorldPoint(t,h,e):e,o=a.fromNormalAndCoplanarPoint(c,n);this.zoomData={hitPt:n,hitPlane:o}}if(null!=this.zoomData){const{hitPt:t,hitPlane:n}=this.zoomData,h=o.distance(s.position,t),r=l.at(d,6*h*i/e.height),c=a.projectPoint(n,r),u=s.update({position:r,lookAt:c});if(o.distance(r,c)>=u.near)return u}return s}))}async pivotCamera(t,i){return this.transformCamera((({camera:s})=>{const{position:e,up:n,lookAt:h}=s,a=o.normalize(n),l=o.normalize(s.viewVector),c=o.cross(a,l),u=o.cross(l,c),d=o.rotateAboutAxis(r.toRadians(t),h,c,e),v=o.rotateAboutAxis(r.toRadians(i),d,u,e);return s.update(Object.assign(Object.assign({},s),{lookAt:v}))}))}async endInteraction(){this.isInteracting()&&(this.currentCamera=void 0,this.worldRotationPoint=void 0,this.panData=void 0,this.zoomData=void 0,this.resetLastAngle(),this.interactionFinishedEmitter.emit(),await this.stream.endInteraction())}resetLastAngle(){this.lastAngle=void 0}isInteracting(){return null!=this.currentCamera}pixelThreshold(t){return(this.isCoarseInputDevice(t)?this.getConfig().coarsePointerThreshold:this.getConfig().finePointerThreshold)*window.devicePixelRatio}async hitItems(t){var i;const s=await this.getScene().raycaster().hitItems(t);return null!==(i=null==s?void 0:s.hits)&&void 0!==i?i:[]}emitTapEvent(t,i,s={},e=0){const{altKey:n=!1,ctrlKey:h=!1,metaKey:o=!1,shiftKey:r=!1}=s;t({position:i,altKey:n,ctrlKey:h,metaKey:o,shiftKey:r,buttons:e})}isCoarseInputDevice(t){return t||window.matchMedia("(pointer: coarse)").matches}getWorldPoint(t,i,s){const e=this.getViewport(),n=e.transformPointToFrame(t,i);return i.hitTest(n)?e.transformPointToWorldSpace(t,i):s}}class lt extends at{constructor(t,i,s,e,n,h,o,r,a,l,c){super(t,i,s,e,n,h,o,r,a,l,c)}async getWorldPointFromViewport(t){const i=this.getViewport(),s=this.getFrame();if(null==s)throw new Error("Cannot get world point. Frame is undefined.");const e=await s.depthBuffer();return null!=e?i.transformPointToOrthographicWorldSpace(t,e,.5):void 0}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{const e=i.viewVector,n=o.normalize(i.up),h=o.normalize(e),r=o.magnitude(e)*Math.tan(i.fovHeight),a=t.x*r/s.width,l=t.y/s.width*r,c=o.cross(n,h),u=o.cross(h,c),d=o.add(o.scale(a,c),o.scale(l,u));return i.moveBy(d)}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:e})=>{if(null==this.panData){const n=i.toFrameCamera(),h=n.direction,o=e.transformPointToOrthographicRay(t,s.image,n),r=a.fromNormalAndCoplanarPoint(h,i.lookAt),c=l.intersectPlane(o,r);if(null==c)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;this.panData={hitPt:c,hitPlane:r,startingCamera:n}}if(null!=this.panData){const{hitPt:n,hitPlane:h,startingCamera:r}=this.panData,a=e.transformPointToOrthographicRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(n,c);return i.update({lookAt:o.add(r.lookAt,t)})}}return i}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:e,frame:n,depthBuffer:r})=>{if(null==this.orthographicZoomData||h.distance(t,this.orthographicZoomData.startingScreenPt)>2){const i=s.toFrameCamera(),h=i.direction,o=e.transformPointToOrthographicRay(t,n.image,i),c=a.fromNormalAndCoplanarPoint(h,i.lookAt),u=l.intersectPlane(o,c);if(null==u)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const d=null!=r?this.getWorldPoint(t,r,u):u,v=a.fromNormalAndCoplanarPoint(h,d);this.orthographicZoomData={hitPt:d,hitPlane:v,startingScreenPt:t}}if(null!=this.orthographicZoomData){const{hitPt:t,hitPlane:n}=this.orthographicZoomData,h=s.fovHeight/e.height*2*i,r=Math.max(1,s.fovHeight-h),l=a.projectPoint(n,s.lookAt),c=o.scale((s.fovHeight-r)/s.fovHeight,o.subtract(t,l));return s.update({lookAt:o.add(s.lookAt,c),fovHeight:Math.max(1,s.fovHeight-h)})}return s}))}getWorldPoint(t,i,s){const e=this.getViewport(),n=e.transformPointToFrame(t,i);return i.hitTest(n)?e.transformPointToOrthographicWorldSpace(t,i):s}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),e=this.getViewport(),n=this.getFrame(),h=await(null==n?void 0:n.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=e&&null!=n?t({camera:this.currentCamera,viewport:e,scale:s.scale(),boundingBox:s.boundingBox(),frame:n,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ct extends at{constructor(t,i,s,e,n,h,o,r,a,l,c){super(t,i,s,e,n,h,o,r,a,l,c)}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{var e;const n=i.viewVector,h=o.normalize(i.up),r=o.normalize(n),a=o.magnitude(n)*Math.tan(null!==(e=i.fovY)&&void 0!==e?e:45),l=t.x*a/s.width,c=t.y/s.width*a,u=o.cross(h,r),d=o.cross(r,u),v=o.add(o.scale(l,u),o.scale(c,d));return i.moveBy(v)}))}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),e=this.getViewport(),n=this.getFrame(),h=await(null==n?void 0:n.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=e&&null!=n?t({camera:this.currentCamera,viewport:e,scale:s.scale(),boundingBox:s.boundingBox(),frame:n,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ut{constructor(t,i,s,e){this.stream=t,this.configProvider=i,this.imageScaleProvider=s,this.sceneProvider=e}predicate(t){return t.altKey&&t.shiftKey}async fn(t){var i,s;const e=this.imageScaleProvider(),n=await this.stream.hitItems({point:h.scale(t.position,(null==e?void 0:e.x)||1,(null==e?void 0:e.y)||1)},!0);if(null!=(null===(i=n.hitItems)||void 0===i?void 0:i.hits)&&n.hitItems.hits.length>0&&null!=n.hitItems.hits[0].hitPoint){const i=this.sceneProvider().camera(),e=n.hitItems.hits[0];null!=e.hitPoint&&null!=e.hitPoint.x&&null!=e.hitPoint.y&&null!=e.hitPoint.z?await this.stream.flyTo({camera:m(i.update({lookAt:o.create(e.hitPoint.x,e.hitPoint.y,e.hitPoint.z)}).toFrameCamera()),animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit position found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}, hit-id={${null===(s=e.itemId)||void 0===s?void 0:s.hex}}]`)}else console.debug(`No hit results found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}const dt=[.2,.15,.25,.25,.15];class vt{constructor(t,i,s,e,n,h,o,r,a,l){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.rotateInteraction=e,this.rotatePointInteraction=n,this.zoomInteraction=h,this.panInteraction=o,this.twistInteraction=r,this.pivotInteraction=a,this.getConfig=l,this.primaryInteraction=this.rotateInteraction,this.isDragging=!1,this.keyboardControls=!1,this.disableIndividualInteractions=!1,this.primaryInteractionTypeChange=new j,this.handleDownEvent=this.handleDownEvent.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleWindowMove=this.handleWindowMove.bind(this),this.handleWindowUp=this.handleWindowUp.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this)}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDownEvent),t.addEventListener("mousedown",this.handleDoubleClick),t.addEventListener("wheel",this.handleMouseWheel)}dispose(){var t,i,s;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDownEvent),null===(i=this.element)||void 0===i||i.removeEventListener("mousedown",this.handleDoubleClick),null===(s=this.element)||void 0===s||s.removeEventListener("wheel",this.handleMouseWheel),this.element=void 0}onPrimaryInteractionTypeChange(t){return this.primaryInteractionTypeChange.on(t)}setCurrentInteractionType(t){var i;switch(t){case"rotate":this.currentInteraction=this.rotateInteraction;break;case"zoom":this.currentInteraction=this.zoomInteraction;break;case"pan":this.currentInteraction=this.panInteraction;break;case"twist":this.currentInteraction=this.twistInteraction;break;case"rotate-point":this.currentInteraction=this.rotatePointInteraction;break;case"pivot":this.currentInteraction=this.pivotInteraction;break;default:this.currentInteraction=void 0}if(this.draggingInteraction){const t=this.draggingInteraction.getPosition();this.draggingInteraction=this.currentInteraction||this.primaryInteraction,null===(i=this.interactionApi)||void 0===i||i.resetLastAngle(),this.draggingInteraction.setPosition(t)}}getPrimaryInteractionType(){return this.primaryInteraction.getType()}getCurrentInteractionType(){return(this.currentInteraction||this.primaryInteraction).getType()}setPrimaryInteractionType(t){switch(t){case"rotate":this.primaryInteraction=this.rotateInteraction;break;case"rotate-point":this.primaryInteraction=this.rotatePointInteraction;break;case"zoom":this.primaryInteraction=this.zoomInteraction;break;case"pan":this.primaryInteraction=this.panInteraction;break;case"pivot":this.primaryInteraction=this.pivotInteraction}this.primaryInteractionTypeChange.emit()}setDefaultKeyboardControls(t){this.keyboardControls=t}handleDownEvent(t){t.preventDefault(),this.interactionTimer=window.setTimeout((()=>{this.downPosition=h.create(t.screenX,t.screenY),this.downPositionCanvas=this.getCanvasPosition(t),this.interactionTimer=void 0,null!=this.lastMoveEvent&&this.handleWindowMove(this.lastMoveEvent)}),this.getConfig().interactions.interactionDelay),window.addEventListener(this.moveEvent,this.handleWindowMove),window.addEventListener(this.upEvent,this.handleWindowUp)}handleWindowMove(t){if(null==this.interactionTimer){if(this.disableIndividualInteractions)return;const i=h.create(t.screenX,t.screenY),s=null!=this.interactionApi?this.interactionApi.pixelThreshold(this.isTouch(t)):2;null!=this.downPosition&&h.distance(i,this.downPosition)>=s&&!this.isDragging&&(this.beginDrag(t),this.isDragging=!0),this.isDragging&&this.drag(t)}this.lastMoveEvent=t}async handleWindowUp(t){this.isDragging&&(this.endDrag(t),this.isDragging=!1),null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0),window.removeEventListener(this.moveEvent,this.handleWindowMove),window.removeEventListener(this.upEvent,this.handleWindowUp),this.lastMoveEvent=void 0}async handleDoubleClick(t){2===t.detail&&4===t.buttons&&null!=this.interactionApi&&this.interactionApi.viewAll()}beginDrag(t){this.keyboardControls&&t.metaKey&&t.shiftKey?this.currentInteraction=this.rotatePointInteraction:this.keyboardControls&&t.shiftKey?this.currentInteraction=this.zoomInteraction:this.keyboardControls&&(t.metaKey||t.ctrlKey)?this.currentInteraction=this.panInteraction:this.keyboardControls&&t.altKey&&(this.currentInteraction=this.rotateInteraction),1===t.buttons||4===t.buttons?this.draggingInteraction=this.currentInteraction||this.primaryInteraction:2===t.buttons&&(this.draggingInteraction=this.panInteraction),null!=this.draggingInteraction&&null!=this.interactionApi&&null!=this.element&&(this.zoomInteraction.endDrag(t,this.interactionApi),this.draggingInteraction.beginDrag(t,this.downPositionCanvas||h.create(t.clientX,t.clientY),this.interactionApi,this.element))}drag(t){this.currentInteraction=this.keyboardControls&&t.altKey&&t.shiftKey?this.twistInteraction:void 0,this.draggingInteraction=this.currentInteraction||this.draggingInteraction||this.primaryInteraction,null!=this.draggingInteraction&&null!=this.interactionApi&&this.draggingInteraction.drag(t,this.interactionApi)}endDrag(t){this.keyboardControls&&this.currentInteraction===this.twistInteraction&&(this.currentInteraction=void 0),null!=this.draggingInteraction&&null!=this.interactionApi&&(this.draggingInteraction.endDrag(t,this.interactionApi),this.draggingInteraction=void 0)}handleMouseWheel(t){if(t.preventDefault(),null!=this.element&&null!=this.interactionApi&&4!==t.buttons){const i=-this.wheelDeltaToPixels(t.deltaY,t.deltaMode)/10,s=this.element.getBoundingClientRect(),e=W(t,s);dt.forEach(((t,s)=>{window.setTimeout((()=>{null!=this.interactionApi&&this.zoomInteraction.zoomToPoint(e,i*t,this.interactionApi)}),2*s)}))}}wheelDeltaToPixels(t,i){null==this.computedBodyStyle&&(this.computedBodyStyle=window.getComputedStyle(document.body));const s=null==this.computedBodyStyle.fontSize||""===this.computedBodyStyle.fontSize||isNaN(parseFloat(this.computedBodyStyle.fontSize))?19.2:1.2*parseFloat(this.computedBodyStyle.fontSize);return 1===i?null==this.computedBodyStyle.lineHeight||""===this.computedBodyStyle.lineHeight||isNaN(parseFloat(this.computedBodyStyle.lineHeight))?t*s:t*parseFloat(this.computedBodyStyle.lineHeight):2===i?null==this.computedBodyStyle.height||""===this.computedBodyStyle.height||isNaN(parseFloat(this.computedBodyStyle.height))?t*window.innerHeight:t*parseFloat(this.computedBodyStyle.height):t}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),e=null!=s?h.create(s.left,s.top):void 0;return null!=e?h.subtract(h.create(t.clientX,t.clientY),e):void 0}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class wt{setPosition(t){this.currentPosition=t}getPosition(){return this.currentPosition}getType(){return this.type}beginDrag(t,i,s,e){}drag(t,i){}endDrag(t,i){null!=this.currentPosition&&(i.endInteraction(),this.currentPosition=void 0)}zoom(t,i){}}class ft extends wt{constructor(){super(...arguments),this.type="rotate"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.screenX,t.screenY),e=h.subtract(s,this.currentPosition);i.rotateCamera(e),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class pt extends wt{constructor(){super(...arguments),this.type="rotate-point"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.startingPosition=i,s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.startingPosition){const s=h.create(t.screenX,t.screenY),e=h.subtract(s,this.currentPosition);i.rotateCameraAtPoint(e,this.startingPosition),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class mt extends wt{constructor(t=1e3){super(),this.interactionTimeout=t,this.type="zoom",this.didTransformBegin=!1}beginDrag(t,i,s,e){if(null==this.currentPosition){this.currentPosition=h.create(t.clientX,t.clientY);const i=e.getBoundingClientRect(),n=W(t,i);this.startPt=n,s.beginInteraction()}}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.clientX,t.clientY),e=h.subtract(s,this.currentPosition);null!=this.startPt&&(i.zoomCameraToPoint(this.startPt,e.y),this.currentPosition=s)}}endDrag(t,i){super.endDrag(t,i),this.stopInteractionTimer(),this.didTransformBegin=!1,this.startPt=void 0}zoom(t,i){this.operateWithTimer(i,(()=>i.zoomCamera(t)))}zoomToPoint(t,i,s){this.operateWithTimer(s,(()=>s.zoomCameraToPoint(t,i)))}beginInteraction(t){this.didTransformBegin=!0,t.beginInteraction()}endInteraction(t){this.didTransformBegin=!1,t.endInteraction()}resetInteractionTimer(t){this.stopInteractionTimer(),this.startInteractionTimer(t)}startInteractionTimer(t){this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0,this.endInteraction(t)}),this.interactionTimeout)}stopInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}operateWithTimer(t,i){this.didTransformBegin||this.beginInteraction(t),this.resetInteractionTimer(t),i()}}class gt extends wt{constructor(){super(...arguments),this.type="pan"}beginDrag(t,i,s,e){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.canvasRect=e.getBoundingClientRect(),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.canvasRect){const s=W(t,this.canvasRect);i.panCameraToScreenPoint(s),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class yt extends wt{constructor(){super(...arguments),this.type="twist"}beginDrag(t,i,s){this.currentPosition=h.create(t.clientX,t.clientY),s.beginInteraction()}drag(t,i){const s=h.create(t.clientX,t.clientY);this.currentPosition=s,i.twistCamera(s)}endDrag(t,i){super.endDrag(t,i)}}class bt extends wt{constructor(){super(...arguments),this.type="pivot"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.screenX,t.screenY),e=h.subtract(s,this.currentPosition);i.pivotCamera(-.25*e.y,.25*e.x),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Ct extends vt{constructor(t,i=new ft,s=new pt,e=new mt,n=new gt,h=new yt,o=new bt){super("mousedown","mouseup","mousemove",i,s,e,n,h,o,t)}}class Pt{initialize(t,i){this.element=t,this.interactionApi=i}dispose(){this.element=void 0}handleTwoPointTouchMove(t,i){var s,e,n,o;if(null!=this.currentPosition1&&null!=this.currentPosition2){const a=h.scale(h.add(h.subtract(t,this.currentPosition1),h.subtract(i,this.currentPosition2)),.25,.25),l=.5*(h.distance(t,i)-h.distance(this.currentPosition1,this.currentPosition2)),c=u.create(h.subtract(this.currentPosition1,this.currentPosition2),h.subtract(t,i)),d=r.toDegrees(Math.atan2(u.determinant(c),u.dot(c)));null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(e=this.interactionApi)||void 0===e||e.zoomCamera(l),null===(n=this.interactionApi)||void 0===n||n.panCameraByDelta(a),Math.abs(d)>.5&&(null===(o=this.interactionApi)||void 0===o||o.twistCamera(d))}this.currentPosition1=t,this.currentPosition2=i}}class Tt extends Pt{constructor(){super(),this.touchPoints={},this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("pointerdown",this.handlePointerDown),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){const i=h.create(t.screenX,t.screenY);this.touchPoints=Object.assign(Object.assign({},this.touchPoints),{[t.pointerId]:i}),1===Object.keys(this.touchPoints).length&&(window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){null!=this.touchPoints[t.pointerId]&&(this.touchPoints[t.pointerId]=h.create(t.screenX,t.screenY));const i=Object.keys(this.touchPoints);2===i.length&&this.handleTwoPointTouchMove(this.touchPoints[i[0]],this.touchPoints[i[1]])}handlePointerUp(t){var i;delete this.touchPoints[t.pointerId];const s=Object.keys(this.touchPoints);1===s.length&&(null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.currentPosition1=void 0,this.currentPosition2=void 0),0===s.length&&(window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp))}}class It extends vt{constructor(t){super("pointerdown","pointerup","pointermove",new ft,new pt,new mt,new gt,new yt,new bt,t),this.touchPoints=new Set,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){this.downPosition=h.create(t.screenX,t.screenY),this.touchPoints.add(t.pointerId),1===this.touchPoints.size&&window.addEventListener("pointerup",this.handlePointerUp),2===this.touchPoints.size&&(this.disableIndividualInteractions=!0)}handlePointerUp(t){this.touchPoints.delete(t.pointerId),this.touchPoints.size<2&&(this.disableIndividualInteractions=!1),0===this.touchPoints.size&&window.removeEventListener("pointerup",this.handlePointerUp)}}class Dt{constructor(t,i,s,e){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.getConfig=e,this.handleDown=this.handleDown.bind(this),this.handleUp=this.handleUp.bind(this),this.handleMove=this.handleMove.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerEnd=this.handlePointerEnd.bind(this),this.clearPositions=this.clearPositions.bind(this),this.restartDoubleTapTimer=this.restartDoubleTapTimer.bind(this),this.clearDoubleTapTimer=this.clearDoubleTapTimer.bind(this),this.restartLongPressTimer=this.restartLongPressTimer.bind(this),this.clearLongPressTimer=this.clearLongPressTimer.bind(this),this.setPointerPositions=this.setPointerPositions.bind(this),this.emit=this.emit.bind(this)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDown),null===(i=this.element)||void 0===i||i.removeEventListener("touchstart",this.handleTouchStart),this.element=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer()}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDown),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){1===t.touches.length&&(this.setPointerPositions(h.create(t.touches[0].clientX,t.touches[0].clientY)),this.restartLongPressTimer(),window.addEventListener("touchend",this.handleTouchEnd),window.addEventListener("touchmove",this.handleTouchMove))}handleTouchMove(t){t.touches.length>0&&this.handlePointerMove(h.create(t.touches[0].clientX,t.touches[0].clientY),!0)}handleTouchEnd(t){null!=this.pointerDownPosition&&(window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchmove",this.handleTouchMove)),this.handlePointerEnd(this.pointerDownPosition)}handleDown(t){this.setPointerPositions(h.create(t.clientX,t.clientY)),this.buttons=t.buttons,this.restartLongPressTimer({altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}),window.addEventListener(this.upEvent,this.handleUp),window.addEventListener(this.moveEvent,this.handleMove)}handleMove(t){this.handlePointerMove(h.create(t.clientX,t.clientY),this.isTouch(t))}handleUp(t){null!=this.pointerDownPosition&&(window.removeEventListener(this.upEvent,this.handleUp),window.removeEventListener(this.moveEvent,this.handleMove)),this.handlePointerEnd(h.create(t.clientX,t.clientY),{altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},this.buttons,this.isTouch(t)),this.buttons=void 0}handlePointerMove(t,i){var s;const e=(null===(s=this.interactionApi)||void 0===s?void 0:s.pixelThreshold(i))||2;null!=this.pointerDownPosition&&h.distance(t,this.pointerDownPosition)>=e&&null==this.interactionTimer&&this.clearPositions()}handlePointerEnd(t,i={},s=0,e=!1){var n,h;null!=t&&(null!=this.longPressTimer&&this.emit(null===(n=this.interactionApi)||void 0===n?void 0:n.tap)(t,i,s),null!=this.doubleTapTimer&&null!=this.secondPointerDownPosition&&(this.emit(null===(h=this.interactionApi)||void 0===h?void 0:h.doubleTap)(t,i,s,this.secondPointerDownPosition),this.clearDoubleTapTimer())),this.pointerDownPosition=void 0,this.clearLongPressTimer()}emit(t){return(i,s={},e=0,n,o=!1)=>{var r;const a=n||this.pointerDownPosition,l=(null===(r=this.interactionApi)||void 0===r?void 0:r.pixelThreshold(o))||1;let c;null!=this.interactionTimer?c=this.getCanvasPosition(a||i):null!=a&&h.distance(a,i)<=l&&(c=this.getCanvasPosition(i)),null!=c&&null!=t&&t(c,s,e)}}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),e=null!=s?h.create(s.left,s.top):void 0;return null!=e?h.subtract(h.create(t.x,t.y),e):void 0}clearPositions(){this.pointerDownPosition=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer(),this.clearInteractionTimer()}clearDoubleTapTimer(){null!=this.doubleTapTimer&&window.clearTimeout(this.doubleTapTimer),this.doubleTapTimer=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0}restartDoubleTapTimer(){this.clearDoubleTapTimer(),this.doubleTapTimer=window.setTimeout((()=>this.clearDoubleTapTimer()),this.getConfig().events.doubleTapThreshold)}clearLongPressTimer(){null!=this.longPressTimer&&window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0}restartLongPressTimer(t={}){this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((()=>{var i;this.pointerDownPosition&&this.emit(null===(i=this.interactionApi)||void 0===i?void 0:i.longPress)(this.pointerDownPosition,t,this.buttons),this.clearLongPressTimer()}),this.getConfig().events.longPressThreshold)}restartInteractionTimer(){this.clearInteractionTimer(),this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0}),this.getConfig().interactions.interactionDelay)}clearInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}setPointerPositions(t){this.pointerDownPosition=t,this.restartInteractionTimer(),null==this.firstPointerDownPosition?(this.restartDoubleTapTimer(),this.firstPointerDownPosition=t):this.secondPointerDownPosition=t}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class kt extends Pt{constructor(){super(),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("touchstart",this.handleTouchStart),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){if(t.touches.length>=1){const i=t.touches[0],s=t.touches[1];this.currentPosition1=h.create(i.screenX,i.screenY),this.currentPosition2=null!=s?h.create(s.screenX,s.screenY):void 0,window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchEnd)}}handleTouchMove(t){if(1===t.touches.length)this.handleOnePointTouchMove(t.touches[0]);else if(2===t.touches.length){const i=h.create(t.touches[0].clientX,t.touches[0].clientY),s=h.create(t.touches[1].clientX,t.touches[1].clientY);this.handleTwoPointTouchMove(i,s)}}handleTouchEnd(t){var i;null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.isInteracting=!1,window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)}handleOnePointTouchMove(t){var i,s,e;const n=h.create(t.screenX,t.screenY);if(null!=this.currentPosition1){const t=h.subtract(n,this.currentPosition1),o=(null===(i=this.interactionApi)||void 0===i?void 0:i.pixelThreshold(!0))||2;(h.distance(n,this.currentPosition1)>=o||this.isInteracting)&&(null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(e=this.interactionApi)||void 0===e||e.rotateCamera(t),this.isInteracting=!0)}this.currentPosition1=n}}const xt=new class{constructor(t,i=window.performance){this.name=t,this.perf=i,this.measures=new Set,this.nextId=0}clearMeasurements(){this.perf.clearMeasures(this.name)}measure(t){if(null!=(i=t)&&i.then instanceof Function&&i.catch instanceof Function&&i.finally instanceof Function){const i=this.begin();return t.finally((()=>this.end(i)))}if("function"==typeof t){const i=this.begin(),s=t();return this.end(i),s}throw new Error("Input must be a function or Promise");var i}takeMeasurements(){const t=this.perf.getEntriesByName(this.name);return this.clearMeasurements(),t}takeLastMeasurement(){const t=this.takeMeasurements();return t[t.length-1]}begin(){const t=`${this.name}-${this.nextId++}`;return this.measures.add(t),this.perf.mark(t),t}end(t){this.perf.measure(this.name,t),this.perf.clearMarks(t),this.measures.delete(t)}}("paint_time");function St(t,i,s,e,n=1e3){let h,o,r=0,a=[];return s&&setInterval((()=>{if(null!=o){5===a.length?a=[...a.slice(1),o]:a.push(o);const t=a.reduce(((t,i)=>t+i))/a.length;console.debug(`Paint rate: ${o}fps`),console.debug(`Paint rate (avg): ${t}`),o=void 0}}),1e3),s=>(r++,null==h&&(h=setInterval((()=>{!function(t,i){const s=t.takeMeasurements();s.length>0&&i(s)}(t,e),0===r&&null!=h&&(clearInterval(h),h=void 0)}),n)),t.measure((async()=>{const t=await i(s);return o=null==o?1:o+1,t})).finally((()=>{r--})))}var Et;!function(t){t.DEVICE_ID="vertexvis:device-id"}(Et||(Et={}));class Mt extends C{constructor(t,i={}){var s,e,n;super(t,{loggingEnabled:i.loggingEnabled}),this.state={type:"disconnected"},this.stateChanged=new j,this.dimensions=d.create(0,0),this.streamAttributes={},this.frameBgColor=R.create(255,255,255),this.config=$("platprod"),this.options={tokenRefreshOffsetInSeconds:null!==(s=i.tokenRefreshOffsetInSeconds)&&void 0!==s?s:30,offlineThresholdInSeconds:null!==(e=i.offlineThresholdInSeconds)&&void 0!==e?e:30,loadTimeoutInSeconds:null!==(n=i.loadTimeoutInSeconds)&&void 0!==n?n:15}}getState(){return this.state}disconnect(){"disconnected"!==this.state.type&&"connection-failed"!==this.state.type&&(console.debug("Disconnecting websocket"),this.state.connection.dispose(),this.updateState({type:"disconnected"}))}async load(t,i,s,e=$("platprod")){return this.clientId=i,this.deviceId=s,this.config=e,"disconnected"===this.state.type||"connection-failed"===this.state.type?this.loadIfDisconnected(t):this.loadIfConnectingOrConnected(t,this.state)}update(t){this.frameBgColor=t.frameBgColor?t.frameBgColor:this.frameBgColor,null!=t.dimensions&&t.dimensions!==this.dimensions&&(this.dimensions=t.dimensions,this.ifState("connected",(()=>this.updateDimensions({dimensions:this.dimensions})))),null!=t.streamAttributes&&this.streamAttributes!==t.streamAttributes&&(this.streamAttributes=t.streamAttributes,this.ifState("connected",(()=>this.updateStream({streamAttributes:Ot(this.streamAttributes)}))))}async loadIfConnectingOrConnected(t,i){const{resource:s,queries:e}=i.resource,n=H(t),h=!F.isEqual(s,n.resource),o=!F.isEqual(e,n.queries),r=null!=n.queries[0],a="connected"===i.type;if(h||("connecting"===i.type||"reconnecting"===i.type)&&o)return this.disconnect(),this.loadIfDisconnected(t);a&&r&&o&&(await this.loadSceneViewState({sceneViewStateId:{hex:n.queries[0].id}}),this.updateState(Object.assign(Object.assign({},i),{resource:n})))}async loadIfDisconnected(t){try{await this.connectWithNewStream(H(t))}catch(t){throw this.updateState(t instanceof U?{type:"connection-failed",message:`Cannot load scene. ${t.message}`,error:t}:t instanceof P?{type:"connection-failed",message:"Cannot load scene. Stream request failed to start stream.",error:t}:{type:"connection-failed",message:"Cannot load scene for unknown reason. See console logs.",error:t}),t}}connectWithNewStream(t){return this.openWebsocketStream(t,"connecting",(()=>this.requestNewStream(t)))}connectToExistingStream(t){return this.openWebsocketStream(t.resource,"reconnecting",(()=>this.requestReconnectStream(t)),{maxRetries:Number.POSITIVE_INFINITY})}async openWebsocketStream(t,i,s,{maxRetries:e=3}={}){const n=(h=function(t,i,s,e){return B.appendPath(null!=s?B.toString(B.parseAndAddParams("/ws",{clientId:s,deviceId:e})):`/stream-keys/${i.id}/session`,B.parse(t.network.renderingHost))}(this.config,t.resource,this.clientId,this.deviceId),{url:B.toString(h),protocols:["ws.vertexvis.com"]});var h;console.debug(`Initiating WS connection [uri=${n.url}]`);const o=new AbortController,r=(a=this.config,{EXPERIMENTAL_frameDelivery:Object.assign(Object.assign({},a.EXPERIMENTAL_frameDelivery),{rateLimitingEnabled:a.flags.throttleFrameDelivery}),EXPERIMENTAL_adaptiveRendering:Object.assign(Object.assign({},a.EXPERIMENTAL_adaptiveRendering),{enabled:a.flags.adaptiveRendering}),EXPERIMENTAL_qualityOfService:Object.assign({},a.EXPERIMENTAL_qualityOfService)});var a;this.updateState({type:i,resource:t,connection:{dispose:()=>{this.dispose(),o.abort()}}});const l=await z.abort(o.signal,z.retry((()=>this.connect(n,r)),{maxRetries:e,delaysInMs:Mt.WS_RECONNECT_DELAYS})).catch((t=>{throw new G("Websocket connection failed.",t instanceof Error?t:void 0)}));if(!l.aborted)return this.requestNewOrExistingStream(t,l.result,s);this.updateState({type:"disconnected"})}async requestNewOrExistingStream(t,i,s){const e=this.requestClock(),n=await s();console.debug(`Stream connected [stream-id=${n.streamId}, scene-view-id=${n.sceneViewId}]`);const h=this.onRequest((t=>{const i=t.request.drawFrame;if(null!=i){const t=T(n.worldOrientation)(i);"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{frame:t}))}})),o=this.reconnectWhenNeeded(),r=this.refreshTokenWhenExpired(n.token),a=this.acknowledgeFrameRequests(),l=null==n.frame?await this.waitForFrame(n.worldOrientation,this.options.loadTimeoutInSeconds):n.frame,c=await e;console.debug(`Synchronized clocks [local-time=${c.knownLocalTime.toISOString()}, remote-time=${c.knownRemoteTime.toISOString()}]`),this.updateState({type:"connected",connection:{dispose:()=>{o.dispose(),h.dispose(),r.dispose(),a.dispose(),i.dispose()}},resource:t,streamId:n.streamId,deviceId:n.deviceId,sceneViewId:n.sceneViewId,worldOrientation:n.worldOrientation,token:n.token,frame:l,clock:c})}async requestNewStream(t){var i;const s=I(await this.startStream({streamKey:{value:t.resource.id},dimensions:this.dimensions,frameBackgroundColor:jt(this.frameBgColor),streamAttributes:Ot(this.streamAttributes),sceneViewStateId:"scene-view-state"===(null===(i=t.queries[0])||void 0===i?void 0:i.type)?{hex:t.queries[0].id}:void 0}));return{resource:t,streamId:s.streamId,sceneViewId:s.sceneViewId,deviceId:s.sessionId,token:s.token,worldOrientation:s.worldOrientation,frame:void 0}}async requestReconnectStream(t){const i=D(await this.reconnect({streamId:{hex:t.streamId},dimensions:this.dimensions,frameBackgroundColor:jt(this.frameBgColor),streamAttributes:Ot(this.streamAttributes)}));return Object.assign(Object.assign({},t),{token:i.token})}async requestClock(){const t=k(await this.syncTime({requestTime:x()}));return new J(t)}reconnectWhenNeeded(){const t=this.onClose((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)})),i=this.onRequest((t=>{null!=t.request.gracefulReconnection&&"connected"===this.state.type&&(console.debug("Received request for graceful reconnect. Closing connection and attempting reconnect."),this.closeAndReconnect(this.state))})),s=this.reconnectWhenOffline();return{dispose:()=>{t.dispose(),i.dispose(),s.dispose()}}}refreshTokenWhenExpired(t){let i;const s=t=>{const{tokenRefreshOffsetInSeconds:e}=this.options,n=t.remainingTimeInMs(e);i=window.setTimeout((async()=>{const t=await this.refreshToken(),i=S(t);s(i),"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{token:i}))}),n)};return s(t),{dispose:()=>clearTimeout(i)}}reconnectWhenOffline(){let t;const i=()=>window.clearTimeout(t),s=()=>{i();const s=this.options.offlineThresholdInSeconds;console.debug(`Detected that host is offline. Will attempt reconnect in ${s}s.`),t=window.setTimeout((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)}),1e3*s)};return window.addEventListener("offline",(()=>s())),window.addEventListener("online",(()=>{console.debug("Detected that host is online."),i()})),{dispose:()=>{i(),window.removeEventListener("offline",s),window.removeEventListener("online",i)}}}closeAndReconnect(t){return t.connection.dispose(),this.connectToExistingStream(t)}async waitForFrame(t,i){let s;try{return await z.timeout(1e3*i,new Promise((i=>{s=this.onRequest((e=>{try{const n=e.request.drawFrame;if(null!=n){const s=T(t)(n);i(s)}}finally{null==s||s.dispose()}}))})))}catch(t){throw new _(`Frame timed out after ${i/1e3}s`,t instanceof Error?t:void 0)}finally{null==s||s.dispose()}}acknowledgeFrameRequests(){return this.onRequest(function(t,i){const s=function(t){let i=!1;return s=>{const e=t();if(null!=e){const t=e.remoteTime(new Date(Date.now())),n=p(s,t);return g(n).getTime()>=0?n:void(i||(console.warn(`Possible erroneous send to receive timing. Muting for 60s. [sent-at=${s.toISOString()}, received-at=${t.toISOString()}, remote-time=${e.knownRemoteTime.toISOString()}]`),i=!0,setTimeout((()=>i=!1),6e4)))}}}(i);return e=i=>{return e=()=>e=>{const n=g(e.sentAtTime);null!=n&&t.replyResult(i,{drawFrame:{sendToReceiveDuration:s(n)}})},t=>{const{drawFrame:i}=t.request;null!=i&&e()(t)};var e},t=>{var i;const s=null===(i=t.request.requestId)||void 0===i?void 0:i.value;null!=s&&e(s)(t)};var e}(this,(()=>"connected"===this.state.type?this.state.clock:void 0)))}updateState(t){this.state!==t&&(this.state=t,this.stateChanged.emit(this.state))}ifState(t,i){if(this.state.type===t)return i()}onStateChanged(t){return this.stateChanged.on(t)}}Mt.WS_RECONNECT_DELAYS=[0,1e3,1e3,5e3];const Ot=A.ifInvalidThrow(y),jt=A.ifInvalidThrow(b);let At=class{constructor(s){t(this,s),this.tap=i(this,"tap",7),this.doubletap=i(this,"doubletap",7),this.longpress=i(this,"longpress",7),this.frameReceived=i(this,"frameReceived",7),this.frameDrawn=i(this,"frameDrawn",7),this.tokenExpired=i(this,"tokenExpired",7),this.connectionChange=i(this,"connectionChange",7),this.sceneReady=i(this,"sceneReady",7),this.sceneChanged=i(this,"sceneChanged",7),this.interactionStarted=i(this,"interactionStarted",7),this.interactionFinished=i(this,"interactionFinished",7),this.cameraTypeChanged=i(this,"cameraTypeChanged",7),this.deviceIdChange=i(this,"deviceIdChange",7),this.dimensionschange=i(this,"dimensionschange",7),this.configEnv="platprod",this.cameraControls=!0,this.cameraType="perspective",this.keyboardControls=!0,this.rotateAroundTapPoint=!0,this.experimentalGhostingOpacity=0,this.noDefaultLights=!1,this.selectionMaterial=X,this.resizeDebounce=100,this.stencilBuffer=new ht(this.hostElement),this.viewport=nt.fromDimensions(d.create(0,0)),this.stateMap={cursorManager:new K,streamState:{type:"disconnected"}},this.interactionHandlers=[],this.tapKeyInteractions=[],this.internalFrameDrawnDispatcher=new j,this.handleElementResize=this.handleElementResize.bind(this)}componentWillLoad(){var t;this.updateResolvedConfig(),this.calculateComponentDimensions(),this.resizeObserver=new ResizeObserver(this.handleElementResize),this.registerSlotChangeListeners(),this.stream=null!==(t=this.stream)&&void 0!==t?t:new Mt(new E,{loggingEnabled:this.getResolvedConfig().flags.logWsMessages}),this.addStreamListeners(),this.updateStreamAttributes(),this.stateMap.cursorManager.onChanged.on((()=>this.handleCursorChanged()))}componentDidLoad(){var t,i,s;if(this.interactionApi=this.createInteractionApi(),null!=this.containerElement&&(null===(t=this.resizeObserver)||void 0===t||t.observe(this.containerElement)),null!=this.src)try{this.load(this.src)}catch(t){console.error("Error loading scene",t)}if(this.cameraControls)if(null!=window.PointerEvent){const t=new Dt("pointerdown","pointerup","pointermove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new It((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Tt),this.registerInteractionHandler(t)}else{const t=new Dt("mousedown","mouseup","mousemove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new Ct((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new kt),this.registerInteractionHandler(t)}this.keyboardControls&&null!=this.stream&&(null===(i=this.baseInteractionHandler)||void 0===i||i.setDefaultKeyboardControls(this.keyboardControls),this.registerTapKeyInteraction(new rt(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()))),this.registerTapKeyInteraction(new ut(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()),(()=>this.createScene())))),this.rotateAroundTapPoint&&(null===(s=this.baseInteractionHandler)||void 0===s||s.setPrimaryInteractionType("rotate-point")),this.injectViewerApi()}render(){var t;return s(e,null,s("div",{class:"viewer-container",style:{cursor:V(null!==(t=this.cursor)&&void 0!==t?t:"")},onContextMenu:t=>t.preventDefault()},s("div",{ref:t=>this.containerElement=t,class:N("canvas-container",{"enable-pointer-events ":null!=window.PointerEvent})},s("canvas",{ref:t=>{this.canvasElement=t,this.stateMap.interactionTarget=t},class:"canvas"}),null!=this.errorMessage?s("div",{class:"error-message"},this.errorMessage):null),s("slot",null)))}async dispatchFrameDrawn(t){this.frame=t,this.internalFrameDrawnDispatcher.emit(t),this.frameDrawn.emit(t)}async registerInteractionHandler(t){return this.interactionHandlers.push(t),this.initializeInteractionHandler(t),{dispose:()=>{const i=this.interactionHandlers.indexOf(t);-1!==i&&(this.interactionHandlers[i].dispose(),this.interactionHandlers.splice(i,1))}}}async registerTapKeyInteraction(t){this.tapKeyInteractions=[...this.tapKeyInteractions,t]}async getInteractionTarget(){if(null!=this.stateMap.interactionTarget)return this.stateMap.interactionTarget;throw new Error("Interaction target is undefined.")}async addCursor(t,i){return this.stateMap.cursorManager.add(t,i)}async getInteractionHandlers(){return this.interactionHandlers}async getBaseInteractionHandler(){return this.baseInteractionHandler}async getJwt(){return this.token}handleSrcChanged(t){null!=t?this.load(t):this.unload()}handleRotateAboutTapPointChanged(){var t,i;this.updateStreamAttributes(),this.rotateAroundTapPoint?null===(t=this.baseInteractionHandler)||void 0===t||t.setPrimaryInteractionType("rotate-point"):null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate")}handleCameraTypeChanged(t,i){t!==i&&this.updateCameraType()}handleDepthBuffersChanged(){this.updateStreamAttributes()}handleExperimentalGhostingOpacityChanged(){this.updateStreamAttributes()}handleNoDefaultLightsChanged(){this.updateStreamAttributes()}handleFeatureLinesChanged(){this.updateStreamAttributes()}handleFeatureHighlightingChanged(){this.updateStreamAttributes()}handleFeatureMapsChanged(){this.updateStreamAttributes()}handleConfigChanged(){this.updateResolvedConfig()}handleConfigEnvChanged(){this.updateResolvedConfig()}async load(t){var i;if(null==this.stream||null==this.dimensions)throw new Y("Cannot load scene. Viewer has not been initialized.");this.calculateComponentDimensions(),this.stream.update({streamAttributes:this.getStreamAttributes(),config:$(this.configEnv,this.config),dimensions:this.dimensions,frameBgColor:this.getBackgroundColor()}),await(null===(i=this.stream)||void 0===i?void 0:i.load(t,this.clientId,this.getDeviceId(),this.getResolvedConfig())),this.sceneReady.emit()}async unload(){if(null!=this.stream&&(this.stream.disconnect(),this.frame=void 0,this.errorMessage=void 0),null!=this.canvasElement){const t=this.canvasElement.getContext("2d");null!=t&&t.clearRect(0,0,this.canvasElement.width,this.canvasElement.height)}}async scene(){return this.createScene()}async isSceneReady(){return"connected"===this.stateMap.streamState.type}async handleTapEvent(t){this.tapKeyInteractions.filter((i=>i.predicate(t.detail))).forEach((i=>i.fn(t.detail)))}emitConnectionChange(t){this.connectionChange.emit(t)}handleElementResize(t){t.length>=0&&null!=this.dimensions&&!d.isEqual(t[0].contentRect,this.viewport)&&(null!=this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=void 0),this.isResizing||(this.resizeTimer=setTimeout((()=>{this.isResizing=!0,this.isResizeUpdate=!0,this.recalculateComponentDimensions()}),this.resizeDebounce)))}registerSlotChangeListeners(){this.mutationObserver=new MutationObserver((()=>this.injectViewerApi())),this.mutationObserver.observe(this.hostElement,{childList:!0,subtree:!0})}injectViewerApi(){function t(t){return Array.from(t.querySelectorAll("*"))}t(this.hostElement).filter((t=>t.nodeName.startsWith("VERTEX-"))).reduce(((i,s)=>[...i,s,...t(s)]),[]).forEach((t=>{t.viewer=this.hostElement}))}calculateComponentDimensions(){var t;const i=this.getBounds();if(null!=(null==i?void 0:i.width)&&null!=(null==i?void 0:i.height)){const s=d.create(i.width,i.height),e=d.scaleFit(2073600,s);this.hostDimensions=s,this.dimensions=null!=e?d.create(e.width,e.height):void 0,this.viewport=nt.fromDimensions(null!==(t=this.getCanvasDimensions())&&void 0!==t?t:d.create(0,0))}}recalculateComponentDimensions(){var t;this.isResizing&&(this.calculateComponentDimensions(),this.isResizing=!1,null===(t=this.stream)||void 0===t||t.update({dimensions:this.dimensions}),this.dimensionschange.emit(this.dimensions))}reportPerformance(t){if("connected"===this.stateMap.streamState.type){const i={timings:t.map((t=>({receiveToPaintDuration:p(t.duration)})))};this.getStream().recordPerformance(i,!1)}}addStreamListeners(){this.stateMap.streamListeners=this.getStream().stateChanged.on((t=>{this.handleStreamStateChanged(this.stateMap.streamState,t)}))}handleStreamStateChanged(t,i){this.stateMap.streamState=i,"connecting"===i.type?this.handleConnecting(t,i):"connected"===i.type?this.handleConnected(t,i):"connection-failed"===i.type?this.handleConnectionFailed(t,i):"disconnected"===i.type&&this.handleDisconnected(t,i)}handleConnecting(t,i){"connecting"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"connecting"}))}handleConnected(t,i){this.token=i.token.token,"connected"!==t.type&&(this.errorMessage=void 0,this.canvasRenderer=St(xt,function(){let t;return async i=>{var s,e,n;const h=i.frame.sequenceNumber,o=null==t||h>t,r=await(l=i.frame.image.imageBytes,null!=window.createImageBitmap?async function(t){const i=new Blob([t]),s=await window.createImageBitmap(i);return{image:s,dispose:()=>s.close()}}(l):(c=l,new Promise(((t,i)=>{const s=new Blob([c]),e=URL.createObjectURL(s),n=new Image;n.addEventListener("load",(()=>{t({image:n,dispose:()=>{}}),URL.revokeObjectURL(e)})),n.addEventListener("error",(()=>{i(new q("Failed to load image data")),URL.revokeObjectURL(e)})),n.src=e})))),a=null===(e=null===(s=i.predicate)||void 0===s?void 0:s.call(i))||void 0===e||e;var l,c;return o&&a&&(t=h,null===(n=i.beforeDraw)||void 0===n||n.call(i),function(t,i){const s=i.viewport.calculateDrawRect(i.frame.image);i.canvas.clearRect(0,0,i.canvasDimensions.width,i.canvasDimensions.height),i.canvas.drawImage(t.image,s.x,s.y,s.width,s.height)}(r,i)),r.dispose(),i.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),this.emitConnectionChange({status:"connected",jwt:i.token.token}),this.deviceIdChange.emit(i.deviceId)),this.frame!==i.frame&&this.updateFrame(i.frame)}handleConnectionFailed(t,i){"connection-failed"!==t.type&&(this.token=void 0,this.errorMessage=i.message)}handleDisconnected(t,i){"disconnected"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"disconnected"}))}async updateFrame(t){const i=this.getCanvasDimensions();if(null!=this.canvasElement&&null!=i&&this.frame!==t){const s=this.canvasElement.getContext("2d");if(null!=s){const e=this.frame;this.frame=t,this.updateInteractionApi(e);const n={canvas:s,canvasDimensions:i,dimensions:this.dimensions,frame:this.frame,viewport:this.viewport,beforeDraw:()=>{this.updateCanvasDimensions(i),this.isResizeUpdate=!1},predicate:()=>!this.isResizeUpdate||null==this.dimensions||d.isEqual(this.dimensions,n.frame.image.imageAttr.frameDimensions)};this.frameReceived.emit(this.frame),this.frame.scene.hasChanged&&this.sceneChanged.emit();const h=await this.canvasRenderer(n);this.dispatchFrameDrawn(h)}}}initializeInteractionHandler(t){if(null==this.stateMap.interactionTarget)throw new Q("Cannot initialize interaction handler. Interaction target is undefined.");if(null==this.interactionApi)throw new Q("Cannot initialize interaction handler. Interaction APi is undefined.");t.initialize(this.stateMap.interactionTarget,this.interactionApi)}createInteractionApi(){if(null==this.stream)throw new Z("Cannot create interaction API. Component has not been initialized.");return null==this.frame||this.frame.scene.camera.isPerspective()?new ct(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished):new lt(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished)}handleCursorChanged(){window.requestAnimationFrame((()=>{this.cursor=this.stateMap.cursorManager.getActiveCursor()}))}createScene(){if("connected"!==this.stateMap.streamState.type)throw new tt("Cannot create scene. Viewer stream is not connected.");const{frame:t,sceneViewId:i,worldOrientation:s}=this.stateMap.streamState,e="string"==typeof this.selectionMaterial?it(this.selectionMaterial):this.selectionMaterial;return new st(this.getStream(),t,T(s),(()=>this.getImageScale()),this.viewport,i,e)}getBackgroundColor(){if(null!=this.containerElement)return function(t){const i=window.getComputedStyle(t);return R.fromCss(i.backgroundColor)}(this.containerElement)}getBounds(){return this.hostElement.getBoundingClientRect()}getCanvasDimensions(){return this.getResolvedConfig().flags.letterboxFrames?this.dimensions:this.hostDimensions}getImageScale(){const t=this.getCanvasDimensions();if(null!=this.dimensions&&null!=t)return h.create(this.dimensions.width/t.width,this.dimensions.height/t.height)}getStreamAttributes(){return{depthBuffers:this.getDepthBufferStreamAttributesValue(),experimentalGhosting:this.experimentalGhostingOpacity,noDefaultLights:this.noDefaultLights,featureLines:this.featureLines,featureHighlighting:this.featureHighlighting,featureMaps:this.featureMaps}}updateCanvasDimensions(t){null!=this.canvasElement&&(this.canvasElement.width=t.width,this.canvasElement.height=t.height)}updateStreamAttributes(){var t;null===(t=this.stream)||void 0===t||t.update({streamAttributes:this.getStreamAttributes()})}updateInteractionApi(t){if(null!=this.frame){const i=(null==t||t.scene.camera.isPerspective())&&this.frame.scene.camera.isOrthographic(),s=(null==t||t.scene.camera.isOrthographic())&&this.frame.scene.camera.isPerspective();(i||s)&&(this.interactionApi=this.createInteractionApi(),this.cameraType=this.frame.scene.camera.isPerspective()?"perspective":"orthographic",this.cameraTypeChanged.emit(this.cameraType),this.interactionHandlers.forEach((t=>this.initializeInteractionHandler(t))))}}updateCameraType(){var t,i;null!=this.frame&&("orthographic"===this.cameraType&&this.frame.scene.camera.isPerspective()?null===(t=this.stream)||void 0===t||t.replaceCamera({camera:m(M(this.frame.scene.camera,this.frame.scene.boundingBox))}):"perspective"===this.cameraType&&this.frame.scene.camera.isOrthographic()&&(null===(i=this.stream)||void 0===i||i.replaceCamera({camera:m(O(this.frame.scene.camera))})))}getDepthBufferStreamAttributesValue(){var t;return null!==(t=this.depthBuffers)&&void 0!==t?t:this.rotateAroundTapPoint?"final":void 0}updateResolvedConfig(){this.resolvedConfig=$(this.configEnv,this.config)}getResolvedConfig(){return Rt("Resolved config is undefined",(()=>this.resolvedConfig))}getStream(){return Rt("Stream is undefined",(()=>this.stream))}getDeviceId(){if(null==this.deviceId){try{this.deviceId=function(t,i,s=window.localStorage){const e=s.getItem(Et.DEVICE_ID);if(null!=e)return i(JSON.parse(e))}(0,(t=>t["device-id"]))}catch(t){console.warn("Cannot read device ID. Local storage is not supported.")}if(null==this.deviceId){this.deviceId=L.create();try{!function(t,i,s=window.localStorage){const e=s.getItem(t);if(null!=e){const n=Object.assign(Object.assign({},JSON.parse(e)),i);s.setItem(t,JSON.stringify(n))}else s.setItem(t,JSON.stringify(i))}(Et.DEVICE_ID,{"device-id":this.deviceId})}catch(t){console.warn("Cannot write device ID. Local storage is not supported.")}}}return this.deviceId}get hostElement(){return n(this)}static get watchers(){return{src:["handleSrcChanged"],rotateAroundTapPoint:["handleRotateAboutTapPointChanged"],cameraType:["handleCameraTypeChanged"],depthBuffers:["handleDepthBuffersChanged"],experimentalGhostingOpacity:["handleExperimentalGhostingOpacityChanged"],noDefaultLights:["handleNoDefaultLightsChanged"],featureLines:["handleFeatureLinesChanged"],featureHighlighting:["handleFeatureHighlightingChanged"],featureMaps:["handleFeatureMapsChanged"],config:["handleConfigChanged"],configEnv:["handleConfigEnvChanged"]}}};function Rt(t,i){const s=i();if(null!=s)return s;throw new Error(t)}At.style=":host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px;min-width:1px;min-height:1px}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative;background:var(--image-background, var(--viewer-background, #ffffff))}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden;background:var(--viewer-background, #ffffff)}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}";export{At as vertex_viewer}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import{h as i,F as t,r as e}from"./p-2e581b2a.js";import{p as n,m as o,v as s}from"./p-70e5e8a8.js";import"./p-058632f4.js";import"./p-6c377932.js";import"./p-92fe4417.js";import"./p-e42cb163.js";import"./p-df8fbe56.js";import{V as r}from"./p-29986489.js";import{i as l,b as a,P as p,a as h}from"./p-148c5f1a.js";import{a as d}from"./p-9acd1b44.js";import{c as v}from"./p-07aeee89.js";import"./p-083f427e.js";import"./p-dfe5a97d.js";import"./p-39803f8f.js";const c=({pin:e,selected:n})=>i(t,null,a(e)&&i("div",{id:"pin-anchor",class:v("pin-anchor",{selected:n})}),l(e)&&i("vertex-viewer-icon",{name:"pin-fill",size:"lg",class:v("pin",{"pin-selected":n})}));function u(i,t,e){const o=[{x:i.x+e.width/2,y:i.y},{x:i.x+e.width/2,y:i.y+e.height},{x:i.x,y:i.y+e.height/2},{x:i.x+e.width,y:i.y+e.height/2}],s=o.map((i=>n.distance(i,t)));return o[s.indexOf(Math.min(...s))]}let b=class{constructor(i){e(this,i),this.matrix=o.makeIdentity(),this.projectionViewMatrix=o.makeIdentity(),this.pinModel=new p,this.selected=!1,this.invalidateStateCounter=0,this.leafNodesRendered=!1,this.handleAnchorPointerDown=()=>{var i,t;null!=this.elementBounds&&"edit"===(null===(i=this.pinController)||void 0===i?void 0:i.getToolMode())&&null!=this.pin&&(null===(t=this.pinController)||void 0===t||t.setDraggable({id:this.pin.id}))}}componentDidLoad(){this.setLabelObserver(),null==this.pinController&&(this.pinController=new h(this.pinModel)),this.leafNodesRendered=!0}disconnectedCallback(){var i,t;null===(i=this.labelEl)||void 0===i||i.removeEventListener("labelChanged",this.invalidateState),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}render(){var e;if(null==this.pin)throw new Error("Unable to draw pin");const n=this.computePinPoints(this.pin),{pinPoint:o,labelPoint:s}=n,r=()=>{var i,t;null===(i=this.pinController)||void 0===i||i.setSelectedPinId(null===(t=this.pin)||void 0===t?void 0:t.id)};return i(t,null,i("vertex-viewer-dom-element",{"data-testid":`drawn-pin-${this.pin.id}`,position:this.pin.worldPosition,onPointerDown:i=>{2!==i.buttons&&i.stopPropagation(),r(),this.handleAnchorPointerDown(i)}},this.leafNodesRendered&&i(c,{pin:this.pin,selected:this.selected})),a(this.pin)&&i(t,null,i("vertex-viewer-pin-label-line",{id:`pin-label-line-${null===(e=this.pin)||void 0===e?void 0:e.id}`,pinPoint:o,labelPoint:s,onPointerDown:r}),i("vertex-viewer-pin-label",{pin:this.pin,ref:i=>{this.labelEl=i},elementBounds:this.elementBounds,pinController:this.pinController,onPointerDown:r})))}invalidateState(){this.invalidateStateCounter=this.invalidateStateCounter+1}setLabelObserver(){var i;const t=null===(i=this.labelEl)||void 0===i?void 0:i.addEventListener("labelChanged",this.invalidateState);null!=t&&(this.resizeObserver=new ResizeObserver((()=>this.invalidateState())),this.resizeObserver.observe(t))}computePinPoints(i){return null!=this.elementBounds&&null!=this.pin?a(this.pin)&&null!=this.pin.label.point?this.computeTextPinPoints(this.pin,this.elementBounds):this.computeDefaultPinPoints(this.pin,this.elementBounds):{pinPoint:i.worldPosition}}computeDefaultPinPoints(i,t){return{pinPoint:this.getFromWorldPosition(i.worldPosition,this.projectionViewMatrix,t)}}computeTextPinPoints(i,t){var e,n;const{pinPoint:o}=this.computeDefaultPinPoints(i,t),s=d(i.label.point,t),r=null===(e=this.labelEl)||void 0===e?void 0:e.querySelector(`#pin-label-${null===(n=this.pin)||void 0===n?void 0:n.id}`);return{pinPoint:o,labelPoint:u(s,o,{width:(null==r?void 0:r.clientWidth)||0,height:(null==r?void 0:r.clientHeight)||0})}}getFromWorldPosition(i,t,e){const n=s.transformMatrix(i,t);return r.fromDimensions(e).transformVectorToViewport(n)}};b.style=":host{--viewer-annotations-pin-dot-color:var(--blue-600);--viewer-annotations-pin-color:var(--blue-700);--viewer-annotations-pin-font-size:0.75rem;--viewer-annotations-pin-selected-stroke:var(--white);--viewer-annotations-pin-selected-border:2px solid var(--white);--viewer-annotations-pin-label-border:2px solid var(--black);--viewer-annotations-pin-selected-stroke:var(--white);font-size:var(--viewer-annotations-pin-font-size);position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none}.pin-anchor{position:absolute;border-radius:50%;transform:translate(-50%, -50%);display:block;width:9px;height:9px;box-sizing:border-box;border:var(--viewer-annotations-pin-label-border);background:var(--viewer-annotations-pin-dot-color);pointer-events:auto;cursor:pointer}.selected{width:13px;height:13px;border:var(--viewer-annotations-pin-selected-border)}.pin{color:var(--viewer-annotations-pin-color);cursor:pointer}.pin-selected{stroke-width:1;stroke:var(--viewer-annotations-pin-selected-stroke)}";export{b as vertex_viewer_pin_group}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**!
|
|
2
2
|
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import{d as e,N as t,w as a,p as r,b as i}from"./p-2e581b2a.js";import{g as n}from"./p-98e6a50e.js";import"./p-dfe5a97d.js";(()=>{const i=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${t}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===t)),n={};return n.resourcesUrl=new URL(".",new URL(i.getAttribute("data-resources-url")||i.src,a.location.href)).href,((r,i)=>{const n=`__sc_import_${t.replace(/\s|-/g,"_")}`;try{a[n]=new Function("w",`return import(w);//${Math.random()}`)}catch(t){const o=new Map;a[n]=t=>{const s=new URL(t,r).href;let l=o.get(s);if(!l){const t=e.createElement("script");t.type="module",t.crossOrigin=i.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${s}'; window.${n}.m = m;`],{type:"application/javascript"})),l=new Promise((e=>{t.onload=()=>{e(a[n].m),t.remove()}})),o.set(s,l),e.head.appendChild(t)}return l}}})(n.resourcesUrl,i),a.customElements?r(n):__sc_import_viewer("./p-ac0761c3.js").then((()=>n))})().then((e=>(n(),i(JSON.parse('[["p-db716103",[[1,"vertex-viewer-pin-tool",{"pinController":[1040],"pinModel":[16],"pins":[1040],"viewer":[16],"tool":[1025],"mode":[1025],"selectedPinId":[32],"elementBounds":[32],"projectionViewMatrix":[32]}]]],["p-08eda2b2",[[1,"vertex-viewer-default-toolbar",{"viewer":[16],"placement":[1],"direction":[1],"animationsDisabled":[4,"animations-disabled"],"animationMs":[2,"animation-ms"]}]]],["p-eefae62a",[[1,"vertex-scene-tree",{"overScanCount":[2,"over-scan-count"],"viewerSelector":[1,"viewer-selector"],"viewer":[1040],"rowData":[16],"config":[16],"configEnv":[1,"config-env"],"controller":[1040],"metadataSearchExactMatch":[1028,"metadata-search-exact-match"],"metadataSearchKeys":[1040],"metadataKeys":[16],"rows":[32],"totalRows":[32],"stateMap":[32],"errorDetails":[32],"attemptingRetry":[32],"invalidateRows":[64],"scrollToIndex":[64],"scrollToItem":[64],"expandAll":[64],"collapseAll":[64],"expandItem":[64],"collapseItem":[64],"toggleExpandItem":[64],"toggleItemVisibility":[64],"hideItem":[64],"showItem":[64],"selectItem":[64],"deselectItem":[64],"getRowAtIndex":[64],"getRowForEvent":[64],"getRowAtClientY":[64],"filterItems":[64],"selectFilteredItems":[64],"fetchMetadataKeys":[64]},[[0,"search","handleSearch"]]]]],["p-465a92d9",[[1,"vertex-viewer-measurement-tool",{"distanceTemplateId":[1,"distance-template-id"],"tool":[1],"units":[1],"fractionalDigits":[2,"fractional-digits"],"disabled":[4],"viewer":[16],"isMeasuring":[1540,"is-measuring"],"snapDistance":[2,"snap-distance"],"stateMap":[32]}]]],["p-99799a71",[[1,"vertex-viewer-markup",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"selectedMarkupId":[1025,"selected-markup-id"],"selectNew":[4,"select-new"],"toSelectMarkupId":[32],"pointerDownPosition":[32],"addMarkup":[64],"removeMarkup":[64],"getMarkupElements":[64],"getMarkupElement":[64]},[[0,"markupEnd","handleMarkupEnd"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["p-af37b63e",[[1,"vertex-viewer-markup-tool",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"stateMap":[32],"reset":[64]}]]],["p-1db9bd1a",[[1,"vertex-viewer-measurements",{"distanceTemplateId":[1,"distance-template-id"],"tool":[1],"units":[1],"fractionalDigits":[2,"fractional-digits"],"disabled":[4],"viewer":[16],"selectedMeasurementId":[1025,"selected-measurement-id"],"snapDistance":[2,"snap-distance"],"showAxisReferenceLines":[4,"show-axis-reference-lines"],"measurementModel":[16],"addMeasurement":[64],"removeMeasurement":[64],"getMeasurementElement":[64],"getMeasurementElements":[64]},[[0,"measureEnd","handleMeasureEnd"],[1,"pointerdown","handleMeasurementPointerDown"]]]]],["p-ebd85d58",[[1,"vertex-viewer-view-cube",{"xPositiveLabel":[1,"x-positive-label"],"xNegativeLabel":[1,"x-negative-label"],"yPositiveLabel":[1,"y-positive-label"],"yNegativeLabel":[1,"y-negative-label"],"zPositiveLabel":[1,"z-positive-label"],"zNegativeLabel":[1,"z-negative-label"],"standardViewsOff":[4,"standard-views-off"],"animationDuration":[2,"animation-duration"],"triadOff":[4,"triad-off"],"worldOrientation":[1040],"camera":[1040],"viewer":[16],"boxLength":[32],"triadPosition":[32]}]]],["p-4a65ddb3",[[1,"vertex-viewer-measurement-precise",{"measurementModel":[16],"measurementOverlays":[16],"measurementController":[1040],"measurableEntityTypes":[16],"viewer":[16],"configEnv":[1,"config-env"],"config":[16],"overlays":[32]}]]],["p-6d70b198",[[1,"vertex-scene-tree-table-cell",{"node":[16],"tree":[16],"value":[1],"placeholder":[1],"hoveredNodeId":[1,"hovered-node-id"],"isScrolling":[4,"is-scrolling"],"expandToggle":[4,"expand-toggle"],"visibilityToggle":[4,"visibility-toggle"],"interactionsDisabled":[4,"interactions-disabled"],"recurseParentSelectionDisabled":[4,"recurse-parent-selection-disabled"]}]]],["p-1f251549",[[1,"vertex-scene-tree-table-column",{"initialWidth":[2,"initial-width"],"minWidth":[2,"min-width"],"maxWidth":[2,"max-width"]}]]],["p-33daeb09",[[1,"vertex-scene-tree-table-header"]]],["p-a32cc378",[[1,"vertex-scene-tree-table-resize-divider",{"dragging":[32]}]]],["p-4aaf02b4",[[1,"vertex-scene-tree-toolbar-group"]]],["p-7c755e0e",[[1,"vertex-viewer",{"src":[1],"clientId":[1,"client-id"],"deviceId":[1025,"device-id"],"config":[1],"configEnv":[1,"config-env"],"resolvedConfig":[1040],"cameraControls":[4,"camera-controls"],"cameraType":[1537,"camera-type"],"keyboardControls":[4,"keyboard-controls"],"rotateAroundTapPoint":[4,"rotate-around-tap-point"],"token":[1025],"depthBuffers":[1,"depth-buffers"],"experimentalGhostingOpacity":[2,"experimental-ghosting-opacity"],"noDefaultLights":[4,"no-default-lights"],"featureLines":[16],"featureHighlighting":[16],"featureMaps":[1,"feature-maps"],"selectionMaterial":[1,"selection-material"],"resizeDebounce":[2,"resize-debounce"],"frame":[1040],"stream":[1040],"stencilBuffer":[1040],"viewport":[1040],"dimensions":[32],"hostDimensions":[32],"errorMessage":[32],"cursor":[32],"stateMap":[32],"dispatchFrameDrawn":[64],"registerInteractionHandler":[64],"registerTapKeyInteraction":[64],"getInteractionTarget":[64],"addCursor":[64],"getInteractionHandlers":[64],"getBaseInteractionHandler":[64],"getJwt":[64],"load":[64],"unload":[64],"scene":[64],"isSceneReady":[64]},[[0,"tap","handleTapEvent"]]]]],["p-74102b29",[[1,"vertex-viewer-measurement-details",{"measurementModel":[16],"measurementOverlays":[16],"measurementOutcome":[1040],"distanceUnits":[1,"distance-units"],"angleUnits":[1,"angle-units"],"fractionalDigits":[2,"fractional-digits"],"distanceFormatter":[16],"angleFormatter":[16],"areaFormatter":[16],"resultTypes":[16],"overlay":[32],"distanceMeasurementUnits":[32],"angleMeasurementUnits":[32],"areaMeasurementUnits":[32]}]]],["p-61a042f0",[[1,"vertex-viewer-transform-widget",{"viewer":[16],"position":[1040],"controller":[1040],"hovered":[1040]}]]],["p-c9f91798",[[1,"vertex-viewer-icon",{"name":[1],"size":[1]}]]],["p-6e7e094a",[[0,"vertex-viewer-pin-group",{"pin":[16],"matrix":[1040],"projectionViewMatrix":[16],"elementBounds":[1040],"pinModel":[16],"pinController":[16],"selected":[4],"invalidateStateCounter":[32],"leafNodesRendered":[32]}]]],["p-b6b727a6",[[1,"vertex-viewer-dom-group",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040]}]]],["p-5679f46b",[[1,"vertex-viewer-measurement-distance",{"start":[1040],"startJson":[1,"start-json"],"end":[1040],"endJson":[1,"end-json"],"distance":[1026],"showAxisReferenceLines":[4,"show-axis-reference-lines"],"snapDistance":[2,"snap-distance"],"units":[1],"fractionalDigits":[2,"fractional-digits"],"labelFormatter":[16],"anchorLabelOffset":[2,"anchor-label-offset"],"lineCapLength":[2,"line-cap-length"],"mode":[513],"interactingAnchor":[1537,"interacting-anchor"],"invalid":[1540],"camera":[16],"hitProvider":[16],"indicatorPt":[1040],"viewer":[16],"measurementModel":[16],"viewport":[32],"elementBounds":[32],"interactionCount":[32],"internalCamera":[32],"invalidateStateCounter":[32],"stateMap":[32],"measurementUnits":[32],"computeElementMetrics":[64]}]]],["p-4fdf8553",[[1,"vertex-scene-tree-search",{"debounce":[2],"disabled":[4],"placeholder":[1],"value":[1025],"focused":[32],"setFocus":[64]}],[1,"vertex-scene-tree-table-layout",{"tree":[16],"controller":[16],"rows":[16],"totalRows":[2,"total-rows"],"rowHeight":[1026,"row-height"],"overScanCount":[2,"over-scan-count"],"rowData":[16],"layoutOffset":[1026,"layout-offset"],"scrollOffset":[1026,"scroll-offset"],"layoutHeight":[1026,"layout-height"],"layoutWidth":[1026,"layout-width"],"viewportStartIndex":[1026,"viewport-start-index"],"viewportEndIndex":[1026,"viewport-end-index"],"columnGridLayout":[32],"columnGridFixedLayout":[32],"hoveredNodeId":[32],"isComputingCellHeight":[32],"lastDividerPointerPosition":[32],"resizingColumnIndex":[32],"isScrolling":[32],"scrollTimer":[32],"stateMap":[32],"scrollToPosition":[64]}],[1,"vertex-scene-tree-toolbar"]]],["p-ebb801c3",[[1,"vertex-viewer-layer",{"stretchOff":[516,"stretch-off"]}]]],["p-4c3a3738",[[1,"vertex-viewer-toolbar",{"placement":[1],"direction":[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{"direction":[1]}]]],["p-d828fd18",[[0,"vertex-viewer-pin-label",{"pin":[16],"elementBounds":[16],"value":[1025],"pinController":[16],"focused":[32],"computedScreenPosition":[32],"textareaRows":[32],"contentElBounds":[32],"setFocus":[64]}],[0,"vertex-viewer-pin-label-line",{"pinPoint":[16],"labelPoint":[16]}]]],["p-ca518dcb",[[1,"vertex-viewer-dom-renderer",{"drawMode":[1,"draw-mode"],"viewer":[16],"camera":[1040],"depthBuffer":[1040],"viewport":[32],"invalidateFrameCounter":[32]},[[0,"propertyChange","handlePropertyChange"]]],[1,"vertex-viewer-dom-element",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040],"occlusionOff":[4,"occlusion-off"],"occluded":[516],"billboardOff":[4,"billboard-off"],"interactionsOff":[516,"interactions-off"]}]]],["p-d996b1d2",[[1,"vertex-viewer-markup-arrow",{"start":[1040],"startJson":[1,"start"],"end":[1040],"endJson":[1,"end"],"mode":[513],"viewer":[16],"elementBounds":[32],"editAnchor":[32],"dispose":[64]}],[1,"vertex-viewer-markup-circle",{"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"startPosition":[32],"editAnchor":[32],"resizeBounds":[32],"dispose":[64]}],[1,"vertex-viewer-markup-freeform",{"points":[1040],"pointsJson":[1,"points"],"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"resizeStartPosition":[32],"editAnchor":[32],"resizeBounds":[32],"resizePoints":[32],"screenPoints":[32],"dispose":[64]}]]],["p-7a5a9a93",[[1,"vertex-viewer-measurement-overlays",{"measurementOverlays":[16],"camera":[1040],"viewer":[16],"overlays":[32]}],[1,"vertex-viewer-measurement-line",{"start":[16],"end":[16],"capLength":[2,"cap-length"],"pointerEvents":[1,"pointer-events"]}]]]]'),e))));
|
|
4
|
+
import{d as e,N as t,w as r,p as a,b as i}from"./p-2e581b2a.js";import{g as n}from"./p-98e6a50e.js";import"./p-dfe5a97d.js";(()=>{const i=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${t}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===t)),n={};return n.resourcesUrl=new URL(".",new URL(i.getAttribute("data-resources-url")||i.src,r.location.href)).href,((a,i)=>{const n=`__sc_import_${t.replace(/\s|-/g,"_")}`;try{r[n]=new Function("w",`return import(w);//${Math.random()}`)}catch(t){const o=new Map;r[n]=t=>{const s=new URL(t,a).href;let l=o.get(s);if(!l){const t=e.createElement("script");t.type="module",t.crossOrigin=i.crossOrigin,t.src=URL.createObjectURL(new Blob([`import * as m from '${s}'; window.${n}.m = m;`],{type:"application/javascript"})),l=new Promise((e=>{t.onload=()=>{e(r[n].m),t.remove()}})),o.set(s,l),e.head.appendChild(t)}return l}}})(n.resourcesUrl,i),r.customElements?a(n):__sc_import_viewer("./p-ac0761c3.js").then((()=>n))})().then((e=>(n(),i(JSON.parse('[["p-db716103",[[1,"vertex-viewer-pin-tool",{"pinController":[1040],"pinModel":[16],"pins":[1040],"viewer":[16],"tool":[1025],"mode":[1025],"selectedPinId":[32],"elementBounds":[32],"projectionViewMatrix":[32]}]]],["p-08eda2b2",[[1,"vertex-viewer-default-toolbar",{"viewer":[16],"placement":[1],"direction":[1],"animationsDisabled":[4,"animations-disabled"],"animationMs":[2,"animation-ms"]}]]],["p-eefae62a",[[1,"vertex-scene-tree",{"overScanCount":[2,"over-scan-count"],"viewerSelector":[1,"viewer-selector"],"viewer":[1040],"rowData":[16],"config":[16],"configEnv":[1,"config-env"],"controller":[1040],"metadataSearchExactMatch":[1028,"metadata-search-exact-match"],"metadataSearchKeys":[1040],"metadataKeys":[16],"rows":[32],"totalRows":[32],"stateMap":[32],"errorDetails":[32],"attemptingRetry":[32],"invalidateRows":[64],"scrollToIndex":[64],"scrollToItem":[64],"expandAll":[64],"collapseAll":[64],"expandItem":[64],"collapseItem":[64],"toggleExpandItem":[64],"toggleItemVisibility":[64],"hideItem":[64],"showItem":[64],"selectItem":[64],"deselectItem":[64],"getRowAtIndex":[64],"getRowForEvent":[64],"getRowAtClientY":[64],"filterItems":[64],"selectFilteredItems":[64],"fetchMetadataKeys":[64]},[[0,"search","handleSearch"]]]]],["p-465a92d9",[[1,"vertex-viewer-measurement-tool",{"distanceTemplateId":[1,"distance-template-id"],"tool":[1],"units":[1],"fractionalDigits":[2,"fractional-digits"],"disabled":[4],"viewer":[16],"isMeasuring":[1540,"is-measuring"],"snapDistance":[2,"snap-distance"],"stateMap":[32]}]]],["p-99799a71",[[1,"vertex-viewer-markup",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"selectedMarkupId":[1025,"selected-markup-id"],"selectNew":[4,"select-new"],"toSelectMarkupId":[32],"pointerDownPosition":[32],"addMarkup":[64],"removeMarkup":[64],"getMarkupElements":[64],"getMarkupElement":[64]},[[0,"markupEnd","handleMarkupEnd"],[1,"pointerdown","handleMarkupPointerDown"]]]]],["p-af37b63e",[[1,"vertex-viewer-markup-tool",{"arrowTemplateId":[1,"arrow-template-id"],"circleTemplateId":[1,"circle-template-id"],"freeformTemplateId":[1,"freeform-template-id"],"tool":[1],"disabled":[4],"viewer":[16],"stateMap":[32],"reset":[64]}]]],["p-1db9bd1a",[[1,"vertex-viewer-measurements",{"distanceTemplateId":[1,"distance-template-id"],"tool":[1],"units":[1],"fractionalDigits":[2,"fractional-digits"],"disabled":[4],"viewer":[16],"selectedMeasurementId":[1025,"selected-measurement-id"],"snapDistance":[2,"snap-distance"],"showAxisReferenceLines":[4,"show-axis-reference-lines"],"measurementModel":[16],"addMeasurement":[64],"removeMeasurement":[64],"getMeasurementElement":[64],"getMeasurementElements":[64]},[[0,"measureEnd","handleMeasureEnd"],[1,"pointerdown","handleMeasurementPointerDown"]]]]],["p-ebd85d58",[[1,"vertex-viewer-view-cube",{"xPositiveLabel":[1,"x-positive-label"],"xNegativeLabel":[1,"x-negative-label"],"yPositiveLabel":[1,"y-positive-label"],"yNegativeLabel":[1,"y-negative-label"],"zPositiveLabel":[1,"z-positive-label"],"zNegativeLabel":[1,"z-negative-label"],"standardViewsOff":[4,"standard-views-off"],"animationDuration":[2,"animation-duration"],"triadOff":[4,"triad-off"],"worldOrientation":[1040],"camera":[1040],"viewer":[16],"boxLength":[32],"triadPosition":[32]}]]],["p-4a65ddb3",[[1,"vertex-viewer-measurement-precise",{"measurementModel":[16],"measurementOverlays":[16],"measurementController":[1040],"measurableEntityTypes":[16],"viewer":[16],"configEnv":[1,"config-env"],"config":[16],"overlays":[32]}]]],["p-6d70b198",[[1,"vertex-scene-tree-table-cell",{"node":[16],"tree":[16],"value":[1],"placeholder":[1],"hoveredNodeId":[1,"hovered-node-id"],"isScrolling":[4,"is-scrolling"],"expandToggle":[4,"expand-toggle"],"visibilityToggle":[4,"visibility-toggle"],"interactionsDisabled":[4,"interactions-disabled"],"recurseParentSelectionDisabled":[4,"recurse-parent-selection-disabled"]}]]],["p-1f251549",[[1,"vertex-scene-tree-table-column",{"initialWidth":[2,"initial-width"],"minWidth":[2,"min-width"],"maxWidth":[2,"max-width"]}]]],["p-33daeb09",[[1,"vertex-scene-tree-table-header"]]],["p-a32cc378",[[1,"vertex-scene-tree-table-resize-divider",{"dragging":[32]}]]],["p-4aaf02b4",[[1,"vertex-scene-tree-toolbar-group"]]],["p-990f3efe",[[1,"vertex-viewer",{"src":[1],"clientId":[1,"client-id"],"deviceId":[1025,"device-id"],"config":[1],"configEnv":[1,"config-env"],"resolvedConfig":[1040],"cameraControls":[4,"camera-controls"],"cameraType":[1537,"camera-type"],"keyboardControls":[4,"keyboard-controls"],"rotateAroundTapPoint":[4,"rotate-around-tap-point"],"token":[1025],"depthBuffers":[1,"depth-buffers"],"experimentalGhostingOpacity":[2,"experimental-ghosting-opacity"],"noDefaultLights":[4,"no-default-lights"],"featureLines":[16],"featureHighlighting":[16],"featureMaps":[1,"feature-maps"],"selectionMaterial":[1,"selection-material"],"resizeDebounce":[2,"resize-debounce"],"frame":[1040],"stream":[1040],"stencilBuffer":[1040],"viewport":[1040],"dimensions":[32],"hostDimensions":[32],"errorMessage":[32],"cursor":[32],"stateMap":[32],"dispatchFrameDrawn":[64],"registerInteractionHandler":[64],"registerTapKeyInteraction":[64],"getInteractionTarget":[64],"addCursor":[64],"getInteractionHandlers":[64],"getBaseInteractionHandler":[64],"getJwt":[64],"load":[64],"unload":[64],"scene":[64],"isSceneReady":[64]},[[0,"tap","handleTapEvent"]]]]],["p-74102b29",[[1,"vertex-viewer-measurement-details",{"measurementModel":[16],"measurementOverlays":[16],"measurementOutcome":[1040],"distanceUnits":[1,"distance-units"],"angleUnits":[1,"angle-units"],"fractionalDigits":[2,"fractional-digits"],"distanceFormatter":[16],"angleFormatter":[16],"areaFormatter":[16],"resultTypes":[16],"overlay":[32],"distanceMeasurementUnits":[32],"angleMeasurementUnits":[32],"areaMeasurementUnits":[32]}]]],["p-61a042f0",[[1,"vertex-viewer-transform-widget",{"viewer":[16],"position":[1040],"controller":[1040],"hovered":[1040]}]]],["p-c9f91798",[[1,"vertex-viewer-icon",{"name":[1],"size":[1]}]]],["p-ef7c3c47",[[0,"vertex-viewer-pin-group",{"pin":[16],"matrix":[1040],"projectionViewMatrix":[16],"elementBounds":[1040],"pinModel":[16],"pinController":[16],"selected":[4],"invalidateStateCounter":[32],"leafNodesRendered":[32]}]]],["p-b6b727a6",[[1,"vertex-viewer-dom-group",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040]}]]],["p-5679f46b",[[1,"vertex-viewer-measurement-distance",{"start":[1040],"startJson":[1,"start-json"],"end":[1040],"endJson":[1,"end-json"],"distance":[1026],"showAxisReferenceLines":[4,"show-axis-reference-lines"],"snapDistance":[2,"snap-distance"],"units":[1],"fractionalDigits":[2,"fractional-digits"],"labelFormatter":[16],"anchorLabelOffset":[2,"anchor-label-offset"],"lineCapLength":[2,"line-cap-length"],"mode":[513],"interactingAnchor":[1537,"interacting-anchor"],"invalid":[1540],"camera":[16],"hitProvider":[16],"indicatorPt":[1040],"viewer":[16],"measurementModel":[16],"viewport":[32],"elementBounds":[32],"interactionCount":[32],"internalCamera":[32],"invalidateStateCounter":[32],"stateMap":[32],"measurementUnits":[32],"computeElementMetrics":[64]}]]],["p-4fdf8553",[[1,"vertex-scene-tree-search",{"debounce":[2],"disabled":[4],"placeholder":[1],"value":[1025],"focused":[32],"setFocus":[64]}],[1,"vertex-scene-tree-table-layout",{"tree":[16],"controller":[16],"rows":[16],"totalRows":[2,"total-rows"],"rowHeight":[1026,"row-height"],"overScanCount":[2,"over-scan-count"],"rowData":[16],"layoutOffset":[1026,"layout-offset"],"scrollOffset":[1026,"scroll-offset"],"layoutHeight":[1026,"layout-height"],"layoutWidth":[1026,"layout-width"],"viewportStartIndex":[1026,"viewport-start-index"],"viewportEndIndex":[1026,"viewport-end-index"],"columnGridLayout":[32],"columnGridFixedLayout":[32],"hoveredNodeId":[32],"isComputingCellHeight":[32],"lastDividerPointerPosition":[32],"resizingColumnIndex":[32],"isScrolling":[32],"scrollTimer":[32],"stateMap":[32],"scrollToPosition":[64]}],[1,"vertex-scene-tree-toolbar"]]],["p-ebb801c3",[[1,"vertex-viewer-layer",{"stretchOff":[516,"stretch-off"]}]]],["p-4c3a3738",[[1,"vertex-viewer-toolbar",{"placement":[1],"direction":[1]}],[1,"vertex-viewer-button"],[1,"vertex-viewer-toolbar-group",{"direction":[1]}]]],["p-d828fd18",[[0,"vertex-viewer-pin-label",{"pin":[16],"elementBounds":[16],"value":[1025],"pinController":[16],"focused":[32],"computedScreenPosition":[32],"textareaRows":[32],"contentElBounds":[32],"setFocus":[64]}],[0,"vertex-viewer-pin-label-line",{"pinPoint":[16],"labelPoint":[16]}]]],["p-ca518dcb",[[1,"vertex-viewer-dom-renderer",{"drawMode":[1,"draw-mode"],"viewer":[16],"camera":[1040],"depthBuffer":[1040],"viewport":[32],"invalidateFrameCounter":[32]},[[0,"propertyChange","handlePropertyChange"]]],[1,"vertex-viewer-dom-element",{"position":[1040],"positionJson":[1,"position"],"rotation":[1040],"rotationJson":[1,"rotation"],"quaternion":[1040],"quaternionJson":[1,"quaternion"],"scale":[1040],"scaleJson":[1,"scale"],"matrix":[1040],"occlusionOff":[4,"occlusion-off"],"occluded":[516],"billboardOff":[4,"billboard-off"],"interactionsOff":[516,"interactions-off"]}]]],["p-d996b1d2",[[1,"vertex-viewer-markup-arrow",{"start":[1040],"startJson":[1,"start"],"end":[1040],"endJson":[1,"end"],"mode":[513],"viewer":[16],"elementBounds":[32],"editAnchor":[32],"dispose":[64]}],[1,"vertex-viewer-markup-circle",{"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"startPosition":[32],"editAnchor":[32],"resizeBounds":[32],"dispose":[64]}],[1,"vertex-viewer-markup-freeform",{"points":[1040],"pointsJson":[1,"points"],"bounds":[1040],"boundsJson":[1,"bounds"],"mode":[513],"viewer":[16],"elementBounds":[32],"resizeStartPosition":[32],"editAnchor":[32],"resizeBounds":[32],"resizePoints":[32],"screenPoints":[32],"dispose":[64]}]]],["p-7a5a9a93",[[1,"vertex-viewer-measurement-overlays",{"measurementOverlays":[16],"camera":[1040],"viewer":[16],"overlays":[32]}],[1,"vertex-viewer-measurement-line",{"start":[16],"end":[16],"capLength":[2,"cap-length"],"pointerEvents":[1,"pointer-events"]}]]]]'),e))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/viewer",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1-canary.2",
|
|
4
4
|
"description": "The Vertex SDK for viewing models.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Vertex Developers <support@vertexvis.com> (https://developer.vertexvis.com)",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"@stencil/core": "^2.12.1",
|
|
50
50
|
"@types/classnames": "^2.3.1",
|
|
51
51
|
"@vertexvis/frame-streaming-protos": "^0.6.22",
|
|
52
|
-
"@vertexvis/geometry": "0.14.
|
|
53
|
-
"@vertexvis/html-templates": "0.14.
|
|
52
|
+
"@vertexvis/geometry": "0.14.1-canary.2",
|
|
53
|
+
"@vertexvis/html-templates": "0.14.1-canary.2",
|
|
54
54
|
"@vertexvis/scene-tree-protos": "^0.1.14",
|
|
55
55
|
"@vertexvis/scene-view-protos": "^0.1.8",
|
|
56
|
-
"@vertexvis/stream-api": "0.14.
|
|
57
|
-
"@vertexvis/utils": "0.14.
|
|
56
|
+
"@vertexvis/stream-api": "0.14.1-canary.2",
|
|
57
|
+
"@vertexvis/utils": "0.14.1-canary.2",
|
|
58
58
|
"@vertexvis/web-workers": "^0.1.0",
|
|
59
59
|
"camel-case": "^4.1.2",
|
|
60
60
|
"classnames": "^2.3.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@vertexvis/rollup-plugin-vertexvis-copyright": "^0.4.1",
|
|
82
82
|
"@vertexvis/rollup-plugin-web-workers": "^0.1.0",
|
|
83
83
|
"@vertexvis/typescript-config-vertexvis": "1.1.0",
|
|
84
|
-
"@vertexwebsdk/build": "0.14.
|
|
84
|
+
"@vertexwebsdk/build": "0.14.1-canary.2",
|
|
85
85
|
"abortcontroller-polyfill": "^1.7.3",
|
|
86
86
|
"chance": "^1.1.8",
|
|
87
87
|
"eslint": "^8.6.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"typedoc": "^0.22.10",
|
|
97
97
|
"typescript": "^4.5.4"
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "e3dd9cfea48c01a6f90da2eb71e259176cad3a0a"
|
|
100
100
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**!
|
|
2
|
-
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import{h as i,F as t,r as e}from"./p-2e581b2a.js";import{p as n,m as o,v as s}from"./p-70e5e8a8.js";import"./p-058632f4.js";import"./p-6c377932.js";import"./p-92fe4417.js";import"./p-e42cb163.js";import"./p-df8fbe56.js";import{V as r}from"./p-29986489.js";import{i as l,b as a,P as p,a as h}from"./p-148c5f1a.js";import{a as d}from"./p-9acd1b44.js";import{c as v}from"./p-07aeee89.js";import"./p-083f427e.js";import"./p-dfe5a97d.js";import"./p-39803f8f.js";const c=({pin:e,selected:n})=>i(t,null,a(e)&&i("div",{id:"pin-anchor",class:v("pin-anchor",{selected:n})}),l(e)&&i("vertex-viewer-icon",{name:"pin-fill",size:"lg",class:v("pin",{"pin-selected":n})}));function u(i,t,e){const o=[{x:i.x+e.width/2,y:i.y},{x:i.x+e.width/2,y:i.y+e.height},{x:i.x,y:i.y+e.height/2},{x:i.x+e.width,y:i.y+e.height/2}],s=o.map((i=>n.distance(i,t)));return o[s.indexOf(Math.min(...s))]}let b=class{constructor(i){e(this,i),this.matrix=o.makeIdentity(),this.projectionViewMatrix=o.makeIdentity(),this.pinModel=new p,this.selected=!1,this.invalidateStateCounter=0,this.leafNodesRendered=!1,this.handleAnchorPointerDown=()=>{var i,t;null!=this.elementBounds&&"edit"===(null===(i=this.pinController)||void 0===i?void 0:i.getToolMode())&&null!=this.pin&&(null===(t=this.pinController)||void 0===t||t.setDraggable({id:this.pin.id}))}}componentDidLoad(){this.setLabelObserver(),null==this.pinController&&(this.pinController=new h(this.pinModel)),this.leafNodesRendered=!0}disconnectedCallback(){var i,t;null===(i=this.labelEl)||void 0===i||i.removeEventListener("labelChanged",this.invalidateState),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}render(){var e;if(null==this.pin)throw new Error("Unable to draw pin");const n=this.computePinPoints(this.pin),{pinPoint:o,labelPoint:s}=n;return i(t,null,i("vertex-viewer-dom-element",{"data-testid":`drawn-pin-${this.pin.id}`,position:this.pin.worldPosition,onPointerDown:i=>{var t,e;2!==i.buttons&&i.stopPropagation(),null===(t=this.pinController)||void 0===t||t.setSelectedPinId(null===(e=this.pin)||void 0===e?void 0:e.id),this.handleAnchorPointerDown(i)}},this.leafNodesRendered&&i(c,{pin:this.pin,selected:this.selected})),a(this.pin)&&i(t,null,i("vertex-viewer-pin-label-line",{id:`pin-label-line-${null===(e=this.pin)||void 0===e?void 0:e.id}`,pinPoint:o,labelPoint:s}),i("vertex-viewer-pin-label",{pin:this.pin,ref:i=>{this.labelEl=i},elementBounds:this.elementBounds,pinController:this.pinController})))}invalidateState(){this.invalidateStateCounter=this.invalidateStateCounter+1}setLabelObserver(){var i;const t=null===(i=this.labelEl)||void 0===i?void 0:i.addEventListener("labelChanged",this.invalidateState);null!=t&&(this.resizeObserver=new ResizeObserver((()=>this.invalidateState())),this.resizeObserver.observe(t))}computePinPoints(i){return null!=this.elementBounds&&null!=this.pin?a(this.pin)&&null!=this.pin.label.point?this.computeTextPinPoints(this.pin,this.elementBounds):this.computeDefaultPinPoints(this.pin,this.elementBounds):{pinPoint:i.worldPosition}}computeDefaultPinPoints(i,t){return{pinPoint:this.getFromWorldPosition(i.worldPosition,this.projectionViewMatrix,t)}}computeTextPinPoints(i,t){var e,n;const{pinPoint:o}=this.computeDefaultPinPoints(i,t),s=d(i.label.point,t),r=null===(e=this.labelEl)||void 0===e?void 0:e.querySelector(`#pin-label-${null===(n=this.pin)||void 0===n?void 0:n.id}`);return{pinPoint:o,labelPoint:u(s,o,{width:(null==r?void 0:r.clientWidth)||0,height:(null==r?void 0:r.clientHeight)||0})}}getFromWorldPosition(i,t,e){const n=s.transformMatrix(i,t);return r.fromDimensions(e).transformVectorToViewport(n)}};b.style=":host{--viewer-annotations-pin-dot-color:var(--blue-600);--viewer-annotations-pin-color:var(--blue-700);--viewer-annotations-pin-font-size:0.75rem;--viewer-annotations-pin-selected-stroke:var(--white);--viewer-annotations-pin-selected-border:2px solid var(--white);--viewer-annotations-pin-label-border:2px solid var(--black);--viewer-annotations-pin-selected-stroke:var(--white);font-size:var(--viewer-annotations-pin-font-size);position:absolute;top:0;bottom:0;left:0;right:0;overflow:hidden;pointer-events:none}.pin-anchor{position:absolute;border-radius:50%;transform:translate(-50%, -50%);display:block;width:9px;height:9px;box-sizing:border-box;border:var(--viewer-annotations-pin-label-border);background:var(--viewer-annotations-pin-dot-color);pointer-events:auto;cursor:pointer}.selected{width:13px;height:13px;border:var(--viewer-annotations-pin-selected-border)}.pin{color:var(--viewer-annotations-pin-color);cursor:pointer}.pin-selected{stroke-width:1;stroke:var(--viewer-annotations-pin-selected-stroke)}";export{b as vertex_viewer_pin_group}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/**!
|
|
2
|
-
* Copyright (c) 2022 Vertex Software LLC. All rights reserved.
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as i,h as s,H as e,g as n}from"./p-2e581b2a.js";import{p as h,v as o,h as r,j as a,r as l,b as c,s as u,d}from"./p-70e5e8a8.js";import{l as v,m as w,n as f,t as p,g as m,p as g,o as y,q as b,S as C,r as P,s as T,u as I,x as D,y as k,z as x,B as S,W as E,C as M,E as O}from"./p-e42cb163.js";import{E as j,m as A,c as R,o as F,u as B,a as z,b as L}from"./p-083f427e.js";import{c as N}from"./p-07aeee89.js";import{p as $}from"./p-c2e3312b.js";import{C as K}from"./p-058632f4.js";import{g as W,c as V}from"./p-99352cf0.js";import{I as q,f as H,C as U,W as G,a as J,b as _,d as X,V as Y,e as Q,g as Z,h as tt,i as it,S as st}from"./p-6d379d4a.js";import{E as et}from"./p-df8fbe56.js";import{V as nt}from"./p-29986489.js";import"./p-dfe5a97d.js";class ht{constructor(t){this.viewer=t,this.handleInteractionStarted=()=>{this.invalidateStencilBuffer(),this.pendingInteractionFinished=new Promise((t=>{this.pendingInteractionFinishedResolver=t}))},this.handleInteractionFinished=()=>{var t;null===(t=this.pendingInteractionFinishedResolver)||void 0===t||t.call(this),this.pendingInteractionFinished=void 0,this.pendingInteractionFinishedResolver=void 0},this.invalidateStencilBuffer=()=>{this.pendingStencilBuffer=void 0},t.addEventListener("interactionStarted",this.handleInteractionStarted),t.addEventListener("interactionFinished",this.handleInteractionFinished),t.addEventListener("frameReceived",(()=>{this.invalidateStencilBuffer()}))}async fetch(){var t;const i=await this.viewer.isSceneReady()?await this.viewer.scene():void 0,s=null!=i&&(i.crossSectioning().current().sectionPlanes.length>0||null!=this.viewer.featureLines),e=null===(t=this.viewer.frame)||void 0===t?void 0:t.scene.camera;if(s&&null!=this.viewer.stream&&null!=e){const t=await this.viewer.stream.getStencilBuffer({includeDepthBuffer:!0}),{stencilBuffer:i,depthBuffer:s,imageAttributes:n}=v(t),[h,o]=await Promise.all([w(new Uint8Array(i)),w(new Uint8Array(s))]);return ot.fromPng(h,n,i,f.fromPng(o,e,n))}}latest(){return null==this.pendingStencilBuffer&&(this.pendingStencilBuffer=this.fetch()),this.pendingStencilBuffer}async latestAfterInteraction(){return await this.pendingInteractionFinished,this.latest()}}class ot{constructor(t,i,s,e,n){this.imageAttr=t,this.imageBytes=i,this.pixelBytes=s,this.imageChannels=e,this.depthBuffer=n}static fromPng(t,i,s,e){if(t.data instanceof Uint8Array){if(1!==t.channels)throw new Error("Expected stencil PNG to have 1 color channel");return new ot(i,s,t.data,t.channels,e)}throw new Error("Expected stencil PNG to have depth of 8-bit")}getValue(t){const{width:i,height:s}=this.imageAttr.imageRect,e=h.subtract(t,this.imageAttr.imageRect),n=1/this.imageAttr.imageScale,o=h.scale(e,n,n);if(o.x>=0&&o.y>=0&&o.x<i&&o.y<s){const t=Math.floor(o.x)+Math.floor(o.y)*i;return this.pixelBytes[t]}return 0}hitTest(t){return 0!==this.getValue(t)}snapToNearestPixel(t,i,s=(()=>!0)){const e=2*i,n=h.create(t.x-i,t.y-i),o=[];for(let r=0;r<e*e;r++){const a=r%e,l=Math.floor(r/e),c=h.add(n,{x:a,y:l});if(h.distance(c,t)<=i){const t=this.getValue(c);255===t&&s(t)&&o.push(c)}}const r=o.sort(((i,s)=>h.distance(i,t)-h.distance(s,t)))[0];return null!=r?h.create(Math.floor(r.x)+.5,Math.floor(r.y)+.5):t}}class rt{constructor(t,i,s){this.stream=t,this.configProvider=i,this.imageScaleProvider=s}predicate(t){return t.altKey&&!t.shiftKey}async fn(t){var i;const s=this.imageScaleProvider(),e=await this.stream.hitItems({point:h.scale(t.position,(null==s?void 0:s.x)||1,(null==s?void 0:s.y)||1)},!0);null!=(null===(i=e.hitItems)||void 0===i?void 0:i.hits)&&e.hitItems.hits.length>0?await this.stream.flyTo({itemId:e.hitItems.hits[0].itemId,animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit results found for fly to part [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}class at{constructor(t,i,s,e,n,h,o,r,a,l,c){this.stream=t,this.cursors=i,this.getConfig=s,this.getScene=e,this.getFrame=n,this.getViewport=h,this.tapEmitter=o,this.doubleTapEmitter=r,this.longPressEmitter=a,this.interactionStartedEmitter=l,this.interactionFinishedEmitter=c,this.tap=this.tap.bind(this),this.doubleTap=this.doubleTap.bind(this),this.longPress=this.longPress.bind(this),this.emitTapEvent=this.emitTapEvent.bind(this)}addCursor(t,i){return this.cursors.add(t,i)}async getWorldPointFromViewport(t){const i=this.getViewport(),s=this.getFrame();if(null==s)throw new Error("Cannot get world point. Frame is undefined.");const e=await s.depthBuffer();return null!=e?i.transformPointToWorldSpace(t,e,.5):void 0}async getEntityTypeAtPoint(t){var i;const s=this.getViewport(),e=await(null===(i=this.getFrame())||void 0===i?void 0:i.featureMap());if(null!=e){const i=s.transformPointToFrame(t,e);return e.getEntityType(i)}return et.NO_GEOMETRY}getRayFromPoint(t){const i=this.getViewport(),s=this.getFrame();if(null!=s)return i.transformPointToRay(t,s.image,s.scene.camera);throw new Error("Cannot get camera. Frame is undefined.")}async tap(t,i={},s=0){this.emitTapEvent(this.tapEmitter.emit,t,i,s)}async doubleTap(t,i={},s=0){this.emitTapEvent(this.doubleTapEmitter.emit,t,i,s)}async longPress(t,i={},s=0){this.emitTapEvent(this.longPressEmitter.emit,t,i,s)}async beginInteraction(){this.isInteracting()||(this.interactionStartedEmitter.emit(),this.currentCamera=this.getScene().camera(),await this.stream.beginInteraction())}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),e=this.getViewport(),n=this.getFrame(),h=await(null==n?void 0:n.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=e&&null!=n?t({camera:this.currentCamera,viewport:e,scale:s.scale(),boundingBox:s.boundingBox(),frame:n,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}async twistCamera(...t){return this.transformCamera((({camera:i,viewport:s})=>{const e=o.normalize(o.subtract(i.lookAt,i.position));if(1===t.length&&"number"==typeof t[0]){const s=r.toRadians(-t[0]);return i.rotateAroundAxis(s,e)}if(1===t.length){const e=h.create(s.width/2,s.height/2),n=r.toDegrees(r.fromPoints(e,t[0])),a=null!=this.lastAngle?n-this.lastAngle:0;this.lastAngle=n;const l=o.normalize(o.subtract(i.lookAt,i.position)),c=r.toRadians(-a);return i.rotateAroundAxis(c,l)}return i}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:e,depthBuffer:n})=>{if(null==this.panData){const h=i.toFrameCamera(),o=h.direction,r=e.transformPointToRay(t,s.image,h),c=a.fromNormalAndCoplanarPoint(o,i.lookAt),u=l.intersectPlane(r,c);if(null==u)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;const d=null!=n?this.getWorldPoint(t,n,u):u,v=a.fromNormalAndCoplanarPoint(o,d);this.panData={hitPt:d,hitPlane:v,startingCamera:h}}if(null!=this.panData){const{hitPt:n,hitPlane:h,startingCamera:r}=this.panData,a=e.transformPointToRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(n,c);return i.update(r).moveBy(t)}}return i}))}async viewAll(){await this.getScene().camera().viewAll().render()}async rotateCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const e=o.normalize(i.up),n=o.normalize(o.subtract(i.lookAt,i.position)),h=o.cross(e,n),r=o.cross(n,h),a=o.normalize({x:t.x*h.x+t.y*r.x,y:t.x*h.y+t.y*r.y,z:t.x*h.z+t.y*r.z}),l=o.cross(a,n),c=3*Math.PI*t.x/s.width,u=3*Math.PI*t.y/s.height,d=Math.abs(c)+Math.abs(u);return i.rotateAroundAxis(d,l)}))}async rotateCameraAtPoint(t,i){return this.transformCamera((({camera:s,viewport:e,boundingBox:n,depthBuffer:h})=>{if(null==this.worldRotationPoint){const t=c.center(n);this.worldRotationPoint=null!=h?this.getWorldPoint(i,h,t):s.lookAt}const r=o.normalize(s.up),a=o.normalize(o.subtract(s.lookAt,s.position)),l=o.cross(r,a),u=o.cross(a,l),d=o.normalize({x:t.x*l.x+t.y*u.x,y:t.x*l.y+t.y*u.y,z:t.x*l.z+t.y*u.z}),v=o.cross(d,a),w=3*Math.PI*t.x/e.width,f=3*Math.PI*t.y/e.height,p=Math.abs(w)+Math.abs(f),m=s.rotateAroundAxisAtPoint(p,this.worldRotationPoint,v);return m.update({lookAt:o.add(o.scale(Math.abs(s.signedDistanceToBoundingBoxCenter())/o.magnitude(m.viewVector),m.viewVector),m.position)})}))}async zoomCamera(t){return this.transformCamera((({camera:i,viewport:s})=>{const e=i.viewVector,n=o.normalize(e),h=o.magnitude(e),r=o.add(i.position,o.scale(3*h*t/s.height,n));return i.update({position:r})}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:e,frame:n,depthBuffer:h})=>{const r=n.scene.camera,c=r.direction,u=s.toFrameCamera(),d=e.transformPointToRay(t,n.image,u);if(null==this.zoomData){const i=a.fromNormalAndCoplanarPoint(c,r.lookAt),e=l.intersectPlane(d,i);if(null==e)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const n=null!=h?this.getWorldPoint(t,h,e):e,o=a.fromNormalAndCoplanarPoint(c,n);this.zoomData={hitPt:n,hitPlane:o}}if(null!=this.zoomData){const{hitPt:t,hitPlane:n}=this.zoomData,h=o.distance(s.position,t),r=l.at(d,6*h*i/e.height),c=a.projectPoint(n,r),u=s.update({position:r,lookAt:c});if(o.distance(r,c)>=u.near)return u}return s}))}async pivotCamera(t,i){return this.transformCamera((({camera:s})=>{const{position:e,up:n,lookAt:h}=s,a=o.normalize(n),l=o.normalize(s.viewVector),c=o.cross(a,l),u=o.cross(l,c),d=o.rotateAboutAxis(r.toRadians(t),h,c,e),v=o.rotateAboutAxis(r.toRadians(i),d,u,e);return s.update(Object.assign(Object.assign({},s),{lookAt:v}))}))}async endInteraction(){this.isInteracting()&&(this.currentCamera=void 0,this.worldRotationPoint=void 0,this.panData=void 0,this.zoomData=void 0,this.resetLastAngle(),this.interactionFinishedEmitter.emit(),await this.stream.endInteraction())}resetLastAngle(){this.lastAngle=void 0}isInteracting(){return null!=this.currentCamera}pixelThreshold(t){return(this.isCoarseInputDevice(t)?this.getConfig().coarsePointerThreshold:this.getConfig().finePointerThreshold)*window.devicePixelRatio}async hitItems(t){var i;const s=await this.getScene().raycaster().hitItems(t);return null!==(i=null==s?void 0:s.hits)&&void 0!==i?i:[]}emitTapEvent(t,i,s={},e=0){const{altKey:n=!1,ctrlKey:h=!1,metaKey:o=!1,shiftKey:r=!1}=s;t({position:i,altKey:n,ctrlKey:h,metaKey:o,shiftKey:r,buttons:e})}isCoarseInputDevice(t){return t||window.matchMedia("(pointer: coarse)").matches}getWorldPoint(t,i,s){const e=this.getViewport(),n=e.transformPointToFrame(t,i);return i.hitTest(n)?e.transformPointToWorldSpace(t,i):s}}class lt extends at{constructor(t,i,s,e,n,h,o,r,a,l,c){super(t,i,s,e,n,h,o,r,a,l,c)}async getWorldPointFromViewport(t){const i=this.getViewport(),s=this.getFrame();if(null==s)throw new Error("Cannot get world point. Frame is undefined.");const e=await s.depthBuffer();return null!=e?i.transformPointToOrthographicWorldSpace(t,e,.5):void 0}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{const e=i.viewVector,n=o.normalize(i.up),h=o.normalize(e),r=o.magnitude(e)*Math.tan(i.fovHeight),a=t.x*r/s.width,l=t.y/s.width*r,c=o.cross(n,h),u=o.cross(h,c),d=o.add(o.scale(a,c),o.scale(l,u));return i.moveBy(d)}))}async panCameraToScreenPoint(t){return this.transformCamera((({camera:i,frame:s,viewport:e})=>{if(null==this.panData){const n=i.toFrameCamera(),h=n.direction,o=e.transformPointToOrthographicRay(t,s.image,n),r=a.fromNormalAndCoplanarPoint(h,i.lookAt),c=l.intersectPlane(o,r);if(null==c)return console.warn("Cannot determine fallback for pan. Ray does not intersect plane."),i;this.panData={hitPt:c,hitPlane:r,startingCamera:n}}if(null!=this.panData){const{hitPt:n,hitPlane:h,startingCamera:r}=this.panData,a=e.transformPointToOrthographicRay(t,s.image,r),c=l.intersectPlane(a,h);if(null!=c){const t=o.subtract(n,c);return i.update({lookAt:o.add(r.lookAt,t)})}}return i}))}async zoomCameraToPoint(t,i){return this.transformCamera((({camera:s,viewport:e,frame:n,depthBuffer:r})=>{if(null==this.orthographicZoomData||h.distance(t,this.orthographicZoomData.startingScreenPt)>2){const i=s.toFrameCamera(),h=i.direction,o=e.transformPointToOrthographicRay(t,n.image,i),c=a.fromNormalAndCoplanarPoint(h,i.lookAt),u=l.intersectPlane(o,c);if(null==u)return console.warn("Cannot determine fallback point for zoom. Ray does not intersect plane."),s;const d=null!=r?this.getWorldPoint(t,r,u):u,v=a.fromNormalAndCoplanarPoint(h,d);this.orthographicZoomData={hitPt:d,hitPlane:v,startingScreenPt:t}}if(null!=this.orthographicZoomData){const{hitPt:t,hitPlane:n}=this.orthographicZoomData,h=s.fovHeight/e.height*2*i,r=Math.max(1,s.fovHeight-h),l=a.projectPoint(n,s.lookAt),c=o.scale((s.fovHeight-r)/s.fovHeight,o.subtract(t,l));return s.update({lookAt:o.add(s.lookAt,c),fovHeight:Math.max(1,s.fovHeight-h)})}return s}))}getWorldPoint(t,i,s){const e=this.getViewport(),n=e.transformPointToFrame(t,i);return i.hitTest(n)?e.transformPointToOrthographicWorldSpace(t,i):s}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),e=this.getViewport(),n=this.getFrame(),h=await(null==n?void 0:n.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=e&&null!=n?t({camera:this.currentCamera,viewport:e,scale:s.scale(),boundingBox:s.boundingBox(),frame:n,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ct extends at{constructor(t,i,s,e,n,h,o,r,a,l,c){super(t,i,s,e,n,h,o,r,a,l,c)}async panCameraByDelta(t){return this.transformCamera((({camera:i,viewport:s})=>{var e;const n=i.viewVector,h=o.normalize(i.up),r=o.normalize(n),a=o.magnitude(n)*Math.tan(null!==(e=i.fovY)&&void 0!==e?e:45),l=t.x*a/s.width,c=t.y/s.width*a,u=o.cross(h,r),d=o.cross(r,u),v=o.add(o.scale(l,u),o.scale(c,d));return i.moveBy(v)}))}async transformCamera(t){var i;if(this.isInteracting()){const s=this.getScene(),e=this.getViewport(),n=this.getFrame(),h=await(null==n?void 0:n.depthBuffer());this.currentCamera=null!=this.currentCamera&&null!=e&&null!=n?t({camera:this.currentCamera,viewport:e,scale:s.scale(),boundingBox:s.boundingBox(),frame:n,depthBuffer:h}):void 0,await(null===(i=this.currentCamera)||void 0===i?void 0:i.render())}}}class ut{constructor(t,i,s,e){this.stream=t,this.configProvider=i,this.imageScaleProvider=s,this.sceneProvider=e}predicate(t){return t.altKey&&t.shiftKey}async fn(t){var i,s;const e=this.imageScaleProvider(),n=await this.stream.hitItems({point:h.scale(t.position,(null==e?void 0:e.x)||1,(null==e?void 0:e.y)||1)},!0);if(null!=(null===(i=n.hitItems)||void 0===i?void 0:i.hits)&&n.hitItems.hits.length>0&&null!=n.hitItems.hits[0].hitPoint){const i=this.sceneProvider().camera(),e=n.hitItems.hits[0];null!=e.hitPoint&&null!=e.hitPoint.x&&null!=e.hitPoint.y&&null!=e.hitPoint.z?await this.stream.flyTo({camera:m(i.update({lookAt:o.create(e.hitPoint.x,e.hitPoint.y,e.hitPoint.z)}).toFrameCamera()),animation:{duration:p(this.configProvider().animation.durationMs)}}):console.debug(`No hit position found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}, hit-id={${null===(s=e.itemId)||void 0===s?void 0:s.hex}}]`)}else console.debug(`No hit results found for fly to position [position={x: ${t.position.x}, y: ${t.position.y}}]`)}}const dt=[.2,.15,.25,.25,.15];class vt{constructor(t,i,s,e,n,h,o,r,a,l){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.rotateInteraction=e,this.rotatePointInteraction=n,this.zoomInteraction=h,this.panInteraction=o,this.twistInteraction=r,this.pivotInteraction=a,this.getConfig=l,this.primaryInteraction=this.rotateInteraction,this.isDragging=!1,this.keyboardControls=!1,this.disableIndividualInteractions=!1,this.primaryInteractionTypeChange=new j,this.handleDownEvent=this.handleDownEvent.bind(this),this.handleMouseWheel=this.handleMouseWheel.bind(this),this.handleWindowMove=this.handleWindowMove.bind(this),this.handleWindowUp=this.handleWindowUp.bind(this),this.handleDoubleClick=this.handleDoubleClick.bind(this)}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDownEvent),t.addEventListener("mousedown",this.handleDoubleClick),t.addEventListener("wheel",this.handleMouseWheel)}dispose(){var t,i,s;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDownEvent),null===(i=this.element)||void 0===i||i.removeEventListener("mousedown",this.handleDoubleClick),null===(s=this.element)||void 0===s||s.removeEventListener("wheel",this.handleMouseWheel),this.element=void 0}onPrimaryInteractionTypeChange(t){return this.primaryInteractionTypeChange.on(t)}setCurrentInteractionType(t){var i;switch(t){case"rotate":this.currentInteraction=this.rotateInteraction;break;case"zoom":this.currentInteraction=this.zoomInteraction;break;case"pan":this.currentInteraction=this.panInteraction;break;case"twist":this.currentInteraction=this.twistInteraction;break;case"rotate-point":this.currentInteraction=this.rotatePointInteraction;break;case"pivot":this.currentInteraction=this.pivotInteraction;break;default:this.currentInteraction=void 0}if(this.draggingInteraction){const t=this.draggingInteraction.getPosition();this.draggingInteraction=this.currentInteraction||this.primaryInteraction,null===(i=this.interactionApi)||void 0===i||i.resetLastAngle(),this.draggingInteraction.setPosition(t)}}getPrimaryInteractionType(){return this.primaryInteraction.getType()}getCurrentInteractionType(){return(this.currentInteraction||this.primaryInteraction).getType()}setPrimaryInteractionType(t){switch(t){case"rotate":this.primaryInteraction=this.rotateInteraction;break;case"rotate-point":this.primaryInteraction=this.rotatePointInteraction;break;case"zoom":this.primaryInteraction=this.zoomInteraction;break;case"pan":this.primaryInteraction=this.panInteraction;break;case"pivot":this.primaryInteraction=this.pivotInteraction}this.primaryInteractionTypeChange.emit()}setDefaultKeyboardControls(t){this.keyboardControls=t}handleDownEvent(t){this.interactionTimer=window.setTimeout((()=>{this.downPosition=h.create(t.screenX,t.screenY),this.downPositionCanvas=this.getCanvasPosition(t),this.interactionTimer=void 0,null!=this.lastMoveEvent&&this.handleWindowMove(this.lastMoveEvent)}),this.getConfig().interactions.interactionDelay),window.addEventListener(this.moveEvent,this.handleWindowMove),window.addEventListener(this.upEvent,this.handleWindowUp)}handleWindowMove(t){if(null==this.interactionTimer){if(this.disableIndividualInteractions)return;const i=h.create(t.screenX,t.screenY),s=null!=this.interactionApi?this.interactionApi.pixelThreshold(this.isTouch(t)):2;null!=this.downPosition&&h.distance(i,this.downPosition)>=s&&!this.isDragging&&(this.beginDrag(t),this.isDragging=!0),this.isDragging&&this.drag(t)}this.lastMoveEvent=t}async handleWindowUp(t){this.isDragging&&(this.endDrag(t),this.isDragging=!1),null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0),window.removeEventListener(this.moveEvent,this.handleWindowMove),window.removeEventListener(this.upEvent,this.handleWindowUp),this.lastMoveEvent=void 0}async handleDoubleClick(t){2===t.detail&&4===t.buttons&&null!=this.interactionApi&&this.interactionApi.viewAll()}beginDrag(t){this.keyboardControls&&t.metaKey&&t.shiftKey?this.currentInteraction=this.rotatePointInteraction:this.keyboardControls&&t.shiftKey?this.currentInteraction=this.zoomInteraction:this.keyboardControls&&(t.metaKey||t.ctrlKey)?this.currentInteraction=this.panInteraction:this.keyboardControls&&t.altKey&&(this.currentInteraction=this.rotateInteraction),1===t.buttons||4===t.buttons?this.draggingInteraction=this.currentInteraction||this.primaryInteraction:2===t.buttons&&(this.draggingInteraction=this.panInteraction),null!=this.draggingInteraction&&null!=this.interactionApi&&null!=this.element&&(this.zoomInteraction.endDrag(t,this.interactionApi),this.draggingInteraction.beginDrag(t,this.downPositionCanvas||h.create(t.clientX,t.clientY),this.interactionApi,this.element))}drag(t){this.currentInteraction=this.keyboardControls&&t.altKey&&t.shiftKey?this.twistInteraction:void 0,this.draggingInteraction=this.currentInteraction||this.draggingInteraction||this.primaryInteraction,null!=this.draggingInteraction&&null!=this.interactionApi&&this.draggingInteraction.drag(t,this.interactionApi)}endDrag(t){this.keyboardControls&&this.currentInteraction===this.twistInteraction&&(this.currentInteraction=void 0),null!=this.draggingInteraction&&null!=this.interactionApi&&(this.draggingInteraction.endDrag(t,this.interactionApi),this.draggingInteraction=void 0)}handleMouseWheel(t){if(t.preventDefault(),null!=this.element&&null!=this.interactionApi&&4!==t.buttons){const i=-this.wheelDeltaToPixels(t.deltaY,t.deltaMode)/10,s=this.element.getBoundingClientRect(),e=W(t,s);dt.forEach(((t,s)=>{window.setTimeout((()=>{null!=this.interactionApi&&this.zoomInteraction.zoomToPoint(e,i*t,this.interactionApi)}),2*s)}))}}wheelDeltaToPixels(t,i){null==this.computedBodyStyle&&(this.computedBodyStyle=window.getComputedStyle(document.body));const s=null==this.computedBodyStyle.fontSize||""===this.computedBodyStyle.fontSize||isNaN(parseFloat(this.computedBodyStyle.fontSize))?19.2:1.2*parseFloat(this.computedBodyStyle.fontSize);return 1===i?null==this.computedBodyStyle.lineHeight||""===this.computedBodyStyle.lineHeight||isNaN(parseFloat(this.computedBodyStyle.lineHeight))?t*s:t*parseFloat(this.computedBodyStyle.lineHeight):2===i?null==this.computedBodyStyle.height||""===this.computedBodyStyle.height||isNaN(parseFloat(this.computedBodyStyle.height))?t*window.innerHeight:t*parseFloat(this.computedBodyStyle.height):t}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),e=null!=s?h.create(s.left,s.top):void 0;return null!=e?h.subtract(h.create(t.clientX,t.clientY),e):void 0}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class wt{setPosition(t){this.currentPosition=t}getPosition(){return this.currentPosition}getType(){return this.type}beginDrag(t,i,s,e){}drag(t,i){}endDrag(t,i){null!=this.currentPosition&&(i.endInteraction(),this.currentPosition=void 0)}zoom(t,i){}}class ft extends wt{constructor(){super(...arguments),this.type="rotate"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.screenX,t.screenY),e=h.subtract(s,this.currentPosition);i.rotateCamera(e),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class pt extends wt{constructor(){super(...arguments),this.type="rotate-point"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.startingPosition=i,s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.startingPosition){const s=h.create(t.screenX,t.screenY),e=h.subtract(s,this.currentPosition);i.rotateCameraAtPoint(e,this.startingPosition),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class mt extends wt{constructor(t=1e3){super(),this.interactionTimeout=t,this.type="zoom",this.didTransformBegin=!1}beginDrag(t,i,s,e){if(null==this.currentPosition){this.currentPosition=h.create(t.clientX,t.clientY);const i=e.getBoundingClientRect(),n=W(t,i);this.startPt=n,s.beginInteraction()}}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.clientX,t.clientY),e=h.subtract(s,this.currentPosition);null!=this.startPt&&(i.zoomCameraToPoint(this.startPt,e.y),this.currentPosition=s)}}endDrag(t,i){super.endDrag(t,i),this.stopInteractionTimer(),this.didTransformBegin=!1,this.startPt=void 0}zoom(t,i){this.operateWithTimer(i,(()=>i.zoomCamera(t)))}zoomToPoint(t,i,s){this.operateWithTimer(s,(()=>s.zoomCameraToPoint(t,i)))}beginInteraction(t){this.didTransformBegin=!0,t.beginInteraction()}endInteraction(t){this.didTransformBegin=!1,t.endInteraction()}resetInteractionTimer(t){this.stopInteractionTimer(),this.startInteractionTimer(t)}startInteractionTimer(t){this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0,this.endInteraction(t)}),this.interactionTimeout)}stopInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}operateWithTimer(t,i){this.didTransformBegin||this.beginInteraction(t),this.resetInteractionTimer(t),i()}}class gt extends wt{constructor(){super(...arguments),this.type="pan"}beginDrag(t,i,s,e){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),this.canvasRect=e.getBoundingClientRect(),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition&&null!=this.canvasRect){const s=W(t,this.canvasRect);i.panCameraToScreenPoint(s),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class yt extends wt{constructor(){super(...arguments),this.type="twist"}beginDrag(t,i,s){this.currentPosition=h.create(t.clientX,t.clientY),s.beginInteraction()}drag(t,i){const s=h.create(t.clientX,t.clientY);this.currentPosition=s,i.twistCamera(s)}endDrag(t,i){super.endDrag(t,i)}}class bt extends wt{constructor(){super(...arguments),this.type="pivot"}beginDrag(t,i,s){null==this.currentPosition&&(this.currentPosition=h.create(t.screenX,t.screenY),s.beginInteraction())}drag(t,i){if(null!=this.currentPosition){const s=h.create(t.screenX,t.screenY),e=h.subtract(s,this.currentPosition);i.pivotCamera(-.25*e.y,.25*e.x),this.currentPosition=s}}endDrag(t,i){super.endDrag(t,i)}}class Ct extends vt{constructor(t,i=new ft,s=new pt,e=new mt,n=new gt,h=new yt,o=new bt){super("mousedown","mouseup","mousemove",i,s,e,n,h,o,t)}}class Pt{initialize(t,i){this.element=t,this.interactionApi=i}dispose(){this.element=void 0}handleTwoPointTouchMove(t,i){var s,e,n,o;if(null!=this.currentPosition1&&null!=this.currentPosition2){const a=h.scale(h.add(h.subtract(t,this.currentPosition1),h.subtract(i,this.currentPosition2)),.25,.25),l=.5*(h.distance(t,i)-h.distance(this.currentPosition1,this.currentPosition2)),c=u.create(h.subtract(this.currentPosition1,this.currentPosition2),h.subtract(t,i)),d=r.toDegrees(Math.atan2(u.determinant(c),u.dot(c)));null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(e=this.interactionApi)||void 0===e||e.zoomCamera(l),null===(n=this.interactionApi)||void 0===n||n.panCameraByDelta(a),Math.abs(d)>.5&&(null===(o=this.interactionApi)||void 0===o||o.twistCamera(d))}this.currentPosition1=t,this.currentPosition2=i}}class Tt extends Pt{constructor(){super(),this.touchPoints={},this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("pointerdown",this.handlePointerDown),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){const i=h.create(t.screenX,t.screenY);this.touchPoints=Object.assign(Object.assign({},this.touchPoints),{[t.pointerId]:i}),1===Object.keys(this.touchPoints).length&&(window.addEventListener("pointermove",this.handlePointerMove),window.addEventListener("pointerup",this.handlePointerUp))}handlePointerMove(t){null!=this.touchPoints[t.pointerId]&&(this.touchPoints[t.pointerId]=h.create(t.screenX,t.screenY));const i=Object.keys(this.touchPoints);2===i.length&&this.handleTwoPointTouchMove(this.touchPoints[i[0]],this.touchPoints[i[1]])}handlePointerUp(t){var i;delete this.touchPoints[t.pointerId];const s=Object.keys(this.touchPoints);1===s.length&&(null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.currentPosition1=void 0,this.currentPosition2=void 0),0===s.length&&(window.removeEventListener("pointermove",this.handlePointerMove),window.removeEventListener("pointerup",this.handlePointerUp))}}class It extends vt{constructor(t){super("pointerdown","pointerup","pointermove",new ft,new pt,new mt,new gt,new yt,new bt,t),this.touchPoints=new Set,this.handlePointerDown=this.handlePointerDown.bind(this),this.handlePointerUp=this.handlePointerUp.bind(this)}initialize(t,i){super.initialize(t,i),t.addEventListener("pointerdown",this.handlePointerDown)}handlePointerDown(t){this.downPosition=h.create(t.screenX,t.screenY),this.touchPoints.add(t.pointerId),1===this.touchPoints.size&&window.addEventListener("pointerup",this.handlePointerUp),2===this.touchPoints.size&&(this.disableIndividualInteractions=!0)}handlePointerUp(t){this.touchPoints.delete(t.pointerId),this.touchPoints.size<2&&(this.disableIndividualInteractions=!1),0===this.touchPoints.size&&window.removeEventListener("pointerup",this.handlePointerUp)}}class Dt{constructor(t,i,s,e){this.downEvent=t,this.upEvent=i,this.moveEvent=s,this.getConfig=e,this.handleDown=this.handleDown.bind(this),this.handleUp=this.handleUp.bind(this),this.handleMove=this.handleMove.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.handlePointerMove=this.handlePointerMove.bind(this),this.handlePointerEnd=this.handlePointerEnd.bind(this),this.clearPositions=this.clearPositions.bind(this),this.restartDoubleTapTimer=this.restartDoubleTapTimer.bind(this),this.clearDoubleTapTimer=this.clearDoubleTapTimer.bind(this),this.restartLongPressTimer=this.restartLongPressTimer.bind(this),this.clearLongPressTimer=this.clearLongPressTimer.bind(this),this.setPointerPositions=this.setPointerPositions.bind(this),this.emit=this.emit.bind(this)}dispose(){var t,i;null===(t=this.element)||void 0===t||t.removeEventListener(this.downEvent,this.handleDown),null===(i=this.element)||void 0===i||i.removeEventListener("touchstart",this.handleTouchStart),this.element=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer()}initialize(t,i){this.element=t,this.interactionApi=i,t.addEventListener(this.downEvent,this.handleDown),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){1===t.touches.length&&(this.setPointerPositions(h.create(t.touches[0].clientX,t.touches[0].clientY)),this.restartLongPressTimer(),window.addEventListener("touchend",this.handleTouchEnd),window.addEventListener("touchmove",this.handleTouchMove))}handleTouchMove(t){t.touches.length>0&&this.handlePointerMove(h.create(t.touches[0].clientX,t.touches[0].clientY),!0)}handleTouchEnd(t){null!=this.pointerDownPosition&&(window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchmove",this.handleTouchMove)),this.handlePointerEnd(this.pointerDownPosition)}handleDown(t){this.setPointerPositions(h.create(t.clientX,t.clientY)),this.buttons=t.buttons,this.restartLongPressTimer({altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey}),window.addEventListener(this.upEvent,this.handleUp),window.addEventListener(this.moveEvent,this.handleMove)}handleMove(t){this.handlePointerMove(h.create(t.clientX,t.clientY),this.isTouch(t))}handleUp(t){null!=this.pointerDownPosition&&(window.removeEventListener(this.upEvent,this.handleUp),window.removeEventListener(this.moveEvent,this.handleMove)),this.handlePointerEnd(h.create(t.clientX,t.clientY),{altKey:t.altKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey},this.buttons,this.isTouch(t)),this.buttons=void 0}handlePointerMove(t,i){var s;const e=(null===(s=this.interactionApi)||void 0===s?void 0:s.pixelThreshold(i))||2;null!=this.pointerDownPosition&&h.distance(t,this.pointerDownPosition)>=e&&null==this.interactionTimer&&this.clearPositions()}handlePointerEnd(t,i={},s=0,e=!1){var n,h;null!=t&&(null!=this.longPressTimer&&this.emit(null===(n=this.interactionApi)||void 0===n?void 0:n.tap)(t,i,s),null!=this.doubleTapTimer&&null!=this.secondPointerDownPosition&&(this.emit(null===(h=this.interactionApi)||void 0===h?void 0:h.doubleTap)(t,i,s,this.secondPointerDownPosition),this.clearDoubleTapTimer())),this.pointerDownPosition=void 0,this.clearLongPressTimer()}emit(t){return(i,s={},e=0,n,o=!1)=>{var r;const a=n||this.pointerDownPosition,l=(null===(r=this.interactionApi)||void 0===r?void 0:r.pixelThreshold(o))||1;let c;null!=this.interactionTimer?c=this.getCanvasPosition(a||i):null!=a&&h.distance(a,i)<=l&&(c=this.getCanvasPosition(i)),null!=c&&null!=t&&t(c,s,e)}}getCanvasPosition(t){var i;const s=null===(i=this.element)||void 0===i?void 0:i.getBoundingClientRect(),e=null!=s?h.create(s.left,s.top):void 0;return null!=e?h.subtract(h.create(t.x,t.y),e):void 0}clearPositions(){this.pointerDownPosition=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0,this.clearDoubleTapTimer(),this.clearLongPressTimer(),this.clearInteractionTimer()}clearDoubleTapTimer(){null!=this.doubleTapTimer&&window.clearTimeout(this.doubleTapTimer),this.doubleTapTimer=void 0,this.firstPointerDownPosition=void 0,this.secondPointerDownPosition=void 0}restartDoubleTapTimer(){this.clearDoubleTapTimer(),this.doubleTapTimer=window.setTimeout((()=>this.clearDoubleTapTimer()),this.getConfig().events.doubleTapThreshold)}clearLongPressTimer(){null!=this.longPressTimer&&window.clearTimeout(this.longPressTimer),this.longPressTimer=void 0}restartLongPressTimer(t={}){this.clearLongPressTimer(),this.longPressTimer=window.setTimeout((()=>{var i;this.pointerDownPosition&&this.emit(null===(i=this.interactionApi)||void 0===i?void 0:i.longPress)(this.pointerDownPosition,t,this.buttons),this.clearLongPressTimer()}),this.getConfig().events.longPressThreshold)}restartInteractionTimer(){this.clearInteractionTimer(),this.interactionTimer=window.setTimeout((()=>{this.interactionTimer=void 0}),this.getConfig().interactions.interactionDelay)}clearInteractionTimer(){null!=this.interactionTimer&&(window.clearTimeout(this.interactionTimer),this.interactionTimer=void 0)}setPointerPositions(t){this.pointerDownPosition=t,this.restartInteractionTimer(),null==this.firstPointerDownPosition?(this.restartDoubleTapTimer(),this.firstPointerDownPosition=t):this.secondPointerDownPosition=t}isTouch(t){return null!=window.PointerEvent&&t instanceof PointerEvent&&"touch"===t.pointerType}}class kt extends Pt{constructor(){super(),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this)}dispose(){var t;null===(t=this.element)||void 0===t||t.removeEventListener("touchstart",this.handleTouchStart),super.dispose()}initialize(t,i){super.initialize(t,i),t.addEventListener("touchstart",this.handleTouchStart)}handleTouchStart(t){if(t.touches.length>=1){const i=t.touches[0],s=t.touches[1];this.currentPosition1=h.create(i.screenX,i.screenY),this.currentPosition2=null!=s?h.create(s.screenX,s.screenY):void 0,window.addEventListener("touchmove",this.handleTouchMove,{passive:!1}),window.addEventListener("touchend",this.handleTouchEnd)}}handleTouchMove(t){if(1===t.touches.length)this.handleOnePointTouchMove(t.touches[0]);else if(2===t.touches.length){const i=h.create(t.touches[0].clientX,t.touches[0].clientY),s=h.create(t.touches[1].clientX,t.touches[1].clientY);this.handleTwoPointTouchMove(i,s)}}handleTouchEnd(t){var i;null===(i=this.interactionApi)||void 0===i||i.endInteraction(),this.isInteracting=!1,window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd)}handleOnePointTouchMove(t){var i,s,e;const n=h.create(t.screenX,t.screenY);if(null!=this.currentPosition1){const t=h.subtract(n,this.currentPosition1),o=(null===(i=this.interactionApi)||void 0===i?void 0:i.pixelThreshold(!0))||2;(h.distance(n,this.currentPosition1)>=o||this.isInteracting)&&(null===(s=this.interactionApi)||void 0===s||s.beginInteraction(),null===(e=this.interactionApi)||void 0===e||e.rotateCamera(t),this.isInteracting=!0)}this.currentPosition1=n}}const xt=new class{constructor(t,i=window.performance){this.name=t,this.perf=i,this.measures=new Set,this.nextId=0}clearMeasurements(){this.perf.clearMeasures(this.name)}measure(t){if(null!=(i=t)&&i.then instanceof Function&&i.catch instanceof Function&&i.finally instanceof Function){const i=this.begin();return t.finally((()=>this.end(i)))}if("function"==typeof t){const i=this.begin(),s=t();return this.end(i),s}throw new Error("Input must be a function or Promise");var i}takeMeasurements(){const t=this.perf.getEntriesByName(this.name);return this.clearMeasurements(),t}takeLastMeasurement(){const t=this.takeMeasurements();return t[t.length-1]}begin(){const t=`${this.name}-${this.nextId++}`;return this.measures.add(t),this.perf.mark(t),t}end(t){this.perf.measure(this.name,t),this.perf.clearMarks(t),this.measures.delete(t)}}("paint_time");function St(t,i,s,e,n=1e3){let h,o,r=0,a=[];return s&&setInterval((()=>{if(null!=o){5===a.length?a=[...a.slice(1),o]:a.push(o);const t=a.reduce(((t,i)=>t+i))/a.length;console.debug(`Paint rate: ${o}fps`),console.debug(`Paint rate (avg): ${t}`),o=void 0}}),1e3),s=>(r++,null==h&&(h=setInterval((()=>{!function(t,i){const s=t.takeMeasurements();s.length>0&&i(s)}(t,e),0===r&&null!=h&&(clearInterval(h),h=void 0)}),n)),t.measure((async()=>{const t=await i(s);return o=null==o?1:o+1,t})).finally((()=>{r--})))}var Et;!function(t){t.DEVICE_ID="vertexvis:device-id"}(Et||(Et={}));class Mt extends C{constructor(t,i={}){var s,e,n;super(t,{loggingEnabled:i.loggingEnabled}),this.state={type:"disconnected"},this.stateChanged=new j,this.dimensions=d.create(0,0),this.streamAttributes={},this.frameBgColor=R.create(255,255,255),this.config=$("platprod"),this.options={tokenRefreshOffsetInSeconds:null!==(s=i.tokenRefreshOffsetInSeconds)&&void 0!==s?s:30,offlineThresholdInSeconds:null!==(e=i.offlineThresholdInSeconds)&&void 0!==e?e:30,loadTimeoutInSeconds:null!==(n=i.loadTimeoutInSeconds)&&void 0!==n?n:15}}getState(){return this.state}disconnect(){"disconnected"!==this.state.type&&"connection-failed"!==this.state.type&&(console.debug("Disconnecting websocket"),this.state.connection.dispose(),this.updateState({type:"disconnected"}))}async load(t,i,s,e=$("platprod")){return this.clientId=i,this.deviceId=s,this.config=e,"disconnected"===this.state.type||"connection-failed"===this.state.type?this.loadIfDisconnected(t):this.loadIfConnectingOrConnected(t,this.state)}update(t){this.frameBgColor=t.frameBgColor?t.frameBgColor:this.frameBgColor,null!=t.dimensions&&t.dimensions!==this.dimensions&&(this.dimensions=t.dimensions,this.ifState("connected",(()=>this.updateDimensions({dimensions:this.dimensions})))),null!=t.streamAttributes&&this.streamAttributes!==t.streamAttributes&&(this.streamAttributes=t.streamAttributes,this.ifState("connected",(()=>this.updateStream({streamAttributes:Ot(this.streamAttributes)}))))}async loadIfConnectingOrConnected(t,i){const{resource:s,queries:e}=i.resource,n=H(t),h=!F.isEqual(s,n.resource),o=!F.isEqual(e,n.queries),r=null!=n.queries[0],a="connected"===i.type;if(h||("connecting"===i.type||"reconnecting"===i.type)&&o)return this.disconnect(),this.loadIfDisconnected(t);a&&r&&o&&(await this.loadSceneViewState({sceneViewStateId:{hex:n.queries[0].id}}),this.updateState(Object.assign(Object.assign({},i),{resource:n})))}async loadIfDisconnected(t){try{await this.connectWithNewStream(H(t))}catch(t){throw this.updateState(t instanceof U?{type:"connection-failed",message:`Cannot load scene. ${t.message}`,error:t}:t instanceof P?{type:"connection-failed",message:"Cannot load scene. Stream request failed to start stream.",error:t}:{type:"connection-failed",message:"Cannot load scene for unknown reason. See console logs.",error:t}),t}}connectWithNewStream(t){return this.openWebsocketStream(t,"connecting",(()=>this.requestNewStream(t)))}connectToExistingStream(t){return this.openWebsocketStream(t.resource,"reconnecting",(()=>this.requestReconnectStream(t)),{maxRetries:Number.POSITIVE_INFINITY})}async openWebsocketStream(t,i,s,{maxRetries:e=3}={}){const n=(h=function(t,i,s,e){return B.appendPath(null!=s?B.toString(B.parseAndAddParams("/ws",{clientId:s,deviceId:e})):`/stream-keys/${i.id}/session`,B.parse(t.network.renderingHost))}(this.config,t.resource,this.clientId,this.deviceId),{url:B.toString(h),protocols:["ws.vertexvis.com"]});var h;console.debug(`Initiating WS connection [uri=${n.url}]`);const o=new AbortController,r=(a=this.config,{EXPERIMENTAL_frameDelivery:Object.assign(Object.assign({},a.EXPERIMENTAL_frameDelivery),{rateLimitingEnabled:a.flags.throttleFrameDelivery}),EXPERIMENTAL_adaptiveRendering:Object.assign(Object.assign({},a.EXPERIMENTAL_adaptiveRendering),{enabled:a.flags.adaptiveRendering}),EXPERIMENTAL_qualityOfService:Object.assign({},a.EXPERIMENTAL_qualityOfService)});var a;this.updateState({type:i,resource:t,connection:{dispose:()=>{this.dispose(),o.abort()}}});const l=await z.abort(o.signal,z.retry((()=>this.connect(n,r)),{maxRetries:e,delaysInMs:Mt.WS_RECONNECT_DELAYS})).catch((t=>{throw new G("Websocket connection failed.",t instanceof Error?t:void 0)}));if(!l.aborted)return this.requestNewOrExistingStream(t,l.result,s);this.updateState({type:"disconnected"})}async requestNewOrExistingStream(t,i,s){const e=this.requestClock(),n=await s();console.debug(`Stream connected [stream-id=${n.streamId}, scene-view-id=${n.sceneViewId}]`);const h=this.onRequest((t=>{const i=t.request.drawFrame;if(null!=i){const t=T(n.worldOrientation)(i);"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{frame:t}))}})),o=this.reconnectWhenNeeded(),r=this.refreshTokenWhenExpired(n.token),a=this.acknowledgeFrameRequests(),l=null==n.frame?await this.waitForFrame(n.worldOrientation,this.options.loadTimeoutInSeconds):n.frame,c=await e;console.debug(`Synchronized clocks [local-time=${c.knownLocalTime.toISOString()}, remote-time=${c.knownRemoteTime.toISOString()}]`),this.updateState({type:"connected",connection:{dispose:()=>{o.dispose(),h.dispose(),r.dispose(),a.dispose(),i.dispose()}},resource:t,streamId:n.streamId,deviceId:n.deviceId,sceneViewId:n.sceneViewId,worldOrientation:n.worldOrientation,token:n.token,frame:l,clock:c})}async requestNewStream(t){var i;const s=I(await this.startStream({streamKey:{value:t.resource.id},dimensions:this.dimensions,frameBackgroundColor:jt(this.frameBgColor),streamAttributes:Ot(this.streamAttributes),sceneViewStateId:"scene-view-state"===(null===(i=t.queries[0])||void 0===i?void 0:i.type)?{hex:t.queries[0].id}:void 0}));return{resource:t,streamId:s.streamId,sceneViewId:s.sceneViewId,deviceId:s.sessionId,token:s.token,worldOrientation:s.worldOrientation,frame:void 0}}async requestReconnectStream(t){const i=D(await this.reconnect({streamId:{hex:t.streamId},dimensions:this.dimensions,frameBackgroundColor:jt(this.frameBgColor),streamAttributes:Ot(this.streamAttributes)}));return Object.assign(Object.assign({},t),{token:i.token})}async requestClock(){const t=k(await this.syncTime({requestTime:x()}));return new J(t)}reconnectWhenNeeded(){const t=this.onClose((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)})),i=this.onRequest((t=>{null!=t.request.gracefulReconnection&&"connected"===this.state.type&&(console.debug("Received request for graceful reconnect. Closing connection and attempting reconnect."),this.closeAndReconnect(this.state))})),s=this.reconnectWhenOffline();return{dispose:()=>{t.dispose(),i.dispose(),s.dispose()}}}refreshTokenWhenExpired(t){let i;const s=t=>{const{tokenRefreshOffsetInSeconds:e}=this.options,n=t.remainingTimeInMs(e);i=window.setTimeout((async()=>{const t=await this.refreshToken(),i=S(t);s(i),"connected"===this.state.type&&this.updateState(Object.assign(Object.assign({},this.state),{token:i}))}),n)};return s(t),{dispose:()=>clearTimeout(i)}}reconnectWhenOffline(){let t;const i=()=>window.clearTimeout(t),s=()=>{i();const s=this.options.offlineThresholdInSeconds;console.debug(`Detected that host is offline. Will attempt reconnect in ${s}s.`),t=window.setTimeout((()=>{"connected"===this.state.type&&this.closeAndReconnect(this.state)}),1e3*s)};return window.addEventListener("offline",(()=>s())),window.addEventListener("online",(()=>{console.debug("Detected that host is online."),i()})),{dispose:()=>{i(),window.removeEventListener("offline",s),window.removeEventListener("online",i)}}}closeAndReconnect(t){return t.connection.dispose(),this.connectToExistingStream(t)}async waitForFrame(t,i){let s;try{return await z.timeout(1e3*i,new Promise((i=>{s=this.onRequest((e=>{try{const n=e.request.drawFrame;if(null!=n){const s=T(t)(n);i(s)}}finally{null==s||s.dispose()}}))})))}catch(t){throw new _(`Frame timed out after ${i/1e3}s`,t instanceof Error?t:void 0)}finally{null==s||s.dispose()}}acknowledgeFrameRequests(){return this.onRequest(function(t,i){const s=function(t){let i=!1;return s=>{const e=t();if(null!=e){const t=e.remoteTime(new Date(Date.now())),n=p(s,t);return g(n).getTime()>=0?n:void(i||(console.warn(`Possible erroneous send to receive timing. Muting for 60s. [sent-at=${s.toISOString()}, received-at=${t.toISOString()}, remote-time=${e.knownRemoteTime.toISOString()}]`),i=!0,setTimeout((()=>i=!1),6e4)))}}}(i);return e=i=>{return e=()=>e=>{const n=g(e.sentAtTime);null!=n&&t.replyResult(i,{drawFrame:{sendToReceiveDuration:s(n)}})},t=>{const{drawFrame:i}=t.request;null!=i&&e()(t)};var e},t=>{var i;const s=null===(i=t.request.requestId)||void 0===i?void 0:i.value;null!=s&&e(s)(t)};var e}(this,(()=>"connected"===this.state.type?this.state.clock:void 0)))}updateState(t){this.state!==t&&(this.state=t,this.stateChanged.emit(this.state))}ifState(t,i){if(this.state.type===t)return i()}onStateChanged(t){return this.stateChanged.on(t)}}Mt.WS_RECONNECT_DELAYS=[0,1e3,1e3,5e3];const Ot=A.ifInvalidThrow(y),jt=A.ifInvalidThrow(b);let At=class{constructor(s){t(this,s),this.tap=i(this,"tap",7),this.doubletap=i(this,"doubletap",7),this.longpress=i(this,"longpress",7),this.frameReceived=i(this,"frameReceived",7),this.frameDrawn=i(this,"frameDrawn",7),this.tokenExpired=i(this,"tokenExpired",7),this.connectionChange=i(this,"connectionChange",7),this.sceneReady=i(this,"sceneReady",7),this.sceneChanged=i(this,"sceneChanged",7),this.interactionStarted=i(this,"interactionStarted",7),this.interactionFinished=i(this,"interactionFinished",7),this.cameraTypeChanged=i(this,"cameraTypeChanged",7),this.deviceIdChange=i(this,"deviceIdChange",7),this.dimensionschange=i(this,"dimensionschange",7),this.configEnv="platprod",this.cameraControls=!0,this.cameraType="perspective",this.keyboardControls=!0,this.rotateAroundTapPoint=!0,this.experimentalGhostingOpacity=0,this.noDefaultLights=!1,this.selectionMaterial=X,this.resizeDebounce=100,this.stencilBuffer=new ht(this.hostElement),this.viewport=nt.fromDimensions(d.create(0,0)),this.stateMap={cursorManager:new K,streamState:{type:"disconnected"}},this.interactionHandlers=[],this.tapKeyInteractions=[],this.internalFrameDrawnDispatcher=new j,this.handleElementResize=this.handleElementResize.bind(this)}componentWillLoad(){var t;this.updateResolvedConfig(),this.calculateComponentDimensions(),this.resizeObserver=new ResizeObserver(this.handleElementResize),this.registerSlotChangeListeners(),this.stream=null!==(t=this.stream)&&void 0!==t?t:new Mt(new E,{loggingEnabled:this.getResolvedConfig().flags.logWsMessages}),this.addStreamListeners(),this.updateStreamAttributes(),this.stateMap.cursorManager.onChanged.on((()=>this.handleCursorChanged()))}componentDidLoad(){var t,i,s;if(this.interactionApi=this.createInteractionApi(),null!=this.containerElement&&(null===(t=this.resizeObserver)||void 0===t||t.observe(this.containerElement)),null!=this.src)try{this.load(this.src)}catch(t){console.error("Error loading scene",t)}if(this.cameraControls)if(null!=window.PointerEvent){const t=new Dt("pointerdown","pointerup","pointermove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new It((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new Tt),this.registerInteractionHandler(t)}else{const t=new Dt("mousedown","mouseup","mousemove",(()=>this.getResolvedConfig()));this.baseInteractionHandler=new Ct((()=>this.getResolvedConfig())),this.registerInteractionHandler(this.baseInteractionHandler),this.registerInteractionHandler(new kt),this.registerInteractionHandler(t)}this.keyboardControls&&null!=this.stream&&(null===(i=this.baseInteractionHandler)||void 0===i||i.setDefaultKeyboardControls(this.keyboardControls),this.registerTapKeyInteraction(new rt(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()))),this.registerTapKeyInteraction(new ut(this.stream,(()=>this.getResolvedConfig()),(()=>this.getImageScale()),(()=>this.createScene())))),this.rotateAroundTapPoint&&(null===(s=this.baseInteractionHandler)||void 0===s||s.setPrimaryInteractionType("rotate-point")),this.injectViewerApi()}render(){var t;return s(e,null,s("div",{class:"viewer-container",style:{cursor:V(null!==(t=this.cursor)&&void 0!==t?t:"")},onContextMenu:t=>t.preventDefault()},s("div",{ref:t=>this.containerElement=t,class:N("canvas-container",{"enable-pointer-events ":null!=window.PointerEvent})},s("canvas",{ref:t=>{this.canvasElement=t,this.stateMap.interactionTarget=t},class:"canvas"}),null!=this.errorMessage?s("div",{class:"error-message"},this.errorMessage):null),s("slot",null)))}async dispatchFrameDrawn(t){this.frame=t,this.internalFrameDrawnDispatcher.emit(t),this.frameDrawn.emit(t)}async registerInteractionHandler(t){return this.interactionHandlers.push(t),this.initializeInteractionHandler(t),{dispose:()=>{const i=this.interactionHandlers.indexOf(t);-1!==i&&(this.interactionHandlers[i].dispose(),this.interactionHandlers.splice(i,1))}}}async registerTapKeyInteraction(t){this.tapKeyInteractions=[...this.tapKeyInteractions,t]}async getInteractionTarget(){if(null!=this.stateMap.interactionTarget)return this.stateMap.interactionTarget;throw new Error("Interaction target is undefined.")}async addCursor(t,i){return this.stateMap.cursorManager.add(t,i)}async getInteractionHandlers(){return this.interactionHandlers}async getBaseInteractionHandler(){return this.baseInteractionHandler}async getJwt(){return this.token}handleSrcChanged(t){null!=t?this.load(t):this.unload()}handleRotateAboutTapPointChanged(){var t,i;this.updateStreamAttributes(),this.rotateAroundTapPoint?null===(t=this.baseInteractionHandler)||void 0===t||t.setPrimaryInteractionType("rotate-point"):null===(i=this.baseInteractionHandler)||void 0===i||i.setPrimaryInteractionType("rotate")}handleCameraTypeChanged(t,i){t!==i&&this.updateCameraType()}handleDepthBuffersChanged(){this.updateStreamAttributes()}handleExperimentalGhostingOpacityChanged(){this.updateStreamAttributes()}handleNoDefaultLightsChanged(){this.updateStreamAttributes()}handleFeatureLinesChanged(){this.updateStreamAttributes()}handleFeatureHighlightingChanged(){this.updateStreamAttributes()}handleFeatureMapsChanged(){this.updateStreamAttributes()}handleConfigChanged(){this.updateResolvedConfig()}handleConfigEnvChanged(){this.updateResolvedConfig()}async load(t){var i;if(null==this.stream||null==this.dimensions)throw new Y("Cannot load scene. Viewer has not been initialized.");this.calculateComponentDimensions(),this.stream.update({streamAttributes:this.getStreamAttributes(),config:$(this.configEnv,this.config),dimensions:this.dimensions,frameBgColor:this.getBackgroundColor()}),await(null===(i=this.stream)||void 0===i?void 0:i.load(t,this.clientId,this.getDeviceId(),this.getResolvedConfig())),this.sceneReady.emit()}async unload(){if(null!=this.stream&&(this.stream.disconnect(),this.frame=void 0,this.errorMessage=void 0),null!=this.canvasElement){const t=this.canvasElement.getContext("2d");null!=t&&t.clearRect(0,0,this.canvasElement.width,this.canvasElement.height)}}async scene(){return this.createScene()}async isSceneReady(){return"connected"===this.stateMap.streamState.type}async handleTapEvent(t){this.tapKeyInteractions.filter((i=>i.predicate(t.detail))).forEach((i=>i.fn(t.detail)))}emitConnectionChange(t){this.connectionChange.emit(t)}handleElementResize(t){t.length>=0&&null!=this.dimensions&&!d.isEqual(t[0].contentRect,this.viewport)&&(null!=this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=void 0),this.isResizing||(this.resizeTimer=setTimeout((()=>{this.isResizing=!0,this.isResizeUpdate=!0,this.recalculateComponentDimensions()}),this.resizeDebounce)))}registerSlotChangeListeners(){this.mutationObserver=new MutationObserver((()=>this.injectViewerApi())),this.mutationObserver.observe(this.hostElement,{childList:!0,subtree:!0})}injectViewerApi(){function t(t){return Array.from(t.querySelectorAll("*"))}t(this.hostElement).filter((t=>t.nodeName.startsWith("VERTEX-"))).reduce(((i,s)=>[...i,s,...t(s)]),[]).forEach((t=>{t.viewer=this.hostElement}))}calculateComponentDimensions(){var t;const i=this.getBounds();if(null!=(null==i?void 0:i.width)&&null!=(null==i?void 0:i.height)){const s=d.create(i.width,i.height),e=d.scaleFit(2073600,s);this.hostDimensions=s,this.dimensions=null!=e?d.create(e.width,e.height):void 0,this.viewport=nt.fromDimensions(null!==(t=this.getCanvasDimensions())&&void 0!==t?t:d.create(0,0))}}recalculateComponentDimensions(){var t;this.isResizing&&(this.calculateComponentDimensions(),this.isResizing=!1,null===(t=this.stream)||void 0===t||t.update({dimensions:this.dimensions}),this.dimensionschange.emit(this.dimensions))}reportPerformance(t){if("connected"===this.stateMap.streamState.type){const i={timings:t.map((t=>({receiveToPaintDuration:p(t.duration)})))};this.getStream().recordPerformance(i,!1)}}addStreamListeners(){this.stateMap.streamListeners=this.getStream().stateChanged.on((t=>{this.handleStreamStateChanged(this.stateMap.streamState,t)}))}handleStreamStateChanged(t,i){this.stateMap.streamState=i,"connecting"===i.type?this.handleConnecting(t,i):"connected"===i.type?this.handleConnected(t,i):"connection-failed"===i.type?this.handleConnectionFailed(t,i):"disconnected"===i.type&&this.handleDisconnected(t,i)}handleConnecting(t,i){"connecting"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"connecting"}))}handleConnected(t,i){this.token=i.token.token,"connected"!==t.type&&(this.errorMessage=void 0,this.canvasRenderer=St(xt,function(){let t;return async i=>{var s,e,n;const h=i.frame.sequenceNumber,o=null==t||h>t,r=await(l=i.frame.image.imageBytes,null!=window.createImageBitmap?async function(t){const i=new Blob([t]),s=await window.createImageBitmap(i);return{image:s,dispose:()=>s.close()}}(l):(c=l,new Promise(((t,i)=>{const s=new Blob([c]),e=URL.createObjectURL(s),n=new Image;n.addEventListener("load",(()=>{t({image:n,dispose:()=>{}}),URL.revokeObjectURL(e)})),n.addEventListener("error",(()=>{i(new q("Failed to load image data")),URL.revokeObjectURL(e)})),n.src=e})))),a=null===(e=null===(s=i.predicate)||void 0===s?void 0:s.call(i))||void 0===e||e;var l,c;return o&&a&&(t=h,null===(n=i.beforeDraw)||void 0===n||n.call(i),function(t,i){const s=i.viewport.calculateDrawRect(i.frame.image);i.canvas.clearRect(0,0,i.canvasDimensions.width,i.canvasDimensions.height),i.canvas.drawImage(t.image,s.x,s.y,s.width,s.height)}(r,i)),r.dispose(),i.frame}}(),this.getResolvedConfig().flags.logFrameRate,(t=>this.reportPerformance(t))),this.emitConnectionChange({status:"connected",jwt:i.token.token}),this.deviceIdChange.emit(i.deviceId)),this.frame!==i.frame&&this.updateFrame(i.frame)}handleConnectionFailed(t,i){"connection-failed"!==t.type&&(this.token=void 0,this.errorMessage=i.message)}handleDisconnected(t,i){"disconnected"!==t.type&&(this.token=void 0,this.errorMessage=void 0,this.emitConnectionChange({status:"disconnected"}))}async updateFrame(t){const i=this.getCanvasDimensions();if(null!=this.canvasElement&&null!=i&&this.frame!==t){const s=this.canvasElement.getContext("2d");if(null!=s){const e=this.frame;this.frame=t,this.updateInteractionApi(e);const n={canvas:s,canvasDimensions:i,dimensions:this.dimensions,frame:this.frame,viewport:this.viewport,beforeDraw:()=>{this.updateCanvasDimensions(i),this.isResizeUpdate=!1},predicate:()=>!this.isResizeUpdate||null==this.dimensions||d.isEqual(this.dimensions,n.frame.image.imageAttr.frameDimensions)};this.frameReceived.emit(this.frame),this.frame.scene.hasChanged&&this.sceneChanged.emit();const h=await this.canvasRenderer(n);this.dispatchFrameDrawn(h)}}}initializeInteractionHandler(t){if(null==this.stateMap.interactionTarget)throw new Q("Cannot initialize interaction handler. Interaction target is undefined.");if(null==this.interactionApi)throw new Q("Cannot initialize interaction handler. Interaction APi is undefined.");t.initialize(this.stateMap.interactionTarget,this.interactionApi)}createInteractionApi(){if(null==this.stream)throw new Z("Cannot create interaction API. Component has not been initialized.");return null==this.frame||this.frame.scene.camera.isPerspective()?new ct(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished):new lt(this.stream,this.stateMap.cursorManager,(()=>this.getResolvedConfig().interactions),(()=>this.createScene()),(()=>this.frame),(()=>this.viewport),this.tap,this.doubletap,this.longpress,this.interactionStarted,this.interactionFinished)}handleCursorChanged(){window.requestAnimationFrame((()=>{this.cursor=this.stateMap.cursorManager.getActiveCursor()}))}createScene(){if("connected"!==this.stateMap.streamState.type)throw new tt("Cannot create scene. Viewer stream is not connected.");const{frame:t,sceneViewId:i,worldOrientation:s}=this.stateMap.streamState,e="string"==typeof this.selectionMaterial?it(this.selectionMaterial):this.selectionMaterial;return new st(this.getStream(),t,T(s),(()=>this.getImageScale()),this.viewport,i,e)}getBackgroundColor(){if(null!=this.containerElement)return function(t){const i=window.getComputedStyle(t);return R.fromCss(i.backgroundColor)}(this.containerElement)}getBounds(){return this.hostElement.getBoundingClientRect()}getCanvasDimensions(){return this.getResolvedConfig().flags.letterboxFrames?this.dimensions:this.hostDimensions}getImageScale(){const t=this.getCanvasDimensions();if(null!=this.dimensions&&null!=t)return h.create(this.dimensions.width/t.width,this.dimensions.height/t.height)}getStreamAttributes(){return{depthBuffers:this.getDepthBufferStreamAttributesValue(),experimentalGhosting:this.experimentalGhostingOpacity,noDefaultLights:this.noDefaultLights,featureLines:this.featureLines,featureHighlighting:this.featureHighlighting,featureMaps:this.featureMaps}}updateCanvasDimensions(t){null!=this.canvasElement&&(this.canvasElement.width=t.width,this.canvasElement.height=t.height)}updateStreamAttributes(){var t;null===(t=this.stream)||void 0===t||t.update({streamAttributes:this.getStreamAttributes()})}updateInteractionApi(t){if(null!=this.frame){const i=(null==t||t.scene.camera.isPerspective())&&this.frame.scene.camera.isOrthographic(),s=(null==t||t.scene.camera.isOrthographic())&&this.frame.scene.camera.isPerspective();(i||s)&&(this.interactionApi=this.createInteractionApi(),this.cameraType=this.frame.scene.camera.isPerspective()?"perspective":"orthographic",this.cameraTypeChanged.emit(this.cameraType),this.interactionHandlers.forEach((t=>this.initializeInteractionHandler(t))))}}updateCameraType(){var t,i;null!=this.frame&&("orthographic"===this.cameraType&&this.frame.scene.camera.isPerspective()?null===(t=this.stream)||void 0===t||t.replaceCamera({camera:m(M(this.frame.scene.camera,this.frame.scene.boundingBox))}):"perspective"===this.cameraType&&this.frame.scene.camera.isOrthographic()&&(null===(i=this.stream)||void 0===i||i.replaceCamera({camera:m(O(this.frame.scene.camera))})))}getDepthBufferStreamAttributesValue(){var t;return null!==(t=this.depthBuffers)&&void 0!==t?t:this.rotateAroundTapPoint?"final":void 0}updateResolvedConfig(){this.resolvedConfig=$(this.configEnv,this.config)}getResolvedConfig(){return Rt("Resolved config is undefined",(()=>this.resolvedConfig))}getStream(){return Rt("Stream is undefined",(()=>this.stream))}getDeviceId(){if(null==this.deviceId){try{this.deviceId=function(t,i,s=window.localStorage){const e=s.getItem(Et.DEVICE_ID);if(null!=e)return i(JSON.parse(e))}(0,(t=>t["device-id"]))}catch(t){console.warn("Cannot read device ID. Local storage is not supported.")}if(null==this.deviceId){this.deviceId=L.create();try{!function(t,i,s=window.localStorage){const e=s.getItem(t);if(null!=e){const n=Object.assign(Object.assign({},JSON.parse(e)),i);s.setItem(t,JSON.stringify(n))}else s.setItem(t,JSON.stringify(i))}(Et.DEVICE_ID,{"device-id":this.deviceId})}catch(t){console.warn("Cannot write device ID. Local storage is not supported.")}}}return this.deviceId}get hostElement(){return n(this)}static get watchers(){return{src:["handleSrcChanged"],rotateAroundTapPoint:["handleRotateAboutTapPointChanged"],cameraType:["handleCameraTypeChanged"],depthBuffers:["handleDepthBuffersChanged"],experimentalGhostingOpacity:["handleExperimentalGhostingOpacityChanged"],noDefaultLights:["handleNoDefaultLightsChanged"],featureLines:["handleFeatureLinesChanged"],featureHighlighting:["handleFeatureHighlightingChanged"],featureMaps:["handleFeatureMapsChanged"],config:["handleConfigChanged"],configEnv:["handleConfigEnvChanged"]}}};function Rt(t,i){const s=i();if(null!=s)return s;throw new Error(t)}At.style=":host{--image-background:var(--image-background);--viewer-background:var(--viewer-background);display:block;position:relative;width:300px;height:300px;min-width:1px;min-height:1px}.canvas-container{display:flex;justify-content:center;align-items:center;width:100%;height:100%;position:relative;background:var(--image-background, var(--viewer-background, #ffffff))}.enable-pointer-events{touch-action:none}.viewer-container{width:100%;height:100%;overflow:hidden;background:var(--viewer-background, #ffffff)}.error-message{position:absolute;top:50%;width:100%;transform:translateY(-50%);text-align:center}";export{At as vertex_viewer}
|