chunk-RVCE264D.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import {
  2. S,
  3. S2,
  4. b,
  5. b2,
  6. c,
  7. c2,
  8. f,
  9. h,
  10. k,
  11. k2,
  12. m,
  13. m2,
  14. n,
  15. y
  16. } from "./chunk-3Z755LKF.js";
  17. import {
  18. s3 as s
  19. } from "./chunk-E5O6P5I2.js";
  20. import {
  21. r,
  22. t
  23. } from "./chunk-YXWMMD76.js";
  24. // node_modules/@arcgis/core/symbols/support/symbolConversion.js
  25. var a = { retainId: false, ignoreDrivers: false, hasLabelingContext: true };
  26. function S3(S4, c4 = a) {
  27. var _a, _b;
  28. if (!S4)
  29. return { symbol: null };
  30. const { retainId: u = a.retainId, ignoreDrivers: d = a.ignoreDrivers, hasLabelingContext: j = a.hasLabelingContext, retainCIM: g = a.retainCIM } = c4;
  31. let D = null;
  32. if (c2(S4) || S4 instanceof f)
  33. D = S4.clone();
  34. else if ("cim" === S4.type) {
  35. const o = (_b = (_a = S4.data) == null ? void 0 : _a.symbol) == null ? void 0 : _b.type;
  36. if ("CIMPointSymbol" !== o)
  37. return { error: new s("symbol-conversion:unsupported-cim-symbol", `CIM symbol of type '${o || "unknown"}' is unsupported in 3D`, { symbol: S4 }) };
  38. D = g ? S4.clone() : h.fromCIMSymbol(S4);
  39. } else if (S4 instanceof m)
  40. D = b2.fromSimpleLineSymbol(S4);
  41. else if (S4 instanceof y)
  42. D = h.fromSimpleMarkerSymbol(S4);
  43. else if (S4 instanceof n)
  44. D = h.fromPictureMarkerSymbol(S4);
  45. else if (S4 instanceof S2)
  46. D = c4.geometryType && "mesh" === c4.geometryType ? c.fromSimpleFillSymbol(S4) : S.fromSimpleFillSymbol(S4);
  47. else {
  48. if (!(S4 instanceof m2))
  49. return { error: new s("symbol-conversion:unsupported-2d-symbol", `2D symbol of type '${S4.type || S4.declaredClass}' is unsupported in 3D`, { symbol: S4 }) };
  50. D = j ? b.fromTextSymbol(S4) : h.fromTextSymbol(S4);
  51. }
  52. if (u && D && "cim" !== D.type && (D.id = S4.id), d && c2(D))
  53. for (let o = 0; o < D.symbolLayers.length; ++o)
  54. D.symbolLayers.getItemAt(o)._ignoreDrivers = true;
  55. return { symbol: D };
  56. }
  57. // node_modules/@arcgis/core/symbols/support/jsonUtils.js
  58. var l = ["building-scene", "integrated-mesh", "point-cloud", "scene"];
  59. function m3(e, o, t2, s2) {
  60. const r2 = a2(e, {}, { context: s2, isLabelSymbol: false });
  61. r(r2) && (o[t2] = r2);
  62. }
  63. function c3(e, o, t2, s2) {
  64. const r2 = a2(e, {}, { context: s2, isLabelSymbol: true });
  65. r(r2) && (o[t2] = r2);
  66. }
  67. function b3(e) {
  68. return e instanceof k || e instanceof f;
  69. }
  70. function a2(e, s2, i) {
  71. var _a;
  72. if (t(e))
  73. return null;
  74. const { context: m4, isLabelSymbol: c4 } = i, a3 = m4 == null ? void 0 : m4.origin, p2 = m4 == null ? void 0 : m4.messages;
  75. if ("web-scene" === a3 && !b3(e)) {
  76. const t2 = S3(e, { retainCIM: true, hasLabelingContext: c4 });
  77. return r(t2.symbol) ? t2.symbol.write(s2, m4) : (p2 == null ? void 0 : p2.push(new s("symbol:unsupported", `Symbols of type '${e.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`, { symbol: e, context: m4, error: t2.error })), null);
  78. }
  79. const y2 = (_a = m4 == null ? void 0 : m4.layer) == null ? void 0 : _a.type;
  80. return "web-map" !== a3 && ("portal-item" !== a3 || y2 && l.includes(y2)) || !b3(e) ? e.write(s2, m4) : (p2 == null ? void 0 : p2.push(new s("symbol:unsupported", `Symbols of type '${e.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`, { symbol: e, context: m4 })), null);
  81. }
  82. function p(o, n2) {
  83. return k2(o, null, n2);
  84. }
  85. export {
  86. m3 as m,
  87. c3 as c,
  88. p
  89. };
  90. //# sourceMappingURL=chunk-RVCE264D.js.map