chunk-TQFDJPI3.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. import {
  2. a as a2,
  3. i as i2
  4. } from "./chunk-H3QCF24A.js";
  5. import {
  6. a
  7. } from "./chunk-YJKEIUMW.js";
  8. import {
  9. ge
  10. } from "./chunk-Q4LKAPDF.js";
  11. import {
  12. I
  13. } from "./chunk-23ONSYIH.js";
  14. import {
  15. D as D2,
  16. M2 as M4,
  17. S
  18. } from "./chunk-FUB4YNLX.js";
  19. import {
  20. c,
  21. f as f3
  22. } from "./chunk-GDB2KX4Y.js";
  23. import {
  24. u as u2
  25. } from "./chunk-546QCRS4.js";
  26. import {
  27. t as t2
  28. } from "./chunk-J525NRN3.js";
  29. import {
  30. C,
  31. D,
  32. E,
  33. F,
  34. G,
  35. L,
  36. P,
  37. R
  38. } from "./chunk-MI7HWWFL.js";
  39. import {
  40. e as e2
  41. } from "./chunk-ZHRMTKME.js";
  42. import {
  43. t as t3
  44. } from "./chunk-MFFE4I2S.js";
  45. import {
  46. M as M3,
  47. b,
  48. f as f2,
  49. h,
  50. i,
  51. l as l2,
  52. r as r2
  53. } from "./chunk-CRGVDJI6.js";
  54. import {
  55. g as g2
  56. } from "./chunk-RZFGRBD7.js";
  57. import {
  58. d as d2
  59. } from "./chunk-RMX2AZ4P.js";
  60. import {
  61. l
  62. } from "./chunk-YIS6BAC3.js";
  63. import {
  64. u
  65. } from "./chunk-WEMIK25H.js";
  66. import {
  67. M as M2
  68. } from "./chunk-XNLG7T2T.js";
  69. import {
  70. M2 as M,
  71. j2 as j
  72. } from "./chunk-ECW2QABR.js";
  73. import {
  74. d,
  75. e,
  76. n2 as n,
  77. y3 as y
  78. } from "./chunk-Y3WMVFTW.js";
  79. import {
  80. f,
  81. g
  82. } from "./chunk-ULGDPLM2.js";
  83. import {
  84. s
  85. } from "./chunk-EMJ4ZSM2.js";
  86. import {
  87. r,
  88. t
  89. } from "./chunk-GZT4BVFP.js";
  90. // node_modules/@arcgis/core/views/2d/engine/flow/utils.js
  91. function n2(e4) {
  92. const n3 = i3(a3(e4)), o2 = n3, s5 = true, r4 = Math.max(n3 / 2, 5), l6 = Math.round(u(e4.maxPathLength) / r4) + 1, u7 = 10, { density: c4 } = e4;
  93. return { smoothing: u(e4.smoothing), interpolate: true, velocityScale: e4.flowRepresentation === "flow-from" ? 1 : -1, verticesPerLine: l6, minSpeedThreshold: 1e-3, segmentLength: r4, maxTurnAngle: 1, collisions: s5, lineCollisionWidth: o2, lineSpacing: u7, density: c4 };
  94. }
  95. function i3(e4) {
  96. return e4.kind === "constant" ? e4.value[0] : e4.values[e4.values.length - 1];
  97. }
  98. function o(e4) {
  99. const t6 = e4.toRgba();
  100. return [t6[0] / 255, t6[1] / 255, t6[2] / 255, t6[3]];
  101. }
  102. function s2(e4) {
  103. return { kind: "constant", value: [0.1, 0.1, 0.1, 1] };
  104. }
  105. function a3(e4) {
  106. if (!e4.hasVisualVariables("size"))
  107. return { kind: "constant", value: [u(e4.trailWidth)] };
  108. const n3 = e4.getVisualVariablesForType("size")[0], i4 = [], o2 = [];
  109. let s5;
  110. if (n3.stops) {
  111. for (const e5 of n3.stops)
  112. i4.push(e5.value), o2.push(u(e5.size));
  113. s5 = n3.stops.length;
  114. } else
  115. i4.push(n3.minDataValue, n3.maxDataValue), o2.push(u(n3.minSize), u(n3.maxSize)), s5 = 2;
  116. return { kind: "ramp", stops: i4, values: o2, count: s5 };
  117. }
  118. function r3(e4) {
  119. if (!e4.hasVisualVariables("color"))
  120. return { kind: "constant", value: o(e4.color) };
  121. const t6 = e4.getVisualVariablesForType("color")[0], n3 = [], i4 = [];
  122. for (const s5 of t6.stops)
  123. n3.push(s5.value), Array.prototype.push.apply(i4, o(s5.color));
  124. return { kind: "ramp", stops: n3, values: i4, count: t6.stops.length };
  125. }
  126. function l3(e4) {
  127. if (!e4.hasVisualVariables("opacity"))
  128. return { kind: "constant", value: [1] };
  129. const t6 = e4.getVisualVariablesForType("opacity")[0], n3 = [], i4 = [];
  130. for (const o2 of t6.stops)
  131. n3.push(o2.value), i4.push(o2.opacity);
  132. return { kind: "ramp", stops: n3, values: i4, count: t6.stops.length };
  133. }
  134. function u3(e4, t6, n3, i4) {
  135. switch (t6) {
  136. case "int":
  137. e4.setUniform1iv(n3, i4);
  138. break;
  139. case "float":
  140. e4.setUniform1fv(n3, i4);
  141. break;
  142. case "vec2":
  143. e4.setUniform2fv(n3, i4);
  144. break;
  145. case "vec3":
  146. e4.setUniform3fv(n3, i4);
  147. break;
  148. case "vec4":
  149. e4.setUniform4fv(n3, i4);
  150. }
  151. }
  152. function c2(e4, t6, n3, i4) {
  153. i4.kind === "constant" ? u3(e4, n3, `u_${t6}`, i4.value) : (u3(e4, "float", `u_${t6}_stops`, i4.stops), u3(e4, n3, `u_${t6}_values`, i4.values), e4.setUniform1i(`u_${t6}_count`, i4.count));
  154. }
  155. function p(e4, t6) {
  156. let n3 = true;
  157. return n3 = n3 && e4.collisions === t6.collisions, n3 = n3 && e4.density === t6.density, n3 = n3 && e4.interpolate === t6.interpolate, n3 = n3 && e4.lineCollisionWidth === t6.lineCollisionWidth, n3 = n3 && e4.lineSpacing === t6.lineSpacing, n3 = n3 && e4.maxTurnAngle === t6.maxTurnAngle, n3 = n3 && e4.minSpeedThreshold === t6.minSpeedThreshold, n3 = n3 && e4.segmentLength === t6.segmentLength, n3 = n3 && e4.smoothing === t6.smoothing, n3 = n3 && e4.velocityScale === t6.velocityScale, n3 = n3 && e4.verticesPerLine === t6.verticesPerLine, n3;
  158. }
  159. function f4(t6, n3) {
  160. return t6 === n3 || !(!r(t6) || !r(n3)) && t6.equals(n3);
  161. }
  162. function m(e4, t6) {
  163. if (!p(e4.simulationSettings, t6.simulationSettings))
  164. return false;
  165. if (!f4(e4.timeExtent, t6.timeExtent))
  166. return false;
  167. let n3 = true;
  168. return n3 = n3 && e4.loadImagery === t6.loadImagery, n3 = n3 && e4.createFlowMesh === t6.createFlowMesh, n3 = n3 && e4.color.kind === t6.color.kind, n3 = n3 && e4.opacity.kind === t6.opacity.kind, n3 = n3 && e4.size.kind === t6.size.kind, n3;
  169. }
  170. // node_modules/@arcgis/core/views/2d/engine/flow/styles/Imagery.js
  171. var d3 = class {
  172. constructor(t6) {
  173. this._params = t6, this.animated = false;
  174. }
  175. isCompatible(t6) {
  176. if (!(t6 instanceof d3))
  177. return false;
  178. if (!f4(this._params.timeExtent, t6._params.timeExtent))
  179. return false;
  180. let e4 = true;
  181. return e4 = e4 && this._params.loadImagery === t6._params.loadImagery, e4 = e4 && this._params.color.kind === t6._params.color.kind, e4 = e4 && this._params.opacity.kind === t6._params.opacity.kind, e4;
  182. }
  183. async load(a4, e4) {
  184. const { extent: r4, size: s5 } = a4;
  185. f(e4);
  186. const i4 = await this._params.loadImagery(r4, s5[0], s5[1], this._params.timeExtent, e4);
  187. return new g3(i4, { color: this._params.color, opacity: this._params.opacity });
  188. }
  189. render(t6, a4, r4) {
  190. const { context: s5 } = t6, { program: n3 } = r4;
  191. s5.setFaceCullingEnabled(false), s5.setBlendingEnabled(true), s5.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), s5.useProgram(n3), n3.setUniformMatrix3fv("u_dvsMat3", a4.dvsMat3), s5.bindTexture(r4.texture, 0), n3.setUniform1i("u_texture", 0), n3.setUniform1f("u_Min", r4.min), n3.setUniform1f("u_Max", r4.max), c2(n3, "color", "vec4", this._params.color), c2(n3, "opacity", "float", this._params.opacity), s5.bindVAO(r4.vertexArray), s5.drawArrays(E.TRIANGLE_STRIP, 0, 4);
  192. }
  193. };
  194. var u4 = new Map();
  195. u4.set("a_position", 0), u4.set("a_texcoord", 1);
  196. var w = { geometry: [new t2("a_position", 2, C.UNSIGNED_SHORT, 0, 8), new t2("a_texcoord", 2, C.UNSIGNED_SHORT, 4, 8)] };
  197. var x = { vsPath: "raster/flow/imagery", fsPath: "raster/flow/imagery", attributes: u4 };
  198. var g3 = class {
  199. constructor(t6, a4) {
  200. this._flowData = t6, this._values = a4;
  201. }
  202. attach(t6) {
  203. const { context: a4 } = t6, { width: e4, height: s5 } = this._flowData, i4 = c.createVertex(a4, F.STATIC_DRAW, new Uint16Array([0, 0, 0, 1, e4, 0, 1, 1, 0, s5, 0, 0, e4, s5, 1, 0])), o2 = new f3(a4, u4, w, { geometry: i4 }), f9 = [];
  204. this._values.color.kind === "ramp" && f9.push("vvColor"), this._values.opacity.kind === "ramp" && f9.push("vvOpacity");
  205. const d7 = t6.painter.materialManager.getProgram(x, f9);
  206. let g6 = 1e6, y5 = -1e6;
  207. for (let r4 = 0; r4 < s5; r4++)
  208. for (let t7 = 0; t7 < e4; t7++)
  209. if (this._flowData.mask[r4 * e4 + t7] !== 0) {
  210. const a5 = this._flowData.data[2 * (r4 * e4 + t7) + 0], s6 = this._flowData.data[2 * (r4 * e4 + t7) + 1], i5 = Math.sqrt(a5 * a5 + s6 * s6);
  211. g6 = Math.min(g6, i5), y5 = Math.max(y5, i5);
  212. }
  213. const A = new Uint8Array(4 * e4 * s5);
  214. for (let r4 = 0; r4 < s5; r4++)
  215. for (let t7 = 0; t7 < e4; t7++)
  216. if (this._flowData.mask[r4 * e4 + t7] !== 0) {
  217. const a5 = this._flowData.data[2 * (r4 * e4 + t7) + 0], s6 = this._flowData.data[2 * (r4 * e4 + t7) + 1], i5 = (Math.sqrt(a5 * a5 + s6 * s6) - g6) / (y5 - g6);
  218. A[4 * (r4 * e4 + t7) + 0] = 255 * i5, A[4 * (r4 * e4 + t7) + 1] = 0, A[4 * (r4 * e4 + t7) + 2] = 0, A[4 * (r4 * e4 + t7) + 3] = 255;
  219. } else
  220. A[4 * (r4 * e4 + t7) + 0] = 0, A[4 * (r4 * e4 + t7) + 1] = 0, A[4 * (r4 * e4 + t7) + 2] = 0, A[4 * (r4 * e4 + t7) + 3] = 0;
  221. const E2 = new u2(a4, { pixelFormat: P.RGBA, internalFormat: P.RGBA, samplingMode: L.LINEAR, dataType: G.UNSIGNED_BYTE, wrapMode: D.CLAMP_TO_EDGE, flipped: true, width: e4, height: s5 }, A);
  222. this.vertexArray = o2, this.program = d7, this.texture = E2, this.min = g6, this.max = y5, this._flowData = null;
  223. }
  224. detach() {
  225. this.vertexArray.dispose(), this.texture.dispose();
  226. }
  227. get ready() {
  228. return this.program.isCompiled;
  229. }
  230. };
  231. // node_modules/@arcgis/core/views/2d/engine/flow/styles/Particles.js
  232. var _ = class {
  233. constructor(t6) {
  234. this._params = t6;
  235. }
  236. get animated() {
  237. return this._params.flowSpeed > 0;
  238. }
  239. isCompatible(t6) {
  240. return t6 instanceof _ && m(this._params, t6._params);
  241. }
  242. async load(e4, a4) {
  243. const { extent: s5, size: r4 } = e4;
  244. f(a4);
  245. const i4 = await this._params.loadImagery(s5, r4[0], r4[1], this._params.timeExtent, a4), { vertexData: o2, indexData: n3 } = await this._params.createFlowMesh("Particles", this._params.simulationSettings, i4, a4);
  246. return new c3(o2, n3, { color: this._params.color, opacity: this._params.opacity, size: this._params.size });
  247. }
  248. render(t6, e4, s5) {
  249. const { context: n3 } = t6, { program: m3 } = s5;
  250. n3.setFaceCullingEnabled(false), n3.setBlendingEnabled(true), n3.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), n3.useProgram(m3), m3.setUniform1f("u_time", e4.time), m3.setUniform1f("u_trailLength", this._params.trailLength), m3.setUniform1f("u_flowSpeed", this._params.flowSpeed), m3.setUniform1f("u_featheringSize", this._params.featheringSize), m3.setUniform1f("u_featheringOffset", this._params.featheringOffset), m3.setUniform1f("u_introFade", this._params.introFade ? 1 : 0), m3.setUniform1f("u_fadeToZero", this._params.fadeToZero ? 1 : 0), m3.setUniform1f("u_decayRate", this._params.decayRate), m3.setUniformMatrix3fv("u_dvsMat3", e4.dvsMat3), m3.setUniformMatrix3fv("u_displayViewMat3", e4.displayViewMat3), c2(m3, "color", "vec4", this._params.color), c2(m3, "opacity", "float", this._params.opacity), c2(m3, "size", "float", this._params.size), n3.bindVAO(s5.vertexArray), n3.drawElements(E.TRIANGLES, s5.indexCount, C.UNSIGNED_INT, 0);
  251. }
  252. };
  253. var l4 = new Map();
  254. l4.set("a_xyts0", 0), l4.set("a_xyts1", 1), l4.set("a_typeIdDurationSeed", 2), l4.set("a_extrudeInfo", 3);
  255. var h2 = { geometry: [new t2("a_xyts0", 4, C.FLOAT, 0, 64), new t2("a_xyts1", 4, C.FLOAT, 16, 64), new t2("a_typeIdDurationSeed", 4, C.FLOAT, 32, 64), new t2("a_extrudeInfo", 4, C.FLOAT, 48, 64)] };
  256. var f5 = { vsPath: "raster/flow/particles", fsPath: "raster/flow/particles", attributes: l4 };
  257. var c3 = class {
  258. constructor(t6, e4, a4) {
  259. this._vertexData = t6, this._indexData = e4, this._values = a4;
  260. }
  261. attach(t6) {
  262. const { context: e4 } = t6, a4 = c.createVertex(e4, F.STATIC_DRAW, this._vertexData), r4 = c.createIndex(e4, F.STATIC_DRAW, this._indexData), i4 = new f3(e4, l4, h2, { geometry: a4 }, r4), o2 = [];
  263. this._values.color.kind === "ramp" && o2.push("vvColor"), this._values.opacity.kind === "ramp" && o2.push("vvOpacity"), this._values.size.kind === "ramp" && o2.push("vvSize");
  264. const p3 = t6.painter.materialManager.getProgram(f5, o2);
  265. this.vertexArray = i4, this.program = p3, this.indexCount = this._indexData.length, this._vertexData = null, this._indexData = null;
  266. }
  267. detach() {
  268. this.vertexArray.dispose();
  269. }
  270. get ready() {
  271. return this.program.isCompiled;
  272. }
  273. };
  274. // node_modules/@arcgis/core/views/2d/engine/flow/styles/Stack.js
  275. var t4 = class {
  276. constructor(t6) {
  277. this._styles = t6;
  278. }
  279. get animated() {
  280. return this._styles.reduce((t6, s5) => t6 || s5.animated, false);
  281. }
  282. isCompatible(s5) {
  283. if (!(s5 instanceof t4))
  284. return false;
  285. if (this._styles.length !== s5._styles.length)
  286. return false;
  287. const e4 = this._styles.length;
  288. for (let t6 = 0; t6 < e4; t6++)
  289. if (!this._styles[t6].isCompatible(s5._styles[t6]))
  290. return false;
  291. return true;
  292. }
  293. async load(t6, e4) {
  294. const r4 = await Promise.all(this._styles.map((s5) => s5.load(t6, e4)));
  295. return new s3(r4);
  296. }
  297. render(t6, s5, e4) {
  298. for (let r4 = 0; r4 < this._styles.length; r4++)
  299. this._styles[r4].render(t6, s5, e4.resources[r4]);
  300. }
  301. };
  302. var s3 = class {
  303. constructor(t6) {
  304. this.resources = t6;
  305. }
  306. attach(t6) {
  307. for (const s5 of this.resources)
  308. s5.attach(t6);
  309. }
  310. detach() {
  311. for (const t6 of this.resources)
  312. t6.detach();
  313. }
  314. get ready() {
  315. return this.resources.reduce((t6, s5) => t6 && s5.ready, true);
  316. }
  317. };
  318. // node_modules/@arcgis/core/views/2d/engine/flow/styles/Streamlines.js
  319. var _2 = class {
  320. constructor(t6) {
  321. this._params = t6;
  322. }
  323. get animated() {
  324. return this._params.flowSpeed > 0;
  325. }
  326. isCompatible(t6) {
  327. return t6 instanceof _2 && m(this._params, t6._params);
  328. }
  329. async load(e4, a4) {
  330. const { extent: s5, size: r4 } = e4;
  331. f(a4);
  332. const i4 = await this._params.loadImagery(s5, r4[0], r4[1], this._params.timeExtent, a4), { vertexData: o2, indexData: n3 } = await this._params.createFlowMesh("Streamlines", this._params.simulationSettings, i4, a4);
  333. return new d4(o2, n3, { color: this._params.color, opacity: this._params.opacity, size: this._params.size });
  334. }
  335. render(t6, e4, s5) {
  336. const { context: n3 } = t6, { program: m3 } = s5;
  337. n3.setFaceCullingEnabled(false), n3.setBlendingEnabled(true), n3.setBlendFunction(R.ONE, R.ONE_MINUS_SRC_ALPHA), n3.useProgram(m3), m3.setUniform1f("u_time", e4.time), m3.setUniform1f("u_trailLength", this._params.trailLength), m3.setUniform1f("u_flowSpeed", this._params.flowSpeed), m3.setUniform1f("u_featheringSize", this._params.featheringSize), m3.setUniform1f("u_featheringOffset", this._params.featheringOffset), m3.setUniform1f("u_introFade", this._params.introFade ? 1 : 0), m3.setUniform1f("u_fadeToZero", this._params.fadeToZero ? 1 : 0), m3.setUniform1f("u_decayRate", this._params.decayRate), m3.setUniformMatrix3fv("u_dvsMat3", e4.dvsMat3), m3.setUniformMatrix3fv("u_displayViewMat3", e4.displayViewMat3), c2(m3, "color", "vec4", this._params.color), c2(m3, "opacity", "float", this._params.opacity), c2(m3, "size", "float", this._params.size), n3.bindVAO(s5.vertexArray), n3.drawElements(E.TRIANGLES, s5.indexCount, C.UNSIGNED_INT, 0);
  338. }
  339. };
  340. var l5 = new Map();
  341. l5.set("a_positionAndSide", 0), l5.set("a_timeInfo", 1), l5.set("a_extrude", 2), l5.set("a_speed", 3);
  342. var h3 = { geometry: [new t2("a_positionAndSide", 3, C.FLOAT, 0, 36), new t2("a_timeInfo", 3, C.FLOAT, 12, 36), new t2("a_extrude", 2, C.FLOAT, 24, 36), new t2("a_speed", 1, C.FLOAT, 32, 36)] };
  343. var f6 = { vsPath: "raster/flow/streamlines", fsPath: "raster/flow/streamlines", attributes: l5 };
  344. var d4 = class {
  345. constructor(t6, e4, a4) {
  346. this._vertexData = t6, this._indexData = e4, this._values = a4;
  347. }
  348. attach(t6) {
  349. const { context: e4 } = t6, a4 = c.createVertex(e4, F.STATIC_DRAW, this._vertexData), r4 = c.createIndex(e4, F.STATIC_DRAW, this._indexData), i4 = new f3(e4, l5, h3, { geometry: a4 }, r4), o2 = [];
  350. this._values.color.kind === "ramp" && o2.push("vvColor"), this._values.opacity.kind === "ramp" && o2.push("vvOpacity"), this._values.size.kind === "ramp" && o2.push("vvSize");
  351. const p3 = t6.painter.materialManager.getProgram(f6, o2);
  352. this.vertexArray = i4, this.program = p3, this.indexCount = this._indexData.length, this._vertexData = null, this._indexData = null;
  353. }
  354. detach() {
  355. this.vertexArray.dispose();
  356. }
  357. get ready() {
  358. return this.program.isCompiled;
  359. }
  360. };
  361. // node_modules/@arcgis/core/views/2d/engine/flow/createFlowStyle.js
  362. var f7 = 4;
  363. var p2 = 1;
  364. var u5 = 0.5;
  365. var y2 = true;
  366. var d5 = true;
  367. var g4 = 2.3;
  368. function w2(w3, h6) {
  369. const { flowSpeed: j2, trailLength: v } = w3, S2 = n2(w3);
  370. let k = null;
  371. const x2 = { opacity: l3(w3), size: a3(w3) };
  372. let I2 = r3(w3);
  373. if (w3.background === "none")
  374. x2.color = I2;
  375. else {
  376. I2.kind === "constant" && (I2 = { kind: "ramp", stops: [0, 1], values: [0, 0, 0, 1, I2.value[0], I2.value[1], I2.value[2], I2.value[3]], count: 2 });
  377. const e4 = { loadImagery: h6.loadImagery, timeExtent: h6.timeExtent, color: I2, opacity: { kind: "constant", value: [1] } };
  378. k = new d3(e4), x2.color = s2();
  379. }
  380. const z = { loadImagery: h6.loadImagery, createFlowMesh: h6.createFlowMesh, simulationSettings: S2, timeExtent: h6.timeExtent, trailLength: v, flowSpeed: j2, featheringSize: p2, featheringOffset: u5, introFade: y2, fadeToZero: d5, decayRate: g4, color: x2.color, opacity: x2.opacity, size: x2.size }, E2 = w3.trailCap === "butt" || i3(a3(w3)) <= f7 ? new _2(z) : new _(z);
  381. return r(k) ? new t4([k, E2]) : E2;
  382. }
  383. // node_modules/@arcgis/core/views/2d/engine/flow/FlowContainer.js
  384. var t5 = class extends a2 {
  385. constructor() {
  386. super(...arguments), this.flowStyle = null;
  387. }
  388. get requiresDedicatedFBO() {
  389. return false;
  390. }
  391. doRender(e4) {
  392. super.doRender(e4);
  393. }
  394. prepareRenderPasses(s5) {
  395. const t6 = s5.registerRenderPass({ name: "flow", brushes: [i2], target: () => this.children, drawPhase: I.MAP });
  396. return [...super.prepareRenderPasses(s5), t6];
  397. }
  398. };
  399. // node_modules/@arcgis/core/views/2d/engine/flow/FlowDisplayData.js
  400. var e3 = s.getLogger("esri.views.2d.engine.flow.FlowDisplayData");
  401. var s4 = class {
  402. constructor(t6, e4, s5, a4) {
  403. this.state = { name: "created" }, this.flowStyle = t6, this.extent = e4, this.size = s5, this.pixelRatio = a4;
  404. }
  405. async load() {
  406. const t6 = new AbortController();
  407. this.state = { name: "loading", abortController: t6 };
  408. const e4 = { extent: this.extent, size: this.size, pixelRatio: this.pixelRatio }, s5 = await this.flowStyle.load(e4, t6.signal);
  409. this.state = { name: "loaded", resources: s5 };
  410. }
  411. attach(t6) {
  412. if (this.state.name !== "loaded")
  413. return void e3.error("Only loaded resources can be attached.");
  414. const s5 = this.state.resources;
  415. s5.attach(t6), this.state = { name: "attached", resources: s5 };
  416. }
  417. detach() {
  418. if (this.state.name === "loading")
  419. return this.state.abortController.abort(), void (this.state = { name: "detached" });
  420. this.state.name === "attached" && (this.state.resources.detach(), this.state = { name: "detached" });
  421. }
  422. update(t6) {
  423. if (!this.flowStyle.isCompatible(t6.flowStyle))
  424. return false;
  425. return !(!this.extent.equals(t6.extent) || this.size[0] !== t6.size[0] || this.size[1] !== t6.size[1] || this.pixelRatio !== t6.pixelRatio) && (this.flowStyle = t6.flowStyle, true);
  426. }
  427. };
  428. // node_modules/@arcgis/core/views/2d/engine/flow/FlowDisplayObject.js
  429. var m2 = class extends a {
  430. constructor() {
  431. super(...arguments), this._displayData = null;
  432. }
  433. get displayData() {
  434. return this._displayData;
  435. }
  436. set displayData(t6) {
  437. this._displayData = t6, this.requestRender();
  438. }
  439. clear() {
  440. r(this._displayData) && (this._displayData.detach(), this._displayData = null, this.requestRender());
  441. }
  442. setTransform(s5) {
  443. const { displayData: n3 } = this;
  444. if (t(n3))
  445. return;
  446. const l6 = n3.extent.xmin, m3 = n3.extent.ymax, p3 = [0, 0];
  447. s5.toScreen(p3, [l6, m3]);
  448. const c4 = (n3.extent.xmax - n3.extent.xmin) / n3.size[0] / s5.resolution, d7 = M2(s5.rotation), { dvs: h6 } = this.transforms;
  449. l2(h6, [-1, 1, 0]), f2(h6, h6, [2 / (s5.size[0] * s5.pixelRatio), -2 / (s5.size[1] * s5.pixelRatio), 1]), M3(h6, h6, [p3[0], p3[1], 0]), h(h6, h6, d7), f2(h6, h6, [c4 * s5.pixelRatio, c4 * s5.pixelRatio, 1]);
  450. }
  451. _createTransforms() {
  452. return { dvs: e2() };
  453. }
  454. };
  455. // node_modules/@arcgis/core/views/2d/engine/flow/FlowStrategy.js
  456. var h4 = 1.15;
  457. var y3 = s.getLogger("esri.views.2d.engine.flow.FlowStrategy");
  458. var f8 = class extends y {
  459. constructor(t6) {
  460. super(t6), this._flowDisplayObject = new m2(), this._loading = null;
  461. }
  462. initialize() {
  463. this.flowContainer.addChild(this._flowDisplayObject);
  464. }
  465. destroy() {
  466. this._clear(), this.flowContainer.removeAllChildren();
  467. }
  468. get updating() {
  469. return this._loading != null;
  470. }
  471. update(t6) {
  472. const { flowStyle: o2 } = this.flowContainer;
  473. if (t(o2))
  474. return void this._clear();
  475. const { extent: e4, rotation: i4, resolution: l6, pixelRatio: n3 } = t6.state, p3 = g5(e4, i4);
  476. p3.expand(h4);
  477. const m3 = [Math.round((p3.xmax - p3.xmin) / l6), Math.round((p3.ymax - p3.ymin) / l6)], d7 = new s4(o2, p3, m3, n3);
  478. if (r(this._loading)) {
  479. if (this._loading.update(d7))
  480. return;
  481. this._loading.detach(), this._loading = null;
  482. }
  483. !t(this._flowDisplayObject.displayData) && this._flowDisplayObject.displayData.update(d7) || (d7.load().then(() => {
  484. this._flowDisplayObject.clear(), this._flowDisplayObject.displayData = this._loading, this._loading = null;
  485. }, (t7) => {
  486. g(t7) || (y3.error("A resource failed to load.", t7), this._loading = null);
  487. }), this._loading = d7);
  488. }
  489. _clear() {
  490. this._flowDisplayObject.clear(), r(this._loading) && (this._loading.detach(), this._loading = null);
  491. }
  492. };
  493. e([d()], f8.prototype, "_loading", void 0), e([d()], f8.prototype, "flowContainer", void 0), e([d()], f8.prototype, "updating", null), f8 = e([n("esri.views.2d.engine.flow.FlowStrategy")], f8);
  494. var u6 = f8;
  495. function g5(t6, o2) {
  496. const e4 = new j({ x: (t6.xmax + t6.xmin) / 2, y: (t6.ymax + t6.ymin) / 2, spatialReference: t6.spatialReference }), r4 = t6.xmax - t6.xmin, s5 = t6.ymax - t6.ymin, a4 = Math.abs(Math.cos(M2(o2))), l6 = Math.abs(Math.sin(M2(o2))), n3 = a4 * r4 + l6 * s5, c4 = l6 * r4 + a4 * s5, m3 = new M({ xmin: e4.x - n3 / 2, ymin: e4.y - c4 / 2, xmax: e4.x + n3 / 2, ymax: e4.y + c4 / 2, spatialReference: t6.spatialReference });
  497. return m3.centerAt(e4), m3;
  498. }
  499. // node_modules/@arcgis/core/views/2d/engine/flow/FlowView2D.js
  500. var h5 = class extends d2 {
  501. constructor() {
  502. super(...arguments), this._loadImagery = (t6, e4, i4, r4, o2) => M4(this.layer, t6, e4, i4, r4, o2), this._createFlowMesh = (t6, e4, i4, r4) => this.layer.createFlowMesh({ meshType: t6, flowData: i4, simulationSettings: e4 }, { signal: r4 }), this.attached = false, this.container = null, this.layer = null, this.type = "flow", this.timeExtent = null, this.redrawOrRefetch = async () => {
  503. this._updateVisualization();
  504. };
  505. }
  506. get updating() {
  507. return !this._strategy || this._strategy.updating;
  508. }
  509. attach() {
  510. const { layer: t6 } = this, e4 = () => {
  511. this._loadImagery = (e5, i4, r4, o2, s5) => M4(t6, e5, i4, r4, o2, s5), this._updateVisualization();
  512. };
  513. "multidimensionalDefinition" in t6 ? this.handles.add(l(() => t6.multidimensionalDefinition, e4)) : this.handles.add([l(() => t6.mosaicRule, e4), l(() => t6.renderingRule, e4), l(() => t6.definitionExpression, e4)]), this.container = new t5(), this._strategy = new u6({ flowContainer: this.container }), this._updateVisualization();
  514. }
  515. detach() {
  516. this._strategy.destroy(), this.container.removeAllChildren(), this.container = null, this.handles.removeAll();
  517. }
  518. update(t6) {
  519. t6.stationary ? this._strategy.update(t6) : this.layerView.requestUpdate();
  520. }
  521. hitTest(t6) {
  522. return new g2({ attributes: {}, geometry: t6.clone(), layer: this.layer });
  523. }
  524. moveEnd() {
  525. }
  526. async doRefresh() {
  527. }
  528. _updateVisualization() {
  529. const { renderer: t6 } = this.layer;
  530. if (t6.type !== "flow")
  531. return;
  532. const e4 = w2(t6, { loadImagery: this._loadImagery, createFlowMesh: this._createFlowMesh, timeExtent: this.timeExtent });
  533. this.container.flowStyle = e4, this.layerView.requestUpdate();
  534. }
  535. };
  536. e([d()], h5.prototype, "_strategy", void 0), e([d()], h5.prototype, "attached", void 0), e([d()], h5.prototype, "container", void 0), e([d()], h5.prototype, "layer", void 0), e([d()], h5.prototype, "layerView", void 0), e([d()], h5.prototype, "type", void 0), e([d()], h5.prototype, "updating", null), e([d()], h5.prototype, "timeExtent", void 0), h5 = e([n("esri.views.2d.engine.flow.FlowView2D")], h5);
  537. var d6 = h5;
  538. // node_modules/@arcgis/core/views/2d/engine/imagery/RasterVFDisplayObject.js
  539. var y4 = class extends a {
  540. constructor(t6 = null) {
  541. super(), this._source = null, this._symbolizerParameters = null, this._vaoInvalidated = true, this.coordScale = [1, 1], this.height = null, this.stencilRef = 0, this.resolution = null, this.pixelRatio = 1, this.x = 0, this.y = 0, this.rotation = 0, this.rawPixelData = null, this.width = null, this.source = t6;
  542. }
  543. destroy() {
  544. r(this.vaoData) && (this.vaoData.magdir?.vao.dispose(), this.vaoData.scalar?.vao.dispose(), this.vaoData = null);
  545. }
  546. get symbolizerParameters() {
  547. return this._symbolizerParameters;
  548. }
  549. set symbolizerParameters(t6) {
  550. JSON.stringify(this._symbolizerParameters) !== JSON.stringify(t6) && (this._symbolizerParameters = t6, this.invalidateVAO());
  551. }
  552. get source() {
  553. return this._source;
  554. }
  555. set source(t6) {
  556. this._source = t6, this.invalidateVAO();
  557. }
  558. invalidateVAO() {
  559. !this._vaoInvalidated && r(this.vaoData) && (this.vaoData.magdir?.vao.dispose(), this.vaoData.scalar?.vao.dispose(), this.vaoData = null, this._vaoInvalidated = true, this.requestRender());
  560. }
  561. updateVectorFieldVAO(s5) {
  562. if (this._vaoInvalidated) {
  563. if (this._vaoInvalidated = false, r(this.source) && t(this.vaoData)) {
  564. const { style: t6 } = this.symbolizerParameters;
  565. switch (t6) {
  566. case "beaufort_ft":
  567. case "beaufort_km":
  568. case "beaufort_kn":
  569. case "beaufort_m":
  570. case "beaufort_mi":
  571. case "classified_arrow":
  572. case "ocean_current_kn":
  573. case "ocean_current_m":
  574. case "single_arrow":
  575. {
  576. const t7 = D2(this.source, this.symbolizerParameters), e4 = this._createVectorFieldVAO(s5.context, t7);
  577. this.vaoData = { magdir: e4 };
  578. }
  579. break;
  580. case "simple_scalar":
  581. {
  582. const t7 = S(this.source, this.symbolizerParameters), e4 = this._createVectorFieldVAO(s5.context, t7);
  583. this.vaoData = { scalar: e4 };
  584. }
  585. break;
  586. case "wind_speed": {
  587. const t7 = D2(this.source, this.symbolizerParameters), e4 = this._createVectorFieldVAO(s5.context, t7), a4 = S(this.source, this.symbolizerParameters), r4 = this._createVectorFieldVAO(s5.context, a4);
  588. this.vaoData = { magdir: e4, scalar: r4 };
  589. }
  590. }
  591. }
  592. this.ready(), this.requestRender();
  593. }
  594. }
  595. _createTransforms() {
  596. return { dvs: e2() };
  597. }
  598. setTransform(t6) {
  599. const e4 = r2(this.transforms.dvs), [n3, l6] = t6.toScreenNoRotation([0, 0], [this.x, this.y]), h6 = this.resolution / this.pixelRatio / t6.resolution, m3 = h6 * this.width, u7 = h6 * this.height, d7 = Math.PI * this.rotation / 180;
  600. M3(e4, e4, t3(n3, l6)), M3(e4, e4, t3(m3 / 2, u7 / 2)), h(e4, e4, -d7), M3(e4, e4, t3(-m3 / 2, -u7 / 2)), b(e4, e4, t3(m3, u7)), i(this.transforms.dvs, t6.displayViewMat3, e4);
  601. }
  602. onAttach() {
  603. this.invalidateVAO();
  604. }
  605. onDetach() {
  606. this.invalidateVAO();
  607. }
  608. _createVectorFieldVAO(t6, e4) {
  609. const { vertexData: s5, indexData: a4 } = e4, r4 = c.createVertex(t6, F.STATIC_DRAW, new Float32Array(s5)), i4 = c.createIndex(t6, F.STATIC_DRAW, new Uint32Array(a4)), o2 = ge("vector-field", { geometry: [{ location: 0, name: "a_pos", count: 2, type: C.FLOAT, normalized: false }, { location: 1, name: "a_offset", count: 2, type: C.FLOAT, normalized: false }, { location: 2, name: "a_vv", count: 2, type: C.FLOAT, normalized: false }] });
  610. return { vao: new f3(t6, o2.attributes, o2.bufferLayouts, { geometry: r4 }, i4), elementCount: a4.length };
  611. }
  612. };
  613. export {
  614. d6 as d,
  615. y4 as y
  616. };
  617. //# sourceMappingURL=chunk-TQFDJPI3.js.map