");return this.tooltipOptions&&this.tooltipOptions.cssClass&&0===(t=e("."+this.tooltipOptions.cssClass)).length&&((t=e("
").addClass(this.tooltipOptions.cssClass)).appendTo("body").hide().css({position:"absolute"}),this.tooltipOptions.defaultTheme&&t.css({background:"#fff","z-index":"1040",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111",display:"none","white-space":"nowrap"})),t},i.prototype.stringFormat=function(e,t){var i,o,n,a,r,s=/%s/,l=/%c/,c=/%lx/,u=/%ly/,p=/%x\.{0,1}(\d{0,})/,h=/%y\.{0,1}(\d{0,})/;if(void 0!==t.series.threshold?(i=t.datapoint[0],o=t.datapoint[1],n=t.datapoint[2]):void 0!==t.series.curvedLines?(i=t.datapoint[0],o=t.datapoint[1]):void 0!==t.series.lines&&t.series.lines.steps?(i=t.series.datapoints.points[2*t.dataIndex],o=t.series.datapoints.points[2*t.dataIndex+1],n=""):(i=t.series.data[t.dataIndex][0],o=t.series.data[t.dataIndex][1],n=t.series.data[t.dataIndex][2]),null===t.series.label&&t.series.originSeries&&(t.series.label=t.series.originSeries.label),"function"==typeof e&&(e=e(t.series.label,i,o,t)),"boolean"==typeof e&&!e)return"";if(n&&(e=e.replace("%ct",n)),void 0!==t.series.percent?a=t.series.percent:void 0!==t.series.percents&&(a=t.series.percents[t.dataIndex]),"number"==typeof a&&(e=this.adjustValPrecision(/%p\.{0,1}(\d{0,})/,e,a)),t.series.hasOwnProperty("pie")&&void 0!==t.series.data[0][1]&&(r=t.series.data[0][1]),"number"==typeof r&&(e=e.replace("%n",r)),e=void 0!==t.series.label?e.replace(s,t.series.label):e.replace(s,""),e=void 0!==t.series.color?e.replace(l,t.series.color):e.replace(l,""),e=this.hasAxisLabel("xaxis",t)?e.replace(c,t.series.xaxis.options.axisLabel):e.replace(c,""),e=this.hasAxisLabel("yaxis",t)?e.replace(u,t.series.yaxis.options.axisLabel):e.replace(u,""),this.isTimeMode("xaxis",t)&&this.isXDateFormat(t)&&(e=e.replace(p,this.timestampToDate(i,this.tooltipOptions.xDateFormat,t.series.xaxis.options))),this.isTimeMode("yaxis",t)&&this.isYDateFormat(t)&&(e=e.replace(h,this.timestampToDate(o,this.tooltipOptions.yDateFormat,t.series.yaxis.options))),"number"==typeof i&&(e=this.adjustValPrecision(p,e,i)),"number"==typeof o&&(e=this.adjustValPrecision(h,e,o)),void 0!==t.series.xaxis.ticks){var d;d=this.hasRotatedXAxisTicks(t)?"rotatedTicks":"ticks";var f=t.dataIndex+t.seriesIndex;for(var m in t.series.xaxis[d]){if(t.series.xaxis[d].hasOwnProperty(f)&&!this.isTimeMode("xaxis",t))(this.isCategoriesMode("xaxis",t)?t.series.xaxis[d][f].label:t.series.xaxis[d][f].v)===i&&(e=e.replace(p,t.series.xaxis[d][f].label.replace(/\$/g,"$$$$")))}}if(void 0!==t.series.yaxis.ticks)for(var g in t.series.yaxis.ticks){if(t.series.yaxis.ticks.hasOwnProperty(g))(this.isCategoriesMode("yaxis",t)?t.series.yaxis.ticks[g].label:t.series.yaxis.ticks[g].v)===o&&(e=e.replace(h,t.series.yaxis.ticks[g].label.replace(/\$/g,"$$$$")))}return void 0!==t.series.xaxis.tickFormatter&&(e=e.replace("%x",t.series.xaxis.tickFormatter(i,t.series.xaxis).replace(/\$/g,"$$"))),void 0!==t.series.yaxis.tickFormatter&&(e=e.replace("%y",t.series.yaxis.tickFormatter(o,t.series.yaxis).replace(/\$/g,"$$"))),e},i.prototype.isTimeMode=function(e,t){return void 0!==t.series[e].options.mode&&"time"===t.series[e].options.mode},i.prototype.isXDateFormat=function(e){return void 0!==this.tooltipOptions.xDateFormat&&null!==this.tooltipOptions.xDateFormat},i.prototype.isYDateFormat=function(e){return void 0!==this.tooltipOptions.yDateFormat&&null!==this.tooltipOptions.yDateFormat},i.prototype.isCategoriesMode=function(e,t){return void 0!==t.series[e].options.mode&&"categories"===t.series[e].options.mode},i.prototype.timestampToDate=function(t,i,o){var n=e.plot.dateGenerator(t,o);return e.plot.formatDate(n,i,this.tooltipOptions.monthNames,this.tooltipOptions.dayNames)},i.prototype.adjustValPrecision=function(e,t,i){var o;return null!==t.match(e)&&""!==RegExp.$1&&(o=RegExp.$1,i=i.toFixed(o),t=t.replace(e,i)),t},i.prototype.hasAxisLabel=function(t,i){return-1!==e.inArray("axisLabels",this.plotPlugins)&&void 0!==i.series[t].options.axisLabel&&i.series[t].options.axisLabel.length>0},i.prototype.hasRotatedXAxisTicks=function(t){return-1!==e.inArray("tickRotor",this.plotPlugins)&&void 0!==t.series.xaxis.rotatedTicks};e.plot.plugins.push({init:function(e){new i(e)},options:t,name:"tooltip",version:"0.8.5"})}(jQuery)}})});