meshFeatureSet-77HDYLJC.js 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  1. import {
  2. x as x3
  3. } from "./chunk-773XI6MQ.js";
  4. import {
  5. f as f4,
  6. p as p4
  7. } from "./chunk-T47XOAZJ.js";
  8. import "./chunk-7NPG47AN.js";
  9. import {
  10. n as n3
  11. } from "./chunk-2DNADSBR.js";
  12. import {
  13. L as L2,
  14. L2 as L3,
  15. M as M2,
  16. M2 as M3,
  17. O as O3,
  18. a as a2,
  19. g,
  20. h,
  21. j as j2,
  22. k,
  23. k2,
  24. k3,
  25. l as l2,
  26. r as r3,
  27. x,
  28. x2
  29. } from "./chunk-2ADIR7NB.js";
  30. import "./chunk-4KFEVYXL.js";
  31. import "./chunk-5W6F4NR5.js";
  32. import "./chunk-YZUP3MAF.js";
  33. import {
  34. e as e4
  35. } from "./chunk-E3HOL2XO.js";
  36. import {
  37. e as e3
  38. } from "./chunk-SCXOTZ6Q.js";
  39. import "./chunk-H4JLO5B2.js";
  40. import {
  41. x as x4
  42. } from "./chunk-2VFJVI2I.js";
  43. import "./chunk-5JK4DCPE.js";
  44. import {
  45. a
  46. } from "./chunk-CRGVDJI6.js";
  47. import {
  48. Hn,
  49. qn
  50. } from "./chunk-DH2OBAUC.js";
  51. import "./chunk-TNLRDNTC.js";
  52. import "./chunk-6P6NA7JB.js";
  53. import {
  54. g as g2
  55. } from "./chunk-RZFGRBD7.js";
  56. import "./chunk-PUSPZYFZ.js";
  57. import "./chunk-EN7YGJWG.js";
  58. import "./chunk-VBNMTM7L.js";
  59. import "./chunk-3D3QEPRE.js";
  60. import "./chunk-JFNNSBWL.js";
  61. import "./chunk-WNCU6BFU.js";
  62. import "./chunk-PIGRDDRG.js";
  63. import "./chunk-BJHM4JNS.js";
  64. import "./chunk-F6A2QQ26.js";
  65. import "./chunk-C43UE3Z5.js";
  66. import {
  67. a as a3
  68. } from "./chunk-RMX2AZ4P.js";
  69. import "./chunk-NE3ESGA6.js";
  70. import {
  71. l
  72. } from "./chunk-YIS6BAC3.js";
  73. import "./chunk-7XXXCK2A.js";
  74. import "./chunk-7ZIDBK7B.js";
  75. import "./chunk-65BYCSII.js";
  76. import "./chunk-WZQZRKNH.js";
  77. import "./chunk-LRDX4TO7.js";
  78. import "./chunk-6A4U74YA.js";
  79. import {
  80. p as p3
  81. } from "./chunk-TERAW6FT.js";
  82. import "./chunk-N2663GRX.js";
  83. import {
  84. O
  85. } from "./chunk-O4FY3ITT.js";
  86. import "./chunk-WEMIK25H.js";
  87. import "./chunk-7N4X6GF3.js";
  88. import "./chunk-JXW4QTJA.js";
  89. import "./chunk-UXF37FQ4.js";
  90. import "./chunk-ZOEK6QHJ.js";
  91. import {
  92. L,
  93. O as O2,
  94. e as e2,
  95. o,
  96. q,
  97. u,
  98. z
  99. } from "./chunk-XNLG7T2T.js";
  100. import {
  101. f as f3,
  102. n as n2,
  103. r as r2
  104. } from "./chunk-IR4PV7VK.js";
  105. import "./chunk-2Z6LERTI.js";
  106. import {
  107. f as f2,
  108. v2 as v
  109. } from "./chunk-OWVBLVP3.js";
  110. import "./chunk-AFZ7XSEW.js";
  111. import "./chunk-4NKD334K.js";
  112. import "./chunk-65K7LC56.js";
  113. import "./chunk-ATPLLI5W.js";
  114. import "./chunk-MXB2XLKV.js";
  115. import "./chunk-XH7RUGVZ.js";
  116. import {
  117. m as m2
  118. } from "./chunk-TBBTRX4O.js";
  119. import {
  120. m
  121. } from "./chunk-YBSUITLL.js";
  122. import "./chunk-ALDCDSPV.js";
  123. import "./chunk-DT6EAZQ5.js";
  124. import "./chunk-HNOZUNJ4.js";
  125. import "./chunk-VNFRAYHO.js";
  126. import "./chunk-R5IG2D6H.js";
  127. import {
  128. Ot,
  129. _
  130. } from "./chunk-VBRY5KJM.js";
  131. import "./chunk-PDKDCAAD.js";
  132. import {
  133. M2 as M,
  134. j2 as j,
  135. p as p2
  136. } from "./chunk-ECW2QABR.js";
  137. import "./chunk-GCDJLKH4.js";
  138. import "./chunk-MRJEICT6.js";
  139. import {
  140. d,
  141. e,
  142. n2 as n
  143. } from "./chunk-Y3WMVFTW.js";
  144. import "./chunk-SAS7RONY.js";
  145. import "./chunk-WSRBH7BF.js";
  146. import "./chunk-IHXECKQQ.js";
  147. import {
  148. C,
  149. f,
  150. p,
  151. y
  152. } from "./chunk-ULGDPLM2.js";
  153. import {
  154. s,
  155. s3 as s2
  156. } from "./chunk-EMJ4ZSM2.js";
  157. import "./chunk-IKP3YN53.js";
  158. import {
  159. r,
  160. t
  161. } from "./chunk-GZT4BVFP.js";
  162. import "./chunk-A5ICIBVI.js";
  163. // node_modules/@arcgis/core/geometry/support/triangulationUtils.js
  164. function o2(t2) {
  165. const o3 = l3(t2.rings, t2.hasZ, c.CCW_IS_HOLE), s5 = [];
  166. let i2 = 0, h4 = 0;
  167. for (const e6 of o3.polygons) {
  168. const t3 = e6.count, r5 = e6.index, l7 = new Float64Array(o3.position.buffer, 3 * r5 * o3.position.BYTES_PER_ELEMENT, 3 * t3), c5 = e6.holeIndices.map((n4) => n4 - r5), f9 = new Uint32Array(x3(l7, c5, 3));
  169. s5.push({ position: l7, faces: f9 }), i2 += l7.length, h4 += f9.length;
  170. }
  171. const f8 = r4(s5, i2, h4), a5 = n3(f8.position.buffer, 6, { originalIndices: f8.faces });
  172. return f8.position = new Float64Array(a5.buffer), f8.faces = a5.indices, f8;
  173. }
  174. function r4(n4, t2, e6) {
  175. if (n4.length === 1)
  176. return n4[0];
  177. const o3 = new Float64Array(t2), r5 = new Uint32Array(e6);
  178. let l7 = 0, s5 = 0, i2 = 0;
  179. for (const c5 of n4) {
  180. for (let n5 = 0; n5 < c5.position.length; n5++)
  181. o3[l7++] = c5.position[n5];
  182. for (let n5 = 0; n5 < c5.faces.length; n5++)
  183. r5[s5++] = c5.faces[n5] + i2;
  184. i2 = l7 / 3;
  185. }
  186. return { position: o3, faces: r5 };
  187. }
  188. function l3(n4, t2, e6) {
  189. const o3 = n4.length, r5 = new Array(o3), l7 = new Array(o3), h4 = new Array(o3);
  190. let f8 = 0, a5 = 0, g6 = 0, u4 = 0;
  191. for (let s5 = 0; s5 < o3; ++s5)
  192. u4 += n4[s5].length;
  193. const p9 = new Float64Array(3 * u4);
  194. let d5 = 0;
  195. for (let y7 = o3 - 1; y7 >= 0; y7--) {
  196. const u5 = n4[y7], w5 = e6 === c.CCW_IS_HOLE && i(u5);
  197. if (w5 && o3 !== 1)
  198. r5[f8++] = u5;
  199. else {
  200. let n5 = u5.length;
  201. for (let t3 = 0; t3 < f8; ++t3)
  202. n5 += r5[t3].length;
  203. const e7 = { index: d5, pathLengths: new Array(f8 + 1), count: n5, holeIndices: new Array(f8) };
  204. e7.pathLengths[0] = u5.length, u5.length > 0 && (h4[g6++] = { index: d5, count: u5.length }), d5 = w5 ? s3(u5, u5.length - 1, -1, p9, d5, u5.length, t2) : s3(u5, 0, 1, p9, d5, u5.length, t2);
  205. for (let o4 = 0; o4 < f8; ++o4) {
  206. const n6 = r5[o4];
  207. e7.holeIndices[o4] = d5, e7.pathLengths[o4 + 1] = n6.length, n6.length > 0 && (h4[g6++] = { index: d5, count: n6.length }), d5 = s3(n6, 0, 1, p9, d5, n6.length, t2);
  208. }
  209. f8 = 0, e7.count > 0 && (l7[a5++] = e7);
  210. }
  211. }
  212. for (let i2 = 0; i2 < f8; ++i2) {
  213. const n5 = r5[i2];
  214. n5.length > 0 && (h4[g6++] = { index: d5, count: n5.length }), d5 = s3(n5, 0, 1, p9, d5, n5.length, t2);
  215. }
  216. return a5 < o3 && (l7.length = a5), g6 < o3 && (h4.length = g6), { position: p9, polygons: l7, outlines: h4 };
  217. }
  218. function s3(n4, t2, e6, o3, r5, l7, s5) {
  219. r5 *= 3;
  220. for (let i2 = 0; i2 < l7; ++i2) {
  221. const l8 = n4[t2];
  222. o3[r5++] = l8[0], o3[r5++] = l8[1], o3[r5++] = s5 ? l8[2] : 0, t2 += e6;
  223. }
  224. return r5 / 3;
  225. }
  226. function i(n4) {
  227. return !f2(n4, false, false);
  228. }
  229. var c;
  230. !function(n4) {
  231. n4[n4.NONE = 0] = "NONE", n4[n4.CCW_IS_HOLE = 1] = "CCW_IS_HOLE";
  232. }(c || (c = {}));
  233. // node_modules/@arcgis/core/geometry/support/meshUtils/centerAt.js
  234. var a4 = s.getLogger("esri.geometry.support.meshUtils.centerAt");
  235. function c2(e6, r5, i2) {
  236. if (!e6.vertexAttributes || !e6.vertexAttributes.position)
  237. return;
  238. const n4 = i2?.origin ?? e6.origin;
  239. if (r(e6.transform))
  240. i2?.geographic != null && i2.geographic !== e6.transform.geographic && a4.warn(`Specifying the 'geographic' parameter (${i2.geographic}) different from the Mesh transform setting (${e6.transform.geographic}) is not supported`), f5(e6.transform, r5, n4);
  241. else {
  242. r3(e6.spatialReference, i2) ? p5(e6, r5, n4) : g3(e6, r5, n4);
  243. }
  244. }
  245. function f5(e6, t2, r5) {
  246. const i2 = t2.x - r5.x, o3 = t2.y - r5.y, n4 = t2.hasZ && r5.hasZ ? t2.z - r5.z : 0, s5 = e6.origin;
  247. e6.origin = [s5[0] + i2, s5[1] + o3, s5[2] + n4];
  248. }
  249. function p5(e6, t2, r5) {
  250. const i2 = M3(e6.vertexAttributes, r5, { geographic: true }), { position: o3, normal: a5, tangent: c5 } = x2(i2, t2, { geographic: true });
  251. e6.vertexAttributes.position = o3, e6.vertexAttributes.normal = a5, e6.vertexAttributes.tangent = c5, e6.vertexAttributesChanged();
  252. }
  253. function g3(e6, t2, r5) {
  254. const o3 = h2, n4 = l4;
  255. if (Hn(t2, n4, e6.spatialReference)) {
  256. if (!Hn(r5, o3, e6.spatialReference)) {
  257. const t3 = e6.origin;
  258. o3[0] = t3.x, o3[1] = t3.y, o3[2] = t3.z, a4.error(`Failed to project specified origin (wkid:${r5.spatialReference.wkid}) to mesh spatial reference (wkid:${e6.spatialReference.wkid}).`);
  259. }
  260. m3(e6.vertexAttributes.position, n4, o3), e6.vertexAttributesChanged();
  261. } else
  262. a4.error(`Failed to project centerAt location (wkid:${t2.spatialReference.wkid}) to mesh spatial reference (wkid:${e6.spatialReference.wkid})`);
  263. }
  264. function m3(e6, t2, r5) {
  265. if (e6)
  266. for (let i2 = 0; i2 < e6.length; i2 += 3)
  267. for (let o3 = 0; o3 < 3; o3++)
  268. e6[i2 + o3] += t2[o3] - r5[o3];
  269. }
  270. var l4 = n2();
  271. var h2 = n2();
  272. // node_modules/@arcgis/core/geometry/support/meshUtils/loadExternal.js
  273. async function f6(e6, s5, o3) {
  274. const { loadGLTFMesh: n4 } = await y(import("./loadGLTFMesh-VTQIH4TD.js"), o3), a5 = await m4(s5, o3), i2 = n4(new j({ x: 0, y: 0, z: 0, spatialReference: e6.spatialReference }), a5.url, { resolveFile: u2(a5), useTransform: true, signal: r(o3) ? o3.signal : null });
  275. i2.then(() => a5.dispose(), () => a5.dispose());
  276. const { vertexAttributes: l7, components: f8 } = await i2;
  277. e6.vertexAttributes = l7, e6.components = f8;
  278. }
  279. function u2(e6) {
  280. const t2 = Ot(e6.url);
  281. return (s5) => {
  282. const r5 = _(s5, t2, t2), o3 = r5 ? r5.replace(/^ *\.\//, "") : null;
  283. return e6.files.get(o3) ?? s5;
  284. };
  285. }
  286. async function m4(e6, t2) {
  287. return e6 instanceof Blob ? y2.fromBlob(e6) : typeof e6 == "string" ? new y2(e6) : Array.isArray(e6) ? p6(e6, t2) : w(e6, t2);
  288. }
  289. async function p6(t2, r5) {
  290. const i2 = new Map();
  291. let l7 = null;
  292. const c5 = await C(t2.map(async (e6) => ({ name: e6.name, source: await m4(e6 instanceof Blob ? e6 : e6.source, r5) }))), f8 = [];
  293. for (const e6 of c5)
  294. e6 && (p(r5) ? e6.source.dispose() : f8.push(e6));
  295. f(r5);
  296. for (const { name: e6, source: o3 } of f8)
  297. (t(l7) || /\.(gltf|glb)/i.test(e6)) && (l7 = o3.url), i2.set(e6, o3.url), o3.files && o3.files.forEach((e7, t3) => i2.set(t3, e7));
  298. if (t(l7))
  299. throw new s2("mesh-load-external:missing-files", "Missing files to load external mesh source");
  300. return new y2(l7, () => f8.forEach(({ source: e6 }) => e6.dispose()), i2);
  301. }
  302. async function w(e6, t2) {
  303. const { default: s5 } = await y(import("./request-EYE34PBM.js"), t2), o3 = typeof e6.multipart[0] == "string" ? await Promise.all(e6.multipart.map(async (e7) => (await s5(e7, { responseType: "array-buffer" })).data)) : e6.multipart;
  304. return y2.fromBlob(new Blob(o3));
  305. }
  306. var y2 = class {
  307. constructor(e6, t2 = () => {
  308. }, s5 = new Map()) {
  309. this.url = e6, this.dispose = t2, this.files = s5;
  310. }
  311. static fromBlob(e6) {
  312. const t2 = URL.createObjectURL(e6);
  313. return new y2(t2, () => URL.revokeObjectURL(t2));
  314. }
  315. };
  316. // node_modules/@arcgis/core/geometry/support/meshUtils/offset.js
  317. var x5 = s.getLogger("esri.geometry.support.meshUtils.offset");
  318. function A(t2, e6, o3) {
  319. if (t2.vertexAttributes && t2.vertexAttributes.position)
  320. if (r(t2.transform))
  321. o3?.geographic != null && o3.geographic !== t2.transform.geographic && x5.warn(`Specifying the 'geographic' parameter (${o3.geographic}) different from the Mesh transform setting (${t2.transform.geographic}) is not supported`), v2(t2.transform, e6);
  322. else {
  323. r3(t2.spatialReference, o3) ? b(t2, e6) : y3(t2, e6);
  324. }
  325. }
  326. function v2(t2, r5) {
  327. const e6 = t2.origin;
  328. t2.origin = u(n2(), e6, r5);
  329. }
  330. function b(t2, o3) {
  331. const i2 = t2.spatialReference, n4 = t2.vertexAttributes.position, a5 = t2.vertexAttributes.normal, c5 = t2.vertexAttributes.tangent, x8 = new Float64Array(n4.length), A4 = r(a5) ? new Float32Array(a5.length) : null, v5 = r(c5) ? new Float32Array(c5.length) : null, b3 = t2.extent.center, y7 = k4;
  332. qn(i2, [b3.x, b3.y, b3.z], w2, O(i2)), a(F, w2), O2(y7, o3, F), M2(n4, i2, x8), r(a5) && j2(a5, n4, x8, i2, A4), r(c5) && k2(c5, n4, x8, i2, v5), d2(x8, y7), O3(x8, n4, i2), r(a5) && h(A4, n4, x8, i2, a5), r(c5) && L3(v5, n4, x8, i2, c5), t2.vertexAttributesChanged();
  333. }
  334. function y3(t2, r5) {
  335. d2(t2.vertexAttributes.position, r5), t2.vertexAttributesChanged();
  336. }
  337. function d2(t2, r5) {
  338. if (t2)
  339. for (let e6 = 0; e6 < t2.length; e6 += 3)
  340. for (let o3 = 0; o3 < 3; o3++)
  341. t2[e6 + o3] += r5[o3];
  342. }
  343. var k4 = n2();
  344. var w2 = e4();
  345. var F = e3();
  346. // node_modules/@arcgis/core/geometry/support/meshUtils/primitives.js
  347. function c3() {
  348. const { faceDescriptions: t2, faceVertexOffsets: e6, uvScales: n4 } = d3, r5 = 4 * t2.length, o3 = new Float64Array(3 * r5), s5 = new Float32Array(3 * r5), a5 = new Float32Array(2 * r5), i2 = new Uint32Array(2 * t2.length * 3);
  349. let c5 = 0, l7 = 0, f8 = 0, u4 = 0;
  350. for (let h4 = 0; h4 < t2.length; h4++) {
  351. const r6 = t2[h4], p9 = c5 / 3;
  352. for (const t3 of e6)
  353. i2[u4++] = p9 + t3;
  354. const m6 = r6.corners;
  355. for (let t3 = 0; t3 < 4; t3++) {
  356. const e7 = m6[t3];
  357. let i3 = 0;
  358. a5[f8++] = 0.25 * n4[t3][0] + r6.uvOrigin[0], a5[f8++] = r6.uvOrigin[1] - 0.25 * n4[t3][1];
  359. for (let t4 = 0; t4 < 3; t4++)
  360. r6.axis[t4] !== 0 ? (o3[c5++] = 0.5 * r6.axis[t4], s5[l7++] = r6.axis[t4]) : (o3[c5++] = 0.5 * e7[i3++], s5[l7++] = 0);
  361. }
  362. }
  363. return { position: o3, normal: s5, uv: a5, faces: i2 };
  364. }
  365. function l5(e6, n4) {
  366. const r5 = e6.components[0], o3 = r5.faces, a5 = M4[n4], i2 = 6 * a5, c5 = new Uint32Array(6), l7 = new Uint32Array(o3.length - 6);
  367. let f8 = 0, u4 = 0;
  368. for (let t2 = 0; t2 < o3.length; t2++)
  369. t2 >= i2 && t2 < i2 + 6 ? c5[f8++] = o3[t2] : l7[u4++] = o3[t2];
  370. if (r(e6.vertexAttributes.uv)) {
  371. const t2 = new Float32Array(e6.vertexAttributes.uv), n5 = 4 * a5 * 2, r6 = [0, 1, 1, 1, 1, 0, 0, 0];
  372. for (let e7 = 0; e7 < r6.length; e7++)
  373. t2[n5 + e7] = r6[e7];
  374. e6.vertexAttributes.uv = t2;
  375. }
  376. return e6.components = [new f4({ faces: c5, material: r5.material }), new f4({ faces: l7 })], e6;
  377. }
  378. function f7(t2 = 0) {
  379. const e6 = Math.round(8 * 2 ** t2), n4 = 2 * e6, r5 = (e6 - 1) * (n4 + 1) + 2 * n4, o3 = new Float64Array(3 * r5), s5 = new Float32Array(3 * r5), a5 = new Float32Array(2 * r5), i2 = new Uint32Array(3 * ((e6 - 1) * n4 * 2));
  380. let c5 = 0, l7 = 0, f8 = 0, u4 = 0;
  381. for (let h4 = 0; h4 <= e6; h4++) {
  382. const t3 = h4 / e6 * Math.PI + 0.5 * Math.PI, r6 = Math.cos(t3), p9 = Math.sin(t3);
  383. F2[2] = p9;
  384. const m6 = h4 === 0 || h4 === e6, w5 = m6 ? n4 - 1 : n4;
  385. for (let v5 = 0; v5 <= w5; v5++) {
  386. const t4 = v5 / w5 * 2 * Math.PI;
  387. F2[0] = -Math.sin(t4) * r6, F2[1] = Math.cos(t4) * r6;
  388. for (let e7 = 0; e7 < 3; e7++)
  389. o3[c5] = 0.5 * F2[e7], s5[c5] = F2[e7], ++c5;
  390. a5[l7++] = (v5 + (m6 ? 0.5 : 0)) / n4, a5[l7++] = h4 / e6, h4 !== 0 && v5 !== n4 && (h4 !== e6 && (i2[f8++] = u4, i2[f8++] = u4 + 1, i2[f8++] = u4 - n4), h4 !== 1 && (i2[f8++] = u4, i2[f8++] = u4 - n4, i2[f8++] = u4 - n4 - 1)), u4++;
  391. }
  392. }
  393. return { position: o3, normal: s5, uv: a5, faces: i2 };
  394. }
  395. function u3(t2 = 0) {
  396. const e6 = 5, n4 = Math.round(16 * 2 ** t2), r5 = (e6 - 1) * (n4 + 1) + 2 * n4, o3 = new Float64Array(3 * r5), s5 = new Float32Array(3 * r5), a5 = new Float32Array(2 * r5), i2 = new Uint32Array(3 * (4 * n4));
  397. let c5 = 0, l7 = 0, f8 = 0, u4 = 0, h4 = 0;
  398. for (let p9 = 0; p9 <= e6; p9++) {
  399. const t3 = p9 === 0 || p9 === e6, r6 = p9 <= 1 || p9 >= e6 - 1, m6 = p9 === 2 || p9 === 4, w5 = t3 ? n4 - 1 : n4;
  400. for (let v5 = 0; v5 <= w5; v5++) {
  401. const g6 = v5 / w5 * 2 * Math.PI, A4 = t3 ? 0 : 0.5;
  402. F2[0] = A4 * Math.sin(g6), F2[1] = A4 * -Math.cos(g6), F2[2] = p9 <= 2 ? 0.5 : -0.5;
  403. for (let t4 = 0; t4 < 3; t4++)
  404. o3[c5++] = F2[t4], s5[l7++] = r6 ? t4 === 2 ? p9 <= 1 ? 1 : -1 : 0 : t4 === 2 ? 0 : F2[t4] / A4;
  405. a5[f8++] = (v5 + (t3 ? 0.5 : 0)) / n4, a5[f8++] = p9 <= 1 ? 1 * p9 / 3 : p9 <= 3 ? 1 * (p9 - 2) / 3 + 1 / 3 : 1 * (p9 - 4) / 3 + 2 / 3, m6 || p9 === 0 || v5 === n4 || (p9 !== e6 && (i2[u4++] = h4, i2[u4++] = h4 + 1, i2[u4++] = h4 - n4), p9 !== 1 && (i2[u4++] = h4, i2[u4++] = h4 - n4, i2[u4++] = h4 - n4 - 1)), h4++;
  406. }
  407. }
  408. return { position: o3, normal: s5, uv: a5, faces: i2 };
  409. }
  410. function h3(t2, e6) {
  411. const n4 = typeof e6 == "number" ? e6 : e6 != null ? e6.width : 1, r5 = typeof e6 == "number" ? e6 : e6 != null ? e6.height : 1;
  412. switch (t2) {
  413. case "up":
  414. case "down":
  415. return { width: n4, depth: r5 };
  416. case "north":
  417. case "south":
  418. return { width: n4, height: r5 };
  419. case "east":
  420. case "west":
  421. return { depth: n4, height: r5 };
  422. }
  423. }
  424. function p7(t2) {
  425. const e6 = g4.facingAxisOrderSwap[t2], n4 = g4.position, r5 = g4.normal, o3 = new Float64Array(n4.length), s5 = new Float32Array(r5.length);
  426. let a5 = 0;
  427. for (let i2 = 0; i2 < 4; i2++) {
  428. const t3 = a5;
  429. for (let i3 = 0; i3 < 3; i3++) {
  430. const c5 = e6[i3], l7 = Math.abs(c5) - 1, f8 = c5 >= 0 ? 1 : -1;
  431. o3[a5] = n4[t3 + l7] * f8, s5[a5] = r5[t3 + l7] * f8, a5++;
  432. }
  433. }
  434. return { position: o3, normal: s5, uv: new Float32Array(g4.uv), faces: new Uint32Array(g4.faces), isPlane: true };
  435. }
  436. var m5 = 1;
  437. var w3 = 2;
  438. var v3 = 3;
  439. var g4 = { position: [-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0], normal: [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], uv: [0, 1, 1, 1, 1, 0, 0, 0], faces: [0, 1, 2, 0, 2, 3], facingAxisOrderSwap: { east: [v3, m5, w3], west: [-v3, -m5, w3], north: [-m5, v3, w3], south: [m5, -v3, w3], up: [m5, w3, v3], down: [m5, -w3, -v3] } };
  440. function A2(t2, e6, n4) {
  441. t2.isPlane || y4(t2), x6(t2, n4 && n4.size);
  442. const { vertexAttributes: r5, transform: o3 } = k3(t2, e6, n4);
  443. return { vertexAttributes: new p4({ ...r5, uv: t2.uv }), transform: o3, components: [new f4({ faces: t2.faces, material: n4 && n4.material || null })], spatialReference: e6.spatialReference };
  444. }
  445. function y4(t2) {
  446. for (let e6 = 0; e6 < t2.position.length; e6 += 3)
  447. t2.position[e6 + 2] += 0.5;
  448. }
  449. function x6(t2, e6) {
  450. if (e6 == null)
  451. return;
  452. const o3 = typeof e6 == "number" ? [e6, e6, e6] : [e6.width != null ? e6.width : 1, e6.depth != null ? e6.depth : 1, e6.height != null ? e6.height : 1];
  453. O4[0] = o3[0], O4[4] = o3[1], O4[8] = o3[2];
  454. for (let r5 = 0; r5 < t2.position.length; r5 += 3) {
  455. for (let e7 = 0; e7 < 3; e7++)
  456. F2[e7] = t2.position[r5 + e7];
  457. O2(F2, F2, O4);
  458. for (let e7 = 0; e7 < 3; e7++)
  459. t2.position[r5 + e7] = F2[e7];
  460. }
  461. if (o3[0] !== o3[1] || o3[1] !== o3[2]) {
  462. O4[0] = 1 / o3[0], O4[4] = 1 / o3[1], O4[8] = 1 / o3[2];
  463. for (let e7 = 0; e7 < t2.normal.length; e7 += 3) {
  464. for (let n4 = 0; n4 < 3; n4++)
  465. F2[n4] = t2.normal[e7 + n4];
  466. O2(F2, F2, O4), z(F2, F2);
  467. for (let n4 = 0; n4 < 3; n4++)
  468. t2.normal[e7 + n4] = F2[n4];
  469. }
  470. }
  471. }
  472. var d3 = { faceDescriptions: [{ axis: [0, -1, 0], uvOrigin: [0, 0.625], corners: [[-1, -1], [1, -1], [1, 1], [-1, 1]] }, { axis: [1, 0, 0], uvOrigin: [0.25, 0.625], corners: [[-1, -1], [1, -1], [1, 1], [-1, 1]] }, { axis: [0, 1, 0], uvOrigin: [0.5, 0.625], corners: [[1, -1], [-1, -1], [-1, 1], [1, 1]] }, { axis: [-1, 0, 0], uvOrigin: [0.75, 0.625], corners: [[1, -1], [-1, -1], [-1, 1], [1, 1]] }, { axis: [0, 0, 1], uvOrigin: [0, 0.375], corners: [[-1, -1], [1, -1], [1, 1], [-1, 1]] }, { axis: [0, 0, -1], uvOrigin: [0, 0.875], corners: [[-1, 1], [1, 1], [1, -1], [-1, -1]] }], uvScales: [[0, 0], [1, 0], [1, 1], [0, 1]], faceVertexOffsets: [0, 1, 2, 0, 2, 3] };
  473. var M4 = { south: 0, east: 1, north: 2, west: 3, up: 4, down: 5 };
  474. var F2 = n2();
  475. var O4 = e3();
  476. // node_modules/@arcgis/core/geometry/support/meshUtils/rotate.js
  477. var $ = s.getLogger("esri.geometry.support.meshUtils.rotate");
  478. function z2(t2, r5, o3) {
  479. if (!t2.vertexAttributes || !t2.vertexAttributes.position || r5[3] === 0)
  480. return;
  481. const i2 = t2.spatialReference;
  482. if (r(t2.transform)) {
  483. o3?.geographic != null && o3.geographic !== t2.transform.geographic && $.warn(`Specifying the 'geographic' parameter (${o3.geographic}) different from the Mesh transform setting (${t2.transform.geographic}) is not supported`);
  484. const e6 = o3?.origin ?? t2.transform.getOriginPoint(i2);
  485. C2(t2.transform, r5, e6);
  486. } else {
  487. const e6 = o3?.origin ?? t2.origin;
  488. r3(t2.spatialReference, o3) ? I(t2, r5, e6) : U(t2, r5, e6);
  489. }
  490. }
  491. function C2(t2, e6, r5) {
  492. const o3 = o(E, r5.x, r5.y, r5.z), i2 = e2(E, o3, t2.origin);
  493. t2.applyLocalInverse(i2, M5), t2.rotation = g(t2.rotation, e6, a2()), t2.applyLocalInverse(i2, i2), e2(i2, i2, M5), t2.translation = u(n2(), t2.translation, i2);
  494. }
  495. function I(t2, r5, i2) {
  496. const n4 = t2.spatialReference, s5 = O(n4), a5 = Z;
  497. Hn(i2, a5, s5) || Hn(t2.origin, a5, s5);
  498. const c5 = t2.vertexAttributes.position, f8 = t2.vertexAttributes.normal, m6 = t2.vertexAttributes.tangent, g6 = new Float64Array(c5.length), l7 = r(f8) ? new Float32Array(f8.length) : null, v5 = r(m6) ? new Float32Array(m6.length) : null;
  499. qn(s5, a5, P, s5), a(S, P);
  500. const x8 = O5;
  501. O2(l2(O5), l2(r5), S), x8[3] = r5[3], M2(c5, n4, g6), r(f8) && j2(f8, c5, g6, n4, l7), r(m6) && k2(m6, c5, g6, n4, v5), D(g6, x8, 3, a5), O3(g6, c5, n4), r(f8) && (D(l7, x8, 3), h(l7, c5, g6, n4, f8)), r(m6) && (D(v5, x8, 4), L3(v5, c5, g6, n4, m6)), t2.vertexAttributesChanged();
  502. }
  503. function U(t2, e6, r5) {
  504. const o3 = Z;
  505. if (!Hn(r5, o3, t2.spatialReference)) {
  506. const e7 = t2.origin;
  507. o3[0] = e7.x, o3[1] = e7.y, o3[2] = e7.z, $.error(`Failed to project specified origin (wkid:${r5.spatialReference.wkid}) to mesh spatial reference (wkid:${t2.spatialReference.wkid}).`);
  508. }
  509. D(t2.vertexAttributes.position, e6, 3, o3), D(t2.vertexAttributes.normal, e6, 3), D(t2.vertexAttributes.tangent, e6, 4), t2.vertexAttributesChanged();
  510. }
  511. function D(t2, e6, o3, i2 = f3) {
  512. if (!t(t2)) {
  513. p3(P, x(e6), l2(e6));
  514. for (let e7 = 0; e7 < t2.length; e7 += o3) {
  515. for (let r5 = 0; r5 < 3; r5++)
  516. E[r5] = t2[e7 + r5] - i2[r5];
  517. L(E, E, P);
  518. for (let r5 = 0; r5 < 3; r5++)
  519. t2[e7 + r5] = E[r5] + i2[r5];
  520. }
  521. }
  522. }
  523. var E = n2();
  524. var M5 = n2();
  525. var O5 = a2();
  526. var P = e4();
  527. var S = e3();
  528. var Z = n2();
  529. // node_modules/@arcgis/core/geometry/support/meshUtils/scale.js
  530. var v4 = s.getLogger("esri.geometry.support.meshUtils.scale");
  531. function d4(e6, r5, o3) {
  532. if (!e6.vertexAttributes || !e6.vertexAttributes.position)
  533. return;
  534. const i2 = e6.spatialReference;
  535. if (r(e6.transform)) {
  536. o3?.geographic != null && o3.geographic !== e6.transform.geographic && v4.warn(`Specifying the 'geographic' parameter (${o3.geographic}) different from the Mesh transform setting (${e6.transform.geographic}) is not supported`);
  537. const t2 = o3?.origin ?? e6.transform.getOriginPoint(i2);
  538. x7(e6.transform, r5, t2);
  539. } else {
  540. const t2 = r3(e6.spatialReference, o3), i3 = o3 && o3.origin || e6.origin;
  541. t2 ? A3(e6, r5, i3) : b2(e6, r5, i3);
  542. }
  543. }
  544. function x7(e6, t2, a5) {
  545. const c5 = o(w4, a5.x, a5.y, a5.z), p9 = e2(w4, c5, e6.origin);
  546. e6.applyLocalInverse(p9, k5);
  547. const f8 = q(n2(), e6.scale, t2);
  548. e6.scale = f8, e6.applyLocalInverse(p9, p9), e2(p9, p9, k5), e6.translation = u(n2(), e6.translation, p9);
  549. }
  550. function A3(e6, r5, o3) {
  551. const i2 = e6.spatialReference, n4 = O(i2), s5 = R;
  552. Hn(o3, s5, n4) || Hn(e6.origin, s5, n4);
  553. const a5 = e6.vertexAttributes.position, f8 = e6.vertexAttributes.normal, v5 = e6.vertexAttributes.tangent, d5 = new Float64Array(a5.length), x8 = r(f8) ? new Float32Array(f8.length) : null, A4 = r(v5) ? new Float32Array(v5.length) : null;
  554. M2(a5, i2, d5), r(f8) && j2(f8, a5, d5, i2, x8), r(v5) && k2(v5, a5, d5, i2, A4), y5(d5, r5, s5), O3(d5, a5, i2), r(f8) && h(x8, a5, d5, i2, f8), r(v5) && L3(A4, a5, d5, i2, v5), e6.vertexAttributesChanged();
  555. }
  556. function b2(e6, t2, r5) {
  557. const o3 = R;
  558. if (!Hn(r5, o3, e6.spatialReference)) {
  559. const t3 = e6.origin;
  560. o3[0] = t3.x, o3[1] = t3.y, o3[2] = t3.z, v4.error(`Failed to project specified origin (wkid:${r5.spatialReference.wkid}) to mesh spatial reference (wkid:${e6.spatialReference.wkid}).`);
  561. }
  562. y5(e6.vertexAttributes.position, t2, o3), e6.vertexAttributesChanged();
  563. }
  564. function y5(e6, t2, r5 = f3) {
  565. if (e6)
  566. for (let o3 = 0; o3 < e6.length; o3 += 3) {
  567. for (let t3 = 0; t3 < 3; t3++)
  568. w4[t3] = e6[o3 + t3] - r5[t3];
  569. q(w4, w4, t2);
  570. for (let t3 = 0; t3 < 3; t3++)
  571. e6[o3 + t3] = w4[t3] + r5[t3];
  572. }
  573. }
  574. var w4 = n2();
  575. var k5 = n2();
  576. var R = n2();
  577. // node_modules/@arcgis/core/geometry/Mesh.js
  578. var I2;
  579. var B = s.getLogger("esri.geometry.Mesh");
  580. var k6 = I2 = class extends a3(m2.LoadableMixin(m(p2))) {
  581. constructor(e6) {
  582. super(e6), this.components = null, this.transform = null, this.external = null, this.hasZ = true, this.hasM = false, this.vertexAttributes = new p4(), this.type = "mesh";
  583. }
  584. initialize() {
  585. (t(this.external) || this.vertexAttributes.position.length) && (this.loadStatus = "loaded"), this.when(() => {
  586. this.handles.add(l(() => ({ vertexAttributes: this.vertexAttributes, components: this.components?.map((e6) => e6.clone()), transform: r(this.transform) ? this.transform.clone() : null }), () => this._set("external", null), { once: true, sync: true }));
  587. });
  588. }
  589. get hasExtent() {
  590. return !this.loaded && r(this.external) && r(this.external.extent) || this.loaded && this.vertexAttributes.position.length > 0 && (!this.components || this.components.length > 0);
  591. }
  592. get boundingInfo() {
  593. const e6 = this.vertexAttributes.position, t2 = this.spatialReference;
  594. if (e6.length === 0 || this.components && this.components.length === 0)
  595. return { extent: new M({ xmin: 0, ymin: 0, zmin: 0, xmax: 0, ymax: 0, zmax: 0, spatialReference: t2 }), center: new j({ x: 0, y: 0, z: 0, spatialReference: t2 }) };
  596. const o3 = r(this.transform) ? this.transform.project(e6, t2) : e6;
  597. let r5 = 1 / 0, n4 = 1 / 0, s5 = 1 / 0, a5 = -1 / 0, l7 = -1 / 0, p9 = -1 / 0, c5 = 0, m6 = 0, h4 = 0;
  598. const f8 = o3.length, d5 = 1 / (f8 / 3);
  599. let y7 = 0;
  600. for (; y7 < f8; ) {
  601. const e7 = o3[y7++], t3 = o3[y7++], i2 = o3[y7++];
  602. r5 = Math.min(r5, e7), n4 = Math.min(n4, t3), s5 = Math.min(s5, i2), a5 = Math.max(a5, e7), l7 = Math.max(l7, t3), p9 = Math.max(p9, i2), c5 += d5 * e7, m6 += d5 * t3, h4 += d5 * i2;
  603. }
  604. return { extent: new M({ xmin: r5, ymin: n4, zmin: s5, xmax: a5, ymax: l7, zmax: p9, spatialReference: t2 }), center: new j({ x: c5, y: m6, z: h4, spatialReference: t2 }) };
  605. }
  606. get anchor() {
  607. if (r(this.transform))
  608. return this.transform.getOriginPoint(this.spatialReference);
  609. const e6 = this.boundingInfo;
  610. return new j({ x: e6.center.x, y: e6.center.y, z: e6.extent.zmin, spatialReference: this.spatialReference });
  611. }
  612. get origin() {
  613. return r(this.transform) ? this.transform.getOriginPoint(this.spatialReference) : this.boundingInfo.center;
  614. }
  615. get extent() {
  616. return !this.loaded && r(this.external) && r(this.external.extent) ? this.external.extent.clone() : this.boundingInfo.extent;
  617. }
  618. addComponent(e6) {
  619. this.loaded ? (this.components || (this.components = []), this.components.push(f4.from(e6)), this.notifyChange("components")) : B.error("addComponent()", "Mesh must be loaded before applying operations");
  620. }
  621. removeComponent(e6) {
  622. if (this.loaded) {
  623. if (this.components) {
  624. const t2 = this.components.indexOf(e6);
  625. if (t2 !== -1)
  626. return this.components.splice(t2, 1), void this.notifyChange("components");
  627. }
  628. B.error("removeComponent()", "Provided component is not part of the list of components");
  629. } else
  630. B.error("removeComponent()", "Mesh must be loaded before applying operations");
  631. }
  632. rotate(e6, t2, o3, r5) {
  633. return k(D2.x, e6, W), k(D2.y, t2, Z2), k(D2.z, o3, _2), g(W, Z2, W), g(W, _2, W), z2(this, W, r5), this;
  634. }
  635. offset(e6, t2, o3, r5) {
  636. return this.loaded ? (H[0] = e6, H[1] = t2, H[2] = o3, A(this, H, r5), this) : (B.error("offset()", "Mesh must be loaded before applying operations"), this);
  637. }
  638. scale(e6, t2) {
  639. return this.loaded ? (d4(this, e6, t2), this) : (B.error("scale()", "Mesh must be loaded before applying operations"), this);
  640. }
  641. centerAt(e6, t2) {
  642. return this.loaded ? (c2(this, e6, t2), this) : (B.error("centerAt()", "Mesh must be loaded before applying operations"), this);
  643. }
  644. load(e6) {
  645. return r(this.external) && this.addResolvingPromise(f6(this, this.external.source, e6)), Promise.resolve(this);
  646. }
  647. clone() {
  648. const e6 = this.components ? new Map() : null, t2 = this.components ? new Map() : null, o3 = { components: this.components ? this.components.map((o4) => o4.cloneWithDeduplication(e6, t2)) : null, spatialReference: this.spatialReference, vertexAttributes: this.vertexAttributes.clone(), transform: r(this.transform) ? this.transform.clone() : null, external: r(this.external) ? { source: this.external.source, extent: r(this.external.extent) ? this.external.extent.clone() : null } : null };
  649. return new I2(o3);
  650. }
  651. vertexAttributesChanged() {
  652. this.notifyChange("vertexAttributes");
  653. }
  654. async toBinaryGLTF(e6) {
  655. const { toBinaryGLTF: t2 } = await import("./gltfexport-6ZX4IV4P.js");
  656. return t2(this, e6);
  657. }
  658. static createBox(e6, t2) {
  659. if (!(e6 instanceof j))
  660. return B.error(".createBox()", "expected location to be a Point instance"), null;
  661. const o3 = new I2(A2(c3(), e6, t2));
  662. return t2 && t2.imageFace && t2.imageFace !== "all" ? l5(o3, t2.imageFace) : o3;
  663. }
  664. static createSphere(e6, t2) {
  665. return e6 instanceof j ? new I2(A2(f7(t2 && t2.densificationFactor || 0), e6, t2)) : (B.error(".createSphere()", "expected location to be a Point instance"), null);
  666. }
  667. static createCylinder(e6, t2) {
  668. return e6 instanceof j ? new I2(A2(u3(t2 && t2.densificationFactor || 0), e6, t2)) : (B.error(".createCylinder()", "expected location to be a Point instance"), null);
  669. }
  670. static createPlane(e6, t2) {
  671. if (!(e6 instanceof j))
  672. return B.error(".createPlane()", "expected location to be a Point instance"), null;
  673. const o3 = t2?.facing ?? "up", r5 = h3(o3, t2?.size);
  674. return new I2(A2(p7(o3), e6, { ...t2, size: r5 }));
  675. }
  676. static createFromPolygon(e6, t2) {
  677. if (!(e6 instanceof v))
  678. return B.error(".createFromPolygon()", "expected polygon to be a Polygon instance"), null;
  679. const o3 = o2(e6);
  680. return new I2({ vertexAttributes: new p4({ position: o3.position }), components: [new f4({ faces: o3.faces, shading: "flat", material: t2 && t2.material || null })], spatialReference: e6.spatialReference });
  681. }
  682. static async createFromGLTF(e6, o3, r5) {
  683. if (!(e6 instanceof j))
  684. throw B.error(".createfromGLTF()", "expected location to be a Point instance"), new s2("invalid-input", "Expected location to be a Point instance");
  685. const { loadGLTFMesh: n4 } = await y(import("./loadGLTFMesh-VTQIH4TD.js"), r5);
  686. return new I2(await n4(e6, o3, r5));
  687. }
  688. static createWithExternalSource(e6, t2, o3) {
  689. const r5 = o3?.extent ?? null, n4 = o3?.transform.clone() ?? new L2();
  690. n4.origin = [e6.x, e6.y, e6.z ?? 0];
  691. const s5 = e6.spatialReference;
  692. return new I2({ external: { source: t2, extent: r5 }, transform: n4, spatialReference: s5 });
  693. }
  694. static createIncomplete(e6, o3) {
  695. const r5 = o3?.transform.clone() ?? new L2();
  696. r5.origin = [e6.x, e6.y, e6.z ?? 0];
  697. const n4 = e6.spatialReference, s5 = new I2({ transform: r5, spatialReference: n4 });
  698. return s5.addResolvingPromise(Promise.reject(new s2("mesh-incomplete", "Mesh resources are not complete"))), s5;
  699. }
  700. };
  701. e([d({ type: [f4], json: { write: true } })], k6.prototype, "components", void 0), e([d({ type: L2, json: { write: true } })], k6.prototype, "transform", void 0), e([d({ constructOnly: true })], k6.prototype, "external", void 0), e([d({ readOnly: true })], k6.prototype, "hasExtent", null), e([d({ readOnly: true })], k6.prototype, "boundingInfo", null), e([d({ readOnly: true })], k6.prototype, "anchor", null), e([d({ readOnly: true })], k6.prototype, "origin", null), e([d({ readOnly: true, json: { read: false } })], k6.prototype, "extent", null), e([d({ readOnly: true, json: { read: false, write: true, default: true } })], k6.prototype, "hasZ", void 0), e([d({ readOnly: true, json: { read: false, write: true, default: false } })], k6.prototype, "hasM", void 0), e([d({ type: p4, nonNullable: true, json: { write: true } })], k6.prototype, "vertexAttributes", void 0), k6 = I2 = e([n("esri.geometry.Mesh")], k6);
  702. var D2 = { x: r2(1, 0, 0), y: r2(0, 1, 0), z: r2(0, 0, 1) };
  703. var W = a2();
  704. var Z2 = a2();
  705. var _2 = a2();
  706. var H = n2();
  707. var N = k6;
  708. // node_modules/@arcgis/core/layers/support/infoFor3D.js
  709. var s4;
  710. var e5;
  711. !function(s5) {
  712. s5.featureGUID = "featureGUID", s5.assetName = "assetName", s5.hash = "hash", s5.type = "type", s5.conversionStatus = "conversionStatus", s5.flags = "flags", s5.complexity = "complexity", s5.size = "size", s5.seqNo = "seqNo", s5.sourceHash = "sourceHash", s5.assetURL = "assetURL";
  713. }(s4 || (s4 = {})), function(s5) {
  714. s5.SUBMITTED = "SUBMITTED", s5.INPROGRESS = "INPROGRESS", s5.FAILED = "FAILED", s5.COMPLETED = "COMPLETED";
  715. }(e5 || (e5 = {}));
  716. // node_modules/@arcgis/core/rest/support/meshFeatureSet.js
  717. function c4(o3, s5, n4) {
  718. const a5 = n4.features;
  719. n4.features = [], delete n4.geometryType;
  720. const i2 = x4.fromJSON(n4);
  721. i2.geometryType = "mesh";
  722. const u4 = i2.spatialReference, f8 = t(o3.outFields) || !o3.outFields.length ? () => ({}) : l6(o3.outFields.includes("*") ? null : new Set(o3.outFields));
  723. for (const e6 of a5) {
  724. const o4 = p8(e6, u4, s5);
  725. r(o4) && i2.features.push(new g2({ geometry: o4, attributes: f8(e6) }));
  726. }
  727. return i2;
  728. }
  729. function l6(t2) {
  730. return ({ attributes: e6 }) => {
  731. if (!e6)
  732. return {};
  733. if (!t2)
  734. return e6;
  735. for (const r5 in e6)
  736. t2.has(r5) || delete e6[r5];
  737. return e6;
  738. };
  739. }
  740. function p8(t2, e6, r5) {
  741. const { status: n4, source: a5 } = D3(t2);
  742. if (n4 === y6.FAILED)
  743. return null;
  744. const i2 = g5(t2, e6, r5), u4 = M.fromJSON(t2.geometry);
  745. u4.spatialReference = e6;
  746. const f8 = E2(t2, r5);
  747. return n4 === y6.PENDING ? N.createIncomplete(i2, { extent: u4, transform: f8 }) : N.createWithExternalSource(i2, a5, { extent: u4, transform: f8 });
  748. }
  749. function g5({ attributes: t2 }, e6, { transformFieldRoles: r5 }) {
  750. return new j({ x: t2[r5.originX], y: t2[r5.originY], z: t2[r5.originZ], spatialReference: e6 });
  751. }
  752. function E2({ attributes: t2, assetMappings: e6 }, { transformFieldRoles: r5 }) {
  753. return new L2({ translation: [t2[r5.translationX], t2[r5.translationY], t2[r5.translationZ]], rotation: k([t2[r5.rotationX], t2[r5.rotationY], t2[r5.rotationZ]], t2[r5.rotationDeg]), scale: [t2[r5.scaleX], t2[r5.scaleY], t2[r5.scaleZ]], geographic: !e6[s4.flags]?.includes("PROJECT_VERTICES") });
  754. }
  755. function D3(t2) {
  756. if (!t2.assetMappings)
  757. return { status: y6.FAILED };
  758. const e6 = [], r5 = new Map();
  759. for (const o3 of t2.assetMappings) {
  760. const t3 = o3[s4.seqNo], s5 = o3[s4.assetName], n4 = o3[s4.assetURL], a5 = o3[s4.conversionStatus];
  761. if (a5 === e5.FAILED)
  762. return { status: y6.FAILED };
  763. if (a5 !== e5.COMPLETED)
  764. return { status: y6.PENDING };
  765. if (t3 == null)
  766. e6.push({ name: s5, source: n4 });
  767. else {
  768. const o4 = r5.get(s5);
  769. let a6;
  770. o4 ? a6 = o4.multipart : (a6 = [], e6.push({ name: s5, source: { multipart: a6 } }), r5.set(s5, { multipart: a6 })), a6[t3] = n4;
  771. }
  772. }
  773. return { status: y6.COMPLETED, source: e6 };
  774. }
  775. var y6;
  776. !function(t2) {
  777. t2[t2.FAILED = 0] = "FAILED", t2[t2.PENDING = 1] = "PENDING", t2[t2.COMPLETED = 2] = "COMPLETED";
  778. }(y6 || (y6 = {}));
  779. export {
  780. c4 as meshFeatureSetFromJSON
  781. };
  782. //# sourceMappingURL=meshFeatureSet-77HDYLJC.js.map