/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import e from"../../Color.js";class t{static parse(e,r,n){const o=[],l=[],u=e.split(";");for(let t=0;t<u.length;t++){const e=u[t];if(e){if(e.includes("po:")){const t=e.slice(3).split("|");if(3===t.length){const[e,r,s]=t,n=i(e,r,s);n&&l.push(n)}continue}if(e.includes("|")){for(const t of e.split("|"))if(r.has(t)){o.push(t);break}}else if(r.has(e))o.push(e);else if(0===t){o.length=0,o.push(s(n));break}}}return new t(o,l)}constructor(e,t){this.partNames=e,this.overrides=t}}function r(t,r){if("DashTemplate"===t)return r.split(" ").map(e=>Number(e));if("Color"===t){const t=new e(r).toRgba();return[t[0],t[1],t[2],255*t[3]]}return Number(r)}function i(e,t,i){return{type:"CIMPrimitiveOverride",primitiveName:e,propertyName:t,value:r(t,i),defaultValue:null}}function s(e){switch(e){case"esriGeometryPolyline":return"Invalid_L";case"esriGeometryPolygon":return"Invalid_A";default:return"Invalid_P"}}export{t as DictionaryControlString};
