import { S, S2, b, b2, c, c2, f, h, k, k2, m, m2, n, y } from "./chunk-3Z755LKF.js"; import { s3 as s } from "./chunk-E5O6P5I2.js"; import { r, t } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/symbols/support/symbolConversion.js var a = { retainId: false, ignoreDrivers: false, hasLabelingContext: true }; function S3(S4, c4 = a) { var _a, _b; if (!S4) return { symbol: null }; const { retainId: u = a.retainId, ignoreDrivers: d = a.ignoreDrivers, hasLabelingContext: j = a.hasLabelingContext, retainCIM: g = a.retainCIM } = c4; let D = null; if (c2(S4) || S4 instanceof f) D = S4.clone(); else if ("cim" === S4.type) { const o = (_b = (_a = S4.data) == null ? void 0 : _a.symbol) == null ? void 0 : _b.type; if ("CIMPointSymbol" !== o) return { error: new s("symbol-conversion:unsupported-cim-symbol", `CIM symbol of type '${o || "unknown"}' is unsupported in 3D`, { symbol: S4 }) }; D = g ? S4.clone() : h.fromCIMSymbol(S4); } else if (S4 instanceof m) D = b2.fromSimpleLineSymbol(S4); else if (S4 instanceof y) D = h.fromSimpleMarkerSymbol(S4); else if (S4 instanceof n) D = h.fromPictureMarkerSymbol(S4); else if (S4 instanceof S2) D = c4.geometryType && "mesh" === c4.geometryType ? c.fromSimpleFillSymbol(S4) : S.fromSimpleFillSymbol(S4); else { if (!(S4 instanceof m2)) return { error: new s("symbol-conversion:unsupported-2d-symbol", `2D symbol of type '${S4.type || S4.declaredClass}' is unsupported in 3D`, { symbol: S4 }) }; D = j ? b.fromTextSymbol(S4) : h.fromTextSymbol(S4); } if (u && D && "cim" !== D.type && (D.id = S4.id), d && c2(D)) for (let o = 0; o < D.symbolLayers.length; ++o) D.symbolLayers.getItemAt(o)._ignoreDrivers = true; return { symbol: D }; } // node_modules/@arcgis/core/symbols/support/jsonUtils.js var l = ["building-scene", "integrated-mesh", "point-cloud", "scene"]; function m3(e, o, t2, s2) { const r2 = a2(e, {}, { context: s2, isLabelSymbol: false }); r(r2) && (o[t2] = r2); } function c3(e, o, t2, s2) { const r2 = a2(e, {}, { context: s2, isLabelSymbol: true }); r(r2) && (o[t2] = r2); } function b3(e) { return e instanceof k || e instanceof f; } function a2(e, s2, i) { var _a; if (t(e)) return null; const { context: m4, isLabelSymbol: c4 } = i, a3 = m4 == null ? void 0 : m4.origin, p2 = m4 == null ? void 0 : m4.messages; if ("web-scene" === a3 && !b3(e)) { const t2 = S3(e, { retainCIM: true, hasLabelingContext: c4 }); 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); } const y2 = (_a = m4 == null ? void 0 : m4.layer) == null ? void 0 : _a.type; 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); } function p(o, n2) { return k2(o, null, n2); } export { m3 as m, c3 as c, p }; //# sourceMappingURL=chunk-RVCE264D.js.map