@qispace/vue3-player 0.0.10 → 0.0.13

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.
Files changed (76) hide show
  1. package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts +1 -471
  2. package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts +6 -6
  3. package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts +1 -151
  4. package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts +5 -7
  5. package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts +1 -124
  6. package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts +8 -313
  7. package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts +1 -154
  8. package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts +5 -6
  9. package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts +5 -6
  10. package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts +2 -2
  11. package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts +1 -156
  12. package/dist/components/shared/QiZoomBox.vue.d.ts +2 -2
  13. package/dist/components/virtualTourV2/Compass.vue.d.ts +22 -0
  14. package/dist/components/virtualTourV2/FloorLevel.vue.d.ts +27 -0
  15. package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts +1 -1
  16. package/dist/components/virtualTourV2/InteriorSelector.vue.d.ts +24 -0
  17. package/dist/components/virtualTourV2/Player.vue.d.ts +82 -0
  18. package/dist/components/virtualTourV2/SettingsUI.vue.d.ts +105 -0
  19. package/dist/components/virtualTourV2/TimeOfDay.vue.d.ts +27 -0
  20. package/dist/components/virtualTourV2/Tutorial.vue.d.ts +23 -0
  21. package/dist/components/virtualTourV2/ViewModeToggle.vue.d.ts +16 -0
  22. package/dist/components/virtualTourV2/VirtualTourV2.vue.d.ts +322 -0
  23. package/dist/components/virtualTourV2/index.d.ts +1 -0
  24. package/dist/components/virtualTourV2/minimapv2/MiniMapMap.vue.d.ts +82 -0
  25. package/dist/components/virtualTourV2/minimapv2/MiniMapV2.vue.d.ts +78 -0
  26. package/dist/components/virtualTourV2/minimapv2/MinimapCompass.vue.d.ts +30 -0
  27. package/dist/components/virtualTourV2/minimapv2/Moveable.vue.d.ts +8 -0
  28. package/dist/components/virtualTourV2/minimapv2/RotationMarkerV2.vue.d.ts +12 -0
  29. package/dist/components/virtualTourV2/minimapv2/SunsimulationSlider.vue.d.ts +48 -0
  30. package/dist/components/virtualTourV2/minimapv2/index.d.ts +1 -0
  31. package/dist/index.d.ts +448 -0
  32. package/dist/lib/index.d.ts +3 -0
  33. package/dist/style.css +1 -0
  34. package/dist/vue3-player.js +5362 -0
  35. package/dist/vue3-player.umd.cjs +1 -0
  36. package/package.json +32 -14
  37. package/src/components/buildingPicker/QiBuildingChooser.vue +7 -7
  38. package/src/components/virtualTourV2/{PlayerV2.vue → Player.vue} +64 -64
  39. package/src/components/virtualTourV2/VirtualTourV2.vue +6 -7
  40. package/src/components/virtualTourV2/index.ts +20 -0
  41. package/src/components/virtualTourV2/minimapv2/MiniMapV2.vue +14 -14
  42. package/src/components/virtualTourV2/minimapv2/index.ts +1 -0
  43. package/dist/components/virtualTourV2/ManualSlideShow.vue.d.ts +0 -73
  44. package/dist/components/virtualTourV2/ManualSlideShowPlayer.vue.d.ts +0 -15
  45. package/dist/entry.css +0 -1
  46. package/dist/vue3-player.mjs +0 -3058
  47. package/dist/vue3-player.umd.js +0 -2
  48. package/src/components/virtualTourV2/index.js +0 -2
  49. package/src/components/virtualTourV2/minimapv2/index.js +0 -1
  50. package/src/lib/apartmentChooser/BuildingViewerModel.js +0 -60
  51. package/src/lib/apartmentChooser/CircularSlideshow.js +0 -66
  52. package/src/lib/apartmentChooser/RotationStep.js +0 -31
  53. package/src/lib/apartmentChooser/SceneRotator.js +0 -25
  54. package/src/lib/apartmentChooser/index.js +0 -3
  55. package/src/lib/apartmentChooser/throttle.js +0 -15
  56. package/src/lib/buildingPicker/BuildingMap.js +0 -24
  57. package/src/lib/buildingPicker/BuildingPickerResourceProvider.js +0 -97
  58. package/src/lib/buildingPicker/CanvasRaster.js +0 -29
  59. package/src/lib/buildingPicker/DayOfYearSelector.js +0 -36
  60. package/src/lib/buildingPicker/SampleRaster.js +0 -14
  61. package/src/lib/buildingPicker/index.js +0 -5
  62. package/src/lib/index.js +0 -3
  63. package/src/lib/shared/BatchLoadTracker.js +0 -52
  64. package/src/lib/shared/I18N.js +0 -65
  65. package/src/lib/shared/ResourceLoader.js +0 -33
  66. package/src/lib/shared/index.js +0 -3
  67. package/src/lib/virtualTour/CameraSnapshot.js +0 -42
  68. package/src/lib/virtualTour/FullscreenModel.js +0 -69
  69. package/src/lib/virtualTour/textures/arrow.png +0 -0
  70. package/src/lib/virtualTour/textures/compass-bg.png +0 -0
  71. package/src/lib/virtualTour/textures/compass-needle.png +0 -0
  72. package/src/lib/virtualTour/textures/compass-north.png +0 -0
  73. package/src/lib/virtualTour/textures/floor-1.svg +0 -4
  74. package/src/lib/virtualTour/textures/floor-2.svg +0 -4
  75. package/src/lib/virtualTour/textures/marker.png +0 -0
  76. package/src/lib/virtualTour/textures/tod-sun.png +0 -0
