chunk-P2L4QEOI.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. import {
  2. e
  3. } from "./chunk-M5BTTMP6.js";
  4. import {
  5. ne
  6. } from "./chunk-FYNVVMWY.js";
  7. import {
  8. t as t2
  9. } from "./chunk-HBMVUVZX.js";
  10. import {
  11. d
  12. } from "./chunk-2Z6LERTI.js";
  13. import {
  14. a,
  15. c,
  16. r,
  17. t
  18. } from "./chunk-GZT4BVFP.js";
  19. // node_modules/@arcgis/core/views/2d/layers/features/support/StaticBitSet.js
  20. var t3 = class {
  21. constructor(t4, e2) {
  22. this._mask = 0, this._buf = t4, this._mask = e2;
  23. }
  24. static fromBuffer(e2, s) {
  25. return new t3(e2, s);
  26. }
  27. static create(e2, s = 4294967295) {
  28. const r2 = new Uint32Array(Math.ceil(e2 / 32));
  29. return new t3(r2, s);
  30. }
  31. _getIndex(t4) {
  32. return Math.floor(t4 / 32);
  33. }
  34. has(t4) {
  35. const e2 = this._mask & t4;
  36. return !!(this._buf[this._getIndex(e2)] & 1 << e2 % 32);
  37. }
  38. hasRange(t4, e2) {
  39. let s = t4, r2 = e2;
  40. for (; s % 32 && s !== r2; ) {
  41. if (this.has(s))
  42. return true;
  43. s++;
  44. }
  45. for (; r2 % 32 && s !== r2; ) {
  46. if (this.has(s))
  47. return true;
  48. r2--;
  49. }
  50. if (s === r2)
  51. return false;
  52. for (let h2 = s / 32; h2 !== r2 / 32; h2++) {
  53. if (this._buf[h2])
  54. return true;
  55. }
  56. return false;
  57. }
  58. set(t4) {
  59. const e2 = this._mask & t4, s = this._getIndex(e2), r2 = 1 << e2 % 32;
  60. this._buf[s] |= r2;
  61. }
  62. setRange(t4, e2) {
  63. let s = t4, r2 = e2;
  64. for (; s % 32 && s !== r2; )
  65. this.set(s++);
  66. for (; r2 % 32 && s !== r2; )
  67. this.set(r2--);
  68. if (s !== r2)
  69. for (let h2 = s / 32; h2 !== r2 / 32; h2++)
  70. this._buf[h2] = 4294967295;
  71. }
  72. unset(t4) {
  73. const e2 = this._mask & t4, s = this._getIndex(e2), r2 = 1 << e2 % 32;
  74. this._buf[s] &= 4294967295 ^ r2;
  75. }
  76. resize(t4) {
  77. const e2 = this._buf, s = new Uint32Array(Math.ceil(t4 / 32));
  78. s.set(e2), this._buf = s;
  79. }
  80. or(t4) {
  81. for (let e2 = 0; e2 < this._buf.length; e2++)
  82. this._buf[e2] |= t4._buf[e2];
  83. return this;
  84. }
  85. and(t4) {
  86. for (let e2 = 0; e2 < this._buf.length; e2++)
  87. this._buf[e2] &= t4._buf[e2];
  88. return this;
  89. }
  90. xor(t4) {
  91. for (let e2 = 0; e2 < this._buf.length; e2++)
  92. this._buf[e2] ^= t4._buf[e2];
  93. return this;
  94. }
  95. ior(t4) {
  96. for (let e2 = 0; e2 < this._buf.length; e2++)
  97. this._buf[e2] |= ~t4._buf[e2];
  98. return this;
  99. }
  100. iand(t4) {
  101. for (let e2 = 0; e2 < this._buf.length; e2++)
  102. this._buf[e2] &= ~t4._buf[e2];
  103. return this;
  104. }
  105. ixor(t4) {
  106. for (let e2 = 0; e2 < this._buf.length; e2++)
  107. this._buf[e2] ^= ~t4._buf[e2];
  108. return this;
  109. }
  110. any() {
  111. for (let t4 = 0; t4 < this._buf.length; t4++)
  112. if (this._buf[t4])
  113. return true;
  114. return false;
  115. }
  116. copy(t4) {
  117. for (let e2 = 0; e2 < this._buf.length; e2++)
  118. this._buf[e2] = t4._buf[e2];
  119. return this;
  120. }
  121. clone() {
  122. return new t3(this._buf.slice(), this._mask);
  123. }
  124. clear() {
  125. for (let t4 = 0; t4 < this._buf.length; t4++)
  126. this._buf[t4] = 0;
  127. }
  128. forEachSet(t4) {
  129. for (let e2 = 0; e2 < this._buf.length; e2++) {
  130. let s = this._buf[e2], r2 = 32 * e2;
  131. if (s)
  132. for (; s; ) {
  133. 1 & s && t4(r2), s >>>= 1, r2++;
  134. }
  135. }
  136. }
  137. countSet() {
  138. let t4 = 0;
  139. return this.forEachSet((e2) => {
  140. t4++;
  141. }), t4;
  142. }
  143. };
  144. // node_modules/@arcgis/core/views/2d/layers/features/support/FeatureSetReader.js
  145. var h = 0;
  146. var u = a("featurelayer-simplify-thresholds") ?? [0.5, 0.5, 0.5, 0.5];
  147. var l = u[0];
  148. var c2 = u[1];
  149. var m = u[2];
  150. var g = u[3];
  151. var _ = a("featurelayer-simplify-payload-size-factors") ?? [1, 2, 4];
  152. var y = _[0];
  153. var p = _[1];
  154. var f = _[2];
  155. var I = a("featurelayer-simplify-mobile-factor") ?? 2;
  156. var x = a("esri-mobile");
  157. var A = class {
  158. constructor(e2, t4) {
  159. this.type = "FeatureSetReader", this.arcadeDeclaredClass = "esri.arcade.Feature", this.seen = false, this.instance = 0, this._tx = 0, this._ty = 0, this._sx = 1, this._sy = 1, this._deleted = null, this._joined = [], this._objectIdToIndex = null, this._level = 0, this.instance = e2, this._layerSchema = t4;
  160. }
  161. static createInstance() {
  162. return h++, h = h > 65535 ? 0 : h, h;
  163. }
  164. get isEmpty() {
  165. return r(this._deleted) && this._deleted.countSet() === this.getSize();
  166. }
  167. set level(e2) {
  168. this._level = e2;
  169. }
  170. getAreaSimplificationThreshold(e2, t4) {
  171. let r2 = 1;
  172. const s = x ? I : 1;
  173. t4 > 4e6 ? r2 = f * s : t4 > 1e6 ? r2 = p * s : t4 > 5e5 ? r2 = y * s : t4 > 1e5 && (r2 = s);
  174. let i = 0;
  175. e2 > 4e3 ? i = g * r2 : e2 > 2e3 ? i = m * r2 : e2 > 100 ? i = c2 : e2 > 15 && (i = l);
  176. let o = 8;
  177. return this._level < 4 ? o = 1 : this._level < 5 ? o = 2 : this._level < 6 && (o = 4), i * o;
  178. }
  179. setArcadeSpatialReference(e2) {
  180. this._arcadeSpatialReference = e2;
  181. }
  182. attachStorage(e2) {
  183. this._storage = e2;
  184. }
  185. getQuantizationTransform() {
  186. throw new Error("Unable to find transform for featureSet");
  187. }
  188. getStorage() {
  189. return this._storage;
  190. }
  191. getComputedNumeric(e2) {
  192. return this.getComputedNumericAtIndex(0);
  193. }
  194. setComputedNumeric(e2, t4) {
  195. return this.setComputedNumericAtIndex(t4, 0);
  196. }
  197. getComputedString(e2) {
  198. return this.getComputedStringAtIndex(0);
  199. }
  200. setComputedString(e2, t4) {
  201. return this.setComputedStringAtIndex(0, t4);
  202. }
  203. getComputedNumericAtIndex(e2) {
  204. return this._storage.getComputedNumericAtIndex(this.getDisplayId(), e2);
  205. }
  206. setComputedNumericAtIndex(e2, t4) {
  207. this._storage.setComputedNumericAtIndex(this.getDisplayId(), e2, t4);
  208. }
  209. getComputedStringAtIndex(e2) {
  210. return this._storage.getComputedStringAtIndex(this.getDisplayId(), e2);
  211. }
  212. setComputedStringAtIndex(e2, t4) {
  213. return this._storage.setComputedStringAtIndex(this.getDisplayId(), e2, t4);
  214. }
  215. transform(e2, t4, r2, s) {
  216. const i = this.copy();
  217. return i._tx += e2, i._ty += t4, i._sx *= r2, i._sy *= s, i;
  218. }
  219. readAttribute(e2, t4 = false) {
  220. const r2 = this._readAttribute(e2, t4);
  221. if (r2 !== void 0)
  222. return r2;
  223. for (const s of this._joined) {
  224. s.setIndex(this.getIndex());
  225. const r3 = s._readAttribute(e2, t4);
  226. if (r3 !== void 0)
  227. return r3;
  228. }
  229. }
  230. readAttributes() {
  231. const e2 = this._readAttributes();
  232. for (const t4 of this._joined) {
  233. t4.setIndex(this.getIndex());
  234. const r2 = t4._readAttributes();
  235. for (const t5 of Object.keys(r2))
  236. e2[t5] = r2[t5];
  237. }
  238. return e2;
  239. }
  240. joinAttributes(e2) {
  241. this._joined.push(e2);
  242. }
  243. readArcadeFeature() {
  244. return this;
  245. }
  246. geometry() {
  247. const e2 = this.readHydratedGeometry(), t4 = ne(e2, this.geometryType, this.hasZ, this.hasM), r2 = d(t4);
  248. return r2 && (r2.spatialReference = this._arcadeSpatialReference), r2;
  249. }
  250. field(e2) {
  251. if (this.hasField(e2))
  252. return this.readAttribute(e2, true);
  253. for (const t4 of this._joined)
  254. if (t4.setIndex(this.getIndex()), t4.hasField(e2)) {
  255. return t4._readAttribute(e2, true);
  256. }
  257. throw new Error(`Field ${e2} does not exist`);
  258. }
  259. setField(e2, t4) {
  260. throw new Error("Unable to update feature attribute values, feature is readonly");
  261. }
  262. keys() {
  263. return this.getFieldNames();
  264. }
  265. castToText() {
  266. return JSON.stringify(this.readLegacyFeature());
  267. }
  268. gdbVersion() {
  269. return null;
  270. }
  271. fullSchema() {
  272. return this._layerSchema;
  273. }
  274. castAsJson(e2 = null) {
  275. return { attributes: this._readAttributes(), geometry: e2?.keepGeometryType === true ? this.geometry() : this.geometry().toJSON() };
  276. }
  277. castAsJsonAsync(e2 = null, t4 = null) {
  278. return Promise.resolve(this.castAsJson(t4));
  279. }
  280. removeIds(e2) {
  281. if (t(this._objectIdToIndex)) {
  282. const e3 = new Map(), t5 = this.getCursor();
  283. for (; t5.next(); )
  284. e3.set(t5.getObjectId(), t5.getIndex());
  285. this._objectIdToIndex = e3;
  286. }
  287. const t4 = this._objectIdToIndex;
  288. for (const r2 of e2)
  289. t4.has(r2) && this.removeAtIndex(t4.get(r2));
  290. }
  291. removeAtIndex(e2) {
  292. t(this._deleted) && (this._deleted = t3.create(this.getSize())), this._deleted.set(e2);
  293. }
  294. readGeometryForDisplay() {
  295. return this.readUnquantizedGeometry(true);
  296. }
  297. readLegacyGeometryForDisplay() {
  298. return this.readLegacyGeometry(true);
  299. }
  300. *features() {
  301. const e2 = this.getCursor();
  302. for (; e2.next(); )
  303. yield e2.readOptimizedFeature();
  304. }
  305. _getExists() {
  306. return t(this._deleted) || !this._deleted.has(this.getIndex());
  307. }
  308. _computeCentroid() {
  309. if (this.geometryType !== "esriGeometryPolygon")
  310. return null;
  311. const e2 = this.readUnquantizedGeometry();
  312. if (!e2 || e2.hasIndeterminateRingOrder)
  313. return null;
  314. const t4 = c(this.getQuantizationTransform(), null);
  315. return e(new t2(), e2, this.hasM, this.hasZ, t4);
  316. }
  317. copyInto(e2) {
  318. e2.seen = this.seen, e2._storage = this._storage, e2._arcadeSpatialReference = this._arcadeSpatialReference, e2._joined = this._joined, e2._tx = this._tx, e2._ty = this._ty, e2._sx = this._sx, e2._sy = this._sy, e2._deleted = this._deleted, e2._objectIdToIndex = this._objectIdToIndex;
  319. }
  320. };
  321. export {
  322. t3 as t,
  323. A
  324. };
  325. //# sourceMappingURL=chunk-P2L4QEOI.js.map