chunk-IDINBHDV.js 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630
  1. import {
  2. i as i7,
  3. n as n6
  4. } from "./chunk-6LE4RPMZ.js";
  5. import {
  6. a as a3,
  7. f as f6,
  8. g,
  9. i as i6,
  10. j as j3,
  11. me,
  12. n
  13. } from "./chunk-67RFR4NT.js";
  14. import {
  15. c as c2,
  16. i as i4,
  17. n as n5,
  18. r as r4
  19. } from "./chunk-JXYBFGFY.js";
  20. import {
  21. M
  22. } from "./chunk-EPMXCACW.js";
  23. import {
  24. s as s6
  25. } from "./chunk-R24MO4IV.js";
  26. import {
  27. f as f2,
  28. p as p2
  29. } from "./chunk-XBFCIW4K.js";
  30. import {
  31. G,
  32. ee,
  33. f as f3,
  34. s as s4,
  35. te
  36. } from "./chunk-T2SKWJGU.js";
  37. import {
  38. w,
  39. x
  40. } from "./chunk-UO3LS2M5.js";
  41. import {
  42. e as e4,
  43. i as i3,
  44. o as o4
  45. } from "./chunk-QISOH77W.js";
  46. import {
  47. l
  48. } from "./chunk-KUO7OCMN.js";
  49. import {
  50. X,
  51. at,
  52. ct,
  53. et,
  54. f,
  55. ft,
  56. gt,
  57. ht,
  58. i as i2,
  59. j as j2,
  60. k,
  61. lt,
  62. mt,
  63. nt as nt2,
  64. o as o3,
  65. pt,
  66. rt,
  67. st,
  68. vt
  69. } from "./chunk-XO5VJRK4.js";
  70. import {
  71. C,
  72. N,
  73. O,
  74. P,
  75. U,
  76. Z,
  77. b,
  78. f as f4,
  79. w as w2
  80. } from "./chunk-3WXSWAUV.js";
  81. import {
  82. a as a2,
  83. c,
  84. i as i5,
  85. n as n2,
  86. o as o5,
  87. r as r5,
  88. s as s5
  89. } from "./chunk-27YO3FKC.js";
  90. import {
  91. E,
  92. S
  93. } from "./chunk-EQNT4A7P.js";
  94. import {
  95. n as n3
  96. } from "./chunk-JEA4MMTV.js";
  97. import {
  98. e as e5,
  99. f as f5
  100. } from "./chunk-RG3AHHRL.js";
  101. import {
  102. t as t4
  103. } from "./chunk-XHRNCFJT.js";
  104. import {
  105. n as n4,
  106. t as t3
  107. } from "./chunk-UDYHZLTE.js";
  108. import {
  109. e as e3
  110. } from "./chunk-TFHLTN6F.js";
  111. import {
  112. r as r3,
  113. z
  114. } from "./chunk-E3G7BRZB.js";
  115. import {
  116. Gt,
  117. nt
  118. } from "./chunk-JKFWEHNK.js";
  119. import {
  120. t as t2
  121. } from "./chunk-3IRT3YKJ.js";
  122. import {
  123. e as e2
  124. } from "./chunk-CRHRHOXH.js";
  125. import {
  126. r as r2,
  127. s as s3,
  128. y
  129. } from "./chunk-ZSW35JPD.js";
  130. import {
  131. o as o6
  132. } from "./chunk-4T5ZGMEN.js";
  133. import {
  134. o as o2,
  135. u
  136. } from "./chunk-UVVU4UUO.js";
  137. import {
  138. a
  139. } from "./chunk-RYY6632W.js";
  140. import {
  141. D,
  142. j,
  143. p
  144. } from "./chunk-V6P2MAQQ.js";
  145. import {
  146. s2 as s,
  147. s3 as s2
  148. } from "./chunk-E5O6P5I2.js";
  149. import {
  150. e,
  151. i,
  152. o,
  153. r,
  154. t
  155. } from "./chunk-YXWMMD76.js";
  156. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/heuristics.js
  157. var i8 = /* @__PURE__ */ new Map();
  158. function t5(r13, t10, c9) {
  159. const { indicesPerRecord: s9, multiplier: o11, verticesPerRecord: d7 } = i8.get(r13);
  160. return { recordBytes: c9 * ct * Uint32Array.BYTES_PER_ELEMENT, indexBytes: o11 * s9 * c9 * Uint32Array.BYTES_PER_ELEMENT, vertexBytes: o11 * d7 * c9 * t10 };
  161. }
  162. i8.set(E.MARKER, { multiplier: 1, indicesPerRecord: 6, verticesPerRecord: 4 }), i8.set(E.LINE, { multiplier: 1, indicesPerRecord: 24, verticesPerRecord: 8 }), i8.set(E.FILL, { multiplier: 1, indicesPerRecord: 10, verticesPerRecord: 10 }), i8.set(E.TEXT, { multiplier: 8, indicesPerRecord: 6, verticesPerRecord: 4 }), i8.set(E.LABEL, { multiplier: 8, indicesPerRecord: 6, verticesPerRecord: 4 });
  163. // node_modules/@arcgis/core/views/2d/engine/webgl/util/Writer.js
  164. var t6 = 1.25;
  165. var e6 = class {
  166. constructor(t10, e11) {
  167. this._pos = 0;
  168. const r13 = e11 ? this._roundToNearest(e11, t10.BYTES_PER_ELEMENT) : 40;
  169. this._array = new ArrayBuffer(r13), this._buffer = new t10(this._array), this._ctor = t10, this._i16View = new Int16Array(this._array);
  170. }
  171. get length() {
  172. return this._pos;
  173. }
  174. _roundToNearest(t10, e11) {
  175. const r13 = Math.round(t10);
  176. return r13 + (e11 - r13 % e11);
  177. }
  178. _ensureSize(e11) {
  179. if (this._pos + e11 >= this._buffer.length) {
  180. const r13 = this._roundToNearest((this._array.byteLength + e11 * this._buffer.BYTES_PER_ELEMENT) * t6, this._buffer.BYTES_PER_ELEMENT), s9 = new ArrayBuffer(r13), i12 = new this._ctor(s9);
  181. i12.set(this._buffer, 0), this._array = s9, this._buffer = i12, this._i16View = new Int16Array(this._array);
  182. }
  183. }
  184. ensureSize(t10) {
  185. this._ensureSize(t10);
  186. }
  187. writeF32(t10) {
  188. this._ensureSize(1);
  189. const e11 = this._pos;
  190. return new Float32Array(this._array, 4 * this._pos, 1)[0] = t10, this._pos++, e11;
  191. }
  192. push(t10) {
  193. this._ensureSize(1);
  194. const e11 = this._pos;
  195. return this._buffer[this._pos++] = t10, e11;
  196. }
  197. writeFixed(t10) {
  198. this._buffer[this._pos++] = t10;
  199. }
  200. setValue(t10, e11) {
  201. this._buffer[t10] = e11;
  202. }
  203. i1616Add(t10, e11, r13) {
  204. this._i16View[2 * t10] += e11, this._i16View[2 * t10 + 1] += r13;
  205. }
  206. getValue(t10) {
  207. return this._buffer[t10];
  208. }
  209. incr(t10) {
  210. if (this._buffer.length < t10)
  211. throw new Error("Increment index overflows the target buffer");
  212. this._buffer[t10]++;
  213. }
  214. decr(t10) {
  215. this._buffer[t10]--;
  216. }
  217. writeRegion(t10) {
  218. this._ensureSize(t10.length);
  219. const e11 = this._pos;
  220. return this._buffer.set(t10, this._pos), this._pos += t10.length, e11;
  221. }
  222. writeManyFrom(t10, e11, r13) {
  223. this._ensureSize(r13 - e11);
  224. for (let s9 = e11; s9 !== r13; s9++)
  225. this.writeFixed(t10._buffer[s9]);
  226. }
  227. buffer() {
  228. const t10 = this._array.slice(0, 4 * this._pos);
  229. return this.destroy(), t10;
  230. }
  231. toArray() {
  232. const t10 = this._array, e11 = [];
  233. for (let r13 = 0; r13 < t10.byteLength / 4; r13++)
  234. e11.push(t10[r13]);
  235. return e11;
  236. }
  237. seek(t10) {
  238. this._pos = t10;
  239. }
  240. destroy() {
  241. this._array = null, this._buffer = null;
  242. }
  243. };
  244. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/VertexDataWriter.js
  245. var r6 = class {
  246. constructor(e11, r13, i12) {
  247. this._start = { index: 0, vertex: 0 };
  248. const h5 = t5(e11, r13, i12), c9 = r13 / 4;
  249. this.geometryType = e11, this._records = new e6(Int32Array, h5.recordBytes), this._indices = new e6(Uint32Array, h5.indexBytes), this._vertices = new e6(Uint32Array, h5.vertexBytes), this._metrics = new e6(Float32Array, 0), this._strideInt = c9;
  250. }
  251. serialize(e11) {
  252. const t10 = this._records.buffer(), s9 = this._indices.buffer(), r13 = this._vertices.buffer(), i12 = this._metrics.length ? this._metrics.buffer() : null, h5 = 4 * this._strideInt;
  253. return e11.push(t10, s9, r13), { stride: h5, records: t10, indices: s9, vertices: r13, metrics: i12 };
  254. }
  255. get strideInt() {
  256. return this._strideInt;
  257. }
  258. get recordCount() {
  259. return this._records.length / ct;
  260. }
  261. get vertexCount() {
  262. return this._vertices.length / this._strideInt;
  263. }
  264. get indexCount() {
  265. return this._indices.length;
  266. }
  267. get indexWriter() {
  268. return this._indices;
  269. }
  270. get vertexWriter() {
  271. return this._vertices;
  272. }
  273. get metricWriter() {
  274. return this._metrics;
  275. }
  276. vertexEnsureSize(e11) {
  277. this._vertices.ensureSize(e11);
  278. }
  279. indexEnsureSize(e11) {
  280. this._indices.ensureSize(e11);
  281. }
  282. recordStart() {
  283. this._start.index = this._indices.length, this._start.vertex = this._vertices.length;
  284. }
  285. recordEnd(e11, t10, s9, r13, i12, h5, c9, n10) {
  286. this._records.push(e11), this._records.push(t10), this._records.push(s9), this._records.push(r13), this._records.push(i12), this._records.push(h5), this._records.push(c9), this._records.writeF32(n10);
  287. }
  288. writeIndex(e11) {
  289. this._indices.push(e11);
  290. }
  291. writeVertex(e11) {
  292. this._vertices.push(e11);
  293. }
  294. writeVertexF32(e11) {
  295. this._vertices.writeF32(e11);
  296. }
  297. copyLastFrom(t10, s9, r13) {
  298. const i12 = t10._records.length - ct, h5 = t10._records.getValue(i12), c9 = t10._records.getValue(i12 + 1), n10 = t10._records.getValue(i12 + 2), _5 = t10._records.getValue(i12 + 4), d7 = t10._records.getValue(i12 + 6), o11 = t10._records.getValue(i12 + 7), u12 = this._vertices.length, l7 = (t10._start.vertex - this._vertices.length) / this._strideInt, g9 = this._indices.length, p9 = this.vertexCount;
  299. for (let e11 = t10._start.index; e11 !== t10._indices.length; e11++) {
  300. const s10 = t10._indices.getValue(e11);
  301. this._indices.push(s10 - l7);
  302. }
  303. for (let e11 = t10._start.vertex; e11 !== t10._vertices.length; e11++) {
  304. const s10 = t10._vertices.getValue(e11);
  305. this._vertices.push(s10);
  306. }
  307. for (let e11 = u12; e11 <= this._vertices.length; e11 += this._strideInt)
  308. this._vertices.i1616Add(e11, s9, r13);
  309. this._records.push(h5), this._records.push(c9), this._records.push(n10), this._records.push(g9), this._records.push(_5), this._records.push(p9), this._records.push(d7), this._records.push(o11);
  310. }
  311. };
  312. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/MeshData.js
  313. var u2 = 1;
  314. var c3 = 2;
  315. var o7 = 4;
  316. var _ = 8;
  317. var l2 = 16;
  318. var d = 32;
  319. var g2 = 64;
  320. var p3 = 128;
  321. function x2(e11) {
  322. switch (e11) {
  323. case u2:
  324. case _:
  325. case d:
  326. return -1;
  327. case c3:
  328. case g2:
  329. return 0;
  330. case o7:
  331. case l2:
  332. case p3:
  333. return 1;
  334. }
  335. }
  336. function m(e11) {
  337. switch (e11) {
  338. case u2:
  339. case c3:
  340. case o7:
  341. return -1;
  342. case _:
  343. case l2:
  344. return 0;
  345. case d:
  346. case g2:
  347. case p3:
  348. return 1;
  349. }
  350. }
  351. var f7 = u2 | _ | d;
  352. var y2 = o7 | l2 | p3;
  353. var w3 = u2 | c3 | o7;
  354. var v = d | g2 | p3;
  355. var E2 = class {
  356. constructor(e11, t10, r13, i12, s9, n10 = 0) {
  357. this._hasAggregate = false, this.hasRecords = false, this._data = { self: /* @__PURE__ */ new Map(), neighbors: new Array() }, this._version = 0, this._current = { geometryType: 0, writer: null, overlaps: 0, start: 0, insertAfter: 0, sortKey: 0, id: 0, materialKey: 0, indexStart: 0, vertStart: 0, isDotDensity: false, bufferingEnabled: false, metricBoxLenPointer: 0 }, this.hint = t10, this.tileKey = e11, this._hasAggregate = i12, this._pixelBufferEnabled = s9, this._version = n10, this._symbologyType = r13;
  358. }
  359. get hasAggregates() {
  360. return this._hasAggregate;
  361. }
  362. get hasPixelBufferEnabled() {
  363. return this._pixelBufferEnabled;
  364. }
  365. serialize(t10) {
  366. const r13 = [];
  367. return r13.push(this._serializeTileVertexData(this.tileKey, this.tileKey, this._data.self)), this._data.neighbors.forEach((i12, s9) => {
  368. const n10 = 1 << s9, a7 = x2(n10), u12 = m(n10), c9 = l(new e3(this.tileKey), a7, u12, t10), o11 = this._serializeTileVertexData(this.tileKey, c9.id, i12.vertexData);
  369. o11.message.bufferIds = i12.displayIds, r13.push(o11);
  370. }), r13;
  371. }
  372. _serializeTileVertexData(e11, t10, r13) {
  373. var _a, _b, _c, _d, _e;
  374. const i12 = new Array();
  375. return { message: { tileKeyOrigin: e11, tileKey: t10, data: { [E.MARKER]: (_a = r13.get(E.MARKER)) == null ? void 0 : _a.serialize(i12), [E.FILL]: (_b = r13.get(E.FILL)) == null ? void 0 : _b.serialize(i12), [E.LINE]: (_c = r13.get(E.LINE)) == null ? void 0 : _c.serialize(i12), [E.TEXT]: (_d = r13.get(E.TEXT)) == null ? void 0 : _d.serialize(i12), [E.LABEL]: (_e = r13.get(E.LABEL)) == null ? void 0 : _e.serialize(i12) }, version: this._version }, transferList: i12 };
  376. }
  377. featureStart(e11, t10) {
  378. this._current.insertAfter = e11, this._current.sortKey = t10;
  379. }
  380. featureEnd() {
  381. }
  382. recordStart(e11, t10, r13, i12) {
  383. this._current.writer = this._getVertexWriter(r13), this._current.overlaps = 0, this._current.indexStart = this._current.writer.indexCount, this._current.vertStart = this._current.writer.vertexCount, this._current.bufferingEnabled = i12, this._current.id = e11, this._current.materialKey = t10, this._current.geometryType = r13, this._current.isDotDensity = false, this._current.writer.recordStart();
  384. }
  385. recordCount() {
  386. return this._current.writer.recordCount;
  387. }
  388. vertexCount() {
  389. return this._current.writer.vertexCount;
  390. }
  391. indexCount() {
  392. return this._current.writer.indexCount;
  393. }
  394. vertexEnsureSize(e11) {
  395. this._current.writer.vertexEnsureSize(e11);
  396. }
  397. indexEnsureSize(e11) {
  398. this._current.writer.indexEnsureSize(e11);
  399. }
  400. vertexBounds(e11, t10, r13, i12) {
  401. this._current.bufferingEnabled && this._addOverlap(e11, t10, r13, i12);
  402. }
  403. vertexWrite(e11) {
  404. this._current.writer.writeVertex(e11);
  405. }
  406. vertexWriteF32(e11) {
  407. this._current.writer.writeVertexF32(e11);
  408. }
  409. vertexEnd() {
  410. }
  411. vertexWriter() {
  412. return this._current.writer.vertexWriter;
  413. }
  414. indexWrite(e11) {
  415. this._current.writer.writeIndex(e11);
  416. }
  417. indexWriter() {
  418. return this._current.writer.indexWriter;
  419. }
  420. metricWriter() {
  421. return this._current.writer.metricWriter;
  422. }
  423. metricStart(e11, t10, r13, n10, a7, h5, u12, c9) {
  424. this._current.writer = this._getVertexWriter(E.LABEL);
  425. const o11 = this._current.writer.metricWriter;
  426. o11.push(f2(e11)), o11.push(t10), o11.push(r13), o11.push(n10), o11.push(a7), o11.push(h5), o11.push(u12), o11.push(c9), o11.push(255), this._current.metricBoxLenPointer = o11.push(0);
  427. }
  428. metricEnd() {
  429. const e11 = this._current.writer.metricWriter;
  430. 0 === e11.getValue(this._current.metricBoxLenPointer) && e11.seek(e11.length - 10);
  431. }
  432. metricBoxWrite(e11, t10, r13, i12) {
  433. const s9 = this._current.writer.metricWriter;
  434. s9.incr(this._current.metricBoxLenPointer), s9.push(0), s9.push(0), s9.push(e11), s9.push(t10), s9.push(r13), s9.push(i12);
  435. }
  436. recordEnd() {
  437. const e11 = this._current.vertStart, r13 = this._current.writer.vertexCount - e11;
  438. if (!r13)
  439. return false;
  440. this.hasRecords = true;
  441. const i12 = this._current.indexStart, h5 = this._current.writer.indexCount - i12;
  442. if (this._current.writer.recordEnd(this._current.id, this._current.materialKey, this._current.insertAfter, i12, h5, e11, r13, this._current.sortKey), !this._pixelBufferEnabled || this._hasAggregate || 0 === this._current.overlaps || this._current.geometryType === E.LABEL)
  443. return true;
  444. const u12 = this._current.writer;
  445. for (let s9 = 0; s9 < 8; s9++) {
  446. const e12 = 1 << s9;
  447. if (!!(this._current.overlaps & e12)) {
  448. this._data.neighbors[s9] || (this._data.neighbors[s9] = { vertexData: /* @__PURE__ */ new Map(), displayIds: /* @__PURE__ */ new Set() });
  449. const r14 = this._data.neighbors[s9], i13 = this._current.geometryType;
  450. if (!r14.vertexData.has(i13)) {
  451. const e13 = G(i13, this._symbologyType).geometry, s10 = new r6(i13, e13, ht);
  452. r14.vertexData.set(i13, s10);
  453. }
  454. const h6 = r14.vertexData.get(this._current.geometryType), c9 = 8, o11 = 512 * -x2(e12) * c9, _5 = 512 * -m(e12) * c9;
  455. h6.copyLastFrom(u12, o11, _5), r14.displayIds.add(this._current.id);
  456. }
  457. }
  458. return true;
  459. }
  460. _addOverlap(e11, t10, i12, s9) {
  461. const n10 = 255 ^ ((e11 < 0 + i12 ? y2 : e11 >= o3 - i12 ? f7 : y2 | f7) | (t10 < 0 + s9 ? v : t10 >= o3 - s9 ? w3 : v | w3));
  462. this._current.overlaps |= n10;
  463. }
  464. _getVertexWriter(e11) {
  465. if (!this._data.self.has(e11)) {
  466. const t10 = this._data.self, r13 = G(e11, this._symbologyType).geometry;
  467. t10.set(e11, new r6(e11, r13, this.hint.records));
  468. }
  469. return this._data.self.get(e11);
  470. }
  471. };
  472. // node_modules/@arcgis/core/views/2d/layers/features/textUtils.js
  473. function t7(t10) {
  474. const e11 = new Array(t10.length);
  475. for (let n10 = 0; n10 < t10.length; n10++)
  476. e11[n10] = t10.charCodeAt(n10);
  477. return e11;
  478. }
  479. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/util.js
  480. var n7 = 0;
  481. var o8 = 100;
  482. function t8(n10, o11, t10) {
  483. return n10[0] = o11[0] - t10[0], n10[1] = o11[1] - t10[1], n10;
  484. }
  485. function i9(n10, o11) {
  486. return Math.sqrt(n10 * n10 + o11 * o11);
  487. }
  488. function r7(n10) {
  489. const o11 = i9(n10[0], n10[1]);
  490. n10[0] /= o11, n10[1] /= o11;
  491. }
  492. function u3(n10, o11) {
  493. return i9(n10[0] - o11[0], n10[1] - o11[1]);
  494. }
  495. function c4(n10) {
  496. return "function" == typeof n10;
  497. }
  498. function e7(n10 = 2) {
  499. return 1 / Math.max(n10, 1);
  500. }
  501. function x3(t10, i12) {
  502. return [!!t10.minScale && i12.scaleToZoom(t10.minScale) || n7, !!t10.maxScale && i12.scaleToZoom(t10.maxScale) || o8];
  503. }
  504. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/bufcut.js
  505. function e8(e11, t10, r13, i12, u12, o11, l7) {
  506. D2 = 0;
  507. const f14 = (i12 - r13) * o11, p9 = u12 && u12.length, c9 = p9 ? (u12[0] - r13) * o11 : f14;
  508. let v5, s9, h5, d7, Z4, a7 = n8(t10, r13, i12, 0, c9, o11, true);
  509. if (a7 && a7.next !== a7.prev) {
  510. if (p9 && (a7 = y3(t10, r13, i12, u12, a7, o11)), f14 > 80 * o11) {
  511. v5 = h5 = t10[0 + r13 * o11], s9 = d7 = t10[1 + r13 * o11];
  512. for (let e12 = o11; e12 < c9; e12 += o11) {
  513. const n10 = t10[e12 + r13 * o11], x10 = t10[e12 + 1 + r13 * o11];
  514. v5 = Math.min(v5, n10), s9 = Math.min(s9, x10), h5 = Math.max(h5, n10), d7 = Math.max(d7, x10);
  515. }
  516. Z4 = Math.max(h5 - v5, d7 - s9), Z4 = 0 !== Z4 ? 1 / Z4 : 0;
  517. }
  518. x4(a7, e11, o11, v5, s9, Z4, l7, 0);
  519. }
  520. }
  521. function n8(e11, n10, t10, x10, r13, i12, l7) {
  522. let y7;
  523. if (l7 === Z2(e11, n10, t10, x10, r13, i12) > 0)
  524. for (let o11 = x10; o11 < r13; o11 += i12)
  525. y7 = u4(o11 + n10 * i12, e11[o11 + n10 * i12], e11[o11 + 1 + n10 * i12], y7);
  526. else
  527. for (let o11 = r13 - i12; o11 >= x10; o11 -= i12)
  528. y7 = u4(o11 + n10 * i12, e11[o11 + n10 * i12], e11[o11 + 1 + n10 * i12], y7);
  529. return y7 && M2(y7, y7.next) && (o9(y7), y7 = y7.next), y7;
  530. }
  531. function t9(e11, n10 = e11) {
  532. if (!e11)
  533. return e11;
  534. let t10, x10 = e11;
  535. do {
  536. if (t10 = false, x10.steiner || !M2(x10, x10.next) && 0 !== s7(x10.prev, x10, x10.next))
  537. x10 = x10.next;
  538. else {
  539. if (o9(x10), x10 = n10 = x10.prev, x10 === x10.next)
  540. break;
  541. t10 = true;
  542. }
  543. } while (t10 || x10 !== n10);
  544. return n10;
  545. }
  546. function x4(e11, n10, u12, l7, y7, f14, p9, v5) {
  547. if (!e11)
  548. return;
  549. !v5 && f14 && (e11 = c5(e11, l7, y7, f14));
  550. let s9 = e11;
  551. for (; e11.prev !== e11.next; ) {
  552. const c9 = e11.prev, h5 = e11.next;
  553. if (f14 ? i10(e11, l7, y7, f14) : r8(e11))
  554. n10.push(c9.index / u12 + p9), n10.push(e11.index / u12 + p9), n10.push(h5.index / u12 + p9), o9(e11), e11 = h5.next, s9 = h5.next;
  555. else if ((e11 = h5) === s9) {
  556. v5 ? 1 === v5 ? x4(e11 = b2(e11, n10, u12, p9), n10, u12, l7, y7, f14, p9, 2) : 2 === v5 && g3(e11, n10, u12, l7, y7, f14, p9) : x4(t9(e11), n10, u12, l7, y7, f14, p9, 1);
  557. break;
  558. }
  559. }
  560. }
  561. function r8(e11) {
  562. const n10 = e11.prev, t10 = e11, x10 = e11.next;
  563. if (s7(n10, t10, x10) >= 0)
  564. return false;
  565. let r13 = e11.next.next;
  566. const i12 = r13;
  567. let u12 = 0;
  568. for (; r13 !== e11.prev && (0 === u12 || r13 !== i12); ) {
  569. if (u12++, a4(n10.x, n10.y, t10.x, t10.y, x10.x, x10.y, r13.x, r13.y) && s7(r13.prev, r13, r13.next) >= 0)
  570. return false;
  571. r13 = r13.next;
  572. }
  573. return true;
  574. }
  575. function i10(e11, n10, t10, x10) {
  576. const r13 = e11.prev, i12 = e11, u12 = e11.next;
  577. if (s7(r13, i12, u12) >= 0)
  578. return false;
  579. const o11 = r13.x < i12.x ? r13.x < u12.x ? r13.x : u12.x : i12.x < u12.x ? i12.x : u12.x, l7 = r13.y < i12.y ? r13.y < u12.y ? r13.y : u12.y : i12.y < u12.y ? i12.y : u12.y, y7 = r13.x > i12.x ? r13.x > u12.x ? r13.x : u12.x : i12.x > u12.x ? i12.x : u12.x, f14 = r13.y > i12.y ? r13.y > u12.y ? r13.y : u12.y : i12.y > u12.y ? i12.y : u12.y, p9 = z2(o11, l7, n10, t10, x10), c9 = z2(y7, f14, n10, t10, x10);
  580. let v5 = e11.prevZ, h5 = e11.nextZ;
  581. for (; v5 && v5.z >= p9 && h5 && h5.z <= c9; ) {
  582. if (v5 !== e11.prev && v5 !== e11.next && a4(r13.x, r13.y, i12.x, i12.y, u12.x, u12.y, v5.x, v5.y) && s7(v5.prev, v5, v5.next) >= 0)
  583. return false;
  584. if (v5 = v5.prevZ, h5 !== e11.prev && h5 !== e11.next && a4(r13.x, r13.y, i12.x, i12.y, u12.x, u12.y, h5.x, h5.y) && s7(h5.prev, h5, h5.next) >= 0)
  585. return false;
  586. h5 = h5.nextZ;
  587. }
  588. for (; v5 && v5.z >= p9; ) {
  589. if (v5 !== e11.prev && v5 !== e11.next && a4(r13.x, r13.y, i12.x, i12.y, u12.x, u12.y, v5.x, v5.y) && s7(v5.prev, v5, v5.next) >= 0)
  590. return false;
  591. v5 = v5.prevZ;
  592. }
  593. for (; h5 && h5.z <= c9; ) {
  594. if (h5 !== e11.prev && h5 !== e11.next && a4(r13.x, r13.y, i12.x, i12.y, u12.x, u12.y, h5.x, h5.y) && s7(h5.prev, h5, h5.next) >= 0)
  595. return false;
  596. h5 = h5.nextZ;
  597. }
  598. return true;
  599. }
  600. function u4(e11, n10, t10, x10) {
  601. const r13 = q.create(e11, n10, t10);
  602. return x10 ? (r13.next = x10.next, r13.prev = x10, x10.next.prev = r13, x10.next = r13) : (r13.prev = r13, r13.next = r13), r13;
  603. }
  604. function o9(e11) {
  605. e11.next.prev = e11.prev, e11.prev.next = e11.next, e11.prevZ && (e11.prevZ.nextZ = e11.nextZ), e11.nextZ && (e11.nextZ.prevZ = e11.prevZ);
  606. }
  607. function l3(e11) {
  608. let n10 = e11, t10 = e11;
  609. do {
  610. (n10.x < t10.x || n10.x === t10.x && n10.y < t10.y) && (t10 = n10), n10 = n10.next;
  611. } while (n10 !== e11);
  612. return t10;
  613. }
  614. function y3(e11, t10, x10, r13, i12, u12) {
  615. const o11 = new Array();
  616. for (let y7 = 0, f14 = r13.length; y7 < f14; y7++) {
  617. const i13 = n8(e11, t10, x10, r13[y7] * u12, y7 < f14 - 1 ? r13[y7 + 1] * u12 : x10 * u12, u12, false);
  618. i13 === i13.next && (i13.steiner = true), o11.push(l3(i13));
  619. }
  620. o11.sort(m2);
  621. for (const n10 of o11)
  622. i12 = f8(n10, i12);
  623. return i12;
  624. }
  625. function f8(e11, n10) {
  626. const x10 = p4(e11, n10);
  627. if (!x10)
  628. return n10;
  629. const r13 = j4(x10, e11);
  630. return t9(r13, r13.next), t9(x10, x10.next);
  631. }
  632. function p4(e11, n10) {
  633. let t10 = n10;
  634. const x10 = e11.x, r13 = e11.y;
  635. let i12, u12 = -1 / 0;
  636. do {
  637. if (r13 <= t10.y && r13 >= t10.next.y && t10.next.y !== t10.y) {
  638. const e12 = t10.x + (r13 - t10.y) * (t10.next.x - t10.x) / (t10.next.y - t10.y);
  639. if (e12 <= x10 && e12 > u12) {
  640. if (u12 = e12, e12 === x10) {
  641. if (r13 === t10.y)
  642. return t10;
  643. if (r13 === t10.next.y)
  644. return t10.next;
  645. }
  646. i12 = t10.x < t10.next.x ? t10 : t10.next;
  647. }
  648. }
  649. t10 = t10.next;
  650. } while (t10 !== n10);
  651. if (!i12)
  652. return null;
  653. if (x10 === u12)
  654. return i12.prev;
  655. const o11 = i12, l7 = i12.x, y7 = i12.y;
  656. let f14, p9 = 1 / 0;
  657. for (t10 = i12.next; t10 !== o11; )
  658. x10 >= t10.x && t10.x >= l7 && x10 !== t10.x && a4(r13 < y7 ? x10 : u12, r13, l7, y7, r13 < y7 ? u12 : x10, r13, t10.x, t10.y) && (f14 = Math.abs(r13 - t10.y) / (x10 - t10.x), (f14 < p9 || f14 === p9 && t10.x > i12.x) && w4(t10, e11) && (i12 = t10, p9 = f14)), t10 = t10.next;
  659. return i12;
  660. }
  661. function c5(e11, n10, t10, x10) {
  662. for (let r13; r13 !== e11; r13 = r13.next) {
  663. if (r13 = r13 || e11, null === r13.z && (r13.z = z2(r13.x, r13.y, n10, t10, x10)), r13.prev.next !== r13 || r13.next.prev !== r13)
  664. return r13.prev.next = r13, r13.next.prev = r13, c5(e11, n10, t10, x10);
  665. r13.prevZ = r13.prev, r13.nextZ = r13.next;
  666. }
  667. return e11.prevZ.nextZ = null, e11.prevZ = null, v2(e11);
  668. }
  669. function v2(e11) {
  670. let n10, t10 = 1;
  671. for (; ; ) {
  672. let x10, r13 = e11;
  673. e11 = null, n10 = null;
  674. let i12 = 0;
  675. for (; r13; ) {
  676. i12++, x10 = r13;
  677. let u12 = 0;
  678. for (; u12 < t10 && x10; u12++)
  679. x10 = x10.nextZ;
  680. let o11 = t10;
  681. for (; u12 > 0 || o11 > 0 && x10; ) {
  682. let t11;
  683. 0 === u12 ? (t11 = x10, x10 = x10.nextZ, o11--) : 0 !== o11 && x10 ? r13.z <= x10.z ? (t11 = r13, r13 = r13.nextZ, u12--) : (t11 = x10, x10 = x10.nextZ, o11--) : (t11 = r13, r13 = r13.nextZ, u12--), n10 ? n10.nextZ = t11 : e11 = t11, t11.prevZ = n10, n10 = t11;
  684. }
  685. r13 = x10;
  686. }
  687. if (n10.nextZ = null, t10 *= 2, i12 < 2)
  688. return e11;
  689. }
  690. }
  691. function s7(e11, n10, t10) {
  692. return (n10.y - e11.y) * (t10.x - n10.x) - (n10.x - e11.x) * (t10.y - n10.y);
  693. }
  694. function h(e11, n10, t10, x10) {
  695. return !!(M2(e11, n10) && M2(t10, x10) || M2(e11, x10) && M2(t10, n10)) || s7(e11, n10, t10) > 0 != s7(e11, n10, x10) > 0 && s7(t10, x10, e11) > 0 != s7(t10, x10, n10) > 0;
  696. }
  697. function d2(e11, n10) {
  698. let t10 = e11;
  699. do {
  700. if (t10.index !== e11.index && t10.next.index !== e11.index && t10.index !== n10.index && t10.next.index !== n10.index && h(t10, t10.next, e11, n10))
  701. return true;
  702. t10 = t10.next;
  703. } while (t10 !== e11);
  704. return false;
  705. }
  706. function Z2(e11, n10, t10, x10, r13, i12) {
  707. let u12 = 0;
  708. for (let o11 = x10, l7 = r13 - i12; o11 < r13; o11 += i12)
  709. u12 += (e11[l7 + n10 * i12] - e11[o11 + n10 * i12]) * (e11[o11 + 1 + n10 * i12] + e11[l7 + 1 + n10 * i12]), l7 = o11;
  710. return u12;
  711. }
  712. function a4(e11, n10, t10, x10, r13, i12, u12, o11) {
  713. return (r13 - u12) * (n10 - o11) - (e11 - u12) * (i12 - o11) >= 0 && (e11 - u12) * (x10 - o11) - (t10 - u12) * (n10 - o11) >= 0 && (t10 - u12) * (i12 - o11) - (r13 - u12) * (x10 - o11) >= 0;
  714. }
  715. function w4(e11, n10) {
  716. return s7(e11.prev, e11, e11.next) < 0 ? s7(e11, n10, e11.next) >= 0 && s7(e11, e11.prev, n10) >= 0 : s7(e11, n10, e11.prev) < 0 || s7(e11, e11.next, n10) < 0;
  717. }
  718. function z2(e11, n10, t10, x10, r13) {
  719. return (e11 = 1431655765 & ((e11 = 858993459 & ((e11 = 252645135 & ((e11 = 16711935 & ((e11 = 32767 * (e11 - t10) * r13) | e11 << 8)) | e11 << 4)) | e11 << 2)) | e11 << 1)) | (n10 = 1431655765 & ((n10 = 858993459 & ((n10 = 252645135 & ((n10 = 16711935 & ((n10 = 32767 * (n10 - x10) * r13) | n10 << 8)) | n10 << 4)) | n10 << 2)) | n10 << 1)) << 1;
  720. }
  721. function M2(e11, n10) {
  722. return e11.x === n10.x && e11.y === n10.y;
  723. }
  724. function m2(e11, n10) {
  725. return e11.x - n10.x;
  726. }
  727. function b2(e11, n10, t10, x10) {
  728. let r13 = e11;
  729. do {
  730. const i12 = r13.prev, u12 = r13.next.next;
  731. !M2(i12, u12) && h(i12, r13, r13.next, u12) && w4(i12, u12) && w4(u12, i12) && (n10.push(i12.index / t10 + x10), n10.push(r13.index / t10 + x10), n10.push(u12.index / t10 + x10), o9(r13), o9(r13.next), r13 = e11 = u12), r13 = r13.next;
  732. } while (r13 !== e11);
  733. return r13;
  734. }
  735. function g3(e11, n10, r13, i12, u12, o11, l7) {
  736. let y7 = e11;
  737. do {
  738. let e12 = y7.next.next;
  739. for (; e12 !== y7.prev; ) {
  740. if (y7.index !== e12.index && k2(y7, e12)) {
  741. let f14 = j4(y7, e12);
  742. return y7 = t9(y7, y7.next), f14 = t9(f14, f14.next), x4(y7, n10, r13, i12, u12, o11, l7, 0), void x4(f14, n10, r13, i12, u12, o11, l7, 0);
  743. }
  744. e12 = e12.next;
  745. }
  746. y7 = y7.next;
  747. } while (y7 !== e11);
  748. }
  749. function k2(e11, n10) {
  750. return e11.next.index !== n10.index && e11.prev.index !== n10.index && !d2(e11, n10) && w4(e11, n10) && w4(n10, e11) && A(e11, n10);
  751. }
  752. function A(e11, n10) {
  753. let t10 = e11, x10 = false;
  754. const r13 = (e11.x + n10.x) / 2, i12 = (e11.y + n10.y) / 2;
  755. do {
  756. t10.y > i12 != t10.next.y > i12 && t10.next.y !== t10.y && r13 < (t10.next.x - t10.x) * (i12 - t10.y) / (t10.next.y - t10.y) + t10.x && (x10 = !x10), t10 = t10.next;
  757. } while (t10 !== e11);
  758. return x10;
  759. }
  760. function j4(e11, n10) {
  761. const t10 = q.create(e11.index, e11.x, e11.y), x10 = q.create(n10.index, n10.x, n10.y), r13 = e11.next, i12 = n10.prev;
  762. return e11.next = n10, n10.prev = e11, t10.next = r13, r13.prev = t10, x10.next = t10, t10.prev = x10, i12.next = x10, x10.prev = i12, x10;
  763. }
  764. var q = class {
  765. constructor() {
  766. this.index = 0, this.x = 0, this.y = 0, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = false;
  767. }
  768. static create(e11, n10, t10) {
  769. const x10 = D2 < B.length ? B[D2++] : new q();
  770. return x10.index = e11, x10.x = n10, x10.y = t10, x10.prev = null, x10.next = null, x10.z = null, x10.prevZ = null, x10.nextZ = null, x10.steiner = false, x10;
  771. }
  772. };
  773. var B = new Array();
  774. var C2 = 8096;
  775. var D2 = 0;
  776. for (let E4 = 0; E4 < C2; E4++)
  777. B.push(new q());
  778. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/templateUtils.js
  779. var f9 = 1e-5;
  780. var c6 = new n5(0, 0, 0, 1, 0);
  781. var u5 = new n5(0, 0, 0, 1, 0);
  782. function h2(t10, e11, n10) {
  783. let o11 = 0;
  784. for (let r13 = 1; r13 < n10; r13++) {
  785. const n11 = t10[2 * (e11 + r13 - 1)], s9 = t10[2 * (e11 + r13 - 1) + 1];
  786. o11 += (t10[2 * (e11 + r13)] - n11) * (t10[2 * (e11 + r13) + 1] + s9);
  787. }
  788. return o11;
  789. }
  790. function g4(t10, e11, n10, o11, r13) {
  791. let s9 = 0;
  792. const l7 = 2;
  793. for (let i12 = n10; i12 < o11; i12 += 3) {
  794. const n11 = (t10[i12] - r13) * l7, o12 = (t10[i12 + 1] - r13) * l7, f14 = (t10[i12 + 2] - r13) * l7;
  795. s9 += Math.abs((e11[n11] - e11[f14]) * (e11[o12 + 1] - e11[n11 + 1]) - (e11[n11] - e11[o12]) * (e11[f14 + 1] - e11[n11 + 1]));
  796. }
  797. return s9;
  798. }
  799. function a5(t10, e11) {
  800. const { coords: n10, lengths: o11, hasIndeterminateRingOrder: r13 } = e11, s9 = 0, l7 = t10;
  801. if (r13)
  802. return false;
  803. let c9 = 0;
  804. for (let u12 = 0; u12 < o11.length; ) {
  805. let t11 = u12, e12 = o11[u12], r14 = h2(n10, c9, e12);
  806. const a7 = [];
  807. for (; ++t11 < o11.length; ) {
  808. const s10 = o11[t11], l8 = h2(n10, c9 + e12, s10);
  809. if (!(l8 > 0))
  810. break;
  811. r14 += l8, a7.push(c9 + e12), e12 += s10;
  812. }
  813. const m5 = l7.length;
  814. e8(l7, n10, c9, c9 + e12, a7, 2, s9);
  815. const p9 = g4(l7, n10, m5, l7.length, s9), d7 = Math.abs(r14);
  816. if (Math.abs((p9 - d7) / Math.max(1e-7, d7)) > f9)
  817. return l7.length = 0, false;
  818. u12 = t11, c9 += e12;
  819. }
  820. return true;
  821. }
  822. function p5(t10) {
  823. const { coords: e11, lengths: o11 } = t10, { buffer: r13 } = r4(e11, o11);
  824. return r13;
  825. }
  826. function d3(t10, e11, n10) {
  827. let o11 = 0;
  828. for (let r13 = 0; r13 < t10.lengths.length; r13++) {
  829. const s9 = t10.lengths[r13];
  830. for (let r14 = 0; r14 < s9; r14++) {
  831. const s10 = t10.coords[2 * (r14 + o11)], l7 = t10.coords[2 * (r14 + o11) + 1];
  832. if (s10 < e11 || s10 > n10 || l7 < e11 || l7 > n10)
  833. return true;
  834. }
  835. o11 += s9;
  836. }
  837. return false;
  838. }
  839. function b3(e11, n10) {
  840. if (t(e11))
  841. return null;
  842. if (!d3(e11, -128, o3 + 128))
  843. return e11;
  844. c6.setPixelMargin(n10), c6.reset(s6.Polygon);
  845. let l7 = 0;
  846. for (let t10 = 0; t10 < e11.lengths.length; t10++) {
  847. const n11 = e11.lengths[t10];
  848. let o11 = e11.coords[2 * (0 + l7)], r13 = e11.coords[2 * (0 + l7) + 1];
  849. c6.moveTo(o11, r13);
  850. for (let t11 = 1; t11 < n11; t11++)
  851. o11 = e11.coords[2 * (t11 + l7)], r13 = e11.coords[2 * (t11 + l7) + 1], c6.lineTo(o11, r13);
  852. c6.close(), l7 += n11;
  853. }
  854. const i12 = c6.result(false);
  855. if (!i12)
  856. return null;
  857. const f14 = [], u12 = [];
  858. for (const t10 of i12) {
  859. let e12 = 0;
  860. for (const n11 of t10)
  861. u12.push(n11.x), u12.push(n11.y), e12++;
  862. f14.push(e12);
  863. }
  864. return new t2(f14, u12);
  865. }
  866. function x6(t10, e11) {
  867. u5.setPixelMargin(e11);
  868. const n10 = u5, o11 = -e11, l7 = o3 + e11;
  869. let i12 = [], f14 = false, c9 = 0;
  870. for (; c9 < t10.length; ) {
  871. const e12 = [], r13 = t10[c9];
  872. if (!r13)
  873. return null;
  874. n10.reset(s6.LineString);
  875. let [u12, h5] = r13[0];
  876. if (f14)
  877. n10.moveTo(u12, h5);
  878. else {
  879. if (u12 < o11 || u12 > l7 || h5 < o11 || h5 > l7) {
  880. f14 = true;
  881. continue;
  882. }
  883. e12.push({ x: u12, y: h5 });
  884. }
  885. let g9 = false;
  886. const a7 = r13.length;
  887. for (let t11 = 1; t11 < a7; ++t11)
  888. if (u12 += r13[t11][0], h5 += r13[t11][1], f14)
  889. n10.lineTo(u12, h5);
  890. else {
  891. if (u12 < o11 || u12 > l7 || h5 < o11 || h5 > l7) {
  892. g9 = true;
  893. break;
  894. }
  895. e12.push({ x: u12, y: h5 });
  896. }
  897. if (g9)
  898. f14 = true;
  899. else {
  900. if (f14) {
  901. const t11 = n10.resultWithStarts();
  902. if (t11)
  903. for (const e13 of t11)
  904. i12.push(e13);
  905. } else
  906. i12.push({ line: e12, start: 0 });
  907. c9++, f14 = false;
  908. }
  909. }
  910. return i12 = i12.filter((t11) => t11.line.length > 1), 0 === i12.length ? null : i12;
  911. }
  912. c6.setExtent(o3), u5.setExtent(o3);
  913. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js
  914. var m3 = 8;
  915. var x7 = 16;
  916. var p6 = 65535;
  917. var f10 = (r13) => class extends r13 {
  918. constructor(...e11) {
  919. super(...e11), this.tessellationProperties = {}, this._tessellationOptions = { halfWidth: 0, pixelCoordRatio: 1, offset: 0 }, this.geometryType = E.LINE;
  920. }
  921. writeGeometry(e11, t10, i12, r14) {
  922. this._writeGeometry(e11, t10, i12, r14);
  923. }
  924. _initializeTessellator(e11) {
  925. const i12 = C.load(this._materialKey), r14 = w2.load(this._materialKey), s9 = this._tessellationOptions, h5 = i12.vvSizeFieldStops || i12.vvSizeMinMaxValue || i12.vvSizeScaleStops || i12.vvSizeUnitValue, d7 = this.tessellationProperties._halfWidth < X && !e11 && !h5;
  926. this.tessellationProperties.minMaxZoom = this._minMaxZoom, s9.wrapDistance = p6, s9.textured = this._isDashed || this._hasPattern, s9.offset = this.tessellationProperties.offset, s9.halfWidth = this.tessellationProperties._halfWidth;
  927. const m5 = d7 ? 0 : 1, x10 = O(r14) ? v3 : _2;
  928. this._lineTessellator = new c2(x10(this.tessellationProperties, m5, m5), u6(this.tessellationProperties), d7);
  929. }
  930. _write(e11, t10, i12, r14) {
  931. const s9 = "esriGeometryPoint" === t10.geometryType;
  932. e11.recordStart(t10.getDisplayId(), this._materialKey, this.geometryType, s9), this._writeGeometry(e11, t10, r14, s9), e11.recordEnd();
  933. }
  934. _writeGeometry(t10, i12, r14, s9) {
  935. const o11 = r14 != null ? r14 : i12.readLegacyGeometryForDisplay(), n10 = this._getLines(o11, s9);
  936. t(n10) || this._writeVertices(t10, i12, n10);
  937. }
  938. _getLines(t10, i12) {
  939. if (t(t10))
  940. return null;
  941. const r14 = t10.paths || t10.rings;
  942. if (t(r14))
  943. return null;
  944. return x6(r14, i12 ? 256 : 16);
  945. }
  946. _writeVertices(e11, t10, i12) {
  947. const r14 = t10.getDisplayId(), s9 = e11.vertexCount(), o11 = this.tessellationProperties, h5 = this._tessellationOptions;
  948. o11.out = e11, o11.id = r14, o11.indexCount = 0, o11.vertexCount = 0, o11.offset = s9, h5.capType = this._capType, h5.joinType = this._joinType;
  949. const d7 = w2.load(this._materialKey);
  950. this.tessellationProperties.key = O(d7) ? d7 : C.load(this._materialKey);
  951. for (const { line: n10, start: l7 } of i12)
  952. h5.initialDistance = l7 % p6, this._lineTessellator.tessellate(n10, h5);
  953. }
  954. };
  955. var _2 = (e11, t10, i12) => (o11, n10, l7, a7, h5, d7, p9, f14, _5, v5, u12) => {
  956. const c9 = w(u12, Math.ceil(x7 * e11._halfWidth)), y7 = x(Math.round(x7 * p9), Math.round(x7 * f14), Math.round(x7 * _5), Math.round(x7 * v5)), W = x(x7 * h5, x7 * d7, 0, e11._bitset), M8 = e11.out;
  957. return M8.vertexBounds(o11, n10, t10, i12), M8.vertexWrite(w(m3 * o11, m3 * n10)), M8.vertexWrite(e11.id), M8.vertexWrite(e11._fillColor), M8.vertexWrite(y7), M8.vertexWrite(c9), M8.vertexWrite(e11._tl), M8.vertexWrite(e11._br), M8.vertexWrite(W), M8.vertexWrite(w(Math.ceil(x7 * e11._halfReferenceWidth), 0)), M8.vertexWrite(e11.minMaxZoom), M8.vertexEnd(), e11.offset + e11.vertexCount++;
  958. };
  959. var v3 = (e11, t10, i12) => (o11, n10, l7, a7, d7, p9, f14, _5, v5, u12, c9) => {
  960. const y7 = w(x7 * e11._halfWidth, x7 * e11._halfReferenceWidth), W = x(x7 * f14 + 128, x7 * _5 + 128, x7 * v5 + 128, x7 * u12 + 128), M8 = e11.out, P4 = e11._bitset << 24 | e11.id;
  961. M8.vertexBounds(o11, n10, t10, i12), M8.vertexWrite(w(m3 * o11, m3 * n10)), M8.vertexWrite(P4), M8.vertexWrite(e11._fillColor);
  962. const T = b(e11.key);
  963. return T || (M8.vertexWrite(0), M8.vertexWrite(0)), M8.vertexWrite(0), M8.vertexWrite(y7), M8.vertexWrite(W), T || M8.vertexWrite(e11.minMaxZoom), M8.vertexEnd(), e11.offset + e11.vertexCount++;
  964. };
  965. var u6 = (e11) => (t10, i12, r13) => {
  966. const s9 = e11.out;
  967. s9.indexWrite(t10), s9.indexWrite(i12), s9.indexWrite(r13), e11.indexCount += 3;
  968. };
  969. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js
  970. var r9 = class {
  971. bindFeature(e11, t10, r13) {
  972. }
  973. write(r13, s9, f14, i12) {
  974. var _a;
  975. if (t(this._effects) || 0 === ((_a = this._effects) == null ? void 0 : _a.length))
  976. return this._write(r13, s9, i12);
  977. const c9 = f6.executeEffects(this._effects, s9.readLegacyGeometryForDisplay(), i12.geometryEngine);
  978. let o11 = f6.next(c9);
  979. for (; o11; )
  980. this._write(r13, s9, i12, o11), o11 = f6.next(c9);
  981. }
  982. _write(e11, t10, r13, s9) {
  983. }
  984. };
  985. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js
  986. var K = class extends f10(r9) {
  987. constructor(e11, t10, i12, r13, s9, o11, p9, f14, d7, y7, S4, _5, j7, g9, w7, K2, P4, x10, b6, O3) {
  988. super();
  989. const T = C.load(e11);
  990. t10 && (T.sdf = t10.sdf, T.pattern = true, T.textureBinding = t10.textureBinding), this._capType = r13, this._joinType = s9, this._miterLimitCosine = e7(o11), this.tessellationProperties._fillColor = p9, this.tessellationProperties._tl = f14, this.tessellationProperties._br = d7, this._hasPattern = y7, this._isDashed = S4, this._zOrder = P4, this._effects = x10, this._minMaxZoom = w(Math.round(b6 * at), Math.round(O3 * at)), this._materialKey = T.data;
  991. const M8 = (j7 ? nt2 : 0) | (g9 ? mt : 0) | (_5 ? lt : 0) | (w7 ? gt : 0);
  992. this.tessellationProperties._bitset = M8, this.tessellationProperties._halfWidth = 0.5 * i12, this.tessellationProperties._halfReferenceWidth = 0.5 * K2, this.tessellationProperties.offset = 0, this._initializeTessellator(false);
  993. }
  994. static fromCIMLine(e11, r13, l7) {
  995. const n10 = e11.color, a7 = e11.scaleFactor || 1, m5 = !!e11.dashTemplate;
  996. let c9 = e11.cap;
  997. m5 && c9 === e4.ROUND && (c9 = e4.SQUARE);
  998. const p9 = e11.join, f14 = u(e11.width) * a7, u12 = u(e11.referenceWidth), d7 = u(e11.miterLimit), y7 = n10 && f3(n10) || 0, [L3, _5] = x3(e11.scaleInfo, l7), j7 = false;
  999. if (!r13)
  1000. return new K(e11.materialKey, r13, f14, c9, p9, d7, y7, 0, 0, false, m5, e11.scaleDash, e11.colorLocked, j7, e11.sampleAlphaOnly, u12, e11.zOrder, e11.effects, L3, _5);
  1001. const { rect: g9, width: w7, height: P4 } = r13, x10 = g9.x + et, b6 = g9.y + et, O3 = x10 + w7, T = b6 + P4, M8 = w(x10, b6), W = w(O3, T), z4 = false;
  1002. return new K(e11.materialKey, r13, f14, c9, p9, d7, y7, M8, W, true, m5, e11.scaleDash, e11.colorLocked, z4, e11.sampleAlphaOnly, u12, e11.zOrder, e11.effects, L3, _5);
  1003. }
  1004. static fromFillOutline(e11) {
  1005. var _a;
  1006. const t10 = w2.load(e11.materialKey);
  1007. return O(t10) && e11.outline && "esriSLSSolid" === ((_a = e11.outline) == null ? void 0 : _a.style) ? K.fromSimpleLine({ hash: "", materialKey: e11.materialKey, ...e11.outline }, null, true) : null;
  1008. }
  1009. static fromSimpleLine(e11, i12, s9 = false) {
  1010. const { color: l7 } = e11, n10 = "esriSLSSolid" !== e11.style && "esriSLSNull" !== e11.style, a7 = ee(e11.cap || "round"), m5 = te(e11.join || "round");
  1011. let c9 = l7 && "esriSLSNull" !== e11.style && s4(l7) || 0;
  1012. "esriSLSNull" === e11.style && (c9 = 0);
  1013. const u12 = u(e11.width), d7 = e11.miterLimit;
  1014. if (!i12)
  1015. return new K(e11.materialKey, i12, u12, a7, m5, d7, c9, 0, 0, false, n10, true, false, s9, false, u12, 0, null, n7, o8);
  1016. const { rect: y7, width: L3, height: S4 } = i12, g9 = y7.x + et, w7 = y7.y + et, P4 = g9 + L3, x10 = w7 + S4, b6 = w(g9, w7), O3 = w(P4, x10);
  1017. return new K(e11.materialKey, i12, u12, a7, m5, d7, c9, b6, O3, true, n10, true, false, s9, false, u12, 0, null, n7, o8);
  1018. }
  1019. static fromPictureLineSymbol(t10, i12, r13, s9) {
  1020. return s.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"), null;
  1021. }
  1022. };
  1023. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseFillTemplate.js
  1024. var f11 = 100;
  1025. var u7 = 1;
  1026. var _3 = (_5) => class extends _5 {
  1027. constructor(...e11) {
  1028. super(...e11), this.forceLibtess = false, this._bitset = 0, this._lineTemplate = null, this.geometryType = E.FILL;
  1029. }
  1030. _maybeAddLineTemplate(e11) {
  1031. this._lineTemplate = K.fromFillOutline(e11);
  1032. }
  1033. _write(t10, r13, i12, s9) {
  1034. const o11 = "esriGeometryPoint" === r13.geometryType, m5 = w2.load(this._materialKey);
  1035. t10.recordStart(r13.getDisplayId(), this._materialKey, this.geometryType, o11), this._writeGeometry(t10, r13, m5, s9, o11), O(m5) && r(this._lineTemplate) && this._lineTemplate.writeGeometry(t10, r13, s9, o11), t10.recordEnd();
  1036. }
  1037. _writeGeometry(e11, r13, i12, s9, o11) {
  1038. const m5 = this._getGeometry(r13, s9, o11);
  1039. if (t(m5))
  1040. return;
  1041. const l7 = [];
  1042. if (!(m5.maxLength > f11) && !this.forceLibtess && a5(l7, m5))
  1043. return void (l7.length && this._writeVertices(e11, r13, m5.coords, m5.lengths, i12, l7));
  1044. const n10 = p5(m5);
  1045. this._writeVertices(e11, r13, n10, [n10.length / 2], i12);
  1046. }
  1047. _writeVertex(e11, t10, r13, i12, s9, l7) {
  1048. const n10 = w(u7 * i12, u7 * s9);
  1049. if (e11.vertexBounds(i12, s9, 0, 0), e11.vertexWrite(n10), e11.vertexWrite(t10), r13.symbologyType === S.DOT_DENSITY)
  1050. e11.vertexWriteF32(1 / Math.abs(l7.readGeometryArea()));
  1051. else {
  1052. e11.vertexWrite(this.fillColor);
  1053. const t11 = b(r13);
  1054. t11 || (e11.vertexWrite(this.tl), e11.vertexWrite(this.br)), e11.vertexWrite(this.aux21), e11.vertexWrite(this.aux22), e11.vertexWrite(this.aux3), t11 || e11.vertexWrite(this._minMaxZoom);
  1055. }
  1056. }
  1057. _writeVertices(e11, t10, r13, i12, s9, o11) {
  1058. const m5 = t10.getDisplayId(), n10 = this._bitset << 24 | m5, a7 = i12.reduce((e12, t11) => e12 + t11), h5 = G(s9.geometryType, s9.symbologyType).geometry / 4, y7 = e11.vertexCount();
  1059. e11.vertexEnsureSize(h5 * a7);
  1060. let p9 = 0;
  1061. if (o11)
  1062. for (const l7 of o11) {
  1063. const i13 = r13[2 * l7], o12 = r13[2 * l7 + 1];
  1064. this._writeVertex(e11, n10, s9, i13, o12, t10), p9++;
  1065. }
  1066. else
  1067. for (let l7 = 0; l7 < r13.length; l7 += 2) {
  1068. const i13 = Math.round(r13[l7]), o12 = Math.round(r13[l7 + 1]);
  1069. this._writeVertex(e11, n10, s9, i13, o12, t10), p9++;
  1070. }
  1071. e11.indexEnsureSize(p9);
  1072. for (let l7 = 0; l7 < p9; l7++)
  1073. e11.indexWrite(l7 + y7);
  1074. }
  1075. _getGeometry(e11, t10, s9) {
  1076. const o11 = t10 ? Gt(nt(t10), 2) : e11.readGeometryForDisplay();
  1077. if (!o11)
  1078. return null;
  1079. return b3(o11, s9 ? 256 : 8);
  1080. }
  1081. };
  1082. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicMeshTemplate.js
  1083. var i11 = s.getLogger("esri.views.2d.engine.webgl.WGLDynamicMeshTemplate");
  1084. var r10 = class extends r9 {
  1085. constructor(e11) {
  1086. super(), this._ongoingMaterialRequestMap = /* @__PURE__ */ new Map(), this._materialCache = /* @__PURE__ */ new Map(), this._dynamicPropertyMap = /* @__PURE__ */ new Map(), this._cimLayer = e11;
  1087. }
  1088. analyze(e11, s9, r13, n10, o11) {
  1089. if (o11 && 0 === o11.length)
  1090. return null;
  1091. const l7 = o11 && o11.length > 0, m5 = s9.readLegacyFeature(), c9 = s9.getObjectId(), h5 = this._materialCache, u12 = this._cimLayer.materialHash;
  1092. if (!u12)
  1093. return i11.error("A Dynamic mesh template must have a material hash value or function!"), Promise.reject(null);
  1094. const p9 = "function" == typeof u12 ? u12(m5, r13, n10, c9) : u12;
  1095. if (h5.has(p9)) {
  1096. const e12 = h5.get(p9);
  1097. return Promise.resolve(e12);
  1098. }
  1099. const g9 = this._ongoingMaterialRequestMap.get(p9);
  1100. if (g9)
  1101. return g9;
  1102. const y7 = this._cimLayer, M8 = me(y7.cim, this._cimLayer.materialOverrides);
  1103. M8.mosaicHash = p9;
  1104. const { type: d7, url: f14 } = y7, _5 = { cim: M8, type: d7, mosaicHash: p9, url: f14, size: null, dashTemplate: null, text: null, fontName: null, objectId: c9, animatedSymbolProperties: null };
  1105. switch (d7) {
  1106. case "marker":
  1107. _5.size = t4(y7.size, m5, r13, n10), _5.animatedSymbolProperties = t4(y7.animatedSymbolProperties, m5, r13, n10);
  1108. break;
  1109. case "line":
  1110. _5.dashTemplate = y7.dashTemplate;
  1111. break;
  1112. case "text":
  1113. _5.text = t4(y7.text, m5, r13, n10), _5.fontName = t4(y7.fontName, m5, r13, n10);
  1114. }
  1115. const b6 = e11.getMosaicItem(_5, o11).then((e12) => (l7 || (this._ongoingMaterialRequestMap.delete(p9), h5.set(p9, e12)), e12)).catch((e12) => (this._ongoingMaterialRequestMap.delete(p9), i11.error(".analyze()", e12.message), null));
  1116. return l7 || this._ongoingMaterialRequestMap.set(p9, b6), b6;
  1117. }
  1118. };
  1119. // node_modules/@arcgis/core/views/2d/engine/webgl/util/Result.js
  1120. function e9(e11, n10) {
  1121. if (e11 && "name" in e11) {
  1122. const o11 = e11;
  1123. return n10 && n10.error(new s2(o11.name, o11.message, o11.details)), false;
  1124. }
  1125. return true;
  1126. }
  1127. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js
  1128. var u8 = 128;
  1129. var M3 = class extends _3(r10) {
  1130. constructor(a7, h5, f14) {
  1131. var _a;
  1132. if (super(a7), this._minMaxZoom = w(Math.round(h5 * at), Math.round(f14 * at)), c4(a7.color)) {
  1133. const t10 = (t11, e11, i12) => {
  1134. const o11 = a7.color(t11, e11, i12);
  1135. return o11 && f3(o11) || 0;
  1136. };
  1137. this._dynamicPropertyMap.set("fillColor", t10);
  1138. } else {
  1139. const t10 = a7.color;
  1140. this.fillColor = t10 && f3(t10) || 0;
  1141. }
  1142. const p9 = "CIMMarkerPlacementInsidePolygon" === ((_a = a7.cim.placement) == null ? void 0 : _a.type) && a7.cim.placement.shiftOddRows ? 2 : 1, _5 = a7.height;
  1143. if (c4(_5)) {
  1144. const t10 = (t11, e11, s9) => _5(t11, e11, s9) * p9;
  1145. this._dynamicPropertyMap.set("_height", t10);
  1146. } else
  1147. this._height = (_5 || 0) * p9;
  1148. const y7 = a7.offsetX;
  1149. if (c4(y7)) {
  1150. const t10 = (t11, s9, i12) => u(y7(t11, s9, i12));
  1151. this._dynamicPropertyMap.set("_offsetX", t10);
  1152. } else
  1153. this._offsetX = u(y7 || 0);
  1154. const d7 = a7.offsetY;
  1155. if (c4(d7)) {
  1156. const t10 = (t11, s9, i12) => u(-d7(t11, s9, i12));
  1157. this._dynamicPropertyMap.set("_offsetY", t10);
  1158. } else
  1159. this._offsetY = u(-d7 || 0);
  1160. const u12 = a7.scaleX;
  1161. c4(u12) ? this._dynamicPropertyMap.set("_scaleX", u12) : this._scaleX = u12 || 1;
  1162. const M8 = a7.angle;
  1163. if (c4(M8)) {
  1164. const t10 = (t11, e11, s9) => M(M8(t11, e11, s9));
  1165. this._dynamicPropertyMap.set("_angle", t10);
  1166. } else
  1167. this._angle = M(M8) || 0;
  1168. if (r(a7.effects)) {
  1169. const t10 = a7.effects;
  1170. c4(t10) ? this._dynamicPropertyMap.set("_effects", t10) : this._effects = t10;
  1171. }
  1172. this._cimFillLayer = a7, this._bitset = (a7.colorLocked ? nt2 : 0) | (a7.applyRandomOffset ? vt : 0) | (a7.sampleAlphaOnly ? gt : 0), this._fillMaterialKey = a7.materialKey;
  1173. }
  1174. static fromCIMFill(t10, e11) {
  1175. const [s9, i12] = x3(t10.scaleInfo, e11);
  1176. return new M3(t10, s9, i12);
  1177. }
  1178. bindFeature(t10, s9, i12) {
  1179. const o11 = t10.readLegacyFeature();
  1180. this._dynamicPropertyMap.forEach((t11, e11) => {
  1181. this[e11] = t11(o11, s9, i12);
  1182. });
  1183. const r13 = w2.load(this._fillMaterialKey), l7 = this._materialCache, n10 = (0, this._cimFillLayer.materialHash)(o11, s9, i12), m5 = l7.get(n10);
  1184. let p9 = null;
  1185. if (m5 && e9(m5.spriteMosaicItem) && (p9 = m5.spriteMosaicItem), p9) {
  1186. const { rect: t11, width: s10, height: i13 } = p9, o12 = t11.x + et, l8 = t11.y + et, n11 = o12 + s10, f14 = l8 + i13;
  1187. let m6 = Math.round(u(this._height));
  1188. m6 <= 0 && (m6 = f14 - l8);
  1189. let _5 = Math.round(u(this._height / i13 * s10 || 0));
  1190. _5 <= 0 && (_5 = n11 - o12);
  1191. const y7 = this._scaleX, d7 = 1;
  1192. this.tl = w(o12, l8), this.br = w(n11, f14), this.aux21 = w(_5, m6), this.aux22 = w(this._offsetX, this._offsetY), this.aux3 = x(y7 * u8, d7 * u8, this._angle, 0), r13.sdf = p9.sdf, r13.pattern = true, r13.textureBinding = p9.textureBinding;
  1193. } else
  1194. this.tl = 0, this.br = 0, this.aux21 = 0, this.aux22 = 0, this.aux3 = 0, r13.sdf = false, r13.pattern = false, r13.textureBinding = 0;
  1195. this._materialKey = r13.data;
  1196. }
  1197. };
  1198. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicLineTemplate.js
  1199. var y4 = class extends f10(r10) {
  1200. constructor(a7, n10, p9) {
  1201. super(a7), this._minMaxZoom = w(Math.round(n10 * at), Math.round(p9 * at)), this._cimLineLayer = a7;
  1202. let _5 = 0;
  1203. c4(a7.width) || (_5 = 0.5 * u(a7.width));
  1204. const f14 = (t10, i12, s9) => c4(a7.width) ? 0.5 * u(a7.width(t10, i12, s9)) : _5;
  1205. this._dynamicPropertyMap.set("_halfWidth", f14), c4(a7.cap) ? this._dynamicPropertyMap.set("_capType", a7.cap) : this._capType = a7.cap, c4(a7.join) ? this._dynamicPropertyMap.set("_joinType", a7.join) : this._joinType = a7.join;
  1206. const d7 = a7.color;
  1207. if (c4(d7)) {
  1208. const t10 = (t11, e11, s9) => f3(d7(t11, e11, s9));
  1209. this._dynamicPropertyMap.set("_fillColor", t10);
  1210. } else
  1211. this._fillColor = d7 && f3(d7) || 0;
  1212. const y7 = a7.miterLimit;
  1213. if (c4(y7)) {
  1214. const t10 = (t11, e11, i12) => e7(y7(t11, e11, i12));
  1215. this._dynamicPropertyMap.set("_miterLimitCosine", t10);
  1216. } else
  1217. this._miterLimitCosine = e7(y7);
  1218. if (r(a7.effects)) {
  1219. const t10 = a7.effects;
  1220. c4(t10) ? this._dynamicPropertyMap.set("_effects", t10) : this._effects = t10;
  1221. }
  1222. this._scaleFactor = a7.scaleFactor || 1, this._isDashed = null != a7.dashTemplate;
  1223. const P4 = a7.colorLocked ? nt2 : 0, u12 = a7.scaleDash ? lt : 0, j7 = a7.sampleAlphaOnly ? gt : 0;
  1224. this.tessellationProperties._bitset = P4 | u12 | j7, this._materialKey = a7.materialKey, this._initializeTessellator(true);
  1225. }
  1226. static fromCIMLine(t10, e11) {
  1227. const [i12, s9] = x3(t10.scaleInfo, e11);
  1228. return new y4(t10, i12, s9);
  1229. }
  1230. bindFeature(t10, e11, i12) {
  1231. const s9 = t10.readLegacyFeature();
  1232. this._dynamicPropertyMap.forEach((t11, r14) => {
  1233. this[r14] = t11(s9, e11, i12);
  1234. }), this._halfWidth *= this._scaleFactor;
  1235. const r13 = this._materialCache, o11 = (0, this._cimLineLayer.materialHash)(s9, e11, i12), l7 = r13.get(o11);
  1236. let c9 = null;
  1237. if (l7 && e9(l7.spriteMosaicItem) && (c9 = l7.spriteMosaicItem), c9) {
  1238. this._hasPattern = true;
  1239. const { rect: t11, width: e12, height: i13 } = c9, s10 = t11.x + et, r14 = t11.y + et, o12 = s10 + e12, l8 = r14 + i13;
  1240. this.tessellationProperties._tl = w(s10, r14), this.tessellationProperties._br = w(o12, l8);
  1241. } else
  1242. this._hasPattern = false, this.tessellationProperties._tl = 0, this.tessellationProperties._br = 0;
  1243. this.tessellationProperties._fillColor = this._fillColor, this.tessellationProperties._halfWidth = this._halfWidth, this.tessellationProperties.offset = 0, this.tessellationProperties._halfReferenceWidth = this.tessellationProperties._halfWidth;
  1244. const m5 = C.load(this._materialKey);
  1245. c9 && (m5.sdf = c9.sdf, m5.pattern = true, m5.textureBinding = c9.textureBinding), this._materialKey = m5.data;
  1246. }
  1247. };
  1248. // node_modules/@arcgis/core/symbols/cim/placements/CIMMarkerPlacementHelper.js
  1249. var e10 = class {
  1250. static getPlacement(e11, o11, s9, c9) {
  1251. const n10 = g(o11);
  1252. if (!n10)
  1253. return null;
  1254. const m5 = a3(e11);
  1255. return n10.execute(m5, o11, s9, c9);
  1256. }
  1257. };
  1258. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js
  1259. var g5 = 3.14159265359 / 180;
  1260. var y5 = 8;
  1261. var u9 = (u12) => class extends u12 {
  1262. constructor(...t10) {
  1263. super(...t10), this.angle = 0, this.xOffset = 0, this.yOffset = 0, this.width = 0, this.height = 0, this.boundsType = "square", this._anchorX = 0, this._anchorY = 0, this._computedWidth = 0, this._computedHeight = 0, this._vertexBoundsScaleX = 1, this._vertexBoundsScaleY = 1, this._offsets = { xUpperLeft: 0, yUpperLeft: 0, xUpperRight: 0, yUpperRight: 0, xBottomLeft: 0, yBottomLeft: 0, xBottomRight: 0, yBottomRight: 0 }, this.geometryType = E.MARKER;
  1264. }
  1265. _write(t10, e11, i12, r13) {
  1266. const s9 = e11.getDisplayId();
  1267. t10.recordStart(s9, this._materialKey, this.geometryType, true), this._writeGeometry(t10, e11, s9, i12, r13), t10.recordEnd();
  1268. }
  1269. _writeGeometry(i12, r13, s9, o11, h5) {
  1270. if (r(this._markerPlacement))
  1271. return this._writePlacedMarkers(i12, r13, o11, h5);
  1272. if (!h5 && "esriGeometryPoint" === r13.geometryType) {
  1273. const t10 = r13.getX(), e11 = r13.getY();
  1274. if (!i12.hasAggregates && i12.hasPixelBufferEnabled && (t10 < 0 || t10 >= 513 || e11 < 0 || e11 >= 513))
  1275. return;
  1276. return this._writeVertices(i12, s9, this._getPos(t10, e11), t10, e11);
  1277. }
  1278. const f14 = h5 ? Gt(nt(h5), 2) : "esriGeometryPolygon" === r13.geometryType ? r13.readCentroid() : r13.readGeometryForDisplay();
  1279. if (!t(f14)) {
  1280. if (f14.isPoint) {
  1281. const [t10, e11] = f14.coords;
  1282. if (!i12.hasAggregates && i12.hasPixelBufferEnabled && (t10 < 0 || t10 >= 512 || e11 < 0 || e11 >= 512))
  1283. return;
  1284. return this._writeVertices(i12, s9, this._getPos(t10, e11), t10, e11);
  1285. }
  1286. f14.forEachVertex((t10, e11) => {
  1287. const r14 = 2 * o3;
  1288. t10 < -r14 || t10 >= r14 || e11 < -r14 || e11 >= r14 || this._writeVertices(i12, s9, this._getPos(t10, e11), t10, e11);
  1289. });
  1290. }
  1291. }
  1292. _writePlacedMarkers(t10, e11, s9, o11) {
  1293. const f14 = o11 != null ? o11 : e11.readLegacyGeometryForDisplay(), n10 = e10.getPlacement(f14, e(this._markerPlacement), u(1), s9.geometryEngine);
  1294. if (!n10)
  1295. return;
  1296. const x10 = e11.getDisplayId(), m5 = n4(), _5 = n3(), c9 = -128, l7 = 640;
  1297. let v5 = n10.next();
  1298. for (; null != v5; ) {
  1299. const e12 = v5.tx, i12 = -v5.ty;
  1300. e12 >= c9 && e12 <= l7 && i12 >= c9 && i12 <= l7 && (this._applyTransformation(_5, m5, -v5.getAngle() / g5), this._writeVertices(t10, x10, this._getPos(e12, i12), e12, i12)), v5 = n10.next();
  1301. }
  1302. }
  1303. _writeVertices(t10, e11, i12, r13, s9) {
  1304. const o11 = N.load(this._materialKey);
  1305. return o11.symbologyType === S.HEATMAP ? this._writeHeatmapVertices(t10, e11, i12) : this._writeMarkerVertices(t10, e11, o11, i12, r13, s9);
  1306. }
  1307. _writeMarkerVertices(t10, e11, i12, r13, s9, o11) {
  1308. const h5 = i12.vvRotation, f14 = t10.vertexCount();
  1309. let n10 = this._computedWidth * this._vertexBoundsScaleX, x10 = this._computedHeight * this._vertexBoundsScaleY;
  1310. if (this.angle) {
  1311. const t11 = Math.max(n10, x10);
  1312. n10 = t11, x10 = t11;
  1313. }
  1314. if (h5) {
  1315. const t11 = Math.max(this.xOffset, this.yOffset);
  1316. n10 += t11, x10 += t11;
  1317. }
  1318. t10.vertexBounds(s9 + this.xOffset, o11 - this.yOffset, n10, x10), t10.vertexWrite(r13), t10.vertexWrite(this._offsetUpperLeft), t10.vertexWrite(this._texUpperLeft), t10.vertexWrite(this._bitestAndDistRatio), t10.vertexWrite(e11), t10.vertexWrite(this._fillColor), t10.vertexWrite(this._outlineColor), t10.vertexWrite(this._sizeOutlineWidth), t10.vertexWrite(this._minMaxZoom), t10.vertexEnd(), t10.vertexWrite(r13), t10.vertexWrite(this._offsetUpperRight), t10.vertexWrite(this._texUpperRight), t10.vertexWrite(this._bitestAndDistRatio), t10.vertexWrite(e11), t10.vertexWrite(this._fillColor), t10.vertexWrite(this._outlineColor), t10.vertexWrite(this._sizeOutlineWidth), t10.vertexWrite(this._minMaxZoom), t10.vertexEnd(), t10.vertexWrite(r13), t10.vertexWrite(this._offsetBottomLeft), t10.vertexWrite(this._texBottomLeft), t10.vertexWrite(this._bitestAndDistRatio), t10.vertexWrite(e11), t10.vertexWrite(this._fillColor), t10.vertexWrite(this._outlineColor), t10.vertexWrite(this._sizeOutlineWidth), t10.vertexWrite(this._minMaxZoom), t10.vertexEnd(), t10.vertexWrite(r13), t10.vertexWrite(this._offsetBottomRight), t10.vertexWrite(this._texBottomRight), t10.vertexWrite(this._bitestAndDistRatio), t10.vertexWrite(e11), t10.vertexWrite(this._fillColor), t10.vertexWrite(this._outlineColor), t10.vertexWrite(this._sizeOutlineWidth), t10.vertexWrite(this._minMaxZoom), t10.vertexEnd(), this._writeIndices(t10, f14);
  1319. }
  1320. _writeHeatmapVertices(t10, e11, i12) {
  1321. const r13 = t10.vertexCount();
  1322. t10.vertexWrite(i12), t10.vertexWrite(this._offsetUpperLeft), t10.vertexWrite(e11), t10.vertexEnd(), t10.vertexWrite(i12), t10.vertexWrite(this._offsetUpperRight), t10.vertexWrite(e11), t10.vertexEnd(), t10.vertexWrite(i12), t10.vertexWrite(this._offsetBottomLeft), t10.vertexWrite(e11), t10.vertexEnd(), t10.vertexWrite(i12), t10.vertexWrite(this._offsetBottomRight), t10.vertexWrite(e11), t10.vertexEnd(), this._writeIndices(t10, r13);
  1323. }
  1324. _writeIndices(t10, e11) {
  1325. t10.indexWrite(e11 + 0), t10.indexWrite(e11 + 1), t10.indexWrite(e11 + 2), t10.indexWrite(e11 + 1), t10.indexWrite(e11 + 3), t10.indexWrite(e11 + 2);
  1326. }
  1327. _applyTransformation(t10, e11, i12 = 0) {
  1328. f5(t10, t3(this.xOffset, -this.yOffset)), this.angle + i12 !== 0 && e5(t10, t10, g5 * (this.angle + i12));
  1329. const r13 = this._computedWidth, h5 = this._computedHeight, a7 = -(0.5 + this._anchorX) * r13, m5 = -(0.5 - this._anchorY) * h5;
  1330. r3(e11, a7, m5), z(e11, e11, t10), this._offsetUpperLeft = w(16 * e11[0], 16 * e11[1]), this._offsets.xUpperLeft = e11[0], this._offsets.yUpperLeft = e11[1], r3(e11, a7 + r13, m5), z(e11, e11, t10), this._offsetUpperRight = w(16 * e11[0], 16 * e11[1]), this._offsets.xUpperRight = e11[0], this._offsets.yUpperRight = e11[1], r3(e11, a7, m5 + h5), z(e11, e11, t10), this._offsetBottomLeft = w(16 * e11[0], 16 * e11[1]), this._offsets.xBottomLeft = e11[0], this._offsets.yBottomLeft = e11[1], r3(e11, a7 + r13, m5 + h5), z(e11, e11, t10), this._offsetBottomRight = w(16 * e11[0], 16 * e11[1]), this._offsets.xBottomRight = e11[0], this._offsets.yBottomRight = e11[1];
  1331. }
  1332. _getPos(t10, e11) {
  1333. return w(Math.round(y5 * t10), Math.round(y5 * e11));
  1334. }
  1335. };
  1336. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicMarkerTemplate.js
  1337. var g6 = n4();
  1338. var k3 = n3();
  1339. var P2 = class extends u9(r10) {
  1340. constructor(t10, e11, o11) {
  1341. super(t10), this._cimMarkerLayer = t10, this._minMaxZoom = w(Math.round(e11 * at), Math.round(o11 * at));
  1342. const a7 = t10.color;
  1343. if (c4(a7)) {
  1344. const t11 = (t12, e12, i12) => f3(a7(t12, e12, i12));
  1345. this._dynamicPropertyMap.set("_fillColor", t11);
  1346. } else
  1347. this._fillColor = f3(a7);
  1348. const n10 = t10.outlineColor;
  1349. if (c4(n10)) {
  1350. const t11 = (t12, e12, i12) => f3(n10(t12, e12, i12));
  1351. this._dynamicPropertyMap.set("_outlineColor", t11);
  1352. } else
  1353. this._outlineColor = f3(n10);
  1354. const f14 = t10.size;
  1355. if (c4(f14)) {
  1356. const t11 = (t12, e12, i12) => u(f14(t12, e12, i12));
  1357. this._dynamicPropertyMap.set("_size", t11);
  1358. } else
  1359. this._size = u(f14) || 0;
  1360. const _5 = t10.scaleX;
  1361. c4(_5) ? this._dynamicPropertyMap.set("_scaleX", _5) : this._scaleX = _5;
  1362. const y7 = t10.offsetX;
  1363. if (c4(y7)) {
  1364. const t11 = (t12, e12, i12) => u(y7(t12, e12, i12));
  1365. this._dynamicPropertyMap.set("xOffset", t11);
  1366. } else
  1367. this.xOffset = u(y7) || 0;
  1368. const d7 = t10.offsetY;
  1369. if (c4(d7)) {
  1370. const t11 = (t12, e12, i12) => u(d7(t12, e12, i12));
  1371. this._dynamicPropertyMap.set("yOffset", t11);
  1372. } else
  1373. this.yOffset = u(d7) || 0;
  1374. const M8 = t10.outlineWidth;
  1375. if (c4(M8)) {
  1376. const t11 = (t12, e12, i12) => u(M8(t12, e12, i12));
  1377. this._dynamicPropertyMap.set("_outlineWidth", t11);
  1378. } else
  1379. this._outlineWidth = u(M8) || 0;
  1380. const u12 = t10.rotation;
  1381. if (c4(u12) ? this._dynamicPropertyMap.set("_angle", u12) : this._angle = u12 || 0, r(t10.effects)) {
  1382. const e12 = t10.effects;
  1383. c4(e12) ? this._dynamicPropertyMap.set("_effects", e12) : this._effects = e12;
  1384. }
  1385. if (r(t10.markerPlacement)) {
  1386. const e12 = t10.markerPlacement;
  1387. c4(e12) ? this._dynamicPropertyMap.set("_markerPlacement", e12) : this._markerPlacement = e12;
  1388. }
  1389. this._scaleFactor = i(t10.scaleFactor, 1), this._bitSet = (t10.alignment === i3.MAP ? 1 : 0) | (t10.colorLocked ? 1 : 0) << 1 | (t10.scaleSymbolsProportionally ? 1 : 0) << 3, this._materialKey = t10.materialKey;
  1390. }
  1391. static fromCIMMarker(t10, e11) {
  1392. const [i12, s9] = x3(t10.scaleInfo, e11);
  1393. return new P2(t10, i12, s9);
  1394. }
  1395. bindFeature(i12, s9, o11) {
  1396. const a7 = i12.readLegacyFeature(), h5 = i12.getObjectId();
  1397. this._dynamicPropertyMap.forEach((t10, e11) => {
  1398. this[e11] = t10(a7, s9, o11);
  1399. });
  1400. const c9 = this._cimMarkerLayer.materialHash, m5 = "function" == typeof c9 ? c9(a7, s9, o11, h5) : c9, p9 = this._materialCache.get(m5);
  1401. if (!p9 || !e9(p9.spriteMosaicItem) || !p9.spriteMosaicItem)
  1402. return void s.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new s2("mapview-cim", "Encountered an error when binding feature"));
  1403. const y7 = p9.spriteMosaicItem, d7 = this._cimMarkerLayer.sizeRatio, M8 = y7.width / y7.height * this._scaleX, P4 = this._cimMarkerLayer.rotateClockwise ? this._angle : -this._angle;
  1404. let L3 = this._size, x10 = L3 * M8;
  1405. const j7 = this.xOffset, b6 = this.yOffset;
  1406. this.xOffset *= this._scaleFactor, this.yOffset *= this._scaleFactor;
  1407. const O3 = this._cimMarkerLayer.scaleSymbolsProportionally && this._cimMarkerLayer.frameHeight ? this._size / u(this._cimMarkerLayer.frameHeight) : 1, w7 = this._outlineWidth * O3, z4 = u(this._cimMarkerLayer.referenceSize);
  1408. let W = 0, C4 = 0;
  1409. const F2 = this._cimMarkerLayer.anchorPoint;
  1410. F2 && (this._cimMarkerLayer.isAbsoluteAnchorPoint ? this._size && (W = u(F2.x) / (this._size * M8), C4 = u(F2.y) / this._size) : (W = F2.x, C4 = F2.y)), this._anchorX = W, this._anchorY = C4, this._sizeOutlineWidth = x(Math.round(Math.min(Math.sqrt(128 * x10), 255)), Math.round(Math.min(Math.sqrt(128 * L3), 255)), Math.round(Math.min(Math.sqrt(128 * w7), 255)), Math.round(Math.min(Math.sqrt(128 * z4), 255))), this.angle = P4;
  1411. const I2 = Math.round(64 * d7);
  1412. this._bitestAndDistRatio = w(this._bitSet, I2);
  1413. const K2 = y7.rect.x + et, X2 = y7.rect.y + et, B2 = K2 + y7.width, R = X2 + y7.height;
  1414. this._texUpperLeft = w(K2, X2), this._texUpperRight = w(B2, X2), this._texBottomLeft = w(K2, R), this._texBottomRight = w(B2, R);
  1415. const S4 = N.load(this._materialKey);
  1416. S4.sdf = y7.sdf, S4.pattern = true, S4.textureBinding = y7.textureBinding, this._materialKey = S4.data, x10 *= d7, L3 *= d7, x10 *= this._scaleFactor, L3 *= this._scaleFactor, x10 *= y7.rect.width / y7.width, L3 *= y7.rect.height / y7.height, this._computedWidth = x10, this._computedHeight = L3, this._applyTransformation(k3, g6), this.xOffset = j7, this.yOffset = b6;
  1417. }
  1418. };
  1419. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js
  1420. var f12 = 8;
  1421. var _4 = (_5) => class extends _5 {
  1422. constructor(...e11) {
  1423. super(...e11), this._isCIM = false, this._vertexBoundsScale = 1, this.geometryType = E.TEXT, this._aux = x(0, 0, this._referenceSize, this._bitset);
  1424. }
  1425. bindTextInfo(t10, i12) {
  1426. t10 && t10.length ? this._shapingInfo = o(t10, (e11) => j3(e11, i12, { scale: this._scale, angle: this._angle, xOffset: this._xOffset, yOffset: this._yOffset, hAlign: this._xAlignD, vAlign: this._yAlignD, maxLineWidth: Math.max(32, Math.min(this._lineWidth, 512)), lineHeight: f * Math.max(0.25, Math.min(this._lineHeight, 4)), decoration: this._decoration, isCIM: this._isCIM })) : this._shapingInfo = null;
  1427. }
  1428. _write(e11, t10, i12, r13) {
  1429. const s9 = t10.getDisplayId();
  1430. this._writeGeometry(e11, t10, s9, i12, r13);
  1431. }
  1432. _writeGeometry(e11, r13, s9, h5, a7) {
  1433. const x10 = this._shapingInfo;
  1434. if (t(x10))
  1435. return;
  1436. if (r(this._textPlacement)) {
  1437. const t10 = a7 != null ? a7 : r13.readLegacyGeometryForDisplay();
  1438. return this._writePlacedText(e11, s9, t10, x10, h5);
  1439. }
  1440. const l7 = a7 ? Gt(nt(a7), 2) : "esriGeometryPolygon" === r13.geometryType ? r13.readCentroid() : r13.readGeometryForDisplay();
  1441. if (!t(l7)) {
  1442. if (l7.isPoint) {
  1443. const [t10, i12] = l7.coords;
  1444. if (!e11.hasAggregates && e11.hasPixelBufferEnabled && (t10 < 0 || t10 >= 512 || i12 < 0 || i12 >= 512))
  1445. return;
  1446. return this._writeGlyphs(e11, s9, { x: t10, y: i12 }, x10);
  1447. }
  1448. l7.forEachVertex((t10, i12) => this._writeGlyphs(e11, s9, { x: t10, y: i12 }, x10));
  1449. }
  1450. }
  1451. _writePlacedText(e11, t10, i12, o11, n10) {
  1452. const a7 = e(this._textPlacement), x10 = e10.getPlacement(i12, a7, u(1), n10.geometryEngine);
  1453. if (!x10)
  1454. return;
  1455. let l7 = x10.next();
  1456. for (; null != l7; ) {
  1457. const i13 = -l7.getAngle();
  1458. o11.setRotation(i13);
  1459. const r13 = l7.tx, s9 = -l7.ty;
  1460. r13 < 0 || r13 >= 512 || s9 < 0 || s9 >= 512 ? l7 = x10.next() : (this._writeGlyphs(e11, t10, { x: r13, y: s9 }, o11), o11.setRotation(-i13), l7 = x10.next());
  1461. }
  1462. }
  1463. _writeGlyphs(e11, t10, i12, r13) {
  1464. const s9 = U.load(this._materialKey), o11 = w(Math.round(f12 * i12.x), Math.round(f12 * i12.y)), n10 = this._vertexBoundsScale, h5 = r13.bounds, a7 = 2 * Math.max(h5.width, h5.height);
  1465. for (const x10 of r13.glyphs)
  1466. s9.textureBinding = x10.textureBinding, e11.recordStart(t10, s9.data, this.geometryType, true), e11.vertexBounds(i12.x + h5.x + this._xOffset, i12.y + h5.y - this._yOffset, a7 * n10, a7 * n10), this._writeVertices(e11, t10, o11, x10), e11.recordEnd();
  1467. }
  1468. _writeGlyph(e11, t10, i12, r13, s9) {
  1469. const o11 = U.load(this._materialKey), n10 = w(Math.round(f12 * i12), Math.round(f12 * r13));
  1470. o11.textureBinding = s9.textureBinding, e11.recordStart(t10, o11.data, this.geometryType, true);
  1471. const h5 = s9.bounds, a7 = this._vertexBoundsScale;
  1472. e11.vertexBounds(i12 + h5.x * a7, r13 + h5.y * a7, h5.width * a7, h5.height * a7), this._writeVertices(e11, t10, n10, s9), e11.recordEnd();
  1473. }
  1474. _writeVertices(e11, t10, i12, r13) {
  1475. const s9 = e11.vertexCount();
  1476. this._writeVertexCommon(e11, t10, i12, r13), e11.vertexWrite(r13.offsets.upperLeft), e11.vertexWrite(r13.texcoords.upperLeft), e11.vertexEnd(), this._writeVertexCommon(e11, t10, i12, r13), e11.vertexWrite(r13.offsets.upperRight), e11.vertexWrite(r13.texcoords.upperRight), e11.vertexEnd(), this._writeVertexCommon(e11, t10, i12, r13), e11.vertexWrite(r13.offsets.lowerLeft), e11.vertexWrite(r13.texcoords.lowerLeft), e11.vertexEnd(), this._writeVertexCommon(e11, t10, i12, r13), e11.vertexWrite(r13.offsets.lowerRight), e11.vertexWrite(r13.texcoords.lowerRight), e11.vertexEnd(), e11.indexWrite(s9 + 0), e11.indexWrite(s9 + 1), e11.indexWrite(s9 + 2), e11.indexWrite(s9 + 1), e11.indexWrite(s9 + 3), e11.indexWrite(s9 + 2);
  1477. }
  1478. _writeVertexCommon(e11, t10, i12, r13) {
  1479. const s9 = this._color, o11 = this._haloColor, n10 = x(0, 0, this._referenceSize, this._bitset), h5 = x(0, 0, this._size, this._haloSize);
  1480. e11.vertexWrite(i12), e11.vertexWrite(t10), e11.vertexWrite(s9), e11.vertexWrite(o11), e11.vertexWrite(h5), e11.vertexWrite(n10), e11.vertexWrite(this._minMaxZoom);
  1481. }
  1482. };
  1483. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLDynamicTextTemplate.js
  1484. var M4 = 5;
  1485. function d4(t10, e11, i12, s9) {
  1486. return "string" == typeof t10.text ? t10.text : "function" == typeof t10.text ? t10.text(e11, i12, s9) : "";
  1487. }
  1488. var g7 = class extends _4(r10) {
  1489. constructor(e11, o11, a7) {
  1490. super(e11), this._horizontalAlignment = "center", this._verticalAlignment = "middle", this._textToGlyphs = /* @__PURE__ */ new Map(), this._minMaxZoom = w(Math.round(o11 * at), Math.round(a7 * at));
  1491. const r13 = e11.scaleFactor || 1;
  1492. this._cimTextLayer = e11;
  1493. const _5 = e11.color;
  1494. if (c4(_5)) {
  1495. const t10 = (t11, e12, i12) => f3(_5(t11, e12, i12));
  1496. this._dynamicPropertyMap.set("_color", t10);
  1497. } else
  1498. this._color = f3(_5);
  1499. const f14 = e11.outlineColor;
  1500. if (c4(f14)) {
  1501. const t10 = (t11, e12, i12) => f3(f14(t11, e12, i12));
  1502. this._dynamicPropertyMap.set("_haloColor", t10);
  1503. } else
  1504. this._haloColor = f3(f14);
  1505. let y7;
  1506. c4(e11.size) || (y7 = Math.min(Math.round(u(e11.size * e11.sizeRatio)), 127));
  1507. const p9 = (t10, s9, o12) => c4(e11.size) ? Math.min(Math.round(u(e11.size(t10, s9, o12) * e11.sizeRatio)), 127) : y7;
  1508. if (this._dynamicPropertyMap.set("_size", p9), c4(e11.outlineSize)) {
  1509. const t10 = (t11, s9, o12) => Math.min(Math.floor(M4 * u(e11.outlineSize(t11, s9, o12) * e11.sizeRatio)), 127);
  1510. this._dynamicPropertyMap.set("_haloSize", t10);
  1511. } else
  1512. this._haloSize = Math.min(Math.floor(M4 * u(e11.outlineSize * e11.sizeRatio)), 127);
  1513. let d7;
  1514. c4(e11.offsetX) || (d7 = Math.round(u(e11.offsetX * e11.sizeRatio)));
  1515. const g9 = (t10, s9, o12) => c4(e11.offsetX) ? Math.round(u(e11.offsetX(t10, s9, o12) * e11.sizeRatio)) : d7;
  1516. let u12;
  1517. this._dynamicPropertyMap.set("_xOffset", g9), c4(e11.offsetY) || (u12 = Math.round(u(e11.offsetY * e11.sizeRatio)));
  1518. const z4 = (t10, s9, o12) => c4(e11.offsetY) ? Math.round(u(e11.offsetY(t10, s9, o12) * e11.sizeRatio)) : u12;
  1519. if (this._dynamicPropertyMap.set("_yOffset", z4), c4(e11.angle) ? this._dynamicPropertyMap.set("_angle", e11.angle) : this._angle = e11.angle, c4(e11.horizontalAlignment) ? this._dynamicPropertyMap.set("_horizontalAlignment", e11.horizontalAlignment) : this._horizontalAlignment = e11.horizontalAlignment, c4(e11.verticalAlignment) ? this._dynamicPropertyMap.set("_verticalAlignment", e11.verticalAlignment) : this._verticalAlignment = e11.verticalAlignment, r(e11.effects)) {
  1520. const t10 = e11.effects;
  1521. c4(t10) ? this._dynamicPropertyMap.set("_effects", t10) : this._effects = t10;
  1522. }
  1523. if (r(e11.markerPlacement)) {
  1524. const t10 = e11.markerPlacement;
  1525. c4(t10) ? this._dynamicPropertyMap.set("_markerPlacement", t10) : this._textPlacement = t10;
  1526. }
  1527. c4(e11.text) ? this._dynamicPropertyMap.set("_text", e11.text) : this._text = e11.text, this._scaleFactor = r13;
  1528. const x10 = Math.min(Math.round(u(e11.referenceSize * e11.sizeRatio)), 127);
  1529. this._referenceSize = Math.round(Math.sqrt(256 * x10)), this._materialKey = e11.materialKey;
  1530. const P4 = P.load(this._materialKey);
  1531. P4.sdf = true, this._bitset = (e11.alignment === i3.MAP ? 1 : 0) | (e11.colorLocked ? 1 : 0) << 1, this._materialKey = P4.data, this._decoration = "none", this._lineHeight = 1, this._lineWidth = 512, this._isCIM = true;
  1532. }
  1533. static fromCIMText(t10, e11) {
  1534. const [i12, s9] = x3(t10.scaleInfo, e11);
  1535. return new g7(t10, i12, s9);
  1536. }
  1537. async analyze(t10, e11, i12, s9) {
  1538. const o11 = e11.readLegacyFeature(), a7 = d4(this._cimTextLayer, o11, i12, s9), n10 = await super.analyze(t10, e11, i12, s9, t7(a7));
  1539. return n10 && n10.glyphMosaicItems && this._textToGlyphs.set(a7, n10.glyphMosaicItems), n10;
  1540. }
  1541. bindFeature(t10, i12, s9) {
  1542. const n10 = t10.readLegacyFeature();
  1543. if (this._dynamicPropertyMap.forEach((t11, e11) => {
  1544. this[e11] = t11(n10, i12, s9);
  1545. }), !this._text || 0 === this._text.length)
  1546. return void (this._shapingInfo = null);
  1547. this._size *= this._scaleFactor, this._scale = this._size / j2, this._xOffset *= this._scaleFactor, this._yOffset *= this._scaleFactor, this._xAlignD = r5(i(this._horizontalAlignment, "center")), this._yAlignD = n2(i(this._verticalAlignment, "baseline"));
  1548. const l7 = this._textToGlyphs.get(this._text);
  1549. this.bindTextInfo(l7, false);
  1550. }
  1551. };
  1552. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js
  1553. var M5 = 128;
  1554. var j5 = class extends _3(r9) {
  1555. constructor(t10, e11, i12, r13, o11, s9, l7, n10, m5, u12, d7, p9, y7, x10, M8, j7) {
  1556. super(), this._effects = x10;
  1557. const w7 = w2.load(t10);
  1558. e11 && (w7.sdf = e11.sdf, w7.pattern = true, w7.textureBinding = e11.textureBinding), this.fillColor = i12, this.tl = r13, this.br = o11, this.aux21 = w(s9, l7), this.aux22 = w(n10, m5), this.aux3 = x(u12, d7, p9, 0), this._bitset = y7, this._minMaxZoom = w(Math.round(M8 * at), Math.round(j7 * at)), this._materialKey = w7.data;
  1559. }
  1560. static fromCIMFill(e11, a7, n10) {
  1561. const c9 = e11.color, h5 = c9 && f3(c9) || 0, d7 = e11.materialKey, [p9, y7] = x3(e11.scaleInfo, n10), x10 = (e11.colorLocked ? nt2 : 0) | (e11.applyRandomOffset ? vt : 0) | (e11.sampleAlphaOnly ? gt : 0);
  1562. if (!a7)
  1563. return new j5(d7, null, h5, 0, 0, 0, 0, 0, 0, 0, 0, 0, x10, e11.effects, p9, y7);
  1564. const { rect: w7, width: g9, height: K2 } = a7, _5 = e11.scaleX || 1, b6 = w7.x + et, F2 = w7.y + et, L3 = b6 + g9, T = F2 + K2, A3 = u(e11.height), B2 = _5 * A3;
  1565. let G4 = Math.round(A3);
  1566. G4 <= 0 && (G4 = T - F2);
  1567. let S4 = Math.round(B2);
  1568. S4 <= 0 && (S4 = L3 - b6);
  1569. const C4 = u(e11.offsetX || 0), I2 = u(-e11.offsetY || 0), O3 = w(b6, F2), R = w(L3, T);
  1570. return new j5(d7, a7, h5, O3, R, S4, G4, C4, I2, M5, M5, M(e11.angle), x10, e11.effects, p9, y7);
  1571. }
  1572. static fromSimpleFill(t10, i12, o11 = false) {
  1573. const { color: s9 } = t10, a7 = s9 && "esriSFSNull" !== t10.style && s4(s9) || 0, n10 = o11 ? nt2 : 0, m5 = t10.materialKey;
  1574. let c9;
  1575. if (i12) {
  1576. const { rect: t11, width: e11, height: r13, pixelRatio: o12 } = i12, s10 = t11.x + et, h5 = t11.y + et, u12 = s10 + e11, y7 = h5 + r13, x10 = w(s10, h5), w7 = w(u12, y7);
  1577. c9 = new j5(m5, i12, a7, x10, w7, e11 / o12, r13 / o12, 0, 0, M5, M5, 0, n10, null, n7, o8);
  1578. } else
  1579. c9 = new j5(m5, null, a7, 0, 0, 0, 0, 0, 0, 0, 0, 0, n10, null, n7, o8);
  1580. return c9._maybeAddLineTemplate(t10), c9;
  1581. }
  1582. static fromPictureFill(e11, i12, o11 = false) {
  1583. const s9 = i2, { rect: a7, width: m5, height: c9 } = i12, h5 = a7.x + et, u12 = a7.y + et, y7 = h5 + m5, x10 = u12 + c9, w7 = w(h5, u12), g9 = w(y7, x10), K2 = Math.round(u(e11.width)), _5 = Math.round(u(e11.height)), b6 = u(e11.xoffset), F2 = u(-e11.yoffset), L3 = e11.materialKey, T = o11 ? nt2 : 0, A3 = new j5(L3, i12, s9, w7, g9, K2, _5, b6, F2, M5 * e11.xscale, M5 * e11.yscale, 0, T, null, n7, o8);
  1584. return A3._maybeAddLineTemplate(e11), A3;
  1585. }
  1586. };
  1587. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLMarkerTemplate.js
  1588. var b4 = class extends u9(r9) {
  1589. constructor(t10, e11, r13, a7, n10, p9, S4, g9, V, z4, B2, b6, k5, L3, R, j7, w7, C4, P4, E4, U2, A3, T) {
  1590. super(), this.angle = a7, this.height = S4, this.width = p9, this.xOffset = e11 * P4, this.yOffset = r13 * P4, this._markerPlacement = E4, this._effects = U2, this._anchorX = j7, this._anchorY = w7, this._minMaxZoom = w(Math.round(A3 * at), Math.round(T * at));
  1591. const v5 = (L3 === i3.MAP ? rt : pt) | (B2 ? nt2 : 0) | (k5 ? st : 0) | (b6 ? ft : 0), K2 = R && R.sdf, W = N.load(t10);
  1592. W.sdf = K2, W.pattern = true, W.textureBinding = R.textureBinding, this._materialKey = W.data, this._fillColor = n10, this._outlineColor = V, this._sizeOutlineWidth = x(Math.round(Math.min(Math.sqrt(128 * p9), 255)), Math.round(Math.min(Math.sqrt(128 * S4), 255)), Math.round(Math.min(Math.sqrt(128 * z4), 255)), Math.round(Math.min(Math.sqrt(128 * g9), 255)));
  1593. const X2 = R.rect.x + et, q2 = R.rect.y + et, Y = X2 + R.width, H = q2 + R.height;
  1594. this._offsets.xUpperLeft = X2, this._offsets.yUpperLeft = q2, this._offsets.xUpperRight = Y, this._offsets.yUpperRight = q2, this._offsets.xBottomLeft = X2, this._offsets.yBottomLeft = H, this._offsets.xBottomRight = Y, this._offsets.yBottomRight = H, W.symbologyType === S.PIE_CHART ? (this._texUpperLeft = w(0, 1), this._texUpperRight = w(1, 1), this._texBottomLeft = w(0, 0), this._texBottomRight = w(1, 0)) : (this._texUpperLeft = w(X2, q2), this._texUpperRight = w(Y, q2), this._texBottomLeft = w(X2, H), this._texBottomRight = w(Y, H)), p9 *= C4, S4 *= C4, p9 *= P4, S4 *= P4;
  1595. const I2 = Math.round(64 * C4);
  1596. this._bitestAndDistRatio = w(v5, I2), this._computedWidth = p9, this._computedHeight = S4;
  1597. const N2 = n4(), O3 = n3();
  1598. this._applyTransformation(O3, N2);
  1599. }
  1600. static fromCIMMarker(o11, s9, r13) {
  1601. const n10 = s9 && s9.width || 1, h5 = s9 && s9.height || 1, l7 = o11.size, m5 = n10 / h5 * o11.scaleX, f14 = o11.scaleSymbolsProportionally && o11.frameHeight ? l7 / o11.frameHeight : 1;
  1602. let c9 = f3(o11.color);
  1603. const u12 = f3(o11.outlineColor), d7 = u(l7), p9 = d7 * m5, x10 = u(o11.offsetX || 0), M8 = u(o11.offsetY || 0), y7 = u(o11.outlineWidth || 0) * f14, _5 = o11.alignment || i3.SCREEN, g9 = u(o11.referenceSize), [V, z4] = x3(o11.scaleInfo, r13);
  1604. s9.sdf || 0 !== c9 || (c9 = -1);
  1605. let B2 = o11.rotation || 0;
  1606. o11.rotateClockwise || (B2 = -B2);
  1607. let k5 = 0, L3 = 0;
  1608. const R = o11.anchorPoint;
  1609. R && (o11.isAbsoluteAnchorPoint ? l7 && (k5 = R.x / (l7 * m5), L3 = R.y / l7) : (k5 = R.x, L3 = R.y));
  1610. const j7 = new b4(o11.materialKey, x10, M8, B2, c9, p9, d7, g9, u12, y7, o11.colorLocked, o11.scaleSymbolsProportionally, false, _5, s9, k5, L3, o11.sizeRatio, i(o11.scaleFactor, 1), o11.markerPlacement, o11.effects, V, z4);
  1611. return j7._vertexBoundsScaleX = o11.maxVVSize ? o11.maxVVSize / p9 : 1, j7._vertexBoundsScaleY = o11.maxVVSize ? o11.maxVVSize / d7 : 1, j7;
  1612. }
  1613. static fromPictureMarker(t10, o11) {
  1614. const s9 = Math.round(u(t10.width)), r13 = Math.round(u(t10.height)), a7 = i2, n10 = Math.round(u(t10.xoffset || 0)), h5 = Math.round(u(t10.yoffset || 0)), l7 = new b4(t10.materialKey, n10, h5, t10.angle, a7, s9, r13, r13, 0, 0, false, false, false, i3.SCREEN, o11, 0, 0, 1, 1, null, null, n7, o8);
  1615. return l7._vertexBoundsScaleX = t10.maxVVSize ? t10.maxVVSize / t10.width : 1, l7._vertexBoundsScaleY = t10.maxVVSize ? t10.maxVVSize / t10.height : 1, l7;
  1616. }
  1617. static fromSimpleMarker(t10, o11) {
  1618. const s9 = s4(t10.color), r13 = Math.round(u(t10.size)), a7 = r13, h5 = Math.round(u(t10.xoffset || 0)), l7 = Math.round(u(t10.yoffset || 0)), m5 = t10.style, f14 = t10.outline, c9 = 0 | (f14 && f14.color && s4(f14.color)), u12 = 0 | (f14 && f14.width && Math.round(u(f14.width))), d7 = new b4(t10.materialKey, h5, l7, t10.angle, s9, r13, a7, a7, c9, u12, false, false, "esriSMSCross" === m5 || "esriSMSX" === m5, i3.SCREEN, o11, 0, 0, 126 / 64, 1, null, null, n7, o8);
  1619. return d7.boundsType = "esriSMSCircle" === m5 ? "circle" : "square", d7._vertexBoundsScaleX = t10.maxVVSize ? t10.maxVVSize / t10.size : 1, d7._vertexBoundsScaleY = t10.maxVVSize ? t10.maxVVSize / t10.size : 1, d7;
  1620. }
  1621. static fromLineSymbolMarker(t10, o11) {
  1622. const s9 = s4(t10.color), a7 = 6, h5 = Math.round(u(a7 * t10.lineWidth)), l7 = h5, m5 = "cross" === t10.style || "x" === t10.style;
  1623. let f14;
  1624. switch (t10.placement) {
  1625. case "begin-end":
  1626. f14 = o4.Both;
  1627. break;
  1628. case "begin":
  1629. f14 = o4.JustBegin;
  1630. break;
  1631. case "end":
  1632. f14 = o4.JustEnd;
  1633. break;
  1634. default:
  1635. f14 = o4.None;
  1636. }
  1637. const c9 = { type: "CIMMarkerPlacementAtExtremities", angleToLine: true, offset: 0, extremityPlacement: f14, offsetAlongLine: 0 }, u12 = new b4(t10.materialKey, 0, 0, 0, s9, h5, l7, l7 / a7, s9, m5 ? Math.round(u(t10.lineWidth)) : 0, false, false, m5, i3.MAP, o11, 0, 0, 126 / 64, 1, c9, null, n7, o8);
  1638. return u12.boundsType = "circle" === t10.style ? "circle" : "square", u12;
  1639. }
  1640. };
  1641. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLTextTemplate.js
  1642. var M6 = 5;
  1643. var p7 = class extends _4(r9) {
  1644. constructor(t10, a7, l7, _5, d7, x10, z4, u12, p9, g9, j7, S4, y7, b6, T, V, A3, C4, I2 = false, K2, R) {
  1645. super(), this._xOffset = u(y7), this._yOffset = u(b6), this._decoration = g9 || "none", this._color = d7, this._haloColor = x10, this._haloSize = Math.min(Math.floor(M6 * u(o2(l7))), 127), this._size = Math.min(Math.round(u(a7)), 127);
  1646. const v5 = Math.min(Math.round(u(_5 || a7)), 127);
  1647. this._referenceSize = Math.round(Math.sqrt(256 * v5)), this._scale = this._size / j2, this._angle = S4, this._justify = s5(z4 || "center"), this._xAlignD = r5(z4 || "center"), this._yAlignD = n2(u12 || "baseline"), this._baseline = "baseline" === (u12 || "baseline"), this._bitset = (p9 === i3.MAP ? 1 : 0) | (j7 ? 1 : 0) << 1;
  1648. const B2 = U.load(t10);
  1649. B2.sdf = true, this._materialKey = B2.data, this._lineWidth = u(T) || 512, this._lineHeight = V || 1, this._textPlacement = A3, this._effects = C4, this._isCIM = I2, this._minMaxZoom = w(Math.round(K2 * at), Math.round(R * at));
  1650. }
  1651. static fromText(e11, i12) {
  1652. const s9 = new p7(e11.materialKey, e11.font.size, e11.haloSize || 0, e11.font.size, e11.color && s4(e11.color) || 0, e11.haloColor && s4(e11.haloColor) || 0, e11.horizontalAlignment, e11.verticalAlignment, i3.SCREEN, e11.font.decoration, false, e11.angle || 0, e11.xoffset, e11.yoffset, e11.lineWidth, e11.lineHeight, null, null, false, n7, o8), [, n10] = n(e11.text);
  1653. return s9.bindTextInfo(i12, n10), s9._vertexBoundsScale = e11.maxVVSize ? e11.maxVVSize / e11.font.size : 1, s9;
  1654. }
  1655. static fromCIMText(e11, i12, o11) {
  1656. const s9 = e11.scaleFactor || 1, n10 = e11.size * e11.sizeRatio * s9, [r13, a7] = x3(e11.scaleInfo, o11), m5 = new p7(e11.materialKey, n10, e11.outlineSize * e11.sizeRatio, e11.referenceSize, f3(e11.color), f3(e11.outlineColor), e11.horizontalAlignment, e11.verticalAlignment, e11.alignment, e11.decoration, e11.colorLocked, e11.angle, e11.offsetX * e11.sizeRatio * s9, e11.offsetY * e11.sizeRatio * s9, 512, 1, e11.markerPlacement, e11.effects, true, r13, a7), [, h5] = n(e11.text);
  1657. return m5.bindTextInfo(i12, h5), m5._vertexBoundsScale = e11.maxVVSize ? e11.maxVVSize / n10 : 1, m5;
  1658. }
  1659. };
  1660. // node_modules/@arcgis/core/views/2d/engine/webgl/util/Lock.js
  1661. var r11 = class {
  1662. constructor() {
  1663. this._resolver = null;
  1664. }
  1665. isHeld() {
  1666. return !!this._resolver;
  1667. }
  1668. async acquire() {
  1669. this._resolver ? (await this._resolver.promise, await this.acquire()) : this._resolver = D();
  1670. }
  1671. release() {
  1672. const e11 = this._resolver;
  1673. this._resolver = null, e11 == null ? void 0 : e11.resolve();
  1674. }
  1675. };
  1676. async function s8(e11, r13, s9) {
  1677. try {
  1678. await e11.acquire(), await r13(s9), e11.release();
  1679. } catch (t10) {
  1680. throw e11.release(), t10;
  1681. }
  1682. }
  1683. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLTemplateStore.js
  1684. var S2 = s.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore");
  1685. var w5 = new Array();
  1686. var k4 = { isOutline: false, placement: null, symbologyType: S.DEFAULT, vvFlags: 0 };
  1687. var C3 = { ...r2, hash: JSON.stringify(r2), materialKey: f4(E.MARKER, k4) };
  1688. var L = { ...s3, hash: JSON.stringify(s3), materialKey: f4(E.LINE, k4) };
  1689. var b5 = { ...y, hash: JSON.stringify(y), materialKey: f4(E.FILL, k4) };
  1690. function E3(e11, t10) {
  1691. const r13 = e11.length;
  1692. return e11.push(null), t10.then((t11) => e11[r13] = t11), e11;
  1693. }
  1694. function G2(e11) {
  1695. return !!(1 & e11);
  1696. }
  1697. function j6(e11) {
  1698. return "worker:port-closed" === e11.name;
  1699. }
  1700. var x8 = class {
  1701. constructor(e11, t10) {
  1702. this._idCounter = 1, this._templateIdCounter = 1, this._idToTemplateGroup = /* @__PURE__ */ new Map(), this._symbolToTemplate = /* @__PURE__ */ new Map(), this._fetchQueue = [], this._idToResolver = /* @__PURE__ */ new Map(), this._cimTemplateCache = /* @__PURE__ */ new Map(), this._cimAnalyses = [], this._lock = new r11(), this._fetchResource = e11, this._tileInfo = t10;
  1703. }
  1704. get _markerError() {
  1705. return this._errorTemplates.marker[0];
  1706. }
  1707. get _fillError() {
  1708. return this._errorTemplates.fill[0];
  1709. }
  1710. get _lineError() {
  1711. return this._errorTemplates.line[0];
  1712. }
  1713. get _textError() {
  1714. return this._errorTemplates.line[0];
  1715. }
  1716. createTemplateGroup(e11, t10) {
  1717. this._initErrorTemplates();
  1718. const r13 = e11.hash;
  1719. if (this._symbolToTemplate.has(r13))
  1720. return this._symbolToTemplate.get(r13);
  1721. const s9 = new Array();
  1722. t10 && this._createMeshTemplates(s9, t10, true), this._createMeshTemplates(s9, e11, false);
  1723. const i12 = this._createGroupId("expanded-cim" === e11.type && F(e11));
  1724. return this._idToTemplateGroup.set(i12, s9), this._symbolToTemplate.set(r13, i12), i12;
  1725. }
  1726. getTemplateGroup(e11) {
  1727. return this._idToTemplateGroup.has(e11) ? this._idToTemplateGroup.get(e11) : w5;
  1728. }
  1729. getDynamicTemplateGroup(e11) {
  1730. return this._idToTemplateGroup.has(e11) ? (G2(e11) || S2.error("mapview-template-store", `Id ${e11} does not refer to a dynamic template`), this._idToTemplateGroup.get(e11)) : w5;
  1731. }
  1732. getMosaicItem(e11, t10) {
  1733. const r13 = this._createTemplateId(), s9 = new Promise((e12) => this._idToResolver.set(r13, e12));
  1734. return this._fetchQueue.push({ symbol: e11, id: r13, glyphIds: t10 }), s9;
  1735. }
  1736. finalize(e11) {
  1737. return this._fetchQueue.length || this._lock.isHeld() ? s8(this._lock, this._fetchAllQueuedResources.bind(this), e11) : Promise.resolve();
  1738. }
  1739. _initErrorTemplates() {
  1740. this._errorTemplates || (this._errorTemplates = { fill: this._createMeshTemplates([], b5, false), marker: this._createMeshTemplates([], C3, false), line: this._createMeshTemplates([], L, false) });
  1741. }
  1742. _fetchAllQueuedResources(t10) {
  1743. if (!this._fetchQueue.length)
  1744. return Promise.resolve();
  1745. const s9 = this._fetchQueue, i12 = this._cimAnalyses;
  1746. return this._fetchQueue = [], this._cimAnalyses = [], Promise.all(i12).then(() => this._fetchResource(s9, t10).then((e11) => {
  1747. for (const { id: t11, mosaicItem: r13 } of e11) {
  1748. this._idToResolver.get(t11)(r13), this._idToResolver.delete(t11);
  1749. }
  1750. })).catch((t11) => {
  1751. j(t11) ? this._fetchQueue = this._fetchQueue.concat(s9) : j6(t11) || S2.error(new s2("mapview-template-store", "Unable to fetch requested texture resources", t11));
  1752. });
  1753. }
  1754. _createGroupId(e11) {
  1755. return this._idCounter++ << 1 | (e11 ? 1 : 0);
  1756. }
  1757. _createTemplateId() {
  1758. return this._templateIdCounter++;
  1759. }
  1760. async _createSMS(e11) {
  1761. const { spriteMosaicItem: t10 } = await this.getMosaicItem(e11);
  1762. return e9(t10, S2) ? b4.fromSimpleMarker(e11, t10) : this._markerError;
  1763. }
  1764. async _createPMS(e11) {
  1765. const { spriteMosaicItem: t10 } = await this.getMosaicItem(e11);
  1766. return e9(t10, S2) ? b4.fromPictureMarker(e11, t10) : this._markerError;
  1767. }
  1768. async _createSFS(e11, t10) {
  1769. const { spriteMosaicItem: r13 } = await this.getMosaicItem(e11);
  1770. return e9(r13, S2) ? j5.fromSimpleFill(e11, r13, t10) : this._fillError;
  1771. }
  1772. async _createPFS(e11, t10) {
  1773. const { spriteMosaicItem: r13 } = await this.getMosaicItem(e11);
  1774. return e9(r13, S2) ? j5.fromPictureFill(e11, r13, t10) : this._fillError;
  1775. }
  1776. async _createSLS(e11, t10) {
  1777. const { spriteMosaicItem: r13 } = await this.getMosaicItem(e11);
  1778. return e9(r13, S2) ? K.fromSimpleLine(e11, r13) : this._lineError;
  1779. }
  1780. async _createLMS(e11) {
  1781. const { spriteMosaicItem: t10 } = await this.getMosaicItem(e11);
  1782. return e9(t10, S2) ? b4.fromLineSymbolMarker(e11, t10) : this._markerError;
  1783. }
  1784. async _createTS(e11) {
  1785. const { glyphMosaicItems: t10 } = await this.getMosaicItem(e11);
  1786. return p7.fromText(e11, t10);
  1787. }
  1788. async _createCIMText(e11) {
  1789. const { glyphMosaicItems: t10 } = await this.getMosaicItem(i7(e11), t7(e11.text));
  1790. return e9(t10, S2) ? p7.fromCIMText(e11, t10, this._tileInfo) : this._textError;
  1791. }
  1792. async _createCIMFill(e11) {
  1793. const { spriteMosaicItem: t10 } = await this.getMosaicItem(i7(e11));
  1794. return e9(t10, S2) ? j5.fromCIMFill(e11, t10, this._tileInfo) : this._fillError;
  1795. }
  1796. async _createCIMLine(e11) {
  1797. const { spriteMosaicItem: t10 } = await this.getMosaicItem(i7(e11));
  1798. return e9(t10, S2) ? K.fromCIMLine(e11, t10, this._tileInfo) : this._lineError;
  1799. }
  1800. async _createCIMMarker(e11) {
  1801. const { spriteMosaicItem: t10 } = await this.getMosaicItem(i7(e11));
  1802. return e9(t10, S2) ? b4.fromCIMMarker(e11, t10, this._tileInfo) : this._markerError;
  1803. }
  1804. async _createCIM(e11) {
  1805. const t10 = e11.templateHash;
  1806. if (this._cimTemplateCache.has(t10))
  1807. return this._cimTemplateCache.get(t10);
  1808. let r13;
  1809. switch (e11.type) {
  1810. case "marker":
  1811. r13 = await this._createCIMMarker(e11);
  1812. break;
  1813. case "line":
  1814. r13 = await this._createCIMLine(e11);
  1815. break;
  1816. case "fill":
  1817. r13 = await this._createCIMFill(e11);
  1818. break;
  1819. case "text":
  1820. r13 = await this._createCIMText(e11);
  1821. }
  1822. return this._cimTemplateCache.set(t10, r13), r13;
  1823. }
  1824. async _createDynamicCIM(e11) {
  1825. const t10 = e11.templateHash;
  1826. if (this._cimTemplateCache.has(t10))
  1827. return this._cimTemplateCache.get(t10);
  1828. let r13;
  1829. switch (e11.type) {
  1830. case "marker":
  1831. r13 = P2.fromCIMMarker(e11, this._tileInfo);
  1832. break;
  1833. case "line":
  1834. r13 = y4.fromCIMLine(e11, this._tileInfo);
  1835. break;
  1836. case "fill":
  1837. r13 = M3.fromCIMFill(e11, this._tileInfo);
  1838. break;
  1839. case "text":
  1840. r13 = g7.fromCIMText(e11, this._tileInfo);
  1841. }
  1842. return this._cimTemplateCache.set(t10, r13), r13;
  1843. }
  1844. _createPrimitiveMeshTemplates(e11, t10, r13) {
  1845. switch (t10.type) {
  1846. case "esriSMS":
  1847. return E3(e11, this._createSMS(t10));
  1848. case "esriPMS":
  1849. return E3(e11, this._createPMS(t10));
  1850. case "esriSFS":
  1851. return E3(e11, this._createSFS(t10, r13));
  1852. case "line-marker":
  1853. return E3(e11, this._createLMS(t10));
  1854. case "esriPFS":
  1855. return E3(e11, this._createPFS(t10, r13));
  1856. case "esriSLS":
  1857. return E3(e11, this._createSLS(t10, false));
  1858. case "esriTS":
  1859. return E3(e11, this._createTS(t10));
  1860. default:
  1861. return S2.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"), e11;
  1862. }
  1863. }
  1864. _createMeshTemplates(e11, t10, r13) {
  1865. if (t10.type.includes("3d"))
  1866. return S2.error("3D symbols are not supported with MapView"), e11;
  1867. if ("expanded-cim" === t10.type) {
  1868. for (const r14 of t10.layers)
  1869. "function" == typeof r14.materialHash ? E3(e11, this._createDynamicCIM(r14)) : E3(e11, this._createCIM(r14));
  1870. return e11;
  1871. }
  1872. if ("composite-symbol" === t10.type) {
  1873. for (const s9 of t10.layers)
  1874. this._createPrimitiveMeshTemplates(e11, s9, r13);
  1875. return e11;
  1876. }
  1877. return "cim" === t10.type || "label" === t10.type || "web-style" === t10.type ? e11 : this._createPrimitiveMeshTemplates(e11, t10, r13);
  1878. }
  1879. };
  1880. var F = (e11) => {
  1881. if (!e11.layers)
  1882. return false;
  1883. for (const t10 of e11.layers)
  1884. if ("function" == typeof t10.materialHash)
  1885. return true;
  1886. return false;
  1887. };
  1888. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/segmentUtils.js
  1889. function r12(t10, e11) {
  1890. return t10[e11 + 1];
  1891. }
  1892. function h3(t10) {
  1893. return t10.length - 1;
  1894. }
  1895. function a6(t10) {
  1896. let e11 = 0;
  1897. for (let s9 = 0; s9 < h3(t10); s9++)
  1898. e11 += d5(t10, s9);
  1899. return e11;
  1900. }
  1901. function d5(t10, e11, s9 = 1) {
  1902. const [n10, i12] = r12(t10, e11);
  1903. return Math.sqrt(n10 * n10 + i12 * i12) * s9;
  1904. }
  1905. var c7 = class {
  1906. constructor(t10, e11, s9, n10, i12) {
  1907. this._segments = t10, this._index = e11, this._distance = s9, this._xStart = n10, this._yStart = i12, this._done = false;
  1908. }
  1909. static create(t10) {
  1910. return new c7(t10, 0, 0, t10[0][0], t10[0][1]);
  1911. }
  1912. clone() {
  1913. return new c7(this._segments, this._index, this._distance, this.xStart, this.yStart);
  1914. }
  1915. equals(t10) {
  1916. return this._index === t10._index || t10._index === this._index - 1 && (0 === this._distance || 1 === t10._distance) || t10._index === this._index + 1 && (1 === this._distance || 0 === t10._distance);
  1917. }
  1918. leq(t10) {
  1919. return this._index < t10._index || this._index === t10._index && this._distance <= t10._distance;
  1920. }
  1921. geq(t10) {
  1922. return this._index > t10._index || this._index === t10._index && this._distance >= t10._distance;
  1923. }
  1924. get _segment() {
  1925. return this._segments[this._index + 1];
  1926. }
  1927. get angle() {
  1928. const t10 = this.dy, e11 = (0 * t10 + -1 * -this.dx) / (1 * this.length);
  1929. let s9 = Math.acos(e11);
  1930. return t10 > 0 && (s9 = 2 * Math.PI - s9), s9;
  1931. }
  1932. get xStart() {
  1933. return this._xStart;
  1934. }
  1935. get yStart() {
  1936. return this._yStart;
  1937. }
  1938. get x() {
  1939. return this.xStart + this.distance * this.dx;
  1940. }
  1941. get y() {
  1942. return this.yStart + this.distance * this.dy;
  1943. }
  1944. get dx() {
  1945. return this._segment[0];
  1946. }
  1947. get dy() {
  1948. return this._segment[1];
  1949. }
  1950. get xMidpoint() {
  1951. return this.xStart + 0.5 * this.dx;
  1952. }
  1953. get yMidpoint() {
  1954. return this.yStart + 0.5 * this.dy;
  1955. }
  1956. get xEnd() {
  1957. return this.xStart + this.dx;
  1958. }
  1959. get yEnd() {
  1960. return this.yStart + this.dy;
  1961. }
  1962. get length() {
  1963. const { dx: t10, dy: e11 } = this;
  1964. return Math.sqrt(t10 * t10 + e11 * e11);
  1965. }
  1966. get remainingLength() {
  1967. return this.length * (1 - this._distance);
  1968. }
  1969. get backwardLength() {
  1970. return this.length * this._distance;
  1971. }
  1972. get distance() {
  1973. return this._distance;
  1974. }
  1975. get done() {
  1976. return this._done;
  1977. }
  1978. hasPrev() {
  1979. return this._index - 1 >= 0;
  1980. }
  1981. hasNext() {
  1982. return this._index + 1 < h3(this._segments);
  1983. }
  1984. next() {
  1985. return this.hasNext() ? (this._xStart += this.dx, this._yStart += this.dy, this._distance = 0, this._index += 1, this) : null;
  1986. }
  1987. prev() {
  1988. return this.hasPrev() ? (this._index -= 1, this._xStart -= this.dx, this._yStart -= this.dy, this._distance = 1, this) : (this._done = true, null);
  1989. }
  1990. _seekBackwards(t10, e11) {
  1991. const s9 = this.backwardLength;
  1992. if (t10 <= s9)
  1993. return this._distance = (s9 - t10) / this.length, this;
  1994. let n10 = this.backwardLength;
  1995. for (; this.prev(); ) {
  1996. if (n10 + this.length > t10)
  1997. return this._seekBackwards(t10 - n10);
  1998. n10 += this.length;
  1999. }
  2000. return this._distance = 0, e11 ? this : null;
  2001. }
  2002. seek(t10, e11 = false) {
  2003. if (t10 < 0)
  2004. return this._seekBackwards(Math.abs(t10), e11);
  2005. if (t10 <= this.remainingLength)
  2006. return this._distance = (this.backwardLength + t10) / this.length, this;
  2007. let s9 = this.remainingLength;
  2008. for (; this.next(); ) {
  2009. if (s9 + this.length > t10)
  2010. return this.seek(t10 - s9, e11);
  2011. s9 += this.length;
  2012. }
  2013. return this._distance = 1, e11 ? this : null;
  2014. }
  2015. };
  2016. function u10(t10, e11, s9, n10 = true) {
  2017. const i12 = a6(t10), r13 = c7.create(t10), h5 = i12 / 2;
  2018. if (!n10)
  2019. return r13.seek(h5), void s9(r13.clone(), 0, h5 + 0 * e11, i12);
  2020. const d7 = Math.max((i12 - e11) / 2, 0), u12 = Math.floor(d7 / e11), o11 = h5 - u12 * e11;
  2021. r13.seek(o11);
  2022. for (let a7 = -u12; a7 <= u12; a7++)
  2023. r13.x < 512 && r13.x >= 0 && r13.y < 512 && r13.y >= 0 && s9(r13.clone(), a7, h5 + a7 * e11, i12), r13.seek(e11);
  2024. }
  2025. function l4(t10, e11) {
  2026. const s9 = e11;
  2027. for (let n10 = 0; n10 < t10.length; n10++) {
  2028. let e12 = t10[n10];
  2029. const i12 = [];
  2030. i12.push(e12[0]);
  2031. for (let t11 = 1; t11 < e12.length; t11++) {
  2032. let [s10, n11] = i12[t11 - 1];
  2033. s10 += e12[t11][0], n11 += e12[t11][1], i12.push([s10, n11]);
  2034. }
  2035. g8(i12, s9);
  2036. const r13 = [];
  2037. r13.push(i12[0]);
  2038. for (let t11 = 1; t11 < i12.length; t11++) {
  2039. const [e13, s10] = i12[t11 - 1], [n11, h5] = i12[t11], a7 = Math.round(n11 - e13), d7 = Math.round(h5 - s10);
  2040. r13.push([a7, d7]);
  2041. }
  2042. t10[n10] = r13, e12 = r13;
  2043. }
  2044. return t10;
  2045. }
  2046. function g8(t10, e11) {
  2047. const r13 = 1e-6;
  2048. if (e11 <= 0)
  2049. return;
  2050. const h5 = t10.length;
  2051. if (h5 < 3)
  2052. return;
  2053. const a7 = [];
  2054. let d7 = 0;
  2055. a7.push(0);
  2056. for (let n10 = 1; n10 < h5; n10++)
  2057. d7 += u3(t10[n10], t10[n10 - 1]), a7.push(d7);
  2058. e11 = Math.min(e11, 0.2 * d7);
  2059. const c9 = [];
  2060. c9.push(t10[0][0]), c9.push(t10[0][1]);
  2061. const u12 = t10[h5 - 1][0], o11 = t10[h5 - 1][1], _5 = t8([0, 0], t10[0], t10[1]);
  2062. r7(_5), t10[0][0] += e11 * _5[0], t10[0][1] += e11 * _5[1], t8(_5, t10[h5 - 1], t10[h5 - 2]), r7(_5), t10[h5 - 1][0] += e11 * _5[0], t10[h5 - 1][1] += e11 * _5[1];
  2063. for (let s9 = 1; s9 < h5; s9++)
  2064. a7[s9] += e11;
  2065. a7[h5 - 1] += e11;
  2066. const l7 = 0.5 * e11;
  2067. for (let s9 = 1; s9 < h5 - 1; s9++) {
  2068. let n10 = 0, i12 = 0, d8 = 0;
  2069. for (let h6 = s9 - 1; h6 >= 0 && !(a7[h6 + 1] < a7[s9] - l7); h6--) {
  2070. const c10 = l7 + a7[h6 + 1] - a7[s9], u13 = a7[h6 + 1] - a7[h6], o12 = a7[s9] - a7[h6] < l7 ? 1 : c10 / u13;
  2071. if (Math.abs(o12) < r13)
  2072. break;
  2073. const _6 = o12 * o12, g9 = o12 * c10 - 0.5 * _6 * u13, x10 = o12 * u13 / e11, f14 = t10[h6 + 1], y7 = t10[h6][0] - f14[0], k5 = t10[h6][1] - f14[1];
  2074. n10 += x10 / g9 * (f14[0] * o12 * c10 + 0.5 * _6 * (c10 * y7 - u13 * f14[0]) - _6 * o12 * u13 * y7 / 3), i12 += x10 / g9 * (f14[1] * o12 * c10 + 0.5 * _6 * (c10 * k5 - u13 * f14[1]) - _6 * o12 * u13 * k5 / 3), d8 += x10;
  2075. }
  2076. for (let c10 = s9 + 1; c10 < h5 && !(a7[c10 - 1] > a7[s9] + l7); c10++) {
  2077. const h6 = l7 - a7[c10 - 1] + a7[s9], u13 = a7[c10] - a7[c10 - 1], o12 = a7[c10] - a7[s9] < l7 ? 1 : h6 / u13;
  2078. if (Math.abs(o12) < r13)
  2079. break;
  2080. const _6 = o12 * o12, g9 = o12 * h6 - 0.5 * _6 * u13, x10 = o12 * u13 / e11, f14 = t10[c10 - 1], y7 = t10[c10][0] - f14[0], k5 = t10[c10][1] - f14[1];
  2081. n10 += x10 / g9 * (f14[0] * o12 * h6 + 0.5 * _6 * (h6 * y7 - u13 * f14[0]) - _6 * o12 * u13 * y7 / 3), i12 += x10 / g9 * (f14[1] * o12 * h6 + 0.5 * _6 * (h6 * k5 - u13 * f14[1]) - _6 * o12 * u13 * k5 / 3), d8 += x10;
  2082. }
  2083. c9.push(n10 / d8), c9.push(i12 / d8);
  2084. }
  2085. c9.push(u12), c9.push(o11);
  2086. for (let s9 = 0, n10 = 0; s9 < h5; s9++)
  2087. t10[s9][0] = c9[n10++], t10[s9][1] = c9[n10++];
  2088. }
  2089. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js
  2090. var y6 = s.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate");
  2091. var x9 = (t10, i12 = "mapview-labeling") => y6.error(new s2(i12, t10));
  2092. var L2 = 1;
  2093. var P3 = 0;
  2094. var M7 = 4;
  2095. var S3 = 25;
  2096. function w6(e11, t10) {
  2097. const n10 = !!e11.minScale && t10.scaleToZoom(e11.minScale) || 0;
  2098. return a(n10, 0, 25.5);
  2099. }
  2100. function v4(e11, t10) {
  2101. const n10 = !!e11.maxScale && t10.scaleToZoom(e11.maxScale) || 255;
  2102. return a(n10, 0, 25.5);
  2103. }
  2104. function A2(e11) {
  2105. const t10 = /* @__PURE__ */ new Map();
  2106. return (i12) => (t10.has(i12) || t10.set(i12, e11(i12)), t10.get(i12));
  2107. }
  2108. var Z3 = A2((e11) => {
  2109. let t10 = 0;
  2110. if (0 === e11)
  2111. return 1 / 0;
  2112. for (; !(e11 % 2); )
  2113. t10++, e11 /= 2;
  2114. return t10;
  2115. });
  2116. var I = (e11) => Math.floor(127 * e11 + 127);
  2117. var O2 = (e11) => Math.floor(10 * e11);
  2118. var z3 = (e11) => Math.round(e11 * (254 / 360));
  2119. var G3 = class extends p7 {
  2120. constructor(e11, t10, i12, n10) {
  2121. var _a, _b, _c;
  2122. super(e11, i12.font.size, i12.haloSize || 0, i12.font.size, i12.color && s4(i12.color) || 0, i12.haloColor && s4(i12.haloColor) || 0, i12.horizontalAlignment, i12.verticalAlignment, i5(t10.labelPlacement) ? i3.MAP : i3.SCREEN, i12.font.decoration, false, i12.angle || 0, i12.xoffset, i12.yoffset, i12.lineWidth, i12.lineHeight, null, null, null, null, null), this._outLineLabelAngle = 0, this._refPlacementPadding = 0, this._refPlacementDirX = 0, this._refPlacementDirY = 0, this._refOffsetX = 0, this._refOffsetY = 0, this._zoomLevel = 0, this.geometryType = E.LABEL, this._allowOverrun = (_a = t10.allowOverrun) != null ? _a : false, this._repeatLabel = (_b = t10.repeatLabel) != null ? _b : true, this._labelPosition = (_c = t10.labelPosition) != null ? _c : "curved";
  2123. const o11 = w6(t10, n10), h5 = v4(t10, n10), c9 = t10.labelPlacement, [g9, u12] = a2(c9);
  2124. this._xAlignD = g9, this._yAlignD = u12, this._minZoom = o11, this._maxZoom = h5, this._refPlacementPadding = u(i12.haloSize) + k, this._repeatLabelDistance = t10.repeatLabelDistance ? u(t10.repeatLabelDistance) : 128;
  2125. const d7 = Z.load(e11);
  2126. d7.sdf = true, this._materialKey = d7.data;
  2127. }
  2128. static fromLabelClass(e11, t10) {
  2129. if ("esriServerLinePlacementCenterAlong" === e11.labelPlacement) {
  2130. const t11 = e11.symbol;
  2131. t11.xoffset = 0, t11.yoffset = 0, t11.angle = 0, t11.font.decoration = "none";
  2132. }
  2133. return new G3(e11.materialKey, e11, e11.symbol, t10);
  2134. }
  2135. get _shapedBox() {
  2136. return e(this._shapingInfo).bounds;
  2137. }
  2138. setZoomLevel(e11) {
  2139. this._zoomLevel = e11;
  2140. }
  2141. bindReferenceTemplate(e11) {
  2142. let t10 = c(this._xAlignD), i12 = o5(this._yAlignD);
  2143. if (this._refOffsetX = 0, this._refOffsetY = 0, t(e11))
  2144. return void (this._refSymbolAndPlacementOffset = x(0, 0, I(t10), I(i12)));
  2145. if ("circle" === e11.boundsType && (t10 || i12)) {
  2146. const e12 = Math.sqrt(t10 * t10 + i12 * i12);
  2147. t10 /= e12, i12 /= e12;
  2148. }
  2149. const n10 = Math.max(e11.height, e11.width), s9 = this._refPlacementPadding * M7;
  2150. this._refSymbolAndPlacementOffset = x(s9, n10, I(t10), I(i12)), this._referenceSize = n10, this._refPlacementDirX = t10, this._refPlacementDirY = i12, this._refOffsetX = e11.xOffset, this._refOffsetY = e11.yOffset;
  2151. }
  2152. _write(e11, t10) {
  2153. if (t(this._shapingInfo))
  2154. return;
  2155. const i12 = this._shapingInfo, n10 = t10.getDisplayId(), s9 = "esriGeometryPolygon" === t10.geometryType ? t10.readLegacyCentroid() : t10.readLegacyGeometry();
  2156. if (s9)
  2157. switch (this._current = { out: e11, inId: n10, inShaping: i12, zoomLevel: this._zoomLevel }, t10.geometryType) {
  2158. case "esriGeometryPolyline":
  2159. this._placeLineLabels(s9);
  2160. break;
  2161. case "esriGeometryPoint":
  2162. case "esriGeometryPolygon":
  2163. this._placePointLabels(s9);
  2164. break;
  2165. default:
  2166. x9("mapview-labeling", `Geometry of type ${t10.geometryType} is not supported`);
  2167. }
  2168. }
  2169. _isVisible(e11, t10) {
  2170. const i12 = O2(this._current.zoomLevel);
  2171. return O2(e11) <= i12 && i12 <= O2(t10);
  2172. }
  2173. _placePointLabels(e11) {
  2174. const { out: t10, inId: i12, inShaping: n10 } = this._current;
  2175. this._writeGlyphs(t10, i12, e11, n10);
  2176. }
  2177. _placeLineLabels(e11) {
  2178. const t10 = l4(e11.paths, this._current.inShaping.bounds.width), i12 = this._placeSubdivGlyphs.bind(this), n10 = (this._shapedBox.width + this._repeatLabelDistance) / (1 << L2);
  2179. for (const o11 of t10)
  2180. u10(o11, n10, i12, this._repeatLabel);
  2181. }
  2182. _placeSubdivGlyphs(e11, t10, i12, n10) {
  2183. const o11 = Z3(t10), s9 = this._shapedBox.width / (1 << L2), r13 = Math.sqrt(this._repeatLabelDistance) / (1 << L2), a7 = Math.min(i12, n10 - i12), l7 = this._current.inShaping.isMultiline ? S3 : Math.log2(a7 / (r13 + s9 / 2)), h5 = 0 === t10 ? l7 : Math.min(o11, l7), c9 = Math.max(this._minZoom, this._current.zoomLevel + L2 - h5), m5 = this._current.zoomLevel - c9, _5 = this._shapedBox.width / 2 * 2 ** m5;
  2184. this._current.inShaping.isMultiline ? 0 === t10 && this._placeStraight(e11, c9) : this._allowOverrun && m5 < 0 ? this._placeStraightAlong(e11, this._minZoom) : "parallel" === this._labelPosition ? this._placeStraightAlong(e11, c9) : "curved" === this._labelPosition && this._placeCurved(e11, c9, _5);
  2185. }
  2186. _placeStraight(e11, t10) {
  2187. const { out: i12, inId: n10, inShaping: o11 } = this._current, s9 = Math.ceil(e11.angle * (180 / Math.PI) % 360), r13 = Math.ceil((e11.angle * (180 / Math.PI) + 180) % 360);
  2188. this._outLineLabelAngle = z3(s9), this._writeGlyphs(i12, n10, e11, o11, t10), this._outLineLabelAngle = z3(r13), this._writeGlyphs(i12, n10, e11, o11, t10);
  2189. }
  2190. _placeCurved(e11, t10, i12) {
  2191. const { out: n10, inId: o11 } = this._current;
  2192. n10.metricStart(o11, t10, e11.x, e11.y, 0, 0, 0, 0);
  2193. const s9 = e11.clone(), r13 = e11.angle * (180 / Math.PI) % 360, a7 = (e11.angle * (180 / Math.PI) + 180) % 360;
  2194. this._outLineLabelAngle = z3(r13), this._placeFirst(s9, t10, 1), this._placeBack(e11, s9, t10, i12, 1), this._placeForward(e11, s9, t10, i12, 1), this._outLineLabelAngle = z3(a7), this._placeFirst(s9, t10, 0), this._placeBack(e11, s9, t10, i12, 0), this._placeForward(e11, s9, t10, i12, 0), n10.metricEnd();
  2195. }
  2196. _placeStraightAlong(e11, t10) {
  2197. const { out: i12, inId: n10 } = this._current;
  2198. i12.metricStart(n10, t10, e11.x, e11.y, 0, 0, 0, 0);
  2199. const o11 = e11.clone(), s9 = e11.angle * (180 / Math.PI) % 360, r13 = (e11.angle * (180 / Math.PI) + 180) % 360;
  2200. this._outLineLabelAngle = z3(s9), this._placeFirst(o11, t10, 1, true), this._outLineLabelAngle = z3(r13), this._placeFirst(o11, t10, 0, true), i12.metricEnd();
  2201. }
  2202. _placeBack(e11, t10, i12, n10, o11) {
  2203. const s9 = e11.clone();
  2204. let r13 = e11.backwardLength + P3;
  2205. for (; s9.prev() && !(r13 >= n10); )
  2206. this._placeOnSegment(s9, t10, r13, i12, -1, o11), r13 += s9.length + P3;
  2207. }
  2208. _placeForward(e11, t10, i12, n10, o11) {
  2209. const s9 = e11.clone();
  2210. let r13 = e11.remainingLength + P3;
  2211. for (; s9.next() && !(r13 >= n10); )
  2212. this._placeOnSegment(s9, t10, r13, i12, 1, o11), r13 += s9.length + P3;
  2213. }
  2214. _placeFirst(e11, t10, i12, n10 = false) {
  2215. const o11 = e11, s9 = this._current.inShaping, r13 = s9.glyphs, a7 = this._current.zoomLevel, { out: l7, inId: h5 } = this._current;
  2216. for (const c9 of r13) {
  2217. const r14 = c9.x > s9.bounds.x ? i12 : 1 - i12, m5 = r14 * e11.remainingLength + (1 - r14) * e11.backwardLength, _5 = Math.abs(c9.x + c9.width / 2 - s9.bounds.x), f14 = Math.max(0, a7 + Math.log2(_5 / (m5 + P3))), g9 = Math.max(t10, n10 ? 0 : f14);
  2218. if (c9.maxZoom = S3, c9.angle = e11.angle + (1 - i12) * Math.PI, c9.minZoom = g9, this._writeGlyph(l7, h5, o11.x, o11.y, c9), i12 && this._isVisible(c9.minZoom, c9.maxZoom)) {
  2219. const e12 = c9.bounds;
  2220. l7.metricBoxWrite(e12.center[0], e12.center[1], e12.width, e12.height);
  2221. }
  2222. }
  2223. }
  2224. _placeOnSegment(e11, t10, i12, n10, o11, s9) {
  2225. const r13 = this._current.inShaping.glyphs, { out: a7, inId: l7 } = this._current, h5 = this._current.inShaping, c9 = this._current.zoomLevel, m5 = e11.dx / e11.length, _5 = e11.dy / e11.length, f14 = { x: e11.x + i12 * -o11 * m5, y: e11.y + i12 * -o11 * _5 };
  2226. for (const g9 of r13) {
  2227. const r14 = g9.x > h5.bounds.x ? s9 : 1 - s9;
  2228. if (!(r14 && 1 === o11 || !r14 && -1 === o11))
  2229. continue;
  2230. const m6 = Math.abs(g9.x + g9.width / 2 - h5.bounds.x), _6 = Math.max(0, c9 + Math.log2(m6 / i12) - 0.1), p9 = Math.max(n10, c9 + Math.log2(m6 / (i12 + e11.length + P3)));
  2231. if (0 !== _6 && (g9.angle = e11.angle + (1 - s9) * Math.PI, g9.minZoom = p9, g9.maxZoom = _6, this._writeGlyph(a7, l7, f14.x, f14.y, g9), s9 && this._isVisible(g9.minZoom, g9.maxZoom))) {
  2232. const i13 = g9.bounds, n11 = e11.x - t10.x, o12 = e11.y - t10.y;
  2233. a7.metricBoxWrite(i13.center[0] + n11, i13.center[1] + o12, i13.width, i13.height);
  2234. }
  2235. }
  2236. }
  2237. _writeGlyphs(e11, t10, i12, n10, o11 = this._minZoom) {
  2238. if (i12.x < 0 || i12.x >= 512 || i12.y < 0 || i12.y >= 512)
  2239. return;
  2240. const s9 = i12.x + this._refOffsetX, r13 = i12.y - this._refOffsetY;
  2241. for (const c9 of n10.glyphs)
  2242. c9.minZoom = o11, c9.maxZoom = this._maxZoom, this._writeGlyph(e11, t10, s9, r13, c9);
  2243. const a7 = this._refPlacementDirX, l7 = this._refPlacementDirY, h5 = n10.boundsT;
  2244. e11.metricStart(t10, o11, s9, r13, a7, l7, this._referenceSize, this._materialKey), e11.metricBoxWrite(h5.center[0], h5.center[1], h5.width, h5.height), e11.metricEnd();
  2245. }
  2246. _writeVertexCommon(e11, t10, i12, n10) {
  2247. const o11 = this._color, s9 = this._haloColor, r13 = x(0, 0, this._size, this._haloSize), a7 = Math.max(n10.minZoom, this._minZoom), l7 = Math.min(n10.maxZoom, this._maxZoom), h5 = x(O2(a7), O2(l7), this._outLineLabelAngle, 0);
  2248. e11.vertexWrite(i12), e11.vertexWrite(t10), e11.vertexWrite(o11), e11.vertexWrite(s9), e11.vertexWrite(r13), e11.vertexWrite(this._refSymbolAndPlacementOffset), e11.vertexWrite(h5);
  2249. }
  2250. };
  2251. // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/factories/WGLMeshFactory.js
  2252. var l5 = class {
  2253. constructor(e11, t10, s9) {
  2254. this._loadPromise = i4(), this._geometryType = e11, this._idField = t10, this._templateStore = s9;
  2255. }
  2256. update(t10, r13) {
  2257. r(t10.mesh.labels) && (this._labelTemplates = this._createLabelTemplates(t10.mesh.labels, r13)), this._schema = t10;
  2258. }
  2259. _createLabelTemplates(e11, t10) {
  2260. const r13 = /* @__PURE__ */ new Map();
  2261. if ("simple" === e11.type) {
  2262. for (const s9 of e11.classes) {
  2263. const e12 = G3.fromLabelClass(s9, t10);
  2264. r13.set(s9.index, e12);
  2265. }
  2266. return r13;
  2267. }
  2268. for (const s9 in e11.classes) {
  2269. const o11 = e11.classes[s9];
  2270. for (const e12 of o11) {
  2271. const s10 = G3.fromLabelClass(e12, t10);
  2272. r13.set(e12.index, s10);
  2273. }
  2274. }
  2275. return r13;
  2276. }
  2277. get templates() {
  2278. return this._templateStore;
  2279. }
  2280. async analyze(r13, i12, o11, l7, n10, m5, p9) {
  2281. if (p(p9))
  2282. return;
  2283. let f14;
  2284. "dictionary" === o11.type && (f14 = await o11.analyze(this._idField, r13.copy(), i12, n10, m5, p9));
  2285. let c9 = 0;
  2286. for (; r13.next(); ) {
  2287. let t10;
  2288. if (t10 = f14 ? f14[c9++] : r(l7) && p2(r13.getDisplayId()) && 1 !== r13.readAttribute("cluster_count") ? l7.match(this._idField, r13, this._geometryType, n10, m5) : o11.match(this._idField, r13, this._geometryType, n10, m5), r13.setGroupId(t10), G2(t10)) {
  2289. const e11 = this._templateStore.getDynamicTemplateGroup(t10);
  2290. for (const t11 of e11)
  2291. t11 && t11.analyze && t11.analyze(this._templateStore, r13, n10, m5);
  2292. }
  2293. }
  2294. return await this._loadPromise, this._templateStore.finalize(p9);
  2295. }
  2296. async analyzeGraphics(e11, r13, s9, i12, o11, l7) {
  2297. if (p(l7))
  2298. return;
  2299. const n10 = e11.getCursor();
  2300. for (s9 && await s9.analyze(this._idField, n10.copy(), r13, i12, o11, l7); n10.next(); ) {
  2301. let e12 = n10.getGroupId();
  2302. if (null != e12 && -1 !== e12 || (e12 = s9.match(this._idField, n10, n10.geometryType, i12, o11), n10.setGroupId(e12)), G2(e12)) {
  2303. const t10 = this._templateStore.getDynamicTemplateGroup(e12);
  2304. for (const e13 of t10)
  2305. e13 && e13.analyze && e13.analyze(this._templateStore, n10, i12, o11);
  2306. }
  2307. n10.setGroupId(e12);
  2308. }
  2309. return await this._loadPromise, this._templateStore.finalize(l7);
  2310. }
  2311. writeGraphic(e11, t10, r13, s9) {
  2312. const i12 = t10.getGroupId(), o11 = t10.getDisplayId(), l7 = this._templateStore.getTemplateGroup(i12);
  2313. if (e11.featureStart(t10.insertAfter, 0), null != o11) {
  2314. if (G2(i12))
  2315. for (const e12 of l7)
  2316. e12 && e12.bindFeature(t10, null, null);
  2317. if (l7) {
  2318. for (const i13 of l7)
  2319. i13 && i13.write(e11, t10, r13, s9);
  2320. e11.featureEnd();
  2321. }
  2322. }
  2323. }
  2324. writeCursor(t10, r13, s9, i12, o11, l7, n10) {
  2325. const m5 = r13.getGroupId(), p9 = r13.getDisplayId(), f14 = this._templateStore.getTemplateGroup(m5), c9 = this._schema.mesh.sortKey;
  2326. let d7 = 0;
  2327. if (r(c9) && (d7 = null != c9.fieldIndex ? r13.getComputedNumericAtIndex(c9.fieldIndex) : null != c9.field ? r13.readAttribute(c9.field) : r13.readAttribute(this._idField), d7 *= "asc" === c9.order ? 1 : -1), t10.featureStart(0, null == d7 || isNaN(d7) ? 0 : d7), null != p9 && f14) {
  2328. if (G2(m5))
  2329. for (const e11 of f14)
  2330. e11.bindFeature(r13, s9, i12);
  2331. for (const e11 of f14)
  2332. e11.write(t10, r13, o11, n10);
  2333. if (r(l7) && t10.hasRecords) {
  2334. const e11 = l7 && this._findLabelRef(f14);
  2335. this._writeLabels(t10, r13, l7, e11, o11, n10);
  2336. }
  2337. t10.featureEnd();
  2338. }
  2339. }
  2340. _findLabelRef(e11) {
  2341. for (const t10 of e11)
  2342. if (t10 instanceof b4)
  2343. return t10;
  2344. return null;
  2345. }
  2346. _writeLabels(t10, r13, s9, i12, o11, a7) {
  2347. for (const l7 of s9)
  2348. if (r(l7) && l7) {
  2349. const { glyphs: e11, rtl: s10, index: n10 } = l7, m5 = this._labelTemplates.get(n10);
  2350. m5.setZoomLevel(o11), m5.bindReferenceTemplate(i12), m5.bindTextInfo(e11, s10), m5.write(t10, r13, null, a7);
  2351. }
  2352. }
  2353. };
  2354. // node_modules/@arcgis/core/views/2d/engine/webgl/util/Matcher.js
  2355. var n9 = s.getLogger("esri/views/2d/engine/webgl/util/Matcher");
  2356. async function l6(e11, t10, s9, r13) {
  2357. switch (e11.type) {
  2358. case "simple":
  2359. case "heatmap":
  2360. return o10.fromBasicRenderer(e11, t10, s9, r13);
  2361. case "map":
  2362. return m4.fromUVRenderer(e11, t10, s9, r13);
  2363. case "interval":
  2364. return c8.fromCBRenderer(e11, t10, s9, r13);
  2365. case "dictionary":
  2366. return p8.fromDictionaryRenderer(e11, t10, s9, r13);
  2367. case "pie-chart":
  2368. return u11.fromPieChartRenderer(e11, t10, s9, r13);
  2369. case "subtype":
  2370. return u11.fromSubtypes(e11, t10, s9, r13);
  2371. }
  2372. }
  2373. var o10 = class {
  2374. constructor() {
  2375. this.type = "feature", this._defaultResult = null;
  2376. }
  2377. static async fromBasicRenderer(e11, t10, s9, r13) {
  2378. const i12 = new o10();
  2379. if (e11.symbol) {
  2380. const n10 = await n6(e11.symbol, s9, r13), l7 = t10.createTemplateGroup(n10, null);
  2381. i12.setDefault(l7);
  2382. }
  2383. return i12;
  2384. }
  2385. static async fromPieChartRenderer(e11, t10, s9, r13) {
  2386. const i12 = new o10();
  2387. if (e11.markerSymbol) {
  2388. const n10 = await n6(e11.markerSymbol, s9, r13);
  2389. let l7;
  2390. e11.fillSymbol && (l7 = await n6(e11.fillSymbol, s9, r13));
  2391. const o11 = t10.createTemplateGroup(n10, l7);
  2392. i12.setDefault(o11);
  2393. }
  2394. return i12;
  2395. }
  2396. size() {
  2397. return 1;
  2398. }
  2399. getDefault() {
  2400. return this._defaultResult;
  2401. }
  2402. setDefault(e11) {
  2403. this._defaultResult = e11;
  2404. }
  2405. match(e11, t10, s9, r13, i12) {
  2406. return this.getDefault();
  2407. }
  2408. async analyze(e11, t10, s9, r13, i12, a7) {
  2409. return null;
  2410. }
  2411. };
  2412. var u11 = class extends o10 {
  2413. constructor(e11, t10) {
  2414. super(), this._subMatchers = e11, this._subtypeField = t10;
  2415. }
  2416. static async fromSubtypes(e11, t10, s9, r13) {
  2417. const i12 = /* @__PURE__ */ new Map(), a7 = [];
  2418. for (const n10 in e11.renderers) {
  2419. const o11 = parseInt(n10, 10), u12 = l6(e11.renderers[n10], t10, s9, r13).then((e12) => i12.set(o11, e12));
  2420. a7.push(u12);
  2421. }
  2422. return await Promise.all(a7), new u11(i12, e11.subtypeField);
  2423. }
  2424. match(e11, t10, s9, r13, i12) {
  2425. const a7 = t10.readAttribute(this._subtypeField), n10 = this._subMatchers.get(a7);
  2426. return n10 ? n10.match(e11, t10, s9, r13, i12) : null;
  2427. }
  2428. };
  2429. var c8 = class extends o10 {
  2430. constructor(e11, t10, s9, r13) {
  2431. super(), this.type = "interval", this._intervals = [], this._isMaxInclusive = t10, this._fieldIndex = r13, this._field = e11, this._normalizationInfo = s9;
  2432. }
  2433. static async fromCBRenderer(e11, t10, s9, r13) {
  2434. const { isMaxInclusive: i12, normalizationField: n10, normalizationTotal: l7, normalizationType: o11 } = e11, u12 = e11.field, m5 = new c8(u12, i12, { normalizationField: n10, normalizationTotal: l7, normalizationType: o11 }, e11.fieldIndex), d7 = await n6(e11.backgroundFillSymbol, s9, r13);
  2435. await Promise.all(e11.intervals.map(async (e12) => {
  2436. const i13 = await n6(e12.symbol, s9, r13), n11 = await t10.createTemplateGroup(i13, d7), l8 = { min: e12.min, max: e12.max };
  2437. m5.add(l8, n11);
  2438. }));
  2439. const h5 = await n6(e11.defaultSymbol, s9, r13);
  2440. if (h5) {
  2441. const e12 = await t10.createTemplateGroup(h5, d7);
  2442. m5.setDefault(e12);
  2443. }
  2444. return m5;
  2445. }
  2446. add(e11, t10) {
  2447. this._intervals.push({ interval: e11, result: t10 }), this._intervals.sort((e12, t11) => e12.interval.min - t11.interval.min);
  2448. }
  2449. size() {
  2450. return super.size() + this._intervals.length;
  2451. }
  2452. match(e11, t10, s9, r13, i12) {
  2453. if (null == this._fieldIndex && !this._field)
  2454. return this.getDefault();
  2455. const a7 = null != this._fieldIndex ? t10.getComputedNumericAtIndex(this._fieldIndex) : this._getValueFromField(t10);
  2456. if (null == a7 || isNaN(a7) || a7 === 1 / 0 || a7 === -1 / 0)
  2457. return this.getDefault();
  2458. for (let n10 = 0; n10 < this._intervals.length; n10++) {
  2459. const { interval: e12, result: t11 } = this._intervals[n10], s10 = a7 >= e12.min, r14 = this._isMaxInclusive ? a7 <= e12.max : a7 < e12.max;
  2460. if (s10 && r14)
  2461. return t11;
  2462. }
  2463. return this.getDefault();
  2464. }
  2465. _needsNormalization() {
  2466. const e11 = this._normalizationInfo;
  2467. return e11 && (e11.normalizationField || e11.normalizationTotal || e11.normalizationType);
  2468. }
  2469. _getValueFromField(e11) {
  2470. const t10 = e11.readAttribute(this._field);
  2471. if (!this._needsNormalization() || null == t10)
  2472. return t10;
  2473. const { normalizationField: s9, normalizationTotal: r13, normalizationType: i12 } = this._normalizationInfo, a7 = !!s9 && e11.readAttribute(s9);
  2474. if (i12)
  2475. switch (i12) {
  2476. case "esriNormalizeByField":
  2477. return a7 ? t10 / a7 : void 0;
  2478. case "esriNormalizeByLog":
  2479. return Math.log(t10) * Math.LOG10E;
  2480. case "esriNormalizeByPercentOfTotal":
  2481. return t10 / r13 * 100;
  2482. default:
  2483. return void n9.error(`Found unknown normalization type: ${i12}`);
  2484. }
  2485. else
  2486. n9.error("Normalization is required, but no type was set!");
  2487. }
  2488. };
  2489. var m4 = class extends o10 {
  2490. constructor(e11, t10, s9) {
  2491. super(), this.type = "map", this._nullResult = null, this._resultsMap = /* @__PURE__ */ new Map(), this._fieldsIndex = s9, this._fields = e11, this._seperator = t10 || "";
  2492. }
  2493. static async fromUVRenderer(e11, t10, s9, r13) {
  2494. const i12 = e11.fieldDelimiter, n10 = [e11.field];
  2495. e11.field2 && n10.push(e11.field2), e11.field3 && n10.push(e11.field3);
  2496. const l7 = await n6(e11.backgroundFillSymbol, s9, r13), o11 = new m4(n10, i12, e11.fieldIndex);
  2497. await Promise.all(e11.map.map(async (e12) => {
  2498. const i13 = await n6(e12.symbol, s9, r13), n11 = await t10.createTemplateGroup(i13, l7);
  2499. "<Null>" === e12.value ? o11.setNullResult(n11) : o11.add(e12.value, n11);
  2500. }));
  2501. const u12 = await n6(e11.defaultSymbol, s9, r13);
  2502. if (u12) {
  2503. const e12 = await t10.createTemplateGroup(u12, l7);
  2504. o11.setDefault(e12);
  2505. }
  2506. return o11;
  2507. }
  2508. setNullResult(e11) {
  2509. this._nullResult = e11;
  2510. }
  2511. add(e11, t10) {
  2512. this._resultsMap.set(e11.toString(), t10);
  2513. }
  2514. size() {
  2515. return super.size() + this._resultsMap.size;
  2516. }
  2517. match(e11, t10, s9, r13, i12) {
  2518. if (null == this._fieldsIndex && !this._fields)
  2519. return this.getDefault();
  2520. const a7 = null != this._fieldsIndex ? t10.getComputedStringAtIndex(this._fieldsIndex) : this._getValueFromFields(t10);
  2521. if (null !== this._nullResult && (null == a7 || "" === a7 || "<Null>" === a7))
  2522. return this._nullResult;
  2523. if (null == a7)
  2524. return this.getDefault();
  2525. const n10 = a7.toString();
  2526. return this._resultsMap.has(n10) ? this._resultsMap.get(n10) : this.getDefault();
  2527. }
  2528. _getValueFromFields(e11) {
  2529. const t10 = [];
  2530. for (const s9 of this._fields) {
  2531. const r13 = e11.readAttribute(s9);
  2532. null == r13 || "" === r13 ? t10.push("<Null>") : t10.push(r13);
  2533. }
  2534. return t10.join(this._seperator);
  2535. }
  2536. };
  2537. async function d6(e11, t10) {
  2538. const s9 = e11 || 1;
  2539. if ("number" == typeof s9)
  2540. return (e12, t11, r13) => s9;
  2541. const a7 = await o6(s9, t10.spatialReference, t10.fields);
  2542. return (e12, s10, r13) => i6(a7, e12, { $view: r13 }, t10.geometryType, s10) || 1;
  2543. }
  2544. var h4;
  2545. async function f13() {
  2546. return h4 || (h4 = import("./createSymbolSchema-RDEFTMNL.js")), h4;
  2547. }
  2548. var p8 = class extends o10 {
  2549. constructor(e11, t10, r13, i12, a7, n10) {
  2550. super(), this.type = "dictionary", this._groupIdCache = new e2(100), this._loader = e11, this._fieldMap = e11.fieldMap, this._symbolFields = e11.getSymbolFields(), this._templates = t10, this._info = r13, this._scaleFn = i12, this._schemaUtilsModule = a7, this._symbolOptions = n10;
  2551. }
  2552. static async fromDictionaryRenderer(e11, t10, s9, r13) {
  2553. const [{ DictionaryLoader: i12 }, a7] = await Promise.all([import("./DictionaryLoader-76XPG7YY.js"), f13()]), n10 = new i12(e11.url, e11.config, e11.fieldMap);
  2554. await n10.fetchResources({ spatialReference: s9.spatialReference, fields: s9.fields });
  2555. const l7 = await d6(e11.scaleExpression, s9);
  2556. return new p8(n10, t10, s9, l7, a7, e11.symbolOptions);
  2557. }
  2558. async _analyzeFeature(t10, s9, r13, i12, l7) {
  2559. const o11 = t10.readLegacyFeature(), u12 = this._scaleFn(o11, r13, i12), c9 = this._attributeHash(o11) + "-" + u12, m5 = this._groupIdCache.get(c9);
  2560. if (m5)
  2561. return m5;
  2562. const d7 = { ...i12, spatialReference: this._info.spatialReference, abortOptions: l7, fields: this._info.fields }, h5 = await this._loader.getSymbolAsync(o11, d7), f14 = this._schemaUtilsModule.createSymbolSchema(h5, this._symbolOptions), p9 = n6(f14, this._info, s9, l7).then((t11) => {
  2563. if ("expanded-cim" !== t11.type)
  2564. return n9.error(new s2("mapview-bad-type", `Found unexpected type ${t11.type} in dictionary response`)), null;
  2565. t11.hash += "-" + u12;
  2566. for (const e11 of t11.layers)
  2567. e11.scaleFactor = u12, e11.templateHash += "-" + u12;
  2568. return this._templates.createTemplateGroup(t11, null);
  2569. });
  2570. return this._groupIdCache.put(c9, p9, 1), p9;
  2571. }
  2572. async analyze(e11, t10, s9, r13, i12, a7) {
  2573. const n10 = t10.getCursor(), l7 = [];
  2574. for (; n10.next(); )
  2575. l7.push(this._analyzeFeature(n10, s9, r13, i12, a7));
  2576. return Promise.all(l7);
  2577. }
  2578. match(e11, t10, s9, r13, i12) {
  2579. return null;
  2580. }
  2581. _attributeHash(e11) {
  2582. let t10 = "";
  2583. for (const s9 of this._symbolFields) {
  2584. const r13 = this._fieldMap[s9];
  2585. r13 && (t10 += e11.attributes[r13] + "-");
  2586. }
  2587. return t10;
  2588. }
  2589. };
  2590. export {
  2591. e6 as e,
  2592. E2 as E,
  2593. e9 as e2,
  2594. t7 as t,
  2595. x8 as x,
  2596. l5 as l,
  2597. l6 as l2
  2598. };
  2599. //# sourceMappingURL=chunk-IDINBHDV.js.map