if("undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");+function(t){"use strict";function e(e){return this.each(function(){var n=t(this),r=n.data(i);if(!r){var s=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,r=new a(n,s))}if("string"==typeof r){if(void 0===r[e])throw new Error("No method named "+e);r[e]()}})}var i="lte.boxrefresh",o={source:"",params:{},trigger:".refresh-btn",content:".box-body",loadInContent:!0,responseType:"",overlayTemplate:'
',onLoadStart:function(){},onLoadDone:function(t){return t}},n={data:'[data-widget="box-refresh"]'},a=function(e,i){if(this.element=e,this.options=i,this.$overlay=t(i.overlay),""===i.source)throw new Error("Source url was not defined. Please specify a url in your BoxRefresh source option.");this._setUpListeners(),this.load()};a.prototype.load=function(){this._addOverlay(),this.options.onLoadStart.call(t(this)),t.get(this.options.source,this.options.params,function(e){this.options.loadInContent&&t(this.options.content).html(e),this.options.onLoadDone.call(t(this),e),this._removeOverlay()}.bind(this),""!==this.options.responseType&&this.options.responseType)},a.prototype._setUpListeners=function(){t(this.element).on("click",n.trigger,function(t){t&&t.preventDefault(),this.load()}.bind(this))},a.prototype._addOverlay=function(){t(this.element).append(this.$overlay)},a.prototype._removeOverlay=function(){t(this.element).remove(this.$overlay)};var r=t.fn.boxRefresh;t.fn.boxRefresh=e,t.fn.boxRefresh.Constructor=a,t.fn.boxRefresh.noConflict=function(){return t.fn.boxRefresh=r,this},t(window).on("load",function(){t(n.data).each(function(){e.call(t(this))})})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),a=n.data(i);if(!a){var r=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,a=new s(n,r))}if("string"==typeof e){if(void 0===a[e])throw new Error("No method named "+e);a[e]()}})}var i="lte.boxwidget",o={animationSpeed:500,collapseTrigger:'[data-widget="collapse"]',removeTrigger:'[data-widget="remove"]',collapseIcon:"fa-minus",expandIcon:"fa-plus",removeIcon:"fa-times"},n={data:".box",collapsed:".collapsed-box",header:".box-header",body:".box-body",footer:".box-footer",tools:".box-tools"},a={collapsed:"collapsed-box"},r={collapsed:"collapsed.boxwidget",expanded:"expanded.boxwidget",removed:"removed.boxwidget"},s=function(t,e){this.element=t,this.options=e,this._setUpListeners()};s.prototype.toggle=function(){t(this.element).is(n.collapsed)?this.expand():this.collapse()},s.prototype.expand=function(){var e=t.Event(r.expanded),i=this.options.collapseIcon,o=this.options.expandIcon;t(this.element).removeClass(a.collapsed),t(this.element).children(n.header+", "+n.body+", "+n.footer).children(n.tools).find("."+o).removeClass(o).addClass(i),t(this.element).children(n.body+", "+n.footer).slideDown(this.options.animationSpeed,function(){t(this.element).trigger(e)}.bind(this))},s.prototype.collapse=function(){var e=t.Event(r.collapsed),i=this.options.collapseIcon,o=this.options.expandIcon;t(this.element).children(n.header+", "+n.body+", "+n.footer).children(n.tools).find("."+i).removeClass(i).addClass(o),t(this.element).children(n.body+", "+n.footer).slideUp(this.options.animationSpeed,function(){t(this.element).addClass(a.collapsed),t(this.element).trigger(e)}.bind(this))},s.prototype.remove=function(){var e=t.Event(r.removed);t(this.element).slideUp(this.options.animationSpeed,function(){t(this.element).trigger(e),t(this.element).remove()}.bind(this))},s.prototype._setUpListeners=function(){var e=this;t(this.element).on("click",this.options.collapseTrigger,function(i){return i&&i.preventDefault(),e.toggle(t(this)),!1}),t(this.element).on("click",this.options.removeTrigger,function(i){return i&&i.preventDefault(),e.remove(t(this)),!1})};var l=t.fn.boxWidget;t.fn.boxWidget=e,t.fn.boxWidget.Constructor=s,t.fn.boxWidget.noConflict=function(){return t.fn.boxWidget=l,this},t(window).on("load",function(){t(n.data).each(function(){e.call(t(this))})})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),a=n.data(i);if(!a){var r=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,a=new s(n,r))}"string"==typeof e&&a.toggle()})}var i="lte.controlsidebar",o={slide:!0},n={sidebar:".control-sidebar",data:'[data-toggle="control-sidebar"]',open:".control-sidebar-open",bg:".control-sidebar-bg",wrapper:".wrapper",content:".content-wrapper",boxed:".layout-boxed"},a={open:"control-sidebar-open",fixed:"fixed"},r={collapsed:"collapsed.controlsidebar",expanded:"expanded.controlsidebar"},s=function(t,e){this.element=t,this.options=e,this.hasBindedResize=!1,this.init()};s.prototype.init=function(){t(this.element).is(n.data)||t(this).on("click",this.toggle),this.fix(),t(window).resize(function(){this.fix()}.bind(this))},s.prototype.toggle=function(e){e&&e.preventDefault(),this.fix(),t(n.sidebar).is(n.open)||t("body").is(n.open)?this.collapse():this.expand()},s.prototype.expand=function(){this.options.slide?t(n.sidebar).addClass(a.open):t("body").addClass(a.open),t(this.element).trigger(t.Event(r.expanded))},s.prototype.collapse=function(){t("body, "+n.sidebar).removeClass(a.open),t(this.element).trigger(t.Event(r.collapsed))},s.prototype.fix=function(){t("body").is(n.boxed)&&this._fixForBoxed(t(n.bg))},s.prototype._fixForBoxed=function(e){e.css({position:"absolute",height:t(n.wrapper).height()})};var l=t.fn.controlSidebar;t.fn.controlSidebar=e,t.fn.controlSidebar.Constructor=s,t.fn.controlSidebar.noConflict=function(){return t.fn.controlSidebar=l,this},t(document).on("click",n.data,function(i){i&&i.preventDefault(),e.call(t(this),"toggle")})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data(i);n||o.data(i,n=new a(o)),"string"==typeof e&&n.toggle(o)})}var i="lte.directchat",o={data:'[data-widget="chat-pane-toggle"]',box:".direct-chat"},n={open:"direct-chat-contacts-open"},a=function(t){this.element=t};a.prototype.toggle=function(t){t.parents(o.box).first().toggleClass(n.open)};var r=t.fn.directChat;t.fn.directChat=e,t.fn.directChat.Constructor=a,t.fn.directChat.noConflict=function(){return t.fn.directChat=r,this},t(document).on("click",o.data,function(i){i&&i.preventDefault(),e.call(t(this),"toggle")})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),a=n.data(i);if(!a){var s=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,a=new r(s))}if("string"==typeof e){if(void 0===a[e])throw new Error("No method named "+e);a[e]()}})}var i="lte.layout",o={slimscroll:!0,resetHeight:!0},n={wrapper:".wrapper",contentWrapper:".content-wrapper",layoutBoxed:".layout-boxed",mainFooter:".main-footer",mainHeader:".main-header",sidebar:".sidebar",controlSidebar:".control-sidebar",fixed:".fixed",sidebarMenu:".sidebar-menu",logo:".main-header .logo"},a={fixed:"fixed",holdTransition:"hold-transition"},r=function(t){this.options=t,this.bindedResize=!1,this.activate()};r.prototype.activate=function(){this.fix(),this.fixSidebar(),t("body").removeClass(a.holdTransition),this.options.resetHeight&&t("body, html, "+n.wrapper).css({height:"auto","min-height":"100%"}),this.bindedResize||(t(window).resize(function(){this.fix(),this.fixSidebar(),t(n.logo+", "+n.sidebar).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){this.fix(),this.fixSidebar()}.bind(this))}.bind(this)),this.bindedResize=!0),t(n.sidebarMenu).on("expanded.tree",function(){this.fix(),this.fixSidebar()}.bind(this)),t(n.sidebarMenu).on("collapsed.tree",function(){this.fix(),this.fixSidebar()}.bind(this))},r.prototype.fix=function(){t(n.layoutBoxed+" > "+n.wrapper).css("overflow","hidden");var e=t(n.mainFooter).outerHeight()||0,i=t(n.mainHeader).outerHeight()||0,o=i+e,r=t(window).height(),s=t(n.sidebar).height()||0;if(t("body").hasClass(a.fixed))t(n.contentWrapper).css("min-height",r-e);else{var l;r>=s?(t(n.contentWrapper).css("min-height",r-o),l=r-o):(t(n.contentWrapper).css("min-height",s),l=s);var h=t(n.controlSidebar);void 0!==h&&h.height()>l&&t(n.contentWrapper).css("min-height",h.height())}},r.prototype.fixSidebar=function(){if(!t("body").hasClass(a.fixed))return void(void 0!==t.fn.slimScroll&&t(n.sidebar).slimScroll({destroy:!0}).height("auto"));this.options.slimscroll&&void 0!==t.fn.slimScroll&&t(n.sidebar).slimScroll({height:t(window).height()-t(n.mainHeader).height()+"px"})};var s=t.fn.layout;t.fn.layout=e,t.fn.layout.Constuctor=r,t.fn.layout.noConflict=function(){return t.fn.layout=s,this},t(window).on("load",function(){e.call(t("body"))})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),a=n.data(i);if(!a){var r=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,a=new s(r))}"toggle"===e&&a.toggle()})}var i="lte.pushmenu",o={collapseScreenSize:767,expandOnHover:!1,expandTransitionDelay:200},n={collapsed:".sidebar-collapse",open:".sidebar-open",mainSidebar:".main-sidebar",contentWrapper:".content-wrapper",searchInput:".sidebar-form .form-control",button:'[data-toggle="push-menu"]',mini:".sidebar-mini",expanded:".sidebar-expanded-on-hover",layoutFixed:".fixed"},a={collapsed:"sidebar-collapse",open:"sidebar-open",mini:"sidebar-mini",expanded:"sidebar-expanded-on-hover",expandFeature:"sidebar-mini-expand-feature",layoutFixed:"fixed"},r={expanded:"expanded.pushMenu",collapsed:"collapsed.pushMenu"},s=function(t){this.options=t,this.init()};s.prototype.init=function(){(this.options.expandOnHover||t("body").is(n.mini+n.layoutFixed))&&(this.expandOnHover(),t("body").addClass(a.expandFeature)),t(n.contentWrapper).click(function(){t(window).width()<=this.options.collapseScreenSize&&t("body").hasClass(a.open)&&this.close()}.bind(this)),t(n.searchInput).click(function(t){t.stopPropagation()})},s.prototype.toggle=function(){var e=t(window).width(),i=!t("body").hasClass(a.collapsed);e<=this.options.collapseScreenSize&&(i=t("body").hasClass(a.open)),i?this.close():this.open()},s.prototype.open=function(){t(window).width()>this.options.collapseScreenSize?t("body").removeClass(a.collapsed).trigger(t.Event(r.expanded)):t("body").addClass(a.open).trigger(t.Event(r.expanded))},s.prototype.close=function(){t(window).width()>this.options.collapseScreenSize?t("body").addClass(a.collapsed).trigger(t.Event(r.collapsed)):t("body").removeClass(a.open+" "+a.collapsed).trigger(t.Event(r.collapsed))},s.prototype.expandOnHover=function(){t(n.mainSidebar).hover(function(){t("body").is(n.mini+n.collapsed)&&t(window).width()>this.options.collapseScreenSize&&this.expand()}.bind(this),function(){t("body").is(n.expanded)&&this.collapse()}.bind(this))},s.prototype.expand=function(){setTimeout(function(){t("body").removeClass(a.collapsed).addClass(a.expanded)},this.options.expandTransitionDelay)},s.prototype.collapse=function(){setTimeout(function(){t("body").removeClass(a.expanded).addClass(a.collapsed)},this.options.expandTransitionDelay)};var l=t.fn.pushMenu;t.fn.pushMenu=e,t.fn.pushMenu.Constructor=s,t.fn.pushMenu.noConflict=function(){return t.fn.pushMenu=l,this},t(document).on("click",n.button,function(i){i.preventDefault(),e.call(t(this),"toggle")}),t(window).on("load",function(){e.call(t(n.button))})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),a=n.data(i);if(!a){var s=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,a=new r(n,s))}if("string"==typeof a){if(void 0===a[e])throw new Error("No method named "+e);a[e]()}})}var i="lte.todolist",o={onCheck:function(t){return t},onUnCheck:function(t){return t}},n={data:'[data-widget="todo-list"]'},a={done:"done"},r=function(t,e){this.element=t,this.options=e,this._setUpListeners()};r.prototype.toggle=function(t){if(t.parents(n.li).first().toggleClass(a.done),!t.prop("checked"))return void this.unCheck(t);this.check(t)},r.prototype.check=function(t){this.options.onCheck.call(t)},r.prototype.unCheck=function(t){this.options.onUnCheck.call(t)},r.prototype._setUpListeners=function(){var e=this;t(this.element).on("change ifChanged","input:checkbox",function(){e.toggle(t(this))})};var s=t.fn.todoList;t.fn.todoList=e,t.fn.todoList.Constructor=r,t.fn.todoList.noConflict=function(){return t.fn.todoList=s,this},t(window).on("load",function(){t(n.data).each(function(){e.call(t(this))})})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this);if(!n.data(i)){var a=t.extend({},o,n.data(),"object"==typeof e&&e);n.data(i,new s(n,a))}})}var i="lte.tree",o={animationSpeed:500,accordion:!0,followLink:!1,trigger:".treeview a"},n={tree:".tree",treeview:".treeview",treeviewMenu:".treeview-menu",open:".menu-open, .active",li:"li",data:'[data-widget="tree"]',active:".active"},a={open:"menu-open",tree:"tree"},r={collapsed:"collapsed.tree",expanded:"expanded.tree"},s=function(e,i){this.element=e,this.options=i,t(this.element).addClass(a.tree),t(n.treeview+n.active,this.element).addClass(a.open),this._setUpListeners()};s.prototype.toggle=function(t,e){var i=t.next(n.treeviewMenu),o=t.parent(),r=o.hasClass(a.open);o.is(n.treeview)&&(this.options.followLink&&"#"!==t.attr("href")||e.preventDefault(),r?this.collapse(i,o):this.expand(i,o))},s.prototype.expand=function(e,i){var o=t.Event(r.expanded);if(this.options.accordion){var s=i.siblings(n.open),l=s.children(n.treeviewMenu);this.collapse(l,s)}i.addClass(a.open),e.slideDown(this.options.animationSpeed,function(){t(this.element).trigger(o)}.bind(this))},s.prototype.collapse=function(e,i){var o=t.Event(r.collapsed);i.removeClass(a.open),e.slideUp(this.options.animationSpeed,function(){t(this.element).trigger(o)}.bind(this))},s.prototype._setUpListeners=function(){var e=this;t(this.element).on("click",this.options.trigger,function(i){e.toggle(t(this),i)})};var l=t.fn.tree;t.fn.tree=e,t.fn.tree.Constructor=s,t.fn.tree.noConflict=function(){return t.fn.tree=l,this},t(window).on("load",function(){t(n.data).each(function(){e.call(t(this))})})}(jQuery),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Tether=e()}(this,function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t){var i=t.getBoundingClientRect(),o={};for(var n in i)o[n]=i[n];if(t.ownerDocument!==document){var a=t.ownerDocument.defaultView.frameElement;if(a){var r=e(a);o.top+=r.top,o.bottom+=r.top,o.left+=r.left,o.right+=r.left}}return o}function i(t){var e=getComputedStyle(t)||{},i=e.position,o=[];if("fixed"===i)return[t];for(var n=t;(n=n.parentNode)&&n&&1===n.nodeType;){var a=void 0;try{a=getComputedStyle(n)}catch(t){}if(void 0===a||null===a)return o.push(n),o;var r=a,s=r.overflow,l=r.overflowX;/(auto|scroll|overlay)/.test(s+r.overflowY+l)&&("absolute"!==i||["relative","absolute","fixed"].indexOf(a.position)>=0)&&o.push(n)}return o.push(t.ownerDocument.body),t.ownerDocument!==document&&o.push(t.ownerDocument.defaultView),o}function o(){_&&document.body.removeChild(_),_=null}function n(t){var i=void 0;t===document?(i=document,t=document.documentElement):i=t.ownerDocument;var o=i.documentElement,n=e(t),a=D();return n.top-=a.top,n.left-=a.left,void 0===n.width&&(n.width=document.body.scrollWidth-n.left-n.right),void 0===n.height&&(n.height=document.body.scrollHeight-n.top-n.bottom),n.top=n.top-o.clientTop,n.left=n.left-o.clientLeft,n.right=i.body.clientWidth-n.width-n.left,n.bottom=i.body.clientHeight-n.height-n.top,n}function a(t){return t.offsetParent||document.documentElement}function r(){if(M)return M;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");s(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;i===o&&(o=e.clientWidth),document.body.removeChild(e);var n=i-o;return M={width:n,height:n}}function s(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var i in e)({}).hasOwnProperty.call(e,i)&&(t[i]=e[i])}),t}function l(t,e){if(void 0!==t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var i=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),o=u(t).replace(i," ");c(t,o)}}function h(t,e){if(void 0!==t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{l(t,e);var i=u(t)+" "+e;c(t,i)}}function d(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=u(t);return new RegExp("(^| )"+e+"( |$)","gi").test(i)}function u(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function c(t,e){t.setAttribute("class",e)}function f(t,e,i){i.forEach(function(i){-1===e.indexOf(i)&&d(t,i)&&l(t,i)}),e.forEach(function(e){d(t,e)||h(t,e)})}function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function g(t,e){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+i>=e&&e>=t-i}function m(){return"object"==typeof performance&&"function"==typeof performance.now?performance.now():+new Date}function v(){for(var t={top:0,left:0},e=arguments.length,i=Array(e),o=0;o1?i-1:0),n=1;n16)return e=Math.min(e-16,250),void(i=setTimeout(o,250));void 0!==t&&m()-t<10||(null!=i&&(clearTimeout(i),i=null),t=m(),R(),e=m()-t)};"undefined"!=typeof window&&void 0!==window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,o)})}();var z={center:"center",left:"right",right:"left"},B={middle:"middle",top:"bottom",bottom:"top"},N={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},W=function(t,e){var i=t.left,o=t.top;return"auto"===i&&(i=z[e.left]),"auto"===o&&(o=B[e.top]),{left:i,top:o}},V=function(t){var e=t.left,i=t.top;return void 0!==N[t.left]&&(e=N[t.left]),void 0!==N[t.top]&&(i=N[t.top]),{left:e,top:i}},H=function(t){var e=t.split(" "),i=P(e,2);return{top:i[0],left:i[1]}},U=H,j=function(e){function d(e){var i=this;t(this,d),F(Object.getPrototypeOf(d.prototype),"constructor",this).call(this),this.position=this.position.bind(this),L.push(this),this.history=[],this.setOptions(e,!1),w.modules.forEach(function(t){void 0!==t.initialize&&t.initialize.call(i)}),this.position()}return p(d,e),x(d,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return void 0!==e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,o=arguments.length<=1||void 0===arguments[1]||arguments[1],n={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=s(n,t);var a=this.options,r=a.element,l=a.target,d=a.targetModifier;if(this.element=r,this.target=l,this.targetModifier=d,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if(void 0===e[t])throw new Error("Tether Error: Both element and target must be defined");void 0!==e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),h(this.element,this.getClass("element")),!1!==this.options.addTargetClasses&&h(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=U(this.options.targetAttachment),this.attachment=U(this.options.attachment),this.offset=H(this.options.offset),this.targetOffset=H(this.options.targetOffset),void 0!==this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=i(this.target),!1!==this.options.enabled&&this.enable(o)}},{key:"getTargetBounds",value:function(){if(void 0===this.targetModifier)return n(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=n(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.topi.clientWidth||[o.overflow,o.overflowX].indexOf("scroll")>=0||this.target!==document.body,r=0;a&&(r=15);var s=t.height-parseFloat(o.borderTopWidth)-parseFloat(o.borderBottomWidth)-r,e={width:15,height:.975*s*(s/i.scrollHeight),left:t.left+t.width-parseFloat(o.borderLeftWidth)-15},l=0;s<408&&this.target===document.body&&(l=-11e-5*Math.pow(s,2)-.00727*s+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var h=this.target.scrollTop/(i.scrollHeight-s);return e.top=h*(s-e.height-l)+t.top+parseFloat(o.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return void 0===this._cache&&(this._cache={}),void 0===this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];!1!==this.options.addTargetClasses&&h(this.target,this.getClass("enabled")),h(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!1,void 0!==this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),L.forEach(function(e,i){e===t&&L.splice(i,1)}),0===L.length&&o()}},{key:"updateAttachClasses",value:function(t,e){var i=this;t=t||this.attachment,e=e||this.targetAttachment;var o=["left","top","bottom","right","middle","center"];void 0!==this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),void 0===this._addAttachClasses&&(this._addAttachClasses=[]);var n=this._addAttachClasses;t.top&&n.push(this.getClass("element-attached")+"-"+t.top),t.left&&n.push(this.getClass("element-attached")+"-"+t.left),e.top&&n.push(this.getClass("target-attached")+"-"+e.top),e.left&&n.push(this.getClass("target-attached")+"-"+e.left);var a=[];o.forEach(function(t){a.push(i.getClass("element-attached")+"-"+t),a.push(i.getClass("target-attached")+"-"+t)}),T(function(){void 0!==i._addAttachClasses&&(f(i.element,i._addAttachClasses,a),!1!==i.options.addTargetClasses&&f(i.target,i._addAttachClasses,a),delete i._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var i=W(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,i);var o=this.cache("element-bounds",function(){return n(t.element)}),s=o.width,l=o.height;if(0===s&&0===l&&void 0!==this.lastSize){var h=this.lastSize;s=h.width,l=h.height}else this.lastSize={width:s,height:l};var d=this.cache("target-bounds",function(){return t.getTargetBounds()}),u=d,c=b(V(this.attachment),{width:s,height:l}),f=b(V(i),u),p=b(this.offset,{width:s,height:l}),g=b(this.targetOffset,u);c=v(c,p),f=v(f,g);for(var m=d.left+f.left-c.left,y=d.top+f.top-c.top,x=0;xD.documentElement.clientHeight&&(S=this.cache("scrollbar-size",r),C.viewport.bottom-=S.height),M.innerWidth>D.documentElement.clientWidth&&(S=this.cache("scrollbar-size",r),C.viewport.right-=S.width),-1!==["","static"].indexOf(D.body.style.position)&&-1!==["","static"].indexOf(D.body.parentElement.style.position)||(C.page.bottom=D.body.scrollHeight-y-l,C.page.right=D.body.scrollWidth-m-s),void 0!==this.options.optimizations&&!1!==this.options.optimizations.moveElement&&void 0===this.targetModifier&&function(){var e=t.cache("target-offsetparent",function(){return a(t.target)}),i=t.cache("target-offsetparent-bounds",function(){return n(e)}),o=getComputedStyle(e),r=i,s={};if(["Top","Left","Bottom","Right"].forEach(function(t){s[t.toLowerCase()]=parseFloat(o["border"+t+"Width"])}),i.right=D.body.scrollWidth-i.left-r.width+s.right,i.bottom=D.body.scrollHeight-i.top-r.height+s.bottom,C.page.top>=i.top+s.top&&C.page.bottom>=i.bottom&&C.page.left>=i.left+s.left&&C.page.right>=i.right){var l=e.scrollTop,h=e.scrollLeft;C.offset={top:C.page.top-i.top+l-s.top,left:C.page.left-i.left+h-s.left}}}(),this.move(C),this.history.unshift(C),this.history.length>3&&this.history.pop(),e&&I(),!0}}},{key:"move",value:function(t){var e=this;if(void 0!==this.element.parentNode){var i={};for(var o in t){i[o]={};for(var n in t[o]){for(var r=!1,l=0;l=0){var f=r.split(" "),g=P(f,2);u=g[0],d=g[1]}else d=u=r;var x=y(e,n);"target"!==u&&"both"!==u||(ix[3]&&"bottom"===v.top&&(i-=c,v.top="top")),"together"===u&&("top"===v.top&&("bottom"===b.top&&ix[3]&&i-(l-c)>=x[1]&&(i-=l-c,v.top="bottom",b.top="bottom")),"bottom"===v.top&&("top"===b.top&&i+l>x[3]?(i-=c,v.top="top",i-=l,b.top="bottom"):"bottom"===b.top&&ix[3]&&"top"===b.top?(i-=l,b.top="bottom"):ix[2]&&"right"===v.left&&(o-=p,v.left="left")),"together"===d&&(ox[2]&&"right"===v.left?"left"===b.left?(o-=p,v.left="left",o-=h,b.left="right"):"right"===b.left&&(o-=p,v.left="left",o+=h,b.left="left"):"center"===v.left&&(o+h>x[2]&&"left"===b.left?(o-=h,b.left="right"):ox[3]&&"top"===b.top&&(i-=l,b.top="bottom")),"element"!==d&&"both"!==d||(ox[2]&&("left"===b.left?(o-=h,b.left="right"):"center"===b.left&&(o-=h/2,b.left="right"))),"string"==typeof s?s=s.split(",").map(function(t){return t.trim()}):!0===s&&(s=["top","left","right","bottom"]),s=s||[];var w=[],_=[];i=0?(i=x[1],w.push("top")):_.push("top")),i+l>x[3]&&(s.indexOf("bottom")>=0?(i=x[3]-l,w.push("bottom")):_.push("bottom")),o=0?(o=x[0],w.push("left")):_.push("left")),o+h>x[2]&&(s.indexOf("right")>=0?(o=x[2]-h,w.push("right")):_.push("right")),w.length&&function(){var t=void 0;t=void 0!==e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),m.push(t),w.forEach(function(e){m.push(t+"-"+e)})}(),_.length&&function(){var t=void 0;t=void 0!==e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),m.push(t),_.forEach(function(e){m.push(t+"-"+e)})}(),(w.indexOf("left")>=0||w.indexOf("right")>=0)&&(b.left=v.left=!1),(w.indexOf("top")>=0||w.indexOf("bottom")>=0)&&(b.top=v.top=!1),v.top===a.top&&v.left===a.left&&b.top===e.attachment.top&&b.left===e.attachment.left||(e.updateAttachClasses(b,v),e.trigger("update",{attachment:b,targetAttachment:v}))}),T(function(){!1!==e.options.addTargetClasses&&f(e.target,m,g),f(e.element,m,g)}),{top:i,left:o}}});var O=w.Utils,n=O.getBounds,f=O.updateClasses,T=O.defer;w.modules.push({position:function(t){var e=this,i=t.top,o=t.left,a=this.cache("element-bounds",function(){return n(e.element)}),r=a.height,s=a.width,l=this.getTargetBounds(),h=i+r,d=o+s,u=[];i<=l.bottom&&h>=l.top&&["left","right"].forEach(function(t){var e=l[t];e!==o&&e!==d||u.push(t)}),o<=l.right&&d>=l.left&&["top","bottom"].forEach(function(t){var e=l[t];e!==i&&e!==h||u.push(t)});var c=[],p=[],g=["left","top","right","bottom"];return c.push(this.getClass("abutted")),g.forEach(function(t){c.push(e.getClass("abutted")+"-"+t)}),u.length&&p.push(this.getClass("abutted")),u.forEach(function(t){p.push(e.getClass("abutted")+"-"+t)}),T(function(){!1!==e.options.addTargetClasses&&f(e.target,p,c),f(e.element,p,c)}),!0}});var P=function(){function t(t,e){var i=[],o=!0,n=!1,a=void 0;try{for(var r,s=t[Symbol.iterator]();!(o=(r=s.next()).done)&&(i.push(r.value),!e||i.length!==e);o=!0);}catch(t){n=!0,a=t}finally{try{!o&&s.return&&s.return()}finally{if(n)throw a}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return w.modules.push({position:function(t){var e=t.top,i=t.left;if(this.options.shift){var o=this.options.shift;"function"==typeof this.options.shift&&(o=this.options.shift.call(this,{top:e,left:i}));var n=void 0,a=void 0;if("string"==typeof o){o=o.split(" "),o[1]=o[1]||o[0];var r=o,s=P(r,2);n=s[0],a=s[1],n=parseFloat(n,10),a=parseFloat(a,10)}else n=o.top,a=o.left;return e+=n,i+=a,{top:e,left:i}}}}),Y}),function(e){e.fn.extend({slimScroll:function(i){var o={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"},n=e.extend(o,i);return this.each(function(){function o(t){if(h){var t=t||window.event,i=0;t.wheelDelta&&(i=-t.wheelDelta/120),t.detail&&(i=t.detail/3);var o=t.target||t.srcTarget||t.srcElement;e(o).closest("."+n.wrapperClass).is(x.parent())&&a(i,!0),t.preventDefault&&!y&&t.preventDefault(),y||(t.returnValue=!1)}}function a(t,e,i){y=!1;var o=t,a=x.outerHeight()-M.outerHeight();if(e&&(o=parseInt(M.css("top"))+t*parseInt(n.wheelStep)/100*M.outerHeight(),o=Math.min(Math.max(o,0),a),o=t>0?Math.ceil(o):Math.floor(o),M.css({top:o+"px"})),g=parseInt(M.css("top"))/(x.outerHeight()-M.outerHeight()),o=g*(x[0].scrollHeight-x.outerHeight()),i){o=t;var r=o/x[0].scrollHeight*x.outerHeight();r=Math.min(Math.max(r,0),a),M.css({top:r+"px"})}x.scrollTop(o),x.trigger("slimscrolling",~~o),s(),l()}function r(){p=Math.max(x.outerHeight()/x[0].scrollHeight*x.outerHeight(),b),M.css({height:p+"px"});var t=p==x.outerHeight()?"none":"block";M.css({display:t})}function s(){if(r(),clearTimeout(c),g==~~g){if(y=n.allowPageScroll,m!=g){var t=0==~~g?"top":"bottom";x.trigger("slimscroll",t)}}else y=!1;if(m=g,p>=x.outerHeight())return void(y=!0);M.stop(!0,!0).fadeIn("fast"),n.railVisible&&D.stop(!0,!0).fadeIn("fast")}function l(){n.alwaysVisible||(c=setTimeout(function(){n.disableFadeOut&&h||d||u||(M.fadeOut("slow"),D.fadeOut("slow"))},1e3))}var h,d,u,c,f,p,g,m,v="
",b=30,y=!1,x=e(this);if(x.parent().hasClass(n.wrapperClass)){var w=x.scrollTop();if(M=x.siblings("."+n.barClass),D=x.siblings("."+n.railClass),r(),e.isPlainObject(i)){if("height"in i&&"auto"==i.height){x.parent().css("height","auto"),x.css("height","auto");var _=x.parent().parent().height();x.parent().css("height",_),x.css("height",_)}else if("height"in i){var k=i.height;x.parent().css("height",k),x.css("height",k)}if("scrollTo"in i)w=parseInt(n.scrollTo);else if("scrollBy"in i)w+=parseInt(n.scrollBy);else if("destroy"in i)return M.remove(),D.remove(),void x.unwrap();a(w,!1,!0)}}else if(!(e.isPlainObject(i)&&"destroy"in i)){n.height="auto"==n.height?x.parent().height():n.height;var C=e(v).addClass(n.wrapperClass).css({position:"relative",overflow:"hidden",width:n.width,height:n.height});x.css({overflow:"hidden",width:n.width,height:n.height});var D=e(v).addClass(n.railClass).css({width:n.size,height:"100%",position:"absolute",top:0,display:n.alwaysVisible&&n.railVisible?"block":"none","border-radius":n.railBorderRadius,background:n.railColor,opacity:n.railOpacity,zIndex:90}),M=e(v).addClass(n.barClass).css({background:n.color,width:n.size,position:"absolute",top:0,opacity:n.opacity,display:n.alwaysVisible?"block":"none","border-radius":n.borderRadius,BorderRadius:n.borderRadius,MozBorderRadius:n.borderRadius,WebkitBorderRadius:n.borderRadius,zIndex:99}),S="right"==n.position?{right:n.distance}:{left:n.distance};D.css(S),M.css(S),x.wrap(C),x.parent().append(M),x.parent().append(D),n.railDraggable&&M.bind("mousedown",function(i){var o=e(document);return u=!0,t=parseFloat(M.css("top")),pageY=i.pageY,o.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,M.css("top",currTop),a(0,M.position().top,!1)}),o.bind("mouseup.slimscroll",function(t){u=!1,l(),o.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(t){return t.stopPropagation(),t.preventDefault(),!1}),D.hover(function(){s()},function(){l()}),M.hover(function(){d=!0},function(){d=!1}),x.hover(function(){h=!0,s(),l()},function(){h=!1,l()}),x.bind("touchstart",function(t,e){t.originalEvent.touches.length&&(f=t.originalEvent.touches[0].pageY)}),x.bind("touchmove",function(t){if(y||t.originalEvent.preventDefault(),t.originalEvent.touches.length){a((f-t.originalEvent.touches[0].pageY)/n.touchScrollStep,!0),f=t.originalEvent.touches[0].pageY}}),r(),"bottom"===n.start?(M.css({top:x.outerHeight()-M.outerHeight()}),a(0,!0)):"top"!==n.start&&(a(e(n.start).position().top,null,!0),n.alwaysVisible||M.hide()),function(t){window.addEventListener?(t.addEventListener("DOMMouseScroll",o,!1),t.addEventListener("mousewheel",o,!1)):document.attachEvent("onmousewheel",o)}(this)}}),this}}),e.fn.extend({slimscroll:e.fn.slimScroll})}(jQuery),function(t,e){"use strict";t.ajaxPrefilter(function(t,e,i){if(t.iframe)return t.originalURL=t.url,"iframe"}),t.ajaxTransport("iframe",function(e,i,o){function n(){l.each(function(e,i){var o=t(i);o.data("clone").replaceWith(o)}),a.remove(),r.one("load",function(){r.remove()}),r.attr("src","javascript:false;")}var a=null,r=null,s="iframe-"+t.now(),l=t(e.files).filter(":file:enabled"),h=null;if(e.dataTypes.shift(),e.data=i.data,l.length)return a=t("
").hide().attr({action:e.originalURL,target:s}),"string"==typeof e.data&&e.data.length>0&&t.error("data must not be serialized"),t.each(e.data||{},function(e,i){t.isPlainObject(i)&&(e=i.name,i=i.value),t("").attr({name:e,value:i}).appendTo(a)}),t("").appendTo(a),h=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", */*; q=0.01":""):e.accepts["*"],t("").attr("value",h).appendTo(a),l.after(function(e){var i=t(this),o=i.clone().prop("disabled",!0);return i.data("clone",o),o}).next(),l.appendTo(a),{send:function(e,i){r=t(""),r.one("load",function(){r.one("load",function(){var t=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,e=t.documentElement?t.documentElement:t.body,o=e.getElementsByTagName("textarea")[0],a=o&&o.getAttribute("data-type")||null,r=o&&o.getAttribute("data-status")||200,s=o&&o.getAttribute("data-statusText")||"OK",l={html:e.innerHTML,text:a?o.value:e?e.textContent||e.innerText:null};n(),i(r,s,l,a?"Content-Type: "+a:null)}),a[0].submit()}),t("body").append(a,r)},abort:function(){null!==r&&(r.unbind("load").attr("src","javascript:false;"),n())}}})}(jQuery),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],t):"object"==typeof exports?t(require("jquery"),require("./vendor/jquery.ui.widget")):t(window.jQuery)}(function(t){"use strict";function e(e){var i="dragover"===e;return function(o){o.dataTransfer=o.originalEvent&&o.originalEvent.dataTransfer;var n=o.dataTransfer;n&&-1!==t.inArray("Files",n.types)&&!1!==this._trigger(e,t.Event(e,{delegatedEvent:o}))&&(o.preventDefault(),i&&(n.dropEffect="copy"))}}t.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||t('').prop("disabled")),t.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),t.support.xhrFormDataFileUpload=!!window.FormData,t.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),t.widget("blueimp.fileupload",{options:{dropZone:t(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(e,i){return e=this.messages[e]||e.toString(),i&&t.each(i,function(t,i){e=e.replace("{"+t+"}",i)}),e},formData:function(t){return t.serializeArray()},add:function(e,i){if(e.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&t(this).fileupload("option","autoUpload"))&&i.process().done(function(){i.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:t.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(t,e,i){var o=t-this.timestamp;return(!this.bitrate||!i||o>i)&&(this.bitrate=(e-this.loaded)*(1e3/o)*8,this.loaded=e,this.timestamp=t),this.bitrate}},_isXHRUpload:function(e){return!e.forceIframeTransport&&(!e.multipart&&t.support.xhrFileUpload||t.support.xhrFormDataFileUpload)},_getFormData:function(e){var i;return"function"===t.type(e.formData)?e.formData(e.form):t.isArray(e.formData)?e.formData:"object"===t.type(e.formData)?(i=[],t.each(e.formData,function(t,e){i.push({name:t,value:e})}),i):[]},_getTotal:function(e){var i=0;return t.each(e,function(t,e){i+=e.size||1}),i},_initProgressObject:function(e){var i={loaded:0,total:0,bitrate:0};e._progress?t.extend(e._progress,i):e._progress=i},_initResponseObject:function(t){var e;if(t._response)for(e in t._response)t._response.hasOwnProperty(e)&&delete t._response[e];else t._response={}},_onProgress:function(e,i){if(e.lengthComputable){var o,n=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&n-i._time").prop("href",e.url).prop("host");e.dataType="iframe "+(e.dataType||""),e.formData=this._getFormData(e),e.redirect&&i&&i!==location.host&&e.formData.push({name:e.redirectParamName||"redirect",value:e.redirect})},_initDataSettings:function(t){this._isXHRUpload(t)?(this._chunkedUpload(t,!0)||(t.data||this._initXHRData(t),this._initProgressListener(t)),t.postMessage&&(t.dataType="postmessage "+(t.dataType||""))):this._initIframeSettings(t)},_getParamName:function(e){var i=t(e.fileInput),o=e.paramName;return o?t.isArray(o)||(o=[o]):(o=[],i.each(function(){for(var e=t(this),i=e.prop("name")||"files[]",n=(e.prop("files")||[1]).length;n;)o.push(i),n-=1}),o.length||(o=[i.prop("name")||"files[]"])),o},_initFormSettings:function(e){e.form&&e.form.length||(e.form=t(e.fileInput.prop("form")),e.form.length||(e.form=t(this.options.fileInput.prop("form")))),e.paramName=this._getParamName(e),e.url||(e.url=e.form.prop("action")||location.href),e.type=(e.type||"string"===t.type(e.form.prop("method"))&&e.form.prop("method")||"").toUpperCase(),"POST"!==e.type&&"PUT"!==e.type&&"PATCH"!==e.type&&(e.type="POST"),e.formAcceptCharset||(e.formAcceptCharset=e.form.attr("accept-charset"))},_getAJAXSettings:function(e){var i=t.extend({},this.options,e);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(t){return t.state?t.state():t.isResolved()?"resolved":t.isRejected()?"rejected":"pending"},_enhancePromise:function(t){return t.success=t.done,t.error=t.fail,t.complete=t.always,t},_getXHRPromise:function(e,i,o){var n=t.Deferred(),a=n.promise();return i=i||this.options.context||a,!0===e?n.resolveWith(i,o):!1===e&&n.rejectWith(i,o),a.abort=n.promise,this._enhancePromise(a)},_addConvenienceMethods:function(e,i){var o=this,n=function(e){return t.Deferred().resolveWith(o,e).promise()};i.process=function(e,a){return(e||a)&&(i._processQueue=this._processQueue=(this._processQueue||n([this])).then(function(){return i.errorThrown?t.Deferred().rejectWith(o,[i]).promise():n(arguments)}).then(e,a)),this._processQueue||n([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==o._trigger("submit",t.Event("submit",{delegatedEvent:e}),this)&&o._onSend(e,this)),this.jqXHR||o._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",o._trigger("fail",null,this),o._getXHRPromise(!1))},i.state=function(){return this.jqXHR?o._getDeferredState(this.jqXHR):this._processQueue?o._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===o._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(t){var e=t.getResponseHeader("Range"),i=e&&e.split("-"),o=i&&i.length>1&&parseInt(i[1],10);return o&&o+1},_chunkedUpload:function(e,i){e.uploadedBytes=e.uploadedBytes||0;var o,n,a=this,r=e.files[0],s=r.size,l=e.uploadedBytes,h=e.maxChunkSize||s,d=this._blobSlice,u=t.Deferred(),c=u.promise();return!(!(this._isXHRUpload(e)&&d&&(l||("function"===t.type(h)?h(e):h)=s?(r.error=e.i18n("uploadedBytes"),this._getXHRPromise(!1,e.context,[null,"error",r.error])):(n=function(){var i=t.extend({},e),c=i._progress.loaded;i.blob=d.call(r,l,l+("function"===t.type(h)?h(i):h),r.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+s,a._initXHRData(i),a._initProgressListener(i),o=(!1!==a._trigger("chunksend",null,i)&&t.ajax(i)||a._getXHRPromise(!1,i.context)).done(function(o,r,h){l=a._getUploadedBytes(h)||l+i.chunkSize,c+i.chunkSize-i._progress.loaded&&a._onProgress(t.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),e.uploadedBytes=i.uploadedBytes=l,i.result=o,i.textStatus=r,i.jqXHR=h,a._trigger("chunkdone",null,i),a._trigger("chunkalways",null,i),ls._sending)for(var o=s._slots.shift();o;){if("pending"===s._getDeferredState(o)){o.resolve();break}o=s._slots.shift()}0===s._active&&s._trigger("stop")})};return this._beforeSend(e,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(a=t.Deferred(),this._slots.push(a),r=a.then(h)):(this._sequence=this._sequence.then(h,h),r=this._sequence),r.abort=function(){return n=[void 0,"abort","abort"],o?o.abort():(a&&a.rejectWith(l.context,n),h())},this._enhancePromise(r)):h()},_onAdd:function(e,i){var o,n,a,r,s=this,l=!0,h=t.extend({},this.options,i),d=i.files,u=d.length,c=h.limitMultiFileUploads,f=h.limitMultiFileUploadSize,p=h.limitMultiFileUploadSizeOverhead,g=0,m=this._getParamName(h),v=0;if(!u)return!1;if(f&&void 0===d[0].size&&(f=void 0),(h.singleFileUploads||c||f)&&this._isXHRUpload(h))if(h.singleFileUploads||f||!c)if(!h.singleFileUploads&&f)for(a=[],o=[],r=0;rf||c&&r+1-v>=c)&&(a.push(d.slice(v,r+1)),n=m.slice(v,r+1),n.length||(n=m),o.push(n),v=r+1,g=0);else o=m;else for(a=[],o=[],r=0;r").append(o)[0].reset(),i.after(o).detach(),n&&o.focus(),t.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(t,e){return e===i[0]?o[0]:e}),i[0]===this.element[0]&&(this.element=o)},_handleFileTreeEntry:function(e,i){var o,n=this,a=t.Deferred(),r=[],s=function(t){t&&!t.entry&&(t.entry=e),a.resolve([t])},l=function(t){n._handleFileTreeEntries(t,i+e.name+"/").done(function(t){a.resolve(t)}).fail(s)},h=function(){o.readEntries(function(t){t.length?(r=r.concat(t),h()):l(r)},s)};return i=i||"",e.isFile?e._file?(e._file.relativePath=i,a.resolve(e._file)):e.file(function(t){t.relativePath=i,a.resolve(t)},s):e.isDirectory?(o=e.createReader(),h()):a.resolve([]),a.promise()},_handleFileTreeEntries:function(e,i){var o=this;return t.when.apply(t,t.map(e,function(t){return o._handleFileTreeEntry(t,i)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(e){e=e||{};var i=e.items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(t.map(i,function(t){var e;return t.webkitGetAsEntry?(e=t.webkitGetAsEntry(),e&&(e._file=t.getAsFile()),e):t.getAsEntry()})):t.Deferred().resolve(t.makeArray(e.files)).promise()},_getSingleFileInputFiles:function(e){e=t(e);var i,o,n=e.prop("webkitEntries")||e.prop("entries");if(n&&n.length)return this._handleFileTreeEntries(n);if(i=t.makeArray(e.prop("files")),i.length)void 0===i[0].name&&i[0].fileName&&t.each(i,function(t,e){e.name=e.fileName,e.size=e.fileSize});else{if(!(o=e.prop("value")))return t.Deferred().resolve([]).promise();i=[{name:o.replace(/^.*\\/,"")}]}return t.Deferred().resolve(i).promise()},_getFileInputFiles:function(e){return e instanceof t&&1!==e.length?t.when.apply(t,t.map(e,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(e)},_onChange:function(e){var i=this,o={fileInput:t(e.target),form:t(e.target.form)};this._getFileInputFiles(o.fileInput).always(function(n){o.files=n,i.options.replaceFileInput&&i._replaceFileInput(o),!1!==i._trigger("change",t.Event("change",{delegatedEvent:e}),o)&&i._onAdd(e,o)})},_onPaste:function(e){var i=e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.items,o={files:[]};i&&i.length&&(t.each(i,function(t,e){var i=e.getAsFile&&e.getAsFile();i&&o.files.push(i)}),!1!==this._trigger("paste",t.Event("paste",{delegatedEvent:e}),o)&&this._onAdd(e,o))},_onDrop:function(e){e.dataTransfer=e.originalEvent&&e.originalEvent.dataTransfer;var i=this,o=e.dataTransfer,n={};o&&o.files&&o.files.length&&(e.preventDefault(),this._getDroppedFiles(o).always(function(o){n.files=o,!1!==i._trigger("drop",t.Event("drop",{delegatedEvent:e}),n)&&i._onAdd(e,n)}))},_onDragOver:e("dragover"),_onDragEnter:e("dragenter"),_onDragLeave:e("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),t.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(e,i){var o=-1!==t.inArray(e,this._specialOptions);o&&this._destroyEventHandlers(),this._super(e,i),o&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var e=this.options;void 0===e.fileInput?e.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):e.fileInput instanceof t||(e.fileInput=t(e.fileInput)),e.dropZone instanceof t||(e.dropZone=t(e.dropZone)),e.pasteZone instanceof t||(e.pasteZone=t(e.pasteZone))},_getRegExp:function(t){var e=t.split("/"),i=e.pop();return e.shift(),new RegExp(e.join("/"),i)},_isRegExpOption:function(e,i){return"url"!==e&&"string"===t.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var e=this,i=this.options,o=this.element.data();t.each(this.element[0].attributes,function(t,n){var a,r=n.name.toLowerCase();/^data-/.test(r)&&(r=r.slice(5).replace(/-[a-z]/g,function(t){return t.charAt(1).toUpperCase()}),a=o[r],e._isRegExpOption(r,a)&&(a=e._getRegExp(a)),i[r]=a)})},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(e){var i=this;e&&!this.options.disabled&&(e.fileInput&&!e.files?this._getFileInputFiles(e.fileInput).always(function(t){e.files=t,i._onAdd(null,e)}):(e.files=t.makeArray(e.files),this._onAdd(null,e)))},send:function(e){if(e&&!this.options.disabled){if(e.fileInput&&!e.files){var i,o,n=this,a=t.Deferred(),r=a.promise();return r.abort=function(){return o=!0,i?i.abort():(a.reject(null,"abort","abort"),r)},this._getFileInputFiles(e.fileInput).always(function(t){if(!o){if(!t.length)return void a.reject();e.files=t,i=n._onSend(null,e),i.then(function(t,e,i){a.resolve(t,e,i)},function(t,e,i){a.reject(t,e,i)})}}),this._enhancePromise(r)}if(e.files=t.makeArray(e.files),e.files.length)return this._onSend(null,e)}return this._getXHRPromise(!1,e&&e.context)}})}),function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):jQuery&&!jQuery.fn.colorpicker&&e(jQuery)}(0,function(t){"use strict";var e=function(i,o,n,a,r){this.fallbackValue=n?n&&void 0!==n.h?n:this.value={h:0,s:0,b:0,a:1}:null,this.fallbackFormat=a||"rgba",this.hexNumberSignPrefix=!0===r,this.value=this.fallbackValue,this.origFormat=null,this.predefinedColors=o||{},this.colors=t.extend({},e.webColors,this.predefinedColors),i&&(void 0!==i.h?this.value=i:this.setColor(String(i))),this.value||(this.value={h:0,s:0,b:0,a:1})};e.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0", chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"},e.prototype={constructor:e,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(t){this.value=t},_sanitizeNumber:function(t){return"number"==typeof t?t:isNaN(t)||null===t||""===t||void 0===t?1:""===t?0:void 0!==t.toLowerCase?(t.match(/^\./)&&(t="0"+t),Math.ceil(100*parseFloat(t))/100):1},isTransparent:function(t){return!(!t||!("string"==typeof t||t instanceof String))&&("transparent"===(t=t.toLowerCase().trim())||t.match(/#?00000000/)||t.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/))},rgbaIsTransparent:function(t){return 0===t.r&&0===t.g&&0===t.b&&0===t.a},setColor:function(t){if(t=t.toLowerCase().trim()){if(this.isTransparent(t))return this.value={h:0,s:0,b:0,a:0},!0;var e=this.parse(t);e?(this.value=this.value={h:e.h,s:e.s,b:e.b,a:e.a},this.origFormat||(this.origFormat=e.format)):this.fallbackValue&&(this.value=this.fallbackValue)}return!1},setHue:function(t){this.value.h=1-t},setSaturation:function(t){this.value.s=t},setBrightness:function(t){this.value.b=1-t},setAlpha:function(t){this.value.a=Math.round(parseInt(100*(1-t),10)/100*100)/100},toRGB:function(t,e,i,o){0===arguments.length&&(t=this.value.h,e=this.value.s,i=this.value.b,o=this.value.a),t*=360;var n,a,r,s,l;return t=t%360/60,l=i*e,s=l*(1-Math.abs(t%2-1)),n=a=r=i-l,t=~~t,n+=[l,s,0,0,s,l][t],a+=[s,l,l,s,0,0][t],r+=[0,0,s,l,l,s][t],{r:Math.round(255*n),g:Math.round(255*a),b:Math.round(255*r),a:o}},toHex:function(t,e,i,o,n){arguments.length<=1&&(e=this.value.h,i=this.value.s,o=this.value.b,n=this.value.a);var a="#",r=this.toRGB(e,i,o,n);return this.rgbaIsTransparent(r)?"transparent":(t||(a=this.hexNumberSignPrefix?"#":""),a+((1<<24)+(parseInt(r.r)<<16)+(parseInt(r.g)<<8)+parseInt(r.b)).toString(16).slice(1))},toHSL:function(t,e,i,o){0===arguments.length&&(t=this.value.h,e=this.value.s,i=this.value.b,o=this.value.a);var n=t,a=(2-e)*i,r=e*i;return r/=a>0&&a<=1?a:2-a,a/=2,r>1&&(r=1),{h:isNaN(n)?0:n,s:isNaN(r)?0:r,l:isNaN(a)?0:a,a:isNaN(o)?0:o}},toAlias:function(t,e,i,o){var n,a=0===arguments.length?this.toHex(!0):this.toHex(!0,t,e,i,o),r="alias"===this.origFormat?a:this.toString(!1,this.origFormat);for(var s in this.colors)if((n=this.colors[s].toLowerCase().trim())===a||n===r)return s;return!1},RGBtoHSB:function(t,e,i,o){t/=255,e/=255,i/=255;var n,a,r,s;return r=Math.max(t,e,i),s=r-Math.min(t,e,i),n=0===s?null:r===t?(e-i)/s:r===e?(i-t)/s+2:(t-e)/s+4,n=(n+360)%6*60/360,a=0===s?0:s/r,{h:this._sanitizeNumber(n),s:a,b:r,a:this._sanitizeNumber(o)}},HueToRGB:function(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t},HSLtoRGB:function(t,e,i,o){e<0&&(e=0);var n;n=i<=.5?i*(1+e):i+e-i*e;var a=2*i-n,r=t+1/3,s=t,l=t-1/3;return[Math.round(255*this.HueToRGB(a,n,r)),Math.round(255*this.HueToRGB(a,n,s)),Math.round(255*this.HueToRGB(a,n,l)),this._sanitizeNumber(o)]},parse:function(e){if(0===arguments.length)return!1;var i,o,n=this,a=!1,r=void 0!==this.colors[e];return r&&(e=this.colors[e].toLowerCase().trim()),t.each(this.stringParsers,function(t,s){var l=s.re.exec(e);return!(i=l&&s.parse.apply(n,[l]))||(a={},o=r?"alias":s.format?s.format:n.getValidFallbackFormat(),a=o.match(/hsla?/)?n.RGBtoHSB.apply(n,n.HSLtoRGB.apply(n,i)):n.RGBtoHSB.apply(n,i),a instanceof Object&&(a.format=o),!1)}),a},getValidFallbackFormat:function(){var t=["rgba","rgb","hex","hsla","hsl"];return this.origFormat&&-1!==t.indexOf(this.origFormat)?this.origFormat:this.fallbackFormat&&-1!==t.indexOf(this.fallbackFormat)?this.fallbackFormat:"rgba"},toString:function(t,i,o){i=i||this.origFormat||this.fallbackFormat,o=o||!1;var n=!1;switch(i){case"rgb":return n=this.toRGB(),this.rgbaIsTransparent(n)?"transparent":"rgb("+n.r+","+n.g+","+n.b+")";case"rgba":return n=this.toRGB(),"rgba("+n.r+","+n.g+","+n.b+","+n.a+")";case"hsl":return n=this.toHSL(),"hsl("+Math.round(360*n.h)+","+Math.round(100*n.s)+"%,"+Math.round(100*n.l)+"%)";case"hsla":return n=this.toHSL(),"hsla("+Math.round(360*n.h)+","+Math.round(100*n.s)+"%,"+Math.round(100*n.l)+"%,"+n.a+")";case"hex":return this.toHex(t);case"alias":return n=this.toAlias(),!1===n?this.toString(t,this.getValidFallbackFormat()):o&&!(n in e.webColors)&&n in this.predefinedColors?this.predefinedColors[n]:n;default:return n}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(t){return[t[1],t[2],t[3],1]}},{re:/rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),1]}}],colorNameToHex:function(t){return void 0!==this.colors[t.toLowerCase()]&&this.colors[t.toLowerCase()]}};var i={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",fallbackColor:!1,fallbackFormat:"hex",hexNumberSignPrefix:!0,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'',leftArrow:"",rightArrow:"",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},r=function(){function o(i,n){var r=this;e(this,o),this._config=t.extend({},a,n),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=i instanceof jQuery?i:t(i),this._isBootstrap3=3==t.fn.modal.Constructor.VERSION[0];var s='",l='',h='",d='",u='";t(this._config.doc.body).append('"),this._$modal=t("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=t(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),t(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(t){return t.preventDefault(),r.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(t){return t.preventDefault(),r.navigateRight()}),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return r._toggleLoading(!0),r._handle(),r._config.onShown.call(r)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return r._galleryName&&(t(document).off("keydown.ekkoLightbox"),t(window).off("resize.ekkoLightbox")),r._$modal.remove(),r._config.onHidden.call(r)}).modal(this._config),t(window).on("resize.ekkoLightbox",function(){r._resize(r._wantedWidth,r._wantedHeight)}),this._$lightboxContainer.on("touchstart",function(){r._touchstartX=event.changedTouches[0].screenX}).on("touchend",function(){r._touchendX=event.changedTouches[0].screenX,r._swipeGesure()})}return i(o,null,[{key:"Default",get:function(){return a}}]),i(o,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(e){if(e<0||e>this._$galleryItems.length-1)return this;this._galleryIndex=e,this.updateNavigation(),this._$element=t(this._$galleryItems.get(this._galleryIndex)),this._handle()}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var t=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?t.find("a:first-child").addClass("disabled"):t.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?t.find("a:last-child").addClass("disabled"):t.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(t){return t=t||window.event,39===t.keyCode?this.navigateRight():37===t.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(t,e){return e=e||!1,!e&&this._isImage(t)&&(e="image"),!e&&this._getYoutubeId(t)&&(e="youtube"),!e&&this._getVimeoId(t)&&(e="vimeo"),!e&&this._getInstagramId(t)&&(e="instagram"),(!e||["image","youtube","vimeo","instagram","video","url"].indexOf(e)<0)&&(e="url"),e}},{key:"_isImage",value:function(t){return t&&t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var t=this,e=this._$lightboxBodyTwo,i=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(e=this._$lightboxBodyOne,i=this._$lightboxBodyTwo),i.removeClass("in show"),setTimeout(function(){t._$lightboxBodyTwo.hasClass("in")||t._$lightboxBodyTwo.empty(),t._$lightboxBodyOne.hasClass("in")||t._$lightboxBodyOne.empty()},500),e.addClass("in show"),e}},{key:"_handle",value:function(){var t=this._containerToUse();this._updateTitleAndFooter();var e=this._$element.attr("data-remote")||this._$element.attr("href"),i=this._detectRemoteType(e,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(i)<0)return this._error(this._config.strings.type);switch(i){case"image":this._preloadImage(e,t),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(e,t);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(e),t);break;case"instagram":this._showInstagramVideo(this._getInstagramId(e),t);break;case"video":this._showHtml5Video(e,t);break;default:this._loadRemoteContent(e,t)}return this}},{key:"_getYoutubeId",value:function(t){if(!t)return!1;var e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}},{key:"_getVimeoId",value:function(t){return!!(t&&t.indexOf("vimeo")>0)&&t}},{key:"_getInstagramId",value:function(t){return!!(t&&t.indexOf("instagram")>0)&&t}},{key:"_toggleLoading",value:function(e){return e=e||!1,e?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),t(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),t(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(t){return parseInt(this._$modalDialog.css(t),10)+parseInt(this._$modalContent.css(t),10)+parseInt(this._$modalBody.css(t),10)}},{key:"_updateTitleAndFooter",value:function(){var t=this._$element.data("title")||"",e=this._$element.data("footer")||"";return this._titleIsShown=!1,t||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(t||" ")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,e?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(e)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(t,e){var i=this._getYoutubeId(t),o=t.indexOf("&")>0?t.substr(t.indexOf("&")):"",n=this._$element.data("width")||560,a=this._$element.data("height")||n/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+i+"?badge=0&autoplay=1&html5=1"+o,n,a,e)}},{key:"_showVimeoVideo",value:function(t,e){var i=this._$element.data("width")||500,o=this._$element.data("height")||i/(560/315);return this._showVideoIframe(t+"?autoplay=1",i,o,e)}},{key:"_showInstagramVideo",value:function(t,e){var i=this._$element.data("width")||612,o=i+80;return t="/"!==t.substr(-1)?t+"/":t,e.html(''),this._resize(i,o),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(t,e,i,o){return i=i||e,o.html('
'),this._resize(e,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(t,e){var i=this._$element.data("width")||560,o=this._$element.data("height")||i/(560/315) ;return e.html('
'),this._resize(i,o),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(e,i){var o=this,n=this._$element.data("width")||560,a=this._$element.data("height")||560,r=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),r||this._isExternal(e)?(i.html(''),this._config.onContentLoaded.call(this)):i.load(e,t.proxy(function(){return o._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(n,a),this}},{key:"_isExternal",value:function(t){var e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(t){return console.error(t),this._containerToUse().html(t),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(e,i){if(this._$galleryItems){var o=t(this._$galleryItems.get(e),!1);if(void 0!==o){var n=o.attr("data-remote")||o.attr("href");return("image"===o.attr("data-type")||this._isImage(n))&&this._preloadImage(n,!1),i>0?this._preloadImageByIndex(e+1,i-1):void 0}}}},{key:"_preloadImage",value:function(e,i){var o=this;i=i||!1;var n=new Image;return i&&function(){var a=setTimeout(function(){i.append(o._config.loadingMessage)},200);n.onload=function(){a&&clearTimeout(a),a=null;var e=t("");return e.attr("src",n.src),e.addClass("img-fluid"),e.css("width","100%"),i.html(e),o._$modalArrows&&o._$modalArrows.css("display",""),o._resize(n.width,n.height),o._toggleLoading(!1),o._config.onContentLoaded.call(o)},n.onerror=function(){return o._toggleLoading(!1),o._error(o._config.strings.fail+" "+e)}}(),n.src=e,n}},{key:"_swipeGesure",value:function(){return this._touchendXthis._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(e,i){i=i||e,this._wantedWidth=e,this._wantedHeight=i;var o=e/i,n=this._padding.left+this._padding.right+this._border.left+this._border.right,a=this._config.doc.body.clientWidth>575?20:0,r=this._config.doc.body.clientWidth>575?0:20,s=Math.min(e+n,this._config.doc.body.clientWidth-a,this._config.maxWidth);e+n>s?(i=(s-n-r)/o,e=s):e+=n;var l=0,h=0;this._footerIsShown&&(h=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(l=this._$modalHeader.outerHeight(!0)||67);var d=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,u=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),c=Math.min(i,t(window).height()-d-u-l-h,this._config.maxHeight-d-l-h);i>c&&(e=Math.ceil(c*o)+n),this._$lightboxContainer.css("height",c),this._$modalDialog.css("flex",1).css("maxWidth",e);var f=this._$modal.data("bs.modal");if(f)try{f._handleUpdate()}catch(t){f.handleUpdate()}return this}}],[{key:"_jQueryInterface",value:function(e){var i=this;return e=e||{},this.each(function(){var n=t(i),a=t.extend({},o.Default,n.data(),"object"==typeof e&&e);new o(i,a)})}}]),o}();t.fn[o]=r._jQueryInterface,t.fn[o].Constructor=r,t.fn[o].noConflict=function(){return t.fn[o]=n,r._jQueryInterface}}(jQuery)}(jQuery),function(t){function e(t,e,n){var a=t[0],r=/er/.test(n)?g:/bl/.test(n)?f:u,s=n==m?{checked:a[u],disabled:a[f],indeterminate:"true"==t.attr(g)||"false"==t.attr(p)}:a[r];if(/^(ch|di|in)/.test(n)&&!s)i(t,r);else if(/^(un|en|de)/.test(n)&&s)o(t,r);else if(n==m)for(var l in s)s[l]?i(t,l,!0):o(t,l,!0);else e&&"toggle"!=n||(e||t[w]("ifClicked"),s?a[v]!==d&&o(t,r):i(t,r))}function i(e,i,n){var m=e[0],b=e.parent(),w=i==u,_=i==g,C=i==f,D=_?p:w?c:"enabled",M=a(e,D+r(m[v])),S=a(e,i+r(m[v]));if(!0!==m[i]){if(!n&&i==u&&m[v]==d&&m.name){var T=e.closest("form"),I='input[name="'+m.name+'"]';I=T.length?T.find(I):t(I),I.each(function(){this!==m&&t(this).data(l)&&o(t(this),i)})}_?(m[i]=!0,m[u]&&o(e,u,"force")):(n||(m[i]=!0),w&&m[g]&&o(e,g,!1)),s(e,w,i,n)}m[f]&&a(e,k,!0)&&b.find("."+h).css(k,"default"),b[y](S||a(e,i)||""),b.attr("role")&&!_&&b.attr("aria-"+(C?f:u),"true"),b[x](M||a(e,D)||"")}function o(t,e,i){var o=t[0],n=t.parent(),l=e==u,d=e==g,m=e==f,b=d?p:l?c:"enabled",w=a(t,b+r(o[v])),_=a(t,e+r(o[v]));!1!==o[e]&&(!d&&i&&"force"!=i||(o[e]=!1),s(t,l,b,i)),!o[f]&&a(t,k,!0)&&n.find("."+h).css(k,"pointer"),n[x](_||a(t,e)||""),n.attr("role")&&!d&&n.attr("aria-"+(m?f:u),"false"),n[y](w||a(t,b)||"")}function n(e,i){e.data(l)&&(e.parent().html(e.attr("style",e.data(l).s||"")),i&&e[w](i),e.off(".i").unwrap(),t(_+'[for="'+e[0].id+'"]').add(e.closest(_)).off(".i"))}function a(t,e,i){if(t.data(l))return t.data(l).o[e+(i?"":"Class")]}function r(t){return t.charAt(0).toUpperCase()+t.slice(1)}function s(t,e,i,o){o||(e&&t[w]("ifToggled"),t[w]("ifChanged")[w]("if"+r(i)))}var l="iCheck",h=l+"-helper",d="radio",u="checked",c="un"+u,f="disabled",p="determinate",g="in"+p,m="update",v="type",b="touchbegin.i touchend.i",y="addClass",x="removeClass",w="trigger",_="label",k="cursor",C=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);t.fn[l]=function(a,r){var s='input[type="checkbox"], input[type="'+d+'"]',c=t(),p=function(e){e.each(function(){var e=t(this);c=e.is(s)?c.add(e):c.add(e.find(s))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),p(this),c.each(function(){var i=t(this);"destroy"==a?n(i,"ifDestroyed"):e(i,!0,a),t.isFunction(r)&&r()});if("object"!=typeof a&&a)return this;var k=t.extend({checkedClass:u,disabledClass:f,indeterminateClass:g,labelHover:!0},a),D=k.handle,M=k.hoverClass||"hover",S=k.focusClass||"focus",T=k.activeClass||"active",I=!!k.labelHover,A=k.labelHoverClass||"hover",P=0|(""+k.increaseArea).replace("%","");return"checkbox"!=D&&D!=d||(s='input[type="'+D+'"]'),P<-50&&(P=-50),p(this),c.each(function(){var a=t(this);n(a);var r,s=this,c=s.id,p=-P+"%",g=100+2*P+"%",D={position:"absolute",top:p,left:p,display:"block",width:g,height:g,margin:0,padding:0,background:"#fff",border:0,opacity:0},F=C?{position:"absolute",visibility:"hidden"}:P?D:{position:"absolute",opacity:0},O="checkbox"==s[v]?k.checkboxClass||"icheckbox":k.radioClass||"i"+d,E=t(_+'[for="'+c+'"]').add(a.closest(_)),L=!!k.aria,R=l+"-"+Math.random().toString(36).substr(2,6),z='
")[w]("ifCreated").parent().append(k.insert),r=t('').css(D).appendTo(z),a.data(l,{o:k,s:a.attr("style")}).css(F),!!k.inheritClass&&z[y](s.className||""),!!k.inheritID&&c&&z.attr("id",l+"-"+c),"static"==z.css("position")&&z.css("position","relative"),e(a,!0,m),E.length&&E.on("click.i mouseover.i mouseout.i "+b,function(i){var o=i[v],n=t(this);if(!s[f]){if("click"==o){if(t(i.target).is("a"))return;e(a,!1,!0)}else I&&(/ut|nd/.test(o)?(z[x](M),n[x](A)):(z[y](M),n[y](A)));if(!C)return!1;i.stopPropagation()}}),a.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(t){var e=t[v],n=t.keyCode;return"click"!=e&&("keydown"==e&&32==n?(s[v]==d&&s[u]||(s[u]?o(a,u):i(a,u)),!1):void("keyup"==e&&s[v]==d?!s[u]&&i(a,u):/us|ur/.test(e)&&z["blur"==e?x:y](S)))}),r.on("click mousedown mouseup mouseover mouseout "+b,function(t){var i=t[v],o=/wn|up/.test(i)?T:M;if(!s[f]){if("click"==i?e(a,!1,!0):(/wn|er|in/.test(i)?z[y](o):z[x](o+" "+T),E.length&&I&&o==M&&E[/ut|nd/.test(i)?x:y](A)),!C)return!1;t.stopPropagation()}})})}}(window.jQuery||window.Zepto),function(t){function e(t){for(var e,i,o=t.length;o;e=parseInt(Math.random()*o),i=t[--o],t[o]=t[e],t[e]=i);return t}function i(t,e){return Math.floor(Math.random()*(e-t+1)+t)}var o=[],n=[],a=[],r=[],s=null,l={init:function(e,i){for(var h=t.extend({bind:"click",passwordElement:null,displayElement:null,passwordLength:16,uppercase:!0,lowercase:!0,numbers:!0,specialChars:!0,additionalSpecialChars:[],onPasswordGenerated:function(t){}},e),d=48;d<58;d++)o.push(d);for(d=65;d<91;d++)n.push(d);for(d=97;d<123;d++)a.push(d);return r=[33,35,64,36,38,42,91,93,123,125,92,47,63,58,59,95,45].concat(h.additionalSpecialChars),this.each(function(){s=t(this),s.bind(h.bind,function(t){t.preventDefault(),l.generatePassword(h)})})},generatePassword:function(s){var l=new Array,h=s.uppercase+s.lowercase+s.numbers+s.specialChars,d=0,u=new Array,c=Math.floor(s.passwordLength/h);if(s.uppercase){for(var f=0;fi?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,i=(e[0]+t)%360;return e[0]=i<0?360+i:i,this.setValues("hsl",e),this},mix:function(t,e){var i=this,o=t,n=void 0===e?.5:e,a=2*n-1,r=i.alpha()-o.alpha(),s=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,l=1-s;return this.rgb(s*i.red()+l*o.red(),s*i.green()+l*o.green(),s*i.blue()+l*o.blue()).alpha(i.alpha()*n+o.alpha()*(1-n))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new a,o=this.values,n=i.values;for(var r in o)o.hasOwnProperty(r)&&(t=o[r],e={}.toString.call(t),"[object Array]"===e?n[r]=t.slice(0):"[object Number]"===e?n[r]=t:console.error("unexpected color value:",t));return i}},a.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},a.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},a.prototype.getValues=function(t){for(var e=this.values,i={},o=0;o.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92,[100*(.4124*e+.3576*i+.1805*o),100*(.2126*e+.7152*i+.0722*o),100*(.0193*e+.1192*i+.9505*o)]}function d(t){var e,i,o,n=h(t),a=n[0],r=n[1],s=n[2];return a/=95.047,r/=100,s/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*r-16,i=500*(a-r),o=200*(r-s),[e,i,o]}function u(t){return B(d(t))}function c(t){var e,i,o,n,a,r=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return a=255*l,[a,a,a];i=l<.5?l*(1+s):l+s-l*s,e=2*l-i,n=[0,0,0];for(var h=0;h<3;h++)o=r+1/3*-(h-1),o<0&&o++,o>1&&o--,a=6*o<1?e+6*(i-e)*o:2*o<1?i:3*o<2?e+(i-e)*(2/3-o)*6:e,n[h]=255*a;return n}function f(t){var e,i,o=t[0],n=t[1]/100,a=t[2]/100;return 0===a?[0,0,0]:(a*=2,n*=a<=1?a:2-a,i=(a+n)/2,e=2*n/(a+n),[o,100*e,100*i])}function p(t){return a(c(t))}function m(t){return s(c(t))}function v(t){return l(c(t))}function y(t){var e=t[0]/60,i=t[1]/100,o=t[2]/100,n=Math.floor(e)%6,a=e-Math.floor(e),r=255*o*(1-i),s=255*o*(1-i*a),l=255*o*(1-i*(1-a)),o=255*o;switch(n){case 0:return[o,l,r];case 1:return[s,o,r];case 2:return[r,o,l];case 3:return[r,s,o];case 4:return[l,r,o];case 5:return[o,r,s]}}function x(t){var e,i,o=t[0],n=t[1]/100,a=t[2]/100;return i=(2-n)*a,e=n*a,e/=i<=1?i:2-i,e=e||0,i/=2,[o,100*e,100*i]}function w(t){return a(y(t))}function _(t){return s(y(t))}function k(t){return l(y(t))}function C(t){var e,i,o,n,a=t[0]/360,s=t[1]/100,l=t[2]/100,h=s+l;switch(h>1&&(s/=h,l/=h),e=Math.floor(6*a),i=1-l,o=6*a-e,0!=(1&e)&&(o=1-o),n=s+o*(i-s),e){default:case 6:case 0:r=i,g=n,b=s;break;case 1:r=n,g=i,b=s;break;case 2:r=s,g=i,b=n;break;case 3:r=s,g=n,b=i;break;case 4:r=n,g=s,b=i;break;case 5:r=i,g=s,b=n}return[255*r,255*g,255*b]}function D(t){return o(C(t))}function M(t){return n(C(t))}function S(t){return s(C(t))}function T(t){return l(C(t))}function I(t){var e,i,o,n=t[0]/100,a=t[1]/100,r=t[2]/100,s=t[3]/100;return e=1-Math.min(1,n*(1-s)+s),i=1-Math.min(1,a*(1-s)+s),o=1-Math.min(1,r*(1-s)+s),[255*e,255*i,255*o]}function A(t){return o(I(t))}function P(t){return n(I(t))}function F(t){return a(I(t))}function O(t){return l(I(t))}function E(t){var e,i,o,n=t[0]/100,a=t[1]/100,r=t[2]/100;return e=3.2406*n+-1.5372*a+-.4986*r,i=-.9689*n+1.8758*a+.0415*r,o=.0557*n+-.204*a+1.057*r,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*=12.92,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),[255*e,255*i,255*o]}function L(t){var e,i,o,n=t[0],a=t[1],r=t[2];return n/=95.047,a/=100,r/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,e=116*a-16,i=500*(n-a),o=200*(a-r),[e,i,o]}function R(t){return B(L(t))}function z(t){var e,i,o,n,a=t[0],r=t[1],s=t[2];return a<=8?(i=100*a/903.3,n=i/100*7.787+16/116):(i=100*Math.pow((a+16)/116,3),n=Math.pow(i/100,1/3)),e=e/95.047<=.008856?e=95.047*(r/500+n-16/116)/7.787:95.047*Math.pow(r/500+n,3),o=o/108.883<=.008859?o=108.883*(n-s/200-16/116)/7.787:108.883*Math.pow(n-s/200,3),[e,i,o]}function B(t){var e,i,o,n=t[0],a=t[1],r=t[2];return e=Math.atan2(r,a),i=360*e/2/Math.PI,i<0&&(i+=360),o=Math.sqrt(a*a+r*r),[n,o,i]}function N(t){return E(z(t))}function W(t){var e,i,o,n=t[0],a=t[1],r=t[2];return o=r/360*2*Math.PI,e=a*Math.cos(o),i=a*Math.sin(o),[n,e,i]}function V(t){return z(W(t))}function H(t){return N(W(t))}function U(t){return G[t]}function j(t){return o(U(t))}function Y(t){return n(U(t))}function q(t){return a(U(t))}function $(t){return s(U(t))}function X(t){return d(U(t))}function Q(t){return h(U(t))}e.exports={rgb2hsl:o,rgb2hsv:n,rgb2hwb:a,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:h,rgb2lab:d,rgb2lch:u,hsl2rgb:c,hsl2hsv:f,hsl2hwb:p,hsl2cmyk:m,hsl2keyword:v,hsv2rgb:y,hsv2hsl:x,hsv2hwb:w,hsv2cmyk:_,hsv2keyword:k,hwb2rgb:C,hwb2hsl:D,hwb2hsv:M,hwb2cmyk:S,hwb2keyword:T,cmyk2rgb:I,cmyk2hsl:A,cmyk2hsv:P,cmyk2hwb:F,cmyk2keyword:O,keyword2rgb:U,keyword2hsl:j,keyword2hsv:Y,keyword2hwb:q,keyword2cmyk:$,keyword2lab:X,keyword2xyz:Q,xyz2rgb:E,xyz2lab:L,xyz2lch:R,lab2xyz:z,lab2rgb:N,lab2lch:B,lch2lab:W,lch2xyz:V,lch2rgb:H};var G={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Z={};for(var K in G)Z[JSON.stringify(G[K])]=K},{}],5:[function(t,e,i){var o=t(4),n=function(){return new h};for(var a in o){n[a+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),o[t](e)}}(a);var r=/(\w+)2(\w+)/.exec(a),s=r[1],l=r[2];n[s]=n[s]||{},n[s][l]=n[a]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var i=o[t](e);if("string"==typeof i||void 0===i)return i;for(var n=0;n0?Math.min(r,o-i):r,i=o;return r}function n(t,e,i){var o,n,a=i.barThickness,r=e.stackCount,s=e.pixels[t];return l.isNullOrUndef(a)?(o=e.min*i.categoryPercentage,n=i.barPercentage):(o=a*r,n=1),{chunk:o/r,ratio:n,start:s-o/2}}function a(t,e,i){var o,n,a=e.pixels,r=a[t],s=t>0?a[t-1]:null,l=t0&&(t[0].yLabel?i=t[0].yLabel:e.labels.length>0&&t[0].index=0&&n>0)&&(m+=n));return a=u.getPixelForValue(m),r=u.getPixelForValue(m+f),s=(r-a)/2,{size:s,base:a,head:r,center:r+s/2}},calculateBarIndexPixels:function(t,e,i){var o=this,r=i.scale.options,s="flex"===r.barThickness?a(e,i,r):n(e,i,r),h=o.getStackIndex(t,o.getMeta().stack),d=s.start+s.chunk*h+s.chunk/2,u=Math.min(l.valueOrDefault(r.maxBarThickness,1/0),s.chunk*s.ratio);return{base:d-u/2,head:d+u/2,center:d,size:u}},draw:function(){var t=this,e=t.chart,i=t.getValueScale(),o=t.getMeta().data,n=t.getDataset(),a=o.length,r=0;for(l.canvas.clipArea(e.ctx,e.chartArea);r');var i=t.data,o=i.datasets,n=i.labels;if(o.length)for(var a=0;a'),n[a]&&e.push(n[a]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,o){var n=t.getDatasetMeta(0),r=e.datasets[0],s=n.data[o],l=s&&s.custom||{},h=a.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:i,fillStyle:l.backgroundColor?l.backgroundColor:h(r.backgroundColor,o,d.backgroundColor),strokeStyle:l.borderColor?l.borderColor:h(r.borderColor,o,d.borderColor),lineWidth:l.borderWidth?l.borderWidth:h(r.borderWidth,o,d.borderWidth),hidden:isNaN(r.data[o])||n.data[o].hidden,index:o}}):[]}},onClick:function(t,e){var i,o,n,a=e.index,r=this.chart;for(i=0,o=(r.data.datasets||[]).length;i=Math.PI?-1:p<-Math.PI?1:0);var g=p+f,m={x:Math.cos(p),y:Math.sin(p)},v={x:Math.cos(g),y:Math.sin(g)},b=p<=0&&g>=0||p<=2*Math.PI&&2*Math.PI<=g,y=p<=.5*Math.PI&&.5*Math.PI<=g||p<=2.5*Math.PI&&2.5*Math.PI<=g,x=p<=-Math.PI&&-Math.PI<=g||p<=Math.PI&&Math.PI<=g,w=p<=.5*-Math.PI&&.5*-Math.PI<=g||p<=1.5*Math.PI&&1.5*Math.PI<=g,_=c/100,k={x:x?-1:Math.min(m.x*(m.x<0?1:_),v.x*(v.x<0?1:_)),y:w?-1:Math.min(m.y*(m.y<0?1:_),v.y*(v.y<0?1:_))},C={x:b?1:Math.max(m.x*(m.x>0?1:_),v.x*(v.x>0?1:_)),y:y?1:Math.max(m.y*(m.y>0?1:_),v.y*(v.y>0?1:_))},D={width:.5*(C.x-k.x),height:.5*(C.y-k.y)};h=Math.min(s/D.width,l/D.height),d={x:-.5*(C.x+k.x),y:-.5*(C.y+k.y)}}i.borderWidth=e.getMaxBorderWidth(u.data),i.outerRadius=Math.max((h-i.borderWidth)/2,0),i.innerRadius=Math.max(c?i.outerRadius/100*c:0,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),i.offsetX=d.x*i.outerRadius,i.offsetY=d.y*i.outerRadius,u.total=e.calculateTotal(),e.outerRadius=i.outerRadius-i.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-i.radiusLength,0),a.each(u.data,function(i,o){e.updateElement(i,o,t)})},updateElement:function(t,e,i){var o=this,n=o.chart,r=n.chartArea,s=n.options,l=s.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,u=s.rotation,c=s.rotation,f=o.getDataset(),p=i&&l.animateRotate?0:t.hidden?0:o.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),g=i&&l.animateScale?0:o.innerRadius,m=i&&l.animateScale?0:o.outerRadius,v=a.valueAtIndexOrDefault;a.extend(t,{_datasetIndex:o.index,_index:e,_model:{x:h+n.offsetX,y:d+n.offsetY,startAngle:u,endAngle:c,circumference:p,outerRadius:m,innerRadius:g,label:v(f.label,e,n.data.labels[e])}});var b=t._model,y=t.custom||{},x=a.valueAtIndexOrDefault,w=this.chart.options.elements.arc;b.backgroundColor=y.backgroundColor?y.backgroundColor:x(f.backgroundColor,e,w.backgroundColor),b.borderColor=y.borderColor?y.borderColor:x(f.borderColor,e,w.borderColor),b.borderWidth=y.borderWidth?y.borderWidth:x(f.borderWidth,e,w.borderWidth),i&&l.animateRotate||(b.startAngle=0===e?s.rotation:o.getMeta().data[e-1]._model.endAngle,b.endAngle=b.startAngle+b.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),o=0;return a.each(i.data,function(i,n){t=e.data[n],isNaN(t)||i.hidden||(o+=Math.abs(t))}),o},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){for(var e,i,o=0,n=this.index,a=t.length,r=0;ro?e:o,o=i>o?i:o;return o}})}},{26:26,41:41,46:46}],18:[function(t,e,i){"use strict";var o=t(26),n=t(41),a=t(46);o._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return a.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:n.Line,dataElementType:n.Point,update:function(t){var i,o,n,r=this,s=r.getMeta(),l=s.dataset,h=s.data||[],d=r.chart.options,u=d.elements.line,c=r.getScaleForId(s.yAxisID),f=r.getDataset(),p=e(f,d);for(p&&(n=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=c,l._datasetIndex=r.index,l._children=h,l._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:n.tension?n.tension:a.valueOrDefault(f.lineTension,u.tension),backgroundColor:n.backgroundColor?n.backgroundColor:f.backgroundColor||u.backgroundColor,borderWidth:n.borderWidth?n.borderWidth:f.borderWidth||u.borderWidth,borderColor:n.borderColor?n.borderColor:f.borderColor||u.borderColor,borderCapStyle:n.borderCapStyle?n.borderCapStyle:f.borderCapStyle||u.borderCapStyle,borderDash:n.borderDash?n.borderDash:f.borderDash||u.borderDash,borderDashOffset:n.borderDashOffset?n.borderDashOffset:f.borderDashOffset||u.borderDashOffset,borderJoinStyle:n.borderJoinStyle?n.borderJoinStyle:f.borderJoinStyle||u.borderJoinStyle,fill:n.fill?n.fill:void 0!==f.fill?f.fill:u.fill,steppedLine:n.steppedLine?n.steppedLine:a.valueOrDefault(f.steppedLine,u.stepped),cubicInterpolationMode:n.cubicInterpolationMode?n.cubicInterpolationMode:a.valueOrDefault(f.cubicInterpolationMode,u.cubicInterpolationMode)},l.pivot()),i=0,o=h.length;i');var i=t.data,o=i.datasets,n=i.labels;if(o.length)for(var a=0;a'),n[a]&&e.push(n[a]),e.push("");return e.push(""),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,o){var n=t.getDatasetMeta(0),r=e.datasets[0],s=n.data[o],l=s.custom||{},h=a.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:i,fillStyle:l.backgroundColor?l.backgroundColor:h(r.backgroundColor,o,d.backgroundColor),strokeStyle:l.borderColor?l.borderColor:h(r.borderColor,o,d.borderColor),lineWidth:l.borderWidth?l.borderWidth:h(r.borderWidth,o,d.borderWidth),hidden:isNaN(r.data[o])||n.data[o].hidden,index:o}}):[]}},onClick:function(t,e){var i,o,n,a=e.index,r=this.chart;for(i=0,o=(r.data.datasets||[]).length;i1&&(i=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+i);var o=Date.now();t.dropFrames+=(o-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,i,o=this.animations,a=0;a=e.numSteps?(n.callback(e.onAnimationComplete,[e],i),i.animating=!1,o.splice(a,1)):++a}}},{26:26,46:46}],24:[function(t,e,i){"use strict";var o=t(22),n=t(23),a=t(26),r=t(46),s=t(29),l=t(31),h=t(49),d=t(32),u=t(34),c=t(36);e.exports=function(t){function e(t){t=t||{};var e=t.data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=r.configMerge(a.global,a[t.type],t.options||{}),t}function i(e){var i=e.options;r.each(e.scales,function(t){l.removeBox(e,t)}),i=r.configMerge(t.defaults.global,t.defaults[e.config.type],i),e.options=e.config.options=i,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=i.tooltips,e.tooltip.initialize()}function f(t){return"top"===t||"bottom"===t}t.types={},t.instances={},t.controllers={},r.extend(t.prototype,{construct:function(i,o){var n=this;o=e(o);var a=h.acquireContext(i,o),s=a&&a.canvas,l=s&&s.height,d=s&&s.width;if(n.id=r.uid(),n.ctx=a,n.canvas=s,n.config=o,n.width=d,n.height=l,n.aspectRatio=l?d/l:null,n.options=o.options,n._bufferedRender=!1,n.chart=n,n.controller=n,t.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}), !a||!s)return void console.error("Failed to create chart: can't acquire context from the given item");n.initialize(),n.update()},initialize:function(){var t=this;return d.notify(t,"beforeInit"),r.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),d.notify(t,"afterInit"),t},clear:function(){return r.canvas.clear(this),this},stop:function(){return n.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,o=e.canvas,n=i.maintainAspectRatio&&e.aspectRatio||null,a=Math.max(0,Math.floor(r.getMaximumWidth(o))),s=Math.max(0,Math.floor(n?a/n:r.getMaximumHeight(o)));if((e.width!==a||e.height!==s)&&(o.width=e.width=a,o.height=e.height=s,o.style.width=a+"px",o.style.height=s+"px",r.retinaScale(e,i.devicePixelRatio),!t)){var l={width:a,height:s};d.notify(e,"resize",[l]),e.options.onResize&&e.options.onResize(e,l),e.stop(),e.update({duration:e.options.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;r.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),r.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,i=t.scales||{},o=[],n=Object.keys(i).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(o=o.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&o.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),r.each(o,function(e){var o=e.options,a=o.id,s=r.valueOrDefault(o.type,e.dtype);f(o.position)!==f(e.dposition)&&(o.position=e.dposition),n[a]=!0;var l=null;if(a in i&&i[a].type===s)l=i[a],l.options=o,l.ctx=t.ctx,l.chart=t;else{var h=u.getScaleConstructor(s);if(!h)return;l=new h({id:a,type:s,options:o,ctx:t.ctx,chart:t}),i[l.id]=l}l.mergeTicksOptions(),e.isDefault&&(t.scale=l)}),r.each(n,function(t,e){t||delete i[e]}),t.scales=i,u.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,i=[],o=[];return r.each(e.data.datasets,function(n,a){var r=e.getDatasetMeta(a),s=n.type||e.config.type;if(r.type&&r.type!==s&&(e.destroyDatasetMeta(a),r=e.getDatasetMeta(a)),r.type=s,i.push(r.type),r.controller)r.controller.updateIndex(a),r.controller.linkScales();else{var l=t.controllers[r.type];if(void 0===l)throw new Error('"'+r.type+'" is not a chart type.');r.controller=new l(e,a),o.push(r.controller)}},e),o},resetElements:function(){var t=this;r.each(t.data.datasets,function(e,i){t.getDatasetMeta(i).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),i(e),d._invalidate(e),!1!==d.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var o=e.buildOrUpdateControllers();r.each(e.data.datasets,function(t,i){e.getDatasetMeta(i).controller.buildOrUpdateElements()},e),e.updateLayout(),e.options.animation&&e.options.animation.duration&&r.each(o,function(t){t.reset()}),e.updateDatasets(),e.tooltip.initialize(),e.lastActive=[],d.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var t=this;!1!==d.notify(t,"beforeLayout")&&(l.update(this,this.width,this.height),d.notify(t,"afterScaleUpdate"),d.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==d.notify(t,"beforeDatasetsUpdate")){for(var e=0,i=t.data.datasets.length;e=0;--i)e.isDatasetVisible(i)&&e.drawDataset(i,t);d.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var i=this,o=i.getDatasetMeta(t),n={meta:o,index:t,easingValue:e};!1!==d.notify(i,"beforeDatasetDraw",[n])&&(o.controller.draw(e),d.notify(i,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this,i=e.tooltip,o={tooltip:i,easingValue:t};!1!==d.notify(e,"beforeTooltipDraw",[o])&&(i.draw(),d.notify(e,"afterTooltipDraw",[o]))},getElementAtEvent:function(t){return s.modes.single(this,t)},getElementsAtEvent:function(t){return s.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return s.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var o=s.modes[e];return"function"==typeof o?o(this,t,i):[]},getDatasetAtEvent:function(t){return s.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,i=e.data.datasets[t];i._meta||(i._meta={});var o=i._meta[e.id];return o||(o=i._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),o},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e0||(n.forEach(function(e){delete t[e]}),delete t._chartjs)}}var n=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},o.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var i=this;i.chart=t,i.index=e,i.linkScales(),i.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&i(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,i=e.dataElementType;return i&&new i({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,i=this,o=i.getMeta(),n=i.getDataset().data||[],a=o.data;for(t=0,e=n.length;to&&t.insertElements(o,n-o)},insertElements:function(t,e){for(var i=0;i=e[t].length&&e[t].push({}),!e[t][n].type||l.type&&l.type!==e[t][n].type?a.merge(e[t][n],[r.getScaleDefaults(s),l]):a.merge(e[t][n],l)}else a._merger(t,e,i,o)}})},a.where=function(t,e){if(a.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return a.each(t,function(t){e(t)&&i.push(t)}),i},a.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var o=0,n=t.length;o=0;o--){var n=t[o];if(e(n))return n}},a.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},a.almostEquals=function(t,e,i){return Math.abs(t-e)t},a.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},a.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},a.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},a.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,i=Math.round(e);return t===Math.pow(10,i)?i:e},a.toRadians=function(t){return t*(Math.PI/180)},a.toDegrees=function(t){return t*(180/Math.PI)},a.getAngleFromPoint=function(t,e){var i=e.x-t.x,o=e.y-t.y,n=Math.sqrt(i*i+o*o),a=Math.atan2(o,i);return a<-.5*Math.PI&&(a+=2*Math.PI),{angle:a,distance:n}},a.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},a.aliasPixel=function(t){return t%2==0?0:.5},a.splineCurve=function(t,e,i,o){var n=t.skip?e:t,a=e,r=i.skip?e:i,s=Math.sqrt(Math.pow(a.x-n.x,2)+Math.pow(a.y-n.y,2)),l=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),h=s/(s+l),d=l/(s+l);h=isNaN(h)?0:h,d=isNaN(d)?0:d;var u=o*h,c=o*d;return{previous:{x:a.x-u*(r.x-n.x),y:a.y-u*(r.y-n.y)},next:{x:a.x+c*(r.x-n.x),y:a.y+c*(r.y-n.y)}}},a.EPSILON=Number.EPSILON||1e-14,a.splineCurveMonotone=function(t){var e,i,o,n,r=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=r.length;for(e=0;e0?r[e-1]:null,(n=e0?r[e-1]:null,n=e=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},a.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},a.niceNum=function(t,e){var i=Math.floor(a.log10(t)),o=t/Math.pow(10,i);return(e?o<1.5?1:o<3?2:o<7?5:10:o<=1?1:o<=2?2:o<=5?5:10)*Math.pow(10,i)},a.requestAnimFrame=function(){return"undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),a.getRelativePosition=function(t,e){var i,o,n=t.originalEvent||t,r=t.target||t.srcElement,s=r.getBoundingClientRect(),l=n.touches;l&&l.length>0?(i=l[0].clientX,o=l[0].clientY):(i=n.clientX,o=n.clientY);var h=parseFloat(a.getStyle(r,"padding-left")),d=parseFloat(a.getStyle(r,"padding-top")),u=parseFloat(a.getStyle(r,"padding-right")),c=parseFloat(a.getStyle(r,"padding-bottom")),f=s.right-s.left-h-u,p=s.bottom-s.top-d-c;return i=Math.round((i-s.left-h)/f*r.width/e.currentDevicePixelRatio),o=Math.round((o-s.top-d)/p*r.height/e.currentDevicePixelRatio),{x:i,y:o}},a.getConstraintWidth=function(t){return i(t,"max-width","clientWidth")},a.getConstraintHeight=function(t){return i(t,"max-height","clientHeight")},a._calculatePadding=function(t,e,i){return e=a.getStyle(t,e),e.indexOf("%")>-1?i/parseInt(e,10):parseInt(e,10)},a._getParentNode=function(t){var e=t.parentNode;return e&&e.host&&(e=e.host),e},a.getMaximumWidth=function(t){var e=a._getParentNode(t);if(!e)return t.clientWidth;var i=e.clientWidth,o=a._calculatePadding(e,"padding-left",i),n=a._calculatePadding(e,"padding-right",i),r=i-o-n,s=a.getConstraintWidth(t);return isNaN(s)?r:Math.min(r,s)},a.getMaximumHeight=function(t){var e=a._getParentNode(t);if(!e)return t.clientHeight;var i=e.clientHeight,o=a._calculatePadding(e,"padding-top",i),n=a._calculatePadding(e,"padding-bottom",i),r=i-o-n,s=a.getConstraintHeight(t);return isNaN(s)?r:Math.min(r,s)},a.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},a.retinaScale=function(t,e){var i=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==i){var o=t.canvas,n=t.height,a=t.width;o.height=n*i,o.width=a*i,t.ctx.scale(i,i),o.style.height||o.style.width||(o.style.height=n+"px",o.style.width=a+"px")}},a.fontString=function(t,e,i){return e+" "+t+"px "+i},a.longestText=function(t,e,i,o){o=o||{};var n=o.data=o.data||{},r=o.garbageCollect=o.garbageCollect||[];o.font!==e&&(n=o.data={},r=o.garbageCollect=[],o.font=e),t.font=e;var s=0;a.each(i,function(e){void 0!==e&&null!==e&&!0!==a.isArray(e)?s=a.measureText(t,n,r,s,e):a.isArray(e)&&a.each(e,function(e){void 0===e||null===e||a.isArray(e)||(s=a.measureText(t,n,r,s,e))})});var l=r.length/2;if(l>i.length){for(var h=0;ho&&(o=a),o},a.numberOfLabelLines=function(t){var e=1;return a.each(t,function(t){a.isArray(t)&&t.length>e&&(e=t.length)}),e},a.color=o?function(t){return t instanceof CanvasGradient&&(t=n.global.defaultColor),o(t)}:function(t){return console.error("Color.js not found!"),t},a.getHoverColor=function(t){return t instanceof CanvasPattern?t:a.color(t).saturate(.5).darken(.1).rgbString()}}},{26:26,3:3,34:34,46:46}],29:[function(t,e,i){"use strict";function o(t,e){return t.native?{x:t.x,y:t.y}:h.getRelativePosition(t,e)}function n(t,e){var i,o,n,a,r,s=t.data.datasets;for(o=0,a=s.length;o0&&(h=t.getDatasetMeta(h[0]._datasetIndex).data),h},"x-axis":function(t,e){return l(t,e,{intersect:!1})},point:function(t,e){return a(t,o(e,t))},nearest:function(t,e,i){var n=o(e,t);i.axis=i.axis||"xy";var a=s(i.axis),l=r(t,n,i.intersect,a);return l.length>1&&l.sort(function(t,e){var i=t.getArea(),o=e.getArea(),n=i-o;return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),l.slice(0,1)},x:function(t,e,i){var a=o(e,t),r=[],s=!1;return n(t,function(t){t.inXRange(a.x)&&r.push(t),t.inRange(a.x,a.y)&&(s=!0)}),i.intersect&&!s&&(r=[]),r},y:function(t,e,i){var a=o(e,t),r=[],s=!1;return n(t,function(t){t.inYRange(a.y)&&r.push(t),t.inRange(a.x,a.y)&&(s=!0)}),i.intersect&&!s&&(r=[]),r}}}},{46:46}],30:[function(t,e,i){"use strict";t(26)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{26:26}],31:[function(t,e,i){"use strict";function o(t,e){return a.where(t,function(t){return t.position===e})}function n(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,i){var o=e?i:t,n=e?t:i;return o.weight===n.weight?o._tmpIndex_-n._tmpIndex_:o.weight-n.weight}),t.forEach(function(t){delete t._tmpIndex_})}var a=t(46);e.exports={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var o,n=["fullWidth","position","weight"],a=n.length,r=0;rc&&st.maxHeight){s--;break}s++,u=l*h}t.labelRotation=s},afterCalculateTickRotation:function(){d.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){d.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},i=o(t._ticks),n=t.options,l=n.ticks,h=n.scaleLabel,u=n.gridLines,c=n.display,f=t.isHorizontal(),p=r(l),g=n.gridLines.tickMarkLength;if(e.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:c&&u.drawTicks?g:0,e.height=f?c&&u.drawTicks?g:0:t.maxHeight,h.display&&c){var m=s(h),v=d.options.toPadding(h.padding),b=m+v.height;f?e.height+=b:e.width+=b}if(l.display&&c){var y=d.longestText(t.ctx,p.font,i,t.longestTextCache),x=d.numberOfLabelLines(i),w=.5*p.size,_=t.options.ticks.padding;if(f){t.longestLabelWidth=y;var k=d.toRadians(t.labelRotation),C=Math.cos(k),D=Math.sin(k),M=D*y+p.size*x+w*(x-1)+w;e.height=Math.min(t.maxHeight,e.height+M+_),t.ctx.font=p.font;var S=a(t.ctx,i[0],p.font),T=a(t.ctx,i[i.length-1],p.font);0!==t.labelRotation?(t.paddingLeft="bottom"===n.position?C*S+3:C*w+3,t.paddingRight="bottom"===n.position?C*w+3:C*T+3):(t.paddingLeft=S/2+3,t.paddingRight=T/2+3)}else l.mirror?y=0:y+=_+w,e.width=Math.min(t.maxWidth,e.width+y),t.paddingTop=p.size/2,t.paddingBottom=p.size/2}t.handleMargins(),t.width=e.width,t.height=e.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){d.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(d.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:d.noop,getPixelForValue:d.noop,getValueForPixel:d.noop,getPixelForTick:function(t){var e=this,i=e.options.offset;if(e.isHorizontal()){var o=e.width-(e.paddingLeft+e.paddingRight),n=o/Math.max(e._ticks.length-(i?0:1),1),a=n*t+e.paddingLeft;i&&(a+=n/2);var r=e.left+Math.round(a);return r+=e.isFullWidth()?e.margins.left:0}var s=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(s/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var i=e.width-(e.paddingLeft+e.paddingRight),o=i*t+e.paddingLeft,n=e.left+Math.round(o);return n+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,i=t.max;return t.beginAtZero?0:e<0&&i<0?i:e>0&&i>0?e:0},_autoSkip:function(t){var e,i,o,n,a,r=this,s=r.isHorizontal(),l=r.options.ticks.minor,h=t.length,u=d.toRadians(r.labelRotation),c=Math.cos(u),f=r.longestLabelWidth*c,p=[];for(l.maxTicksLimit&&(a=l.maxTicksLimit),s&&(e=!1,(f+l.autoSkipPadding)*h>r.width-(r.paddingLeft+r.paddingRight)&&(e=1+Math.floor((f+l.autoSkipPadding)*h/(r.width-(r.paddingLeft+r.paddingRight)))),a&&h>a&&(e=Math.max(e,Math.floor(h/a)))),i=0;i1&&i%e>0||i%e==0&&i+e>=h,n&&i!==h-1&&delete o.label,p.push(o);return p},draw:function(t){var e=this,i=e.options;if(i.display){var o=e.ctx,a=l.global,h=i.ticks.minor,u=i.ticks.major||h,c=i.gridLines,f=i.scaleLabel,p=0!==e.labelRotation,g=e.isHorizontal(),m=h.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),v=d.valueOrDefault(h.fontColor,a.defaultFontColor),b=r(h),y=d.valueOrDefault(u.fontColor,a.defaultFontColor),x=r(u),w=c.drawTicks?c.tickMarkLength:0,_=d.valueOrDefault(f.fontColor,a.defaultFontColor),k=r(f),C=d.options.toPadding(f.padding),D=d.toRadians(e.labelRotation),M=[],S=e.options.gridLines.lineWidth,T="right"===i.position?e.left:e.right-S-w,I="right"===i.position?e.left+w:e.right,A="bottom"===i.position?e.top+S:e.bottom-w-S,P="bottom"===i.position?e.top+S+w:e.bottom+S;if(d.each(m,function(o,r){if(!d.isNullOrUndef(o.label)){var s,l,u,f,v=o.label;r===e.zeroLineIndex&&i.offset===c.offsetGridLines?(s=c.zeroLineWidth,l=c.zeroLineColor,u=c.zeroLineBorderDash,f=c.zeroLineBorderDashOffset):(s=d.valueAtIndexOrDefault(c.lineWidth,r),l=d.valueAtIndexOrDefault(c.color,r),u=d.valueOrDefault(c.borderDash,a.borderDash),f=d.valueOrDefault(c.borderDashOffset,a.borderDashOffset));var b,y,x,_,k,C,F,O,E,L,R="middle",z="middle",B=h.padding;if(g){var N=w+B;"bottom"===i.position?(z=p?"middle":"top",R=p?"right":"center",L=e.top+N):(z=p?"middle":"bottom",R=p?"left":"center",L=e.bottom-N);var W=n(e,r,c.offsetGridLines&&m.length>1);W1);U3?i[2]-i[1]:i[1]-i[0];Math.abs(n)>1&&t!==Math.floor(t)&&(n=t-Math.floor(t));var a=o.log10(Math.abs(n)),r="";if(0!==t){if(Math.max(Math.abs(i[0]),Math.abs(i[i.length-1]))<1e-4){var s=o.log10(Math.abs(t));r=t.toExponential(Math.floor(s)-Math.floor(a))}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}}else r="0";return r},logarithmic:function(t,e,i){var n=t/Math.pow(10,Math.floor(o.log10(t)));return 0===t?"0":1===n||2===n||5===n||0===e||e===i.length-1?t.toExponential():""}}}},{46:46}],36:[function(t,e,i){"use strict";function o(t,e){var i=p.color(t);return i.alpha(e*i.alpha()).rgbaString()}function n(t,e){return e&&(p.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function a(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function r(t){var e=t._xScale,i=t._yScale||t._scale,o=t._index,n=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(o,n):"",yLabel:i?i.getLabelForIndex(o,n):"",index:o,datasetIndex:n,x:t._model.x,y:t._model.y}}function s(t){var e=c.global,i=p.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:i(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:i(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:i(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:i(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:i(t.titleFontStyle,e.defaultFontStyle),titleFontSize:i(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:i(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:i(t.footerFontStyle,e.defaultFontStyle),footerFontSize:i(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function l(t,e){var i=t._chart.ctx,o=2*e.yPadding,n=0,a=e.body,r=a.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);r+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,h=e.titleFontSize,d=e.bodyFontSize,u=e.footerFontSize;o+=s*h,o+=s?(s-1)*e.titleSpacing:0,o+=s?e.titleMarginBottom:0,o+=r*d,o+=r?(r-1)*e.bodySpacing:0,o+=l?e.footerMarginTop:0,o+=l*u,o+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){n=Math.max(n,i.measureText(t).width+c)};return i.font=p.fontString(h,e._titleFontStyle,e._titleFontFamily),p.each(e.title,f),i.font=p.fontString(d,e._bodyFontStyle,e._bodyFontFamily),p.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,p.each(a,function(t){p.each(t.before,f),p.each(t.lines,f),p.each(t.after,f)}),c=0,i.font=p.fontString(u,e._footerFontStyle,e._footerFontFamily),p.each(e.footer,f),n+=2*e.xPadding,{width:n,height:o}}function h(t,e){var i=t._model,o=t._chart,n=t._chart.chartArea,a="center",r="center";i.yo.height-e.height&&(r="bottom");var s,l,h,d,u,c=(n.left+n.right)/2,f=(n.top+n.bottom)/2;"center"===r?(s=function(t){return t<=c},l=function(t){return t>c}):(s=function(t){return t<=e.width/2},l=function(t){return t>=o.width-e.width/2}),h=function(t){return t+e.width+i.caretSize+i.caretPadding>o.width},d=function(t){return t-e.width-i.caretSize-i.caretPadding<0},u=function(t){return t<=f?"top":"bottom"},s(i.x)?(a="left",h(i.x)&&(a="center",r=u(i.y))):l(i.x)&&(a="right",d(i.x)&&(a="center",r=u(i.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:a,yAlign:p.yAlign?p.yAlign:r}}function d(t,e,i,o){var n=t.x,a=t.y,r=t.caretSize,s=t.caretPadding,l=t.cornerRadius,h=i.xAlign,d=i.yAlign,u=r+s,c=l+s;return"right"===h?n-=e.width:"center"===h&&(n-=e.width/2,n+e.width>o.width&&(n=o.width-e.width),n<0&&(n=0)),"top"===d?a+=u:a-="bottom"===d?e.height+u:e.height/2,"center"===d?"left"===h?n+=u:"right"===h&&(n-=u):"left"===h?n-=c:"right"===h&&(n+=c),{x:n,y:a}}function u(t){return n([],a(t))}var c=t(26),f=t(27),p=t(46);c._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:p.noop,title:function(t,e){var i="",o=e.labels,n=o?o.length:0;if(t.length>0){var a=t[0];a.xLabel?i=a.xLabel:n>0&&a.index0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},o={x:e.x,y:e.y},n=Math.abs(e.opacity<.001)?0:e.opacity,a=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&a&&(this.drawBackground(o,e,t,i,n),o.x+=e.xPadding,o.y+=e.yPadding,this.drawTitle(o,e,t,n),this.drawBody(o,e,t,n),this.drawFooter(o,e,t,n))}},handleEvent:function(t){var e=this,i=e._options,o=!1;return e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,i.mode,i),o=!p.arrayEquals(e._active,e._lastActive),o&&(e._lastActive=e._active,(i.enabled||i.custom)&&(e._eventPosition={x:t.x,y:t.y},e.update(!0),e.pivot())),o}})).positioners=g},{26:26,27:27,46:46}],37:[function(t,e,i){"use strict";var o=t(26),n=t(27),a=t(46);o._set("global",{elements:{arc:{backgroundColor:o.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=n.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)l;)n-=2*Math.PI;for(;n=s&&n<=l,d=r>=i.innerRadius&&r<=i.outerRadius;return h&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view,i=e.startAngle,o=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,i,o),t.arc(e.x,e.y,e.innerRadius,o,i,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})},{26:26,27:27,46:46}],38:[function(t,e,i){"use strict";var o=t(26),n=t(27),a=t(46),r=o.global;o._set("global",{elements:{line:{tension:.4,backgroundColor:r.defaultColor,borderWidth:3,borderColor:r.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=n.extend({draw:function(){var t,e,i,o,n=this,s=n._view,l=n._chart.ctx,h=s.spanGaps,d=n._children.slice(),u=r.elements.line,c=-1;for(n._loop&&d.length&&d.push(d[0]),l.save(),l.lineCap=s.borderCapStyle||u.borderCapStyle,l.setLineDash&&l.setLineDash(s.borderDash||u.borderDash),l.lineDashOffset=s.borderDashOffset||u.borderDashOffset,l.lineJoin=s.borderJoinStyle||u.borderJoinStyle,l.lineWidth=s.borderWidth||u.borderWidth,l.strokeStyle=s.borderColor||r.defaultColor,l.beginPath(),c=-1,t=0;t=t.left&&1.01*t.right>=i.x&&i.y>=t.top&&1.01*t.bottom>=i.y)&&(o.strokeStyle=e.borderColor||l,o.lineWidth=s.valueOrDefault(e.borderWidth,a.global.elements.point.borderWidth),o.fillStyle=e.backgroundColor||l,s.canvas.drawPoint(o,n,h,d,u,r))}})},{26:26,27:27,46:46}],40:[function(t,e,i){"use strict";function o(t){return void 0!==t._view.width}function n(t){var e,i,n,a,r=t._view;if(o(t)){var s=r.width/2;e=r.x-s,i=r.x+s,n=Math.min(r.y,r.base),a=Math.max(r.y,r.base)}else{var l=r.height/2;e=Math.min(r.x,r.base),i=Math.max(r.x,r.base),n=r.y-l,a=r.y+l}return{left:e,top:n,right:i,bottom:a}}var a=t(26),r=t(27);a._set("global",{elements:{rectangle:{backgroundColor:a.global.defaultColor,borderColor:a.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=r.extend({draw:function(){function t(t){return v[(y+t)%4]}var e,i,o,n,a,r,s,l=this._chart.ctx,h=this._view,d=h.borderWidth;if(h.horizontal?(e=h.base,i=h.x,o=h.y-h.height/2,n=h.y+h.height/2,a=i>e?1:-1,r=1,s=h.borderSkipped||"left"):(e=h.x-h.width/2,i=h.x+h.width/2,o=h.y,n=h.base,a=1,r=n>o?1:-1,s=h.borderSkipped||"bottom"),d){var u=Math.min(Math.abs(e-i),Math.abs(o-n));d=d>u?u:d;var c=d/2,f=e+("left"!==s?c*a:0),p=i+("right"!==s?-c*a:0),g=o+("top"!==s?c*r:0),m=n+("bottom"!==s?-c*r:0);f!==p&&(o=g,n=m),g!==m&&(e=f,i=p)}l.beginPath(),l.fillStyle=h.backgroundColor,l.strokeStyle=h.borderColor,l.lineWidth=d;var v=[[e,n],[e,o],[i,o],[i,n]],b=["bottom","left","top","right"],y=b.indexOf(s,0);-1===y&&(y=0);var x=t(0);l.moveTo(x[0],x[1]);for(var w=1;w<4;w++)x=t(w),l.lineTo(x[0],x[1]);l.fill(),d&&l.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=!1;if(this._view){var o=n(this);i=t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom}return i},inLabelRange:function(t,e){var i=this;if(!i._view)return!1;var a=n(i);return o(i)?t>=a.left&&t<=a.right:e>=a.top&&e<=a.bottom},inXRange:function(t){var e=n(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=n(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,i=this._view;return o(this)?(t=i.x,e=(i.y+i.base)/2):(t=(i.x+i.base)/2,e=i.y),{x:t,y:e}},getArea:function(){var t=this._view;return t.width*Math.abs(t.y-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})},{26:26,27:27}],41:[function(t,e,i){"use strict";e.exports={},e.exports.Arc=t(37),e.exports.Line=t(38),e.exports.Point=t(39),e.exports.Rectangle=t(40)},{37:37,38:38,39:39,40:40}],42:[function(t,e,i){"use strict";var o=t(43),i=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,o,n,a){if(a){var r=Math.min(a,n/2-1e-7,o/2-1e-7);t.moveTo(e+r,i),t.lineTo(e+o-r,i),t.arcTo(e+o,i,e+o,i+r,r),t.lineTo(e+o,i+n-r),t.arcTo(e+o,i+n,e+o-r,i+n,r),t.lineTo(e+r,i+n),t.arcTo(e,i+n,e,i+n-r,r),t.lineTo(e,i+r),t.arcTo(e,i,e+r,i,r),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,o,n)},drawPoint:function(t,e,i,o,n,a){var r,s,l,h,d,u;if(a=a||0,e&&"object"==typeof e&&("[object HTMLImageElement]"===(r=e.toString())||"[object HTMLCanvasElement]"===r))return void t.drawImage(e,o-e.width/2,n-e.height/2,e.width,e.height);if(!(isNaN(i)||i<=0)){switch(t.save(),t.translate(o,n),t.rotate(a*Math.PI/180),t.beginPath(),e){default:t.arc(0,0,i,0,2*Math.PI),t.closePath();break;case"triangle":s=3*i/Math.sqrt(3),d=s*Math.sqrt(3)/2,t.moveTo(-s/2,d/3),t.lineTo(s/2,d/3),t.lineTo(0,-2*d/3),t.closePath();break;case"rect":u=1/Math.SQRT2*i,t.rect(-u,-u,2*u,2*u);break;case"rectRounded":var c=i/Math.SQRT2,f=-c,p=-c,g=Math.SQRT2*i;this.roundedRect(t,f,p,g,g,.425*i);break;case"rectRot":u=1/Math.SQRT2*i,t.moveTo(-u,0),t.lineTo(0,u),t.lineTo(u,0),t.lineTo(0,-u),t.closePath();break;case"cross":t.moveTo(0,i),t.lineTo(0,-i),t.moveTo(-i,0),t.lineTo(i,0);break;case"crossRot":l=Math.cos(Math.PI/4)*i,h=Math.sin(Math.PI/4)*i,t.moveTo(-l,-h),t.lineTo(l,h),t.moveTo(-l,h),t.lineTo(l,-h);break;case"star":t.moveTo(0,i),t.lineTo(0,-i),t.moveTo(-i,0),t.lineTo(i,0),l=Math.cos(Math.PI/4)*i,h=Math.sin(Math.PI/4)*i,t.moveTo(-l,-h),t.lineTo(l,h),t.moveTo(-l,h),t.lineTo(l,-h);break;case"line":t.moveTo(-i,0),t.lineTo(i,0);break;case"dash":t.moveTo(0,0),t.lineTo(i,0)}t.fill(),t.stroke(),t.restore()}},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,i,o){return i.steppedLine?("after"===i.steppedLine&&!o||"after"!==i.steppedLine&&o?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y),void t.lineTo(i.x,i.y)):i.tension?void t.bezierCurveTo(o?e.controlPointPreviousX:e.controlPointNextX,o?e.controlPointPreviousY:e.controlPointNextY,o?i.controlPointNextX:i.controlPointPreviousX,o?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):void t.lineTo(i.x,i.y)}};o.clear=i.clear,o.drawRoundedRectangle=function(t){t.beginPath(),i.roundedRect.apply(i,arguments)}},{43:43}],43:[function(t,e,i){"use strict";var o={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||void 0===t},isArray:Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,i){return o.valueOrDefault(o.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var a,r,s;if(o.isArray(t))if(r=t.length,n)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,o=1;return 0===t?0:1===t?1:(i||(i=.3),o<1?(o=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/o),-o*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,o=1;return 0===t?0:1===t?1:(i||(i=.3),o<1?(o=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/o),o*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,o=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),o<1?(o=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/o),t<1?o*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:o*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)}, easeInBounce:function(t){return 1-n.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*n.easeInBounce(2*t):.5*n.easeOutBounce(2*t-1)+.5}};e.exports={effects:n},o.easingEffects=n},{43:43}],45:[function(t,e,i){"use strict";var o=t(43);e.exports={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,n,a;return o.isObject(t)?(e=+t.top||0,i=+t.right||0,n=+t.bottom||0,a=+t.left||0):e=i=n=a=+t||0,{top:e,right:i,bottom:n,left:a,height:e+n,width:a+i}},resolve:function(t,e,i){var n,a,r;for(n=0,a=t.length;n
';var n=e.childNodes[0],r=e.childNodes[1];e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,r.scrollLeft=1e6,r.scrollTop=1e6};var s=function(){e._reset(),t()};return a(n,"scroll",s.bind(n,"expand")),a(r,"scroll",s.bind(r,"shrink")),e}function u(t,e){var i=t[v]||(t[v]={}),o=i.renderProxy=function(t){t.animationName===x&&e()};m.each(w,function(e){a(t,e,o)}),i.reflow=!!t.offsetParent,t.classList.add(y)}function c(t){var e=t[v]||{},i=e.renderProxy;i&&(m.each(w,function(e){r(t,e,i)}),delete e.renderProxy),t.classList.remove(y)}function f(t,e,i){var o=t[v]||(t[v]={}),n=o.resizer=d(h(function(){if(o.resizer)return e(s("resize",i))}));u(t,function(){if(o.resizer){var e=t.parentNode;e&&e!==n.parentNode&&e.insertBefore(n,e.firstChild),n._reset()}})}function p(t){var e=t[v]||{},i=e.resizer;delete e.resizer,c(t),i&&i.parentNode&&i.parentNode.removeChild(i)}function g(t,e){var i=t._style||document.createElement("style");t._style||(t._style=i,e="/* Chart.js */\n"+e,i.setAttribute("type","text/css"),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(e))}var m=t(46),v="$chartjs",b="chartjs-",y=b+"render-monitor",x=b+"render-animation",w=["animationstart","webkitAnimationStart"],_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},k=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}(),C=!!k&&{passive:!0};e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t="from{opacity:0.99}to{opacity:1}";g(this,"@-webkit-keyframes "+x+"{"+t+"}@keyframes "+x+"{"+t+"}."+y+"{-webkit-animation:"+x+" 0.001s;animation:"+x+" 0.001s;}")},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(n(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[v]){var i=e[v].initial;["height","width"].forEach(function(t){var o=i[t];m.isNullOrUndef(o)?e.removeAttribute(t):e.setAttribute(t,o)}),m.each(i.style||{},function(t,i){e.style[i]=t}),e.width=e.width,delete e[v]}},addEventListener:function(t,e,i){var o=t.canvas;if("resize"===e)return void f(o,i,t);var n=i[v]||(i[v]={});a(o,e,(n.proxies||(n.proxies={}))[t.id+"_"+e]=function(e){i(l(e,t))})},removeEventListener:function(t,e,i){var o=t.canvas;if("resize"===e)return void p(o);var n=i[v]||{},a=n.proxies||{},s=a[t.id+"_"+e];s&&r(o,e,s)}},m.addEvent=a,m.removeEvent=r},{46:46}],49:[function(t,e,i){"use strict";var o=t(46),n=t(47),a=t(48),r=a._enabled?a:n;e.exports=o.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},r)},{46:46,47:47,48:48}],50:[function(t,e,i){"use strict";e.exports={},e.exports.filler=t(51),e.exports.legend=t(52),e.exports.title=t(53)},{51:51,52:52,53:53}],51:[function(t,e,i){"use strict";function o(t,e,i){var o,n=t._model||{},a=n.fill;if(void 0===a&&(a=!!n.backgroundColor),!1===a||null===a)return!1;if(!0===a)return"origin";if(o=parseFloat(a,10),isFinite(o)&&Math.floor(o)===o)return"-"!==a[0]&&"+"!==a[0]||(o=e+o),!(o===e||o<0||o>=i)&&o;switch(a){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return a;default:return!1}}function n(t){var e,i=t.el._model||{},o=t.el._scale||{},n=t.fill,a=null;if(isFinite(n))return null;if("start"===n?a=void 0===i.scaleBottom?o.bottom:i.scaleBottom:"end"===n?a=void 0===i.scaleTop?o.top:i.scaleTop:void 0!==i.scaleZero?a=i.scaleZero:o.getBasePosition?a=o.getBasePosition():o.getBasePixel&&(a=o.getBasePixel()),void 0!==a&&null!==a){if(void 0!==a.x&&void 0!==a.y)return a;if("number"==typeof a&&isFinite(a))return e=o.isHorizontal(),{x:e?a:null,y:e?null:a}}return null}function a(t,e,i){var o,n=t[e],a=n.fill,r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(o=t[a]))return!1;if(o.visible)return a;r.push(a),a=o.fill}return!1}function r(t){var e=t.fill,i="dataset";return!1===e?null:(isFinite(e)||(i="boundary"),f[i](t))}function s(t){return t&&!t.skip}function l(t,e,i,o,n){var a;if(o&&n){for(t.moveTo(e[0].x,e[0].y),a=1;a0;--a)c.canvas.lineTo(t,i[a],i[a-1],!0)}}function h(t,e,i,o,n,a){var r,h,d,u,c,f,p,g=e.length,m=o.spanGaps,v=[],b=[],y=0,x=0;for(t.beginPath(),r=0,h=g+!!a;r');for(var i=0;i'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("");return e.push(""),e.join("")}});var d=r.extend({initialize:function(t){s.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:h,update:function(t,e,i){var o=this;return o.beforeUpdate(),o.maxWidth=t,o.maxHeight=e,o.margins=i,o.beforeSetDimensions(),o.setDimensions(),o.afterSetDimensions(),o.beforeBuildLabels(),o.buildLabels(),o.afterBuildLabels(),o.beforeFit(),o.fit(),o.afterFit(),o.afterUpdate(),o.minSize},afterUpdate:h,beforeSetDimensions:h,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:h,beforeBuildLabels:h,buildLabels:function(){var t=this,e=t.options.labels||{},i=s.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter(function(i){return e.filter(i,t.chart.data)})),t.options.reverse&&i.reverse(),t.legendItems=i},afterBuildLabels:h,beforeFit:h,fit:function(){var t=this,e=t.options,i=e.labels,n=e.display,r=t.ctx,l=a.global,h=s.valueOrDefault,d=h(i.fontSize,l.defaultFontSize),u=h(i.fontStyle,l.defaultFontStyle),c=h(i.fontFamily,l.defaultFontFamily),f=s.fontString(d,u,c),p=t.legendHitBoxes=[],g=t.minSize,m=t.isHorizontal();if(m?(g.width=t.maxWidth,g.height=n?10:0):(g.width=n?10:0,g.height=t.maxHeight),n)if(r.font=f,m){var v=t.lineWidths=[0],b=t.legendItems.length?d+i.padding:0;r.textAlign="left",r.textBaseline="top",s.each(t.legendItems,function(e,n){var a=o(i,d),s=a+d/2+r.measureText(e.text).width;v[v.length-1]+s+i.padding>=t.width&&(b+=d+i.padding,v[v.length]=t.left),p[n]={left:0,top:0,width:s,height:d},v[v.length-1]+=s+i.padding}),g.height+=b}else{var y=i.padding,x=t.columnWidths=[],w=i.padding,_=0,k=0,C=d+y;s.each(t.legendItems,function(t,e){var n=o(i,d),a=n+d/2+r.measureText(t.text).width;k+C>g.height&&(w+=_+i.padding,x.push(_),_=0,k=0),_=Math.max(_,a),k+=C,p[e]={left:0,top:0,width:a,height:d}}),w+=_,x.push(_),g.width+=w}t.width=g.width,t.height=g.height},afterFit:h,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,n=a.global,r=n.elements.line,l=t.width,h=t.lineWidths;if(e.display){var d,u=t.ctx,c=s.valueOrDefault,f=c(i.fontColor,n.defaultFontColor),p=c(i.fontSize,n.defaultFontSize),g=c(i.fontStyle,n.defaultFontStyle),m=c(i.fontFamily,n.defaultFontFamily),v=s.fontString(p,g,m);u.textAlign="left",u.textBaseline="middle",u.lineWidth=.5,u.strokeStyle=f,u.fillStyle=f,u.font=v;var b=o(i,p),y=t.legendHitBoxes,x=function(t,i,o){if(!(isNaN(b)||b<=0)){u.save(),u.fillStyle=c(o.fillStyle,n.defaultColor),u.lineCap=c(o.lineCap,r.borderCapStyle),u.lineDashOffset=c(o.lineDashOffset,r.borderDashOffset),u.lineJoin=c(o.lineJoin,r.borderJoinStyle),u.lineWidth=c(o.lineWidth,r.borderWidth),u.strokeStyle=c(o.strokeStyle,n.defaultColor);var a=0===c(o.lineWidth,r.borderWidth);if(u.setLineDash&&u.setLineDash(c(o.lineDash,r.borderDash)),e.labels&&e.labels.usePointStyle){var l=p*Math.SQRT2/2,h=l/Math.SQRT2,d=t+h,f=i+h;s.canvas.drawPoint(u,o.pointStyle,l,d,f)}else a||u.strokeRect(t,i,b,p),u.fillRect(t,i,b,p);u.restore()}},w=function(t,e,i,o){var n=p/2,a=b+n+t,r=e+n;u.fillText(i.text,a,r),i.hidden&&(u.beginPath(),u.lineWidth=2,u.moveTo(a,r),u.lineTo(a+o,r),u.stroke())},_=t.isHorizontal();d=_?{x:t.left+(l-h[0])/2,y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+i.padding,line:0};var k=p+i.padding;s.each(t.legendItems,function(e,o){var n=u.measureText(e.text).width,a=b+p/2+n,r=d.x,s=d.y;_?r+a>=l&&(s=d.y+=k,d.line++,r=d.x=t.left+(l-h[d.line])/2):s+k>t.bottom&&(r=d.x=r+t.columnWidths[d.line]+i.padding,s=d.y=t.top+i.padding,d.line++),x(r,s,e),y[o].left=r,y[o].top=s,w(r,s,e,n),_?d.x+=a+i.padding:d.y+=k})}},handleEvent:function(t){var e=this,i=e.options,o="mouseup"===t.type?"click":t.type,n=!1;if("mousemove"===o){if(!i.onHover)return}else{if("click"!==o)return;if(!i.onClick)return}var a=t.x,r=t.y;if(a>=e.left&&a<=e.right&&r>=e.top&&r<=e.bottom)for(var s=e.legendHitBoxes,l=0;l=h.left&&a<=h.left+h.width&&r>=h.top&&r<=h.top+h.height){if("click"===o){i.onClick.call(e,t.native,e.legendItems[l]),n=!0;break}if("mousemove"===o){i.onHover.call(e,t.native,e.legendItems[l]),n=!0;break}}}return n}});e.exports={id:"legend",_element:d,beforeInit:function(t){var e=t.options.legend;e&&n(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(s.mergeIf(e,a.global.legend),i?(l.configure(t,i,e),i.options=e):n(t,e)):i&&(l.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}}},{26:26,27:27,31:31,46:46}],53:[function(t,e,i){"use strict";function o(t,e){var i=new h({ctx:t.ctx,options:e,chart:t});s.configure(t,i,e),s.addBox(t,i),t.titleBlock=i}var n=t(26),a=t(27),r=t(46),s=t(31),l=r.noop;n._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}});var h=a.extend({initialize:function(t){var e=this;r.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:l,update:function(t,e,i){var o=this;return o.beforeUpdate(),o.maxWidth=t,o.maxHeight=e,o.margins=i,o.beforeSetDimensions(),o.setDimensions(),o.afterSetDimensions(),o.beforeBuildLabels(),o.buildLabels(),o.afterBuildLabels(),o.beforeFit(),o.fit(),o.afterFit(),o.afterUpdate(),o.minSize},afterUpdate:l,beforeSetDimensions:l,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:l,beforeBuildLabels:l,buildLabels:l,afterBuildLabels:l,beforeFit:l,fit:function(){var t=this,e=r.valueOrDefault,i=t.options,o=i.display,a=e(i.fontSize,n.global.defaultFontSize),s=t.minSize,l=r.isArray(i.text)?i.text.length:1,h=r.options.toLineHeight(i.lineHeight,a),d=o?l*h+2*i.padding:0;t.isHorizontal()?(s.width=t.maxWidth,s.height=d):(s.width=d,s.height=t.maxHeight),t.width=s.width,t.height=s.height},afterFit:l,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=r.valueOrDefault,o=t.options,a=n.global;if(o.display){var s,l,h,d=i(o.fontSize,a.defaultFontSize),u=i(o.fontStyle,a.defaultFontStyle),c=i(o.fontFamily,a.defaultFontFamily),f=r.fontString(d,u,c),p=r.options.toLineHeight(o.lineHeight,d),g=p/2+o.padding,m=0,v=t.top,b=t.left,y=t.bottom,x=t.right;e.fillStyle=i(o.fontColor,a.defaultFontColor),e.font=f,t.isHorizontal()?(l=b+(x-b)/2,h=v+g,s=x-b):(l="left"===o.position?b+g:x-g,h=v+(y-v)/2,s=y-v,m=Math.PI*("left"===o.position?-.5:.5)),e.save(),e.translate(l,h),e.rotate(m),e.textAlign="center",e.textBaseline="middle";var w=o.text;if(r.isArray(w))for(var _=0,k=0;ke.max&&(e.max=o))})});e.min=isFinite(e.min)&&!isNaN(e.min)?e.min:0,e.max=isFinite(e.max)&&!isNaN(e.max)?e.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this,i=e.options.ticks;if(e.isHorizontal())t=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(e.width/50));else{var a=n.valueOrDefault(i.fontSize,o.global.defaultFontSize);t=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(e.height/(2*a)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this,i=e.start,o=+e.getRightValue(t),n=e.end-i;return e.isHorizontal()?e.left+e.width/n*(o-i):e.bottom-e.height/n*(o-i)},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),o=i?e.width:e.height,n=(i?t-e.left:e.bottom-t)/o;return e.start+(e.end-e.start)*n},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});a.registerScaleType("linear",i,e)}},{26:26,34:34,35:35,46:46}],56:[function(t,e,i){"use strict";function o(t,e){var i,o,a,r=[];if(t.stepSize&&t.stepSize>0)a=t.stepSize;else{var s=n.niceNum(e.max-e.min,!1);a=n.niceNum(s/(t.maxTicks-1),!0),o=t.precision,void 0!==o&&(i=Math.pow(10,o),a=Math.ceil(a*i)/i)}var l=Math.floor(e.min/a)*a,h=Math.ceil(e.max/a)*a;n.isNullOrUndef(t.min)||n.isNullOrUndef(t.max)||!t.stepSize||n.almostWhole((t.max-t.min)/t.stepSize,a/1e3)&&(l=t.min,h=t.max);var d=(h-l)/a;d=n.almostEquals(d,Math.round(d),a/1e3)?Math.round(d):Math.ceil(d),o=1,a<1&&(o=Math.pow(10,1-Math.floor(n.log10(a))),l=Math.round(l*o)/o,h=Math.round(h*o)/o),r.push(void 0!==t.min?t.min:l);for(var u=1;u0&&a>0&&(t.min=0)}var r=void 0!==i.min||void 0!==i.suggestedMin,s=void 0!==i.max||void 0!==i.suggestedMax;void 0!==i.min?t.min=i.min:void 0!==i.suggestedMin&&(null===t.min?t.min=i.suggestedMin:t.min=Math.min(t.min,i.suggestedMin)),void 0!==i.max?t.max=i.max:void 0!==i.suggestedMax&&(null===t.max?t.max=i.suggestedMax:t.max=Math.max(t.max,i.suggestedMax)),r!==s&&t.min>=t.max&&(r?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,i.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options,i=e.ticks,a=t.getTickLimit();a=Math.max(2,a);var r={maxTicks:a,min:i.min,max:i.max,precision:i.precision,stepSize:n.valueOrDefault(i.fixedStepSize,i.stepSize)},s=t.ticks=o(r,t);t.handleDirectionalChanges(),t.max=n.max(s),t.min=n.min(s),i.reverse?(s.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),a.prototype.convertTicksToLabels.call(t)}})}},{33:33,46:46}],57:[function(t,e,i){"use strict";function o(t,e){var i,o,a=[],r=n.valueOrDefault,s=r(t.min,Math.pow(10,Math.floor(n.log10(e.min)))),l=Math.floor(n.log10(e.max)),h=Math.ceil(e.max/Math.pow(10,l));0===s?(i=Math.floor(n.log10(e.minNotZero)),o=Math.floor(e.minNotZero/Math.pow(10,i)),a.push(s),s=o*Math.pow(10,i)):(i=Math.floor(n.log10(s)),o=Math.floor(s/Math.pow(10,i)));var d=i<0?Math.pow(10,Math.abs(i)):1;do{a.push(s),++o,10===o&&(o=1,++i,d=i>=0?1:d),s=Math.round(o*Math.pow(10,i)*d)/d}while(i0){var i=n.min(t),o=n.max(t);e.min=null===e.min?i:Math.min(e.min,i),e.max=null===e.max?o:Math.max(e.max,o)}})}else n.each(r,function(i,a){var r=o.getDatasetMeta(a);o.isDatasetVisible(a)&&t(r)&&n.each(i.data,function(t,i){var o=+e.getRightValue(t);isNaN(o)||r.data[i].hidden||o<0||(null===e.min?e.min=o:oe.max&&(e.max=o),0!==o&&(null===e.minNotZero||o0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(n.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options,i=e.ticks,a=!t.isHorizontal(),r={min:i.min,max:i.max},s=t.ticks=o(r,t);t.max=n.max(s),t.min=n.min(s),i.reverse?(a=!a,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),a&&s.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),a.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){return this.getPixelForValue(this.tickValues[t])},_getFirstTickValue:function(t){var e=Math.floor(n.log10(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},getPixelForValue:function(e){var i,o,a,r,s,l=this,h=l.options.ticks.reverse,d=n.log10,u=l._getFirstTickValue(l.minNotZero),c=0;return e=+l.getRightValue(e),h?(a=l.end,r=l.start,s=-1):(a=l.start,r=l.end,s=1),l.isHorizontal()?(i=l.width,o=h?l.right:l.left):(i=l.height,s*=-1,o=h?l.top:l.bottom),e!==a&&(0===a&&(c=n.getValueOrDefault(l.options.ticks.fontSize,t.defaults.global.defaultFontSize),i-=c,a=u),0!==e&&(c+=i/(d(r)-d(a))*(d(e)-d(a))),o+=s*c),o},getValueForPixel:function(e){var i,o,a,r,s=this,l=s.options.ticks.reverse,h=n.log10,d=s._getFirstTickValue(s.minNotZero);if(l?(o=s.end,a=s.start):(o=s.start,a=s.end),s.isHorizontal()?(i=s.width,r=l?s.right-e:e-s.left):(i=s.height,r=l?e-s.top:s.bottom-e),r!==o){if(0===o){var u=n.getValueOrDefault(s.options.ticks.fontSize,t.defaults.global.defaultFontSize);r-=u,i-=u,o=d}r*=h(a)-h(o),r/=i,r=Math.pow(10,h(o)+r)}return r}});r.registerScaleType("logarithmic",i,e)}},{33:33,34:34,35:35,46:46}],58:[function(t,e,i){"use strict";var o=t(26),n=t(46),a=t(34),r=t(35);e.exports=function(t){function e(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function i(t){var e=t.options.pointLabels,i=n.valueOrDefault(e.fontSize,v.defaultFontSize),o=n.valueOrDefault(e.fontStyle,v.defaultFontStyle),a=n.valueOrDefault(e.fontFamily,v.defaultFontFamily);return{size:i,style:o,family:a,font:n.fontString(i,o,a)}}function s(t,e,i){return n.isArray(i)?{w:n.longestText(t,t.font,i),h:i.length*e+1.5*(i.length-1)*e}:{w:t.measureText(i).width,h:e}}function l(t,e,i,o,n){return t===o||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i-5,end:e}:{start:e,end:e+i+5}}function h(t){var o,a,r,h=i(t),d=Math.min(t.height/2,t.width/2),u={r:t.width,l:0,t:t.height,b:0},c={};t.ctx.font=h.font,t._pointLabelSizes=[];var f=e(t);for(o=0;ou.r&&(u.r=m.end,c.r=p),v.startu.b&&(u.b=v.end,c.b=p)}t.setReductions(d,u,c)}function d(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function u(t){return 0===t||180===t?"center":t<180?"left":"right"}function c(t,e,i,o){if(n.isArray(e))for(var a=i.y,r=1.5*o,s=0;s270||t<90)&&(i.y-=e.h)}function p(t){var o=t.ctx,a=t.options,r=a.angleLines,s=a.pointLabels;o.lineWidth=r.lineWidth,o.strokeStyle=r.color;var l=t.getDistanceFromCenterForValue(a.ticks.reverse?t.min:t.max),h=i(t);o.textBaseline="top";for(var d=e(t)-1;d>=0;d--){if(r.display){var p=t.getPointPosition(d,l);o.beginPath(),o.moveTo(t.xCenter,t.yCenter),o.lineTo(p.x,p.y),o.stroke(),o.closePath()}if(s.display){var g=t.getPointPosition(d,l+5),m=n.valueAtIndexOrDefault(s.fontColor,d,v.defaultFontColor);o.font=h.font,o.fillStyle=m;var b=t.getIndexAngle(d),y=n.toDegrees(b);o.textAlign=u(y),f(y,t._pointLabelSizes[d],g),c(o,t.pointLabels[d]||"",g,h.size)}}}function g(t,i,o,a){var r=t.ctx;if(r.strokeStyle=n.valueAtIndexOrDefault(i.color,a-1),r.lineWidth=n.valueAtIndexOrDefault(i.lineWidth,a-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,o,0,2*Math.PI),r.closePath(),r.stroke();else{var s=e(t);if(0===s)return;r.beginPath();var l=t.getPointPosition(0,o);r.moveTo(l.x,l.y);for(var h=1;h0&&i>0?e:0)},draw:function(){var t=this,e=t.options,i=e.gridLines,o=e.ticks,a=n.valueOrDefault;if(e.display){var r=t.ctx,s=this.getIndexAngle(0),l=a(o.fontSize,v.defaultFontSize),h=a(o.fontStyle,v.defaultFontStyle),d=a(o.fontFamily,v.defaultFontFamily),u=n.fontString(l,h,d);n.each(t.ticks,function(e,n){if(n>0||o.reverse){var h=t.getDistanceFromCenterForValue(t.ticksAsNumbers[n]);if(i.display&&0!==n&&g(t,i,h,n),o.display){var d=a(o.fontColor,v.defaultFontColor);if(r.font=u,r.save(),r.translate(t.xCenter,t.yCenter),r.rotate(s),o.showLabelBackdrop){var c=r.measureText(e).width;r.fillStyle=o.backdropColor,r.fillRect(-c/2-o.backdropPaddingX,-h-l/2-o.backdropPaddingY,c+2*o.backdropPaddingX,l+2*o.backdropPaddingY)}r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.fillText(e,0,-h),r.restore()}}}),(e.angleLines.display||e.pointLabels.display)&&p(t)}}});a.registerScaleType("radialLinear",y,b)}},{26:26,34:34,35:35,46:46}],59:[function(t,e,i){"use strict";function o(t,e){return t-e}function n(t){var e,i,o,n={},a=[];for(e=0,i=t.length;ee&&s=0&&r<=s;){if(o=r+s>>1,n=t[o-1]||null,a=t[o],!n)return{lo:null,hi:a};if(a[e]i))return{lo:n,hi:a};s=o-1}}return{lo:a,hi:null}}function s(t,e,i,o){var n=r(t,e,i),a=n.lo?n.hi?n.lo:t[t.length-2]:t[0],s=n.lo?n.hi?n.hi:t[t.length-1]:t[1],l=s[e]-a[e],h=l?(i-a[e])/l:0,d=(s[o]-a[o])*h;return a[o]+d}function l(t,e){var i=e.parser,o=e.parser||e.format;return"function"==typeof i?i(t):"string"==typeof t&&"string"==typeof o?b(t,o):(t instanceof b||(t=b(t)),t.isValid()?t:"function"==typeof o?o(t):t)}function h(t,e){if(x.isNullOrUndef(t))return null;var i=e.options.time,o=l(e.getRightValue(t),i);return o.isValid()?(i.round&&o.startOf(i.round),o.valueOf()):null}function d(t,e,i,o){var n,a,r,s=e-t,l=D[i],h=l.size,d=l.steps;if(!d)return Math.ceil(s/(o*h));for(n=0,a=d.length;n=M.indexOf(e);n--)if(a=M[n],D[a].common&&r.as(a)>=t.length)return a;return M[e?M.indexOf(e):0]}function f(t){for(var e=M.indexOf(t)+1,i=M.length;e1?e[1]:o,r=e[0],l=(s(t,"time",a,"pos")-s(t,"time",r,"pos"))/2),n.time.max||(a=e[e.length-1],r=e.length>1?e[e.length-2]:i,h=(s(t,"time",a,"pos")-s(t,"time",r,"pos"))/2)),{left:l,right:h}}function m(t,e){var i,o,n,a,r=[];for(i=0,o=t.length;i=n&&i<=r&&u.push(i);return o.min=n,o.max=r,o._unit=l.unit||c(u,l.minUnit,o.min,o.max),o._majorUnit=f(o._unit),o._table=a(o._timestamps.data,n,r,s.distribution),o._offsets=g(o._table,u,n,r,s),o._labelFormat=v(o._timestamps.data,l),m(u,o._majorUnit)},getLabelForIndex:function(t,e){var i=this,o=i.chart.data,n=i.options.time,a=o.labels&&t=0&&t0?r:1}});_.registerScaleType("time",e,t)}},{1:1,26:26,33:33,34:34,46:46}]},{},[7])(7)}),function(t,e){"function"==typeof define&&define.amd?define([],function(){return t.SignaturePad=e()}):"object"==typeof exports?module.exports=e():t.SignaturePad=e()}(this,function(){return function(t){"use strict";var e=function(t,e){var i=this,o=e||{};this.velocityFilterWeight=o.velocityFilterWeight||.7,this.minWidth=o.minWidth||.5,this.maxWidth=o.maxWidth||2.5,this.dotSize=o.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=o.penColor||"black",this.backgroundColor=o.backgroundColor||"rgba(0,0,0,0)",this.onEnd=o.onEnd,this.onBegin=o.onBegin,this._canvas=t,this._ctx=t.getContext("2d"),this.clear(),this._handleMouseDown=function(t){1===t.which&&(i._mouseButtonDown=!0,i._strokeBegin(t))},this._handleMouseMove=function(t){i._mouseButtonDown&&i._strokeUpdate(t)},this._handleMouseUp=function(t){1===t.which&&i._mouseButtonDown&&(i._mouseButtonDown=!1,i._strokeEnd(t))},this._handleTouchStart=function(t){if(1==t.targetTouches.length){var e=t.changedTouches[0];i._strokeBegin(e)}},this._handleTouchMove=function(t){t.preventDefault();var e=t.targetTouches[0];i._strokeUpdate(e)},this._handleTouchEnd=function(t){t.target===i._canvas&&(t.preventDefault(),i._strokeEnd(t))},this._handleMouseEvents(),this._handleTouchEvents()};e.prototype.clear=function(){var t=this._ctx,e=this._canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._reset()},e.prototype.toDataURL=function(t,e){var i=this._canvas;return i.toDataURL.apply(i,arguments)},e.prototype.fromDataURL=function(t){var e=this,i=new Image,o=window.devicePixelRatio||1,n=this._canvas.width/o,a=this._canvas.height/o;this._reset(),i.src=t,i.onload=function(){e._ctx.drawImage(i,0,0,n,a)},this._isEmpty=!1},e.prototype._strokeUpdate=function(t){var e=this._createPoint(t);this._addPoint(e)},e.prototype._strokeBegin=function(t){this._reset(),this._strokeUpdate(t),"function"==typeof this.onBegin&&this.onBegin(t)},e.prototype._strokeDraw=function(t){var e=this._ctx,i="function"==typeof this.dotSize?this.dotSize():this.dotSize;e.beginPath(),this._drawPoint(t.x,t.y,i),e.closePath(),e.fill()},e.prototype._strokeEnd=function(t){var e=this.points.length>2,i=this.points[0];!e&&i&&this._strokeDraw(i),"function"==typeof this.onEnd&&this.onEnd(t)},e.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),t.addEventListener("mouseup",this._handleMouseUp)},e.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},e.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},e.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),t.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},e.prototype.isEmpty=function(){return this._isEmpty},e.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._isEmpty=!0,this._ctx.fillStyle=this.penColor},e.prototype._createPoint=function(t){var e=this._canvas.getBoundingClientRect();return new i(t.clientX-e.left,t.clientY-e.top)},e.prototype._addPoint=function(t){var e,i,n,a,r=this.points;r.push(t),r.length>2&&(3===r.length&&r.unshift(r[0]),a=this._calculateCurveControlPoints(r[0],r[1],r[2]),e=a.c2,a=this._calculateCurveControlPoints(r[1],r[2],r[3]),i=a.c1,n=new o(r[1],e,i,r[2]),this._addCurve(n),r.shift())},e.prototype._calculateCurveControlPoints=function(t,e,o){var n=t.x-e.x,a=t.y-e.y,r=e.x-o.x,s=e.y-o.y,l={x:(t.x+e.x)/2,y:(t.y+e.y)/2},h={x:(e.x+o.x)/2,y:(e.y+o.y)/2},d=Math.sqrt(n*n+a*a),u=Math.sqrt(r*r+s*s),c=l.x-h.x,f=l.y-h.y,p=u/(d+u),g={x:h.x+c*p,y:h.y+f*p},m=e.x-g.x,v=e.y-g.y;return{c1:new i(l.x+m,l.y+v),c2:new i(h.x+m,h.y+v)}},e.prototype._addCurve=function(t){var e,i,o=t.startPoint,n=t.endPoint;e=n.velocityFrom(o),e=this.velocityFilterWeight*e+(1-this.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(e),this._drawCurve(t,this._lastWidth,i),this._lastVelocity=e,this._lastWidth=i},e.prototype._drawPoint=function(t,e,i){var o=this._ctx;o.moveTo(t,e),o.arc(t,e,i,0,2*Math.PI,!1),this._isEmpty=!1},e.prototype._drawCurve=function(t,e,i){var o,n,a,r,s,l,h,d,u,c,f,p=this._ctx,g=i-e;for(o=Math.floor(t.length()),p.beginPath(),a=0;a0&&(r=i-n,s=o-a,l+=Math.sqrt(r*r+s*s)),n=i,a=o;return l},o.prototype._point=function(t,e,i,o,n){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*o*(1-t)*t*t+n*t*t*t},e}(document)});