chunk-CDZENOCQ.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {
  2. j
  3. } from "./chunk-LBW34VZ2.js";
  4. import {
  5. e,
  6. l2 as l,
  7. n5 as n,
  8. y3 as y
  9. } from "./chunk-2Z2TG5CU.js";
  10. import {
  11. r,
  12. t
  13. } from "./chunk-YXWMMD76.js";
  14. // node_modules/@arcgis/core/core/CollectionFlattener.js
  15. var c = class extends j {
  16. constructor(t2) {
  17. super(t2), this.getCollections = null;
  18. }
  19. initialize() {
  20. this.own(l(() => this._refresh()));
  21. }
  22. destroy() {
  23. this.getCollections = null;
  24. }
  25. _refresh() {
  26. const t2 = r(this.getCollections) ? this.getCollections() : null;
  27. if (t(t2))
  28. return void this.removeAll();
  29. let o = 0;
  30. for (const r2 of t2)
  31. r(r2) && (o = this._processCollection(o, r2));
  32. this.splice(o, this.length);
  33. }
  34. _createNewInstance(t2) {
  35. return new j(t2);
  36. }
  37. _processCollection(t2, o) {
  38. if (!o)
  39. return t2;
  40. const s = this.itemFilterFunction ? this.itemFilterFunction : (t3) => !!t3;
  41. for (const r2 of o)
  42. if (r2) {
  43. if (s(r2)) {
  44. const o2 = this.indexOf(r2, t2);
  45. o2 >= 0 ? o2 !== t2 && this.reorder(r2, t2) : this.add(r2, t2), ++t2;
  46. }
  47. if (this.getChildrenFunction) {
  48. const o2 = this.getChildrenFunction(r2);
  49. if (Array.isArray(o2))
  50. for (const s2 of o2)
  51. t2 = this._processCollection(t2, s2);
  52. else
  53. t2 = this._processCollection(t2, o2);
  54. }
  55. }
  56. return t2;
  57. }
  58. };
  59. e([y()], c.prototype, "getCollections", void 0), e([y()], c.prototype, "getChildrenFunction", void 0), e([y()], c.prototype, "itemFilterFunction", void 0), c = e([n("esri.core.CollectionFlattener")], c);
  60. var l2 = c;
  61. export {
  62. l2 as l
  63. };
  64. //# sourceMappingURL=chunk-CDZENOCQ.js.map