/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../Color","./support/colors","./support/symbologyUtils","./support/utils"],(function(o,e,a,t,n){"use strict";const c={light:{color:[153,153,153,.25],width:"1px"},dark:{color:[153,153,153,.25],width:"1px"},darker:{color:[26,26,26,.25],width:"1px"}},r=["tropical-bliss","desert-blooms","under-the-sea","vibrant-rainbow","ocean-bay","prairie-summer","pastel-chalk"],l=["predominant-v1","predominant-v2","predominant-v3","predominant-v4","predominant-v5","predominance-race","predominance-money","predominance-race-ethnic","predominance-rainbow","predominance-sequence"],i=["cat-symbols-strong","cat-symbols-autumnal","cat-symbols-bright","cat-symbols-midrange","cat-symbols-subdued","cat-symbols-pastel","cat-symbols-red","cat-symbols-blue","cat-symbols-green","cat-symbols-gray"],s="#aaaaaa",m="12px",p={default:{name:"default",label:"Default",description:"Default theme for visualizing features by their type.",schemes:{point:{light:{common:{noDataColor:s,outline:c.light,size:"8px"},primary:"cat-dark",secondary:["cat-light"].concat(i).concat(r).concat(l)},dark:{common:{noDataColor:s,outline:c.darker,size:"8px"},primary:"cat-light",secondary:["cat-dark"].concat(i).concat(r).concat(l)}},polyline:{light:{common:{noDataColor:s,width:"2px"},primary:"cat-dark",secondary:["cat-light"].concat(i).concat(r).concat(l)},dark:{common:{noDataColor:s,width:"2px"},primary:"cat-light",secondary:["cat-dark"].concat(i).concat(r).concat(l)}},polygon:{light:{common:{noDataColor:s,outline:c.light,fillOpacity:.8},primary:"cat-dark",secondary:["cat-light"].concat(i).concat(r).concat(l)},dark:{common:{noDataColor:s,outline:c.dark,fillOpacity:.8},primary:"cat-light",secondary:["cat-dark"].concat(i).concat(r).concat(l)}}}},"point-cloud-class":{name:"point-cloud-class",label:"Point Cloud Class",description:"Default theme for visualizing point cloud data based on classification.",schemes:{point:{light:{primary:"point-cloud-class-scheme",secondary:[]},dark:{primary:"point-cloud-class-scheme",secondary:[]}}}}},u=t.createThemes({themeDictionary:p});function d(o){return t.getThemesforBasemap(u,o)}function h(o){const e=o.theme||"default",a=t.getRawSchemes({basemap:o.basemap,geometryType:o.geometryType,basemapTheme:o.basemapTheme,theme:u.get(e)});if(!a)return;const{schemesInfo:n,basemapId:c,basemapTheme:r}=a,l=n.common;return{primaryScheme:w(o,n.primary,l),secondarySchemes:n.secondary.map((e=>w(o,e,l))).filter(Boolean),basemapId:c,basemapTheme:r}}function y(o){return t.filterSchemesByName(o.name,h(o))}function g(o){return t.filterSchemesByTag(o.includedTags,o.excludedTags,h(o))}function f(o){if(!o)return;const a={...o};return a.colors=a.colors.map((o=>new e(o))),a.tags=[...a.tags],"noDataColor"in a&&a.noDataColor&&(a.noDataColor=new e(a.noDataColor)),"outline"in a&&a.outline&&(a.outline={color:a.outline.color&&new e(a.outline.color),width:a.outline.width}),a}function w(o,e,t){const n=o.theme||"default",c=a[e];if(!c)return;const r=c.stops,l="mesh"!==o.geometryType&&o.worldScale?o.view:null;switch(o.geometryType){case"point":case"multipoint":{if("point-cloud-class"===n)return b({theme:n,name:c.name,tags:c.tags,colors:r});const o=t;return D({name:c.name,tags:c.tags,theme:n,colors:r,noDataColor:o.noDataColor,opacity:1,outline:o.outline,size:o.size},l)}case"polyline":{const o=t;return C({name:c.name,tags:c.tags,theme:n,colors:r,noDataColor:o.noDataColor,opacity:1,width:o.width},l)}case"polygon":{const o=t;return T({name:c.name,tags:c.tags,theme:n,colors:r,noDataColor:o.noDataColor,opacity:o.fillOpacity||1,outline:o.outline,size:m},l)}case"mesh":{const o=t;return k({name:c.name,tags:c.tags,theme:n,colors:r,noDataColor:o.noDataColor,opacity:o.fillOpacity||1})}default:return}}function b(o){return{name:o.name,tags:[...o.tags],theme:o.theme,colors:o.colors.map((o=>new e(o)))}}function D(o,a){return{name:o.name,tags:[...o.tags],theme:o.theme,colors:o.colors.map((o=>new e(o))),noDataColor:new e(o.noDataColor),outline:{color:new e(o.outline.color),width:o.outline.width},size:a?n.toWorldScale(o.size,a):o.size,opacity:o.opacity}}function C(o,a){return{name:o.name,tags:[...o.tags],theme:o.theme,colors:o.colors.map((o=>new e(o))),noDataColor:new e(o.noDataColor),width:a?n.toWorldScale(o.width,a):o.width,opacity:o.opacity}}function T(o,a){return{name:o.name,tags:[...o.tags],theme:o.theme,colors:o.colors.map((o=>new e(o))),noDataColor:new e(o.noDataColor),outline:{color:new e(o.outline.color),width:o.outline.width},opacity:o.opacity,size:a?n.toWorldScale(o.size,a):o.size}}function k(o){return{name:o.name,tags:[...o.tags],theme:o.theme,colors:o.colors.map((o=>new e(o))),noDataColor:new e(o.noDataColor),opacity:o.opacity}}o.cloneScheme=f,o.getSchemeByName=y,o.getSchemes=h,o.getSchemesByTag=g,o.getThemes=d,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
