// 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("require dojo/_base/lang dojo/_base/html dojox/gfx esri/symbols/jsonUtils esri/symbols/PictureMarkerSymbol".split(" "),function(n,p,h,m,f,q){return{cloneSymbol:function(a){if(!a)return null;var b=null;try{var c=a.toJson();b=f.fromJson(c)}catch(e){console.error(e)}return b},getDefaultMarkerSymbol:function(){return f.fromJson({style:"esriSMSCircle",color:[0,0,128,128],name:"Circle",outline:{color:[0,0,128,255],width:1},type:"esriSMS",size:18})},getDefaultLineSymbol:function(){return f.fromJson({tags:["solid"],
title:"Blue Thin",style:"esriSLSSolid",color:[79,129,189,255],width:3,name:"Blue 1",type:"esriSLS"})},getDefaultFillSymbol:function(){return f.fromJson({tags:["opaque"],title:"Blue",style:"esriSFSSolid",color:[79,129,189,255],name:"Blue 6",type:"esriSFS",outline:{style:"esriSLSSolid",color:[54,93,141,255],width:1.5,type:"esriSLS"}})},getHightlightMarkerSymbol:function(){return f.fromJson({color:[255,255,255,128],size:18,angle:0,xoffset:0,yoffset:0,type:"esriSMS",style:"esriSMSCircle",outline:{color:[0,
255,255,255],width:1.5,type:"esriSLS",style:"esriSLSSolid"}})},getHightlightLineSymbol:function(){return f.fromJson({color:[0,255,255,255],width:1.5,type:"esriSLS",style:"esriSLSSolid"})},getHightlightFillSymbol:function(){return f.fromJson({color:[255,255,255,128],outline:{color:[0,255,255,255],width:1.5,type:"esriSLS",style:"esriSLSSolid"},type:"esriSFS",style:"esriSFSSolid"})},getGreyPinMarkerSymbol:function(){var a=n.toUrl("jimu/css/images/grey_pin.png");a=new q(a,16,16);a.setOffset(0,8);return a},
createSymbolNode:function(a,b){var c=32,e=32,k=h.create("div",{},document.body);h.setStyle(k,"display","inline-block");if(b)c=b.width,e=b.height;else if(c=80,e=30,this.isSimpleMarkerSymbol(a))e=c=Math.min(a.size+12,125);else if(this.isPictureMarkerSymbol(a)){if(!a.url||"http://"===a.url||-1===a.url.indexOf("http://")&&-1===a.url.indexOf("https://")&&-1===a.url.indexOf("data:"))return;e=c=Math.min(Math.max(a.width,a.height),125)}else if(this.isSimpleLineSymbol(a)||this.isCartographicLineSymbol(a))c=
190,e=20;var d=m.createSurface(k,c,e);if("vml"===m.renderer){var g=d.getEventSource();h.setStyle(g,"position","relative");h.setStyle(g.parentNode,"position","relative")}g=null;g=b?f.getShapeDescriptors(a):this.isSimpleLineSymbol(a)||this.isCartographicLineSymbol(a)?this._getLineShapeDesc(a):f.getShapeDescriptors(a);try{var l=d.createShape(g.defaultShape);g.fill&&l.setFill(g.fill);g.stroke&&l.setStroke(g.stroke)}catch(r){d.clear();d.destroy();return}a=d.getDimensions();a={dx:a.width/2,dy:a.height/
2};d=l.getBoundingBox();b=d.width;d=d.height;if(b>c||d>e)c=((c<e?c:e)-5)/(b>d?b:d),p.mixin(a,{xx:c,yy:c});l.applyTransform(a);k&&h.addClass(k,"symbol");return k},_getLineShapeDesc:function(a){var b=null;if(this.isSimpleLineSymbol(a)||this.isCartographicLineSymbol(a))b={defaultShape:{type:"path",path:"M -90,0 L 90,0 E"},fill:null,stroke:a.getStroke()};return b},isSimpleMarkerSymbol:function(a){return a&&"esri.symbol.SimpleMarkerSymbol"===a.declaredClass},isPictureMarkerSymbol:function(a){return a&&
"esri.symbol.PictureMarkerSymbol"===a.declaredClass},isSimpleLineSymbol:function(a){return a&&"esri.symbol.SimpleLineSymbol"===a.declaredClass},isCartographicLineSymbol:function(a){return a&&"esri.symbol.CartographicLineSymbol"===a.declaredClass},isSimpleFillSymbol:function(a){return a&&"esri.symbol.SimpleFillSymbol"===a.declaredClass},isPictureFillSymbol:function(a){return a&&"esri.symbol.PictureFillSymbol"===a.declaredClass},isTextSymbol:function(a){return a&&"esri.symbol.TextSymbol"===a.declaredClass}}});