Files
store_keeping/admin/assets/bundles/vendorscripts.bundle.js
2021-12-21 00:25:43 +08:00

1 line
57 KiB
JavaScript

!function(t,e){if("function"==typeof define&&define.amd)define(["jquery"],e);else if("undefined"!=typeof exports)e(require("jquery"));else{e(t.jquery),t.metisMenu={}}}(this,function(t){"use strict";var e;(e=t)&&e.__esModule;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};var a,i,o,s,n,h,l,g,p=function(s){var e=!1,i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};function t(t){var e=this,i=!1;return s(this).one(n.TRANSITION_END,function(){i=!0}),setTimeout(function(){i||n.triggerTransitionEnd(e)},t),this}var n={TRANSITION_END:"mmTransitionEnd",triggerTransitionEnd:function(t){s(t).trigger(e.end)},supportsTransitionEnd:function(){return Boolean(e)}};return e=function(){if(window.QUnit)return!1;var t=document.createElement("mm");for(var e in i)if(void 0!==t.style[e])return{end:i[e]};return!1}(),s.fn.emulateTransitionEnd=t,n.supportsTransitionEnd()&&(s.event.special[n.TRANSITION_END]={bindType:e.end,delegateType:e.end,handle:function(t){if(s(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}}),n}(jQuery);a=jQuery,s="."+(o=i="metisMenu"),n=a.fn[i],h={toggle:!0,preventDefault:!0,activeClass:"active",collapseClass:"collapse",collapseInClass:"in",collapsingClass:"collapsing",triggerElement:"a",parentTrigger:"li",subMenu:"ul"},l={SHOW:"show"+s,SHOWN:"shown"+s,HIDE:"hide"+s,HIDDEN:"hidden"+s,CLICK_DATA_API:"click"+s+".data-api"},g=function(){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this._element=t,this._config=this._getConfig(e),this._transitioning=null,this.init()}return n.prototype.init=function(){var r=this;a(this._element).find(this._config.parentTrigger+"."+this._config.activeClass).has(this._config.subMenu).children(this._config.subMenu).attr("aria-expanded",!0).addClass(this._config.collapseClass+" "+this._config.collapseInClass),a(this._element).find(this._config.parentTrigger).not("."+this._config.activeClass).has(this._config.subMenu).children(this._config.subMenu).attr("aria-expanded",!1).addClass(this._config.collapseClass),a(this._element).find(this._config.parentTrigger).has(this._config.subMenu).children(this._config.triggerElement).on(l.CLICK_DATA_API,function(t){var e=a(this),i=e.parent(r._config.parentTrigger),s=i.siblings(r._config.parentTrigger).children(r._config.triggerElement),n=i.children(r._config.subMenu);r._config.preventDefault&&t.preventDefault(),"true"!==e.attr("aria-disabled")&&(i.hasClass(r._config.activeClass)?(e.attr("aria-expanded",!1),r._hide(n)):(r._show(n),e.attr("aria-expanded",!0),r._config.toggle&&s.attr("aria-expanded",!1)),r._config.onTransitionStart&&r._config.onTransitionStart(t))})},n.prototype._show=function(t){if(!this._transitioning&&!a(t).hasClass(this._config.collapsingClass)){var e=this,i=a(t),s=a.Event(l.SHOW);if(i.trigger(s),!s.isDefaultPrevented()){i.parent(this._config.parentTrigger).addClass(this._config.activeClass),this._config.toggle&&this._hide(i.parent(this._config.parentTrigger).siblings().children(this._config.subMenu+"."+this._config.collapseInClass).attr("aria-expanded",!1)),i.removeClass(this._config.collapseClass).addClass(this._config.collapsingClass).height(0),this.setTransitioning(!0);var n=function(){i.removeClass(e._config.collapsingClass).addClass(e._config.collapseClass+" "+e._config.collapseInClass).height("").attr("aria-expanded",!0),e.setTransitioning(!1),i.trigger(l.SHOWN)};p.supportsTransitionEnd()?i.height(i[0].scrollHeight).one(p.TRANSITION_END,n).emulateTransitionEnd(350):n()}}},n.prototype._hide=function(t){if(!this._transitioning&&a(t).hasClass(this._config.collapseInClass)){var e=this,i=a(t),s=a.Event(l.HIDE);if(i.trigger(s),!s.isDefaultPrevented()){i.parent(this._config.parentTrigger).removeClass(this._config.activeClass),i.height(i.height())[0].offsetHeight,i.addClass(this._config.collapsingClass).removeClass(this._config.collapseClass).removeClass(this._config.collapseInClass),this.setTransitioning(!0);var n=function(){e._transitioning&&e._config.onTransitionEnd&&e._config.onTransitionEnd(),e.setTransitioning(!1),i.trigger(l.HIDDEN),i.removeClass(e._config.collapsingClass).addClass(e._config.collapseClass).attr("aria-expanded",!1)};p.supportsTransitionEnd()?0==i.height()||"none"==i.css("display")?n():i.height(0).one(p.TRANSITION_END,n).emulateTransitionEnd(350):n()}}},n.prototype.setTransitioning=function(t){this._transitioning=t},n.prototype.dispose=function(){a.removeData(this._element,o),a(this._element).find(this._config.parentTrigger).has(this._config.subMenu).children(this._config.triggerElement).off("click"),this._transitioning=null,this._config=null,this._element=null},n.prototype._getConfig=function(t){return t=a.extend({},h,t)},n._jQueryInterface=function(s){return this.each(function(){var t=a(this),e=t.data(o),i=a.extend({},h,t.data(),"object"===(void 0===s?"undefined":r(s))&&s);if(!e&&/dispose/.test(s)&&this.dispose(),e||(e=new n(this,i),t.data(o,e)),"string"==typeof s){if(void 0===e[s])throw new Error('No method named "'+s+'"');e[s]()}})},n}(),a.fn[i]=g._jQueryInterface,a.fn[i].Constructor=g,a.fn[i].noConflict=function(){return a.fn[i]=n,g._jQueryInterface}}),function(_){jQuery.fn.extend({slimScroll:function(w){var C=_.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},w);return this.each(function(){function e(t){if(n){var e=0;(t=t||window.event).wheelDelta&&(e=-t.wheelDelta/120),t.detail&&(e=t.detail/3),_(t.target||t.srcTarget||t.srcElement).closest("."+C.wrapperClass).is(v.parent())&&s(e,!0),t.preventDefault&&!f&&t.preventDefault(),f||(t.returnValue=!1)}}function s(t,e,i){f=!1;var s=t,n=v.outerHeight()-x.outerHeight();e&&(s=parseInt(x.css("top"))+t*parseInt(C.wheelStep)/100*x.outerHeight(),s=Math.min(Math.max(s,0),n),s=0<t?Math.ceil(s):Math.floor(s),x.css({top:s+"px"})),s=(c=parseInt(x.css("top"))/(v.outerHeight()-x.outerHeight()))*(v[0].scrollHeight-v.outerHeight()),i&&(t=(s=t)/v[0].scrollHeight*v.outerHeight(),t=Math.min(Math.max(t,0),n),x.css({top:t+"px"})),v.scrollTop(s),v.trigger("slimscrolling",~~s),r(),a()}function i(){p=Math.max(v.outerHeight()/v[0].scrollHeight*v.outerHeight(),d),x.css({height:p+"px"});var t=p==v.outerHeight()?"none":"block";x.css({display:t})}function r(){i(),clearTimeout(l),c==~~c?(f=C.allowPageScroll,u!=c&&v.trigger("slimscroll",0==~~c?"top":"bottom")):f=!1,u=c,p>=v.outerHeight()?f=!0:(x.stop(!0,!0).fadeIn("fast"),C.railVisible&&y.stop(!0,!0).fadeIn("fast"))}function a(){C.alwaysVisible||(l=setTimeout(function(){C.disableFadeOut&&n||o||h||(x.fadeOut("slow"),y.fadeOut("slow"))},1e3))}var n,o,h,l,g,p,c,u,d=30,f=!1,v=_(this);if(v.parent().hasClass(C.wrapperClass)){var m=v.scrollTop(),x=v.parent().find("."+C.barClass),y=v.parent().find("."+C.railClass);if(i(),_.isPlainObject(w)){if("height"in w&&"auto"==w.height){v.parent().css("height","auto"),v.css("height","auto");var b=v.parent().parent().height();v.parent().css("height",b),v.css("height",b)}if("scrollTo"in w)m=parseInt(C.scrollTo);else if("scrollBy"in w)m+=parseInt(C.scrollBy);else if("destroy"in w)return x.remove(),y.remove(),void v.unwrap();s(m,!1,!0)}}else{C.height="auto"==C.height?v.parent().height():C.height,m=_("<div></div>").addClass(C.wrapperClass).css({position:"relative",overflow:"hidden",width:C.width,height:C.height}),v.css({overflow:"hidden",width:C.width,height:C.height});y=_("<div></div>").addClass(C.railClass).css({width:C.size,height:"100%",position:"absolute",top:0,display:C.alwaysVisible&&C.railVisible?"block":"none","border-radius":C.railBorderRadius,background:C.railColor,opacity:C.railOpacity,zIndex:90}),x=_("<div></div>").addClass(C.barClass).css({background:C.color,width:C.size,position:"absolute",top:0,opacity:C.opacity,display:C.alwaysVisible?"block":"none","border-radius":C.borderRadius,BorderRadius:C.borderRadius,MozBorderRadius:C.borderRadius,WebkitBorderRadius:C.borderRadius,zIndex:99}),b="right"==C.position?{right:C.distance}:{left:C.distance};y.css(b),x.css(b),v.wrap(m),v.parent().append(x),v.parent().append(y),C.railDraggable&&x.bind("mousedown",function(e){var i=_(document);return h=!0,t=parseFloat(x.css("top")),pageY=e.pageY,i.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,x.css("top",currTop),s(0,x.position().top,!1)}),i.bind("mouseup.slimscroll",function(t){h=!1,a(),i.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(t){return t.stopPropagation(),t.preventDefault(),!1}),y.hover(function(){r()},function(){a()}),x.hover(function(){o=!0},function(){o=!1}),v.hover(function(){n=!0,r(),a()},function(){n=!1,a()}),v.bind("touchstart",function(t,e){t.originalEvent.touches.length&&(g=t.originalEvent.touches[0].pageY)}),v.bind("touchmove",function(t){f||t.originalEvent.preventDefault(),t.originalEvent.touches.length&&(s((g-t.originalEvent.touches[0].pageY)/C.touchScrollStep,!0),g=t.originalEvent.touches[0].pageY)}),i(),"bottom"===C.start?(x.css({top:v.outerHeight()-x.outerHeight()}),s(0,!0)):"top"!==C.start&&(s(_(C.start).position().top,null,!0),C.alwaysVisible||x.hide()),function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",e,!1),this.addEventListener("mousewheel",e,!1),this.addEventListener("MozMousePixelScroll",e,!1)):document.attachEvent("onmousewheel",e)}()}}),this}}),jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})}(jQuery),function(n){"use strict";var r=function(t,e){this.$element=n(t),this.options=n.extend({},r.defaults,e)};r.defaults={transition_delay:300,refresh_speed:50,display_text:"none",use_percentage:!0,percent_format:function(t){return t+"%"},amount_format:function(t,e){return t+" / "+e},update:n.noop,done:n.noop,fail:n.noop},r.prototype.transition=function(){var a=this.$element,o=a.parent(),h=this.$back_text,l=this.$front_text,g=this.options,p=parseInt(a.attr("data-transitiongoal")),c=parseInt(a.attr("aria-valuemin"))||0,u=parseInt(a.attr("aria-valuemax"))||100,d=o.hasClass("vertical"),f=g.update&&"function"==typeof g.update?g.update:r.defaults.update,v=g.done&&"function"==typeof g.done?g.done:r.defaults.done,t=g.fail&&"function"==typeof g.fail?g.fail:r.defaults.fail;if(isNaN(p))t("data-transitiongoal not set");else{var e,m=Math.round(100*(p-c)/(u-c));if("center"===g.display_text&&!h&&!l)this.$back_text=h=n("<span>").addClass("progressbar-back-text").prependTo(o),this.$front_text=l=n("<span>").addClass("progressbar-front-text").prependTo(a),d?(e=o.css("height"),h.css({height:e,"line-height":e}),l.css({height:e,"line-height":e}),n(window).resize(function(){e=o.css("height"),h.css({height:e,"line-height":e}),l.css({height:e,"line-height":e})})):(e=o.css("width"),l.css({width:e}),n(window).resize(function(){e=o.css("width"),l.css({width:e})}));setTimeout(function(){var t,e,i,s,n;d?a.css("height",m+"%"):a.css("width",m+"%");var r=setInterval(function(){s=d?(i=a.height(),o.height()):(i=a.width(),o.width()),t=Math.round(100*i/s),e=Math.round(c+i/s*(u-c)),m<=t&&(t=m,e=p,v(a),clearInterval(r)),"none"!==g.display_text&&(n=g.use_percentage?g.percent_format(t):g.amount_format(e,u,c),"fill"===g.display_text?a.text(n):"center"===g.display_text&&(h.text(n),l.text(n))),a.attr("aria-valuenow",e),f(t,a)},g.refresh_speed)},g.transition_delay)}};var t=n.fn.progressbar;n.fn.progressbar=function(s){return this.each(function(){var t=n(this),e=t.data("bs.progressbar"),i="object"==typeof s&&s;e&&i&&n.extend(e.options,i),e||t.data("bs.progressbar",e=new r(this,i)),e.transition()})},n.fn.progressbar.Constructor=r,n.fn.progressbar.noConflict=function(){return n.fn.progressbar=t,this}}(window.jQuery),function(S,N,F){var t;t=function(E){"use strict";var t,e,m,A,b,L,O,z,g,C,i,r,p,B,c,s,n,j,D,o,a,h,l,w,u,d,f,v,x,y={},_=0;t=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:F,normalRangeMax:F,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:F,chartRangeMax:F,chartRangeMinX:F,chartRangeMaxX:F,tooltipFormat:new m('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:F,nullColor:F,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:F,chartRangeMin:F,chartRangeClip:!1,colorMap:F,tooltipFormat:new m('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new m('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:F,thresholdValue:0,chartRangeMax:F,chartRangeMin:F,chartRangeClip:!1,tooltipFormat:new m("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:F,tooltipFormat:new m("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new m('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:F,targetColor:"#4a2",chartRangeMax:F,chartRangeMin:F,tooltipFormat:new m("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},e=function(){var t,e;return t=function(){this.init.apply(this,arguments)},1<arguments.length?(arguments[0]?(t.prototype=E.extend(new arguments[0],arguments[arguments.length-1]),t._super=arguments[0].prototype):t.prototype=arguments[arguments.length-1],2<arguments.length&&((e=Array.prototype.slice.call(arguments,1,-1)).unshift(t.prototype),E.extend.apply(E,e))):t.prototype=arguments[0],t.prototype.cls=t},E.SPFormatClass=m=e({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(t,e){this.format=t,this.fclass=e},render:function(t,e,i){var s,n,r,a,o,h=this,l=t;return this.format.replace(this.fre,function(){return n=arguments[1],r=arguments[3],(s=h.precre.exec(n))?(o=s[2],n=s[1]):o=!1,(a=l[n])===F?"":r&&e&&e[r]?e[r].get?e[r].get(a)||a:e[r][a]||a:(g(a)&&(a=i.get("numberFormatter")?i.get("numberFormatter")(a):p(a,o,i.get("numberDigitGroupCount"),i.get("numberDigitGroupSep"),i.get("numberDecimalMark"))),a)})}}),E.spformat=function(t,e){return new m(t,e)},A=function(t,e,i){return t<e?e:i<t?i:t},b=function(t,e){var i;return 2===e?(i=N.floor(t.length/2),t.length%2?t[i]:(t[i-1]+t[i])/2):t.length%2?(i=(t.length*e+e)/4)%1?(t[N.floor(i)]+t[N.floor(i)-1])/2:t[i-1]:(i=(t.length*e+2)/4)%1?(t[N.floor(i)]+t[N.floor(i)-1])/2:t[i-1]},L=function(t){var e;switch(t){case"undefined":t=F;break;case"null":t=null;break;case"true":t=!0;break;case"false":t=!1;break;default:t==(e=parseFloat(t))&&(t=e)}return t},O=function(t){var e,i=[];for(e=t.length;e--;)i[e]=L(t[e]);return i},z=function(t,e){var i,s,n=[];for(i=0,s=t.length;i<s;i++)t[i]!==e&&n.push(t[i]);return n},g=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},p=function(t,e,i,s,n){var r,a;for(t=(!1===e?parseFloat(t).toString():t.toFixed(e)).split(""),(r=(r=E.inArray(".",t))<0?t.length:r)<t.length&&(t[r]=n),a=r-i;0<a;a-=i)t.splice(a,0,s);return t.join("")},C=function(t,e,i){var s;for(s=e.length;s--;)if((!i||null!==e[s])&&e[s]!==t)return!1;return!0},r=function(t){return E.isArray(t)?t:[t]},i=function(t){var e,i;if(S.createStyleSheet)try{return void(S.createStyleSheet().cssText=t)}catch(t){i=!0}(e=S.createElement("style")).type="text/css",S.getElementsByTagName("head")[0].appendChild(e),i?S.styleSheets[S.styleSheets.length-1].cssText=t:e["string"==typeof S.body.style.WebkitAppearance?"innerText":"innerHTML"]=t},E.fn.simpledraw=function(t,e,i,s){var n,r;if(i&&(n=this.data("_jqs_vcanvas")))return n;if(!1===E.fn.sparkline.canvas)return!1;if(E.fn.sparkline.canvas===F){var a=S.createElement("canvas");if(a.getContext&&a.getContext("2d"))E.fn.sparkline.canvas=function(t,e,i,s){return new f(t,e,i,s)};else{if(!S.namespaces||S.namespaces.v)return E.fn.sparkline.canvas=!1;S.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),E.fn.sparkline.canvas=function(t,e,i,s){return new v(t,e,i)}}}return t===F&&(t=E(this).innerWidth()),e===F&&(e=E(this).innerHeight()),n=E.fn.sparkline.canvas(t,e,this,s),(r=E(this).data("_jqs_mhandler"))&&r.registerCanvas(n),n},E.fn.cleardraw=function(){var t=this.data("_jqs_vcanvas");t&&t.reset()},E.RangeMapClass=B=e({init:function(t){var e,i,s=[];for(e in t)t.hasOwnProperty(e)&&"string"==typeof e&&-1<e.indexOf(":")&&((i=e.split(":"))[0]=0===i[0].length?-1/0:parseFloat(i[0]),i[1]=0===i[1].length?1/0:parseFloat(i[1]),i[2]=t[e],s.push(i));this.map=t,this.rangelist=s||!1},get:function(t){var e,i,s,n=this.rangelist;if((s=this.map[t])!==F)return s;if(n)for(e=n.length;e--;)if((i=n[e])[0]<=t&&i[1]>=t)return i[2];return F}}),E.range_map=function(t){return new B(t)},c=e({init:function(t,e){var i=E(t);this.$el=i,this.options=e,this.currentPageX=0,this.currentPageY=0,this.el=t,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!e.get("disableTooltips"),this.highlightEnabled=!e.get("disableHighlight")},registerSparkline:function(t){this.splist.push(t),this.over&&this.updateDisplay()},registerCanvas:function(t){var e=E(t.canvas);this.canvas=t,(this.$canvas=e).mouseenter(E.proxy(this.mouseenter,this)),e.mouseleave(E.proxy(this.mouseleave,this)),e.click(E.proxy(this.mouseclick,this))},reset:function(t){this.splist=[],this.tooltip&&t&&(this.tooltip.remove(),this.tooltip=F)},mouseclick:function(t){var e=E.Event("sparklineClick");e.originalEvent=t,e.sparklines=this.splist,this.$el.trigger(e)},mouseenter:function(t){E(S.body).unbind("mousemove.jqs"),E(S.body).bind("mousemove.jqs",E.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new s(this.options),this.tooltip.updatePosition(t.pageX,t.pageY)),this.updateDisplay()},mouseleave:function(){E(S.body).unbind("mousemove.jqs");var t,e=this.splist,i=e.length,s=!1;for(this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null),t=0;t<i;t++)e[t].clearRegionHighlight()&&(s=!0);s&&this.canvas.render()},mousemove:function(t){this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,this.tooltip&&this.tooltip.updatePosition(t.pageX,t.pageY),this.updateDisplay()},updateDisplay:function(){var t,e,i,s,n=this.splist,r=n.length,a=!1,o=this.$canvas.offset(),h=this.currentPageX-o.left,l=this.currentPageY-o.top;if(this.over){for(e=0;e<r;e++)(i=n[e].setRegionHighlight(this.currentEl,h,l))&&(a=!0);if(a){if((s=E.Event("sparklineRegionChange")).sparklines=this.splist,this.$el.trigger(s),this.tooltip){for(t="",e=0;e<r;e++)t+=n[e].getCurrentRegionTooltip();this.tooltip.setContent(t)}this.disableHighlight||this.canvas.render()}null===i&&this.mouseleave()}}}),s=e({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(t){var e,i=t.get("tooltipClassname","jqstooltip"),s=this.sizeStyle;this.container=t.get("tooltipContainer")||S.body,this.tooltipOffsetX=t.get("tooltipOffsetX",10),this.tooltipOffsetY=t.get("tooltipOffsetY",12),E("#jqssizetip").remove(),E("#jqstooltip").remove(),this.sizetip=E("<div/>",{id:"jqssizetip",style:s,class:i}),this.tooltip=E("<div/>",{id:"jqstooltip",class:i}).appendTo(this.container),e=this.tooltip.offset(),this.offsetLeft=e.left,this.offsetTop=e.top,this.hidden=!0,E(window).unbind("resize.jqs scroll.jqs"),E(window).bind("resize.jqs scroll.jqs",E.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=E(window).scrollTop(),this.scrollLeft=E(window).scrollLeft(),this.scrollRight=this.scrollLeft+E(window).width(),this.updatePosition()},getSize:function(t){this.sizetip.html(t).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(t){if(!t)return this.tooltip.css("visibility","hidden"),void(this.hidden=!0);this.getSize(t),this.tooltip.html(t).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition())},updatePosition:function(t,e){if(t===F){if(this.mousex===F)return;t=this.mousex-this.offsetLeft,e=this.mousey-this.offsetTop}else this.mousex=t-=this.offsetLeft,this.mousey=e-=this.offsetTop;this.height&&this.width&&!this.hidden&&(e-=this.height+this.tooltipOffsetY,t+=this.tooltipOffsetX,e<this.scrollTop&&(e=this.scrollTop),t<this.scrollLeft?t=this.scrollLeft:t+this.width>this.scrollRight&&(t=this.scrollRight-this.width),this.tooltip.css({left:t,top:e}))},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=F,E(window).unbind("resize.jqs scroll.jqs")}}),E(function(){i('.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;box-sizing: content-box;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}')}),x=[],E.fn.sparkline=function(l,i){return this.each(function(){var t,e,o=new E.fn.sparkline.options(this,i),h=E(this);if(t=function(){var t,e,i,s,n,r,a;t="html"===l||l===F?((a=this.getAttribute(o.get("tagValuesAttribute")))!==F&&null!==a||(a=h.html()),a.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")):l,e="auto"===o.get("width")?t.length*o.get("defaultPixelsPerValue"):o.get("width"),"auto"===o.get("height")?o.get("composite")&&E.data(this,"_jqs_vcanvas")||((s=S.createElement("span")).innerHTML="a",h.html(s),i=E(s).innerHeight()||E(s).height(),E(s).remove(),s=null):i=o.get("height"),o.get("disableInteraction")?n=!1:(n=E.data(this,"_jqs_mhandler"))?o.get("composite")||n.reset():(n=new c(this,o),E.data(this,"_jqs_mhandler",n)),!o.get("composite")||E.data(this,"_jqs_vcanvas")?((r=new(E.fn.sparkline[o.get("type")])(this,t,o,e,i)).render(),n&&n.registerSparkline(r)):E.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),E.data(this,"_jqs_errnotify",!0))},E(this).html()&&!o.get("disableHiddenCheck")&&E(this).is(":hidden")||!E(this).parents("body").length){if(!o.get("composite")&&E.data(this,"_jqs_pending"))for(e=x.length;e;e--)x[e-1][0]==this&&x.splice(e-1,1);x.push([this,t]),E.data(this,"_jqs_pending",!0)}else t.call(this)})},E.fn.sparkline.defaults=t(),E.sparkline_display_visible=function(){var t,e,i,s=[];for(e=0,i=x.length;e<i;e++)t=x[e][0],E(t).is(":visible")&&!E(t).parents().is(":hidden")?(x[e][1].call(t),E.data(x[e][0],"_jqs_pending",!1),s.push(e)):E(t).closest("html").length||E.data(t,"_jqs_pending")||(E.data(x[e][0],"_jqs_pending",!1),s.push(e));for(e=s.length;e;e--)x.splice(s[e-1],1)},E.fn.sparkline.options=e({init:function(t,e){var i,s,n,r;this.userOptions=e=e||{},this.tag=t,this.tagValCache={},n=(s=E.fn.sparkline.defaults).common,this.tagOptionsPrefix=e.enableTagOptions&&(e.tagOptionsPrefix||n.tagOptionsPrefix),i=(r=this.getTagSetting("type"))===y?s[e.type||n.type]:s[r],this.mergedOptions=E.extend({},n,i,e)},getTagSetting:function(t){var e,i,s,n,r=this.tagOptionsPrefix;if(!1===r||r===F)return y;if(this.tagValCache.hasOwnProperty(t))e=this.tagValCache.key;else{if((e=this.tag.getAttribute(r+t))===F||null===e)e=y;else if("["===e.substr(0,1))for(i=(e=e.substr(1,e.length-2).split(",")).length;i--;)e[i]=L(e[i].replace(/(^\s*)|(\s*$)/g,""));else if("{"===e.substr(0,1))for(s=e.substr(1,e.length-2).split(","),e={},i=s.length;i--;)e[(n=s[i].split(":",2))[0].replace(/(^\s*)|(\s*$)/g,"")]=L(n[1].replace(/(^\s*)|(\s*$)/g,""));else e=L(e);this.tagValCache.key=e}return e},get:function(t,e){var i,s=this.getTagSetting(t);return s!==y?s:(i=this.mergedOptions[t])===F?e:i}}),E.fn.sparkline._base=e({disabled:!1,init:function(t,e,i,s,n){this.el=t,this.$el=E(t),this.values=e,this.options=i,this.width=s,this.height=n,this.currentRegion=F},initTarget:function(){var t=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),t))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return!this.disabled||(this.el.innerHTML="",!1)},getRegion:function(t,e){},setRegionHighlight:function(t,e,i){var s,n=this.currentRegion,r=!this.options.get("disableHighlight");return e>this.canvasWidth||i>this.canvasHeight||e<0||i<0?null:n!==(s=this.getRegion(t,e,i))&&(n!==F&&r&&this.removeHighlight(),(this.currentRegion=s)!==F&&r&&this.renderHighlight(),!0)},clearRegionHighlight:function(){return this.currentRegion!==F&&(this.removeHighlight(),!(this.currentRegion=F))},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(t){},getCurrentRegionTooltip:function(){var t,e,i,s,n,r,a,o,h,l,g,p,c,u,d=this.options,f="",v=[];if(this.currentRegion===F)return"";if(t=this.getCurrentRegionFields(),g=d.get("tooltipFormatter"))return g(this,d,t);if(d.get("tooltipChartTitle")&&(f+='<div class="jqs jqstitle">'+d.get("tooltipChartTitle")+"</div>\n"),!(e=this.options.get("tooltipFormat")))return"";if(E.isArray(e)||(e=[e]),E.isArray(t)||(t=[t]),a=this.options.get("tooltipFormatFieldlist"),o=this.options.get("tooltipFormatFieldlistKey"),a&&o){for(h=[],r=t.length;r--;)l=t[r][o],-1!=(u=E.inArray(l,a))&&(h[u]=t[r]);t=h}for(i=e.length,c=t.length,r=0;r<i;r++)for("string"==typeof(p=e[r])&&(p=new m(p)),s=p.fclass||"jqsfield",u=0;u<c;u++)t[u].isNull&&d.get("tooltipSkipNull")||(E.extend(t[u],{prefix:d.get("tooltipPrefix"),suffix:d.get("tooltipSuffix")}),n=p.render(t[u],d.get("tooltipValueLookups"),d),v.push('<div class="'+s+'">'+n+"</div>"));return v.length?f+v.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(t,e){var i,s,n,r,a=e.get("highlightColor"),o=e.get("highlightLighten");if(a)return a;if(o&&(i=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t))){for(n=[],s=4===t.length?16:1,r=0;r<3;r++)n[r]=A(N.round(parseInt(i[r+1],16)*s*o),0,255);return"rgb("+n.join(",")+")"}return t}}),n={changeHighlight:function(t){var e,i=this.currentRegion,s=this.target,n=this.regionShapes[i];n&&(e=this.renderRegion(i,t),E.isArray(e)||E.isArray(n)?(s.replaceWithShapes(n,e),this.regionShapes[i]=E.map(e,function(t){return t.id})):(s.replaceWithShape(n,e),this.regionShapes[i]=e.id))},render:function(){var t,e,i,s,n=this.values,r=this.target,a=this.regionShapes;if(this.cls._super.render.call(this)){for(i=n.length;i--;)if(t=this.renderRegion(i))if(E.isArray(t)){for(e=[],s=t.length;s--;)t[s].append(),e.push(t[s].id);a[i]=e}else t.append(),a[i]=t.id;else a[i]=null;r.render()}}},E.fn.sparkline.line=j=e(E.fn.sparkline._base,{type:"line",init:function(t,e,i,s,n){j._super.init.call(this,t,e,i,s,n),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(t,e,i){var s,n=this.regionMap;for(s=n.length;s--;)if(null!==n[s]&&e>=n[s][0]&&e<=n[s][1])return n[s][2];return F},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:null===this.yvalues[t],x:this.xvalues[t],y:this.yvalues[t],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:t}},renderHighlight:function(){var t,e,i=this.currentRegion,s=this.target,n=this.vertices[i],r=this.options,a=r.get("spotRadius"),o=r.get("highlightSpotColor"),h=r.get("highlightLineColor");n&&(a&&o&&(t=s.drawCircle(n[0],n[1],a,F,o),this.highlightSpotId=t.id,s.insertAfterShape(this.lastShapeId,t)),h&&(e=s.drawLine(n[0],this.canvasTop,n[0],this.canvasTop+this.canvasHeight,h),this.highlightLineId=e.id,s.insertAfterShape(this.lastShapeId,e)))},removeHighlight:function(){var t=this.target;this.highlightSpotId&&(t.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(t.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var t,e,i,s,n,r=this.values,a=r.length,o=this.xvalues,h=this.yvalues,l=this.yminmax;for(t=0;t<a;t++)e=r[t],i="string"==typeof r[t],s="object"==typeof r[t]&&r[t]instanceof Array,n=i&&r[t].split(":"),i&&2===n.length?(o.push(Number(n[0])),h.push(Number(n[1])),l.push(Number(n[1]))):s?(o.push(e[0]),h.push(e[1]),l.push(e[1])):(o.push(t),null===r[t]||"null"===r[t]?h.push(null):(h.push(Number(e)),l.push(Number(e))));this.options.get("xvalues")&&(o=this.options.get("xvalues")),this.maxy=this.maxyorg=N.max.apply(N,l),this.miny=this.minyorg=N.min.apply(N,l),this.maxx=N.max.apply(N,o),this.minx=N.min.apply(N,o),this.xvalues=o,this.yvalues=h,this.yminmax=l},processRangeOptions:function(){var t=this.options,e=t.get("normalRangeMin"),i=t.get("normalRangeMax");e!==F&&(e<this.miny&&(this.miny=e),i>this.maxy&&(this.maxy=i)),t.get("chartRangeMin")!==F&&(t.get("chartRangeClip")||t.get("chartRangeMin")<this.miny)&&(this.miny=t.get("chartRangeMin")),t.get("chartRangeMax")!==F&&(t.get("chartRangeClip")||t.get("chartRangeMax")>this.maxy)&&(this.maxy=t.get("chartRangeMax")),t.get("chartRangeMinX")!==F&&(t.get("chartRangeClipX")||t.get("chartRangeMinX")<this.minx)&&(this.minx=t.get("chartRangeMinX")),t.get("chartRangeMaxX")!==F&&(t.get("chartRangeClipX")||t.get("chartRangeMaxX")>this.maxx)&&(this.maxx=t.get("chartRangeMaxX"))},drawNormalRange:function(t,e,i,s,n){var r=this.options.get("normalRangeMin"),a=this.options.get("normalRangeMax"),o=e+N.round(i-i*((a-this.miny)/n)),h=N.round(i*(a-r)/n);this.target.drawRect(t,o,s,h,F,this.options.get("normalRangeColor")).append()},render:function(){var t,e,i,s,n,r,a,o,h,l,g,p,c,u,d,f,v,m,x,y,b,w,C,_,S=this.options,R=this.target,M=this.canvasWidth,T=this.canvasHeight,k=this.vertices,H=S.get("spotRadius"),I=this.regionMap;if(j._super.render.call(this)&&(this.scanValues(),this.processRangeOptions(),w=this.xvalues,C=this.yvalues,this.yminmax.length&&!(this.yvalues.length<2))){for(s=n=0,t=this.maxx-this.minx==0?1:this.maxx-this.minx,e=this.maxy-this.miny==0?1:this.maxy-this.miny,i=this.yvalues.length-1,H&&(M<4*H||T<4*H)&&(H=0),H&&(((y=S.get("highlightSpotColor")&&!S.get("disableInteraction"))||S.get("minSpotColor")||S.get("spotColor")&&C[i]===this.miny)&&(T-=N.ceil(H)),(y||S.get("maxSpotColor")||S.get("spotColor")&&C[i]===this.maxy)&&(T-=N.ceil(H),s+=N.ceil(H)),(y||(S.get("minSpotColor")||S.get("maxSpotColor"))&&(C[0]===this.miny||C[0]===this.maxy))&&(n+=N.ceil(H),M-=N.ceil(H)),(y||S.get("spotColor")||S.get("minSpotColor")||S.get("maxSpotColor")&&(C[i]===this.miny||C[i]===this.maxy))&&(M-=N.ceil(H))),T--,S.get("normalRangeMin")===F||S.get("drawNormalOnTop")||this.drawNormalRange(n,s,T,M,e),o=[a=[]],c=u=null,d=C.length,_=0;_<d;_++)h=w[_],g=w[_+1],l=C[_],u=(p=n+N.round((h-this.minx)*(M/t)))+((_<d-1?n+N.round((g-this.minx)*(M/t)):M)-p)/2,I[_]=[c||0,u,_],c=u,null===l?_&&(null!==C[_-1]&&(a=[],o.push(a)),k.push(null)):(l<this.miny&&(l=this.miny),l>this.maxy&&(l=this.maxy),a.length||a.push([p,s+T]),r=[p,s+N.round(T-T*((l-this.miny)/e))],a.push(r),k.push(r));for(f=[],v=[],m=o.length,_=0;_<m;_++)(a=o[_]).length&&(S.get("fillColor")&&(a.push([a[a.length-1][0],s+T]),v.push(a.slice(0)),a.pop()),2<a.length&&(a[0]=[a[0][0],a[1][1]]),f.push(a));for(m=v.length,_=0;_<m;_++)R.drawShape(v[_],S.get("fillColor"),S.get("fillColor")).append();for(S.get("normalRangeMin")!==F&&S.get("drawNormalOnTop")&&this.drawNormalRange(n,s,T,M,e),m=f.length,_=0;_<m;_++)R.drawShape(f[_],S.get("lineColor"),F,S.get("lineWidth")).append();if(H&&S.get("valueSpots"))for((x=S.get("valueSpots")).get===F&&(x=new B(x)),_=0;_<d;_++)(b=x.get(C[_]))&&R.drawCircle(n+N.round((w[_]-this.minx)*(M/t)),s+N.round(T-T*((C[_]-this.miny)/e)),H,F,b).append();H&&S.get("spotColor")&&null!==C[i]&&R.drawCircle(n+N.round((w[w.length-1]-this.minx)*(M/t)),s+N.round(T-T*((C[i]-this.miny)/e)),H,F,S.get("spotColor")).append(),this.maxy!==this.minyorg&&(H&&S.get("minSpotColor")&&(h=w[E.inArray(this.minyorg,C)],R.drawCircle(n+N.round((h-this.minx)*(M/t)),s+N.round(T-T*((this.minyorg-this.miny)/e)),H,F,S.get("minSpotColor")).append()),H&&S.get("maxSpotColor")&&(h=w[E.inArray(this.maxyorg,C)],R.drawCircle(n+N.round((h-this.minx)*(M/t)),s+N.round(T-T*((this.maxyorg-this.miny)/e)),H,F,S.get("maxSpotColor")).append())),this.lastShapeId=R.getLastShapeId(),this.canvasTop=s,R.render()}}}),E.fn.sparkline.bar=D=e(E.fn.sparkline._base,n,{type:"bar",init:function(t,e,i,s,n){var r,a,o,h,l,g,p,c,u,d,f,v,m,x,y,b,w,C,_,S,R,M=parseInt(i.get("barWidth"),10),T=parseInt(i.get("barSpacing"),10),k=i.get("chartRangeMin"),H=i.get("chartRangeMax"),I=i.get("chartRangeClip"),j=1/0,W=-1/0;for(D._super.init.call(this,t,e,i,s,n),g=0,p=e.length;g<p;g++)((r="string"==typeof(S=e[g])&&-1<S.indexOf(":"))||E.isArray(S))&&(y=!0,r&&(S=e[g]=O(S.split(":"))),S=z(S,null),(a=N.min.apply(N,S))<j&&(j=a),W<(o=N.max.apply(N,S))&&(W=o));this.stacked=y,this.regionShapes={},this.barWidth=M,this.barSpacing=T,this.totalBarWidth=M+T,this.width=s=e.length*M+(e.length-1)*T,this.initTarget(),I&&(m=k===F?-1/0:k,x=H===F?1/0:H),l=[],h=y?[]:l;var P=[],q=[];for(g=0,p=e.length;g<p;g++)if(y)for(b=e[g],e[g]=_=[],P[g]=0,h[g]=q[g]=0,w=0,C=b.length;w<C;w++)null!==(S=_[w]=I?A(b[w],m,x):b[w])&&(0<S&&(P[g]+=S),j<0&&0<W?S<0?q[g]+=N.abs(S):h[g]+=S:h[g]+=N.abs(S-(S<0?W:j)),l.push(S));else S=I?A(e[g],m,x):e[g],null!==(S=e[g]=L(S))&&l.push(S);this.max=v=N.max.apply(N,l),this.min=f=N.min.apply(N,l),this.stackMax=W=y?N.max.apply(N,P):v,this.stackMin=j=y?N.min.apply(N,l):f,i.get("chartRangeMin")!==F&&(i.get("chartRangeClip")||i.get("chartRangeMin")<f)&&(f=i.get("chartRangeMin")),i.get("chartRangeMax")!==F&&(i.get("chartRangeClip")||i.get("chartRangeMax")>v)&&(v=i.get("chartRangeMax")),this.zeroAxis=u=i.get("zeroAxis",!0),d=f<=0&&0<=v&&u?0:0==u?f:0<f?f:v,this.xaxisOffset=d,c=y?N.max.apply(N,h)+N.max.apply(N,q):v-f,this.canvasHeightEf=u&&f<0?this.canvasHeight-2:this.canvasHeight-1,f<d?(R=((y&&0<=v?W:v)-d)/c*this.canvasHeight)!==N.ceil(R)&&(this.canvasHeightEf-=2,R=N.ceil(R)):R=this.canvasHeight,this.yoffset=R,E.isArray(i.get("colorMap"))?(this.colorMapByIndex=i.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=i.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===F&&(this.colorMapByValue=new B(this.colorMapByValue))),this.range=c},getRegion:function(t,e,i){var s=N.floor(e/this.totalBarWidth);return s<0||s>=this.values.length?F:s},getCurrentRegionFields:function(){var t,e,i=this.currentRegion,s=r(this.values[i]),n=[];for(e=s.length;e--;)t=s[e],n.push({isNull:null===t,value:t,color:this.calcColor(e,t,i),offset:i});return n},calcColor:function(t,e,i){var s,n,r=this.colorMapByIndex,a=this.colorMapByValue,o=this.options;return s=this.stacked?o.get("stackedBarColor"):e<0?o.get("negBarColor"):o.get("barColor"),0===e&&o.get("zeroColor")!==F&&(s=o.get("zeroColor")),a&&(n=a.get(e))?s=n:r&&r.length>i&&(s=r[i]),E.isArray(s)?s[t%s.length]:s},renderRegion:function(t,e){var i,s,n,r,a,o,h,l,g,p,c=this.values[t],u=this.options,d=this.xaxisOffset,f=[],v=this.range,m=this.stacked,x=this.target,y=t*this.totalBarWidth,b=this.canvasHeightEf,w=this.yoffset;if(h=(c=E.isArray(c)?c:[c]).length,l=c[0],r=C(null,c),p=C(d,c,!0),r)return u.get("nullColor")?(n=e?u.get("nullColor"):this.calcHighlightColor(u.get("nullColor"),u),i=0<w?w-1:w,x.drawRect(y,i,this.barWidth-1,0,n,n)):F;for(a=w,o=0;o<h;o++){if(l=c[o],m&&l===d){if(!p||g)continue;g=!0}s=0<v?N.floor(b*(N.abs(l-d)/v))+1:1,l<d||l===d&&0===w?(i=a,a+=s):(i=w-s,w-=s),n=this.calcColor(o,l,t),e&&(n=this.calcHighlightColor(n,u)),f.push(x.drawRect(y,i,this.barWidth-1,s-1,n,n))}return 1===f.length?f[0]:f}}),E.fn.sparkline.tristate=o=e(E.fn.sparkline._base,n,{type:"tristate",init:function(t,e,i,s,n){var r=parseInt(i.get("barWidth"),10),a=parseInt(i.get("barSpacing"),10);o._super.init.call(this,t,e,i,s,n),this.regionShapes={},this.barWidth=r,this.barSpacing=a,this.totalBarWidth=r+a,this.values=E.map(e,Number),this.width=s=e.length*r+(e.length-1)*a,E.isArray(i.get("colorMap"))?(this.colorMapByIndex=i.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=i.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===F&&(this.colorMapByValue=new B(this.colorMapByValue))),this.initTarget()},getRegion:function(t,e,i){return N.floor(e/this.totalBarWidth)},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:this.values[t]===F,value:this.values[t],color:this.calcColor(this.values[t],t),offset:t}},calcColor:function(t,e){var i,s=this.values,n=this.options,r=this.colorMapByIndex,a=this.colorMapByValue;return a&&(i=a.get(t))?i:r&&r.length>e?r[e]:s[e]<0?n.get("negBarColor"):0<s[e]?n.get("posBarColor"):n.get("zeroBarColor")},renderRegion:function(t,e){var i,s,n,r,a,o,h=this.values,l=this.options,g=this.target;if(i=g.pixelHeight,n=N.round(i/2),r=t*this.totalBarWidth,s=h[t]<0?(a=n)-1:0<h[t]?(a=0,n-1):(a=n-1,2),null!==(o=this.calcColor(h[t],t)))return e&&(o=this.calcHighlightColor(o,l)),g.drawRect(r,a,this.barWidth-1,s-1,o,o)}}),E.fn.sparkline.discrete=a=e(E.fn.sparkline._base,n,{type:"discrete",init:function(t,e,i,s,n){a._super.init.call(this,t,e,i,s,n),this.regionShapes={},this.values=e=E.map(e,Number),this.min=N.min.apply(N,e),this.max=N.max.apply(N,e),this.range=this.max-this.min,this.width=s="auto"===i.get("width")?2*e.length:this.width,this.interval=N.floor(s/e.length),this.itemWidth=s/e.length,i.get("chartRangeMin")!==F&&(i.get("chartRangeClip")||i.get("chartRangeMin")<this.min)&&(this.min=i.get("chartRangeMin")),i.get("chartRangeMax")!==F&&(i.get("chartRangeClip")||i.get("chartRangeMax")>this.max)&&(this.max=i.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight="auto"===i.get("lineHeight")?N.round(.3*this.canvasHeight):i.get("lineHeight"))},getRegion:function(t,e,i){return N.floor(e/this.itemWidth)},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:this.values[t]===F,value:this.values[t],offset:t}},renderRegion:function(t,e){var i,s,n,r,a=this.values,o=this.options,h=this.min,l=this.max,g=this.range,p=this.interval,c=this.target,u=this.canvasHeight,d=this.lineHeight,f=u-d;return s=A(a[t],h,l),r=t*p,i=N.round(f-f*((s-h)/g)),n=o.get("thresholdColor")&&s<o.get("thresholdValue")?o.get("thresholdColor"):o.get("lineColor"),e&&(n=this.calcHighlightColor(n,o)),c.drawLine(r,i,r,i+d,n)}}),E.fn.sparkline.bullet=h=e(E.fn.sparkline._base,{type:"bullet",init:function(t,e,i,s,n){var r,a,o;h._super.init.call(this,t,e,i,s,n),this.values=e=O(e),(o=e.slice())[0]=null===o[0]?o[2]:o[0],o[1]=null===e[1]?o[2]:o[1],r=N.min.apply(N,e),a=N.max.apply(N,e),r=i.get("base")===F?r<0?r:0:i.get("base"),this.min=r,this.max=a,this.range=a-r,this.shapes={},this.valueShapes={},this.regiondata={},this.width=s="auto"===i.get("width")?"4.0em":s,this.target=this.$el.simpledraw(s,n,i.get("composite")),e.length||(this.disabled=!0),this.initTarget()},getRegion:function(t,e,i){var s=this.target.getShapeAt(t,e,i);return s!==F&&this.shapes[s]!==F?this.shapes[s]:F},getCurrentRegionFields:function(){var t=this.currentRegion;return{fieldkey:t.substr(0,1),value:this.values[t.substr(1)],region:t}},changeHighlight:function(t){var e,i=this.currentRegion,s=this.valueShapes[i];switch(delete this.shapes[s],i.substr(0,1)){case"r":e=this.renderRange(i.substr(1),t);break;case"p":e=this.renderPerformance(t);break;case"t":e=this.renderTarget(t)}this.valueShapes[i]=e.id,this.shapes[e.id]=i,this.target.replaceWithShape(s,e)},renderRange:function(t,e){var i=this.values[t],s=N.round(this.canvasWidth*((i-this.min)/this.range)),n=this.options.get("rangeColors")[t-2];return e&&(n=this.calcHighlightColor(n,this.options)),this.target.drawRect(0,0,s-1,this.canvasHeight-1,n,n)},renderPerformance:function(t){var e=this.values[1],i=N.round(this.canvasWidth*((e-this.min)/this.range)),s=this.options.get("performanceColor");return t&&(s=this.calcHighlightColor(s,this.options)),this.target.drawRect(0,N.round(.3*this.canvasHeight),i-1,N.round(.4*this.canvasHeight)-1,s,s)},renderTarget:function(t){var e=this.values[0],i=N.round(this.canvasWidth*((e-this.min)/this.range)-this.options.get("targetWidth")/2),s=N.round(.1*this.canvasHeight),n=this.canvasHeight-2*s,r=this.options.get("targetColor");return t&&(r=this.calcHighlightColor(r,this.options)),this.target.drawRect(i,s,this.options.get("targetWidth")-1,n-1,r,r)},render:function(){var t,e,i=this.values.length,s=this.target;if(h._super.render.call(this)){for(t=2;t<i;t++)e=this.renderRange(t).append(),this.shapes[e.id]="r"+t,this.valueShapes["r"+t]=e.id;null!==this.values[1]&&(e=this.renderPerformance().append(),this.shapes[e.id]="p1",this.valueShapes.p1=e.id),null!==this.values[0]&&(e=this.renderTarget().append(),this.shapes[e.id]="t0",this.valueShapes.t0=e.id),s.render()}}}),E.fn.sparkline.pie=l=e(E.fn.sparkline._base,{type:"pie",init:function(t,e,i,s,n){var r,a=0;if(l._super.init.call(this,t,e,i,s,n),this.shapes={},this.valueShapes={},this.values=e=E.map(e,Number),"auto"===i.get("width")&&(this.width=this.height),0<e.length)for(r=e.length;r--;)a+=e[r];this.total=a,this.initTarget(),this.radius=N.floor(N.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(t,e,i){var s=this.target.getShapeAt(t,e,i);return s!==F&&this.shapes[s]!==F?this.shapes[s]:F},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:this.values[t]===F,value:this.values[t],percent:this.values[t]/this.total*100,color:this.options.get("sliceColors")[t%this.options.get("sliceColors").length],offset:t}},changeHighlight:function(t){var e=this.currentRegion,i=this.renderSlice(e,t),s=this.valueShapes[e];delete this.shapes[s],this.target.replaceWithShape(s,i),this.valueShapes[e]=i.id,this.shapes[i.id]=e},renderSlice:function(t,e){var i,s,n,r,a,o=this.target,h=this.options,l=this.radius,g=h.get("borderWidth"),p=h.get("offset"),c=2*N.PI,u=this.values,d=this.total,f=p?2*N.PI*(p/360):0;for(r=u.length,n=0;n<r;n++){if(s=i=f,0<d&&(s=f+c*(u[n]/d)),t===n)return a=h.get("sliceColors")[n%h.get("sliceColors").length],e&&(a=this.calcHighlightColor(a,h)),o.drawPieSlice(l,l,l-g,i,s,F,a);f=s}},render:function(){var t,e,i=this.target,s=this.values,n=this.options,r=this.radius,a=n.get("borderWidth");if(l._super.render.call(this)){for(a&&i.drawCircle(r,r,N.floor(r-a/2),n.get("borderColor"),F,a).append(),e=s.length;e--;)s[e]&&(t=this.renderSlice(e).append(),this.valueShapes[e]=t.id,this.shapes[t.id]=e);i.render()}}}),E.fn.sparkline.box=w=e(E.fn.sparkline._base,{type:"box",init:function(t,e,i,s,n){w._super.init.call(this,t,e,i,s,n),this.values=E.map(e,Number),this.width="auto"===i.get("width")?"4.0em":s,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var t=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==F&&t.push({field:"lo",value:this.loutlier}),this.routlier!==F&&t.push({field:"ro",value:this.routlier}),this.lwhisker!==F&&t.push({field:"lw",value:this.lwhisker}),this.rwhisker!==F&&t.push({field:"rw",value:this.rwhisker}),t},render:function(){var t,e,i,s,n,r,a,o,h,l,g,p=this.target,c=this.values,u=c.length,d=this.options,f=this.canvasWidth,v=this.canvasHeight,m=d.get("chartRangeMin")===F?N.min.apply(N,c):d.get("chartRangeMin"),x=d.get("chartRangeMax")===F?N.max.apply(N,c):d.get("chartRangeMax"),y=0;if(w._super.render.call(this)){if(d.get("raw"))d.get("showOutliers")&&5<c.length?(e=c[0],t=c[1],s=c[2],n=c[3],r=c[4],a=c[5],o=c[6]):(t=c[0],s=c[1],n=c[2],r=c[3],a=c[4]);else if(c.sort(function(t,e){return t-e}),s=b(c,1),n=b(c,2),i=(r=b(c,3))-s,d.get("showOutliers")){for(t=a=F,h=0;h<u;h++)t===F&&c[h]>s-i*d.get("outlierIQR")&&(t=c[h]),c[h]<r+i*d.get("outlierIQR")&&(a=c[h]);e=c[0],o=c[u-1]}else t=c[0],a=c[u-1];this.quartiles=[s,n,r],this.lwhisker=t,this.rwhisker=a,this.loutlier=e,this.routlier=o,g=f/(x-m+1),d.get("showOutliers")&&(y=N.ceil(d.get("spotRadius")),g=(f-=2*N.ceil(d.get("spotRadius")))/(x-m+1),e<t&&p.drawCircle((e-m)*g+y,v/2,d.get("spotRadius"),d.get("outlierLineColor"),d.get("outlierFillColor")).append(),a<o&&p.drawCircle((o-m)*g+y,v/2,d.get("spotRadius"),d.get("outlierLineColor"),d.get("outlierFillColor")).append()),p.drawRect(N.round((s-m)*g+y),N.round(.1*v),N.round((r-s)*g),N.round(.8*v),d.get("boxLineColor"),d.get("boxFillColor")).append(),p.drawLine(N.round((t-m)*g+y),N.round(v/2),N.round((s-m)*g+y),N.round(v/2),d.get("lineColor")).append(),p.drawLine(N.round((t-m)*g+y),N.round(v/4),N.round((t-m)*g+y),N.round(v-v/4),d.get("whiskerColor")).append(),p.drawLine(N.round((a-m)*g+y),N.round(v/2),N.round((r-m)*g+y),N.round(v/2),d.get("lineColor")).append(),p.drawLine(N.round((a-m)*g+y),N.round(v/4),N.round((a-m)*g+y),N.round(v-v/4),d.get("whiskerColor")).append(),p.drawLine(N.round((n-m)*g+y),N.round(.1*v),N.round((n-m)*g+y),N.round(.9*v),d.get("medianColor")).append(),d.get("target")&&(l=N.ceil(d.get("spotRadius")),p.drawLine(N.round((d.get("target")-m)*g+y),N.round(v/2-l),N.round((d.get("target")-m)*g+y),N.round(v/2+l),d.get("targetColor")).append(),p.drawLine(N.round((d.get("target")-m)*g+y-l),N.round(v/2),N.round((d.get("target")-m)*g+y+l),N.round(v/2),d.get("targetColor")).append()),p.render()}}}),u=e({init:function(t,e,i,s){this.target=t,this.id=e,this.type=i,this.args=s},append:function(){return this.target.appendShape(this),this}}),d=e({_pxregex:/(\d+)(px)?\s*$/i,init:function(t,e,i){t&&(this.width=t,this.height=e,this.target=i,this.lastShapeId=null,i[0]&&(i=i[0]),E.data(i,"_jqs_vcanvas",this))},drawLine:function(t,e,i,s,n,r){return this.drawShape([[t,e],[i,s]],n,r)},drawShape:function(t,e,i,s){return this._genShape("Shape",[t,e,i,s])},drawCircle:function(t,e,i,s,n,r){return this._genShape("Circle",[t,e,i,s,n,r])},drawPieSlice:function(t,e,i,s,n,r,a){return this._genShape("PieSlice",[t,e,i,s,n,r,a])},drawRect:function(t,e,i,s,n,r){return this._genShape("Rect",[t,e,i,s,n,r])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(t,e){E(e).html(t)},_calculatePixelDims:function(t,e,i){var s;s=this._pxregex.exec(e),this.pixelHeight=s?s[1]:E(i).height(),s=this._pxregex.exec(t),this.pixelWidth=s?s[1]:E(i).width()},_genShape:function(t,e){var i=_++;return e.unshift(i),new u(this,i,t,e)},appendShape:function(t){alert("appendShape not implemented")},replaceWithShape:function(t,e){alert("replaceWithShape not implemented")},insertAfterShape:function(t,e){alert("insertAfterShape not implemented")},removeShapeId:function(t){alert("removeShapeId not implemented")},getShapeAt:function(t,e,i){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),f=e(d,{init:function(t,e,i,s){f._super.init.call(this,t,e,i),this.canvas=S.createElement("canvas"),i[0]&&(i=i[0]),E.data(i,"_jqs_vcanvas",this),E(this.canvas).css({display:"inline-block",width:t,height:e,verticalAlign:"top"}),this._insert(this.canvas,i),this._calculatePixelDims(t,e,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=s,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=F,E(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(t,e,i){var s=this.canvas.getContext("2d");return t!==F&&(s.strokeStyle=t),s.lineWidth=i===F?1:i,e!==F&&(s.fillStyle=e),s},reset:function(){this._getContext().clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=F},_drawShape:function(t,e,i,s,n){var r,a,o=this._getContext(i,s,n);for(o.beginPath(),o.moveTo(e[0][0]+.5,e[0][1]+.5),r=1,a=e.length;r<a;r++)o.lineTo(e[r][0]+.5,e[r][1]+.5);i!==F&&o.stroke(),s!==F&&o.fill(),this.targetX!==F&&this.targetY!==F&&o.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t)},_drawCircle:function(t,e,i,s,n,r,a){var o=this._getContext(n,r,a);o.beginPath(),o.arc(e,i,s,0,2*N.PI,!1),this.targetX!==F&&this.targetY!==F&&o.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t),n!==F&&o.stroke(),r!==F&&o.fill()},_drawPieSlice:function(t,e,i,s,n,r,a,o){var h=this._getContext(a,o);h.beginPath(),h.moveTo(e,i),h.arc(e,i,s,n,r,!1),h.lineTo(e,i),h.closePath(),a!==F&&h.stroke(),o&&h.fill(),this.targetX!==F&&this.targetY!==F&&h.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t)},_drawRect:function(t,e,i,s,n,r,a){return this._drawShape(t,[[e,i],[e+s,i],[e+s,i+n],[e,i+n],[e,i]],r,a)},appendShape:function(t){return this.shapes[t.id]=t,this.shapeseq.push(t.id),this.lastShapeId=t.id,t.id},replaceWithShape:function(t,e){var i,s=this.shapeseq;for(this.shapes[e.id]=e,i=s.length;i--;)s[i]==t&&(s[i]=e.id);delete this.shapes[t]},replaceWithShapes:function(t,e){var i,s,n,r=this.shapeseq,a={};for(s=t.length;s--;)a[t[s]]=!0;for(s=r.length;s--;)a[i=r[s]]&&(r.splice(s,1),delete this.shapes[i],n=s);for(s=e.length;s--;)r.splice(n,0,e[s].id),this.shapes[e[s].id]=e[s]},insertAfterShape:function(t,e){var i,s=this.shapeseq;for(i=s.length;i--;)if(s[i]===t)return s.splice(i+1,0,e.id),void(this.shapes[e.id]=e)},removeShapeId:function(t){var e,i=this.shapeseq;for(e=i.length;e--;)if(i[e]===t){i.splice(e,1);break}delete this.shapes[t]},getShapeAt:function(t,e,i){return this.targetX=e,this.targetY=i,this.render(),this.currentTargetShapeId},render:function(){var t,e,i=this.shapeseq,s=this.shapes,n=i.length;for(this._getContext().clearRect(0,0,this.pixelWidth,this.pixelHeight),e=0;e<n;e++)this["_draw"+(t=s[i[e]]).type].apply(this,t.args);this.interact||(this.shapes={},this.shapeseq=[])}}),v=e(d,{init:function(t,e,i){var s;v._super.init.call(this,t,e,i),i[0]&&(i=i[0]),E.data(i,"_jqs_vcanvas",this),this.canvas=S.createElement("span"),E(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:t,height:e,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,i),this._calculatePixelDims(t,e,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,s='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",s),this.group=E(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(t,e,i,s,n){var r,a,o,h,l,g,p=[];for(g=0,l=e.length;g<l;g++)p[g]=e[g][0]+","+e[g][1];return r=p.splice(0,1),n=n===F?1:n,a=i===F?' stroked="false" ':' strokeWeight="'+n+'px" strokeColor="'+i+'" ',o=s===F?' filled="false"':' fillColor="'+s+'" filled="true" ',h=p[0]===p[p.length-1]?"x ":"",'<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" id="jqsshape'+t+'" '+a+o+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" path="m '+r+" l "+p.join(", ")+" "+h+'e"> </v:shape>'},_drawCircle:function(t,e,i,s,n,r,a){return'<v:oval id="jqsshape'+t+'" '+(n===F?' stroked="false" ':' strokeWeight="'+a+'px" strokeColor="'+n+'" ')+(r===F?' filled="false"':' fillColor="'+r+'" filled="true" ')+' style="position:absolute;top:'+(i-=s)+"px; left:"+(e-=s)+"px; width:"+2*s+"px; height:"+2*s+'px"></v:oval>'},_drawPieSlice:function(t,e,i,s,n,r,a,o){var h,l,g,p,c,u,d;if(n===r)return"";if(r-n==2*N.PI&&(n=0,r=2*N.PI),l=e+N.round(N.cos(n)*s),g=i+N.round(N.sin(n)*s),p=e+N.round(N.cos(r)*s),c=i+N.round(N.sin(r)*s),l===p&&g===c){if(r-n<N.PI)return"";l=p=e+s,g=c=i}return l===p&&g===c&&r-n<N.PI?"":(h=[e-s,i-s,e+s,i+s,l,g,p,c],u=a===F?' stroked="false" ':' strokeWeight="1px" strokeColor="'+a+'" ',d=o===F?' filled="false"':' fillColor="'+o+'" filled="true" ','<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" id="jqsshape'+t+'" '+u+d+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" path="m '+e+","+i+" wa "+h.join(", ")+' x e"> </v:shape>')},_drawRect:function(t,e,i,s,n,r,a){return this._drawShape(t,[[e,i],[e,i+n],[e+s,i+n],[e+s,i],[e,i]],r,a)},reset:function(){this.group.innerHTML=""},appendShape:function(t){var e=this["_draw"+t.type].apply(this,t.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",e):this.prerender+=e,this.lastShapeId=t.id,t.id},replaceWithShape:function(t,e){var i=E("#jqsshape"+t),s=this["_draw"+e.type].apply(this,e.args);i[0].outerHTML=s},replaceWithShapes:function(t,e){var i,s=E("#jqsshape"+t[0]),n="",r=e.length;for(i=0;i<r;i++)n+=this["_draw"+e[i].type].apply(this,e[i].args);for(s[0].outerHTML=n,i=1;i<t.length;i++)E("#jqsshape"+t[i]).remove()},insertAfterShape:function(t,e){var i=E("#jqsshape"+t),s=this["_draw"+e.type].apply(this,e.args);i[0].insertAdjacentHTML("afterEnd",s)},removeShapeId:function(t){var e=E("#jqsshape"+t);this.group.removeChild(e[0])},getShapeAt:function(t,e,i){return t.id.substr(8)},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})},"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.sparkline&&t(jQuery)}(document,Math),function(I){I.fn.waitMe=function(H){return this.each(function(){var v,m,x,y,b,w,C=I(this),_="waitMe",S=!1,R="background-color",M="",T="",t={init:function(){switch(b=I.extend({effect:"bounce",text:"",bg:"rgba(255,255,255,0.7)",color:"#000",maxSize:"",waitTime:-1,textPos:"vertical",fontSize:"",source:"",onClose:function(){}},H),w=(new Date).getMilliseconds(),y=I('<div class="'+_+'" data-waitme_id="'+w+'"></div>'),b.effect){case"none":x=0;break;case"bounce":x=3;break;case"rotateplane":x=1;break;case"stretch":x=5;break;case"orbit":x=2,S=!0;break;case"roundBounce":x=12;break;case"win8":case"win8_linear":x=5,S=!0;break;case"ios":x=12;break;case"facebook":x=3;break;case"rotation":x=1,R="border-color";break;case"timer":if(x=2,I.isArray(b.color))var t=b.color[0];else t=b.color;M="border-color:"+t;break;case"pulse":x=1,R="border-color";break;case"progressBar":x=1;break;case"bouncePulse":x=3;break;case"img":x=1}if(""!==M&&(M+=";"),0<x){if("img"===b.effect)T='<img src="'+b.source+'">';else for(var e=1;e<=x;++e){if(I.isArray(b.color))null==(t=b.color[e])&&(t="#000");else t=b.color;T+=S?'<div class="'+_+"_progress_elem"+e+'"><div style="'+R+":"+t+'"></div></div>':'<div class="'+_+"_progress_elem"+e+'" style="'+R+":"+t+'"></div>'}m=I('<div class="'+_+"_progress "+b.effect+'" style="'+M+'">'+T+"</div>")}if(b.text){if(I.isArray(b.color))t=b.color[0];else t=b.color;if(""!=b.fontSize)var i="font-size:"+b.fontSize;else i="";v=I('<div class="'+_+'_text" style="color:'+t+";"+i+'">'+b.text+"</div>")}var s=C.find("> ."+_);s&&s.remove();var n=I('<div class="'+_+"_content "+b.textPos+'"></div>');n.append(m,v),y.append(n),"HTML"==C[0].tagName&&(C=I("body")),C.addClass(_+"_container").attr("data-waitme_id",w).append(y),s=C.find("> ."+_);var r=C.find("."+_+"_content");if(s.css({background:b.bg}),""!==b.maxSize&&"none"!=b.effect){var a=m.outerHeight(),o=(m.outerWidth(),a);if("img"===b.effect)m.css({height:b.maxSize+"px"}),m.find(">img").css({maxHeight:"100%"}),r.css({marginTop:-r.outerHeight()/2+"px"});else if(b.maxSize<o)if("stretch"==b.effect)m.css({height:b.maxSize+"px",width:b.maxSize+"px"}),m.find("> div").css({margin:"0 5%"});else{var h=b.maxSize/o-.2,l="-50%";"roundBounce"==b.effect?(l="-75%",b.text&&(l="75%")):"win8"==b.effect||"timer"==b.effect||"orbit"==b.effect?(l="-20%",b.text&&(l="20%")):"ios"==b.effect&&(l="-15%",b.text&&(l="15%")),"rotation"==b.effect&&b.text&&(l="75%"),m.css({transform:"scale("+h+") translateX("+l+")",whiteSpace:"nowrap"})}}function g(t){r.css({top:"auto",transform:"translateY("+t+"px) translateZ(0)"})}if(r.css({marginTop:-r.outerHeight()/2+"px"}),C.outerHeight()>I(window).height()){var p=I(window).scrollTop(),c=r.outerHeight(),u=C.offset().top,d=C.outerHeight(),f=p-u+I(window).height()/2;f<0&&(f=Math.abs(f)),0<=f-c&&f+c<=d?(u-p>I(window).height()/2&&(f=c),g(f)):g(f=u+d-c<p?p-u-c:p-u+c),I(document).scroll(function(){var t=I(window).scrollTop()-u+I(window).height()/2;0<=t-c&&t+c<=d&&g(t)})}return 0<b.waitTime&&setTimeout(function(){k()},b.waitTime),s.on("destroyed",function(){b.onClose&&I.isFunction(b.onClose)&&b.onClose(C),s.trigger("close",{el:C})}),I.event.special.destroyed={remove:function(t){t.handler&&t.handler()}},s},hide:function(){k()}};function k(){var t=C.attr("data-waitme_id");C.removeClass(_+"_container").removeAttr("data-waitme_id"),C.find("."+_+'[data-waitme_id="'+t+'"]').remove()}return t[H]?t[H].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof H&&H?void 0:t.init.apply(this,arguments)})},I(window).on("load",function(){I("body.waitMe_body").addClass("hideMe"),setTimeout(function(){I("body.waitMe_body").find(".waitMe_container:not([data-waitme_id])").remove(),I("body.waitMe_body").removeClass("waitMe_body hideMe")},200)})}(jQuery);