// 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
require({cache:{"url:widgets/Infographic/setting/dijitsSetting/_dijits/Mark/Marks.html":'\x3cdiv\x3e\r\n\t\r\n\t\x3cdiv class\x3d"mark-add-ct"\x3e\r\n\t\t\x3cdiv data-dojo-attach-event\x3d"click:_onAddMarkLineClicked" class\x3d"mark-add-ct-left" title\x3d"${nls.addMarkLine}"\x3e\r\n\t\t\t\x3cdiv class\x3d"icon-add-mark"\x3e\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"text-add-mark textOverFlow"\x3e${nls.addMarkLine}\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\t\x3cdiv data-dojo-attach-event\x3d"click:_onAddMarkAreaClicked" class\x3d"mark-add-ct-right" title\x3d"${nls.addMarkArea}"\x3e\r\n\t\t\t\x3cdiv class\x3d"icon-add-mark"\x3e\x3c/div\x3e\r\n\t\t\t\x3cdiv class\x3d"text-add-mark textOverFlow" title\x3d"${nls.addMarkArea}"\x3e${nls.addMarkArea}\x3c/div\x3e\r\n\t\t\x3c/div\x3e\r\n\t\x3c/div\x3e\r\n\r\n    \x3cdiv class\x3d"marks-ct" data-dojo-attach-point\x3d"marksContainer"\x3e\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare dijit/_WidgetBase dojo/Evented dijit/_TemplatedMixin dijit/_WidgetsInTemplateMixin dojo/text!./Marks.html ./Mark dojo/on dojo/_base/lang dijit/form/Select jimu/dijit/CheckBox".split(" "),function(e,f,g,h,k,l,m,d,n){return e([f,g,h,k],{baseClass:"infographic-setting-marks",templateString:l,nls:null,constructor:function(){this.inherited(arguments);this.marklines=[];this.markareas=[]},postCreate:function(){this.inherited(arguments);this.setConfig(this.config)},clearMarks:function(){this.marklines.forEach(function(a){a.dijit.destroy()});
this.markareas.forEach(function(a){a.dijit.destroy()});this.marklines=[];this.markareas=[]},getConfig:function(){var a=this._getMarkLineConfig(),b=this._getMarkAreaConfig(),c={};a&&(c.markLine=a);b&&(c.markArea=b);return c},_getMarkLineConfig:function(){if(this.marklines.length){var a=this.marklines.map(function(b){return b.dijit.getConfig()});a=a.filter(function(b){return!1!==b});if(a.length)return{silent:!0,symbol:["",""],data:a}}},_getMarkAreaConfig:function(){if(this.markareas.length){var a=this.markareas.map(function(b){return b.dijit.getConfig()});
a=a.filter(function(b){return!1!==b});if(a.length)return{silent:!0,data:a}}},setConfig:function(a){if(a){this.clearMarks();var b=a.markArea;this._setMarkLineConfig(a.markLine);this._setMarkAreaConfig(b)}},_setMarkLineConfig:function(a){a&&a.data&&a.data.length&&a.data.forEach(function(b){this._createMarkLine(b,!0)}.bind(this))},_setMarkAreaConfig:function(a){a&&a.data&&a.data.length&&a.data.forEach(function(b){this._createMarkArea(b,!0)}.bind(this))},_createMarkLine:function(a,b){a=this._createMark("line",
a,b);this.marklines.push({uniqueID:a.uniqueID,dijit:a});this.own(d(a,"deleted",function(c){this._onMarkDeleted("line",c)}.bind(this)))},_createMarkArea:function(a,b){a=this._createMark("area",a,b);this.markareas.push({uniqueID:a.uniqueID,dijit:a});this.own(d(a,"deleted",function(c){this._onMarkDeleted("area",c)}.bind(this)))},_onAddMarkLineClicked:function(a){a.stopPropagation();this._collapeAllMark();this._createMarkLine()},_onAddMarkAreaClicked:function(a){a.stopPropagation();this._collapeAllMark();
this._createMarkArea()},_createMark:function(a,b,c){a=new m({closed:c,chartType:this.chartType,type:a,config:b,nls:this.nls,folderUrl:this.folderUrl,defaultColor:this.defaultColor});this.own(d(a,"change",n.hitch(this,this._onChange)));a.placeAt(this.marksContainer);return a},_collapeAllMark:function(){this.marklines.forEach(function(a){a.dijit.closed||a.dijit.closeContent()});this.markareas.forEach(function(a){a.dijit.closed||a.dijit.closeContent()})},_onMarkDeleted:function(a,b){"line"===a?this._deleteMarkLine(b):
"area"===a&&this._deleteMarkarea(b);this._onChange()},_deleteMarkLine:function(a){this.marklines=this.marklines.filter(function(b){return b.uniqueID!==a})},_deleteMarkarea:function(a){this.markareas=this.markareas.filter(function(b){return b.uniqueID!==a})},_onChange:function(){var a=this.getConfig();a&&this.emit("change",a)}})});