123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- import {
- e as e3
- } from "./chunk-GSSTTHIT.js";
- import {
- n as n2
- } from "./chunk-IM3LVQXV.js";
- import {
- e,
- n5 as n,
- s2 as s,
- v,
- y3 as y2
- } from "./chunk-2Z2TG5CU.js";
- import {
- e as e2,
- t
- } from "./chunk-U2XHEJM7.js";
- import {
- S,
- b
- } from "./chunk-SQOPWYIT.js";
- import {
- y
- } from "./chunk-SPWQ3AWG.js";
- import {
- x
- } from "./chunk-YXWMMD76.js";
- // node_modules/@arcgis/core/core/ObservableChangesType.js
- var E;
- !function(E3) {
- E3[E3.ADD = 1] = "ADD", E3[E3.REMOVE = 2] = "REMOVE", E3[E3.MOVE = 4] = "MOVE";
- }(E || (E = {}));
- // node_modules/@arcgis/core/core/accessorSupport/decorators/shared.js
- function n3(n4) {
- return (r, t2) => {
- r[t2] = n4;
- };
- }
- // node_modules/@arcgis/core/core/Collection.js
- var g;
- var p = class {
- constructor() {
- this.target = null, this.cancellable = false, this.defaultPrevented = false, this.item = void 0, this.type = void 0;
- }
- preventDefault() {
- this.cancellable && (this.defaultPrevented = true);
- }
- reset(e4) {
- this.defaultPrevented = false, this.item = e4;
- }
- };
- var b2 = new e2(p, void 0, (e4) => {
- e4.item = null, e4.target = null, e4.defaultPrevented = false, e4.cancellable = false;
- });
- var d = () => {
- };
- function v2(e4) {
- return e4 ? e4 instanceof V ? e4.toArray() : e4.length ? Array.prototype.slice.apply(e4) : [] : [];
- }
- function E2(e4) {
- if (e4 && e4.length)
- return e4[0];
- }
- function y3(e4, t2, s2, i) {
- const r = Math.min(e4.length - s2, t2.length - i);
- let n4 = 0;
- for (; n4 < r && e4[s2 + n4] === t2[i + n4]; )
- n4++;
- return n4;
- }
- function C(e4, t2, s2, i) {
- t2 && t2.forEach((t3, r, n4) => {
- e4.push(t3), C(e4, s2.call(i, t3, r, n4), s2, i);
- });
- }
- var A = /* @__PURE__ */ new Set();
- var O = /* @__PURE__ */ new Set();
- var M = /* @__PURE__ */ new Set();
- var D = /* @__PURE__ */ new Map();
- var x2 = 0;
- var V = g = class extends n2.EventedAccessor {
- constructor(e4) {
- super(e4), this._chgListeners = [], this._notifications = null, this._timer = null, this._observable = new e3(), this.length = 0, this._items = [], Object.defineProperty(this, "uid", { value: x2++ });
- }
- static isCollection(e4) {
- return null != e4 && e4 instanceof g;
- }
- normalizeCtorArgs(e4) {
- return e4 ? Array.isArray(e4) || e4 instanceof g ? { items: e4 } : e4 : {};
- }
- destroy() {
- this.removeAll();
- }
- *[Symbol.iterator]() {
- yield* this.items;
- }
- get items() {
- return s(this._observable), this._items;
- }
- set items(e4) {
- this._emitBeforeChanges(E.ADD) || (this._splice(0, this.length, v2(e4)), this._emitAfterChanges(E.ADD));
- }
- hasEventListener(e4) {
- return "change" === e4 ? this._chgListeners.length > 0 : this._emitter.hasEventListener(e4);
- }
- on(e4, t2) {
- if ("change" === e4) {
- const e5 = this._chgListeners, s2 = { removed: false, callback: t2 };
- return e5.push(s2), this._notifications && this._notifications.push({ listeners: e5.slice(), items: this._items.slice(), changes: [] }), { remove() {
- this.remove = d, s2.removed = true, e5.splice(e5.indexOf(s2), 1);
- } };
- }
- return this._emitter.on(e4, t2);
- }
- once(e4, t2) {
- const s2 = this.on(e4, t2);
- return { remove() {
- s2.remove();
- } };
- }
- add(e4, t2) {
- if (s(this._observable), this._emitBeforeChanges(E.ADD))
- return this;
- const s2 = this.getNextIndex(t2 != null ? t2 : null);
- return this._splice(s2, 0, [e4]), this._emitAfterChanges(E.ADD), this;
- }
- addMany(e4, t2 = this._items.length) {
- if (s(this._observable), !e4 || !e4.length)
- return this;
- if (this._emitBeforeChanges(E.ADD))
- return this;
- const s2 = this.getNextIndex(t2);
- return this._splice(s2, 0, v2(e4)), this._emitAfterChanges(E.ADD), this;
- }
- at(e4) {
- if (s(this._observable), (e4 = Math.trunc(e4) || 0) < 0 && (e4 += this.length), !(e4 < 0 || e4 >= this.length))
- return this._items[e4];
- }
- removeAll() {
- if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
- return [];
- const e4 = this._splice(0, this.length) || [];
- return this._emitAfterChanges(E.REMOVE), e4;
- }
- clone() {
- return s(this._observable), this._createNewInstance({ items: this._items.map(y) });
- }
- concat(...e4) {
- s(this._observable);
- const t2 = e4.map(v2);
- return this._createNewInstance({ items: this._items.concat(...t2) });
- }
- drain(e4, t2) {
- if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
- return;
- const s2 = x(this._splice(0, this.length)), i = s2.length;
- for (let r = 0; r < i; r++)
- e4.call(t2, s2[r], r, s2);
- this._emitAfterChanges(E.REMOVE);
- }
- every(e4, t2) {
- return s(this._observable), this._items.every(e4, t2);
- }
- filter(e4, t2) {
- let s2;
- return s(this._observable), s2 = 2 === arguments.length ? this._items.filter(e4, t2) : this._items.filter(e4), this._createNewInstance({ items: s2 });
- }
- find(e4, t2) {
- return s(this._observable), this._items.find(e4, t2);
- }
- findIndex(e4, t2) {
- return s(this._observable), this._items.findIndex(e4, t2);
- }
- flatten(e4, t2) {
- s(this._observable);
- const s2 = [];
- return C(s2, this, e4, t2), new g(s2);
- }
- forEach(e4, t2) {
- return s(this._observable), this._items.forEach(e4, t2);
- }
- getItemAt(e4) {
- return s(this._observable), this._items[e4];
- }
- getNextIndex(e4) {
- s(this._observable);
- const t2 = this.length;
- return (e4 = e4 != null ? e4 : t2) < 0 ? e4 = 0 : e4 > t2 && (e4 = t2), e4;
- }
- includes(e4, t2 = 0) {
- return s(this._observable), this._items.includes(e4, t2);
- }
- indexOf(e4, t2 = 0) {
- return s(this._observable), this._items.indexOf(e4, t2);
- }
- join(e4 = ",") {
- return s(this._observable), this._items.join(e4);
- }
- lastIndexOf(e4, t2 = this.length - 1) {
- return s(this._observable), this._items.lastIndexOf(e4, t2);
- }
- map(e4, t2) {
- s(this._observable);
- const s2 = this._items.map(e4, t2);
- return new g({ items: s2 });
- }
- reorder(e4, t2 = this.length - 1) {
- s(this._observable);
- const s2 = this.indexOf(e4);
- if (-1 !== s2) {
- if (t2 < 0 ? t2 = 0 : t2 >= this.length && (t2 = this.length - 1), s2 !== t2) {
- if (this._emitBeforeChanges(E.MOVE))
- return e4;
- this._splice(s2, 1), this._splice(t2, 0, [e4]), this._emitAfterChanges(E.MOVE);
- }
- return e4;
- }
- }
- pop() {
- if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
- return;
- const e4 = E2(this._splice(this.length - 1, 1));
- return this._emitAfterChanges(E.REMOVE), e4;
- }
- push(...e4) {
- return s(this._observable), this._emitBeforeChanges(E.ADD) || (this._splice(this.length, 0, e4), this._emitAfterChanges(E.ADD)), this.length;
- }
- reduce(e4, t2) {
- s(this._observable);
- const s2 = this._items;
- return 2 === arguments.length ? s2.reduce(e4, t2) : s2.reduce(e4);
- }
- reduceRight(e4, t2) {
- s(this._observable);
- const s2 = this._items;
- return 2 === arguments.length ? s2.reduceRight(e4, t2) : s2.reduceRight(e4);
- }
- remove(e4) {
- return s(this._observable), this.removeAt(this.indexOf(e4));
- }
- removeAt(e4) {
- if (s(this._observable), e4 < 0 || e4 >= this.length || this._emitBeforeChanges(E.REMOVE))
- return;
- const t2 = E2(this._splice(e4, 1));
- return this._emitAfterChanges(E.REMOVE), t2;
- }
- removeMany(e4) {
- if (s(this._observable), !e4 || !e4.length || this._emitBeforeChanges(E.REMOVE))
- return [];
- const t2 = e4 instanceof g ? e4.toArray() : e4, s2 = this._items, i = [], r = t2.length;
- for (let n4 = 0; n4 < r; n4++) {
- const e5 = t2[n4], r2 = s2.indexOf(e5);
- if (r2 > -1) {
- const e6 = 1 + y3(t2, s2, n4 + 1, r2 + 1), h = this._splice(r2, e6);
- h && h.length > 0 && i.push.apply(i, h), n4 += e6 - 1;
- }
- }
- return this._emitAfterChanges(E.REMOVE), i;
- }
- reverse() {
- if (s(this._observable), this._emitBeforeChanges(E.MOVE))
- return this;
- const e4 = this._splice(0, this.length);
- return e4 && (e4.reverse(), this._splice(0, 0, e4)), this._emitAfterChanges(E.MOVE), this;
- }
- shift() {
- if (s(this._observable), !this.length || this._emitBeforeChanges(E.REMOVE))
- return;
- const e4 = E2(this._splice(0, 1));
- return this._emitAfterChanges(E.REMOVE), e4;
- }
- slice(e4 = 0, t2 = this.length) {
- return s(this._observable), this._createNewInstance({ items: this._items.slice(e4, t2) });
- }
- some(e4, t2) {
- return s(this._observable), this._items.some(e4, t2);
- }
- sort(e4) {
- if (s(this._observable), !this.length || this._emitBeforeChanges(E.MOVE))
- return this;
- const t2 = x(this._splice(0, this.length));
- return arguments.length ? t2.sort(e4) : t2.sort(), this._splice(0, 0, t2), this._emitAfterChanges(E.MOVE), this;
- }
- splice(e4, t2, ...s2) {
- s(this._observable);
- const i = (t2 ? E.REMOVE : 0) | (s2.length ? E.ADD : 0);
- if (this._emitBeforeChanges(i))
- return [];
- const r = this._splice(e4, t2, s2) || [];
- return this._emitAfterChanges(i), r;
- }
- toArray() {
- return s(this._observable), this._items.slice();
- }
- toJSON() {
- return s(this._observable), this.toArray();
- }
- toLocaleString() {
- return s(this._observable), this._items.toLocaleString();
- }
- toString() {
- return s(this._observable), this._items.toString();
- }
- unshift(...e4) {
- return s(this._observable), !e4.length || this._emitBeforeChanges(E.ADD) || (this._splice(0, 0, e4), this._emitAfterChanges(E.ADD)), this.length;
- }
- _createNewInstance(e4) {
- return new this.constructor(e4);
- }
- _splice(e4, t2, s2) {
- const i = this._items, r = this.itemType;
- let n4, h;
- if (!this._notifications && this.hasEventListener("change") && (this._notifications = [{ listeners: this._chgListeners.slice(), items: this._items.slice(), changes: [] }], this._timer && this._timer.remove(), this._timer = v(() => this._dispatchChange())), t2) {
- if (h = i.splice(e4, t2), this.hasEventListener("before-remove")) {
- const t3 = b2.acquire();
- t3.target = this, t3.cancellable = true;
- for (let s3 = 0, r2 = h.length; s3 < r2; s3++)
- n4 = h[s3], t3.reset(n4), this.emit("before-remove", t3), t3.defaultPrevented && (h.splice(s3, 1), i.splice(e4, 0, n4), e4 += 1, s3 -= 1, r2 -= 1);
- b2.release(t3);
- }
- if (this.length = this._items.length, this.hasEventListener("after-remove")) {
- const e5 = b2.acquire();
- e5.target = this, e5.cancellable = false;
- const t3 = h.length;
- for (let s3 = 0; s3 < t3; s3++)
- e5.reset(h[s3]), this.emit("after-remove", e5);
- b2.release(e5);
- }
- }
- if (s2 && s2.length) {
- if (r) {
- const e5 = [];
- for (const t4 of s2) {
- const s3 = r.ensureType(t4);
- null == s3 && null != t4 || e5.push(s3);
- }
- s2 = e5;
- }
- const t3 = this.hasEventListener("before-add"), n5 = this.hasEventListener("after-add"), h2 = e4 === this.length;
- if (t3 || n5) {
- const r2 = b2.acquire();
- r2.target = this, r2.cancellable = true;
- const o = b2.acquire();
- o.target = this, o.cancellable = false;
- for (const l of s2)
- t3 ? (r2.reset(l), this.emit("before-add", r2), r2.defaultPrevented || (h2 ? i.push(l) : i.splice(e4++, 0, l), this._set("length", i.length), n5 && (o.reset(l), this.emit("after-add", o)))) : (h2 ? i.push(l) : i.splice(e4++, 0, l), this._set("length", i.length), o.reset(l), this.emit("after-add", o));
- b2.release(o), b2.release(r2);
- } else {
- if (h2)
- for (const e5 of s2)
- i.push(e5);
- else
- i.splice(e4, 0, ...s2);
- this._set("length", i.length);
- }
- }
- return (s2 && s2.length || h && h.length) && this._notifyChangeEvent(s2, h), h;
- }
- _emitBeforeChanges(e4) {
- let t2 = false;
- if (this.hasEventListener("before-changes")) {
- const s2 = b2.acquire();
- s2.target = this, s2.cancellable = true, s2.type = e4, this.emit("before-changes", s2), t2 = s2.defaultPrevented, b2.release(s2);
- }
- return t2;
- }
- _emitAfterChanges(e4) {
- if (this.hasEventListener("after-changes")) {
- const t2 = b2.acquire();
- t2.target = this, t2.cancellable = false, t2.type = e4, this.emit("after-changes", t2), b2.release(t2);
- }
- this._observable.notify();
- }
- _notifyChangeEvent(e4, t2) {
- this.hasEventListener("change") && this._notifications && this._notifications[this._notifications.length - 1].changes.push({ added: e4, removed: t2 });
- }
- _dispatchChange() {
- if (this._timer && (this._timer.remove(), this._timer = null), !this._notifications)
- return;
- const e4 = this._notifications;
- this._notifications = null;
- for (const s2 of e4) {
- const e5 = s2.changes;
- A.clear(), O.clear(), M.clear();
- for (const { added: t2, removed: s3 } of e5) {
- if (t2)
- if (0 === M.size && 0 === O.size)
- for (const e6 of t2)
- A.add(e6);
- else
- for (const e6 of t2)
- O.has(e6) ? (M.add(e6), O.delete(e6)) : M.has(e6) || A.add(e6);
- if (s3)
- if (0 === M.size && 0 === A.size)
- for (const e6 of s3)
- O.add(e6);
- else
- for (const e6 of s3)
- A.has(e6) ? A.delete(e6) : (M.delete(e6), O.add(e6));
- }
- const i = t.acquire();
- A.forEach((e6) => {
- i.push(e6);
- });
- const r = t.acquire();
- O.forEach((e6) => {
- r.push(e6);
- });
- const n4 = this._items, h = s2.items, o = t.acquire();
- if (M.forEach((e6) => {
- h.indexOf(e6) !== n4.indexOf(e6) && o.push(e6);
- }), s2.listeners && (i.length || r.length || o.length)) {
- const e6 = { target: this, added: i, removed: r, moved: o }, t2 = s2.listeners.length;
- for (let i2 = 0; i2 < t2; i2++) {
- const t3 = s2.listeners[i2];
- t3.removed || t3.callback.call(this, e6);
- }
- }
- t.release(i), t.release(r), t.release(o);
- }
- A.clear(), O.clear(), M.clear();
- }
- };
- V.ofType = (t2) => {
- if (!t2)
- return g;
- if (D.has(t2))
- return D.get(t2);
- let s2 = null;
- if ("function" == typeof t2)
- s2 = t2.prototype.declaredClass;
- else if (t2.base)
- s2 = t2.base.prototype.declaredClass;
- else
- for (const e4 in t2.typeMap) {
- const i2 = t2.typeMap[e4].prototype.declaredClass;
- s2 ? s2 += ` | ${i2}` : s2 = i2;
- }
- let i = class extends g {
- };
- return e([n3({ Type: t2, ensureType: "function" == typeof t2 ? b(t2) : S(t2) })], i.prototype, "itemType", void 0), i = e([n(`esri.core.Collection<${s2}>`)], i), D.set(t2, i), i;
- }, e([y2()], V.prototype, "length", void 0), e([y2()], V.prototype, "items", null), V = g = e([n("esri.core.Collection")], V);
- var j = V;
- export {
- n3 as n,
- j
- };
- //# sourceMappingURL=chunk-LBW34VZ2.js.map
|