@@ -1,3058 +0,0 @@
1
- import ve from "axios";
2
- import { openBlock as d, createElementBlock as m, resolveComponent as u, withDirectives as A, createElementVNode as h, normalizeStyle as D, vShow as x, createVNode as l, Fragment as L, renderList as T, createCommentVNode as k, withCtx as c, toDisplayString as S, createTextVNode as B, normalizeClass as M, createBlock as I, renderSlot as _, resolveDynamicComponent as oe, normalizeProps as re, guardReactiveProps as ae, defineComponent as Y, ref as le, mergeProps as R, createSlots as pe, toHandlers as fe, Transition as G } from "vue";
3
- class U {
4
- async loadJson(t) {
5
- return (await ve.get(t)).data;
6
- }
7
- async loadImage(t) {
8
- return new Promise((i, o) => {
9
- const n = new Image();
10
- n.crossOrigin = "anonymous", n.onload = () => {
11
- i(n);
12
- }, n.onerror = o, n.src = t;
13
- });
14
- }
15
- async loadImageData(t) {
16
- const i = await this.loadImage(t), o = document.createElement("canvas");
17
- try {
18
- const n = o.getContext("2d");
19
- return o.width = i.width, o.height = i.height, n.drawImage(i, 0, 0), o.toDataURL("image/png");
20
- } finally {
21
- o.remove();
22
- }
23
- }
24
- }
25
- const w = (e, t) => {
26
- const i = e.__vccOpts || e;
27
- for (const [o, n] of t)
28
- i[o] = n;
29
- return i;
30
- }, be = {
31
- name: "QiHoverProbe",
32
- computed: {
33
- isHoverEnabled() {
34
- return window.getComputedStyle(this.$refs.hoverCheck).display === "none";
35
- }
36
- }
37
- }, ye = {
38
- ref: "hoverCheck",
39
- class: "hover-check"
40
- };
41
- function we(e, t, i, o, n, s) {
42
- return d(), m("div", ye, null, 512);
43
- }
44
- const $ = /* @__PURE__ */ w(be, [["render", we], ["__scopeId", "data-v-e4729353"]]), de = {
45
- methods: {
46
- throttle(e, t) {
47
- let i = !0;
48
- return function(...o) {
49
- i && (i = !1, e.apply(this, o), setTimeout(() => i = !0, t));
50
- };
51
- }
52
- }
53
- }, _e = {
54
- name: "QiApartmentChooserRaster",
55
- components: { QiHoverProbe: $ },
56
- mixins: [de],
57
- props: {
58
- cdnFileResolver: { type: Function, required: !0 },
59
- viewModel: { type: Object, required: !0 },
60
- selectedUnitId: { type: String, default: null },
61
- unitCallback: { type: Function, default: (e) => e },
62
- canGoToUnitCallback: { type: Function, default: () => !0 },
63
- sceneData: { type: Array, default: [] },
64
- colorCallback: {
65
- type: Function,
66
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
67
- },
68
- drawObserver: {
69
- type: [Object, Array, String, Number, Boolean],
70
- default: null
71
- }
72
- },
73
- emits: ["select-unit", "go-to-unit", "hover-over", "hover-out"],
74
- data() {
75
- return {
76
- pos: { x: 0, y: 0, width: 0, height: 0 },
77
- canvas: null,
78
- canvasBg: null,
79
- canvasWidth: 0,
80
- canvasHeight: 0,
81
- context: null,
82
- contextBg: null,
83
- image: null,
84
- imageData: null,
85
- originalImageData: null,
86
- hoverApartmentIndex: -1,
87
- showApartmentCard: !1,
88
- cursorX: null,
89
- cursorY: null,
90
- rasterImages: {},
91
- vueCanvasCursor: "auto",
92
- timeout: null,
93
- windowListener: void 0,
94
- resourceLoader: new U(),
95
- apartmentIndexRasterMap: {}
96
- };
97
- },
98
- computed: {
99
- isHoverable() {
100
- return this.$refs.hoverProbe.isHoverEnabled;
101
- },
102
- rasterUrl() {
103
- return this.cdnFileResolver(
104
- `/scenedata${this.viewModel.currentScene}.png`
105
- );
106
- },
107
- rasterImage() {
108
- return this.rasterUrl in this.rasterImages ? this.rasterImages[this.rasterUrl] : null;
109
- },
110
- hoverApartment() {
111
- if (this.hoverApartmentIndex < 0)
112
- return !1;
113
- const e = this.sceneData.find(
114
- (t) => t.index === this.hoverApartmentIndex
115
- );
116
- return e ? this.unitCallback ? this.unitCallback(e.apartmentId) : e.apartmentId : !1;
117
- },
118
- canvasStyle() {
119
- return {
120
- width: this.canvasWidth + "px",
121
- height: this.canvasHeight + "px",
122
- cursor: this.vueCanvasCursor
123
- };
124
- },
125
- hoverBehaviourIdentifier() {
126
- return `hover-${this.showApartmentCard ? "over" : "out"}-${this.hoverApartment ? typeof this.hoverApartment == "object" && "unitId" in this.hoverApartment ? this.hoverApartment.unitId : this.hoverApartment : ""}`;
127
- }
128
- },
129
- watch: {
130
- rasterUrl: {
131
- handler() {
132
- this.rasterImages[this.rasterUrl] || this.resourceLoader.loadImageData(this.rasterUrl).then((e) => {
133
- this.rasterImages = {
134
- ...this.rasterImages,
135
- [this.rasterUrl]: e
136
- };
137
- });
138
- },
139
- immediate: !0
140
- },
141
- rasterImage() {
142
- this.rasterImage && this.init();
143
- },
144
- "viewModel.currentScene": {
145
- handler() {
146
- this.draw();
147
- },
148
- immediate: !0
149
- },
150
- "viewModel.isRotating"() {
151
- this.draw();
152
- },
153
- drawObserver() {
154
- this.draw();
155
- },
156
- selectedUnitId() {
157
- this.draw();
158
- },
159
- hoverApartment() {
160
- this.draw(), this.hoverApartment ? this.vueCanvasCursor = "pointer" : this.vueCanvasCursor = "auto";
161
- },
162
- hoverBehaviourIdentifier() {
163
- this.$emit(this.showApartmentCard ? "hover-over" : "hover-out", {
164
- hoverApartment: this.hoverApartment,
165
- closeHandler: () => this.closeDialog()
166
- });
167
- },
168
- pos() {
169
- this.$emit("pos", this.pos);
170
- }
171
- },
172
- mounted() {
173
- this.windowListener = () => {
174
- clearTimeout(this.timeout), this.updateCanvasSize(), this.timeout = setTimeout(() => {
175
- this.updateCanvasSize();
176
- }, 50);
177
- }, window.addEventListener("resize", this.windowListener), this.updateCanvasSize();
178
- },
179
- beforeUnmount() {
180
- window.removeEventListener("resize", this.windowListener);
181
- for (const e in this.rasterImages)
182
- URL.revokeObjectURL(this.rasterImages[e]);
183
- },
184
- methods: {
185
- init() {
186
- this.canvas = this.$refs.canvasMask, this.context = this.canvas.getContext("2d", { willReadFrequently: !0 }), this.image = new Image(), this.image.onload = () => {
187
- this.setupDraw(), this.canvas.addEventListener(
188
- "mousemove",
189
- this.throttle(this.handleMouseMove, 50)
190
- );
191
- }, this.image.src = this.rasterImage;
192
- },
193
- handleMouseMove(e) {
194
- const t = this.getApartmentIndexByCursorPosition(
195
- e.offsetX,
196
- e.offsetY
197
- );
198
- this.showApartmentCard = t >= 0, this.hoverApartmentIndex = t, this.pos = {
199
- x: e.offsetX,
200
- y: e.offsetY,
201
- width: this.canvasWidth,
202
- height: this.canvasHeight
203
- };
204
- },
205
- clickCanvas(e) {
206
- const t = this.getApartmentIndexByCursorPosition(
207
- e.offsetX,
208
- e.offsetY
209
- );
210
- t < 0 || this.isHoverable && this.goToApartmentByIndex(t);
211
- },
212
- setImageData() {
213
- if (this.image && this.image.width) {
214
- this.canvas.width = this.image.width, this.canvas.height = this.image.height, this.context.drawImage(
215
- this.image,
216
- 0,
217
- 0,
218
- this.image.width,
219
- this.image.height
220
- ), this.originalImageData = this.context.getImageData(
221
- 0,
222
- 0,
223
- this.canvas.width,
224
- this.canvas.height
225
- ), this.imageData = this.context.getImageData(
226
- 0,
227
- 0,
228
- this.canvas.width,
229
- this.canvas.height
230
- );
231
- const e = this.originalImageData.data;
232
- this.apartmentIndexRasterMap = {};
233
- for (let t = 0; t < e.length; t += 4)
234
- this.apartmentIndexRasterMap[e[t]] = [];
235
- for (let t = 3; t < e.length; t += 4)
236
- e[t] === 255 && e[t - 3] in this.apartmentIndexRasterMap && this.apartmentIndexRasterMap[e[t - 3]].push(t - 3);
237
- }
238
- },
239
- getApartmentIndexByCursorPosition(e, t) {
240
- this.cursorX = e, this.cursorY = t;
241
- const i = this.canvas.offsetWidth / this.canvas.width, o = this.canvas.offsetHeight / this.canvas.height, n = (e / i).toFixed(), r = (t / o).toFixed() * (this.canvas.width * 4) + n * 4, a = this.originalImageData.data[r];
242
- return this.originalImageData.data[r + 3] > 0 ? a : -1;
243
- },
244
- getApartmentIndexById(e) {
245
- const t = this.sceneData.find((i) => i.apartmentId === e);
246
- return t ? t.index : -1;
247
- },
248
- highlightApartments() {
249
- this.getApartmentsInRaster().forEach((t) => {
250
- if (t.index >= 0) {
251
- const i = this.getApartmentPixelsByIndex(t.index), o = this.getApartmentIdByIndex(t.index);
252
- let n = "idle";
253
- !this.hoverApartment && this.selectedUnitId && o === this.selectedUnitId ? n = "selected" : this.hoverApartment && this.hoverApartmentIndex === t.index && (n = "hover");
254
- const s = this.unitCallback ? this.unitCallback(o) : o;
255
- if (s) {
256
- const r = this.colorCallback(s, n);
257
- if (r)
258
- for (let a = 0; a < i.length; a++)
259
- this.imageData.data[i[a]] = r.r, this.imageData.data[i[a] + 1] = r.g, this.imageData.data[i[a] + 2] = r.b, this.imageData.data[i[a] + 3] = r.a;
260
- }
261
- }
262
- });
263
- },
264
- // GETTING APARTMENT DATA
265
- // Returns the index of each RGBA value of a given apartment
266
- getApartmentPixelsByIndex(e) {
267
- return this.originalImageData ? this.apartmentIndexRasterMap[e] : !1;
268
- },
269
- getApartmentIdByIndex(e) {
270
- const t = this.sceneData.find((i) => i.index === e);
271
- return t && t.apartmentId;
272
- },
273
- getApartmentsInRaster() {
274
- if (this.originalImageData) {
275
- const e = Object.keys(this.apartmentIndexRasterMap).map(
276
- (i) => parseInt(i)
277
- );
278
- return this.sceneData.filter(
279
- (i) => e.includes(i.index)
280
- );
281
- } else
282
- return [];
283
- },
284
- goToApartmentByIndex(e) {
285
- const t = this.getApartmentIdByIndex(e);
286
- this.goToApartmentById(t);
287
- },
288
- goToApartmentById(e) {
289
- const t = this.unitCallback ? this.unitCallback(e) : e;
290
- this.$emit("select-unit", t), t && this.canGoToUnitCallback(t) && this.$emit("go-to-unit", t);
291
- },
292
- setAlpha(e = 0) {
293
- if (!this.imageData)
294
- return;
295
- const t = this.imageData.data;
296
- for (let i = 3; i < t.length; i += 4)
297
- t[i] = e;
298
- },
299
- updateCanvasSize() {
300
- if (!this.$el)
301
- return !1;
302
- this.canvasWidth = this.$el.offsetWidth, this.canvasHeight = this.$el.offsetHeight;
303
- },
304
- setupDraw() {
305
- this.setImageData(), this.draw();
306
- },
307
- draw() {
308
- this.setAlpha(), this.highlightApartments(), this.context && this.imageData && this.context.putImageData(this.imageData, 0, 0);
309
- },
310
- closeDialog() {
311
- this.showApartmentCard = !1;
312
- }
313
- }
314
- }, ke = { id: "canvas" };
315
- function Ie(e, t, i, o, n, s) {
316
- const r = u("qi-hover-probe");
317
- return d(), m("div", ke, [
318
- A(h("canvas", {
319
- id: "canvas-mask",
320
- ref: "canvasMask",
321
- style: D(s.canvasStyle),
322
- onClick: t[0] || (t[0] = (...a) => s.clickCanvas && s.clickCanvas(...a))
323
- }, null, 4), [
324
- [x, !i.viewModel.isRotating]
325
- ]),
326
- l(r, { ref: "hoverProbe" }, null, 512)
327
- ]);
328
- }
329
- const N = /* @__PURE__ */ w(_e, [["render", Ie], ["__scopeId", "data-v-3bbbc77b"]]), Ce = {
330
- name: "QiApartmentChooserSvg",
331
- components: { QiHoverProbe: $ },
332
- mixins: [de],
333
- props: {
334
- cdnFileResolver: { type: Function, required: !0 },
335
- viewModel: { type: Object, required: !0 },
336
- selectedUnitId: { type: String, default: null },
337
- unitCallback: { type: Function, default: (e) => e },
338
- canGoToUnitCallback: { type: Function, default: () => !0 },
339
- sceneData: { type: Array, default: [] },
340
- colorCallback: {
341
- type: Function,
342
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
343
- },
344
- drawObserver: {
345
- type: [Object, Array, String, Number, Boolean],
346
- default: null
347
- }
348
- },
349
- emits: ["select-unit", "go-to-unit", "hover-over", "hover-out"],
350
- data() {
351
- return {
352
- pos: { x: 0, y: 0, width: 0, height: 0 },
353
- hoverApartmentIndex: -1,
354
- svgImages: {},
355
- currentSvgImage: null,
356
- resourceLoader: new U()
357
- };
358
- },
359
- computed: {
360
- isHoverable() {
361
- return this.$refs.hoverProbe.isHoverEnabled;
362
- }
363
- },
364
- watch: {
365
- "viewModel.currentScene": {
366
- handler() {
367
- this.viewModel.currentScene in this.svgImages && (this.currentSvgImage = this.svgImages[this.viewModel.currentScene]);
368
- },
369
- immediate: !0
370
- },
371
- svgImages: {
372
- handler() {
373
- this.viewModel.currentScene in this.svgImages && (this.currentSvgImage = this.svgImages[this.viewModel.currentScene]);
374
- },
375
- immediate: !0
376
- },
377
- pos() {
378
- this.$emit("pos", this.pos);
379
- },
380
- hoverApartmentIndex(e, t) {
381
- if (e >= 0) {
382
- const i = this.getApartmentByIndex(e);
383
- this.$emit("hover-over", {
384
- hoverApartment: i,
385
- closeHandler: () => {
386
- this.hoverApartmentIndex = -1;
387
- }
388
- });
389
- } else {
390
- const i = this.getApartmentByIndex(t);
391
- this.$emit("hover-out", {
392
- hoverApartment: i,
393
- closeHandler: () => {
394
- this.hoverApartmentIndex = -1;
395
- }
396
- });
397
- }
398
- }
399
- },
400
- mounted() {
401
- for (let e = 1; e <= 4; e++) {
402
- const t = this.cdnFileResolver(`/scenedata${e}.svg`), i = {};
403
- this.resourceLoader.loadJson(t).then((o) => {
404
- i.markup = o;
405
- const s = new DOMParser().parseFromString(o, "image/svg+xml").getElementsByTagName("svg")[0];
406
- i.viewBox = s.getAttribute("viewBox"), i.svgObjects = Array.from(
407
- s.querySelectorAll("*[data-index]")
408
- ).map((r) => ({
409
- index: parseInt(r.getAttribute("data-index")),
410
- svg: r.innerHTML
411
- })), this.svgImages = { ...this.svgImages, [e]: i };
412
- });
413
- }
414
- this.$refs.container.addEventListener(
415
- "mousemove",
416
- this.throttle(this.handleMouseMove, 50)
417
- );
418
- },
419
- methods: {
420
- handleMouseMove(e) {
421
- this.pos = {
422
- x: e.offsetX,
423
- y: e.offsetY,
424
- width: this.$el.offsetWidth,
425
- height: this.$el.offsetHeight
426
- };
427
- },
428
- getApartmentIdByIndex(e) {
429
- var t;
430
- return (t = this.sceneData.find((i) => i.index === parseInt(e))) == null ? void 0 : t.apartmentId;
431
- },
432
- getApartmentByIndex(e) {
433
- const t = this.getApartmentIdByIndex(e);
434
- return this.unitCallback ? this.unitCallback(t) : t;
435
- },
436
- mouseEnter(e) {
437
- this.isHoverable && (this.hoverApartmentIndex = e);
438
- },
439
- mouseLeave() {
440
- this.isHoverable && (this.hoverApartmentIndex = -1);
441
- },
442
- click(e) {
443
- const t = this.getApartmentByIndex(e);
444
- this.$emit("select-unit", t), this.isHoverable && t && this.canGoToUnitCallback(t) ? this.$emit("go-to-unit", t) : this.hoverApartmentIndex = e;
445
- },
446
- getGClass(e) {
447
- const t = this.getApartmentIdByIndex(e), i = this.getApartmentByIndex(e);
448
- let o = "idle";
449
- this.hoverApartmentIndex < 0 && this.selectedUnitId && t === this.selectedUnitId ? o = "selected" : this.hoverApartmentIndex >= 0 && this.hoverApartmentIndex === e && (o = "hover");
450
- const n = this.colorCallback(i, o);
451
- if (n) {
452
- const { r: s, g: r, b: a, a: g, s: f } = n;
453
- return {
454
- strokeWidth: f !== void 0 ? f : 2,
455
- stroke: `rgb(${s}, ${r}, ${a})`,
456
- strokeOpacity: 1,
457
- fill: `rgb(${s}, ${r}, ${a})`,
458
- fillOpacity: g / 255,
459
- cursor: `${this.canGoToUnitCallback(i) ? "cursor" : "default"} !important`
460
- };
461
- } else
462
- return {
463
- strokeWidth: 0,
464
- stroke: "white",
465
- strokeOpacity: 0,
466
- fill: "white",
467
- fillOpacity: 0,
468
- cursor: "default !important"
469
- };
470
- }
471
- }
472
- }, Se = {
473
- id: "container",
474
- ref: "container"
475
- }, Be = ["viewBox"], De = ["innerHTML", "onMouseenter", "onMouseleave", "onClick"];
476
- function Ae(e, t, i, o, n, s) {
477
- const r = u("qi-hover-probe");
478
- return d(), m("div", Se, [
479
- A(h("div", {
480
- class: "svg-container",
481
- style: D({
482
- opacity: !n.currentSvgImage || !n.currentSvgImage.svgObjects ? 0 : 1
483
- })
484
- }, [
485
- n.currentSvgImage && n.currentSvgImage.svgObjects ? (d(), m("svg", {
486
- key: 0,
487
- viewBox: n.currentSvgImage.viewBox
488
- }, [
489
- (d(!0), m(L, null, T(n.currentSvgImage.svgObjects, ({ index: a, svg: g }) => (d(), m("g", {
490
- key: a,
491
- innerHTML: g,
492
- style: D(s.getGClass(a)),
493
- onMouseenter: (f) => s.mouseEnter(a),
494
- onMouseleave: (f) => s.mouseLeave(a),
495
- onClick: (f) => s.click(a)
496
- }, null, 44, De))), 128))
497
- ], 8, Be)) : k("", !0)
498
- ], 4), [
499
- [x, !i.viewModel.isRotating]
500
- ]),
501
- l(r, { ref: "hoverProbe" }, null, 512)
502
- ], 512);
503
- }
504
- const X = /* @__PURE__ */ w(Ce, [["render", Ae], ["__scopeId", "data-v-82a61864"]]), xe = {
505
- name: "QiApartmentChooserNavigation",
506
- inject: ["i18n"],
507
- props: {
508
- canGoToUnitCallback: { type: Function, default: () => !0 },
509
- selectedUnit: { type: Object, default: null },
510
- prevUnit: { type: Object, default: null },
511
- nextUnit: { type: Object, default: null },
512
- viewModel: { type: Object, required: !0 }
513
- },
514
- mounted() {
515
- window.addEventListener("keydown", this.keyNavigate);
516
- },
517
- beforeUnmount() {
518
- window.removeEventListener("keydown", this.keyNavigate);
519
- },
520
- methods: {
521
- keyNavigate(e) {
522
- e.keyCode === 37 ? this.prevUnit && this.$emit("prev-unit") : e.keyCode === 39 && this.nextUnit && this.$emit("next-unit");
523
- }
524
- }
525
- }, Me = {
526
- key: 0,
527
- class: "d-none d-md-flex"
528
- };
529
- function Re(e, t, i, o, n, s) {
530
- const r = u("v-btn");
531
- return d(), m("div", null, [
532
- l(r, {
533
- elevation: "1",
534
- icon: "mdi-rotate-right",
535
- class: "black darken-1",
536
- onClick: t[0] || (t[0] = (a) => i.viewModel.rotateClockwise())
537
- }),
538
- l(r, {
539
- elevation: "1",
540
- plain: "",
541
- icon: "mdi-chevron-left",
542
- class: "mr-sm-4 ml-sm-8 mr-3 ml-3 black darken-1",
543
- disabled: !i.prevUnit,
544
- onClick: t[1] || (t[1] = (a) => e.$emit("prev-unit"))
545
- }, null, 8, ["disabled"]),
546
- l(r, {
547
- color: "success darken-2",
548
- elevation: "1",
549
- rounded: "",
550
- plain: "",
551
- disabled: !i.selectedUnit || !i.canGoToUnitCallback(i.selectedUnit),
552
- onClick: t[2] || (t[2] = (a) => e.$emit("go-to-unit", i.selectedUnit))
553
- }, {
554
- default: c(() => [
555
- i.selectedUnit && i.canGoToUnitCallback(i.selectedUnit) ? (d(), m("span", Me, S(s.i18n.getLabel("see-apartment")) + "  ", 1)) : k("", !0),
556
- h("span", null, S(i.selectedUnit && "title" in i.selectedUnit ? i.selectedUnit.title : "-"), 1)
557
- ]),
558
- _: 1
559
- }, 8, ["disabled"]),
560
- l(r, {
561
- elevation: "1",
562
- plain: "",
563
- icon: "mdi-chevron-right",
564
- class: "mr-sm-8 ml-sm-4 mr-3 ml-3 black darken-1",
565
- disabled: !i.nextUnit,
566
- onClick: t[3] || (t[3] = (a) => e.$emit("next-unit"))
567
- }, null, 8, ["disabled"]),
568
- l(r, {
569
- elevation: "1",
570
- plain: "",
571
- icon: "mdi-rotate-left",
572
- class: "black darken-1",
573
- onClick: t[4] || (t[4] = (a) => i.viewModel.rotateCounterClockwise())
574
- })
575
- ]);
576
- }
577
- const ce = /* @__PURE__ */ w(xe, [["render", Re], ["__scopeId", "data-v-129ef905"]]);
578
- class W {
579
- constructor(t) {
580
- this._numParts = t, this._loadedCount = 0, this._isError = !1, this._finishedAction = () => {
581
- }, this._errorAction = () => {
582
- }, this._loadProgressAction = () => {
583
- };
584
- }
585
- onLoadFinished(t) {
586
- return this._finishedAction = t, this;
587
- }
588
- onLoadError(t) {
589
- return this._errorAction = t, this;
590
- }
591
- onLoadProgress(t) {
592
- return this._loadProgressAction = t, this;
593
- }
594
- partLoaded() {
595
- this.isFinished || (this._loadedCount++, this._loadProgressAction(this.percentLoaded), this.isFinished && this._finishedAction());
596
- }
597
- errorDetected() {
598
- this._isError || (this._isError = !0, this._errorAction());
599
- }
600
- get isFinished() {
601
- return this._loadedCount >= this._numParts;
602
- }
603
- get isError() {
604
- return this._isError;
605
- }
606
- get percentLoaded() {
607
- return Math.round(this._loadedCount * 100 / this._numParts);
608
- }
609
- }
610
- class J {
611
- constructor(t, i, o, n) {
612
- this._rotator = t, this._direction = i, this._frameIndex = o, this._sceneCount = n;
613
- }
614
- get atEnd() {
615
- return this._sceneCount === 0;
616
- }
617
- get frameIndex() {
618
- return this._frameIndex;
619
- }
620
- nextFrame() {
621
- const t = this._rotator.clampFrameIndex(
622
- this._frameIndex + this._direction
623
- ), i = this._rotator.isCardinalFrame(t) ? this._sceneCount - 1 : this._sceneCount;
624
- return new J(
625
- this._rotator,
626
- this._direction,
627
- t,
628
- i
629
- );
630
- }
631
- }
632
- class Fe {
633
- constructor(t, i) {
634
- this._cardinalFrames = t, this._totalFrameCount = i;
635
- }
636
- start(t, i, o) {
637
- const n = this.startFrameIndexForScene(i);
638
- return new J(this, t, n, o);
639
- }
640
- isCardinalFrame(t) {
641
- return this._cardinalFrames.includes(t);
642
- }
643
- clampFrameIndex(t) {
644
- return (this._totalFrameCount + t) % this._totalFrameCount;
645
- }
646
- startFrameIndexForScene(t) {
647
- return this._cardinalFrames[t];
648
- }
649
- }
650
- const se = 64, O = 4, He = 120, Te = {
651
- name: "QiApartmentChooserRotator",
652
- props: {
653
- viewModel: { type: Object, required: !0 },
654
- build: { type: String, default: "" },
655
- cdnFileResolver: { type: Function, required: !0 },
656
- cardinalFrames: { type: Array, required: !0 }
657
- },
658
- emits: ["loaded", "error", "progress"],
659
- data() {
660
- const e = this.createFrames();
661
- return {
662
- loadTracker: new W(e.length).onLoadFinished(() => this.$emit("loaded")).onLoadProgress((t) => this.$emit("progress", t)).onLoadError(() => this.$emit("error")),
663
- sceneRotator: new Fe(this.cardinalFrames, se),
664
- images: e,
665
- isPreloaded: !1
666
- };
667
- },
668
- computed: {
669
- activeFrame() {
670
- return this.images.find((e) => e.show);
671
- }
672
- },
673
- watch: {
674
- "viewModel.currentScene"(e, t) {
675
- const i = this.getDirection(t, e), o = this.getSceneCountBetween(t, e);
676
- this.rotateInDirection(t, i, o);
677
- }
678
- },
679
- created() {
680
- this.rotateComplete();
681
- },
682
- methods: {
683
- rotateInDirection(e, t, i) {
684
- this.viewModel.isRotating || (this.viewModel.isRotating = !0, this.rotationStep(
685
- this.sceneRotator.start(
686
- t,
687
- e % O,
688
- i
689
- )
690
- ));
691
- },
692
- rotationStep(e) {
693
- setTimeout(() => {
694
- this.images[e.frameIndex].show = !1;
695
- const t = e.nextFrame();
696
- this.images[t.frameIndex].show = !0, t.atEnd ? this.rotateComplete() : window.requestAnimationFrame(() => this.rotationStep(t));
697
- }, 1e3 / He);
698
- },
699
- rotateComplete() {
700
- const e = this.sceneRotator.startFrameIndexForScene(
701
- this.viewModel.currentScene % O
702
- );
703
- e in this.images && (this.images[e].show = !0), this.viewModel.isRotating = !1;
704
- },
705
- createFrames() {
706
- const e = [];
707
- for (let t = 0; t < se; t++) {
708
- const { sourceSet: i, defaultPath: o } = this.frameImageSource(t);
709
- e.push({
710
- index: t,
711
- sourceSet: i,
712
- defaultPath: o,
713
- show: !1
714
- });
715
- }
716
- return e;
717
- },
718
- frameImageSource(e) {
719
- const t = ("0000" + (e + 1)).slice(-4), i = this.build ? `?v=${this.build}` : "", o = [
720
- `${this.cdnFileResolver(`/480/${t}.jpg${i}`)} 480w`,
721
- `${this.cdnFileResolver(`/960/${t}.jpg${i}`)} 960w`,
722
- `${this.cdnFileResolver(`/1280/${t}.jpg${i}`)} 1280w`
723
- ].join(","), n = this.cdnFileResolver(
724
- `/480/${t}.jpg${i}`
725
- );
726
- return { sourceSet: o, defaultPath: n };
727
- },
728
- getSceneCountBetween(e, t) {
729
- const i = O / 2, o = Math.abs(e - t);
730
- return o > i ? O - o : o;
731
- },
732
- getDirection(e, t) {
733
- if (e === t)
734
- return 0;
735
- const o = Math.abs(e - t) < O / 2;
736
- return o && e < t || !o && e > t ? 1 : -1;
737
- }
738
- }
739
- }, Le = {
740
- key: 0,
741
- class: "fill-parent d-flex justify-center align-center blue-grey lighten-5"
742
- }, Ue = {
743
- key: 1,
744
- class: "frame-container"
745
- }, $e = { class: "frame-image" }, Oe = ["srcset", "type"], Ee = ["src"], qe = {
746
- key: 2,
747
- id: "image-stack",
748
- class: "frame-container"
749
- }, je = ["alt"], Ye = ["srcset"], ze = ["src"];
750
- function Pe(e, t, i, o, n, s) {
751
- const r = u("v-icon");
752
- return d(), m("div", null, [
753
- n.loadTracker.isError ? (d(), m("div", Le, [
754
- l(r, { "x-large": "" }, {
755
- default: c(() => [
756
- B("mdi-alert-circle-outline")
757
- ]),
758
- _: 1
759
- })
760
- ])) : n.isPreloaded ? (d(), m("div", qe, [
761
- (d(!0), m(L, null, T(n.images, (a) => (d(), m("picture", {
762
- key: a.index,
763
- alt: a.index,
764
- class: M({ "frame-image": !0, show: a.show })
765
- }, [
766
- h("source", {
767
- srcset: a.sourceSet,
768
- type: "image/jpeg"
769
- }, null, 8, Ye),
770
- h("img", {
771
- src: a.defaultPath,
772
- alt: "Building image",
773
- onLoad: t[2] || (t[2] = (g) => n.loadTracker.partLoaded()),
774
- onError: t[3] || (t[3] = (g) => n.loadTracker.errorDetected())
775
- }, null, 40, ze)
776
- ], 10, je))), 128))
777
- ])) : (d(), m("div", Ue, [
778
- h("picture", $e, [
779
- h("source", {
780
- srcset: s.activeFrame.sourceSet,
781
- type: s.activeFrame.type
782
- }, null, 8, Oe),
783
- h("img", {
784
- src: s.activeFrame.defaultPath,
785
- onLoad: t[0] || (t[0] = (a) => n.isPreloaded = !0),
786
- onError: t[1] || (t[1] = (a) => n.loadTracker.errorDetected())
787
- }, null, 40, Ee)
788
- ])
789
- ]))
790
- ]);
791
- }
792
- const ue = /* @__PURE__ */ w(Te, [["render", Pe], ["__scopeId", "data-v-e6481f8e"]]), Qe = {
793
- name: "FloatingCard",
794
- props: {
795
- pos: { type: Object, required: !0 },
796
- isHoverable: Boolean
797
- },
798
- computed: {
799
- q() {
800
- const e = this.pos.x <= this.pos.width / 2 ? "left" : "right";
801
- return `${this.pos.y <= this.pos.height / 2 ? "top" : "bottom"}-${e}`;
802
- }
803
- }
804
- };
805
- function Ve(e, t, i, o, n, s) {
806
- const r = u("v-dialog"), a = u("v-fade-transition");
807
- return d(), I(a, {
808
- origin: s.q.replace("-", " ") + " " + i.pos.x + " " + i.pos.y
809
- }, {
810
- default: c(() => [
811
- i.isHoverable ? (d(), m("div", {
812
- key: 0,
813
- class: M(["floating-card", s.q]),
814
- style: D({ left: `${i.pos.x}px`, top: `${i.pos.y}px`, pointerEvents: "none" })
815
- }, [
816
- _(e.$slots, "default", { isHoverable: i.isHoverable }, void 0, !0)
817
- ], 6)) : (d(), I(r, {
818
- key: 1,
819
- value: !0,
820
- width: "auto",
821
- "onClick:outside": t[0] || (t[0] = (g) => e.$emit("outside", g))
822
- }, {
823
- default: c(() => [
824
- _(e.$slots, "default", { isHoverable: i.isHoverable }, void 0, !0)
825
- ]),
826
- _: 3
827
- }))
828
- ]),
829
- _: 3
830
- }, 8, ["origin"]);
831
- }
832
- const z = /* @__PURE__ */ w(Qe, [["render", Ve], ["__scopeId", "data-v-b74de171"]]), Ge = {
833
- name: "QiZoomBox",
834
- props: {
835
- desktop: {
836
- type: Boolean,
837
- default: !0
838
- },
839
- mobile: {
840
- type: Boolean,
841
- default: !0
842
- },
843
- maxScale: {
844
- type: Number,
845
- default: 10
846
- },
847
- consumeMouseClickWhenMoved: {
848
- type: Boolean,
849
- default: !0
850
- },
851
- consumeMouseUpWhenMoved: {
852
- type: Boolean,
853
- default: !0
854
- }
855
- },
856
- data() {
857
- return {
858
- zoom: 100,
859
- originX: 0,
860
- originY: 0,
861
- moving: !1,
862
- scaling: !1,
863
- lastEvent: void 0,
864
- moved: !1
865
- };
866
- },
867
- computed: {
868
- transform() {
869
- return `translateX(${this.originX}px) translateY(${this.originY}px) scale(${this.scale})`;
870
- },
871
- scale() {
872
- return this.zoom / 100;
873
- },
874
- actualMaxScale() {
875
- return this.maxScale * 100;
876
- }
877
- },
878
- watch: {
879
- scale() {
880
- this.emitUpdate();
881
- },
882
- originX() {
883
- this.emitUpdate();
884
- },
885
- originY() {
886
- this.emitUpdate();
887
- },
888
- desktop() {
889
- this.desktop ? this.addDesktopHandlers() : this.removeDesktopHandlers();
890
- },
891
- mobile() {
892
- this.mobile ? this.addMobileHandlers() : this.removeMobileHandlers();
893
- }
894
- },
895
- mounted() {
896
- this.desktop && this.addDesktopHandlers(), this.mobile && this.addMobileHandlers();
897
- },
898
- beforeUnmount() {
899
- this.desktop && this.removeDesktopHandlers(), this.mobile && this.removeMobileHandlers();
900
- },
901
- methods: {
902
- addDesktopHandlers() {
903
- this.$refs.box.addEventListener("wheel", this.wheelHandler, {
904
- capture: !0
905
- }), this.$refs.box.addEventListener("mousedown", this.mouseDownHandler, {
906
- capture: !0
907
- }), this.$refs.box.addEventListener("mousemove", this.mouseMoveHandler, {
908
- capture: !0
909
- }), window.addEventListener("mouseup", this.mouseUpHandler, {
910
- capture: !0
911
- }), window.addEventListener("click", this.mouseClickHandler, {
912
- capture: !0
913
- });
914
- },
915
- addMobileHandlers() {
916
- this.$refs.box.addEventListener("touchstart", this.touchStartHandler, {
917
- capture: !0
918
- }), this.$refs.box.addEventListener("touchmove", this.touchMoveHandler, {
919
- capture: !0
920
- }), window.addEventListener("touchend", this.touchEndHandler, {
921
- capture: !0
922
- }), window.addEventListener("touchcancel", this.touchEndHandler, {
923
- capture: !0
924
- });
925
- },
926
- removeDesktopHandlers() {
927
- this.$refs.box.removeEventListener("wheel", this.wheelHandler, {
928
- capture: !0
929
- }), this.$refs.box.removeEventListener("mousedown", this.mouseDownHandler, {
930
- capture: !0
931
- }), this.$refs.box.removeEventListener("mousemove", this.mouseMoveHandler, {
932
- capture: !0
933
- }), window.removeEventListener("mouseup", this.mouseUpHandler, {
934
- capture: !0
935
- }), window.removeEventListener("click", this.mouseClickHandler, {
936
- capture: !0
937
- });
938
- },
939
- removeMobileHandlers() {
940
- this.$refs.box.removeEventListener("touchstart", this.touchStartHandler, {
941
- capture: !0
942
- }), this.$refs.box.removeEventListener("touchmove", this.touchMoveHandler, {
943
- capture: !0
944
- }), window.removeEventListener("touchend", this.touchEndHandler, {
945
- capture: !0
946
- }), window.removeEventListener("touchcancel", this.touchEndHandler, {
947
- capture: !0
948
- });
949
- },
950
- wheelHandler(e) {
951
- const { x: t, y: i } = this.getOffsetCoordinates(e);
952
- this.adjustZoom(-e.deltaY / 10, t, i), e.preventDefault();
953
- },
954
- mouseDownHandler(e) {
955
- this.moving = !0, this.moved = !1, this.lastEvent = e;
956
- },
957
- mouseMoveHandler(e) {
958
- if (this.moving) {
959
- const { x: t, y: i } = this.getOffsetCoordinates(e), { x: o, y: n } = this.getOffsetCoordinates(this.lastEvent), s = {
960
- x: t - o,
961
- y: i - n
962
- };
963
- this.adjustTranslateX(s.x), this.adjustTranslateY(s.y), this.moved = !0, this.lastEvent = e;
964
- }
965
- },
966
- mouseUpHandler(e) {
967
- this.moving && this.moved && this.consumeMouseUpWhenMoved && (e.preventDefault(), e.stopImmediatePropagation());
968
- },
969
- mouseClickHandler(e) {
970
- this.moving && (this.moved && this.consumeMouseClickWhenMoved && (e.preventDefault(), e.stopImmediatePropagation()), this.moving = !1);
971
- },
972
- touchStartHandler(e) {
973
- this.moving = e.touches.length === 1, this.scaling = e.touches.length === 2, this.lastEvent = e;
974
- },
975
- touchMoveHandler(e) {
976
- if (this.moving) {
977
- const { x: t, y: i } = this.getOffsetCoordinates(e.touches[0]), { x: o, y: n } = this.getOffsetCoordinates(
978
- this.lastEvent.touches[0]
979
- ), s = {
980
- x: t - o,
981
- y: i - n
982
- };
983
- this.adjustTranslateX(s.x), this.adjustTranslateY(s.y);
984
- } else if (this.scaling && e.touches.length === 2) {
985
- const { x: t, y: i } = this.getOffsetCoordinates(e.touches[0]), { x: o, y: n } = this.getOffsetCoordinates(
986
- this.lastEvent.touches[0]
987
- ), { x: s, y: r } = this.getOffsetCoordinates(e.touches[1]), { x: a, y: g } = this.getOffsetCoordinates(
988
- this.lastEvent.touches[1]
989
- ), f = Math.hypot(o - a, n - g), y = Math.hypot(t - s, i - r), C = (s + t) / 2, p = (r + i) / 2;
990
- this.adjustZoom(y - f, C, p);
991
- }
992
- this.lastEvent = e;
993
- },
994
- touchEndHandler() {
995
- this.moving = !1, this.scaling = !1;
996
- },
997
- getOffsetCoordinates(e) {
998
- const { left: t, top: i } = this.$refs.box.getBoundingClientRect();
999
- return {
1000
- x: e.clientX - t,
1001
- y: e.clientY - i
1002
- };
1003
- },
1004
- adjustTranslateX(e) {
1005
- const t = this.$refs.box.clientWidth, i = t * this.scale;
1006
- this.originX = Math.max(
1007
- Math.min(0, this.originX + e),
1008
- -(i - t)
1009
- );
1010
- },
1011
- adjustTranslateY(e) {
1012
- const t = this.$refs.box.clientHeight, i = t * this.scale;
1013
- this.originY = Math.max(
1014
- Math.min(0, this.originY + e),
1015
- -(i - t)
1016
- );
1017
- },
1018
- adjustZoom(e, t, i) {
1019
- const o = this.$refs.box.clientWidth, n = this.$refs.box.clientHeight, s = o * this.scale, r = n * this.scale;
1020
- this.zoom = Math.min(
1021
- Math.max(100, this.zoom + e),
1022
- this.actualMaxScale
1023
- );
1024
- const a = o * this.scale, g = n * this.scale, f = a - s, y = g - r;
1025
- this.originX -= t / o * f, this.originY -= i / n * y, this.adjustTranslateX(0), this.adjustTranslateY(0);
1026
- },
1027
- emitUpdate() {
1028
- this.$emit("update", {
1029
- scale: this.scale,
1030
- x: this.originX,
1031
- y: this.originY,
1032
- resolve: (e, t) => {
1033
- const i = this.$refs.box.clientWidth, o = this.$refs.box.clientHeight, n = this.originX / -this.scale, s = this.originY / -this.scale, r = n + i / this.scale, a = s + o / this.scale, g = e / i * (r - n) + n, f = t / o * (a - s) + s;
1034
- return { x: g, y: f };
1035
- }
1036
- });
1037
- }
1038
- }
1039
- }, Ne = {
1040
- ref: "box",
1041
- class: "zoom-box-container"
1042
- };
1043
- function Xe(e, t, i, o, n, s) {
1044
- return d(), m("div", Ne, [
1045
- h("div", {
1046
- style: D({ "transform-origin": "top left", transform: s.transform }),
1047
- class: "zoom-box"
1048
- }, [
1049
- _(e.$slots, "default", {}, void 0, !0)
1050
- ], 4)
1051
- ], 512);
1052
- }
1053
- const P = /* @__PURE__ */ w(Ge, [["render", Xe], ["__scopeId", "data-v-83bfd28a"]]), ee = 4;
1054
- function he(e) {
1055
- return e < ee ? e + 1 : 1;
1056
- }
1057
- function We(e) {
1058
- return e > 1 ? e - 1 : ee;
1059
- }
1060
- class Ke {
1061
- constructor(t) {
1062
- this._state = {
1063
- isRotating: !1,
1064
- currentScene: t
1065
- };
1066
- }
1067
- get isRotating() {
1068
- return this._state.isRotating;
1069
- }
1070
- set isRotating(t) {
1071
- this._state.isRotating = t;
1072
- }
1073
- get navigator() {
1074
- return this._navigator;
1075
- }
1076
- get sceneModel() {
1077
- return this._sceneModel;
1078
- }
1079
- unlessRotatingDo(t) {
1080
- this.isRotating || t();
1081
- }
1082
- get currentScene() {
1083
- return this._state.currentScene;
1084
- }
1085
- set currentScene(t) {
1086
- this._state.currentScene = t;
1087
- }
1088
- rotateCounterClockwise() {
1089
- this.unlessRotatingDo(() => {
1090
- this.currentScene = he(this.currentScene);
1091
- });
1092
- }
1093
- rotateClockwise() {
1094
- this.unlessRotatingDo(() => {
1095
- this.currentScene = We(this.currentScene);
1096
- });
1097
- }
1098
- }
1099
- const Ze = {
1100
- // virtual tour default labels
1101
- interior: "Interiør",
1102
- "see-a-selection-of-the-options-in-the-project": "Se et utvalg av tilvalgsmulighetene i prosjektet.",
1103
- "floor-plan": "Planløsning",
1104
- "all-illustrations-are-indicative-deviations-may-occur": { nb: "Alle illustrasjoner er veiledende. Avvik kan forekomme.", en: "All illustrations are indicative. Discrepancies may exist." },
1105
- "read-more-here": "Les mer her",
1106
- "i-understand": { nb: "Jeg forstår", en: "I understand" },
1107
- share: "Share",
1108
- "share-to-facebook": "Share to Facebook",
1109
- "share-to-linkedin": "Share to Linkedin",
1110
- "share-to-twitter": "Share to Twitter",
1111
- "share-via-email": "Share via Email",
1112
- "copy-link": "Copy link",
1113
- "virtual-view": "Virtuell Visning",
1114
- "slide-show": "Slide Show",
1115
- // building chooser default labels
1116
- room: "Room",
1117
- floor: "Floor",
1118
- "see-apartments": "See apartments",
1119
- // apartment chooser default labels
1120
- "see-apartment": "See apartment",
1121
- "click-and-drag-to-look-around": { en: "Click and drag to look around", nb: "Klikk og dra for å se deg rundt" },
1122
- "click-on-the-cricles-to-move-around": { en: "Click on the circles to move around", nb: "Klikk på sirkelene for å gå rundt" },
1123
- "use-the-mouse-wheel-to-zoom": { en: "Use the mouse wheel to zoom", nb: "Bruk mushjulet for å zoome" },
1124
- "you-can-also-use-the-arrow-keys-to-move-around": { en: "You can also use the arrow keys to move around", nb: "Du kan også bruke pilene på tastaturet for å gå rundt" },
1125
- "tap-and-drag-to-look-around": { en: "Tap and drag to look around", nb: "Trykk og dra for å se deg rundt" },
1126
- "tap-on-the-circles-to-move-around": { en: "Tap on the circles to move around", nb: "Trykk på sirkelene for å gå rundt" },
1127
- "use-two-fingers-to-zoom": { en: "Use two fingers to zoom", nb: "Bruk to fingre for å zoome" },
1128
- "dont-show-again": { en: "Don't Show Again", nb: "Ikke vis igjen" }
1129
- };
1130
- class F {
1131
- constructor(t, i) {
1132
- this._labels = { ...Ze, ...t || {} }, this._language = i || "en";
1133
- }
1134
- getLabel(t) {
1135
- return t in this._labels ? this.get(this._labels[t]) : t;
1136
- }
1137
- get(t) {
1138
- if (typeof t == "string")
1139
- return t;
1140
- if (this._language in t && t[this._language])
1141
- return t[this._language];
1142
- for (const i in t)
1143
- if (t[i])
1144
- return t[i];
1145
- return "";
1146
- }
1147
- }
1148
- const Je = 4, et = [0, 16, 32, 48], tt = {
1149
- name: "QiApartmentChooser",
1150
- components: {
1151
- QiApartmentChooserRaster: N,
1152
- QiApartmentChooserSvg: X,
1153
- QiApartmentChooserNavigation: ce,
1154
- QiApartmentChooserRotator: ue,
1155
- QiFloatingCard: z,
1156
- QiHoverProbe: $,
1157
- QiZoomBox: P
1158
- },
1159
- provide() {
1160
- return {
1161
- i18n: this.i18n ? new F(this.i18n.labels, this.i18n.language) : new F()
1162
- };
1163
- },
1164
- emits: [
1165
- "select-unit",
1166
- "go-to-unit",
1167
- "nav-unit",
1168
- "hover-over-unit",
1169
- "hover-out-unit",
1170
- "initialized"
1171
- ],
1172
- props: {
1173
- i18n: { type: Object, default: void 0 },
1174
- showCards: { type: Boolean, default: !0 },
1175
- build: { type: String, default: "" },
1176
- buildingSceneDataResolver: { type: Function, default: null },
1177
- buildingScenesByApartmentResolver: { type: Function, default: null },
1178
- cdnFileResolver: { type: Function, required: !0 },
1179
- colorCallback: {
1180
- type: Function,
1181
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
1182
- },
1183
- unitCallback: { type: Function, default: (e) => e },
1184
- canGoToUnitCallback: { type: Function, default: () => !0 },
1185
- selectedUnitId: { type: String, default: null },
1186
- nextUnit: { type: Object, default: null },
1187
- prevUnit: { type: Object, default: null },
1188
- drawObserver: {
1189
- type: [Object, Array, String, Number, Boolean],
1190
- default: null
1191
- },
1192
- interactiveDesktop: { type: Boolean, default: !0 },
1193
- interactiveMobile: { type: Boolean, default: !0 },
1194
- useSvg: { type: Boolean, default: !1 }
1195
- },
1196
- data() {
1197
- return {
1198
- loadState: { isReady: !1, isError: !1, progress: void 0 },
1199
- scenesByApartment: null,
1200
- sceneData: null,
1201
- scenes: null,
1202
- viewModel: void 0,
1203
- resourceLoader: new U(),
1204
- pos: { x: 0, y: 0, width: 0, height: 0 },
1205
- closeHandler: void 0,
1206
- hoverApartment: void 0
1207
- };
1208
- },
1209
- computed: {
1210
- isHoverable() {
1211
- return this.$refs.hoverProbe.isHoverEnabled;
1212
- },
1213
- selectedUnit() {
1214
- return this.unitCallback ? this.unitCallback(this.selectedUnitId) : this.selectedUnitId;
1215
- },
1216
- overlayComponent() {
1217
- return this.useSvg ? X : N;
1218
- }
1219
- },
1220
- watch: {
1221
- selectedUnitId: {
1222
- handler() {
1223
- if (this.selectedUnitId && this.viewModel) {
1224
- const e = this.scenesByApartment[this.selectedUnitId];
1225
- e && (this.viewModel.currentScene = e);
1226
- }
1227
- },
1228
- immediate: !0
1229
- }
1230
- },
1231
- async mounted() {
1232
- let e = null;
1233
- try {
1234
- e = await this.resourceLoader.loadJson(
1235
- this.cdnFileResolver("/apartmentChooser.json")
1236
- );
1237
- } catch {
1238
- console.info("apartmentChooser.json not found");
1239
- }
1240
- const t = e && e.startScene !== void 0 ? e.startScene : Je;
1241
- this.scenes = e && e.scenes !== void 0 ? e.scenes : et, this.sceneData = e && e.sceneData !== void 0 ? e.sceneData.map((n) => ({
1242
- apartmentId: n.apartmentID,
1243
- index: n.index
1244
- })) : this.buildingSceneDataResolver ? await this.buildingSceneDataResolver() : [], this.scenesByApartment = e && e.sceneData !== void 0 ? e.sceneData.map((n) => {
1245
- const s = n.bestScene === 0 ? 4 : n.bestScene;
1246
- return { unitId: n.apartmentID, scene: s };
1247
- }).reduce((n, s) => ({ ...n, [s.unitId]: s.scene }), {}) : this.buildingScenesByApartmentResolver ? await this.buildingScenesByApartmentResolver() : [];
1248
- const i = (n, s = "unitId") => {
1249
- let r = t, a = [];
1250
- for (let g = 0; g < ee; g++)
1251
- a.push(r), r = he(r);
1252
- return n.sort((g, f) => {
1253
- const y = a.findIndex(
1254
- (p) => p === this.scenesByApartment[g[s]]
1255
- ), C = a.findIndex(
1256
- (p) => p === this.scenesByApartment[f[s]]
1257
- );
1258
- return y < C ? -1 : y > C ? 1 : 0;
1259
- }), n;
1260
- }, o = (n) => {
1261
- this.viewModel = new Ke(n);
1262
- };
1263
- this.$emit("initialized", {
1264
- scene: t,
1265
- scenes: this.scenes,
1266
- sceneData: this.sceneData,
1267
- scenesByApartment: this.scenesByApartment,
1268
- unitsSceneSort: i,
1269
- initialize: o
1270
- });
1271
- },
1272
- methods: {
1273
- onPos(e) {
1274
- this.pos = e;
1275
- },
1276
- hoverOver({ hoverApartment: e, closeHandler: t }) {
1277
- this.hoverApartment = e, this.closeHandler = t, this.$emit("hover-over-unit", e);
1278
- },
1279
- hoverOut({ hoverApartment: e, closeHandler: t }) {
1280
- this.hoverApartment = null, this.closeHandler = t, this.$emit("hover-out-unit", e);
1281
- }
1282
- }
1283
- }, it = { key: 0 }, nt = { class: "interactive-viewer" }, st = { class: "fill-parent" }, ot = { key: 0 }, rt = {
1284
- key: 1,
1285
- class: "navigation"
1286
- }, at = { key: 2 };
1287
- function lt(e, t, i, o, n, s) {
1288
- const r = u("qi-apartment-chooser-rotator"), a = u("qi-zoom-box"), g = u("qi-floating-card"), f = u("qi-apartment-chooser-navigation"), y = u("v-progress-linear"), C = u("qi-hover-probe");
1289
- return n.viewModel ? (d(), m("div", it, [
1290
- h("div", nt, [
1291
- h("div", st, [
1292
- l(a, {
1293
- desktop: n.loadState.isReady && i.interactiveDesktop,
1294
- mobile: n.loadState.isReady && i.interactiveMobile
1295
- }, {
1296
- default: c(() => [
1297
- l(r, {
1298
- "cdn-file-resolver": i.cdnFileResolver,
1299
- "view-model": n.viewModel,
1300
- "cardinal-frames": n.scenes,
1301
- build: i.build,
1302
- onProgress: t[0] || (t[0] = (p) => n.loadState.progress = p),
1303
- onLoaded: t[1] || (t[1] = (p) => n.loadState.isReady = !0),
1304
- onError: t[2] || (t[2] = (p) => n.loadState.isError = !0)
1305
- }, null, 8, ["cdn-file-resolver", "view-model", "cardinal-frames", "build"]),
1306
- n.loadState.isReady ? (d(), m("div", ot, [
1307
- (d(), I(oe(s.overlayComponent), {
1308
- "cdn-file-resolver": i.cdnFileResolver,
1309
- "view-model": n.viewModel,
1310
- "selected-unit-id": i.selectedUnitId,
1311
- "scene-data": n.sceneData,
1312
- "color-callback": i.colorCallback,
1313
- "unit-callback": i.unitCallback,
1314
- "can-go-to-unit-callback": i.canGoToUnitCallback,
1315
- "draw-observer": i.drawObserver,
1316
- onSelectUnit: t[3] || (t[3] = (p) => e.$emit("select-unit", p)),
1317
- onGoToUnit: t[4] || (t[4] = (p) => e.$emit("go-to-unit", p)),
1318
- onHoverOver: s.hoverOver,
1319
- onHoverOut: s.hoverOut,
1320
- onPos: s.onPos
1321
- }, {
1322
- default: c((p) => [
1323
- _(e.$slots, "default", re(ae(p)), void 0, !0)
1324
- ]),
1325
- _: 3
1326
- }, 40, ["cdn-file-resolver", "view-model", "selected-unit-id", "scene-data", "color-callback", "unit-callback", "can-go-to-unit-callback", "draw-observer", "onHoverOver", "onHoverOut", "onPos"]))
1327
- ])) : k("", !0)
1328
- ]),
1329
- _: 3
1330
- }, 8, ["desktop", "mobile"]),
1331
- n.hoverApartment && i.showCards ? (d(), I(g, {
1332
- key: 0,
1333
- "is-hoverable": s.isHoverable,
1334
- pos: n.pos,
1335
- onOutside: n.closeHandler
1336
- }, {
1337
- default: c(() => [
1338
- _(e.$slots, "default", {
1339
- unit: n.hoverApartment,
1340
- canGoToUnit: i.canGoToUnitCallback(n.hoverApartment),
1341
- goToUnit: () => i.canGoToUnitCallback(n.hoverApartment) && e.$emit("go-to-unit", n.hoverApartment),
1342
- pos: n.pos,
1343
- isHoverable: s.isHoverable,
1344
- close: n.closeHandler
1345
- }, void 0, !0)
1346
- ]),
1347
- _: 3
1348
- }, 8, ["is-hoverable", "pos", "onOutside"])) : k("", !0),
1349
- n.loadState.isReady ? (d(), m("div", rt, [
1350
- l(f, {
1351
- "can-go-to-unit-callback": i.canGoToUnitCallback,
1352
- "selected-unit": s.selectedUnit,
1353
- "prev-unit": i.prevUnit,
1354
- "next-unit": i.nextUnit,
1355
- "view-model": n.viewModel,
1356
- onGoToUnit: t[5] || (t[5] = (p) => e.$emit("go-to-unit", p)),
1357
- onPrevUnit: t[6] || (t[6] = (p) => e.$emit("nav-unit", i.prevUnit)),
1358
- onNextUnit: t[7] || (t[7] = (p) => e.$emit("nav-unit", i.nextUnit))
1359
- }, null, 8, ["can-go-to-unit-callback", "selected-unit", "prev-unit", "next-unit", "view-model"])
1360
- ])) : n.loadState.isError ? k("", !0) : (d(), m("div", at, [
1361
- l(y, {
1362
- indeterminate: !n.loadState.progress,
1363
- value: n.loadState.progress
1364
- }, null, 8, ["indeterminate", "value"])
1365
- ]))
1366
- ])
1367
- ]),
1368
- l(C, { ref: "hoverProbe" }, null, 512)
1369
- ])) : k("", !0);
1370
- }
1371
- const dt = /* @__PURE__ */ w(tt, [["render", lt], ["__scopeId", "data-v-3a1121f3"]]), ct = "data:image/png;base64,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", ut = {
1372
- name: "QiNorthDirection",
1373
- props: {
1374
- longitude: { type: Number, default: () => 0 }
1375
- },
1376
- data() {
1377
- return {
1378
- compassNeedle: ct
1379
- };
1380
- },
1381
- computed: {
1382
- needleRotation() {
1383
- return {
1384
- transform: `rotate(${90 - this.longitude}deg)`,
1385
- transition: " transform 0.5s ease-in"
1386
- };
1387
- }
1388
- }
1389
- };
1390
- function ht(e, t, i, o, n, s) {
1391
- const r = u("v-img");
1392
- return d(), I(r, {
1393
- src: n.compassNeedle,
1394
- style: D(s.needleRotation)
1395
- }, null, 8, ["src", "style"]);
1396
- }
1397
- const te = /* @__PURE__ */ w(ut, [["render", ht]]);
1398
- function V(e) {
1399
- return e.toLocaleString("en-no", {
1400
- month: "short",
1401
- day: "numeric"
1402
- });
1403
- }
1404
- const mt = Y({
1405
- setup() {
1406
- },
1407
- name: "QiBuildingChooserSunSimControl",
1408
- props: {
1409
- modelValue: { type: Number, required: !0 },
1410
- dateSelector: { type: Object, required: !0 },
1411
- isLoading: { type: Boolean, default: !1 }
1412
- },
1413
- emits: ["update:modelValue"],
1414
- data() {
1415
- return {
1416
- currentValue: this.modelValue,
1417
- currentDate: null
1418
- };
1419
- },
1420
- computed: {
1421
- currentValueString() {
1422
- const e = Math.floor(this.currentValue / 2).toString().padStart(2, "0"), t = this.currentValue % 2 === 0 ? "00" : "30";
1423
- return `${e}:${t}`;
1424
- },
1425
- dates() {
1426
- return this.dateSelector.dates.map(V);
1427
- },
1428
- selectedDate: {
1429
- get() {
1430
- return V(this.dateSelector.selectedDate);
1431
- },
1432
- set(e) {
1433
- this.dateSelector.selectIndex(this.dates.indexOf(e));
1434
- }
1435
- }
1436
- },
1437
- watch: {
1438
- currentValue(e) {
1439
- this.$emit("update:modelValue", e);
1440
- },
1441
- modelValue(e) {
1442
- this.currentValue = Math.floor(e);
1443
- },
1444
- dates: {
1445
- handler(e) {
1446
- this.currentDate = V(this.dateSelector.selectedDate);
1447
- },
1448
- immediate: !0
1449
- },
1450
- currentDate(e) {
1451
- this.dateSelector.selectIndex(this.dates.indexOf(e));
1452
- }
1453
- },
1454
- methods: {}
1455
- }), gt = { class: "sunsim-bar-wrapper" }, vt = { class: "sunsim-date d-flex align-center pl-5 pr-5" }, pt = {
1456
- key: 1,
1457
- class: "text-center text-body-1"
1458
- }, ft = { class: "sunsim-wrapper d-flex align-center px-3" }, bt = { class: "sunsim-time-label text-body-1 font-weight-normal ml-2" };
1459
- function yt(e, t, i, o, n, s) {
1460
- const r = u("v-icon"), a = u("v-select"), g = u("v-progress-linear"), f = u("v-slider");
1461
- return d(), m("div", gt, [
1462
- h("div", vt, [
1463
- l(r, {
1464
- color: "black",
1465
- class: "mr-2",
1466
- icon: "mdi-calendar-blank-outline"
1467
- }),
1468
- e.dateSelector.hasMultipleDates ? (d(), I(a, {
1469
- key: 0,
1470
- modelValue: e.currentDate,
1471
- "onUpdate:modelValue": t[0] || (t[0] = (y) => e.currentDate = y),
1472
- items: e.dates,
1473
- density: "compact",
1474
- variant: "underlined",
1475
- "hide-details": "",
1476
- class: "day-selector"
1477
- }, null, 8, ["modelValue", "items"])) : (d(), m("span", pt, S(e.selectedDate), 1))
1478
- ]),
1479
- h("div", ft, [
1480
- h("span", bt, S(e.currentValueString), 1),
1481
- l(r, {
1482
- medium: "",
1483
- class: "ml-2 mr-2 icon"
1484
- }, {
1485
- default: c(() => [
1486
- B("mdi-white-balance-sunny")
1487
- ]),
1488
- _: 1
1489
- }),
1490
- e.isLoading ? (d(), I(g, {
1491
- key: 0,
1492
- indeterminate: "",
1493
- rounded: "",
1494
- height: "6",
1495
- color: "grey lighten-1",
1496
- class: "mr-2"
1497
- })) : (d(), I(f, {
1498
- key: 1,
1499
- modelValue: e.currentValue,
1500
- "onUpdate:modelValue": t[1] || (t[1] = (y) => e.currentValue = y),
1501
- min: 0,
1502
- max: 47,
1503
- step: 1,
1504
- "thumb-label": !1,
1505
- "hide-details": !0,
1506
- "thumb-color": "white",
1507
- "thumb-size": "25",
1508
- "track-size": "7",
1509
- "track-fill-color": "transparent",
1510
- class: "sunsim-slider mr-1"
1511
- }, null, 8, ["modelValue"]))
1512
- ])
1513
- ]);
1514
- }
1515
- const ie = /* @__PURE__ */ w(mt, [["render", yt], ["__scopeId", "data-v-1fba3edd"]]), wt = Y({
1516
- setup() {
1517
- },
1518
- name: "QiBuildingChooserSceneImageStack",
1519
- props: {
1520
- imageUrls: { type: Array, required: !0 },
1521
- activeIndex: { type: Number, required: !0 }
1522
- },
1523
- emits: ["resize", "ready", "preloaded", "reset"],
1524
- data() {
1525
- return {
1526
- state: "init",
1527
- activeStates: ["preloaded", "loaded"],
1528
- loadTracker: new W(0)
1529
- };
1530
- },
1531
- watch: {
1532
- imageUrls(e) {
1533
- this.$emit("reset"), this.loadImages(e);
1534
- }
1535
- },
1536
- mounted() {
1537
- this.loadImages(this.imageUrls), new ResizeObserver((e) => {
1538
- window.requestAnimationFrame(() => {
1539
- const t = e[0].contentRect.width, i = e[0].contentRect.height;
1540
- this.$emit("resize", { width: t, height: i });
1541
- });
1542
- }).observe(this.$refs.baseImage);
1543
- },
1544
- methods: {
1545
- onPreloaded() {
1546
- this.state = "preloaded", this.$emit("preloaded");
1547
- },
1548
- loadImages(e) {
1549
- this.state = "init", this.$refs.baseImage.src = e[0], this.loadTracker = new W(e.length).onLoadFinished(
1550
- () => {
1551
- this.state = "loaded", this.$emit("ready");
1552
- }
1553
- );
1554
- }
1555
- }
1556
- }), _t = { key: 0 }, kt = ["src"];
1557
- function It(e, t, i, o, n, s) {
1558
- return d(), m("div", null, [
1559
- h("img", {
1560
- ref: "baseImage",
1561
- class: "image-instance zero",
1562
- style: { opacity: 1, borderRadius: 50 },
1563
- onLoad: t[0] || (t[0] = (...r) => e.onPreloaded && e.onPreloaded(...r))
1564
- }, null, 544),
1565
- e.state === "preloaded" || e.state === "loaded" ? A((d(), m("div", _t, [
1566
- (d(!0), m(L, null, T(e.imageUrls, (r, a) => (d(), m("img", {
1567
- key: a,
1568
- class: M({ "image-instance": !0, active: a === e.activeIndex }),
1569
- src: r,
1570
- onLoad: t[1] || (t[1] = (g) => e.loadTracker.partLoaded())
1571
- }, null, 42, kt))), 128)),
1572
- B(" Here ")
1573
- ], 512)), [
1574
- [x, e.state === "loaded"]
1575
- ]) : k("", !0)
1576
- ]);
1577
- }
1578
- const ne = /* @__PURE__ */ w(wt, [["render", It], ["__scopeId", "data-v-fad48118"]]), Ct = "buildingChooser.json", St = 180;
1579
- class me {
1580
- constructor(t) {
1581
- this._cdnFileResolver = t, this._resourceLoader = new U();
1582
- }
1583
- constructFileUrl(t) {
1584
- return this._cdnFileResolver ? this._cdnFileResolver(`/${t}`) : null;
1585
- }
1586
- loadConfigFile() {
1587
- const t = this.constructFileUrl(Ct);
1588
- return t ? this._resourceLoader.loadJson(t) : null;
1589
- }
1590
- loadBuildingMapImage(t) {
1591
- const i = this.constructFileUrl(t.lookupFilename);
1592
- return i ? this._resourceLoader.loadImage(i) : null;
1593
- }
1594
- getViewLongitude(t) {
1595
- return t.cameraRotation && t.cameraRotation.y + 270;
1596
- }
1597
- getBuildingData(t) {
1598
- const i = t ? t.buildings : [], o = i.map((s) => s.id), n = i.map((s) => ({
1599
- id: s.id,
1600
- url: this.constructFileUrl(s.overlayFilename)
1601
- }));
1602
- return { buildingIds: o, buildingOverlays: n };
1603
- }
1604
- getBackgroundImageData(t) {
1605
- return "days" in t ? this.processMultipleDays(t.days) : [this.processTimeSamples(
1606
- St,
1607
- t.timeSamples
1608
- )];
1609
- }
1610
- processMultipleDays(t) {
1611
- return t.map(
1612
- (i) => this.processTimeSamples(i.dayOfYear, i.timeSamples)
1613
- );
1614
- }
1615
- processTimeSamples(t, i) {
1616
- return {
1617
- urls: i.map(
1618
- (n) => this.constructFileUrl(n.filename)
1619
- ),
1620
- referenceDate: this.makeReferenceDate(t)
1621
- };
1622
- }
1623
- makeReferenceDate(t) {
1624
- const i = /* @__PURE__ */ new Date(0);
1625
- return i.setUTCDate(t), i;
1626
- }
1627
- async loadBuildingChooser() {
1628
- try {
1629
- const t = await this.loadConfigFile();
1630
- if (t) {
1631
- const i = await this.loadBuildingMapImage(t);
1632
- if (i) {
1633
- const o = this.getViewLongitude(t), { buildingIds: n, buildingOverlays: s } = this.getBuildingData(t), r = this.getBackgroundImageData(t);
1634
- return {
1635
- mapImage: i,
1636
- viewLongitude: o,
1637
- buildingIds: n,
1638
- buildingOverlays: s,
1639
- backgrounds: r
1640
- };
1641
- }
1642
- }
1643
- return null;
1644
- } catch {
1645
- return null;
1646
- }
1647
- }
1648
- }
1649
- class E {
1650
- static empty() {
1651
- return new E([]);
1652
- }
1653
- constructor(t) {
1654
- this._buildingIds = t;
1655
- }
1656
- getBuildingId(t, i, o) {
1657
- const n = this._getBuildingIndex(t, i, o);
1658
- if (n !== void 0)
1659
- return this._buildingIds[n];
1660
- }
1661
- _getBuildingIndex(t, i, o) {
1662
- const [n, s, r, a] = t.getPixel(i, o);
1663
- if (a === 255 && n === s && s === r)
1664
- return n;
1665
- }
1666
- }
1667
- class q {
1668
- static empty() {
1669
- return new q(null);
1670
- }
1671
- constructor(t) {
1672
- this._mapImage = t, this._context = null;
1673
- }
1674
- update(t) {
1675
- this._mapImage && (this._context = t.getContext("2d", { willReadFrequently: !0 }), this._context.drawImage(this._mapImage, 0, 0, t.width, t.height));
1676
- }
1677
- getPixel(t, i) {
1678
- try {
1679
- return this._context ? this._context.getImageData(t, i, 1, 1).data : [0, 0, 0, 0];
1680
- } catch {
1681
- return [0, 0, 0, 0];
1682
- }
1683
- }
1684
- }
1685
- const Bt = /* @__PURE__ */ new Date(0);
1686
- class Q {
1687
- static empty() {
1688
- return new Q([{ referenceDate: Bt, urls: [] }]);
1689
- }
1690
- constructor(t) {
1691
- this._imagesByDay = t, this._state = { selectedIndex: 0 };
1692
- }
1693
- selectIndex(t) {
1694
- t < this._imagesByDay.length && (this._state.selectedIndex = t);
1695
- }
1696
- get dates() {
1697
- return this._imagesByDay.map((t) => t.referenceDate);
1698
- }
1699
- get hasMultipleDates() {
1700
- return this._imagesByDay.length > 1;
1701
- }
1702
- get selectedIndex() {
1703
- return this._state.selectedIndex;
1704
- }
1705
- get selectedDate() {
1706
- return this._imagesByDay[this.selectedIndex].referenceDate;
1707
- }
1708
- get imageUrls() {
1709
- return this._imagesByDay[this.selectedIndex].urls;
1710
- }
1711
- }
1712
- const Dt = Y({
1713
- setup() {
1714
- le({});
1715
- },
1716
- name: "QiBuildingChooserSvg",
1717
- components: {
1718
- QiBuildingChooserSunSimControl: ie,
1719
- QiBuildingChooserSceneImageStack: ne,
1720
- QiNorthDirection: te,
1721
- QiFloatingCard: z,
1722
- QiHoverProbe: $,
1723
- QiZoomBox: P
1724
- },
1725
- emits: ["go-to-building", "hover-over-building", "hover-out-building"],
1726
- provide() {
1727
- return {
1728
- i18n: this.i18n ? new F(this.i18n.labels, this.i18n.language) : new F()
1729
- };
1730
- },
1731
- props: {
1732
- showCards: { type: Boolean, default: () => !0 },
1733
- colorCallback: {
1734
- type: Function,
1735
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
1736
- },
1737
- buildingCallback: { type: Function, default: (e) => e },
1738
- canGoToBuildingCallback: { type: Function, default: () => !0 },
1739
- buildingChooserTimeOfDay: { type: String, default: null },
1740
- cdnFileResolver: { type: Function, required: !0 },
1741
- i18n: { type: Object, default: void 0 },
1742
- interactiveDesktop: { type: Boolean, default: !0 },
1743
- interactiveMobile: { type: Boolean, default: !0 },
1744
- customOverlayContent: { type: String, default: "" }
1745
- },
1746
- data() {
1747
- return {
1748
- sceneState: { preloaded: !1, ready: !1 },
1749
- canvasDimensions: { width: 0, height: 0 },
1750
- pos: { x: 0, y: 0, width: 0, height: 0 },
1751
- pickerData: void 0,
1752
- hoverBuildingId: void 0,
1753
- halfHourMark: (/* @__PURE__ */ new Date()).getHours() * 2 + ((/* @__PURE__ */ new Date()).getMinutes() < 30 ? 0 : 1),
1754
- error: !1,
1755
- resourceLoader: new U(),
1756
- svgObjects: void 0,
1757
- svgViewBox: "0 0 0 0"
1758
- };
1759
- },
1760
- computed: {
1761
- isHoverable() {
1762
- return this.$refs.hoverProbe.isHoverEnabled;
1763
- },
1764
- hoverBuilding() {
1765
- return this.getBuildingData(this.hoverBuildingId);
1766
- }
1767
- },
1768
- watch: {
1769
- buildingChooserTimeOfDay: {
1770
- handler() {
1771
- if (this.buildingChooserTimeOfDay) {
1772
- const [e, t, i] = /^(\d\d):(\d\d)$/.exec(
1773
- this.buildingChooserTimeOfDay
1774
- ), o = parseInt(i);
1775
- this.halfHourMark = parseInt(t) * 2 + (o < 15 ? 0 : o > 45 ? 2 : 1);
1776
- }
1777
- },
1778
- immediate: !0
1779
- },
1780
- hoverBuildingId(e, t) {
1781
- e ? this.$emit("hover-over-building", this.getBuildingData(e)) : this.$emit("hover-out-building", this.getBuildingData(t));
1782
- }
1783
- },
1784
- async mounted() {
1785
- const t = await new me(
1786
- this.cdnFileResolver
1787
- ).loadBuildingChooser();
1788
- if (t) {
1789
- this.canvasRaster = new q(t.mapImage), this.buildingMap = new E(t.buildingIds), this.daysOfYear = new Q(t.backgrounds), this.pickerData = {
1790
- buildingOverlays: t.buildingOverlays,
1791
- sceneLongitude: t.viewLongitude
1792
- };
1793
- const i = [];
1794
- for (let { id: o, url: n } of t.buildingOverlays)
1795
- this.resourceLoader.loadJson(n.replace(".png", ".svg")).then((s) => {
1796
- const a = new DOMParser().parseFromString(s, "image/svg+xml").getElementsByTagName("svg")[0];
1797
- this.svgViewBox = a.getAttribute("viewBox"), i.push({
1798
- id: o,
1799
- svg: a.innerHTML
1800
- });
1801
- });
1802
- this.svgObjects = i;
1803
- } else
1804
- this.error = !0;
1805
- },
1806
- methods: {
1807
- resizeScene({ width: e, height: t }) {
1808
- this.canvasDimensions.width = e, this.canvasDimensions.height = t;
1809
- },
1810
- sceneReset() {
1811
- this.sceneState = { preloaded: !1, ready: !1 };
1812
- },
1813
- getBuildingData(e) {
1814
- return this.buildingCallback ? this.buildingCallback(e) : e;
1815
- },
1816
- getColor(e) {
1817
- return this.colorCallback(
1818
- this.getBuildingData(e),
1819
- e === this.hoverBuildingId ? "hover" : "idle"
1820
- );
1821
- },
1822
- getGClass(e) {
1823
- const t = this.getBuildingData(e), i = this.colorCallback(
1824
- t,
1825
- e === this.hoverBuildingId ? "hover" : "idle"
1826
- ), o = [];
1827
- return e === this.hoverBuildingId ? o.push("hover") : o.push("idle"), i && this.canGoToBuildingCallback(t) ? o.push("clickable") : o.push("restricted"), o.join(" ");
1828
- },
1829
- getGStyle(e) {
1830
- const t = this.getBuildingData(e), i = this.colorCallback(
1831
- t,
1832
- e === this.hoverBuildingId ? "hover" : "idle"
1833
- );
1834
- if (i) {
1835
- const { r: o, g: n, b: s, a: r, s: a } = i;
1836
- return {
1837
- strokeWidth: a !== void 0 ? a : 2,
1838
- stroke: `rgb(${o}, ${n}, ${s})`,
1839
- strokeOpacity: 1,
1840
- fill: `rgb(${o}, ${n}, ${s})`,
1841
- fillOpacity: r / 255,
1842
- cursor: `${this.canGoToBuildingCallback(t) ? "cursor" : "default"} !important`
1843
- };
1844
- } else
1845
- return {
1846
- strokeWidth: 0,
1847
- stroke: "white",
1848
- strokeOpacity: 0,
1849
- fill: "white",
1850
- fillOpacity: 0,
1851
- cursor: "default !important"
1852
- };
1853
- },
1854
- onBuildingMouseOver(e, t) {
1855
- this.isHoverable && (this.pos = {
1856
- x: e.layerX,
1857
- y: e.layerY,
1858
- width: this.canvasDimensions.width,
1859
- height: this.canvasDimensions.height
1860
- }, this.hoverBuildingId = t, this.$emit("hover-over-building", this.getBuildingData(t)));
1861
- },
1862
- onBuildingMouseOut(e, t) {
1863
- this.isHoverable && (this.pos = {
1864
- x: e.layerX,
1865
- y: e.layerY,
1866
- width: this.canvasDimensions.width,
1867
- height: this.canvasDimensions.height
1868
- }, this.hoverBuildingId = void 0, this.$emit("hover-out-building", this.getBuildingData(t)));
1869
- },
1870
- onBuildingMouseMove(e) {
1871
- this.isHoverable && (this.pos = {
1872
- x: e.layerX,
1873
- y: e.layerY,
1874
- width: this.canvasDimensions.width,
1875
- height: this.canvasDimensions.height
1876
- });
1877
- },
1878
- onBuildingClick(e) {
1879
- this.hoverBuildingId = e, this.isHoverable && this.hoverBuilding && this.canGoToBuildingCallback(this.hoverBuilding) && this.$emit("go-to-building", this.hoverBuilding);
1880
- }
1881
- }
1882
- }), At = {
1883
- key: 0,
1884
- style: { height: "50vh" },
1885
- class: "d-flex justify-center align-center blue-grey lighten-5"
1886
- }, xt = { class: "image-instances" }, Mt = { key: 0 }, Rt = { class: "svg-container" }, Ft = ["viewBox"], Ht = ["innerHTML", "data-building-id", "onMouseover", "onMouseout", "onMousemove", "onClick"], Tt = ["innerHTML"];
1887
- function Lt(e, t, i, o, n, s) {
1888
- const r = u("v-icon"), a = u("qi-building-chooser-scene-image-stack"), g = u("qi-zoom-box"), f = u("qi-north-direction"), y = u("qi-building-chooser-sun-sim-control"), C = u("qi-floating-card"), p = u("qi-hover-probe");
1889
- return e.error ? (d(), m("div", At, [
1890
- l(r, { "x-large": "" }, {
1891
- default: c(() => [
1892
- B("mdi-alert-circle-outline")
1893
- ]),
1894
- _: 1
1895
- })
1896
- ])) : e.pickerData ? (d(), m("div", {
1897
- key: 1,
1898
- style: D(`height: ${e.canvasDimensions.height}px; position: relative`),
1899
- class: "image-container"
1900
- }, [
1901
- l(g, {
1902
- desktop: e.interactiveDesktop,
1903
- mobile: e.interactiveMobile
1904
- }, {
1905
- default: c(() => [
1906
- h("div", xt, [
1907
- l(a, {
1908
- "image-urls": e.daysOfYear.imageUrls,
1909
- "active-index": e.halfHourMark,
1910
- onResize: e.resizeScene,
1911
- onPreloaded: t[0] || (t[0] = (b) => e.sceneState.preloaded = !0),
1912
- onReady: t[1] || (t[1] = (b) => e.sceneState.ready = !0),
1913
- onReset: e.sceneReset
1914
- }, null, 8, ["image-urls", "active-index", "onResize", "onReset"]),
1915
- e.svgObjects ? A((d(), m("div", Mt, [
1916
- h("div", Rt, [
1917
- (d(), m("svg", { viewBox: e.svgViewBox }, [
1918
- (d(!0), m(L, null, T(e.svgObjects, ({ id: b, svg: v }, j) => (d(), m("g", {
1919
- key: j,
1920
- innerHTML: v,
1921
- "data-building-id": b,
1922
- class: M(e.getGClass(b)),
1923
- style: D(e.getGStyle(b)),
1924
- onMouseover: (H) => e.onBuildingMouseOver(H, b),
1925
- onMouseout: (H) => e.onBuildingMouseOut(H, b),
1926
- onMousemove: (H) => e.onBuildingMouseMove(H, b),
1927
- onClick: (H) => e.onBuildingClick(b)
1928
- }, null, 46, Ht))), 128))
1929
- ], 8, Ft))
1930
- ])
1931
- ], 512)), [
1932
- [x, e.sceneState.preloaded]
1933
- ]) : k("", !0),
1934
- A(h("div", {
1935
- class: "custom-overlay-layer",
1936
- innerHTML: e.customOverlayContent
1937
- }, null, 8, Tt), [
1938
- [x, e.sceneState.preloaded]
1939
- ])
1940
- ])
1941
- ]),
1942
- _: 1
1943
- }, 8, ["desktop", "mobile"]),
1944
- A(h("div", null, [
1945
- e.pickerData.sceneLongitude ? (d(), I(f, {
1946
- key: 0,
1947
- class: "north-indicator",
1948
- longitude: e.pickerData.sceneLongitude
1949
- }, null, 8, ["longitude"])) : k("", !0),
1950
- l(y, {
1951
- modelValue: e.halfHourMark,
1952
- "onUpdate:modelValue": t[2] || (t[2] = (b) => e.halfHourMark = b),
1953
- "date-selector": e.daysOfYear,
1954
- "is-loading": !e.sceneState.ready
1955
- }, null, 8, ["modelValue", "date-selector", "is-loading"])
1956
- ], 512), [
1957
- [x, e.sceneState.preloaded]
1958
- ]),
1959
- e.showCards && e.hoverBuilding ? (d(), I(C, {
1960
- key: 0,
1961
- "is-hoverable": e.isHoverable,
1962
- pos: e.pos,
1963
- onOutside: t[3] || (t[3] = () => e.hoverBuildingId = void 0)
1964
- }, {
1965
- default: c(() => [
1966
- _(e.$slots, "default", {
1967
- building: e.hoverBuilding,
1968
- canGoToBuilding: e.canGoToBuildingCallback(e.hoverBuilding),
1969
- goToBuilding: () => e.canGoToBuildingCallback(e.hoverBuilding) && e.$emit("go-to-building", e.hoverBuilding),
1970
- pos: e.pos,
1971
- isHoverable: e.isHoverable,
1972
- close: () => e.hoverBuildingId = void 0
1973
- }, void 0, !0)
1974
- ]),
1975
- _: 3
1976
- }, 8, ["is-hoverable", "pos"])) : k("", !0),
1977
- l(p, { ref: "hoverProbe" }, null, 512)
1978
- ], 4)) : k("", !0);
1979
- }
1980
- const K = /* @__PURE__ */ w(Dt, [["render", Lt], ["__scopeId", "data-v-0a2cec1f"]]), Ut = {
1981
- name: "QiBuildingChooserRasterOverlay",
1982
- props: {
1983
- imageUrl: { type: String, required: !0 },
1984
- dimensions: { type: Object, required: !0 },
1985
- color: {
1986
- type: Object,
1987
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
1988
- }
1989
- },
1990
- data() {
1991
- return {
1992
- isLoaded: !1,
1993
- overlayImage: void 0,
1994
- resourceLoader: new U(),
1995
- context: void 0,
1996
- imageData: void 0,
1997
- imageDataIndices: []
1998
- };
1999
- },
2000
- watch: {
2001
- color(e, t) {
2002
- (e.r !== t.r || e.g !== t.g || e.b !== t.b || e.a !== t.a) && this.draw();
2003
- }
2004
- },
2005
- async mounted() {
2006
- this.overlayImage = await this.resourceLoader.loadImage(this.imageUrl), this.setupDraw();
2007
- },
2008
- methods: {
2009
- setupDraw() {
2010
- if (!this.overlayImage || !this.$refs.canvas)
2011
- return;
2012
- const { width: e, height: t } = this.dimensions;
2013
- if (!(e === 0 || t === 0)) {
2014
- this.context = this.$refs.canvas.getContext("2d", {
2015
- willReadFrequently: !0
2016
- }), this.context.drawImage(this.overlayImage, 0, 0, e, t), this.imageData = this.context.getImageData(0, 0, e, t);
2017
- for (let i = 3; i < this.imageData.data.length; i += 4)
2018
- this.imageData.data[i] !== 0 && this.imageDataIndices.push(i);
2019
- this.draw(), this.isLoaded = !0;
2020
- }
2021
- },
2022
- draw() {
2023
- this.context && this.imageData && (this.applyColor(), this.context.putImageData(this.imageData, 0, 0));
2024
- },
2025
- applyColor() {
2026
- if (this.color)
2027
- for (let e = 0; e < this.imageDataIndices.length; e++)
2028
- this.imageData.data[this.imageDataIndices[e] - 3] = this.color.r, this.imageData.data[this.imageDataIndices[e] - 2] = this.color.g, this.imageData.data[this.imageDataIndices[e] - 1] = this.color.b, this.imageData.data[this.imageDataIndices[e]] = this.color.a;
2029
- }
2030
- }
2031
- };
2032
- function $t(e, t, i, o, n, s) {
2033
- return d(), m("canvas", R({
2034
- ref: "canvas",
2035
- class: "overlay"
2036
- }, i.dimensions), null, 16);
2037
- }
2038
- const ge = /* @__PURE__ */ w(Ut, [["render", $t], ["__scopeId", "data-v-9a90fa2f"]]), Ot = Y({
2039
- setup() {
2040
- le({});
2041
- },
2042
- name: "QiBuildingChooserRaster",
2043
- components: {
2044
- QiBuildingChooserRasterOverlay: ge,
2045
- QiBuildingChooserSunSimControl: ie,
2046
- QiBuildingChooserSceneImageStack: ne,
2047
- QiNorthDirection: te,
2048
- QiFloatingCard: z,
2049
- QiHoverProbe: $,
2050
- QiZoomBox: P
2051
- },
2052
- emits: ["go-to-building", "hover-over-building", "hover-out-building"],
2053
- provide() {
2054
- return {
2055
- i18n: this.i18n ? new F(this.i18n.labels, this.i18n.language) : new F()
2056
- };
2057
- },
2058
- props: {
2059
- showCards: { type: Boolean, default: () => !0 },
2060
- colorCallback: {
2061
- type: Function,
2062
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
2063
- },
2064
- buildingCallback: { type: Function, default: (e) => e },
2065
- canGoToBuildingCallback: { type: Function, default: () => !0 },
2066
- buildingChooserTimeOfDay: { type: String, default: null },
2067
- cdnFileResolver: { type: Function, required: !0 },
2068
- i18n: { type: Object, default: void 0 },
2069
- interactiveDesktop: { type: Boolean, default: !0 },
2070
- interactiveMobile: { type: Boolean, default: !0 },
2071
- customOverlayContent: { type: String, default: "" }
2072
- },
2073
- data() {
2074
- return {
2075
- sceneState: { preloaded: !1, ready: !1 },
2076
- canvasDimensions: { width: 0, height: 0 },
2077
- pos: { x: 0, y: 0, width: 0, height: 0 },
2078
- pickerData: void 0,
2079
- buildingMap: E.empty(),
2080
- canvasRaster: q.empty(),
2081
- selectedBuildingId: void 0,
2082
- halfHourMark: (/* @__PURE__ */ new Date()).getHours() * 2 + ((/* @__PURE__ */ new Date()).getMinutes() < 30 ? 0 : 1),
2083
- viewResolver: (e, t) => ({ x: e, y: t }),
2084
- error: !1
2085
- };
2086
- },
2087
- computed: {
2088
- isHoverable() {
2089
- return this.$refs.hoverProbe.isHoverEnabled;
2090
- },
2091
- selectedBuilding() {
2092
- return this.getBuildingData(this.selectedBuildingId);
2093
- }
2094
- },
2095
- watch: {
2096
- buildingChooserTimeOfDay: {
2097
- handler() {
2098
- if (this.buildingChooserTimeOfDay) {
2099
- const [e, t, i] = /^(\d\d):(\d\d)$/.exec(
2100
- this.buildingChooserTimeOfDay
2101
- ), o = parseInt(i);
2102
- this.halfHourMark = parseInt(t) * 2 + (o < 15 ? 0 : o > 45 ? 2 : 1);
2103
- }
2104
- },
2105
- immediate: !0
2106
- },
2107
- selectedBuildingId(e, t) {
2108
- e ? this.$emit("hover-over-building", this.getBuildingData(e)) : this.$emit("hover-out-building", this.getBuildingData(t));
2109
- }
2110
- },
2111
- async mounted() {
2112
- const t = await new me(
2113
- this.cdnFileResolver
2114
- ).loadBuildingChooser();
2115
- t ? (this.canvasRaster = new q(t.mapImage), this.buildingMap = new E(t.buildingIds), this.daysOfYear = new Q(t.backgrounds), this.pickerData = {
2116
- buildingOverlays: t.buildingOverlays,
2117
- sceneLongitude: t.viewLongitude
2118
- }, this.resizeImages()) : this.error = !0;
2119
- },
2120
- methods: {
2121
- resizeScene({ width: e, height: t }) {
2122
- this.canvasDimensions.width = e, this.canvasDimensions.height = t, this.$nextTick(this.resizeImages);
2123
- },
2124
- sceneReset() {
2125
- this.sceneState = { preloaded: !1, ready: !1 };
2126
- },
2127
- getBuildingData(e) {
2128
- return this.buildingCallback ? this.buildingCallback(e) : e;
2129
- },
2130
- getBuildingId(e) {
2131
- const { x: t, y: i } = this.viewResolver(e.layerX, e.layerY);
2132
- return this.buildingMap.getBuildingId(this.canvasRaster, t, i);
2133
- },
2134
- resizeImages() {
2135
- if (this.$refs.canvas && (this.canvasRaster.update(this.$refs.canvas), this.$refs.overlays))
2136
- for (const e of this.$refs.overlays)
2137
- e.setupDraw();
2138
- },
2139
- onMove(e) {
2140
- this.isHoverable && (this.selectedBuildingId = this.getBuildingId(e), this.selectedBuildingId !== void 0 && (this.pos = {
2141
- x: e.layerX,
2142
- y: e.layerY,
2143
- width: this.canvasDimensions.width,
2144
- height: this.canvasDimensions.height
2145
- }));
2146
- },
2147
- onClick(e) {
2148
- this.selectedBuildingId = this.getBuildingId(e), this.isHoverable && this.selectedBuilding && this.$emit("go-to-building", this.selectedBuilding);
2149
- },
2150
- getColor(e) {
2151
- return this.colorCallback(
2152
- this.getBuildingData(e),
2153
- e === this.selectedBuildingId ? "hover" : "idle"
2154
- );
2155
- },
2156
- updateView({ resolve: e }) {
2157
- this.viewResolver = e;
2158
- }
2159
- }
2160
- }), Et = {
2161
- key: 0,
2162
- style: { height: "50vh" },
2163
- class: "d-flex justify-center align-center blue-grey lighten-5"
2164
- }, qt = { class: "image-instances" }, jt = ["innerHTML"];
2165
- function Yt(e, t, i, o, n, s) {
2166
- const r = u("v-icon"), a = u("qi-building-chooser-scene-image-stack"), g = u("qi-building-chooser-raster-overlay"), f = u("qi-zoom-box"), y = u("qi-north-direction"), C = u("qi-building-chooser-sun-sim-control"), p = u("qi-floating-card"), b = u("qi-hover-probe");
2167
- return e.error ? (d(), m("div", Et, [
2168
- l(r, { "x-large": "" }, {
2169
- default: c(() => [
2170
- B("mdi-alert-circle-outline")
2171
- ]),
2172
- _: 1
2173
- })
2174
- ])) : e.pickerData ? (d(), m("div", {
2175
- key: 1,
2176
- style: D(`cursor: ${e.selectedBuildingId ? "pointer" : "auto"};height: ${e.canvasDimensions.height}px; position: relative`),
2177
- class: "image-container"
2178
- }, [
2179
- l(f, {
2180
- desktop: e.interactiveDesktop,
2181
- mobile: e.interactiveMobile,
2182
- onUpdate: e.updateView
2183
- }, {
2184
- default: c(() => [
2185
- h("div", qt, [
2186
- l(a, {
2187
- "image-urls": e.daysOfYear.imageUrls,
2188
- "active-index": e.halfHourMark,
2189
- onResize: e.resizeScene,
2190
- onPreloaded: t[0] || (t[0] = (v) => e.sceneState.preloaded = !0),
2191
- onReady: t[1] || (t[1] = (v) => e.sceneState.ready = !0),
2192
- onReset: e.sceneReset
2193
- }, null, 8, ["image-urls", "active-index", "onResize", "onReset"]),
2194
- A(h("div", null, [
2195
- (d(!0), m(L, null, T(e.pickerData.buildingOverlays, (v) => (d(), I(g, {
2196
- ref_for: !0,
2197
- ref: "overlays",
2198
- key: v.id,
2199
- "image-url": v.url,
2200
- dimensions: e.canvasDimensions,
2201
- color: e.getColor(v.id)
2202
- }, null, 8, ["image-url", "dimensions", "color"]))), 128))
2203
- ], 512), [
2204
- [x, e.sceneState.preloaded]
2205
- ])
2206
- ]),
2207
- h("canvas", R(e.canvasDimensions, {
2208
- ref: "canvas",
2209
- class: { hover: !!e.selectedBuildingId },
2210
- onClick: t[2] || (t[2] = (...v) => e.onClick && e.onClick(...v)),
2211
- onMousemove: t[3] || (t[3] = (...v) => e.onMove && e.onMove(...v))
2212
- }), null, 16),
2213
- A(h("div", {
2214
- class: "custom-overlay-layer",
2215
- innerHTML: e.customOverlayContent
2216
- }, null, 8, jt), [
2217
- [x, e.sceneState.preloaded]
2218
- ])
2219
- ]),
2220
- _: 1
2221
- }, 8, ["desktop", "mobile", "onUpdate"]),
2222
- A(h("div", null, [
2223
- e.pickerData.sceneLongitude ? (d(), I(y, {
2224
- key: 0,
2225
- class: "north-indicator",
2226
- longitude: e.pickerData.sceneLongitude
2227
- }, null, 8, ["longitude"])) : k("", !0),
2228
- l(C, {
2229
- modelValue: e.halfHourMark,
2230
- "onUpdate:modelValue": t[4] || (t[4] = (v) => e.halfHourMark = v),
2231
- "date-selector": e.daysOfYear,
2232
- "is-loading": !e.sceneState.ready
2233
- }, null, 8, ["modelValue", "date-selector", "is-loading"])
2234
- ], 512), [
2235
- [x, e.sceneState.preloaded]
2236
- ]),
2237
- e.showCards && e.selectedBuilding ? (d(), I(p, {
2238
- key: 0,
2239
- "is-hoverable": e.isHoverable,
2240
- pos: e.pos,
2241
- onOutside: t[5] || (t[5] = () => e.selectedBuildingId = void 0)
2242
- }, {
2243
- default: c(() => [
2244
- _(e.$slots, "default", {
2245
- building: e.selectedBuilding,
2246
- canGoToBuilding: e.canGoToBuildingCallback(e.selectedBuilding),
2247
- goToBuilding: () => e.canGoToBuildingCallback(e.selectedBuilding) && e.$emit("go-to-building", e.selectedBuilding),
2248
- pos: e.pos,
2249
- isHoverable: e.isHoverable,
2250
- close: () => e.selectedBuildingId = void 0
2251
- }, void 0, !0)
2252
- ]),
2253
- _: 3
2254
- }, 8, ["is-hoverable", "pos"])) : k("", !0),
2255
- l(b, { ref: "hoverProbe" }, null, 512)
2256
- ], 4)) : k("", !0);
2257
- }
2258
- const Z = /* @__PURE__ */ w(Ot, [["render", Yt], ["__scopeId", "data-v-08f2ea1e"]]), zt = {
2259
- name: "QiBuildingChooser",
2260
- components: {
2261
- QiBuildingChooserSvg: K,
2262
- QiBuildingChooserRaster: Z
2263
- },
2264
- emits: ["go-to-building", "hover-over-building", "hover-out-building"],
2265
- props: {
2266
- showCards: { type: Boolean, default: () => !0 },
2267
- colorCallback: {
2268
- type: Function,
2269
- default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 })
2270
- },
2271
- buildingCallback: { type: Function, default: (e) => e },
2272
- cdnFileResolver: { type: Function, required: !0 },
2273
- i18n: { type: Object, default: void 0 },
2274
- interactiveDesktop: { type: Boolean, default: !0 },
2275
- interactiveMobile: { type: Boolean, default: !0 },
2276
- useSvg: { type: Boolean, default: !1 },
2277
- buildingChooserTimeOfDay: { type: String, default: null },
2278
- canGoToBuildingCallback: { type: Function, default: () => !0 },
2279
- customOverlayContent: { type: String, default: "" }
2280
- },
2281
- computed: {
2282
- component() {
2283
- return this.useSvg ? K : Z;
2284
- }
2285
- }
2286
- };
2287
- function Pt(e, t, i, o, n, s) {
2288
- return d(), I(oe(s.component), {
2289
- "show-cards": i.showCards,
2290
- "color-callback": i.colorCallback,
2291
- "building-callback": i.buildingCallback,
2292
- "cdn-file-resolver": i.cdnFileResolver,
2293
- i18n: i.i18n,
2294
- "interactive-desktop": i.interactiveDesktop,
2295
- "interactive-mobile": i.interactiveMobile,
2296
- "building-chooser-time-of-day": i.buildingChooserTimeOfDay,
2297
- "can-go-to-building-callback": i.canGoToBuildingCallback,
2298
- "custom-overlay-content": i.customOverlayContent,
2299
- onGoToBuilding: t[0] || (t[0] = (r) => e.$emit("go-to-building", r)),
2300
- onHoverOverBuilding: t[1] || (t[1] = (r) => e.$emit("hover-over-building", r)),
2301
- onHoverOutBuilding: t[2] || (t[2] = (r) => e.$emit("hover-out-building", r))
2302
- }, pe({ _: 2 }, [
2303
- T(Object.keys(e.$slots), (r) => ({
2304
- name: r,
2305
- fn: c((a) => [
2306
- _(e.$slots, r, re(ae(a)))
2307
- ])
2308
- }))
2309
- ]), 1064, ["show-cards", "color-callback", "building-callback", "cdn-file-resolver", "i18n", "interactive-desktop", "interactive-mobile", "building-chooser-time-of-day", "can-go-to-building-callback", "custom-overlay-content"]);
2310
- }
2311
- const Qt = /* @__PURE__ */ w(zt, [["render", Pt]]), Vt = 37, Gt = 39, Nt = {
2312
- name: "WaypointCarousel",
2313
- props: {
2314
- thumbnails: { type: Array, required: !0 },
2315
- active: { type: Number, required: !0 }
2316
- },
2317
- data() {
2318
- return {
2319
- activeThumb: 0
2320
- };
2321
- },
2322
- computed: {
2323
- activeIndex: {
2324
- get() {
2325
- return this.active;
2326
- },
2327
- set(e) {
2328
- this.activeThumb = e;
2329
- }
2330
- },
2331
- isMobile() {
2332
- return /Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(
2333
- window.navigator.userAgent
2334
- );
2335
- }
2336
- },
2337
- mounted() {
2338
- window.addEventListener("keydown", this.keyNavigate);
2339
- },
2340
- beforeUnmount() {
2341
- window.removeEventListener("keydown", this.keyNavigate);
2342
- },
2343
- methods: {
2344
- keyNavigate(e) {
2345
- switch (e.keyCode) {
2346
- case e.keyCode === Vt:
2347
- this.$emit("previous");
2348
- case e.keyCode === Gt:
2349
- this.$emit("next");
2350
- default:
2351
- return;
2352
- }
2353
- },
2354
- goToCamera(e, t) {
2355
- t(), this.$emit("goto", e);
2356
- }
2357
- }
2358
- }, Xt = { class: "waypoint-carousel" };
2359
- function Wt(e, t, i, o, n, s) {
2360
- const r = u("v-icon"), a = u("v-btn"), g = u("v-hover"), f = u("v-img"), y = u("v-card"), C = u("v-slide-group-item"), p = u("v-slide-group");
2361
- return d(), m("div", Xt, [
2362
- l(p, {
2363
- modelValue: s.activeIndex,
2364
- "onUpdate:modelValue": t[2] || (t[2] = (b) => s.activeIndex = b),
2365
- "active-class": "active-apt",
2366
- "selected-class": "active-apt",
2367
- "show-arrows": "",
2368
- "center-active": "",
2369
- mandatory: ""
2370
- }, {
2371
- prev: c(() => [
2372
- l(g, null, {
2373
- default: c(({ hover: b }) => [
2374
- l(a, {
2375
- elevation: "0",
2376
- class: M(["carousel-button", { mobile: s.isMobile }]),
2377
- onClick: t[0] || (t[0] = (v) => e.$emit("previous"))
2378
- }, {
2379
- default: c(() => [
2380
- l(r, {
2381
- color: b ? "#999" : "#d2d2d2",
2382
- "x-large": ""
2383
- }, {
2384
- default: c(() => [
2385
- B(" mdi-chevron-left ")
2386
- ]),
2387
- _: 2
2388
- }, 1032, ["color"])
2389
- ]),
2390
- _: 2
2391
- }, 1032, ["class"])
2392
- ]),
2393
- _: 1
2394
- })
2395
- ]),
2396
- next: c(() => [
2397
- l(g, null, {
2398
- default: c(({ hover: b }) => [
2399
- l(a, {
2400
- elevation: "0",
2401
- class: M(["carousel-button", { mobile: s.isMobile }]),
2402
- onClick: t[1] || (t[1] = (v) => e.$emit("next"))
2403
- }, {
2404
- default: c(() => [
2405
- l(r, {
2406
- color: b ? "#999" : "#d2d2d2",
2407
- "x-large": ""
2408
- }, {
2409
- default: c(() => [
2410
- B(" mdi-chevron-right ")
2411
- ]),
2412
- _: 2
2413
- }, 1032, ["color"])
2414
- ]),
2415
- _: 2
2416
- }, 1032, ["class"])
2417
- ]),
2418
- _: 1
2419
- })
2420
- ]),
2421
- default: c(() => [
2422
- (d(!0), m(L, null, T(i.thumbnails, (b) => (d(), I(C, {
2423
- key: b.id
2424
- }, {
2425
- default: c(({ toggle: v, selectedClass: j }) => [
2426
- l(y, {
2427
- class: M(["ma-2", j]),
2428
- align: "center",
2429
- justify: "center",
2430
- height: s.isMobile ? 50 : 100,
2431
- width: s.isMobile ? 80 : 160,
2432
- elevation: "0",
2433
- style: { overflow: "hidden" },
2434
- onClick: (H) => s.goToCamera(b.id, v)
2435
- }, {
2436
- default: c(() => [
2437
- l(f, {
2438
- "max-height": "100",
2439
- "max-width": "160",
2440
- src: b.thumbnailUrl
2441
- }, null, 8, ["src"])
2442
- ]),
2443
- _: 2
2444
- }, 1032, ["class", "height", "width", "onClick"])
2445
- ]),
2446
- _: 2
2447
- }, 1024))), 128))
2448
- ]),
2449
- _: 1
2450
- }, 8, ["modelValue"])
2451
- ]);
2452
- }
2453
- const Kt = /* @__PURE__ */ w(Nt, [["render", Wt], ["__scopeId", "data-v-f4e6ce2e"]]), Zt = {
2454
- name: "QiVirtualTourSocialShare",
2455
- inject: ["i18n"],
2456
- data() {
2457
- return {
2458
- showSocialShare: !1,
2459
- currentURL: location.href
2460
- };
2461
- },
2462
- methods: {
2463
- shareToFacebook() {
2464
- return window.open(
2465
- "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent(location.href),
2466
- "facebook-share-dialog",
2467
- "width=626,height=436"
2468
- ), !1;
2469
- },
2470
- shareToTwitter() {
2471
- return window.open(
2472
- "https://twitter.com/intent/tweet?text=" + encodeURIComponent(location.href),
2473
- "twiter-share-dialog",
2474
- "width=626,height=436"
2475
- ), !1;
2476
- },
2477
- shareToLinkedin() {
2478
- return window.open(
2479
- "https://www.linkedin.com/sharing/share-offsite/?url=" + encodeURIComponent(location.href),
2480
- "linkedin-share-dialog",
2481
- "width=626,height=736"
2482
- ), !1;
2483
- },
2484
- copyLink() {
2485
- navigator.clipboard.writeText(location.href);
2486
- }
2487
- }
2488
- }, Jt = {
2489
- id: "share-btns-wrapper",
2490
- class: "text-center"
2491
- };
2492
- function ei(e, t, i, o, n, s) {
2493
- const r = u("v-btn"), a = u("v-tooltip"), g = u("v-toolbar-title"), f = u("v-spacer"), y = u("v-toolbar"), C = u("v-card-text"), p = u("v-card"), b = u("v-dialog");
2494
- return d(), m("div", null, [
2495
- l(a, {
2496
- elevation: "2",
2497
- top: "",
2498
- attach: ""
2499
- }, {
2500
- activator: c(({ on: v }) => [
2501
- l(r, R({
2502
- density: "comfortable",
2503
- elevation: "1",
2504
- icon: "mdi-share-variant",
2505
- onClick: t[0] || (t[0] = (j) => n.showSocialShare = !n.showSocialShare)
2506
- }, fe({ ...v })), null, 16)
2507
- ]),
2508
- default: c(() => [
2509
- h("span", null, S(s.i18n.getLabel("share")), 1)
2510
- ]),
2511
- _: 1
2512
- }),
2513
- l(b, {
2514
- id: "share-box",
2515
- width: "400",
2516
- modelValue: n.showSocialShare,
2517
- "onUpdate:modelValue": t[2] || (t[2] = (v) => n.showSocialShare = v)
2518
- }, {
2519
- default: c(() => [
2520
- l(p, null, {
2521
- default: c(() => [
2522
- l(y, { elevation: "0" }, {
2523
- default: c(() => [
2524
- l(r, {
2525
- size: "x-small",
2526
- icon: "mdi-close",
2527
- onClick: t[1] || (t[1] = (v) => n.showSocialShare = !1)
2528
- }),
2529
- l(g, null, {
2530
- default: c(() => [
2531
- B(S(s.i18n.getLabel("share")), 1)
2532
- ]),
2533
- _: 1
2534
- }),
2535
- l(f)
2536
- ]),
2537
- _: 1
2538
- }),
2539
- l(C, { class: "mt-5" }, {
2540
- default: c(() => [
2541
- h("p", Jt, [
2542
- l(a, { location: "top" }, {
2543
- activator: c(({ props: v }) => [
2544
- l(r, R({
2545
- depressed: "",
2546
- fab: "",
2547
- light: "",
2548
- icon: "mdi-facebook"
2549
- }, v, { onClick: s.shareToFacebook }), null, 16, ["onClick"])
2550
- ]),
2551
- default: c(() => [
2552
- h("span", null, S(s.i18n.getLabel("share-to-facebook")), 1)
2553
- ]),
2554
- _: 1
2555
- }),
2556
- l(a, { location: "top" }, {
2557
- activator: c(({ props: v }) => [
2558
- l(r, R({
2559
- depressed: "",
2560
- fab: "",
2561
- light: "",
2562
- icon: "mdi-linkedin"
2563
- }, v, { onClick: s.shareToLinkedin }), null, 16, ["onClick"])
2564
- ]),
2565
- default: c(() => [
2566
- h("span", null, S(s.i18n.getLabel("share-to-linkedin")), 1)
2567
- ]),
2568
- _: 1
2569
- }),
2570
- l(a, { location: "top" }, {
2571
- activator: c(({ props: v }) => [
2572
- l(r, R({
2573
- depressed: "",
2574
- fab: "",
2575
- light: "",
2576
- icon: "mdi-twitter"
2577
- }, v, { onClick: s.shareToTwitter }), null, 16, ["onClick"])
2578
- ]),
2579
- default: c(() => [
2580
- h("span", null, S(s.i18n.getLabel("share-to-twitter")), 1)
2581
- ]),
2582
- _: 1
2583
- }),
2584
- l(a, { location: "top" }, {
2585
- activator: c(({ props: v }) => [
2586
- l(r, R({
2587
- depressed: "",
2588
- fab: "",
2589
- light: "",
2590
- icon: "mdi-email",
2591
- link: "",
2592
- href: `mailto:?body=${n.currentURL}`
2593
- }, v), null, 16, ["href"])
2594
- ]),
2595
- default: c(() => [
2596
- h("span", null, S(s.i18n.getLabel("share-via-email")), 1)
2597
- ]),
2598
- _: 1
2599
- }),
2600
- l(a, { location: "top" }, {
2601
- activator: c(({ props: v }) => [
2602
- l(r, R({
2603
- depressed: "",
2604
- fab: "",
2605
- light: "",
2606
- icon: "mdi-content-copy",
2607
- onClick: s.copyLink
2608
- }, v), null, 16, ["onClick"])
2609
- ]),
2610
- default: c(() => [
2611
- h("span", null, S(s.i18n.getLabel("copy-link")), 1)
2612
- ]),
2613
- _: 1
2614
- }),
2615
- l(f)
2616
- ])
2617
- ]),
2618
- _: 1
2619
- })
2620
- ]),
2621
- _: 1
2622
- })
2623
- ]),
2624
- _: 1
2625
- }, 8, ["modelValue"])
2626
- ]);
2627
- }
2628
- const ti = /* @__PURE__ */ w(Zt, [["render", ei], ["__scopeId", "data-v-3560cd03"]]);
2629
- class ii {
2630
- constructor(t, i) {
2631
- this._doc = t, this._elemId = i, this._state = { isActive: !1 };
2632
- }
2633
- get isActive() {
2634
- return this._state.isActive;
2635
- }
2636
- setup() {
2637
- const t = [
2638
- "fullscreenchange",
2639
- "webkitfullscreenchange",
2640
- "mozfullscreenchange",
2641
- "msfullscreenchange"
2642
- ], i = this._getElement();
2643
- t.forEach((o) => {
2644
- i.addEventListener(o, this._toggle.bind(this), !1);
2645
- });
2646
- }
2647
- toggle() {
2648
- this.isActive ? this._exit() : this._enter();
2649
- }
2650
- _enter() {
2651
- const t = this._getElement(), i = t.requestFullscreen || t.webkitRequestFullscreen || t.mozRequestFullscreen || t.msRequestFullscreen;
2652
- i && i.apply(t);
2653
- }
2654
- _exit() {
2655
- const t = this._doc.exitFullscreen || this._doc.webkitExitFullscreen || this._doc.mozExitFullscreen || this._doc.document.msExitFullscreen;
2656
- t && t.apply(document);
2657
- }
2658
- _getElement() {
2659
- return this._doc.getElementById(this._elemId);
2660
- }
2661
- _toggle() {
2662
- const t = !!(this._doc.fullscreenElement || this._doc.webkitFullscreenElement || this._doc.mozFullscreenElement || this._doc.msFullscreenElement);
2663
- this._state.isActive = t;
2664
- }
2665
- }
2666
- const ni = {
2667
- props: {
2668
- isFullScreen: {
2669
- type: Boolean,
2670
- required: !0
2671
- }
2672
- },
2673
- emits: ["toggle-fullscreen"]
2674
- }, si = {
2675
- id: "btn-fullscreen",
2676
- class: "btn-placeholder mr-2"
2677
- };
2678
- function oi(e, t, i, o, n, s) {
2679
- const r = u("v-btn");
2680
- return d(), m("div", si, [
2681
- l(r, {
2682
- density: "comfortable",
2683
- elevation: "3",
2684
- icon: i.isFullScreen ? "mdi-fullscreen-exit" : "mdi-fullscreen",
2685
- onClick: t[0] || (t[0] = (a) => e.$emit("toggle-fullscreen"))
2686
- }, null, 8, ["icon"])
2687
- ]);
2688
- }
2689
- const ri = /* @__PURE__ */ w(ni, [["render", oi]]), ai = {
2690
- name: "Disclaimer",
2691
- inject: ["i18n"],
2692
- data() {
2693
- return {
2694
- isVisible: !0
2695
- };
2696
- }
2697
- }, li = {
2698
- key: 0,
2699
- class: "text-white disclaimer caption"
2700
- };
2701
- function di(e, t, i, o, n, s) {
2702
- return d(), I(G, { name: "fade-transition" }, {
2703
- default: c(() => [
2704
- n.isVisible ? (d(), m("div", li, [
2705
- B(S(s.i18n.getLabel("all-illustrations-are-indicative-deviations-may-occur")) + " ", 1),
2706
- h("span", {
2707
- onClick: t[0] || (t[0] = (r) => n.isVisible = !1),
2708
- class: "link-text text-decoration-underline"
2709
- }, S(s.i18n.getLabel("i-understand")), 1)
2710
- ])) : k("", !0)
2711
- ]),
2712
- _: 1
2713
- });
2714
- }
2715
- const ci = /* @__PURE__ */ w(ai, [["render", di], ["__scopeId", "data-v-6e4f02d6"]]), ui = {
2716
- name: "ManualSlideShowImage",
2717
- props: {
2718
- isFullScreen: { type: Boolean, required: !0 }
2719
- },
2720
- data() {
2721
- return {};
2722
- },
2723
- watch: {},
2724
- mounted() {
2725
- window.addEventListener("resize", this.setPlayerSize), this.setPlayerSize();
2726
- },
2727
- methods: {
2728
- findClosestAncestor(e, t) {
2729
- let i = e, o = e;
2730
- for (; (i = i.parentNode) && i.className.indexOf(t) < 0; )
2731
- ;
2732
- return o = i, o;
2733
- },
2734
- setPlayerSize() {
2735
- let e = 1.7777777777777777, t = document.querySelector("#player-sizer");
2736
- if (!t)
2737
- return;
2738
- let i = t.offsetWidth, o = i * (1 / e);
2739
- (window.innerWidth <= 600 || i <= 600) && (o = window.innerHeight * 0.75, i = o * (1 / e)), t.style.height = o + "px", t.style.width = i + "px", this.$emit("new-size-callback", i, o);
2740
- }
2741
- }
2742
- }, hi = { id: "player-wrapper" }, mi = { id: "player-sizer" }, gi = {
2743
- class: "player-control",
2744
- id: "controls-top-left"
2745
- }, vi = {
2746
- class: "player-control",
2747
- id: "controls-top-center"
2748
- }, pi = {
2749
- class: "player-control",
2750
- id: "controls-top-right"
2751
- }, fi = {
2752
- class: "player-control",
2753
- id: "controls-center-left"
2754
- }, bi = {
2755
- class: "player-control",
2756
- id: "controls-center-center"
2757
- }, yi = {
2758
- class: "player-control",
2759
- id: "controls-center-right"
2760
- }, wi = {
2761
- class: "player-control",
2762
- id: "controls-bottom-left"
2763
- }, _i = {
2764
- class: "player-control",
2765
- id: "controls-bottom-center"
2766
- }, ki = {
2767
- class: "player-control",
2768
- id: "controls-bottom-right"
2769
- };
2770
- function Ii(e, t, i, o, n, s) {
2771
- return d(), m("div", hi, [
2772
- h("div", mi, [
2773
- _(e.$slots, "slideshow-image", {}, void 0, !0),
2774
- h("div", gi, [
2775
- _(e.$slots, "top-left", {}, void 0, !0)
2776
- ]),
2777
- h("div", vi, [
2778
- _(e.$slots, "top-center", {}, void 0, !0)
2779
- ]),
2780
- h("div", pi, [
2781
- _(e.$slots, "top-right", {}, void 0, !0)
2782
- ]),
2783
- h("div", fi, [
2784
- _(e.$slots, "center-left", {}, void 0, !0)
2785
- ]),
2786
- h("div", bi, [
2787
- _(e.$slots, "center-center", {}, void 0, !0)
2788
- ]),
2789
- h("div", yi, [
2790
- _(e.$slots, "center-right", {}, void 0, !0)
2791
- ]),
2792
- h("div", wi, [
2793
- _(e.$slots, "bottom-left", {}, void 0, !0)
2794
- ]),
2795
- h("div", _i, [
2796
- _(e.$slots, "bottom-center", {}, void 0, !0)
2797
- ]),
2798
- h("div", ki, [
2799
- _(e.$slots, "bottom-right", {}, void 0, !0)
2800
- ])
2801
- ])
2802
- ]);
2803
- }
2804
- const Ci = /* @__PURE__ */ w(ui, [["render", Ii], ["__scopeId", "data-v-1dab1ac3"]]), Si = {
2805
- name: "StaticImage",
2806
- props: {
2807
- image: { type: String, required: !0 },
2808
- aspectRatio: { type: String, default: () => "wide" }
2809
- },
2810
- computed: {
2811
- style() {
2812
- return { "background-image": `url("${encodeURI(this.image)}")` };
2813
- }
2814
- }
2815
- }, Bi = { class: "static-image-wrapper" };
2816
- function Di(e, t, i, o, n, s) {
2817
- return d(), m("div", Bi, [
2818
- h("div", {
2819
- class: M(["img-div", [i.aspectRatio]]),
2820
- style: D(s.style)
2821
- }, null, 6)
2822
- ]);
2823
- }
2824
- const Ai = /* @__PURE__ */ w(Si, [["render", Di], ["__scopeId", "data-v-b418cf51"]]), xi = {
2825
- name: "ManualSlideShow",
2826
- components: {
2827
- WaypointCarousel: Kt,
2828
- SingleImage: Ai,
2829
- SocialShare: ti,
2830
- FullScreenButton: ri,
2831
- Disclaimer: ci,
2832
- ManualSlideShowPlayer: Ci
2833
- },
2834
- provide() {
2835
- return {
2836
- i18n: this.i18n ? new F(this.i18n.labels, this.i18n.language) : new F()
2837
- };
2838
- },
2839
- props: {
2840
- images: { type: Array, required: !0 },
2841
- websiteUrl: { type: String, default: () => {
2842
- } },
2843
- i18n: { type: Object, default: void 0 },
2844
- showFullScreen: { type: Boolean, default: () => !0 },
2845
- showShare: { type: Boolean, default: () => !0 },
2846
- defaultWaypointIndex: { type: Number, default: () => 0 }
2847
- },
2848
- data() {
2849
- return {
2850
- loading: !0,
2851
- error: !1,
2852
- currentIndex: 0,
2853
- currentImageId: void 0,
2854
- fullScreen: new ii(document, "player-wrapper")
2855
- };
2856
- },
2857
- computed: {
2858
- imagesWithThumbnails() {
2859
- return this.images.map((e) => ({ ...e, thumbnailUrl: e.url }));
2860
- },
2861
- currentImage() {
2862
- return this.images[this.currentIndex].url;
2863
- }
2864
- },
2865
- mounted() {
2866
- this.fullScreen.setup();
2867
- },
2868
- methods: {
2869
- toggleFullscreen() {
2870
- this.fullScreen.toggle(), window.scrollTo({ top: 150, behavior: "smooth" });
2871
- },
2872
- nextImage() {
2873
- let e = this.currentIndex + 1;
2874
- e >= this.images.length && (e = 0), this.currentIndex = e;
2875
- },
2876
- previousImage() {
2877
- let e = this.currentIndex - 1;
2878
- e < 0 && (e = this.images.length - 1), this.currentIndex = e;
2879
- },
2880
- goToImage(e, t = !0) {
2881
- let i = this.images.findIndex((o) => o.id === e);
2882
- i != -1 && (this.currentIndex = i);
2883
- }
2884
- }
2885
- }, Mi = { class: "virtual-tour-v2-wrapper" }, Ri = { class: "player-and-components-wrapper" }, Fi = {
2886
- key: 1,
2887
- class: "btn-placeholder"
2888
- };
2889
- function Hi(e, t, i, o, n, s) {
2890
- const r = u("single-image"), a = u("disclaimer"), g = u("v-icon"), f = u("v-btn"), y = u("full-screen-button"), C = u("social-share"), p = u("waypoint-carousel"), b = u("manual-slide-show-player");
2891
- return d(), m("div", Mi, [
2892
- h("div", Ri, [
2893
- h("div", null, [
2894
- l(b, {
2895
- isFullScreen: n.fullScreen.isActive
2896
- }, {
2897
- "slideshow-image": c(() => [
2898
- l(r, { image: s.currentImage }, null, 8, ["image"])
2899
- ]),
2900
- "top-left": c(() => []),
2901
- "top-center": c(() => [
2902
- l(a, { "return-url": i.websiteUrl }, null, 8, ["return-url"])
2903
- ]),
2904
- "top-right": c(() => []),
2905
- "center-left": c(() => [
2906
- l(G, { name: "slide-x-transition" }, {
2907
- default: c(() => [
2908
- l(f, {
2909
- elevation: "1",
2910
- rounded: "",
2911
- plain: "",
2912
- icon: "",
2913
- onClick: s.previousImage
2914
- }, {
2915
- default: c(() => [
2916
- l(g, { color: "black darken-1" }, {
2917
- default: c(() => [
2918
- B("mdi-chevron-left")
2919
- ]),
2920
- _: 1
2921
- })
2922
- ]),
2923
- _: 1
2924
- }, 8, ["onClick"])
2925
- ]),
2926
- _: 1
2927
- })
2928
- ]),
2929
- "center-center": c(() => []),
2930
- "center-right": c(() => [
2931
- l(G, { name: "slide-x-reverse-transition" }, {
2932
- default: c(() => [
2933
- l(f, {
2934
- elevation: "1",
2935
- rounded: "",
2936
- plain: "",
2937
- icon: "",
2938
- onClick: s.nextImage
2939
- }, {
2940
- default: c(() => [
2941
- l(g, { color: "black darken-1" }, {
2942
- default: c(() => [
2943
- B("mdi-chevron-right")
2944
- ]),
2945
- _: 1
2946
- })
2947
- ]),
2948
- _: 1
2949
- }, 8, ["onClick"])
2950
- ]),
2951
- _: 1
2952
- })
2953
- ]),
2954
- "bottom-left": c(() => [
2955
- i.showFullScreen ? (d(), I(y, {
2956
- key: 0,
2957
- isFullScreen: n.fullScreen.isActive,
2958
- class: "btn-fullscreen",
2959
- onToggleFullscreen: s.toggleFullscreen
2960
- }, null, 8, ["isFullScreen", "onToggleFullscreen"])) : k("", !0),
2961
- i.showShare ? (d(), m("div", Fi, [
2962
- l(C)
2963
- ])) : k("", !0)
2964
- ]),
2965
- "bottom-center": c(() => [
2966
- h("div", null, [
2967
- n.fullScreen.isActive ? (d(), I(p, {
2968
- key: 0,
2969
- class: M([n.fullScreen.isActive ? "full-screen" : ""]),
2970
- thumbnails: s.imagesWithThumbnails,
2971
- active: n.currentIndex,
2972
- onNext: s.nextImage,
2973
- onPrevious: s.previousImage,
2974
- onGoto: s.goToImage
2975
- }, null, 8, ["class", "thumbnails", "active", "onNext", "onPrevious", "onGoto"])) : k("", !0)
2976
- ])
2977
- ]),
2978
- "bottom-right": c(() => []),
2979
- _: 1
2980
- }, 8, ["isFullScreen"]),
2981
- l(p, {
2982
- thumbnails: s.imagesWithThumbnails,
2983
- active: n.currentIndex,
2984
- onNext: s.nextImage,
2985
- onPrevious: s.previousImage,
2986
- onGoto: s.goToImage
2987
- }, null, 8, ["thumbnails", "active", "onNext", "onPrevious", "onGoto"])
2988
- ])
2989
- ])
2990
- ]);
2991
- }
2992
- const Ti = /* @__PURE__ */ w(xi, [["render", Hi], ["__scopeId", "data-v-e2117d1e"]]), Li = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2993
- __proto__: null,
2994
- ManualSlideShow: Ti,
2995
- QiApartmentChooser: dt,
2996
- QiApartmentChooserNavigation: ce,
2997
- QiApartmentChooserRaster: N,
2998
- QiApartmentChooserRotator: ue,
2999
- QiApartmentChooserSvg: X,
3000
- QiBuildingChooser: Qt,
3001
- QiBuildingChooserRaster: Z,
3002
- QiBuildingChooserRasterOverlay: ge,
3003
- QiBuildingChooserSceneImageStack: ne,
3004
- QiBuildingChooserSunSimControl: ie,
3005
- QiBuildingChooserSvg: K,
3006
- QiFloatingCard: z,
3007
- QiHoverProbe: $,
3008
- QiNorthDirection: te,
3009
- QiZoomBox: P
3010
- }, Symbol.toStringTag, { value: "Module" }));
3011
- class Oi {
3012
- constructor(t) {
3013
- this._data = t;
3014
- }
3015
- getPixel(t, i) {
3016
- const o = this._data[t][i];
3017
- if (o !== " ") {
3018
- const n = Number.parseInt(o);
3019
- return [n, n, n, 255];
3020
- } else
3021
- return [0, 0, 0, 0];
3022
- }
3023
- }
3024
- const Ei = function(t) {
3025
- Object.entries(Li).forEach(([i, o]) => {
3026
- t.component(i, o);
3027
- });
3028
- };
3029
- export {
3030
- W as BatchLoadTracker,
3031
- E as BuildingMap,
3032
- me as BuildingPickerResourceProvider,
3033
- Ke as BuildingViewerModel,
3034
- q as CanvasRaster,
3035
- Q as DayOfYearSelector,
3036
- F as I18N,
3037
- Ti as ManualSlideShow,
3038
- dt as QiApartmentChooser,
3039
- ce as QiApartmentChooserNavigation,
3040
- N as QiApartmentChooserRaster,
3041
- ue as QiApartmentChooserRotator,
3042
- X as QiApartmentChooserSvg,
3043
- Qt as QiBuildingChooser,
3044
- Z as QiBuildingChooserRaster,
3045
- ge as QiBuildingChooserRasterOverlay,
3046
- ne as QiBuildingChooserSceneImageStack,
3047
- ie as QiBuildingChooserSunSimControl,
3048
- K as QiBuildingChooserSvg,
3049
- z as QiFloatingCard,
3050
- $ as QiHoverProbe,
3051
- te as QiNorthDirection,
3052
- P as QiZoomBox,
3053
- U as ResourceLoader,
3054
- Oi as SampleRaster,
3055
- Fe as SceneRotator,
3056
- Ei as default,
3057
- de as throttle
3058
- };