// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define("dojo/_base/lang dojo/_base/array esri/geometry/Point esri/geometry/Polygon esri/geometry/Polyline esri/graphic esri/symbols/SimpleMarkerSymbol esri/symbols/SimpleLineSymbol esri/symbols/SimpleFillSymbol esri/Color".split(" "),function(n,p,t,u,v,m,q,k,r,l){var g={getHighLightSymbol:function(b,a){switch(b.geometry.type){case "point":return g._getPointSymbol(b,a);case "polyline":return g._getPolyLineSymbol(b,a);case "polygon":return g._getPolygonSymbol(b,a)}},_getSizeInfo:function(b){var a=null;
b.renderer.visualVariables&&p.forEach(b.renderer.visualVariables,n.hitch(this,function(c){"sizeInfo"===c.type&&(a=c)}));return a},_getPointSymbol:function(b,a){var c,e;var f=!1;var d=new q(q.STYLE_SQUARE,null,new k(k.STYLE_SOLID,new l([0,255,255,1]),3));d.setColor(null);d.size=30;if(a&&a.renderer)if(a.renderer.symbol)f=!0,d=g._updatePointSymbolProperties(d,a.renderer.symbol);else if(a.renderer.infos&&0<a.renderer.infos.length){for(e=0;e<a.renderer.infos.length;e++){a.typeIdField?c=b.attributes[a.typeIdField]:
a.renderer.attributeField&&(c=b.attributes[a.renderer.attributeField]);var h=a.renderer.infos[e].value;void 0!==c&&null!==c&&""!==c&&void 0!==h&&null!==h&&""!==h&&c.toString()===h.toString()&&(f=!0,d=g._updatePointSymbolProperties(d,a.renderer.infos[e].symbol))}!f&&a.renderer.defaultSymbol&&(f=!0,d=g._updatePointSymbolProperties(d,a.renderer.defaultSymbol))}a&&a.graphics&&0<a.graphics.length&&a._getSymbol(b)&&((c=b.getShape())&&c.shape?c.shape.hasOwnProperty("r")?(f=!0,d.size=2*c.shape.r+10):c.shape.hasOwnProperty("width")&&
(f=!0,a.renderer&&a.renderer.infos&&0<a.renderer.infos.length&&(d=g._updatePointSymbolProperties(d,a.renderer.infos[0].symbol)),d.size=c.shape.width+10):a.renderer.visualVariables&&(f=a._getRenderer(b),c=g._getSizeInfo(a))&&(a=f.getSize(b,{sizeInfo:c,shape:a._getSymbol(b),resolution:a&&a.getResolutionInMeters&&a.getResolutionInMeters()}),null!==a&&(d.size=a+10)));a=new t(b.geometry.x,b.geometry.y,b.geometry.spatialReference);return new m(a,d,b.attributes)},_updatePointSymbolProperties:function(b,
a){if(a.hasOwnProperty("height")&&a.hasOwnProperty("width")){var c=a.height;var e=a.width;c=(c>e?c:e)+10;b.size=c}a.hasOwnProperty("size")&&(!c||c<a.size)&&(b.size=a.size+10);a.hasOwnProperty("xoffset")&&(b.xoffset=a.xoffset);a.hasOwnProperty("yoffset")&&(b.yoffset=a.yoffset);return b},_getPolyLineSymbol:function(b,a){var c,e;var f=5;if(a&&a.renderer)if(a.renderer.symbol&&a.renderer.symbol.hasOwnProperty("width"))f=a.renderer.symbol.width;else if(a.renderer.infos&&0<a.renderer.infos.length)for(e=
0;e<a.renderer.infos.length;e++){a.typeIdField?c=b.attributes[a.typeIdField]:a.renderer.attributeField&&(c=b.attributes[a.renderer.attributeField]);var d=a.renderer.infos[e].value;void 0!==c&&null!==c&&""!==c&&void 0!==d&&null!==d&&""!==d&&c.toString()===d.toString()&&a.renderer.infos[e].symbol.hasOwnProperty("width")&&(f=a.renderer.infos[e].symbol.width)}else a.renderer.defaultSymbol&&a.renderer.defaultSymbol.hasOwnProperty("width")&&(f=a.renderer.defaultSymbol.width);a=new k(k.STYLE_SOLID,new l([0,
255,255,1]),f);var h=new v(b.geometry.spatialReference);b.geometry.paths&&0<b.geometry.paths.length&&p.forEach(b.geometry.paths,function(w){h.addPath(w)});return new m(h,a,b.attributes)},_getPolygonSymbol:function(b){var a=new r(r.STYLE_SOLID,new k(k.STYLE_SOLID,new l([0,255,255,1]),4),new l([0,0,0,0]));var c=new u(b.geometry.spatialReference);b.geometry.rings&&(c.rings=n.clone(b.geometry.rings));return new m(c,a,b.attributes)}};return g});