/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as o}from"tslib";import t from"../../../../../core/Accessor.js";import{property as e}from"../../../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../../../core/accessorSupport/decorators/subclass.js";import r from"../../../../../symbols/SimpleFillSymbol.js";import l from"../../../../../symbols/SimpleLineSymbol.js";import s from"../../../../../symbols/SimpleMarkerSymbol.js";import n from"../../../../Theme.js";import{activeVertex as c,regularVertices as a,polygonOutline as u,outline as d,colors as m}from"./symbols.js";let y=class extends t{constructor(o){super(o),this._overrideSymbols=new Map,this._systemSymbols=new Map,this.accentColor=b,this.initialOverrides={}}initialize(){f(this.initialOverrides,(o,t)=>{this._overrideSymbols.set(o,t)}),f(w(),(o,t)=>{this._systemSymbols.set(o,t)}),this.updateAccentColor(this.accentColor)}get(o,t,e){const i=p(o);return null===i?null:this._getExact(i,t,e)??this._getExact(i,t,"default")??this._getExact(i,"default")}addOverride(o,t,e,i){const r=h(t,e,i);null==o?this._overrideSymbols.delete(r):this._overrideSymbols.set(r,o)}updateAccentColor(o){this.accentColor=o,f(v(o),(o,t)=>{this._systemSymbols.set(o,t)})}_getExact(o,t,e){const i=h(o,t,e);return this._overrideSymbols.get(i)??this._systemSymbols.get(i)}};function p(o){switch(o){case"point":case"multipoint":return"point";case"polyline":return"polyline";case"polygon":return"polygon";default:return null}}function f(o,t){for(const[e,i]of Object.entries(o)){const{default:o,...r}=i;o&&t(h(e,"default"),o);for(const[i,l]of Object.entries(r))for(const[o,r]of Object.entries(l)){t(h(e,i,o),r)}}}function h(o,t,e){return"default"===t?`${o}.default`:`${o}.${t}.${e??"default"}`}function w(){return{polyline:{default:new l({color:m.lightGray,width:2}),outline:{active:d}},polygon:{default:new r({color:m.transluscentGray,outline:{color:m.gray,width:2}}),outline:{active:u,default:new r({color:m.transparent,outline:{color:m.gray,width:2}})}},point:{default:new s({style:"circle",size:6,color:m.white,outline:{color:m.gray,width:1}}),vertex:{default:a,active:c}}}}o([e()],y.prototype,"accentColor",void 0),o([e()],y.prototype,"initialOverrides",void 0),y=o([i("esri.views.2d.interactive.editingTools.draw.SymbolDictionary")],y);const b=(new n).accentColor;function v(o){const t=new l({style:"solid",color:o,width:1});return{polyline:{constructionLine:{default:t}},point:{controlPoint:{default:new s({style:"diamond",color:m.white,size:6,outline:t}),focused:new s({style:"diamond",color:t.color,size:8,outline:{color:m.white,width:2}}),active:new s({style:"diamond",color:t.color,size:9,outline:{color:m.white,width:1}})},cursor:{default:new s({style:"circle",color:m.white,size:6,outline:t}),focused:new s({style:"circle",color:t.color,size:8,outline:{color:m.white,width:2}}),active:new s({style:"circle",color:t.color,size:9,outline:{color:m.white,width:1}})}}}}export{y as SymbolDictionary};
