text: /**
   * highcharts-ng
   * @version v0.0.8-dev - 2014-11-26
   * @link https://github.com/pablojim/highcharts-ng
   * @author Barry Fitzgerald <>
   * @license MIT License, http://www.opensource.org/licenses/MIT
   */
  "undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="highcharts-ng"),function(){"use strict";function a(){return{indexOf:function(a,b,c){void 0===c&&(c=0),0>c&&(c+=a.length),0>c&&(c=0);for(var d=a.length;d>c;c++)if(c in a&&a[c]===b)return c;return-1},prependMethod:function(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);return c.apply(this,a),d?d.apply(this,a):void 0}},deepExtend:function a(b,c){if(angular.isArray(c)){b=angular.isArray(b)?b:[];for(var d=0;d<c.length;d++)b[d]=a(b[d]||{},c[d])}else if(angular.isObject(c))for(var e in c)b[e]=a(b[e]||{},c[e]);else b=c;return b}}}function b(a,b){var c=0,d=function(a){var b=!1;return angular.forEach(a,function(a){angular.isDefined(a.id)||(a.id="series-"+c++,b=!0)}),b},e=["xAxis","yAxis"],f=function(b,c,d){var f={},g={chart:{events:{}},title:{},subtitle:{},series:[],credits:{},plotOptions:{},navigator:{enabled:!1}};return f=d.options?a.deepExtend(g,d.options):g,f.chart.renderTo=c[0],angular.forEach(e,function(c){angular.isDefined(d[c])&&(f[c]=angular.copy(d[c]),(angular.isDefined(d[c].currentMin)||angular.isDefined(d[c].currentMax))&&(a.prependMethod(f.chart.events,"selection",function(a){var d=this;b.$apply(a[c]?function(){b.config[c].currentMin=a[c][0].min,b.config[c].currentMax=a[c][0].max}:function(){b.config[c].currentMin=d[c][0].dataMin,b.config[c].currentMax=d[c][0].dataMax})}),a.prependMethod(f.chart.events,"addSeries",function(){b.config[c].currentMin=this[c][0].min||b.config[c].currentMin,b.config[c].currentMax=this[c][0].max||b.config[c].currentMax})))}),d.title&&(f.title=d.title),d.subtitle&&(f.subtitle=d.subtitle),d.credits&&(f.credits=d.credits),d.size&&(d.size.width&&(f.chart.width=d.size.width),d.size.height&&(f.chart.height=d.size.height)),f},g=function(a,b){var c=a.getExtremes();(b.currentMin!==c.dataMin||b.currentMax!==c.dataMax)&&a.setExtremes(b.currentMin,b.currentMax,!1)},h=function(a,b,c){(b.currentMin||b.currentMax)&&a[c][0].setExtremes(b.currentMin,b.currentMax,!0)},i=function(a){return angular.extend({},a,{data:null,visible:null})};return{restrict:"EAC",replace:!0,template:"<div></div>",scope:{config:"=",disableDataWatch:"="},link:function(c,j){var k={},l=function(b){var e,f=[];if(b){var g=d(b);if(g)return!1;if(angular.forEach(b,function(a){f.push(a.id);var b=m.get(a.id);b?angular.equals(k[a.id],i(a))?(void 0!==a.visible&&b.visible!==a.visible&&b.setVisible(a.visible,!1),b.setData(angular.copy(a.data),!1)):b.update(angular.copy(a),!1):m.addSeries(angular.copy(a),!1),k[a.id]=i(a)}),c.config.noData){var h=!1;for(e=0;e<b.length;e++)if(b[e].data&&b[e].data.length>0){h=!0;break}h?m.hideLoading():m.showLoading(c.config.noData)}}for(e=m.series.length-1;e>=0;e--){var j=m.series[e];"highcharts-navigator-series"!==j.options.id&&a.indexOf(f,j.options.id)<0&&j.remove(!1)}return!0},m=!1,n=function(){m&&m.destroy(),k={};var a=c.config||{},b=f(c,j,a),d=a.func||void 0;m=a.useHighStocks?new Highcharts.StockChart(b,d):new Highcharts.Chart(b,d);for(var g=0;g<e.length;g++)a[e[g]]&&h(m,a[e[g]],e[g]);a.loading&&m.showLoading(),a.getHighcharts=function(){return m}};n(),c.disableDataWatch?c.$watchCollection("config.series",function(a){l(a),m.redraw()}):c.$watch("config.series",function(a){var b=l(a);b&&m.redraw()},!0),c.$watch("config.title",function(a){m.setTitle(a,!0)},!0),c.$watch("config.subtitle",function(a){m.setTitle(!0,a)},!0),c.$watch("config.loading",function(a){a?m.showLoading():m.hideLoading()}),c.$watch("config.credits.enabled",function(a){a?m.credits.show():m.credits&&m.credits.hide()}),c.$watch("config.useHighStocks",function(a,b){a!==b&&n()}),angular.forEach(e,function(a){c.$watch("config."+a,function(b,c){b!==c&&b&&(m[a][0].update(b,!1),g(m[a][0],angular.copy(b)),m.redraw())},!0)}),c.$watch("config.options",function(a,b,c){a!==b&&(n(),l(c.config.series),m.redraw())},!0),c.$watch("config.size",function(a,b){a!==b&&a&&m.setSize(a.width||void 0,a.height||void 0)},!0),c.$on("highchartsng.reflow",function(){m.reflow()}),c.$on("$destroy",function(){m&&(m.destroy(),b(function(){j.remove()},0))})}}}angular.module("highcharts-ng",[]).factory("highchartsNGUtils",a).directive("highchart",["highchartsNGUtils","$timeout",b])}();