123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649 |
- import {
- e as e2
- } from "./chunk-6334AFGG.js";
- import {
- t as t3
- } from "./chunk-KOKTANE6.js";
- import {
- a
- } from "./chunk-RYY6632W.js";
- import {
- e,
- m,
- n5 as n,
- t4 as t2,
- x,
- y2 as y,
- y3 as y2
- } from "./chunk-2Z2TG5CU.js";
- import {
- i
- } from "./chunk-V6P2MAQQ.js";
- import {
- s2 as s
- } from "./chunk-E5O6P5I2.js";
- import {
- has
- } from "./chunk-SPWQ3AWG.js";
- import {
- f,
- t
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/core/throttle.js
- function e3(e8, t5, l2, n3) {
- let o3 = null, p = 1e3;
- "number" == typeof t5 ? (p = t5, n3 = l2) : (o3 = t5 != null ? t5 : null, p = l2);
- let r2, u3 = 0;
- const a4 = () => {
- u3 = 0, e8.apply(n3, r2);
- }, c2 = (...e9) => {
- o3 && o3.apply(n3, e9), r2 = e9, p ? u3 || (u3 = setTimeout(a4, p)) : a4();
- };
- return c2.remove = () => {
- u3 && (clearTimeout(u3), u3 = 0);
- }, c2.forceUpdate = () => {
- u3 && (clearTimeout(u3), a4());
- }, c2.hasPendingUpdates = () => !!u3, c2;
- }
- // node_modules/@arcgis/core/views/2d/support/Timeline.js
- var s2 = (s6) => s6.includes("Brush");
- var e4 = class {
- constructor() {
- this._names = /* @__PURE__ */ new Map();
- }
- begin(e8) {
- this._names.has(e8) || (this._names.set(e8, false), s2(e8) && this.record("Esri.FirstDraw"), performance.mark(`Esri.${e8}.Start`));
- }
- end(s6) {
- this._names.has(s6) && !this._names.get(s6) && (this._names.set(s6, true), performance.mark(`Esri.${s6}.End`));
- }
- record(s6) {
- this._names.has(s6) || (this._names.set(s6, true), performance.mark(`Esri.${s6}`));
- }
- };
- // node_modules/@arcgis/core/views/support/screenshotUtils.js
- function r(t5, h, i4) {
- const { ctx: e8, canvas: o3 } = g(t5, i4), n3 = e8.getImageData(0, 0, t5.width, t5.height), a4 = c(o3, h);
- return f2(o3), { dataUrl: a4, data: n3 };
- }
- function l(t5, h) {
- const { ctx: i4, canvas: e8 } = g(t5, h), o3 = i4.getImageData(0, 0, t5.width, t5.height);
- return f2(e8), o3;
- }
- function g(t5, h) {
- const i4 = d();
- h.premultipliedAlpha && v(t5), i4.width = t5.width, i4.height = t5.height;
- const e8 = i4.getContext("2d");
- return e8.putImageData(t5, 0, 0), h.flipY && q(e8), { ctx: e8, canvas: i4 };
- }
- function f2(t5) {
- t5.width = 0, t5.height = 0;
- }
- function d() {
- return t(u) && (u = document.createElement("canvas")), u;
- }
- var u = null;
- function c(t5, h) {
- const i4 = I[h.format], e8 = h.quality / 100;
- return t5.toDataURL(i4, e8);
- }
- function s3(h, i4) {
- const e8 = D(h), o3 = B[e8];
- return { format: e8, quality: a(null != i4 ? i4 : o3, 0, 100) };
- }
- function w(t5, h) {
- return h / Math.max(t5[0], t5[1]);
- }
- function m2(t5, h, i4, e8 = 0, o3 = 0, n3 = t5.width - e8, a4 = t5.height - o3, r2 = false) {
- const { data: l2 } = t5, { width: g3, height: f3, data: d2 } = h, u3 = n3 / g3, c2 = a4 / f3, s6 = Math.ceil(u3 / 2), w2 = Math.ceil(c2 / 2), m3 = t5.width;
- for (let M = 0; M < f3; M++)
- for (let t6 = 0; t6 < g3; t6++) {
- const h2 = 4 * (t6 + (r2 ? f3 - M - 1 : M) * g3);
- let n4 = 0, a5 = 0, p = 0, y3 = 0, x2 = 0, b = 0;
- const j = (M + 0.5) * c2;
- for (let r3 = Math.floor(M * c2); r3 < (M + 1) * c2; r3++) {
- const h3 = Math.abs(j - (r3 + 0.5)) / w2, g4 = (t6 + 0.5) * u3, f4 = h3 * h3;
- for (let d3 = Math.floor(t6 * u3); d3 < (t6 + 1) * u3; d3++) {
- const t7 = Math.abs(g4 - (d3 + 0.5)) / s6, h4 = Math.sqrt(f4 + t7 * t7);
- if (h4 >= 1)
- continue;
- let u4 = 2 * h4 * h4 * h4 - 3 * h4 * h4 + 1;
- const c3 = 4 * (e8 + d3 + (o3 + r3) * m3);
- b += u4 * l2[c3 + 3], a5 += u4, !i4 && l2[c3 + 3] < 255 && (u4 = u4 * l2[c3 + 3] / 255), p += u4 * l2[c3], y3 += u4 * l2[c3 + 1], x2 += u4 * l2[c3 + 2], n4 += u4;
- }
- }
- d2[h2] = p / n4, d2[h2 + 1] = y3 / n4, d2[h2 + 2] = x2 / n4, d2[h2 + 3] = b / a5;
- }
- return h;
- }
- function D(t5) {
- switch (t5) {
- case "png":
- case "jpg":
- case "jpeg":
- return t5;
- default:
- return k;
- }
- }
- function q(t5) {
- t5.save(), t5.globalCompositeOperation = "copy", t5.scale(1, -1), t5.translate(0, -t5.canvas.height), t5.drawImage(t5.canvas, 0, 0), t5.restore();
- }
- function v(t5) {
- const h = t5.data, i4 = h.length;
- for (let e8 = 0; e8 < i4; e8 += 4) {
- const t6 = h[e8 + 3];
- if (255 !== t6 && t6 > 0) {
- const i5 = 255 / t6;
- h[e8 + 0] = h[e8 + 0] * i5, h[e8 + 1] = h[e8 + 1] * i5, h[e8 + 2] = h[e8 + 2] * i5;
- }
- }
- }
- var I = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg" };
- var P = 98;
- var k = "png";
- var B = { png: 100, jpg: P, jpeg: P };
- // node_modules/@arcgis/core/views/3d/support/PropertiesPool.js
- var o = class {
- constructor(r2, o3) {
- this._owner = o3, this._properties = {}, this._afterDispatchHandle = null;
- for (const t5 in r2) {
- const o4 = r2[t5], s6 = new t2(o4, void 0, void 0, 2, 2);
- this._properties[t5] = { pool: s6, acquired: [] };
- }
- this._afterDispatchHandle = y(() => this._release());
- }
- destroy() {
- this._afterDispatchHandle && (this._afterDispatchHandle.remove(), this._afterDispatchHandle = null);
- for (const e8 in this._properties) {
- const t5 = this._properties[e8];
- for (const e9 of t5.acquired)
- x(e9) || t5.pool.release(e9);
- t5.pool.destroy(), t5.pool = null, t5.acquired = null;
- }
- this._properties = null, this._owner = null;
- }
- get(e8) {
- const t5 = this._owner._get(e8), r2 = this._properties[e8];
- let o3 = r2.pool.acquire();
- for (r2.acquired.push(o3); o3 === t5; )
- r2.acquired.push(o3), o3 = r2.pool.acquire();
- return o3;
- }
- _release() {
- for (const e8 in this._properties) {
- const t5 = this._properties[e8];
- let o3 = 0;
- for (const e9 of t5.acquired)
- x(e9) ? t5.acquired[o3++] = e9 : t5.pool.release(e9);
- t5.acquired.length = o3;
- }
- }
- };
- // node_modules/@arcgis/core/views/input/keys.js
- var e6 = has("mac") ? "Meta" : "Ctrl";
- var t4 = { 8: "Backspace", 9: "Tab", 13: "Enter", 27: "Escape", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "ArrowLeft", 38: "ArrowUp", 39: "ArrowRight", 40: "ArrowDown", 45: "Insert", 46: "Delete" };
- for (let n3 = 48; n3 < 58; n3++)
- t4[n3] = String.fromCharCode(n3);
- for (let n3 = 1; n3 < 25; n3++)
- t4[111 + n3] = `F${n3}`;
- for (let n3 = 65; n3 < 91; n3++)
- t4[n3] = [String.fromCharCode(n3 + 32), String.fromCharCode(n3)];
- function o2(e8) {
- if (void 0 !== e8.key)
- return i(e8);
- const o3 = t4[e8.keyCode];
- return Array.isArray(o3) ? e8.shiftKey ? o3[1] : o3[0] : o3;
- }
- function a2(r2) {
- switch (r2) {
- case "Ctrl":
- case "Alt":
- case "Shift":
- case "Meta":
- case "Primary":
- return true;
- }
- return false;
- }
- // node_modules/@arcgis/core/views/input/EventMatch.js
- var e7 = class {
- constructor(e8, t5 = []) {
- this.eventType = e8, this.keyModifiers = t5;
- }
- matches(e8) {
- if (e8.type !== this.eventType)
- return false;
- if (0 === this.keyModifiers.length)
- return true;
- const t5 = e8.modifiers;
- for (const i4 of this.keyModifiers)
- if (!t5.has(i4))
- return false;
- return true;
- }
- };
- // node_modules/@arcgis/core/views/input/InputHandler.js
- var n2 = s.getLogger("esri.views.input.InputHandler");
- var i2 = class {
- constructor(e8) {
- this._manager = null, this._incoming = {}, this._outgoing = {}, this._incomingEventMatches = null, this._incomingEventTypes = null, this._outgoingEventTypes = null, this._hasSideEffects = e8;
- }
- get incomingEventMatches() {
- if (!this._incomingEventMatches) {
- this._incomingEventMatches = [];
- for (const e8 in this._incoming) {
- const t5 = this._incoming[e8];
- for (const e9 of t5)
- this._incomingEventMatches.push(e9.match);
- }
- }
- return this._incomingEventMatches;
- }
- get incomingEventTypes() {
- return this._incomingEventTypes || (this._incomingEventTypes = this.incomingEventMatches.map((e8) => e8.eventType)), this._incomingEventTypes;
- }
- get outgoingEventTypes() {
- return this._outgoingEventTypes || (this._outgoingEventTypes = Object.keys(this._outgoing)), this._outgoingEventTypes;
- }
- get hasSideEffects() {
- return this._hasSideEffects;
- }
- get hasPendingInputs() {
- return false;
- }
- onInstall(e8) {
- this._manager ? n2.error("This InputHandler has already been registered with an InputManager") : (e8.setEventCallback((e9) => this._handleEvent(e9)), e8.setUninstallCallback(() => this._onUninstall()), this._manager = e8);
- }
- onUninstall() {
- }
- registerIncoming(e8, n3, i4) {
- let a4;
- "function" == typeof n3 ? (i4 = n3, a4 = []) : a4 = n3 || [];
- const o3 = "string" == typeof e8 ? new e7(e8, a4) : e8, h = () => {
- this._incomingEventTypes = null, this._incomingEventMatches = null;
- }, r2 = (e9) => {
- const t5 = this._incoming[e9.match.eventType];
- if (t5) {
- const n4 = t5.indexOf(e9);
- t5.splice(n4, 1), h(), this._manager && this._manager.updateDependencies();
- }
- }, g3 = new s4(o3, i4, { onPause: r2, onRemove: r2, onResume: (e9) => {
- const t5 = this._incoming[e9.match.eventType];
- t5 && !t5.includes(e9) && (t5.push(e9), h(), this._manager && this._manager.updateDependencies());
- } });
- let c2 = this._incoming[o3.eventType];
- return c2 || (c2 = [], this._incoming[o3.eventType] = c2), c2.push(g3), h(), this._manager && this._manager.updateDependencies(), g3;
- }
- registerOutgoing(e8) {
- if (this._outgoing[e8])
- throw new Error("There is already a callback registered for this outgoing InputEvent: " + e8);
- const t5 = new a3(e8, { onEmit: (e9, t6, n3, i4) => {
- var _a;
- (_a = this._manager) == null ? void 0 : _a.emit(e9.eventType, t6, n3, i4);
- }, onRemove: (e9) => {
- var _a;
- delete this._outgoing[e9.eventType], (_a = this._manager) == null ? void 0 : _a.updateDependencies();
- } });
- return this._outgoing[e8] = t5, this._outgoingEventTypes = null, this._manager && this._manager.updateDependencies(), t5;
- }
- startCapturingPointer(e8) {
- var _a;
- (_a = this._manager) == null ? void 0 : _a.setPointerCapture(e8, true);
- }
- stopCapturingPointer(e8) {
- var _a;
- (_a = this._manager) == null ? void 0 : _a.setPointerCapture(e8, false);
- }
- refreshHasPendingInputs() {
- var _a;
- (_a = this._manager) == null ? void 0 : _a.refreshHasPendingInputs();
- }
- _onUninstall() {
- this._manager ? (this.onUninstall(), this._manager = null) : n2.error("This InputHandler is not registered with an InputManager");
- }
- _handleEvent(e8) {
- var _a;
- const t5 = this._incoming[e8.type];
- if (t5) {
- for (const n3 of t5)
- if (n3.match.matches(e8) && ((_a = n3.callback) == null ? void 0 : _a.call(n3, e8), e8.shouldStopPropagation()))
- break;
- }
- }
- };
- var s4 = class {
- constructor(e8, t5, n3) {
- this.match = e8, this._callback = t5, this._handler = n3;
- }
- pause() {
- this._handler.onPause(this);
- }
- resume() {
- this._handler.onResume(this);
- }
- remove() {
- this._handler.onRemove(this);
- }
- get callback() {
- return this._callback;
- }
- };
- var a3 = class {
- constructor(e8, t5) {
- this.eventType = e8, this._removed = false, this._handler = t5;
- }
- emit(e8, t5, n3) {
- this._removed || this._handler.onEmit(this, e8, t5, n3);
- }
- remove() {
- this._removed = true, this._handler.onRemove(this);
- }
- };
- // node_modules/@arcgis/core/views/input/handlers/LatestPointer.js
- var s5 = class extends i2 {
- constructor(t5) {
- super(true), this._onChange = t5, this._value = "mouse", this._x = null, this._y = null, this.registerIncoming("pointer-move", (t6) => {
- this._update(t6.data);
- });
- }
- _update(t5) {
- const s6 = "touch" === t5.native.pointerType ? "touch" : "mouse", { x: e8, y: i4 } = t5;
- s6 === this._value && this._x === e8 && this._y === i4 || (this._value = s6, this._x = e8, this._y = i4, this._onChange(s6, e8, i4));
- }
- };
- // node_modules/@arcgis/core/views/input/handlers/MultiTouch.js
- var i3 = class extends i2 {
- constructor() {
- super(true), this._activeTouchPointerIds = /* @__PURE__ */ new Set(), this._multiTouchActive = new t3(false), this._onPointerAdd = ({ data: t5 }) => {
- "touch" === t5.pointerType && (this._activeTouchPointerIds.add(t5.native.pointerId), this._update());
- }, this._onPointerRemove = ({ data: t5 }) => {
- "touch" === t5.pointerType && (this._activeTouchPointerIds.delete(t5.native.pointerId), this._update());
- }, this.registerIncoming("pointer-down", this._onPointerAdd), this.registerIncoming("pointer-up", this._onPointerRemove), this.registerIncoming("pointer-capture-lost", this._onPointerRemove), this.registerIncoming("pointer-cancel", this._onPointerRemove);
- }
- get multiTouchActive() {
- return this._multiTouchActive.get();
- }
- _update() {
- this._multiTouchActive.set(this._activeTouchPointerIds.size > 1);
- }
- };
- // node_modules/@arcgis/core/views/input/InputManager.js
- var u2 = class extends m {
- constructor(e8) {
- super(e8), this._pointerCaptures = /* @__PURE__ */ new Map(), this._nameToGroup = {}, this._handlers = [], this._handlersPriority = [], this._currentPropagation = null, this._updateDependenciesAfterPropagation = false, this._sourceEvents = /* @__PURE__ */ new Set(), this._keyModifiers = /* @__PURE__ */ new Set(), this._activeKeyModifiers = /* @__PURE__ */ new Set(), this._stoppedPropagationEventIds = /* @__PURE__ */ new Set(), this.primaryKey = e6, this._latestPointerType = "mouse", this._propertiesPool = new o({ latestPointerLocation: v2 }, this), this.latestPointerLocation = null, this.test = { timestamp: void 0, hasCurrentPropagation: () => !!this._currentPropagation };
- }
- initialize() {
- this.eventSource.onEventReceived = this._onEventReceived.bind(this), this._installRecognizers();
- }
- destroy() {
- const e8 = Object.keys(this._nameToGroup);
- for (const t5 of e8)
- this.uninstallHandlers(t5);
- this.eventSource.destroy(), this._currentPropagation = null, this._propertiesPool.destroy();
- }
- get hasPendingInputs() {
- return this._handlers.some((e8) => e8.handler.hasPendingInputs);
- }
- get latestPointerType() {
- return this._latestPointerType;
- }
- get multiTouchActive() {
- return this._multiTouchHandler.multiTouchActive;
- }
- installHandlers(e8, t5, i4 = P2.INTERNAL) {
- if (this._nameToGroup[e8])
- return void s.getLogger(this.declaredClass).error("There is already an InputHandler group registered under the name `" + e8 + "`");
- if (0 === t5.length)
- return void s.getLogger(this.declaredClass).error("Can't register a group of zero handlers");
- const n3 = { name: e8, handlers: t5.map((e9) => ({ handler: e9, active: true, removed: false, priorityIndex: 0, groupPriority: i4, eventCallback: null, uninstallCallback: null })) };
- this._nameToGroup[e8] = n3;
- for (let r2 = n3.handlers.length - 1; r2 >= 0; r2--) {
- const e9 = n3.handlers[r2];
- this._handlers.push(e9), e9.handler.onInstall({ updateDependencies: () => {
- this.updateDependencies();
- }, emit: (t6, r3, i5, n4, s6) => {
- this._emitInputEvent(e9.priorityIndex + 1, t6, r3, i5, s6, n4);
- }, setPointerCapture: (t6, r3) => {
- this._setPointerCapture(n3, e9, t6, r3);
- }, setEventCallback: (t6) => {
- e9.eventCallback = t6;
- }, setUninstallCallback: (t6) => {
- e9.uninstallCallback = t6;
- }, refreshHasPendingInputs: () => {
- this.notifyChange("hasPendingInputs");
- } });
- }
- this.updateDependencies();
- }
- uninstallHandlers(e8) {
- const t5 = this._nameToGroup[e8];
- t5 ? (t5.handlers.forEach((e9) => {
- var _a;
- e9.removed = true, (_a = e9.uninstallCallback) == null ? void 0 : _a.call(e9);
- }), delete this._nameToGroup[e8], this._currentPropagation ? this._currentPropagation.needsHandlerGarbageCollect = true : this._garbageCollectRemovedHandlers()) : s.getLogger(this.declaredClass).error("There is no InputHandler group registered under the name `" + e8 + "`");
- }
- hasHandlers(e8) {
- return void 0 !== this._nameToGroup[e8];
- }
- updateDependencies() {
- if (this._currentPropagation)
- return void (this._updateDependenciesAfterPropagation = true);
- this._updateDependenciesAfterPropagation = false;
- const e8 = /* @__PURE__ */ new Set(), t5 = /* @__PURE__ */ new Set();
- this._handlersPriority = [];
- for (let r2 = this._handlers.length - 1; r2 >= 0; r2--) {
- const e9 = this._handlers[r2];
- e9.priorityIndex = r2, this._handlersPriority.push(e9);
- }
- this._handlersPriority = this._sortHandlersPriority(this._handlersPriority);
- for (let r2 = this._handlersPriority.length - 1; r2 >= 0; r2--) {
- const i4 = this._handlersPriority[r2];
- i4.priorityIndex = r2;
- let n3 = i4.handler.hasSideEffects;
- if (!n3) {
- for (const t6 of i4.handler.outgoingEventTypes)
- if (e8.has(t6)) {
- n3 = true;
- break;
- }
- }
- if (n3)
- for (const r3 of i4.handler.incomingEventMatches) {
- e8.add(r3.eventType);
- for (const e9 of r3.keyModifiers)
- a2(e9) || t5.add(e9);
- }
- i4.active = n3;
- }
- this._sourceEvents = e8, this._keyModifiers = t5, this._pointerCaptures.size > 0 && this._sourceEvents.add("pointer-capture-lost"), this._keyModifiers.size > 0 && (this._sourceEvents.add("key-down"), this._sourceEvents.add("key-up")), this.eventSource && (this.eventSource.activeEvents = this._sourceEvents);
- }
- _setLatestPointer(e8, t5, r2) {
- this._latestPointerType = e8;
- const n3 = this._get("latestPointerLocation");
- if (t(n3) || n3.x !== t5 || n3.y !== r2) {
- const e9 = this._propertiesPool.get("latestPointerLocation");
- e9.x = t5, e9.y = r2, this._set("latestPointerLocation", e9);
- }
- }
- _onEventReceived(e8, t5) {
- if ("pointer-capture-lost" === e8) {
- const e9 = t5;
- this._pointerCaptures.delete(e9.native.pointerId);
- }
- this._updateKeyModifiers(e8, t5);
- const r2 = null != this.test.timestamp ? this.test.timestamp : t5.native ? t5.native.timestamp : void 0, i4 = t5.native ? t5.native.cancelable : void 0;
- this._emitInputEventFromSource(e8, t5, r2, i4);
- }
- _updateKeyModifiers(e8, t5) {
- if (!t5)
- return;
- let r2 = false;
- const i4 = () => {
- if (!r2) {
- const e9 = /* @__PURE__ */ new Set();
- this._activeKeyModifiers.forEach((t6) => {
- e9.add(t6);
- }), this._activeKeyModifiers = e9, r2 = true;
- }
- }, n3 = (e9, t6) => {
- t6 && !this._activeKeyModifiers.has(e9) ? (i4(), this._activeKeyModifiers.add(e9)) : !t6 && this._activeKeyModifiers.has(e9) && (i4(), this._activeKeyModifiers.delete(e9));
- };
- if ("key-down" === e8 || "key-up" === e8) {
- const r3 = t5.key;
- this._keyModifiers.has(r3) && n3(r3, "key-down" === e8);
- }
- const s6 = t5.native;
- n3("Alt", !(!s6 || !s6.altKey)), n3("Ctrl", !(!s6 || !s6.ctrlKey)), n3("Shift", !(!s6 || !s6.shiftKey)), n3("Meta", !(!s6 || !s6.metaKey)), n3("Primary", this._activeKeyModifiers.has(this.primaryKey));
- }
- _installRecognizers() {
- this._latestPointerHandler = new s5((e8, t5, r2) => this._setLatestPointer(e8, t5, r2)), this._multiTouchHandler = new i3(), this.installHandlers("input-manager-logic", [this._latestPointerHandler, this._multiTouchHandler], P2.ALWAYS), this.recognizers.length > 0 && this.installHandlers("default", this.recognizers, P2.INTERNAL);
- }
- _setPointerCapture(e8, t5, r2, i4) {
- const n3 = e8.name + "-" + t5.priorityIndex, s6 = this._pointerCaptures.get(r2.pointerId) || /* @__PURE__ */ new Set();
- this._pointerCaptures.set(r2.pointerId, s6), i4 ? (s6.add(n3), 1 === s6.size && this.eventSource && this.eventSource.setPointerCapture(r2, true)) : s6.has(n3) && (s6.delete(n3), 0 === s6.size && (this._pointerCaptures.delete(r2.pointerId), this.eventSource && this.eventSource.setPointerCapture(r2, false)));
- }
- _garbageCollectRemovedHandlers() {
- this._handlers = this._handlers.filter((e8) => !e8.removed), this.updateDependencies();
- }
- _emitInputEventFromSource(e8, t5, r2, i4) {
- this._emitInputEvent(0, e8, t5, r2, i4);
- }
- _emitInputEvent(e8, t5, r2, i4, n3, s6) {
- const o3 = void 0 !== i4 ? i4 : this._currentPropagation ? this._currentPropagation.timestamp : performance.now(), a4 = void 0 !== n3 && n3, l2 = { event: new _(t5, r2, o3, s6 || this._activeKeyModifiers, a4), priorityIndex: e8 };
- this._currentPropagation ? this._currentPropagation.events.push(l2) : this._doNewPropagation(l2);
- }
- _doNewPropagation(e8) {
- this._currentPropagation = { events: new e2(), currentHandler: null, needsHandlerGarbageCollect: false, timestamp: e8.event.timestamp }, this._currentPropagation.events.push(e8), this._continuePropagation();
- }
- _continuePropagation() {
- var _a, _b;
- const e8 = f(this._currentPropagation);
- for (; e8.events.length > 0; ) {
- const { event: t5, priorityIndex: r2 } = e8.events.pop(), i4 = t5.data && t5.data.eventId;
- if (!(null != i4 && this._stoppedPropagationEventIds.has(i4)))
- for (e8.currentHandler = this._handlersPriority[r2]; e8.currentHandler; ) {
- if (e8.currentHandler.removed)
- e8.needsHandlerGarbageCollect = true;
- else {
- if (e8.currentHandler.active && !t5.shouldStopPropagation() && ((_b = (_a = e8.currentHandler).eventCallback) == null ? void 0 : _b.call(_a, t5)), t5.shouldStopPropagation()) {
- null != i4 && this._stoppedPropagationEventIds.add(i4);
- break;
- }
- if (t5.shouldPausePropagation(() => this._continuePropagation()))
- return void this._pausePropagation({ event: t5, priorityIndex: e8.currentHandler.priorityIndex + 1 });
- }
- e8.currentHandler = this._handlersPriority[e8.currentHandler.priorityIndex + 1];
- }
- }
- e8.needsHandlerGarbageCollect && this._garbageCollectRemovedHandlers(), this.hasPendingInputs || this._stoppedPropagationEventIds.clear(), this._currentPropagation = null, this._updateDependenciesAfterPropagation && this.updateDependencies();
- }
- _pausePropagation(e8) {
- const t5 = new e2();
- t5.push(e8);
- const r2 = this._currentPropagation;
- if (r2) {
- for (; r2.events.length; )
- t5.push(r2.events.pop());
- r2.events = t5, r2.currentHandler = null;
- }
- }
- _compareHandlerPriority(e8, t5) {
- if (e8.handler.hasSideEffects !== t5.handler.hasSideEffects)
- return e8.handler.hasSideEffects ? 1 : -1;
- if (e8.groupPriority !== t5.groupPriority)
- return e8.groupPriority > t5.groupPriority ? -1 : 1;
- for (const r2 of e8.handler.incomingEventMatches)
- for (const e9 of t5.handler.incomingEventMatches) {
- if (r2.eventType !== e9.eventType)
- continue;
- const t6 = r2.keyModifiers.filter((t7) => e9.keyModifiers.includes(t7));
- if (t6.length === r2.keyModifiers.length !== (t6.length === e9.keyModifiers.length))
- return r2.keyModifiers.length > e9.keyModifiers.length ? -1 : 1;
- }
- return e8.priorityIndex > t5.priorityIndex ? -1 : 1;
- }
- _sortHandlersPriority(e8) {
- const t5 = [];
- for (const r2 of e8) {
- let e9 = 0;
- for (; e9 < t5.length && this._compareHandlerPriority(r2, t5[e9]) >= 0; )
- e9++;
- t5.splice(e9, 0, r2);
- }
- return t5;
- }
- get debug() {
- const e8 = (e9) => {
- const t5 = this._setPointerCapture;
- this._setPointerCapture = () => {
- }, e9(), this._setPointerCapture = t5;
- };
- return { injectEvent: (t5, r2) => {
- e8(() => {
- this._onEventReceived(t5, r2);
- });
- }, disablePointerCapture: e8 };
- }
- };
- e([y2({ readOnly: true })], u2.prototype, "hasPendingInputs", null), e([y2({ constructOnly: true })], u2.prototype, "eventSource", void 0), e([y2({ constructOnly: true })], u2.prototype, "recognizers", void 0), e([y2()], u2.prototype, "_latestPointerType", void 0), e([y2()], u2.prototype, "latestPointerType", null), e([y2()], u2.prototype, "multiTouchActive", null), e([y2({ readOnly: true })], u2.prototype, "latestPointerLocation", void 0), u2 = e([n("esri.views.input.InputManager")], u2);
- var _ = class {
- constructor(e8, t5, r2, i4, n3) {
- this.type = e8, this.data = t5, this.timestamp = r2, this.modifiers = i4, this.cancelable = n3, this._propagationState = g2.NONE, this._resumeCallback = null;
- }
- stopPropagation() {
- this._propagationState |= g2.STOPPED;
- }
- shouldStopPropagation() {
- return 0 != (this._propagationState & g2.STOPPED);
- }
- async(e8) {
- this._propagationState |= g2.PAUSED;
- const t5 = (e9, t6) => {
- this._propagationState &= ~g2.PAUSED;
- const r2 = this._resumeCallback;
- if (this._resumeCallback = null, r2 && r2(), t6)
- throw e9;
- return e9;
- };
- return ("function" == typeof e8 ? e8() : e8).then((e9) => t5(e9, false), (e9) => t5(e9, true));
- }
- shouldPausePropagation(e8) {
- return !!(this._propagationState & g2.PAUSED) && (this._resumeCallback = e8, true);
- }
- preventDefault() {
- this.data.native.preventDefault();
- }
- };
- var g2;
- !function(e8) {
- e8[e8.NONE = 0] = "NONE", e8[e8.STOPPED = 1] = "STOPPED", e8[e8.PAUSED = 2] = "PAUSED";
- }(g2 || (g2 = {}));
- var P2 = { ALWAYS: 1, DEFAULT: 0, TOOL: -1, WIDGET: -2, INTERNAL: -3 };
- var v2 = class {
- };
- export {
- e3 as e,
- o2 as o,
- i2 as i,
- u2 as u,
- P2 as P,
- e4 as e2,
- r,
- l,
- s3 as s,
- w,
- m2 as m
- };
- //# sourceMappingURL=chunk-4NE3ZC7B.js.map
|