@virtualdisplay.io/client 4.0.0-alpha.35 → 4.0.0-alpha.37

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.
@@ -18,7 +18,11 @@ var t = {
18
18
  QR_SHOWN: "qr_shown",
19
19
  SYNC: "sync",
20
20
  SELECTABLE: "selectable",
21
- APP_RESOLVED: "app_resolved"
21
+ APP_RESOLVED: "app_resolved",
22
+ PERSONALISE: "personalise",
23
+ PERSONALISED: "personalised",
24
+ ZONES: "zones",
25
+ PLACE: "place"
22
26
  }, n = "main", r = {
23
27
  FOCUS: "focus",
24
28
  UNFOCUS: "unfocus"
@@ -55,46 +59,61 @@ function ee(e) {
55
59
  }
56
60
  function d(e) {
57
61
  let n = o(e);
58
- return n !== null && n.type === t.MUTATION && typeof n.instance == "string" && n.instance !== "" && Array.isArray(n.results);
62
+ return n !== null && n.type === t.PERSONALISED && typeof n.id == "string" && n.id !== "" && typeof n.instance == "string" && n.instance !== "" && typeof n.zone == "string" && typeof n.ok == "boolean" && (n.error === void 0 || typeof n.error == "string");
59
63
  }
60
64
  function f(e) {
65
+ return typeof e == "number" && Number.isFinite(e);
66
+ }
67
+ function p(e) {
68
+ let t = o(e);
69
+ return t !== null && typeof t.name == "string" && t.name !== "" && f(t.aspect) && f(t.widthMm) && f(t.heightMm);
70
+ }
71
+ function te(e) {
72
+ let n = o(e);
73
+ return n !== null && n.type === t.ZONES && typeof n.instance == "string" && n.instance !== "" && Array.isArray(n.zones) && n.zones.every(p);
74
+ }
75
+ function ne(e) {
76
+ let n = o(e);
77
+ return n !== null && n.type === t.MUTATION && typeof n.instance == "string" && n.instance !== "" && Array.isArray(n.results);
78
+ }
79
+ function m(e) {
61
80
  let n = o(e);
62
81
  return n !== null && n.type === t.SNAPSHOT && ("data" in n || "error" in n);
63
82
  }
64
- function p(e) {
83
+ function re(e) {
65
84
  let n = o(e);
66
85
  return n !== null && n.type === t.CAMERA && Array.isArray(n.transforms);
67
86
  }
68
- function te(e) {
87
+ function ie(e) {
69
88
  let n = o(e);
70
89
  return n !== null && n.type === t.MAPPING && typeof n.instance == "string" && n.instance !== "" && Array.isArray(n.attributes);
71
90
  }
72
- function ne(e) {
91
+ function ae(e) {
73
92
  let n = o(e);
74
93
  return n !== null && n.type === t.LOADING_INDICATOR && typeof n.progress == "number";
75
94
  }
76
- function m(e) {
95
+ function oe(e) {
77
96
  let n = o(e);
78
97
  return n !== null && n.type === t.SYNC && typeof n.connected == "boolean";
79
98
  }
80
- function re(e) {
99
+ function se(e) {
81
100
  let n = o(e);
82
101
  return n !== null && n.type === t.SELECTABLE && typeof n.instance == "string" && n.instance !== "" && Array.isArray(n.attributes);
83
102
  }
84
- function ie(e) {
103
+ function ce(e) {
85
104
  let n = o(e);
86
105
  return n !== null && n.type === t.CONFIG && typeof n.viewerSettings == "object";
87
106
  }
88
- function ae(e) {
107
+ function le(e) {
89
108
  let n = o(e);
90
109
  return n !== null && n.type === t.FOCUS && typeof n.instance == "string" && n.instance !== "" && typeof n.state == "string";
91
110
  }
92
- function oe(e) {
111
+ function ue(e) {
93
112
  let n = o(e);
94
113
  return n !== null && n.type === t.PRICING && typeof n.instance == "string" && n.instance !== "" && typeof n.pricing == "object" && n.pricing !== null;
95
114
  }
96
115
  // ../messaging/src/queue.ts
97
- var se = class {
116
+ var de = class {
98
117
  processor;
99
118
  pending = [];
100
119
  isReady = !1;
@@ -116,7 +135,7 @@ var se = class {
116
135
  clear() {
117
136
  this.pending.length = 0;
118
137
  }
119
- }, ce = class {
138
+ }, fe = class {
120
139
  getTarget;
121
140
  handlers = /* @__PURE__ */ new Map();
122
141
  publisher;
@@ -127,7 +146,7 @@ var se = class {
127
146
  isValid;
128
147
  onHandlerError;
129
148
  constructor(e, t) {
130
- this.getTarget = e, this.sourceId = `vd-${Math.random().toString(36).slice(2, 8)}`, this.targetOrigin = "*", this.isValid = t?.isValid ?? c, this.onHandlerError = t?.onHandlerError ?? le, this.publisher = new se((e) => this.post(e)), this.consumer = new se((e) => this.routeToHandler(e)), t?.bufferIncoming !== !0 && this.consumer.markReady();
149
+ this.getTarget = e, this.sourceId = `vd-${Math.random().toString(36).slice(2, 8)}`, this.targetOrigin = "*", this.isValid = t?.isValid ?? c, this.onHandlerError = t?.onHandlerError ?? pe, this.publisher = new de((e) => this.post(e)), this.consumer = new de((e) => this.routeToHandler(e)), t?.bufferIncoming !== !0 && this.consumer.markReady();
131
150
  }
132
151
  on(e, t) {
133
152
  this.handlers.set(e, t);
@@ -185,13 +204,13 @@ var se = class {
185
204
  });
186
205
  }
187
206
  };
188
- function le(e, t) {
207
+ function pe(e, t) {
189
208
  let n = t instanceof Error ? t.message : String(t);
190
209
  console.error(`Virtualdisplay: error handling ${e.type}: ${n}`);
191
210
  }
192
211
  t.CAMERA, t.LOADING_INDICATOR;
193
212
  // ../client-core/src/annotations/annotations.ts
194
- var ue = class {
213
+ var me = class {
195
214
  send;
196
215
  instance;
197
216
  constructor(e, t) {
@@ -204,7 +223,7 @@ var ue = class {
204
223
  enabled: e
205
224
  });
206
225
  }
207
- }, de = class {
226
+ }, he = class {
208
227
  value;
209
228
  attribute;
210
229
  label;
@@ -218,37 +237,37 @@ var ue = class {
218
237
  setSelected(e) {
219
238
  this.isSelectedValue = e;
220
239
  }
221
- }, fe = {}, pe = [
240
+ }, ge = {}, _e = [
222
241
  "en",
223
242
  "nl",
224
243
  "de"
225
244
  ], h = ["globalVariable", "baseLocale"], g = [], _ = typeof window > "u";
226
245
  globalThis.__paraglide = globalThis.__paraglide ?? {};
227
- var v, me = !1, y = () => {
228
- let e = !_ && g.length > 0 && typeof window < "u" ? window.location?.href : void 0, t = he(e ? Me(e) : h, e);
229
- if (t) return me || (v = t, me = !0, _e(t, { reload: !1 })), t;
246
+ var v, ve = !1, y = () => {
247
+ let e = !_ && g.length > 0 && typeof window < "u" ? window.location?.href : void 0, t = ye(e ? Ie(e) : h, e);
248
+ if (t) return ve || (v = t, ve = !0, xe(t, { reload: !1 })), t;
230
249
  throw Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
231
250
  };
232
- function he(e, t) {
251
+ function ye(e, t) {
233
252
  let n;
234
253
  for (let t of e) {
235
254
  if (t === "baseLocale") n = "en";
236
255
  else if (t === "globalVariable" && v !== void 0) n = v;
237
- else if (Ne(t) && S.has(t)) {
256
+ else if (Le(t) && S.has(t)) {
238
257
  let e = S.get(t);
239
258
  if (e) {
240
259
  let t = e.getLocale();
241
260
  if (t instanceof Promise) continue;
242
- if (t !== void 0) return xe(t);
261
+ if (t !== void 0) return Te(t);
243
262
  }
244
263
  }
245
264
  let e = b(n);
246
265
  if (e) return e;
247
266
  }
248
267
  }
249
- var ge = (e) => {
268
+ var be = (e) => {
250
269
  e ? window.location.href = e : window.location.reload();
251
- }, _e = (e, t) => {
270
+ }, xe = (e, t) => {
252
271
  let n = {
253
272
  reload: !0,
254
273
  ...t
@@ -257,10 +276,10 @@ var ge = (e) => {
257
276
  r = y();
258
277
  } catch {}
259
278
  let i = [], a = h;
260
- !_ && typeof window < "u" && window.location?.href && (a = Me(window.location.href));
279
+ !_ && typeof window < "u" && window.location?.href && (a = Ie(window.location.href));
261
280
  for (let t of a) if (t === "globalVariable") v = e;
262
281
  else if (t === "baseLocale") continue;
263
- else if (Ne(t) && S.has(t)) {
282
+ else if (Le(t) && S.has(t)) {
264
283
  let n = S.get(t);
265
284
  if (n) {
266
285
  let r = n.setLocale(e);
@@ -270,79 +289,79 @@ var ge = (e) => {
270
289
  }
271
290
  }
272
291
  let o = () => {
273
- !_ && n.reload && window.location && e !== r && ge(void 0);
292
+ !_ && n.reload && window.location && e !== r && be(void 0);
274
293
  };
275
294
  if (i.length) return Promise.all(i).then(() => {
276
295
  o();
277
296
  });
278
297
  o();
279
- }, ve = () => typeof window < "u" ? window.location.origin : "http://fallback.com", ye;
298
+ }, Se = () => typeof window < "u" ? window.location.origin : "http://fallback.com", Ce;
280
299
  function b(e) {
281
- if (typeof e == "string") return ye ??= be(), ye.get(e.toLowerCase());
300
+ if (typeof e == "string") return Ce ??= we(), Ce.get(e.toLowerCase());
282
301
  }
283
- function be() {
302
+ function we() {
284
303
  let e = /* @__PURE__ */ new Map();
285
- for (let t of pe) {
304
+ for (let t of _e) {
286
305
  let n = t.toLowerCase();
287
306
  e.has(n) || e.set(n, t);
288
307
  }
289
308
  return e;
290
309
  }
291
- function xe(e) {
310
+ function Te(e) {
292
311
  let t = b(e);
293
312
  if (t) return t;
294
- throw Error(`Invalid locale: ${e}. Expected one of: ${pe.join(", ")}`);
313
+ throw Error(`Invalid locale: ${e}. Expected one of: ${_e.join(", ")}`);
295
314
  }
296
315
  function x(e) {
297
316
  return e;
298
317
  }
299
- function Se(e, t) {
300
- return new fe(e, t.href);
318
+ function Ee(e, t) {
319
+ return new ge(e, t.href);
301
320
  }
302
- function Ce() {
321
+ function De() {
303
322
  return 0;
304
323
  }
305
- function we(e) {
324
+ function Oe(e) {
306
325
  return g;
307
326
  }
308
- function Te(e, t) {
327
+ function ke(e, t) {
309
328
  return e.exec(t.href);
310
329
  }
311
- function Ee(e) {
312
- return De(e);
330
+ function Ae(e) {
331
+ return je(e);
313
332
  }
314
- function De(e) {
315
- let t = x(typeof e == "string" ? new URL(e, ve()) : new URL(e.href)), n = t.pathname.replace(/^\/+/, "").split("/");
333
+ function je(e) {
334
+ let t = x(typeof e == "string" ? new URL(e, Se()) : new URL(e.href)), n = t.pathname.replace(/^\/+/, "").split("/");
316
335
  return n.length > 0 && b(n[0]) && (t.pathname = "/" + n.slice(1).join("/")), x(t);
317
336
  }
318
- var Oe = -1, ke, Ae;
319
- function je(e) {
337
+ var Me = -1, Ne, Pe;
338
+ function Fe(e) {
320
339
  if (g.length === 0) return;
321
- let t = typeof e == "string" ? e : e.href, n = Ce();
322
- if (ke === t && Oe === n) return Ae;
323
- let r = x(new URL(t, "http://example.com")), i = Ee(r), a = i.href === r.href ? [r] : [r, i], o;
340
+ let t = typeof e == "string" ? e : e.href, n = De();
341
+ if (Ne === t && Me === n) return Pe;
342
+ let r = x(new URL(t, "http://example.com")), i = Ae(r), a = i.href === r.href ? [r] : [r, i], o;
324
343
  for (let e of a) {
325
- for (let t of we(e)) if (Te(Se(t.match, e), e)) {
344
+ for (let t of Oe(e)) if (ke(Ee(t.match, e), e)) {
326
345
  o = t;
327
346
  break;
328
347
  }
329
348
  if (o) break;
330
349
  }
331
- return Oe = n, ke = t, Ae = o, o;
350
+ return Me = n, Ne = t, Pe = o, o;
332
351
  }
333
- function Me(e) {
334
- let t = je(e);
352
+ function Ie(e) {
353
+ let t = Fe(e);
335
354
  return t && t.exclude !== !0 && Array.isArray(t.strategy) ? t.strategy : h;
336
355
  }
337
356
  var S = /* @__PURE__ */ new Map();
338
- function Ne(e) {
357
+ function Le(e) {
339
358
  return typeof e == "string" && /^custom-[A-Za-z0-9_-]+$/.test(e);
340
359
  }
341
360
  // ../client-core/src/attributes/label.ts
342
- function Pe(e, t) {
343
- return Fe(t !== void 0 && Object.hasOwn(t, e) ? t[e] : void 0) ?? C(e);
361
+ function Re(e, t) {
362
+ return ze(t !== void 0 && Object.hasOwn(t, e) ? t[e] : void 0) ?? C(e);
344
363
  }
345
- function Fe(e) {
364
+ function ze(e) {
346
365
  if (e === void 0) return;
347
366
  for (let t of [
348
367
  y(),
@@ -363,7 +382,8 @@ var w = {
363
382
  VALUE_NOT_FOUND: "VALUE_NOT_FOUND",
364
383
  PARENT_NOT_FOUND: "PARENT_NOT_FOUND",
365
384
  INVALID_PARAMETER: "INVALID_PARAMETER",
366
- SNAPSHOT_FAILED: "SNAPSHOT_FAILED"
385
+ SNAPSHOT_FAILED: "SNAPSHOT_FAILED",
386
+ PERSONALISATION_FAILED: "PERSONALISATION_FAILED"
367
387
  }, T = class e extends Error {
368
388
  code;
369
389
  constructor(e, t) {
@@ -378,7 +398,7 @@ var w = {
378
398
  static invalidParameter(t) {
379
399
  return new e(t, w.INVALID_PARAMETER);
380
400
  }
381
- }, Ie = class {
401
+ }, Be = class {
382
402
  name;
383
403
  defaultValue;
384
404
  values;
@@ -414,17 +434,17 @@ var w = {
414
434
  createValues(e, t) {
415
435
  let n = /* @__PURE__ */ new Map();
416
436
  for (let r of e) {
417
- let e = new de(r, this.name, Pe(r, t));
437
+ let e = new he(r, this.name, Re(r, t));
418
438
  r === this.defaultValue && e.setSelected(!0), n.set(r, e);
419
439
  }
420
440
  return n;
421
441
  }
422
- }, Le = class {
442
+ }, Ve = class {
423
443
  attributes = /* @__PURE__ */ new Map();
424
444
  constructor(e, t, n) {
425
445
  for (let n of e) {
426
446
  let e = this.buildOptions(n, t);
427
- this.attributes.set(n.name, new Ie(e));
447
+ this.attributes.set(n.name, new Be(e));
428
448
  }
429
449
  this.onMutationFailed = n;
430
450
  }
@@ -460,11 +480,11 @@ var w = {
460
480
  defaultValue: e.defaultValue
461
481
  };
462
482
  }
463
- }, E = 4096, D = 16384, Re = [
483
+ }, E = 4096, D = 16384, He = [
464
484
  1024,
465
485
  256,
466
486
  64
467
- ], ze = 20, O = [
487
+ ], Ue = 20, O = [
468
488
  "timestamp",
469
489
  "level",
470
490
  "msg",
@@ -472,12 +492,12 @@ var w = {
472
492
  "trace_id",
473
493
  "span_id"
474
494
  ];
475
- function Be(e) {
495
+ function We(e) {
476
496
  let t = new Date(e.timestamp).toLocaleTimeString("en-GB", { hour12: !1 }), n = e.level.toUpperCase().padEnd(5), r = e.trace_id?.slice(0, 8) ?? "--------", i = e.msg, a = Object.entries(e).filter(([e]) => !O.includes(e)).map(([e, t]) => `${e}=${k(t, E).line}`).join(" ");
477
497
  return `${t} ${n} [${r}] ${i}${a ? " " + a : ""}`;
478
498
  }
479
- function Ve(e) {
480
- for (let t of [E, ...Re]) {
499
+ function Ge(e) {
500
+ for (let t of [E, ...He]) {
481
501
  let { line: n, truncated: r } = k(e, t);
482
502
  if (!r) {
483
503
  if (n.length <= D) return n;
@@ -490,12 +510,12 @@ function Ve(e) {
490
510
  if (i.length <= D) return i;
491
511
  }
492
512
  let t = Object.keys(e).filter((e) => !O.includes(e)), n = {
493
- ...Ue(e, O),
513
+ ...qe(e, O),
494
514
  log_truncated: !0,
495
515
  log_dropped_count: t.length
496
516
  }, r = k({
497
517
  ...n,
498
- log_dropped_attrs: t.slice(0, ze)
518
+ log_dropped_attrs: t.slice(0, Ue)
499
519
  }, E);
500
520
  return r.line.length <= D ? r.line : k(n, E).line;
501
521
  }
@@ -503,7 +523,7 @@ function k(e, t) {
503
523
  let n = [], r = !1;
504
524
  return {
505
525
  line: JSON.stringify(e, function(e, i) {
506
- if (typeof i == "string") return i.length > t && (r = !0), He(i, t);
526
+ if (typeof i == "string") return i.length > t && (r = !0), Ke(i, t);
507
527
  if (typeof i == "bigint") return i.toString();
508
528
  if (typeof i != "object" || !i) return i;
509
529
  for (; n.length > 0 && n.at(-1) !== this;) n.pop();
@@ -512,80 +532,80 @@ function k(e, t) {
512
532
  truncated: r
513
533
  };
514
534
  }
515
- function He(e, t) {
535
+ function Ke(e, t) {
516
536
  return e.length <= t ? e : `${e.slice(0, t)}...[truncated ${e.length - t} chars]`;
517
537
  }
518
- function Ue(e, t) {
538
+ function qe(e, t) {
519
539
  let n = {};
520
540
  for (let r of t) e[r] !== void 0 && (n[r] = e[r]);
521
541
  return n;
522
542
  }
523
543
  // ../logger/src/write.ts
524
- function We(e, t) {
525
- let n = t ? Be(e) : Ve(e);
544
+ function Je(e, t) {
545
+ let n = t ? We(e) : Ge(e);
526
546
  e.level === "error" ? console.error(n) : e.level === "warn" ? console.warn(n) : console.log(n);
527
547
  }
528
548
  // ../logger/src/serialise.ts
529
- function Ge(e, t = 0) {
549
+ function Ye(e, t = 0) {
530
550
  let n = {
531
551
  name: e.name,
532
552
  message: e.message
533
553
  };
534
- return e.stack !== void 0 && (n.stack = e.stack), qe(e, n), e.cause !== void 0 && e.cause !== null && (n.cause = e.cause instanceof Error && t < 5 ? Ge(e.cause, t + 1) : String(e.cause)), n;
554
+ return e.stack !== void 0 && (n.stack = e.stack), Ze(e, n), e.cause !== void 0 && e.cause !== null && (n.cause = e.cause instanceof Error && t < 5 ? Ye(e.cause, t + 1) : String(e.cause)), n;
535
555
  }
536
- var Ke = /* @__PURE__ */ new Set([
556
+ var Xe = /* @__PURE__ */ new Set([
537
557
  "name",
538
558
  "message",
539
559
  "stack",
540
560
  "cause"
541
561
  ]);
542
- function qe(e, t) {
562
+ function Ze(e, t) {
543
563
  for (let n of Object.getOwnPropertyNames(e)) {
544
- if (Ke.has(n)) continue;
564
+ if (Xe.has(n)) continue;
545
565
  let r = e[n];
546
566
  r !== void 0 && (t[n] = r);
547
567
  }
548
568
  }
549
- function Je(e) {
569
+ function Qe(e) {
550
570
  let t = {};
551
- for (let [n, r] of Object.entries(e)) t[n] = r instanceof Error ? Ge(r) : r;
571
+ for (let [n, r] of Object.entries(e)) t[n] = r instanceof Error ? Ye(r) : r;
552
572
  return t;
553
573
  }
554
574
  // ../utils/src/now.ts
555
- function Ye() {
575
+ function $e() {
556
576
  return /* @__PURE__ */ new Date();
557
577
  }
558
578
  // ../utils/src/device.ts
559
- function Xe() {
579
+ function et() {
560
580
  return typeof navigator > "u" ? "" : navigator.userAgent;
561
581
  }
562
- function Ze() {
582
+ function tt() {
563
583
  return typeof navigator > "u" ? !1 : navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
564
584
  }
565
- function Qe() {
566
- return /iPhone|iPad|iPod/i.test(Xe()) || Ze();
585
+ function nt() {
586
+ return /iPhone|iPad|iPod/i.test(et()) || tt();
567
587
  }
568
- function $e() {
569
- return /Android/i.test(Xe());
588
+ function rt() {
589
+ return /Android/i.test(et());
570
590
  }
571
- function et() {
572
- return Qe() || $e();
591
+ function it() {
592
+ return nt() || rt();
573
593
  }
574
594
  // ../logger/src/logger.ts
575
- var tt = class {
595
+ var at = class {
576
596
  config;
577
597
  constructor(e) {
578
598
  this.config = e;
579
599
  }
580
600
  log(e, t, n = {}) {
581
601
  let r = this.config.traceProvider?.() ?? {};
582
- We({
583
- timestamp: Ye().toISOString(),
602
+ Je({
603
+ timestamp: $e().toISOString(),
584
604
  level: e,
585
605
  msg: t,
586
606
  service: this.config.service,
587
607
  ...r,
588
- ...Je(n)
608
+ ...Qe(n)
589
609
  }, this.config.isDev);
590
610
  }
591
611
  debug(e, t) {
@@ -601,8 +621,8 @@ var tt = class {
601
621
  this.log("error", e, t);
602
622
  }
603
623
  };
604
- function nt(e, t) {
605
- return new tt({
624
+ function ot(e, t) {
625
+ return new at({
606
626
  service: e,
607
627
  isDev: t?.isDev === void 0 ? typeof process < "u" ? process.env.NODE_ENV !== "production" : !0 : t.isDev,
608
628
  traceProvider: t?.traceProvider
@@ -612,7 +632,7 @@ function nt(e, t) {
612
632
  function A(e) {
613
633
  if (e !== void 0) return typeof e == "object" && e && !Array.isArray(e) && !(e instanceof Error) ? e : e instanceof Error ? { error: e.message } : { value: e };
614
634
  }
615
- function rt(e) {
635
+ function st(e) {
616
636
  return {
617
637
  debug: (t, n) => e.debug(t, A(n)),
618
638
  info: (t, n) => e.info(t, A(n)),
@@ -620,15 +640,15 @@ function rt(e) {
620
640
  error: (t, n) => e.error(t, A(n))
621
641
  };
622
642
  }
623
- var it = !1, j = rt(nt("client", { isDev: !1 }));
624
- function at() {
625
- it = !0, j = rt(nt("client", { isDev: !0 }));
643
+ var ct = !1, j = st(ot("client", { isDev: !1 }));
644
+ function lt() {
645
+ ct = !0, j = st(ot("client", { isDev: !0 }));
626
646
  }
627
- function ot() {
628
- return it;
647
+ function ut() {
648
+ return ct;
629
649
  }
630
650
  // ../client-core/src/attributes/attributes.ts
631
- var st = class {
651
+ var dt = class {
632
652
  send;
633
653
  instance;
634
654
  onMutationFailed;
@@ -638,7 +658,7 @@ var st = class {
638
658
  this.send = e, this.instance = t, this.onMutationFailed = n;
639
659
  }
640
660
  handleMappingReceived(e) {
641
- j.debug("Initializing from server mapping", { attributeCount: e.attributes.length }), this.registry = new Le(e.attributes, (e, t) => this.sendMutation(e, t), this.onMutationFailed), this.replayPendingCallbacks();
661
+ j.debug("Initializing from server mapping", { attributeCount: e.attributes.length }), this.registry = new Ve(e.attributes, (e, t) => this.sendMutation(e, t), this.onMutationFailed), this.replayPendingCallbacks();
642
662
  }
643
663
  handleMutationResult(e) {
644
664
  this.registry?.handleResults(e.results);
@@ -695,7 +715,7 @@ var st = class {
695
715
  }
696
716
  this.pendingCallbacks.length = 0;
697
717
  }
698
- }, ct = class {
718
+ }, ft = class {
699
719
  snapshot;
700
720
  callbacks = [];
701
721
  handleSnapshot(e) {
@@ -711,7 +731,7 @@ var st = class {
711
731
  get current() {
712
732
  return this.snapshot ?? [];
713
733
  }
714
- }, lt = class {
734
+ }, pt = class {
715
735
  send;
716
736
  commands = [];
717
737
  constructor(e) {
@@ -753,7 +773,7 @@ var st = class {
753
773
  };
754
774
  this.send(e);
755
775
  }
756
- }, ut = class {
776
+ }, mt = class {
757
777
  state;
758
778
  limitsState;
759
779
  changeCallbacks = [];
@@ -813,20 +833,20 @@ var st = class {
813
833
  }
814
834
  };
815
835
  // ../client-core/src/configuration/pricing-rule.ts
816
- function dt(e, t) {
817
- let n = e.filter((e) => ft(e, t));
836
+ function ht(e, t) {
837
+ let n = e.filter((e) => gt(e, t));
818
838
  if (n.length === 0) return;
819
- let r = Math.max(...n.map(pt)), i = n.filter((e) => pt(e) === r);
839
+ let r = Math.max(...n.map(_t)), i = n.filter((e) => _t(e) === r);
820
840
  return i.length === 1 ? i[0] : void 0;
821
841
  }
822
- function ft(e, t) {
842
+ function gt(e, t) {
823
843
  return Object.entries(e.attributes).every(([e, n]) => t[e] === n);
824
844
  }
825
- function pt(e) {
845
+ function _t(e) {
826
846
  return Object.keys(e.attributes).length;
827
847
  }
828
848
  // ../client-core/src/configuration/configuration.ts
829
- var mt = class {
849
+ var vt = class {
830
850
  dispatchChange;
831
851
  dispatchSubmit;
832
852
  pricing;
@@ -895,7 +915,7 @@ var mt = class {
895
915
  }
896
916
  resolve() {
897
917
  if (this.pricing === void 0) return;
898
- let e = dt(this.pricing.rules, this.selection);
918
+ let e = ht(this.pricing.rules, this.selection);
899
919
  if (e !== void 0 && e.availability !== a.HIDDEN) return {
900
920
  attributes: { ...this.selection },
901
921
  reference: e.reference,
@@ -904,7 +924,7 @@ var mt = class {
904
924
  availability: e.availability
905
925
  };
906
926
  }
907
- }, ht = class {
927
+ }, yt = class {
908
928
  send;
909
929
  dispatch;
910
930
  instance;
@@ -945,7 +965,100 @@ var mt = class {
945
965
  for (let e of this.changeCallbacks) e(t);
946
966
  this.dispatch(t);
947
967
  }
948
- }, gt = class {
968
+ }, bt = 3e4, xt = "Virtualdisplay: the print zone could not be personalised", St = class {
969
+ send;
970
+ instance;
971
+ pending = /* @__PURE__ */ new Map();
972
+ zoneListeners = /* @__PURE__ */ new Set();
973
+ zoneReport = [];
974
+ sequence = 0;
975
+ pendingPlacements = /* @__PURE__ */ new Map();
976
+ frame = null;
977
+ constructor(e, t) {
978
+ this.send = e, this.instance = t;
979
+ }
980
+ setImage(e, t) {
981
+ return typeof e != "string" || e === "" ? Promise.reject(T.invalidParameter("setImage() takes a zone name")) : t instanceof Blob ? this.request(e, t) : Promise.reject(T.invalidParameter("setImage() takes an image as a Blob"));
982
+ }
983
+ clear(e) {
984
+ return typeof e != "string" || e === "" ? Promise.reject(T.invalidParameter("clear() takes a zone name")) : this.request(e, null);
985
+ }
986
+ get zones() {
987
+ return this.zoneReport;
988
+ }
989
+ onZones(e) {
990
+ this.zoneListeners.add(e);
991
+ }
992
+ place(e, n) {
993
+ if (typeof e != "string" || e === "") throw T.invalidParameter("place() takes a zone name");
994
+ if (![
995
+ n.x,
996
+ n.y,
997
+ n.scale
998
+ ].every(Number.isFinite)) throw T.invalidParameter("place() takes x, y and scale as numbers");
999
+ if (typeof n.editing != "boolean") throw T.invalidParameter("place() takes editing as true or false");
1000
+ this.pendingPlacements.set(e, {
1001
+ type: t.PLACE,
1002
+ instance: this.instance,
1003
+ zone: e,
1004
+ x: n.x,
1005
+ y: n.y,
1006
+ scale: n.scale,
1007
+ editing: n.editing
1008
+ }), this.frame ??= requestAnimationFrame(() => {
1009
+ this.sendPlacements();
1010
+ });
1011
+ }
1012
+ sendPlacements() {
1013
+ let e = [...this.pendingPlacements.values()];
1014
+ this.frame = null, this.pendingPlacements.clear();
1015
+ for (let t of e) this.send(t);
1016
+ }
1017
+ request(e, n) {
1018
+ return new Promise((r, i) => {
1019
+ this.sequence += 1;
1020
+ let a = String(this.sequence), o = setTimeout(() => {
1021
+ this.expire(a, e);
1022
+ }, bt);
1023
+ this.pending.set(a, {
1024
+ resolve: r,
1025
+ reject: i,
1026
+ timeout: o
1027
+ }), this.send({
1028
+ type: t.PERSONALISE,
1029
+ id: a,
1030
+ instance: this.instance,
1031
+ zone: e,
1032
+ image: n
1033
+ });
1034
+ });
1035
+ }
1036
+ expire(e, t) {
1037
+ let n = this.pending.get(e);
1038
+ n !== void 0 && (this.pending.delete(e), j.warn("Personalisation timed out", { zone: t }), n.reject(M(`Virtualdisplay: the viewer did not answer for zone "${t}"`)));
1039
+ }
1040
+ handleReplyReceived(e) {
1041
+ let t = this.pending.get(e.id);
1042
+ t === void 0 ? j.info("Personalisation reply with no call waiting", {
1043
+ id: e.id,
1044
+ zone: e.zone
1045
+ }) : (this.pending.delete(e.id), clearTimeout(t.timeout), e.ok ? t.resolve() : t.reject(M(e.error ?? xt)));
1046
+ }
1047
+ handleZonesReceived(e) {
1048
+ this.zoneReport = e.zones;
1049
+ for (let e of this.zoneListeners) e(this.zoneReport);
1050
+ }
1051
+ destroy() {
1052
+ this.frame !== null && cancelAnimationFrame(this.frame), this.frame = null, this.pendingPlacements.clear(), this.zoneListeners.clear();
1053
+ for (let e of this.pending.values()) clearTimeout(e.timeout), e.reject(M("Virtualdisplay: the client was destroyed before the viewer answered"));
1054
+ this.pending.clear();
1055
+ }
1056
+ };
1057
+ function M(e) {
1058
+ return new T(e, w.PERSONALISATION_FAILED);
1059
+ }
1060
+ // ../client-core/src/snapshot/photo.ts
1061
+ var Ct = class {
949
1062
  filename;
950
1063
  developedCallbacks = /* @__PURE__ */ new Set();
951
1064
  errorCallbacks = /* @__PURE__ */ new Set();
@@ -974,7 +1087,7 @@ var mt = class {
974
1087
  t(e);
975
1088
  }), this.developedCallbacks.clear(), this.errorCallbacks.clear());
976
1089
  }
977
- }, _t = 3e4, vt = class {
1090
+ }, wt = 3e4, Tt = class {
978
1091
  send;
979
1092
  validExtensions = [".png"];
980
1093
  pendingPhotos = /* @__PURE__ */ new Map();
@@ -989,9 +1102,9 @@ var mt = class {
989
1102
  }
990
1103
  request(e, n) {
991
1104
  this.validateFilename(e), j.debug("Taking snapshot", { filename: e });
992
- let r = new gt(e), i = setTimeout(() => {
993
- this.pendingPhotos.delete(e), j.warn("Snapshot timed out", { filename: e }), r.fail(new T(`Snapshot timed out: the viewer did not respond within ${_t}ms`, w.SNAPSHOT_FAILED));
994
- }, _t);
1105
+ let r = new Ct(e), i = setTimeout(() => {
1106
+ this.pendingPhotos.delete(e), j.warn("Snapshot timed out", { filename: e }), r.fail(new T(`Snapshot timed out: the viewer did not respond within ${wt}ms`, w.SNAPSHOT_FAILED));
1107
+ }, wt);
995
1108
  return this.pendingPhotos.set(e, {
996
1109
  photo: r,
997
1110
  timeout: i
@@ -1028,7 +1141,7 @@ var mt = class {
1028
1141
  if (!this.validExtensions.some((t) => e.toLowerCase().endsWith(t))) throw new T(`Invalid filename: "${e}". Filename must end with one of: ${this.validExtensions.join(", ")}`, w.INVALID_PARAMETER);
1029
1142
  if (e.includes("..") || e.includes("/") || e.includes("\\")) throw new T("Filename cannot contain path separators or \"..\"", w.INVALID_PARAMETER);
1030
1143
  }
1031
- }, yt = class {
1144
+ }, Et = class {
1032
1145
  container = null;
1033
1146
  attach(e) {
1034
1147
  this.container = e;
@@ -1054,76 +1167,76 @@ var mt = class {
1054
1167
  this.container?.removeEventListener(e, n);
1055
1168
  };
1056
1169
  }
1057
- }, bt = ((e = {}, t = {}) => {
1170
+ }, Dt = ((e = {}, t = {}) => {
1058
1171
  let n = t.locale ?? y();
1059
1172
  return n === "nl" ? "Bezig…" : n === "de" ? "Läuft…" : "Working…";
1060
- }), xt = ((e = {}, t = {}) => {
1173
+ }), Ot = ((e = {}, t = {}) => {
1061
1174
  let n = t.locale ?? y();
1062
1175
  return n === "nl" ? "Mislukt" : n === "de" ? "Fehlgeschlagen" : "Failed";
1063
- }), St = ((e = {}, t = {}) => {
1176
+ }), kt = ((e = {}, t = {}) => {
1064
1177
  let n = t.locale ?? y();
1065
1178
  return n === "nl" ? "Gelukt" : n === "de" ? "Fertig" : "Done";
1066
- }), Ct = ((e = {}, t = {}) => {
1179
+ }), At = ((e = {}, t = {}) => {
1067
1180
  let n = t.locale ?? y();
1068
1181
  return n === "nl" ? "Annotaties" : n === "de" ? "Anmerkungen" : "Annotations";
1069
- }), wt = ((e = {}, t = {}) => {
1182
+ }), jt = ((e = {}, t = {}) => {
1070
1183
  let n = t.locale ?? y();
1071
1184
  return n === "nl" ? "AR activeren" : n === "de" ? "AR aktivieren" : "Activate AR";
1072
- }), Tt = ((e = {}, t = {}) => {
1185
+ }), Mt = ((e = {}, t = {}) => {
1073
1186
  let n = t.locale ?? y();
1074
1187
  return n === "nl" ? "Camera resetten" : n === "de" ? "Kamera zurücksetzen" : "Reset camera";
1075
- }), Et = ((e = {}, t = {}) => {
1188
+ }), Nt = ((e = {}, t = {}) => {
1076
1189
  let n = t.locale ?? y();
1077
1190
  return n === "nl" ? "Naar links draaien" : n === "de" ? "Nach links drehen" : "Rotate left";
1078
- }), Dt = ((e = {}, t = {}) => {
1191
+ }), Pt = ((e = {}, t = {}) => {
1079
1192
  let n = t.locale ?? y();
1080
1193
  return n === "nl" ? "Naar rechts draaien" : n === "de" ? "Nach rechts drehen" : "Rotate right";
1081
- }), Ot = ((e = {}, t = {}) => {
1194
+ }), Ft = ((e = {}, t = {}) => {
1082
1195
  let n = t.locale ?? y();
1083
1196
  return n === "nl" ? "Omlaag kantelen" : n === "de" ? "Nach unten kippen" : "Tilt down";
1084
- }), kt = ((e = {}, t = {}) => {
1197
+ }), It = ((e = {}, t = {}) => {
1085
1198
  let n = t.locale ?? y();
1086
1199
  return n === "nl" ? "Omhoog kantelen" : n === "de" ? "Nach oben kippen" : "Tilt up";
1087
- }), At = ((e = {}, t = {}) => {
1200
+ }), Lt = ((e = {}, t = {}) => {
1088
1201
  let n = t.locale ?? y();
1089
1202
  return n === "nl" ? "Inzoomen" : n === "de" ? "Hineinzoomen" : "Zoom in";
1090
- }), jt = ((e = {}, t = {}) => {
1203
+ }), Rt = ((e = {}, t = {}) => {
1091
1204
  let n = t.locale ?? y();
1092
1205
  return n === "nl" ? "Uitzoomen" : n === "de" ? "Herauszoomen" : "Zoom out";
1093
- }), Mt = ((e = {}, t = {}) => {
1206
+ }), zt = ((e = {}, t = {}) => {
1094
1207
  let n = t.locale ?? y();
1095
1208
  return n === "nl" ? "Sluiten" : n === "de" ? "Schließen" : "Close";
1096
- }), Nt = ((e = {}, t = {}) => {
1209
+ }), Bt = ((e = {}, t = {}) => {
1097
1210
  let n = t.locale ?? y();
1098
1211
  return n === "nl" ? "Configureren" : n === "de" ? "Konfigurieren" : "Configure";
1099
- }), Pt = ((e = {}, t = {}) => {
1212
+ }), Vt = ((e = {}, t = {}) => {
1100
1213
  let n = t.locale ?? y();
1101
1214
  return n === "nl" ? "Volledig scherm" : n === "de" ? "Vollbild" : "Fullscreen";
1102
- }), Ft = ((e = {}, t = {}) => {
1215
+ }), Ht = ((e = {}, t = {}) => {
1103
1216
  let n = t.locale ?? y();
1104
1217
  return n === "nl" ? "Sluiten" : n === "de" ? "Schließen" : "Close";
1105
- }), It = ((e = {}, t = {}) => {
1218
+ }), Ut = ((e = {}, t = {}) => {
1106
1219
  let n = t.locale ?? y();
1107
1220
  return n === "nl" ? "QR-code" : n === "de" ? "QR-Code" : "QR code";
1108
- }), Lt = ((e = {}, t = {}) => {
1221
+ }), Wt = ((e = {}, t = {}) => {
1109
1222
  let n = t.locale ?? y();
1110
1223
  return n === "nl" ? "Gebruik de camera van je smartphone om deze QR-code te scannen" : n === "de" ? "Verwende die Kamera deines Smartphones, um diesen QR-Code zu scannen" : "Use your smartphone camera to scan this QR code";
1111
- }), Rt = ((e = {}, t = {}) => {
1224
+ }), Gt = ((e = {}, t = {}) => {
1112
1225
  let n = t.locale ?? y();
1113
1226
  return n === "nl" ? "Je telefoon opent het 3D-model in AR-modus." : n === "de" ? "Dein Telefon öffnet das 3D-Modell im AR-Modus." : "Your phone will open the 3D model in AR mode.";
1114
- }), zt = ((e = {}, t = {}) => {
1227
+ }), Kt = ((e = {}, t = {}) => {
1115
1228
  let n = t.locale ?? y();
1116
1229
  return n === "nl" ? "Scan om in AR te bekijken" : n === "de" ? "Scannen für AR-Ansicht" : "Scan to view in AR";
1117
- }), Bt = ((e = {}, t = {}) => {
1230
+ }), qt = ((e = {}, t = {}) => {
1118
1231
  let n = t.locale ?? y();
1119
1232
  return n === "nl" ? "We kunnen de QR-code nu niet tonen. Open deze link op je telefoon:" : n === "de" ? "Wir können den QR-Code gerade nicht anzeigen. Öffne diesen Link auf deinem Handy:" : "We can't show the QR code right now. Open this link on your phone:";
1120
- }), Vt = ((e = {}, t = {}) => (t.locale ?? y(), "Screenshot")), Ht = ((e = {}, t = {}) => {
1233
+ }), Jt = ((e = {}, t = {}) => (t.locale ?? y(), "Screenshot")), Yt = ((e = {}, t = {}) => {
1121
1234
  let n = t.locale ?? y();
1122
1235
  return n === "nl" ? "Downloaden" : n === "de" ? "Herunterladen" : "Downloading";
1123
- }), Ut = ((e = {}, t = {}) => {
1236
+ }), Xt = ((e = {}, t = {}) => {
1124
1237
  let n = t.locale ?? y();
1125
1238
  return n === "nl" ? "Laden mislukt. Ververs de pagina om het opnieuw te proberen." : n === "de" ? "Laden fehlgeschlagen. Lade die Seite neu, um es erneut zu versuchen." : "Load failed. Refresh the page to try again.";
1126
- }), Wt = {
1239
+ }), Zt = {
1127
1240
  xmlns: "http://www.w3.org/2000/svg",
1128
1241
  width: 24,
1129
1242
  height: 24,
@@ -1133,50 +1246,50 @@ var mt = class {
1133
1246
  "stroke-width": 2,
1134
1247
  "stroke-linecap": "round",
1135
1248
  "stroke-linejoin": "round"
1136
- }, Gt = ([e, t, n]) => {
1249
+ }, Qt = ([e, t, n]) => {
1137
1250
  let r = document.createElementNS("http://www.w3.org/2000/svg", e);
1138
1251
  return Object.keys(t).forEach((e) => {
1139
1252
  r.setAttribute(e, String(t[e]));
1140
1253
  }), n?.length && n.forEach((e) => {
1141
- let t = Gt(e);
1254
+ let t = Qt(e);
1142
1255
  r.appendChild(t);
1143
1256
  }), r;
1144
- }, Kt = (e, t = {}) => Gt([
1257
+ }, $t = (e, t = {}) => Qt([
1145
1258
  "svg",
1146
1259
  {
1147
- ...Wt,
1260
+ ...Zt,
1148
1261
  ...t
1149
1262
  },
1150
1263
  e
1151
- ]), qt = [
1264
+ ]), en = [
1152
1265
  ["path", { d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" }],
1153
1266
  ["path", { d: "m3.3 7 8.7 5 8.7-5" }],
1154
1267
  ["path", { d: "M12 22V12" }]
1155
- ], Jt = [["path", { d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" }], ["circle", {
1268
+ ], tn = [["path", { d: "M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" }], ["circle", {
1156
1269
  cx: "12",
1157
1270
  cy: "13",
1158
1271
  r: "3"
1159
- }]], M = [["path", { d: "m6 9 6 6 6-6" }]], Yt = [["path", { d: "m15 18-6-6 6-6" }]], Xt = [["path", { d: "m9 18 6-6-6-6" }]], Zt = [["path", { d: "m18 15-6-6-6 6" }]], Qt = [
1272
+ }]], N = [["path", { d: "m6 9 6 6 6-6" }]], nn = [["path", { d: "m15 18-6-6 6-6" }]], rn = [["path", { d: "m9 18 6-6-6-6" }]], an = [["path", { d: "m18 15-6-6-6 6" }]], on = [
1160
1273
  ["path", { d: "M12.75 7.09a3 3 0 0 1 2.16 2.16" }],
1161
1274
  ["path", { d: "M17.072 17.072c-1.634 2.17-3.527 3.912-4.471 4.727a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 1.432-4.568" }],
1162
1275
  ["path", { d: "m2 2 20 20" }],
1163
1276
  ["path", { d: "M8.475 2.818A8 8 0 0 1 20 10c0 1.183-.31 2.377-.81 3.533" }],
1164
1277
  ["path", { d: "M9.13 9.13a3 3 0 0 0 3.74 3.74" }]
1165
- ], $t = [["path", { d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" }], ["circle", {
1278
+ ], sn = [["path", { d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0" }], ["circle", {
1166
1279
  cx: "12",
1167
1280
  cy: "10",
1168
1281
  r: "3"
1169
- }]], en = [
1282
+ }]], cn = [
1170
1283
  ["path", { d: "M15 3h6v6" }],
1171
1284
  ["path", { d: "m21 3-7 7" }],
1172
1285
  ["path", { d: "m3 21 7-7" }],
1173
1286
  ["path", { d: "M9 21H3v-6" }]
1174
- ], tn = [
1287
+ ], ln = [
1175
1288
  ["path", { d: "m14 10 7-7" }],
1176
1289
  ["path", { d: "M20 10h-6V4" }],
1177
1290
  ["path", { d: "m3 21 7-7" }],
1178
1291
  ["path", { d: "M4 14h6v6" }]
1179
- ], nn = [["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { d: "M3 3v5h5" }]], rn = [
1292
+ ], un = [["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { d: "M3 3v5h5" }]], dn = [
1180
1293
  ["path", { d: "M10 5H3" }],
1181
1294
  ["path", { d: "M12 19H3" }],
1182
1295
  ["path", { d: "M14 3v4" }],
@@ -1186,7 +1299,7 @@ var mt = class {
1186
1299
  ["path", { d: "M21 5h-7" }],
1187
1300
  ["path", { d: "M8 10v4" }],
1188
1301
  ["path", { d: "M8 12H3" }]
1189
- ], an = [["path", { d: "M18 6 6 18" }], ["path", { d: "m6 6 12 12" }]], on = [
1302
+ ], fn = [["path", { d: "M18 6 6 18" }], ["path", { d: "m6 6 12 12" }]], pn = [
1190
1303
  ["circle", {
1191
1304
  cx: "11",
1192
1305
  cy: "11",
@@ -1210,7 +1323,7 @@ var mt = class {
1210
1323
  y1: "11",
1211
1324
  y2: "11"
1212
1325
  }]
1213
- ], sn = [
1326
+ ], mn = [
1214
1327
  ["circle", {
1215
1328
  cx: "11",
1216
1329
  cy: "11",
@@ -1230,31 +1343,31 @@ var mt = class {
1230
1343
  }]
1231
1344
  ];
1232
1345
  // ../ui/src/icons.ts
1233
- function N(e, { size: t = 20, strokeWidth: n = 1.75 } = {}) {
1234
- return Kt(e, {
1346
+ function P(e, { size: t = 20, strokeWidth: n = 1.75 } = {}) {
1347
+ return $t(e, {
1235
1348
  width: t,
1236
1349
  height: t,
1237
1350
  "stroke-width": n
1238
1351
  });
1239
1352
  }
1240
- var P = {
1241
- ar: (e) => N(qt, e),
1242
- annotations: (e) => N($t, e),
1243
- annotationsOff: (e) => N(Qt, e),
1244
- fullscreen: (e) => N(en, e),
1245
- exitFullscreen: (e) => N(tn, e),
1246
- screenshot: (e) => N(Jt, e),
1247
- tiltUp: (e) => N(Zt, e),
1248
- tiltDown: (e) => N(M, e),
1249
- rotateLeft: (e) => N(Yt, e),
1250
- rotateRight: (e) => N(Xt, e),
1251
- zoomIn: (e) => N(on, e),
1252
- zoomOut: (e) => N(sn, e),
1253
- reset: (e) => N(nn, e),
1254
- configurator: (e) => N(rn, e),
1255
- close: (e) => N(an, e),
1256
- expand: (e) => N(M, e)
1257
- }, F = class {
1353
+ var F = {
1354
+ ar: (e) => P(en, e),
1355
+ annotations: (e) => P(sn, e),
1356
+ annotationsOff: (e) => P(on, e),
1357
+ fullscreen: (e) => P(cn, e),
1358
+ exitFullscreen: (e) => P(ln, e),
1359
+ screenshot: (e) => P(tn, e),
1360
+ tiltUp: (e) => P(an, e),
1361
+ tiltDown: (e) => P(N, e),
1362
+ rotateLeft: (e) => P(nn, e),
1363
+ rotateRight: (e) => P(rn, e),
1364
+ zoomIn: (e) => P(pn, e),
1365
+ zoomOut: (e) => P(mn, e),
1366
+ reset: (e) => P(un, e),
1367
+ configurator: (e) => P(dn, e),
1368
+ close: (e) => P(fn, e),
1369
+ expand: (e) => P(N, e)
1370
+ }, I = class {
1258
1371
  element;
1259
1372
  constructor({ variant: e = "default", size: t = "default", label: n, icon: r, onClick: i, disabled: a = !1 } = {}) {
1260
1373
  this.element = document.createElement("button"), this.element.className = `ui-btn ui-btn--${e} ui-btn--size-${t}`, n !== void 0 && (this.element.setAttribute("aria-label", n), this.element.title = n), r === void 0 ? n !== void 0 && (this.element.textContent = n) : this.element.appendChild(r), i && this.element.addEventListener("click", i), this.element.disabled = a;
@@ -1265,11 +1378,11 @@ var P = {
1265
1378
  }
1266
1379
  };
1267
1380
  // ../ui/src/vanilla/components/loading-indicator/wireframe-cube.ts
1268
- function cn(e) {
1381
+ function hn(e) {
1269
1382
  let t = Math.max(0, Math.min(1, e));
1270
1383
  return t * t * (3 - 2 * t);
1271
1384
  }
1272
- function ln(e, t, n, r, i, a) {
1385
+ function gn(e, t, n, r, i, a) {
1273
1386
  let [o, s, c] = e, l = Math.cos(t), u = Math.sin(t), ee = l * o + u * c, d = -u * o + l * c, f = Math.cos(n), p = Math.sin(n), te = f * s - p * d, ne = p * s + f * d, m = .55;
1274
1387
  return [
1275
1388
  r + ee * a * m,
@@ -1277,81 +1390,81 @@ function ln(e, t, n, r, i, a) {
1277
1390
  ne
1278
1391
  ];
1279
1392
  }
1280
- function un(e, t, n) {
1393
+ function _n(e, t, n) {
1281
1394
  e.beginPath(), e.moveTo(t[0], t[1]), e.lineTo(n[0], n[1]), e.lineWidth = 2, e.stroke();
1282
1395
  }
1283
- function dn(e, t, n, r, i) {
1396
+ function vn(e, t, n, r, i) {
1284
1397
  let a = t(n), o = t(r);
1285
- un(e, a, [
1398
+ _n(e, a, [
1286
1399
  a[0] + (o[0] - a[0]) * i,
1287
1400
  a[1] + (o[1] - a[1]) * i,
1288
1401
  a[2]
1289
1402
  ]);
1290
1403
  }
1291
- var I = [
1404
+ var L = [
1292
1405
  -1,
1293
1406
  -1,
1294
1407
  1
1295
- ], L = [
1408
+ ], R = [
1296
1409
  1,
1297
1410
  -1,
1298
1411
  1
1299
- ], R = [
1412
+ ], z = [
1300
1413
  1,
1301
1414
  -1,
1302
1415
  -1
1303
- ], z = [
1416
+ ], B = [
1304
1417
  -1,
1305
1418
  -1,
1306
1419
  -1
1307
- ], B = [
1420
+ ], V = [
1308
1421
  -1,
1309
1422
  1,
1310
1423
  1
1311
- ], V = [
1424
+ ], H = [
1312
1425
  1,
1313
1426
  1,
1314
1427
  1
1315
- ], H = [
1428
+ ], U = [
1316
1429
  1,
1317
1430
  1,
1318
1431
  -1
1319
- ], U = [
1432
+ ], W = [
1320
1433
  -1,
1321
1434
  1,
1322
1435
  -1
1323
- ], W = [
1324
- [I, L],
1436
+ ], G = [
1325
1437
  [L, R],
1326
1438
  [R, z],
1327
- [z, I],
1328
- [I, B],
1439
+ [z, B],
1440
+ [B, L],
1329
1441
  [L, V],
1330
1442
  [R, H],
1331
1443
  [z, U],
1332
- [B, V],
1444
+ [B, W],
1333
1445
  [V, H],
1334
1446
  [H, U],
1335
- [U, B]
1447
+ [U, W],
1448
+ [W, V]
1336
1449
  ];
1337
- function fn(e) {
1338
- let t = e % 6 / 6, n = W.length;
1339
- return t < .35 ? cn(t / .35) * n : t < .55 ? n : t < .9 ? (1 - cn((t - .55) / .35)) * n : 0;
1450
+ function yn(e) {
1451
+ let t = e % 6 / 6, n = G.length;
1452
+ return t < .35 ? hn(t / .35) * n : t < .55 ? n : t < .9 ? (1 - hn((t - .55) / .35)) * n : 0;
1340
1453
  }
1341
- function pn(e, { width: t, height: n }, r, i = "#000") {
1342
- let a = t / 2, o = n * .44, s = Math.min(t, n) * .08, c = (e) => ln(e, .785, .615, a, o, s), l = fn(r);
1454
+ function bn(e, { width: t, height: n }, r, i = "#000") {
1455
+ let a = t / 2, o = n * .44, s = Math.min(t, n) * .08, c = (e) => gn(e, .785, .615, a, o, s), l = yn(r);
1343
1456
  e.shadowBlur = 5, e.shadowColor = "rgba(30,30,30,0.08)", e.strokeStyle = i;
1344
- for (let t = 0; t < W.length && !(t >= l); t++) {
1345
- let n = W[t];
1457
+ for (let t = 0; t < G.length && !(t >= l); t++) {
1458
+ let n = G[t];
1346
1459
  if (n === void 0) continue;
1347
1460
  let r = Math.min(1, l - t);
1348
- dn(e, c, n[0], n[1], r);
1461
+ vn(e, c, n[0], n[1], r);
1349
1462
  }
1350
1463
  e.shadowBlur = 0;
1351
1464
  }
1352
1465
  // ../ui/src/vanilla/components/loading-indicator/index.ts
1353
- var mn = 400, hn = 3e4, gn = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
1354
- function _n(e) {
1466
+ var xn = 400, Sn = 3e4, Cn = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif";
1467
+ function wn(e) {
1355
1468
  let t = getComputedStyle(e).color, n = t === "" ? "#000" : t;
1356
1469
  return {
1357
1470
  surface: "transparent",
@@ -1359,7 +1472,7 @@ function _n(e) {
1359
1472
  danger: n
1360
1473
  };
1361
1474
  }
1362
- function vn(e, t) {
1475
+ function Tn(e, t) {
1363
1476
  let n = document.createElement("div");
1364
1477
  Object.assign(n.style, {
1365
1478
  position: "absolute",
@@ -1395,13 +1508,13 @@ function vn(e, t) {
1395
1508
  fontWeight: "400",
1396
1509
  color: e.ink,
1397
1510
  fontVariantNumeric: "tabular-nums",
1398
- fontFamily: gn
1511
+ fontFamily: Cn
1399
1512
  });
1400
1513
  let o = document.createElement("span");
1401
1514
  return Object.assign(o.style, {
1402
1515
  fontSize: "13px",
1403
1516
  color: e.ink,
1404
- fontFamily: gn
1517
+ fontFamily: Cn
1405
1518
  }), o.textContent = t, i.appendChild(a), i.appendChild(o), n.appendChild(r), n.appendChild(i), {
1406
1519
  overlay: n,
1407
1520
  canvas: r,
@@ -1409,7 +1522,7 @@ function vn(e, t) {
1409
1522
  phaseEl: o
1410
1523
  };
1411
1524
  }
1412
- var yn = class {
1525
+ var En = class {
1413
1526
  overlay;
1414
1527
  canvas;
1415
1528
  ctx;
@@ -1426,13 +1539,13 @@ var yn = class {
1426
1539
  colours;
1427
1540
  text;
1428
1541
  constructor(e, t) {
1429
- this.startTime = performance.now(), this.colours = t.colours ?? _n(e), this.text = t.text;
1430
- let n = vn(this.colours, this.text.downloading());
1542
+ this.startTime = performance.now(), this.colours = t.colours ?? wn(e), this.text = t.text;
1543
+ let n = Tn(this.colours, this.text.downloading());
1431
1544
  this.overlay = n.overlay, t.className !== void 0 && (this.overlay.className = t.className), this.canvas = n.canvas, this.pctEl = n.pctEl, this.phaseEl = n.phaseEl, e.appendChild(this.overlay), this.ctx = this.canvas.getContext("2d"), this.ctx !== null && (this.sizeCanvas(), this.tick()), this.showTimerId = setTimeout(() => {
1432
1545
  this.reveal();
1433
- }, mn), this.noSignalTimerId = setTimeout(() => {
1546
+ }, xn), this.noSignalTimerId = setTimeout(() => {
1434
1547
  this.hidden || (this.noSignalErrored = !0, this.showError(this.text.loadError()));
1435
- }, hn);
1548
+ }, Sn);
1436
1549
  }
1437
1550
  viewerAlive() {
1438
1551
  this.cancelNoSignalTimer(), this.noSignalErrored && this.recoverFromNoSignal();
@@ -1484,12 +1597,12 @@ var yn = class {
1484
1597
  drawFrame() {
1485
1598
  if (this.ctx === null) return;
1486
1599
  let e = this.canvas.width / Math.min(devicePixelRatio, 2), t = this.canvas.height / Math.min(devicePixelRatio, 2), n = (performance.now() - this.startTime) / 1e3;
1487
- this.ctx.clearRect(0, 0, e, t), pn(this.ctx, {
1600
+ this.ctx.clearRect(0, 0, e, t), bn(this.ctx, {
1488
1601
  width: e,
1489
1602
  height: t
1490
1603
  }, n, this.colours.ink);
1491
1604
  }
1492
- }, bn = class {
1605
+ }, Dn = class {
1493
1606
  element;
1494
1607
  selectCallback = null;
1495
1608
  constructor(e, t, n) {
@@ -1516,7 +1629,7 @@ var yn = class {
1516
1629
  t.disabled = !n, t.setAttribute("aria-disabled", n ? "false" : "true");
1517
1630
  }
1518
1631
  }
1519
- }, xn = class {
1632
+ }, On = class {
1520
1633
  element;
1521
1634
  select;
1522
1635
  constructor(e, t, n, r, i) {
@@ -1529,7 +1642,7 @@ var yn = class {
1529
1642
  a.value = n, a.textContent = i?.[e] ?? n, n === r && (a.selected = !0, o = !0), this.select.appendChild(a);
1530
1643
  }
1531
1644
  o || (a.selected = !0);
1532
- let s = Kt(M, {
1645
+ let s = $t(N, {
1533
1646
  width: 16,
1534
1647
  height: 16,
1535
1648
  "stroke-width": 2
@@ -1547,7 +1660,7 @@ var yn = class {
1547
1660
  setEnabled(e) {
1548
1661
  for (let t of this.select.options) t.value !== "" && (t.disabled = e !== null && !e.includes(t.value));
1549
1662
  }
1550
- }, Sn = class {
1663
+ }, kn = class {
1551
1664
  element;
1552
1665
  input;
1553
1666
  valueText;
@@ -1608,7 +1721,7 @@ var yn = class {
1608
1721
  let t = this.labelAt(e);
1609
1722
  return this.options.unit === void 0 ? t : `${t} ${this.options.unit}`;
1610
1723
  }
1611
- }, G = {
1724
+ }, K = {
1612
1725
  neutral: {
1613
1726
  50: "oklch(98.5% 0 0)",
1614
1727
  100: "oklch(96.5% 0 0)",
@@ -1624,7 +1737,7 @@ var yn = class {
1624
1737
  },
1625
1738
  white: "oklch(100% 0 0)",
1626
1739
  semantic: { error: "oklch(47% 0.17 25)" }
1627
- }, K = {
1740
+ }, q = {
1628
1741
  px: "1px",
1629
1742
  0: "0",
1630
1743
  .5: "0.125rem",
@@ -1646,7 +1759,7 @@ var yn = class {
1646
1759
  16: "4rem",
1647
1760
  20: "5rem",
1648
1761
  24: "6rem"
1649
- }, q = {
1762
+ }, J = {
1650
1763
  fontFamily: {
1651
1764
  sans: [
1652
1765
  "Mona Sans",
@@ -1685,25 +1798,25 @@ var yn = class {
1685
1798
  normal: "1.5",
1686
1799
  relaxed: "1.75"
1687
1800
  }
1688
- }, Cn = class {
1801
+ }, An = class {
1689
1802
  element;
1690
1803
  constructor() {
1691
1804
  this.element = document.createElement("div"), Object.assign(this.element.style, {
1692
- background: G.white,
1805
+ background: K.white,
1693
1806
  borderRadius: "var(--radius)",
1694
- padding: K[6],
1695
- boxShadow: `0 ${K[2]} ${K[8]} oklch(0% 0 0 / 20%)`,
1807
+ padding: q[6],
1808
+ boxShadow: `0 ${q[2]} ${q[8]} oklch(0% 0 0 / 20%)`,
1696
1809
  maxWidth: "20rem",
1697
1810
  width: "100%"
1698
1811
  });
1699
1812
  }
1700
- }, wn = class {
1813
+ }, jn = class {
1701
1814
  options;
1702
1815
  card;
1703
1816
  backdrop;
1704
1817
  keyHandler = null;
1705
1818
  constructor(e = {}) {
1706
- this.options = e, this.card = new Cn(), this.backdrop = this.createBackdrop(), this.backdrop.appendChild(this.card.element);
1819
+ this.options = e, this.card = new An(), this.backdrop = this.createBackdrop(), this.backdrop.appendChild(this.card.element);
1707
1820
  }
1708
1821
  get content() {
1709
1822
  return this.card.element;
@@ -1720,7 +1833,7 @@ var yn = class {
1720
1833
  let e = document.createElement("div");
1721
1834
  return Object.assign(e.style, {
1722
1835
  position: "fixed",
1723
- inset: K[0],
1836
+ inset: q[0],
1724
1837
  background: "oklch(0% 0 0 / 50%)",
1725
1838
  zIndex: "9999",
1726
1839
  display: "flex",
@@ -1730,7 +1843,7 @@ var yn = class {
1730
1843
  t.target === e && this.close();
1731
1844
  }), e;
1732
1845
  }
1733
- }, J = q.fontFamily.sans.join(", "), Tn = `
1846
+ }, Y = J.fontFamily.sans.join(", "), Mn = `
1734
1847
  :root {
1735
1848
  --primary: oklch(5% 0 0);
1736
1849
  --primary-foreground: oklch(100% 0 0);
@@ -1754,7 +1867,7 @@ var yn = class {
1754
1867
  gap: 0.5rem;
1755
1868
  border: 1px solid transparent;
1756
1869
  border-radius: var(--radius);
1757
- font-family: ${J};
1870
+ font-family: ${Y};
1758
1871
  font-size: 0.875rem;
1759
1872
  font-weight: 600;
1760
1873
  white-space: nowrap;
@@ -1811,7 +1924,7 @@ var yn = class {
1811
1924
  border-radius: var(--radius);
1812
1925
  background: var(--background);
1813
1926
  color: var(--foreground);
1814
- font-family: ${J};
1927
+ font-family: ${Y};
1815
1928
  font-size: 0.875rem;
1816
1929
  font-weight: 600;
1817
1930
  cursor: pointer;
@@ -1852,7 +1965,7 @@ var yn = class {
1852
1965
  background: var(--background);
1853
1966
  appearance: none;
1854
1967
  color: var(--foreground);
1855
- font-family: ${J};
1968
+ font-family: ${Y};
1856
1969
  font-size: 0.875rem;
1857
1970
  font-weight: 400;
1858
1971
  cursor: pointer;
@@ -1890,7 +2003,7 @@ var yn = class {
1890
2003
 
1891
2004
  /* Tabular figures keep the readout and layout steady mid-drag. */
1892
2005
  .ui-slider-value {
1893
- font-family: ${J};
2006
+ font-family: ${Y};
1894
2007
  font-size: 0.875rem;
1895
2008
  font-weight: 600;
1896
2009
  color: var(--foreground);
@@ -1901,7 +2014,7 @@ var yn = class {
1901
2014
  .ui-slider-ends {
1902
2015
  display: flex;
1903
2016
  justify-content: space-between;
1904
- font-family: ${J};
2017
+ font-family: ${Y};
1905
2018
  font-size: 0.75rem;
1906
2019
  color: var(--muted-foreground);
1907
2020
  font-variant-numeric: tabular-nums;
@@ -2037,7 +2150,7 @@ var yn = class {
2037
2150
  border: 2px solid oklch(100% 0 0);
2038
2151
  background: var(--primary);
2039
2152
  color: var(--primary-foreground);
2040
- font-family: ${J};
2153
+ font-family: ${Y};
2041
2154
  font-size: 0.8125rem;
2042
2155
  font-weight: 600;
2043
2156
  cursor: pointer;
@@ -2126,7 +2239,7 @@ var yn = class {
2126
2239
  }
2127
2240
 
2128
2241
  .vd-annotation-popup-title {
2129
- font-family: ${J};
2242
+ font-family: ${Y};
2130
2243
  font-size: 0.875rem;
2131
2244
  font-weight: 600;
2132
2245
  line-height: 1.25rem;
@@ -2174,7 +2287,7 @@ button.vd-annotation-popup-title:focus-visible {
2174
2287
  }
2175
2288
 
2176
2289
  .vd-annotation-popup-description {
2177
- font-family: ${J};
2290
+ font-family: ${Y};
2178
2291
  font-size: 0.8125rem;
2179
2292
  font-weight: 400;
2180
2293
  line-height: 1.125rem;
@@ -2213,41 +2326,41 @@ button.vd-annotation-popup-title:focus-visible {
2213
2326
  0%, 100% { opacity: 1; }
2214
2327
  50% { opacity: 0.55; }
2215
2328
  }
2216
- `, En = !1;
2217
- function Dn() {
2218
- if (En || typeof document > "u") return;
2219
- En = !0;
2329
+ `, Nn = !1;
2330
+ function Pn() {
2331
+ if (Nn || typeof document > "u") return;
2332
+ Nn = !0;
2220
2333
  let e = document.createElement("style");
2221
- e.id = "vd-ui-vanilla", e.textContent = Tn, document.head.appendChild(e);
2334
+ e.id = "vd-ui-vanilla", e.textContent = Mn, document.head.appendChild(e);
2222
2335
  }
2223
2336
  // ../ui/src/vanilla/composites/qr-modal/index.ts
2224
- var On = q.fontFamily.sans.join(", "), kn = class {
2337
+ var Fn = J.fontFamily.sans.join(", "), In = class {
2225
2338
  qrLib = null;
2226
2339
  dialog = null;
2227
2340
  qrSlot = null;
2228
2341
  show() {
2229
- this.hide(), Dn(), this.dialog = new wn({ onClose: () => {
2342
+ this.hide(), Pn(), this.dialog = new jn({ onClose: () => {
2230
2343
  this.dialog = null, this.qrSlot = null;
2231
2344
  } }), Object.assign(this.dialog.content.style, {
2232
2345
  display: "flex",
2233
2346
  flexDirection: "column",
2234
2347
  alignItems: "center",
2235
- gap: K[3],
2236
- fontFamily: On
2237
- }), this.dialog.content.appendChild(this.createText(zt(), {
2238
- fontSize: q.fontSize.base,
2239
- fontWeight: q.fontWeight.semibold,
2240
- color: G.neutral[900]
2241
- })), this.dialog.content.appendChild(this.createText(Lt(), {
2242
- fontSize: q.fontSize.sm,
2243
- color: G.neutral[600]
2244
- })), this.qrSlot = this.createQrSlot(), this.dialog.content.appendChild(this.qrSlot), this.dialog.content.appendChild(this.createText(Rt(), {
2245
- fontSize: q.fontSize.xs,
2246
- color: G.neutral[500]
2348
+ gap: q[3],
2349
+ fontFamily: Fn
2350
+ }), this.dialog.content.appendChild(this.createText(Kt(), {
2351
+ fontSize: J.fontSize.base,
2352
+ fontWeight: J.fontWeight.semibold,
2353
+ color: K.neutral[900]
2354
+ })), this.dialog.content.appendChild(this.createText(Wt(), {
2355
+ fontSize: J.fontSize.sm,
2356
+ color: K.neutral[600]
2357
+ })), this.qrSlot = this.createQrSlot(), this.dialog.content.appendChild(this.qrSlot), this.dialog.content.appendChild(this.createText(Gt(), {
2358
+ fontSize: J.fontSize.xs,
2359
+ color: K.neutral[500]
2247
2360
  }));
2248
- let e = new F({
2361
+ let e = new I({
2249
2362
  variant: "outline",
2250
- label: Ft(),
2363
+ label: Ht(),
2251
2364
  onClick: () => {
2252
2365
  this.hide();
2253
2366
  }
@@ -2257,7 +2370,7 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2257
2370
  async update(t) {
2258
2371
  let n;
2259
2372
  try {
2260
- this.qrLib ??= await import("./browser-xDScqAR5.js").then((t) => /* @__PURE__ */ e(t.default, 1)), n = await this.qrLib.toDataURL(t, {
2373
+ this.qrLib ??= await import("./browser-DSuT5Y7h.js").then((t) => /* @__PURE__ */ e(t.default, 1)), n = await this.qrLib.toDataURL(t, {
2261
2374
  width: 256,
2262
2375
  margin: 4,
2263
2376
  errorCorrectionLevel: "M",
@@ -2272,12 +2385,12 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2272
2385
  return this.qrSlot !== null && (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createQrImage(n)), !0);
2273
2386
  }
2274
2387
  showLink(e) {
2275
- this.qrSlot !== null && (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createText(Bt(), {
2276
- fontSize: q.fontSize.sm,
2277
- color: G.neutral[600]
2388
+ this.qrSlot !== null && (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createText(qt(), {
2389
+ fontSize: J.fontSize.sm,
2390
+ color: K.neutral[600]
2278
2391
  }), this.createText(e, {
2279
- fontSize: q.fontSize.xs,
2280
- color: G.neutral[900],
2392
+ fontSize: J.fontSize.xs,
2393
+ color: K.neutral[900],
2281
2394
  overflowWrap: "anywhere",
2282
2395
  userSelect: "all"
2283
2396
  })));
@@ -2299,9 +2412,9 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2299
2412
  }
2300
2413
  createQrImage(e) {
2301
2414
  let t = document.createElement("img");
2302
- return t.src = e, t.alt = It(), t;
2415
+ return t.src = e, t.alt = Ut(), t;
2303
2416
  }
2304
- }, An = class {
2417
+ }, Ln = class {
2305
2418
  options;
2306
2419
  element;
2307
2420
  arBtn = null;
@@ -2318,7 +2431,7 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2318
2431
  }, document.addEventListener("fullscreenchange", this.onFullscreenChange);
2319
2432
  }
2320
2433
  setFullscreenIcon(e) {
2321
- this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(e ? P.exitFullscreen() : P.fullscreen());
2434
+ this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(e ? F.exitFullscreen() : F.fullscreen());
2322
2435
  }
2323
2436
  syncButton(e, t, n) {
2324
2437
  if (t && e === null) {
@@ -2328,19 +2441,19 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2328
2441
  return !t && e !== null ? (e.element.remove(), null) : e;
2329
2442
  }
2330
2443
  applySettings(e) {
2331
- this.arBtn = this.syncButton(this.arBtn, e.ar !== !1 && this.options.onAr !== void 0, () => new F({
2444
+ this.arBtn = this.syncButton(this.arBtn, e.ar !== !1 && this.options.onAr !== void 0, () => new I({
2332
2445
  variant: "outline",
2333
2446
  size: "icon",
2334
- label: wt(),
2335
- icon: P.ar(),
2447
+ label: jt(),
2448
+ icon: F.ar(),
2336
2449
  onClick: () => {
2337
2450
  this.options.onAr?.();
2338
2451
  }
2339
- })), this.fullscreenBtn = this.syncButton(this.fullscreenBtn, e.fullscreen !== !1 && this.options.onFullscreen !== void 0, () => new F({
2452
+ })), this.fullscreenBtn = this.syncButton(this.fullscreenBtn, e.fullscreen !== !1 && this.options.onFullscreen !== void 0, () => new I({
2340
2453
  variant: "outline",
2341
2454
  size: "icon",
2342
- label: Pt(),
2343
- icon: P.fullscreen(),
2455
+ label: Vt(),
2456
+ icon: F.fullscreen(),
2344
2457
  onClick: () => {
2345
2458
  this.options.onFullscreen?.();
2346
2459
  }
@@ -2348,11 +2461,11 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2348
2461
  let t = e.annotations === "toggle-shown" || e.annotations === "toggle-hidden";
2349
2462
  this.annotationsBtn = this.syncButton(this.annotationsBtn, t && this.options.onAnnotationsToggle !== void 0, () => {
2350
2463
  this.annotationsShown = e.annotations === "toggle-shown";
2351
- let t = new F({
2464
+ let t = new I({
2352
2465
  variant: "outline",
2353
2466
  size: "icon",
2354
- label: Ct(),
2355
- icon: this.annotationsShown ? P.annotations() : P.annotationsOff(),
2467
+ label: At(),
2468
+ icon: this.annotationsShown ? F.annotations() : F.annotationsOff(),
2356
2469
  onClick: () => {
2357
2470
  this.flipAnnotations();
2358
2471
  }
@@ -2361,12 +2474,12 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2361
2474
  });
2362
2475
  }
2363
2476
  flipAnnotations() {
2364
- this.annotationsShown = !this.annotationsShown, this.annotationsBtn?.element.setAttribute("aria-pressed", String(this.annotationsShown)), this.annotationsBtn?.setIcon(this.annotationsShown ? P.annotations() : P.annotationsOff()), this.options.onAnnotationsToggle?.(this.annotationsShown);
2477
+ this.annotationsShown = !this.annotationsShown, this.annotationsBtn?.element.setAttribute("aria-pressed", String(this.annotationsShown)), this.annotationsBtn?.setIcon(this.annotationsShown ? F.annotations() : F.annotationsOff()), this.options.onAnnotationsToggle?.(this.annotationsShown);
2365
2478
  }
2366
2479
  destroy() {
2367
2480
  document.removeEventListener("fullscreenchange", this.onFullscreenChange);
2368
2481
  }
2369
- }, Y = .5, jn = class e {
2482
+ }, X = .5, Rn = class e {
2370
2483
  element;
2371
2484
  constructor(t, n) {
2372
2485
  this.element = Object.assign(document.createElement("div"), { className: "vd-camera-controls" });
@@ -2375,9 +2488,9 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2375
2488
  targetTilt: n.tilt,
2376
2489
  targetZoom: n.zoom,
2377
2490
  thetaOffset: 0
2378
- }, i = Ln(t, n, r);
2491
+ }, i = Wn(t, n, r);
2379
2492
  n.onChange((e) => {
2380
- r.targetRotation = e.rotation - r.thetaOffset, r.targetTilt = e.tilt, r.targetZoom = e.zoom, Rn(i, n, e);
2493
+ r.targetRotation = e.rotation - r.thetaOffset, r.targetTilt = e.tilt, r.targetZoom = e.zoom, Gn(i, n, e);
2381
2494
  }), this.element.appendChild(e.buildZoom(i.zoomOut, i.zoomIn)), this.element.appendChild(e.buildDpad(i.tiltUp, i.rotateLeft, i.reset, i.rotateRight, i.tiltDown));
2382
2495
  }
2383
2496
  static buildZoom(e, t) {
@@ -2397,18 +2510,18 @@ var On = q.fontFamily.sans.join(", "), kn = class {
2397
2510
  return a;
2398
2511
  }
2399
2512
  };
2400
- function Mn(e, t) {
2513
+ function zn(e, t) {
2401
2514
  let n = e;
2402
2515
  for (; n < t;) n += 360;
2403
2516
  for (; n >= t + 360;) n -= 360;
2404
2517
  return n;
2405
2518
  }
2406
- function Nn(e, t, n) {
2407
- let r = Mn(e, t);
2519
+ function Bn(e, t, n) {
2520
+ let r = zn(e, t);
2408
2521
  return r <= n ? r : r - n <= t + 360 - r ? n : t;
2409
2522
  }
2410
- function X(e, t, n) {
2411
- return new F({
2523
+ function Z(e, t, n) {
2524
+ return new I({
2412
2525
  variant: "outline",
2413
2526
  size: "icon",
2414
2527
  label: e,
@@ -2416,14 +2529,14 @@ function X(e, t, n) {
2416
2529
  onClick: n
2417
2530
  });
2418
2531
  }
2419
- function Pn(e, t) {
2532
+ function Vn(e, t) {
2420
2533
  return Math.max(e.limits?.minZoom ?? 1, Math.min(e.limits?.maxZoom ?? Infinity, t));
2421
2534
  }
2422
- function Fn(e, t) {
2535
+ function Hn(e, t) {
2423
2536
  let n = e.limits?.minRotate, r = e.limits?.maxRotate;
2424
- return n === void 0 || r === void 0 || r - n >= 360 ? t : Nn(t, n, r);
2537
+ return n === void 0 || r === void 0 || r - n >= 360 ? t : Bn(t, n, r);
2425
2538
  }
2426
- function In(e, t, n, r) {
2539
+ function Un(e, t, n, r) {
2427
2540
  let i = t.limits?.minTilt, a = t.limits?.maxTilt;
2428
2541
  if (i !== void 0 || a !== void 0) {
2429
2542
  n.targetTilt = Math.max(i ?? 0, Math.min(a ?? 180, n.targetTilt + r)), e.tilt(n.targetTilt).set();
@@ -2432,50 +2545,50 @@ function In(e, t, n, r) {
2432
2545
  let o = n.targetTilt + r;
2433
2546
  o > 180 || o < 0 ? (n.targetTilt = o > 180 ? 360 - o : -o, n.thetaOffset = (n.thetaOffset + 180) % 360, e.tilt(n.targetTilt).rotate(n.targetRotation + n.thetaOffset).set()) : (n.targetTilt = o, e.tilt(n.targetTilt).set());
2434
2547
  }
2435
- function Ln(e, t, n) {
2548
+ function Wn(e, t, n) {
2436
2549
  let r = (r) => {
2437
- n.targetZoom = Pn(t, n.targetZoom + r), e.zoom(n.targetZoom).set();
2550
+ n.targetZoom = Vn(t, n.targetZoom + r), e.zoom(n.targetZoom).set();
2438
2551
  }, i = (r) => {
2439
- n.targetRotation = Fn(t, n.targetRotation + r), e.rotate(n.targetRotation + n.thetaOffset).set();
2552
+ n.targetRotation = Hn(t, n.targetRotation + r), e.rotate(n.targetRotation + n.thetaOffset).set();
2440
2553
  };
2441
2554
  return {
2442
- zoomOut: X(jt(), P.zoomOut(), () => {
2555
+ zoomOut: Z(Rt(), F.zoomOut(), () => {
2443
2556
  r(-10);
2444
2557
  }),
2445
- zoomIn: X(At(), P.zoomIn(), () => {
2558
+ zoomIn: Z(Lt(), F.zoomIn(), () => {
2446
2559
  r(10);
2447
2560
  }),
2448
- tiltUp: X(kt(), P.tiltUp(), () => {
2449
- In(e, t, n, -15);
2561
+ tiltUp: Z(It(), F.tiltUp(), () => {
2562
+ Un(e, t, n, -15);
2450
2563
  }),
2451
- rotateLeft: X(Et(), P.rotateLeft(), () => {
2564
+ rotateLeft: Z(Nt(), F.rotateLeft(), () => {
2452
2565
  i(-15);
2453
2566
  }),
2454
- reset: X(Tt(), P.reset(), () => {
2567
+ reset: Z(Mt(), F.reset(), () => {
2455
2568
  n.thetaOffset = 0, e.reset();
2456
2569
  }),
2457
- rotateRight: X(Dt(), P.rotateRight(), () => {
2570
+ rotateRight: Z(Pt(), F.rotateRight(), () => {
2458
2571
  i(15);
2459
2572
  }),
2460
- tiltDown: X(Ot(), P.tiltDown(), () => {
2461
- In(e, t, n, 15);
2573
+ tiltDown: Z(Ft(), F.tiltDown(), () => {
2574
+ Un(e, t, n, 15);
2462
2575
  })
2463
2576
  };
2464
2577
  }
2465
- function Rn(e, t, n) {
2578
+ function Gn(e, t, n) {
2466
2579
  let r = t.limits;
2467
2580
  if (r === void 0) return;
2468
- e.zoomOut.element.disabled = r.minZoom !== void 0 && n.zoom <= r.minZoom + Y, e.zoomIn.element.disabled = r.maxZoom !== void 0 && n.zoom >= r.maxZoom - Y, e.tiltUp.element.disabled = r.minTilt !== void 0 && n.tilt <= r.minTilt + Y, e.tiltDown.element.disabled = r.maxTilt !== void 0 && n.tilt >= r.maxTilt - Y;
2581
+ e.zoomOut.element.disabled = r.minZoom !== void 0 && n.zoom <= r.minZoom + X, e.zoomIn.element.disabled = r.maxZoom !== void 0 && n.zoom >= r.maxZoom - X, e.tiltUp.element.disabled = r.minTilt !== void 0 && n.tilt <= r.minTilt + X, e.tiltDown.element.disabled = r.maxTilt !== void 0 && n.tilt >= r.maxTilt - X;
2469
2582
  let { minRotate: i, maxRotate: a } = r;
2470
2583
  if (i === void 0 || a === void 0 || a - i >= 360) {
2471
2584
  e.rotateLeft.element.disabled = !1, e.rotateRight.element.disabled = !1;
2472
2585
  return;
2473
2586
  }
2474
- let o = Mn(n.rotation, i);
2475
- e.rotateLeft.element.disabled = o <= i + Y, e.rotateRight.element.disabled = o >= a - Y;
2587
+ let o = zn(n.rotation, i);
2588
+ e.rotateLeft.element.disabled = o <= i + X, e.rotateRight.element.disabled = o >= a - X;
2476
2589
  }
2477
2590
  // ../client-core/src/client/events.ts
2478
- var Z = {
2591
+ var Q = {
2479
2592
  SELECT: "vd:select",
2480
2593
  SELECTED: "vd:selected",
2481
2594
  FOCUS_CHANGE: "vd:focus-change",
@@ -2483,8 +2596,8 @@ var Z = {
2483
2596
  CONFIGURATION_SUBMIT: "vd:configuration-submit"
2484
2597
  };
2485
2598
  // ../client-core/src/ui/controls/measurement-group.ts
2486
- function zn(e, t, n, r, i, a, o) {
2487
- let s = e.values.find((t) => n.getValue(e.name, t)?.isSelected === !0) ?? e.defaultValue, c = new Sn(e.values, {
2599
+ function Kn(e, t, n, r, i, a, o) {
2600
+ let s = e.values.find((t) => n.getValue(e.name, t)?.isSelected === !0) ?? e.defaultValue, c = new kn(e.values, {
2488
2601
  label: e.name,
2489
2602
  labels: t.labels,
2490
2603
  unit: t.unit,
@@ -2493,12 +2606,12 @@ function zn(e, t, n, r, i, a, o) {
2493
2606
  return c.onSelect((t) => {
2494
2607
  i(e.name, t);
2495
2608
  }), c.onSettle((t) => {
2496
- r.dispatch(Z.SELECT, {
2609
+ r.dispatch(Q.SELECT, {
2497
2610
  attribute: e.name,
2498
2611
  value: t
2499
2612
  }, !0).defaultPrevented || a(e.name, t);
2500
2613
  }), o(e.name, (t) => {
2501
- c.setSelected(t.value), r.dispatch(Z.SELECTED, {
2614
+ c.setSelected(t.value), r.dispatch(Q.SELECTED, {
2502
2615
  attribute: e.name,
2503
2616
  value: t.value
2504
2617
  });
@@ -2508,75 +2621,75 @@ function zn(e, t, n, r, i, a, o) {
2508
2621
  };
2509
2622
  }
2510
2623
  // ../measurements/src/units.ts
2511
- var Bn = {
2624
+ var qn = {
2512
2625
  mm: 1,
2513
2626
  cm: 10,
2514
2627
  m: 1e3,
2515
2628
  in: 25.4
2516
2629
  };
2517
- function Vn(e, t) {
2518
- return e / Bn[t];
2630
+ function Jn(e, t) {
2631
+ return e / qn[t];
2519
2632
  }
2520
2633
  // ../client-core/src/ui/controls/measurement-format.ts
2521
- var Hn = 3;
2522
- function Un(e) {
2523
- let t = Vn(e.stepMm, e.displayUnit);
2524
- for (let e = 0; e <= Hn; e++) {
2634
+ var Yn = 3;
2635
+ function Xn(e) {
2636
+ let t = Jn(e.stepMm, e.displayUnit);
2637
+ for (let e = 0; e <= Yn; e++) {
2525
2638
  let n = t * 10 ** e;
2526
2639
  if (Math.abs(n - Math.round(n)) < 1e-9) return e;
2527
2640
  }
2528
- return Hn;
2641
+ return Yn;
2529
2642
  }
2530
- function Wn(e, t, n) {
2531
- let r = Un(t), i = Vn(e, t.displayUnit);
2643
+ function Zn(e, t, n) {
2644
+ let r = Xn(t), i = Jn(e, t.displayUnit);
2532
2645
  return new Intl.NumberFormat(n, {
2533
2646
  minimumFractionDigits: r,
2534
2647
  maximumFractionDigits: r
2535
2648
  }).format(i);
2536
2649
  }
2537
- function Gn(e, t, n) {
2650
+ function Qn(e, t, n) {
2538
2651
  return {
2539
- labels: e.values.map((e) => Wn(Number(e), t, n)),
2652
+ labels: e.values.map((e) => Zn(Number(e), t, n)),
2540
2653
  unit: t.displayUnit
2541
2654
  };
2542
2655
  }
2543
- var Kn = 20;
2544
- function qn(e, t) {
2545
- let n = new Intl.NumberFormat(t, { maximumFractionDigits: Kn });
2656
+ var $n = 20;
2657
+ function er(e, t) {
2658
+ let n = new Intl.NumberFormat(t, { maximumFractionDigits: $n });
2546
2659
  return {
2547
2660
  labels: e.numbers.map((e) => n.format(e)),
2548
2661
  unit: e.unit
2549
2662
  };
2550
2663
  }
2551
2664
  // ../client-core/src/ui/controls/attribute-group.ts
2552
- var Jn = 5, Yn = 0;
2553
- function Xn(e, t, n, r, i, a) {
2665
+ var tr = 5, nr = 0;
2666
+ function rr(e, t, n, r, i, a) {
2554
2667
  let o = document.createElement("div");
2555
2668
  o.className = "vd-attribute", o.dataset.name = e.name;
2556
2669
  let s = document.createElement("span");
2557
- s.className = "vd-attribute-label", s.textContent = C(e.name), s.id = `vd-attribute-label-${Yn++}`, o.appendChild(s), o.setAttribute("role", "group"), o.setAttribute("aria-labelledby", s.id);
2670
+ s.className = "vd-attribute-label", s.textContent = C(e.name), s.id = `vd-attribute-label-${nr++}`, o.appendChild(s), o.setAttribute("role", "group"), o.setAttribute("aria-labelledby", s.id);
2558
2671
  let c = (e) => {
2559
2672
  o.style.display = e ? "none" : "";
2560
- }, l = Zn(e), u = l === void 0 ? Qn(e, t, n, r, a) : zn(e, l, t, n, i, r, a);
2673
+ }, l = ir(e), u = l === void 0 ? ar(e, t, n, r, a) : Kn(e, l, t, n, i, r, a);
2561
2674
  return o.appendChild(u.element), {
2562
2675
  element: o,
2563
2676
  setSelectable: u.setSelectable,
2564
2677
  setHidden: c
2565
2678
  };
2566
2679
  }
2567
- function Zn(e) {
2568
- if (e.dimension !== void 0) return Gn(e, e.dimension, y());
2569
- if (e.size !== void 0) return qn(e.size, y());
2680
+ function ir(e) {
2681
+ if (e.dimension !== void 0) return Qn(e, e.dimension, y());
2682
+ if (e.size !== void 0) return er(e.size, y());
2570
2683
  }
2571
- function Qn(e, t, n, r, i) {
2572
- let a = e.values.find((n) => t.getValue(e.name, n)?.isSelected === !0), o = e.values.map((t) => Pe(t, e.labels)), s = e.values.length <= Jn ? new bn(e.values, a, o) : new xn(e.name, e.values, C(e.name), a, o);
2684
+ function ar(e, t, n, r, i) {
2685
+ let a = e.values.find((n) => t.getValue(e.name, n)?.isSelected === !0), o = e.values.map((t) => Re(t, e.labels)), s = e.values.length <= tr ? new Dn(e.values, a, o) : new On(e.name, e.values, C(e.name), a, o);
2573
2686
  return s.onSelect((t) => {
2574
- n.dispatch(Z.SELECT, {
2687
+ n.dispatch(Q.SELECT, {
2575
2688
  attribute: e.name,
2576
2689
  value: t
2577
2690
  }, !0).defaultPrevented || r(e.name, t);
2578
2691
  }), i(e.name, (t) => {
2579
- s.setSelected(t.value), n.dispatch(Z.SELECTED, {
2692
+ s.setSelected(t.value), n.dispatch(Q.SELECTED, {
2580
2693
  attribute: e.name,
2581
2694
  value: t.value
2582
2695
  });
@@ -2588,7 +2701,7 @@ function Qn(e, t, n, r, i) {
2588
2701
  };
2589
2702
  }
2590
2703
  // ../client-core/src/ui/commerce-panel.ts
2591
- var $n = 80, er = 2500, tr = class {
2704
+ var or = 80, sr = 2500, cr = class {
2592
2705
  configuration;
2593
2706
  element;
2594
2707
  priceEl;
@@ -2600,7 +2713,7 @@ var $n = 80, er = 2500, tr = class {
2600
2713
  constructor(e) {
2601
2714
  this.configuration = e, this.element = document.createElement("div"), this.element.className = "vd-commerce vd-hidden";
2602
2715
  let t = document.createElement("div");
2603
- t.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", t.append(this.priceEl, this.vatEl), this.button = new F({
2716
+ t.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", t.append(this.priceEl, this.vatEl), this.button = new I({
2604
2717
  variant: "default",
2605
2718
  onClick: () => {
2606
2719
  this.handleSubmit();
@@ -2618,23 +2731,23 @@ var $n = 80, er = 2500, tr = class {
2618
2731
  this.unsubscribe(), this.resetTimer !== void 0 && clearTimeout(this.resetTimer), this.element.remove();
2619
2732
  }
2620
2733
  renderPrice(e) {
2621
- e === void 0 ? (this.priceEl.textContent = "", this.vatEl.textContent = "") : (this.priceEl.textContent = nr(e.price, e.currency), this.vatEl.textContent = Q(this.configuration.vatDisplay));
2734
+ e === void 0 ? (this.priceEl.textContent = "", this.vatEl.textContent = "") : (this.priceEl.textContent = lr(e.price, e.currency), this.vatEl.textContent = $(this.configuration.vatDisplay));
2622
2735
  }
2623
2736
  renderButton() {
2624
2737
  let e = this.configuration.submitEnabled;
2625
- this.button.element.classList.toggle("vd-hidden", !e), e && this.state === "idle" && this.setButtonText(Q(this.configuration.buttonLabel));
2738
+ this.button.element.classList.toggle("vd-hidden", !e), e && this.state === "idle" && this.setButtonText($(this.configuration.buttonLabel));
2626
2739
  }
2627
2740
  async handleSubmit() {
2628
2741
  if (this.state !== "busy") {
2629
- this.setState("busy", bt());
2742
+ this.setState("busy", Dt());
2630
2743
  try {
2631
- await this.configuration.submit(), this.setState("success", St());
2744
+ await this.configuration.submit(), this.setState("success", kt());
2632
2745
  } catch (e) {
2633
2746
  if (e instanceof DOMException && e.name === "AbortError") {
2634
- this.setState("idle", Q(this.configuration.buttonLabel));
2747
+ this.setState("idle", $(this.configuration.buttonLabel));
2635
2748
  return;
2636
2749
  }
2637
- j.warn("Commerce submit failed", { error: e }), this.setState("failed", xt());
2750
+ j.warn("Commerce submit failed", { error: e }), this.setState("failed", Ot());
2638
2751
  }
2639
2752
  this.scheduleReset();
2640
2753
  }
@@ -2642,7 +2755,7 @@ var $n = 80, er = 2500, tr = class {
2642
2755
  scheduleReset() {
2643
2756
  this.resetTimer !== void 0 && clearTimeout(this.resetTimer), this.resetTimer = setTimeout(() => {
2644
2757
  this.state = "idle", this.update();
2645
- }, er);
2758
+ }, sr);
2646
2759
  }
2647
2760
  setState(e, t) {
2648
2761
  this.state = e, this.element.dataset.submit = e, this.button.element.disabled = e === "busy", this.setButtonText(t);
@@ -2651,10 +2764,10 @@ var $n = 80, er = 2500, tr = class {
2651
2764
  this.button.element.textContent = e, this.button.element.setAttribute("aria-label", e);
2652
2765
  }
2653
2766
  };
2654
- function Q(e) {
2655
- return (e ?? "").slice(0, $n);
2767
+ function $(e) {
2768
+ return (e ?? "").slice(0, or);
2656
2769
  }
2657
- function nr(e, t) {
2770
+ function lr(e, t) {
2658
2771
  try {
2659
2772
  let n = new Intl.NumberFormat(y(), {
2660
2773
  style: "currency",
@@ -2666,7 +2779,7 @@ function nr(e, t) {
2666
2779
  }
2667
2780
  }
2668
2781
  // ../client-core/src/ui/layouts/inframe-layout.ts
2669
- var rr = class {
2782
+ var ur = class {
2670
2783
  slot = null;
2671
2784
  panel = null;
2672
2785
  attach(e, t) {
@@ -2678,7 +2791,7 @@ var rr = class {
2678
2791
  destroy() {
2679
2792
  this.slot?.remove(), this.slot = null, this.panel = null;
2680
2793
  }
2681
- }, ir = 572, ar = class {
2794
+ }, dr = 572, fr = class {
2682
2795
  actionBarSlot;
2683
2796
  element = null;
2684
2797
  body = null;
@@ -2693,21 +2806,21 @@ var rr = class {
2693
2806
  this.actionBarSlot = e;
2694
2807
  }
2695
2808
  attach(e, t) {
2696
- this.container = e, t.classList.add("vd-attributes-sidebar"), this.closeButton = new F({
2809
+ this.container = e, t.classList.add("vd-attributes-sidebar"), this.closeButton = new I({
2697
2810
  variant: "ghost",
2698
2811
  size: "icon-sm",
2699
- label: Mt(),
2700
- icon: P.close({ size: 18 }),
2812
+ label: zt(),
2813
+ icon: F.close({ size: 18 }),
2701
2814
  onClick: () => {
2702
2815
  this.expanded = !1, this.render();
2703
2816
  }
2704
2817
  });
2705
2818
  let n = document.createElement("div");
2706
- n.className = "vd-sidebar-header", n.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(n, this.body), e.appendChild(this.element), this.openButton = new F({
2819
+ n.className = "vd-sidebar-header", n.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(n, this.body), e.appendChild(this.element), this.openButton = new I({
2707
2820
  variant: "outline",
2708
2821
  size: "icon",
2709
- label: Nt(),
2710
- icon: P.configurator({ size: 18 }),
2822
+ label: Bt(),
2823
+ icon: F.configurator({ size: 18 }),
2711
2824
  onClick: () => {
2712
2825
  this.expanded = !0, this.render();
2713
2826
  }
@@ -2722,7 +2835,7 @@ var rr = class {
2722
2835
  observe() {
2723
2836
  typeof ResizeObserver < "u" && this.container !== null && (this.observer = new ResizeObserver((e) => {
2724
2837
  let t = e[0]?.contentRect.width ?? 0;
2725
- this.setCollapsible(t > 0 && t < ir);
2838
+ this.setCollapsible(t > 0 && t < dr);
2726
2839
  }), this.observer.observe(this.container));
2727
2840
  }
2728
2841
  setCollapsible(e) {
@@ -2733,20 +2846,20 @@ var rr = class {
2733
2846
  let e = this.visible && this.expanded, t = this.visible && !this.expanded;
2734
2847
  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);
2735
2848
  }
2736
- }, or = class {
2849
+ }, pr = class {
2737
2850
  attach(e, t) {}
2738
2851
  setVisible(e) {}
2739
2852
  destroy() {}
2740
- }, sr = {
2741
- "inframe-bottom-left": () => new rr(),
2742
- "sidebar-right": (e) => new ar(e),
2743
- hidden: () => new or()
2853
+ }, mr = {
2854
+ "inframe-bottom-left": () => new ur(),
2855
+ "sidebar-right": (e) => new fr(e),
2856
+ hidden: () => new pr()
2744
2857
  };
2745
- function cr(e, t) {
2746
- return (sr[e ?? ""] ?? (() => new rr()))(t);
2858
+ function hr(e, t) {
2859
+ return (mr[e ?? ""] ?? (() => new ur()))(t);
2747
2860
  }
2748
2861
  // ../client-core/src/ui/styles.ts
2749
- var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display: flex;\n z-index: 10;\n transition: inset-inline-end 0.18s ease;\n", ur = `
2862
+ var gr = J.fontFamily.sans.join(", "), _r = "\n position: absolute;\n display: flex;\n z-index: 10;\n transition: inset-inline-end 0.18s ease;\n", vr = `
2750
2863
  /* Override browser's default black fullscreen backdrop */
2751
2864
  .vd-container:fullscreen {
2752
2865
  background: oklch(100% 0 0);
@@ -2754,52 +2867,52 @@ var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display:
2754
2867
 
2755
2868
  /* Layout slots — four corners */
2756
2869
  .vd-slot-top-right {
2757
- ${lr}
2758
- inset-block-start: ${K[3]};
2759
- inset-inline-end: ${K[3]};
2870
+ ${_r}
2871
+ inset-block-start: ${q[3]};
2872
+ inset-inline-end: ${q[3]};
2760
2873
  flex-direction: column;
2761
2874
  align-items: flex-end;
2762
- gap: ${K[1.5]};
2875
+ gap: ${q[1.5]};
2763
2876
  }
2764
2877
 
2765
2878
  .vd-slot-bottom-left {
2766
- ${lr}
2767
- inset-block-end: ${K[3]};
2768
- inset-inline-start: ${K[3]};
2879
+ ${_r}
2880
+ inset-block-end: ${q[3]};
2881
+ inset-inline-start: ${q[3]};
2769
2882
  flex-direction: column;
2770
2883
  align-items: flex-start;
2771
- gap: ${K[1.5]};
2884
+ gap: ${q[1.5]};
2772
2885
  }
2773
2886
 
2774
2887
  .vd-slot-bottom-right {
2775
- ${lr}
2776
- inset-block-end: ${K[3]};
2777
- inset-inline-end: ${K[3]};
2888
+ ${_r}
2889
+ inset-block-end: ${q[3]};
2890
+ inset-inline-end: ${q[3]};
2778
2891
  flex-direction: row;
2779
- gap: ${K[1.5]};
2892
+ gap: ${q[1.5]};
2780
2893
  }
2781
2894
 
2782
2895
  /* Component styles — no positioning */
2783
2896
  .vd-camera-controls {
2784
2897
  display: flex;
2785
2898
  flex-direction: column;
2786
- gap: ${K[1]};
2787
- background: color-mix(in oklch, ${G.white} 85%, transparent);
2899
+ gap: ${q[1]};
2900
+ background: color-mix(in oklch, ${K.white} 85%, transparent);
2788
2901
  backdrop-filter: blur(8px);
2789
- border-radius: ${K[2]};
2790
- padding: ${K[2]};
2902
+ border-radius: ${q[2]};
2903
+ padding: ${q[2]};
2791
2904
  }
2792
2905
 
2793
2906
  .vd-zoom {
2794
2907
  display: flex;
2795
- gap: ${K[.5]};
2908
+ gap: ${q[.5]};
2796
2909
  }
2797
2910
 
2798
2911
  .vd-dpad {
2799
2912
  display: grid;
2800
- grid-template-columns: repeat(3, ${K[9]});
2801
- grid-template-rows: repeat(3, ${K[9]});
2802
- gap: ${K[.5]};
2913
+ grid-template-columns: repeat(3, ${q[9]});
2914
+ grid-template-rows: repeat(3, ${q[9]});
2915
+ gap: ${q[.5]};
2803
2916
  }
2804
2917
 
2805
2918
  .vd-dpad-up { grid-column: 2; grid-row: 1; }
@@ -2811,30 +2924,30 @@ var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display:
2811
2924
  .vd-attributes {
2812
2925
  display: flex;
2813
2926
  flex-direction: column;
2814
- gap: ${K[3]};
2815
- background: color-mix(in oklch, ${G.white} 85%, transparent);
2927
+ gap: ${q[3]};
2928
+ background: color-mix(in oklch, ${K.white} 85%, transparent);
2816
2929
  backdrop-filter: blur(8px);
2817
- border: 1px solid color-mix(in oklch, ${G.neutral[900]} 8%, transparent);
2818
- border-radius: ${K[3]};
2819
- padding: ${K[3]};
2820
- box-shadow: 0 ${K[1]} ${K[4]} color-mix(in oklch, ${G.neutral[900]} 6%, transparent);
2821
- font-family: ${$};
2930
+ border: 1px solid color-mix(in oklch, ${K.neutral[900]} 8%, transparent);
2931
+ border-radius: ${q[3]};
2932
+ padding: ${q[3]};
2933
+ box-shadow: 0 ${q[1]} ${q[4]} color-mix(in oklch, ${K.neutral[900]} 6%, transparent);
2934
+ font-family: ${gr};
2822
2935
  }
2823
2936
 
2824
2937
  .vd-attribute {
2825
2938
  display: flex;
2826
2939
  flex-direction: column;
2827
- gap: ${K[1.5]};
2940
+ gap: ${q[1.5]};
2828
2941
  }
2829
2942
 
2830
2943
  /* Micro-label: recedes so the controls lead. */
2831
2944
  .vd-attribute-label {
2832
- font-size: ${q.fontSize.xs};
2833
- font-weight: ${q.fontWeight.medium};
2834
- color: ${G.neutral[500]};
2945
+ font-size: ${J.fontSize.xs};
2946
+ font-weight: ${J.fontWeight.medium};
2947
+ color: ${K.neutral[500]};
2835
2948
  text-transform: uppercase;
2836
2949
  letter-spacing: 0.05em;
2837
- font-family: ${$};
2950
+ font-family: ${gr};
2838
2951
  }
2839
2952
 
2840
2953
  /* sidebar-right layout — a docked, full-height right panel */
@@ -2870,10 +2983,10 @@ var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display:
2870
2983
  z-index: 11;
2871
2984
  display: flex;
2872
2985
  flex-direction: column;
2873
- background: color-mix(in oklch, ${G.white} 90%, transparent);
2986
+ background: color-mix(in oklch, ${K.white} 90%, transparent);
2874
2987
  backdrop-filter: blur(10px);
2875
- border-inline-start: 1px solid color-mix(in oklch, ${G.neutral[900]} 8%, transparent);
2876
- box-shadow: -${K[1]} 0 ${K[4]} color-mix(in oklch, ${G.neutral[900]} 5%, transparent);
2988
+ border-inline-start: 1px solid color-mix(in oklch, ${K.neutral[900]} 8%, transparent);
2989
+ box-shadow: -${q[1]} 0 ${q[4]} color-mix(in oklch, ${K.neutral[900]} 5%, transparent);
2877
2990
  }
2878
2991
 
2879
2992
  @media (prefers-reduced-motion: no-preference) {
@@ -2885,13 +2998,13 @@ var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display:
2885
2998
  .vd-sidebar-header {
2886
2999
  display: flex;
2887
3000
  justify-content: flex-end;
2888
- padding: ${K[1.5]} ${K[1.5]} 0;
3001
+ padding: ${q[1.5]} ${q[1.5]} 0;
2889
3002
  }
2890
3003
 
2891
3004
  .vd-sidebar-body {
2892
3005
  flex: 1;
2893
3006
  overflow-y: auto;
2894
- padding: ${K[4]};
3007
+ padding: ${q[4]};
2895
3008
  }
2896
3009
 
2897
3010
  /* attributes inside the sidebar: flat and full-width — the panel provides the frosting */
@@ -2902,38 +3015,38 @@ var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display:
2902
3015
  border-radius: 0;
2903
3016
  padding: 0;
2904
3017
  box-shadow: none;
2905
- gap: ${K[5]};
3018
+ gap: ${q[5]};
2906
3019
  }
2907
3020
 
2908
3021
  /* while the panel is open, keep the corner controls clear of it */
2909
- .vd-layout-sidebar-right .vd-slot-top-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${K[3]}); }
2910
- .vd-layout-sidebar-right .vd-slot-bottom-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${K[3]}); }
3022
+ .vd-layout-sidebar-right .vd-slot-top-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${q[3]}); }
3023
+ .vd-layout-sidebar-right .vd-slot-bottom-right { inset-inline-end: calc(var(--vd-sidebar-width) + ${q[3]}); }
2911
3024
 
2912
3025
  /* Price + CTA — sit under the attribute controls, separated by a hairline */
2913
3026
  .vd-commerce {
2914
3027
  display: flex;
2915
3028
  flex-direction: column;
2916
- gap: ${K[2]};
2917
- padding-block-start: ${K[3]};
2918
- border-block-start: 1px solid color-mix(in oklch, ${G.neutral[900]} 8%, transparent);
2919
- font-family: ${$};
3029
+ gap: ${q[2]};
3030
+ padding-block-start: ${q[3]};
3031
+ border-block-start: 1px solid color-mix(in oklch, ${K.neutral[900]} 8%, transparent);
3032
+ font-family: ${gr};
2920
3033
  }
2921
3034
 
2922
3035
  .vd-commerce-price {
2923
3036
  display: flex;
2924
3037
  align-items: baseline;
2925
- gap: ${K[1.5]};
3038
+ gap: ${q[1.5]};
2926
3039
  }
2927
3040
 
2928
3041
  .vd-price {
2929
- font-size: ${q.fontSize.lg};
2930
- font-weight: ${q.fontWeight.semibold};
2931
- color: ${G.neutral[900]};
3042
+ font-size: ${J.fontSize.lg};
3043
+ font-weight: ${J.fontWeight.semibold};
3044
+ color: ${K.neutral[900]};
2932
3045
  }
2933
3046
 
2934
3047
  .vd-vat {
2935
- font-size: ${q.fontSize.xs};
2936
- color: ${G.neutral[500]};
3048
+ font-size: ${J.fontSize.xs};
3049
+ color: ${K.neutral[500]};
2937
3050
  }
2938
3051
 
2939
3052
  .vd-cta {
@@ -2943,23 +3056,23 @@ var $ = q.fontFamily.sans.join(", "), lr = "\n position: absolute;\n display:
2943
3056
 
2944
3057
  /* Failed submit is the one place red belongs: a clear, recoverable error state. */
2945
3058
  .vd-commerce[data-submit="failed"] .vd-cta {
2946
- background: ${G.semantic.error};
2947
- border-color: ${G.semantic.error};
2948
- color: ${G.white};
3059
+ background: ${K.semantic.error};
3060
+ border-color: ${K.semantic.error};
3061
+ color: ${K.white};
2949
3062
  }
2950
3063
 
2951
3064
  `;
2952
- function dr() {
2953
- if (Dn(), document.getElementById("vd-styles") !== null) return;
3065
+ function yr() {
3066
+ if (Pn(), document.getElementById("vd-styles") !== null) return;
2954
3067
  let e = document.createElement("style");
2955
- e.id = "vd-styles", e.textContent = ur, document.head.appendChild(e);
3068
+ e.id = "vd-styles", e.textContent = vr, document.head.appendChild(e);
2956
3069
  }
2957
3070
  // ../client-core/src/ui/standard-interface.ts
2958
- function fr(e, t) {
3071
+ function br(e, t) {
2959
3072
  let n = document.createElement("a");
2960
3073
  n.href = `data:image/png;base64,${e}`, n.download = t, n.click();
2961
3074
  }
2962
- var pr = class {
3075
+ var xr = class {
2963
3076
  options;
2964
3077
  settings = {};
2965
3078
  container = null;
@@ -2981,9 +3094,9 @@ var pr = class {
2981
3094
  this.options = e;
2982
3095
  }
2983
3096
  attach(e) {
2984
- dr(), this.container = e, this.loading = new yn(e, { text: {
2985
- downloading: () => Ht(),
2986
- loadError: () => Ut()
3097
+ yr(), this.container = e, this.loading = new En(e, { text: {
3098
+ downloading: () => Yt(),
3099
+ loadError: () => Xt()
2987
3100
  } }), this.slots.topRight = this.createSlot(e, "vd-slot-top-right"), this.slots.bottomRight = this.createSlot(e, "vd-slot-bottom-right");
2988
3101
  }
2989
3102
  onReady() {
@@ -2992,7 +3105,7 @@ var pr = class {
2992
3105
  mountToolbar() {
2993
3106
  if (this.actionBar !== null || this.slots.bottomRight === null || this.container === null) return;
2994
3107
  let e = typeof this.container.requestFullscreen == "function" && document.fullscreenEnabled !== !1;
2995
- this.actionBar = new An({
3108
+ this.actionBar = new Ln({
2996
3109
  onAr: this.options.onAr,
2997
3110
  onFullscreen: e ? () => {
2998
3111
  this.toggleFullscreen();
@@ -3015,20 +3128,20 @@ var pr = class {
3015
3128
  this.loading?.viewerAlive();
3016
3129
  }
3017
3130
  applyViewerSettings(e) {
3018
- this.settings = e, e.language !== void 0 && _e(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();
3131
+ this.settings = e, e.language !== void 0 && xe(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();
3019
3132
  }
3020
3133
  renderModelControls(e, t) {
3021
3134
  if (this.container !== null && this.slots.topRight !== null && this.slots.bottomRight !== null && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.mountCameraControls(this.slots.topRight), this.placeScreenshotButton(), t.length !== 0)) {
3022
3135
  this.attributes = document.createElement("div"), this.attributes.className = "vd-attributes", this.groupHandles = /* @__PURE__ */ new Map();
3023
3136
  for (let n of t) {
3024
- let t = Xn(n, e, this.options.eventBus, this.options.onSelect, this.options.onSelectTransient, this.options.onSubscribe);
3137
+ let t = rr(n, e, this.options.eventBus, this.options.onSelect, this.options.onSelectTransient, this.options.onSubscribe);
3025
3138
  this.groupHandles.set(n.name, t), this.attributes.appendChild(t.element);
3026
3139
  }
3027
- this.commerce = new tr(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = cr(this.settings.configuratorLayout, this.slots.bottomRight), this.layout.attach(this.container, this.attributes), this.ready === !0 && this.layout.setVisible(!0), this.lastSelectable !== null && this.applySelectable(this.lastSelectable);
3140
+ this.commerce = new cr(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = hr(this.settings.configuratorLayout, this.slots.bottomRight), this.layout.attach(this.container, this.attributes), this.ready === !0 && this.layout.setVisible(!0), this.lastSelectable !== null && this.applySelectable(this.lastSelectable);
3028
3141
  }
3029
3142
  }
3030
3143
  mountCameraControls(e) {
3031
- this.settings.cameraControls === !0 && (this.cameraControls = new jn(this.options.cameraApi, this.options.cameraPositionApi), this.cameraControls.element.style.display = this.ready ? "flex" : "none", e.appendChild(this.cameraControls.element));
3144
+ this.settings.cameraControls === !0 && (this.cameraControls = new Rn(this.options.cameraApi, this.options.cameraPositionApi), this.cameraControls.element.style.display = this.ready ? "flex" : "none", e.appendChild(this.cameraControls.element));
3032
3145
  }
3033
3146
  applySelectable(e) {
3034
3147
  this.lastSelectable = e;
@@ -3054,11 +3167,11 @@ var pr = class {
3054
3167
  }
3055
3168
  syncScreenshotButton() {
3056
3169
  let e = this.settings.screenshot === !0;
3057
- e && this.screenshotBtn === null && (this.screenshotBtn = new F({
3170
+ e && this.screenshotBtn === null && (this.screenshotBtn = new I({
3058
3171
  variant: "outline",
3059
3172
  size: "icon",
3060
- label: Vt(),
3061
- icon: P.screenshot(),
3173
+ label: Jt(),
3174
+ icon: F.screenshot(),
3062
3175
  onClick: () => {
3063
3176
  this.takeScreenshot();
3064
3177
  }
@@ -3067,7 +3180,7 @@ var pr = class {
3067
3180
  takeScreenshot() {
3068
3181
  let e = this.screenshotBtn;
3069
3182
  e === null || e.element.disabled || (e.element.disabled = !0, this.options.snapshotApi.take("snapshot.png").onDeveloped(({ data: t, filename: n }) => {
3070
- e.element.disabled = !1, fr(t, n);
3183
+ e.element.disabled = !1, br(t, n);
3071
3184
  }).onError((t) => {
3072
3185
  e.element.disabled = !1, j.warn("Screenshot failed", { error: t });
3073
3186
  }));
@@ -3075,7 +3188,7 @@ var pr = class {
3075
3188
  placeScreenshotButton() {
3076
3189
  this.screenshotBtn !== null && this.slots.topRight !== null && (this.cameraControls === null ? this.slots.topRight.appendChild(this.screenshotBtn.element) : this.cameraControls.element.appendChild(this.screenshotBtn.element));
3077
3190
  }
3078
- }, mr = class {
3191
+ }, Sr = class {
3079
3192
  defaultServer = "https://server.virtualdisplay.io";
3080
3193
  options;
3081
3194
  serverHost;
@@ -3126,42 +3239,46 @@ var pr = class {
3126
3239
  }
3127
3240
  };
3128
3241
  // ../client-core/src/client/incoming-message-routing.ts
3129
- function hr(e) {
3242
+ function Cr(e) {
3130
3243
  let { messenger: n } = e;
3131
3244
  n.on(t.HANDSHAKE, (t) => {
3132
3245
  l(t) && (j.info("Server handshake received, flushing publisher queue"), n.markReady(), e.ui.viewerAlive());
3133
3246
  }), n.on(t.SESSION, (t) => {
3134
3247
  u(t) && e.onSession(t.sessionId);
3135
3248
  }), n.on(t.MUTATION, (t) => {
3136
- d(t) && (e.attributes.handleMutationResult(t), e.configuration.handleSelectionChanged(e.attributes.getSelection()));
3249
+ ne(t) && (e.attributes.handleMutationResult(t), e.configuration.handleSelectionChanged(e.attributes.getSelection()));
3137
3250
  }), n.on(t.SNAPSHOT, (t) => {
3138
- f(t) && e.snapshot.handleSnapshotResult(t);
3251
+ m(t) && e.snapshot.handleSnapshotResult(t);
3139
3252
  }), n.on(t.CAMERA, (t) => {
3140
- p(t) && e.cameraPosition.handlePositionUpdate(t);
3253
+ re(t) && e.cameraPosition.handlePositionUpdate(t);
3141
3254
  }), n.on(t.LOADING_INDICATOR, (t) => {
3142
- ne(t) && (t.error === void 0 ? e.ui.updateProgress(t.progress, t.phase) : e.ui.showError(t.error));
3255
+ ae(t) && (t.error === void 0 ? e.ui.updateProgress(t.progress, t.phase) : e.ui.showError(t.error));
3143
3256
  }), n.on(t.CONFIG, (t) => {
3144
- ie(t) && e.applyConfig(t);
3257
+ ce(t) && e.applyConfig(t);
3145
3258
  }), n.on(t.MAPPING, (t) => {
3146
- te(t) && (e.attributes.handleMappingReceived(t), e.configuration.handleSelectionChanged(e.attributes.getSelection()), e.ui.renderModelControls(e.attributes, t.attributes), e.readyStateTracker.handleMappingReceived());
3147
- }), gr(e);
3259
+ ie(t) && (e.attributes.handleMappingReceived(t), e.configuration.handleSelectionChanged(e.attributes.getSelection()), e.ui.renderModelControls(e.attributes, t.attributes), e.readyStateTracker.handleMappingReceived());
3260
+ }), wr(e);
3148
3261
  }
3149
- function gr(e) {
3262
+ function wr(e) {
3150
3263
  let { messenger: n } = e;
3151
3264
  n.on(t.FOCUS, (t) => {
3152
- ae(t) && e.focus.handleStateReceived(t);
3265
+ le(t) && e.focus.handleStateReceived(t);
3266
+ }), n.on(t.PERSONALISED, (t) => {
3267
+ d(t) && e.personalisation.handleReplyReceived(t);
3268
+ }), n.on(t.ZONES, (t) => {
3269
+ te(t) && e.personalisation.handleZonesReceived(t);
3153
3270
  }), n.on(t.PRICING, (t) => {
3154
- oe(t) && e.configuration.handlePricingReceived(t.pricing);
3271
+ ue(t) && e.configuration.handlePricingReceived(t.pricing);
3155
3272
  }), n.on(t.SYNC, (t) => {
3156
- m(t) && e.onSync(t.connected);
3273
+ oe(t) && e.onSync(t.connected);
3157
3274
  }), n.on(t.SELECTABLE, (t) => {
3158
- re(t) && (e.selectable.handleSnapshot(t), e.ui.applySelectable(t.attributes));
3275
+ se(t) && (e.selectable.handleSnapshot(t), e.ui.applySelectable(t.attributes));
3159
3276
  }), n.on(t.APP_RESOLVED, (t) => {
3160
3277
  ee(t) && e.onAppResolved(t);
3161
3278
  });
3162
3279
  }
3163
3280
  // ../client-core/src/client/ready-state-tracker.ts
3164
- var _r = class {
3281
+ var Tr = class {
3165
3282
  ready = !1;
3166
3283
  onReady;
3167
3284
  constructor(e) {
@@ -3178,7 +3295,7 @@ var _r = class {
3178
3295
  }
3179
3296
  };
3180
3297
  // ../client-core/src/client/base-client.ts
3181
- function vr(e) {
3298
+ function Er(e) {
3182
3299
  if (e === void 0) return;
3183
3300
  let { annotations: t, ...n } = e;
3184
3301
  return t === void 0 ? n : t === !0 ? {
@@ -3192,12 +3309,12 @@ function vr(e) {
3192
3309
  annotations: t
3193
3310
  };
3194
3311
  }
3195
- function yr(e) {
3312
+ function Dr(e) {
3196
3313
  if (!Array.isArray(e)) return {};
3197
3314
  let t = e.filter((e) => typeof e == "string");
3198
3315
  return t.length > 0 ? { features: t } : {};
3199
3316
  }
3200
- var br = class {
3317
+ var Or = class {
3201
3318
  attributes;
3202
3319
  selectableState;
3203
3320
  readyStateTracker;
@@ -3205,6 +3322,7 @@ var br = class {
3205
3322
  cameraApi;
3206
3323
  cameraPositionApi;
3207
3324
  focusApi;
3325
+ personalisationApi;
3208
3326
  configurationApi;
3209
3327
  snapshotApi;
3210
3328
  annotationsApi;
@@ -3225,28 +3343,28 @@ var br = class {
3225
3343
  constructor(e, t) {
3226
3344
  this.options = e;
3227
3345
  let r = t ?? {};
3228
- this.serverHost = r.serverHost, this.iframeParams = r.iframeParams, this.initializeLogging(), this.messenger = new ce(() => this.iframe?.contentWindow ?? null, {
3346
+ this.serverHost = r.serverHost, this.iframeParams = r.iframeParams, this.initializeLogging(), this.messenger = new fe(() => this.iframe?.contentWindow ?? null, {
3229
3347
  onHandlerError: (e, t) => j.error(`Error handling ${e.type}`, t),
3230
3348
  ...r.messengerOptions
3231
3349
  });
3232
3350
  let i = (e) => {
3233
3351
  this.messenger.send(e);
3234
3352
  };
3235
- this.attributes = new st(i, n, (e, t) => {
3353
+ this.attributes = new dt(i, n, (e, t) => {
3236
3354
  this.notifyMutationFailed(e, t);
3237
- }), this.selectableState = new ct(), this.snapshotApi = new vt(i), this.annotationsApi = new ue(i, n), this.cameraApi = new lt(i), this.cameraPositionApi = new ut(), this.focusApi = new ht(i, (e) => {
3355
+ }), this.selectableState = new ft(), this.snapshotApi = new Tt(i), this.annotationsApi = new me(i, n), this.cameraApi = new pt(i), this.cameraPositionApi = new mt(), this.focusApi = new yt(i, (e) => {
3238
3356
  this.dispatchFocusChange(e);
3239
- }, n), this.configurationApi = new mt((e) => {
3357
+ }, n), this.personalisationApi = new St(i, n), this.configurationApi = new vt((e) => {
3240
3358
  this.dispatchConfigurationChange(e);
3241
3359
  }, (e) => {
3242
3360
  this.dispatchConfigurationSubmit(e);
3243
- }), this.eventBus = new yt(), this.arActivation = r.createArActivation?.(i), this.syncTracker = r.createSyncTracker?.(), this.readyStateTracker = new _r(() => {
3361
+ }), this.eventBus = new Et(), this.arActivation = r.createArActivation?.(i), this.syncTracker = r.createSyncTracker?.(), this.readyStateTracker = new Tr(() => {
3244
3362
  this.notifyReady();
3245
3363
  }), this.ui = this.createStandardInterface(), this.wireIncomingMessages(), r.registerHandlers?.(this.messenger, i), this.messenger.start(), this.mountIframe();
3246
3364
  }
3247
3365
  createStandardInterface() {
3248
3366
  let e = this.arActivation;
3249
- return new pr({
3367
+ return new xr({
3250
3368
  snapshotApi: this.snapshotApi,
3251
3369
  cameraApi: this.cameraApi,
3252
3370
  cameraPositionApi: this.cameraPositionApi,
@@ -3277,7 +3395,7 @@ var br = class {
3277
3395
  });
3278
3396
  }
3279
3397
  wireIncomingMessages() {
3280
- hr({
3398
+ Cr({
3281
3399
  messenger: this.messenger,
3282
3400
  attributes: this.attributes,
3283
3401
  selectable: this.selectableState,
@@ -3285,6 +3403,7 @@ var br = class {
3285
3403
  snapshot: this.snapshotApi,
3286
3404
  cameraPosition: this.cameraPositionApi,
3287
3405
  focus: this.focusApi,
3406
+ personalisation: this.personalisationApi,
3288
3407
  ui: this.ui,
3289
3408
  readyStateTracker: this.readyStateTracker,
3290
3409
  applyConfig: (e) => {
@@ -3302,7 +3421,7 @@ var br = class {
3302
3421
  name: e.name,
3303
3422
  ...e.slug !== void 0 && { slug: e.slug },
3304
3423
  ...e.submit !== void 0 && { submit: e.submit },
3305
- ...yr(e.features)
3424
+ ...Dr(e.features)
3306
3425
  });
3307
3426
  }
3308
3427
  });
@@ -3327,25 +3446,25 @@ var br = class {
3327
3446
  this.ui.onReady();
3328
3447
  }
3329
3448
  dispatchFocusChange(e) {
3330
- this.container?.dispatchEvent(new CustomEvent(Z.FOCUS_CHANGE, {
3449
+ this.container?.dispatchEvent(new CustomEvent(Q.FOCUS_CHANGE, {
3331
3450
  detail: e,
3332
3451
  bubbles: !0
3333
3452
  }));
3334
3453
  }
3335
3454
  dispatchConfigurationChange(e) {
3336
- this.container?.dispatchEvent(new CustomEvent(Z.CONFIGURATION_CHANGE, {
3455
+ this.container?.dispatchEvent(new CustomEvent(Q.CONFIGURATION_CHANGE, {
3337
3456
  detail: e ?? null,
3338
3457
  bubbles: !0
3339
3458
  }));
3340
3459
  }
3341
3460
  dispatchConfigurationSubmit(e) {
3342
- this.container?.dispatchEvent(new CustomEvent(Z.CONFIGURATION_SUBMIT, {
3461
+ this.container?.dispatchEvent(new CustomEvent(Q.CONFIGURATION_SUBMIT, {
3343
3462
  detail: e,
3344
3463
  bubbles: !0
3345
3464
  }));
3346
3465
  }
3347
3466
  handleConfig(e) {
3348
- let t = e.viewerSettings, n = vr(this.options.viewerSettings);
3467
+ let t = e.viewerSettings, n = Er(this.options.viewerSettings);
3349
3468
  if (t !== void 0 || n !== void 0) {
3350
3469
  let e = n === void 0 ? t : {
3351
3470
  ...t ?? {},
@@ -3366,10 +3485,10 @@ var br = class {
3366
3485
  this.messenger.send({ type: t.FULLSCREEN });
3367
3486
  }
3368
3487
  initializeLogging() {
3369
- this.options.debug === !0 && at(), j.info("Initializing Virtualdisplay client", { ...this.options.app === void 0 ? { model: this.options.model } : { app: this.options.app } });
3488
+ this.options.debug === !0 && lt(), j.info("Initializing Virtualdisplay client", { ...this.options.app === void 0 ? { model: this.options.model } : { app: this.options.app } });
3370
3489
  }
3371
3490
  mountIframe() {
3372
- let e = new mr(this.options, this.serverHost, this.iframeParams).create();
3491
+ let e = new Sr(this.options, this.serverHost, this.iframeParams).create();
3373
3492
  this.container = e.container, this.iframe = e.iframe, this.eventBus.attach(this.container), this.ui.attach(this.container), this.messenger.setTargetOrigin(new URL(this.iframe.src).origin);
3374
3493
  }
3375
3494
  select(e, t) {
@@ -3420,6 +3539,9 @@ var br = class {
3420
3539
  get focus() {
3421
3540
  return this.focusApi;
3422
3541
  }
3542
+ get personalisation() {
3543
+ return this.personalisationApi;
3544
+ }
3423
3545
  get configuration() {
3424
3546
  return this.configurationApi;
3425
3547
  }
@@ -3436,17 +3558,17 @@ var br = class {
3436
3558
  return this.ui.viewerSettings;
3437
3559
  }
3438
3560
  destroy() {
3439
- 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;
3561
+ this.readyStateTracker.clear(), this.readyCallbacks = [], this.mutationFailedCallbacks.length = 0, this.snapshotApi.clear(), this.personalisationApi.destroy(), 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;
3440
3562
  }
3441
- }, xr = "ar.virtualdisplay.io";
3442
- function Sr(e) {
3443
- let t = new URL(`https://${xr}/go`);
3563
+ }, kr = "ar.virtualdisplay.io";
3564
+ function Ar(e) {
3565
+ let t = new URL(`https://${kr}/go`);
3444
3566
  return e.sessionId === void 0 ? e.app === void 0 ? e.license !== void 0 && e.model !== void 0 && (t.searchParams.set("license", e.license), t.searchParams.set("model", e.model)) : t.searchParams.set("app", e.app) : t.searchParams.set("session", e.sessionId), t.toString();
3445
3567
  }
3446
3568
  // src/ar/ar-activation.ts
3447
- var Cr = 1500, wr = class {
3569
+ var jr = 1500, Mr = class {
3448
3570
  options;
3449
- qrModal = new kn();
3571
+ qrModal = new In();
3450
3572
  sessionId;
3451
3573
  waiters = [];
3452
3574
  pendingTimers = /* @__PURE__ */ new Set();
@@ -3461,7 +3583,7 @@ var Cr = 1500, wr = class {
3461
3583
  for (let n of t) n(e);
3462
3584
  }
3463
3585
  activate() {
3464
- et() ? this.options.send({ type: t.AR_ACTIVATE }) : this.showQrCode();
3586
+ it() ? this.options.send({ type: t.AR_ACTIVATE }) : this.showQrCode();
3465
3587
  }
3466
3588
  destroy() {
3467
3589
  this.destroyed = !0;
@@ -3472,7 +3594,7 @@ var Cr = 1500, wr = class {
3472
3594
  this.qrModal.show();
3473
3595
  let e = await this.waitForSessionId();
3474
3596
  if (this.destroyed) return;
3475
- let n = Sr({
3597
+ let n = Ar({
3476
3598
  sessionId: e,
3477
3599
  app: this.options.app,
3478
3600
  license: this.options.license,
@@ -3490,13 +3612,13 @@ var Cr = 1500, wr = class {
3490
3612
  return this.sessionId === void 0 ? new Promise((e) => {
3491
3613
  let t = setTimeout(() => {
3492
3614
  this.pendingTimers.delete(t), e(void 0);
3493
- }, Cr);
3615
+ }, jr);
3494
3616
  this.pendingTimers.add(t), this.waiters.push((n) => {
3495
3617
  this.pendingTimers.delete(t), clearTimeout(t), e(n);
3496
3618
  });
3497
3619
  }) : Promise.resolve(this.sessionId);
3498
3620
  }
3499
- }, Tr = class {
3621
+ }, Nr = class {
3500
3622
  callbacks = [];
3501
3623
  lastKnown;
3502
3624
  handleSync(e) {
@@ -3506,12 +3628,12 @@ var Cr = 1500, wr = class {
3506
3628
  onChange(e) {
3507
3629
  this.callbacks.push(e), this.lastKnown !== void 0 && e(this.lastKnown);
3508
3630
  }
3509
- }, Er = class extends br {
3631
+ }, Pr = class extends Or {
3510
3632
  syncStatusTracker;
3511
3633
  constructor(e) {
3512
- let t = new Tr();
3634
+ let t = new Nr();
3513
3635
  super(e, {
3514
- createArActivation: (t) => new wr({
3636
+ createArActivation: (t) => new Mr({
3515
3637
  app: e.app,
3516
3638
  license: e.license,
3517
3639
  model: e.model,
@@ -3524,4 +3646,4 @@ var Cr = 1500, wr = class {
3524
3646
  this.syncStatusTracker.onChange(e);
3525
3647
  }
3526
3648
  };
3527
- export { a as AVAILABILITY, ue as Annotations, Ie as Attribute, de as AttributeValue, lt as Camera, ut as CameraPosition, mt as Configuration, w as ERROR_CODES, ht as Focus, gt as Photo, vt as Snapshot, Z as VD_EVENTS, Er as VirtualdisplayClient, T as VirtualdisplayError, at as enableDebugMode, ot as isDebugMode, j as logger };
3649
+ export { a as AVAILABILITY, me as Annotations, Be as Attribute, he as AttributeValue, pt as Camera, mt as CameraPosition, vt as Configuration, w as ERROR_CODES, yt as Focus, St as Personalisation, Ct as Photo, Tt as Snapshot, Q as VD_EVENTS, Pr as VirtualdisplayClient, T as VirtualdisplayError, lt as enableDebugMode, ut as isDebugMode, j as logger };