dh_ackergaul
2026-06-03 a25433795ec239654db2ef31af6d3f4e84b3b8dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { n, B as BaseElement } from './base.component-813fc7cf.js';
import { e } from './custom-element-30fc6381.js';
import { i, r, x } from './query-assigned-elements-fea1f631.js';
import '@dh-software/furnview-icons';
 
var css_248z = i`:host{position:absolute;transform:translate(-50%,-50%)}`;
 
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getProtoOf = Object.getPrototypeOf;
var __reflectGet = Reflect.get;
var __decorateClass = (decorators, target, key, kind) => {
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
    if (decorator = decorators[i])
      result = (kind ? decorator(target, key, result) : decorator(result)) || result;
  if (kind && result)
    __defProp(target, key, result);
  return result;
};
var __superStaticGet = (obj, member) => __reflectGet(__getProtoOf(obj), member, obj);
var __async = (__this, __arguments, generator) => {
  return new Promise((resolve, reject) => {
    var fulfilled = (value) => {
      try {
        step(generator.next(value));
      } catch (e) {
        reject(e);
      }
    };
    var rejected = (value) => {
      try {
        step(generator.throw(value));
      } catch (e) {
        reject(e);
      }
    };
    var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
    step((generator = generator.apply(__this, __arguments)).next());
  });
};
let ExternalWidgetComponent = class extends BaseElement {
  constructor() {
    super(...arguments);
    this._checkFrustum = false;
    this._updateTimeout = 100;
  }
  firstUpdated(_changedProperties) {
    super.firstUpdated(_changedProperties);
    this.createUpdateScheduler();
  }
  disconnectedCallback() {
    this.cancelUpdateScheduler();
    super.disconnectedCallback();
  }
  render() {
    return x`
            <slot></slot>
        `;
  }
  updated(_changedProperties) {
    if (_changedProperties.has("_updateTimeout")) {
      this.createUpdateScheduler();
    }
    super.updated(_changedProperties);
  }
  onUpdate() {
    return __async(this, null, function* () {
      if (this._positionVector) {
        const position = yield CommunicationMessageService.getWidgetPosition(this._instanceIdents || [], this._positionVector, this.getBoundingClientRect());
        if (position) {
          this.style.top = position.y;
          this.style.left = position.left ? position.x : "";
          this.classList.remove("hidden");
          if (!position.pointer && this._checkFrustum) {
            this.classList.add("hidden");
          }
        }
      }
    });
  }
  createUpdateScheduler() {
    if (this._timer) {
      this.cancelUpdateScheduler();
    }
    this._timer = window.setInterval(this.onUpdate.bind(this), this._updateTimeout);
  }
  cancelUpdateScheduler() {
    if (this._timer) {
      window.clearInterval(this._timer);
      this._timer = void 0;
    }
  }
};
ExternalWidgetComponent.styles = [__superStaticGet(ExternalWidgetComponent, "styles") || [], r(css_248z)];
__decorateClass([
  n({ type: Array, reflect: true, attribute: "instance-idents" })
], ExternalWidgetComponent.prototype, "_instanceIdents", 2);
__decorateClass([
  n({ type: Object, reflect: true, attribute: "position-vector" })
], ExternalWidgetComponent.prototype, "_positionVector", 2);
__decorateClass([
  n({ type: Boolean, reflect: true, attribute: "check-frustum" })
], ExternalWidgetComponent.prototype, "_checkFrustum", 2);
__decorateClass([
  n({ type: Number, reflect: true, attribute: "update-timeout" })
], ExternalWidgetComponent.prototype, "_updateTimeout", 2);
ExternalWidgetComponent = __decorateClass([
  e("fv-external-widget")
], ExternalWidgetComponent);
 
export { ExternalWidgetComponent };