chunk-V7H6CJ37.js 1.7 KB

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