@eva/plugin-worker 2.0.1-beta.2 → 2.0.1-beta.21
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.
|
@@ -1109,9 +1109,10 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1109
1109
|
nativeEvent.preventDefault();
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
|
+
const nEvent = nativeEvent;
|
|
1112
1113
|
for (let i = 0, j = events.length; i < j; i++) {
|
|
1113
1114
|
const nativeEvent = events[i];
|
|
1114
|
-
const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent);
|
|
1115
|
+
const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent, nEvent);
|
|
1115
1116
|
this.rootBoundary.mapEvent(federatedEvent);
|
|
1116
1117
|
}
|
|
1117
1118
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1122,7 +1123,7 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1122
1123
|
EventsTicker.pointerMoved();
|
|
1123
1124
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1124
1125
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1125
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1126
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1126
1127
|
this.rootBoundary.mapEvent(event);
|
|
1127
1128
|
}
|
|
1128
1129
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1133,7 +1134,7 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1133
1134
|
const outside = '';
|
|
1134
1135
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1135
1136
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1136
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1137
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1137
1138
|
event.type += outside;
|
|
1138
1139
|
this.rootBoundary.mapEvent(event);
|
|
1139
1140
|
}
|
|
@@ -1144,7 +1145,7 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1144
1145
|
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
|
|
1145
1146
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1146
1147
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1147
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1148
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1148
1149
|
this.rootBoundary.mapEvent(event);
|
|
1149
1150
|
}
|
|
1150
1151
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1175,7 +1176,14 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1175
1176
|
style.touchAction = 'none';
|
|
1176
1177
|
}
|
|
1177
1178
|
}
|
|
1178
|
-
|
|
1179
|
+
let id = '0';
|
|
1180
|
+
for (const key in EventSystem.canvasMap) {
|
|
1181
|
+
const domElement = EventSystem.canvasMap[key];
|
|
1182
|
+
if (domElement === this.domElement) {
|
|
1183
|
+
id = key;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
EventSystem.eventsHandler[id] = {
|
|
1179
1187
|
pointermove: this._onPointerMove.bind(this),
|
|
1180
1188
|
pointerdown: this._onPointerDown.bind(this),
|
|
1181
1189
|
pointerleave: this._onPointerOverOut.bind(this),
|
|
@@ -1190,7 +1198,7 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1190
1198
|
touchend: this._onPointerUp.bind(this),
|
|
1191
1199
|
touchmove: this._onPointerMove.bind(this)
|
|
1192
1200
|
};
|
|
1193
|
-
EventSystem.eventsHandler['wheel'] = this.onWheel.bind(this);
|
|
1201
|
+
EventSystem.eventsHandler[id]['wheel'] = this.onWheel.bind(this);
|
|
1194
1202
|
this._eventsAdded = true;
|
|
1195
1203
|
}
|
|
1196
1204
|
_removeEvents() {
|
|
@@ -1207,12 +1215,12 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1207
1215
|
style.touchAction = '';
|
|
1208
1216
|
}
|
|
1209
1217
|
}
|
|
1210
|
-
EventSystem.eventsHandler = [];
|
|
1211
1218
|
this.domElement = null;
|
|
1212
1219
|
this._eventsAdded = false;
|
|
1213
1220
|
}
|
|
1214
|
-
mapPositionToPoint(point, x, y) {
|
|
1215
|
-
const
|
|
1221
|
+
mapPositionToPoint(point, x, y, e) {
|
|
1222
|
+
const resolutionMultiplier = 1.0 / this.resolution;
|
|
1223
|
+
const rect = e.canvasRect || {
|
|
1216
1224
|
x: 0,
|
|
1217
1225
|
y: 0,
|
|
1218
1226
|
width: this.domElement.width,
|
|
@@ -1220,9 +1228,9 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1220
1228
|
left: 0,
|
|
1221
1229
|
top: 0
|
|
1222
1230
|
};
|
|
1223
|
-
const
|
|
1224
|
-
point.x = (x - rect.left) * (
|
|
1225
|
-
point.y = (y - rect.top) * (
|
|
1231
|
+
const domElement = e.domElement || this.domElement;
|
|
1232
|
+
point.x = (x - rect.left) * (domElement.width / rect.width) * resolutionMultiplier;
|
|
1233
|
+
point.y = (y - rect.top) * (domElement.height / rect.height) * resolutionMultiplier;
|
|
1226
1234
|
}
|
|
1227
1235
|
_normalizeToPointerData(event) {
|
|
1228
1236
|
return event.normalizedEvents;
|
|
@@ -1234,14 +1242,14 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1234
1242
|
event.deltaY = nativeEvent.deltaY;
|
|
1235
1243
|
event.deltaZ = nativeEvent.deltaZ;
|
|
1236
1244
|
event.deltaMode = nativeEvent.deltaMode;
|
|
1237
|
-
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
|
|
1245
|
+
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY, nativeEvent);
|
|
1238
1246
|
event.global.copyFrom(event.screen);
|
|
1239
1247
|
event.offset.copyFrom(event.screen);
|
|
1240
1248
|
event.nativeEvent = nativeEvent;
|
|
1241
1249
|
event.type = nativeEvent.type;
|
|
1242
1250
|
return event;
|
|
1243
1251
|
}
|
|
1244
|
-
_bootstrapEvent(event, nativeEvent) {
|
|
1252
|
+
_bootstrapEvent(event, nativeEvent, nEvent) {
|
|
1245
1253
|
event.originalEvent = null;
|
|
1246
1254
|
event.nativeEvent = nativeEvent;
|
|
1247
1255
|
event.pointerId = nativeEvent.pointerId;
|
|
@@ -1255,7 +1263,7 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1255
1263
|
event.tiltY = nativeEvent.tiltY;
|
|
1256
1264
|
event.twist = nativeEvent.twist;
|
|
1257
1265
|
this._transferMouseData(event, nativeEvent);
|
|
1258
|
-
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
|
|
1266
|
+
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY, nEvent);
|
|
1259
1267
|
event.global.copyFrom(event.screen);
|
|
1260
1268
|
event.offset.copyFrom(event.screen);
|
|
1261
1269
|
event.isTrusted = nativeEvent.isTrusted;
|
|
@@ -1295,6 +1303,7 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1295
1303
|
type: [pixi_js.ExtensionType.WebGLSystem, pixi_js.ExtensionType.CanvasSystem, pixi_js.ExtensionType.WebGPUSystem],
|
|
1296
1304
|
priority: -1
|
|
1297
1305
|
};
|
|
1306
|
+
EventSystem.canvasMap = {};
|
|
1298
1307
|
EventSystem.eventsHandler = {};
|
|
1299
1308
|
EventSystem.defaultEventFeatures = {
|
|
1300
1309
|
move: true,
|
|
@@ -1400,8 +1409,17 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1400
1409
|
const eventHandler = data => {
|
|
1401
1410
|
const {
|
|
1402
1411
|
type,
|
|
1403
|
-
events
|
|
1412
|
+
events,
|
|
1413
|
+
canvasRect,
|
|
1414
|
+
domElement,
|
|
1415
|
+
id
|
|
1404
1416
|
} = data;
|
|
1417
|
+
if (type === 'eva-init') {
|
|
1418
|
+
const {
|
|
1419
|
+
canvasMap
|
|
1420
|
+
} = data;
|
|
1421
|
+
EventSystem.canvasMap = canvasMap;
|
|
1422
|
+
}
|
|
1405
1423
|
if (type === 'eva-events') {
|
|
1406
1424
|
for (const res of events) {
|
|
1407
1425
|
const {
|
|
@@ -1409,10 +1427,12 @@ var _EVA_IIFE_worker = function (exports, pixi_js) {
|
|
|
1409
1427
|
event,
|
|
1410
1428
|
normalizedEvents
|
|
1411
1429
|
} = res;
|
|
1412
|
-
const fn = EventSystem.eventsHandler[eventName];
|
|
1430
|
+
const fn = EventSystem.eventsHandler[id][eventName];
|
|
1413
1431
|
fn && fn(_extends(_extends({}, event), {
|
|
1414
1432
|
preventDefault() {},
|
|
1415
|
-
normalizedEvents
|
|
1433
|
+
normalizedEvents,
|
|
1434
|
+
canvasRect,
|
|
1435
|
+
domElement
|
|
1416
1436
|
}));
|
|
1417
1437
|
}
|
|
1418
1438
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},_extends.apply(null,arguments)}globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{};var _EVA_IIFE_worker=function(t,e){"use strict";var n,i,o=(n=function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(t,e,i,r,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,r||t,s),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,o=[];if(0===this._eventsCount)return o;for(i in t=this._events)e.call(t,i)&&o.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,r=i.length,s=new Array(r);o<r;o++)s[o]=i[o].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,o,r,s){var a=n?n+t:t;if(!this._events[a])return!1;var h,l,p=this._events[a],c=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),c){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,i),!0;case 4:return p.fn.call(p.context,e,i,o),!0;case 5:return p.fn.call(p.context,e,i,o,r),!0;case 6:return p.fn.call(p.context,e,i,o,r,s),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];p.fn.apply(p.context,h)}else{var u,v=p.length;for(l=0;l<v;l++)switch(p[l].once&&this.removeListener(t,p[l].fn,void 0,!0),c){case 1:p[l].fn.call(p[l].context);break;case 2:p[l].fn.call(p[l].context,e);break;case 3:p[l].fn.call(p[l].context,e,i);break;case 4:p[l].fn.call(p[l].context,e,i,o);break;default:if(!h)for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];p[l].fn.apply(p[l].context,h)}}return!0},a.prototype.on=function(t,e,n){return r(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return r(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,o){var r=n?n+t:t;if(!this._events[r])return this;if(!e)return s(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||o&&!a.once||i&&a.context!==i||s(this,r);else{for(var h=0,l=[],p=a.length;h<p;h++)(a[h].fn!==e||o&&!a[h].once||i&&a[h].context!==i)&&l.push(a[h]);l.length?this._events[r]=1===l.length?l[0]:l:s(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a},n(i={exports:{}},i.exports),i.exports),r=o;const s=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){!this._tickerAdded&&this.domElement&&(e.Ticker.system.add(this._tickerUpdate,this,e.UPDATE_PRIORITY.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(e.Ticker.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())}};class a{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=a.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new e.Point,this.page=new e.Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,n){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,n,i,o){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class h extends a{constructor(){super(...arguments),this.client=new e.Point,this.movement=new e.Point,this.offset=new e.Point,this.global=new e.Point,this.screen=new e.Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,n){return t.worldTransform.applyInverse(n||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,n,i,o,r,s,a,h,l,p,c,u,v,d){throw new Error("Method not implemented.")}}class l extends h{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class p extends h{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}p.DOM_DELTA_PIXEL=0,p.DOM_DELTA_LINE=1,p.DOM_DELTA_PAGE=2;const c=new e.Point,u=new e.Point;class v{constructor(t){this.dispatch=new r,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,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)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const n=this.mappingTable[t.type];if(n)for(let e=0,i=n.length;e<i;e++)n[e].fn(t);else e.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){s.pauseUpdate=!0;const n=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,c.set(t,e),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(t,e){if(!t.target)return;const n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,o=n.length-1;i<o;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=n.length-2;i>=0;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,n=this._allInteractiveElements){if(0===n.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=n.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=n[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,n,i,o,r=!1){let a=!1;if(this._interactivePrune(t))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(s.pauseUpdate=!1),t.interactiveChildren&&t.children){const s=t.children;for(let h=s.length-1;h>=0;h--){const l=s[h],p=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,n,i,o,r||o(t,n));if(p){if(p.length>0&&!p[p.length-1].parent)continue;const e=t.isInteractive();(p.length>0||e)&&(e&&this._allInteractiveElements.push(t),p.push(t)),0===this._hitElements.length&&(this._hitElements=p),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),r||this._hitElements.length>0?null:a?this._hitElements:h&&!o(t,n)&&i(t,n)?l?[t]:[]:null}hitTestRecursive(t,e,n,i,o){if(this._interactivePrune(t)||o(t,n))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(s.pauseUpdate=!1),t.interactiveChildren&&t.children){const r=t.children,s=n;for(let n=r.length-1;n>=0;n--){const a=r[n],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,s,i,o);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const r=this._isInteractive(e),a=t.isInteractive();return r&&i(t,n)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&t.visible&&t.renderable&&t.measurable)||("none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,u),!t.hitArea.contains(u.x,u.y)))return!0;if(t.effects&&t.effects.length)for(let n=0;n<t.effects.length;n++){const i=t.effects[n];if(i.containsPoint){if(!i.containsPoint(e,this.hitTestFn))return!0}}return!1}hitTestFn(t,e){var n;return!!t.hitArea||!!(null===(n=t)||void 0===n?void 0:n.containsPoint)&&(t.worldTransform.applyInverse(e,u),t.containsPoint(u))}notifyTarget(t,e){var n;if(!t.currentTarget.isInteractive())return;const i=`on${e=null!=e?e:t.type}`;null===(n=t.currentTarget[i])||void 0===n||n(t);const o=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,o),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t);if(this.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)this.dispatchEvent(n,"touchstart");else if("mouse"===n.pointerType||"pen"===n.pointerType){const t=2===n.button;this.dispatchEvent(n,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),this.freeEvent(n)}mapPointerMove(t){var n,i,o;if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s="mouse"===r.pointerType||"pen"===r.pointerType,a=this.trackingData(t.pointerId),h=this.findMountedTarget(a.overTargets);if((null===(n=a.overTargets)||void 0===n?void 0:n.length)>0&&h!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,e,h);if(this.dispatchEvent(n,"pointerout"),s&&this.dispatchEvent(n,"mouseout"),!r.composedPath().includes(h)){const e=this.createPointerEvent(t,"pointerleave",h);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(n)}if(h!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(r,e);this.dispatchEvent(n,"pointerover"),s&&this.dispatchEvent(n,"mouseover");let i=null==h?void 0:h.parent;for(;i&&i!==this.rootTarget.parent&&i!==r.target;)i=i.parent;if(!i||i===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==h&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const p=[],c=null===(i=this.enableGlobalMoveEvents)||void 0===i||i;this.moveOnAll?p.push("pointermove"):this.dispatchEvent(r,"pointermove"),c&&p.push("globalpointermove"),"touch"===r.pointerType&&(this.moveOnAll?p.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),c&&p.push("globaltouchmove")),s&&(this.moveOnAll?p.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),c&&p.push("globalmousemove"),this.cursor=null===(o=r.target)||void 0===o?void 0:o.cursor),p.length>0&&this.all(r,p),this._allInteractiveElements.length=0,this._hitElements.length=0,a.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(t){var n;if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),o=this.createPointerEvent(t),r="mouse"===o.pointerType||"pen"===o.pointerType;this.dispatchEvent(o,"pointerover"),r&&this.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(this.cursor=null===(n=o.target)||void 0===n?void 0:n.cursor);const s=this.clonePointerEvent(o,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;i.overTargets=o.composedPath(),this.freeEvent(o),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId);if(n.overTargets){const e="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(n.overTargets),o=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(o),e&&this.dispatchEvent(o,"mouseout");const r=this.createPointerEvent(t,"pointerleave",i);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;n.overTargets=null,this.freeEvent(o),this.freeEvent(r)}this.cursor=null}mapPointerUp(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)this.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightup":"mouseup")}const o=this.trackingData(t.pointerId),r=this.findMountedTarget(o.pressTargetsByButton[t.button]);let s=r;if(r&&!i.composedPath().includes(r)){let e=r;for(;e&&!i.composedPath().includes(e);){if(i.currentTarget=e,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)this.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.notifyTarget(i,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete o.pressTargetsByButton[t.button],s=e}if(s){const e=this.clonePointerEvent(i,"click");e.target=s,e.path=null,o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:n});const r=o.clicksByButton[t.button];if(r.target===e.target&&n-r.timeStamp<200?++r.clickCount:r.clickCount=1,r.target=e.target,r.timeStamp=n,e.detail=r.clickCount,"mouse"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightclick":"click")}else"touch"===e.pointerType&&this.dispatchEvent(e,"tap");this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(i)}mapPointerUpOutside(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),i=this.findMountedTarget(n.pressTargetsByButton[t.button]),o=this.createPointerEvent(t);if(i){let e=i;for(;e;)o.currentTarget=e,this.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType?this.notifyTarget(o,"touchendoutside"):"mouse"!==o.pointerType&&"pen"!==o.pointerType||this.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete n.pressTargetsByButton[t.button]}this.freeEvent(o)}mapWheel(t){if(!(t instanceof p))return void e.warn("EventBoundary cannot map a non-wheel event as a wheel event");const n=this.createWheelEvent(t);this.dispatchEvent(n),this.freeEvent(n)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}createPointerEvent(t,e,n){var i;const o=this.allocateEvent(l);return this.copyPointerData(t,o),this.copyMouseData(t,o),this.copyData(t,o),o.nativeEvent=t.nativeEvent,o.originalEvent=t,o.target=null!==(i=null!=n?n:this.hitTest(o.global.x,o.global.y))&&void 0!==i?i:this._hitElements[0],"string"==typeof e&&(o.type=e),o}createWheelEvent(t){const e=this.allocateEvent(p);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const n=this.allocateEvent(l);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof l&&e instanceof l&&(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)}copyMouseData(t,e){t instanceof h&&e instanceof h&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){const n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeListener(e,n.fn,void 0,!0),n.fn.call(n.context,t);else for(let i=0,o=n.length;i<o&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeListener(e,n[i].fn,void 0,!0),n[i].fn.call(n[i].context,t)}}const d={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class m{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new v(null),s.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new l(null),this._rootWheelEvent=new p(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy(_extends({},m.defaultEventFeatures),{set:(t,e,n)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=n),t[e]=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)}static get defaultEventMode(){return this._defaultEventMode}init(t){var e,n;const{canvas:i,resolution:o}=this.renderer;this.setTargetElement(i),this.resolution=o,m._defaultEventMode=null!==(e=t.eventMode)&&void 0!==e?e:"passive",_extends(this.features,null!==(n=t.eventFeatures)&&void 0!==n?n:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;const n=this.cursorStyles[t];if(n)switch(typeof n){case"string":e&&(this.domElement.style.cursor=n);break;case"function":n(t);break;case"object":e&&_extends(this.domElement.style,n)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,n=e.length;t<n;t++){const n=e[t],i=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,s.pointerMoved();const e=this._normalizeToPointerData(t);for(let t=0,n=e.length;t<n;t++){const n=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let t=0,n=e.length;t<n;t++){const n=this._bootstrapEvent(this._rootPointerEvent,e[t]);n.type+="",this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let t=0,n=e.length;t<n;t++){const n=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,s.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;s.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),m.eventsHandler={pointermove:this._onPointerMove.bind(this),pointerdown:this._onPointerDown.bind(this),pointerleave:this._onPointerOverOut.bind(this),pointerover:this._onPointerOverOut.bind(this),pointerup:this._onPointerUp.bind(this),mousemove:this._onPointerMove.bind(this),mousedown:this._onPointerDown.bind(this),mouseout:this._onPointerOverOut.bind(this),mouseover:this._onPointerOverOut.bind(this),mouseup:this._onPointerUp.bind(this),touchstart:this._onPointerDown.bind(this),touchend:this._onPointerUp.bind(this),touchmove:this._onPointerMove.bind(this)},m.eventsHandler.wheel=this.onWheel.bind(this),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;s.removeTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),m.eventsHandler=[],this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,n){const i=globalThis.$canvasRect?globalThis.$canvasRect:this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},o=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*o,t.y=(n-i.top)*(this.domElement.height/i.height)*o}_normalizeToPointerData(t){return t.normalizedEvents}normalizeWheelEvent(t){const e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,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,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=d[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}}m.extension={name:"events",type:[e.ExtensionType.WebGLSystem,e.ExtensionType.CanvasSystem,e.ExtensionType.WebGPUSystem],priority:-1},m.eventsHandler={},m.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};const g={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return"dynamic"===this.eventMode||"static"===this.eventMode},set interactive(t){this.eventMode=t?"static":"passive"},_internalEventMode:void 0,get eventMode(){var t;return null!==(t=this._internalEventMode)&&void 0!==t?t:m.defaultEventMode},set eventMode(t){this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,n){const i="boolean"==typeof n&&n||"object"==typeof n&&n.capture,o="object"==typeof n?n.signal:void 0,r="object"==typeof n&&!0===n.once,s="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;o&&o.addEventListener("abort",(()=>{h.off(t,a,s)})),r?h.once(t,a,s):h.on(t,a,s)},removeEventListener(t,e,n){const i="function"==typeof e?void 0:e;t="boolean"==typeof n&&n||"object"==typeof n&&n.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof a))throw new Error("Container cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};return e.extensions.add(m),e.extensions.mixin(e.Container,g),e.DOMAdapter.set(e.WebWorkerAdapter),t.eventHandler=t=>{const{type:e,events:n}=t;if("eva-events"===e)for(const t of n){const{eventName:e,event:n,normalizedEvents:i}=t,o=m.eventsHandler[e];o&&o(_extends(_extends({},n),{preventDefault(){},normalizedEvents:i}))}},Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI);globalThis.EVA.plugin.worker=globalThis.EVA.plugin.worker||_EVA_IIFE_worker;
|
|
1
|
+
function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},_extends.apply(null,arguments)}globalThis.EVA=globalThis.EVA||{},globalThis.EVA.plugin=globalThis.EVA.plugin||{};var _EVA_IIFE_worker=function(t,e){"use strict";var n,i,o=(n=function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(t,e,i,r,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,r||t,s),h=n?n+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,o=[];if(0===this._eventsCount)return o;for(i in t=this._events)e.call(t,i)&&o.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,r=i.length,s=new Array(r);o<r;o++)s[o]=i[o].fn;return s},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,o,r,s){var a=n?n+t:t;if(!this._events[a])return!1;var h,l,p=this._events[a],c=arguments.length;if(p.fn){switch(p.once&&this.removeListener(t,p.fn,void 0,!0),c){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,e),!0;case 3:return p.fn.call(p.context,e,i),!0;case 4:return p.fn.call(p.context,e,i,o),!0;case 5:return p.fn.call(p.context,e,i,o,r),!0;case 6:return p.fn.call(p.context,e,i,o,r,s),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];p.fn.apply(p.context,h)}else{var u,v=p.length;for(l=0;l<v;l++)switch(p[l].once&&this.removeListener(t,p[l].fn,void 0,!0),c){case 1:p[l].fn.call(p[l].context);break;case 2:p[l].fn.call(p[l].context,e);break;case 3:p[l].fn.call(p[l].context,e,i);break;case 4:p[l].fn.call(p[l].context,e,i,o);break;default:if(!h)for(u=1,h=new Array(c-1);u<c;u++)h[u-1]=arguments[u];p[l].fn.apply(p[l].context,h)}}return!0},a.prototype.on=function(t,e,n){return r(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return r(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,o){var r=n?n+t:t;if(!this._events[r])return this;if(!e)return s(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||o&&!a.once||i&&a.context!==i||s(this,r);else{for(var h=0,l=[],p=a.length;h<p;h++)(a[h].fn!==e||o&&!a[h].once||i&&a[h].context!==i)&&l.push(a[h]);l.length?this._events[r]=1===l.length?l[0]:l:s(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&s(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a},n(i={exports:{}},i.exports),i.exports),r=o;const s=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){!this._tickerAdded&&this.domElement&&(e.Ticker.system.add(this._tickerUpdate,this,e.UPDATE_PRIORITY.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(e.Ticker.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())}};class a{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=a.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new e.Point,this.page=new e.Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,n){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,n,i,o){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class h extends a{constructor(){super(...arguments),this.client=new e.Point,this.movement=new e.Point,this.offset=new e.Point,this.global=new e.Point,this.screen=new e.Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,n){return t.worldTransform.applyInverse(n||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,n,i,o,r,s,a,h,l,p,c,u,v,d){throw new Error("Method not implemented.")}}class l extends h{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class p extends h{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}p.DOM_DELTA_PIXEL=0,p.DOM_DELTA_LINE=1,p.DOM_DELTA_PAGE=2;const c=new e.Point,u=new e.Point;class v{constructor(t){this.dispatch=new r,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,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)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const n=this.mappingTable[t.type];if(n)for(let e=0,i=n.length;e<i;e++)n[e].fn(t);else e.warn(`[EventBoundary]: Event mapping not defined for ${t.type}`)}hitTest(t,e){s.pauseUpdate=!0;const n=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,c.set(t,e),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(t,e){if(!t.target)return;const n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,o=n.length-1;i<o;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=n.length-2;i>=0;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,n=this._allInteractiveElements){if(0===n.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=n.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=n[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,n,i,o,r=!1){let a=!1;if(this._interactivePrune(t))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(s.pauseUpdate=!1),t.interactiveChildren&&t.children){const s=t.children;for(let h=s.length-1;h>=0;h--){const l=s[h],p=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,n,i,o,r||o(t,n));if(p){if(p.length>0&&!p[p.length-1].parent)continue;const e=t.isInteractive();(p.length>0||e)&&(e&&this._allInteractiveElements.push(t),p.push(t)),0===this._hitElements.length&&(this._hitElements=p),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),r||this._hitElements.length>0?null:a?this._hitElements:h&&!o(t,n)&&i(t,n)?l?[t]:[]:null}hitTestRecursive(t,e,n,i,o){if(this._interactivePrune(t)||o(t,n))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(s.pauseUpdate=!1),t.interactiveChildren&&t.children){const r=t.children,s=n;for(let n=r.length-1;n>=0;n--){const a=r[n],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,s,i,o);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const r=this._isInteractive(e),a=t.isInteractive();return r&&i(t,n)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&t.visible&&t.renderable&&t.measurable)||("none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,u),!t.hitArea.contains(u.x,u.y)))return!0;if(t.effects&&t.effects.length)for(let n=0;n<t.effects.length;n++){const i=t.effects[n];if(i.containsPoint){if(!i.containsPoint(e,this.hitTestFn))return!0}}return!1}hitTestFn(t,e){var n;return!!t.hitArea||!!(null===(n=t)||void 0===n?void 0:n.containsPoint)&&(t.worldTransform.applyInverse(e,u),t.containsPoint(u))}notifyTarget(t,e){var n;if(!t.currentTarget.isInteractive())return;const i=`on${e=null!=e?e:t.type}`;null===(n=t.currentTarget[i])||void 0===n||n(t);const o=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,o),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t);if(this.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)this.dispatchEvent(n,"touchstart");else if("mouse"===n.pointerType||"pen"===n.pointerType){const t=2===n.button;this.dispatchEvent(n,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),this.freeEvent(n)}mapPointerMove(t){var n,i,o;if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const s="mouse"===r.pointerType||"pen"===r.pointerType,a=this.trackingData(t.pointerId),h=this.findMountedTarget(a.overTargets);if((null===(n=a.overTargets)||void 0===n?void 0:n.length)>0&&h!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",n=this.createPointerEvent(t,e,h);if(this.dispatchEvent(n,"pointerout"),s&&this.dispatchEvent(n,"mouseout"),!r.composedPath().includes(h)){const e=this.createPointerEvent(t,"pointerleave",h);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(n)}if(h!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",n=this.clonePointerEvent(r,e);this.dispatchEvent(n,"pointerover"),s&&this.dispatchEvent(n,"mouseover");let i=null==h?void 0:h.parent;for(;i&&i!==this.rootTarget.parent&&i!==r.target;)i=i.parent;if(!i||i===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==h&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const p=[],c=null===(i=this.enableGlobalMoveEvents)||void 0===i||i;this.moveOnAll?p.push("pointermove"):this.dispatchEvent(r,"pointermove"),c&&p.push("globalpointermove"),"touch"===r.pointerType&&(this.moveOnAll?p.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),c&&p.push("globaltouchmove")),s&&(this.moveOnAll?p.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),c&&p.push("globalmousemove"),this.cursor=null===(o=r.target)||void 0===o?void 0:o.cursor),p.length>0&&this.all(r,p),this._allInteractiveElements.length=0,this._hitElements.length=0,a.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(t){var n;if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),o=this.createPointerEvent(t),r="mouse"===o.pointerType||"pen"===o.pointerType;this.dispatchEvent(o,"pointerover"),r&&this.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(this.cursor=null===(n=o.target)||void 0===n?void 0:n.cursor);const s=this.clonePointerEvent(o,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),r&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;i.overTargets=o.composedPath(),this.freeEvent(o),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId);if(n.overTargets){const e="mouse"===t.pointerType||"pen"===t.pointerType,i=this.findMountedTarget(n.overTargets),o=this.createPointerEvent(t,"pointerout",i);this.dispatchEvent(o),e&&this.dispatchEvent(o,"mouseout");const r=this.createPointerEvent(t,"pointerleave",i);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;n.overTargets=null,this.freeEvent(o),this.freeEvent(r)}this.cursor=null}mapPointerUp(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)this.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightup":"mouseup")}const o=this.trackingData(t.pointerId),r=this.findMountedTarget(o.pressTargetsByButton[t.button]);let s=r;if(r&&!i.composedPath().includes(r)){let e=r;for(;e&&!i.composedPath().includes(e);){if(i.currentTarget=e,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)this.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.notifyTarget(i,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete o.pressTargetsByButton[t.button],s=e}if(s){const e=this.clonePointerEvent(i,"click");e.target=s,e.path=null,o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:n});const r=o.clicksByButton[t.button];if(r.target===e.target&&n-r.timeStamp<200?++r.clickCount:r.clickCount=1,r.target=e.target,r.timeStamp=n,e.detail=r.clickCount,"mouse"===e.pointerType){const t=2===e.button;this.dispatchEvent(e,t?"rightclick":"click")}else"touch"===e.pointerType&&this.dispatchEvent(e,"tap");this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(i)}mapPointerUpOutside(t){if(!(t instanceof l))return void e.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),i=this.findMountedTarget(n.pressTargetsByButton[t.button]),o=this.createPointerEvent(t);if(i){let e=i;for(;e;)o.currentTarget=e,this.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType?this.notifyTarget(o,"touchendoutside"):"mouse"!==o.pointerType&&"pen"!==o.pointerType||this.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete n.pressTargetsByButton[t.button]}this.freeEvent(o)}mapWheel(t){if(!(t instanceof p))return void e.warn("EventBoundary cannot map a non-wheel event as a wheel event");const n=this.createWheelEvent(t);this.dispatchEvent(n),this.freeEvent(n)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}createPointerEvent(t,e,n){var i;const o=this.allocateEvent(l);return this.copyPointerData(t,o),this.copyMouseData(t,o),this.copyData(t,o),o.nativeEvent=t.nativeEvent,o.originalEvent=t,o.target=null!==(i=null!=n?n:this.hitTest(o.global.x,o.global.y))&&void 0!==i?i:this._hitElements[0],"string"==typeof e&&(o.type=e),o}createWheelEvent(t){const e=this.allocateEvent(p);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const n=this.allocateEvent(l);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof l&&e instanceof l&&(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)}copyMouseData(t,e){t instanceof h&&e instanceof h&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){const n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeListener(e,n.fn,void 0,!0),n.fn.call(n.context,t);else for(let i=0,o=n.length;i<o&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeListener(e,n[i].fn,void 0,!0),n[i].fn.call(n[i].context,t)}}const d={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class m{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new v(null),s.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new l(null),this._rootWheelEvent=new p(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy(_extends({},m.defaultEventFeatures),{set:(t,e,n)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=n),t[e]=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)}static get defaultEventMode(){return this._defaultEventMode}init(t){var e,n;const{canvas:i,resolution:o}=this.renderer;this.setTargetElement(i),this.resolution=o,m._defaultEventMode=null!==(e=t.eventMode)&&void 0!==e?e:"passive",_extends(this.features,null!==(n=t.eventFeatures)&&void 0!==n?n:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;const n=this.cursorStyles[t];if(n)switch(typeof n){case"string":e&&(this.domElement.style.cursor=n);break;case"function":n(t);break;case"object":e&&_extends(this.domElement.style,n)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}const n=t;for(let t=0,i=e.length;t<i;t++){const i=e[t],o=this._bootstrapEvent(this._rootPointerEvent,i,n);this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,s.pointerMoved();const e=this._normalizeToPointerData(t);for(let n=0,i=e.length;n<i;n++){const i=this._bootstrapEvent(this._rootPointerEvent,e[n],t);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let n=0,i=e.length;n<i;n++){const i=this._bootstrapEvent(this._rootPointerEvent,e[n],t);i.type+="",this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let n=0,i=e.length;n<i;n++){const i=this._bootstrapEvent(this._rootPointerEvent,e[n],t);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,s.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;s.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"));let e="0";for(const t in m.canvasMap){m.canvasMap[t]===this.domElement&&(e=t)}m.eventsHandler[e]={pointermove:this._onPointerMove.bind(this),pointerdown:this._onPointerDown.bind(this),pointerleave:this._onPointerOverOut.bind(this),pointerover:this._onPointerOverOut.bind(this),pointerup:this._onPointerUp.bind(this),mousemove:this._onPointerMove.bind(this),mousedown:this._onPointerDown.bind(this),mouseout:this._onPointerOverOut.bind(this),mouseover:this._onPointerOverOut.bind(this),mouseup:this._onPointerUp.bind(this),touchstart:this._onPointerDown.bind(this),touchend:this._onPointerUp.bind(this),touchmove:this._onPointerMove.bind(this)},m.eventsHandler[e].wheel=this.onWheel.bind(this),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;s.removeTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,n,i){const o=1/this.resolution,r=i.canvasRect||{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=i.domElement||this.domElement;t.x=(e-r.left)*(s.width/r.width)*o,t.y=(n-r.top)*(s.height/r.height)*o}_normalizeToPointerData(t){return t.normalizedEvents}normalizeWheelEvent(t){const e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY,t),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e,n){return t.originalEvent=null,t.nativeEvent=e,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,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY,n),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=d[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}}m.extension={name:"events",type:[e.ExtensionType.WebGLSystem,e.ExtensionType.CanvasSystem,e.ExtensionType.WebGPUSystem],priority:-1},m.canvasMap={},m.eventsHandler={},m.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};const g={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return"dynamic"===this.eventMode||"static"===this.eventMode},set interactive(t){this.eventMode=t?"static":"passive"},_internalEventMode:void 0,get eventMode(){var t;return null!==(t=this._internalEventMode)&&void 0!==t?t:m.defaultEventMode},set eventMode(t){this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,n){const i="boolean"==typeof n&&n||"object"==typeof n&&n.capture,o="object"==typeof n?n.signal:void 0,r="object"==typeof n&&!0===n.once,s="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;o&&o.addEventListener("abort",(()=>{h.off(t,a,s)})),r?h.once(t,a,s):h.on(t,a,s)},removeEventListener(t,e,n){const i="function"==typeof e?void 0:e;t="boolean"==typeof n&&n||"object"==typeof n&&n.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof a))throw new Error("Container cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};return e.extensions.add(m),e.extensions.mixin(e.Container,g),e.DOMAdapter.set(e.WebWorkerAdapter),t.eventHandler=t=>{const{type:e,events:n,canvasRect:i,domElement:o,id:r}=t;if("eva-init"===e){const{canvasMap:e}=t;m.canvasMap=e}if("eva-events"===e)for(const t of n){const{eventName:e,event:n,normalizedEvents:s}=t,a=m.eventsHandler[r][e];a&&a(_extends(_extends({},n),{preventDefault(){},normalizedEvents:s,canvasRect:i,domElement:o}))}},Object.defineProperty(t,"__esModule",{value:!0}),t}({},PIXI);globalThis.EVA.plugin.worker=globalThis.EVA.plugin.worker||_EVA_IIFE_worker;
|
|
@@ -989,9 +989,10 @@ class EventSystem {
|
|
|
989
989
|
nativeEvent.preventDefault();
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
+
const nEvent = nativeEvent;
|
|
992
993
|
for (let i = 0, j = events.length; i < j; i++) {
|
|
993
994
|
const nativeEvent = events[i];
|
|
994
|
-
const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent);
|
|
995
|
+
const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent, nEvent);
|
|
995
996
|
this.rootBoundary.mapEvent(federatedEvent);
|
|
996
997
|
}
|
|
997
998
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1003,7 +1004,7 @@ class EventSystem {
|
|
|
1003
1004
|
EventsTicker.pointerMoved();
|
|
1004
1005
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1005
1006
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1006
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1007
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1007
1008
|
this.rootBoundary.mapEvent(event);
|
|
1008
1009
|
}
|
|
1009
1010
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1015,7 +1016,7 @@ class EventSystem {
|
|
|
1015
1016
|
const outside = '';
|
|
1016
1017
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1017
1018
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1018
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1019
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1019
1020
|
event.type += outside;
|
|
1020
1021
|
this.rootBoundary.mapEvent(event);
|
|
1021
1022
|
}
|
|
@@ -1027,7 +1028,7 @@ class EventSystem {
|
|
|
1027
1028
|
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
|
|
1028
1029
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1029
1030
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1030
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1031
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1031
1032
|
this.rootBoundary.mapEvent(event);
|
|
1032
1033
|
}
|
|
1033
1034
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1060,7 +1061,14 @@ class EventSystem {
|
|
|
1060
1061
|
style.touchAction = 'none';
|
|
1061
1062
|
}
|
|
1062
1063
|
}
|
|
1063
|
-
|
|
1064
|
+
let id = '0';
|
|
1065
|
+
for (const key in EventSystem.canvasMap) {
|
|
1066
|
+
const domElement = EventSystem.canvasMap[key];
|
|
1067
|
+
if (domElement === this.domElement) {
|
|
1068
|
+
id = key;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
EventSystem.eventsHandler[id] = {
|
|
1064
1072
|
pointermove: this._onPointerMove.bind(this),
|
|
1065
1073
|
pointerdown: this._onPointerDown.bind(this),
|
|
1066
1074
|
pointerleave: this._onPointerOverOut.bind(this),
|
|
@@ -1075,7 +1083,7 @@ class EventSystem {
|
|
|
1075
1083
|
touchend: this._onPointerUp.bind(this),
|
|
1076
1084
|
touchmove: this._onPointerMove.bind(this),
|
|
1077
1085
|
};
|
|
1078
|
-
EventSystem.eventsHandler['wheel'] = this.onWheel.bind(this);
|
|
1086
|
+
EventSystem.eventsHandler[id]['wheel'] = this.onWheel.bind(this);
|
|
1079
1087
|
this._eventsAdded = true;
|
|
1080
1088
|
}
|
|
1081
1089
|
_removeEvents() {
|
|
@@ -1093,26 +1101,22 @@ class EventSystem {
|
|
|
1093
1101
|
style.touchAction = '';
|
|
1094
1102
|
}
|
|
1095
1103
|
}
|
|
1096
|
-
EventSystem.eventsHandler = [];
|
|
1097
1104
|
this.domElement = null;
|
|
1098
1105
|
this._eventsAdded = false;
|
|
1099
1106
|
}
|
|
1100
|
-
mapPositionToPoint(point, x, y) {
|
|
1101
|
-
const rect = globalThis.$canvasRect
|
|
1102
|
-
? globalThis.$canvasRect
|
|
1103
|
-
: this.domElement.isConnected
|
|
1104
|
-
? this.domElement.getBoundingClientRect()
|
|
1105
|
-
: {
|
|
1106
|
-
x: 0,
|
|
1107
|
-
y: 0,
|
|
1108
|
-
width: this.domElement.width,
|
|
1109
|
-
height: this.domElement.height,
|
|
1110
|
-
left: 0,
|
|
1111
|
-
top: 0,
|
|
1112
|
-
};
|
|
1107
|
+
mapPositionToPoint(point, x, y, e) {
|
|
1113
1108
|
const resolutionMultiplier = 1.0 / this.resolution;
|
|
1114
|
-
|
|
1115
|
-
|
|
1109
|
+
const rect = e.canvasRect || {
|
|
1110
|
+
x: 0,
|
|
1111
|
+
y: 0,
|
|
1112
|
+
width: this.domElement.width,
|
|
1113
|
+
height: this.domElement.height,
|
|
1114
|
+
left: 0,
|
|
1115
|
+
top: 0,
|
|
1116
|
+
};
|
|
1117
|
+
const domElement = e.domElement || this.domElement;
|
|
1118
|
+
point.x = (x - rect.left) * (domElement.width / rect.width) * resolutionMultiplier;
|
|
1119
|
+
point.y = (y - rect.top) * (domElement.height / rect.height) * resolutionMultiplier;
|
|
1116
1120
|
}
|
|
1117
1121
|
_normalizeToPointerData(event) {
|
|
1118
1122
|
return event.normalizedEvents;
|
|
@@ -1124,14 +1128,14 @@ class EventSystem {
|
|
|
1124
1128
|
event.deltaY = nativeEvent.deltaY;
|
|
1125
1129
|
event.deltaZ = nativeEvent.deltaZ;
|
|
1126
1130
|
event.deltaMode = nativeEvent.deltaMode;
|
|
1127
|
-
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
|
|
1131
|
+
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY, nativeEvent);
|
|
1128
1132
|
event.global.copyFrom(event.screen);
|
|
1129
1133
|
event.offset.copyFrom(event.screen);
|
|
1130
1134
|
event.nativeEvent = nativeEvent;
|
|
1131
1135
|
event.type = nativeEvent.type;
|
|
1132
1136
|
return event;
|
|
1133
1137
|
}
|
|
1134
|
-
_bootstrapEvent(event, nativeEvent) {
|
|
1138
|
+
_bootstrapEvent(event, nativeEvent, nEvent) {
|
|
1135
1139
|
event.originalEvent = null;
|
|
1136
1140
|
event.nativeEvent = nativeEvent;
|
|
1137
1141
|
event.pointerId = nativeEvent.pointerId;
|
|
@@ -1145,7 +1149,7 @@ class EventSystem {
|
|
|
1145
1149
|
event.tiltY = nativeEvent.tiltY;
|
|
1146
1150
|
event.twist = nativeEvent.twist;
|
|
1147
1151
|
this._transferMouseData(event, nativeEvent);
|
|
1148
|
-
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
|
|
1152
|
+
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY, nEvent);
|
|
1149
1153
|
event.global.copyFrom(event.screen);
|
|
1150
1154
|
event.offset.copyFrom(event.screen);
|
|
1151
1155
|
event.isTrusted = nativeEvent.isTrusted;
|
|
@@ -1185,6 +1189,7 @@ EventSystem.extension = {
|
|
|
1185
1189
|
type: [pixi_js.ExtensionType.WebGLSystem, pixi_js.ExtensionType.CanvasSystem, pixi_js.ExtensionType.WebGPUSystem],
|
|
1186
1190
|
priority: -1,
|
|
1187
1191
|
};
|
|
1192
|
+
EventSystem.canvasMap = {};
|
|
1188
1193
|
EventSystem.eventsHandler = {};
|
|
1189
1194
|
EventSystem.defaultEventFeatures = {
|
|
1190
1195
|
move: true,
|
|
@@ -1292,12 +1297,16 @@ const init = () => {
|
|
|
1292
1297
|
};
|
|
1293
1298
|
|
|
1294
1299
|
const eventHandler = data => {
|
|
1295
|
-
const { type, events } = data;
|
|
1300
|
+
const { type, events, canvasRect, domElement, id } = data;
|
|
1301
|
+
if (type === 'eva-init') {
|
|
1302
|
+
const { canvasMap } = data;
|
|
1303
|
+
EventSystem.canvasMap = canvasMap;
|
|
1304
|
+
}
|
|
1296
1305
|
if (type === 'eva-events') {
|
|
1297
1306
|
for (const res of events) {
|
|
1298
1307
|
const { eventName, event, normalizedEvents } = res;
|
|
1299
|
-
const fn = EventSystem.eventsHandler[eventName];
|
|
1300
|
-
fn && fn(Object.assign(Object.assign({}, event), { preventDefault() { }, normalizedEvents }));
|
|
1308
|
+
const fn = EventSystem.eventsHandler[id][eventName];
|
|
1309
|
+
fn && fn(Object.assign(Object.assign({}, event), { preventDefault() { }, normalizedEvents, canvasRect, domElement }));
|
|
1301
1310
|
}
|
|
1302
1311
|
}
|
|
1303
1312
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("pixi.js");function e(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var n=e(require("eventemitter3"));const i=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){!this._tickerAdded&&this.domElement&&(t.Ticker.system.add(this._tickerUpdate,this,t.UPDATE_PRIORITY.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(t.Ticker.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())}};class o{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=o.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new t.Point,this.page=new t.Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,n){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,n,i,o){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class r extends o{constructor(){super(...arguments),this.client=new t.Point,this.movement=new t.Point,this.offset=new t.Point,this.global=new t.Point,this.screen=new t.Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,n){return t.worldTransform.applyInverse(n||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,n,i,o,r,s,a,h,l,p,u,c,d,v){throw new Error("Method not implemented.")}}class s extends r{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class a extends r{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}a.DOM_DELTA_PIXEL=0,a.DOM_DELTA_LINE=1,a.DOM_DELTA_PAGE=2;const h=new t.Point,l=new t.Point;class p{constructor(t){this.dispatch=new n,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,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)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(e){if(!this.rootTarget)return;const n=this.mappingTable[e.type];if(n)for(let t=0,i=n.length;t<i;t++)n[t].fn(e);else t.warn(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(t,e){i.pauseUpdate=!0;const n=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,h.set(t,e),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(t,e){if(!t.target)return;const n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,o=n.length-1;i<o;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=n.length-2;i>=0;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,n=this._allInteractiveElements){if(0===n.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=n.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=n[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,n,o,r,s=!1){let a=!1;if(this._interactivePrune(t))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(i.pauseUpdate=!1),t.interactiveChildren&&t.children){const i=t.children;for(let h=i.length-1;h>=0;h--){const l=i[h],p=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,n,o,r,s||r(t,n));if(p){if(p.length>0&&!p[p.length-1].parent)continue;const e=t.isInteractive();(p.length>0||e)&&(e&&this._allInteractiveElements.push(t),p.push(t)),0===this._hitElements.length&&(this._hitElements=p),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),s||this._hitElements.length>0?null:a?this._hitElements:h&&!r(t,n)&&o(t,n)?l?[t]:[]:null}hitTestRecursive(t,e,n,o,r){if(this._interactivePrune(t)||r(t,n))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(i.pauseUpdate=!1),t.interactiveChildren&&t.children){const i=t.children,s=n;for(let n=i.length-1;n>=0;n--){const a=i[n],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,s,o,r);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const s=this._isInteractive(e),a=t.isInteractive();return s&&o(t,n)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&t.visible&&t.renderable&&t.measurable)||("none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,l),!t.hitArea.contains(l.x,l.y)))return!0;if(t.effects&&t.effects.length)for(let n=0;n<t.effects.length;n++){const i=t.effects[n];if(i.containsPoint){if(!i.containsPoint(e,this.hitTestFn))return!0}}return!1}hitTestFn(t,e){var n;return!!t.hitArea||!!(null===(n=t)||void 0===n?void 0:n.containsPoint)&&(t.worldTransform.applyInverse(e,l),t.containsPoint(l))}notifyTarget(t,e){var n;if(!t.currentTarget.isInteractive())return;const i=`on${e=null!=e?e:t.type}`;null===(n=t.currentTarget[i])||void 0===n||n(t);const o=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,o),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(e);if(this.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)this.dispatchEvent(n,"touchstart");else if("mouse"===n.pointerType||"pen"===n.pointerType){const t=2===n.button;this.dispatchEvent(n,t?"rightdown":"mousedown")}this.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),this.freeEvent(n)}mapPointerMove(e){var n,i,o;if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const a="mouse"===r.pointerType||"pen"===r.pointerType,h=this.trackingData(e.pointerId),l=this.findMountedTarget(h.overTargets);if((null===(n=h.overTargets)||void 0===n?void 0:n.length)>0&&l!==r.target){const t="mousemove"===e.type?"mouseout":"pointerout",n=this.createPointerEvent(e,t,l);if(this.dispatchEvent(n,"pointerout"),a&&this.dispatchEvent(n,"mouseout"),!r.composedPath().includes(l)){const t=this.createPointerEvent(e,"pointerleave",l);for(t.eventPhase=t.AT_TARGET;t.target&&!r.composedPath().includes(t.target);)t.currentTarget=t.target,this.notifyTarget(t),a&&this.notifyTarget(t,"mouseleave"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}if(l!==r.target){const t="mousemove"===e.type?"mouseover":"pointerover",n=this.clonePointerEvent(r,t);this.dispatchEvent(n,"pointerover"),a&&this.dispatchEvent(n,"mouseover");let i=null==l?void 0:l.parent;for(;i&&i!==this.rootTarget.parent&&i!==r.target;)i=i.parent;if(!i||i===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==l&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),a&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const p=[],u=null===(i=this.enableGlobalMoveEvents)||void 0===i||i;this.moveOnAll?p.push("pointermove"):this.dispatchEvent(r,"pointermove"),u&&p.push("globalpointermove"),"touch"===r.pointerType&&(this.moveOnAll?p.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),u&&p.push("globaltouchmove")),a&&(this.moveOnAll?p.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),u&&p.push("globalmousemove"),this.cursor=null===(o=r.target)||void 0===o?void 0:o.cursor),p.length>0&&this.all(r,p),this._allInteractiveElements.length=0,this._hitElements.length=0,h.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(e){var n;if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const i=this.trackingData(e.pointerId),o=this.createPointerEvent(e),r="mouse"===o.pointerType||"pen"===o.pointerType;this.dispatchEvent(o,"pointerover"),r&&this.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(this.cursor=null===(n=o.target)||void 0===n?void 0:n.cursor);const a=this.clonePointerEvent(o,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),r&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;i.overTargets=o.composedPath(),this.freeEvent(o),this.freeEvent(a)}mapPointerOut(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(e.pointerId);if(n.overTargets){const t="mouse"===e.pointerType||"pen"===e.pointerType,i=this.findMountedTarget(n.overTargets),o=this.createPointerEvent(e,"pointerout",i);this.dispatchEvent(o),t&&this.dispatchEvent(o,"mouseout");const r=this.createPointerEvent(e,"pointerleave",i);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),t&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;n.overTargets=null,this.freeEvent(o),this.freeEvent(r)}this.cursor=null}mapPointerUp(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)this.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightup":"mouseup")}const o=this.trackingData(e.pointerId),r=this.findMountedTarget(o.pressTargetsByButton[e.button]);let a=r;if(r&&!i.composedPath().includes(r)){let t=r;for(;t&&!i.composedPath().includes(t);){if(i.currentTarget=t,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)this.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.notifyTarget(i,t?"rightupoutside":"mouseupoutside")}t=t.parent}delete o.pressTargetsByButton[e.button],a=t}if(a){const t=this.clonePointerEvent(i,"click");t.target=a,t.path=null,o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:t.target,timeStamp:n});const r=o.clicksByButton[e.button];if(r.target===t.target&&n-r.timeStamp<200?++r.clickCount:r.clickCount=1,r.target=t.target,r.timeStamp=n,t.detail=r.clickCount,"mouse"===t.pointerType){const e=2===t.button;this.dispatchEvent(t,e?"rightclick":"click")}else"touch"===t.pointerType&&this.dispatchEvent(t,"tap");this.dispatchEvent(t,"pointertap"),this.freeEvent(t)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(e.pointerId),i=this.findMountedTarget(n.pressTargetsByButton[e.button]),o=this.createPointerEvent(e);if(i){let t=i;for(;t;)o.currentTarget=t,this.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType?this.notifyTarget(o,"touchendoutside"):"mouse"!==o.pointerType&&"pen"!==o.pointerType||this.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),t=t.parent;delete n.pressTargetsByButton[e.button]}this.freeEvent(o)}mapWheel(e){if(!(e instanceof a))return void t.warn("EventBoundary cannot map a non-wheel event as a wheel event");const n=this.createWheelEvent(e);this.dispatchEvent(n),this.freeEvent(n)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}createPointerEvent(t,e,n){var i;const o=this.allocateEvent(s);return this.copyPointerData(t,o),this.copyMouseData(t,o),this.copyData(t,o),o.nativeEvent=t.nativeEvent,o.originalEvent=t,o.target=null!==(i=null!=n?n:this.hitTest(o.global.x,o.global.y))&&void 0!==i?i:this._hitElements[0],"string"==typeof e&&(o.type=e),o}createWheelEvent(t){const e=this.allocateEvent(a);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const n=this.allocateEvent(s);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof s&&e instanceof s&&(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)}copyMouseData(t,e){t instanceof r&&e instanceof r&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){const n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeListener(e,n.fn,void 0,!0),n.fn.call(n.context,t);else for(let i=0,o=n.length;i<o&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeListener(e,n[i].fn,void 0,!0),n[i].fn.call(n[i].context,t)}}const u={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class c{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new p(null),i.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new s(null),this._rootWheelEvent=new a(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy(Object.assign({},c.defaultEventFeatures),{set:(t,e,n)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=n),t[e]=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)}static get defaultEventMode(){return this._defaultEventMode}init(t){var e,n;const{canvas:i,resolution:o}=this.renderer;this.setTargetElement(i),this.resolution=o,c._defaultEventMode=null!==(e=t.eventMode)&&void 0!==e?e:"passive",Object.assign(this.features,null!==(n=t.eventFeatures)&&void 0!==n?n:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;const n=this.cursorStyles[t];if(n)switch(typeof n){case"string":e&&(this.domElement.style.cursor=n);break;case"function":n(t);break;case"object":e&&Object.assign(this.domElement.style,n)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}for(let t=0,n=e.length;t<n;t++){const n=e[t],i=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,i.pointerMoved();const e=this._normalizeToPointerData(t);for(let t=0,n=e.length;t<n;t++){const n=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let t=0,n=e.length;t<n;t++){const n=this._bootstrapEvent(this._rootPointerEvent,e[t]);n.type+="",this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let t=0,n=e.length;t<n;t++){const n=this._bootstrapEvent(this._rootPointerEvent,e[t]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,i.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;i.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none")),c.eventsHandler={pointermove:this._onPointerMove.bind(this),pointerdown:this._onPointerDown.bind(this),pointerleave:this._onPointerOverOut.bind(this),pointerover:this._onPointerOverOut.bind(this),pointerup:this._onPointerUp.bind(this),mousemove:this._onPointerMove.bind(this),mousedown:this._onPointerDown.bind(this),mouseout:this._onPointerOverOut.bind(this),mouseover:this._onPointerOverOut.bind(this),mouseup:this._onPointerUp.bind(this),touchstart:this._onPointerDown.bind(this),touchend:this._onPointerUp.bind(this),touchmove:this._onPointerMove.bind(this)},c.eventsHandler.wheel=this.onWheel.bind(this),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;i.removeTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),c.eventsHandler=[],this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,n){const i=globalThis.$canvasRect?globalThis.$canvasRect:this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},o=1/this.resolution;t.x=(e-i.left)*(this.domElement.width/i.width)*o,t.y=(n-i.top)*(this.domElement.height/i.height)*o}_normalizeToPointerData(t){return t.normalizedEvents}normalizeWheelEvent(t){const e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,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,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=u[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}}c.extension={name:"events",type:[t.ExtensionType.WebGLSystem,t.ExtensionType.CanvasSystem,t.ExtensionType.WebGPUSystem],priority:-1},c.eventsHandler={},c.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};const d={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return"dynamic"===this.eventMode||"static"===this.eventMode},set interactive(t){this.eventMode=t?"static":"passive"},_internalEventMode:void 0,get eventMode(){var t;return null!==(t=this._internalEventMode)&&void 0!==t?t:c.defaultEventMode},set eventMode(t){this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,n){const i="boolean"==typeof n&&n||"object"==typeof n&&n.capture,o="object"==typeof n?n.signal:void 0,r="object"==typeof n&&!0===n.once,s="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;o&&o.addEventListener("abort",(()=>{h.off(t,a,s)})),r?h.once(t,a,s):h.on(t,a,s)},removeEventListener(t,e,n){const i="function"==typeof e?void 0:e;t="boolean"==typeof n&&n||"object"==typeof n&&n.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof o))throw new Error("Container cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};t.extensions.add(c),t.extensions.mixin(t.Container,d),t.DOMAdapter.set(t.WebWorkerAdapter),exports.eventHandler=t=>{const{type:e,events:n}=t;if("eva-events"===e)for(const t of n){const{eventName:e,event:n,normalizedEvents:i}=t,o=c.eventsHandler[e];o&&o(Object.assign(Object.assign({},n),{preventDefault(){},normalizedEvents:i}))}};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("pixi.js");function e(t){return t&&"object"==typeof t&&"default"in t?t.default:t}var n=e(require("eventemitter3"));const i=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){!this._tickerAdded&&this.domElement&&(t.Ticker.system.add(this._tickerUpdate,this,t.UPDATE_PRIORITY.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(t.Ticker.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove)return void(this._didMove=!1);const t=this.events._rootPointerEvent;this.events.supportsTouchEvents&&"touch"===t.pointerType||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY,pointerType:t.pointerType,pointerId:t.pointerId}))}_tickerUpdate(t){this._deltaTime+=t.deltaTime,this._deltaTime<this.interactionFrequency||(this._deltaTime=0,this._update())}};class o{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=o.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new t.Point,this.page=new t.Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(t,e,n){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(t,e,n,i,o){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class r extends o{constructor(){super(...arguments),this.client=new t.Point,this.movement=new t.Point,this.offset=new t.Point,this.global=new t.Point,this.screen=new t.Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(t,e,n){return t.worldTransform.applyInverse(n||this.global,e)}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,n,i,o,r,s,a,h,l,p,u,c,d,v){throw new Error("Method not implemented.")}}class s extends r{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class a extends r{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}a.DOM_DELTA_PIXEL=0,a.DOM_DELTA_LINE=1,a.DOM_DELTA_PAGE=2;const h=new t.Point,l=new t.Point;class p{constructor(t){this.dispatch=new n,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=t,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)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(e){if(!this.rootTarget)return;const n=this.mappingTable[e.type];if(n)for(let t=0,i=n.length;t<i;t++)n[t].fn(e);else t.warn(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(t,e){i.pauseUpdate=!0;const n=this[this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive"](this.rootTarget,this.rootTarget.eventMode,h.set(t,e),this.hitTestFn,this.hitPruneFn);return n&&n[0]}propagate(t,e){if(!t.target)return;const n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let i=0,o=n.length-1;i<o;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let i=n.length-2;i>=0;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,n=this._allInteractiveElements){if(0===n.length)return;t.eventPhase=t.BUBBLING_PHASE;const i=Array.isArray(e)?e:[e];for(let e=n.length-1;e>=0;e--)i.forEach((i=>{t.currentTarget=n[e],this.notifyTarget(t,i)}))}propagationPath(t){const e=[t];for(let n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}hitTestMoveRecursive(t,e,n,o,r,s=!1){let a=!1;if(this._interactivePrune(t))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(i.pauseUpdate=!1),t.interactiveChildren&&t.children){const i=t.children;for(let h=i.length-1;h>=0;h--){const l=i[h],p=this.hitTestMoveRecursive(l,this._isInteractive(e)?e:l.eventMode,n,o,r,s||r(t,n));if(p){if(p.length>0&&!p[p.length-1].parent)continue;const e=t.isInteractive();(p.length>0||e)&&(e&&this._allInteractiveElements.push(t),p.push(t)),0===this._hitElements.length&&(this._hitElements=p),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),s||this._hitElements.length>0?null:a?this._hitElements:h&&!r(t,n)&&o(t,n)?l?[t]:[]:null}hitTestRecursive(t,e,n,o,r){if(this._interactivePrune(t)||r(t,n))return null;if("dynamic"!==t.eventMode&&"dynamic"!==e||(i.pauseUpdate=!1),t.interactiveChildren&&t.children){const i=t.children,s=n;for(let n=i.length-1;n>=0;n--){const a=i[n],h=this.hitTestRecursive(a,this._isInteractive(e)?e:a.eventMode,s,o,r);if(h){if(h.length>0&&!h[h.length-1].parent)continue;const e=t.isInteractive();return(h.length>0||e)&&h.push(t),h}}}const s=this._isInteractive(e),a=t.isInteractive();return s&&o(t,n)?a?[t]:[]:null}_isInteractive(t){return"static"===t||"dynamic"===t}_interactivePrune(t){return!(t&&t.visible&&t.renderable&&t.measurable)||("none"===t.eventMode||"passive"===t.eventMode&&!t.interactiveChildren)}hitPruneFn(t,e){if(t.hitArea&&(t.worldTransform.applyInverse(e,l),!t.hitArea.contains(l.x,l.y)))return!0;if(t.effects&&t.effects.length)for(let n=0;n<t.effects.length;n++){const i=t.effects[n];if(i.containsPoint){if(!i.containsPoint(e,this.hitTestFn))return!0}}return!1}hitTestFn(t,e){var n;return!!t.hitArea||!!(null===(n=t)||void 0===n?void 0:n.containsPoint)&&(t.worldTransform.applyInverse(e,l),t.containsPoint(l))}notifyTarget(t,e){var n;if(!t.currentTarget.isInteractive())return;const i=`on${e=null!=e?e:t.type}`;null===(n=t.currentTarget[i])||void 0===n||n(t);const o=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this._notifyListeners(t,o),t.eventPhase===t.AT_TARGET&&this._notifyListeners(t,e)}mapPointerDown(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(e);if(this.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)this.dispatchEvent(n,"touchstart");else if("mouse"===n.pointerType||"pen"===n.pointerType){const t=2===n.button;this.dispatchEvent(n,t?"rightdown":"mousedown")}this.trackingData(e.pointerId).pressTargetsByButton[e.button]=n.composedPath(),this.freeEvent(n)}mapPointerMove(e){var n,i,o;if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const r=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const a="mouse"===r.pointerType||"pen"===r.pointerType,h=this.trackingData(e.pointerId),l=this.findMountedTarget(h.overTargets);if((null===(n=h.overTargets)||void 0===n?void 0:n.length)>0&&l!==r.target){const t="mousemove"===e.type?"mouseout":"pointerout",n=this.createPointerEvent(e,t,l);if(this.dispatchEvent(n,"pointerout"),a&&this.dispatchEvent(n,"mouseout"),!r.composedPath().includes(l)){const t=this.createPointerEvent(e,"pointerleave",l);for(t.eventPhase=t.AT_TARGET;t.target&&!r.composedPath().includes(t.target);)t.currentTarget=t.target,this.notifyTarget(t),a&&this.notifyTarget(t,"mouseleave"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}if(l!==r.target){const t="mousemove"===e.type?"mouseover":"pointerover",n=this.clonePointerEvent(r,t);this.dispatchEvent(n,"pointerover"),a&&this.dispatchEvent(n,"mouseover");let i=null==l?void 0:l.parent;for(;i&&i!==this.rootTarget.parent&&i!==r.target;)i=i.parent;if(!i||i===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");for(t.eventPhase=t.AT_TARGET;t.target&&t.target!==l&&t.target!==this.rootTarget.parent;)t.currentTarget=t.target,this.notifyTarget(t),a&&this.notifyTarget(t,"mouseenter"),t.target=t.target.parent;this.freeEvent(t)}this.freeEvent(n)}const p=[],u=null===(i=this.enableGlobalMoveEvents)||void 0===i||i;this.moveOnAll?p.push("pointermove"):this.dispatchEvent(r,"pointermove"),u&&p.push("globalpointermove"),"touch"===r.pointerType&&(this.moveOnAll?p.splice(1,0,"touchmove"):this.dispatchEvent(r,"touchmove"),u&&p.push("globaltouchmove")),a&&(this.moveOnAll?p.splice(1,0,"mousemove"):this.dispatchEvent(r,"mousemove"),u&&p.push("globalmousemove"),this.cursor=null===(o=r.target)||void 0===o?void 0:o.cursor),p.length>0&&this.all(r,p),this._allInteractiveElements.length=0,this._hitElements.length=0,h.overTargets=r.composedPath(),this.freeEvent(r)}mapPointerOver(e){var n;if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const i=this.trackingData(e.pointerId),o=this.createPointerEvent(e),r="mouse"===o.pointerType||"pen"===o.pointerType;this.dispatchEvent(o,"pointerover"),r&&this.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(this.cursor=null===(n=o.target)||void 0===n?void 0:n.cursor);const a=this.clonePointerEvent(o,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),r&&this.notifyTarget(a,"mouseenter"),a.target=a.target.parent;i.overTargets=o.composedPath(),this.freeEvent(o),this.freeEvent(a)}mapPointerOut(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(e.pointerId);if(n.overTargets){const t="mouse"===e.pointerType||"pen"===e.pointerType,i=this.findMountedTarget(n.overTargets),o=this.createPointerEvent(e,"pointerout",i);this.dispatchEvent(o),t&&this.dispatchEvent(o,"mouseout");const r=this.createPointerEvent(e,"pointerleave",i);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),t&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;n.overTargets=null,this.freeEvent(o),this.freeEvent(r)}this.cursor=null}mapPointerUp(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=performance.now(),i=this.createPointerEvent(e);if(this.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)this.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.dispatchEvent(i,t?"rightup":"mouseup")}const o=this.trackingData(e.pointerId),r=this.findMountedTarget(o.pressTargetsByButton[e.button]);let a=r;if(r&&!i.composedPath().includes(r)){let t=r;for(;t&&!i.composedPath().includes(t);){if(i.currentTarget=t,this.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)this.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){const t=2===i.button;this.notifyTarget(i,t?"rightupoutside":"mouseupoutside")}t=t.parent}delete o.pressTargetsByButton[e.button],a=t}if(a){const t=this.clonePointerEvent(i,"click");t.target=a,t.path=null,o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:t.target,timeStamp:n});const r=o.clicksByButton[e.button];if(r.target===t.target&&n-r.timeStamp<200?++r.clickCount:r.clickCount=1,r.target=t.target,r.timeStamp=n,t.detail=r.clickCount,"mouse"===t.pointerType){const e=2===t.button;this.dispatchEvent(t,e?"rightclick":"click")}else"touch"===t.pointerType&&this.dispatchEvent(t,"tap");this.dispatchEvent(t,"pointertap"),this.freeEvent(t)}this.freeEvent(i)}mapPointerUpOutside(e){if(!(e instanceof s))return void t.warn("EventBoundary cannot map a non-pointer event as a pointer event");const n=this.trackingData(e.pointerId),i=this.findMountedTarget(n.pressTargetsByButton[e.button]),o=this.createPointerEvent(e);if(i){let t=i;for(;t;)o.currentTarget=t,this.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType?this.notifyTarget(o,"touchendoutside"):"mouse"!==o.pointerType&&"pen"!==o.pointerType||this.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),t=t.parent;delete n.pressTargetsByButton[e.button]}this.freeEvent(o)}mapWheel(e){if(!(e instanceof a))return void t.warn("EventBoundary cannot map a non-wheel event as a wheel event");const n=this.createWheelEvent(e);this.dispatchEvent(n),this.freeEvent(n)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}createPointerEvent(t,e,n){var i;const o=this.allocateEvent(s);return this.copyPointerData(t,o),this.copyMouseData(t,o),this.copyData(t,o),o.nativeEvent=t.nativeEvent,o.originalEvent=t,o.target=null!==(i=null!=n?n:this.hitTest(o.global.x,o.global.y))&&void 0!==i?i:this._hitElements[0],"string"==typeof e&&(o.type=e),o}createWheelEvent(t){const e=this.allocateEvent(a);return this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t,e.target=this.hitTest(e.global.x,e.global.y),e}clonePointerEvent(t,e){const n=this.allocateEvent(s);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof s&&e instanceof s&&(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)}copyMouseData(t,e){t instanceof r&&e instanceof r&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.copyFrom(t.client),e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.copyFrom(t.movement),e.screen.copyFrom(t.screen),e.shiftKey=t.shiftKey,e.global.copyFrom(t.global))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.copyFrom(t.layer),e.page.copyFrom(t.page)}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){this.eventPool.has(t)||this.eventPool.set(t,[]);const e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.defaultPrevented=!1,e.path=null,e.target=null,e}freeEvent(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}_notifyListeners(t,e){const n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeListener(e,n.fn,void 0,!0),n.fn.call(n.context,t);else for(let i=0,o=n.length;i<o&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeListener(e,n[i].fn,void 0,!0),n[i].fn.call(n[i].context,t)}}const u={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class c{constructor(t){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new p(null),i.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new s(null),this._rootWheelEvent=new a(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy(Object.assign({},c.defaultEventFeatures),{set:(t,e,n)=>("globalMove"===e&&(this.rootBoundary.enableGlobalMoveEvents=n),t[e]=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)}static get defaultEventMode(){return this._defaultEventMode}init(t){var e,n;const{canvas:i,resolution:o}=this.renderer;this.setTargetElement(i),this.resolution=o,c._defaultEventMode=null!==(e=t.eventMode)&&void 0!==e?e:"passive",Object.assign(this.features,null!==(n=t.eventFeatures)&&void 0!==n?n:{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(t){t||(t="default");let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this._currentCursor===t)return;this._currentCursor=t;const n=this.cursorStyles[t];if(n)switch(typeof n){case"string":e&&(this.domElement.style.cursor=n);break;case"function":n(t);break;case"object":e&&Object.assign(this.domElement.style,n)}else e&&"string"==typeof t&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this._rootPointerEvent}_onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);if(this.autoPreventDefault&&e[0].isNormalized){(t.cancelable||!("cancelable"in t))&&t.preventDefault()}const n=t;for(let t=0,i=e.length;t<i;t++){const i=e[t],o=this._bootstrapEvent(this._rootPointerEvent,i,n);this.rootBoundary.mapEvent(o)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(t){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,i.pointerMoved();const e=this._normalizeToPointerData(t);for(let n=0,i=e.length;n<i;n++){const i=this._bootstrapEvent(this._rootPointerEvent,e[n],t);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let n=0,i=e.length;n<i;n++){const i=this._bootstrapEvent(this._rootPointerEvent,e[n],t);i.type+="",this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this._normalizeToPointerData(t);for(let n=0,i=e.length;n<i;n++){const i=this._bootstrapEvent(this._rootPointerEvent,e[n],t);this.rootBoundary.mapEvent(i)}this.setCursor(this.rootBoundary.cursor)}onWheel(t){if(!this.features.wheel)return;const e=this.normalizeWheelEvent(t);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(e)}setTargetElement(t){this._removeEvents(),this.domElement=t,i.domElement=t,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;i.addTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="none",t.msTouchAction="none"):this.supportsPointerEvents&&(t.touchAction="none"));let e="0";for(const t in c.canvasMap){c.canvasMap[t]===this.domElement&&(e=t)}c.eventsHandler[e]={pointermove:this._onPointerMove.bind(this),pointerdown:this._onPointerDown.bind(this),pointerleave:this._onPointerOverOut.bind(this),pointerover:this._onPointerOverOut.bind(this),pointerup:this._onPointerUp.bind(this),mousemove:this._onPointerMove.bind(this),mousedown:this._onPointerDown.bind(this),mouseout:this._onPointerOverOut.bind(this),mouseover:this._onPointerOverOut.bind(this),mouseup:this._onPointerUp.bind(this),touchstart:this._onPointerDown.bind(this),touchend:this._onPointerUp.bind(this),touchmove:this._onPointerMove.bind(this)},c.eventsHandler[e].wheel=this.onWheel.bind(this),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;i.removeTickerListener();const t=this.domElement.style;t&&(globalThis.navigator.msPointerEnabled?(t.msContentZooming="",t.msTouchAction=""):this.supportsPointerEvents&&(t.touchAction="")),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(t,e,n,i){const o=1/this.resolution,r=i.canvasRect||{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},s=i.domElement||this.domElement;t.x=(e-r.left)*(s.width/r.width)*o,t.y=(n-r.top)*(s.height/r.height)*o}_normalizeToPointerData(t){return t.normalizedEvents}normalizeWheelEvent(t){const e=this._rootWheelEvent;return this._transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY,t),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}_bootstrapEvent(t,e,n){return t.originalEvent=null,t.nativeEvent=e,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,this._transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY,n),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=u[t.type]||t.type),t}_transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}}c.extension={name:"events",type:[t.ExtensionType.WebGLSystem,t.ExtensionType.CanvasSystem,t.ExtensionType.WebGPUSystem],priority:-1},c.canvasMap={},c.eventsHandler={},c.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};const d={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return"dynamic"===this.eventMode||"static"===this.eventMode},set interactive(t){this.eventMode=t?"static":"passive"},_internalEventMode:void 0,get eventMode(){var t;return null!==(t=this._internalEventMode)&&void 0!==t?t:c.defaultEventMode},set eventMode(t){this._internalEventMode=t},isInteractive(){return"static"===this.eventMode||"dynamic"===this.eventMode},interactiveChildren:!0,hitArea:null,addEventListener(t,e,n){const i="boolean"==typeof n&&n||"object"==typeof n&&n.capture,o="object"==typeof n?n.signal:void 0,r="object"==typeof n&&!0===n.once,s="function"==typeof e?void 0:e;t=i?`${t}capture`:t;const a="function"==typeof e?e:e.handleEvent,h=this;o&&o.addEventListener("abort",(()=>{h.off(t,a,s)})),r?h.once(t,a,s):h.on(t,a,s)},removeEventListener(t,e,n){const i="function"==typeof e?void 0:e;t="boolean"==typeof n&&n||"object"==typeof n&&n.capture?`${t}capture`:t,e="function"==typeof e?e:e.handleEvent,this.off(t,e,i)},dispatchEvent(t){if(!(t instanceof o))throw new Error("Container cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=null,t.target=this,t.manager.dispatchEvent(t),!t.defaultPrevented}};t.extensions.add(c),t.extensions.mixin(t.Container,d),t.DOMAdapter.set(t.WebWorkerAdapter),exports.eventHandler=t=>{const{type:e,events:n,canvasRect:i,domElement:o,id:r}=t;if("eva-init"===e){const{canvasMap:e}=t;c.canvasMap=e}if("eva-events"===e)for(const t of n){const{eventName:e,event:n,normalizedEvents:s}=t,a=c.eventsHandler[r][e];a&&a(Object.assign(Object.assign({},n),{preventDefault(){},normalizedEvents:s,canvasRect:i,domElement:o}))}};
|
|
@@ -981,9 +981,10 @@ class EventSystem {
|
|
|
981
981
|
nativeEvent.preventDefault();
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
|
+
const nEvent = nativeEvent;
|
|
984
985
|
for (let i = 0, j = events.length; i < j; i++) {
|
|
985
986
|
const nativeEvent = events[i];
|
|
986
|
-
const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent);
|
|
987
|
+
const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent, nEvent);
|
|
987
988
|
this.rootBoundary.mapEvent(federatedEvent);
|
|
988
989
|
}
|
|
989
990
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -995,7 +996,7 @@ class EventSystem {
|
|
|
995
996
|
EventsTicker.pointerMoved();
|
|
996
997
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
997
998
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
998
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
999
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
999
1000
|
this.rootBoundary.mapEvent(event);
|
|
1000
1001
|
}
|
|
1001
1002
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1007,7 +1008,7 @@ class EventSystem {
|
|
|
1007
1008
|
const outside = '';
|
|
1008
1009
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1009
1010
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1010
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1011
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1011
1012
|
event.type += outside;
|
|
1012
1013
|
this.rootBoundary.mapEvent(event);
|
|
1013
1014
|
}
|
|
@@ -1019,7 +1020,7 @@ class EventSystem {
|
|
|
1019
1020
|
this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
|
|
1020
1021
|
const normalizedEvents = this._normalizeToPointerData(nativeEvent);
|
|
1021
1022
|
for (let i = 0, j = normalizedEvents.length; i < j; i++) {
|
|
1022
|
-
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
|
|
1023
|
+
const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i], nativeEvent);
|
|
1023
1024
|
this.rootBoundary.mapEvent(event);
|
|
1024
1025
|
}
|
|
1025
1026
|
this.setCursor(this.rootBoundary.cursor);
|
|
@@ -1052,7 +1053,14 @@ class EventSystem {
|
|
|
1052
1053
|
style.touchAction = 'none';
|
|
1053
1054
|
}
|
|
1054
1055
|
}
|
|
1055
|
-
|
|
1056
|
+
let id = '0';
|
|
1057
|
+
for (const key in EventSystem.canvasMap) {
|
|
1058
|
+
const domElement = EventSystem.canvasMap[key];
|
|
1059
|
+
if (domElement === this.domElement) {
|
|
1060
|
+
id = key;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
EventSystem.eventsHandler[id] = {
|
|
1056
1064
|
pointermove: this._onPointerMove.bind(this),
|
|
1057
1065
|
pointerdown: this._onPointerDown.bind(this),
|
|
1058
1066
|
pointerleave: this._onPointerOverOut.bind(this),
|
|
@@ -1067,7 +1075,7 @@ class EventSystem {
|
|
|
1067
1075
|
touchend: this._onPointerUp.bind(this),
|
|
1068
1076
|
touchmove: this._onPointerMove.bind(this),
|
|
1069
1077
|
};
|
|
1070
|
-
EventSystem.eventsHandler['wheel'] = this.onWheel.bind(this);
|
|
1078
|
+
EventSystem.eventsHandler[id]['wheel'] = this.onWheel.bind(this);
|
|
1071
1079
|
this._eventsAdded = true;
|
|
1072
1080
|
}
|
|
1073
1081
|
_removeEvents() {
|
|
@@ -1085,26 +1093,22 @@ class EventSystem {
|
|
|
1085
1093
|
style.touchAction = '';
|
|
1086
1094
|
}
|
|
1087
1095
|
}
|
|
1088
|
-
EventSystem.eventsHandler = [];
|
|
1089
1096
|
this.domElement = null;
|
|
1090
1097
|
this._eventsAdded = false;
|
|
1091
1098
|
}
|
|
1092
|
-
mapPositionToPoint(point, x, y) {
|
|
1093
|
-
const rect = globalThis.$canvasRect
|
|
1094
|
-
? globalThis.$canvasRect
|
|
1095
|
-
: this.domElement.isConnected
|
|
1096
|
-
? this.domElement.getBoundingClientRect()
|
|
1097
|
-
: {
|
|
1098
|
-
x: 0,
|
|
1099
|
-
y: 0,
|
|
1100
|
-
width: this.domElement.width,
|
|
1101
|
-
height: this.domElement.height,
|
|
1102
|
-
left: 0,
|
|
1103
|
-
top: 0,
|
|
1104
|
-
};
|
|
1099
|
+
mapPositionToPoint(point, x, y, e) {
|
|
1105
1100
|
const resolutionMultiplier = 1.0 / this.resolution;
|
|
1106
|
-
|
|
1107
|
-
|
|
1101
|
+
const rect = e.canvasRect || {
|
|
1102
|
+
x: 0,
|
|
1103
|
+
y: 0,
|
|
1104
|
+
width: this.domElement.width,
|
|
1105
|
+
height: this.domElement.height,
|
|
1106
|
+
left: 0,
|
|
1107
|
+
top: 0,
|
|
1108
|
+
};
|
|
1109
|
+
const domElement = e.domElement || this.domElement;
|
|
1110
|
+
point.x = (x - rect.left) * (domElement.width / rect.width) * resolutionMultiplier;
|
|
1111
|
+
point.y = (y - rect.top) * (domElement.height / rect.height) * resolutionMultiplier;
|
|
1108
1112
|
}
|
|
1109
1113
|
_normalizeToPointerData(event) {
|
|
1110
1114
|
return event.normalizedEvents;
|
|
@@ -1116,14 +1120,14 @@ class EventSystem {
|
|
|
1116
1120
|
event.deltaY = nativeEvent.deltaY;
|
|
1117
1121
|
event.deltaZ = nativeEvent.deltaZ;
|
|
1118
1122
|
event.deltaMode = nativeEvent.deltaMode;
|
|
1119
|
-
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
|
|
1123
|
+
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY, nativeEvent);
|
|
1120
1124
|
event.global.copyFrom(event.screen);
|
|
1121
1125
|
event.offset.copyFrom(event.screen);
|
|
1122
1126
|
event.nativeEvent = nativeEvent;
|
|
1123
1127
|
event.type = nativeEvent.type;
|
|
1124
1128
|
return event;
|
|
1125
1129
|
}
|
|
1126
|
-
_bootstrapEvent(event, nativeEvent) {
|
|
1130
|
+
_bootstrapEvent(event, nativeEvent, nEvent) {
|
|
1127
1131
|
event.originalEvent = null;
|
|
1128
1132
|
event.nativeEvent = nativeEvent;
|
|
1129
1133
|
event.pointerId = nativeEvent.pointerId;
|
|
@@ -1137,7 +1141,7 @@ class EventSystem {
|
|
|
1137
1141
|
event.tiltY = nativeEvent.tiltY;
|
|
1138
1142
|
event.twist = nativeEvent.twist;
|
|
1139
1143
|
this._transferMouseData(event, nativeEvent);
|
|
1140
|
-
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
|
|
1144
|
+
this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY, nEvent);
|
|
1141
1145
|
event.global.copyFrom(event.screen);
|
|
1142
1146
|
event.offset.copyFrom(event.screen);
|
|
1143
1147
|
event.isTrusted = nativeEvent.isTrusted;
|
|
@@ -1177,6 +1181,7 @@ EventSystem.extension = {
|
|
|
1177
1181
|
type: [ExtensionType.WebGLSystem, ExtensionType.CanvasSystem, ExtensionType.WebGPUSystem],
|
|
1178
1182
|
priority: -1,
|
|
1179
1183
|
};
|
|
1184
|
+
EventSystem.canvasMap = {};
|
|
1180
1185
|
EventSystem.eventsHandler = {};
|
|
1181
1186
|
EventSystem.defaultEventFeatures = {
|
|
1182
1187
|
move: true,
|
|
@@ -1284,12 +1289,16 @@ const init = () => {
|
|
|
1284
1289
|
};
|
|
1285
1290
|
|
|
1286
1291
|
const eventHandler = data => {
|
|
1287
|
-
const { type, events } = data;
|
|
1292
|
+
const { type, events, canvasRect, domElement, id } = data;
|
|
1293
|
+
if (type === 'eva-init') {
|
|
1294
|
+
const { canvasMap } = data;
|
|
1295
|
+
EventSystem.canvasMap = canvasMap;
|
|
1296
|
+
}
|
|
1288
1297
|
if (type === 'eva-events') {
|
|
1289
1298
|
for (const res of events) {
|
|
1290
1299
|
const { eventName, event, normalizedEvents } = res;
|
|
1291
|
-
const fn = EventSystem.eventsHandler[eventName];
|
|
1292
|
-
fn && fn(Object.assign(Object.assign({}, event), { preventDefault() { }, normalizedEvents }));
|
|
1300
|
+
const fn = EventSystem.eventsHandler[id][eventName];
|
|
1301
|
+
fn && fn(Object.assign(Object.assign({}, event), { preventDefault() { }, normalizedEvents, canvasRect, domElement }));
|
|
1293
1302
|
}
|
|
1294
1303
|
}
|
|
1295
1304
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-worker",
|
|
3
|
-
"version": "2.0.1-beta.
|
|
3
|
+
"version": "2.0.1-beta.21",
|
|
4
4
|
"description": "@eva/plugin-worker",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-worker.esm.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@eva/eva.js": "2.0.1-beta.
|
|
21
|
+
"@eva/eva.js": "2.0.1-beta.21",
|
|
22
22
|
"eventemitter3": "^3.1.2",
|
|
23
23
|
"pixi.js": "^8.8.1"
|
|
24
24
|
}
|