PBFDecoderWorker-IGUUFCFU.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. import "./chunk-UMUHMVL4.js";
  2. import {
  3. t as t2
  4. } from "./chunk-XJHQZ4NT.js";
  5. import "./chunk-CFVLY6NB.js";
  6. import {
  7. pt,
  8. rt
  9. } from "./chunk-JKFWEHNK.js";
  10. import "./chunk-EDHROVWI.js";
  11. import "./chunk-3IRT3YKJ.js";
  12. import {
  13. o
  14. } from "./chunk-SAJAEMIJ.js";
  15. import "./chunk-OJ2HHY2O.js";
  16. import {
  17. a
  18. } from "./chunk-ECY35CJI.js";
  19. import {
  20. y
  21. } from "./chunk-JGBXYDGB.js";
  22. import "./chunk-QEWF7QPH.js";
  23. import {
  24. u
  25. } from "./chunk-2H5MD622.js";
  26. import "./chunk-3RSFVUKZ.js";
  27. import {
  28. n
  29. } from "./chunk-O6VYMEIX.js";
  30. import "./chunk-5N7JLUJJ.js";
  31. import "./chunk-RYY6632W.js";
  32. import "./chunk-DW42UVIT.js";
  33. import "./chunk-YAEIHDJH.js";
  34. import "./chunk-TJNOJH33.js";
  35. import "./chunk-OSHI574D.js";
  36. import "./chunk-75U5LM2V.js";
  37. import "./chunk-RMDDCMKS.js";
  38. import "./chunk-VCH45Q2I.js";
  39. import "./chunk-HZRKBTHJ.js";
  40. import "./chunk-6T6G6LCQ.js";
  41. import "./chunk-YEJL5NEF.js";
  42. import {
  43. k2 as k
  44. } from "./chunk-PQFTYGF5.js";
  45. import {
  46. e4 as e
  47. } from "./chunk-2Z2TG5CU.js";
  48. import "./chunk-6KZ2LTDA.js";
  49. import "./chunk-U2XHEJM7.js";
  50. import "./chunk-SQOPWYIT.js";
  51. import "./chunk-V6P2MAQQ.js";
  52. import "./chunk-E5O6P5I2.js";
  53. import "./chunk-SPWQ3AWG.js";
  54. import "./chunk-2TIUKVZN.js";
  55. import {
  56. t
  57. } from "./chunk-YXWMMD76.js";
  58. import "./chunk-S5KM4IGW.js";
  59. // node_modules/@arcgis/core/layers/graphics/dehydratedFeatures.js
  60. var j = class {
  61. constructor(e3, t5, s3) {
  62. this.uid = e3, this.geometry = t5, this.attributes = s3, this.visible = true, this.objectId = null, this.centroid = null;
  63. }
  64. };
  65. var N = class {
  66. constructor() {
  67. 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;
  68. }
  69. };
  70. var P = a();
  71. var U = u();
  72. // node_modules/@arcgis/core/rest/query/operations/pbfDehydratedFeatureSet.js
  73. function u2(t5, e3) {
  74. return e3;
  75. }
  76. function p(t5, e3, r2, s3) {
  77. switch (r2) {
  78. case 0:
  79. return m2(t5, e3 + s3, 0);
  80. case 1:
  81. return "lowerLeft" === t5.originPosition ? m2(t5, e3 + s3, 1) : y2(t5, e3 + s3, 1);
  82. }
  83. }
  84. function c(t5, e3, r2, s3) {
  85. return 2 === r2 ? m2(t5, e3, 2) : p(t5, e3, r2, s3);
  86. }
  87. function d(t5, e3, r2, s3) {
  88. return 2 === r2 ? m2(t5, e3, 3) : p(t5, e3, r2, s3);
  89. }
  90. function f2(t5, e3, r2, s3) {
  91. return 3 === r2 ? m2(t5, e3, 3) : c(t5, e3, r2, s3);
  92. }
  93. function m2({ translate: t5, scale: e3 }, r2, s3) {
  94. return t5[s3] + r2 * e3[s3];
  95. }
  96. function y2({ translate: t5, scale: e3 }, r2, s3) {
  97. return t5[s3] - r2 * e3[s3];
  98. }
  99. var _ = class {
  100. constructor(t5) {
  101. this._options = t5, 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 = class {
  102. };
  103. }
  104. createFeatureResult() {
  105. return new N();
  106. }
  107. finishFeatureResult(t5) {
  108. if (this._options.applyTransform && (t5.transform = null), this._attributesConstructor = class {
  109. }, this._coordinateBuffer = null, this._lengths.length = 0, !t5.hasZ)
  110. return;
  111. const r2 = o(t5.geometryType, this._options.sourceSpatialReference, t5.spatialReference);
  112. if (!t(r2))
  113. for (const e3 of t5.features)
  114. r2(e3.geometry);
  115. }
  116. createSpatialReference() {
  117. return new k();
  118. }
  119. addField(t5, e3) {
  120. t5.fields.push(y.fromJSON(e3));
  121. const r2 = t5.fields.map((t6) => t6.name);
  122. this._attributesConstructor = function() {
  123. for (const t6 of r2)
  124. this[t6] = null;
  125. };
  126. }
  127. addFeature(t5, e3) {
  128. const r2 = this._options.maxStringAttributeLength ? this._options.maxStringAttributeLength : 0;
  129. if (r2 > 0)
  130. for (const s3 in e3.attributes) {
  131. const t6 = e3.attributes[s3];
  132. "string" == typeof t6 && t6.length > r2 && (e3.attributes[s3] = "");
  133. }
  134. t5.features.push(e3);
  135. }
  136. addQueryGeometry(t5, e3) {
  137. const { queryGeometry: r2, queryGeometryType: s3 } = e3, o2 = pt(r2.clone(), r2, false, false, this._transform), i2 = rt(o2, s3, false, false);
  138. let n2 = null;
  139. switch (s3) {
  140. case "esriGeometryPoint":
  141. n2 = "point";
  142. break;
  143. case "esriGeometryPolygon":
  144. n2 = "polygon";
  145. break;
  146. case "esriGeometryPolyline":
  147. n2 = "polyline";
  148. break;
  149. case "esriGeometryMultipoint":
  150. n2 = "multipoint";
  151. }
  152. i2.type = n2, t5.queryGeometryType = s3, t5.queryGeometry = i2;
  153. }
  154. prepareFeatures(e3) {
  155. 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) {
  156. case "point":
  157. this.addCoordinate = (t5, e4, r2) => this.addCoordinatePoint(t5, e4, r2), this.createGeometry = (t5) => this.createPointGeometry(t5);
  158. break;
  159. case "polygon":
  160. this.addCoordinate = (t5, e4, r2) => this._addCoordinatePolygon(t5, e4, r2), this.createGeometry = (t5) => this._createPolygonGeometry(t5);
  161. break;
  162. case "polyline":
  163. this.addCoordinate = (t5, e4, r2) => this._addCoordinatePolyline(t5, e4, r2), this.createGeometry = (t5) => this._createPolylineGeometry(t5);
  164. break;
  165. case "multipoint":
  166. this.addCoordinate = (t5, e4, r2) => this._addCoordinateMultipoint(t5, e4, r2), this.createGeometry = (t5) => this._createMultipointGeometry(t5);
  167. break;
  168. case "mesh":
  169. case "extent":
  170. break;
  171. default:
  172. n(e3.geometryType);
  173. }
  174. }
  175. createFeature() {
  176. return this._lengths.length = 0, this._currentLengthIndex = 0, this._previousCoordinate[0] = 0, this._previousCoordinate[1] = 0, new j(e(), null, new this._attributesConstructor());
  177. }
  178. allocateCoordinates() {
  179. const t5 = this._lengths.reduce((t6, e3) => t6 + e3, 0);
  180. this._coordinateBuffer = new Float64Array(t5 * this._vertexDimension), this._coordinateBufferPtr = 0;
  181. }
  182. addLength(t5, e3, r2) {
  183. 0 === this._lengths.length && (this._toAddInCurrentPath = e3), this._lengths.push(e3);
  184. }
  185. createPointGeometry(t5) {
  186. const e3 = { type: "point", x: 0, y: 0, spatialReference: t5.spatialReference, hasZ: !!t5.hasZ, hasM: !!t5.hasM };
  187. return e3.hasZ && (e3.z = 0), e3.hasM && (e3.m = 0), e3;
  188. }
  189. addCoordinatePoint(t5, e3, r2) {
  190. switch (e3 = this._applyTransform(this._transform, e3, r2, 0), r2) {
  191. case 0:
  192. t5.x = e3;
  193. break;
  194. case 1:
  195. t5.y = e3;
  196. break;
  197. case 2:
  198. t5.hasZ ? t5.z = e3 : t5.m = e3;
  199. break;
  200. case 3:
  201. t5.m = e3;
  202. }
  203. }
  204. _transformPathLikeValue(t5, e3) {
  205. let r2 = 0;
  206. return e3 <= 1 && (r2 = this._previousCoordinate[e3], this._previousCoordinate[e3] += t5), this._applyTransform(this._transform, t5, e3, r2);
  207. }
  208. _addCoordinatePolyline(t5, e3, r2) {
  209. this._dehydratedAddPointsCoordinate(t5.paths, e3, r2);
  210. }
  211. _addCoordinatePolygon(t5, e3, r2) {
  212. this._dehydratedAddPointsCoordinate(t5.rings, e3, r2);
  213. }
  214. _addCoordinateMultipoint(t5, e3, r2) {
  215. 0 === r2 && t5.points.push([]);
  216. const s3 = this._transformPathLikeValue(e3, r2);
  217. t5.points[t5.points.length - 1].push(s3);
  218. }
  219. _createPolygonGeometry(t5) {
  220. return { type: "polygon", rings: [[]], spatialReference: t5.spatialReference, hasZ: !!t5.hasZ, hasM: !!t5.hasM };
  221. }
  222. _createPolylineGeometry(t5) {
  223. return { type: "polyline", paths: [[]], spatialReference: t5.spatialReference, hasZ: !!t5.hasZ, hasM: !!t5.hasM };
  224. }
  225. _createMultipointGeometry(t5) {
  226. return { type: "multipoint", points: [], spatialReference: t5.spatialReference, hasZ: !!t5.hasZ, hasM: !!t5.hasM };
  227. }
  228. _dehydratedAddPointsCoordinate(t5, e3, r2) {
  229. 0 === r2 && 0 == this._toAddInCurrentPath-- && (t5.push([]), this._toAddInCurrentPath = this._lengths[++this._currentLengthIndex] - 1, this._previousCoordinate[0] = 0, this._previousCoordinate[1] = 0);
  230. const s3 = this._transformPathLikeValue(e3, r2), o2 = t5[t5.length - 1];
  231. 0 === r2 && o2.push(new Float64Array(this._coordinateBuffer.buffer, this._coordinateBufferPtr * Float64Array.BYTES_PER_ELEMENT, this._vertexDimension)), this._coordinateBuffer[this._coordinateBufferPtr++] = s3;
  232. }
  233. _deriveApplyTransform(t5) {
  234. const { hasZ: e3, hasM: r2 } = t5;
  235. return e3 && r2 ? f2 : e3 ? c : r2 ? d : p;
  236. }
  237. };
  238. // node_modules/@arcgis/core/views/3d/support/PBFDecoderWorker.js
  239. var t4 = class {
  240. _parseFeatureQuery(t5) {
  241. const s3 = t2(t5.buffer, new _(t5.options)), o2 = { ...s3, spatialReference: s3.spatialReference.toJSON(), fields: s3.fields ? s3.fields.map((e3) => e3.toJSON()) : void 0 };
  242. return Promise.resolve(o2);
  243. }
  244. };
  245. function s2() {
  246. return new t4();
  247. }
  248. export {
  249. s2 as default
  250. };
  251. //# sourceMappingURL=PBFDecoderWorker-IGUUFCFU.js.map