@virtualdisplay.io/client 4.0.0-alpha.25 → 4.0.0-alpha.26
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/CHANGELOG.md +14 -0
- package/README.md +50 -16
- package/dist/index.d.ts +141 -13
- package/dist/virtualdisplay.client.cjs.js +103 -12
- package/dist/virtualdisplay.client.es.js +1500 -1203
- package/dist/virtualdisplay.client.umd.js +111 -20
- package/package.json +1 -1
|
@@ -15,76 +15,81 @@ const c = {
|
|
|
15
15
|
PRICING: "pricing",
|
|
16
16
|
QR_SHOWN: "qr_shown",
|
|
17
17
|
SYNC: "sync",
|
|
18
|
-
SELECTABLE: "selectable"
|
|
19
|
-
|
|
18
|
+
SELECTABLE: "selectable",
|
|
19
|
+
APP_RESOLVED: "app_resolved"
|
|
20
|
+
}, ee = {
|
|
20
21
|
FOCUS: "focus",
|
|
21
22
|
UNFOCUS: "unfocus"
|
|
22
|
-
},
|
|
23
|
+
}, Ie = {
|
|
23
24
|
FOCUSED: "focused"
|
|
24
|
-
},
|
|
25
|
+
}, Le = {
|
|
25
26
|
/** Behaves exactly like an unpriced combination: no price, no button. */
|
|
26
27
|
HIDDEN: "hidden"
|
|
27
|
-
},
|
|
28
|
-
function
|
|
28
|
+
}, Oe = new Set(Object.values(c));
|
|
29
|
+
function Ne(n) {
|
|
29
30
|
if (typeof n != "object" || n === null)
|
|
30
31
|
return !1;
|
|
31
|
-
const
|
|
32
|
-
return typeof
|
|
32
|
+
const e = n;
|
|
33
|
+
return typeof e.target == "string" ? !1 : typeof e.type == "string" && Oe.has(e.type);
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
return
|
|
35
|
+
function Me(n) {
|
|
36
|
+
const e = S(n);
|
|
37
|
+
return e !== null && e.type === c.HANDSHAKE;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
return
|
|
39
|
+
function ze(n) {
|
|
40
|
+
const e = S(n);
|
|
41
|
+
return e !== null && e.type === c.SESSION && typeof e.sessionId == "string";
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
return
|
|
43
|
+
function Pe(n) {
|
|
44
|
+
const e = S(n);
|
|
45
|
+
return e !== null && e.type === c.APP_RESOLVED && typeof e.appType == "string" && e.appType !== "" && typeof e.name == "string";
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
47
|
+
function Fe(n) {
|
|
48
|
+
const e = S(n);
|
|
49
|
+
return e !== null && e.type === c.MUTATION && Array.isArray(e.results);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
return
|
|
51
|
+
function $e(n) {
|
|
52
|
+
const e = S(n);
|
|
53
|
+
return e !== null && e.type === c.SNAPSHOT && ("data" in e || "error" in e);
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
return
|
|
55
|
+
function De(n) {
|
|
56
|
+
const e = S(n);
|
|
57
|
+
return e !== null && e.type === c.CAMERA && Array.isArray(e.transforms);
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
return
|
|
59
|
+
function Ue(n) {
|
|
60
|
+
const e = S(n);
|
|
61
|
+
return e !== null && e.type === c.MAPPING && Array.isArray(e.attributes);
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
return
|
|
63
|
+
function Be(n) {
|
|
64
|
+
const e = S(n);
|
|
65
|
+
return e !== null && e.type === c.LOADING_INDICATOR && typeof e.progress == "number";
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
return
|
|
67
|
+
function Ve(n) {
|
|
68
|
+
const e = S(n);
|
|
69
|
+
return e !== null && e.type === c.SYNC && typeof e.connected == "boolean";
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
return
|
|
71
|
+
function je(n) {
|
|
72
|
+
const e = S(n);
|
|
73
|
+
return e !== null && e.type === c.SELECTABLE && Array.isArray(e.attributes);
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
76
|
-
return
|
|
75
|
+
function He(n) {
|
|
76
|
+
const e = S(n);
|
|
77
|
+
return e !== null && e.type === c.CONFIG && typeof e.viewerSettings == "object";
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
return
|
|
79
|
+
function qe(n) {
|
|
80
|
+
const e = S(n);
|
|
81
|
+
return e !== null && e.type === c.FOCUS && typeof e.state == "string";
|
|
82
|
+
}
|
|
83
|
+
function Ge(n) {
|
|
84
|
+
const e = S(n);
|
|
85
|
+
return e !== null && e.type === c.PRICING && typeof e.pricing == "object" && e.pricing !== null;
|
|
81
86
|
}
|
|
82
87
|
function S(n) {
|
|
83
88
|
return typeof n != "object" || n === null ? null : n;
|
|
84
89
|
}
|
|
85
|
-
class
|
|
86
|
-
constructor(
|
|
87
|
-
this.processor =
|
|
90
|
+
class te {
|
|
91
|
+
constructor(e) {
|
|
92
|
+
this.processor = e;
|
|
88
93
|
}
|
|
89
94
|
processor;
|
|
90
95
|
pending = [];
|
|
@@ -92,12 +97,12 @@ class et {
|
|
|
92
97
|
/**
|
|
93
98
|
* Add a message — processed immediately if ready, queued otherwise
|
|
94
99
|
*/
|
|
95
|
-
enqueue(
|
|
100
|
+
enqueue(e) {
|
|
96
101
|
if (this.isReady) {
|
|
97
|
-
this.processor(
|
|
102
|
+
this.processor(e);
|
|
98
103
|
return;
|
|
99
104
|
}
|
|
100
|
-
this.pending.push(
|
|
105
|
+
this.pending.push(e);
|
|
101
106
|
}
|
|
102
107
|
/**
|
|
103
108
|
* Mark as ready and flush all pending messages
|
|
@@ -105,10 +110,10 @@ class et {
|
|
|
105
110
|
markReady() {
|
|
106
111
|
if (this.isReady || (this.isReady = !0, this.pending.length === 0))
|
|
107
112
|
return;
|
|
108
|
-
const
|
|
113
|
+
const e = [...this.pending];
|
|
109
114
|
this.pending.length = 0;
|
|
110
|
-
for (const
|
|
111
|
-
this.processor(
|
|
115
|
+
for (const t of e)
|
|
116
|
+
this.processor(t);
|
|
112
117
|
}
|
|
113
118
|
get ready() {
|
|
114
119
|
return this.isReady;
|
|
@@ -119,8 +124,8 @@ class et {
|
|
|
119
124
|
/**
|
|
120
125
|
* Check if a message of a specific type is pending
|
|
121
126
|
*/
|
|
122
|
-
hasPending(
|
|
123
|
-
return this.pending.some((
|
|
127
|
+
hasPending(e) {
|
|
128
|
+
return this.pending.some((t) => t.type === e);
|
|
124
129
|
}
|
|
125
130
|
/**
|
|
126
131
|
* Clear all pending messages
|
|
@@ -129,9 +134,9 @@ class et {
|
|
|
129
134
|
this.pending.length = 0;
|
|
130
135
|
}
|
|
131
136
|
}
|
|
132
|
-
class
|
|
133
|
-
constructor(
|
|
134
|
-
this.getTarget =
|
|
137
|
+
class Ze {
|
|
138
|
+
constructor(e, t) {
|
|
139
|
+
this.getTarget = e, this.sourceId = `vd-${Math.random().toString(36).slice(2, 8)}`, this.targetOrigin = "*", this.isValid = t?.isValid ?? Ne, this.publisher = new te((i) => this.post(i)), this.consumer = new te((i) => this.routeToHandler(i)), t?.bufferIncoming !== !0 && this.consumer.markReady();
|
|
135
140
|
}
|
|
136
141
|
getTarget;
|
|
137
142
|
handlers = /* @__PURE__ */ new Map();
|
|
@@ -144,22 +149,22 @@ class Ht {
|
|
|
144
149
|
/**
|
|
145
150
|
* Register a handler for a specific message type
|
|
146
151
|
*/
|
|
147
|
-
on(
|
|
148
|
-
this.handlers.set(
|
|
152
|
+
on(e, t) {
|
|
153
|
+
this.handlers.set(e, t);
|
|
149
154
|
}
|
|
150
155
|
/**
|
|
151
156
|
* Update the target origin for outgoing postMessage calls.
|
|
152
157
|
* Use when the target origin is discovered at runtime (e.g. from the first incoming message).
|
|
153
158
|
*/
|
|
154
|
-
setTargetOrigin(
|
|
155
|
-
this.targetOrigin =
|
|
159
|
+
setTargetOrigin(e) {
|
|
160
|
+
this.targetOrigin = e;
|
|
156
161
|
}
|
|
157
162
|
/**
|
|
158
163
|
* Send a message to the target window
|
|
159
164
|
* Queued until markReady() is called
|
|
160
165
|
*/
|
|
161
|
-
send(
|
|
162
|
-
this.publisher.enqueue(
|
|
166
|
+
send(e) {
|
|
167
|
+
this.publisher.enqueue(e);
|
|
163
168
|
}
|
|
164
169
|
/**
|
|
165
170
|
* Feed a message through the same routing path as one that just arrived via
|
|
@@ -170,8 +175,8 @@ class Ht {
|
|
|
170
175
|
* viewer engine's SSE-sourced live sync channel, ar-session-handoff) and
|
|
171
176
|
* needs them to land exactly where a postMessage would.
|
|
172
177
|
*/
|
|
173
|
-
receive(
|
|
174
|
-
this.isValid(
|
|
178
|
+
receive(e) {
|
|
179
|
+
this.isValid(e) && this.consumer.enqueue(e);
|
|
175
180
|
}
|
|
176
181
|
/**
|
|
177
182
|
* Enable sending and flush queued outgoing messages
|
|
@@ -189,22 +194,22 @@ class Ht {
|
|
|
189
194
|
/**
|
|
190
195
|
* Check if an incoming message of a specific type is pending in the consumer buffer
|
|
191
196
|
*/
|
|
192
|
-
consumerHasPending(
|
|
193
|
-
return this.consumer.hasPending(
|
|
197
|
+
consumerHasPending(e) {
|
|
198
|
+
return this.consumer.hasPending(e);
|
|
194
199
|
}
|
|
195
200
|
/**
|
|
196
201
|
* Start listening for incoming messages
|
|
197
202
|
*/
|
|
198
203
|
start() {
|
|
199
|
-
this.listener === null && (this.listener = (
|
|
200
|
-
const { data:
|
|
201
|
-
if (!this.isValid(
|
|
204
|
+
this.listener === null && (this.listener = (e) => {
|
|
205
|
+
const { data: t } = e;
|
|
206
|
+
if (!this.isValid(t) || t._source === this.sourceId)
|
|
202
207
|
return;
|
|
203
208
|
const i = this.getTarget();
|
|
204
|
-
if (i !== null &&
|
|
209
|
+
if (i !== null && e.source !== null && e.source !== i)
|
|
205
210
|
return;
|
|
206
|
-
const
|
|
207
|
-
this.consumer.enqueue(
|
|
211
|
+
const s = t;
|
|
212
|
+
this.consumer.enqueue(s);
|
|
208
213
|
}, window.addEventListener("message", this.listener));
|
|
209
214
|
}
|
|
210
215
|
/**
|
|
@@ -225,36 +230,36 @@ class Ht {
|
|
|
225
230
|
get pendingCount() {
|
|
226
231
|
return this.publisher.pendingCount;
|
|
227
232
|
}
|
|
228
|
-
post(
|
|
229
|
-
const
|
|
230
|
-
|
|
233
|
+
post(e) {
|
|
234
|
+
const t = this.getTarget();
|
|
235
|
+
t !== null && t.postMessage({ ...e, _source: this.sourceId }, this.targetOrigin);
|
|
231
236
|
}
|
|
232
|
-
routeToHandler(
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
237
|
+
routeToHandler(e) {
|
|
238
|
+
const t = this.handlers.get(e.type);
|
|
239
|
+
if (t === void 0)
|
|
235
240
|
return;
|
|
236
|
-
const i = e
|
|
237
|
-
i instanceof Promise && i.catch((
|
|
238
|
-
const
|
|
239
|
-
console.error(`Virtualdisplay: error handling ${
|
|
241
|
+
const i = t(e);
|
|
242
|
+
i instanceof Promise && i.catch((s) => {
|
|
243
|
+
const o = s instanceof Error ? s.message : String(s);
|
|
244
|
+
console.error(`Virtualdisplay: error handling ${e.type}: ${o}`);
|
|
240
245
|
});
|
|
241
246
|
}
|
|
242
247
|
}
|
|
243
|
-
class
|
|
244
|
-
constructor(
|
|
245
|
-
this.send =
|
|
248
|
+
class We {
|
|
249
|
+
constructor(e) {
|
|
250
|
+
this.send = e;
|
|
246
251
|
}
|
|
247
252
|
send;
|
|
248
|
-
setEnabled(
|
|
253
|
+
setEnabled(e) {
|
|
249
254
|
this.send({
|
|
250
255
|
type: c.ANNOTATION_TOGGLE,
|
|
251
|
-
enabled:
|
|
256
|
+
enabled: e
|
|
252
257
|
});
|
|
253
258
|
}
|
|
254
259
|
}
|
|
255
|
-
class
|
|
256
|
-
constructor(
|
|
257
|
-
this.value =
|
|
260
|
+
class Ye {
|
|
261
|
+
constructor(e, t) {
|
|
262
|
+
this.value = e, this.attribute = t;
|
|
258
263
|
}
|
|
259
264
|
value;
|
|
260
265
|
attribute;
|
|
@@ -262,8 +267,8 @@ class Gt {
|
|
|
262
267
|
get isSelected() {
|
|
263
268
|
return this.isSelectedValue;
|
|
264
269
|
}
|
|
265
|
-
setSelected(
|
|
266
|
-
this.isSelectedValue =
|
|
270
|
+
setSelected(e) {
|
|
271
|
+
this.isSelectedValue = e;
|
|
267
272
|
}
|
|
268
273
|
}
|
|
269
274
|
const A = {
|
|
@@ -274,286 +279,286 @@ const A = {
|
|
|
274
279
|
INVALID_PARAMETER: "INVALID_PARAMETER",
|
|
275
280
|
SNAPSHOT_FAILED: "SNAPSHOT_FAILED"
|
|
276
281
|
};
|
|
277
|
-
class
|
|
282
|
+
class g extends Error {
|
|
278
283
|
code;
|
|
279
|
-
constructor(
|
|
280
|
-
super(
|
|
284
|
+
constructor(e, t) {
|
|
285
|
+
super(e), this.name = "VirtualdisplayError", this.code = t;
|
|
281
286
|
}
|
|
282
|
-
static valueNotFound(
|
|
283
|
-
return new
|
|
284
|
-
`Value "${
|
|
287
|
+
static valueNotFound(e, t) {
|
|
288
|
+
return new g(
|
|
289
|
+
`Value "${t}" not found for attribute "${e}"`,
|
|
285
290
|
A.VALUE_NOT_FOUND
|
|
286
291
|
);
|
|
287
292
|
}
|
|
288
|
-
static parentNotFound(
|
|
289
|
-
return new
|
|
290
|
-
`Parent element not found: ${
|
|
293
|
+
static parentNotFound(e) {
|
|
294
|
+
return new g(
|
|
295
|
+
`Parent element not found: ${e}`,
|
|
291
296
|
A.PARENT_NOT_FOUND
|
|
292
297
|
);
|
|
293
298
|
}
|
|
294
|
-
static invalidParameter(
|
|
295
|
-
return new
|
|
299
|
+
static invalidParameter(e) {
|
|
300
|
+
return new g(e, A.INVALID_PARAMETER);
|
|
296
301
|
}
|
|
297
302
|
}
|
|
298
|
-
class
|
|
303
|
+
class Qe {
|
|
299
304
|
name;
|
|
300
305
|
defaultValue;
|
|
301
306
|
values;
|
|
302
307
|
onSelect;
|
|
303
308
|
onChangeCallback;
|
|
304
|
-
constructor(
|
|
305
|
-
this.name =
|
|
309
|
+
constructor(e) {
|
|
310
|
+
this.name = e.name, this.defaultValue = e.defaultValue, this.onSelect = e.onSelect, this.values = this.createValues(e.values);
|
|
306
311
|
}
|
|
307
312
|
/**
|
|
308
313
|
* Select a value for this attribute
|
|
309
314
|
* @throws {VirtualdisplayError} When value not found
|
|
310
315
|
*/
|
|
311
|
-
select(
|
|
312
|
-
if (!this.values.has(
|
|
313
|
-
throw
|
|
314
|
-
this.onSelect(this.name,
|
|
316
|
+
select(e) {
|
|
317
|
+
if (!this.values.has(e))
|
|
318
|
+
throw g.valueNotFound(this.name, e);
|
|
319
|
+
this.onSelect(this.name, e);
|
|
315
320
|
}
|
|
316
321
|
getValues() {
|
|
317
322
|
return Array.from(this.values.values());
|
|
318
323
|
}
|
|
319
|
-
getValue(
|
|
320
|
-
return this.values.get(
|
|
324
|
+
getValue(e) {
|
|
325
|
+
return this.values.get(e);
|
|
321
326
|
}
|
|
322
327
|
/** The currently selected value, or undefined before any selection lands. */
|
|
323
328
|
get selected() {
|
|
324
|
-
for (const
|
|
325
|
-
if (
|
|
326
|
-
return
|
|
329
|
+
for (const e of this.values.values())
|
|
330
|
+
if (e.isSelected)
|
|
331
|
+
return e.value;
|
|
327
332
|
}
|
|
328
333
|
/**
|
|
329
334
|
* Register callback that fires when selection changes
|
|
330
335
|
* Receives the newly selected AttributeValue
|
|
331
336
|
*/
|
|
332
|
-
onChange(
|
|
333
|
-
this.onChangeCallback =
|
|
337
|
+
onChange(e) {
|
|
338
|
+
this.onChangeCallback = e;
|
|
334
339
|
}
|
|
335
340
|
/**
|
|
336
341
|
* Update selection state from server mutation result
|
|
337
342
|
* Direct value comparison - no source/target translation
|
|
338
343
|
*/
|
|
339
|
-
handleResult(
|
|
340
|
-
let
|
|
344
|
+
handleResult(e) {
|
|
345
|
+
let t;
|
|
341
346
|
for (const i of this.values.values()) {
|
|
342
|
-
const
|
|
343
|
-
i.setSelected(
|
|
347
|
+
const s = i.value === e;
|
|
348
|
+
i.setSelected(s), s && (t = i);
|
|
344
349
|
}
|
|
345
|
-
|
|
350
|
+
t !== void 0 && this.onChangeCallback !== void 0 && this.onChangeCallback(t);
|
|
346
351
|
}
|
|
347
|
-
createValues(
|
|
348
|
-
const
|
|
349
|
-
for (const i of
|
|
350
|
-
const
|
|
351
|
-
i === this.defaultValue &&
|
|
352
|
+
createValues(e) {
|
|
353
|
+
const t = /* @__PURE__ */ new Map();
|
|
354
|
+
for (const i of e) {
|
|
355
|
+
const s = new Ye(i, this.name);
|
|
356
|
+
i === this.defaultValue && s.setSelected(!0), t.set(i, s);
|
|
352
357
|
}
|
|
353
|
-
return
|
|
358
|
+
return t;
|
|
354
359
|
}
|
|
355
360
|
}
|
|
356
|
-
class
|
|
361
|
+
class Ke {
|
|
357
362
|
attributes = /* @__PURE__ */ new Map();
|
|
358
|
-
constructor(
|
|
359
|
-
for (const
|
|
360
|
-
const
|
|
361
|
-
this.attributes.set(
|
|
363
|
+
constructor(e, t, i) {
|
|
364
|
+
for (const s of e) {
|
|
365
|
+
const o = this.buildOptions(s, t);
|
|
366
|
+
this.attributes.set(s.name, new Qe(o));
|
|
362
367
|
}
|
|
363
368
|
this.onMutationFailed = i;
|
|
364
369
|
}
|
|
365
370
|
onMutationFailed;
|
|
366
|
-
get(
|
|
367
|
-
return this.attributes.get(
|
|
371
|
+
get(e) {
|
|
372
|
+
return this.attributes.get(e);
|
|
368
373
|
}
|
|
369
374
|
/** The current selection as attribute name→value pairs, skipping unset attributes. */
|
|
370
375
|
getSelection() {
|
|
371
|
-
const
|
|
372
|
-
for (const [
|
|
373
|
-
const
|
|
374
|
-
|
|
376
|
+
const e = {};
|
|
377
|
+
for (const [t, i] of this.attributes) {
|
|
378
|
+
const s = i.selected;
|
|
379
|
+
s !== void 0 && (e[t] = s);
|
|
375
380
|
}
|
|
376
|
-
return
|
|
381
|
+
return e;
|
|
377
382
|
}
|
|
378
|
-
handleResults(
|
|
379
|
-
for (const
|
|
380
|
-
if (!
|
|
381
|
-
this.onMutationFailed?.(
|
|
383
|
+
handleResults(e) {
|
|
384
|
+
for (const t of e) {
|
|
385
|
+
if (!t.success) {
|
|
386
|
+
this.onMutationFailed?.(t.name, t.value);
|
|
382
387
|
continue;
|
|
383
388
|
}
|
|
384
|
-
this.get(
|
|
389
|
+
this.get(t.name)?.handleResult(t.value);
|
|
385
390
|
}
|
|
386
391
|
}
|
|
387
|
-
buildOptions(
|
|
392
|
+
buildOptions(e, t) {
|
|
388
393
|
const i = {
|
|
389
|
-
name:
|
|
390
|
-
values:
|
|
391
|
-
onSelect: (
|
|
392
|
-
|
|
394
|
+
name: e.name,
|
|
395
|
+
values: e.values,
|
|
396
|
+
onSelect: (s, o) => {
|
|
397
|
+
t([{ name: s, value: o }], !1);
|
|
393
398
|
}
|
|
394
399
|
};
|
|
395
|
-
return
|
|
400
|
+
return e.defaultValue !== void 0 ? { ...i, defaultValue: e.defaultValue } : i;
|
|
396
401
|
}
|
|
397
402
|
}
|
|
398
|
-
const N = 4096, F = 16384,
|
|
399
|
-
function
|
|
400
|
-
const
|
|
401
|
-
return `${
|
|
403
|
+
const N = 4096, F = 16384, Xe = [1024, 256, 64], Je = 20, W = ["timestamp", "level", "msg", "service", "trace_id", "span_id"];
|
|
404
|
+
function et(n) {
|
|
405
|
+
const e = new Date(n.timestamp).toLocaleTimeString("en-GB", { hour12: !1 }), t = n.level.toUpperCase().padEnd(5), i = n.trace_id?.slice(0, 8) ?? "--------", s = n.msg, o = Object.entries(n).filter(([r]) => !W.includes(r)).map(([r, a]) => `${r}=${L(a, N).line}`).join(" ");
|
|
406
|
+
return `${e} ${t} [${i}] ${s}${o ? " " + o : ""}`;
|
|
402
407
|
}
|
|
403
|
-
function
|
|
404
|
-
for (const
|
|
405
|
-
const { line:
|
|
408
|
+
function tt(n) {
|
|
409
|
+
for (const s of [N, ...Xe]) {
|
|
410
|
+
const { line: o, truncated: r } = L(n, s);
|
|
406
411
|
if (!r) {
|
|
407
|
-
if (
|
|
408
|
-
return
|
|
412
|
+
if (o.length <= F)
|
|
413
|
+
return o;
|
|
409
414
|
continue;
|
|
410
415
|
}
|
|
411
|
-
const { line: a } =
|
|
416
|
+
const { line: a } = L({ ...n, log_truncated: !0 }, s);
|
|
412
417
|
if (a.length <= F)
|
|
413
418
|
return a;
|
|
414
419
|
}
|
|
415
|
-
const
|
|
416
|
-
return i.line.length <= F ? i.line :
|
|
420
|
+
const e = Object.keys(n).filter((s) => !W.includes(s)), t = { ...it(n, W), log_truncated: !0, log_dropped_count: e.length }, i = L({ ...t, log_dropped_attrs: e.slice(0, Je) }, N);
|
|
421
|
+
return i.line.length <= F ? i.line : L(t, N).line;
|
|
417
422
|
}
|
|
418
|
-
function
|
|
419
|
-
const
|
|
423
|
+
function L(n, e) {
|
|
424
|
+
const t = [];
|
|
420
425
|
let i = !1;
|
|
421
426
|
return { line: JSON.stringify(n, function(r, a) {
|
|
422
427
|
if (typeof a == "string")
|
|
423
|
-
return a.length >
|
|
428
|
+
return a.length > e && (i = !0), nt(a, e);
|
|
424
429
|
if (typeof a == "bigint")
|
|
425
430
|
return a.toString();
|
|
426
431
|
if (typeof a != "object" || a === null)
|
|
427
432
|
return a;
|
|
428
|
-
for (;
|
|
429
|
-
|
|
430
|
-
return
|
|
433
|
+
for (; t.length > 0 && t.at(-1) !== this; )
|
|
434
|
+
t.pop();
|
|
435
|
+
return t.includes(a) ? "[Circular]" : (t.push(a), a);
|
|
431
436
|
}), truncated: i };
|
|
432
437
|
}
|
|
433
|
-
function
|
|
434
|
-
return n.length <=
|
|
438
|
+
function nt(n, e) {
|
|
439
|
+
return n.length <= e ? n : `${n.slice(0, e)}...[truncated ${n.length - e} chars]`;
|
|
435
440
|
}
|
|
436
|
-
function
|
|
437
|
-
const
|
|
438
|
-
for (const i of
|
|
439
|
-
n[i] !== void 0 && (
|
|
440
|
-
return
|
|
441
|
+
function it(n, e) {
|
|
442
|
+
const t = {};
|
|
443
|
+
for (const i of e)
|
|
444
|
+
n[i] !== void 0 && (t[i] = n[i]);
|
|
445
|
+
return t;
|
|
441
446
|
}
|
|
442
|
-
function
|
|
443
|
-
const
|
|
444
|
-
n.level === "error" ? console.error(
|
|
447
|
+
function st(n, e) {
|
|
448
|
+
const t = e ? et(n) : tt(n);
|
|
449
|
+
n.level === "error" ? console.error(t) : n.level === "warn" ? console.warn(t) : console.log(t);
|
|
445
450
|
}
|
|
446
|
-
function
|
|
447
|
-
const
|
|
451
|
+
function pe(n, e = 0) {
|
|
452
|
+
const t = {
|
|
448
453
|
name: n.name,
|
|
449
454
|
message: n.message
|
|
450
455
|
};
|
|
451
|
-
n.stack !== void 0 && (
|
|
456
|
+
n.stack !== void 0 && (t.stack = n.stack);
|
|
452
457
|
for (const i of Object.getOwnPropertyNames(n)) {
|
|
453
458
|
if (i === "name" || i === "message" || i === "stack" || i === "cause")
|
|
454
459
|
continue;
|
|
455
|
-
const
|
|
456
|
-
|
|
460
|
+
const s = n[i];
|
|
461
|
+
s !== void 0 && (t[i] = s);
|
|
457
462
|
}
|
|
458
|
-
return n.cause !== void 0 && n.cause !== null && (
|
|
463
|
+
return n.cause !== void 0 && n.cause !== null && (t.cause = n.cause instanceof Error && e < 5 ? pe(n.cause, e + 1) : String(n.cause)), t;
|
|
459
464
|
}
|
|
460
|
-
function
|
|
461
|
-
const
|
|
462
|
-
for (const [
|
|
463
|
-
t
|
|
464
|
-
return
|
|
465
|
+
function ot(n) {
|
|
466
|
+
const e = {};
|
|
467
|
+
for (const [t, i] of Object.entries(n))
|
|
468
|
+
e[t] = i instanceof Error ? pe(i) : i;
|
|
469
|
+
return e;
|
|
465
470
|
}
|
|
466
|
-
function
|
|
471
|
+
function rt() {
|
|
467
472
|
return /* @__PURE__ */ new Date();
|
|
468
473
|
}
|
|
469
|
-
function
|
|
474
|
+
function at(n) {
|
|
470
475
|
return n.toISOString();
|
|
471
476
|
}
|
|
472
|
-
function
|
|
477
|
+
function fe() {
|
|
473
478
|
return typeof navigator > "u" ? "" : navigator.userAgent;
|
|
474
479
|
}
|
|
475
|
-
function
|
|
480
|
+
function lt() {
|
|
476
481
|
return typeof navigator > "u" ? !1 : navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
477
482
|
}
|
|
478
|
-
function
|
|
479
|
-
return /iPhone|iPad|iPod/i.test(
|
|
483
|
+
function ct() {
|
|
484
|
+
return /iPhone|iPad|iPod/i.test(fe()) || lt();
|
|
480
485
|
}
|
|
481
|
-
function
|
|
482
|
-
return /Android/i.test(
|
|
486
|
+
function dt() {
|
|
487
|
+
return /Android/i.test(fe());
|
|
483
488
|
}
|
|
484
|
-
function
|
|
485
|
-
return
|
|
489
|
+
function ut() {
|
|
490
|
+
return ct() || dt();
|
|
486
491
|
}
|
|
487
|
-
class
|
|
488
|
-
constructor(
|
|
489
|
-
this.config =
|
|
492
|
+
class ht {
|
|
493
|
+
constructor(e) {
|
|
494
|
+
this.config = e;
|
|
490
495
|
}
|
|
491
496
|
config;
|
|
492
497
|
/**
|
|
493
498
|
* Log at specified level with optional attributes.
|
|
494
499
|
*/
|
|
495
|
-
log(
|
|
496
|
-
const
|
|
497
|
-
timestamp:
|
|
498
|
-
level:
|
|
499
|
-
msg:
|
|
500
|
+
log(e, t, i = {}) {
|
|
501
|
+
const s = this.config.traceProvider?.() ?? {}, o = {
|
|
502
|
+
timestamp: at(rt()),
|
|
503
|
+
level: e,
|
|
504
|
+
msg: t,
|
|
500
505
|
service: this.config.service,
|
|
501
|
-
...
|
|
502
|
-
...
|
|
506
|
+
...s,
|
|
507
|
+
...ot(i)
|
|
503
508
|
};
|
|
504
|
-
|
|
509
|
+
st(o, this.config.isDev);
|
|
505
510
|
}
|
|
506
511
|
/**
|
|
507
512
|
* Log at DEBUG level (development only).
|
|
508
513
|
*/
|
|
509
|
-
debug(
|
|
510
|
-
this.config.isDev && this.log("debug",
|
|
514
|
+
debug(e, t) {
|
|
515
|
+
this.config.isDev && this.log("debug", e, t);
|
|
511
516
|
}
|
|
512
517
|
/**
|
|
513
518
|
* Log at INFO level.
|
|
514
519
|
*/
|
|
515
|
-
info(
|
|
516
|
-
this.log("info",
|
|
520
|
+
info(e, t) {
|
|
521
|
+
this.log("info", e, t);
|
|
517
522
|
}
|
|
518
523
|
/**
|
|
519
524
|
* Log at WARN level.
|
|
520
525
|
*/
|
|
521
|
-
warn(
|
|
522
|
-
this.log("warn",
|
|
526
|
+
warn(e, t) {
|
|
527
|
+
this.log("warn", e, t);
|
|
523
528
|
}
|
|
524
529
|
/**
|
|
525
530
|
* Log at ERROR level.
|
|
526
531
|
*/
|
|
527
|
-
error(
|
|
528
|
-
this.log("error",
|
|
532
|
+
error(e, t) {
|
|
533
|
+
this.log("error", e, t);
|
|
529
534
|
}
|
|
530
535
|
}
|
|
531
|
-
function
|
|
532
|
-
const
|
|
533
|
-
return new
|
|
536
|
+
function ge(n, e) {
|
|
537
|
+
const t = e?.isDev !== void 0 ? e.isDev : typeof process < "u" ? process.env.NODE_ENV !== "production" : !0;
|
|
538
|
+
return new ht({ service: n, isDev: t, traceProvider: e?.traceProvider });
|
|
534
539
|
}
|
|
535
540
|
function O(n) {
|
|
536
541
|
if (n !== void 0)
|
|
537
542
|
return typeof n == "object" && n !== null && !Array.isArray(n) && !(n instanceof Error) ? n : n instanceof Error ? { error: n.message } : { value: n };
|
|
538
543
|
}
|
|
539
|
-
function
|
|
544
|
+
function be(n) {
|
|
540
545
|
return {
|
|
541
|
-
debug: (
|
|
542
|
-
info: (
|
|
543
|
-
warn: (
|
|
544
|
-
error: (
|
|
546
|
+
debug: (e, t) => n.debug(e, O(t)),
|
|
547
|
+
info: (e, t) => n.info(e, O(t)),
|
|
548
|
+
warn: (e, t) => n.warn(e, O(t)),
|
|
549
|
+
error: (e, t) => n.error(e, O(t))
|
|
545
550
|
};
|
|
546
551
|
}
|
|
547
|
-
let
|
|
548
|
-
function
|
|
549
|
-
|
|
552
|
+
let ve = !1, C = be(ge("client", { isDev: !1 }));
|
|
553
|
+
function mt() {
|
|
554
|
+
ve = !0, C = be(ge("client", { isDev: !0 }));
|
|
550
555
|
}
|
|
551
|
-
function
|
|
552
|
-
return
|
|
556
|
+
function vs() {
|
|
557
|
+
return ve;
|
|
553
558
|
}
|
|
554
|
-
class
|
|
555
|
-
constructor(
|
|
556
|
-
this.send =
|
|
559
|
+
class pt {
|
|
560
|
+
constructor(e, t) {
|
|
561
|
+
this.send = e, this.onMutationFailed = t;
|
|
557
562
|
}
|
|
558
563
|
send;
|
|
559
564
|
onMutationFailed;
|
|
@@ -562,50 +567,61 @@ class ue {
|
|
|
562
567
|
/**
|
|
563
568
|
* Handle incoming MAPPING message from server
|
|
564
569
|
*/
|
|
565
|
-
handleMappingReceived(
|
|
566
|
-
|
|
567
|
-
attributeCount:
|
|
568
|
-
}), this.registry = new
|
|
569
|
-
|
|
570
|
-
(
|
|
570
|
+
handleMappingReceived(e) {
|
|
571
|
+
C.debug("Initializing from server mapping", {
|
|
572
|
+
attributeCount: e.attributes.length
|
|
573
|
+
}), this.registry = new Ke(
|
|
574
|
+
e.attributes,
|
|
575
|
+
(t, i) => this.sendMutation(t, i),
|
|
571
576
|
this.onMutationFailed
|
|
572
577
|
), this.replayPendingCallbacks();
|
|
573
578
|
}
|
|
574
|
-
handleMutationResult(
|
|
575
|
-
this.registry?.handleResults(
|
|
579
|
+
handleMutationResult(e) {
|
|
580
|
+
this.registry?.handleResults(e.results);
|
|
576
581
|
}
|
|
577
582
|
/**
|
|
578
583
|
* Select a value for an attribute - sends mutation to server.
|
|
579
584
|
* Can be called before the mapping arrives — the mutation is sent immediately
|
|
580
585
|
* and the messenger's publisher queue holds it until the iframe is ready.
|
|
581
586
|
*/
|
|
582
|
-
select(
|
|
583
|
-
this.sendMutation([{ name:
|
|
587
|
+
select(e, t) {
|
|
588
|
+
this.sendMutation([{ name: e, value: t }], !1);
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* A drag's intermediate step (parametric dimensions): the viewer applies it
|
|
592
|
+
* so the model follows the hand, but it is never recorded as a choice; the
|
|
593
|
+
* settling `select()` is the one tracked value. Used by the measurement
|
|
594
|
+
* slider per step crossed. Deliberately not delegated on the public client:
|
|
595
|
+
* `select()` staying the whole choice API is the spec's own evidence the
|
|
596
|
+
* shape is right, and no integrator has asked for live-follow yet.
|
|
597
|
+
*/
|
|
598
|
+
selectTransient(e, t) {
|
|
599
|
+
this.sendMutation([{ name: e, value: t }], !1, !0);
|
|
584
600
|
}
|
|
585
|
-
getValues(
|
|
586
|
-
return this.registry?.get(
|
|
601
|
+
getValues(e) {
|
|
602
|
+
return this.registry?.get(e)?.getValues() ?? [];
|
|
587
603
|
}
|
|
588
|
-
getValue(
|
|
589
|
-
return this.registry?.get(
|
|
604
|
+
getValue(e, t) {
|
|
605
|
+
return this.registry?.get(e)?.getValue(t);
|
|
590
606
|
}
|
|
591
607
|
/**
|
|
592
608
|
* Register onChange callback for an attribute.
|
|
593
609
|
* Buffers the callback if the mapping hasn't arrived yet.
|
|
594
610
|
*/
|
|
595
|
-
onChange(
|
|
611
|
+
onChange(e, t) {
|
|
596
612
|
if (this.registry === void 0) {
|
|
597
|
-
this.pendingCallbacks.push({ name:
|
|
613
|
+
this.pendingCallbacks.push({ name: e, callback: t });
|
|
598
614
|
return;
|
|
599
615
|
}
|
|
600
|
-
const i = this.registry.get(
|
|
616
|
+
const i = this.registry.get(e);
|
|
601
617
|
if (i === void 0) {
|
|
602
|
-
|
|
618
|
+
C.warn(`onChange: attribute "${e}" not found — callback will not fire`);
|
|
603
619
|
return;
|
|
604
620
|
}
|
|
605
|
-
i.onChange(
|
|
621
|
+
i.onChange(t);
|
|
606
622
|
}
|
|
607
|
-
getAttribute(
|
|
608
|
-
return this.registry?.get(
|
|
623
|
+
getAttribute(e) {
|
|
624
|
+
return this.registry?.get(e);
|
|
609
625
|
}
|
|
610
626
|
/** The current selection as attribute name→value pairs, empty before the mapping arrives. */
|
|
611
627
|
getSelection() {
|
|
@@ -614,45 +630,46 @@ class ue {
|
|
|
614
630
|
get hasMapping() {
|
|
615
631
|
return this.registry !== void 0;
|
|
616
632
|
}
|
|
617
|
-
sendMutation(t,
|
|
618
|
-
const
|
|
633
|
+
sendMutation(e, t, i = !1) {
|
|
634
|
+
const s = {
|
|
619
635
|
type: c.MUTATION,
|
|
620
|
-
mutations:
|
|
621
|
-
isInitial:
|
|
636
|
+
mutations: e,
|
|
637
|
+
isInitial: t,
|
|
638
|
+
...i && { transient: !0 }
|
|
622
639
|
};
|
|
623
|
-
this.send(
|
|
640
|
+
this.send(s);
|
|
624
641
|
}
|
|
625
642
|
replayPendingCallbacks() {
|
|
626
|
-
for (const { name:
|
|
627
|
-
const i = this.registry?.get(
|
|
628
|
-
i === void 0 &&
|
|
643
|
+
for (const { name: e, callback: t } of this.pendingCallbacks) {
|
|
644
|
+
const i = this.registry?.get(e);
|
|
645
|
+
i === void 0 && C.warn(`onChange: attribute "${e}" not found — buffered callback will not fire`), i?.onChange(t);
|
|
629
646
|
}
|
|
630
647
|
this.pendingCallbacks.length = 0;
|
|
631
648
|
}
|
|
632
649
|
}
|
|
633
|
-
class
|
|
650
|
+
class ft {
|
|
634
651
|
snapshot;
|
|
635
652
|
callbacks = [];
|
|
636
|
-
handleSnapshot(
|
|
637
|
-
this.snapshot =
|
|
638
|
-
for (const
|
|
639
|
-
e
|
|
653
|
+
handleSnapshot(e) {
|
|
654
|
+
this.snapshot = e.attributes;
|
|
655
|
+
for (const t of this.callbacks)
|
|
656
|
+
t(e.attributes);
|
|
640
657
|
}
|
|
641
|
-
onChange(
|
|
642
|
-
this.callbacks.push(
|
|
658
|
+
onChange(e) {
|
|
659
|
+
this.callbacks.push(e), this.snapshot !== void 0 && e(this.snapshot);
|
|
643
660
|
}
|
|
644
661
|
/** The selectable values for one attribute, or null when unrestricted. */
|
|
645
|
-
selectableFor(
|
|
646
|
-
return this.snapshot?.find((i) => i.name ===
|
|
662
|
+
selectableFor(e) {
|
|
663
|
+
return this.snapshot?.find((i) => i.name === e)?.selectable ?? null;
|
|
647
664
|
}
|
|
648
665
|
/** The latest snapshot; empty before the viewer has reported anything. */
|
|
649
666
|
get current() {
|
|
650
667
|
return this.snapshot ?? [];
|
|
651
668
|
}
|
|
652
669
|
}
|
|
653
|
-
let
|
|
654
|
-
constructor(
|
|
655
|
-
this.send =
|
|
670
|
+
let gt = class {
|
|
671
|
+
constructor(e) {
|
|
672
|
+
this.send = e;
|
|
656
673
|
}
|
|
657
674
|
send;
|
|
658
675
|
commands = [];
|
|
@@ -661,24 +678,24 @@ let me = class {
|
|
|
661
678
|
* @param degrees - Absolute rotation in degrees (0 = front view)
|
|
662
679
|
* @throws VirtualdisplayError if value is not a finite number
|
|
663
680
|
*/
|
|
664
|
-
rotate(
|
|
665
|
-
return this.validateFiniteNumber(
|
|
681
|
+
rotate(e) {
|
|
682
|
+
return this.validateFiniteNumber(e, "rotate"), this.commands.push({ action: "rotate", value: e }), this;
|
|
666
683
|
}
|
|
667
684
|
/**
|
|
668
685
|
* Tilt camera vertically
|
|
669
686
|
* @param degrees - Absolute tilt in degrees (0 = top view, 90 = horizontal)
|
|
670
687
|
* @throws VirtualdisplayError if value is not a finite number
|
|
671
688
|
*/
|
|
672
|
-
tilt(
|
|
673
|
-
return this.validateFiniteNumber(
|
|
689
|
+
tilt(e) {
|
|
690
|
+
return this.validateFiniteNumber(e, "tilt"), this.commands.push({ action: "tilt", value: e }), this;
|
|
674
691
|
}
|
|
675
692
|
/**
|
|
676
693
|
* Zoom camera
|
|
677
694
|
* @param percentage - Zoom percentage (100 = normal, >100 = zoom in, <100 = zoom out)
|
|
678
695
|
* @throws VirtualdisplayError if value is not a finite number
|
|
679
696
|
*/
|
|
680
|
-
zoom(
|
|
681
|
-
return this.validateFiniteNumber(
|
|
697
|
+
zoom(e) {
|
|
698
|
+
return this.validateFiniteNumber(e, "zoom"), this.commands.push({ action: "zoom", value: e }), this;
|
|
682
699
|
}
|
|
683
700
|
/**
|
|
684
701
|
* Execute accumulated camera commands
|
|
@@ -686,19 +703,19 @@ let me = class {
|
|
|
686
703
|
*/
|
|
687
704
|
set() {
|
|
688
705
|
if (this.commands.length === 0)
|
|
689
|
-
throw
|
|
706
|
+
throw g.invalidParameter(
|
|
690
707
|
"No camera commands to execute. Call rotate(), tilt(), or zoom() before set()."
|
|
691
708
|
);
|
|
692
|
-
const
|
|
709
|
+
const e = {
|
|
693
710
|
type: c.CAMERA,
|
|
694
711
|
commands: this.commands
|
|
695
712
|
};
|
|
696
|
-
this.send(
|
|
713
|
+
this.send(e), this.commands = [];
|
|
697
714
|
}
|
|
698
|
-
validateFiniteNumber(
|
|
699
|
-
if (!Number.isFinite(
|
|
700
|
-
throw
|
|
701
|
-
`${
|
|
715
|
+
validateFiniteNumber(e, t) {
|
|
716
|
+
if (!Number.isFinite(e))
|
|
717
|
+
throw g.invalidParameter(
|
|
718
|
+
`${t}() requires a finite number, got ${String(e)}`
|
|
702
719
|
);
|
|
703
720
|
}
|
|
704
721
|
/**
|
|
@@ -706,14 +723,14 @@ let me = class {
|
|
|
706
723
|
* This is not chainable and executes immediately
|
|
707
724
|
*/
|
|
708
725
|
reset() {
|
|
709
|
-
const
|
|
726
|
+
const e = {
|
|
710
727
|
type: c.CAMERA,
|
|
711
728
|
commands: [{ action: "reset" }]
|
|
712
729
|
};
|
|
713
|
-
this.send(
|
|
730
|
+
this.send(e);
|
|
714
731
|
}
|
|
715
732
|
};
|
|
716
|
-
class
|
|
733
|
+
class bt {
|
|
717
734
|
state;
|
|
718
735
|
limitsState;
|
|
719
736
|
changeCallbacks = [];
|
|
@@ -747,8 +764,8 @@ class pe {
|
|
|
747
764
|
* Also fires when limits are applied via applyLimits() so components
|
|
748
765
|
* can re-evaluate disabled states without a separate callback.
|
|
749
766
|
*/
|
|
750
|
-
onChange(
|
|
751
|
-
this.changeCallbacks.push(
|
|
767
|
+
onChange(e) {
|
|
768
|
+
this.changeCallbacks.push(e);
|
|
752
769
|
}
|
|
753
770
|
/**
|
|
754
771
|
* Current camera movement limits (set from CONFIG message).
|
|
@@ -761,62 +778,62 @@ class pe {
|
|
|
761
778
|
* Apply camera limits received from the server CONFIG message.
|
|
762
779
|
* Fires onChange callbacks so button disabled states update immediately.
|
|
763
780
|
*/
|
|
764
|
-
applyLimits(
|
|
765
|
-
this.limitsState =
|
|
766
|
-
const
|
|
781
|
+
applyLimits(e) {
|
|
782
|
+
this.limitsState = e;
|
|
783
|
+
const t = { rotation: this.rotation, tilt: this.tilt, zoom: this.zoom };
|
|
767
784
|
for (const i of this.changeCallbacks)
|
|
768
|
-
i(
|
|
785
|
+
i(t);
|
|
769
786
|
}
|
|
770
787
|
/**
|
|
771
788
|
* Handle incoming camera position message from server
|
|
772
789
|
*/
|
|
773
|
-
handlePositionUpdate(
|
|
774
|
-
this.update(
|
|
790
|
+
handlePositionUpdate(e) {
|
|
791
|
+
this.update(e.transforms);
|
|
775
792
|
}
|
|
776
793
|
/**
|
|
777
794
|
* Update camera position from server transforms
|
|
778
795
|
*/
|
|
779
|
-
update(
|
|
780
|
-
let
|
|
781
|
-
for (const i of
|
|
796
|
+
update(e) {
|
|
797
|
+
let t = !1;
|
|
798
|
+
for (const i of e)
|
|
782
799
|
switch (i.type) {
|
|
783
800
|
case "rotation":
|
|
784
|
-
this.state.rotation = i.value,
|
|
801
|
+
this.state.rotation = i.value, t = !0;
|
|
785
802
|
break;
|
|
786
803
|
case "tilt":
|
|
787
|
-
this.state.tilt = i.value,
|
|
804
|
+
this.state.tilt = i.value, t = !0;
|
|
788
805
|
break;
|
|
789
806
|
case "zoom":
|
|
790
|
-
this.state.zoom = i.value,
|
|
807
|
+
this.state.zoom = i.value, t = !0;
|
|
791
808
|
break;
|
|
792
809
|
}
|
|
793
|
-
if (
|
|
810
|
+
if (t) {
|
|
794
811
|
const i = {
|
|
795
812
|
rotation: this.rotation,
|
|
796
813
|
tilt: this.tilt,
|
|
797
814
|
zoom: this.zoom
|
|
798
815
|
};
|
|
799
|
-
for (const
|
|
800
|
-
|
|
816
|
+
for (const s of this.changeCallbacks)
|
|
817
|
+
s(i);
|
|
801
818
|
}
|
|
802
819
|
}
|
|
803
820
|
}
|
|
804
|
-
function
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
821
|
+
function vt(n, e) {
|
|
822
|
+
const t = n.filter((o) => yt(o, e));
|
|
823
|
+
if (t.length === 0)
|
|
807
824
|
return;
|
|
808
|
-
const i = Math.max(...
|
|
809
|
-
return
|
|
825
|
+
const i = Math.max(...t.map(ne)), s = t.filter((o) => ne(o) === i);
|
|
826
|
+
return s.length === 1 ? s[0] : void 0;
|
|
810
827
|
}
|
|
811
|
-
function
|
|
812
|
-
return Object.entries(n.attributes).every(([
|
|
828
|
+
function yt(n, e) {
|
|
829
|
+
return Object.entries(n.attributes).every(([t, i]) => e[t] === i);
|
|
813
830
|
}
|
|
814
|
-
function
|
|
831
|
+
function ne(n) {
|
|
815
832
|
return Object.keys(n.attributes).length;
|
|
816
833
|
}
|
|
817
|
-
class
|
|
818
|
-
constructor(
|
|
819
|
-
this.dispatchChange =
|
|
834
|
+
class St {
|
|
835
|
+
constructor(e, t) {
|
|
836
|
+
this.dispatchChange = e, this.dispatchSubmit = t;
|
|
820
837
|
}
|
|
821
838
|
dispatchChange;
|
|
822
839
|
dispatchSubmit;
|
|
@@ -841,9 +858,9 @@ class be {
|
|
|
841
858
|
* it says, so the CTA does not render.
|
|
842
859
|
*/
|
|
843
860
|
get buttonLabel() {
|
|
844
|
-
const
|
|
845
|
-
if (
|
|
846
|
-
return
|
|
861
|
+
const e = this.pricing?.buttonLabel;
|
|
862
|
+
if (e != null && e !== "")
|
|
863
|
+
return e;
|
|
847
864
|
if (this.submitDefaultLabel !== void 0 && this.submitDefaultLabel !== "")
|
|
848
865
|
return this.submitDefaultLabel;
|
|
849
866
|
}
|
|
@@ -868,16 +885,16 @@ class be {
|
|
|
868
885
|
* Subscribe to configuration changes. Fires after every selection change with
|
|
869
886
|
* the resolved configuration, including undefined when nothing matches.
|
|
870
887
|
*/
|
|
871
|
-
onChange(
|
|
872
|
-
this.changeCallbacks.push(
|
|
888
|
+
onChange(e) {
|
|
889
|
+
this.changeCallbacks.push(e);
|
|
873
890
|
}
|
|
874
891
|
/**
|
|
875
892
|
* Register the submit handler the CTA hands the configuration to. Registering
|
|
876
893
|
* one is what switches the button on (capability driven). `defaultLabel` fills
|
|
877
894
|
* in when the customer authored no button label.
|
|
878
895
|
*/
|
|
879
|
-
onSubmit(
|
|
880
|
-
this.submitCallback =
|
|
896
|
+
onSubmit(e, t) {
|
|
897
|
+
this.submitCallback = e, this.submitDefaultLabel = t?.defaultLabel, this.notifyRender();
|
|
881
898
|
}
|
|
882
899
|
/**
|
|
883
900
|
* Subscribe the built-in UI to re-render the price + CTA. Fires on every
|
|
@@ -885,10 +902,10 @@ class be {
|
|
|
885
902
|
* on without a configuration change). Separate from `onChange`, which stays the
|
|
886
903
|
* host-facing, mutation-driven contract. Returns a disposer.
|
|
887
904
|
*/
|
|
888
|
-
onRender(
|
|
889
|
-
return this.renderCallbacks.push(
|
|
890
|
-
const
|
|
891
|
-
|
|
905
|
+
onRender(e) {
|
|
906
|
+
return this.renderCallbacks.push(e), () => {
|
|
907
|
+
const t = this.renderCallbacks.indexOf(e);
|
|
908
|
+
t !== -1 && this.renderCallbacks.splice(t, 1);
|
|
892
909
|
};
|
|
893
910
|
}
|
|
894
911
|
/**
|
|
@@ -900,44 +917,44 @@ class be {
|
|
|
900
917
|
async submit() {
|
|
901
918
|
if (!this.submittable)
|
|
902
919
|
return;
|
|
903
|
-
const
|
|
904
|
-
this.dispatchSubmit(
|
|
920
|
+
const e = this.resolved !== void 0 ? { attributes: this.resolved.attributes, reference: this.resolved.reference } : { attributes: { ...this.selection }, reference: "" };
|
|
921
|
+
this.dispatchSubmit(e), await this.submitCallback?.(e);
|
|
905
922
|
}
|
|
906
923
|
/** Called by the client when a PRICING message arrives from the viewer. */
|
|
907
|
-
handlePricingReceived(
|
|
908
|
-
this.pricing =
|
|
924
|
+
handlePricingReceived(e) {
|
|
925
|
+
this.pricing = e, this.recompute();
|
|
909
926
|
}
|
|
910
927
|
/** Called by the client after every mutation result, with the full selection. */
|
|
911
|
-
handleSelectionChanged(
|
|
912
|
-
this.selection =
|
|
928
|
+
handleSelectionChanged(e) {
|
|
929
|
+
this.selection = e, this.recompute();
|
|
913
930
|
}
|
|
914
931
|
recompute() {
|
|
915
932
|
this.resolved = this.resolve();
|
|
916
|
-
for (const
|
|
917
|
-
|
|
933
|
+
for (const e of this.changeCallbacks)
|
|
934
|
+
e(this.resolved);
|
|
918
935
|
this.dispatchChange(this.resolved), this.notifyRender();
|
|
919
936
|
}
|
|
920
937
|
notifyRender() {
|
|
921
|
-
for (const
|
|
922
|
-
|
|
938
|
+
for (const e of this.renderCallbacks)
|
|
939
|
+
e();
|
|
923
940
|
}
|
|
924
941
|
resolve() {
|
|
925
942
|
if (this.pricing === void 0)
|
|
926
943
|
return;
|
|
927
|
-
const
|
|
928
|
-
if (!(
|
|
944
|
+
const e = vt(this.pricing.rules, this.selection);
|
|
945
|
+
if (!(e === void 0 || e.availability === Le.HIDDEN))
|
|
929
946
|
return {
|
|
930
947
|
attributes: { ...this.selection },
|
|
931
|
-
reference:
|
|
932
|
-
price:
|
|
948
|
+
reference: e.reference,
|
|
949
|
+
price: e.priceCents,
|
|
933
950
|
currency: this.pricing.currency,
|
|
934
|
-
availability:
|
|
951
|
+
availability: e.availability
|
|
935
952
|
};
|
|
936
953
|
}
|
|
937
954
|
}
|
|
938
|
-
class
|
|
939
|
-
constructor(
|
|
940
|
-
this.send =
|
|
955
|
+
class wt {
|
|
956
|
+
constructor(e, t) {
|
|
957
|
+
this.send = e, this.dispatch = t;
|
|
941
958
|
}
|
|
942
959
|
send;
|
|
943
960
|
dispatch;
|
|
@@ -952,36 +969,36 @@ class ve {
|
|
|
952
969
|
* Focus a component by name. Sends a focus message to the viewer.
|
|
953
970
|
* @throws VirtualdisplayError if component is not a non-empty string
|
|
954
971
|
*/
|
|
955
|
-
set(
|
|
956
|
-
if (typeof
|
|
957
|
-
throw
|
|
958
|
-
`set() requires a non-empty component name, got ${String(
|
|
972
|
+
set(e) {
|
|
973
|
+
if (typeof e != "string" || e.length === 0)
|
|
974
|
+
throw g.invalidParameter(
|
|
975
|
+
`set() requires a non-empty component name, got ${String(e)}`
|
|
959
976
|
);
|
|
960
|
-
this.send({ type: c.FOCUS, action:
|
|
977
|
+
this.send({ type: c.FOCUS, action: ee.FOCUS, component: e });
|
|
961
978
|
}
|
|
962
979
|
/** Return to the overview — unfocus the current component. */
|
|
963
980
|
clear() {
|
|
964
|
-
this.send({ type: c.FOCUS, action:
|
|
981
|
+
this.send({ type: c.FOCUS, action: ee.UNFOCUS });
|
|
965
982
|
}
|
|
966
983
|
/**
|
|
967
984
|
* Subscribe to focus changes. The callback fires with the focus state when a
|
|
968
985
|
* component is focused, and with null when returning to overview.
|
|
969
986
|
*/
|
|
970
|
-
onChange(
|
|
971
|
-
this.changeCallbacks.push(
|
|
987
|
+
onChange(e) {
|
|
988
|
+
this.changeCallbacks.push(e);
|
|
972
989
|
}
|
|
973
990
|
/** Called by the client when a FocusStateMessage is received from the viewer. */
|
|
974
|
-
handleStateReceived(
|
|
975
|
-
|
|
976
|
-
const
|
|
991
|
+
handleStateReceived(e) {
|
|
992
|
+
e.state === Ie.FOCUSED && e.component !== void 0 ? (this.focused = e.component, this.attributes = e.attributes ?? []) : (this.focused = null, this.attributes = []);
|
|
993
|
+
const t = this.focused !== null ? { component: this.focused, attributes: this.attributes } : null;
|
|
977
994
|
for (const i of this.changeCallbacks)
|
|
978
|
-
i(
|
|
979
|
-
this.dispatch(
|
|
995
|
+
i(t);
|
|
996
|
+
this.dispatch(t);
|
|
980
997
|
}
|
|
981
998
|
}
|
|
982
|
-
class
|
|
983
|
-
constructor(
|
|
984
|
-
this.filename =
|
|
999
|
+
class Ct {
|
|
1000
|
+
constructor(e) {
|
|
1001
|
+
this.filename = e;
|
|
985
1002
|
}
|
|
986
1003
|
filename;
|
|
987
1004
|
developedCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -996,8 +1013,8 @@ class ye {
|
|
|
996
1013
|
* @param callback Function to call with photo data
|
|
997
1014
|
* @returns This Photo instance for chaining
|
|
998
1015
|
*/
|
|
999
|
-
onDeveloped(
|
|
1000
|
-
return this.developed && this.photoData !== null ? (
|
|
1016
|
+
onDeveloped(e) {
|
|
1017
|
+
return this.developed && this.photoData !== null ? (e(this.photoData), this) : (this.developedCallbacks.add(e), this);
|
|
1001
1018
|
}
|
|
1002
1019
|
/**
|
|
1003
1020
|
* Register a callback for when the photo capture fails
|
|
@@ -1005,8 +1022,8 @@ class ye {
|
|
|
1005
1022
|
* @param callback Function to call with error
|
|
1006
1023
|
* @returns This Photo instance for chaining
|
|
1007
1024
|
*/
|
|
1008
|
-
onError(
|
|
1009
|
-
return this.errorCallbacks.add(
|
|
1025
|
+
onError(e) {
|
|
1026
|
+
return this.errorCallbacks.add(e), this;
|
|
1010
1027
|
}
|
|
1011
1028
|
/**
|
|
1012
1029
|
* Get the filename for this photo
|
|
@@ -1018,24 +1035,24 @@ class ye {
|
|
|
1018
1035
|
* Mark the photo as developed and notify all callbacks
|
|
1019
1036
|
* This method is called by Snapshot when the photo data arrives from the server
|
|
1020
1037
|
*/
|
|
1021
|
-
develop(
|
|
1022
|
-
this.developed || this.failed || (this.photoData =
|
|
1023
|
-
|
|
1038
|
+
develop(e) {
|
|
1039
|
+
this.developed || this.failed || (this.photoData = e, this.developed = !0, this.developedCallbacks.forEach((t) => {
|
|
1040
|
+
t(this.photoData);
|
|
1024
1041
|
}), this.developedCallbacks.clear(), this.errorCallbacks.clear());
|
|
1025
1042
|
}
|
|
1026
1043
|
/**
|
|
1027
1044
|
* Mark the photo as failed and notify error callbacks
|
|
1028
1045
|
*/
|
|
1029
|
-
fail(
|
|
1030
|
-
this.developed || this.failed || (this.failed = !0, this.errorCallbacks.forEach((
|
|
1031
|
-
e
|
|
1046
|
+
fail(e) {
|
|
1047
|
+
this.developed || this.failed || (this.failed = !0, this.errorCallbacks.forEach((t) => {
|
|
1048
|
+
t(e);
|
|
1032
1049
|
}), this.developedCallbacks.clear(), this.errorCallbacks.clear());
|
|
1033
1050
|
}
|
|
1034
1051
|
}
|
|
1035
|
-
const
|
|
1036
|
-
class
|
|
1037
|
-
constructor(
|
|
1038
|
-
this.send =
|
|
1052
|
+
const ie = 3e4;
|
|
1053
|
+
class _t {
|
|
1054
|
+
constructor(e) {
|
|
1055
|
+
this.send = e;
|
|
1039
1056
|
}
|
|
1040
1057
|
send;
|
|
1041
1058
|
validExtensions = [".png"];
|
|
@@ -1047,39 +1064,39 @@ class we {
|
|
|
1047
1064
|
* @returns Photo object for registering callbacks
|
|
1048
1065
|
* @throws VirtualdisplayError if filename is invalid
|
|
1049
1066
|
*/
|
|
1050
|
-
take(
|
|
1051
|
-
this.validateFilename(
|
|
1052
|
-
const
|
|
1053
|
-
this.pendingPhotos.delete(
|
|
1054
|
-
`Snapshot timed out: the viewer did not respond within ${
|
|
1067
|
+
take(e) {
|
|
1068
|
+
this.validateFilename(e), C.debug("Taking snapshot", { filename: e });
|
|
1069
|
+
const t = new Ct(e), i = setTimeout(() => {
|
|
1070
|
+
this.pendingPhotos.delete(e), C.warn("Snapshot timed out", { filename: e }), t.fail(new g(
|
|
1071
|
+
`Snapshot timed out: the viewer did not respond within ${ie}ms`,
|
|
1055
1072
|
A.SNAPSHOT_FAILED
|
|
1056
1073
|
));
|
|
1057
|
-
},
|
|
1058
|
-
return this.pendingPhotos.set(
|
|
1074
|
+
}, ie);
|
|
1075
|
+
return this.pendingPhotos.set(e, { photo: t, timeout: i }), this.send({
|
|
1059
1076
|
type: c.SNAPSHOT,
|
|
1060
|
-
filename:
|
|
1061
|
-
}),
|
|
1077
|
+
filename: e
|
|
1078
|
+
}), t;
|
|
1062
1079
|
}
|
|
1063
1080
|
/**
|
|
1064
1081
|
* Handle incoming snapshot result from server
|
|
1065
1082
|
* Matches the message to a pending photo by filename, then develops or fails it
|
|
1066
1083
|
*/
|
|
1067
|
-
handleSnapshotResult(
|
|
1068
|
-
const
|
|
1069
|
-
if (
|
|
1070
|
-
|
|
1071
|
-
filename:
|
|
1084
|
+
handleSnapshotResult(e) {
|
|
1085
|
+
const t = this.pendingPhotos.get(e.filename);
|
|
1086
|
+
if (t === void 0) {
|
|
1087
|
+
C.warn("No pending photo found for filename", {
|
|
1088
|
+
filename: e.filename,
|
|
1072
1089
|
pendingFilenames: Array.from(this.pendingPhotos.keys())
|
|
1073
1090
|
});
|
|
1074
1091
|
return;
|
|
1075
1092
|
}
|
|
1076
|
-
clearTimeout(
|
|
1077
|
-
const { photo: i } =
|
|
1078
|
-
if (
|
|
1079
|
-
i.fail(new
|
|
1093
|
+
clearTimeout(t.timeout), this.pendingPhotos.delete(e.filename);
|
|
1094
|
+
const { photo: i } = t;
|
|
1095
|
+
if (e.error !== void 0) {
|
|
1096
|
+
i.fail(new g(e.error, A.SNAPSHOT_FAILED));
|
|
1080
1097
|
return;
|
|
1081
1098
|
}
|
|
1082
|
-
|
|
1099
|
+
e.data !== void 0 && i.develop({ filename: e.filename, data: e.data });
|
|
1083
1100
|
}
|
|
1084
1101
|
/**
|
|
1085
1102
|
* Fail any pending photos and forget them. Called from client destroy
|
|
@@ -1089,688 +1106,688 @@ class we {
|
|
|
1089
1106
|
clear() {
|
|
1090
1107
|
if (this.pendingPhotos.size === 0)
|
|
1091
1108
|
return;
|
|
1092
|
-
const
|
|
1109
|
+
const e = new g(
|
|
1093
1110
|
"Client destroyed before snapshot completed",
|
|
1094
1111
|
A.SNAPSHOT_FAILED
|
|
1095
1112
|
);
|
|
1096
|
-
for (const { photo:
|
|
1097
|
-
clearTimeout(i),
|
|
1113
|
+
for (const { photo: t, timeout: i } of this.pendingPhotos.values())
|
|
1114
|
+
clearTimeout(i), t.fail(e);
|
|
1098
1115
|
this.pendingPhotos.clear();
|
|
1099
1116
|
}
|
|
1100
1117
|
/**
|
|
1101
1118
|
* Validate filename has a valid image extension
|
|
1102
1119
|
*/
|
|
1103
|
-
validateFilename(
|
|
1104
|
-
if (
|
|
1105
|
-
throw new
|
|
1120
|
+
validateFilename(e) {
|
|
1121
|
+
if (e === "" || typeof e != "string")
|
|
1122
|
+
throw new g(
|
|
1106
1123
|
"Filename must be a non-empty string",
|
|
1107
1124
|
A.INVALID_PARAMETER
|
|
1108
1125
|
);
|
|
1109
1126
|
if (!this.validExtensions.some(
|
|
1110
|
-
(i) =>
|
|
1127
|
+
(i) => e.toLowerCase().endsWith(i)
|
|
1111
1128
|
))
|
|
1112
|
-
throw new
|
|
1113
|
-
`Invalid filename: "${
|
|
1129
|
+
throw new g(
|
|
1130
|
+
`Invalid filename: "${e}". Filename must end with one of: ${this.validExtensions.join(", ")}`,
|
|
1114
1131
|
A.INVALID_PARAMETER
|
|
1115
1132
|
);
|
|
1116
|
-
if (
|
|
1117
|
-
throw new
|
|
1133
|
+
if (e.includes("..") || e.includes("/") || e.includes("\\"))
|
|
1134
|
+
throw new g(
|
|
1118
1135
|
'Filename cannot contain path separators or ".."',
|
|
1119
1136
|
A.INVALID_PARAMETER
|
|
1120
1137
|
);
|
|
1121
1138
|
}
|
|
1122
1139
|
}
|
|
1123
|
-
class
|
|
1140
|
+
class kt {
|
|
1124
1141
|
container = null;
|
|
1125
|
-
attach(
|
|
1126
|
-
this.container =
|
|
1142
|
+
attach(e) {
|
|
1143
|
+
this.container = e;
|
|
1127
1144
|
}
|
|
1128
|
-
dispatch(
|
|
1129
|
-
const
|
|
1130
|
-
return this.container?.dispatchEvent(
|
|
1145
|
+
dispatch(e, t, i = !1) {
|
|
1146
|
+
const s = new CustomEvent(e, { detail: t, cancelable: i });
|
|
1147
|
+
return this.container?.dispatchEvent(s), s;
|
|
1131
1148
|
}
|
|
1132
|
-
on(
|
|
1133
|
-
const i = (
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1149
|
+
on(e, t) {
|
|
1150
|
+
const i = (s) => {
|
|
1151
|
+
const o = s, r = { ...o.detail, preventDefault: () => {
|
|
1152
|
+
o.preventDefault();
|
|
1136
1153
|
} };
|
|
1137
|
-
|
|
1154
|
+
t(r);
|
|
1138
1155
|
};
|
|
1139
|
-
return this.container?.addEventListener(
|
|
1140
|
-
this.container?.removeEventListener(
|
|
1156
|
+
return this.container?.addEventListener(e, i), () => {
|
|
1157
|
+
this.container?.removeEventListener(e, i);
|
|
1141
1158
|
};
|
|
1142
1159
|
}
|
|
1143
1160
|
}
|
|
1144
|
-
const
|
|
1161
|
+
const At = {}, Et = "en", ye = (
|
|
1145
1162
|
/** @type {const} */
|
|
1146
1163
|
["en", "nl", "de"]
|
|
1147
1164
|
), K = [
|
|
1148
1165
|
"baseLocale"
|
|
1149
|
-
],
|
|
1166
|
+
], se = [], Y = typeof window > "u";
|
|
1150
1167
|
globalThis.__paraglide = /** @type {any} */
|
|
1151
1168
|
globalThis.__paraglide ?? {};
|
|
1152
1169
|
globalThis.__paraglide.ssr = /** @type {any} */
|
|
1153
1170
|
globalThis.__paraglide.ssr ?? {};
|
|
1154
|
-
let
|
|
1171
|
+
let oe = !1, m = () => {
|
|
1155
1172
|
let n = K;
|
|
1156
|
-
!
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
1159
|
-
return
|
|
1173
|
+
!Y && typeof window < "u" && window.location?.href && (n = we(window.location.href));
|
|
1174
|
+
const e = xt(n);
|
|
1175
|
+
if (e)
|
|
1176
|
+
return oe || (oe = !0, Se(e, { reload: !1 })), e;
|
|
1160
1177
|
throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
|
|
1161
1178
|
};
|
|
1162
|
-
function
|
|
1163
|
-
let
|
|
1179
|
+
function xt(n, e) {
|
|
1180
|
+
let t;
|
|
1164
1181
|
for (const i of n) {
|
|
1165
1182
|
if (i === "baseLocale")
|
|
1166
|
-
|
|
1167
|
-
else if (
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
const r =
|
|
1183
|
+
t = Et;
|
|
1184
|
+
else if (Ce(i) && M.has(i)) {
|
|
1185
|
+
const o = M.get(i);
|
|
1186
|
+
if (o) {
|
|
1187
|
+
const r = o.getLocale();
|
|
1171
1188
|
if (r instanceof Promise)
|
|
1172
1189
|
continue;
|
|
1173
1190
|
if (r !== void 0)
|
|
1174
|
-
return
|
|
1191
|
+
return It(r);
|
|
1175
1192
|
}
|
|
1176
1193
|
}
|
|
1177
|
-
const
|
|
1178
|
-
if (
|
|
1179
|
-
return
|
|
1194
|
+
const s = X(t);
|
|
1195
|
+
if (s)
|
|
1196
|
+
return s;
|
|
1180
1197
|
}
|
|
1181
1198
|
}
|
|
1182
|
-
const
|
|
1199
|
+
const Tt = (n) => {
|
|
1183
1200
|
window.location.reload();
|
|
1184
1201
|
};
|
|
1185
|
-
let
|
|
1186
|
-
const
|
|
1202
|
+
let Se = (n, e) => {
|
|
1203
|
+
const t = {
|
|
1187
1204
|
reload: !0,
|
|
1188
|
-
...
|
|
1205
|
+
...e
|
|
1189
1206
|
};
|
|
1190
1207
|
let i;
|
|
1191
1208
|
try {
|
|
1192
|
-
i =
|
|
1209
|
+
i = m();
|
|
1193
1210
|
} catch {
|
|
1194
1211
|
}
|
|
1195
|
-
const
|
|
1196
|
-
let
|
|
1197
|
-
!
|
|
1198
|
-
for (const a of
|
|
1199
|
-
if (a !== "baseLocale" &&
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1202
|
-
let
|
|
1203
|
-
|
|
1212
|
+
const s = [];
|
|
1213
|
+
let o = K;
|
|
1214
|
+
!Y && typeof window < "u" && window.location?.href && (o = we(window.location.href));
|
|
1215
|
+
for (const a of o)
|
|
1216
|
+
if (a !== "baseLocale" && Ce(a) && M.has(a)) {
|
|
1217
|
+
const d = M.get(a);
|
|
1218
|
+
if (d) {
|
|
1219
|
+
let u = d.setLocale(n);
|
|
1220
|
+
u instanceof Promise && (u = u.catch((f) => {
|
|
1204
1221
|
throw new Error(`Custom strategy "${a}" setLocale failed.`, {
|
|
1205
|
-
cause:
|
|
1222
|
+
cause: f
|
|
1206
1223
|
});
|
|
1207
|
-
}),
|
|
1224
|
+
}), s.push(u));
|
|
1208
1225
|
}
|
|
1209
1226
|
}
|
|
1210
1227
|
const r = () => {
|
|
1211
|
-
!
|
|
1228
|
+
!Y && t.reload && window.location && n !== i && Tt();
|
|
1212
1229
|
};
|
|
1213
|
-
if (
|
|
1214
|
-
return Promise.all(
|
|
1230
|
+
if (s.length)
|
|
1231
|
+
return Promise.all(s).then(() => {
|
|
1215
1232
|
r();
|
|
1216
1233
|
});
|
|
1217
1234
|
r();
|
|
1218
|
-
},
|
|
1235
|
+
}, Rt = () => typeof window < "u" ? window.location.origin : "http://fallback.com";
|
|
1219
1236
|
function X(n) {
|
|
1220
1237
|
if (typeof n != "string")
|
|
1221
1238
|
return;
|
|
1222
|
-
const
|
|
1223
|
-
for (const
|
|
1224
|
-
if (
|
|
1225
|
-
return
|
|
1239
|
+
const e = n.toLowerCase();
|
|
1240
|
+
for (const t of ye)
|
|
1241
|
+
if (t.toLowerCase() === e)
|
|
1242
|
+
return t;
|
|
1226
1243
|
}
|
|
1227
|
-
function
|
|
1228
|
-
const
|
|
1229
|
-
if (
|
|
1230
|
-
return
|
|
1231
|
-
throw new Error(`Invalid locale: ${n}. Expected one of: ${
|
|
1244
|
+
function It(n) {
|
|
1245
|
+
const e = X(n);
|
|
1246
|
+
if (e)
|
|
1247
|
+
return e;
|
|
1248
|
+
throw new Error(`Invalid locale: ${n}. Expected one of: ${ye.join(", ")}`);
|
|
1232
1249
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return
|
|
1250
|
+
function Lt(n) {
|
|
1251
|
+
return Ot(n);
|
|
1235
1252
|
}
|
|
1236
|
-
function
|
|
1237
|
-
const
|
|
1238
|
-
return
|
|
1253
|
+
function Ot(n) {
|
|
1254
|
+
const e = typeof n == "string" ? new URL(n, Rt()) : new URL(n), t = e.pathname.split("/").filter(Boolean);
|
|
1255
|
+
return t.length > 0 && X(t[0]) && (e.pathname = "/" + t.slice(1).join("/")), e;
|
|
1239
1256
|
}
|
|
1240
|
-
let
|
|
1241
|
-
function
|
|
1242
|
-
if (
|
|
1257
|
+
let re, ae;
|
|
1258
|
+
function Nt(n) {
|
|
1259
|
+
if (se.length === 0)
|
|
1243
1260
|
return;
|
|
1244
|
-
const
|
|
1245
|
-
if (
|
|
1246
|
-
return
|
|
1247
|
-
const
|
|
1248
|
-
let
|
|
1249
|
-
for (const r of
|
|
1250
|
-
for (const a of
|
|
1251
|
-
if (new
|
|
1252
|
-
|
|
1261
|
+
const e = typeof n == "string" ? n : n.href;
|
|
1262
|
+
if (re === e)
|
|
1263
|
+
return ae;
|
|
1264
|
+
const t = new URL(e, "http://example.com"), i = Lt(t), s = i.href === t.href ? [t] : [t, i];
|
|
1265
|
+
let o;
|
|
1266
|
+
for (const r of s) {
|
|
1267
|
+
for (const a of se)
|
|
1268
|
+
if (new At(a.match, r.href).exec(r.href)) {
|
|
1269
|
+
o = a;
|
|
1253
1270
|
break;
|
|
1254
1271
|
}
|
|
1255
|
-
if (
|
|
1272
|
+
if (o)
|
|
1256
1273
|
break;
|
|
1257
1274
|
}
|
|
1258
|
-
return
|
|
1275
|
+
return re = e, ae = o, o;
|
|
1259
1276
|
}
|
|
1260
|
-
function
|
|
1261
|
-
const
|
|
1262
|
-
return
|
|
1277
|
+
function we(n) {
|
|
1278
|
+
const e = Nt(n);
|
|
1279
|
+
return e && e.exclude !== !0 && Array.isArray(e.strategy) ? e.strategy : K;
|
|
1263
1280
|
}
|
|
1264
1281
|
const M = /* @__PURE__ */ new Map();
|
|
1265
|
-
function
|
|
1282
|
+
function Ce(n) {
|
|
1266
1283
|
return typeof n == "string" && /^custom-[A-Za-z0-9_-]+$/.test(n);
|
|
1267
1284
|
}
|
|
1268
|
-
const
|
|
1285
|
+
const Mt = (
|
|
1269
1286
|
/** @type {(inputs: Controls_Ar_Buttonlabel1Inputs) => LocalizedString} */
|
|
1270
1287
|
() => (
|
|
1271
1288
|
/** @type {LocalizedString} */
|
|
1272
1289
|
"Activate AR"
|
|
1273
1290
|
)
|
|
1274
|
-
),
|
|
1291
|
+
), zt = (
|
|
1275
1292
|
/** @type {(inputs: Controls_Ar_Buttonlabel1Inputs) => LocalizedString} */
|
|
1276
1293
|
() => (
|
|
1277
1294
|
/** @type {LocalizedString} */
|
|
1278
1295
|
"AR activeren"
|
|
1279
1296
|
)
|
|
1280
|
-
),
|
|
1297
|
+
), Pt = (
|
|
1281
1298
|
/** @type {(inputs: Controls_Ar_Buttonlabel1Inputs) => LocalizedString} */
|
|
1282
1299
|
() => (
|
|
1283
1300
|
/** @type {LocalizedString} */
|
|
1284
1301
|
"AR aktivieren"
|
|
1285
1302
|
)
|
|
1286
|
-
),
|
|
1303
|
+
), Ft = (
|
|
1287
1304
|
/** @type {((inputs?: Controls_Ar_Buttonlabel1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Ar_Buttonlabel1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1288
|
-
((n = {},
|
|
1289
|
-
const
|
|
1290
|
-
return
|
|
1305
|
+
((n = {}, e = {}) => {
|
|
1306
|
+
const t = e.locale ?? m();
|
|
1307
|
+
return t === "nl" ? zt() : t === "de" ? Pt() : Mt();
|
|
1291
1308
|
})
|
|
1292
|
-
),
|
|
1309
|
+
), $t = (
|
|
1293
1310
|
/** @type {(inputs: Controls_Qr_Modaltitle1Inputs) => LocalizedString} */
|
|
1294
1311
|
() => (
|
|
1295
1312
|
/** @type {LocalizedString} */
|
|
1296
1313
|
"Scan to view in AR"
|
|
1297
1314
|
)
|
|
1298
|
-
),
|
|
1315
|
+
), Dt = (
|
|
1299
1316
|
/** @type {(inputs: Controls_Qr_Modaltitle1Inputs) => LocalizedString} */
|
|
1300
1317
|
() => (
|
|
1301
1318
|
/** @type {LocalizedString} */
|
|
1302
1319
|
"Scan om in AR te bekijken"
|
|
1303
1320
|
)
|
|
1304
|
-
),
|
|
1321
|
+
), Ut = (
|
|
1305
1322
|
/** @type {(inputs: Controls_Qr_Modaltitle1Inputs) => LocalizedString} */
|
|
1306
1323
|
() => (
|
|
1307
1324
|
/** @type {LocalizedString} */
|
|
1308
1325
|
"Scannen für AR-Ansicht"
|
|
1309
1326
|
)
|
|
1310
|
-
),
|
|
1327
|
+
), Bt = (
|
|
1311
1328
|
/** @type {((inputs?: Controls_Qr_Modaltitle1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modaltitle1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1312
|
-
((n = {},
|
|
1313
|
-
const
|
|
1314
|
-
return
|
|
1329
|
+
((n = {}, e = {}) => {
|
|
1330
|
+
const t = e.locale ?? m();
|
|
1331
|
+
return t === "nl" ? Dt() : t === "de" ? Ut() : $t();
|
|
1315
1332
|
})
|
|
1316
|
-
),
|
|
1333
|
+
), Vt = (
|
|
1317
1334
|
/** @type {(inputs: Controls_Qr_Modaldescription1Inputs) => LocalizedString} */
|
|
1318
1335
|
() => (
|
|
1319
1336
|
/** @type {LocalizedString} */
|
|
1320
1337
|
"Use your smartphone camera to scan this QR code"
|
|
1321
1338
|
)
|
|
1322
|
-
),
|
|
1339
|
+
), jt = (
|
|
1323
1340
|
/** @type {(inputs: Controls_Qr_Modaldescription1Inputs) => LocalizedString} */
|
|
1324
1341
|
() => (
|
|
1325
1342
|
/** @type {LocalizedString} */
|
|
1326
1343
|
"Gebruik de camera van je smartphone om deze QR-code te scannen"
|
|
1327
1344
|
)
|
|
1328
|
-
),
|
|
1345
|
+
), Ht = (
|
|
1329
1346
|
/** @type {(inputs: Controls_Qr_Modaldescription1Inputs) => LocalizedString} */
|
|
1330
1347
|
() => (
|
|
1331
1348
|
/** @type {LocalizedString} */
|
|
1332
1349
|
"Verwende die Kamera deines Smartphones, um diesen QR-Code zu scannen"
|
|
1333
1350
|
)
|
|
1334
|
-
),
|
|
1351
|
+
), qt = (
|
|
1335
1352
|
/** @type {((inputs?: Controls_Qr_Modaldescription1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modaldescription1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1336
|
-
((n = {},
|
|
1337
|
-
const
|
|
1338
|
-
return
|
|
1353
|
+
((n = {}, e = {}) => {
|
|
1354
|
+
const t = e.locale ?? m();
|
|
1355
|
+
return t === "nl" ? jt() : t === "de" ? Ht() : Vt();
|
|
1339
1356
|
})
|
|
1340
|
-
),
|
|
1357
|
+
), Gt = (
|
|
1341
1358
|
/** @type {(inputs: Controls_Qr_Modalinstructions1Inputs) => LocalizedString} */
|
|
1342
1359
|
() => (
|
|
1343
1360
|
/** @type {LocalizedString} */
|
|
1344
1361
|
"Your phone will open the 3D model in AR mode."
|
|
1345
1362
|
)
|
|
1346
|
-
),
|
|
1363
|
+
), Zt = (
|
|
1347
1364
|
/** @type {(inputs: Controls_Qr_Modalinstructions1Inputs) => LocalizedString} */
|
|
1348
1365
|
() => (
|
|
1349
1366
|
/** @type {LocalizedString} */
|
|
1350
1367
|
"Je telefoon opent het 3D-model in AR-modus."
|
|
1351
1368
|
)
|
|
1352
|
-
),
|
|
1369
|
+
), Wt = (
|
|
1353
1370
|
/** @type {(inputs: Controls_Qr_Modalinstructions1Inputs) => LocalizedString} */
|
|
1354
1371
|
() => (
|
|
1355
1372
|
/** @type {LocalizedString} */
|
|
1356
1373
|
"Dein Telefon öffnet das 3D-Modell im AR-Modus."
|
|
1357
1374
|
)
|
|
1358
|
-
),
|
|
1375
|
+
), Yt = (
|
|
1359
1376
|
/** @type {((inputs?: Controls_Qr_Modalinstructions1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modalinstructions1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1360
|
-
((n = {},
|
|
1361
|
-
const
|
|
1362
|
-
return
|
|
1377
|
+
((n = {}, e = {}) => {
|
|
1378
|
+
const t = e.locale ?? m();
|
|
1379
|
+
return t === "nl" ? Zt() : t === "de" ? Wt() : Gt();
|
|
1363
1380
|
})
|
|
1364
|
-
),
|
|
1381
|
+
), Qt = (
|
|
1365
1382
|
/** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
|
|
1366
1383
|
() => (
|
|
1367
1384
|
/** @type {LocalizedString} */
|
|
1368
1385
|
"Close"
|
|
1369
1386
|
)
|
|
1370
|
-
),
|
|
1387
|
+
), Kt = (
|
|
1371
1388
|
/** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
|
|
1372
1389
|
() => (
|
|
1373
1390
|
/** @type {LocalizedString} */
|
|
1374
1391
|
"Sluiten"
|
|
1375
1392
|
)
|
|
1376
|
-
),
|
|
1393
|
+
), Xt = (
|
|
1377
1394
|
/** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
|
|
1378
1395
|
() => (
|
|
1379
1396
|
/** @type {LocalizedString} */
|
|
1380
1397
|
"Schließen"
|
|
1381
1398
|
)
|
|
1382
|
-
),
|
|
1399
|
+
), Jt = (
|
|
1383
1400
|
/** @type {((inputs?: Controls_Qr_Closebutton1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Closebutton1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1384
|
-
((n = {},
|
|
1385
|
-
const
|
|
1386
|
-
return
|
|
1401
|
+
((n = {}, e = {}) => {
|
|
1402
|
+
const t = e.locale ?? m();
|
|
1403
|
+
return t === "nl" ? Kt() : t === "de" ? Xt() : Qt();
|
|
1387
1404
|
})
|
|
1388
|
-
),
|
|
1405
|
+
), en = (
|
|
1389
1406
|
/** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
|
|
1390
1407
|
() => (
|
|
1391
1408
|
/** @type {LocalizedString} */
|
|
1392
1409
|
"Fullscreen"
|
|
1393
1410
|
)
|
|
1394
|
-
),
|
|
1411
|
+
), tn = (
|
|
1395
1412
|
/** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
|
|
1396
1413
|
() => (
|
|
1397
1414
|
/** @type {LocalizedString} */
|
|
1398
1415
|
"Volledig scherm"
|
|
1399
1416
|
)
|
|
1400
|
-
),
|
|
1417
|
+
), nn = (
|
|
1401
1418
|
/** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
|
|
1402
1419
|
() => (
|
|
1403
1420
|
/** @type {LocalizedString} */
|
|
1404
1421
|
"Vollbild"
|
|
1405
1422
|
)
|
|
1406
|
-
),
|
|
1423
|
+
), sn = (
|
|
1407
1424
|
/** @type {((inputs?: Controls_Fullscreen_Buttonlabel1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Fullscreen_Buttonlabel1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1408
|
-
((n = {},
|
|
1409
|
-
const
|
|
1410
|
-
return
|
|
1425
|
+
((n = {}, e = {}) => {
|
|
1426
|
+
const t = e.locale ?? m();
|
|
1427
|
+
return t === "nl" ? tn() : t === "de" ? nn() : en();
|
|
1411
1428
|
})
|
|
1412
|
-
),
|
|
1429
|
+
), on = (
|
|
1413
1430
|
/** @type {(inputs: Loading_Downloadingshort1Inputs) => LocalizedString} */
|
|
1414
1431
|
() => (
|
|
1415
1432
|
/** @type {LocalizedString} */
|
|
1416
1433
|
"Downloading"
|
|
1417
1434
|
)
|
|
1418
|
-
),
|
|
1435
|
+
), rn = (
|
|
1419
1436
|
/** @type {(inputs: Loading_Downloadingshort1Inputs) => LocalizedString} */
|
|
1420
1437
|
() => (
|
|
1421
1438
|
/** @type {LocalizedString} */
|
|
1422
1439
|
"Downloaden"
|
|
1423
1440
|
)
|
|
1424
|
-
),
|
|
1441
|
+
), an = (
|
|
1425
1442
|
/** @type {(inputs: Loading_Downloadingshort1Inputs) => LocalizedString} */
|
|
1426
1443
|
() => (
|
|
1427
1444
|
/** @type {LocalizedString} */
|
|
1428
1445
|
"Herunterladen"
|
|
1429
1446
|
)
|
|
1430
|
-
),
|
|
1447
|
+
), _e = (
|
|
1431
1448
|
/** @type {((inputs?: Loading_Downloadingshort1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Loading_Downloadingshort1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1432
|
-
((n = {},
|
|
1433
|
-
const
|
|
1434
|
-
return
|
|
1449
|
+
((n = {}, e = {}) => {
|
|
1450
|
+
const t = e.locale ?? m();
|
|
1451
|
+
return t === "nl" ? rn() : t === "de" ? an() : on();
|
|
1435
1452
|
})
|
|
1436
|
-
),
|
|
1453
|
+
), ln = (
|
|
1437
1454
|
/** @type {(inputs: Loading_RenderingInputs) => LocalizedString} */
|
|
1438
1455
|
() => (
|
|
1439
1456
|
/** @type {LocalizedString} */
|
|
1440
1457
|
"Rendering"
|
|
1441
1458
|
)
|
|
1442
|
-
),
|
|
1459
|
+
), cn = (
|
|
1443
1460
|
/** @type {(inputs: Loading_RenderingInputs) => LocalizedString} */
|
|
1444
1461
|
() => (
|
|
1445
1462
|
/** @type {LocalizedString} */
|
|
1446
1463
|
"Renderen"
|
|
1447
1464
|
)
|
|
1448
|
-
),
|
|
1465
|
+
), dn = (
|
|
1449
1466
|
/** @type {(inputs: Loading_RenderingInputs) => LocalizedString} */
|
|
1450
1467
|
() => (
|
|
1451
1468
|
/** @type {LocalizedString} */
|
|
1452
1469
|
"Rendern"
|
|
1453
1470
|
)
|
|
1454
|
-
),
|
|
1471
|
+
), un = (
|
|
1455
1472
|
/** @type {((inputs?: Loading_RenderingInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Loading_RenderingInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1456
|
-
((n = {},
|
|
1457
|
-
const
|
|
1458
|
-
return
|
|
1473
|
+
((n = {}, e = {}) => {
|
|
1474
|
+
const t = e.locale ?? m();
|
|
1475
|
+
return t === "nl" ? cn() : t === "de" ? dn() : ln();
|
|
1459
1476
|
})
|
|
1460
|
-
),
|
|
1477
|
+
), hn = (
|
|
1461
1478
|
/** @type {(inputs: Controls_Screenshot_Buttonlabel1Inputs) => LocalizedString} */
|
|
1462
1479
|
() => (
|
|
1463
1480
|
/** @type {LocalizedString} */
|
|
1464
1481
|
"Screenshot"
|
|
1465
1482
|
)
|
|
1466
|
-
),
|
|
1483
|
+
), mn = (
|
|
1467
1484
|
/** @type {(inputs: Controls_Screenshot_Buttonlabel1Inputs) => LocalizedString} */
|
|
1468
1485
|
() => (
|
|
1469
1486
|
/** @type {LocalizedString} */
|
|
1470
1487
|
"Screenshot"
|
|
1471
1488
|
)
|
|
1472
|
-
),
|
|
1489
|
+
), pn = (
|
|
1473
1490
|
/** @type {(inputs: Controls_Screenshot_Buttonlabel1Inputs) => LocalizedString} */
|
|
1474
1491
|
() => (
|
|
1475
1492
|
/** @type {LocalizedString} */
|
|
1476
1493
|
"Screenshot"
|
|
1477
1494
|
)
|
|
1478
|
-
),
|
|
1495
|
+
), fn = (
|
|
1479
1496
|
/** @type {((inputs?: Controls_Screenshot_Buttonlabel1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Screenshot_Buttonlabel1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1480
|
-
((n = {},
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
1497
|
+
((n = {}, e = {}) => {
|
|
1498
|
+
const t = e.locale ?? m();
|
|
1499
|
+
return t === "nl" ? mn() : t === "de" ? pn() : hn();
|
|
1483
1500
|
})
|
|
1484
|
-
),
|
|
1501
|
+
), gn = (
|
|
1485
1502
|
/** @type {(inputs: Controls_Configurator_OpenInputs) => LocalizedString} */
|
|
1486
1503
|
() => (
|
|
1487
1504
|
/** @type {LocalizedString} */
|
|
1488
1505
|
"Configure"
|
|
1489
1506
|
)
|
|
1490
|
-
),
|
|
1507
|
+
), bn = (
|
|
1491
1508
|
/** @type {(inputs: Controls_Configurator_OpenInputs) => LocalizedString} */
|
|
1492
1509
|
() => (
|
|
1493
1510
|
/** @type {LocalizedString} */
|
|
1494
1511
|
"Configureren"
|
|
1495
1512
|
)
|
|
1496
|
-
),
|
|
1513
|
+
), vn = (
|
|
1497
1514
|
/** @type {(inputs: Controls_Configurator_OpenInputs) => LocalizedString} */
|
|
1498
1515
|
() => (
|
|
1499
1516
|
/** @type {LocalizedString} */
|
|
1500
1517
|
"Konfigurieren"
|
|
1501
1518
|
)
|
|
1502
|
-
),
|
|
1519
|
+
), yn = (
|
|
1503
1520
|
/** @type {((inputs?: Controls_Configurator_OpenInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Configurator_OpenInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1504
|
-
((n = {},
|
|
1505
|
-
const
|
|
1506
|
-
return
|
|
1521
|
+
((n = {}, e = {}) => {
|
|
1522
|
+
const t = e.locale ?? m();
|
|
1523
|
+
return t === "nl" ? bn() : t === "de" ? vn() : gn();
|
|
1507
1524
|
})
|
|
1508
|
-
),
|
|
1525
|
+
), Sn = (
|
|
1509
1526
|
/** @type {(inputs: Controls_Configurator_CloseInputs) => LocalizedString} */
|
|
1510
1527
|
() => (
|
|
1511
1528
|
/** @type {LocalizedString} */
|
|
1512
1529
|
"Close"
|
|
1513
1530
|
)
|
|
1514
|
-
),
|
|
1531
|
+
), wn = (
|
|
1515
1532
|
/** @type {(inputs: Controls_Configurator_CloseInputs) => LocalizedString} */
|
|
1516
1533
|
() => (
|
|
1517
1534
|
/** @type {LocalizedString} */
|
|
1518
1535
|
"Sluiten"
|
|
1519
1536
|
)
|
|
1520
|
-
),
|
|
1537
|
+
), Cn = (
|
|
1521
1538
|
/** @type {(inputs: Controls_Configurator_CloseInputs) => LocalizedString} */
|
|
1522
1539
|
() => (
|
|
1523
1540
|
/** @type {LocalizedString} */
|
|
1524
1541
|
"Schließen"
|
|
1525
1542
|
)
|
|
1526
|
-
),
|
|
1543
|
+
), _n = (
|
|
1527
1544
|
/** @type {((inputs?: Controls_Configurator_CloseInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Configurator_CloseInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1528
|
-
((n = {},
|
|
1529
|
-
const
|
|
1530
|
-
return
|
|
1545
|
+
((n = {}, e = {}) => {
|
|
1546
|
+
const t = e.locale ?? m();
|
|
1547
|
+
return t === "nl" ? wn() : t === "de" ? Cn() : Sn();
|
|
1531
1548
|
})
|
|
1532
|
-
),
|
|
1549
|
+
), kn = (
|
|
1533
1550
|
/** @type {(inputs: Controls_Camera_ResetInputs) => LocalizedString} */
|
|
1534
1551
|
() => (
|
|
1535
1552
|
/** @type {LocalizedString} */
|
|
1536
1553
|
"Reset camera"
|
|
1537
1554
|
)
|
|
1538
|
-
),
|
|
1555
|
+
), An = (
|
|
1539
1556
|
/** @type {(inputs: Controls_Camera_ResetInputs) => LocalizedString} */
|
|
1540
1557
|
() => (
|
|
1541
1558
|
/** @type {LocalizedString} */
|
|
1542
1559
|
"Camera resetten"
|
|
1543
1560
|
)
|
|
1544
|
-
),
|
|
1561
|
+
), En = (
|
|
1545
1562
|
/** @type {(inputs: Controls_Camera_ResetInputs) => LocalizedString} */
|
|
1546
1563
|
() => (
|
|
1547
1564
|
/** @type {LocalizedString} */
|
|
1548
1565
|
"Kamera zurücksetzen"
|
|
1549
1566
|
)
|
|
1550
|
-
),
|
|
1567
|
+
), xn = (
|
|
1551
1568
|
/** @type {((inputs?: Controls_Camera_ResetInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_ResetInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1552
|
-
((n = {},
|
|
1553
|
-
const
|
|
1554
|
-
return
|
|
1569
|
+
((n = {}, e = {}) => {
|
|
1570
|
+
const t = e.locale ?? m();
|
|
1571
|
+
return t === "nl" ? An() : t === "de" ? En() : kn();
|
|
1555
1572
|
})
|
|
1556
|
-
),
|
|
1573
|
+
), Tn = (
|
|
1557
1574
|
/** @type {(inputs: Controls_Camera_Zoomin1Inputs) => LocalizedString} */
|
|
1558
1575
|
() => (
|
|
1559
1576
|
/** @type {LocalizedString} */
|
|
1560
1577
|
"Zoom in"
|
|
1561
1578
|
)
|
|
1562
|
-
),
|
|
1579
|
+
), Rn = (
|
|
1563
1580
|
/** @type {(inputs: Controls_Camera_Zoomin1Inputs) => LocalizedString} */
|
|
1564
1581
|
() => (
|
|
1565
1582
|
/** @type {LocalizedString} */
|
|
1566
1583
|
"Inzoomen"
|
|
1567
1584
|
)
|
|
1568
|
-
),
|
|
1585
|
+
), In = (
|
|
1569
1586
|
/** @type {(inputs: Controls_Camera_Zoomin1Inputs) => LocalizedString} */
|
|
1570
1587
|
() => (
|
|
1571
1588
|
/** @type {LocalizedString} */
|
|
1572
1589
|
"Hineinzoomen"
|
|
1573
1590
|
)
|
|
1574
|
-
),
|
|
1591
|
+
), Ln = (
|
|
1575
1592
|
/** @type {((inputs?: Controls_Camera_Zoomin1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Zoomin1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1576
|
-
((n = {},
|
|
1577
|
-
const
|
|
1578
|
-
return
|
|
1593
|
+
((n = {}, e = {}) => {
|
|
1594
|
+
const t = e.locale ?? m();
|
|
1595
|
+
return t === "nl" ? Rn() : t === "de" ? In() : Tn();
|
|
1579
1596
|
})
|
|
1580
|
-
),
|
|
1597
|
+
), On = (
|
|
1581
1598
|
/** @type {(inputs: Controls_Camera_Zoomout1Inputs) => LocalizedString} */
|
|
1582
1599
|
() => (
|
|
1583
1600
|
/** @type {LocalizedString} */
|
|
1584
1601
|
"Zoom out"
|
|
1585
1602
|
)
|
|
1586
|
-
),
|
|
1603
|
+
), Nn = (
|
|
1587
1604
|
/** @type {(inputs: Controls_Camera_Zoomout1Inputs) => LocalizedString} */
|
|
1588
1605
|
() => (
|
|
1589
1606
|
/** @type {LocalizedString} */
|
|
1590
1607
|
"Uitzoomen"
|
|
1591
1608
|
)
|
|
1592
|
-
),
|
|
1609
|
+
), Mn = (
|
|
1593
1610
|
/** @type {(inputs: Controls_Camera_Zoomout1Inputs) => LocalizedString} */
|
|
1594
1611
|
() => (
|
|
1595
1612
|
/** @type {LocalizedString} */
|
|
1596
1613
|
"Herauszoomen"
|
|
1597
1614
|
)
|
|
1598
|
-
),
|
|
1615
|
+
), zn = (
|
|
1599
1616
|
/** @type {((inputs?: Controls_Camera_Zoomout1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Zoomout1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1600
|
-
((n = {},
|
|
1601
|
-
const
|
|
1602
|
-
return
|
|
1617
|
+
((n = {}, e = {}) => {
|
|
1618
|
+
const t = e.locale ?? m();
|
|
1619
|
+
return t === "nl" ? Nn() : t === "de" ? Mn() : On();
|
|
1603
1620
|
})
|
|
1604
|
-
),
|
|
1621
|
+
), Pn = (
|
|
1605
1622
|
/** @type {(inputs: Controls_Camera_Rotateleft1Inputs) => LocalizedString} */
|
|
1606
1623
|
() => (
|
|
1607
1624
|
/** @type {LocalizedString} */
|
|
1608
1625
|
"Rotate left"
|
|
1609
1626
|
)
|
|
1610
|
-
),
|
|
1627
|
+
), Fn = (
|
|
1611
1628
|
/** @type {(inputs: Controls_Camera_Rotateleft1Inputs) => LocalizedString} */
|
|
1612
1629
|
() => (
|
|
1613
1630
|
/** @type {LocalizedString} */
|
|
1614
1631
|
"Naar links draaien"
|
|
1615
1632
|
)
|
|
1616
|
-
),
|
|
1633
|
+
), $n = (
|
|
1617
1634
|
/** @type {(inputs: Controls_Camera_Rotateleft1Inputs) => LocalizedString} */
|
|
1618
1635
|
() => (
|
|
1619
1636
|
/** @type {LocalizedString} */
|
|
1620
1637
|
"Nach links drehen"
|
|
1621
1638
|
)
|
|
1622
|
-
),
|
|
1639
|
+
), Dn = (
|
|
1623
1640
|
/** @type {((inputs?: Controls_Camera_Rotateleft1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Rotateleft1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1624
|
-
((n = {},
|
|
1625
|
-
const
|
|
1626
|
-
return
|
|
1641
|
+
((n = {}, e = {}) => {
|
|
1642
|
+
const t = e.locale ?? m();
|
|
1643
|
+
return t === "nl" ? Fn() : t === "de" ? $n() : Pn();
|
|
1627
1644
|
})
|
|
1628
|
-
),
|
|
1645
|
+
), Un = (
|
|
1629
1646
|
/** @type {(inputs: Controls_Camera_Rotateright1Inputs) => LocalizedString} */
|
|
1630
1647
|
() => (
|
|
1631
1648
|
/** @type {LocalizedString} */
|
|
1632
1649
|
"Rotate right"
|
|
1633
1650
|
)
|
|
1634
|
-
),
|
|
1651
|
+
), Bn = (
|
|
1635
1652
|
/** @type {(inputs: Controls_Camera_Rotateright1Inputs) => LocalizedString} */
|
|
1636
1653
|
() => (
|
|
1637
1654
|
/** @type {LocalizedString} */
|
|
1638
1655
|
"Naar rechts draaien"
|
|
1639
1656
|
)
|
|
1640
|
-
),
|
|
1657
|
+
), Vn = (
|
|
1641
1658
|
/** @type {(inputs: Controls_Camera_Rotateright1Inputs) => LocalizedString} */
|
|
1642
1659
|
() => (
|
|
1643
1660
|
/** @type {LocalizedString} */
|
|
1644
1661
|
"Nach rechts drehen"
|
|
1645
1662
|
)
|
|
1646
|
-
),
|
|
1663
|
+
), jn = (
|
|
1647
1664
|
/** @type {((inputs?: Controls_Camera_Rotateright1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Rotateright1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1648
|
-
((n = {},
|
|
1649
|
-
const
|
|
1650
|
-
return
|
|
1665
|
+
((n = {}, e = {}) => {
|
|
1666
|
+
const t = e.locale ?? m();
|
|
1667
|
+
return t === "nl" ? Bn() : t === "de" ? Vn() : Un();
|
|
1651
1668
|
})
|
|
1652
|
-
),
|
|
1669
|
+
), Hn = (
|
|
1653
1670
|
/** @type {(inputs: Controls_Camera_Tiltup1Inputs) => LocalizedString} */
|
|
1654
1671
|
() => (
|
|
1655
1672
|
/** @type {LocalizedString} */
|
|
1656
1673
|
"Tilt up"
|
|
1657
1674
|
)
|
|
1658
|
-
),
|
|
1675
|
+
), qn = (
|
|
1659
1676
|
/** @type {(inputs: Controls_Camera_Tiltup1Inputs) => LocalizedString} */
|
|
1660
1677
|
() => (
|
|
1661
1678
|
/** @type {LocalizedString} */
|
|
1662
1679
|
"Omhoog kantelen"
|
|
1663
1680
|
)
|
|
1664
|
-
),
|
|
1681
|
+
), Gn = (
|
|
1665
1682
|
/** @type {(inputs: Controls_Camera_Tiltup1Inputs) => LocalizedString} */
|
|
1666
1683
|
() => (
|
|
1667
1684
|
/** @type {LocalizedString} */
|
|
1668
1685
|
"Nach oben kippen"
|
|
1669
1686
|
)
|
|
1670
|
-
),
|
|
1687
|
+
), Zn = (
|
|
1671
1688
|
/** @type {((inputs?: Controls_Camera_Tiltup1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Tiltup1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1672
|
-
((n = {},
|
|
1673
|
-
const
|
|
1674
|
-
return
|
|
1689
|
+
((n = {}, e = {}) => {
|
|
1690
|
+
const t = e.locale ?? m();
|
|
1691
|
+
return t === "nl" ? qn() : t === "de" ? Gn() : Hn();
|
|
1675
1692
|
})
|
|
1676
|
-
),
|
|
1693
|
+
), Wn = (
|
|
1677
1694
|
/** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
|
|
1678
1695
|
() => (
|
|
1679
1696
|
/** @type {LocalizedString} */
|
|
1680
1697
|
"Tilt down"
|
|
1681
1698
|
)
|
|
1682
|
-
),
|
|
1699
|
+
), Yn = (
|
|
1683
1700
|
/** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
|
|
1684
1701
|
() => (
|
|
1685
1702
|
/** @type {LocalizedString} */
|
|
1686
1703
|
"Omlaag kantelen"
|
|
1687
1704
|
)
|
|
1688
|
-
),
|
|
1705
|
+
), Qn = (
|
|
1689
1706
|
/** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
|
|
1690
1707
|
() => (
|
|
1691
1708
|
/** @type {LocalizedString} */
|
|
1692
1709
|
"Nach unten kippen"
|
|
1693
1710
|
)
|
|
1694
|
-
),
|
|
1711
|
+
), Kn = (
|
|
1695
1712
|
/** @type {((inputs?: Controls_Camera_Tiltdown1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Tiltdown1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1696
|
-
((n = {},
|
|
1697
|
-
const
|
|
1698
|
-
return
|
|
1713
|
+
((n = {}, e = {}) => {
|
|
1714
|
+
const t = e.locale ?? m();
|
|
1715
|
+
return t === "nl" ? Yn() : t === "de" ? Qn() : Wn();
|
|
1699
1716
|
})
|
|
1700
|
-
),
|
|
1717
|
+
), Xn = (
|
|
1701
1718
|
/** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
|
|
1702
1719
|
() => (
|
|
1703
1720
|
/** @type {LocalizedString} */
|
|
1704
1721
|
"Working…"
|
|
1705
1722
|
)
|
|
1706
|
-
),
|
|
1723
|
+
), Jn = (
|
|
1707
1724
|
/** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
|
|
1708
1725
|
() => (
|
|
1709
1726
|
/** @type {LocalizedString} */
|
|
1710
1727
|
"Bezig…"
|
|
1711
1728
|
)
|
|
1712
|
-
),
|
|
1729
|
+
), ei = (
|
|
1713
1730
|
/** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
|
|
1714
1731
|
() => (
|
|
1715
1732
|
/** @type {LocalizedString} */
|
|
1716
1733
|
"Läuft…"
|
|
1717
1734
|
)
|
|
1718
|
-
),
|
|
1735
|
+
), ti = (
|
|
1719
1736
|
/** @type {((inputs?: Commerce_Submit_BusyInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Commerce_Submit_BusyInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1720
|
-
((n = {},
|
|
1721
|
-
const
|
|
1722
|
-
return
|
|
1737
|
+
((n = {}, e = {}) => {
|
|
1738
|
+
const t = e.locale ?? m();
|
|
1739
|
+
return t === "nl" ? Jn() : t === "de" ? ei() : Xn();
|
|
1723
1740
|
})
|
|
1724
|
-
),
|
|
1741
|
+
), ni = (
|
|
1725
1742
|
/** @type {(inputs: Commerce_Submit_SuccessInputs) => LocalizedString} */
|
|
1726
1743
|
() => (
|
|
1727
1744
|
/** @type {LocalizedString} */
|
|
1728
1745
|
"Done"
|
|
1729
1746
|
)
|
|
1730
|
-
),
|
|
1747
|
+
), ii = (
|
|
1731
1748
|
/** @type {(inputs: Commerce_Submit_SuccessInputs) => LocalizedString} */
|
|
1732
1749
|
() => (
|
|
1733
1750
|
/** @type {LocalizedString} */
|
|
1734
1751
|
"Gelukt"
|
|
1735
1752
|
)
|
|
1736
|
-
),
|
|
1753
|
+
), si = (
|
|
1737
1754
|
/** @type {(inputs: Commerce_Submit_SuccessInputs) => LocalizedString} */
|
|
1738
1755
|
() => (
|
|
1739
1756
|
/** @type {LocalizedString} */
|
|
1740
1757
|
"Fertig"
|
|
1741
1758
|
)
|
|
1742
|
-
),
|
|
1759
|
+
), oi = (
|
|
1743
1760
|
/** @type {((inputs?: Commerce_Submit_SuccessInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Commerce_Submit_SuccessInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1744
|
-
((n = {},
|
|
1745
|
-
const
|
|
1746
|
-
return
|
|
1761
|
+
((n = {}, e = {}) => {
|
|
1762
|
+
const t = e.locale ?? m();
|
|
1763
|
+
return t === "nl" ? ii() : t === "de" ? si() : ni();
|
|
1747
1764
|
})
|
|
1748
|
-
),
|
|
1765
|
+
), ri = (
|
|
1749
1766
|
/** @type {(inputs: Commerce_Submit_FailedInputs) => LocalizedString} */
|
|
1750
1767
|
() => (
|
|
1751
1768
|
/** @type {LocalizedString} */
|
|
1752
1769
|
"Failed"
|
|
1753
1770
|
)
|
|
1754
|
-
),
|
|
1771
|
+
), ai = (
|
|
1755
1772
|
/** @type {(inputs: Commerce_Submit_FailedInputs) => LocalizedString} */
|
|
1756
1773
|
() => (
|
|
1757
1774
|
/** @type {LocalizedString} */
|
|
1758
1775
|
"Mislukt"
|
|
1759
1776
|
)
|
|
1760
|
-
),
|
|
1777
|
+
), li = (
|
|
1761
1778
|
/** @type {(inputs: Commerce_Submit_FailedInputs) => LocalizedString} */
|
|
1762
1779
|
() => (
|
|
1763
1780
|
/** @type {LocalizedString} */
|
|
1764
1781
|
"Fehlgeschlagen"
|
|
1765
1782
|
)
|
|
1766
|
-
),
|
|
1783
|
+
), ci = (
|
|
1767
1784
|
/** @type {((inputs?: Commerce_Submit_FailedInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Commerce_Submit_FailedInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1768
|
-
((n = {},
|
|
1769
|
-
const
|
|
1770
|
-
return
|
|
1785
|
+
((n = {}, e = {}) => {
|
|
1786
|
+
const t = e.locale ?? m();
|
|
1787
|
+
return t === "nl" ? ai() : t === "de" ? li() : ri();
|
|
1771
1788
|
})
|
|
1772
1789
|
);
|
|
1773
|
-
const
|
|
1790
|
+
const di = {
|
|
1774
1791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1775
1792
|
width: 24,
|
|
1776
1793
|
height: 24,
|
|
@@ -1781,22 +1798,22 @@ const ai = {
|
|
|
1781
1798
|
"stroke-linecap": "round",
|
|
1782
1799
|
"stroke-linejoin": "round"
|
|
1783
1800
|
};
|
|
1784
|
-
const
|
|
1801
|
+
const ke = ([n, e, t]) => {
|
|
1785
1802
|
const i = document.createElementNS("http://www.w3.org/2000/svg", n);
|
|
1786
|
-
return Object.keys(
|
|
1787
|
-
i.setAttribute(
|
|
1788
|
-
}),
|
|
1789
|
-
const
|
|
1790
|
-
i.appendChild(
|
|
1803
|
+
return Object.keys(e).forEach((s) => {
|
|
1804
|
+
i.setAttribute(s, String(e[s]));
|
|
1805
|
+
}), t?.length && t.forEach((s) => {
|
|
1806
|
+
const o = ke(s);
|
|
1807
|
+
i.appendChild(o);
|
|
1791
1808
|
}), i;
|
|
1792
|
-
},
|
|
1809
|
+
}, Ae = (n, e = {}) => {
|
|
1793
1810
|
const i = {
|
|
1794
|
-
...
|
|
1795
|
-
...
|
|
1811
|
+
...di,
|
|
1812
|
+
...e
|
|
1796
1813
|
};
|
|
1797
|
-
return
|
|
1814
|
+
return ke(["svg", i, n]);
|
|
1798
1815
|
};
|
|
1799
|
-
const
|
|
1816
|
+
const ui = [
|
|
1800
1817
|
[
|
|
1801
1818
|
"path",
|
|
1802
1819
|
{
|
|
@@ -1806,7 +1823,7 @@ const li = [
|
|
|
1806
1823
|
["path", { d: "m3.3 7 8.7 5 8.7-5" }],
|
|
1807
1824
|
["path", { d: "M12 22V12" }]
|
|
1808
1825
|
];
|
|
1809
|
-
const
|
|
1826
|
+
const hi = [
|
|
1810
1827
|
[
|
|
1811
1828
|
"path",
|
|
1812
1829
|
{
|
|
@@ -1815,27 +1832,27 @@ const ci = [
|
|
|
1815
1832
|
],
|
|
1816
1833
|
["circle", { cx: "12", cy: "13", r: "3" }]
|
|
1817
1834
|
];
|
|
1818
|
-
const
|
|
1819
|
-
const
|
|
1820
|
-
const
|
|
1821
|
-
const
|
|
1822
|
-
const
|
|
1835
|
+
const Ee = [["path", { d: "m6 9 6 6 6-6" }]];
|
|
1836
|
+
const mi = [["path", { d: "m15 18-6-6 6-6" }]];
|
|
1837
|
+
const pi = [["path", { d: "m9 18 6-6-6-6" }]];
|
|
1838
|
+
const fi = [["path", { d: "m18 15-6-6-6 6" }]];
|
|
1839
|
+
const gi = [
|
|
1823
1840
|
["path", { d: "M15 3h6v6" }],
|
|
1824
1841
|
["path", { d: "m21 3-7 7" }],
|
|
1825
1842
|
["path", { d: "m3 21 7-7" }],
|
|
1826
1843
|
["path", { d: "M9 21H3v-6" }]
|
|
1827
1844
|
];
|
|
1828
|
-
const
|
|
1845
|
+
const bi = [
|
|
1829
1846
|
["path", { d: "m14 10 7-7" }],
|
|
1830
1847
|
["path", { d: "M20 10h-6V4" }],
|
|
1831
1848
|
["path", { d: "m3 21 7-7" }],
|
|
1832
1849
|
["path", { d: "M4 14h6v6" }]
|
|
1833
1850
|
];
|
|
1834
|
-
const
|
|
1851
|
+
const vi = [
|
|
1835
1852
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }],
|
|
1836
1853
|
["path", { d: "M3 3v5h5" }]
|
|
1837
1854
|
];
|
|
1838
|
-
const
|
|
1855
|
+
const yi = [
|
|
1839
1856
|
["path", { d: "M10 5H3" }],
|
|
1840
1857
|
["path", { d: "M12 19H3" }],
|
|
1841
1858
|
["path", { d: "M14 3v4" }],
|
|
@@ -1846,47 +1863,47 @@ const gi = [
|
|
|
1846
1863
|
["path", { d: "M8 10v4" }],
|
|
1847
1864
|
["path", { d: "M8 12H3" }]
|
|
1848
1865
|
];
|
|
1849
|
-
const
|
|
1866
|
+
const Si = [
|
|
1850
1867
|
["path", { d: "M18 6 6 18" }],
|
|
1851
1868
|
["path", { d: "m6 6 12 12" }]
|
|
1852
1869
|
];
|
|
1853
|
-
const
|
|
1870
|
+
const wi = [
|
|
1854
1871
|
["circle", { cx: "11", cy: "11", r: "8" }],
|
|
1855
1872
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }],
|
|
1873
|
+
["line", { x1: "11", x2: "11", y1: "8", y2: "14" }],
|
|
1856
1874
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11" }]
|
|
1857
1875
|
];
|
|
1858
|
-
const
|
|
1876
|
+
const Ci = [
|
|
1859
1877
|
["circle", { cx: "11", cy: "11", r: "8" }],
|
|
1860
1878
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }],
|
|
1861
|
-
["line", { x1: "11", x2: "11", y1: "8", y2: "14" }],
|
|
1862
1879
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11" }]
|
|
1863
1880
|
];
|
|
1864
|
-
function y(n, { size:
|
|
1865
|
-
return
|
|
1866
|
-
}
|
|
1867
|
-
const
|
|
1868
|
-
ar: (n) => y(
|
|
1869
|
-
fullscreen: (n) => y(
|
|
1870
|
-
exitFullscreen: (n) => y(
|
|
1871
|
-
screenshot: (n) => y(
|
|
1872
|
-
tiltUp: (n) => y(
|
|
1873
|
-
tiltDown: (n) => y(
|
|
1874
|
-
rotateLeft: (n) => y(
|
|
1875
|
-
rotateRight: (n) => y(
|
|
1876
|
-
zoomIn: (n) => y(
|
|
1877
|
-
zoomOut: (n) => y(
|
|
1878
|
-
reset: (n) => y(
|
|
1879
|
-
configurator: (n) => y(
|
|
1880
|
-
close: (n) => y(
|
|
1881
|
+
function y(n, { size: e = 20, strokeWidth: t = 1.75 } = {}) {
|
|
1882
|
+
return Ae(n, { width: e, height: e, "stroke-width": t });
|
|
1883
|
+
}
|
|
1884
|
+
const b = {
|
|
1885
|
+
ar: (n) => y(ui, n),
|
|
1886
|
+
fullscreen: (n) => y(gi, n),
|
|
1887
|
+
exitFullscreen: (n) => y(bi, n),
|
|
1888
|
+
screenshot: (n) => y(hi, n),
|
|
1889
|
+
tiltUp: (n) => y(fi, n),
|
|
1890
|
+
tiltDown: (n) => y(Ee, n),
|
|
1891
|
+
rotateLeft: (n) => y(mi, n),
|
|
1892
|
+
rotateRight: (n) => y(pi, n),
|
|
1893
|
+
zoomIn: (n) => y(wi, n),
|
|
1894
|
+
zoomOut: (n) => y(Ci, n),
|
|
1895
|
+
reset: (n) => y(vi, n),
|
|
1896
|
+
configurator: (n) => y(yi, n),
|
|
1897
|
+
close: (n) => y(Si, n)
|
|
1881
1898
|
};
|
|
1882
|
-
class
|
|
1899
|
+
class v {
|
|
1883
1900
|
element;
|
|
1884
|
-
constructor({ variant:
|
|
1885
|
-
this.element = document.createElement("button"), this.element.className = `ui-btn ui-btn--${
|
|
1901
|
+
constructor({ variant: e = "default", size: t = "default", label: i, icon: s, onClick: o, disabled: r = !1 } = {}) {
|
|
1902
|
+
this.element = document.createElement("button"), this.element.className = `ui-btn ui-btn--${e} ui-btn--size-${t}`, i !== void 0 && (this.element.setAttribute("aria-label", i), this.element.title = i), s !== void 0 ? this.element.appendChild(s) : i !== void 0 && (this.element.textContent = i), o && this.element.addEventListener("click", o), this.element.disabled = r;
|
|
1886
1903
|
}
|
|
1887
|
-
setIcon(
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1904
|
+
setIcon(e) {
|
|
1905
|
+
const t = this.element.querySelector("svg");
|
|
1906
|
+
t !== null ? t.replaceWith(e) : this.element.appendChild(e);
|
|
1890
1907
|
}
|
|
1891
1908
|
}
|
|
1892
1909
|
const p = {
|
|
@@ -1923,7 +1940,7 @@ const p = {
|
|
|
1923
1940
|
// 32px
|
|
1924
1941
|
9: "2.25rem"
|
|
1925
1942
|
};
|
|
1926
|
-
class
|
|
1943
|
+
class _i {
|
|
1927
1944
|
element;
|
|
1928
1945
|
constructor() {
|
|
1929
1946
|
this.element = document.createElement("div"), Object.assign(this.element.style, {
|
|
@@ -1936,25 +1953,25 @@ class wi {
|
|
|
1936
1953
|
});
|
|
1937
1954
|
}
|
|
1938
1955
|
}
|
|
1939
|
-
class
|
|
1940
|
-
constructor(
|
|
1941
|
-
this.options =
|
|
1956
|
+
class ki {
|
|
1957
|
+
constructor(e = {}) {
|
|
1958
|
+
this.options = e, this.card = new _i(), this.backdrop = this.createBackdrop(), this.backdrop.appendChild(this.card.element);
|
|
1942
1959
|
}
|
|
1943
1960
|
options;
|
|
1944
1961
|
card;
|
|
1945
1962
|
backdrop;
|
|
1946
1963
|
keyHandler = null;
|
|
1947
1964
|
open() {
|
|
1948
|
-
document.body.appendChild(this.backdrop), this.keyHandler = (
|
|
1949
|
-
|
|
1965
|
+
document.body.appendChild(this.backdrop), this.keyHandler = (e) => {
|
|
1966
|
+
e.key === "Escape" && this.close();
|
|
1950
1967
|
}, document.addEventListener("keydown", this.keyHandler);
|
|
1951
1968
|
}
|
|
1952
1969
|
close() {
|
|
1953
1970
|
this.backdrop.remove(), this.keyHandler !== null && (document.removeEventListener("keydown", this.keyHandler), this.keyHandler = null), this.options.onClose?.();
|
|
1954
1971
|
}
|
|
1955
1972
|
createBackdrop() {
|
|
1956
|
-
const
|
|
1957
|
-
return Object.assign(
|
|
1973
|
+
const e = document.createElement("div");
|
|
1974
|
+
return Object.assign(e.style, {
|
|
1958
1975
|
position: "fixed",
|
|
1959
1976
|
inset: l[0],
|
|
1960
1977
|
background: "oklch(0% 0 0 / 50%)",
|
|
@@ -1962,72 +1979,137 @@ class Si {
|
|
|
1962
1979
|
display: "flex",
|
|
1963
1980
|
alignItems: "center",
|
|
1964
1981
|
justifyContent: "center"
|
|
1965
|
-
}),
|
|
1966
|
-
|
|
1967
|
-
}),
|
|
1982
|
+
}), e.addEventListener("click", (t) => {
|
|
1983
|
+
t.target === e && this.close();
|
|
1984
|
+
}), e;
|
|
1968
1985
|
}
|
|
1969
1986
|
}
|
|
1970
|
-
class
|
|
1987
|
+
class Ai {
|
|
1971
1988
|
element;
|
|
1972
1989
|
selectCallback = null;
|
|
1973
|
-
constructor(
|
|
1990
|
+
constructor(e, t, i) {
|
|
1974
1991
|
this.element = document.createElement("div"), this.element.className = "ui-toggle-group";
|
|
1975
|
-
for (let
|
|
1976
|
-
const
|
|
1977
|
-
r.className = "ui-toggle-group-item", r.dataset.value =
|
|
1978
|
-
this.selectCallback?.(
|
|
1992
|
+
for (let s = 0; s < e.length; s++) {
|
|
1993
|
+
const o = e[s], r = document.createElement("button");
|
|
1994
|
+
r.className = "ui-toggle-group-item", r.dataset.value = o, r.textContent = i?.[s] ?? o, r.dataset.state = o === t ? "on" : "off", r.setAttribute("aria-pressed", o === t ? "true" : "false"), r.addEventListener("click", () => {
|
|
1995
|
+
this.selectCallback?.(o);
|
|
1979
1996
|
}), this.element.appendChild(r);
|
|
1980
1997
|
}
|
|
1981
1998
|
}
|
|
1982
|
-
setSelected(
|
|
1983
|
-
for (const
|
|
1984
|
-
const i =
|
|
1985
|
-
|
|
1999
|
+
setSelected(e) {
|
|
2000
|
+
for (const t of this.element.querySelectorAll(".ui-toggle-group-item")) {
|
|
2001
|
+
const i = t.dataset.value === e;
|
|
2002
|
+
t.dataset.state = i ? "on" : "off", t.setAttribute("aria-pressed", i ? "true" : "false");
|
|
1986
2003
|
}
|
|
1987
2004
|
}
|
|
1988
|
-
onSelect(
|
|
1989
|
-
this.selectCallback =
|
|
2005
|
+
onSelect(e) {
|
|
2006
|
+
this.selectCallback = e;
|
|
1990
2007
|
}
|
|
1991
2008
|
/**
|
|
1992
2009
|
* Enable only the given values; null lifts every restriction. A disabled
|
|
1993
2010
|
* value stays visible (the buyer sees the option exists) but cannot be
|
|
1994
2011
|
* picked: the selectable snapshot's "not in the list = grey".
|
|
1995
2012
|
*/
|
|
1996
|
-
setEnabled(
|
|
1997
|
-
for (const
|
|
1998
|
-
const i =
|
|
1999
|
-
|
|
2013
|
+
setEnabled(e) {
|
|
2014
|
+
for (const t of this.element.querySelectorAll(".ui-toggle-group-item")) {
|
|
2015
|
+
const i = e === null || e.includes(t.dataset.value ?? "");
|
|
2016
|
+
t.disabled = !i, t.setAttribute("aria-disabled", i ? "false" : "true");
|
|
2000
2017
|
}
|
|
2001
2018
|
}
|
|
2002
2019
|
}
|
|
2003
|
-
class
|
|
2020
|
+
class Ei {
|
|
2004
2021
|
element;
|
|
2005
2022
|
select;
|
|
2006
|
-
constructor(
|
|
2007
|
-
this.select = document.createElement("select"), this.select.className = "ui-native-select", this.select.dataset.name =
|
|
2023
|
+
constructor(e, t, i, s, o) {
|
|
2024
|
+
this.select = document.createElement("select"), this.select.className = "ui-native-select", this.select.dataset.name = e, this.select.setAttribute("aria-label", i);
|
|
2008
2025
|
const r = document.createElement("option");
|
|
2009
2026
|
r.value = "", r.disabled = !0, r.textContent = i, this.select.appendChild(r);
|
|
2010
2027
|
let a = !1;
|
|
2011
|
-
for (let
|
|
2012
|
-
const
|
|
2013
|
-
|
|
2028
|
+
for (let u = 0; u < t.length; u++) {
|
|
2029
|
+
const f = t[u], h = document.createElement("option");
|
|
2030
|
+
h.value = f, h.textContent = o?.[u] ?? f, f === s && (h.selected = !0, a = !0), this.select.appendChild(h);
|
|
2014
2031
|
}
|
|
2015
2032
|
a || (r.selected = !0);
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2033
|
+
const d = Ae(Ee, { width: 16, height: 16, "stroke-width": 2 });
|
|
2034
|
+
d.classList.add("ui-native-select-icon"), this.element = document.createElement("div"), this.element.className = "ui-native-select-wrap", this.element.appendChild(this.select), this.element.appendChild(d);
|
|
2018
2035
|
}
|
|
2019
|
-
setSelected(
|
|
2020
|
-
this.select.value =
|
|
2036
|
+
setSelected(e) {
|
|
2037
|
+
this.select.value = e;
|
|
2021
2038
|
}
|
|
2022
|
-
onSelect(
|
|
2039
|
+
onSelect(e) {
|
|
2023
2040
|
this.select.addEventListener("change", () => {
|
|
2024
|
-
|
|
2041
|
+
e(this.select.value);
|
|
2025
2042
|
});
|
|
2026
2043
|
}
|
|
2027
2044
|
/** Enable only the given values; null lifts every restriction (see ToggleGroup.setEnabled). */
|
|
2028
|
-
setEnabled(
|
|
2029
|
-
for (const
|
|
2030
|
-
|
|
2045
|
+
setEnabled(e) {
|
|
2046
|
+
for (const t of this.select.options)
|
|
2047
|
+
t.value !== "" && (t.disabled = e !== null && !e.includes(t.value));
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
class xi {
|
|
2051
|
+
element;
|
|
2052
|
+
input;
|
|
2053
|
+
valueText;
|
|
2054
|
+
values;
|
|
2055
|
+
options;
|
|
2056
|
+
selectCallback = null;
|
|
2057
|
+
settleCallback = null;
|
|
2058
|
+
constructor(e, t) {
|
|
2059
|
+
if (e.length === 0)
|
|
2060
|
+
throw new Error("Virtualdisplay: Slider needs at least one value");
|
|
2061
|
+
this.values = e, this.options = t, this.input = document.createElement("input"), this.input.type = "range", this.input.className = "ui-slider-input", this.input.min = "0", this.input.max = String(e.length - 1), this.input.step = "1", this.input.setAttribute("aria-label", t.label), this.valueText = document.createElement("span"), this.valueText.className = "ui-slider-value", this.valueText.setAttribute("aria-hidden", "true");
|
|
2062
|
+
const i = document.createElement("div");
|
|
2063
|
+
i.className = "ui-slider-track", i.appendChild(this.input), i.appendChild(this.buildEnds()), this.element = document.createElement("div"), this.element.className = "ui-slider", this.element.appendChild(i), this.element.appendChild(this.valueText);
|
|
2064
|
+
const s = t.initialSelected === void 0 ? 0 : e.indexOf(t.initialSelected);
|
|
2065
|
+
this.applyIndex(s === -1 ? 0 : s), this.listen();
|
|
2066
|
+
}
|
|
2067
|
+
setSelected(e) {
|
|
2068
|
+
const t = this.values.indexOf(e);
|
|
2069
|
+
t !== -1 && this.applyIndex(t);
|
|
2070
|
+
}
|
|
2071
|
+
/** Fires on every step a drag or keypress crosses, with the value it lands on. */
|
|
2072
|
+
onSelect(e) {
|
|
2073
|
+
this.selectCallback = e;
|
|
2074
|
+
}
|
|
2075
|
+
/** Fires once per interaction, when the value commits (drag released, key released). */
|
|
2076
|
+
onSettle(e) {
|
|
2077
|
+
this.settleCallback = e;
|
|
2078
|
+
}
|
|
2079
|
+
listen() {
|
|
2080
|
+
this.input.addEventListener("input", () => {
|
|
2081
|
+
const e = this.values[this.currentIndex];
|
|
2082
|
+
e !== void 0 && (this.applyIndex(this.currentIndex), this.selectCallback?.(e));
|
|
2083
|
+
}), this.input.addEventListener("change", () => {
|
|
2084
|
+
const e = this.values[this.currentIndex];
|
|
2085
|
+
e !== void 0 && this.settleCallback?.(e);
|
|
2086
|
+
});
|
|
2087
|
+
}
|
|
2088
|
+
get currentIndex() {
|
|
2089
|
+
return Number(this.input.value);
|
|
2090
|
+
}
|
|
2091
|
+
applyIndex(e) {
|
|
2092
|
+
this.input.value = String(e);
|
|
2093
|
+
const t = this.displayAt(e);
|
|
2094
|
+
this.valueText.textContent = t, this.input.setAttribute("aria-valuetext", t);
|
|
2095
|
+
const i = this.values.length === 1 ? 100 : e / (this.values.length - 1) * 100;
|
|
2096
|
+
this.element.style.setProperty("--ui-slider-pct", `${i}%`);
|
|
2097
|
+
}
|
|
2098
|
+
buildEnds() {
|
|
2099
|
+
const e = document.createElement("div");
|
|
2100
|
+
e.className = "ui-slider-ends", e.setAttribute("aria-hidden", "true");
|
|
2101
|
+
for (const t of [0, this.values.length - 1]) {
|
|
2102
|
+
const i = document.createElement("span");
|
|
2103
|
+
i.textContent = this.labelAt(t), e.appendChild(i);
|
|
2104
|
+
}
|
|
2105
|
+
return e;
|
|
2106
|
+
}
|
|
2107
|
+
labelAt(e) {
|
|
2108
|
+
return this.options.labels?.[e] ?? this.values[e] ?? "";
|
|
2109
|
+
}
|
|
2110
|
+
displayAt(e) {
|
|
2111
|
+
const t = this.labelAt(e);
|
|
2112
|
+
return this.options.unit === void 0 ? t : `${t} ${this.options.unit}`;
|
|
2031
2113
|
}
|
|
2032
2114
|
}
|
|
2033
2115
|
const w = {
|
|
@@ -2047,7 +2129,7 @@ const w = {
|
|
|
2047
2129
|
medium: "500",
|
|
2048
2130
|
semibold: "600"
|
|
2049
2131
|
}
|
|
2050
|
-
}, x = w.fontFamily.sans.join(", "),
|
|
2132
|
+
}, x = w.fontFamily.sans.join(", "), Ti = `
|
|
2051
2133
|
--primary: oklch(5% 0 0);
|
|
2052
2134
|
--primary-foreground: oklch(100% 0 0);
|
|
2053
2135
|
--secondary: oklch(92% 0 0);
|
|
@@ -2060,8 +2142,8 @@ const w = {
|
|
|
2060
2142
|
--accent: oklch(92% 0 0);
|
|
2061
2143
|
--accent-foreground: oklch(5% 0 0);
|
|
2062
2144
|
--muted-foreground: oklch(44% 0 0);
|
|
2063
|
-
`,
|
|
2064
|
-
:root { ${
|
|
2145
|
+
`, Ri = `
|
|
2146
|
+
:root { ${Ti} }
|
|
2065
2147
|
|
|
2066
2148
|
/* ── Button ──────────────────────────────────────────────── */
|
|
2067
2149
|
.ui-btn {
|
|
@@ -2192,6 +2274,97 @@ const w = {
|
|
|
2192
2274
|
pointer-events: none;
|
|
2193
2275
|
}
|
|
2194
2276
|
|
|
2277
|
+
/* ── Slider ──────────────────────────────────────────────── */
|
|
2278
|
+
.ui-slider {
|
|
2279
|
+
display: flex;
|
|
2280
|
+
align-items: center;
|
|
2281
|
+
gap: 0.75rem;
|
|
2282
|
+
inline-size: 100%;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
.ui-slider-track {
|
|
2286
|
+
flex: 1;
|
|
2287
|
+
min-inline-size: 0;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/* Tabular figures keep the readout and layout steady mid-drag. */
|
|
2291
|
+
.ui-slider-value {
|
|
2292
|
+
font-family: ${x};
|
|
2293
|
+
font-size: 0.875rem;
|
|
2294
|
+
font-weight: 600;
|
|
2295
|
+
color: var(--foreground);
|
|
2296
|
+
font-variant-numeric: tabular-nums;
|
|
2297
|
+
white-space: nowrap;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
.ui-slider-ends {
|
|
2301
|
+
display: flex;
|
|
2302
|
+
justify-content: space-between;
|
|
2303
|
+
font-family: ${x};
|
|
2304
|
+
font-size: 0.75rem;
|
|
2305
|
+
color: var(--muted-foreground);
|
|
2306
|
+
font-variant-numeric: tabular-nums;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
/* 2.75rem tall: the whole input is the touch target (44px). */
|
|
2310
|
+
.ui-slider-input {
|
|
2311
|
+
appearance: none;
|
|
2312
|
+
display: block;
|
|
2313
|
+
inline-size: 100%;
|
|
2314
|
+
block-size: 2.75rem;
|
|
2315
|
+
margin: 0;
|
|
2316
|
+
padding: 0;
|
|
2317
|
+
background: transparent;
|
|
2318
|
+
cursor: pointer;
|
|
2319
|
+
}
|
|
2320
|
+
.ui-slider-input:focus-visible { outline: none; }
|
|
2321
|
+
|
|
2322
|
+
/* --ui-slider-pct is set by the component; it fills the track up to the thumb. */
|
|
2323
|
+
.ui-slider-input::-webkit-slider-runnable-track {
|
|
2324
|
+
block-size: 0.375rem;
|
|
2325
|
+
border-radius: 9999px;
|
|
2326
|
+
background: linear-gradient(to right, var(--primary) var(--ui-slider-pct, 0%), var(--secondary) var(--ui-slider-pct, 0%));
|
|
2327
|
+
}
|
|
2328
|
+
.ui-slider-input::-webkit-slider-thumb {
|
|
2329
|
+
appearance: none;
|
|
2330
|
+
inline-size: 1.25rem;
|
|
2331
|
+
block-size: 1.25rem;
|
|
2332
|
+
margin-block-start: -0.4375rem; /* centre the 1.25rem thumb on the 0.375rem track */
|
|
2333
|
+
border-radius: 50%;
|
|
2334
|
+
border: 2px solid var(--primary);
|
|
2335
|
+
background: var(--background);
|
|
2336
|
+
box-shadow: 0 1px 3px oklch(5% 0 0 / 20%);
|
|
2337
|
+
transition: box-shadow 200ms, border-color 200ms;
|
|
2338
|
+
}
|
|
2339
|
+
.ui-slider-input:focus-visible::-webkit-slider-thumb {
|
|
2340
|
+
border-color: var(--ring);
|
|
2341
|
+
box-shadow: 0 0 0 3px oklch(5% 0 0 / 12%);
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
.ui-slider-input::-moz-range-track {
|
|
2345
|
+
block-size: 0.375rem;
|
|
2346
|
+
border-radius: 9999px;
|
|
2347
|
+
background: var(--secondary);
|
|
2348
|
+
}
|
|
2349
|
+
.ui-slider-input::-moz-range-progress {
|
|
2350
|
+
block-size: 0.375rem;
|
|
2351
|
+
border-radius: 9999px;
|
|
2352
|
+
background: var(--primary);
|
|
2353
|
+
}
|
|
2354
|
+
.ui-slider-input::-moz-range-thumb {
|
|
2355
|
+
inline-size: 1.25rem;
|
|
2356
|
+
block-size: 1.25rem;
|
|
2357
|
+
border-radius: 50%;
|
|
2358
|
+
border: 2px solid var(--primary);
|
|
2359
|
+
background: var(--background);
|
|
2360
|
+
box-shadow: 0 1px 3px oklch(5% 0 0 / 20%);
|
|
2361
|
+
transition: box-shadow 200ms, border-color 200ms;
|
|
2362
|
+
}
|
|
2363
|
+
.ui-slider-input:focus-visible::-moz-range-thumb {
|
|
2364
|
+
border-color: var(--ring);
|
|
2365
|
+
box-shadow: 0 0 0 3px oklch(5% 0 0 / 12%);
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2195
2368
|
/* ── Annotation layer ───────────────────────────────────── */
|
|
2196
2369
|
.vd-annotations-layer {
|
|
2197
2370
|
position: absolute;
|
|
@@ -2340,114 +2513,114 @@ const w = {
|
|
|
2340
2513
|
50% { opacity: 0.55; }
|
|
2341
2514
|
}
|
|
2342
2515
|
`;
|
|
2343
|
-
let
|
|
2344
|
-
function
|
|
2345
|
-
if (
|
|
2516
|
+
let le = !1;
|
|
2517
|
+
function xe() {
|
|
2518
|
+
if (le || typeof document > "u")
|
|
2346
2519
|
return;
|
|
2347
|
-
|
|
2520
|
+
le = !0;
|
|
2348
2521
|
const n = document.createElement("style");
|
|
2349
|
-
n.id = "vd-ui-vanilla", n.textContent =
|
|
2522
|
+
n.id = "vd-ui-vanilla", n.textContent = Ri, document.head.appendChild(n);
|
|
2350
2523
|
}
|
|
2351
|
-
const
|
|
2352
|
-
class
|
|
2524
|
+
const Ii = w.fontFamily.sans.join(", ");
|
|
2525
|
+
class Li {
|
|
2353
2526
|
qrLib = null;
|
|
2354
2527
|
dialog = null;
|
|
2355
2528
|
qrSlot = null;
|
|
2356
2529
|
/** Open the modal immediately, with a loading placeholder in the QR slot. */
|
|
2357
2530
|
show() {
|
|
2358
|
-
this.hide(),
|
|
2531
|
+
this.hide(), xe(), this.dialog = new ki({ onClose: () => {
|
|
2359
2532
|
this.dialog = null, this.qrSlot = null;
|
|
2360
2533
|
} }), Object.assign(this.dialog.card.element.style, {
|
|
2361
2534
|
display: "flex",
|
|
2362
2535
|
flexDirection: "column",
|
|
2363
2536
|
alignItems: "center",
|
|
2364
2537
|
gap: l[3],
|
|
2365
|
-
fontFamily:
|
|
2366
|
-
}), this.dialog.card.element.appendChild(this.createText(
|
|
2538
|
+
fontFamily: Ii
|
|
2539
|
+
}), this.dialog.card.element.appendChild(this.createText(Bt(), {
|
|
2367
2540
|
fontSize: w.fontSize.base,
|
|
2368
2541
|
fontWeight: w.fontWeight.semibold,
|
|
2369
2542
|
color: p.neutral[900]
|
|
2370
|
-
})), this.dialog.card.element.appendChild(this.createText(
|
|
2543
|
+
})), this.dialog.card.element.appendChild(this.createText(qt(), {
|
|
2371
2544
|
fontSize: w.fontSize.sm,
|
|
2372
2545
|
color: p.neutral[600]
|
|
2373
|
-
})), this.qrSlot = this.createQrSlot(), this.dialog.card.element.appendChild(this.qrSlot), this.dialog.card.element.appendChild(this.createText(
|
|
2546
|
+
})), this.qrSlot = this.createQrSlot(), this.dialog.card.element.appendChild(this.qrSlot), this.dialog.card.element.appendChild(this.createText(Yt(), {
|
|
2374
2547
|
fontSize: w.fontSize.xs,
|
|
2375
2548
|
color: p.neutral[500]
|
|
2376
2549
|
}));
|
|
2377
|
-
const
|
|
2550
|
+
const e = new v({
|
|
2378
2551
|
variant: "outline",
|
|
2379
|
-
label:
|
|
2552
|
+
label: Jt(),
|
|
2380
2553
|
onClick: () => {
|
|
2381
2554
|
this.hide();
|
|
2382
2555
|
}
|
|
2383
2556
|
});
|
|
2384
|
-
this.dialog.card.element.appendChild(
|
|
2557
|
+
this.dialog.card.element.appendChild(e.element), this.dialog.open();
|
|
2385
2558
|
}
|
|
2386
2559
|
/**
|
|
2387
2560
|
* Render the QR for `url` into the open modal's slot, replacing the loading
|
|
2388
2561
|
* placeholder. Resolves `true` once the QR is actually on screen; `false`
|
|
2389
2562
|
* when the modal was closed before it could render (nothing reopens).
|
|
2390
2563
|
*/
|
|
2391
|
-
async update(
|
|
2564
|
+
async update(e) {
|
|
2392
2565
|
this.qrLib ??= await import("./browser-ey6Iih3j.js").then((i) => i.b);
|
|
2393
|
-
const
|
|
2566
|
+
const t = await this.qrLib.toDataURL(e, {
|
|
2394
2567
|
width: 256,
|
|
2395
2568
|
margin: 4,
|
|
2396
2569
|
errorCorrectionLevel: "M",
|
|
2397
2570
|
color: { dark: p.black, light: p.white }
|
|
2398
2571
|
});
|
|
2399
|
-
return this.qrSlot === null ? !1 : (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createQrImage(
|
|
2572
|
+
return this.qrSlot === null ? !1 : (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createQrImage(t)), !0);
|
|
2400
2573
|
}
|
|
2401
2574
|
hide() {
|
|
2402
2575
|
this.dialog?.close(), this.dialog = null, this.qrSlot = null;
|
|
2403
2576
|
}
|
|
2404
|
-
createText(
|
|
2577
|
+
createText(e, t) {
|
|
2405
2578
|
const i = document.createElement("p");
|
|
2406
|
-
return i.textContent =
|
|
2579
|
+
return i.textContent = e, Object.assign(i.style, { margin: "0", textAlign: "center", ...t }), i;
|
|
2407
2580
|
}
|
|
2408
2581
|
createQrSlot() {
|
|
2409
|
-
const
|
|
2410
|
-
return
|
|
2582
|
+
const e = document.createElement("div");
|
|
2583
|
+
return e.className = "ui-qr-slot ui-qr-slot--loading", e;
|
|
2411
2584
|
}
|
|
2412
|
-
createQrImage(
|
|
2413
|
-
const
|
|
2414
|
-
return
|
|
2585
|
+
createQrImage(e) {
|
|
2586
|
+
const t = document.createElement("img");
|
|
2587
|
+
return t.src = e, t.alt = "QR code", t;
|
|
2415
2588
|
}
|
|
2416
2589
|
}
|
|
2417
|
-
function
|
|
2418
|
-
const
|
|
2419
|
-
return
|
|
2590
|
+
function ce(n) {
|
|
2591
|
+
const e = Math.max(0, Math.min(1, n));
|
|
2592
|
+
return e * e * (3 - 2 * e);
|
|
2420
2593
|
}
|
|
2421
|
-
function
|
|
2422
|
-
const [r, a,
|
|
2423
|
-
return [i +
|
|
2594
|
+
function Oi(n, e, t, i, s, o) {
|
|
2595
|
+
const [r, a, d] = n, u = Math.cos(e), f = Math.sin(e), h = u * r + f * d, E = -f * r + u * d, k = Math.cos(t), _ = Math.sin(t), I = k * a - _ * E, P = _ * a + k * E, J = 0.55;
|
|
2596
|
+
return [i + h * o * J, s - I * o * J, P];
|
|
2424
2597
|
}
|
|
2425
|
-
function
|
|
2426
|
-
n.beginPath(), n.moveTo(
|
|
2598
|
+
function Ni(n, e, t) {
|
|
2599
|
+
n.beginPath(), n.moveTo(e[0], e[1]), n.lineTo(t[0], t[1]), n.strokeStyle = "#000", n.lineWidth = 2, n.stroke();
|
|
2427
2600
|
}
|
|
2428
|
-
function
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2601
|
+
function Mi(n, e, t, i, s) {
|
|
2602
|
+
const o = e(t), r = e(i), a = [
|
|
2603
|
+
o[0] + (r[0] - o[0]) * s,
|
|
2604
|
+
o[1] + (r[1] - o[1]) * s,
|
|
2605
|
+
o[2]
|
|
2433
2606
|
];
|
|
2434
|
-
|
|
2607
|
+
Ni(n, o, a);
|
|
2435
2608
|
}
|
|
2436
|
-
const $ = [-1, -1, 1], D = [1, -1, 1],
|
|
2609
|
+
const $ = [-1, -1, 1], D = [1, -1, 1], U = [1, -1, -1], B = [-1, -1, -1], V = [-1, 1, 1], j = [1, 1, 1], H = [1, 1, -1], q = [-1, 1, -1], de = [
|
|
2437
2610
|
[$, D],
|
|
2438
|
-
[D,
|
|
2439
|
-
[
|
|
2440
|
-
[
|
|
2611
|
+
[D, U],
|
|
2612
|
+
[U, B],
|
|
2613
|
+
[B, $],
|
|
2441
2614
|
[$, V],
|
|
2442
2615
|
[D, j],
|
|
2443
|
-
[
|
|
2444
|
-
[
|
|
2616
|
+
[U, H],
|
|
2617
|
+
[B, q],
|
|
2445
2618
|
[V, j],
|
|
2446
2619
|
[j, H],
|
|
2447
2620
|
[H, q],
|
|
2448
2621
|
[q, V]
|
|
2449
|
-
],
|
|
2450
|
-
function
|
|
2622
|
+
], zi = 400, ue = '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif';
|
|
2623
|
+
function Pi() {
|
|
2451
2624
|
const n = document.createElement("div");
|
|
2452
2625
|
Object.assign(n.style, {
|
|
2453
2626
|
position: "absolute",
|
|
@@ -2461,15 +2634,15 @@ function Oi() {
|
|
|
2461
2634
|
opacity: "0",
|
|
2462
2635
|
transition: "opacity 0.3s ease-in-out"
|
|
2463
2636
|
});
|
|
2464
|
-
const
|
|
2465
|
-
Object.assign(
|
|
2637
|
+
const e = document.createElement("canvas");
|
|
2638
|
+
Object.assign(e.style, {
|
|
2466
2639
|
width: "100%",
|
|
2467
2640
|
height: "100%",
|
|
2468
2641
|
position: "absolute",
|
|
2469
2642
|
inset: "0"
|
|
2470
2643
|
});
|
|
2471
|
-
const
|
|
2472
|
-
Object.assign(
|
|
2644
|
+
const t = document.createElement("div");
|
|
2645
|
+
Object.assign(t.style, {
|
|
2473
2646
|
position: "absolute",
|
|
2474
2647
|
top: "56%",
|
|
2475
2648
|
left: "0",
|
|
@@ -2483,16 +2656,16 @@ function Oi() {
|
|
|
2483
2656
|
fontWeight: "400",
|
|
2484
2657
|
color: "#000",
|
|
2485
2658
|
fontVariantNumeric: "tabular-nums",
|
|
2486
|
-
fontFamily:
|
|
2659
|
+
fontFamily: ue
|
|
2487
2660
|
});
|
|
2488
|
-
const
|
|
2489
|
-
return Object.assign(
|
|
2661
|
+
const s = document.createElement("span");
|
|
2662
|
+
return Object.assign(s.style, {
|
|
2490
2663
|
fontSize: "13px",
|
|
2491
2664
|
color: "#000",
|
|
2492
|
-
fontFamily:
|
|
2493
|
-
}),
|
|
2665
|
+
fontFamily: ue
|
|
2666
|
+
}), s.textContent = _e(), t.appendChild(i), t.appendChild(s), n.appendChild(e), n.appendChild(t), { overlay: n, canvas: e, pctEl: i, phaseEl: s };
|
|
2494
2667
|
}
|
|
2495
|
-
class
|
|
2668
|
+
class Fi {
|
|
2496
2669
|
overlay;
|
|
2497
2670
|
canvas;
|
|
2498
2671
|
ctx;
|
|
@@ -2503,34 +2676,34 @@ class Ni {
|
|
|
2503
2676
|
startTime;
|
|
2504
2677
|
hidden = !1;
|
|
2505
2678
|
visible = !1;
|
|
2506
|
-
constructor(
|
|
2679
|
+
constructor(e, t = {}) {
|
|
2507
2680
|
this.startTime = performance.now();
|
|
2508
|
-
const i =
|
|
2509
|
-
this.overlay = i.overlay, this.canvas = i.canvas, this.pctEl = i.pctEl, this.phaseEl = i.phaseEl,
|
|
2510
|
-
const
|
|
2681
|
+
const i = Pi();
|
|
2682
|
+
this.overlay = i.overlay, this.canvas = i.canvas, this.pctEl = i.pctEl, this.phaseEl = i.phaseEl, e.appendChild(this.overlay), this.ctx = this.canvas.getContext("2d"), this.ctx !== null && (this.sizeCanvas(), this.tick());
|
|
2683
|
+
const s = t.showDelay ?? zi;
|
|
2511
2684
|
this.showTimerId = setTimeout(() => {
|
|
2512
2685
|
this.reveal();
|
|
2513
|
-
},
|
|
2686
|
+
}, s);
|
|
2514
2687
|
}
|
|
2515
2688
|
get loadingTexts() {
|
|
2516
2689
|
return {
|
|
2517
|
-
downloading:
|
|
2518
|
-
rendering:
|
|
2690
|
+
downloading: _e(),
|
|
2691
|
+
rendering: un()
|
|
2519
2692
|
};
|
|
2520
2693
|
}
|
|
2521
|
-
updateProgress(
|
|
2522
|
-
this.hidden || (this.pctEl.textContent = `${Math.round(
|
|
2694
|
+
updateProgress(e, t) {
|
|
2695
|
+
this.hidden || (this.pctEl.textContent = `${Math.round(e)}%`, this.phaseEl.textContent = t !== "" ? ` · ${t}` : "");
|
|
2523
2696
|
}
|
|
2524
2697
|
/**
|
|
2525
2698
|
* Show an error state — stops animation and displays the error message.
|
|
2526
2699
|
* The overlay stays visible so the user knows something went wrong.
|
|
2527
2700
|
*/
|
|
2528
|
-
showError(
|
|
2701
|
+
showError(e) {
|
|
2529
2702
|
if (this.hidden = !1, this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.ctx !== null) {
|
|
2530
|
-
const
|
|
2531
|
-
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0, i *
|
|
2703
|
+
const t = Math.min(devicePixelRatio, 2), i = this.canvas.width / t, s = this.canvas.height / t;
|
|
2704
|
+
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0, i * t, s * t);
|
|
2532
2705
|
}
|
|
2533
|
-
this.pctEl.textContent = "", this.phaseEl.textContent =
|
|
2706
|
+
this.pctEl.textContent = "", this.phaseEl.textContent = e, this.phaseEl.style.color = "#b91c1c", this.reveal();
|
|
2534
2707
|
}
|
|
2535
2708
|
hide() {
|
|
2536
2709
|
if (!this.hidden) {
|
|
@@ -2557,8 +2730,8 @@ class Ni {
|
|
|
2557
2730
|
sizeCanvas() {
|
|
2558
2731
|
if (this.ctx === null)
|
|
2559
2732
|
return;
|
|
2560
|
-
const
|
|
2561
|
-
this.canvas.width =
|
|
2733
|
+
const e = Math.min(devicePixelRatio, 2), t = this.overlay.clientWidth || 440, i = this.overlay.clientHeight || 360;
|
|
2734
|
+
this.canvas.width = t * e, this.canvas.height = i * e, this.ctx.scale(e, e), this.ctx.lineCap = "round", this.ctx.lineJoin = "round";
|
|
2562
2735
|
}
|
|
2563
2736
|
tick = () => {
|
|
2564
2737
|
this.hidden || (this.drawFrame(), this.animationId = requestAnimationFrame(this.tick));
|
|
@@ -2566,24 +2739,24 @@ class Ni {
|
|
|
2566
2739
|
drawFrame() {
|
|
2567
2740
|
if (this.ctx === null)
|
|
2568
2741
|
return;
|
|
2569
|
-
const
|
|
2570
|
-
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0,
|
|
2571
|
-
const
|
|
2742
|
+
const e = this.canvas.width / Math.min(devicePixelRatio, 2), t = this.canvas.height / Math.min(devicePixelRatio, 2), i = (performance.now() - this.startTime) / 1e3;
|
|
2743
|
+
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0, e, t);
|
|
2744
|
+
const s = e / 2, o = t * 0.44, r = Math.min(e, t) * 0.08, a = 0.785, d = 0.615, u = (_) => Oi(_, a, d, s, o, r), f = 6, h = i % f / f, E = de.length;
|
|
2572
2745
|
let k;
|
|
2573
|
-
|
|
2574
|
-
for (let
|
|
2575
|
-
const
|
|
2576
|
-
if (
|
|
2746
|
+
h < 0.35 ? k = ce(h / 0.35) * E : h < 0.55 ? k = E : h < 0.9 ? k = (1 - ce((h - 0.55) / 0.35)) * E : k = 0, this.ctx.shadowBlur = 5, this.ctx.shadowColor = "rgba(30,30,30,0.08)";
|
|
2747
|
+
for (let _ = 0; _ < E && !(_ >= k); _++) {
|
|
2748
|
+
const I = de[_];
|
|
2749
|
+
if (I === void 0)
|
|
2577
2750
|
continue;
|
|
2578
|
-
const P = Math.min(1, k -
|
|
2579
|
-
|
|
2751
|
+
const P = Math.min(1, k - _);
|
|
2752
|
+
Mi(this.ctx, u, I[0], I[1], P);
|
|
2580
2753
|
}
|
|
2581
2754
|
this.ctx.shadowBlur = 0;
|
|
2582
2755
|
}
|
|
2583
2756
|
}
|
|
2584
|
-
class
|
|
2585
|
-
constructor(
|
|
2586
|
-
this.options =
|
|
2757
|
+
class $i {
|
|
2758
|
+
constructor(e) {
|
|
2759
|
+
this.options = e, this.element = document.createElement("div"), Object.assign(this.element.style, { display: "flex", gap: "0.375rem" }), this.onFullscreenChange = () => {
|
|
2587
2760
|
this.setFullscreenIcon(document.fullscreenElement !== null);
|
|
2588
2761
|
}, document.addEventListener("fullscreenchange", this.onFullscreenChange);
|
|
2589
2762
|
}
|
|
@@ -2592,30 +2765,30 @@ class Mi {
|
|
|
2592
2765
|
arBtn = null;
|
|
2593
2766
|
fullscreenBtn = null;
|
|
2594
2767
|
onFullscreenChange;
|
|
2595
|
-
setFullscreenIcon(
|
|
2596
|
-
this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(
|
|
2768
|
+
setFullscreenIcon(e) {
|
|
2769
|
+
this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(e ? b.exitFullscreen() : b.fullscreen());
|
|
2597
2770
|
}
|
|
2598
|
-
syncButton(
|
|
2599
|
-
if (
|
|
2600
|
-
const
|
|
2601
|
-
return this.element.appendChild(
|
|
2771
|
+
syncButton(e, t, i) {
|
|
2772
|
+
if (t && e === null) {
|
|
2773
|
+
const s = i();
|
|
2774
|
+
return this.element.appendChild(s.element), s;
|
|
2602
2775
|
}
|
|
2603
|
-
return !
|
|
2776
|
+
return !t && e !== null ? (e.element.remove(), null) : e;
|
|
2604
2777
|
}
|
|
2605
|
-
applySettings(
|
|
2606
|
-
this.arBtn = this.syncButton(this.arBtn,
|
|
2778
|
+
applySettings(e) {
|
|
2779
|
+
this.arBtn = this.syncButton(this.arBtn, e.ar !== !1 && this.options.onAr !== void 0, () => new v({
|
|
2607
2780
|
variant: "outline",
|
|
2608
2781
|
size: "icon",
|
|
2609
|
-
label:
|
|
2610
|
-
icon:
|
|
2782
|
+
label: Ft(),
|
|
2783
|
+
icon: b.ar(),
|
|
2611
2784
|
onClick: () => {
|
|
2612
2785
|
this.options.onAr?.();
|
|
2613
2786
|
}
|
|
2614
|
-
})), this.fullscreenBtn = this.syncButton(this.fullscreenBtn,
|
|
2787
|
+
})), this.fullscreenBtn = this.syncButton(this.fullscreenBtn, e.fullscreen !== !1 && this.options.onFullscreen !== void 0, () => new v({
|
|
2615
2788
|
variant: "outline",
|
|
2616
2789
|
size: "icon",
|
|
2617
|
-
label:
|
|
2618
|
-
icon:
|
|
2790
|
+
label: sn(),
|
|
2791
|
+
icon: b.fullscreen(),
|
|
2619
2792
|
onClick: () => {
|
|
2620
2793
|
this.options.onFullscreen?.();
|
|
2621
2794
|
}
|
|
@@ -2625,81 +2798,81 @@ class Mi {
|
|
|
2625
2798
|
document.removeEventListener("fullscreenchange", this.onFullscreenChange);
|
|
2626
2799
|
}
|
|
2627
2800
|
}
|
|
2628
|
-
const
|
|
2801
|
+
const R = 0.5;
|
|
2629
2802
|
class z {
|
|
2630
2803
|
element;
|
|
2631
|
-
constructor(
|
|
2804
|
+
constructor(e, t) {
|
|
2632
2805
|
this.element = Object.assign(document.createElement("div"), { className: "vd-camera-controls" });
|
|
2633
2806
|
const i = {
|
|
2634
|
-
targetRotation:
|
|
2635
|
-
targetTilt:
|
|
2636
|
-
targetZoom:
|
|
2807
|
+
targetRotation: t.rotation,
|
|
2808
|
+
targetTilt: t.tilt,
|
|
2809
|
+
targetZoom: t.zoom,
|
|
2637
2810
|
thetaOffset: 0
|
|
2638
|
-
},
|
|
2639
|
-
|
|
2640
|
-
i.targetRotation =
|
|
2641
|
-
}), this.element.appendChild(z.buildZoom(
|
|
2811
|
+
}, s = Di(e, t, i);
|
|
2812
|
+
t.onChange((o) => {
|
|
2813
|
+
i.targetRotation = o.rotation - i.thetaOffset, i.targetTilt = o.tilt, i.targetZoom = o.zoom, Ui(s, t, o);
|
|
2814
|
+
}), this.element.appendChild(z.buildZoom(s.zoomOut, s.zoomIn)), this.element.appendChild(z.buildDpad(s.tiltUp, s.rotateLeft, s.reset, s.rotateRight, s.tiltDown));
|
|
2642
2815
|
}
|
|
2643
|
-
static buildZoom(
|
|
2816
|
+
static buildZoom(e, t) {
|
|
2644
2817
|
const i = document.createElement("div");
|
|
2645
|
-
return i.className = "vd-zoom", i.appendChild(
|
|
2818
|
+
return i.className = "vd-zoom", i.appendChild(e.element), i.appendChild(t.element), i;
|
|
2646
2819
|
}
|
|
2647
|
-
static buildDpad(
|
|
2820
|
+
static buildDpad(e, t, i, s, o) {
|
|
2648
2821
|
const r = document.createElement("div");
|
|
2649
2822
|
r.className = "vd-dpad";
|
|
2650
|
-
for (const [a,
|
|
2651
|
-
[
|
|
2652
|
-
[
|
|
2823
|
+
for (const [a, d] of [
|
|
2824
|
+
[e, "up"],
|
|
2825
|
+
[t, "left"],
|
|
2653
2826
|
[i, "center"],
|
|
2654
|
-
[
|
|
2655
|
-
[
|
|
2827
|
+
[s, "right"],
|
|
2828
|
+
[o, "down"]
|
|
2656
2829
|
])
|
|
2657
|
-
a.element.classList.add(`vd-dpad-${
|
|
2830
|
+
a.element.classList.add(`vd-dpad-${d}`), r.appendChild(a.element);
|
|
2658
2831
|
return r;
|
|
2659
2832
|
}
|
|
2660
2833
|
}
|
|
2661
|
-
function
|
|
2662
|
-
const i = (r) => Math.max(
|
|
2663
|
-
const a =
|
|
2664
|
-
return a !== void 0 ||
|
|
2665
|
-
},
|
|
2666
|
-
const a =
|
|
2667
|
-
if (a !== void 0 ||
|
|
2668
|
-
|
|
2834
|
+
function Di(n, e, t) {
|
|
2835
|
+
const i = (r) => Math.max(e.limits?.minZoom ?? 1, Math.min(e.limits?.maxZoom ?? 1 / 0, r)), s = (r) => {
|
|
2836
|
+
const a = e.limits?.minRotate, d = e.limits?.maxRotate;
|
|
2837
|
+
return a !== void 0 || d !== void 0 ? Math.max(a ?? -1 / 0, Math.min(d ?? 1 / 0, r)) : r;
|
|
2838
|
+
}, o = (r) => {
|
|
2839
|
+
const a = e.limits?.minTilt, d = e.limits?.maxTilt;
|
|
2840
|
+
if (a !== void 0 || d !== void 0) {
|
|
2841
|
+
t.targetTilt = Math.max(a ?? 0, Math.min(d ?? 180, t.targetTilt + r)), n.tilt(t.targetTilt).set();
|
|
2669
2842
|
return;
|
|
2670
2843
|
}
|
|
2671
|
-
const
|
|
2672
|
-
|
|
2844
|
+
const u = t.targetTilt + r;
|
|
2845
|
+
u > 180 || u < 0 ? (t.targetTilt = u > 180 ? 360 - u : -u, t.thetaOffset = (t.thetaOffset + 180) % 360, n.tilt(t.targetTilt).rotate(t.targetRotation + t.thetaOffset).set()) : (t.targetTilt = u, n.tilt(t.targetTilt).set());
|
|
2673
2846
|
};
|
|
2674
2847
|
return {
|
|
2675
|
-
zoomOut: new
|
|
2676
|
-
|
|
2848
|
+
zoomOut: new v({ variant: "outline", size: "icon", label: zn(), icon: b.zoomOut(), onClick: () => {
|
|
2849
|
+
t.targetZoom = i(t.targetZoom - 10), n.zoom(t.targetZoom).set();
|
|
2677
2850
|
} }),
|
|
2678
|
-
zoomIn: new
|
|
2679
|
-
|
|
2851
|
+
zoomIn: new v({ variant: "outline", size: "icon", label: Ln(), icon: b.zoomIn(), onClick: () => {
|
|
2852
|
+
t.targetZoom = i(t.targetZoom + 10), n.zoom(t.targetZoom).set();
|
|
2680
2853
|
} }),
|
|
2681
|
-
tiltUp: new
|
|
2682
|
-
|
|
2854
|
+
tiltUp: new v({ variant: "outline", size: "icon", label: Zn(), icon: b.tiltUp(), onClick: () => {
|
|
2855
|
+
o(-15);
|
|
2683
2856
|
} }),
|
|
2684
|
-
rotateLeft: new
|
|
2685
|
-
|
|
2857
|
+
rotateLeft: new v({ variant: "outline", size: "icon", label: Dn(), icon: b.rotateLeft(), onClick: () => {
|
|
2858
|
+
t.targetRotation = s(t.targetRotation - 15), n.rotate(t.targetRotation + t.thetaOffset).set();
|
|
2686
2859
|
} }),
|
|
2687
|
-
reset: new
|
|
2688
|
-
|
|
2860
|
+
reset: new v({ variant: "outline", size: "icon", label: xn(), icon: b.reset(), onClick: () => {
|
|
2861
|
+
t.thetaOffset = 0, n.reset();
|
|
2689
2862
|
} }),
|
|
2690
|
-
rotateRight: new
|
|
2691
|
-
|
|
2863
|
+
rotateRight: new v({ variant: "outline", size: "icon", label: jn(), icon: b.rotateRight(), onClick: () => {
|
|
2864
|
+
t.targetRotation = s(t.targetRotation + 15), n.rotate(t.targetRotation + t.thetaOffset).set();
|
|
2692
2865
|
} }),
|
|
2693
|
-
tiltDown: new
|
|
2694
|
-
|
|
2866
|
+
tiltDown: new v({ variant: "outline", size: "icon", label: Kn(), icon: b.tiltDown(), onClick: () => {
|
|
2867
|
+
o(15);
|
|
2695
2868
|
} })
|
|
2696
2869
|
};
|
|
2697
2870
|
}
|
|
2698
|
-
function
|
|
2699
|
-
const i =
|
|
2700
|
-
i !== void 0 && (n.zoomOut.element.disabled = i.minZoom !== void 0 &&
|
|
2871
|
+
function Ui(n, e, t) {
|
|
2872
|
+
const i = e.limits;
|
|
2873
|
+
i !== void 0 && (n.zoomOut.element.disabled = i.minZoom !== void 0 && t.zoom <= i.minZoom + R, n.zoomIn.element.disabled = i.maxZoom !== void 0 && t.zoom >= i.maxZoom - R, n.tiltUp.element.disabled = i.minTilt !== void 0 && t.tilt <= i.minTilt + R, n.tiltDown.element.disabled = i.maxTilt !== void 0 && t.tilt >= i.maxTilt - R, n.rotateLeft.element.disabled = i.minRotate !== void 0 && t.rotation <= i.minRotate + R, n.rotateRight.element.disabled = i.maxRotate !== void 0 && t.rotation >= i.maxRotate - R);
|
|
2701
2874
|
}
|
|
2702
|
-
const
|
|
2875
|
+
const T = {
|
|
2703
2876
|
/** Attribute selection requested (cancelable). `detail`: `{ attribute, value }`. */
|
|
2704
2877
|
SELECT: "ui:select",
|
|
2705
2878
|
/** Attribute selection applied. `detail`: `{ attribute, value }`. */
|
|
@@ -2710,32 +2883,97 @@ const L = {
|
|
|
2710
2883
|
CONFIGURATION_CHANGE: "vd:configuration-change",
|
|
2711
2884
|
/** Configuration submitted (bubbles). `detail`: the resolved configuration handed to the host. */
|
|
2712
2885
|
CONFIGURATION_SUBMIT: "vd:configuration-submit"
|
|
2713
|
-
},
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
}
|
|
2719
|
-
function
|
|
2720
|
-
const
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2886
|
+
}, Te = {
|
|
2887
|
+
mm: 1,
|
|
2888
|
+
cm: 10,
|
|
2889
|
+
m: 1e3,
|
|
2890
|
+
in: 25.4
|
|
2891
|
+
}, he = 3;
|
|
2892
|
+
function Bi(n) {
|
|
2893
|
+
const e = n.stepMm / Te[n.displayUnit];
|
|
2894
|
+
for (let t = 0; t <= he; t++) {
|
|
2895
|
+
const i = e * 10 ** t;
|
|
2896
|
+
if (Math.abs(i - Math.round(i)) < 1e-9)
|
|
2897
|
+
return t;
|
|
2898
|
+
}
|
|
2899
|
+
return he;
|
|
2900
|
+
}
|
|
2901
|
+
function Vi(n, e, t) {
|
|
2902
|
+
const i = Bi(e), s = n / Te[e.displayUnit];
|
|
2903
|
+
return new Intl.NumberFormat(t, {
|
|
2904
|
+
minimumFractionDigits: i,
|
|
2905
|
+
maximumFractionDigits: i
|
|
2906
|
+
}).format(s);
|
|
2907
|
+
}
|
|
2908
|
+
function ji(n, e, t, i, s, o, r) {
|
|
2909
|
+
const a = m(), d = n.values.map((h) => Vi(Number(h), e, a)), u = n.values.find((h) => t.getValue(n.name, h)?.isSelected === !0) ?? n.defaultValue, f = new xi(n.values, {
|
|
2910
|
+
label: n.name,
|
|
2911
|
+
labels: d,
|
|
2912
|
+
unit: e.displayUnit,
|
|
2913
|
+
...u !== void 0 && { initialSelected: u }
|
|
2914
|
+
});
|
|
2915
|
+
return f.onSelect((h) => {
|
|
2916
|
+
s(n.name, h);
|
|
2917
|
+
}), f.onSettle((h) => {
|
|
2918
|
+
i.dispatch(T.SELECT, { attribute: n.name, value: h }, !0).defaultPrevented || o(n.name, h);
|
|
2919
|
+
}), r(n.name, (h) => {
|
|
2920
|
+
f.setSelected(h.value), i.dispatch(T.SELECTED, { attribute: n.name, value: h.value });
|
|
2921
|
+
}), {
|
|
2922
|
+
element: f.element,
|
|
2923
|
+
// No per-notch grey-out on the slider in v1: a range control cannot
|
|
2924
|
+
// honestly disable one notch. The exclusion still works, the way it
|
|
2925
|
+
// always does, on the other side: the viewer's selectable snapshot greys
|
|
2926
|
+
// the leg that cannot do this size. A slider-side treatment is a later
|
|
2927
|
+
// refinement, noted in task 040.
|
|
2928
|
+
setSelectable: () => {
|
|
2929
|
+
}
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
const Hi = 5;
|
|
2933
|
+
let qi = 0;
|
|
2934
|
+
function Q(n) {
|
|
2935
|
+
const e = n.replace(/([A-Z])/g, " $1").trim();
|
|
2936
|
+
return e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
2937
|
+
}
|
|
2938
|
+
function Gi(n, e, t, i, s, o) {
|
|
2939
|
+
const r = document.createElement("div");
|
|
2940
|
+
r.className = "vd-attribute", r.dataset.name = n.name;
|
|
2941
|
+
const a = document.createElement("span");
|
|
2942
|
+
a.className = "vd-attribute-label", a.textContent = Q(n.name), a.id = `vd-attribute-label-${qi++}`, r.appendChild(a), r.setAttribute("role", "group"), r.setAttribute("aria-labelledby", a.id);
|
|
2943
|
+
const d = (f) => {
|
|
2944
|
+
r.style.display = f ? "none" : "";
|
|
2945
|
+
}, u = n.dimension !== void 0 ? ji(
|
|
2946
|
+
n,
|
|
2947
|
+
n.dimension,
|
|
2948
|
+
e,
|
|
2949
|
+
t,
|
|
2950
|
+
s,
|
|
2951
|
+
i,
|
|
2952
|
+
o
|
|
2953
|
+
) : Zi(n, e, t, i, o);
|
|
2954
|
+
return r.appendChild(u.element), { element: r, setSelectable: u.setSelectable, setHidden: d };
|
|
2955
|
+
}
|
|
2956
|
+
function Zi(n, e, t, i, s) {
|
|
2957
|
+
const o = n.values.find(
|
|
2958
|
+
(d) => e.getValue(n.name, d)?.isSelected === !0
|
|
2959
|
+
), r = n.values.map(Q), a = n.values.length <= Hi ? new Ai(n.values, o, r) : new Ei(n.name, n.values, Q(n.name), o, r);
|
|
2960
|
+
return a.onSelect((d) => {
|
|
2961
|
+
t.dispatch(T.SELECT, { attribute: n.name, value: d }, !0).defaultPrevented || i(n.name, d);
|
|
2962
|
+
}), s(n.name, (d) => {
|
|
2963
|
+
a.setSelected(d.value), t.dispatch(T.SELECTED, { attribute: n.name, value: d.value });
|
|
2964
|
+
}), {
|
|
2965
|
+
element: a.element,
|
|
2966
|
+
setSelectable: (d) => {
|
|
2967
|
+
a.setEnabled(d);
|
|
2968
|
+
}
|
|
2969
|
+
};
|
|
2970
|
+
}
|
|
2971
|
+
const Wi = 80, Yi = 2500;
|
|
2972
|
+
class Qi {
|
|
2973
|
+
constructor(e, t = Yi) {
|
|
2974
|
+
this.configuration = e, this.resetMs = t, this.element = document.createElement("div"), this.element.className = "vd-commerce vd-hidden";
|
|
2737
2975
|
const i = document.createElement("div");
|
|
2738
|
-
i.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", i.append(this.priceEl, this.vatEl), this.button = new
|
|
2976
|
+
i.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", i.append(this.priceEl, this.vatEl), this.button = new v({ variant: "default", onClick: () => {
|
|
2739
2977
|
this.handleSubmit();
|
|
2740
2978
|
} }), this.button.element.classList.add("vd-cta", "vd-hidden"), this.element.append(i, this.button.element), this.unsubscribe = this.configuration.onRender(() => {
|
|
2741
2979
|
this.update();
|
|
@@ -2753,30 +2991,30 @@ class Vi {
|
|
|
2753
2991
|
/** Re-render from the facade. Called on every resolve and on submit-handler registration. */
|
|
2754
2992
|
update() {
|
|
2755
2993
|
this.renderPrice(this.configuration.current), this.renderButton();
|
|
2756
|
-
const
|
|
2757
|
-
this.element.classList.toggle("vd-hidden", !
|
|
2994
|
+
const e = this.configuration.current !== void 0 || this.configuration.submitEnabled;
|
|
2995
|
+
this.element.classList.toggle("vd-hidden", !e);
|
|
2758
2996
|
}
|
|
2759
2997
|
destroy() {
|
|
2760
2998
|
this.unsubscribe(), this.resetTimer !== void 0 && clearTimeout(this.resetTimer), this.element.remove();
|
|
2761
2999
|
}
|
|
2762
|
-
renderPrice(
|
|
2763
|
-
if (
|
|
3000
|
+
renderPrice(e) {
|
|
3001
|
+
if (e === void 0) {
|
|
2764
3002
|
this.priceEl.textContent = "", this.vatEl.textContent = "";
|
|
2765
3003
|
return;
|
|
2766
3004
|
}
|
|
2767
|
-
this.priceEl.textContent =
|
|
3005
|
+
this.priceEl.textContent = Ki(e.price, e.currency), this.vatEl.textContent = me(this.configuration.vatDisplay);
|
|
2768
3006
|
}
|
|
2769
3007
|
renderButton() {
|
|
2770
|
-
const
|
|
2771
|
-
this.button.element.classList.toggle("vd-hidden", !
|
|
3008
|
+
const e = this.configuration.submitEnabled;
|
|
3009
|
+
this.button.element.classList.toggle("vd-hidden", !e), e && this.state === "idle" && this.setButtonText(me(this.configuration.buttonLabel));
|
|
2772
3010
|
}
|
|
2773
3011
|
async handleSubmit() {
|
|
2774
3012
|
if (this.state !== "busy") {
|
|
2775
|
-
this.setState("busy",
|
|
3013
|
+
this.setState("busy", ti());
|
|
2776
3014
|
try {
|
|
2777
|
-
await this.configuration.submit(), this.setState("success",
|
|
3015
|
+
await this.configuration.submit(), this.setState("success", oi());
|
|
2778
3016
|
} catch {
|
|
2779
|
-
this.setState("failed",
|
|
3017
|
+
this.setState("failed", ci());
|
|
2780
3018
|
}
|
|
2781
3019
|
this.scheduleReset();
|
|
2782
3020
|
}
|
|
@@ -2786,43 +3024,43 @@ class Vi {
|
|
|
2786
3024
|
this.state = "idle", this.update();
|
|
2787
3025
|
}, this.resetMs);
|
|
2788
3026
|
}
|
|
2789
|
-
setState(
|
|
2790
|
-
this.state =
|
|
3027
|
+
setState(e, t) {
|
|
3028
|
+
this.state = e, this.element.dataset.submit = e, this.button.element.disabled = e === "busy", this.setButtonText(t);
|
|
2791
3029
|
}
|
|
2792
|
-
setButtonText(
|
|
2793
|
-
this.button.element.textContent =
|
|
3030
|
+
setButtonText(e) {
|
|
3031
|
+
this.button.element.textContent = e, this.button.element.setAttribute("aria-label", e);
|
|
2794
3032
|
}
|
|
2795
3033
|
}
|
|
2796
|
-
function
|
|
2797
|
-
return (n ?? "").slice(0,
|
|
3034
|
+
function me(n) {
|
|
3035
|
+
return (n ?? "").slice(0, Wi);
|
|
2798
3036
|
}
|
|
2799
|
-
function
|
|
3037
|
+
function Ki(n, e) {
|
|
2800
3038
|
try {
|
|
2801
|
-
const
|
|
2802
|
-
return
|
|
3039
|
+
const t = new Intl.NumberFormat(m(), { style: "currency", currency: e }), i = t.resolvedOptions().maximumFractionDigits ?? 2;
|
|
3040
|
+
return t.format(n / 10 ** i);
|
|
2803
3041
|
} catch {
|
|
2804
|
-
return `${
|
|
3042
|
+
return `${e} ${(n / 100).toFixed(2)}`;
|
|
2805
3043
|
}
|
|
2806
3044
|
}
|
|
2807
|
-
class
|
|
3045
|
+
class Re {
|
|
2808
3046
|
slot = null;
|
|
2809
3047
|
panel = null;
|
|
2810
|
-
attach(
|
|
2811
|
-
this.panel =
|
|
3048
|
+
attach(e, t) {
|
|
3049
|
+
this.panel = t, t.style.display = "none", this.slot = document.createElement("div"), this.slot.className = "vd-slot-bottom-left", this.slot.appendChild(t), e.appendChild(this.slot);
|
|
2812
3050
|
}
|
|
2813
|
-
setVisible(
|
|
2814
|
-
this.panel !== null && (this.panel.style.display =
|
|
3051
|
+
setVisible(e) {
|
|
3052
|
+
this.panel !== null && (this.panel.style.display = e ? "flex" : "none");
|
|
2815
3053
|
}
|
|
2816
3054
|
destroy() {
|
|
2817
3055
|
this.slot?.remove(), this.slot = null, this.panel = null;
|
|
2818
3056
|
}
|
|
2819
3057
|
}
|
|
2820
|
-
const
|
|
2821
|
-
class
|
|
3058
|
+
const Xi = 572;
|
|
3059
|
+
class Ji {
|
|
2822
3060
|
/** @param actionBarSlot The shared corner slot the AR/fullscreen buttons live in — the
|
|
2823
3061
|
* "open configurator" toggle joins them there instead of floating as its own overlay. */
|
|
2824
|
-
constructor(
|
|
2825
|
-
this.actionBarSlot =
|
|
3062
|
+
constructor(e) {
|
|
3063
|
+
this.actionBarSlot = e;
|
|
2826
3064
|
}
|
|
2827
3065
|
actionBarSlot;
|
|
2828
3066
|
element = null;
|
|
@@ -2834,71 +3072,71 @@ class qi {
|
|
|
2834
3072
|
collapsible = !1;
|
|
2835
3073
|
expanded = !0;
|
|
2836
3074
|
visible = !1;
|
|
2837
|
-
attach(
|
|
2838
|
-
this.container =
|
|
3075
|
+
attach(e, t) {
|
|
3076
|
+
this.container = e, t.classList.add("vd-attributes-sidebar"), this.closeButton = new v({
|
|
2839
3077
|
variant: "ghost",
|
|
2840
3078
|
size: "icon-sm",
|
|
2841
|
-
label:
|
|
2842
|
-
icon:
|
|
3079
|
+
label: _n(),
|
|
3080
|
+
icon: b.close({ size: 18 }),
|
|
2843
3081
|
onClick: () => {
|
|
2844
3082
|
this.expanded = !1, this.render();
|
|
2845
3083
|
}
|
|
2846
3084
|
});
|
|
2847
3085
|
const i = document.createElement("div");
|
|
2848
|
-
i.className = "vd-sidebar-header", i.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(
|
|
3086
|
+
i.className = "vd-sidebar-header", i.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(t), this.element = document.createElement("div"), this.element.className = "vd-sidebar vd-hidden", this.element.append(i, this.body), e.appendChild(this.element), this.openButton = new v({
|
|
2849
3087
|
variant: "outline",
|
|
2850
3088
|
size: "icon",
|
|
2851
|
-
label:
|
|
2852
|
-
icon:
|
|
3089
|
+
label: yn(),
|
|
3090
|
+
icon: b.configurator({ size: 18 }),
|
|
2853
3091
|
onClick: () => {
|
|
2854
3092
|
this.expanded = !0, this.render();
|
|
2855
3093
|
}
|
|
2856
3094
|
}), this.openButton.element.classList.add("vd-configurator-toggle", "vd-hidden"), this.actionBarSlot.appendChild(this.openButton.element), this.observe();
|
|
2857
3095
|
}
|
|
2858
|
-
setVisible(
|
|
2859
|
-
this.visible =
|
|
3096
|
+
setVisible(e) {
|
|
3097
|
+
this.visible = e, this.render();
|
|
2860
3098
|
}
|
|
2861
3099
|
destroy() {
|
|
2862
3100
|
this.observer?.disconnect(), this.observer = null, this.openButton?.element.remove(), this.element?.remove(), this.container?.classList.remove("vd-layout-sidebar-right", "vd-layout-sidebar-permanent"), this.container = null;
|
|
2863
3101
|
}
|
|
2864
3102
|
observe() {
|
|
2865
|
-
typeof ResizeObserver > "u" || this.container === null || (this.observer = new ResizeObserver((
|
|
2866
|
-
const
|
|
2867
|
-
this.setCollapsible(
|
|
3103
|
+
typeof ResizeObserver > "u" || this.container === null || (this.observer = new ResizeObserver((e) => {
|
|
3104
|
+
const t = e[0]?.contentRect.width ?? 0;
|
|
3105
|
+
this.setCollapsible(t > 0 && t < Xi);
|
|
2868
3106
|
}), this.observer.observe(this.container));
|
|
2869
3107
|
}
|
|
2870
|
-
setCollapsible(
|
|
2871
|
-
|
|
3108
|
+
setCollapsible(e) {
|
|
3109
|
+
e !== this.collapsible && (this.collapsible = e, this.expanded = !e, this.render());
|
|
2872
3110
|
}
|
|
2873
3111
|
render() {
|
|
2874
3112
|
if (this.element === null || this.openButton === null || this.closeButton === null || this.container === null)
|
|
2875
3113
|
return;
|
|
2876
|
-
const
|
|
2877
|
-
this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed",
|
|
3114
|
+
const e = this.visible && this.expanded, t = this.visible && !this.expanded;
|
|
3115
|
+
this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed", t), this.openButton.element.classList.toggle("vd-hidden", !t), this.closeButton.element.style.display = this.collapsible ? "" : "none", this.container.classList.toggle("vd-layout-sidebar-right", e), this.container.classList.toggle("vd-layout-sidebar-permanent", e && !this.collapsible);
|
|
2878
3116
|
}
|
|
2879
3117
|
}
|
|
2880
|
-
class
|
|
2881
|
-
attach(
|
|
3118
|
+
class es {
|
|
3119
|
+
attach(e, t) {
|
|
2882
3120
|
}
|
|
2883
|
-
setVisible(
|
|
3121
|
+
setVisible(e) {
|
|
2884
3122
|
}
|
|
2885
3123
|
destroy() {
|
|
2886
3124
|
}
|
|
2887
3125
|
}
|
|
2888
|
-
const
|
|
2889
|
-
"inframe-bottom-left": () => new
|
|
2890
|
-
"sidebar-right": (n) => new
|
|
2891
|
-
hidden: () => new
|
|
3126
|
+
const ts = {
|
|
3127
|
+
"inframe-bottom-left": () => new Re(),
|
|
3128
|
+
"sidebar-right": (n) => new Ji(n),
|
|
3129
|
+
hidden: () => new es()
|
|
2892
3130
|
};
|
|
2893
|
-
function
|
|
2894
|
-
return (
|
|
3131
|
+
function ns(n, e) {
|
|
3132
|
+
return (ts[n ?? ""] ?? (() => new Re()))(e);
|
|
2895
3133
|
}
|
|
2896
|
-
const
|
|
3134
|
+
const G = w.fontFamily.sans.join(", "), Z = `
|
|
2897
3135
|
position: absolute;
|
|
2898
3136
|
display: flex;
|
|
2899
3137
|
z-index: 10;
|
|
2900
3138
|
transition: inset-inline-end 0.18s ease;
|
|
2901
|
-
`,
|
|
3139
|
+
`, is = `
|
|
2902
3140
|
/* Override browser's default black fullscreen backdrop */
|
|
2903
3141
|
.vd-container:fullscreen {
|
|
2904
3142
|
background: oklch(100% 0 0);
|
|
@@ -2906,7 +3144,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2906
3144
|
|
|
2907
3145
|
/* Layout slots — four corners */
|
|
2908
3146
|
.vd-slot-top-right {
|
|
2909
|
-
${
|
|
3147
|
+
${Z}
|
|
2910
3148
|
inset-block-start: ${l[3]};
|
|
2911
3149
|
inset-inline-end: ${l[3]};
|
|
2912
3150
|
flex-direction: column;
|
|
@@ -2915,7 +3153,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2915
3153
|
}
|
|
2916
3154
|
|
|
2917
3155
|
.vd-slot-bottom-left {
|
|
2918
|
-
${
|
|
3156
|
+
${Z}
|
|
2919
3157
|
inset-block-end: ${l[3]};
|
|
2920
3158
|
inset-inline-start: ${l[3]};
|
|
2921
3159
|
flex-direction: column;
|
|
@@ -2924,7 +3162,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2924
3162
|
}
|
|
2925
3163
|
|
|
2926
3164
|
.vd-slot-bottom-right {
|
|
2927
|
-
${
|
|
3165
|
+
${Z}
|
|
2928
3166
|
inset-block-end: ${l[3]};
|
|
2929
3167
|
inset-inline-end: ${l[3]};
|
|
2930
3168
|
flex-direction: row;
|
|
@@ -2970,7 +3208,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2970
3208
|
border-radius: ${l[3]};
|
|
2971
3209
|
padding: ${l[3]};
|
|
2972
3210
|
box-shadow: 0 ${l[1]} ${l[4]} color-mix(in oklch, ${p.neutral[900]} 6%, transparent);
|
|
2973
|
-
font-family: ${
|
|
3211
|
+
font-family: ${G};
|
|
2974
3212
|
}
|
|
2975
3213
|
|
|
2976
3214
|
.vd-attribute {
|
|
@@ -2986,7 +3224,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2986
3224
|
color: ${p.neutral[500]};
|
|
2987
3225
|
text-transform: uppercase;
|
|
2988
3226
|
letter-spacing: 0.05em;
|
|
2989
|
-
font-family: ${
|
|
3227
|
+
font-family: ${G};
|
|
2990
3228
|
}
|
|
2991
3229
|
|
|
2992
3230
|
/* sidebar-right layout — a docked, full-height right panel */
|
|
@@ -3068,7 +3306,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
3068
3306
|
gap: ${l[2]};
|
|
3069
3307
|
padding-block-start: ${l[3]};
|
|
3070
3308
|
border-block-start: 1px solid color-mix(in oklch, ${p.neutral[900]} 8%, transparent);
|
|
3071
|
-
font-family: ${
|
|
3309
|
+
font-family: ${G};
|
|
3072
3310
|
}
|
|
3073
3311
|
|
|
3074
3312
|
.vd-commerce-price {
|
|
@@ -3101,17 +3339,17 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
3101
3339
|
}
|
|
3102
3340
|
|
|
3103
3341
|
`;
|
|
3104
|
-
function
|
|
3105
|
-
if (
|
|
3342
|
+
function ss() {
|
|
3343
|
+
if (xe(), document.getElementById("vd-styles") !== null)
|
|
3106
3344
|
return;
|
|
3107
3345
|
const n = document.createElement("style");
|
|
3108
|
-
n.id = "vd-styles", n.textContent =
|
|
3346
|
+
n.id = "vd-styles", n.textContent = is, document.head.appendChild(n);
|
|
3109
3347
|
}
|
|
3110
|
-
function
|
|
3111
|
-
const
|
|
3112
|
-
|
|
3348
|
+
function os(n, e) {
|
|
3349
|
+
const t = document.createElement("a");
|
|
3350
|
+
t.href = `data:image/png;base64,${n}`, t.download = e, t.click();
|
|
3113
3351
|
}
|
|
3114
|
-
class
|
|
3352
|
+
class rs {
|
|
3115
3353
|
options;
|
|
3116
3354
|
settings = {};
|
|
3117
3355
|
container = null;
|
|
@@ -3127,11 +3365,11 @@ class Xi {
|
|
|
3127
3365
|
lastSelectable = null;
|
|
3128
3366
|
layout = null;
|
|
3129
3367
|
commerce = null;
|
|
3130
|
-
constructor(
|
|
3131
|
-
this.options =
|
|
3368
|
+
constructor(e) {
|
|
3369
|
+
this.options = e;
|
|
3132
3370
|
}
|
|
3133
|
-
attach(
|
|
3134
|
-
|
|
3371
|
+
attach(e) {
|
|
3372
|
+
ss(), this.container = e, this.loading = new Fi(e), this.slots.topRight = this.createSlot(e, "vd-slot-top-right"), this.slots.bottomRight = this.createSlot(e, "vd-slot-bottom-right");
|
|
3135
3373
|
}
|
|
3136
3374
|
onReady() {
|
|
3137
3375
|
this.loading?.hide(), this.loading = null, this.mountToolbar(), this.cameraControls !== null && (this.cameraControls.element.style.display = "flex"), this.layout?.setVisible(!0);
|
|
@@ -3139,10 +3377,10 @@ class Xi {
|
|
|
3139
3377
|
mountToolbar() {
|
|
3140
3378
|
if (this.actionBar !== null || this.slots.bottomRight === null || this.container === null)
|
|
3141
3379
|
return;
|
|
3142
|
-
const
|
|
3143
|
-
this.actionBar = new
|
|
3380
|
+
const e = typeof this.container.requestFullscreen == "function";
|
|
3381
|
+
this.actionBar = new $i({
|
|
3144
3382
|
onAr: this.options.onAr,
|
|
3145
|
-
onFullscreen:
|
|
3383
|
+
onFullscreen: e ? () => {
|
|
3146
3384
|
this.toggleFullscreen();
|
|
3147
3385
|
} : void 0
|
|
3148
3386
|
}), this.actionBar.applySettings(this.settings), this.slots.bottomRight.appendChild(this.actionBar.element), this.syncScreenshotButton(), this.placeScreenshotButton();
|
|
@@ -3150,29 +3388,36 @@ class Xi {
|
|
|
3150
3388
|
toggleFullscreen() {
|
|
3151
3389
|
this.container !== null && (document.fullscreenElement !== null ? document.exitFullscreen() : (this.options.onFullscreenEnter?.(), this.container.requestFullscreen()));
|
|
3152
3390
|
}
|
|
3153
|
-
updateProgress(
|
|
3154
|
-
this.loading?.updateProgress(
|
|
3391
|
+
updateProgress(e, t) {
|
|
3392
|
+
this.loading?.updateProgress(e, t);
|
|
3155
3393
|
}
|
|
3156
|
-
showError(
|
|
3157
|
-
this.loading?.showError(
|
|
3394
|
+
showError(e) {
|
|
3395
|
+
this.loading?.showError(e);
|
|
3158
3396
|
}
|
|
3159
|
-
applyViewerSettings(
|
|
3160
|
-
this.settings =
|
|
3397
|
+
applyViewerSettings(e) {
|
|
3398
|
+
this.settings = e, e.language !== void 0 && Se(e.language, { reload: !1 }), this.syncScreenshotButton(), this.actionBar?.applySettings(e), this.cameraControls !== null && (this.cameraControls.element.style.display = e.cameraControls === !0 ? "flex" : "none"), this.placeScreenshotButton();
|
|
3161
3399
|
}
|
|
3162
|
-
renderAttributeControls(
|
|
3163
|
-
if (!(this.container === null || this.slots.topRight === null || this.slots.bottomRight === null) && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.settings.cameraControls === !0 && (this.cameraControls = new z(
|
|
3400
|
+
renderAttributeControls(e, t) {
|
|
3401
|
+
if (!(this.container === null || this.slots.topRight === null || this.slots.bottomRight === null) && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.settings.cameraControls === !0 && (this.cameraControls = new z(
|
|
3402
|
+
this.options.cameraApi,
|
|
3403
|
+
this.options.cameraPositionApi
|
|
3404
|
+
), this.cameraControls.element.style.display = "none", this.slots.topRight.appendChild(this.cameraControls.element)), this.placeScreenshotButton(), t.length !== 0)) {
|
|
3164
3405
|
this.attributes = document.createElement("div"), this.attributes.className = "vd-attributes", this.groupHandles = /* @__PURE__ */ new Map();
|
|
3165
|
-
for (const i of
|
|
3166
|
-
const
|
|
3406
|
+
for (const i of t) {
|
|
3407
|
+
const s = Gi(
|
|
3167
3408
|
i,
|
|
3168
|
-
|
|
3409
|
+
e,
|
|
3169
3410
|
this.options.eventBus,
|
|
3170
3411
|
this.options.onSelect,
|
|
3412
|
+
this.options.onSelectTransient,
|
|
3171
3413
|
this.options.onSubscribe
|
|
3172
3414
|
);
|
|
3173
|
-
this.groupHandles.set(i.name,
|
|
3415
|
+
this.groupHandles.set(i.name, s), this.attributes.appendChild(s.element);
|
|
3174
3416
|
}
|
|
3175
|
-
this.commerce = new
|
|
3417
|
+
this.commerce = new Qi(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = ns(
|
|
3418
|
+
this.settings.configuratorLayout,
|
|
3419
|
+
this.slots.bottomRight
|
|
3420
|
+
), this.layout.attach(this.container, this.attributes), this.lastSelectable !== null && this.applySelectable(this.lastSelectable);
|
|
3176
3421
|
}
|
|
3177
3422
|
}
|
|
3178
3423
|
/**
|
|
@@ -3181,11 +3426,11 @@ class Xi {
|
|
|
3181
3426
|
* does not name are unrestricted. The interface renders, it never knows
|
|
3182
3427
|
* the exclusion rules (kiesbaarheid live, binding-studio task 17).
|
|
3183
3428
|
*/
|
|
3184
|
-
applySelectable(
|
|
3185
|
-
this.lastSelectable =
|
|
3186
|
-
for (const [
|
|
3187
|
-
const
|
|
3188
|
-
i.setSelectable(
|
|
3429
|
+
applySelectable(e) {
|
|
3430
|
+
this.lastSelectable = e;
|
|
3431
|
+
for (const [t, i] of this.groupHandles) {
|
|
3432
|
+
const s = e.find((o) => o.name === t);
|
|
3433
|
+
i.setSelectable(s?.selectable ?? null), i.setHidden(s?.hidden === !0);
|
|
3189
3434
|
}
|
|
3190
3435
|
}
|
|
3191
3436
|
get viewerSettings() {
|
|
@@ -3197,126 +3442,141 @@ class Xi {
|
|
|
3197
3442
|
}
|
|
3198
3443
|
destroy() {
|
|
3199
3444
|
this.loading?.destroy(), this.screenshotBtn?.element.remove(), this.actionBar?.destroy(), this.actionBar?.element.remove(), this.cameraControls?.element.remove(), this.teardownConfigurator();
|
|
3200
|
-
for (const
|
|
3201
|
-
|
|
3445
|
+
for (const e of Object.values(this.slots))
|
|
3446
|
+
e?.remove();
|
|
3202
3447
|
this.container = null;
|
|
3203
3448
|
}
|
|
3204
|
-
createSlot(
|
|
3449
|
+
createSlot(e, t) {
|
|
3205
3450
|
const i = document.createElement("div");
|
|
3206
|
-
return i.className =
|
|
3451
|
+
return i.className = t, e.appendChild(i), i;
|
|
3207
3452
|
}
|
|
3208
3453
|
syncScreenshotButton() {
|
|
3209
|
-
const
|
|
3210
|
-
|
|
3454
|
+
const e = this.settings.screenshot === !0;
|
|
3455
|
+
e && this.screenshotBtn === null && (this.screenshotBtn = new v({
|
|
3211
3456
|
variant: "outline",
|
|
3212
3457
|
size: "icon",
|
|
3213
|
-
label:
|
|
3214
|
-
icon:
|
|
3458
|
+
label: fn(),
|
|
3459
|
+
icon: b.screenshot(),
|
|
3215
3460
|
onClick: () => {
|
|
3216
|
-
this.options.snapshotApi.take("snapshot.png").onDeveloped(({ data:
|
|
3217
|
-
|
|
3461
|
+
this.options.snapshotApi.take("snapshot.png").onDeveloped(({ data: t, filename: i }) => {
|
|
3462
|
+
os(t, i);
|
|
3218
3463
|
});
|
|
3219
3464
|
}
|
|
3220
|
-
})), !
|
|
3465
|
+
})), !e && this.screenshotBtn !== null && (this.screenshotBtn.element.remove(), this.screenshotBtn = null);
|
|
3221
3466
|
}
|
|
3222
3467
|
placeScreenshotButton() {
|
|
3223
3468
|
this.screenshotBtn === null || this.slots.topRight === null || (this.cameraControls !== null ? this.cameraControls.element.appendChild(this.screenshotBtn.element) : this.slots.topRight.appendChild(this.screenshotBtn.element));
|
|
3224
3469
|
}
|
|
3225
3470
|
}
|
|
3226
|
-
const
|
|
3227
|
-
class
|
|
3471
|
+
const as = {};
|
|
3472
|
+
class ls {
|
|
3228
3473
|
defaultServer = "https://server.virtualdisplay.io";
|
|
3229
3474
|
options;
|
|
3230
3475
|
serverHost;
|
|
3231
3476
|
extraParams;
|
|
3232
|
-
constructor(
|
|
3233
|
-
this.options =
|
|
3477
|
+
constructor(e, t, i) {
|
|
3478
|
+
this.options = e, this.serverHost = t, this.extraParams = i;
|
|
3234
3479
|
}
|
|
3235
3480
|
/**
|
|
3236
3481
|
* Create container and iframe, attach to parent element
|
|
3237
3482
|
*/
|
|
3238
3483
|
create() {
|
|
3239
|
-
const
|
|
3240
|
-
return
|
|
3484
|
+
const e = this.createContainer(), t = this.createIframe();
|
|
3485
|
+
return e.appendChild(t), this.attachToParent(e), { container: e, iframe: t };
|
|
3241
3486
|
}
|
|
3242
3487
|
createContainer() {
|
|
3243
|
-
const
|
|
3244
|
-
return
|
|
3488
|
+
const e = document.createElement("div");
|
|
3489
|
+
return e.className = "vd-container", Object.assign(e.style, {
|
|
3245
3490
|
position: "relative",
|
|
3246
3491
|
width: "100%",
|
|
3247
3492
|
height: "100%",
|
|
3248
3493
|
overflow: "hidden"
|
|
3249
|
-
}),
|
|
3494
|
+
}), e;
|
|
3250
3495
|
}
|
|
3251
3496
|
createIframe() {
|
|
3252
|
-
const
|
|
3253
|
-
return
|
|
3497
|
+
const e = document.createElement("iframe");
|
|
3498
|
+
return e.src = this.buildUrl(), e.setAttribute("allow", "xr-spatial-tracking; fullscreen"), e;
|
|
3254
3499
|
}
|
|
3255
|
-
attachToParent(
|
|
3256
|
-
this.getParentElement().appendChild(
|
|
3500
|
+
attachToParent(e) {
|
|
3501
|
+
this.getParentElement().appendChild(e);
|
|
3257
3502
|
}
|
|
3258
3503
|
buildUrl() {
|
|
3259
|
-
const
|
|
3260
|
-
|
|
3261
|
-
for (const [i,
|
|
3262
|
-
|
|
3263
|
-
return
|
|
3504
|
+
const e = this.getServerUrl(), t = new URL(e);
|
|
3505
|
+
this.setAddressParams(t), this.options.language !== void 0 && t.searchParams.set("language", this.options.language), this.options.session !== void 0 && t.searchParams.set("session", this.options.session), this.options.debug === !0 && t.searchParams.set("debug", "true"), this.options.traceparent !== void 0 && t.searchParams.set("traceparent", this.options.traceparent);
|
|
3506
|
+
for (const [i, s] of Object.entries(this.extraParams ?? {}))
|
|
3507
|
+
t.searchParams.set(i, s);
|
|
3508
|
+
return t.toString();
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* Put the address form on the URL. `app` names an app row; the
|
|
3512
|
+
* `license`/`model` pair resolves to the model's default app. When both are
|
|
3513
|
+
* given, `app` wins and the pair is ignored with a warning, so adding `app`
|
|
3514
|
+
* to an existing integration is additive rather than a swap.
|
|
3515
|
+
*/
|
|
3516
|
+
setAddressParams(e) {
|
|
3517
|
+
if (this.options.app === void 0) {
|
|
3518
|
+
e.searchParams.set("license", this.options.license), e.searchParams.set("model", this.options.model);
|
|
3519
|
+
return;
|
|
3520
|
+
}
|
|
3521
|
+
e.searchParams.set("app", this.options.app), (this.options.license !== void 0 || this.options.model !== void 0) && C.warn("Both `app` and `license`/`model` were supplied: `app` wins, the pair was ignored");
|
|
3264
3522
|
}
|
|
3265
3523
|
getServerUrl() {
|
|
3266
3524
|
if (this.serverHost !== void 0)
|
|
3267
3525
|
return this.serverHost;
|
|
3268
|
-
if (
|
|
3526
|
+
if (as?.VITE_VIRTUALDISPLAY_SERVER_HOST === void 0)
|
|
3269
3527
|
return this.defaultServer;
|
|
3270
3528
|
}
|
|
3271
3529
|
getParentElement() {
|
|
3272
3530
|
if (typeof this.options.parent != "string")
|
|
3273
3531
|
return this.options.parent;
|
|
3274
|
-
const
|
|
3275
|
-
if (
|
|
3276
|
-
throw
|
|
3277
|
-
return
|
|
3532
|
+
const e = document.querySelector(this.options.parent);
|
|
3533
|
+
if (e === null)
|
|
3534
|
+
throw g.parentNotFound(this.options.parent);
|
|
3535
|
+
return e;
|
|
3278
3536
|
}
|
|
3279
3537
|
}
|
|
3280
|
-
function
|
|
3281
|
-
const { messenger:
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
}),
|
|
3285
|
-
|
|
3286
|
-
}),
|
|
3287
|
-
|
|
3288
|
-
}),
|
|
3289
|
-
|
|
3290
|
-
}),
|
|
3291
|
-
|
|
3292
|
-
}),
|
|
3293
|
-
|
|
3294
|
-
}),
|
|
3295
|
-
|
|
3296
|
-
}),
|
|
3297
|
-
|
|
3298
|
-
}),
|
|
3299
|
-
}
|
|
3300
|
-
function
|
|
3301
|
-
const { messenger:
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
}),
|
|
3305
|
-
|
|
3306
|
-
}),
|
|
3307
|
-
|
|
3308
|
-
}),
|
|
3309
|
-
|
|
3538
|
+
function cs(n) {
|
|
3539
|
+
const { messenger: e } = n;
|
|
3540
|
+
e.on(c.HANDSHAKE, (t) => {
|
|
3541
|
+
Me(t) && (C.info("Server handshake received, flushing publisher queue"), e.markReady());
|
|
3542
|
+
}), e.on(c.SESSION, (t) => {
|
|
3543
|
+
ze(t) && n.onSession(t.sessionId);
|
|
3544
|
+
}), e.on(c.MUTATION, (t) => {
|
|
3545
|
+
Fe(t) && (n.attributes.handleMutationResult(t), n.configuration.handleSelectionChanged(n.attributes.getSelection()));
|
|
3546
|
+
}), e.on(c.SNAPSHOT, (t) => {
|
|
3547
|
+
$e(t) && n.snapshot.handleSnapshotResult(t);
|
|
3548
|
+
}), e.on(c.CAMERA, (t) => {
|
|
3549
|
+
De(t) && n.cameraPosition.handlePositionUpdate(t);
|
|
3550
|
+
}), e.on(c.LOADING_INDICATOR, (t) => {
|
|
3551
|
+
Be(t) && (t.error !== void 0 ? n.ui.showError(t.error) : n.ui.updateProgress(t.progress, t.phase));
|
|
3552
|
+
}), e.on(c.CONFIG, (t) => {
|
|
3553
|
+
He(t) && n.applyConfig(t);
|
|
3554
|
+
}), e.on(c.MAPPING, (t) => {
|
|
3555
|
+
Ue(t) && (n.attributes.handleMappingReceived(t), n.configuration.handleSelectionChanged(n.attributes.getSelection()), n.ui.renderAttributeControls(n.attributes, t.attributes), n.readyStateTracker.handleMappingReceived());
|
|
3556
|
+
}), ds(n);
|
|
3557
|
+
}
|
|
3558
|
+
function ds(n) {
|
|
3559
|
+
const { messenger: e } = n;
|
|
3560
|
+
e.on(c.FOCUS, (t) => {
|
|
3561
|
+
qe(t) && n.focus.handleStateReceived(t);
|
|
3562
|
+
}), e.on(c.PRICING, (t) => {
|
|
3563
|
+
Ge(t) && n.configuration.handlePricingReceived(t.pricing);
|
|
3564
|
+
}), e.on(c.SYNC, (t) => {
|
|
3565
|
+
Ve(t) && n.onSync(t.connected);
|
|
3566
|
+
}), e.on(c.SELECTABLE, (t) => {
|
|
3567
|
+
je(t) && (n.selectable.handleSnapshot(t), n.ui.applySelectable(t.attributes));
|
|
3568
|
+
}), e.on(c.APP_RESOLVED, (t) => {
|
|
3569
|
+
Pe(t) && n.onAppResolved(t);
|
|
3310
3570
|
});
|
|
3311
3571
|
}
|
|
3312
|
-
class
|
|
3572
|
+
class us {
|
|
3313
3573
|
ready = !1;
|
|
3314
3574
|
onReady;
|
|
3315
|
-
constructor(
|
|
3316
|
-
this.onReady =
|
|
3575
|
+
constructor(e) {
|
|
3576
|
+
this.onReady = e;
|
|
3317
3577
|
}
|
|
3318
3578
|
handleMappingReceived() {
|
|
3319
|
-
this.ready || (this.ready = !0,
|
|
3579
|
+
this.ready || (this.ready = !0, C.info("Mapping received from server, client is now ready"), this.onReady?.());
|
|
3320
3580
|
}
|
|
3321
3581
|
get isReady() {
|
|
3322
3582
|
return this.ready;
|
|
@@ -3325,7 +3585,7 @@ class io {
|
|
|
3325
3585
|
this.ready = !1;
|
|
3326
3586
|
}
|
|
3327
3587
|
}
|
|
3328
|
-
class
|
|
3588
|
+
class hs {
|
|
3329
3589
|
attributes;
|
|
3330
3590
|
selectableState;
|
|
3331
3591
|
readyStateTracker;
|
|
@@ -3351,50 +3611,59 @@ class oo {
|
|
|
3351
3611
|
mutationFailedCallbacks = [];
|
|
3352
3612
|
/** The viewer's tracking session id, once the server announces it (SESSION). */
|
|
3353
3613
|
viewerSessionId;
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3614
|
+
/** Which app the viewer resolved, once reported (APP_RESOLVED). */
|
|
3615
|
+
resolvedApp;
|
|
3616
|
+
appResolvedCallbacks = [];
|
|
3617
|
+
constructor(e, t) {
|
|
3618
|
+
this.options = e;
|
|
3619
|
+
const i = t ?? {};
|
|
3620
|
+
this.serverHost = i.serverHost, this.iframeParams = i.iframeParams, this.initializeLogging(), this.messenger = new Ze(
|
|
3358
3621
|
() => this.iframe?.contentWindow ?? null,
|
|
3359
3622
|
i.messengerOptions
|
|
3360
3623
|
);
|
|
3361
|
-
const
|
|
3362
|
-
this.messenger.send(
|
|
3624
|
+
const s = (o) => {
|
|
3625
|
+
this.messenger.send(o);
|
|
3363
3626
|
};
|
|
3364
|
-
this.attributes = new
|
|
3365
|
-
this.notifyMutationFailed(
|
|
3366
|
-
}), this.selectableState = new
|
|
3367
|
-
this.dispatchFocusChange(
|
|
3368
|
-
}), this.configurationApi = new
|
|
3369
|
-
(
|
|
3370
|
-
this.dispatchConfigurationChange(
|
|
3627
|
+
this.attributes = new pt(s, (o, r) => {
|
|
3628
|
+
this.notifyMutationFailed(o, r);
|
|
3629
|
+
}), this.selectableState = new ft(), this.snapshotApi = new _t(s), this.annotationsApi = new We(s), this.cameraApi = new gt(s), this.cameraPositionApi = new bt(), this.focusApi = new wt(s, (o) => {
|
|
3630
|
+
this.dispatchFocusChange(o);
|
|
3631
|
+
}), this.configurationApi = new St(
|
|
3632
|
+
(o) => {
|
|
3633
|
+
this.dispatchConfigurationChange(o);
|
|
3371
3634
|
},
|
|
3372
|
-
(
|
|
3373
|
-
this.dispatchConfigurationSubmit(
|
|
3635
|
+
(o) => {
|
|
3636
|
+
this.dispatchConfigurationSubmit(o);
|
|
3374
3637
|
}
|
|
3375
|
-
), this.eventBus = new
|
|
3638
|
+
), this.eventBus = new kt(), this.arActivation = i.createArActivation?.(s), this.syncTracker = i.createSyncTracker?.(), this.readyStateTracker = new us(() => {
|
|
3376
3639
|
this.notifyReady();
|
|
3377
|
-
});
|
|
3378
|
-
|
|
3379
|
-
|
|
3640
|
+
}), this.ui = this.createStandardInterface(), this.wireIncomingMessages(), i.registerHandlers?.(this.messenger, s), this.messenger.start(), this.createAndConnectIframe();
|
|
3641
|
+
}
|
|
3642
|
+
/** The configurator UI, every callback bridging it to the facade that owns the action. */
|
|
3643
|
+
createStandardInterface() {
|
|
3644
|
+
const e = this.arActivation;
|
|
3645
|
+
return new rs({
|
|
3380
3646
|
snapshotApi: this.snapshotApi,
|
|
3381
3647
|
cameraApi: this.cameraApi,
|
|
3382
3648
|
cameraPositionApi: this.cameraPositionApi,
|
|
3383
3649
|
eventBus: this.eventBus,
|
|
3384
3650
|
configuration: this.configurationApi,
|
|
3385
|
-
onSelect: (
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3651
|
+
onSelect: (t, i) => this.attributes.select(t, i),
|
|
3652
|
+
onSelectTransient: (t, i) => this.attributes.selectTransient(t, i),
|
|
3653
|
+
onSubscribe: (t, i) => this.attributes.onChange(t, i),
|
|
3654
|
+
...e !== void 0 && {
|
|
3655
|
+
onAr: () => {
|
|
3656
|
+
e.activate();
|
|
3657
|
+
}
|
|
3658
|
+
},
|
|
3390
3659
|
onFullscreenEnter: () => {
|
|
3391
3660
|
this.trackFullscreen();
|
|
3392
3661
|
}
|
|
3393
|
-
})
|
|
3662
|
+
});
|
|
3394
3663
|
}
|
|
3395
3664
|
/** Wire the inbound viewer protocol to the facades. */
|
|
3396
3665
|
wireIncomingMessages() {
|
|
3397
|
-
|
|
3666
|
+
cs({
|
|
3398
3667
|
messenger: this.messenger,
|
|
3399
3668
|
attributes: this.attributes,
|
|
3400
3669
|
selectable: this.selectableState,
|
|
@@ -3404,113 +3673,131 @@ class oo {
|
|
|
3404
3673
|
focus: this.focusApi,
|
|
3405
3674
|
ui: this.ui,
|
|
3406
3675
|
readyStateTracker: this.readyStateTracker,
|
|
3407
|
-
applyConfig: (
|
|
3408
|
-
this.handleConfig(
|
|
3676
|
+
applyConfig: (e) => {
|
|
3677
|
+
this.handleConfig(e);
|
|
3678
|
+
},
|
|
3679
|
+
onSession: (e) => {
|
|
3680
|
+
this.handleSession(e);
|
|
3409
3681
|
},
|
|
3410
|
-
|
|
3411
|
-
this.
|
|
3682
|
+
onSync: (e) => {
|
|
3683
|
+
this.syncTracker?.handleSync(e);
|
|
3412
3684
|
},
|
|
3413
|
-
|
|
3414
|
-
this.
|
|
3685
|
+
onAppResolved: (e) => {
|
|
3686
|
+
this.handleAppResolved({
|
|
3687
|
+
appType: e.appType,
|
|
3688
|
+
name: e.name,
|
|
3689
|
+
...e.slug !== void 0 && { slug: e.slug },
|
|
3690
|
+
...e.submit !== void 0 && { submit: e.submit }
|
|
3691
|
+
});
|
|
3415
3692
|
}
|
|
3416
3693
|
});
|
|
3417
3694
|
}
|
|
3695
|
+
/** Store the resolved app and notify every registered `onAppResolved` callback. */
|
|
3696
|
+
handleAppResolved(e) {
|
|
3697
|
+
this.resolvedApp = e;
|
|
3698
|
+
for (const t of this.appResolvedCallbacks)
|
|
3699
|
+
t(e);
|
|
3700
|
+
}
|
|
3418
3701
|
/** Store the tracking session id and hand it to the AR flow, which waits on it for the QR. */
|
|
3419
|
-
handleSession(
|
|
3420
|
-
this.viewerSessionId =
|
|
3702
|
+
handleSession(e) {
|
|
3703
|
+
this.viewerSessionId = e, this.arActivation?.onSession(e);
|
|
3421
3704
|
}
|
|
3422
3705
|
/** Forward a failed mutation to every registered `onMutationFailed` callback. */
|
|
3423
|
-
notifyMutationFailed(
|
|
3706
|
+
notifyMutationFailed(e, t) {
|
|
3424
3707
|
for (const i of this.mutationFailedCallbacks)
|
|
3425
|
-
i({ attribute:
|
|
3708
|
+
i({ attribute: e, value: t });
|
|
3426
3709
|
}
|
|
3427
3710
|
/** Flush the queued `onReady` callbacks once, then let the standard interface know. */
|
|
3428
3711
|
notifyReady() {
|
|
3429
|
-
const
|
|
3712
|
+
const e = this.readyCallbacks;
|
|
3430
3713
|
this.readyCallbacks = [];
|
|
3431
|
-
for (const
|
|
3432
|
-
|
|
3714
|
+
for (const t of e)
|
|
3715
|
+
t(this);
|
|
3433
3716
|
this.ui.onReady();
|
|
3434
3717
|
}
|
|
3435
3718
|
/**
|
|
3436
3719
|
* Dispatch a bubbling `vd:focus-change` event on the container so a page can
|
|
3437
3720
|
* react to focus without registering an `onChange` callback.
|
|
3438
3721
|
*/
|
|
3439
|
-
dispatchFocusChange(
|
|
3722
|
+
dispatchFocusChange(e) {
|
|
3440
3723
|
this.container?.dispatchEvent(
|
|
3441
|
-
new CustomEvent(
|
|
3724
|
+
new CustomEvent(T.FOCUS_CHANGE, { detail: e, bubbles: !0 })
|
|
3442
3725
|
);
|
|
3443
3726
|
}
|
|
3444
3727
|
/**
|
|
3445
3728
|
* Dispatch a bubbling `vd:configuration-change` event on the container so a
|
|
3446
3729
|
* page or tag manager can react to price changes without a client callback.
|
|
3447
3730
|
*/
|
|
3448
|
-
dispatchConfigurationChange(
|
|
3731
|
+
dispatchConfigurationChange(e) {
|
|
3449
3732
|
this.container?.dispatchEvent(
|
|
3450
|
-
new CustomEvent(
|
|
3733
|
+
new CustomEvent(T.CONFIGURATION_CHANGE, { detail: e ?? null, bubbles: !0 })
|
|
3451
3734
|
);
|
|
3452
3735
|
}
|
|
3453
3736
|
/** Dispatch a bubbling `vd:configuration-submit` event when the CTA is used. */
|
|
3454
|
-
dispatchConfigurationSubmit(
|
|
3737
|
+
dispatchConfigurationSubmit(e) {
|
|
3455
3738
|
this.container?.dispatchEvent(
|
|
3456
|
-
new CustomEvent(
|
|
3739
|
+
new CustomEvent(T.CONFIGURATION_SUBMIT, { detail: e, bubbles: !0 })
|
|
3457
3740
|
);
|
|
3458
3741
|
}
|
|
3459
|
-
handleConfig(
|
|
3460
|
-
const
|
|
3461
|
-
if (
|
|
3462
|
-
const
|
|
3463
|
-
if (i !== void 0 &&
|
|
3464
|
-
const
|
|
3465
|
-
|
|
3742
|
+
handleConfig(e) {
|
|
3743
|
+
const t = e.viewerSettings, i = this.options.viewerSettings;
|
|
3744
|
+
if (t !== void 0 || i !== void 0) {
|
|
3745
|
+
const s = i !== void 0 ? { ...t ?? {}, ...i } : t;
|
|
3746
|
+
if (i !== void 0 && t !== void 0) {
|
|
3747
|
+
const o = Object.entries(i).filter(([r, a]) => t[r] !== a).map(
|
|
3748
|
+
([r, a]) => `${r} (metadata: ${t[r] ?? "undefined"}, override: ${a})`
|
|
3749
|
+
);
|
|
3750
|
+
o.length > 0 && C.warn(`Viewer settings override active: ${o.join(", ")}`);
|
|
3466
3751
|
}
|
|
3467
|
-
this.ui.applyViewerSettings(
|
|
3752
|
+
this.ui.applyViewerSettings(s), this.annotationsApi.setEnabled(s.annotations !== !1);
|
|
3468
3753
|
}
|
|
3469
|
-
this.cameraPositionApi.applyLimits(
|
|
3754
|
+
this.cameraPositionApi.applyLimits(e.cameraLimits);
|
|
3470
3755
|
}
|
|
3471
3756
|
/** Tell the viewer the user entered fullscreen, so it records the engagement. */
|
|
3472
3757
|
trackFullscreen() {
|
|
3473
3758
|
this.messenger.send({ type: c.FULLSCREEN });
|
|
3474
3759
|
}
|
|
3475
3760
|
initializeLogging() {
|
|
3476
|
-
this.options.debug === !0 &&
|
|
3761
|
+
this.options.debug === !0 && mt(), C.info("Initializing Virtualdisplay client", {
|
|
3762
|
+
...this.options.app === void 0 ? { model: this.options.model } : { app: this.options.app }
|
|
3763
|
+
});
|
|
3477
3764
|
}
|
|
3478
3765
|
createAndConnectIframe() {
|
|
3479
|
-
const
|
|
3480
|
-
this.container =
|
|
3766
|
+
const t = new ls(this.options, this.serverHost, this.iframeParams).create();
|
|
3767
|
+
this.container = t.container, this.iframe = t.iframe, this.eventBus.attach(this.container), this.ui.attach(this.container);
|
|
3481
3768
|
try {
|
|
3482
3769
|
const i = new URL(this.iframe.src).origin;
|
|
3483
3770
|
this.messenger.setTargetOrigin(i);
|
|
3484
3771
|
} catch {
|
|
3485
3772
|
}
|
|
3486
3773
|
}
|
|
3487
|
-
select(
|
|
3488
|
-
this.attributes.select(
|
|
3774
|
+
select(e, t) {
|
|
3775
|
+
this.attributes.select(e, t);
|
|
3489
3776
|
}
|
|
3490
|
-
getValues(
|
|
3491
|
-
return this.attributes.getValues(
|
|
3777
|
+
getValues(e) {
|
|
3778
|
+
return this.attributes.getValues(e);
|
|
3492
3779
|
}
|
|
3493
|
-
getValue(
|
|
3494
|
-
return this.attributes.getValue(
|
|
3780
|
+
getValue(e, t) {
|
|
3781
|
+
return this.attributes.getValue(e, t);
|
|
3495
3782
|
}
|
|
3496
|
-
onChange(
|
|
3497
|
-
this.attributes.onChange(
|
|
3783
|
+
onChange(e, t) {
|
|
3784
|
+
this.attributes.onChange(e, t);
|
|
3498
3785
|
}
|
|
3499
|
-
getAttribute(
|
|
3500
|
-
return this.attributes.getAttribute(
|
|
3786
|
+
getAttribute(e) {
|
|
3787
|
+
return this.attributes.getAttribute(e);
|
|
3501
3788
|
}
|
|
3502
3789
|
get isReady() {
|
|
3503
3790
|
return this.readyStateTracker.isReady;
|
|
3504
3791
|
}
|
|
3505
|
-
onReady(
|
|
3792
|
+
onReady(e) {
|
|
3506
3793
|
if (this.readyStateTracker.isReady) {
|
|
3507
|
-
|
|
3794
|
+
e(this);
|
|
3508
3795
|
return;
|
|
3509
3796
|
}
|
|
3510
|
-
this.readyCallbacks.push(
|
|
3797
|
+
this.readyCallbacks.push(e);
|
|
3511
3798
|
}
|
|
3512
|
-
onMutationFailed(
|
|
3513
|
-
this.mutationFailedCallbacks.push(
|
|
3799
|
+
onMutationFailed(e) {
|
|
3800
|
+
this.mutationFailedCallbacks.push(e);
|
|
3514
3801
|
}
|
|
3515
3802
|
/**
|
|
3516
3803
|
* Subscribe to the viewer's selectability snapshots (kiesbaarheid live):
|
|
@@ -3519,12 +3806,20 @@ class oo {
|
|
|
3519
3806
|
* exclusions never sends one: everything stays selectable and this never
|
|
3520
3807
|
* fires.
|
|
3521
3808
|
*/
|
|
3522
|
-
onSelectableChange(
|
|
3523
|
-
this.selectableState.onChange(
|
|
3809
|
+
onSelectableChange(e) {
|
|
3810
|
+
this.selectableState.onChange(e);
|
|
3811
|
+
}
|
|
3812
|
+
/**
|
|
3813
|
+
* Subscribe to which app this viewer resolved (type, name, public submit
|
|
3814
|
+
* settings). Reported once by the viewer after its resolve; fires immediately
|
|
3815
|
+
* when the report already arrived, so registration order does not matter.
|
|
3816
|
+
*/
|
|
3817
|
+
onAppResolved(e) {
|
|
3818
|
+
this.appResolvedCallbacks.push(e), this.resolvedApp !== void 0 && e(this.resolvedApp);
|
|
3524
3819
|
}
|
|
3525
3820
|
/** The selectable values for one attribute right now, or null when unrestricted. */
|
|
3526
|
-
getSelectable(
|
|
3527
|
-
return this.selectableState.selectableFor(
|
|
3821
|
+
getSelectable(e) {
|
|
3822
|
+
return this.selectableState.selectableFor(e);
|
|
3528
3823
|
}
|
|
3529
3824
|
/**
|
|
3530
3825
|
* Trigger the composed AR flow directly (ar-session-handoff task 035): a host
|
|
@@ -3536,8 +3831,8 @@ class oo {
|
|
|
3536
3831
|
activateAr() {
|
|
3537
3832
|
this.arActivation?.activate();
|
|
3538
3833
|
}
|
|
3539
|
-
on(
|
|
3540
|
-
this.eventBus.on(
|
|
3834
|
+
on(e, t) {
|
|
3835
|
+
this.eventBus.on(e, t);
|
|
3541
3836
|
}
|
|
3542
3837
|
get annotations() {
|
|
3543
3838
|
return this.annotationsApi;
|
|
@@ -3568,15 +3863,15 @@ class oo {
|
|
|
3568
3863
|
this.readyStateTracker.clear(), this.readyCallbacks = [], this.mutationFailedCallbacks.length = 0, this.snapshotApi.clear(), this.messenger.destroy(), this.arActivation?.destroy(), this.ui.destroy(), this.container?.parentElement !== null && this.container?.parentElement !== void 0 && this.container.parentElement.removeChild(this.container), this.container = void 0, this.iframe = void 0;
|
|
3569
3864
|
}
|
|
3570
3865
|
}
|
|
3571
|
-
const
|
|
3572
|
-
function
|
|
3573
|
-
const
|
|
3574
|
-
return n.sessionId !== void 0 ?
|
|
3866
|
+
const ms = "ar.virtualdisplay.io";
|
|
3867
|
+
function ps(n) {
|
|
3868
|
+
const e = new URL(`https://${ms}/go`);
|
|
3869
|
+
return n.sessionId !== void 0 ? e.searchParams.set("session", n.sessionId) : n.app !== void 0 ? e.searchParams.set("app", n.app) : n.license !== void 0 && n.model !== void 0 && (e.searchParams.set("license", n.license), e.searchParams.set("model", n.model)), e.toString();
|
|
3575
3870
|
}
|
|
3576
|
-
const
|
|
3577
|
-
class
|
|
3871
|
+
const fs = 1500;
|
|
3872
|
+
class gs {
|
|
3578
3873
|
options;
|
|
3579
|
-
qrModal = new
|
|
3874
|
+
qrModal = new Li();
|
|
3580
3875
|
/** The viewer's tracking session id, once the engine announces it (SESSION). */
|
|
3581
3876
|
sessionId;
|
|
3582
3877
|
/** Callbacks waiting on the SESSION message, resolved (or timed out) exactly once each. */
|
|
@@ -3585,20 +3880,20 @@ class lo {
|
|
|
3585
3880
|
pendingTimers = /* @__PURE__ */ new Set();
|
|
3586
3881
|
/** Set on destroy: an in-flight hand-off must not re-mount the modal or send QR_SHOWN. */
|
|
3587
3882
|
destroyed = !1;
|
|
3588
|
-
constructor(
|
|
3589
|
-
this.options =
|
|
3883
|
+
constructor(e) {
|
|
3884
|
+
this.options = e;
|
|
3590
3885
|
}
|
|
3591
3886
|
/** Store the engine-announced tracking session id and resolve anyone waiting on it. */
|
|
3592
|
-
onSession(
|
|
3593
|
-
this.sessionId =
|
|
3594
|
-
const
|
|
3887
|
+
onSession(e) {
|
|
3888
|
+
this.sessionId = e;
|
|
3889
|
+
const t = this.waiters;
|
|
3595
3890
|
this.waiters = [];
|
|
3596
|
-
for (const i of
|
|
3597
|
-
i(
|
|
3891
|
+
for (const i of t)
|
|
3892
|
+
i(e);
|
|
3598
3893
|
}
|
|
3599
3894
|
/** The AR button handler: mobile activates AR in the engine, desktop shows the hand-off QR. */
|
|
3600
3895
|
activate() {
|
|
3601
|
-
if (
|
|
3896
|
+
if (ut()) {
|
|
3602
3897
|
this.options.send({ type: c.AR_ACTIVATE });
|
|
3603
3898
|
return;
|
|
3604
3899
|
}
|
|
@@ -3606,8 +3901,8 @@ class lo {
|
|
|
3606
3901
|
}
|
|
3607
3902
|
destroy() {
|
|
3608
3903
|
this.destroyed = !0;
|
|
3609
|
-
for (const
|
|
3610
|
-
clearTimeout(
|
|
3904
|
+
for (const e of this.pendingTimers)
|
|
3905
|
+
clearTimeout(e);
|
|
3611
3906
|
this.pendingTimers.clear(), this.waiters = [], this.qrModal.hide();
|
|
3612
3907
|
}
|
|
3613
3908
|
/**
|
|
@@ -3619,14 +3914,15 @@ class lo {
|
|
|
3619
3914
|
*/
|
|
3620
3915
|
async showQrCode() {
|
|
3621
3916
|
this.qrModal.show();
|
|
3622
|
-
const
|
|
3917
|
+
const e = await this.waitForSessionId();
|
|
3623
3918
|
if (this.destroyed)
|
|
3624
3919
|
return;
|
|
3625
|
-
const
|
|
3626
|
-
sessionId:
|
|
3920
|
+
const t = ps({
|
|
3921
|
+
sessionId: e,
|
|
3922
|
+
app: this.options.app,
|
|
3627
3923
|
license: this.options.license,
|
|
3628
3924
|
model: this.options.model
|
|
3629
|
-
}), i = await this.qrModal.update(
|
|
3925
|
+
}), i = await this.qrModal.update(t);
|
|
3630
3926
|
if (this.destroyed) {
|
|
3631
3927
|
this.qrModal.hide();
|
|
3632
3928
|
return;
|
|
@@ -3640,60 +3936,61 @@ class lo {
|
|
|
3640
3936
|
* rather than encoding a wrong one.
|
|
3641
3937
|
*/
|
|
3642
3938
|
waitForSessionId() {
|
|
3643
|
-
return this.sessionId !== void 0 ? Promise.resolve(this.sessionId) : new Promise((
|
|
3644
|
-
const
|
|
3645
|
-
this.pendingTimers.delete(
|
|
3646
|
-
},
|
|
3647
|
-
this.pendingTimers.add(
|
|
3648
|
-
this.pendingTimers.delete(
|
|
3939
|
+
return this.sessionId !== void 0 ? Promise.resolve(this.sessionId) : new Promise((e) => {
|
|
3940
|
+
const t = setTimeout(() => {
|
|
3941
|
+
this.pendingTimers.delete(t), e(void 0);
|
|
3942
|
+
}, fs);
|
|
3943
|
+
this.pendingTimers.add(t), this.waiters.push((i) => {
|
|
3944
|
+
this.pendingTimers.delete(t), clearTimeout(t), e(i);
|
|
3649
3945
|
});
|
|
3650
3946
|
});
|
|
3651
3947
|
}
|
|
3652
3948
|
}
|
|
3653
|
-
class
|
|
3949
|
+
class bs {
|
|
3654
3950
|
callbacks = [];
|
|
3655
3951
|
lastKnown;
|
|
3656
|
-
handleSync(
|
|
3657
|
-
this.lastKnown =
|
|
3658
|
-
for (const
|
|
3659
|
-
e
|
|
3952
|
+
handleSync(e) {
|
|
3953
|
+
this.lastKnown = e;
|
|
3954
|
+
for (const t of this.callbacks)
|
|
3955
|
+
t(e);
|
|
3660
3956
|
}
|
|
3661
|
-
onChange(
|
|
3662
|
-
this.callbacks.push(
|
|
3957
|
+
onChange(e) {
|
|
3958
|
+
this.callbacks.push(e), this.lastKnown !== void 0 && e(this.lastKnown);
|
|
3663
3959
|
}
|
|
3664
3960
|
}
|
|
3665
|
-
class
|
|
3961
|
+
class Ss extends hs {
|
|
3666
3962
|
syncStatusTracker;
|
|
3667
|
-
constructor(
|
|
3668
|
-
const
|
|
3669
|
-
super(
|
|
3670
|
-
createArActivation: (i) => new
|
|
3671
|
-
|
|
3672
|
-
|
|
3963
|
+
constructor(e) {
|
|
3964
|
+
const t = new bs();
|
|
3965
|
+
super(e, {
|
|
3966
|
+
createArActivation: (i) => new gs({
|
|
3967
|
+
app: e.app,
|
|
3968
|
+
license: e.license,
|
|
3969
|
+
model: e.model,
|
|
3673
3970
|
send: i
|
|
3674
3971
|
}),
|
|
3675
|
-
createSyncTracker: () =>
|
|
3676
|
-
}), this.syncStatusTracker =
|
|
3972
|
+
createSyncTracker: () => t
|
|
3973
|
+
}), this.syncStatusTracker = t;
|
|
3677
3974
|
}
|
|
3678
3975
|
/** Subscribe to the live sync channel's connection state (ar-session-handoff). Latest-wins, no buffering. */
|
|
3679
|
-
onSyncChange(
|
|
3680
|
-
this.syncStatusTracker.onChange(
|
|
3976
|
+
onSyncChange(e) {
|
|
3977
|
+
this.syncStatusTracker.onChange(e);
|
|
3681
3978
|
}
|
|
3682
3979
|
}
|
|
3683
3980
|
export {
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3981
|
+
We as Annotations,
|
|
3982
|
+
Qe as Attribute,
|
|
3983
|
+
Ye as AttributeValue,
|
|
3984
|
+
gt as Camera,
|
|
3985
|
+
St as Configuration,
|
|
3689
3986
|
A as ERROR_CODES,
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3987
|
+
wt as Focus,
|
|
3988
|
+
Ct as Photo,
|
|
3989
|
+
_t as Snapshot,
|
|
3990
|
+
T as VD_EVENTS,
|
|
3991
|
+
Ss as VirtualdisplayClient,
|
|
3992
|
+
g as VirtualdisplayError,
|
|
3993
|
+
mt as enableDebugMode,
|
|
3994
|
+
vs as isDebugMode,
|
|
3995
|
+
C as logger
|
|
3699
3996
|
};
|