PBFDecoderWorker-SIUZSYGK.js 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. import "./chunk-Q34L5KZA.js";
  2. import {
  3. t as t2
  4. } from "./chunk-54AOZV5X.js";
  5. import "./chunk-PK35UGFJ.js";
  6. import {
  7. me,
  8. ne
  9. } from "./chunk-FYNVVMWY.js";
  10. import "./chunk-Q52DVFYK.js";
  11. import "./chunk-HBMVUVZX.js";
  12. import {
  13. o
  14. } from "./chunk-TNLRDNTC.js";
  15. import "./chunk-WR32EHFC.js";
  16. import {
  17. a
  18. } from "./chunk-WNCU6BFU.js";
  19. import {
  20. y
  21. } from "./chunk-BJHM4JNS.js";
  22. import "./chunk-F6A2QQ26.js";
  23. import {
  24. n
  25. } from "./chunk-H2KDMZTR.js";
  26. import "./chunk-7ZIDBK7B.js";
  27. import {
  28. u
  29. } from "./chunk-N2663GRX.js";
  30. import "./chunk-O4FY3ITT.js";
  31. import "./chunk-ZOEK6QHJ.js";
  32. import "./chunk-XNLG7T2T.js";
  33. import "./chunk-IR4PV7VK.js";
  34. import "./chunk-2Z6LERTI.js";
  35. import "./chunk-OWVBLVP3.js";
  36. import "./chunk-PDKDCAAD.js";
  37. import "./chunk-ECW2QABR.js";
  38. import "./chunk-GCDJLKH4.js";
  39. import {
  40. k2 as k
  41. } from "./chunk-MRJEICT6.js";
  42. import {
  43. e4 as e
  44. } from "./chunk-Y3WMVFTW.js";
  45. import "./chunk-SAS7RONY.js";
  46. import "./chunk-WSRBH7BF.js";
  47. import "./chunk-IHXECKQQ.js";
  48. import "./chunk-ULGDPLM2.js";
  49. import "./chunk-EMJ4ZSM2.js";
  50. import "./chunk-IKP3YN53.js";
  51. import {
  52. t
  53. } from "./chunk-GZT4BVFP.js";
  54. import "./chunk-A5ICIBVI.js";
  55. // node_modules/@arcgis/core/layers/graphics/dehydratedFeatures.js
  56. var j = class {
  57. constructor(e3, t4, s3) {
  58. this.uid = e3, this.geometry = t4, this.attributes = s3, this.visible = true, this.objectId = null, this.centroid = null;
  59. }
  60. };
  61. var N = class {
  62. constructor() {
  63. this.exceededTransferLimit = false, this.features = [], this.fields = [], this.hasM = false, this.hasZ = false, this.geometryType = null, this.objectIdFieldName = null, this.globalIdFieldName = null, this.geometryProperties = null, this.geohashFieldName = null, this.spatialReference = null, this.transform = null;
  64. }
  65. };
  66. var P = a();
  67. var U = u();
  68. // node_modules/@arcgis/core/rest/query/operations/pbfDehydratedFeatureSet.js
  69. function u2(t4, e3) {
  70. return e3;
  71. }
  72. function p(t4, e3, r3, o3) {
  73. switch (r3) {
  74. case 0:
  75. return m2(t4, e3 + o3, 0);
  76. case 1:
  77. return t4.originPosition === "lowerLeft" ? m2(t4, e3 + o3, 1) : y2(t4, e3 + o3, 1);
  78. }
  79. }
  80. function d(t4, e3, r3, o3) {
  81. return r3 === 2 ? m2(t4, e3, 2) : p(t4, e3, r3, o3);
  82. }
  83. function c(t4, e3, r3, o3) {
  84. return r3 === 2 ? m2(t4, e3, 3) : p(t4, e3, r3, o3);
  85. }
  86. function f2(t4, e3, r3, o3) {
  87. return r3 === 3 ? m2(t4, e3, 3) : d(t4, e3, r3, o3);
  88. }
  89. function m2({ translate: t4, scale: e3 }, r3, o3) {
  90. return t4[o3] + r3 * e3[o3];
  91. }
  92. function y2({ translate: t4, scale: e3 }, r3, o3) {
  93. return t4[o3] - r3 * e3[o3];
  94. }
  95. var g = class {
  96. constructor(t4) {
  97. this.options = t4, this.geometryTypes = ["point", "multipoint", "polyline", "polygon"], this.previousCoordinate = [0, 0], this.transform = null, this.applyTransform = u2, this.lengths = [], this.currentLengthIndex = 0, this.toAddInCurrentPath = 0, this.vertexDimension = 0, this.coordinateBuffer = null, this.coordinateBufferPtr = 0, this._attributesConstructor = () => {
  98. };
  99. }
  100. createFeatureResult() {
  101. return new N();
  102. }
  103. finishFeatureResult(t4) {
  104. if (this.options.applyTransform && (t4.transform = null), this._attributesConstructor = () => {
  105. }, this.coordinateBuffer = null, this.lengths.length = 0, !t4.hasZ)
  106. return;
  107. const r3 = o(t4.geometryType, this.options.sourceSpatialReference, t4.spatialReference);
  108. if (!t(r3))
  109. for (const e3 of t4.features)
  110. r3(e3.geometry);
  111. }
  112. createSpatialReference() {
  113. return new k();
  114. }
  115. addField(t4, e3) {
  116. t4.fields.push(y.fromJSON(e3));
  117. const r3 = t4.fields.map((t5) => t5.name);
  118. this._attributesConstructor = function() {
  119. for (const t5 of r3)
  120. this[t5] = null;
  121. };
  122. }
  123. addFeature(t4, e3) {
  124. const r3 = this.options.maxStringAttributeLength ? this.options.maxStringAttributeLength : 0;
  125. if (r3 > 0)
  126. for (const o3 in e3.attributes) {
  127. const t5 = e3.attributes[o3];
  128. typeof t5 == "string" && t5.length > r3 && (e3.attributes[o3] = "");
  129. }
  130. t4.features.push(e3);
  131. }
  132. addQueryGeometry(t4, e3) {
  133. const { queryGeometry: r3, queryGeometryType: o3 } = e3, s3 = me(r3.clone(), r3, false, false, this.transform), i2 = ne(s3, o3, false, false);
  134. let n2 = null;
  135. switch (o3) {
  136. case "esriGeometryPoint":
  137. n2 = "point";
  138. break;
  139. case "esriGeometryPolygon":
  140. n2 = "polygon";
  141. break;
  142. case "esriGeometryPolyline":
  143. n2 = "polyline";
  144. break;
  145. case "esriGeometryMultipoint":
  146. n2 = "multipoint";
  147. }
  148. i2.type = n2, t4.queryGeometryType = o3, t4.queryGeometry = i2;
  149. }
  150. prepareFeatures(e3) {
  151. switch (this.transform = e3.transform, this.options.applyTransform && e3.transform && (this.applyTransform = this._deriveApplyTransform(e3)), this.vertexDimension = 2, e3.hasZ && this.vertexDimension++, e3.hasM && this.vertexDimension++, e3.geometryType) {
  152. case "point":
  153. this.addCoordinate = (t4, e4, r3) => this.addCoordinatePoint(t4, e4, r3), this.createGeometry = (t4) => this.createPointGeometry(t4);
  154. break;
  155. case "polygon":
  156. this.addCoordinate = (t4, e4, r3) => this._addCoordinatePolygon(t4, e4, r3), this.createGeometry = (t4) => this._createPolygonGeometry(t4);
  157. break;
  158. case "polyline":
  159. this.addCoordinate = (t4, e4, r3) => this._addCoordinatePolyline(t4, e4, r3), this.createGeometry = (t4) => this._createPolylineGeometry(t4);
  160. break;
  161. case "multipoint":
  162. this.addCoordinate = (t4, e4, r3) => this._addCoordinateMultipoint(t4, e4, r3), this.createGeometry = (t4) => this._createMultipointGeometry(t4);
  163. break;
  164. case "mesh":
  165. case "extent":
  166. break;
  167. default:
  168. n(e3.geometryType);
  169. }
  170. }
  171. createFeature() {
  172. return this.lengths.length = 0, this.currentLengthIndex = 0, this.previousCoordinate[0] = 0, this.previousCoordinate[1] = 0, new j(e(), null, new this._attributesConstructor());
  173. }
  174. allocateCoordinates() {
  175. const t4 = this.lengths.reduce((t5, e3) => t5 + e3, 0);
  176. this.coordinateBuffer = new Float64Array(t4 * this.vertexDimension), this.coordinateBufferPtr = 0;
  177. }
  178. addLength(t4, e3, r3) {
  179. this.lengths.length === 0 && (this.toAddInCurrentPath = e3), this.lengths.push(e3);
  180. }
  181. createPointGeometry(t4) {
  182. const e3 = { type: "point", x: 0, y: 0, spatialReference: t4.spatialReference, hasZ: !!t4.hasZ, hasM: !!t4.hasM };
  183. return e3.hasZ && (e3.z = 0), e3.hasM && (e3.m = 0), e3;
  184. }
  185. addCoordinatePoint(t4, e3, r3) {
  186. switch (e3 = this.applyTransform(this.transform, e3, r3, 0), r3) {
  187. case 0:
  188. t4.x = e3;
  189. break;
  190. case 1:
  191. t4.y = e3;
  192. break;
  193. case 2:
  194. t4.hasZ ? t4.z = e3 : t4.m = e3;
  195. break;
  196. case 3:
  197. t4.m = e3;
  198. }
  199. }
  200. _transformPathLikeValue(t4, e3) {
  201. let r3 = 0;
  202. return e3 <= 1 && (r3 = this.previousCoordinate[e3], this.previousCoordinate[e3] += t4), this.applyTransform(this.transform, t4, e3, r3);
  203. }
  204. _addCoordinatePolyline(t4, e3, r3) {
  205. this._dehydratedAddPointsCoordinate(t4.paths, e3, r3);
  206. }
  207. _addCoordinatePolygon(t4, e3, r3) {
  208. this._dehydratedAddPointsCoordinate(t4.rings, e3, r3);
  209. }
  210. _addCoordinateMultipoint(t4, e3, r3) {
  211. r3 === 0 && t4.points.push([]);
  212. const o3 = this._transformPathLikeValue(e3, r3);
  213. t4.points[t4.points.length - 1].push(o3);
  214. }
  215. _createPolygonGeometry(t4) {
  216. return { type: "polygon", rings: [[]], spatialReference: t4.spatialReference, hasZ: !!t4.hasZ, hasM: !!t4.hasM };
  217. }
  218. _createPolylineGeometry(t4) {
  219. return { type: "polyline", paths: [[]], spatialReference: t4.spatialReference, hasZ: !!t4.hasZ, hasM: !!t4.hasM };
  220. }
  221. _createMultipointGeometry(t4) {
  222. return { type: "multipoint", points: [], spatialReference: t4.spatialReference, hasZ: !!t4.hasZ, hasM: !!t4.hasM };
  223. }
  224. _dehydratedAddPointsCoordinate(t4, e3, r3) {
  225. r3 === 0 && this.toAddInCurrentPath-- == 0 && (t4.push([]), this.toAddInCurrentPath = this.lengths[++this.currentLengthIndex] - 1, this.previousCoordinate[0] = 0, this.previousCoordinate[1] = 0);
  226. const o3 = this._transformPathLikeValue(e3, r3), s3 = t4[t4.length - 1];
  227. r3 === 0 && s3.push(new Float64Array(this.coordinateBuffer.buffer, this.coordinateBufferPtr * Float64Array.BYTES_PER_ELEMENT, this.vertexDimension)), this.coordinateBuffer[this.coordinateBufferPtr++] = o3;
  228. }
  229. _deriveApplyTransform(t4) {
  230. const { hasZ: e3, hasM: r3 } = t4;
  231. return e3 && r3 ? f2 : e3 ? d : r3 ? c : p;
  232. }
  233. };
  234. // node_modules/@arcgis/core/views/3d/support/PBFDecoderWorker.js
  235. var t3 = class {
  236. _parseFeatureQuery(t4) {
  237. const s3 = t2(t4.buffer, new g(t4.options)), o3 = { ...s3, spatialReference: s3.spatialReference.toJSON(), fields: s3.fields ? s3.fields.map((e3) => e3.toJSON()) : void 0 };
  238. return Promise.resolve(o3);
  239. }
  240. };
  241. function s2() {
  242. return new t3();
  243. }
  244. export {
  245. s2 as default
  246. };
  247. //# sourceMappingURL=PBFDecoderWorker-SIUZSYGK.js.map