aoi-comp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +187 -0
- package/dist/BufferResource-CVU-ZRRz.js +273 -0
- package/dist/CanvasPool-C3aVgvEX.js +30 -0
- package/dist/CanvasRenderer-CVj7HTkL.js +3460 -0
- package/dist/Geometry-CN7W9DnD.js +3802 -0
- package/dist/RenderTargetSystem-D_FiZPnb.js +2572 -0
- package/dist/WebGLRenderer-CurPxJtF.js +2210 -0
- package/dist/WebGPURenderer-CfiYFIN2.js +1840 -0
- package/dist/browserAll-DqFkNC6q.js +977 -0
- package/dist/canvasUtils-D0KM_fKp.js +168 -0
- package/dist/comps.js +4459 -0
- package/dist/getTextureBatchBindGroup-CLFTP_Vc.js +19 -0
- package/dist/hooks-DByotZq7.js +452 -0
- package/dist/hooks.js +2 -0
- package/dist/index.js +2 -0
- package/dist/init-CIaGzij5.js +446 -0
- package/dist/init-DVXFVLyx.js +878 -0
- package/dist/packages-BbFWPD88.js +4002 -0
- package/dist/rolldown-runtime-CWhphoD1.js +23 -0
- package/dist/style.css +2 -0
- package/dist/utils.js +2 -0
- package/dist/webworkerAll-XSXRmCFC.js +2 -0
- package/package.json +65 -0
|
@@ -0,0 +1,977 @@
|
|
|
1
|
+
import { C as e, F as t, R as n, _ as r, it as i, nt as a, rt as o, tt as s, v as c } from "./Geometry-CN7W9DnD.js";
|
|
2
|
+
import "./init-DVXFVLyx.js";
|
|
3
|
+
import "./init-CIaGzij5.js";
|
|
4
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/dom/CanvasObserver.mjs
|
|
5
|
+
var l = class {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this._lastTransform = "", this._observer = null, this._tickerAttached = !1, this.updateTranslation = () => {
|
|
8
|
+
if (!this._canvas) return;
|
|
9
|
+
let e = this._canvas.getBoundingClientRect(), t = this._canvas.width, n = this._canvas.height, r = e.width / t * this._renderer.resolution, i = e.height / n * this._renderer.resolution, a = `translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;
|
|
10
|
+
a !== this._lastTransform && (this._domElement.style.transform = a, this._lastTransform = a);
|
|
11
|
+
}, this._domElement = e.domElement, this._renderer = e.renderer, !(globalThis.OffscreenCanvas && this._renderer.canvas instanceof OffscreenCanvas) && (this._canvas = this._renderer.canvas, this._attachObserver());
|
|
12
|
+
}
|
|
13
|
+
get canvas() {
|
|
14
|
+
return this._canvas;
|
|
15
|
+
}
|
|
16
|
+
ensureAttached() {
|
|
17
|
+
!this._domElement.parentNode && this._canvas.parentNode && (this._canvas.parentNode.appendChild(this._domElement), this.updateTranslation());
|
|
18
|
+
}
|
|
19
|
+
_attachObserver() {
|
|
20
|
+
"ResizeObserver" in globalThis ? (this._observer &&= (this._observer.disconnect(), null), this._observer = new ResizeObserver((e) => {
|
|
21
|
+
for (let t of e) {
|
|
22
|
+
if (t.target !== this._canvas) continue;
|
|
23
|
+
let e = this.canvas.width, n = this.canvas.height, r = t.contentRect.width / e * this._renderer.resolution, i = t.contentRect.height / n * this._renderer.resolution;
|
|
24
|
+
(this._lastScaleX !== r || this._lastScaleY !== i) && (this.updateTranslation(), this._lastScaleX = r, this._lastScaleY = i);
|
|
25
|
+
}
|
|
26
|
+
}), this._observer.observe(this._canvas)) : this._tickerAttached || r.shared.add(this.updateTranslation, this, c.HIGH);
|
|
27
|
+
}
|
|
28
|
+
destroy() {
|
|
29
|
+
this._observer ? (this._observer.disconnect(), this._observer = null) : this._tickerAttached && r.shared.remove(this.updateTranslation), this._domElement = null, this._renderer = null, this._canvas = null, this._tickerAttached = !1, this._lastTransform = "", this._lastScaleX = null, this._lastScaleY = null;
|
|
30
|
+
}
|
|
31
|
+
}, u = class e {
|
|
32
|
+
constructor(t) {
|
|
33
|
+
this.bubbles = !0, this.cancelBubble = !0, this.cancelable = !1, this.composed = !1, this.defaultPrevented = !1, this.eventPhase = e.prototype.NONE, this.propagationStopped = !1, this.propagationImmediatelyStopped = !1, this.layer = new s(), this.page = new s(), this.NONE = 0, this.CAPTURING_PHASE = 1, this.AT_TARGET = 2, this.BUBBLING_PHASE = 3, this.manager = t;
|
|
34
|
+
}
|
|
35
|
+
get layerX() {
|
|
36
|
+
return this.layer.x;
|
|
37
|
+
}
|
|
38
|
+
get layerY() {
|
|
39
|
+
return this.layer.y;
|
|
40
|
+
}
|
|
41
|
+
get pageX() {
|
|
42
|
+
return this.page.x;
|
|
43
|
+
}
|
|
44
|
+
get pageY() {
|
|
45
|
+
return this.page.y;
|
|
46
|
+
}
|
|
47
|
+
get data() {
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
composedPath() {
|
|
51
|
+
return this.manager && (!this.path || this.path[this.path.length - 1] !== this.target) && (this.path = this.target ? this.manager.propagationPath(this.target) : []), this.path;
|
|
52
|
+
}
|
|
53
|
+
initEvent(e, t, n) {
|
|
54
|
+
throw Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
55
|
+
}
|
|
56
|
+
initUIEvent(e, t, n, r, i) {
|
|
57
|
+
throw Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
|
|
58
|
+
}
|
|
59
|
+
preventDefault() {
|
|
60
|
+
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault(), this.defaultPrevented = !0;
|
|
61
|
+
}
|
|
62
|
+
stopImmediatePropagation() {
|
|
63
|
+
this.propagationImmediatelyStopped = !0;
|
|
64
|
+
}
|
|
65
|
+
stopPropagation() {
|
|
66
|
+
this.propagationStopped = !0;
|
|
67
|
+
}
|
|
68
|
+
}, d = /iPhone/i, f = /iPod/i, p = /iPad/i, m = /\biOS-universal(?:.+)Mac\b/i, h = /\bAndroid(?:.+)Mobile\b/i, g = /Android/i, _ = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i, v = /Silk/i, y = /Windows Phone/i, b = /\bWindows(?:.+)ARM\b/i, x = /BlackBerry/i, S = /BB10/i, C = /Opera Mini/i, w = /\b(CriOS|Chrome)(?:.+)Mobile/i, T = /Mobile(?:.+)Firefox\b/i, E = function(e) {
|
|
69
|
+
return e !== void 0 && e.platform === "MacIntel" && typeof e.maxTouchPoints == "number" && e.maxTouchPoints > 1 && typeof MSStream > "u";
|
|
70
|
+
};
|
|
71
|
+
function D(e) {
|
|
72
|
+
return function(t) {
|
|
73
|
+
return t.test(e);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function O(e) {
|
|
77
|
+
var t = {
|
|
78
|
+
userAgent: "",
|
|
79
|
+
platform: "",
|
|
80
|
+
maxTouchPoints: 0
|
|
81
|
+
};
|
|
82
|
+
!e && typeof navigator < "u" ? t = {
|
|
83
|
+
userAgent: navigator.userAgent,
|
|
84
|
+
platform: navigator.platform,
|
|
85
|
+
maxTouchPoints: navigator.maxTouchPoints || 0
|
|
86
|
+
} : typeof e == "string" ? t.userAgent = e : e && e.userAgent && (t = {
|
|
87
|
+
userAgent: e.userAgent,
|
|
88
|
+
platform: e.platform,
|
|
89
|
+
maxTouchPoints: e.maxTouchPoints || 0
|
|
90
|
+
});
|
|
91
|
+
var n = t.userAgent, r = n.split("[FBAN");
|
|
92
|
+
r[1] !== void 0 && (n = r[0]), r = n.split("Twitter"), r[1] !== void 0 && (n = r[0]);
|
|
93
|
+
var i = D(n), a = {
|
|
94
|
+
apple: {
|
|
95
|
+
phone: i(d) && !i(y),
|
|
96
|
+
ipod: i(f),
|
|
97
|
+
tablet: !i(d) && (i(p) || E(t)) && !i(y),
|
|
98
|
+
universal: i(m),
|
|
99
|
+
device: (i(d) || i(f) || i(p) || i(m) || E(t)) && !i(y)
|
|
100
|
+
},
|
|
101
|
+
amazon: {
|
|
102
|
+
phone: i(_),
|
|
103
|
+
tablet: !i(_) && i(v),
|
|
104
|
+
device: i(_) || i(v)
|
|
105
|
+
},
|
|
106
|
+
android: {
|
|
107
|
+
phone: !i(y) && i(_) || !i(y) && i(h),
|
|
108
|
+
tablet: !i(y) && !i(_) && !i(h) && (i(v) || i(g)),
|
|
109
|
+
device: !i(y) && (i(_) || i(v) || i(h) || i(g)) || i(/\bokhttp\b/i)
|
|
110
|
+
},
|
|
111
|
+
windows: {
|
|
112
|
+
phone: i(y),
|
|
113
|
+
tablet: i(b),
|
|
114
|
+
device: i(y) || i(b)
|
|
115
|
+
},
|
|
116
|
+
other: {
|
|
117
|
+
blackberry: i(x),
|
|
118
|
+
blackberry10: i(S),
|
|
119
|
+
opera: i(C),
|
|
120
|
+
firefox: i(T),
|
|
121
|
+
chrome: i(w),
|
|
122
|
+
device: i(x) || i(S) || i(C) || i(T) || i(w)
|
|
123
|
+
},
|
|
124
|
+
any: !1,
|
|
125
|
+
phone: !1,
|
|
126
|
+
tablet: !1
|
|
127
|
+
};
|
|
128
|
+
return a.any = a.apple.device || a.android.device || a.windows.device || a.other.device, a.phone = a.apple.phone || a.android.phone || a.windows.phone, a.tablet = a.apple.tablet || a.android.tablet || a.windows.tablet, a;
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/utils/browser/isMobile.mjs
|
|
132
|
+
var k = (O.default ?? O)(globalThis.navigator), A = 9, j = 100, M = 0, N = 0, P = 2, F = 1, I = -1e3, L = -1e3, R = 2, z = class e {
|
|
133
|
+
constructor(e, t = k) {
|
|
134
|
+
this._mobileInfo = t, this.debug = !1, this._activateOnTab = !0, this._deactivateOnMouseMove = !0, this._isActive = !1, this._isMobileAccessibility = !1, this._div = null, this._pools = {}, this._renderId = 0, this._children = [], this._androidUpdateCount = 0, this._androidUpdateFrequency = 500, this._isRunningTests = !1, this._boundOnKeyDown = this._onKeyDown.bind(this), this._boundOnMouseMove = this._onMouseMove.bind(this), this._hookDiv = null, (t.tablet || t.phone) && this._createTouchHook(), this._renderer = e;
|
|
135
|
+
}
|
|
136
|
+
get isActive() {
|
|
137
|
+
return this._isActive;
|
|
138
|
+
}
|
|
139
|
+
get isMobileAccessibility() {
|
|
140
|
+
return this._isMobileAccessibility;
|
|
141
|
+
}
|
|
142
|
+
get hookDiv() {
|
|
143
|
+
return this._hookDiv;
|
|
144
|
+
}
|
|
145
|
+
get div() {
|
|
146
|
+
return this._div;
|
|
147
|
+
}
|
|
148
|
+
_createTouchHook() {
|
|
149
|
+
let e = document.createElement("button");
|
|
150
|
+
e.style.width = `${F}px`, e.style.height = `${F}px`, e.style.position = "absolute", e.style.top = `${I}px`, e.style.left = `${L}px`, e.style.zIndex = R.toString(), e.style.backgroundColor = "#FF0000", e.title = "select to enable accessibility for this content", e.addEventListener("focus", () => {
|
|
151
|
+
this._isMobileAccessibility = !0, this._activate(), this._destroyTouchHook();
|
|
152
|
+
}), document.body.appendChild(e), this._hookDiv = e;
|
|
153
|
+
}
|
|
154
|
+
_destroyTouchHook() {
|
|
155
|
+
this._hookDiv &&= (document.body.removeChild(this._hookDiv), null);
|
|
156
|
+
}
|
|
157
|
+
_activate() {
|
|
158
|
+
if (this._isActive) return;
|
|
159
|
+
this._isActive = !0, this._div || (this._div = document.createElement("div"), this._div.style.position = "absolute", this._div.style.top = `${M}px`, this._div.style.left = `${N}px`, this._div.style.pointerEvents = "none", this._div.style.zIndex = P.toString(), this._canvasObserver = new l({
|
|
160
|
+
domElement: this._div,
|
|
161
|
+
renderer: this._renderer
|
|
162
|
+
})), this._activateOnTab && globalThis.addEventListener("keydown", this._boundOnKeyDown, !1), this._deactivateOnMouseMove && globalThis.document.addEventListener("mousemove", this._boundOnMouseMove, !0);
|
|
163
|
+
let e = this._renderer.view.canvas;
|
|
164
|
+
if (e.parentNode) this._canvasObserver.ensureAttached(), this._initAccessibilitySetup();
|
|
165
|
+
else {
|
|
166
|
+
let t = new MutationObserver(() => {
|
|
167
|
+
e.parentNode && (t.disconnect(), this._canvasObserver.ensureAttached(), this._initAccessibilitySetup());
|
|
168
|
+
});
|
|
169
|
+
t.observe(document.body, {
|
|
170
|
+
childList: !0,
|
|
171
|
+
subtree: !0
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
_initAccessibilitySetup() {
|
|
176
|
+
this._renderer.runners.postrender.add(this), this._renderer.lastObjectRendered && this._updateAccessibleObjects(this._renderer.lastObjectRendered);
|
|
177
|
+
}
|
|
178
|
+
_deactivate() {
|
|
179
|
+
if (!(!this._isActive || this._isMobileAccessibility)) {
|
|
180
|
+
this._isActive = !1, globalThis.document.removeEventListener("mousemove", this._boundOnMouseMove, !0), this._activateOnTab && globalThis.addEventListener("keydown", this._boundOnKeyDown, !1), this._renderer.runners.postrender.remove(this);
|
|
181
|
+
for (let e of this._children) e._accessibleDiv?.parentNode && (e._accessibleDiv.parentNode.removeChild(e._accessibleDiv), e._accessibleDiv = null), e._accessibleActive = !1;
|
|
182
|
+
for (let e in this._pools) this._pools[e].forEach((e) => {
|
|
183
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
184
|
+
}), delete this._pools[e];
|
|
185
|
+
this._div?.parentNode && this._div.parentNode.removeChild(this._div), this._pools = {}, this._children = [];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
_updateAccessibleObjects(e) {
|
|
189
|
+
if (!e.visible || !e.accessibleChildren) return;
|
|
190
|
+
e.accessible && (e._accessibleActive || this._addChild(e), e._renderId = this._renderId);
|
|
191
|
+
let t = e.children;
|
|
192
|
+
if (t) for (let e = 0; e < t.length; e++) this._updateAccessibleObjects(t[e]);
|
|
193
|
+
}
|
|
194
|
+
init(t) {
|
|
195
|
+
let n = { accessibilityOptions: {
|
|
196
|
+
...e.defaultOptions,
|
|
197
|
+
...t?.accessibilityOptions || {}
|
|
198
|
+
} };
|
|
199
|
+
this.debug = n.accessibilityOptions.debug, this._activateOnTab = n.accessibilityOptions.activateOnTab, this._deactivateOnMouseMove = n.accessibilityOptions.deactivateOnMouseMove, n.accessibilityOptions.enabledByDefault && this._activate(), this._renderer.runners.postrender.remove(this);
|
|
200
|
+
}
|
|
201
|
+
postrender() {
|
|
202
|
+
let e = performance.now();
|
|
203
|
+
if (this._mobileInfo.android.device && e < this._androidUpdateCount || (this._androidUpdateCount = e + this._androidUpdateFrequency, (!this._renderer.renderingToScreen || !this._renderer.view.canvas) && !this._isRunningTests)) return;
|
|
204
|
+
let n = /* @__PURE__ */ new Set();
|
|
205
|
+
if (this._renderer.lastObjectRendered) {
|
|
206
|
+
this._updateAccessibleObjects(this._renderer.lastObjectRendered);
|
|
207
|
+
for (let e of this._children) e._renderId === this._renderId && n.add(this._children.indexOf(e));
|
|
208
|
+
}
|
|
209
|
+
for (let e = this._children.length - 1; e >= 0; e--) {
|
|
210
|
+
let r = this._children[e];
|
|
211
|
+
n.has(e) || (r._accessibleDiv && r._accessibleDiv.parentNode && (r._accessibleDiv.parentNode.removeChild(r._accessibleDiv), this._getPool(r.accessibleType).push(r._accessibleDiv), r._accessibleDiv = null), r._accessibleActive = !1, t(this._children, e, 1));
|
|
212
|
+
}
|
|
213
|
+
this._renderer.renderingToScreen && this._canvasObserver.ensureAttached();
|
|
214
|
+
for (let e = 0; e < this._children.length; e++) {
|
|
215
|
+
let t = this._children[e];
|
|
216
|
+
if (!t._accessibleActive || !t._accessibleDiv) continue;
|
|
217
|
+
let n = t._accessibleDiv, r = t.hitArea || t.getBounds().rectangle;
|
|
218
|
+
if (t.hitArea) {
|
|
219
|
+
let e = t.worldTransform;
|
|
220
|
+
n.style.left = `${e.tx + r.x * e.a}px`, n.style.top = `${e.ty + r.y * e.d}px`, n.style.width = `${r.width * e.a}px`, n.style.height = `${r.height * e.d}px`;
|
|
221
|
+
} else this._capHitArea(r), n.style.left = `${r.x}px`, n.style.top = `${r.y}px`, n.style.width = `${r.width}px`, n.style.height = `${r.height}px`;
|
|
222
|
+
}
|
|
223
|
+
this._renderId++;
|
|
224
|
+
}
|
|
225
|
+
_updateDebugHTML(e) {
|
|
226
|
+
e.innerHTML = `type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;
|
|
227
|
+
}
|
|
228
|
+
_capHitArea(e) {
|
|
229
|
+
e.x < 0 && (e.width += e.x, e.x = 0), e.y < 0 && (e.height += e.y, e.y = 0);
|
|
230
|
+
let { width: t, height: n } = this._renderer;
|
|
231
|
+
e.x + e.width > t && (e.width = t - e.x), e.y + e.height > n && (e.height = n - e.y);
|
|
232
|
+
}
|
|
233
|
+
_addChild(e) {
|
|
234
|
+
let t = this._getPool(e.accessibleType).pop();
|
|
235
|
+
t ? (t.innerHTML = "", t.removeAttribute("title"), t.removeAttribute("aria-label"), t.tabIndex = 0) : (e.accessibleType === "button" ? t = document.createElement("button") : (t = document.createElement(e.accessibleType), t.style.cssText = "\n color: transparent;\n pointer-events: none;\n padding: 0;\n margin: 0;\n border: 0;\n outline: 0;\n background: transparent;\n box-sizing: border-box;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n ", e.accessibleText && (t.innerText = e.accessibleText)), t.style.width = `${j}px`, t.style.height = `${j}px`, t.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent", t.style.position = "absolute", t.style.zIndex = P.toString(), t.style.borderStyle = "none", navigator.userAgent.toLowerCase().includes("chrome") ? t.setAttribute("aria-live", "off") : t.setAttribute("aria-live", "polite"), navigator.userAgent.match(/rv:.*Gecko\//) ? t.setAttribute("aria-relevant", "additions") : t.setAttribute("aria-relevant", "text"), t.addEventListener("click", this._onClick.bind(this)), t.addEventListener("focus", this._onFocus.bind(this)), t.addEventListener("focusout", this._onFocusOut.bind(this))), t.style.pointerEvents = e.accessiblePointerEvents, t.type = e.accessibleType, e.accessibleTitle && e.accessibleTitle !== null ? t.title = e.accessibleTitle : (!e.accessibleHint || e.accessibleHint === null) && (t.title = `container ${e.tabIndex}`), e.accessibleHint && e.accessibleHint !== null && t.setAttribute("aria-label", e.accessibleHint), e.interactive ? t.tabIndex = e.tabIndex : t.tabIndex = 0, this.debug && this._updateDebugHTML(t), e._accessibleActive = !0, e._accessibleDiv = t, t.container = e, this._children.push(e), this._div.appendChild(e._accessibleDiv);
|
|
236
|
+
}
|
|
237
|
+
_dispatchEvent(e, t) {
|
|
238
|
+
let { container: n } = e.target, r = this._renderer.events.rootBoundary, i = Object.assign(new u(r), { target: n });
|
|
239
|
+
r.rootTarget = this._renderer.lastObjectRendered, t.forEach((e) => r.dispatchEvent(i, e));
|
|
240
|
+
}
|
|
241
|
+
_onClick(e) {
|
|
242
|
+
this._dispatchEvent(e, [
|
|
243
|
+
"click",
|
|
244
|
+
"pointertap",
|
|
245
|
+
"tap"
|
|
246
|
+
]);
|
|
247
|
+
}
|
|
248
|
+
_onFocus(e) {
|
|
249
|
+
e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "assertive"), this._dispatchEvent(e, ["mouseover"]);
|
|
250
|
+
}
|
|
251
|
+
_onFocusOut(e) {
|
|
252
|
+
e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "polite"), this._dispatchEvent(e, ["mouseout"]);
|
|
253
|
+
}
|
|
254
|
+
_onKeyDown(e) {
|
|
255
|
+
e.keyCode !== A || !this._activateOnTab || this._activate();
|
|
256
|
+
}
|
|
257
|
+
_onMouseMove(e) {
|
|
258
|
+
e.movementX === 0 && e.movementY === 0 || this._deactivate();
|
|
259
|
+
}
|
|
260
|
+
destroy() {
|
|
261
|
+
this._deactivate(), this._destroyTouchHook(), this._canvasObserver?.destroy(), this._canvasObserver = null, this._div = null, this._pools = null, this._children = null, this._renderer = null, this._hookDiv = null, globalThis.removeEventListener("keydown", this._boundOnKeyDown), this._boundOnKeyDown = null, globalThis.document.removeEventListener("mousemove", this._boundOnMouseMove, !0), this._boundOnMouseMove = null;
|
|
262
|
+
}
|
|
263
|
+
setAccessibilityEnabled(e) {
|
|
264
|
+
e ? this._activate() : this._deactivate();
|
|
265
|
+
}
|
|
266
|
+
_getPool(e) {
|
|
267
|
+
return this._pools[e] || (this._pools[e] = []), this._pools[e];
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
z.extension = {
|
|
271
|
+
type: [o.WebGLSystem, o.WebGPUSystem],
|
|
272
|
+
name: "accessibility"
|
|
273
|
+
}, z.defaultOptions = {
|
|
274
|
+
enabledByDefault: !1,
|
|
275
|
+
debug: !1,
|
|
276
|
+
activateOnTab: !0,
|
|
277
|
+
deactivateOnMouseMove: !0
|
|
278
|
+
};
|
|
279
|
+
var B = z, V = {
|
|
280
|
+
accessible: !1,
|
|
281
|
+
accessibleTitle: null,
|
|
282
|
+
accessibleHint: null,
|
|
283
|
+
tabIndex: 0,
|
|
284
|
+
accessibleType: "button",
|
|
285
|
+
accessibleText: null,
|
|
286
|
+
accessiblePointerEvents: "auto",
|
|
287
|
+
accessibleChildren: !0,
|
|
288
|
+
_accessibleActive: !1,
|
|
289
|
+
_accessibleDiv: null,
|
|
290
|
+
_renderId: -1
|
|
291
|
+
}, H = class {
|
|
292
|
+
constructor(e) {
|
|
293
|
+
this._attachedDomElements = [], this._renderer = e, this._renderer.runners.postrender.add(this), this._renderer.runners.init.add(this), this._domElement = document.createElement("div"), this._domElement.style.position = "absolute", this._domElement.style.top = "0", this._domElement.style.left = "0", this._domElement.style.pointerEvents = "none", this._domElement.style.zIndex = "1000";
|
|
294
|
+
}
|
|
295
|
+
init() {
|
|
296
|
+
this._canvasObserver = new l({
|
|
297
|
+
domElement: this._domElement,
|
|
298
|
+
renderer: this._renderer
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
addRenderable(e, t) {
|
|
302
|
+
this._attachedDomElements.includes(e) || this._attachedDomElements.push(e);
|
|
303
|
+
}
|
|
304
|
+
updateRenderable(e) {}
|
|
305
|
+
validateRenderable(e) {
|
|
306
|
+
return !0;
|
|
307
|
+
}
|
|
308
|
+
postrender() {
|
|
309
|
+
let e = this._attachedDomElements;
|
|
310
|
+
if (e.length === 0) {
|
|
311
|
+
this._domElement.remove();
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
this._canvasObserver.ensureAttached();
|
|
315
|
+
for (let t = 0; t < e.length; t++) {
|
|
316
|
+
let n = e[t], r = n.element;
|
|
317
|
+
if (!n.parent || n.globalDisplayStatus < 7) r?.remove(), e.splice(t, 1), t--;
|
|
318
|
+
else {
|
|
319
|
+
this._domElement.contains(r) || (r.style.position = "absolute", r.style.pointerEvents = "auto", this._domElement.appendChild(r));
|
|
320
|
+
let e = n.worldTransform, t = n._anchor, i = n.width * t.x, a = n.height * t.y;
|
|
321
|
+
r.style.transformOrigin = `${i}px ${a}px`, r.style.transform = `matrix(${e.a}, ${e.b}, ${e.c}, ${e.d}, ${e.tx - i}, ${e.ty - a})`, r.style.opacity = n.groupAlpha.toString();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
destroy() {
|
|
326
|
+
this._renderer.runners.postrender.remove(this);
|
|
327
|
+
for (let e = 0; e < this._attachedDomElements.length; e++) this._attachedDomElements[e].element?.remove();
|
|
328
|
+
this._attachedDomElements.length = 0, this._domElement.remove(), this._canvasObserver.destroy(), this._renderer = null;
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
H.extension = {
|
|
332
|
+
type: [
|
|
333
|
+
o.WebGLPipes,
|
|
334
|
+
o.WebGPUPipes,
|
|
335
|
+
o.CanvasPipes
|
|
336
|
+
],
|
|
337
|
+
name: "dom"
|
|
338
|
+
};
|
|
339
|
+
var U = new class {
|
|
340
|
+
constructor() {
|
|
341
|
+
this.interactionFrequency = 10, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
|
|
342
|
+
}
|
|
343
|
+
init(e) {
|
|
344
|
+
this.removeTickerListener(), this.events = e, this.interactionFrequency = 10, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
|
|
345
|
+
}
|
|
346
|
+
get pauseUpdate() {
|
|
347
|
+
return this._pauseUpdate;
|
|
348
|
+
}
|
|
349
|
+
set pauseUpdate(e) {
|
|
350
|
+
this._pauseUpdate = e;
|
|
351
|
+
}
|
|
352
|
+
addTickerListener() {
|
|
353
|
+
this._tickerAdded || !this.domElement || (r.system.add(this._tickerUpdate, this, c.INTERACTION), this._tickerAdded = !0);
|
|
354
|
+
}
|
|
355
|
+
removeTickerListener() {
|
|
356
|
+
this._tickerAdded &&= (r.system.remove(this._tickerUpdate, this), !1);
|
|
357
|
+
}
|
|
358
|
+
pointerMoved() {
|
|
359
|
+
this._didMove = !0;
|
|
360
|
+
}
|
|
361
|
+
_update() {
|
|
362
|
+
if (!this.domElement || this._pauseUpdate) return;
|
|
363
|
+
if (this._didMove) {
|
|
364
|
+
this._didMove = !1;
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
let e = this.events._rootPointerEvent;
|
|
368
|
+
this.events.supportsTouchEvents && e.pointerType === "touch" || globalThis.document.dispatchEvent(this.events.supportsPointerEvents ? new PointerEvent("pointermove", {
|
|
369
|
+
clientX: e.clientX,
|
|
370
|
+
clientY: e.clientY,
|
|
371
|
+
pointerType: e.pointerType,
|
|
372
|
+
pointerId: e.pointerId
|
|
373
|
+
}) : new MouseEvent("mousemove", {
|
|
374
|
+
clientX: e.clientX,
|
|
375
|
+
clientY: e.clientY
|
|
376
|
+
}));
|
|
377
|
+
}
|
|
378
|
+
_tickerUpdate(e) {
|
|
379
|
+
this._deltaTime += e.deltaTime, !(this._deltaTime < this.interactionFrequency) && (this._deltaTime = 0, this._update());
|
|
380
|
+
}
|
|
381
|
+
destroy() {
|
|
382
|
+
this.removeTickerListener(), this.events = null, this.domElement = null, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
|
|
383
|
+
}
|
|
384
|
+
}(), W = class extends u {
|
|
385
|
+
constructor() {
|
|
386
|
+
super(...arguments), this.client = new s(), this.movement = new s(), this.offset = new s(), this.global = new s(), this.screen = new s();
|
|
387
|
+
}
|
|
388
|
+
get clientX() {
|
|
389
|
+
return this.client.x;
|
|
390
|
+
}
|
|
391
|
+
get clientY() {
|
|
392
|
+
return this.client.y;
|
|
393
|
+
}
|
|
394
|
+
get x() {
|
|
395
|
+
return this.clientX;
|
|
396
|
+
}
|
|
397
|
+
get y() {
|
|
398
|
+
return this.clientY;
|
|
399
|
+
}
|
|
400
|
+
get movementX() {
|
|
401
|
+
return this.movement.x;
|
|
402
|
+
}
|
|
403
|
+
get movementY() {
|
|
404
|
+
return this.movement.y;
|
|
405
|
+
}
|
|
406
|
+
get offsetX() {
|
|
407
|
+
return this.offset.x;
|
|
408
|
+
}
|
|
409
|
+
get offsetY() {
|
|
410
|
+
return this.offset.y;
|
|
411
|
+
}
|
|
412
|
+
get globalX() {
|
|
413
|
+
return this.global.x;
|
|
414
|
+
}
|
|
415
|
+
get globalY() {
|
|
416
|
+
return this.global.y;
|
|
417
|
+
}
|
|
418
|
+
get screenX() {
|
|
419
|
+
return this.screen.x;
|
|
420
|
+
}
|
|
421
|
+
get screenY() {
|
|
422
|
+
return this.screen.y;
|
|
423
|
+
}
|
|
424
|
+
getLocalPosition(e, t, n) {
|
|
425
|
+
return e.worldTransform.applyInverse(n || this.global, t);
|
|
426
|
+
}
|
|
427
|
+
getModifierState(e) {
|
|
428
|
+
return "getModifierState" in this.nativeEvent && this.nativeEvent.getModifierState(e);
|
|
429
|
+
}
|
|
430
|
+
initMouseEvent(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
431
|
+
throw Error("Method not implemented.");
|
|
432
|
+
}
|
|
433
|
+
}, G = class extends W {
|
|
434
|
+
constructor() {
|
|
435
|
+
super(...arguments), this.width = 0, this.height = 0, this.isPrimary = !1, this.persistentDeviceId = 0;
|
|
436
|
+
}
|
|
437
|
+
getCoalescedEvents() {
|
|
438
|
+
return this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove" ? [this] : [];
|
|
439
|
+
}
|
|
440
|
+
getPredictedEvents() {
|
|
441
|
+
throw Error("getPredictedEvents is not supported!");
|
|
442
|
+
}
|
|
443
|
+
}, K = class extends W {
|
|
444
|
+
constructor() {
|
|
445
|
+
super(...arguments), this.DOM_DELTA_PIXEL = 0, this.DOM_DELTA_LINE = 1, this.DOM_DELTA_PAGE = 2;
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
K.DOM_DELTA_PIXEL = 0, K.DOM_DELTA_LINE = 1, K.DOM_DELTA_PAGE = 2;
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/events/EventBoundary.mjs
|
|
451
|
+
var q = 2048, J = new s(), Y = new s(), X = class {
|
|
452
|
+
constructor(e) {
|
|
453
|
+
this.dispatch = new a(), this.moveOnAll = !1, this.enableGlobalMoveEvents = !0, this.mappingState = { trackingData: {} }, this.eventPool = /* @__PURE__ */ new Map(), this._allInteractiveElements = [], this._hitElements = [], this._isPointerMoveEvent = !1, this.rootTarget = e, this.hitPruneFn = this.hitPruneFn.bind(this), this.hitTestFn = this.hitTestFn.bind(this), this.mapPointerDown = this.mapPointerDown.bind(this), this.mapPointerMove = this.mapPointerMove.bind(this), this.mapPointerOut = this.mapPointerOut.bind(this), this.mapPointerOver = this.mapPointerOver.bind(this), this.mapPointerUp = this.mapPointerUp.bind(this), this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this), this.mapWheel = this.mapWheel.bind(this), this.mappingTable = {}, this.addEventMapping("pointerdown", this.mapPointerDown), this.addEventMapping("pointermove", this.mapPointerMove), this.addEventMapping("pointerout", this.mapPointerOut), this.addEventMapping("pointerleave", this.mapPointerOut), this.addEventMapping("pointerover", this.mapPointerOver), this.addEventMapping("pointerup", this.mapPointerUp), this.addEventMapping("pointerupoutside", this.mapPointerUpOutside), this.addEventMapping("wheel", this.mapWheel);
|
|
454
|
+
}
|
|
455
|
+
addEventMapping(e, t) {
|
|
456
|
+
this.mappingTable[e] || (this.mappingTable[e] = []), this.mappingTable[e].push({
|
|
457
|
+
fn: t,
|
|
458
|
+
priority: 0
|
|
459
|
+
}), this.mappingTable[e].sort((e, t) => e.priority - t.priority);
|
|
460
|
+
}
|
|
461
|
+
dispatchEvent(e, t) {
|
|
462
|
+
e.propagationStopped = !1, e.propagationImmediatelyStopped = !1, this.propagate(e, t), this.dispatch.emit(t || e.type, e);
|
|
463
|
+
}
|
|
464
|
+
mapEvent(e) {
|
|
465
|
+
if (!this.rootTarget) return;
|
|
466
|
+
let t = this.mappingTable[e.type];
|
|
467
|
+
if (t) for (let n = 0, r = t.length; n < r; n++) t[n].fn(e);
|
|
468
|
+
else n(`[EventBoundary]: Event mapping not defined for ${e.type}`);
|
|
469
|
+
}
|
|
470
|
+
hitTest(e, t) {
|
|
471
|
+
U.pauseUpdate = !0;
|
|
472
|
+
let n = this._isPointerMoveEvent && this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive", r = this[n](this.rootTarget, this.rootTarget.eventMode, J.set(e, t), this.hitTestFn, this.hitPruneFn);
|
|
473
|
+
return r && r[0];
|
|
474
|
+
}
|
|
475
|
+
propagate(e, t) {
|
|
476
|
+
if (!e.target) return;
|
|
477
|
+
let n = e.composedPath();
|
|
478
|
+
e.eventPhase = e.CAPTURING_PHASE;
|
|
479
|
+
for (let r = 0, i = n.length - 1; r < i; r++) if (e.currentTarget = n[r], this.notifyTarget(e, t), e.propagationStopped || e.propagationImmediatelyStopped) return;
|
|
480
|
+
if (e.eventPhase = e.AT_TARGET, e.currentTarget = e.target, this.notifyTarget(e, t), !(e.propagationStopped || e.propagationImmediatelyStopped)) {
|
|
481
|
+
e.eventPhase = e.BUBBLING_PHASE;
|
|
482
|
+
for (let r = n.length - 2; r >= 0; r--) if (e.currentTarget = n[r], this.notifyTarget(e, t), e.propagationStopped || e.propagationImmediatelyStopped) return;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
all(e, t, n = this._allInteractiveElements) {
|
|
486
|
+
if (n.length === 0) return;
|
|
487
|
+
e.eventPhase = e.BUBBLING_PHASE;
|
|
488
|
+
let r = Array.isArray(t) ? t : [t];
|
|
489
|
+
for (let t = n.length - 1; t >= 0; t--) r.forEach((r) => {
|
|
490
|
+
e.currentTarget = n[t], this.notifyTarget(e, r);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
propagationPath(e) {
|
|
494
|
+
let t = [e];
|
|
495
|
+
for (let n = 0; n < q && e !== this.rootTarget && e.parent; n++) {
|
|
496
|
+
if (!e.parent) throw Error("Cannot find propagation path to disconnected target");
|
|
497
|
+
t.push(e.parent), e = e.parent;
|
|
498
|
+
}
|
|
499
|
+
return t.reverse(), t;
|
|
500
|
+
}
|
|
501
|
+
hitTestMoveRecursive(e, t, n, r, i, a = !1) {
|
|
502
|
+
let o = !1;
|
|
503
|
+
if (this._interactivePrune(e)) return null;
|
|
504
|
+
if ((e.eventMode === "dynamic" || t === "dynamic") && (U.pauseUpdate = !1), e.interactiveChildren && e.children) {
|
|
505
|
+
let s = e.children;
|
|
506
|
+
for (let c = s.length - 1; c >= 0; c--) {
|
|
507
|
+
let l = s[c], u = this.hitTestMoveRecursive(l, this._isInteractive(t) ? t : l.eventMode, n, r, i, a || i(e, n));
|
|
508
|
+
if (u) {
|
|
509
|
+
if (u.length > 0 && !u[u.length - 1].parent) continue;
|
|
510
|
+
let t = e.isInteractive();
|
|
511
|
+
(u.length > 0 || t) && (t && this._allInteractiveElements.push(e), u.push(e)), this._hitElements.length === 0 && (this._hitElements = u), o = !0;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
let s = this._isInteractive(t), c = e.isInteractive();
|
|
516
|
+
return c && c && this._allInteractiveElements.push(e), a || this._hitElements.length > 0 ? null : o ? this._hitElements : s && !i(e, n) && r(e, n) ? c ? [e] : [] : null;
|
|
517
|
+
}
|
|
518
|
+
hitTestRecursive(e, t, n, r, i) {
|
|
519
|
+
if (this._interactivePrune(e) || i(e, n)) return null;
|
|
520
|
+
if ((e.eventMode === "dynamic" || t === "dynamic") && (U.pauseUpdate = !1), e.interactiveChildren && e.children) {
|
|
521
|
+
let a = e.children, o = n;
|
|
522
|
+
for (let n = a.length - 1; n >= 0; n--) {
|
|
523
|
+
let s = a[n], c = this.hitTestRecursive(s, this._isInteractive(t) ? t : s.eventMode, o, r, i);
|
|
524
|
+
if (c) {
|
|
525
|
+
if (c.length > 0 && !c[c.length - 1].parent) continue;
|
|
526
|
+
let t = e.isInteractive();
|
|
527
|
+
return (c.length > 0 || t) && c.push(e), c;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
let a = this._isInteractive(t), o = e.isInteractive();
|
|
532
|
+
return a && r(e, n) ? o ? [e] : [] : null;
|
|
533
|
+
}
|
|
534
|
+
_isInteractive(e) {
|
|
535
|
+
return e === "static" || e === "dynamic";
|
|
536
|
+
}
|
|
537
|
+
_interactivePrune(e) {
|
|
538
|
+
return !e || !e.visible || !e.renderable || !e.measurable || e.eventMode === "none" || e.eventMode === "passive" && !e.interactiveChildren;
|
|
539
|
+
}
|
|
540
|
+
hitPruneFn(e, t) {
|
|
541
|
+
if (e.hitArea && (e.worldTransform.applyInverse(t, Y), !e.hitArea.contains(Y.x, Y.y))) return !0;
|
|
542
|
+
if (e.effects && e.effects.length) for (let n = 0; n < e.effects.length; n++) {
|
|
543
|
+
let r = e.effects[n];
|
|
544
|
+
if (r.containsPoint && !r.containsPoint(t, this.hitTestFn)) return !0;
|
|
545
|
+
}
|
|
546
|
+
return !1;
|
|
547
|
+
}
|
|
548
|
+
hitTestFn(e, t) {
|
|
549
|
+
return e.hitArea ? !0 : e?.containsPoint ? (e.worldTransform.applyInverse(t, Y), e.containsPoint(Y)) : !1;
|
|
550
|
+
}
|
|
551
|
+
notifyTarget(e, t) {
|
|
552
|
+
if (!e.currentTarget.isInteractive()) return;
|
|
553
|
+
t ??= e.type;
|
|
554
|
+
let n = `on${t}`;
|
|
555
|
+
e.currentTarget[n]?.(e);
|
|
556
|
+
let r = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? `${t}capture` : t;
|
|
557
|
+
this._notifyListeners(e, r), e.eventPhase === e.AT_TARGET && this._notifyListeners(e, t);
|
|
558
|
+
}
|
|
559
|
+
mapPointerDown(e) {
|
|
560
|
+
if (!(e instanceof G)) {
|
|
561
|
+
n("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
let t = this.createPointerEvent(e);
|
|
565
|
+
if (this.dispatchEvent(t, "pointerdown"), t.pointerType === "touch") this.dispatchEvent(t, "touchstart");
|
|
566
|
+
else if (t.pointerType === "mouse" || t.pointerType === "pen") {
|
|
567
|
+
let e = t.button === 2;
|
|
568
|
+
this.dispatchEvent(t, e ? "rightdown" : "mousedown");
|
|
569
|
+
}
|
|
570
|
+
let r = this.trackingData(e.pointerId);
|
|
571
|
+
r.pressTargetsByButton[e.button] = t.composedPath(), this.freeEvent(t);
|
|
572
|
+
}
|
|
573
|
+
mapPointerMove(e) {
|
|
574
|
+
if (!(e instanceof G)) {
|
|
575
|
+
n("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
this._allInteractiveElements.length = 0, this._hitElements.length = 0, this._isPointerMoveEvent = !0;
|
|
579
|
+
let t = this.createPointerEvent(e);
|
|
580
|
+
this._isPointerMoveEvent = !1;
|
|
581
|
+
let r = t.pointerType === "mouse" || t.pointerType === "pen", i = this.trackingData(e.pointerId), a = this.findMountedTarget(i.overTargets);
|
|
582
|
+
if (i.overTargets?.length > 0 && a !== t.target) {
|
|
583
|
+
let n = e.type === "mousemove" ? "mouseout" : "pointerout", i = this.createPointerEvent(e, n, a);
|
|
584
|
+
if (this.dispatchEvent(i, "pointerout"), r && this.dispatchEvent(i, "mouseout"), !t.composedPath().includes(a)) {
|
|
585
|
+
let n = this.createPointerEvent(e, "pointerleave", a);
|
|
586
|
+
for (n.eventPhase = n.AT_TARGET; n.target && !t.composedPath().includes(n.target);) n.currentTarget = n.target, this.notifyTarget(n), r && this.notifyTarget(n, "mouseleave"), n.target = n.target.parent;
|
|
587
|
+
this.freeEvent(n);
|
|
588
|
+
}
|
|
589
|
+
this.freeEvent(i);
|
|
590
|
+
}
|
|
591
|
+
if (a !== t.target) {
|
|
592
|
+
let n = e.type === "mousemove" ? "mouseover" : "pointerover", i = this.clonePointerEvent(t, n);
|
|
593
|
+
this.dispatchEvent(i, "pointerover"), r && this.dispatchEvent(i, "mouseover");
|
|
594
|
+
let o = a?.parent;
|
|
595
|
+
for (; o && o !== this.rootTarget.parent && o !== t.target;) o = o.parent;
|
|
596
|
+
if (!o || o === this.rootTarget.parent) {
|
|
597
|
+
let e = this.clonePointerEvent(t, "pointerenter");
|
|
598
|
+
for (e.eventPhase = e.AT_TARGET; e.target && e.target !== a && e.target !== this.rootTarget.parent;) e.currentTarget = e.target, this.notifyTarget(e), r && this.notifyTarget(e, "mouseenter"), e.target = e.target.parent;
|
|
599
|
+
this.freeEvent(e);
|
|
600
|
+
}
|
|
601
|
+
this.freeEvent(i);
|
|
602
|
+
}
|
|
603
|
+
let o = [], s = this.enableGlobalMoveEvents ?? !0;
|
|
604
|
+
this.moveOnAll ? o.push("pointermove") : this.dispatchEvent(t, "pointermove"), s && o.push("globalpointermove"), t.pointerType === "touch" && (this.moveOnAll ? o.splice(1, 0, "touchmove") : this.dispatchEvent(t, "touchmove"), s && o.push("globaltouchmove")), r && (this.moveOnAll ? o.splice(1, 0, "mousemove") : this.dispatchEvent(t, "mousemove"), s && o.push("globalmousemove"), this.cursor = t.target?.cursor), o.length > 0 && this.all(t, o), this._allInteractiveElements.length = 0, this._hitElements.length = 0, i.overTargets = t.composedPath(), this.freeEvent(t);
|
|
605
|
+
}
|
|
606
|
+
mapPointerOver(e) {
|
|
607
|
+
if (!(e instanceof G)) {
|
|
608
|
+
n("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
609
|
+
return;
|
|
610
|
+
}
|
|
611
|
+
let t = this.trackingData(e.pointerId), r = this.createPointerEvent(e), i = r.pointerType === "mouse" || r.pointerType === "pen";
|
|
612
|
+
this.dispatchEvent(r, "pointerover"), i && this.dispatchEvent(r, "mouseover"), r.pointerType === "mouse" && (this.cursor = r.target?.cursor);
|
|
613
|
+
let a = this.clonePointerEvent(r, "pointerenter");
|
|
614
|
+
for (a.eventPhase = a.AT_TARGET; a.target && a.target !== this.rootTarget.parent;) a.currentTarget = a.target, this.notifyTarget(a), i && this.notifyTarget(a, "mouseenter"), a.target = a.target.parent;
|
|
615
|
+
t.overTargets = r.composedPath(), this.freeEvent(r), this.freeEvent(a);
|
|
616
|
+
}
|
|
617
|
+
mapPointerOut(e) {
|
|
618
|
+
if (!(e instanceof G)) {
|
|
619
|
+
n("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
let t = this.trackingData(e.pointerId);
|
|
623
|
+
if (t.overTargets) {
|
|
624
|
+
let n = e.pointerType === "mouse" || e.pointerType === "pen", r = this.findMountedTarget(t.overTargets), i = this.createPointerEvent(e, "pointerout", r);
|
|
625
|
+
this.dispatchEvent(i), n && this.dispatchEvent(i, "mouseout");
|
|
626
|
+
let a = this.createPointerEvent(e, "pointerleave", r);
|
|
627
|
+
for (a.eventPhase = a.AT_TARGET; a.target && a.target !== this.rootTarget.parent;) a.currentTarget = a.target, this.notifyTarget(a), n && this.notifyTarget(a, "mouseleave"), a.target = a.target.parent;
|
|
628
|
+
t.overTargets = null, this.freeEvent(i), this.freeEvent(a);
|
|
629
|
+
}
|
|
630
|
+
this.cursor = null;
|
|
631
|
+
}
|
|
632
|
+
mapPointerUp(e) {
|
|
633
|
+
if (!(e instanceof G)) {
|
|
634
|
+
n("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
let t = performance.now(), r = this.createPointerEvent(e);
|
|
638
|
+
if (this.dispatchEvent(r, "pointerup"), r.pointerType === "touch") this.dispatchEvent(r, "touchend");
|
|
639
|
+
else if (r.pointerType === "mouse" || r.pointerType === "pen") {
|
|
640
|
+
let e = r.button === 2;
|
|
641
|
+
this.dispatchEvent(r, e ? "rightup" : "mouseup");
|
|
642
|
+
}
|
|
643
|
+
let i = this.trackingData(e.pointerId), a = this.findMountedTarget(i.pressTargetsByButton[e.button]), o = a;
|
|
644
|
+
if (a && !r.composedPath().includes(a)) {
|
|
645
|
+
let t = a;
|
|
646
|
+
for (; t && !r.composedPath().includes(t);) {
|
|
647
|
+
if (r.currentTarget = t, this.notifyTarget(r, "pointerupoutside"), r.pointerType === "touch") this.notifyTarget(r, "touchendoutside");
|
|
648
|
+
else if (r.pointerType === "mouse" || r.pointerType === "pen") {
|
|
649
|
+
let e = r.button === 2;
|
|
650
|
+
this.notifyTarget(r, e ? "rightupoutside" : "mouseupoutside");
|
|
651
|
+
}
|
|
652
|
+
t = t.parent;
|
|
653
|
+
}
|
|
654
|
+
delete i.pressTargetsByButton[e.button], o = t;
|
|
655
|
+
}
|
|
656
|
+
if (o) {
|
|
657
|
+
let n = this.clonePointerEvent(r, "click");
|
|
658
|
+
n.target = o, n.path = null, i.clicksByButton[e.button] || (i.clicksByButton[e.button] = {
|
|
659
|
+
clickCount: 0,
|
|
660
|
+
target: n.target,
|
|
661
|
+
timeStamp: t
|
|
662
|
+
});
|
|
663
|
+
let a = i.clicksByButton[e.button];
|
|
664
|
+
if (a.target === n.target && t - a.timeStamp < 200 ? ++a.clickCount : a.clickCount = 1, a.target = n.target, a.timeStamp = t, n.detail = a.clickCount, n.pointerType === "mouse") {
|
|
665
|
+
let e = n.button === 2;
|
|
666
|
+
this.dispatchEvent(n, e ? "rightclick" : "click");
|
|
667
|
+
} else n.pointerType === "touch" && this.dispatchEvent(n, "tap");
|
|
668
|
+
this.dispatchEvent(n, "pointertap"), this.freeEvent(n);
|
|
669
|
+
}
|
|
670
|
+
this.freeEvent(r);
|
|
671
|
+
}
|
|
672
|
+
mapPointerUpOutside(e) {
|
|
673
|
+
if (!(e instanceof G)) {
|
|
674
|
+
n("EventBoundary cannot map a non-pointer event as a pointer event");
|
|
675
|
+
return;
|
|
676
|
+
}
|
|
677
|
+
let t = this.trackingData(e.pointerId), r = this.findMountedTarget(t.pressTargetsByButton[e.button]), i = this.createPointerEvent(e);
|
|
678
|
+
if (r) {
|
|
679
|
+
let n = r;
|
|
680
|
+
for (; n;) i.currentTarget = n, this.notifyTarget(i, "pointerupoutside"), i.pointerType === "touch" ? this.notifyTarget(i, "touchendoutside") : (i.pointerType === "mouse" || i.pointerType === "pen") && this.notifyTarget(i, i.button === 2 ? "rightupoutside" : "mouseupoutside"), n = n.parent;
|
|
681
|
+
delete t.pressTargetsByButton[e.button];
|
|
682
|
+
}
|
|
683
|
+
this.freeEvent(i);
|
|
684
|
+
}
|
|
685
|
+
mapWheel(e) {
|
|
686
|
+
if (!(e instanceof K)) {
|
|
687
|
+
n("EventBoundary cannot map a non-wheel event as a wheel event");
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
let t = this.createWheelEvent(e);
|
|
691
|
+
this.dispatchEvent(t), this.freeEvent(t);
|
|
692
|
+
}
|
|
693
|
+
findMountedTarget(e) {
|
|
694
|
+
if (!e) return null;
|
|
695
|
+
let t = e[0];
|
|
696
|
+
for (let n = 1; n < e.length && e[n].parent === t; n++) t = e[n];
|
|
697
|
+
return t;
|
|
698
|
+
}
|
|
699
|
+
createPointerEvent(e, t, n) {
|
|
700
|
+
let r = this.allocateEvent(G);
|
|
701
|
+
return this.copyPointerData(e, r), this.copyMouseData(e, r), this.copyData(e, r), r.nativeEvent = e.nativeEvent, r.originalEvent = e, r.target = n ?? this.hitTest(r.global.x, r.global.y) ?? this._hitElements[0], typeof t == "string" && (r.type = t), r;
|
|
702
|
+
}
|
|
703
|
+
createWheelEvent(e) {
|
|
704
|
+
let t = this.allocateEvent(K);
|
|
705
|
+
return this.copyWheelData(e, t), this.copyMouseData(e, t), this.copyData(e, t), t.nativeEvent = e.nativeEvent, t.originalEvent = e, t.target = this.hitTest(t.global.x, t.global.y), t;
|
|
706
|
+
}
|
|
707
|
+
clonePointerEvent(e, t) {
|
|
708
|
+
let n = this.allocateEvent(G);
|
|
709
|
+
return n.nativeEvent = e.nativeEvent, n.originalEvent = e.originalEvent, this.copyPointerData(e, n), this.copyMouseData(e, n), this.copyData(e, n), n.target = e.target, n.path = e.composedPath().slice(), n.type = t ?? n.type, n;
|
|
710
|
+
}
|
|
711
|
+
copyWheelData(e, t) {
|
|
712
|
+
t.deltaMode = e.deltaMode, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ;
|
|
713
|
+
}
|
|
714
|
+
copyPointerData(e, t) {
|
|
715
|
+
e instanceof G && t instanceof G && (t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist, t.persistentDeviceId = e.persistentDeviceId);
|
|
716
|
+
}
|
|
717
|
+
copyMouseData(e, t) {
|
|
718
|
+
e instanceof W && t instanceof W && (t.altKey = e.altKey, t.button = e.button, t.buttons = e.buttons, t.client.copyFrom(e.client), t.ctrlKey = e.ctrlKey, t.metaKey = e.metaKey, t.movement.copyFrom(e.movement), t.screen.copyFrom(e.screen), t.shiftKey = e.shiftKey, t.global.copyFrom(e.global));
|
|
719
|
+
}
|
|
720
|
+
copyData(e, t) {
|
|
721
|
+
t.isTrusted = e.isTrusted, t.srcElement = e.srcElement, t.timeStamp = performance.now(), t.type = e.type, t.detail = e.detail, t.view = e.view, t.which = e.which, t.layer.copyFrom(e.layer), t.page.copyFrom(e.page);
|
|
722
|
+
}
|
|
723
|
+
trackingData(e) {
|
|
724
|
+
return this.mappingState.trackingData[e] || (this.mappingState.trackingData[e] = {
|
|
725
|
+
pressTargetsByButton: {},
|
|
726
|
+
clicksByButton: {},
|
|
727
|
+
overTarget: null
|
|
728
|
+
}), this.mappingState.trackingData[e];
|
|
729
|
+
}
|
|
730
|
+
allocateEvent(e) {
|
|
731
|
+
this.eventPool.has(e) || this.eventPool.set(e, []);
|
|
732
|
+
let t = this.eventPool.get(e).pop() || new e(this);
|
|
733
|
+
return t.eventPhase = t.NONE, t.currentTarget = null, t.defaultPrevented = !1, t.path = null, t.target = null, t;
|
|
734
|
+
}
|
|
735
|
+
freeEvent(e) {
|
|
736
|
+
if (e.manager !== this) throw Error("It is illegal to free an event not managed by this EventBoundary!");
|
|
737
|
+
let t = e.constructor;
|
|
738
|
+
this.eventPool.has(t) || this.eventPool.set(t, []), this.eventPool.get(t).push(e);
|
|
739
|
+
}
|
|
740
|
+
_notifyListeners(e, t) {
|
|
741
|
+
let n = e.currentTarget._events[t];
|
|
742
|
+
if (n) if ("fn" in n) n.once && e.currentTarget.removeListener(t, n.fn, void 0, !0), n.fn.call(n.context, e);
|
|
743
|
+
else for (let r = 0, i = n.length; r < i && !e.propagationImmediatelyStopped; r++) n[r].once && e.currentTarget.removeListener(t, n[r].fn, void 0, !0), n[r].fn.call(n[r].context, e);
|
|
744
|
+
}
|
|
745
|
+
}, Z = 1, ee = {
|
|
746
|
+
touchstart: "pointerdown",
|
|
747
|
+
touchend: "pointerup",
|
|
748
|
+
touchendoutside: "pointerupoutside",
|
|
749
|
+
touchmove: "pointermove",
|
|
750
|
+
touchcancel: "pointercancel"
|
|
751
|
+
}, Q = class e {
|
|
752
|
+
constructor(t) {
|
|
753
|
+
this.supportsTouchEvents = "ontouchstart" in globalThis, this.supportsPointerEvents = !!globalThis.PointerEvent, this.domElement = null, this.resolution = 1, this.renderer = t, this.rootBoundary = new X(null), U.init(this), this.autoPreventDefault = !0, this._eventsAdded = !1, this._rootPointerEvent = new G(null), this._rootWheelEvent = new K(null), this.cursorStyles = {
|
|
754
|
+
default: "inherit",
|
|
755
|
+
pointer: "pointer"
|
|
756
|
+
}, this.features = new Proxy({ ...e.defaultEventFeatures }, { set: (e, t, n) => (t === "globalMove" && (this.rootBoundary.enableGlobalMoveEvents = n), e[t] = n, !0) }), this._onPointerDown = this._onPointerDown.bind(this), this._onPointerMove = this._onPointerMove.bind(this), this._onPointerUp = this._onPointerUp.bind(this), this._onPointerOverOut = this._onPointerOverOut.bind(this), this.onWheel = this.onWheel.bind(this);
|
|
757
|
+
}
|
|
758
|
+
static get defaultEventMode() {
|
|
759
|
+
return this._defaultEventMode;
|
|
760
|
+
}
|
|
761
|
+
init(t) {
|
|
762
|
+
let { canvas: n, resolution: r } = this.renderer;
|
|
763
|
+
this.setTargetElement(n), this.resolution = r, e._defaultEventMode = t.eventMode ?? "passive", Object.assign(this.features, t.eventFeatures ?? {}), this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove;
|
|
764
|
+
}
|
|
765
|
+
resolutionChange(e) {
|
|
766
|
+
this.resolution = e;
|
|
767
|
+
}
|
|
768
|
+
destroy() {
|
|
769
|
+
U.destroy(), this.setTargetElement(null), this.renderer = null, this._currentCursor = null;
|
|
770
|
+
}
|
|
771
|
+
setCursor(e) {
|
|
772
|
+
e ||= "default";
|
|
773
|
+
let t = !0;
|
|
774
|
+
if (globalThis.OffscreenCanvas && this.domElement instanceof OffscreenCanvas && (t = !1), this._currentCursor === e) return;
|
|
775
|
+
this._currentCursor = e;
|
|
776
|
+
let n = this.cursorStyles[e];
|
|
777
|
+
if (n) switch (typeof n) {
|
|
778
|
+
case "string":
|
|
779
|
+
t && (this.domElement.style.cursor = n);
|
|
780
|
+
break;
|
|
781
|
+
case "function":
|
|
782
|
+
n(e);
|
|
783
|
+
break;
|
|
784
|
+
case "object":
|
|
785
|
+
t && Object.assign(this.domElement.style, n);
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
else t && typeof e == "string" && !Object.prototype.hasOwnProperty.call(this.cursorStyles, e) && (this.domElement.style.cursor = e);
|
|
789
|
+
}
|
|
790
|
+
get pointer() {
|
|
791
|
+
return this._rootPointerEvent;
|
|
792
|
+
}
|
|
793
|
+
_onPointerDown(e) {
|
|
794
|
+
if (!this.features.click) return;
|
|
795
|
+
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
|
|
796
|
+
let t = this._normalizeToPointerData(e);
|
|
797
|
+
this.autoPreventDefault && t[0].isNormalized && (e.cancelable || !("cancelable" in e)) && e.preventDefault();
|
|
798
|
+
for (let e = 0, n = t.length; e < n; e++) {
|
|
799
|
+
let n = t[e], r = this._bootstrapEvent(this._rootPointerEvent, n);
|
|
800
|
+
this.rootBoundary.mapEvent(r);
|
|
801
|
+
}
|
|
802
|
+
this.setCursor(this.rootBoundary.cursor);
|
|
803
|
+
}
|
|
804
|
+
_onPointerMove(e) {
|
|
805
|
+
if (!this.features.move) return;
|
|
806
|
+
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, U.pointerMoved();
|
|
807
|
+
let t = this._normalizeToPointerData(e);
|
|
808
|
+
for (let e = 0, n = t.length; e < n; e++) {
|
|
809
|
+
let n = this._bootstrapEvent(this._rootPointerEvent, t[e]);
|
|
810
|
+
this.rootBoundary.mapEvent(n);
|
|
811
|
+
}
|
|
812
|
+
this.setCursor(this.rootBoundary.cursor);
|
|
813
|
+
}
|
|
814
|
+
_onPointerUp(e) {
|
|
815
|
+
if (!this.features.click) return;
|
|
816
|
+
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
|
|
817
|
+
let t = e.target;
|
|
818
|
+
e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
|
|
819
|
+
let n = t === this.domElement ? "" : "outside", r = this._normalizeToPointerData(e);
|
|
820
|
+
for (let e = 0, t = r.length; e < t; e++) {
|
|
821
|
+
let t = this._bootstrapEvent(this._rootPointerEvent, r[e]);
|
|
822
|
+
t.type += n, this.rootBoundary.mapEvent(t);
|
|
823
|
+
}
|
|
824
|
+
this.setCursor(this.rootBoundary.cursor);
|
|
825
|
+
}
|
|
826
|
+
_onPointerOverOut(e) {
|
|
827
|
+
if (!this.features.click) return;
|
|
828
|
+
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
|
|
829
|
+
let t = this._normalizeToPointerData(e);
|
|
830
|
+
for (let e = 0, n = t.length; e < n; e++) {
|
|
831
|
+
let n = this._bootstrapEvent(this._rootPointerEvent, t[e]);
|
|
832
|
+
this.rootBoundary.mapEvent(n);
|
|
833
|
+
}
|
|
834
|
+
this.setCursor(this.rootBoundary.cursor);
|
|
835
|
+
}
|
|
836
|
+
onWheel(e) {
|
|
837
|
+
if (!this.features.wheel) return;
|
|
838
|
+
let t = this.normalizeWheelEvent(e);
|
|
839
|
+
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.rootBoundary.mapEvent(t);
|
|
840
|
+
}
|
|
841
|
+
setTargetElement(e) {
|
|
842
|
+
this._removeEvents(), this.domElement = e, U.domElement = e, this._addEvents();
|
|
843
|
+
}
|
|
844
|
+
_addEvents() {
|
|
845
|
+
if (this._eventsAdded || !this.domElement) return;
|
|
846
|
+
U.addTickerListener();
|
|
847
|
+
let e = this.domElement.style;
|
|
848
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : this.supportsPointerEvents && (e.touchAction = "none")), this.supportsPointerEvents ? (globalThis.document.addEventListener("pointermove", this._onPointerMove, !0), this.domElement.addEventListener("pointerdown", this._onPointerDown, !0), this.domElement.addEventListener("pointerleave", this._onPointerOverOut, !0), this.domElement.addEventListener("pointerover", this._onPointerOverOut, !0), globalThis.addEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.addEventListener("mousemove", this._onPointerMove, !0), this.domElement.addEventListener("mousedown", this._onPointerDown, !0), this.domElement.addEventListener("mouseout", this._onPointerOverOut, !0), this.domElement.addEventListener("mouseover", this._onPointerOverOut, !0), globalThis.addEventListener("mouseup", this._onPointerUp, !0), this.supportsTouchEvents && (this.domElement.addEventListener("touchstart", this._onPointerDown, !0), this.domElement.addEventListener("touchend", this._onPointerUp, !0), this.domElement.addEventListener("touchmove", this._onPointerMove, !0))), this.domElement.addEventListener("wheel", this.onWheel, {
|
|
849
|
+
passive: !0,
|
|
850
|
+
capture: !0
|
|
851
|
+
}), this._eventsAdded = !0;
|
|
852
|
+
}
|
|
853
|
+
_removeEvents() {
|
|
854
|
+
if (!this._eventsAdded || !this.domElement) return;
|
|
855
|
+
U.removeTickerListener();
|
|
856
|
+
let e = this.domElement.style;
|
|
857
|
+
e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : this.supportsPointerEvents && (e.touchAction = "")), this.supportsPointerEvents ? (globalThis.document.removeEventListener("pointermove", this._onPointerMove, !0), this.domElement.removeEventListener("pointerdown", this._onPointerDown, !0), this.domElement.removeEventListener("pointerleave", this._onPointerOverOut, !0), this.domElement.removeEventListener("pointerover", this._onPointerOverOut, !0), globalThis.removeEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.removeEventListener("mousemove", this._onPointerMove, !0), this.domElement.removeEventListener("mousedown", this._onPointerDown, !0), this.domElement.removeEventListener("mouseout", this._onPointerOverOut, !0), this.domElement.removeEventListener("mouseover", this._onPointerOverOut, !0), globalThis.removeEventListener("mouseup", this._onPointerUp, !0), this.supportsTouchEvents && (this.domElement.removeEventListener("touchstart", this._onPointerDown, !0), this.domElement.removeEventListener("touchend", this._onPointerUp, !0), this.domElement.removeEventListener("touchmove", this._onPointerMove, !0))), this.domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this._eventsAdded = !1;
|
|
858
|
+
}
|
|
859
|
+
mapPositionToPoint(e, t, n) {
|
|
860
|
+
let r = this.domElement.isConnected ? this.domElement.getBoundingClientRect() : {
|
|
861
|
+
x: 0,
|
|
862
|
+
y: 0,
|
|
863
|
+
width: this.domElement.width,
|
|
864
|
+
height: this.domElement.height,
|
|
865
|
+
left: 0,
|
|
866
|
+
top: 0
|
|
867
|
+
}, i = 1 / this.resolution;
|
|
868
|
+
e.x = (t - r.left) * (this.domElement.width / r.width) * i, e.y = (n - r.top) * (this.domElement.height / r.height) * i;
|
|
869
|
+
}
|
|
870
|
+
_normalizeToPointerData(e) {
|
|
871
|
+
let t = [];
|
|
872
|
+
if (this.supportsTouchEvents && e instanceof TouchEvent) for (let n = 0, r = e.changedTouches.length; n < r; n++) {
|
|
873
|
+
let r = e.changedTouches[n];
|
|
874
|
+
r.button === void 0 && (r.button = 0), r.buttons === void 0 && (r.buttons = 1), r.isPrimary === void 0 && (r.isPrimary = e.touches.length === 1 && e.type === "touchstart"), r.width === void 0 && (r.width = r.radiusX || 1), r.height === void 0 && (r.height = r.radiusY || 1), r.tiltX === void 0 && (r.tiltX = 0), r.tiltY === void 0 && (r.tiltY = 0), r.pointerType === void 0 && (r.pointerType = "touch"), r.pointerId === void 0 && (r.pointerId = r.identifier || 0), r.pressure === void 0 && (r.pressure = r.force || .5), r.twist === void 0 && (r.twist = 0), r.tangentialPressure === void 0 && (r.tangentialPressure = 0), r.layerX === void 0 && (r.layerX = r.offsetX = r.clientX), r.layerY === void 0 && (r.layerY = r.offsetY = r.clientY), r.isNormalized = !0, r.type = e.type, r.altKey ??= e.altKey, r.ctrlKey ??= e.ctrlKey, r.metaKey ??= e.metaKey, r.shiftKey ??= e.shiftKey, t.push(r);
|
|
875
|
+
}
|
|
876
|
+
else if (!globalThis.MouseEvent || e instanceof MouseEvent && (!this.supportsPointerEvents || !(e instanceof globalThis.PointerEvent))) {
|
|
877
|
+
let n = e;
|
|
878
|
+
n.isPrimary === void 0 && (n.isPrimary = !0), n.width === void 0 && (n.width = 1), n.height === void 0 && (n.height = 1), n.tiltX === void 0 && (n.tiltX = 0), n.tiltY === void 0 && (n.tiltY = 0), n.pointerType === void 0 && (n.pointerType = "mouse"), n.pointerId === void 0 && (n.pointerId = Z), n.pressure === void 0 && (n.pressure = .5), n.twist === void 0 && (n.twist = 0), n.tangentialPressure === void 0 && (n.tangentialPressure = 0), n.isNormalized = !0, t.push(n);
|
|
879
|
+
} else t.push(e);
|
|
880
|
+
return t;
|
|
881
|
+
}
|
|
882
|
+
normalizeWheelEvent(e) {
|
|
883
|
+
let t = this._rootWheelEvent;
|
|
884
|
+
return this._transferMouseData(t, e), t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.copyFrom(t.screen), t.offset.copyFrom(t.screen), t.nativeEvent = e, t.type = e.type, t;
|
|
885
|
+
}
|
|
886
|
+
_bootstrapEvent(e, t) {
|
|
887
|
+
return e.originalEvent = null, e.nativeEvent = t, e.pointerId = t.pointerId, e.width = t.width, e.height = t.height, e.isPrimary = t.isPrimary, e.pointerType = t.pointerType, e.pressure = t.pressure, e.tangentialPressure = t.tangentialPressure, e.tiltX = t.tiltX, e.tiltY = t.tiltY, e.twist = t.twist, this._transferMouseData(e, t), this.mapPositionToPoint(e.screen, t.clientX, t.clientY), e.global.copyFrom(e.screen), e.offset.copyFrom(e.screen), e.isTrusted = t.isTrusted, e.type === "pointerleave" && (e.type = "pointerout"), e.type.startsWith("mouse") && (e.type = e.type.replace("mouse", "pointer")), e.type.startsWith("touch") && (e.type = ee[e.type] || e.type), e;
|
|
888
|
+
}
|
|
889
|
+
_transferMouseData(e, t) {
|
|
890
|
+
e.isTrusted = t.isTrusted, e.srcElement = t.srcElement, e.timeStamp = performance.now(), e.type = t.type, e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
Q.extension = {
|
|
894
|
+
name: "events",
|
|
895
|
+
type: [
|
|
896
|
+
o.WebGLSystem,
|
|
897
|
+
o.CanvasSystem,
|
|
898
|
+
o.WebGPUSystem
|
|
899
|
+
],
|
|
900
|
+
priority: -1
|
|
901
|
+
}, Q.defaultEventFeatures = {
|
|
902
|
+
move: !0,
|
|
903
|
+
globalMove: !0,
|
|
904
|
+
click: !0,
|
|
905
|
+
wheel: !0
|
|
906
|
+
};
|
|
907
|
+
var $ = Q;
|
|
908
|
+
i.add(B), i.mixin(e, V), i.add(H), i.add($), i.mixin(e, {
|
|
909
|
+
onclick: null,
|
|
910
|
+
onmousedown: null,
|
|
911
|
+
onmouseenter: null,
|
|
912
|
+
onmouseleave: null,
|
|
913
|
+
onmousemove: null,
|
|
914
|
+
onglobalmousemove: null,
|
|
915
|
+
onmouseout: null,
|
|
916
|
+
onmouseover: null,
|
|
917
|
+
onmouseup: null,
|
|
918
|
+
onmouseupoutside: null,
|
|
919
|
+
onpointercancel: null,
|
|
920
|
+
onpointerdown: null,
|
|
921
|
+
onpointerenter: null,
|
|
922
|
+
onpointerleave: null,
|
|
923
|
+
onpointermove: null,
|
|
924
|
+
onglobalpointermove: null,
|
|
925
|
+
onpointerout: null,
|
|
926
|
+
onpointerover: null,
|
|
927
|
+
onpointertap: null,
|
|
928
|
+
onpointerup: null,
|
|
929
|
+
onpointerupoutside: null,
|
|
930
|
+
onrightclick: null,
|
|
931
|
+
onrightdown: null,
|
|
932
|
+
onrightup: null,
|
|
933
|
+
onrightupoutside: null,
|
|
934
|
+
ontap: null,
|
|
935
|
+
ontouchcancel: null,
|
|
936
|
+
ontouchend: null,
|
|
937
|
+
ontouchendoutside: null,
|
|
938
|
+
ontouchmove: null,
|
|
939
|
+
onglobaltouchmove: null,
|
|
940
|
+
ontouchstart: null,
|
|
941
|
+
onwheel: null,
|
|
942
|
+
get interactive() {
|
|
943
|
+
return this.eventMode === "dynamic" || this.eventMode === "static";
|
|
944
|
+
},
|
|
945
|
+
set interactive(e) {
|
|
946
|
+
this.eventMode = e ? "static" : "passive";
|
|
947
|
+
},
|
|
948
|
+
_internalEventMode: void 0,
|
|
949
|
+
get eventMode() {
|
|
950
|
+
return this._internalEventMode ?? $.defaultEventMode;
|
|
951
|
+
},
|
|
952
|
+
set eventMode(e) {
|
|
953
|
+
this._internalEventMode = e;
|
|
954
|
+
},
|
|
955
|
+
isInteractive() {
|
|
956
|
+
return this.eventMode === "static" || this.eventMode === "dynamic";
|
|
957
|
+
},
|
|
958
|
+
interactiveChildren: !0,
|
|
959
|
+
hitArea: null,
|
|
960
|
+
addEventListener(e, t, n) {
|
|
961
|
+
let r = typeof n == "boolean" && n || typeof n == "object" && n.capture, i = typeof n == "object" ? n.signal : void 0, a = typeof n == "object" && n.once === !0, o = typeof t == "function" ? void 0 : t;
|
|
962
|
+
e = r ? `${e}capture` : e;
|
|
963
|
+
let s = typeof t == "function" ? t : t.handleEvent, c = this;
|
|
964
|
+
i && i.addEventListener("abort", () => {
|
|
965
|
+
c.off(e, s, o);
|
|
966
|
+
}), a ? c.once(e, s, o) : c.on(e, s, o);
|
|
967
|
+
},
|
|
968
|
+
removeEventListener(e, t, n) {
|
|
969
|
+
let r = typeof n == "boolean" && n || typeof n == "object" && n.capture, i = typeof t == "function" ? void 0 : t;
|
|
970
|
+
e = r ? `${e}capture` : e, t = typeof t == "function" ? t : t.handleEvent, this.off(e, t, i);
|
|
971
|
+
},
|
|
972
|
+
dispatchEvent(e) {
|
|
973
|
+
if (!(e instanceof u)) throw Error("Container cannot propagate events outside of the Federated Events API");
|
|
974
|
+
return e.defaultPrevented = !1, e.path = null, e.target = this, e.manager.dispatchEvent(e), !e.defaultPrevented;
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
//#endregion
|