/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../symbols","../../core/Error","../../core/maybe","../Symbol3D","./symbolConversion","../WebStyleSymbol"],(function(e,n,o,t,l,s,i){"use strict";const r=["building-scene","integrated-mesh","point-cloud","scene"];function u(e,n,o,l){const s=c(e,{},{context:l,isLabelSymbol:!1});t.isSome(s)&&(n[o]=s)}function a(e,n,o,l){const s=c(e,{},{context:l,isLabelSymbol:!0});t.isSome(s)&&(n[o]=s)}function b(e){return e instanceof l||e instanceof i}function c(e,n,l){var i;if(t.isNone(e))return null;const{context:u,isLabelSymbol:a}=l,c=null==u?void 0:u.origin,m=null==u?void 0:u.messages;if("web-scene"===c&&!b(e)){const l=s.to3D(e,{retainCIM:!0,hasLabelingContext:a});return t.isSome(l.symbol)?l.symbol.write(n,u):(null==m||m.push(new o("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:u,error:l.error})),null)}return("web-map"===c||"portal-item"===c&&!r.includes(null==u||null==(i=u.layer)?void 0:i.type))&&b(e)?(null==m||m.push(new o("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:u})),null):e.write(n,u)}function m(e,o){return n.readSymbol(e,null,o)}e.fromJSON=m,e.write=u,e.writeLabelSymbol=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
