objectResourceUtils-OTLKPTOD.js 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706
  1. import {
  2. E as E4,
  3. W,
  4. _ as _2,
  5. a as a9,
  6. c as c5,
  7. c2 as c6,
  8. h as h5,
  9. i as i7,
  10. l as l5,
  11. t as t6
  12. } from "./chunk-G3TNMPDJ.js";
  13. import {
  14. D as D2,
  15. _,
  16. c as c4,
  17. f as f3,
  18. n as n10
  19. } from "./chunk-GDB2KX4Y.js";
  20. import {
  21. _ as _3
  22. } from "./chunk-Y2EWIDNZ.js";
  23. import {
  24. n as n5,
  25. u as u5
  26. } from "./chunk-546QCRS4.js";
  27. import {
  28. W as W2,
  29. i as i6
  30. } from "./chunk-Q7HVKAHU.js";
  31. import {
  32. u as u4
  33. } from "./chunk-QXZVBSBH.js";
  34. import {
  35. V as V3
  36. } from "./chunk-NKUISUYG.js";
  37. import {
  38. E as E3,
  39. L as L4,
  40. a2 as a8,
  41. d3 as d,
  42. e as e12,
  43. f as f4,
  44. h as h3,
  45. h2 as h4,
  46. i as i5,
  47. l as l4,
  48. o as o6,
  49. o3 as o7,
  50. o5 as o8,
  51. r as r9,
  52. r2 as r10,
  53. x as x2
  54. } from "./chunk-OBMTYN3I.js";
  55. import {
  56. C as C2,
  57. N,
  58. O as O5,
  59. a as a7,
  60. c as c3,
  61. l as l2,
  62. n as n9
  63. } from "./chunk-EPIK5VPD.js";
  64. import {
  65. e as e11
  66. } from "./chunk-YOPKLVID.js";
  67. import {
  68. n as n11
  69. } from "./chunk-T4GXZJ3D.js";
  70. import {
  71. a as a6
  72. } from "./chunk-ILP23N26.js";
  73. import {
  74. c as c2,
  75. e as e10,
  76. g,
  77. i as i4,
  78. l,
  79. n2 as n6,
  80. n3 as n7,
  81. n4 as n8,
  82. o as o3,
  83. o2 as o4,
  84. o3 as o5,
  85. r as r6,
  86. r2 as r7,
  87. t as t5,
  88. u as u6
  89. } from "./chunk-NBRP7CWO.js";
  90. import "./chunk-GXVMJ7RN.js";
  91. import "./chunk-6BRTRIDE.js";
  92. import {
  93. T
  94. } from "./chunk-AGCBSGET.js";
  95. import {
  96. t as t3
  97. } from "./chunk-J525NRN3.js";
  98. import {
  99. O as O3
  100. } from "./chunk-XXBIV3TZ.js";
  101. import "./chunk-2QVXRTVA.js";
  102. import {
  103. C,
  104. D,
  105. E as E2,
  106. F,
  107. G as G2,
  108. I,
  109. L as L3,
  110. M,
  111. O as O4,
  112. P as P2,
  113. V as V2,
  114. Y,
  115. u as u3
  116. } from "./chunk-MI7HWWFL.js";
  117. import {
  118. e2 as e9,
  119. f as f2,
  120. r as r5,
  121. t as t4
  122. } from "./chunk-4KFEVYXL.js";
  123. import {
  124. S as S2
  125. } from "./chunk-5W6F4NR5.js";
  126. import {
  127. e as e8
  128. } from "./chunk-YZUP3MAF.js";
  129. import {
  130. e as e7
  131. } from "./chunk-E3HOL2XO.js";
  132. import {
  133. e as e6
  134. } from "./chunk-SCXOTZ6Q.js";
  135. import {
  136. E,
  137. L as L2,
  138. O as O2,
  139. c,
  140. i as i3,
  141. u as u2,
  142. x
  143. } from "./chunk-H4JLO5B2.js";
  144. import "./chunk-LGW7TID4.js";
  145. import {
  146. l as l3
  147. } from "./chunk-FXKC6XZV.js";
  148. import "./chunk-G5AI6ZNE.js";
  149. import {
  150. j
  151. } from "./chunk-CRGVDJI6.js";
  152. import "./chunk-6P6NA7JB.js";
  153. import {
  154. r as r8
  155. } from "./chunk-LPQPD3EP.js";
  156. import "./chunk-WR32EHFC.js";
  157. import {
  158. B,
  159. h as h2
  160. } from "./chunk-WNCU6BFU.js";
  161. import {
  162. r as r4
  163. } from "./chunk-NTUXR253.js";
  164. import {
  165. n as n4
  166. } from "./chunk-H2KDMZTR.js";
  167. import "./chunk-PJ7ZQ4VD.js";
  168. import {
  169. G,
  170. h
  171. } from "./chunk-TERAW6FT.js";
  172. import "./chunk-N2663GRX.js";
  173. import {
  174. A,
  175. L,
  176. O,
  177. P,
  178. S,
  179. a2 as a4,
  180. e as e5,
  181. i,
  182. i2,
  183. o as o2,
  184. p,
  185. q,
  186. r as r3,
  187. s as s4,
  188. u,
  189. z
  190. } from "./chunk-XNLG7T2T.js";
  191. import {
  192. e as e4,
  193. n as n3,
  194. r as r2,
  195. t as t2
  196. } from "./chunk-IR4PV7VK.js";
  197. import {
  198. a as a5
  199. } from "./chunk-WJ3OEUD3.js";
  200. import {
  201. a as a3
  202. } from "./chunk-MXB2XLKV.js";
  203. import {
  204. n as n2
  205. } from "./chunk-DT6EAZQ5.js";
  206. import {
  207. U,
  208. a as a2
  209. } from "./chunk-VNFRAYHO.js";
  210. import "./chunk-R5IG2D6H.js";
  211. import {
  212. V,
  213. X
  214. } from "./chunk-VBRY5KJM.js";
  215. import "./chunk-ECW2QABR.js";
  216. import "./chunk-GCDJLKH4.js";
  217. import "./chunk-MRJEICT6.js";
  218. import {
  219. e,
  220. n5 as n
  221. } from "./chunk-Y3WMVFTW.js";
  222. import "./chunk-SAS7RONY.js";
  223. import "./chunk-WSRBH7BF.js";
  224. import "./chunk-IHXECKQQ.js";
  225. import {
  226. f,
  227. m as m2,
  228. v,
  229. w
  230. } from "./chunk-ULGDPLM2.js";
  231. import {
  232. s as s2,
  233. s3
  234. } from "./chunk-EMJ4ZSM2.js";
  235. import "./chunk-IKP3YN53.js";
  236. import {
  237. a2 as a,
  238. e as e2,
  239. e2 as e3,
  240. m,
  241. o2 as o,
  242. r,
  243. s,
  244. t
  245. } from "./chunk-GZT4BVFP.js";
  246. import "./chunk-A5ICIBVI.js";
  247. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/BoundingInfo.js
  248. var a10 = class {
  249. constructor(i12, s8, a12, c12) {
  250. this.primitiveIndices = i12, this._numIndexPerPrimitive = s8, this.indices = a12, this.position = c12, this.center = n3(), e11(i12.length >= 1), e11(a12.length % this._numIndexPerPrimitive == 0), e11(a12.length >= i12.length * this._numIndexPerPrimitive), e11(c12.size === 3 || c12.size === 4);
  251. const { data: o12, size: d6 } = c12, M3 = i12.length;
  252. let l10 = d6 * a12[this._numIndexPerPrimitive * i12[0]];
  253. b.clear(), b.push(l10), this.bbMin = r2(o12[l10], o12[l10 + 1], o12[l10 + 2]), this.bbMax = t2(this.bbMin);
  254. for (let t11 = 0; t11 < M3; ++t11) {
  255. const s9 = this._numIndexPerPrimitive * i12[t11];
  256. for (let i13 = 0; i13 < this._numIndexPerPrimitive; ++i13) {
  257. l10 = d6 * a12[s9 + i13], b.push(l10);
  258. let t12 = o12[l10];
  259. this.bbMin[0] = Math.min(t12, this.bbMin[0]), this.bbMax[0] = Math.max(t12, this.bbMax[0]), t12 = o12[l10 + 1], this.bbMin[1] = Math.min(t12, this.bbMin[1]), this.bbMax[1] = Math.max(t12, this.bbMax[1]), t12 = o12[l10 + 2], this.bbMin[2] = Math.min(t12, this.bbMin[2]), this.bbMax[2] = Math.max(t12, this.bbMax[2]);
  260. }
  261. }
  262. A(this.center, this.bbMin, this.bbMax, 0.5), this.radius = 0.5 * Math.max(Math.max(this.bbMax[0] - this.bbMin[0], this.bbMax[1] - this.bbMin[1]), this.bbMax[2] - this.bbMin[2]);
  263. let m6 = this.radius * this.radius;
  264. for (let t11 = 0; t11 < b.length; ++t11) {
  265. l10 = b.getItemAt(t11);
  266. const i13 = o12[l10] - this.center[0], s9 = o12[l10 + 1] - this.center[1], e16 = o12[l10 + 2] - this.center[2], n14 = i13 * i13 + s9 * s9 + e16 * e16;
  267. if (n14 <= m6)
  268. continue;
  269. const r12 = Math.sqrt(n14), h10 = 0.5 * (r12 - this.radius);
  270. this.radius = this.radius + h10, m6 = this.radius * this.radius;
  271. const a13 = h10 / r12;
  272. this.center[0] += i13 * a13, this.center[1] += s9 * a13, this.center[2] += e16 * a13;
  273. }
  274. b.clear();
  275. }
  276. getCenter() {
  277. return this.center;
  278. }
  279. getBSRadius() {
  280. return this.radius;
  281. }
  282. getBBMin() {
  283. return this.bbMin;
  284. }
  285. getBBMax() {
  286. return this.bbMax;
  287. }
  288. getChildren() {
  289. if (this._children)
  290. return this._children;
  291. if (p(this.bbMin, this.bbMax) > 1) {
  292. const i12 = A(n3(), this.bbMin, this.bbMax, 0.5), s8 = this.primitiveIndices.length, n14 = new Uint8Array(s8), r12 = new Array(8);
  293. for (let t11 = 0; t11 < 8; ++t11)
  294. r12[t11] = 0;
  295. const { data: h10, size: b3 } = this.position;
  296. for (let t11 = 0; t11 < s8; ++t11) {
  297. let s9 = 0;
  298. const e16 = this._numIndexPerPrimitive * this.primitiveIndices[t11];
  299. let a12 = b3 * this.indices[e16], c13 = h10[a12], o13 = h10[a12 + 1], d6 = h10[a12 + 2];
  300. for (let i13 = 1; i13 < this._numIndexPerPrimitive; ++i13) {
  301. a12 = b3 * this.indices[e16 + i13];
  302. const t12 = h10[a12], s10 = h10[a12 + 1], n15 = h10[a12 + 2];
  303. t12 < c13 && (c13 = t12), s10 < o13 && (o13 = s10), n15 < d6 && (d6 = n15);
  304. }
  305. c13 < i12[0] && (s9 |= 1), o13 < i12[1] && (s9 |= 2), d6 < i12[2] && (s9 |= 4), n14[t11] = s9, ++r12[s9];
  306. }
  307. let c12 = 0;
  308. for (let t11 = 0; t11 < 8; ++t11)
  309. r12[t11] > 0 && ++c12;
  310. if (c12 < 2)
  311. return;
  312. const o12 = new Array(8);
  313. for (let t11 = 0; t11 < 8; ++t11)
  314. o12[t11] = r12[t11] > 0 ? new Uint32Array(r12[t11]) : void 0;
  315. for (let t11 = 0; t11 < 8; ++t11)
  316. r12[t11] = 0;
  317. for (let t11 = 0; t11 < s8; ++t11) {
  318. const i13 = n14[t11];
  319. o12[i13][r12[i13]++] = this.primitiveIndices[t11];
  320. }
  321. this._children = new Array(8);
  322. for (let t11 = 0; t11 < 8; ++t11)
  323. o12[t11] !== void 0 && (this._children[t11] = new a10(o12[t11], this._numIndexPerPrimitive, this.indices, this.position));
  324. }
  325. return this._children;
  326. }
  327. static prune() {
  328. b.prune();
  329. }
  330. };
  331. var b = new n({ deallocator: null });
  332. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Geometry.js
  333. var g2 = class extends r9 {
  334. constructor(t11, i12 = [], n14 = c3.Triangle, o12 = -1) {
  335. super(), this._primitiveType = n14, this.edgeIndicesLength = o12, this.type = e12.Geometry, this._vertexAttributes = new Map(), this._indices = new Map(), this._boundingInfo = null;
  336. for (const [e16, s8] of t11)
  337. s8 && this._vertexAttributes.set(e16, { ...s8 });
  338. if (i12 == null || i12.length === 0) {
  339. const t12 = d2(this._vertexAttributes), e16 = l(t12);
  340. this.edgeIndicesLength = this.edgeIndicesLength < 0 ? t12 : this.edgeIndicesLength;
  341. for (const i13 of this._vertexAttributes.keys())
  342. this._indices.set(i13, e16);
  343. } else
  344. for (const [e16, s8] of i12)
  345. s8 && (this._indices.set(e16, l6(s8)), e16 === O3.POSITION && (this.edgeIndicesLength = this.edgeIndicesLength < 0 ? this._indices.get(e16).length : this.edgeIndicesLength));
  346. }
  347. cloneShallow() {
  348. const t11 = new g2([], void 0, this._primitiveType, void 0), { _vertexAttributes: e16, _indices: i12 } = t11;
  349. return this._vertexAttributes.forEach((t12, i13) => {
  350. e16.set(i13, t12);
  351. }), this._indices.forEach((t12, e17) => {
  352. i12.set(e17, t12);
  353. }), t11.screenToWorldRatio = this.screenToWorldRatio, t11._boundingInfo = this._boundingInfo, t11;
  354. }
  355. get vertexAttributes() {
  356. return this._vertexAttributes;
  357. }
  358. getMutableAttribute(t11) {
  359. const e16 = this._vertexAttributes.get(t11);
  360. return e16 && !e16.exclusive && (e16.data = Array.from(e16.data), e16.exclusive = true), e16;
  361. }
  362. get indices() {
  363. return this._indices;
  364. }
  365. get indexCount() {
  366. const t11 = this._indices.values().next().value;
  367. return t11 ? t11.length : 0;
  368. }
  369. get primitiveType() {
  370. return this._primitiveType;
  371. }
  372. get faceCount() {
  373. return this.indexCount / 3;
  374. }
  375. get boundingInfo() {
  376. return t(this._boundingInfo) && (this._boundingInfo = this._calculateBoundingInfo()), this._boundingInfo;
  377. }
  378. computeAttachmentOrigin(t11) {
  379. return this.primitiveType === c3.Triangle ? this._computeAttachmentOriginTriangles(t11) : this._computeAttachmentOriginPoints(t11);
  380. }
  381. _computeAttachmentOriginTriangles(t11) {
  382. const e16 = this.indices.get(O3.POSITION), i12 = this.vertexAttributes.get(O3.POSITION);
  383. return u6(i12, e16, t11);
  384. }
  385. _computeAttachmentOriginPoints(t11) {
  386. const e16 = this.indices.get(O3.POSITION), i12 = this.vertexAttributes.get(O3.POSITION);
  387. return g(i12, e16, t11);
  388. }
  389. invalidateBoundingInfo() {
  390. this._boundingInfo = null;
  391. }
  392. _calculateBoundingInfo() {
  393. const t11 = this.indices.get(O3.POSITION);
  394. if (t11.length === 0)
  395. return null;
  396. const n14 = this.primitiveType === c3.Triangle ? 3 : 1;
  397. e11(t11.length % n14 == 0, "Indexing error: " + t11.length + " not divisible by " + n14);
  398. const s8 = l(t11.length / n14), o12 = this.vertexAttributes.get(O3.POSITION);
  399. return new a10(s8, n14, t11, o12);
  400. }
  401. };
  402. function d2(t11) {
  403. const e16 = t11.values().next().value;
  404. return e16 == null ? 0 : e16.data.length / e16.size;
  405. }
  406. function l6(t11) {
  407. if (t11.BYTES_PER_ELEMENT === Uint16Array.BYTES_PER_ELEMENT)
  408. return t11;
  409. for (const e16 of t11)
  410. if (e16 >= 65536)
  411. return t11;
  412. return new Uint16Array(t11);
  413. }
  414. // node_modules/@arcgis/core/libs/basisu/BasisU.js
  415. function s5() {
  416. if (t(i8)) {
  417. const t11 = (t12) => a3(`esri/libs/basisu/${t12}`);
  418. i8 = import("./basis_transcoder-YLPYC2ZL.js").then((e16) => e16.b).then(({ default: e16 }) => e16({ locateFile: t11 }).then((e17) => (e17.initializeBasis(), delete e17.then, e17)));
  419. }
  420. return i8;
  421. }
  422. var i8;
  423. // node_modules/@arcgis/core/libs/basisu/TextureFormat.js
  424. var _4;
  425. !function(_8) {
  426. _8[_8.ETC1_RGB = 0] = "ETC1_RGB", _8[_8.ETC2_RGBA = 1] = "ETC2_RGBA", _8[_8.BC1_RGB = 2] = "BC1_RGB", _8[_8.BC3_RGBA = 3] = "BC3_RGBA", _8[_8.BC4_R = 4] = "BC4_R", _8[_8.BC5_RG = 5] = "BC5_RG", _8[_8.BC7_M6_RGB = 6] = "BC7_M6_RGB", _8[_8.BC7_M5_RGBA = 7] = "BC7_M5_RGBA", _8[_8.PVRTC1_4_RGB = 8] = "PVRTC1_4_RGB", _8[_8.PVRTC1_4_RGBA = 9] = "PVRTC1_4_RGBA", _8[_8.ASTC_4x4_RGBA = 10] = "ASTC_4x4_RGBA", _8[_8.ATC_RGB = 11] = "ATC_RGB", _8[_8.ATC_RGBA = 12] = "ATC_RGBA", _8[_8.FXT1_RGB = 17] = "FXT1_RGB", _8[_8.PVRTC2_4_RGB = 18] = "PVRTC2_4_RGB", _8[_8.PVRTC2_4_RGBA = 19] = "PVRTC2_4_RGBA", _8[_8.ETC2_EAC_R11 = 20] = "ETC2_EAC_R11", _8[_8.ETC2_EAC_RG11 = 21] = "ETC2_EAC_RG11", _8[_8.RGBA32 = 13] = "RGBA32", _8[_8.RGB565 = 14] = "RGB565", _8[_8.BGR565 = 15] = "BGR565", _8[_8.RGBA4444 = 16] = "RGBA4444";
  427. }(_4 || (_4 = {}));
  428. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/BasisUtil.js
  429. var g3 = null;
  430. var l7 = null;
  431. async function c7() {
  432. return t(l7) && (l7 = s5(), g3 = await l7), l7;
  433. }
  434. function u7(t11, n14) {
  435. if (t(g3))
  436. return t11.byteLength;
  437. const r12 = new g3.BasisFile(new Uint8Array(t11)), s8 = T2(r12) ? E5(r12.getNumLevels(0), r12.getHasAlpha(), r12.getImageWidth(0, 0), r12.getImageHeight(0, 0), n14) : 0;
  438. return r12.close(), r12.delete(), s8;
  439. }
  440. function m3(t11, n14) {
  441. if (t(g3))
  442. return t11.byteLength;
  443. const r12 = new g3.KTX2File(new Uint8Array(t11)), s8 = _5(r12) ? E5(r12.getLevels(), r12.getHasAlpha(), r12.getWidth(), r12.getHeight(), n14) : 0;
  444. return r12.close(), r12.delete(), s8;
  445. }
  446. function E5(e16, t11, n14, s8, i12) {
  447. const a12 = _(t11 ? u3.COMPRESSED_RGBA8_ETC2_EAC : u3.COMPRESSED_RGB8_ETC2), g7 = i12 && e16 > 1 ? (4 ** e16 - 1) / (3 * 4 ** (e16 - 1)) : 1;
  448. return Math.ceil(n14 * s8 * a12 * g7);
  449. }
  450. function T2(e16) {
  451. return e16.getNumImages() >= 1 && !e16.isUASTC();
  452. }
  453. function _5(e16) {
  454. return e16.getFaces() >= 1 && e16.isETC1S();
  455. }
  456. async function h6(t11, n14, r12) {
  457. t(g3) && (g3 = await c7());
  458. const s8 = new g3.BasisFile(new Uint8Array(r12));
  459. if (!T2(s8))
  460. return null;
  461. s8.startTranscoding();
  462. const i12 = p2(t11, n14, s8.getNumLevels(0), s8.getHasAlpha(), s8.getImageWidth(0, 0), s8.getImageHeight(0, 0), (e16, t12) => s8.getImageTranscodedSizeInBytes(0, e16, t12), (e16, t12, n15) => s8.transcodeImage(n15, 0, e16, t12, 0, 0));
  463. return s8.close(), s8.delete(), i12;
  464. }
  465. async function A2(t11, n14, r12) {
  466. t(g3) && (g3 = await c7());
  467. const s8 = new g3.KTX2File(new Uint8Array(r12));
  468. if (!_5(s8))
  469. return null;
  470. s8.startTranscoding();
  471. const i12 = p2(t11, n14, s8.getLevels(), s8.getHasAlpha(), s8.getWidth(), s8.getHeight(), (e16, t12) => s8.getImageTranscodedSizeInBytes(e16, 0, 0, t12), (e16, t12, n15) => s8.transcodeImage(n15, e16, 0, 0, t12, 0, -1, -1));
  472. return s8.close(), s8.delete(), i12;
  473. }
  474. function p2(e16, t11, o12, g7, l10, c12, u11, m6) {
  475. const { compressedTextureETC: E9, compressedTextureS3TC: T6 } = e16.capabilities, [_8, h10] = E9 ? g7 ? [_4.ETC2_RGBA, u3.COMPRESSED_RGBA8_ETC2_EAC] : [_4.ETC1_RGB, u3.COMPRESSED_RGB8_ETC2] : T6 ? g7 ? [_4.BC3_RGBA, u3.COMPRESSED_RGBA_S3TC_DXT5_EXT] : [_4.BC1_RGB, u3.COMPRESSED_RGB_S3TC_DXT1_EXT] : [_4.RGBA32, P2.RGBA], A7 = t11.hasMipmap ? o12 : Math.min(1, o12), p5 = [];
  476. for (let n14 = 0; n14 < A7; n14++)
  477. p5.push(new Uint8Array(u11(n14, _8))), m6(n14, _8, p5[n14]);
  478. const C4 = p5.length > 1, d6 = C4 ? L3.LINEAR_MIPMAP_LINEAR : L3.LINEAR, R2 = { ...t11, samplingMode: d6, hasMipmap: C4, internalFormat: h10, width: l10, height: c12 };
  479. return new u5(e16, R2, { type: "compressed", levels: p5 });
  480. }
  481. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DDSUtil.js
  482. var a11 = s2.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");
  483. var i9 = 542327876;
  484. var s6 = 131072;
  485. var l8 = 4;
  486. function u8(e16) {
  487. return e16.charCodeAt(0) + (e16.charCodeAt(1) << 8) + (e16.charCodeAt(2) << 16) + (e16.charCodeAt(3) << 24);
  488. }
  489. function m4(e16) {
  490. return String.fromCharCode(255 & e16, e16 >> 8 & 255, e16 >> 16 & 255, e16 >> 24 & 255);
  491. }
  492. var c8 = u8("DXT1");
  493. var h7 = u8("DXT3");
  494. var p3 = u8("DXT5");
  495. var d3 = 31;
  496. var g4 = 0;
  497. var f5 = 1;
  498. var C3 = 2;
  499. var w2 = 3;
  500. var D3 = 4;
  501. var _6 = 7;
  502. var T3 = 20;
  503. var A3 = 21;
  504. function E6(e16, t11, n14) {
  505. const { textureData: a12, internalFormat: i12, width: s8, height: l10 } = S3(n14, t11.hasMipmap);
  506. return t11.samplingMode = a12.levels.length > 1 ? L3.LINEAR_MIPMAP_LINEAR : L3.LINEAR, t11.hasMipmap = a12.levels.length > 1, t11.internalFormat = i12, t11.width = s8, t11.height = l10, new u5(e16, t11, a12);
  507. }
  508. function S3(e16, r12) {
  509. const o12 = new Int32Array(e16, 0, d3);
  510. if (o12[g4] !== i9)
  511. return a11.error("Invalid magic number in DDS header"), null;
  512. if (!(o12[T3] & l8))
  513. return a11.error("Unsupported format, must contain a FourCC code"), null;
  514. const u11 = o12[A3];
  515. let E9, S5;
  516. switch (u11) {
  517. case c8:
  518. E9 = 8, S5 = u3.COMPRESSED_RGB_S3TC_DXT1_EXT;
  519. break;
  520. case h7:
  521. E9 = 16, S5 = u3.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  522. break;
  523. case p3:
  524. E9 = 16, S5 = u3.COMPRESSED_RGBA_S3TC_DXT5_EXT;
  525. break;
  526. default:
  527. return a11.error("Unsupported FourCC code:", m4(u11)), null;
  528. }
  529. let M3 = 1, R2 = o12[D3], x4 = o12[w2];
  530. (3 & R2) == 0 && (3 & x4) == 0 || (a11.warn("Rounding up compressed texture size to nearest multiple of 4."), R2 = R2 + 3 & -4, x4 = x4 + 3 & -4);
  531. const X3 = R2, b3 = x4;
  532. let I5, v4;
  533. o12[C3] & s6 && r12 !== false && (M3 = Math.max(1, o12[_6])), M3 === 1 || i2(R2) && i2(x4) || (a11.warn("Ignoring mipmaps of non power of two sized compressed texture."), M3 = 1);
  534. let F3 = o12[f5] + 4;
  535. const L6 = [];
  536. for (let t11 = 0; t11 < M3; ++t11)
  537. v4 = (R2 + 3 >> 2) * (x4 + 3 >> 2) * E9, I5 = new Uint8Array(e16, F3, v4), L6.push(I5), F3 += v4, R2 = Math.max(1, R2 >> 1), x4 = Math.max(1, x4 >> 1);
  538. return { textureData: { type: "compressed", levels: L6 }, internalFormat: S5, width: X3, height: b3 };
  539. }
  540. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js
  541. var n12 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 12)];
  542. var w3 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 20), new t3(O3.UV0, 2, C.FLOAT, 12, 20)];
  543. var I2 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 32), new t3(O3.NORMAL, 3, C.FLOAT, 12, 32), new t3(O3.UV0, 2, C.FLOAT, 24, 32)];
  544. var r11 = [new t3(O3.POSITION, 3, C.FLOAT, 0, 16), new t3(O3.COLOR, 4, C.UNSIGNED_BYTE, 12, 16)];
  545. var t7 = [new t3(O3.POSITION, 2, C.FLOAT, 0, 8)];
  546. var A4 = [new t3(O3.POSITION, 2, C.FLOAT, 0, 16), new t3(O3.UV0, 2, C.FLOAT, 8, 16)];
  547. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/glUtil3D.js
  548. function u9(a12, i12 = t7, m6 = E3, l10 = -1, T6 = 1) {
  549. let u11 = null;
  550. if (i12 === A4)
  551. u11 = new Float32Array([l10, l10, 0, 0, T6, l10, 1, 0, l10, T6, 0, 1, T6, T6, 1, 1]);
  552. else
  553. u11 = new Float32Array([l10, l10, T6, l10, l10, T6, T6, T6]);
  554. return new f3(a12, m6, { geometry: i12 }, { geometry: c4.createVertex(a12, F.STATIC_DRAW, u11) });
  555. }
  556. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Texture.js
  557. var L5 = class extends r9 {
  558. constructor(t11, e16) {
  559. super(), this.data = t11, this.type = e12.Texture, this._glTexture = null, this._powerOfTwoStretchInfo = null, this._loadingPromise = null, this._loadingController = null, this.events = new n2(), this.params = e16 || {}, this.params.mipmap = this.params.mipmap !== false, this.params.noUnpackFlip = this.params.noUnpackFlip || false, this.params.preMultiplyAlpha = this.params.preMultiplyAlpha || false, this.params.wrap = this.params.wrap || { s: D.REPEAT, t: D.REPEAT }, this.params.powerOfTwoResizeMode = this.params.powerOfTwoResizeMode || l2.STRETCH, this.estimatedTexMemRequired = L5._estimateTexMemRequired(this.data, this.params), this._startPreload();
  560. }
  561. _startPreload() {
  562. const t11 = this.data;
  563. t(t11) || (t11 instanceof HTMLVideoElement ? this._startPreloadVideoElement(t11) : t11 instanceof HTMLImageElement && this._startPreloadImageElement(t11));
  564. }
  565. _startPreloadVideoElement(t11) {
  566. if (!(V(t11.src) || t11.preload === "auto" && t11.crossOrigin)) {
  567. t11.preload = "auto", t11.crossOrigin = "anonymous";
  568. const e16 = !t11.paused;
  569. if (t11.src = t11.src, e16 && t11.autoplay) {
  570. const e17 = () => {
  571. t11.removeEventListener("canplay", e17), t11.play();
  572. };
  573. t11.addEventListener("canplay", e17);
  574. }
  575. }
  576. }
  577. _startPreloadImageElement(t11) {
  578. X(t11.src) || V(t11.src) || t11.crossOrigin || (t11.crossOrigin = "anonymous", t11.src = t11.src);
  579. }
  580. static _getDataDimensions(t11) {
  581. return t11 instanceof HTMLVideoElement ? { width: t11.videoWidth, height: t11.videoHeight } : t11;
  582. }
  583. static _estimateTexMemRequired(t11, e16) {
  584. if (t(t11))
  585. return 0;
  586. if (o(t11) || e3(t11))
  587. return e16.encoding === L5.KTX2_ENCODING ? m3(t11, e16.mipmap) : e16.encoding === L5.BASIS_ENCODING ? u7(t11, e16.mipmap) : t11.byteLength;
  588. const { width: r12, height: i12 } = t11 instanceof Image || t11 instanceof ImageData || t11 instanceof HTMLCanvasElement || t11 instanceof HTMLVideoElement ? L5._getDataDimensions(t11) : e16;
  589. return (e16.mipmap ? 4 / 3 : 1) * r12 * i12 * (e16.components || 4) || 0;
  590. }
  591. dispose() {
  592. this.data = void 0;
  593. }
  594. get width() {
  595. return this.params.width;
  596. }
  597. get height() {
  598. return this.params.height;
  599. }
  600. _createDescriptor(t11) {
  601. return { target: M.TEXTURE_2D, pixelFormat: P2.RGBA, dataType: G2.UNSIGNED_BYTE, wrapMode: this.params.wrap, flipped: !this.params.noUnpackFlip, samplingMode: this.params.mipmap ? L3.LINEAR_MIPMAP_LINEAR : L3.LINEAR, hasMipmap: this.params.mipmap, preMultiplyAlpha: this.params.preMultiplyAlpha, maxAnisotropy: this.params.maxAnisotropy ?? (this.params.mipmap ? t11.parameters.maxMaxAnisotropy : 1) };
  602. }
  603. get glTexture() {
  604. return this._glTexture;
  605. }
  606. load(t11, e16) {
  607. if (r(this._glTexture))
  608. return this._glTexture;
  609. if (r(this._loadingPromise))
  610. return this._loadingPromise;
  611. const r12 = this.data;
  612. return t(r12) ? (this._glTexture = new u5(t11, this._createDescriptor(t11), null), this._glTexture) : typeof r12 == "string" ? this._loadFromURL(t11, e16, r12) : r12 instanceof Image ? this._loadFromImageElement(t11, e16, r12) : r12 instanceof HTMLVideoElement ? this._loadFromVideoElement(t11, e16, r12) : r12 instanceof ImageData || r12 instanceof HTMLCanvasElement ? this._loadFromImage(t11, r12, e16) : (o(r12) || e3(r12)) && this.params.encoding === L5.DDS_ENCODING ? (this.data = void 0, this._loadFromDDSData(t11, r12)) : (o(r12) || e3(r12)) && this.params.encoding === L5.KTX2_ENCODING ? (this.data = void 0, this._loadFromKTX2(t11, r12)) : (o(r12) || e3(r12)) && this.params.encoding === L5.BASIS_ENCODING ? (this.data = void 0, this._loadFromBasis(t11, r12)) : e3(r12) ? this._loadFromPixelData(t11, r12) : o(r12) ? this._loadFromPixelData(t11, new Uint8Array(r12)) : null;
  613. }
  614. get requiresFrameUpdates() {
  615. return this.data instanceof HTMLVideoElement;
  616. }
  617. frameUpdate(t11, e16, r12) {
  618. if (!(this.data instanceof HTMLVideoElement) || t(this._glTexture))
  619. return r12;
  620. if (this.data.readyState < j2.HAVE_CURRENT_DATA || r12 === this.data.currentTime)
  621. return r12;
  622. if (r(this._powerOfTwoStretchInfo)) {
  623. const { framebuffer: r13, vao: i12, sourceTexture: s8 } = this._powerOfTwoStretchInfo;
  624. s8.setData(this.data), this._drawStretchedTexture(t11, e16, r13, i12, s8, this._glTexture);
  625. } else {
  626. const { videoWidth: t12, videoHeight: e17 } = this.data, { width: r13, height: i12 } = this._glTexture.descriptor;
  627. t12 !== r13 || e17 !== i12 ? this._glTexture.updateData(0, 0, 0, Math.min(t12, r13), Math.min(e17, i12), this.data) : this._glTexture.setData(this.data);
  628. }
  629. return this._glTexture.descriptor.hasMipmap && this._glTexture.generateMipmap(), this.params.updateCallback && this.params.updateCallback(), this.data.currentTime;
  630. }
  631. _loadFromDDSData(t11, e16) {
  632. return this._glTexture = E6(t11, this._createDescriptor(t11), e16), this._glTexture;
  633. }
  634. _loadFromKTX2(t11, e16) {
  635. return this._loadAsync(() => A2(t11, this._createDescriptor(t11), e16).then((t12) => (this._glTexture = t12, t12)));
  636. }
  637. _loadFromBasis(t11, e16) {
  638. return this._loadAsync(() => h6(t11, this._createDescriptor(t11), e16).then((t12) => (this._glTexture = t12, t12)));
  639. }
  640. _loadFromPixelData(t11, e16) {
  641. e11(this.params.width > 0 && this.params.height > 0);
  642. const r12 = this._createDescriptor(t11);
  643. return r12.pixelFormat = this.params.components === 1 ? P2.LUMINANCE : this.params.components === 3 ? P2.RGB : P2.RGBA, r12.width = this.params.width, r12.height = this.params.height, this._glTexture = new u5(t11, r12, e16), this._glTexture;
  644. }
  645. _loadFromURL(t11, e16, r12) {
  646. return this._loadAsync(async (i12) => {
  647. const s8 = await t6(r12, { signal: i12 });
  648. return f(i12), this._loadFromImage(t11, s8, e16);
  649. });
  650. }
  651. _loadFromImageElement(t11, e16, r12) {
  652. return r12.complete ? this._loadFromImage(t11, r12, e16) : this._loadAsync(async (i12) => {
  653. const s8 = await a2(r12, r12.src, false, i12);
  654. return f(i12), this._loadFromImage(t11, s8, e16);
  655. });
  656. }
  657. _loadFromVideoElement(t11, e16, r12) {
  658. return r12.readyState >= j2.HAVE_CURRENT_DATA ? this._loadFromImage(t11, r12, e16) : this._loadFromVideoElementAsync(t11, e16, r12);
  659. }
  660. _loadFromVideoElementAsync(t11, r12, i12) {
  661. return this._loadAsync((s8) => new Promise((a12, o12) => {
  662. const m6 = () => {
  663. i12.removeEventListener("loadeddata", p5), i12.removeEventListener("error", d6), a(_8);
  664. }, p5 = () => {
  665. i12.readyState >= j2.HAVE_CURRENT_DATA && (m6(), a12(this._loadFromImage(t11, i12, r12)));
  666. }, d6 = (t12) => {
  667. m6(), o12(t12 || new s3("Failed to load video"));
  668. };
  669. i12.addEventListener("loadeddata", p5), i12.addEventListener("error", d6);
  670. const _8 = v(s8, () => d6(m2()));
  671. }));
  672. }
  673. _loadFromImage(t11, e16, r12) {
  674. const s8 = L5._getDataDimensions(e16);
  675. this.params.width = s8.width, this.params.height = s8.height;
  676. const a12 = this._createDescriptor(t11);
  677. return a12.pixelFormat = this.params.components === 3 ? P2.RGB : P2.RGBA, !this._requiresPowerOfTwo(t11, a12) || i2(s8.width) && i2(s8.height) ? (a12.width = s8.width, a12.height = s8.height, this._glTexture = new u5(t11, a12, e16), this._glTexture) : (this._glTexture = this._makePowerOfTwoTexture(t11, e16, s8, a12, r12), this._glTexture);
  678. }
  679. _loadAsync(t11) {
  680. const e16 = new AbortController();
  681. this._loadingController = e16;
  682. const r12 = t11(e16.signal);
  683. this._loadingPromise = r12;
  684. const i12 = () => {
  685. this._loadingController === e16 && (this._loadingController = null), this._loadingPromise === r12 && (this._loadingPromise = null);
  686. };
  687. return r12.then(i12, i12), r12;
  688. }
  689. _requiresPowerOfTwo(t11, e16) {
  690. const r12 = D.CLAMP_TO_EDGE, i12 = typeof e16.wrapMode == "number" ? e16.wrapMode === r12 : e16.wrapMode.s === r12 && e16.wrapMode.t === r12;
  691. return !n5(t11.gl) && (e16.hasMipmap || !i12);
  692. }
  693. _makePowerOfTwoTexture(e16, r12, i12, a12, o12) {
  694. const { width: n14, height: m6 } = i12, h10 = a4(n14), l10 = a4(m6);
  695. let p5;
  696. switch (a12.width = h10, a12.height = l10, this.params.powerOfTwoResizeMode) {
  697. case l2.PAD:
  698. a12.textureCoordinateScaleFactor = [n14 / h10, m6 / l10], p5 = new u5(e16, a12), p5.updateData(0, 0, 0, n14, m6, r12);
  699. break;
  700. case l2.STRETCH:
  701. case null:
  702. case void 0:
  703. p5 = this._stretchToPowerOfTwo(e16, r12, a12, o12());
  704. break;
  705. default:
  706. n4(this.params.powerOfTwoResizeMode);
  707. }
  708. return a12.hasMipmap && p5.generateMipmap(), p5;
  709. }
  710. _stretchToPowerOfTwo(t11, e16, r12, i12) {
  711. const s8 = new u5(t11, r12), a12 = new D2(t11, { colorTarget: Y.TEXTURE, depthStencilTarget: V2.NONE }, s8), o12 = new u5(t11, { target: M.TEXTURE_2D, pixelFormat: r12.pixelFormat, dataType: G2.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, samplingMode: L3.LINEAR, flipped: !!r12.flipped, maxAnisotropy: 8, preMultiplyAlpha: r12.preMultiplyAlpha }, e16), n14 = u9(t11), m6 = t11.getBoundFramebufferObject();
  712. return this._drawStretchedTexture(t11, i12, a12, n14, o12, s8), this.requiresFrameUpdates ? this._powerOfTwoStretchInfo = { vao: n14, sourceTexture: o12, framebuffer: a12 } : (n14.dispose(true), o12.dispose(), a12.detachColorTexture(), a12.dispose()), t11.bindFramebuffer(m6), s8;
  713. }
  714. _drawStretchedTexture(t11, e16, r12, i12, s8, a12) {
  715. t11.bindFramebuffer(r12);
  716. const o12 = t11.getViewport();
  717. t11.setViewport(0, 0, a12.descriptor.width, a12.descriptor.height);
  718. const n14 = t11.bindTechnique(e16);
  719. n14.setUniform4f("uColor", 1, 1, 1, 1), n14.bindTexture("tex", s8), t11.bindVAO(i12), t11.drawArrays(E2.TRIANGLE_STRIP, 0, n10(i12, "geometry")), t11.bindFramebuffer(null), t11.setViewport(o12.x, o12.y, o12.width, o12.height);
  720. }
  721. unload() {
  722. if (r(this._powerOfTwoStretchInfo)) {
  723. const { framebuffer: t11, vao: e16, sourceTexture: r12 } = this._powerOfTwoStretchInfo;
  724. e16.dispose(true), r12.dispose(), t11.dispose(), this._glTexture = null, this._powerOfTwoStretchInfo = null;
  725. }
  726. if (r(this._glTexture) && (this._glTexture.dispose(), this._glTexture = null), r(this._loadingController)) {
  727. const t11 = this._loadingController;
  728. this._loadingController = null, this._loadingPromise = null, t11.abort();
  729. }
  730. this.events.emit("unloaded");
  731. }
  732. };
  733. var j2;
  734. L5.DDS_ENCODING = "image/vnd-ms.dds", L5.KTX2_ENCODING = "image/ktx2", L5.BASIS_ENCODING = "image/x.basis", function(t11) {
  735. t11[t11.HAVE_NOTHING = 0] = "HAVE_NOTHING", t11[t11.HAVE_METADATA = 1] = "HAVE_METADATA", t11[t11.HAVE_CURRENT_DATA = 2] = "HAVE_CURRENT_DATA", t11[t11.HAVE_FUTURE_DATA = 3] = "HAVE_FUTURE_DATA", t11[t11.HAVE_ENOUGH_DATA = 4] = "HAVE_ENOUGH_DATA";
  736. }(j2 || (j2 = {}));
  737. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderPass.js
  738. var A5;
  739. !function(A7) {
  740. A7[A7.MATERIAL = 0] = "MATERIAL", A7[A7.MATERIAL_ALPHA = 1] = "MATERIAL_ALPHA", A7[A7.MATERIAL_DEPTH = 2] = "MATERIAL_DEPTH", A7[A7.MATERIAL_NORMAL = 3] = "MATERIAL_NORMAL", A7[A7.MATERIAL_DEPTH_SHADOWMAP_ALL = 4] = "MATERIAL_DEPTH_SHADOWMAP_ALL", A7[A7.MATERIAL_HIGHLIGHT = 5] = "MATERIAL_HIGHLIGHT", A7[A7.MATERIAL_DEPTH_SHADOWMAP_DEFAULT = 6] = "MATERIAL_DEPTH_SHADOWMAP_DEFAULT", A7[A7.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT = 7] = "MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT";
  741. }(A5 || (A5 = {}));
  742. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/RenderSlot.js
  743. var E7;
  744. !function(E9) {
  745. E9[E9.INTEGRATED_MESH = 0] = "INTEGRATED_MESH", E9[E9.OPAQUE_TERRAIN = 1] = "OPAQUE_TERRAIN", E9[E9.OPAQUE_MATERIAL = 2] = "OPAQUE_MATERIAL", E9[E9.TRANSPARENT_MATERIAL = 3] = "TRANSPARENT_MATERIAL", E9[E9.TRANSPARENT_TERRAIN = 4] = "TRANSPARENT_TERRAIN", E9[E9.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL = 5] = "TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL", E9[E9.OCCLUDED_TERRAIN = 6] = "OCCLUDED_TERRAIN", E9[E9.OCCLUDER_MATERIAL = 7] = "OCCLUDER_MATERIAL", E9[E9.TRANSPARENT_OCCLUDER_MATERIAL = 8] = "TRANSPARENT_OCCLUDER_MATERIAL", E9[E9.OCCLUSION_PIXELS = 9] = "OCCLUSION_PIXELS", E9[E9.POSTPROCESSING_ENVIRONMENT_OPAQUE = 10] = "POSTPROCESSING_ENVIRONMENT_OPAQUE", E9[E9.POSTPROCESSING_ENVIRONMENT_TRANSPARENT = 11] = "POSTPROCESSING_ENVIRONMENT_TRANSPARENT", E9[E9.LASERLINES = 12] = "LASERLINES", E9[E9.LASERLINES_CONTRAST_CONTROL = 13] = "LASERLINES_CONTRAST_CONTROL", E9[E9.HUD_MATERIAL = 14] = "HUD_MATERIAL", E9[E9.LABEL_MATERIAL = 15] = "LABEL_MATERIAL", E9[E9.LINE_CALLOUTS = 16] = "LINE_CALLOUTS", E9[E9.LINE_CALLOUTS_HUD_DEPTH = 17] = "LINE_CALLOUTS_HUD_DEPTH", E9[E9.DRAPED_MATERIAL = 18] = "DRAPED_MATERIAL", E9[E9.DRAPED_WATER = 19] = "DRAPED_WATER", E9[E9.VOXEL = 20] = "VOXEL", E9[E9.MAX_SLOTS = 21] = "MAX_SLOTS";
  746. }(E7 || (E7 = {}));
  747. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/verticalOffsetUtils.js
  748. var v2 = class {
  749. constructor(t11 = 0) {
  750. this.offset = t11, this.tmpVertex = n3();
  751. }
  752. applyToVertex(t11, s8, e16) {
  753. const i12 = t11 + this.localOrigin[0], r12 = s8 + this.localOrigin[1], a12 = e16 + this.localOrigin[2], o12 = this.offset / Math.sqrt(i12 * i12 + r12 * r12 + a12 * a12);
  754. return this.tmpVertex[0] = t11 + i12 * o12, this.tmpVertex[1] = s8 + r12 * o12, this.tmpVertex[2] = e16 + a12 * o12, this.tmpVertex;
  755. }
  756. applyToAabb(t11) {
  757. for (let r12 = 0; r12 < 3; ++r12)
  758. O6[r12] = t11[0 + r12] + this.localOrigin[r12], z2[r12] = t11[3 + r12] + this.localOrigin[r12], T4[r12] = O6[r12];
  759. const s8 = this.applyToVertex(O6[0], O6[1], O6[2]);
  760. for (let r12 = 0; r12 < 3; ++r12)
  761. t11[r12] = s8[r12], t11[r12 + 3] = s8[r12];
  762. const e16 = (s9) => {
  763. const e17 = this.applyToVertex(s9[0], s9[1], s9[2]);
  764. for (let i13 = 0; i13 < 3; ++i13)
  765. t11[i13 + 0] = Math.min(t11[i13 + 0], e17[i13]), t11[i13 + 3] = Math.max(t11[i13 + 3], e17[i13]);
  766. };
  767. for (let r12 = 1; r12 < 8; ++r12) {
  768. for (let t12 = 0; t12 < 3; ++t12)
  769. T4[t12] = (r12 & 1 << t12) == 0 ? O6[t12] : z2[t12];
  770. e16(T4);
  771. }
  772. let i12 = 0;
  773. for (let r12 = 0; r12 < 3; ++r12) {
  774. O6[r12] * z2[r12] < 0 && (i12 |= 1 << r12);
  775. }
  776. if (i12 !== 0 && i12 !== 7) {
  777. for (let r12 = 0; r12 < 8; ++r12)
  778. if ((i12 & r12) == 0) {
  779. for (let t12 = 0; t12 < 3; ++t12)
  780. i12[t12] ? T4[t12] = 0 : T4[t12] = (r12 & 1 << t12) != 0 ? O6[t12] : z2[t12];
  781. e16(T4);
  782. }
  783. }
  784. for (let r12 = 0; r12 < 3; ++r12)
  785. t11[r12 + 0] -= this.localOrigin[r12], t11[r12 + 3] -= this.localOrigin[r12];
  786. return t11;
  787. }
  788. };
  789. var O6 = n3();
  790. var z2 = n3();
  791. var T4 = n3();
  792. var g5 = class {
  793. constructor(t11 = 0) {
  794. this.componentLocalOriginLength = 0, this._tmpVertex = n3(), this._mbs = _3(), this._obb = { center: n3(), halfSize: n11(), quaternion: null }, this._totalOffset = 0, this._offset = 0, this._resetOffset(t11);
  795. }
  796. _resetOffset(t11) {
  797. this._offset = t11, this._totalOffset = t11;
  798. }
  799. set offset(t11) {
  800. this._resetOffset(t11);
  801. }
  802. get offset() {
  803. return this._offset;
  804. }
  805. set componentOffset(t11) {
  806. this._totalOffset = this._offset + t11;
  807. }
  808. set localOrigin(t11) {
  809. this.componentLocalOriginLength = Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]);
  810. }
  811. applyToVertex(t11, s8, e16) {
  812. const i12 = t11, r12 = s8, a12 = e16 + this.componentLocalOriginLength, o12 = this._totalOffset / Math.sqrt(i12 * i12 + r12 * r12 + a12 * a12);
  813. return this._tmpVertex[0] = t11 + i12 * o12, this._tmpVertex[1] = s8 + r12 * o12, this._tmpVertex[2] = e16 + a12 * o12, this._tmpVertex;
  814. }
  815. applyToAabb(t11) {
  816. const s8 = t11[0], e16 = t11[1], i12 = t11[2] + this.componentLocalOriginLength, r12 = t11[3], a12 = t11[4], o12 = t11[5] + this.componentLocalOriginLength, h10 = s8 * r12 < 0 ? 0 : Math.min(Math.abs(s8), Math.abs(r12)), n14 = e16 * a12 < 0 ? 0 : Math.min(Math.abs(e16), Math.abs(a12)), f7 = i12 * o12 < 0 ? 0 : Math.min(Math.abs(i12), Math.abs(o12)), l10 = Math.sqrt(h10 * h10 + n14 * n14 + f7 * f7);
  817. if (l10 < this._totalOffset)
  818. return t11[0] -= s8 < 0 ? this._totalOffset : 0, t11[1] -= e16 < 0 ? this._totalOffset : 0, t11[2] -= i12 < 0 ? this._totalOffset : 0, t11[3] += r12 > 0 ? this._totalOffset : 0, t11[4] += a12 > 0 ? this._totalOffset : 0, t11[5] += o12 > 0 ? this._totalOffset : 0, t11;
  819. const m6 = Math.max(Math.abs(s8), Math.abs(r12)), b3 = Math.max(Math.abs(e16), Math.abs(a12)), _8 = Math.max(Math.abs(i12), Math.abs(o12)), c12 = Math.sqrt(m6 * m6 + b3 * b3 + _8 * _8), p5 = this._totalOffset / c12, u11 = this._totalOffset / l10;
  820. return t11[0] += s8 * (s8 > 0 ? p5 : u11), t11[1] += e16 * (e16 > 0 ? p5 : u11), t11[2] += i12 * (i12 > 0 ? p5 : u11), t11[3] += r12 * (r12 < 0 ? p5 : u11), t11[4] += a12 * (a12 < 0 ? p5 : u11), t11[5] += o12 * (o12 < 0 ? p5 : u11), t11;
  821. }
  822. applyToMbs(t11) {
  823. const s8 = Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]), e16 = this._totalOffset / s8;
  824. return this._mbs[0] = t11[0] + t11[0] * e16, this._mbs[1] = t11[1] + t11[1] * e16, this._mbs[2] = t11[2] + t11[2] * e16, this._mbs[3] = t11[3] + t11[3] * this._totalOffset / s8, this._mbs;
  825. }
  826. applyToObb(t11) {
  827. const s8 = t11.center, e16 = this._totalOffset / Math.sqrt(s8[0] * s8[0] + s8[1] * s8[1] + s8[2] * s8[2]);
  828. this._obb.center[0] = s8[0] + s8[0] * e16, this._obb.center[1] = s8[1] + s8[1] * e16, this._obb.center[2] = s8[2] + s8[2] * e16, S(this._obb.halfSize, t11.halfSize, t11.quaternion), u(this._obb.halfSize, this._obb.halfSize, t11.center);
  829. const i12 = this._totalOffset / Math.sqrt(this._obb.halfSize[0] * this._obb.halfSize[0] + this._obb.halfSize[1] * this._obb.halfSize[1] + this._obb.halfSize[2] * this._obb.halfSize[2]);
  830. return this._obb.halfSize[0] += this._obb.halfSize[0] * i12, this._obb.halfSize[1] += this._obb.halfSize[1] * i12, this._obb.halfSize[2] += this._obb.halfSize[2] * i12, e5(this._obb.halfSize, this._obb.halfSize, t11.center), S2(I3, t11.quaternion), S(this._obb.halfSize, this._obb.halfSize, I3), this._obb.halfSize[0] *= this._obb.halfSize[0] < 0 ? -1 : 1, this._obb.halfSize[1] *= this._obb.halfSize[1] < 0 ? -1 : 1, this._obb.halfSize[2] *= this._obb.halfSize[2] < 0 ? -1 : 1, this._obb.quaternion = t11.quaternion, this._obb;
  831. }
  832. };
  833. var x3 = class {
  834. constructor(t11 = 0) {
  835. this.offset = t11, this.sphere = _3(), this.tmpVertex = n3();
  836. }
  837. applyToVertex(t11, s8, e16) {
  838. const i12 = this.objectTransform.transform;
  839. let r12 = i12[0] * t11 + i12[4] * s8 + i12[8] * e16 + i12[12], a12 = i12[1] * t11 + i12[5] * s8 + i12[9] * e16 + i12[13], o12 = i12[2] * t11 + i12[6] * s8 + i12[10] * e16 + i12[14];
  840. const h10 = this.offset / Math.sqrt(r12 * r12 + a12 * a12 + o12 * o12);
  841. r12 += r12 * h10, a12 += a12 * h10, o12 += o12 * h10;
  842. const n14 = this.objectTransform.inverse;
  843. return this.tmpVertex[0] = n14[0] * r12 + n14[4] * a12 + n14[8] * o12 + n14[12], this.tmpVertex[1] = n14[1] * r12 + n14[5] * a12 + n14[9] * o12 + n14[13], this.tmpVertex[2] = n14[2] * r12 + n14[6] * a12 + n14[10] * o12 + n14[14], this.tmpVertex;
  844. }
  845. applyToMinMax(t11, s8) {
  846. const e16 = this.offset / Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]);
  847. t11[0] += t11[0] * e16, t11[1] += t11[1] * e16, t11[2] += t11[2] * e16;
  848. const i12 = this.offset / Math.sqrt(s8[0] * s8[0] + s8[1] * s8[1] + s8[2] * s8[2]);
  849. s8[0] += s8[0] * i12, s8[1] += s8[1] * i12, s8[2] += s8[2] * i12;
  850. }
  851. applyToAabb(t11) {
  852. const s8 = this.offset / Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]);
  853. t11[0] += t11[0] * s8, t11[1] += t11[1] * s8, t11[2] += t11[2] * s8;
  854. const e16 = this.offset / Math.sqrt(t11[3] * t11[3] + t11[4] * t11[4] + t11[5] * t11[5]);
  855. return t11[3] += t11[3] * e16, t11[4] += t11[4] * e16, t11[5] += t11[5] * e16, t11;
  856. }
  857. applyToBoundingSphere(t11) {
  858. const s8 = Math.sqrt(t11[0] * t11[0] + t11[1] * t11[1] + t11[2] * t11[2]), e16 = this.offset / s8;
  859. return this.sphere[0] = t11[0] + t11[0] * e16, this.sphere[1] = t11[1] + t11[1] * e16, this.sphere[2] = t11[2] + t11[2] * e16, this.sphere[3] = t11[3] + t11[3] * this.offset / s8, this.sphere;
  860. }
  861. };
  862. var S4 = new x3();
  863. function y2(s8) {
  864. return r(s8) ? (S4.offset = s8, S4) : null;
  865. }
  866. var q2 = new g5();
  867. var d4 = new v2();
  868. var I3 = e8();
  869. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js
  870. function c9(t11, e16, f7, o12) {
  871. const r12 = f7.typedBuffer, s8 = f7.typedBufferStride, n14 = t11.length;
  872. o12 *= s8;
  873. for (let i12 = 0; i12 < n14; ++i12) {
  874. const f8 = 2 * t11[i12];
  875. r12[o12] = e16[f8], r12[o12 + 1] = e16[f8 + 1], o12 += s8;
  876. }
  877. }
  878. function l9(t11, e16, f7, o12, r12) {
  879. const s8 = f7.typedBuffer, n14 = f7.typedBufferStride, i12 = t11.length;
  880. if (o12 *= n14, r12 == null || r12 === 1)
  881. for (let c12 = 0; c12 < i12; ++c12) {
  882. const f8 = 3 * t11[c12];
  883. s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], o12 += n14;
  884. }
  885. else
  886. for (let c12 = 0; c12 < i12; ++c12) {
  887. const f8 = 3 * t11[c12];
  888. for (let t12 = 0; t12 < r12; ++t12)
  889. s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], o12 += n14;
  890. }
  891. }
  892. function d5(t11, e16, f7, o12, r12 = 1) {
  893. const s8 = f7.typedBuffer, n14 = f7.typedBufferStride, i12 = t11.length;
  894. if (o12 *= n14, r12 === 1)
  895. for (let c12 = 0; c12 < i12; ++c12) {
  896. const f8 = 4 * t11[c12];
  897. s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], s8[o12 + 3] = e16[f8 + 3], o12 += n14;
  898. }
  899. else
  900. for (let c12 = 0; c12 < i12; ++c12) {
  901. const f8 = 4 * t11[c12];
  902. for (let t12 = 0; t12 < r12; ++t12)
  903. s8[o12] = e16[f8], s8[o12 + 1] = e16[f8 + 1], s8[o12 + 2] = e16[f8 + 2], s8[o12 + 3] = e16[f8 + 3], o12 += n14;
  904. }
  905. }
  906. function p4(t11, e16, f7, o12, r12, s8 = 1) {
  907. if (!f7)
  908. return void l9(t11, e16, o12, r12, s8);
  909. const n14 = o12.typedBuffer, i12 = o12.typedBufferStride, c12 = t11.length, d6 = f7[0], u11 = f7[1], a12 = f7[2], p5 = f7[4], B4 = f7[5], y4 = f7[6], g7 = f7[8], h10 = f7[9], S5 = f7[10], b3 = f7[12], m6 = f7[13], z4 = f7[14];
  910. if (r12 *= i12, s8 === 1)
  911. for (let l10 = 0; l10 < c12; ++l10) {
  912. const f8 = 3 * t11[l10], o13 = e16[f8], s9 = e16[f8 + 1], c13 = e16[f8 + 2];
  913. n14[r12] = d6 * o13 + p5 * s9 + g7 * c13 + b3, n14[r12 + 1] = u11 * o13 + B4 * s9 + h10 * c13 + m6, n14[r12 + 2] = a12 * o13 + y4 * s9 + S5 * c13 + z4, r12 += i12;
  914. }
  915. else
  916. for (let l10 = 0; l10 < c12; ++l10) {
  917. const f8 = 3 * t11[l10], o13 = e16[f8], c13 = e16[f8 + 1], O7 = e16[f8 + 2], k3 = d6 * o13 + p5 * c13 + g7 * O7 + b3, F3 = u11 * o13 + B4 * c13 + h10 * O7 + m6, M3 = a12 * o13 + y4 * c13 + S5 * O7 + z4;
  918. for (let t12 = 0; t12 < s8; ++t12)
  919. n14[r12] = k3, n14[r12 + 1] = F3, n14[r12 + 2] = M3, r12 += i12;
  920. }
  921. }
  922. function B2(e16, f7, o12, r12, s8, n14 = 1) {
  923. if (!o12)
  924. return void l9(e16, f7, r12, s8, n14);
  925. const i12 = o12, c12 = r12.typedBuffer, d6 = r12.typedBufferStride, u11 = e16.length, a12 = i12[0], p5 = i12[1], B4 = i12[2], y4 = i12[4], g7 = i12[5], h10 = i12[6], S5 = i12[8], b3 = i12[9], m6 = i12[10], z4 = !G(i12), O7 = 1e-6, k3 = 1 - O7;
  926. if (s8 *= d6, n14 === 1)
  927. for (let t11 = 0; t11 < u11; ++t11) {
  928. const o13 = 3 * e16[t11], r13 = f7[o13], n15 = f7[o13 + 1], i13 = f7[o13 + 2];
  929. let l10 = a12 * r13 + y4 * n15 + S5 * i13, u12 = p5 * r13 + g7 * n15 + b3 * i13, F3 = B4 * r13 + h10 * n15 + m6 * i13;
  930. if (z4) {
  931. const t12 = l10 * l10 + u12 * u12 + F3 * F3;
  932. if (t12 < k3 && t12 > O7) {
  933. const e17 = 1 / Math.sqrt(t12);
  934. l10 *= e17, u12 *= e17, F3 *= e17;
  935. }
  936. }
  937. c12[s8 + 0] = l10, c12[s8 + 1] = u12, c12[s8 + 2] = F3, s8 += d6;
  938. }
  939. else
  940. for (let t11 = 0; t11 < u11; ++t11) {
  941. const o13 = 3 * e16[t11], r13 = f7[o13], i13 = f7[o13 + 1], l10 = f7[o13 + 2];
  942. let u12 = a12 * r13 + y4 * i13 + S5 * l10, F3 = p5 * r13 + g7 * i13 + b3 * l10, M3 = B4 * r13 + h10 * i13 + m6 * l10;
  943. if (z4) {
  944. const t12 = u12 * u12 + F3 * F3 + M3 * M3;
  945. if (t12 < k3 && t12 > O7) {
  946. const e17 = 1 / Math.sqrt(t12);
  947. u12 *= e17, F3 *= e17, M3 *= e17;
  948. }
  949. }
  950. for (let t12 = 0; t12 < n14; ++t12)
  951. c12[s8 + 0] = u12, c12[s8 + 1] = F3, c12[s8 + 2] = M3, s8 += d6;
  952. }
  953. }
  954. function y3(e16, f7, o12, r12, s8, n14 = 1) {
  955. if (!o12)
  956. return void d5(e16, f7, r12, s8, n14);
  957. const i12 = o12, c12 = r12.typedBuffer, l10 = r12.typedBufferStride, u11 = e16.length, a12 = i12[0], p5 = i12[1], B4 = i12[2], y4 = i12[4], g7 = i12[5], h10 = i12[6], S5 = i12[8], b3 = i12[9], m6 = i12[10], z4 = !G(i12), O7 = 1e-6, k3 = 1 - O7;
  958. if (s8 *= l10, n14 === 1)
  959. for (let t11 = 0; t11 < u11; ++t11) {
  960. const o13 = 4 * e16[t11], r13 = f7[o13], n15 = f7[o13 + 1], i13 = f7[o13 + 2], d6 = f7[o13 + 3];
  961. let u12 = a12 * r13 + y4 * n15 + S5 * i13, F3 = p5 * r13 + g7 * n15 + b3 * i13, M3 = B4 * r13 + h10 * n15 + m6 * i13;
  962. if (z4) {
  963. const t12 = u12 * u12 + F3 * F3 + M3 * M3;
  964. if (t12 < k3 && t12 > O7) {
  965. const e17 = 1 / Math.sqrt(t12);
  966. u12 *= e17, F3 *= e17, M3 *= e17;
  967. }
  968. }
  969. c12[s8 + 0] = u12, c12[s8 + 1] = F3, c12[s8 + 2] = M3, c12[s8 + 3] = d6, s8 += l10;
  970. }
  971. else
  972. for (let t11 = 0; t11 < u11; ++t11) {
  973. const o13 = 4 * e16[t11], r13 = f7[o13], i13 = f7[o13 + 1], d6 = f7[o13 + 2], u12 = f7[o13 + 3];
  974. let F3 = a12 * r13 + y4 * i13 + S5 * d6, M3 = p5 * r13 + g7 * i13 + b3 * d6, N3 = B4 * r13 + h10 * i13 + m6 * d6;
  975. if (z4) {
  976. const t12 = F3 * F3 + M3 * M3 + N3 * N3;
  977. if (t12 < k3 && t12 > O7) {
  978. const e17 = 1 / Math.sqrt(t12);
  979. F3 *= e17, M3 *= e17, N3 *= e17;
  980. }
  981. }
  982. for (let t12 = 0; t12 < n14; ++t12)
  983. c12[s8 + 0] = F3, c12[s8 + 1] = M3, c12[s8 + 2] = N3, c12[s8 + 3] = u12, s8 += l10;
  984. }
  985. }
  986. function g6(t11, e16, f7, o12, r12, s8 = 1) {
  987. const n14 = o12.typedBuffer, i12 = o12.typedBufferStride, c12 = t11.length;
  988. if (r12 *= i12, s8 === 1) {
  989. if (f7 === 4)
  990. for (let l10 = 0; l10 < c12; ++l10) {
  991. const f8 = 4 * t11[l10];
  992. n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = e16[f8 + 3], r12 += i12;
  993. }
  994. else if (f7 === 3)
  995. for (let l10 = 0; l10 < c12; ++l10) {
  996. const f8 = 3 * t11[l10];
  997. n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = 255, r12 += i12;
  998. }
  999. } else if (f7 === 4)
  1000. for (let l10 = 0; l10 < c12; ++l10) {
  1001. const f8 = 4 * t11[l10];
  1002. for (let t12 = 0; t12 < s8; ++t12)
  1003. n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = e16[f8 + 3], r12 += i12;
  1004. }
  1005. else if (f7 === 3)
  1006. for (let l10 = 0; l10 < c12; ++l10) {
  1007. const f8 = 3 * t11[l10];
  1008. for (let t12 = 0; t12 < s8; ++t12)
  1009. n14[r12] = e16[f8], n14[r12 + 1] = e16[f8 + 1], n14[r12 + 2] = e16[f8 + 2], n14[r12 + 3] = 255, r12 += i12;
  1010. }
  1011. }
  1012. function h8(t11, i12, l10, d6, u11, a12) {
  1013. for (const h10 of i12.fieldNames) {
  1014. const i13 = t11.vertexAttributes.get(h10), S5 = t11.indices.get(h10);
  1015. if (i13 && S5)
  1016. switch (h10) {
  1017. case O3.POSITION: {
  1018. e11(i13.size === 3);
  1019. const t12 = u11.getField(h10, i3);
  1020. t12 && p4(S5, i13.data, l10, t12, a12);
  1021. break;
  1022. }
  1023. case O3.NORMAL: {
  1024. e11(i13.size === 3);
  1025. const t12 = u11.getField(h10, i3);
  1026. t12 && B2(S5, i13.data, d6, t12, a12);
  1027. break;
  1028. }
  1029. case O3.UV0: {
  1030. e11(i13.size === 2);
  1031. const t12 = u11.getField(h10, u2);
  1032. t12 && c9(S5, i13.data, t12, a12);
  1033. break;
  1034. }
  1035. case O3.COLOR: {
  1036. e11(i13.size === 3 || i13.size === 4);
  1037. const t12 = u11.getField(h10, x);
  1038. t12 && g6(S5, i13.data, i13.size, t12, a12);
  1039. break;
  1040. }
  1041. case O3.SYMBOLCOLOR: {
  1042. e11(i13.size === 3 || i13.size === 4);
  1043. const t12 = u11.getField(h10, x);
  1044. t12 && g6(S5, i13.data, i13.size, t12, a12);
  1045. break;
  1046. }
  1047. case O3.TANGENT: {
  1048. e11(i13.size === 4);
  1049. const t12 = u11.getField(h10, c);
  1050. t12 && y3(S5, i13.data, d6, t12, a12);
  1051. break;
  1052. }
  1053. }
  1054. }
  1055. }
  1056. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule.js
  1057. var t8 = class {
  1058. constructor(t11, o12) {
  1059. this._module = t11, this._loadModule = o12;
  1060. }
  1061. get() {
  1062. return this._module;
  1063. }
  1064. async reload() {
  1065. return this._module = await this._loadModule(), this._module;
  1066. }
  1067. };
  1068. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js
  1069. var e13 = class {
  1070. constructor(i12, t11, e16) {
  1071. this.release = e16, t11 && (this.initializeConfiguration(i12, t11), this._configuration = t11.snapshot()), this._program = this.initializeProgram(i12), this._pipeline = this.initializePipeline(i12.rctx.capabilities);
  1072. }
  1073. destroy() {
  1074. this._program = s(this._program), this._pipeline = this._configuration = null;
  1075. }
  1076. reload(t11) {
  1077. s(this._program), this._program = this.initializeProgram(t11), this._pipeline = this.initializePipeline(t11.rctx.capabilities);
  1078. }
  1079. get program() {
  1080. return this._program;
  1081. }
  1082. get compiled() {
  1083. return this.program.isCompiled;
  1084. }
  1085. get key() {
  1086. return this._configuration.key;
  1087. }
  1088. get configuration() {
  1089. return this._configuration;
  1090. }
  1091. bindPass(i12, t11) {
  1092. this.program.bindPass(i12, t11);
  1093. }
  1094. bindDraw(i12, t11) {
  1095. this.program.bindDraw(i12, t11), this.program.rebindTextures();
  1096. }
  1097. bindPipelineState(i12, t11 = null, e16) {
  1098. i12.setPipelineState(this.getPipelineState(t11, e16));
  1099. }
  1100. ensureAttributeLocations(i12) {
  1101. this.program.assertCompatibleVertexAttributeLocations(i12);
  1102. }
  1103. get primitiveType() {
  1104. return E2.TRIANGLES;
  1105. }
  1106. getPipelineState(i12, t11) {
  1107. return this._pipeline;
  1108. }
  1109. initializeConfiguration(i12, t11) {
  1110. }
  1111. };
  1112. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/Program.js
  1113. var o10 = class {
  1114. constructor(t11, e16, o12) {
  1115. this._context = t11, this._locations = o12, this._textures = new Map(), this._freeTextureUnits = new n({ deallocator: null }), this._glProgram = t11.programCache.acquire(e16.generate("vertex"), e16.generate("fragment"), o12), this._glProgram.stop = () => {
  1116. throw new Error("Wrapped _glProgram used directly");
  1117. }, this.bindPass = e16.generateBind(a8.Pass, this), this.bindDraw = e16.generateBind(a8.Draw, this), this._fragmentUniforms = u4() ? e16.fragmentUniforms : null;
  1118. }
  1119. dispose() {
  1120. this._glProgram.dispose();
  1121. }
  1122. get glName() {
  1123. return this._glProgram.glName;
  1124. }
  1125. get isCompiled() {
  1126. return this._glProgram.isCompiled;
  1127. }
  1128. setUniform1b(t11, e16) {
  1129. this._glProgram.setUniform1i(t11, e16 ? 1 : 0);
  1130. }
  1131. setUniform1i(t11, e16) {
  1132. this._glProgram.setUniform1i(t11, e16);
  1133. }
  1134. setUniform1f(t11, e16) {
  1135. this._glProgram.setUniform1f(t11, e16);
  1136. }
  1137. setUniform2f(t11, e16, r12) {
  1138. this._glProgram.setUniform2f(t11, e16, r12);
  1139. }
  1140. setUniform2fv(t11, e16) {
  1141. this._glProgram.setUniform2fv(t11, e16);
  1142. }
  1143. setUniform3f(t11, e16, r12, i12) {
  1144. this._glProgram.setUniform3f(t11, e16, r12, i12);
  1145. }
  1146. setUniform3fv(t11, e16) {
  1147. this._glProgram.setUniform3fv(t11, e16);
  1148. }
  1149. setUniform4f(t11, e16, r12, i12, s8) {
  1150. this._glProgram.setUniform4f(t11, e16, r12, i12, s8);
  1151. }
  1152. setUniform4fv(t11, e16) {
  1153. this._glProgram.setUniform4fv(t11, e16);
  1154. }
  1155. setUniformMatrix3fv(t11, e16) {
  1156. this._glProgram.setUniformMatrix3fv(t11, e16);
  1157. }
  1158. setUniformMatrix4fv(t11, e16) {
  1159. this._glProgram.setUniformMatrix4fv(t11, e16);
  1160. }
  1161. setUniform1fv(t11, e16) {
  1162. this._glProgram.setUniform1fv(t11, e16);
  1163. }
  1164. setUniform1iv(t11, e16) {
  1165. this._glProgram.setUniform1iv(t11, e16);
  1166. }
  1167. setUniform2iv(t11, e16) {
  1168. this._glProgram.setUniform3iv(t11, e16);
  1169. }
  1170. setUniform3iv(t11, e16) {
  1171. this._glProgram.setUniform3iv(t11, e16);
  1172. }
  1173. setUniform4iv(t11, e16) {
  1174. this._glProgram.setUniform4iv(t11, e16);
  1175. }
  1176. assertCompatibleVertexAttributeLocations(t11) {
  1177. t11.locations !== this._locations && console.error("VertexAttributeLocations are incompatible");
  1178. }
  1179. stop() {
  1180. this._textures.clear(), this._freeTextureUnits.clear();
  1181. }
  1182. bindTexture(e16, r12) {
  1183. if (t(r12) || r12.glName == null) {
  1184. const t11 = this._textures.get(e16);
  1185. return t11 && (this._context.bindTexture(null, t11.unit), this._freeTextureUnit(t11), this._textures.delete(e16)), null;
  1186. }
  1187. let i12 = this._textures.get(e16);
  1188. return i12 == null ? (i12 = this._allocTextureUnit(r12), this._textures.set(e16, i12)) : i12.texture = r12, this._context.useProgram(this), this.setUniform1i(e16, i12.unit), this._context.bindTexture(r12, i12.unit), i12.unit;
  1189. }
  1190. rebindTextures() {
  1191. this._context.useProgram(this), this._textures.forEach((t11, e16) => {
  1192. this._context.bindTexture(t11.texture, t11.unit), this.setUniform1i(e16, t11.unit);
  1193. }), r(this._fragmentUniforms) && this._fragmentUniforms.forEach((t11) => {
  1194. t11.type !== "sampler2D" && t11.type !== "samplerCube" || this._textures.has(t11.name) || console.error(`Texture sampler ${t11.name} has no bound texture`);
  1195. });
  1196. }
  1197. _allocTextureUnit(t11) {
  1198. return { texture: t11, unit: this._freeTextureUnits.length === 0 ? this._textures.size : this._freeTextureUnits.pop() };
  1199. }
  1200. _freeTextureUnit(t11) {
  1201. this._freeTextureUnits.push(t11.unit);
  1202. }
  1203. };
  1204. // node_modules/@arcgis/core/views/3d/webgl-engine/lib/StencilUtils.js
  1205. var i10 = { func: I.LESS };
  1206. var s7 = { func: I.ALWAYS };
  1207. var e14 = { mask: 255 };
  1208. var f6 = { function: { func: I.ALWAYS, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.ZERO } };
  1209. var o11 = { function: { func: I.ALWAYS, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.REPLACE } };
  1210. var P3 = { function: { func: I.EQUAL, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.KEEP } };
  1211. var m5 = { function: { func: I.NOTEQUAL, ref: a7.OutlineVisualElementMask, mask: a7.OutlineVisualElementMask }, operation: { fail: O4.KEEP, zFail: O4.KEEP, zPass: O4.KEEP } };
  1212. // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js
  1213. var F2 = class extends f4 {
  1214. constructor() {
  1215. super(...arguments), this.isSchematic = false, this.usePBR = false, this.mrrFactors = r2(0, 1, 0.5), this.hasVertexColors = false, this.hasSymbolColors = false, this.doubleSided = false, this.doubleSidedType = "normal", this.cullFace = n9.Back, this.emissiveFactor = r2(0, 0, 0), this.instancedDoublePrecision = false, this.normals = "default", this.receiveSSAO = true, this.receiveShadows = true, this.castShadows = true, this.shadowMappingEnabled = false, this.ambient = r2(0.2, 0.2, 0.2), this.diffuse = r2(0.8, 0.8, 0.8), this.externalColor = r4(1, 1, 1, 1), this.colorMixMode = "multiply", this.opacity = 1, this.layerOpacity = 1, this.origin = n3(), this.hasSlicePlane = false, this.hasSliceHighlight = true, this.offsetTransparentBackfaces = false, this.vvSizeEnabled = false, this.vvSizeMinSize = [1, 1, 1], this.vvSizeMaxSize = [100, 100, 100], this.vvSizeOffset = [0, 0, 0], this.vvSizeFactor = [1, 1, 1], this.vvSizeValue = [1, 1, 1], this.vvColorEnabled = false, this.vvColorValues = [0, 0, 0, 0, 0, 0, 0, 0], this.vvColorColors = [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0], this.vvSymbolAnchor = [0, 0, 0], this.vvSymbolRotationMatrix = e6(), this.vvOpacityEnabled = false, this.vvOpacityValues = [], this.vvOpacityOpacities = [], this.transparent = false, this.writeDepth = true, this.customDepthTest = N.Less, this.textureAlphaMode = C2.Blend, this.textureAlphaCutoff = o8, this.textureAlphaPremultiplied = false, this.hasOccludees = false, this.renderOccluded = h4.Occlude;
  1216. }
  1217. };
  1218. var E8 = class extends e13 {
  1219. initializeConfiguration(e16, t11) {
  1220. t11.spherical = e16.viewingMode === l3.Global, t11.doublePrecisionRequiresObfuscation = r10(e16.rctx), t11.textureCoordinateType = t11.hasColorTexture || t11.hasMetalnessAndRoughnessTexture || t11.hasEmissionTexture || t11.hasOcclusionTexture || t11.hasNormalTexture ? o7.Default : o7.None;
  1221. }
  1222. initializeProgram(e16) {
  1223. return this._initializeProgram(e16, E8.shader);
  1224. }
  1225. _initializeProgram(e16, t11) {
  1226. const i12 = t11.get().build(this.configuration);
  1227. return new o10(e16.rctx, i12, E3);
  1228. }
  1229. _convertDepthTestFunction(e16) {
  1230. return e16 === N.Lequal ? I.LEQUAL : I.LESS;
  1231. }
  1232. _setPipeline(e16, t11) {
  1233. const i12 = this.configuration, s8 = e16 === O5.NONE, r12 = e16 === O5.FrontFace;
  1234. return W({ blending: i12.output !== o6.Color && i12.output !== o6.Alpha || !i12.transparent ? null : s8 ? c6 : E4(e16), culling: V4(i12) && h5(i12.cullFace), depthTest: { func: l5(e16, this._convertDepthTestFunction(i12.customDepthTest)) }, depthWrite: s8 || r12 ? i12.writeDepth && a9 : null, colorWrite: c5, stencilWrite: i12.hasOccludees ? e14 : null, stencilTest: i12.hasOccludees ? t11 ? o11 : f6 : null, polygonOffset: s8 || r12 ? null : i7(i12.enableOffset) });
  1235. }
  1236. initializePipeline() {
  1237. return this._occludeePipelineState = this._setPipeline(this.configuration.transparencyPassType, true), this._setPipeline(this.configuration.transparencyPassType, false);
  1238. }
  1239. getPipelineState(e16, t11) {
  1240. return t11 ? this._occludeePipelineState : super.getPipelineState(e16, t11);
  1241. }
  1242. };
  1243. function V4(e16) {
  1244. return e16.cullFace !== n9.None || !e16.hasSlicePlane && (!e16.transparent && !e16.doubleSidedMode);
  1245. }
  1246. E8.shader = new t8(W2, () => import("./DefaultMaterial.glsl-ORAFMP5K.js"));
  1247. // node_modules/@arcgis/core/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js
  1248. var t9 = class {
  1249. constructor() {
  1250. this._key = "", this._keyDirty = false, this._parameterBits = this._parameterBits ? this._parameterBits.map(() => 0) : [], this._parameterNames || (this._parameterNames = []);
  1251. }
  1252. get key() {
  1253. return this._keyDirty && (this._keyDirty = false, this._key = String.fromCharCode.apply(String, this._parameterBits)), this._key;
  1254. }
  1255. snapshot() {
  1256. const t11 = this._parameterNames, e16 = { key: this.key };
  1257. for (const r12 of t11)
  1258. e16[r12] = this[r12];
  1259. return e16;
  1260. }
  1261. };
  1262. function e15(t11 = {}) {
  1263. return (e16, r12) => {
  1264. if (e16._parameterNames = e16._parameterNames ?? [], e16._parameterNames.push(r12), t11.constValue != null)
  1265. Object.defineProperty(e16, r12, { get: () => t11.constValue });
  1266. else {
  1267. const s8 = e16._parameterNames.length - 1, a12 = t11.count || 2, i12 = Math.ceil(Math.log2(a12)), o12 = e16._parameterBits ?? [0];
  1268. let h10 = 0;
  1269. for (; o12[h10] + i12 > 16; )
  1270. h10++, h10 >= o12.length && o12.push(0);
  1271. e16._parameterBits = o12;
  1272. const n14 = o12[h10], m6 = (1 << i12) - 1 << n14;
  1273. o12[h10] += i12, Object.defineProperty(e16, r12, { get() {
  1274. return this[s8];
  1275. }, set(t12) {
  1276. if (this[s8] !== t12 && (this[s8] = t12, this._keyDirty = true, this._parameterBits[h10] = this._parameterBits[h10] & ~m6 | +t12 << n14 & m6, typeof t12 != "number" && typeof t12 != "boolean"))
  1277. throw "Configuration value for " + r12 + " must be boolean or number, got " + typeof t12;
  1278. } });
  1279. }
  1280. };
  1281. }
  1282. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js
  1283. var i11 = class extends t9 {
  1284. };
  1285. e([e15({ constValue: true })], i11.prototype, "hasSliceHighlight", void 0), e([e15({ constValue: false })], i11.prototype, "hasSliceInVertexProgram", void 0), e([e15({ constValue: false })], i11.prototype, "instancedDoublePrecision", void 0), e([e15({ constValue: false })], i11.prototype, "isGround", void 0), e([e15({ constValue: a8.Pass })], i11.prototype, "pbrTextureBindType", void 0);
  1286. // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js
  1287. var c11 = class extends i11 {
  1288. constructor() {
  1289. super(...arguments), this.output = o6.Color, this.alphaDiscardMode = C2.Opaque, this.doubleSidedMode = i6.None, this.pbrMode = l4.Disabled, this.cullFace = n9.None, this.transparencyPassType = O5.NONE, this.normalType = i5.Attribute, this.textureCoordinateType = o7.None, this.customDepthTest = N.Less, this.spherical = false, this.hasVertexColors = false, this.hasSymbolColors = false, this.hasVerticalOffset = false, this.hasSlicePlane = false, this.hasSliceHighlight = true, this.hasColorTexture = false, this.hasMetalnessAndRoughnessTexture = false, this.hasEmissionTexture = false, this.hasOcclusionTexture = false, this.hasNormalTexture = false, this.hasScreenSizePerspective = false, this.hasVertexTangents = false, this.hasOccludees = false, this.hasMultipassTerrain = false, this.hasModelTransformation = false, this.offsetBackfaces = false, this.vvSize = false, this.vvColor = false, this.receiveShadows = false, this.receiveAmbientOcclusion = false, this.textureAlphaPremultiplied = false, this.instanced = false, this.instancedColor = false, this.instancedDoublePrecision = false, this.doublePrecisionRequiresObfuscation = false, this.writeDepth = true, this.transparent = false, this.enableOffset = true, this.cullAboveGround = false, this.snowCover = false;
  1290. }
  1291. };
  1292. e([e15({ count: o6.COUNT })], c11.prototype, "output", void 0), e([e15({ count: C2.COUNT })], c11.prototype, "alphaDiscardMode", void 0), e([e15({ count: i6.COUNT })], c11.prototype, "doubleSidedMode", void 0), e([e15({ count: l4.COUNT })], c11.prototype, "pbrMode", void 0), e([e15({ count: n9.COUNT })], c11.prototype, "cullFace", void 0), e([e15({ count: O5.COUNT })], c11.prototype, "transparencyPassType", void 0), e([e15({ count: i5.COUNT })], c11.prototype, "normalType", void 0), e([e15({ count: o7.COUNT })], c11.prototype, "textureCoordinateType", void 0), e([e15({ count: N.COUNT })], c11.prototype, "customDepthTest", void 0), e([e15()], c11.prototype, "spherical", void 0), e([e15()], c11.prototype, "hasVertexColors", void 0), e([e15()], c11.prototype, "hasSymbolColors", void 0), e([e15()], c11.prototype, "hasVerticalOffset", void 0), e([e15()], c11.prototype, "hasSlicePlane", void 0), e([e15()], c11.prototype, "hasSliceHighlight", void 0), e([e15()], c11.prototype, "hasColorTexture", void 0), e([e15()], c11.prototype, "hasMetalnessAndRoughnessTexture", void 0), e([e15()], c11.prototype, "hasEmissionTexture", void 0), e([e15()], c11.prototype, "hasOcclusionTexture", void 0), e([e15()], c11.prototype, "hasNormalTexture", void 0), e([e15()], c11.prototype, "hasScreenSizePerspective", void 0), e([e15()], c11.prototype, "hasVertexTangents", void 0), e([e15()], c11.prototype, "hasOccludees", void 0), e([e15()], c11.prototype, "hasMultipassTerrain", void 0), e([e15()], c11.prototype, "hasModelTransformation", void 0), e([e15()], c11.prototype, "offsetBackfaces", void 0), e([e15()], c11.prototype, "vvSize", void 0), e([e15()], c11.prototype, "vvColor", void 0), e([e15()], c11.prototype, "receiveShadows", void 0), e([e15()], c11.prototype, "receiveAmbientOcclusion", void 0), e([e15()], c11.prototype, "textureAlphaPremultiplied", void 0), e([e15()], c11.prototype, "instanced", void 0), e([e15()], c11.prototype, "instancedColor", void 0), e([e15()], c11.prototype, "instancedDoublePrecision", void 0), e([e15()], c11.prototype, "doublePrecisionRequiresObfuscation", void 0), e([e15()], c11.prototype, "writeDepth", void 0), e([e15()], c11.prototype, "transparent", void 0), e([e15()], c11.prototype, "enableOffset", void 0), e([e15()], c11.prototype, "cullAboveGround", void 0), e([e15()], c11.prototype, "snowCover", void 0), e([e15({ constValue: true })], c11.prototype, "hasVvInstancing", void 0), e([e15({ constValue: false })], c11.prototype, "useCustomDTRExponentForWater", void 0), e([e15({ constValue: false })], c11.prototype, "supportsTextureAtlas", void 0), e([e15({ constValue: true })], c11.prototype, "useFillLights", void 0);
  1293. // node_modules/@arcgis/core/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js
  1294. var t10 = class extends E8 {
  1295. initializeConfiguration(i12, s8) {
  1296. super.initializeConfiguration(i12, s8), s8.hasMetalnessAndRoughnessTexture = false, s8.hasEmissionTexture = false, s8.hasOcclusionTexture = false, s8.hasNormalTexture = false, s8.hasModelTransformation = false, s8.normalType = i5.Attribute, s8.doubleSidedMode = i6.WindingOrder, s8.hasVertexTangents = false;
  1297. }
  1298. initializeProgram(e16) {
  1299. return this._initializeProgram(e16, t10.shader);
  1300. }
  1301. };
  1302. t10.shader = new t8(V3, () => import("./RealisticTree.glsl-Z3HAPVGH.js"));
  1303. // node_modules/@arcgis/core/views/3d/webgl-engine/materials/DefaultMaterial.js
  1304. var R = class extends d {
  1305. constructor(e16) {
  1306. super(e16, _7), this.supportsEdges = true, this.techniqueConfig = new c11(), this.vertexBufferLayout = j3(this.parameters), this.instanceBufferLayout = e16.instanced ? B3(this.parameters) : null;
  1307. }
  1308. isVisibleInPass(e16) {
  1309. return e16 !== A5.MATERIAL_DEPTH_SHADOWMAP_ALL && e16 !== A5.MATERIAL_DEPTH_SHADOWMAP_DEFAULT && e16 !== A5.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT || this.parameters.castShadows;
  1310. }
  1311. isVisible() {
  1312. const t11 = this.parameters;
  1313. if (!super.isVisible() || t11.layerOpacity === 0)
  1314. return false;
  1315. const { instanced: r12, hasVertexColors: s8, hasSymbolColors: i12, vvColorEnabled: a12 } = t11, n14 = r(r12) && r12.includes("color"), o12 = t11.colorMixMode === "replace", h10 = t11.opacity > 0, c12 = t11.externalColor && t11.externalColor[3] > 0;
  1316. return s8 && (n14 || a12 || i12) ? !!o12 || h10 : s8 ? o12 ? c12 : h10 : n14 || a12 || i12 ? !!o12 || h10 : o12 ? c12 : h10;
  1317. }
  1318. getConfiguration(t11, r12) {
  1319. return this.techniqueConfig.output = t11, this.techniqueConfig.hasNormalTexture = !!this.parameters.normalTextureId, this.techniqueConfig.hasColorTexture = !!this.parameters.textureId, this.techniqueConfig.hasVertexTangents = this.parameters.hasVertexTangents, this.techniqueConfig.instanced = !!this.parameters.instanced, this.techniqueConfig.instancedDoublePrecision = this.parameters.instancedDoublePrecision, this.techniqueConfig.vvSize = this.parameters.vvSizeEnabled, this.techniqueConfig.hasVerticalOffset = r(this.parameters.verticalOffset), this.techniqueConfig.hasScreenSizePerspective = r(this.parameters.screenSizePerspective), this.techniqueConfig.hasSlicePlane = this.parameters.hasSlicePlane, this.techniqueConfig.hasSliceHighlight = this.parameters.hasSliceHighlight, this.techniqueConfig.alphaDiscardMode = this.parameters.textureAlphaMode, this.techniqueConfig.normalType = this.parameters.normals === "screenDerivative" ? i5.ScreenDerivative : i5.Attribute, this.techniqueConfig.transparent = this.parameters.transparent, this.techniqueConfig.writeDepth = this.parameters.writeDepth, r(this.parameters.customDepthTest) && (this.techniqueConfig.customDepthTest = this.parameters.customDepthTest), this.techniqueConfig.hasOccludees = this.parameters.hasOccludees, this.techniqueConfig.cullFace = this.parameters.hasSlicePlane ? n9.None : this.parameters.cullFace, this.techniqueConfig.hasMultipassTerrain = r12.multipassTerrain.enabled, this.techniqueConfig.cullAboveGround = r12.multipassTerrain.cullAboveGround, this.techniqueConfig.hasModelTransformation = r(this.parameters.modelTransformation), t11 !== o6.Color && t11 !== o6.Alpha || (this.techniqueConfig.hasVertexColors = this.parameters.hasVertexColors, this.techniqueConfig.hasSymbolColors = this.parameters.hasSymbolColors, this.parameters.treeRendering ? this.techniqueConfig.doubleSidedMode = i6.WindingOrder : this.techniqueConfig.doubleSidedMode = this.parameters.doubleSided && this.parameters.doubleSidedType === "normal" ? i6.View : this.parameters.doubleSided && this.parameters.doubleSidedType === "winding-order" ? i6.WindingOrder : i6.None, this.techniqueConfig.instancedColor = r(this.parameters.instanced) && this.parameters.instanced.includes("color"), this.techniqueConfig.receiveShadows = this.parameters.receiveShadows && this.parameters.shadowMappingEnabled, this.techniqueConfig.receiveAmbientOcclusion = !!r12.ssaoHelper.ready && this.parameters.receiveSSAO, this.techniqueConfig.vvColor = this.parameters.vvColorEnabled, this.techniqueConfig.textureAlphaPremultiplied = !!this.parameters.textureAlphaPremultiplied, this.techniqueConfig.pbrMode = this.parameters.usePBR ? this.parameters.isSchematic ? l4.Schematic : l4.Normal : l4.Disabled, this.techniqueConfig.hasMetalnessAndRoughnessTexture = !!this.parameters.metallicRoughnessTextureId, this.techniqueConfig.hasEmissionTexture = !!this.parameters.emissiveTextureId, this.techniqueConfig.hasOcclusionTexture = !!this.parameters.occlusionTextureId, this.techniqueConfig.offsetBackfaces = !(!this.parameters.transparent || !this.parameters.offsetTransparentBackfaces), this.techniqueConfig.transparencyPassType = r12.transparencyPassType, this.techniqueConfig.enableOffset = r12.camera.relativeElevation < _2, this.techniqueConfig.snowCover = this.hasSnowCover(r12)), this.techniqueConfig;
  1320. }
  1321. hasSnowCover(t11) {
  1322. return r(t11.weather) && t11.weatherVisible && t11.weather.type === "snowy" && t11.weather.snowCover === "enabled";
  1323. }
  1324. intersect(c12, u11, p5, m6, f7, d6, g7) {
  1325. if (r(this.parameters.verticalOffset)) {
  1326. const e16 = m6.camera;
  1327. o2(z3, p5[12], p5[13], p5[14]);
  1328. let c13 = null;
  1329. switch (m6.viewingMode) {
  1330. case l3.Global:
  1331. c13 = z(U2, z3);
  1332. break;
  1333. case l3.Local:
  1334. c13 = r3(U2, G3);
  1335. }
  1336. let u12 = 0;
  1337. const g8 = e5(k, z3, e16.eye), T6 = s4(g8), C4 = q(g8, g8, 1 / T6);
  1338. let v4 = null;
  1339. this.parameters.screenSizePerspective && (v4 = P(c13, C4)), u12 += L4(e16, T6, this.parameters.verticalOffset, v4, this.parameters.screenSizePerspective), q(c13, c13, u12), O(W3, c13, m6.transform.inverseRotation), f7 = e5(V5, f7, W3), d6 = e5(H, d6, W3);
  1340. }
  1341. x2(c12, u11, m6, f7, d6, y2(m6.verticalOffset), g7);
  1342. }
  1343. requiresSlot(e16) {
  1344. return e16 === (this.parameters.transparent ? this.parameters.writeDepth ? E7.TRANSPARENT_MATERIAL : E7.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL : E7.OPAQUE_MATERIAL) || e16 === E7.DRAPED_MATERIAL;
  1345. }
  1346. createGLMaterial(e16) {
  1347. return e16.output === o6.Color || e16.output === o6.Alpha || e16.output === o6.Depth || e16.output === o6.Normal || e16.output === o6.Shadow || e16.output === o6.Highlight ? new w4(e16) : null;
  1348. }
  1349. createBufferWriter() {
  1350. return new N2(this.vertexBufferLayout, this.instanceBufferLayout);
  1351. }
  1352. };
  1353. var w4 = class extends h3 {
  1354. constructor(e16) {
  1355. super({ ...e16, ...e16.material.parameters });
  1356. }
  1357. _updateParameters(e16) {
  1358. const r12 = this._material.parameters;
  1359. this.updateTexture(r12.textureId);
  1360. const s8 = e16.camera.viewInverseTransposeMatrix;
  1361. return o2(r12.origin, s8[3], s8[7], s8[11]), this._material.setParameters(this.textureBindParameters), this.ensureTechnique(r12.treeRendering ? t10 : E8, e16);
  1362. }
  1363. _updateShadowState(e16) {
  1364. e16.shadowMap.enabled !== this._material.parameters.shadowMappingEnabled && this._material.setParameters({ shadowMappingEnabled: e16.shadowMap.enabled });
  1365. }
  1366. _updateOccludeeState(e16) {
  1367. e16.hasOccludees !== this._material.parameters.hasOccludees && this._material.setParameters({ hasOccludees: e16.hasOccludees });
  1368. }
  1369. beginSlot(e16) {
  1370. return this._output !== o6.Color && this._output !== o6.Alpha || (this._updateShadowState(e16), this._updateOccludeeState(e16)), this._updateParameters(e16);
  1371. }
  1372. };
  1373. var D4 = class extends F2 {
  1374. constructor() {
  1375. super(...arguments), this.initTextureTransparent = false, this.treeRendering = false, this.hasVertexTangents = false;
  1376. }
  1377. };
  1378. var _7 = new D4();
  1379. var N2 = class {
  1380. constructor(e16, t11) {
  1381. this.vertexBufferLayout = e16, this.instanceBufferLayout = t11;
  1382. }
  1383. allocate(e16) {
  1384. return this.vertexBufferLayout.createBuffer(e16);
  1385. }
  1386. elementCount(e16) {
  1387. return e16.indices.get(O3.POSITION).length;
  1388. }
  1389. write(e16, t11, r12, s8) {
  1390. h8(t11, this.vertexBufferLayout, e16.transformation, e16.invTranspTransformation, r12, s8);
  1391. }
  1392. };
  1393. function j3(e16) {
  1394. const t11 = e16.textureId || e16.normalTextureId || e16.metallicRoughnessTextureId || e16.emissiveTextureId || e16.occlusionTextureId, r12 = T().vec3f(O3.POSITION).vec3f(O3.NORMAL);
  1395. return e16.hasVertexTangents && r12.vec4f(O3.TANGENT), t11 && r12.vec2f(O3.UV0), e16.hasVertexColors && r12.vec4u8(O3.COLOR), e16.hasSymbolColors && r12.vec4u8(O3.SYMBOLCOLOR), r12;
  1396. }
  1397. function B3(t11) {
  1398. let r12 = T();
  1399. return r12 = t11.instancedDoublePrecision ? r12.vec3f(O3.MODELORIGINHI).vec3f(O3.MODELORIGINLO).mat3f(O3.MODEL).mat3f(O3.MODELNORMAL) : r12.mat4f(O3.MODEL).mat4f(O3.MODELNORMAL), r(t11.instanced) && t11.instanced.includes("color") && (r12 = r12.vec4f(O3.INSTANCECOLOR)), r(t11.instanced) && t11.instanced.includes("featureAttribute") && (r12 = r12.vec4f(O3.INSTANCEFEATUREATTRIBUTE)), r12;
  1400. }
  1401. var V5 = n3();
  1402. var H = n3();
  1403. var G3 = r2(0, 0, 1);
  1404. var U2 = n3();
  1405. var W3 = n3();
  1406. var z3 = n3();
  1407. var k = n3();
  1408. // node_modules/@arcgis/core/views/3d/layers/graphics/wosrLoader.js
  1409. var b2 = s2.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");
  1410. async function w5(e16, t11) {
  1411. const r12 = await h9(e16, t11);
  1412. return { resource: r12, textures: await P4(r12.textureDefinitions, t11) };
  1413. }
  1414. async function h9(r12, n14) {
  1415. const i12 = r(n14) && n14.streamDataRequester;
  1416. if (i12)
  1417. return v3(r12, i12, n14);
  1418. const u11 = await a5(U(r12, e2(n14)));
  1419. if (u11.ok === true)
  1420. return u11.value.data;
  1421. w(u11.error), j4(u11.error);
  1422. }
  1423. async function v3(e16, r12, n14) {
  1424. const a12 = await a5(r12.request(e16, "json", n14));
  1425. if (a12.ok === true)
  1426. return a12.value;
  1427. w(a12.error), j4(a12.error.details.url);
  1428. }
  1429. function j4(e16) {
  1430. throw new s3("", `Request for object resource failed: ${e16}`);
  1431. }
  1432. function A6(e16) {
  1433. const t11 = e16.params, r12 = t11.topology;
  1434. let n14 = true;
  1435. switch (t11.vertexAttributes || (b2.warn("Geometry must specify vertex attributes"), n14 = false), t11.topology) {
  1436. case "PerAttributeArray":
  1437. break;
  1438. case "Indexed":
  1439. case null:
  1440. case void 0: {
  1441. const e17 = t11.faces;
  1442. if (e17) {
  1443. if (t11.vertexAttributes)
  1444. for (const r13 in t11.vertexAttributes) {
  1445. const t12 = e17[r13];
  1446. t12 && t12.values ? (t12.valueType != null && t12.valueType !== "UInt32" && (b2.warn(`Unsupported indexed geometry indices type '${t12.valueType}', only UInt32 is currently supported`), n14 = false), t12.valuesPerElement != null && t12.valuesPerElement !== 1 && (b2.warn(`Unsupported indexed geometry values per element '${t12.valuesPerElement}', only 1 is currently supported`), n14 = false)) : (b2.warn(`Indexed geometry does not specify face indices for '${r13}' attribute`), n14 = false);
  1447. }
  1448. } else
  1449. b2.warn("Indexed geometries must specify faces"), n14 = false;
  1450. break;
  1451. }
  1452. default:
  1453. b2.warn(`Unsupported topology '${r12}'`), n14 = false;
  1454. }
  1455. e16.params.material || (b2.warn("Geometry requires material"), n14 = false);
  1456. const a12 = e16.params.vertexAttributes;
  1457. for (const s8 in a12) {
  1458. a12[s8].values || (b2.warn("Geometries with externally defined attributes are not yet supported"), n14 = false);
  1459. }
  1460. return n14;
  1461. }
  1462. function M2(e16, t11) {
  1463. const r12 = [], n14 = [], s8 = [], o12 = [], l10 = e16.resource, c12 = r8.parse(l10.version || "1.0", "wosr");
  1464. k2.validate(c12);
  1465. const p5 = l10.model.name, f7 = l10.model.geometries, x4 = l10.materialDefinitions, b3 = e16.textures;
  1466. let w6 = 0;
  1467. const h10 = new Map();
  1468. for (let i12 = 0; i12 < f7.length; i12++) {
  1469. const e17 = f7[i12];
  1470. if (!A6(e17))
  1471. continue;
  1472. const l11 = T5(e17), c13 = e17.params.vertexAttributes, p6 = [];
  1473. for (const t12 in c13) {
  1474. const e18 = c13[t12], r13 = e18.values;
  1475. p6.push([t12, { data: r13, size: e18.valuesPerElement, exclusive: true }]);
  1476. }
  1477. const v4 = [];
  1478. if (e17.params.topology !== "PerAttributeArray") {
  1479. const t12 = e17.params.faces;
  1480. for (const e18 in t12)
  1481. v4.push([e18, new Uint32Array(t12[e18].values)]);
  1482. }
  1483. const j5 = b3 && b3[l11.texture];
  1484. if (j5 && !h10.has(l11.texture)) {
  1485. const { image: e18, params: t12 } = j5, r13 = new L5(e18, t12);
  1486. o12.push(r13), h10.set(l11.texture, r13);
  1487. }
  1488. const M3 = h10.get(l11.texture), U4 = M3 ? M3.id : void 0;
  1489. let P5 = s8[l11.material] ? s8[l11.material][l11.texture] : null;
  1490. if (!P5) {
  1491. const e18 = x4[l11.material.substring(l11.material.lastIndexOf("/") + 1)].params;
  1492. e18.transparency === 1 && (e18.transparency = 0);
  1493. const r13 = j5 && j5.alphaChannelUsage, n15 = e18.transparency > 0 || r13 === "transparency" || r13 === "maskAndTransparency", o13 = j5 ? I4(j5.alphaChannelUsage) : void 0, i13 = { ambient: e4(e18.diffuse), diffuse: e4(e18.diffuse), opacity: 1 - (e18.transparency || 0), transparent: n15, textureAlphaMode: o13, textureAlphaCutoff: 0.33, textureId: U4, initTextureTransparent: true, doubleSided: true, cullFace: n9.None, colorMixMode: e18.externalColorMixMode || "tint", textureAlphaPremultiplied: !!j5 && !!j5.params.preMultiplyAlpha };
  1494. r(t11) && t11.materialParamsMixin && Object.assign(i13, t11.materialParamsMixin), P5 = new R(i13), s8[l11.material] || (s8[l11.material] = {}), s8[l11.material][l11.texture] = P5;
  1495. }
  1496. n14.push(P5);
  1497. const k3 = new g2(p6, v4);
  1498. w6 += v4.position ? v4.position.length : 0, r12.push(k3);
  1499. }
  1500. return { name: p5, stageResources: { textures: o12, materials: n14, geometries: r12 }, pivotOffset: l10.model.pivotOffset, boundingBox: U3(r12), numberOfVertices: w6, lodThreshold: null };
  1501. }
  1502. function U3(e16) {
  1503. const t11 = B();
  1504. return e16.forEach((e17) => {
  1505. const r12 = e17.boundingInfo;
  1506. r(r12) && (h2(t11, r12.getBBMin()), h2(t11, r12.getBBMax()));
  1507. }), t11;
  1508. }
  1509. async function P4(e16, t11) {
  1510. const r12 = [];
  1511. for (const o12 in e16) {
  1512. const n15 = e16[o12], s9 = n15.images[0].data;
  1513. if (!s9) {
  1514. b2.warn("Externally referenced texture data is not yet supported");
  1515. continue;
  1516. }
  1517. const i12 = n15.encoding + ";base64," + s9, u11 = "/textureDefinitions/" + o12, l10 = n15.channels === "rgba" ? n15.alphaChannelUsage || "transparency" : "none", c12 = { noUnpackFlip: true, wrap: { s: D.REPEAT, t: D.REPEAT }, preMultiplyAlpha: I4(l10) !== C2.Opaque }, m6 = r(t11) && t11.disableTextures ? Promise.resolve(null) : t6(i12, t11);
  1518. r12.push(m6.then((e17) => ({ refId: u11, image: e17, params: c12, alphaChannelUsage: l10 })));
  1519. }
  1520. const n14 = await Promise.all(r12), s8 = {};
  1521. for (const a12 of n14)
  1522. s8[a12.refId] = a12;
  1523. return s8;
  1524. }
  1525. function I4(e16) {
  1526. switch (e16) {
  1527. case "mask":
  1528. return C2.Mask;
  1529. case "maskAndTransparency":
  1530. return C2.MaskBlend;
  1531. case "none":
  1532. return C2.Opaque;
  1533. default:
  1534. return C2.Blend;
  1535. }
  1536. }
  1537. function T5(e16) {
  1538. const t11 = e16.params;
  1539. return { id: 1, material: t11.material, texture: t11.texture, region: t11.texture };
  1540. }
  1541. var k2 = new r8(1, 2, "wosr");
  1542. // node_modules/@arcgis/core/views/3d/layers/graphics/objectResourceUtils.js
  1543. async function J(s8, o12) {
  1544. const i12 = X2(a6(s8));
  1545. if (i12.fileType === "wosr") {
  1546. const e16 = await (o12.cache ? o12.cache.loadWOSR(i12.url, o12) : w5(i12.url, o12)), t11 = M2(e16, o12);
  1547. return { lods: [t11], referenceBoundingBox: t11.boundingBox, isEsriSymbolResource: false, isWosr: true, remove: e16.remove };
  1548. }
  1549. const a12 = await (o12.cache ? o12.cache.loadGLTF(i12.url, o12, o12.usePBR) : c2(new n7(o12.streamDataRequester), i12.url, o12, o12.usePBR)), u11 = m(a12.model.meta, "ESRI_proxyEllipsoid");
  1550. a12.meta.isEsriSymbolResource && r(u11) && a12.meta.uri.includes("/RealisticTrees/") && te(a12, u11);
  1551. const n14 = a12.meta.isEsriSymbolResource ? { usePBR: o12.usePBR, isSchematic: false, treeRendering: !!a12.customMeta.esriTreeRendering, mrrFactors: [0, 1, 0.2] } : { usePBR: o12.usePBR, isSchematic: false, treeRendering: false, mrrFactors: [0, 1, 0.5] }, l10 = { ...o12.materialParamsMixin, treeRendering: !!a12.customMeta.esriTreeRendering };
  1552. if (i12.specifiedLodIndex != null) {
  1553. const e16 = Y2(a12, n14, l10, i12.specifiedLodIndex);
  1554. let t11 = e16[0].boundingBox;
  1555. if (i12.specifiedLodIndex !== 0) {
  1556. t11 = Y2(a12, n14, l10, 0)[0].boundingBox;
  1557. }
  1558. return { lods: e16, referenceBoundingBox: t11, isEsriSymbolResource: a12.meta.isEsriSymbolResource, isWosr: false, remove: a12.remove };
  1559. }
  1560. const c12 = Y2(a12, n14, l10);
  1561. return { lods: c12, referenceBoundingBox: c12[0].boundingBox, isEsriSymbolResource: a12.meta.isEsriSymbolResource, isWosr: false, remove: a12.remove };
  1562. }
  1563. function X2(e16) {
  1564. const t11 = e16.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);
  1565. if (t11)
  1566. return { fileType: "gltf", url: t11[1], specifiedLodIndex: t11[4] != null ? Number(t11[4]) : null };
  1567. return e16.match(/(.*\.(json|json\.gz))$/) ? { fileType: "wosr", url: e16, specifiedLodIndex: null } : { fileType: "unknown", url: e16, specifiedLodIndex: null };
  1568. }
  1569. function Y2(e16, t11, s8, a12) {
  1570. const u11 = e16.model, n14 = e6(), l10 = new Array(), c12 = new Map(), m6 = new Map();
  1571. return u11.lods.forEach((e17, i12) => {
  1572. if (a12 !== void 0 && i12 !== a12)
  1573. return;
  1574. const d6 = { name: e17.name, stageResources: { textures: new Array(), materials: new Array(), geometries: new Array() }, lodThreshold: r(e17.lodThreshold) ? e17.lodThreshold : null, pivotOffset: [0, 0, 0], numberOfVertices: 0, boundingBox: B() };
  1575. l10.push(d6), e17.parts.forEach((e18) => {
  1576. const i13 = e18.material + (e18.attributes.normal ? "_normal" : "") + (e18.attributes.color ? "_color" : "") + (e18.attributes.texCoord0 ? "_texCoord0" : "") + (e18.attributes.tangent ? "_tangent" : ""), a13 = u11.materials.get(e18.material), l11 = r(e18.attributes.texCoord0), f7 = r(e18.attributes.normal), p5 = Z(a13.alphaMode);
  1577. if (!c12.has(i13)) {
  1578. if (l11) {
  1579. if (r(a13.textureColor) && !m6.has(a13.textureColor)) {
  1580. const e19 = u11.textures.get(a13.textureColor), t12 = { ...e19.parameters, preMultiplyAlpha: p5 !== C2.Opaque };
  1581. m6.set(a13.textureColor, new L5(e19.data, t12));
  1582. }
  1583. if (r(a13.textureNormal) && !m6.has(a13.textureNormal)) {
  1584. const e19 = u11.textures.get(a13.textureNormal);
  1585. m6.set(a13.textureNormal, new L5(e19.data, e19.parameters));
  1586. }
  1587. if (r(a13.textureOcclusion) && !m6.has(a13.textureOcclusion)) {
  1588. const e19 = u11.textures.get(a13.textureOcclusion);
  1589. m6.set(a13.textureOcclusion, new L5(e19.data, e19.parameters));
  1590. }
  1591. if (r(a13.textureEmissive) && !m6.has(a13.textureEmissive)) {
  1592. const e19 = u11.textures.get(a13.textureEmissive);
  1593. m6.set(a13.textureEmissive, new L5(e19.data, e19.parameters));
  1594. }
  1595. if (r(a13.textureMetallicRoughness) && !m6.has(a13.textureMetallicRoughness)) {
  1596. const e19 = u11.textures.get(a13.textureMetallicRoughness);
  1597. m6.set(a13.textureMetallicRoughness, new L5(e19.data, e19.parameters));
  1598. }
  1599. }
  1600. const o12 = a13.color[0] ** (1 / o5), n15 = a13.color[1] ** (1 / o5), d7 = a13.color[2] ** (1 / o5), x5 = a13.emissiveFactor[0] ** (1 / o5), g7 = a13.emissiveFactor[1] ** (1 / o5), h10 = a13.emissiveFactor[2] ** (1 / o5), b3 = r(a13.textureColor) && l11 ? m6.get(a13.textureColor) : null;
  1601. c12.set(i13, new R({ ...t11, transparent: p5 === C2.Blend, customDepthTest: N.Lequal, textureAlphaMode: p5, textureAlphaCutoff: a13.alphaCutoff, diffuse: [o12, n15, d7], ambient: [o12, n15, d7], opacity: a13.opacity, doubleSided: a13.doubleSided, doubleSidedType: "winding-order", cullFace: a13.doubleSided ? n9.None : n9.Back, hasVertexColors: !!e18.attributes.color, hasVertexTangents: !!e18.attributes.tangent, normals: f7 ? "default" : "screenDerivative", castShadows: true, receiveSSAO: true, textureId: r(b3) ? b3.id : void 0, colorMixMode: a13.colorMixMode, normalTextureId: r(a13.textureNormal) && l11 ? m6.get(a13.textureNormal).id : void 0, textureAlphaPremultiplied: r(b3) && !!b3.params.preMultiplyAlpha, occlusionTextureId: r(a13.textureOcclusion) && l11 ? m6.get(a13.textureOcclusion).id : void 0, emissiveTextureId: r(a13.textureEmissive) && l11 ? m6.get(a13.textureEmissive).id : void 0, metallicRoughnessTextureId: r(a13.textureMetallicRoughness) && l11 ? m6.get(a13.textureMetallicRoughness).id : void 0, emissiveFactor: [x5, g7, h10], mrrFactors: [a13.metallicFactor, a13.roughnessFactor, t11.mrrFactors[2]], isSchematic: false, ...s8 }));
  1602. }
  1603. const x4 = ee(e18.indices || e18.attributes.position.count, e18.primitiveType), S5 = e18.attributes.position.count, A7 = r7(i3, S5);
  1604. t4(A7, e18.attributes.position, e18.transform);
  1605. const N3 = [[O3.POSITION, { data: A7.typedBuffer, size: A7.elementCount, exclusive: true }]], I5 = [[O3.POSITION, x4]];
  1606. if (r(e18.attributes.normal)) {
  1607. const t12 = r7(i3, S5);
  1608. j(n14, e18.transform), r5(t12, e18.attributes.normal, n14), N3.push([O3.NORMAL, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.NORMAL, x4]);
  1609. }
  1610. if (r(e18.attributes.tangent)) {
  1611. const t12 = r7(c, S5);
  1612. j(n14, e18.transform), r6(t12, e18.attributes.tangent, n14), N3.push([O3.TANGENT, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.TANGENT, x4]);
  1613. }
  1614. if (r(e18.attributes.texCoord0)) {
  1615. const t12 = r7(u2, S5);
  1616. n6(t12, e18.attributes.texCoord0), N3.push([O3.UV0, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.UV0, x4]);
  1617. }
  1618. if (r(e18.attributes.color)) {
  1619. const t12 = r7(x, S5);
  1620. if (e18.attributes.color.elementCount === 4)
  1621. e18.attributes.color instanceof c ? o3(t12, e18.attributes.color, 255) : e18.attributes.color instanceof x ? e10(t12, e18.attributes.color) : e18.attributes.color instanceof L2 && o3(t12, e18.attributes.color, 1 / 256);
  1622. else {
  1623. t5(t12, 255, 255, 255, 255);
  1624. const r12 = new O2(t12.buffer, 0, 4);
  1625. e18.attributes.color instanceof i3 ? f2(r12, e18.attributes.color, 255) : e18.attributes.color instanceof O2 ? e9(r12, e18.attributes.color) : e18.attributes.color instanceof E && f2(r12, e18.attributes.color, 1 / 256);
  1626. }
  1627. N3.push([O3.COLOR, { data: t12.typedBuffer, size: t12.elementCount, exclusive: true }]), I5.push([O3.COLOR, x4]);
  1628. }
  1629. const L6 = new g2(N3, I5);
  1630. d6.stageResources.geometries.push(L6), d6.stageResources.materials.push(c12.get(i13)), l11 && (r(a13.textureColor) && d6.stageResources.textures.push(m6.get(a13.textureColor)), r(a13.textureNormal) && d6.stageResources.textures.push(m6.get(a13.textureNormal)), r(a13.textureOcclusion) && d6.stageResources.textures.push(m6.get(a13.textureOcclusion)), r(a13.textureEmissive) && d6.stageResources.textures.push(m6.get(a13.textureEmissive)), r(a13.textureMetallicRoughness) && d6.stageResources.textures.push(m6.get(a13.textureMetallicRoughness))), d6.numberOfVertices += S5;
  1631. const F3 = L6.boundingInfo;
  1632. r(F3) && (h2(d6.boundingBox, F3.getBBMin()), h2(d6.boundingBox, F3.getBBMax()));
  1633. });
  1634. }), l10;
  1635. }
  1636. function Z(e16) {
  1637. switch (e16) {
  1638. case "BLEND":
  1639. return C2.Blend;
  1640. case "MASK":
  1641. return C2.Mask;
  1642. case "OPAQUE":
  1643. case null:
  1644. case void 0:
  1645. return C2.Opaque;
  1646. }
  1647. }
  1648. function ee(e16, t11) {
  1649. switch (t11) {
  1650. case E2.TRIANGLES:
  1651. return n8(e16);
  1652. case E2.TRIANGLE_STRIP:
  1653. return o4(e16);
  1654. case E2.TRIANGLE_FAN:
  1655. return i4(e16);
  1656. }
  1657. }
  1658. function te(e16, t11) {
  1659. for (let r12 = 0; r12 < e16.model.lods.length; ++r12) {
  1660. const o12 = e16.model.lods[r12];
  1661. e16.customMeta.esriTreeRendering = true;
  1662. for (const i12 of o12.parts) {
  1663. const o13 = i12.attributes.normal;
  1664. if (t(o13))
  1665. return;
  1666. const x4 = i12.attributes.position, g7 = x4.count, b3 = n3(), R2 = n3(), B4 = n3(), M3 = r7(x, g7), T6 = r7(i3, g7), w6 = h(e7(), i12.transform);
  1667. for (let s8 = 0; s8 < g7; s8++) {
  1668. x4.getVec(s8, R2), o13.getVec(s8, b3), L(R2, R2, i12.transform), e5(B4, R2, t11.center), i(B4, B4, t11.radius);
  1669. const a12 = B4[2], u11 = s4(B4), p5 = Math.min(0.45 + 0.55 * u11 * u11, 1);
  1670. i(B4, B4, t11.radius), L(B4, B4, w6), z(B4, B4), r12 + 1 !== e16.model.lods.length && e16.model.lods.length > 1 && A(B4, B4, b3, a12 > -1 ? 0.2 : Math.min(-4 * a12 - 3.8, 1)), T6.setVec(s8, B4), M3.set(s8, 0, 255 * p5), M3.set(s8, 1, 255 * p5), M3.set(s8, 2, 255 * p5), M3.set(s8, 3, 255);
  1671. }
  1672. i12.attributes.normal = T6, i12.attributes.color = M3;
  1673. }
  1674. }
  1675. }
  1676. export {
  1677. J as fetch,
  1678. Y2 as gltfToEngineResources,
  1679. X2 as parseUrl
  1680. };
  1681. //# sourceMappingURL=objectResourceUtils-OTLKPTOD.js.map