chunk-77N52HSV.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. import {
  2. p
  3. } from "./chunk-V7H6CJ37.js";
  4. import {
  5. b
  6. } from "./chunk-4DDBH2K5.js";
  7. import {
  8. n as n2
  9. } from "./chunk-AFZ7XSEW.js";
  10. import {
  11. j
  12. } from "./chunk-ALDCDSPV.js";
  13. import {
  14. d,
  15. e,
  16. n2 as n
  17. } from "./chunk-Y3WMVFTW.js";
  18. import {
  19. k
  20. } from "./chunk-ULGDPLM2.js";
  21. import {
  22. s
  23. } from "./chunk-EMJ4ZSM2.js";
  24. // node_modules/@arcgis/core/support/collectionUtils.js
  25. function t(t2) {
  26. return new p({ getCollections: () => [t2.tables, t2.layers], getChildrenFunction: (e2) => {
  27. const t3 = [];
  28. return "tables" in e2 && t3.push(e2.tables), "layers" in e2 && t3.push(e2.layers), t3;
  29. }, itemFilterFunction: (e2) => {
  30. const t3 = e2.parent;
  31. return t3 && "tables" in t3 && t3.tables.includes(e2);
  32. } });
  33. }
  34. // node_modules/@arcgis/core/support/LayersMixin.js
  35. function n3(e2, r, t2) {
  36. let s2, o;
  37. if (e2)
  38. for (let a2 = 0, i = e2.length; a2 < i; a2++) {
  39. if (s2 = e2.getItemAt(a2), s2[r] === t2)
  40. return s2;
  41. if (s2?.type === "group" && (o = n3(s2.layers, r, t2), o))
  42. return o;
  43. }
  44. }
  45. var d2 = s.getLogger("esri.support.LayersMixin");
  46. var y = (s2) => {
  47. let y2 = class extends s2 {
  48. constructor(...e2) {
  49. super(...e2), this.layers = new j();
  50. const t2 = (e3) => {
  51. e3.parent && "remove" in e3.parent && e3.parent.remove(e3);
  52. }, s3 = (e3) => {
  53. e3.parent = this, this.layerAdded(e3), e3.type !== "elevation" && e3.type !== "base-elevation" || d2.error(`Layer 'title:${e3.title}, id:${e3.id}' of type '${e3.type}' is not supported as an operational layer and will therefore be ignored.`);
  54. }, o = (e3) => {
  55. e3.parent = null, this.layerRemoved(e3);
  56. };
  57. this.layers.on("before-add", (e3) => t2(e3.item)), this.layers.on("after-add", (e3) => s3(e3.item)), this.layers.on("after-remove", (e3) => o(e3.item));
  58. }
  59. destroy() {
  60. const e2 = this.layers.removeAll();
  61. for (const r of e2)
  62. this.layerRemoved(r), r.destroy();
  63. this.layers.destroy();
  64. }
  65. set layers(e2) {
  66. this._set("layers", n2(e2, this._get("layers")));
  67. }
  68. add(e2, r) {
  69. const t2 = this.layers;
  70. if (r = t2.getNextIndex(r), e2 instanceof b) {
  71. const s3 = e2;
  72. s3.parent === this ? this.reorder(s3, r) : t2.add(s3, r);
  73. } else
  74. k(e2) ? e2.then((e3) => {
  75. this.destroyed || this.add(e3, r);
  76. }) : d2.error("#add()", "The item being added is not a Layer or a Promise that resolves to a Layer.");
  77. }
  78. addMany(e2, r) {
  79. const t2 = this.layers;
  80. r = t2.getNextIndex(r), e2.slice().forEach((e3) => {
  81. e3.parent !== this ? (t2.add(e3, r), r += 1) : this.reorder(e3, r);
  82. });
  83. }
  84. findLayerById(e2) {
  85. return n3(this.layers, "id", e2);
  86. }
  87. findLayerByUid(e2) {
  88. return n3(this.layers, "uid", e2);
  89. }
  90. remove(e2) {
  91. return this.layers.remove(e2);
  92. }
  93. removeMany(e2) {
  94. return this.layers.removeMany(e2);
  95. }
  96. removeAll() {
  97. return this.layers.removeAll();
  98. }
  99. reorder(e2, r) {
  100. return this.layers.reorder(e2, r);
  101. }
  102. layerAdded(e2) {
  103. }
  104. layerRemoved(e2) {
  105. }
  106. };
  107. return e([d()], y2.prototype, "layers", null), y2 = e([n("esri.support.LayersMixin")], y2), y2;
  108. };
  109. // node_modules/@arcgis/core/support/TablesMixin.js
  110. var a = "esri.support.TablesMixin";
  111. var l = s.getLogger(a);
  112. function n4(t2, e2, r) {
  113. if (t2)
  114. for (let s2 = 0, o = t2.length; s2 < o; s2++) {
  115. const o2 = t2.getItemAt(s2);
  116. if (o2[e2] === r)
  117. return o2;
  118. if (o2?.type === "group") {
  119. const t3 = n4(o2.tables, e2, r);
  120. if (t3)
  121. return t3;
  122. }
  123. }
  124. }
  125. var p2 = (s2) => {
  126. let p3 = class extends s2 {
  127. constructor(...t2) {
  128. super(...t2), this.tables = new j(), this.tables.on("after-add", (t3) => {
  129. const e2 = t3.item;
  130. e2.parent && e2.parent !== this && "tables" in e2.parent && e2.parent.tables.remove(e2), e2.parent = this, e2.type !== "feature" && l.error(`Layer 'title:${e2.title}, id:${e2.id}' of type '${e2.type}' is not supported as a table and will therefore be ignored.`);
  131. }), this.tables.on("after-remove", (t3) => {
  132. t3.item.parent = null;
  133. });
  134. }
  135. destroy() {
  136. const t2 = this.tables.removeAll();
  137. for (const e2 of t2)
  138. e2.destroy();
  139. this.tables.destroy();
  140. }
  141. set tables(t2) {
  142. this._set("tables", n2(t2, this._get("tables")));
  143. }
  144. findTableById(t2) {
  145. return n4(this.tables, "id", t2);
  146. }
  147. findTableByUid(t2) {
  148. return n4(this.tables, "uid", t2);
  149. }
  150. };
  151. return e([d()], p3.prototype, "tables", null), p3 = e([n(a)], p3), p3;
  152. };
  153. export {
  154. t,
  155. y,
  156. p2 as p
  157. };
  158. //# sourceMappingURL=chunk-77N52HSV.js.map