(function(){google.load("visualization","1");"1"===motopressGoogleChartsPHPData.motopressCE&&(google.motopressDrawChart=function(b){var a,c,d,e;0!==arguments.length&&(a=arguments[1]);c=jQuery(document.getElementById(b));d=jQuery.parseJSON(c.attr("data-chart"))||{};d.height=200;null!==a&&(d.height=a);a={};e=f(d.table);a.chartType=g(d.type);a.dataTable=!0===e?d.table:null;a.options={title:d.title,height:d.height,colors:d.colors};null!==d.backgroundColor&&(a.options.backgroundColor={fill:"transparent"});
"PieChart3D"==d.type&&(a.options.is3D=!0);0!=d.donut&&"false"!==d.donut&&(a.options.pieHole=.5);a.containerId=d.ID;null!==a.dataTable?(d=new google.visualization.ChartWrapper(a),d.draw(),c.addClass("motopress-google-chart-loaded")):c.toggleClass("motopress-empty-chart").text("No Data")});var e=function(){jQuery(".motopress-google-chart").each(function(){var b=jQuery(this),a=jQuery.parseJSON(b.attr("data-chart"))||{},c,d;"0"===motopressGoogleChartsPHPData.motopressCE?(c=b.parent(),c=c.attr("style"),
void 0!==c?(c=c.split("min-height:"),c=c[1].split("px;"),a.height=Number(c[0])):a.height=200):"1"===motopressGoogleChartsPHPData.motopressCE&&(a.height=b.parent().parent().height(),100>a.height&&(a.height=200));c={};d=f(a.table);c.chartType=g(a.type);c.dataTable=!0===d?a.table:null;c.options={title:a.title,height:a.height,colors:a.colors};null!==a.backgroundColor&&(c.options.backgroundColor={fill:"transparent"});"PieChart3D"==a.type&&(c.options.is3D=!0);0!=a.donut&&"false"!==a.donut&&(c.options.pieHole=
.5);c.containerId=a.ID;null!==c.dataTable?(a=new google.visualization.ChartWrapper(c),a.draw(),b.addClass("motopress-google-chart-loaded")):b.addClass("motopress-empty-chart").text("No Data")})},f=function(b){var a=null;if(b){for(i=0;i<b.length;i++)if(a=b[0].length,1===b.length&&null===b[0][0]||a!=b[i].length)return!1;return!0}return!1},g=function(b){"PieChart3D"==b&&(b="PieChart");return b};google.setOnLoadCallback(e);"0"===motopressGoogleChartsPHPData.motopressCE&&jQuery(document).ready(function(){var b;
jQuery(window).resize(function(a){b&&clearTimeout(b);b=setTimeout(e,100)})});"1"===motopressGoogleChartsPHPData.motopressCE&&jQuery(document).ready(function(){var b;jQuery(document).on("resize",".motopress-content-wrapper .ui-resizable",function(a){var c=jQuery(this).find(".motopress-google-chart").attr("id");if(void 0!==c){var d=jQuery(this).find(".motopress-drag-handle").height();b&&clearTimeout(b);b=setTimeout(function(){google.motopressDrawChart(c,d)},100)}});jQuery(document).on("dragstop",".motopress-content-wrapper .motopress-splitter",
function(a){a=jQuery(this).parent().parent().parent().find(".motopress-google-chart");0!==a.length&&a.each(function(){var a=jQuery(this).attr("id");google.motopressDrawChart(a)})});jQuery(document).on("drop",".motopress-content-wrapper",function(a){0!==jQuery(this).find(".motopress-google-chart").length&&(b&&clearTimeout(b),b=setTimeout(e,100))})})})();
