chunk-ZIWBDWEW.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. import {
  2. i
  3. } from "./chunk-IQNZZCQJ.js";
  4. import {
  5. A,
  6. E,
  7. S,
  8. _
  9. } from "./chunk-23ONSYIH.js";
  10. import {
  11. s3 as s
  12. } from "./chunk-EMJ4ZSM2.js";
  13. // node_modules/@arcgis/core/views/2d/engine/webgl/materialKey/MaterialKey.js
  14. function n(t, e, s2) {
  15. const n2 = A.SIZE_FIELD_STOPS | A.SIZE_MINMAX_VALUE | A.SIZE_SCALE_STOPS | A.SIZE_UNIT_VALUE, o2 = (e & (_.FIELD_TARGETS_OUTLINE | _.MINMAX_TARGETS_OUTLINE | _.SCALE_TARGETS_OUTLINE | _.UNIT_TARGETS_OUTLINE)) >>> 4;
  16. return t === E.LINE && s2.isOutline || t === E.FILL && _2(s2.symbologyType) ? n2 & o2 : n2 & ~o2;
  17. }
  18. var o = 0;
  19. var v = 8;
  20. var l = 7;
  21. var h = 8;
  22. var S2 = 11;
  23. var u = 11;
  24. var p = 12;
  25. var c = 13;
  26. var y = 14;
  27. var V = 15;
  28. var d = 16;
  29. var g = 17;
  30. var T = 18;
  31. var m = 19;
  32. var z = 20;
  33. var E2 = 21;
  34. var L = 26;
  35. var M = Object.keys(S).filter((t) => typeof S[t] == "number").reduce((t, e) => ({ ...t, [e]: S[e] }), {});
  36. function I(t) {
  37. return t === S.SIMPLE || t === S.OUTLINE_FILL_SIMPLE;
  38. }
  39. function _2(t) {
  40. return t === S.OUTLINE_FILL || t === S.OUTLINE_FILL_SIMPLE;
  41. }
  42. function b(t) {
  43. return I(t.symbologyType);
  44. }
  45. function O(t) {
  46. return _2(t.symbologyType);
  47. }
  48. function f(t, e) {
  49. switch (t) {
  50. case E.FILL:
  51. return w.from(e);
  52. case E.LINE:
  53. return C.from(e);
  54. case E.MARKER:
  55. return N.from(e);
  56. case E.TEXT:
  57. return P.from(e);
  58. case E.LABEL:
  59. return Z.from(e);
  60. default:
  61. throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`);
  62. }
  63. }
  64. function A2(t) {
  65. switch (U.load(t).geometryType) {
  66. case E.MARKER:
  67. return new N(t);
  68. case E.FILL:
  69. return new w(t);
  70. case E.LINE:
  71. return new C(t);
  72. case E.TEXT:
  73. return new P(t);
  74. case E.LABEL:
  75. return new Z(t);
  76. }
  77. }
  78. var U = class {
  79. constructor(t) {
  80. this._data = 0, this._data = t;
  81. }
  82. static load(t) {
  83. const e = this.shared;
  84. return e.data = t, e;
  85. }
  86. set data(t) {
  87. this._data = t;
  88. }
  89. get data() {
  90. return this._data;
  91. }
  92. get geometryType() {
  93. return this.bits(h, S2);
  94. }
  95. set geometryType(t) {
  96. this.setBits(t, h, S2);
  97. }
  98. get mapAligned() {
  99. return !!this.bit(z);
  100. }
  101. set mapAligned(t) {
  102. this.setBit(z, t);
  103. }
  104. get sdf() {
  105. return !!this.bit(u);
  106. }
  107. set sdf(t) {
  108. this.setBit(u, t);
  109. }
  110. get pattern() {
  111. return !!this.bit(p);
  112. }
  113. set pattern(t) {
  114. this.setBit(p, t);
  115. }
  116. get textureBinding() {
  117. return this.bits(o, v);
  118. }
  119. set textureBinding(t) {
  120. this.setBits(t, o, v);
  121. }
  122. get symbologyType() {
  123. return this.bits(E2, L);
  124. }
  125. set symbologyType(t) {
  126. this.setBits(t, E2, L);
  127. }
  128. get geometryTypeString() {
  129. switch (this.geometryType) {
  130. case E.FILL:
  131. return "fill";
  132. case E.MARKER:
  133. return "marker";
  134. case E.LINE:
  135. return "line";
  136. case E.TEXT:
  137. return "text";
  138. case E.LABEL:
  139. return "label";
  140. default:
  141. throw new s(`Unable to handle unknown geometryType: ${this.geometryType}`);
  142. }
  143. }
  144. setBit(t, e) {
  145. const s2 = 1 << t;
  146. e ? this._data |= s2 : this._data &= ~s2;
  147. }
  148. bit(t) {
  149. return (this._data & 1 << t) >> t;
  150. }
  151. setBits(t, e, s2) {
  152. for (let i2 = e, a = 0; i2 < s2; i2++, a++)
  153. this.setBit(i2, (t & 1 << a) != 0);
  154. }
  155. bits(t, e) {
  156. let s2 = 0;
  157. for (let i2 = t, a = 0; i2 < e; i2++, a++)
  158. s2 |= this.bit(i2) << a;
  159. return s2;
  160. }
  161. hasVV() {
  162. return false;
  163. }
  164. setVV(t, e) {
  165. }
  166. getVariation() {
  167. return { mapAligned: this.mapAligned, pattern: this.pattern, sdf: this.sdf, symbologyType: { value: S[this.symbologyType], options: M, namespace: "SYMBOLOGY_TYPE" } };
  168. }
  169. getVariationHash() {
  170. return this._data & ~(l & this.textureBinding);
  171. }
  172. };
  173. U.shared = new U(0);
  174. var F = (t) => class extends t {
  175. get vvSizeMinMaxValue() {
  176. return this.bit(d) !== 0;
  177. }
  178. set vvSizeMinMaxValue(t2) {
  179. this.setBit(d, t2);
  180. }
  181. get vvSizeScaleStops() {
  182. return this.bit(g) !== 0;
  183. }
  184. set vvSizeScaleStops(t2) {
  185. this.setBit(g, t2);
  186. }
  187. get vvSizeFieldStops() {
  188. return this.bit(T) !== 0;
  189. }
  190. set vvSizeFieldStops(t2) {
  191. this.setBit(T, t2);
  192. }
  193. get vvSizeUnitValue() {
  194. return this.bit(m) !== 0;
  195. }
  196. set vvSizeUnitValue(t2) {
  197. this.setBit(m, t2);
  198. }
  199. hasVV() {
  200. return super.hasVV() || this.vvSizeMinMaxValue || this.vvSizeScaleStops || this.vvSizeFieldStops || this.vvSizeUnitValue;
  201. }
  202. setVV(t2, e) {
  203. super.setVV(t2, e);
  204. const s2 = n(this.geometryType, t2, e) & t2;
  205. this.vvSizeMinMaxValue = !!(s2 & A.SIZE_MINMAX_VALUE), this.vvSizeFieldStops = !!(s2 & A.SIZE_FIELD_STOPS), this.vvSizeUnitValue = !!(s2 & A.SIZE_UNIT_VALUE), this.vvSizeScaleStops = !!(s2 & A.SIZE_SCALE_STOPS);
  206. }
  207. };
  208. var x = (t) => class extends t {
  209. get vvRotation() {
  210. return this.bit(V) !== 0;
  211. }
  212. set vvRotation(t2) {
  213. this.setBit(V, t2);
  214. }
  215. hasVV() {
  216. return super.hasVV() || this.vvRotation;
  217. }
  218. setVV(t2, e) {
  219. super.setVV(t2, e), this.vvRotation = !e.isOutline && !!(t2 & A.ROTATION);
  220. }
  221. };
  222. var B = (t) => class extends t {
  223. get vvColor() {
  224. return this.bit(c) !== 0;
  225. }
  226. set vvColor(t2) {
  227. this.setBit(c, t2);
  228. }
  229. hasVV() {
  230. return super.hasVV() || this.vvColor;
  231. }
  232. setVV(t2, e) {
  233. super.setVV(t2, e), this.vvColor = !e.isOutline && !!(t2 & A.COLOR);
  234. }
  235. };
  236. var R = (t) => class extends t {
  237. get vvOpacity() {
  238. return this.bit(y) !== 0;
  239. }
  240. set vvOpacity(t2) {
  241. this.setBit(y, t2);
  242. }
  243. hasVV() {
  244. return super.hasVV() || this.vvOpacity;
  245. }
  246. setVV(t2, e) {
  247. super.setVV(t2, e), this.vvOpacity = !e.isOutline && !!(t2 & A.OPACITY);
  248. }
  249. };
  250. var w = class extends B(R(F(U))) {
  251. static load(t) {
  252. const e = this.shared;
  253. return e.data = t, e;
  254. }
  255. static from(t) {
  256. const { symbologyType: e, vvFlags: a } = t, r = this.load(0);
  257. return r.geometryType = E.FILL, r.symbologyType = e, e !== S.DOT_DENSITY && r.setVV(a, t), r.data;
  258. }
  259. getVariation() {
  260. return { ...super.getVariation(), vvColor: this.vvColor, vvOpacity: this.vvOpacity, vvSizeFieldStops: this.vvSizeFieldStops, vvSizeMinMaxValue: this.vvSizeMinMaxValue, vvSizeScaleStops: this.vvSizeScaleStops, vvSizeUnitValue: this.vvSizeUnitValue };
  261. }
  262. };
  263. w.shared = new w(0);
  264. var N = class extends B(R(x(F(U)))) {
  265. static load(t) {
  266. const e = this.shared;
  267. return e.data = t, e;
  268. }
  269. static from(t) {
  270. const { symbologyType: e, vvFlags: a } = t, r = this.load(0);
  271. return r.geometryType = E.MARKER, r.symbologyType = e, e !== S.HEATMAP && r.setVV(a, t), r.data;
  272. }
  273. getVariation() {
  274. return { ...super.getVariation(), vvColor: this.vvColor, vvRotation: this.vvRotation, vvOpacity: this.vvOpacity, vvSizeFieldStops: this.vvSizeFieldStops, vvSizeMinMaxValue: this.vvSizeMinMaxValue, vvSizeScaleStops: this.vvSizeScaleStops, vvSizeUnitValue: this.vvSizeUnitValue };
  275. }
  276. };
  277. N.shared = new N(0);
  278. var C = class extends B(R(F(U))) {
  279. static load(t) {
  280. const e = this.shared;
  281. return e.data = t, e;
  282. }
  283. static from(t) {
  284. const e = this.load(0);
  285. return e.geometryType = E.LINE, e.symbologyType = t.symbologyType, e.setVV(t.vvFlags, t), e.data;
  286. }
  287. getVariation() {
  288. return { ...super.getVariation(), vvColor: this.vvColor, vvOpacity: this.vvOpacity, vvSizeFieldStops: this.vvSizeFieldStops, vvSizeMinMaxValue: this.vvSizeMinMaxValue, vvSizeScaleStops: this.vvSizeScaleStops, vvSizeUnitValue: this.vvSizeUnitValue };
  289. }
  290. };
  291. C.shared = new C(0);
  292. var P = class extends B(R(x(F(U)))) {
  293. static load(t) {
  294. const e = this.shared;
  295. return e.data = t, e;
  296. }
  297. static from(t) {
  298. const e = this.load(0);
  299. return e.geometryType = E.TEXT, e.symbologyType = t.symbologyType, e.setVV(t.vvFlags, t), e.data;
  300. }
  301. getVariation() {
  302. return { ...super.getVariation(), vvColor: this.vvColor, vvOpacity: this.vvOpacity, vvRotation: this.vvRotation, vvSizeFieldStops: this.vvSizeFieldStops, vvSizeMinMaxValue: this.vvSizeMinMaxValue, vvSizeScaleStops: this.vvSizeScaleStops, vvSizeUnitValue: this.vvSizeUnitValue };
  303. }
  304. };
  305. P.shared = new P(0);
  306. var Z = class extends F(U) {
  307. static load(t) {
  308. const e = this.shared;
  309. return e.data = t, e;
  310. }
  311. static from(t) {
  312. const s2 = this.load(0);
  313. return s2.geometryType = E.LABEL, s2.symbologyType = t.symbologyType, s2.setVV(t.vvFlags, t), s2.mapAligned = i(t.placement), s2.data;
  314. }
  315. getVariation() {
  316. return { ...super.getVariation(), vvSizeFieldStops: this.vvSizeFieldStops, vvSizeMinMaxValue: this.vvSizeMinMaxValue, vvSizeScaleStops: this.vvSizeScaleStops, vvSizeUnitValue: this.vvSizeUnitValue };
  317. }
  318. };
  319. Z.shared = new Z(0);
  320. export {
  321. _2 as _,
  322. b,
  323. O,
  324. f,
  325. A2 as A,
  326. U,
  327. w,
  328. N,
  329. C,
  330. P,
  331. Z
  332. };
  333. //# sourceMappingURL=chunk-ZIWBDWEW.js.map