E:
/
home
/
kbcomunicacao1
/
Web
/
ibape
/
associado
/
assets
/
js
/
Upload File
HOME
function _defineProperty(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _toConsumableArray(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){"use strict";Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=i.length;return function(r){if("object"!==(void 0===r?"undefined":_typeof(r))&&("function"!=typeof r||null===r))throw new TypeError("Object.keys called on non-object");var o,a,s=[];for(o in r)t.call(r,o)&&s.push(o);if(e)for(a=0;a<n;a++)t.call(r,i[a])&&s.push(i[a]);return s}}())}();var pxUtil=function(){"use strict";function t(t,e){for(var i="[object Array]"===Object.prototype.toString.call(t)?t:t.split(" "),n=0;n<i.length;n++)e(i[n],n)}var e="classList"in document.documentElement,i=e?function(t,e){return t.classList.contains(e)}:function(t,e){return new RegExp("(?:^|\\s)"+e+"(?:\\s|$)").test(t.className)},n=e?function(t,e){return t.classList.add(e)}:function(t,e){i(t,e)||(t.className+=(t.className?" ":"")+e)},r=e?function(t,e){return t.classList.remove(e)}:function(t,e){i(t,e)&&(t.className=t.className.replace(new RegExp("(?:^"+e+"\\s+)|(?:^\\s*"+e+"\\s*$)|(?:\\s+"+e+"$)","g"),"").replace(new RegExp("\\s+"+e+"\\s+","g")," "))},o=e?function(t,e){return t.classList.toggle(e)}:function(t,e){return(i(t,e)?r:n)(t,e)};return{generateUniqueId:function(){var t=(Math.floor(25*Math.random())+10).toString(36)+"_";t+=(new Date).getTime().toString(36)+"_";do{t+=Math.floor(35*Math.random()).toString(36)}while(t.length<32);return t},escapeRegExp:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hexToRgba:function(t,e){var i=t.replace("#","");return"rgba("+parseInt(i.substring(0,2),16)+", "+parseInt(i.substring(2,4),16)+", "+parseInt(i.substring(4,6),16)+", "+e+")"},triggerResizeEvent:function(){var t=void 0;document.createEvent?(t=document.createEvent("HTMLEvents")).initEvent("resize",!0,!0):(t=document.createEventObject()).eventType="resize",t.eventName="resize",document.createEvent?window.dispatchEvent(t):window.fireEvent("on"+t.eventType,t)},hasClass:function(t,e){return i(t,e)},addClass:function(e,i){t(i,function(t){return n(e,t)})},removeClass:function(e,i){t(i,function(t){return r(e,t)})},toggleClass:function(e,i){t(i,function(t){return o(e,t)})}}}(),PixelAdmin=function(t){"use strict";var e={isRtl:"rtl"===document.documentElement.getAttribute("dir"),isMobile:/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()),isLocalStorageSupported:void 0!==window.Storage,options:{resizeDelay:100,storageKeyPrefix:"px_s_",cookieKeyPrefix:"px_c_"},getScreenSize:function(){var t=e._isBreakpointVisible;return t("xs")?"xs":t("sm")?"sm":t("md")?"md":t("lg")?"lg":"xl"},storage:{_prefix:function(t){return""+e.options.storageKeyPrefix+t},set:function(t,i){var n="string"==typeof t?_defineProperty({},t,i):t,r=Object.keys(n);try{for(var o=0,a=r.length;o<a;o++)window.localStorage.setItem(this._prefix(r[o]),n[r[o]])}catch(n){e.cookies.set(t,i)}},get:function(i){var n=t.isArray(i)?i:[i],r={};try{for(var o=0,a=n.length;o<a;o++)r[n[o]]=window.localStorage.getItem(this._prefix(n[o]));return t.isArray(i)?r:r[i]}catch(t){return e.cookies.get(i)}}},cookies:{_prefix:function(t){return""+e.options.cookieKeyPrefix+t},set:function(t,e){for(var i="string"==typeof t?_defineProperty({},t,e):t,n=Object.keys(i),r=void 0,o=void 0,a=0,s=n.length;a<s;a++)r=encodeURIComponent(this._prefix(n[a])),o=encodeURIComponent(i[n[a]]),document.cookie=r+"="+o},get:function(e){for(var i=";"+document.cookie+";",n=t.isArray(e)?e:[e],r={},o=void 0,a=void 0,s=void 0,l=0,c=n.length;l<c;l++)o=pxUtil.escapeRegExp(encodeURIComponent(this._prefix(n[l]))),a=new RegExp(";\\s*"+o+"\\s*=\\s*([^;]+)\\s*;"),s=i.match(a),r[n[l]]=s?decodeURIComponent(s[1]):null;return t.isArray(e)?r:r[e]}},_isBreakpointVisible:function(e){return(document.getElementById("px-breakpoint-"+e)||t('<div id="px-breakpoint-'+e+'"></div>').prependTo(document.body)[0]).offsetTop},_setDelayedResizeListener:function(){var i=t(window),n=null;i.on("resize",function(t){var i=null;return function(){i&&clearTimeout(i),i=setTimeout(function(){i=null,t()},e.options.resizeDelay)}}(function(){var t=e.getScreenSize();i.trigger("px.resize"),n!==t&&i.trigger("px.screen."+t),n=t}))}};return e._setDelayedResizeListener(),t(function(){e.isMobile&&window.FastClick&&window.FastClick.attach(document.body),e.isRtl&&t(window).on("px.resize.px-rtl-fix",function(){document.body.style.overflow="hidden";document.body.offsetHeight;document.body.style.overflow=""}),t(window).trigger("px.load"),pxUtil.triggerResizeEvent()}),e}(jQuery);window.PixelAdmin=PixelAdmin,function(t){"use strict";if(!t.fn.modal)throw new Error("modal.js required.");var e=t.fn.modal.Constructor.prototype.show,i=t.fn.modal.Constructor.prototype.hide;t.fn.modal.Constructor.prototype.show=function(i){e.call(this,i),this.isShown&&t("html").addClass("modal-open")},t.fn.modal.Constructor.prototype.hide=function(e){i.call(this,e),this.isShown||t("html").removeClass("modal-open")}}(jQuery),function(t){"use strict";if(!t.fn.tooltip)throw new Error("tooltip.js required.");var e=t.fn.tooltip.Constructor.prototype.getOptions,i=t.fn.tooltip.Constructor.prototype.setContent;t.fn.tooltip.Constructor.prototype.getOptions=function(i){var n=e.call(this,i),r="rtl"===t("html").attr("dir");return r&&"left"===n.placement?n.placement="right":r&&"right"===n.placement&&(n.placement="left"),n},t.fn.tooltip.Constructor.prototype.setContent=function(){var e=this.$element.attr("data-state");e&&t(this.tip()).addClass("tooltip-"+e.replace(/[^a-z0-9_-]/gi,"")),i.call(this)}}(jQuery),function(t){"use strict";if(!t.fn.popover)throw new Error("popover.js required.");var e=t.fn.popover.Constructor.prototype.getOptions,i=t.fn.popover.Constructor.prototype.setContent;t.fn.popover.Constructor.prototype.getOptions=function(i){var n=e.call(this,i),r="rtl"===t("html").attr("dir");return r&&"left"===n.placement?n.placement="right":r&&"right"===n.placement&&(n.placement="left"),n},t.fn.popover.Constructor.prototype.setContent=function(){var e=this.$element,n=t(this.tip()),r=e.attr("data-state"),o=(e.attr("data-style")||"").toLowerCase().split(" ");r&&n.addClass("popover-"+r.replace(/[^a-z0-9_-]/gi,"")),-1!==o.indexOf("dark")&&n.addClass("popover-dark"),-1!==o.indexOf("colorful")&&n.addClass("popover-colorful"),i.call(this)}}(jQuery);var _createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxFile=function(t){"use strict";var e="pxFile",i=t.fn[e],n={BROWSE:"px-file-browse",CLEAR:"px-file-clear",HAS_VALUE:"px-file-has-value"},r={CLICK:"click.px.file",CHANGE:"change.px.file"},o=function(){function i(e){_classCallCheck(this,i),this.element=e,this.input=t(e).find(".custom-file-input")[0],this.control=t(e).find(".custom-file-control")[0],this.placeholder=this.control.innerHTML,this._checkElement(),this._checkInput(),this._checkControl(),this._setListeners(),this.update()}return _createClass(i,[{key:"browse",value:function(){t(this.input).trigger("click")}},{key:"clear",value:function(){t(this.input).is(":disabled")||(t(this.input).wrap("<form>").parent().on("reset",function(t){t.stopPropagation()}).trigger("reset"),t(this.input).unwrap(),t(this.input).trigger("change"))}},{key:"update",value:function(){var e=(this.input.value||"").replace(/\\/g,"/").split("/").pop();e?t(this.control).text(e):this.control.innerHTML=this.placeholder,pxUtil[e?"addClass":"removeClass"](this.element,n.HAS_VALUE)}},{key:"destroy",value:function(){this._unsetListeners(),t(this.element).removeData("px.file")}},{key:"_checkElement",value:function(){if(!pxUtil.hasClass(this.element,"custom-file"))throw new Error(e+" plugin must be called on a custom file input wrapper.")}},{key:"_checkInput",value:function(){if(!this.input)throw new Error("File input is not found.")}},{key:"_checkControl",value:function(){if(!this.control)throw new Error(".custom-file-control element is not found.")}},{key:"_rejectEvent",value:function(t){t&&(t.stopPropagation(),t.preventDefault())}},{key:"_setListeners",value:function(){var e=this;t(this.element).find("."+n.BROWSE).on(this.constructor.Event.CLICK,function(i){e._rejectEvent(i),e.browse(),t(e.input).trigger("focus")}),t(this.element).find("."+n.CLEAR).on(this.constructor.Event.CLICK,function(i){e._rejectEvent(i),e.clear(),t(e.input).trigger("focus")}),t(this.input).on(this.constructor.Event.CHANGE,t.proxy(this.update,this))}},{key:"_unsetListeners",value:function(){t(this.element).find("."+n.BROWSE).off(".px.file"),t(this.element).find("."+n.CLEAR).off(".px.file"),t(this.input).off(".px.file")}}],[{key:"_jQueryInterface",value:function(e){return this.each(function(){var n=t(this).data("px.file");if(n||(n=new i(this),t(this).data("px.file",n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'".');n[e]()}})}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"px.file"}},{key:"Event",get:function(){return r}},{key:"EVENT_KEY",get:function(){return".px.file"}}]),i}();return t.fn[e]=o._jQueryInterface,t.fn[e].Constructor=o,t.fn[e].noConflict=function(){return t.fn[e]=i,o._jQueryInterface},o}(jQuery);!function t(e,i,n){function r(a,s){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[a]={exports:{}};e[a][0].call(h.exports,function(t){var i=e[a][1][t];return r(i||t)},h,h.exports,t,e,i,n)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(t,e,i){"use strict";function n(t){t.fn.perfectScrollbar=function(t){return this.each(function(){if("object"==typeof t||void 0===t){var e=t;o.get(this)||r.initialize(this,e)}else{var i=t;"update"===i?r.update(this):"destroy"===i&&r.destroy(this)}})}}var r=t("../main"),o=t("../plugin/instances");if("function"==typeof define&&define.amd)define(["jquery"],n);else{var a=window.jQuery?window.jQuery:window.$;void 0!==a&&n(a)}e.exports=n},{"../main":7,"../plugin/instances":18}],2:[function(t,e,i){"use strict";function n(t,e){var i=t.className.split(" ");i.indexOf(e)<0&&i.push(e),t.className=i.join(" ")}function r(t,e){var i=t.className.split(" "),n=i.indexOf(e);n>=0&&i.splice(n,1),t.className=i.join(" ")}i.add=function(t,e){t.classList?t.classList.add(e):n(t,e)},i.remove=function(t,e){t.classList?t.classList.remove(e):r(t,e)},i.list=function(t){return t.classList?Array.prototype.slice.apply(t.classList):t.className.split(" ")}},{}],3:[function(t,e,i){"use strict";function n(t,e){return window.getComputedStyle(t)[e]}function r(t,e,i){return"number"==typeof i&&(i=i.toString()+"px"),t.style[e]=i,t}function o(t,e){for(var i in e){var n=e[i];"number"==typeof n&&(n=n.toString()+"px"),t.style[i]=n}return t}var a={};a.e=function(t,e){var i=document.createElement(t);return i.className=e,i},a.appendTo=function(t,e){return e.appendChild(t),t},a.css=function(t,e,i){return"object"==typeof e?o(t,e):void 0===i?n(t,e):r(t,e,i)},a.matches=function(t,e){return void 0!==t.matches?t.matches(e):void 0!==t.matchesSelector?t.matchesSelector(e):void 0!==t.webkitMatchesSelector?t.webkitMatchesSelector(e):void 0!==t.mozMatchesSelector?t.mozMatchesSelector(e):void 0!==t.msMatchesSelector?t.msMatchesSelector(e):void 0},a.remove=function(t){void 0!==t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)},a.queryChildren=function(t,e){return Array.prototype.filter.call(t.childNodes,function(t){return a.matches(t,e)})},e.exports=a},{}],4:[function(t,e,i){"use strict";var n=function(t){this.element=t,this.events={}};n.prototype.bind=function(t,e){void 0===this.events[t]&&(this.events[t]=[]),this.events[t].push(e),this.element.addEventListener(t,e,!1)},n.prototype.unbind=function(t,e){var i=void 0!==e;this.events[t]=this.events[t].filter(function(n){return!(!i||n===e)||(this.element.removeEventListener(t,n,!1),!1)},this)},n.prototype.unbindAll=function(){for(var t in this.events)this.unbind(t)};var r=function(){this.eventElements=[]};r.prototype.eventElement=function(t){var e=this.eventElements.filter(function(e){return e.element===t})[0];return void 0===e&&(e=new n(t),this.eventElements.push(e)),e},r.prototype.bind=function(t,e,i){this.eventElement(t).bind(e,i)},r.prototype.unbind=function(t,e,i){this.eventElement(t).unbind(e,i)},r.prototype.unbindAll=function(){for(var t=0;t<this.eventElements.length;t++)this.eventElements[t].unbindAll()},r.prototype.once=function(t,e,i){var n=this.eventElement(t),r=function(t){n.unbind(e,r),i(t)};n.bind(e,r)},e.exports=r},{}],5:[function(t,e,i){"use strict";e.exports=function(){function t(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return function(){return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()}}()},{}],6:[function(t,e,i){"use strict";var n=t("./class"),r=t("./dom"),o=i.toInt=function(t){return parseInt(t,10)||0},a=i.clone=function(t){if(t){if(t.constructor===Array)return t.map(a);if("object"==typeof t){var e={};for(var i in t)e[i]=a(t[i]);return e}return t}return null};i.extend=function(t,e){var i=a(t);for(var n in e)i[n]=a(e[n]);return i},i.isEditable=function(t){return r.matches(t,"input,[contenteditable]")||r.matches(t,"select,[contenteditable]")||r.matches(t,"textarea,[contenteditable]")||r.matches(t,"button,[contenteditable]")},i.removePsClasses=function(t){for(var e=n.list(t),i=0;i<e.length;i++){var r=e[i];0===r.indexOf("ps-")&&n.remove(t,r)}},i.outerWidth=function(t){return o(r.css(t,"width"))+o(r.css(t,"paddingLeft"))+o(r.css(t,"paddingRight"))+o(r.css(t,"borderLeftWidth"))+o(r.css(t,"borderRightWidth"))},i.startScrolling=function(t,e){n.add(t,"ps-in-scrolling"),void 0!==e?n.add(t,"ps-"+e):(n.add(t,"ps-x"),n.add(t,"ps-y"))},i.stopScrolling=function(t,e){n.remove(t,"ps-in-scrolling"),void 0!==e?n.remove(t,"ps-"+e):(n.remove(t,"ps-x"),n.remove(t,"ps-y"))},i.env={isWebKit:"WebkitAppearance"in document.documentElement.style,supportsTouch:"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,supportsIePointer:null!==window.navigator.msMaxTouchPoints}},{"./class":2,"./dom":3}],7:[function(t,e,i){"use strict";var n=t("./plugin/destroy"),r=t("./plugin/initialize"),o=t("./plugin/update");e.exports={initialize:r,update:o,destroy:n}},{"./plugin/destroy":9,"./plugin/initialize":17,"./plugin/update":21}],8:[function(t,e,i){"use strict";e.exports={handlers:["click-rail","drag-scrollbar","keyboard","wheel","touch"],maxScrollbarLength:null,minScrollbarLength:null,scrollXMarginOffset:0,scrollYMarginOffset:0,suppressScrollX:!1,suppressScrollY:!1,swipePropagation:!0,useBothWheelAxes:!1,wheelPropagation:!1,wheelSpeed:1,theme:"default"}},{}],9:[function(t,e,i){"use strict";var n=t("../lib/helper"),r=t("../lib/dom"),o=t("./instances");e.exports=function(t){var e=o.get(t);e&&(e.event.unbindAll(),r.remove(e.scrollbarX),r.remove(e.scrollbarY),r.remove(e.scrollbarXRail),r.remove(e.scrollbarYRail),n.removePsClasses(t),o.remove(t))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18}],10:[function(t,e,i){"use strict";function n(t,e){function i(t){return t.getBoundingClientRect()}var n=function(t){t.stopPropagation()};e.event.bind(e.scrollbarY,"click",n),e.event.bind(e.scrollbarYRail,"click",function(n){var r=n.pageY-window.pageYOffset-i(e.scrollbarYRail).top>e.scrollbarYTop?1:-1;a(t,"top",t.scrollTop+r*e.containerHeight),o(t),n.stopPropagation()}),e.event.bind(e.scrollbarX,"click",n),e.event.bind(e.scrollbarXRail,"click",function(n){var r=n.pageX-window.pageXOffset-i(e.scrollbarXRail).left>e.scrollbarXLeft?1:-1;a(t,"left",t.scrollLeft+r*e.containerWidth),o(t),n.stopPropagation()})}var r=t("../instances"),o=t("../update-geometry"),a=t("../update-scroll");e.exports=function(t){n(t,r.get(t))}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],11:[function(t,e,i){"use strict";function n(t,e){function i(i){var r=n+i*e.railXRatio,a=Math.max(0,e.scrollbarXRail.getBoundingClientRect().left)+e.railXRatio*(e.railXWidth-e.scrollbarXWidth);e.scrollbarXLeft=r<0?0:r>a?a:r;var s=o.toInt(e.scrollbarXLeft*(e.contentWidth-e.containerWidth)/(e.containerWidth-e.railXRatio*e.scrollbarXWidth))-e.negativeScrollAdjustment;c(t,"left",s)}var n=null,r=null,s=function(e){i(e.pageX-r),l(t),e.stopPropagation(),e.preventDefault()},h=function(){o.stopScrolling(t,"x"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarX,"mousedown",function(i){r=i.pageX,n=o.toInt(a.css(e.scrollbarX,"left"))*e.railXRatio,o.startScrolling(t,"x"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",h),i.stopPropagation(),i.preventDefault()})}function r(t,e){function i(i){var r=n+i*e.railYRatio,a=Math.max(0,e.scrollbarYRail.getBoundingClientRect().top)+e.railYRatio*(e.railYHeight-e.scrollbarYHeight);e.scrollbarYTop=r<0?0:r>a?a:r;var s=o.toInt(e.scrollbarYTop*(e.contentHeight-e.containerHeight)/(e.containerHeight-e.railYRatio*e.scrollbarYHeight));c(t,"top",s)}var n=null,r=null,s=function(e){i(e.pageY-r),l(t),e.stopPropagation(),e.preventDefault()},h=function(){o.stopScrolling(t,"y"),e.event.unbind(e.ownerDocument,"mousemove",s)};e.event.bind(e.scrollbarY,"mousedown",function(i){r=i.pageY,n=o.toInt(a.css(e.scrollbarY,"top"))*e.railYRatio,o.startScrolling(t,"y"),e.event.bind(e.ownerDocument,"mousemove",s),e.event.once(e.ownerDocument,"mouseup",h),i.stopPropagation(),i.preventDefault()})}var o=t("../../lib/helper"),a=t("../../lib/dom"),s=t("../instances"),l=t("../update-geometry"),c=t("../update-scroll");e.exports=function(t){var e=s.get(t);n(t,e),r(t,e)}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],12:[function(t,e,i){"use strict";function n(t,e){function i(i,n){var r=t.scrollTop;if(0===i){if(!e.scrollbarYActive)return!1;if(0===r&&n>0||r>=e.contentHeight-e.containerHeight&&n<0)return!e.settings.wheelPropagation}var o=t.scrollLeft;if(0===n){if(!e.scrollbarXActive)return!1;if(0===o&&i<0||o>=e.contentWidth-e.containerWidth&&i>0)return!e.settings.wheelPropagation}return!0}var n=!1;e.event.bind(t,"mouseenter",function(){n=!0}),e.event.bind(t,"mouseleave",function(){n=!1});var a=!1;e.event.bind(e.ownerDocument,"keydown",function(c){if(!(c.isDefaultPrevented&&c.isDefaultPrevented()||c.defaultPrevented)){var h=o.matches(e.scrollbarX,":focus")||o.matches(e.scrollbarY,":focus");if(n||h){var u=document.activeElement?document.activeElement:e.ownerDocument.activeElement;if(u){if("IFRAME"===u.tagName)u=u.contentDocument.activeElement;else for(;u.shadowRoot;)u=u.shadowRoot.activeElement;if(r.isEditable(u))return}var d=0,f=0;switch(c.which){case 37:d=c.metaKey?-e.contentWidth:c.altKey?-e.containerWidth:-30;break;case 38:f=c.metaKey?e.contentHeight:c.altKey?e.containerHeight:30;break;case 39:d=c.metaKey?e.contentWidth:c.altKey?e.containerWidth:30;break;case 40:f=c.metaKey?-e.contentHeight:c.altKey?-e.containerHeight:-30;break;case 33:f=90;break;case 32:f=c.shiftKey?90:-90;break;case 34:f=-90;break;case 35:f=c.ctrlKey?-e.contentHeight:-e.containerHeight;break;case 36:f=c.ctrlKey?t.scrollTop:e.containerHeight;break;default:return}l(t,"top",t.scrollTop-f),l(t,"left",t.scrollLeft+d),s(t),(a=i(d,f))&&c.preventDefault()}}})}var r=t("../../lib/helper"),o=t("../../lib/dom"),a=t("../instances"),s=t("../update-geometry"),l=t("../update-scroll");e.exports=function(t){n(t,a.get(t))}},{"../../lib/dom":3,"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],13:[function(t,e,i){"use strict";function n(t,e){function i(i,n){var r=t.scrollTop;if(0===i){if(!e.scrollbarYActive)return!1;if(0===r&&n>0||r>=e.contentHeight-e.containerHeight&&n<0)return!e.settings.wheelPropagation}var o=t.scrollLeft;if(0===n){if(!e.scrollbarXActive)return!1;if(0===o&&i<0||o>=e.contentWidth-e.containerWidth&&i>0)return!e.settings.wheelPropagation}return!0}function n(t){var e=t.deltaX,i=-1*t.deltaY;return void 0!==e&&void 0!==i||(e=-1*t.wheelDeltaX/6,i=t.wheelDeltaY/6),t.deltaMode&&1===t.deltaMode&&(e*=10,i*=10),e!==e&&i!==i&&(e=0,i=t.wheelDelta),t.shiftKey?[-i,-e]:[e,i]}function r(e,i){var n=t.querySelector("textarea:hover, select[multiple]:hover, .ps-child:hover");if(n){if(!window.getComputedStyle(n).overflow.match(/(scroll|auto)/))return!1;var r=n.scrollHeight-n.clientHeight;if(r>0&&!(0===n.scrollTop&&i>0||n.scrollTop===r&&i<0))return!0;var o=n.scrollLeft-n.clientWidth;if(o>0&&!(0===n.scrollLeft&&e<0||n.scrollLeft===o&&e>0))return!0}return!1}function s(s){var c=n(s),h=c[0],u=c[1];r(h,u)||(l=!1,e.settings.useBothWheelAxes?e.scrollbarYActive&&!e.scrollbarXActive?(u?a(t,"top",t.scrollTop-u*e.settings.wheelSpeed):a(t,"top",t.scrollTop+h*e.settings.wheelSpeed),l=!0):e.scrollbarXActive&&!e.scrollbarYActive&&(h?a(t,"left",t.scrollLeft+h*e.settings.wheelSpeed):a(t,"left",t.scrollLeft-u*e.settings.wheelSpeed),l=!0):(a(t,"top",t.scrollTop-u*e.settings.wheelSpeed),a(t,"left",t.scrollLeft+h*e.settings.wheelSpeed)),o(t),(l=l||i(h,u))&&(s.stopPropagation(),s.preventDefault()))}var l=!1;void 0!==window.onwheel?e.event.bind(t,"wheel",s):void 0!==window.onmousewheel&&e.event.bind(t,"mousewheel",s)}var r=t("../instances"),o=t("../update-geometry"),a=t("../update-scroll");e.exports=function(t){n(t,r.get(t))}},{"../instances":18,"../update-geometry":19,"../update-scroll":20}],14:[function(t,e,i){"use strict";function n(t,e){e.event.bind(t,"scroll",function(){o(t)})}var r=t("../instances"),o=t("../update-geometry");e.exports=function(t){n(t,r.get(t))}},{"../instances":18,"../update-geometry":19}],15:[function(t,e,i){"use strict";function n(t,e){function i(){var t=window.getSelection?window.getSelection():document.getSelection?document.getSelection():"";return 0===t.toString().length?null:t.getRangeAt(0).commonAncestorContainer}function n(){c||(c=setInterval(function(){o.get(t)?(s(t,"top",t.scrollTop+h.top),s(t,"left",t.scrollLeft+h.left),a(t)):clearInterval(c)},50))}function l(){c&&(clearInterval(c),c=null),r.stopScrolling(t)}var c=null,h={top:0,left:0},u=!1;e.event.bind(e.ownerDocument,"selectionchange",function(){t.contains(i())?u=!0:(u=!1,l())}),e.event.bind(window,"mouseup",function(){u&&(u=!1,l())}),e.event.bind(window,"keyup",function(){u&&(u=!1,l())}),e.event.bind(window,"mousemove",function(e){if(u){var i={x:e.pageX,y:e.pageY},o={left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,bottom:t.offsetTop+t.offsetHeight};i.x<o.left+3?(h.left=-5,r.startScrolling(t,"x")):i.x>o.right-3?(h.left=5,r.startScrolling(t,"x")):h.left=0,i.y<o.top+3?(h.top=o.top+3-i.y<5?-5:-20,r.startScrolling(t,"y")):i.y>o.bottom-3?(h.top=i.y-o.bottom+3<5?5:20,r.startScrolling(t,"y")):h.top=0,0===h.top&&0===h.left?l():n()}})}var r=t("../../lib/helper"),o=t("../instances"),a=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){n(t,o.get(t))}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],16:[function(t,e,i){"use strict";function n(t,e,i,n){function r(i,n){var r=t.scrollTop,o=t.scrollLeft,a=Math.abs(i),s=Math.abs(n);if(s>a){if(n<0&&r===e.contentHeight-e.containerHeight||n>0&&0===r)return!e.settings.swipePropagation}else if(a>s&&(i<0&&o===e.contentWidth-e.containerWidth||i>0&&0===o))return!e.settings.swipePropagation;return!0}function l(e,i){s(t,"top",t.scrollTop-i),s(t,"left",t.scrollLeft-e),a(t)}function c(){x=!0}function h(){x=!1}function u(t){return t.targetTouches?t.targetTouches[0]:t}function d(t){return!(!t.targetTouches||1!==t.targetTouches.length)||!(!t.pointerType||"mouse"===t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE)}function f(t){if(d(t)){_=!0;var e=u(t);m.pageX=e.pageX,m.pageY=e.pageY,v=(new Date).getTime(),null!==b&&clearInterval(b),t.stopPropagation()}}function p(t){if(!_&&e.settings.swipePropagation&&f(t),!x&&_&&d(t)){var i=u(t),n={pageX:i.pageX,pageY:i.pageY},o=n.pageX-m.pageX,a=n.pageY-m.pageY;l(o,a),m=n;var s=(new Date).getTime(),c=s-v;c>0&&(y.x=o/c,y.y=a/c,v=s),r(o,a)&&(t.stopPropagation(),t.preventDefault())}}function g(){!x&&_&&(_=!1,clearInterval(b),b=setInterval(function(){o.get(t)&&(y.x||y.y)?Math.abs(y.x)<.01&&Math.abs(y.y)<.01?clearInterval(b):(l(30*y.x,30*y.y),y.x*=.8,y.y*=.8):clearInterval(b)},10))}var m={},v=0,y={},b=null,x=!1,_=!1;i?(e.event.bind(window,"touchstart",c),e.event.bind(window,"touchend",h),e.event.bind(t,"touchstart",f),e.event.bind(t,"touchmove",p),e.event.bind(t,"touchend",g)):n&&(window.PointerEvent?(e.event.bind(window,"pointerdown",c),e.event.bind(window,"pointerup",h),e.event.bind(t,"pointerdown",f),e.event.bind(t,"pointermove",p),e.event.bind(t,"pointerup",g)):window.MSPointerEvent&&(e.event.bind(window,"MSPointerDown",c),e.event.bind(window,"MSPointerUp",h),e.event.bind(t,"MSPointerDown",f),e.event.bind(t,"MSPointerMove",p),e.event.bind(t,"MSPointerUp",g)))}var r=t("../../lib/helper"),o=t("../instances"),a=t("../update-geometry"),s=t("../update-scroll");e.exports=function(t){(r.env.supportsTouch||r.env.supportsIePointer)&&n(t,o.get(t),r.env.supportsTouch,r.env.supportsIePointer)}},{"../../lib/helper":6,"../instances":18,"../update-geometry":19,"../update-scroll":20}],17:[function(t,e,i){"use strict";var n=t("../lib/helper"),r=t("../lib/class"),o=t("./instances"),a=t("./update-geometry"),s={"click-rail":t("./handler/click-rail"),"drag-scrollbar":t("./handler/drag-scrollbar"),keyboard:t("./handler/keyboard"),wheel:t("./handler/mouse-wheel"),touch:t("./handler/touch"),selection:t("./handler/selection")},l=t("./handler/native-scroll");e.exports=function(t,e){e="object"==typeof e?e:{},r.add(t,"ps-container");var i=o.add(t);i.settings=n.extend(i.settings,e),r.add(t,"ps-theme-"+i.settings.theme),i.settings.handlers.forEach(function(e){s[e](t)}),l(t),a(t)}},{"../lib/class":2,"../lib/helper":6,"./handler/click-rail":10,"./handler/drag-scrollbar":11,"./handler/keyboard":12,"./handler/mouse-wheel":13,"./handler/native-scroll":14,"./handler/selection":15,"./handler/touch":16,"./instances":18,"./update-geometry":19}],18:[function(t,e,i){"use strict";function n(t){function e(){l.add(t,"ps-focus")}function i(){l.remove(t,"ps-focus")}var n=this;n.settings=s.clone(c),n.containerWidth=null,n.containerHeight=null,n.contentWidth=null,n.contentHeight=null,n.isRtl="rtl"===h.css(t,"direction"),n.isNegativeScroll=function(){var e=t.scrollLeft,i=null;return t.scrollLeft=-1,i=t.scrollLeft<0,t.scrollLeft=e,i}(),n.negativeScrollAdjustment=n.isNegativeScroll?t.scrollWidth-t.clientWidth:0,n.event=new u,n.ownerDocument=t.ownerDocument||document,n.scrollbarXRail=h.appendTo(h.e("div","ps-scrollbar-x-rail"),t),n.scrollbarX=h.appendTo(h.e("div","ps-scrollbar-x"),n.scrollbarXRail),n.scrollbarX.setAttribute("tabindex",0),n.event.bind(n.scrollbarX,"focus",e),n.event.bind(n.scrollbarX,"blur",i),n.scrollbarXActive=null,n.scrollbarXWidth=null,n.scrollbarXLeft=null,n.scrollbarXBottom=s.toInt(h.css(n.scrollbarXRail,"bottom")),n.isScrollbarXUsingBottom=n.scrollbarXBottom===n.scrollbarXBottom,n.scrollbarXTop=n.isScrollbarXUsingBottom?null:s.toInt(h.css(n.scrollbarXRail,"top")),n.railBorderXWidth=s.toInt(h.css(n.scrollbarXRail,"borderLeftWidth"))+s.toInt(h.css(n.scrollbarXRail,"borderRightWidth")),h.css(n.scrollbarXRail,"display","block"),n.railXMarginWidth=s.toInt(h.css(n.scrollbarXRail,"marginLeft"))+s.toInt(h.css(n.scrollbarXRail,"marginRight")),h.css(n.scrollbarXRail,"display",""),n.railXWidth=null,n.railXRatio=null,n.scrollbarYRail=h.appendTo(h.e("div","ps-scrollbar-y-rail"),t),n.scrollbarY=h.appendTo(h.e("div","ps-scrollbar-y"),n.scrollbarYRail),n.scrollbarY.setAttribute("tabindex",0),n.event.bind(n.scrollbarY,"focus",e),n.event.bind(n.scrollbarY,"blur",i),n.scrollbarYActive=null,n.scrollbarYHeight=null,n.scrollbarYTop=null,n.scrollbarYRight=s.toInt(h.css(n.scrollbarYRail,"right")),n.isScrollbarYUsingRight=n.scrollbarYRight===n.scrollbarYRight,n.scrollbarYLeft=n.isScrollbarYUsingRight?null:s.toInt(h.css(n.scrollbarYRail,"left")),n.scrollbarYOuterWidth=n.isRtl?s.outerWidth(n.scrollbarY):null,n.railBorderYWidth=s.toInt(h.css(n.scrollbarYRail,"borderTopWidth"))+s.toInt(h.css(n.scrollbarYRail,"borderBottomWidth")),h.css(n.scrollbarYRail,"display","block"),n.railYMarginHeight=s.toInt(h.css(n.scrollbarYRail,"marginTop"))+s.toInt(h.css(n.scrollbarYRail,"marginBottom")),h.css(n.scrollbarYRail,"display",""),n.railYHeight=null,n.railYRatio=null}function r(t){return t.getAttribute("data-ps-id")}function o(t,e){t.setAttribute("data-ps-id",e)}function a(t){t.removeAttribute("data-ps-id")}var s=t("../lib/helper"),l=t("../lib/class"),c=t("./default-setting"),h=t("../lib/dom"),u=t("../lib/event-manager"),d=t("../lib/guid"),f={};i.add=function(t){var e=d();return o(t,e),f[e]=new n(t),f[e]},i.remove=function(t){delete f[r(t)],a(t)},i.get=function(t){return f[r(t)]}},{"../lib/class":2,"../lib/dom":3,"../lib/event-manager":4,"../lib/guid":5,"../lib/helper":6,"./default-setting":8}],19:[function(t,e,i){"use strict";function n(t,e){return t.settings.minScrollbarLength&&(e=Math.max(e,t.settings.minScrollbarLength)),t.settings.maxScrollbarLength&&(e=Math.min(e,t.settings.maxScrollbarLength)),e}function r(t,e){var i={width:e.railXWidth};e.isRtl?i.left=e.negativeScrollAdjustment+t.scrollLeft+e.containerWidth-e.contentWidth:i.left=t.scrollLeft,e.isScrollbarXUsingBottom?i.bottom=e.scrollbarXBottom-t.scrollTop:i.top=e.scrollbarXTop+t.scrollTop,s.css(e.scrollbarXRail,i);var n={top:t.scrollTop,height:e.railYHeight};e.isScrollbarYUsingRight?e.isRtl?n.right=e.contentWidth-(e.negativeScrollAdjustment+t.scrollLeft)-e.scrollbarYRight-e.scrollbarYOuterWidth:n.right=e.scrollbarYRight-t.scrollLeft:e.isRtl?n.left=e.negativeScrollAdjustment+t.scrollLeft+2*e.containerWidth-e.contentWidth-e.scrollbarYLeft-e.scrollbarYOuterWidth:n.left=e.scrollbarYLeft+t.scrollLeft,s.css(e.scrollbarYRail,n),s.css(e.scrollbarX,{left:e.scrollbarXLeft,width:e.scrollbarXWidth-e.railBorderXWidth}),s.css(e.scrollbarY,{top:e.scrollbarYTop,height:e.scrollbarYHeight-e.railBorderYWidth})}var o=t("../lib/helper"),a=t("../lib/class"),s=t("../lib/dom"),l=t("./instances"),c=t("./update-scroll");e.exports=function(t){var e=l.get(t);e.containerWidth=t.clientWidth,e.containerHeight=t.clientHeight,e.contentWidth=t.scrollWidth,e.contentHeight=t.scrollHeight;var i;t.contains(e.scrollbarXRail)||((i=s.queryChildren(t,".ps-scrollbar-x-rail")).length>0&&i.forEach(function(t){s.remove(t)}),s.appendTo(e.scrollbarXRail,t)),t.contains(e.scrollbarYRail)||((i=s.queryChildren(t,".ps-scrollbar-y-rail")).length>0&&i.forEach(function(t){s.remove(t)}),s.appendTo(e.scrollbarYRail,t)),!e.settings.suppressScrollX&&e.containerWidth+e.settings.scrollXMarginOffset<e.contentWidth?(e.scrollbarXActive=!0,e.railXWidth=e.containerWidth-e.railXMarginWidth,e.railXRatio=e.containerWidth/e.railXWidth,e.scrollbarXWidth=n(e,o.toInt(e.railXWidth*e.containerWidth/e.contentWidth)),e.scrollbarXLeft=o.toInt((e.negativeScrollAdjustment+t.scrollLeft)*(e.railXWidth-e.scrollbarXWidth)/(e.contentWidth-e.containerWidth))):e.scrollbarXActive=!1,!e.settings.suppressScrollY&&e.containerHeight+e.settings.scrollYMarginOffset<e.contentHeight?(e.scrollbarYActive=!0,e.railYHeight=e.containerHeight-e.railYMarginHeight,e.railYRatio=e.containerHeight/e.railYHeight,e.scrollbarYHeight=n(e,o.toInt(e.railYHeight*e.containerHeight/e.contentHeight)),e.scrollbarYTop=o.toInt(t.scrollTop*(e.railYHeight-e.scrollbarYHeight)/(e.contentHeight-e.containerHeight))):e.scrollbarYActive=!1,e.scrollbarXLeft>=e.railXWidth-e.scrollbarXWidth&&(e.scrollbarXLeft=e.railXWidth-e.scrollbarXWidth),e.scrollbarYTop>=e.railYHeight-e.scrollbarYHeight&&(e.scrollbarYTop=e.railYHeight-e.scrollbarYHeight),r(t,e),e.scrollbarXActive?a.add(t,"ps-active-x"):(a.remove(t,"ps-active-x"),e.scrollbarXWidth=0,e.scrollbarXLeft=0,c(t,"left",0)),e.scrollbarYActive?a.add(t,"ps-active-y"):(a.remove(t,"ps-active-y"),e.scrollbarYHeight=0,e.scrollbarYTop=0,c(t,"top",0))}},{"../lib/class":2,"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-scroll":20}],20:[function(t,e,i){"use strict";var n,r,o=t("./instances"),a=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!0),e};e.exports=function(t,e,i){if(void 0===t)throw"You must provide an element to the update-scroll function";if(void 0===e)throw"You must provide an axis to the update-scroll function";if(void 0===i)throw"You must provide a value to the update-scroll function";"top"===e&&i<=0&&(t.scrollTop=i=0,t.dispatchEvent(a("ps-y-reach-start"))),"left"===e&&i<=0&&(t.scrollLeft=i=0,t.dispatchEvent(a("ps-x-reach-start")));var s=o.get(t);"top"===e&&i>=s.contentHeight-s.containerHeight&&((i=s.contentHeight-s.containerHeight)-t.scrollTop<=1?i=t.scrollTop:t.scrollTop=i,t.dispatchEvent(a("ps-y-reach-end"))),"left"===e&&i>=s.contentWidth-s.containerWidth&&((i=s.contentWidth-s.containerWidth)-t.scrollLeft<=1?i=t.scrollLeft:t.scrollLeft=i,t.dispatchEvent(a("ps-x-reach-end"))),n||(n=t.scrollTop),r||(r=t.scrollLeft),"top"===e&&i<n&&t.dispatchEvent(a("ps-scroll-up")),"top"===e&&i>n&&t.dispatchEvent(a("ps-scroll-down")),"left"===e&&i<r&&t.dispatchEvent(a("ps-scroll-left")),"left"===e&&i>r&&t.dispatchEvent(a("ps-scroll-right")),"top"===e&&(t.scrollTop=n=i,t.dispatchEvent(a("ps-scroll-y"))),"left"===e&&(t.scrollLeft=r=i,t.dispatchEvent(a("ps-scroll-x")))}},{"./instances":18}],21:[function(t,e,i){"use strict";var n=t("../lib/helper"),r=t("../lib/dom"),o=t("./instances"),a=t("./update-geometry"),s=t("./update-scroll");e.exports=function(t){var e=o.get(t);e&&(e.negativeScrollAdjustment=e.isNegativeScroll?t.scrollWidth-t.clientWidth:0,r.css(e.scrollbarXRail,"display","block"),r.css(e.scrollbarYRail,"display","block"),e.railXMarginWidth=n.toInt(r.css(e.scrollbarXRail,"marginLeft"))+n.toInt(r.css(e.scrollbarXRail,"marginRight")),e.railYMarginHeight=n.toInt(r.css(e.scrollbarYRail,"marginTop"))+n.toInt(r.css(e.scrollbarYRail,"marginBottom")),r.css(e.scrollbarXRail,"display","none"),r.css(e.scrollbarYRail,"display","none"),a(t),s(t,"top",t.scrollTop),s(t,"left",t.scrollLeft),r.css(e.scrollbarXRail,"display",""),r.css(e.scrollbarYRail,"display",""))}},{"../lib/dom":3,"../lib/helper":6,"./instances":18,"./update-geometry":19,"./update-scroll":20}]},{},[1]),function(t){"use strict";if(!t.fn.perfectScrollbar)throw new Error("perfect-scrollbar.jquery.js required.");var e="rtl"===t("html").attr("dir"),i=t.fn.perfectScrollbar;t.fn.perfectScrollbar=function(n){return this.each(function(){var r=this,o=t(this).attr("data-ps-id");i.call(t(this),n),e&&!o?(o=t(this).attr("data-ps-id"))&&t(window).on("resize.ps."+o,function(){return t(r).perfectScrollbar("update")}):e&&o&&"destroy"===n&&t(window).off("resize.ps."+o)})}}(jQuery);var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxSidebar=function(t){"use strict";var e="pxSidebar",i="px.sidebar",n="."+i,r=t.fn[e],o={NAVBAR_FIXED:"px-navbar-fixed",LEFT:"px-sidebar-left"},a={RESIZE:"resize"+n,SCROLL:"scroll"+n,CLICK_DATA_API:"click.px.sidebar.data-api",EXPAND:"expand"+n,EXPANDED:"expanded"+n,COLLAPSE:"collapse"+n,COLLAPSED:"collapsed"+n},s={DATA_TOGGLE:'[data-toggle="sidebar"]',CONTENT:".px-sidebar-content",NAVBAR_HEADER:".navbar-header"},l={width:null,enableScrollbar:!0,desktopMode:["lg","xl"],navbarSelector:"> .px-navbar"},c=function(){function r(e,i){_classCallCheck(this,r),this.uniqueId=pxUtil.generateUniqueId(),this.element=e,this.$content=t(e).find(s.CONTENT),this.parent=e.parentNode,this.config=this._getConfig(i),this._isRtl="rtl"===t("html").attr("dir"),this._setWidth(),this._setScrollbar(),this._checkMode(),this._setListeners()}return _createClass(r,[{key:"toggle",value:function(){this._triggerPreventableEvent(pxUtil.hasClass(this.element,"open")?"COLLAPSE":"EXPAND",this.element)&&(pxUtil.toggleClass(this.element,"open"),this._triggerEvent(pxUtil.hasClass(this.element,"open")?"EXPANDED":"COLLAPSED",this.element))}},{key:"update",value:function(){var e=t(this.parent).find(this.config.navbarSelector+" "+s.NAVBAR_HEADER);if(e.length){var i=e.height();if(pxUtil.hasClass(this.parent,o.NAVBAR_FIXED)||!this._positioning)this.element.style.top=i+"px";else{var n=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop||0;this.element.style.top=n>i?"0px":i-n+"px"}}this.config.enableScrollbar&&this.$content.perfectScrollbar("update")}},{key:"destroy",value:function(){this._unsetListeners(),this._unsetScrollbar(),t(this.element).removeData(i)}},{key:"_setWidth",value:function(){var e=parseInt(this.config.width||t(this.element).width(),10),i=void 0;i=this._isRtl?pxUtil.hasClass(this.element,o.LEFT)?"right":"left":pxUtil.hasClass(this.element,o.LEFT)?"left":"right",this.element.style.width=e+"px",this.element.style[i]="-"+e+"px"}},{key:"_checkMode",value:function(){this._positioning=-1!==this.config.desktopMode.indexOf(window.PixelAdmin.getScreenSize()),this.update()}},{key:"_setScrollbar",value:function(){if(this.config.enableScrollbar){if(!this.$content.length)throw new Error(".px-sidebar-content element is not found.");this.$content.perfectScrollbar()}}},{key:"_unsetScrollbar",value:function(){this.config.enableScrollbar&&this.$content.length&&this.$content.perfectScrollbar("destroy")}},{key:"_triggerEvent",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this.element).trigger(t.Event(this.constructor.Event[e],{target:i}),[n])}},{key:"_triggerPreventableEvent",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.Event(this.constructor.Event[e],{target:i});return t(this.element).trigger(r,[n]),!r.isDefaultPrevented()}},{key:"_setListeners",value:function(){t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,t.proxy(this._checkMode,this)).on(this.constructor.Event.SCROLL+"."+this.uniqueId,t.proxy(this.update,this))}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId).off(this.constructor.Event.SCROLL+"."+this.uniqueId)}},{key:"_getConfig",value:function(e){return t.extend({},this.constructor.Default,t(this.element).data(),e)}}],[{key:"_jQueryInterface",value:function(e){return this.each(function(){var n=t(this).data(i),o="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(n||(n=new r(this,o),t(this).data(i,n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'"');n[e]()}})}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return n}}]),r}();return t(document).on(a.CLICK_DATA_API,s.DATA_TOGGLE,function(e){e.preventDefault();var n=this.getAttribute("data-target"),r=n?t(n)[0]:null;r&&(t(r).data(i)||c._jQueryInterface.call(t(r),t(this).data()),c._jQueryInterface.call(t(r),"toggle"))}),t.fn[e]=c._jQueryInterface,t.fn[e].Constructor=c,t.fn[e].noConflict=function(){return t.fn[e]=r,c._jQueryInterface},c}(jQuery),_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxNavbar=function(t){"use strict";var e="pxNavbar",i=".px.navbar",n=t.fn[e],r={NAVBAR:"px-navbar",INNER:"px-navbar-collapse-inner",IN:"in",COLLAPSED:"collapsed"},o={DATA_TOGGLE:'.navbar-toggle[data-toggle="collapse"]',DROPDOWN_TOGGLE:'.dropdown-toggle[data-toggle="dropdown"]',COLLAPSE:".navbar-collapse",DROPDOWN:".dropdown"},a={CLICK_DATA_API:"click.px.navbar.data-api",RESIZE:"resize.px.navbar",CLICK:"click.px.navbar",MOUSEDOWN:"mousedown.px.navbar",COLLAPSE_SHOW:"show.bs.collapse.px.navbar",COLLAPSE_SHOWN:"shown.bs.collapse.px.navbar",COLLAPSE_HIDDEN:"hidden.bs.collapse.px.navbar",DROPDOWN_SHOWN:"shown.bs.dropdown.px.navbar",DROPDOWN_HIDDEN:"hidden.bs.dropdown.px.navbar"},s=function(){function n(e){if(_classCallCheck(this,n),!t.fn.perfectScrollbar)throw new Error('Scrolling feature requires the "perfect-scrollbar" plugin included.');this.uniqueId=pxUtil.generateUniqueId(),this.element=e,this.$collapse=t(e).find(o.COLLAPSE),this.$toggle=t(e).find(o.DATA_TOGGLE),this._scrollbarEnabled=0,this._curScrollTop=0,this.$collapse.length&&this.$toggle.length&&(this.$inner=this._setupInnerContainer(),this._setListeners())}return _createClass(n,[{key:"updateScrollbar",value:function(){this._scrollbarEnabled&&(this._updateHeight(),this.$inner.scrollTop(this._curScrollTop).perfectScrollbar("update"))}},{key:"destroy",value:function(){this._unsetListeners(),this._disableScrollbar(),this.$collapse.append(this.$inner.find("> *")),this.$inner.remove(),t(this.element).removeData("px.navbar")}},{key:"_updateHeight",value:function(){var e=t(window).height()-this.$collapse[0].offsetTop;this.$collapse.height(""),this.$collapse.height()>e&&this.$collapse.height(e+"px")}},{key:"_enableScrollbar",value:function(){this._scrollbarEnabled||(this._updateHeight(),this.$inner.perfectScrollbar({suppressScrollX:!0}),this._scrollbarEnabled=1)}},{key:"_disableScrollbar",value:function(){this._scrollbarEnabled&&(this.$collapse.height(""),this.$inner.perfectScrollbar("destroy"),this._scrollbarEnabled=0)}},{key:"_setupInnerContainer",value:function(){var e=t('<div class="'+r.INNER+'"></div>');return e.append(this.$collapse.find("> *")),this.$collapse.append(e),e}},{key:"_setListeners",value:function(){var e=this,i=this;t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,function(){e._scrollbarEnabled&&(e.$toggle.is(":visible")?(e._curScrollTop=e.$inner[0].scrollTop,e.updateScrollbar()):(e._disableScrollbar(),e.$collapse.removeClass(r.IN),e.$toggle.addClass(r.COLLAPSED),e.$collapse.attr("aria-expanded","false"),e.$toggle.attr("aria-expanded","false")))}),t(this.element).on(this.constructor.Event.COLLAPSE_SHOW,o.COLLAPSE,function(){e.$collapse.find(".dropdown.open").removeClass("open")}).on(this.constructor.Event.COLLAPSE_SHOWN,o.COLLAPSE,function(){e._enableScrollbar()}).on(this.constructor.Event.COLLAPSE_HIDDEN,o.COLLAPSE,function(){e._disableScrollbar()}).on(this.constructor.Event.DROPDOWN_SHOWN+" "+this.constructor.Event.DROPDOWN_HIDDEN,o.DROPDOWN,function(){e.updateScrollbar()}).on(this.constructor.Event.MOUSEDOWN,o.DROPDOWN_TOGGLE,function(){if(!e._scrollbarEnabled)return!0;e._curScrollTop=e.$inner[0].scrollTop}).on(this.constructor.Event.CLICK,o.DROPDOWN_TOGGLE,function(t){return!i._scrollbarEnabled||(!this.getAttribute("href")||"#"===this.getAttribute("href")||(t.preventDefault(),t.stopPropagation(),this.removeAttribute("data-toggle"),this.click(),void this.setAttribute("data-toggle","dropdown")))})}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId),t(this.element).off(i)}}],[{key:"_jQueryInterface",value:function(e){for(var i=arguments.length,r=Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];return this.each(function(){var i=t(this).data("px.navbar");if(i||(i=new n(this),t(this).data("px.navbar",i),t.support.transition||"true"!==t(this).find(o.DATA_TOGGLE).attr("aria-expanded")||i._enableScrollbar()),"string"==typeof e){if(!i[e])throw new Error('No method named "'+e+'"');i[e].apply(i,r)}})}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"px.navbar"}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return i}}]),n}();return t(document).on(a.CLICK_DATA_API,"."+r.NAVBAR+" "+o.DATA_TOGGLE,function(e){e.preventDefault();var i=t(this).parents("."+r.NAVBAR);i.length&&(i.data("px.navbar")||s._jQueryInterface.call(i))}),t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=n,s._jQueryInterface},s}(jQuery),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxNav=function(t){"use strict";var e="pxNav",i=t.fn[e],n={accordion:!0,transitionDuration:300,dropdownCloseDelay:400,enableTooltips:!0,animate:!0,storeState:!0,storagePrefix:"px-nav.",modes:{phone:["xs"],tablet:["sm","md"],desktop:["lg","xl"]}},r={NAV:"px-nav",NAV_LEFT:"px-nav-left",CONTENT:"px-nav-content",EXPAND:"px-nav-expand",STATIC:"px-nav-static",COLLAPSE:"px-nav-collapse",ANIMATE:"px-nav-animate",NAV_TRANSITIONING:"px-nav-transitioning",DIMMER:"px-nav-dimmer",FIXED:"px-nav-fixed",OFF_CANVAS:"px-nav-off-canvas",SCROLLABLE_AREA:"px-nav-scrollable-area",ITEM:"px-nav-item",TOOLTIP:"px-nav-tooltip",DROPDOWN:"px-nav-dropdown",DROPDOWN_MENU:"px-nav-dropdown-menu",DROPDOWN_MENU_TITLE:"px-nav-dropdown-menu-title",DROPDOWN_MENU_SHOW:"px-nav-dropdown-menu-show",DROPDOWN_MENU_WRAPPER:"px-nav-dropdown-menu-wrapper",DROPDOWN_MENU_TOP:"px-nav-dropdown-menu-top",OPEN:"px-open",SHOW:"px-show",FREEZE:"freeze",ACTIVE:"active",TRANSITIONING:"transitioning",PERFECT_SCROLLBAR_CONTAINER:"ps-container",NAVBAR_FIXED:"px-navbar-fixed"},o={DATA_TOGGLE:'[data-toggle="px-nav"]',CONTENT:".px-nav-content",ITEM:"> .px-nav-item",ITEM_LABEL:"> a > .px-nav-label",ROOT_LINK:"> .px-nav-item:not(.px-nav-dropdown) > a",DROPDOWN_LINK:".px-nav-dropdown > a",DROPDOWN_MENU:"> .px-nav-dropdown-menu",DROPDOWN_MENU_TITLE:"> .px-nav-dropdown-menu-title",OPENED_DROPDOWNS:"> .px-nav-dropdown.px-open",SHOWN_DROPDOWNS:"> .px-nav-dropdown.px-show",FROZEN_DROPDOWNS:".px-nav-dropdown.freeze",SCROLLABLE_AREA:".px-nav-scrollable-area",NEAR_NAVBAR:"~ .px-navbar"},a={CLICK_DATA_API:"click.px.nav.data-api",RESIZE:"resize.px.nav",CLICK:"click.px.nav",MOUSEENTER:"mouseenter.px.nav",MOUSELEAVE:"mouseleave.px.nav",SCROLL:"scroll.px.nav",INITIALIZED:"initialized",EXPAND:"expand.px.nav",EXPANDED:"expanded.px.nav",COLLAPSE:"collapse.px.nav",COLLAPSED:"collapsed.px.nav",DESTROY:"destroy.px.nav",DROPDOWN_OPEN:"dropdown-open.px.nav",DROPDOWN_OPENED:"dropdown-opened.px.nav",DROPDOWN_CLOSE:"dropdown-close.px.nav",DROPDOWN_CLOSED:"dropdown-closed.px.nav",DROPDOWN_FROZEN:"dropdown-frozen.px.nav",DROPDOWN_UNFROZEN:"dropdown-unfrozen.px.nav"},s={suppressScrollX:!0,wheelPropagation:!1,swipePropagation:!1},l=function(){function i(e,n){_classCallCheck(this,i),this.uniqueId=pxUtil.generateUniqueId(),this.element=e,this.content=t(e).find(o.CONTENT)[0],this.config=this._getConfig(n),this._curMode=this._getMode(),this._isCollapsed=this._getNavState(),this._stateChanging=0,this._setupMarkup(),this.dimmer=t(e).parent().find("> ."+r.DIMMER)[0],this._setListeners(),this._restoreNavState(),this._detectActiveItem(),this._enableAnimation(),this._checkNavbarPosition(),this._triggerEvent("INITIALIZED",e)}return _createClass(i,[{key:"toggle",value:function(){this["desktop"!==this._curMode&&pxUtil.hasClass(this.element,r.EXPAND)||"desktop"===this._curMode&&!pxUtil.hasClass(this.element,r.COLLAPSE)?"collapse":"expand"]()}},{key:"expand",value:function(){("phone"===this._curMode||this.isCollapsed())&&("phone"===this._curMode&&pxUtil.hasClass(this.element,r.EXPAND)||this._triggerPreventableEvent("EXPAND",this.element)&&("phone"!==this._curMode&&this.closeAllDropdowns(),this.config.enableTooltips&&this._clearTooltips(),this._changeNavState(function(){var i=this;if("desktop"!==this._curMode){var n=this;t(this.element).parent().find("> ."+r.EXPAND).each(function(){this!==n.element&&t(this)[e]("collapse")}),t(this.dimmer).on(this.constructor.Event.CLICK,function(){return i.collapse()}),pxUtil.addClass(this.element,r.EXPAND)}else pxUtil.removeClass(this.element,r.COLLAPSE);this._triggerEvent("EXPANDED",this.element)})))}},{key:"collapse",value:function(){this.isCollapsed()||this._triggerPreventableEvent("COLLAPSE",this.element)&&this._changeNavState(function(){"desktop"!==this._curMode?(t(this.dimmer).off("click"),pxUtil.removeClass(this.element,r.EXPAND)):pxUtil.addClass(this.element,r.COLLAPSE),t(window).trigger("scroll"),this._triggerEvent("COLLAPSED",this.element)})}},{key:"isFixed",value:function(){return pxUtil.hasClass(this.element,r.FIXED)}},{key:"isStatic",value:function(){return pxUtil.hasClass(this.element,r.STATIC)}},{key:"isCollapsed",value:function(){return this._isCollapsed}},{key:"activateItem",value:function(e){var i=this._getNode(e,r.ITEM);if(!pxUtil.hasClass(i,r.DROPDOWN)&&(t(this.element).find("."+r.ITEM+"."+r.ACTIVE).removeClass(r.ACTIVE),pxUtil.addClass(i,r.ACTIVE),!pxUtil.hasClass(i.parentNode,r.CONTENT)))if(pxUtil.hasClass(i.parentNode,r.DROPDOWN_MENU_WRAPPER)){var n=t(i).parents("."+r.DROPDOWN_MENU).data("dropdown");if(!n)return;n.addClass(r.ACTIVE)}else{var a=t(i).parents("."+r.DROPDOWN)[0],s=void 0;for(this.openDropdown(a,!1);a;)if(pxUtil.addClass(a,r.ACTIVE),pxUtil.hasClass(a.parentNode,r.DROPDOWN_MENU_WRAPPER)){if(s=t(a).parents("."+r.DROPDOWN_MENU).data("dropdown"),a=null,!s)return;pxUtil.addClass(s,r.ACTIVE)}else s=a,a=t(a).parents("."+r.DROPDOWN)[0];this.isCollapsed()&&(t(this.content).find(o.OPENED_DROPDOWNS).removeClass(r.OPEN),pxUtil.addClass(s,r.OPEN))}}},{key:"openDropdown",value:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._getNode(e);if((!this.isStatic()||this._isFloatingDropdown(n))&&(this._isFloatingDropdown(n)&&!i||this.isDropdownOpened(n)||this._triggerPreventableEvent("DROPDOWN_OPEN",n))){for(var o=this.isDropdownOpened(n)?[]:[n],a=n;a=t(a).parents("."+r.DROPDOWN)[0];)this.isDropdownOpened(a)||o.push(a);var s=o.pop();if(s){for(var l=0,c=o.length;l<c;l++)this._expandDropdown(o[l],!1);if(this._isFloatingDropdown(s)){if(!i)return;this._showDropdown(s)}else this._expandDropdown(s,!0)}}}},{key:"closeDropdown",value:function(t){var e=this._getNode(t);this.isDropdownOpened(e)&&(this.isStatic()&&!this._isFloatingDropdown(e)||this._triggerPreventableEvent("DROPDOWN_CLOSE",e)&&(this._isFloatingDropdown(e)?this._hideDropdown(e):this._collapseDropdown(e,!0)))}},{key:"toggleDropdown",value:function(t){var e=this._getNode(t);this[this.isDropdownOpened(e)?"closeDropdown":"openDropdown"](e)}},{key:"closeAllDropdowns",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t(this.element).find("."+r.CONTENT);this._closeAllDropdowns(this._getNode(e,null))}},{key:"freezeDropdown",value:function(t){var e=this._getNode(t);this._isFloatingDropdown(e)&&this.isDropdownOpened(e)&&(pxUtil.hasClass(e,r.FREEZE)||(pxUtil.addClass(e,r.FREEZE),this._clearDropdownTimer(e),this._triggerEvent("DROPDOWN_FROZEN",e)))}},{key:"unfreezeDropdown",value:function(t){var e=this._getNode(t);this._isFloatingDropdown(e)&&this.isDropdownOpened(e)&&pxUtil.hasClass(e,r.FREEZE)&&(pxUtil.removeClass(e,r.FREEZE),this._triggerEvent("DROPDOWN_UNFROZEN",e))}},{key:"getDropdownContainer",value:function(e){var i=this._getNode(e);return this._isFloatingDropdown(i)&&this.isDropdownOpened(i)?t(t(i).data("dropdown")).find("."+r.DROPDOWN_MENU_WRAPPER):t(i).find(o.DROPDOWN_MENU)}},{key:"isFloatingDropdown",value:function(t){return this._isFloatingDropdown(this._getNode(t))}},{key:"isDropdownOpened",value:function(t){var e=this._getNode(t),i=this._isRootDropdown(e),n=this.isCollapsed();return n&&i&&pxUtil.hasClass(e,r.SHOW)||n&&!i&&pxUtil.hasClass(e,r.OPEN)||!n&&pxUtil.hasClass(e,r.OPEN)}},{key:"isDropdownFrozen",value:function(t){return pxUtil.hasClass(this._getNode(t),r.FREEZE)}},{key:"append",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.insert(t,null,e)}},{key:"prepend",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.insert(t,0,e)}},{key:"insert",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this._getNodeOrCreate(e,r.ITEM,!1);if(a.hasClass(r.DROPDOWN)&&!a.find(o.DROPDOWN_MENU).length)throw new Error("The ."+r.DROPDOWN+" item(s) must contain the child ."+r.DROPDOWN_MENU+" element.");var s=null===n?t(this.content):this._getNode(n,r.DROPDOWN,!1),l=void 0;if(s.hasClass(r.CONTENT))l=s;else if(!(l=this._isFloatingDropdown(s[0])&&this.isDropdownOpened(s[0])?t(s.data("dropdown")).find("."+r.DROPDOWN_MENU_WRAPPER):s.find(o.DROPDOWN_MENU)).length)throw new Error("Targeted element is not found.");var c=l.find(o.ITEM);if(c.length)if(null===i)a.insertAfter(c.last());else{var h=c.eq(i);h.length?a.insertBefore(h):a.insertAfter(c.last())}else l.append(a);return!this.isCollapsed()||s.hasClass(r.CONTENT)?this._updateScrollbar(this.content):l.hasClass(r.DROPDOWN_MENU_WRAPPER)?this._updateScrollbar(l[0]):this._updateScrollbar(l.parents("."+r.DROPDOWN_MENU_WRAPPER)[0]),a}},{key:"remove",value:function(e){var i=this._getNode(e,r.ITEM,!1),n=i.parent();i.hasClass(r.DROPDOWN)&&t(i.data("dropdown")).remove(),i.remove(),!this.isCollapsed()||n.hasClass(r.CONTENT)?this._updateScrollbar(this.content):n.hasClass(r.DROPDOWN_MENU_WRAPPER)?this._updateScrollbar(n[0]):this._updateScrollbar(n.parents("."+r.DROPDOWN_MENU_WRAPPER)[0])}},{key:"destroy",value:function(){if(this._triggerPreventableEvent("DESTROY",this.element)){this._unsetListeners(),t(this.element).removeData("px.nav"),pxUtil.removeClass(this.element,r.ANIMATE),pxUtil.removeClass(this.element,r.TRANSITIONING),pxUtil.removeClass(this.element,r.EXPAND),this.isCollapsed()&&this.closeAllDropdowns();var e=0;t(this.element.parentNode).find("> ."+r.NAV).each(function(){t(this).data("px.nav")&&e++}),e||t(this.dimmer).remove(),t(this.element).find("."+r.CONTENT).perfectScrollbar("destroy"),t(this.content).unwrap(o.SCROLLABLE_AREA)}}},{key:"_getNode",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.DROPDOWN,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o="string"==typeof e?t(this.element).find(e):t(e);if(!o.length)throw new Error("Element is not found.");if(i&&!o.hasClass(i))throw new Error("Element(s) must have the ."+i+" class.");return n?o[0]:o}},{key:"_getNodeOrCreate",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.DROPDOWN,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._getNode("string"!=typeof e||"#"!==e[0]&&"."!==e[0]?t(e):e,i,n)}},{key:"_detectActiveItem",value:function(){var e=t(this.content).find("."+r.ITEM+"."+r.ACTIVE+":not(."+r.DROPDOWN+")");e.length&&this.activateItem(e.first())}},{key:"_expandDropdown",value:function(e){function i(){a.removeClass(r.TRANSITIONING).height(""),this._updateScrollbar(this.isCollapsed()?t(e).parents("."+r.DROPDOWN_MENU_WRAPPER)[0]:this.content),this._triggerEvent("DROPDOWN_OPENED",e)}var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!pxUtil.hasClass(e,r.OPEN)){var a=t(e).find(o.DROPDOWN_MENU);if(this.config.accordion&&this._closeAllDropdowns(e.parentNode,n,t(e)),pxUtil.addClass(e,r.OPEN),!t.support.transition||!n)return i.call(this);a.height(0).addClass(r.TRANSITIONING).one("bsTransitionEnd",t.proxy(i,this)).emulateTransitionEnd(this.config.transitionDuration).height(a[0].scrollHeight)}}},{key:"_collapseDropdown",value:function(e){function i(){pxUtil.removeClass(e,r.OPEN),a.removeClass(r.TRANSITIONING).height(""),t(e).find("."+r.OPEN).removeClass(r.OPEN),this._updateScrollbar(this.isCollapsed()?t(e).parents("."+r.DROPDOWN_MENU_WRAPPER)[0]:this.content),this._triggerEvent("DROPDOWN_CLOSED",e)}var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(pxUtil.hasClass(e,r.OPEN)){var a=t(e).find(o.DROPDOWN_MENU);if(!t.support.transition||!n)return i.call(this);a.height(a.height())[0].offsetHeight,a.addClass(r.TRANSITIONING).height(0).one("bsTransitionEnd",t.proxy(i,this)).emulateTransitionEnd(this.config.transitionDuration)}}},{key:"_showDropdown",value:function(e){var i=this;if(!pxUtil.hasClass(e,r.SHOW)&&this._isRootDropdown(e)){var n=e.parentNode.parentNode,a=t(e).find(o.DROPDOWN_MENU)[0];if(a){this.closeAllDropdowns();var l=e.parentNode.offsetTop,c=e.offsetTop-e.parentNode.scrollTop,h=t('<div class="'+r.DROPDOWN_MENU_TITLE+'"></div>').html(t(e).find(o.ITEM_LABEL).html()).prependTo(a);pxUtil.addClass(e,r.SHOW),pxUtil.addClass(a,r.SHOW),n.appendChild(a);var u=t(e).outerHeight(),d=t(a).find(o.ITEM),f=d.first().find("> a").outerHeight(),p=t(this.element).outerHeight()-l,g=h.outerHeight(),m=g+3*f,v=t('<div class="'+r.DROPDOWN_MENU_WRAPPER+'"></div>').append(d).appendTo(a)[0],y=void 0;c+m>p?(y=c,this.isFixed()||"tablet"===this._curMode?a.style.bottom=p-c-u+"px":a.style.bottom="0px",pxUtil.addClass(a,r.DROPDOWN_MENU_TOP),a.appendChild(h[0])):(y=p-c-g,a.style.top=l+c+"px",a.insertBefore(h[0],a.firstChild)),v.style.maxHeight=y-10+"px",t(v).perfectScrollbar(s),t(a).on(this.constructor.Event.MOUSEENTER,function(){return i._clearDropdownTimer(e)}).on(this.constructor.Event.MOUSELEAVE,function(){return i._setDropdownTimer(e)}),t(e).data("dropdown",a),t(a).data("element",e),this._updateScrollbar(e.parentNode),this._triggerEvent("DROPDOWN_OPENED",e)}}}},{key:"_hideDropdown",value:function(e){if(pxUtil.hasClass(e,r.SHOW)){var i=t(e).data("dropdown");if(i){pxUtil.removeClass(e,[r.SHOW,r.FREEZE]),pxUtil.removeClass(i,r.SHOW),pxUtil.removeClass(i,r.DROPDOWN_MENU_TOP),this.unfreezeDropdown(e);var n=t(i).find("."+r.DROPDOWN_MENU_WRAPPER);t(i).find("."+r.DROPDOWN_MENU_TITLE).remove(),t(i).append(n.find(o.ITEM)),n.perfectScrollbar("destroy").remove(),i.setAttribute("style",""),e.appendChild(i),t(e).data("dropdown",null),t(i).data("element",null),this._clearDropdownTimer(e),t(i).off("mouseenter").off("mouseleave"),this._updateScrollbar(e.parentNode),this._triggerEvent("DROPDOWN_CLOSED",e)}}}},{key:"_showTooltip",value:function(e){this._clearTooltips();var i=t(e).find(".px-nav-label").contents().filter(function(){return 3===this.nodeType}).text(),n=t('<div class="'+r.TOOLTIP+'"></div>').text(i)[0],o=e.parentNode.offsetTop,a=e.offsetTop-e.parentNode.scrollTop;n.style.top=o+a+"px",t(n).data("dropdown",e),e.parentNode.parentNode.appendChild(n)}},{key:"_updateTooltipPosition",value:function(){var e=t(this.element).find("."+r.TOOLTIP)[0];if(e){var i=t(e).data("dropdown");if(i){var n=i.parentNode.offsetTop,o=i.offsetTop-i.parentNode.scrollTop;e.style.top=n+o+"px"}else t(e).remove()}}},{key:"_clearTooltips",value:function(){t(this.element).find("."+r.TOOLTIP).remove()}},{key:"_closeAllDropdowns",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=this,s=void 0,l=void 0,c=e;this.isCollapsed()&&pxUtil.hasClass(c,r.CONTENT)?(s=o.SHOWN_DROPDOWNS,l="_hideDropdown"):(this._isFloatingDropdown(c)&&this.isDropdownOpened(c)?c=t(t(c).data("dropdown")).find("."+r.DROPDOWN_MENU_WRAPPER)[0]:pxUtil.hasClass(c,r.DROPDOWN)&&(c=t(c).find(o.DROPDOWN_MENU)[0]),s=o.OPENED_DROPDOWNS,l="_collapseDropdown"),t(c).find(s).each(function(){n&&n===t(this)||a[l](this,i)})}},{key:"_isRootDropdown",value:function(t){return pxUtil.hasClass(t.parentNode,r.CONTENT)}},{key:"_isFloatingDropdown",value:function(t){return this.isCollapsed()&&this._isRootDropdown(t)}},{key:"_getNavState",value:function(){return("phone"===this._curMode||"tablet"===this._curMode)&&!pxUtil.hasClass(this.element,r.EXPAND)||"desktop"===this._curMode&&pxUtil.hasClass(this.element,r.COLLAPSE)}},{key:"_setDropdownTimer",value:function(e){var i=this;if(!this.isDropdownFrozen(e)){this._clearDropdownTimer(e);var n=setTimeout(function(){i.isDropdownFrozen(e)||i._hideDropdown(e)},this.config.dropdownCloseDelay);t(e).data("timer",n)}}},{key:"_clearDropdownTimer",value:function(e){var i=t(e).data("timer");i&&clearTimeout(i)}},{key:"_updateScrollbar",value:function(e){e&&pxUtil.hasClass(e,r.PERFECT_SCROLLBAR_CONTAINER)&&t(e).perfectScrollbar("update")}},{key:"_changeNavState",value:function(e){function i(){this._stateChanging=this._stateChanging<2?0:this._stateChanging-1,this._stateChanging||pxUtil.removeClass(this.element,r.NAV_TRANSITIONING),this._updateScrollbar(this.content),pxUtil.triggerResizeEvent()}if(this._stateChanging++,this.config.animate&&t.support.transition&&pxUtil.addClass(this.element,r.NAV_TRANSITIONING),e.call(this),this._isCollapsed=this._getNavState(),this._storeNavState(),!this.config.animate||!t.support.transition)return i.call(this);t(this.element).one("bsTransitionEnd",t.proxy(i,this)).emulateTransitionEnd(this.config.transitionDuration)}},{key:"_getMode",value:function(){var t=window.PixelAdmin.getScreenSize(),e=void 0;if(-1!==this.config.modes.phone.indexOf(t))e="phone";else if(-1!==this.config.modes.tablet.indexOf(t))e="tablet";else{if(-1===this.config.modes.desktop.indexOf(t))throw new Error("Cannot determine PxNav mode.");e="desktop"}return e}},{key:"_prefixStorageKey",value:function(t){return this.config.storagePrefix+(pxUtil.hasClass(this.element,r.NAV_LEFT)?"left.":"right.")+t}},{key:"_storeNavState",value:function(){if(this.config.storeState){var t=this._prefixStorageKey("state"),e=pxUtil.hasClass(this.element,r.COLLAPSE)?"collapsed":"expanded";window.PixelAdmin.storage.set(t,e)}}},{key:"_restoreNavState",value:function(){if(this.config.storeState){var t=this._prefixStorageKey("state"),e=window.PixelAdmin.storage.get(t)||"expanded";pxUtil["collapsed"===e?"addClass":"removeClass"](this.element,r.COLLAPSE),this._isCollapsed=this._getNavState(),pxUtil.triggerResizeEvent()}}},{key:"_checkNavbarPosition",value:function(){if(this.isFixed()){var e=t(this.element).find(o.NEAR_NAVBAR)[0];e&&(pxUtil.hasClass(e.parentNode,r.NAVBAR_FIXED)||(console.warn("The "+(pxUtil.hasClass(this.element,r.NAV_LEFT)?"left":"right")+" .px-nav is fixed, but the coterminous .px-navbar isn't. You need to explicitly add the ."+r.NAVBAR_FIXED+" class to the parent element to fix the navbar."),pxUtil.addClass(e.parentNode,r.NAVBAR_FIXED)))}}},{key:"_setupMarkup",value:function(){var e=t(this.element).parent();if(e.find("> ."+r.DIMMER).length||e.append('<div class="'+r.DIMMER+'"></div>'),!t.fn.perfectScrollbar)throw new Error('Scrolling feature requires the "perfect-scrollbar" plugin included.');var i=t(this.content);i.length&&i.wrap('<div class="'+r.SCROLLABLE_AREA+'"></div>').perfectScrollbar(s)}},{key:"_setListeners",value:function(){var e=this,i=this;t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,function(){i._curMode=i._getMode(),i._isCollapsed=i._getNavState(),i.isCollapsed()&&i.closeAllDropdowns(),i.config.enableTooltips&&i._clearTooltips(),i._updateScrollbar(i.content)}),t(this.element).on(this.constructor.Event.CLICK,o.DROPDOWN_LINK,function(t){t.preventDefault();var e=this.parentNode;i._isFloatingDropdown(e)?i.isDropdownOpened(e)?i[i.isDropdownFrozen(e)?"closeDropdown":"freezeDropdown"](e):(i.openDropdown(e),i.freezeDropdown(e)):i.toggleDropdown(e)}),t(this.content).on(this.constructor.Event.MOUSEENTER,o.DROPDOWN_LINK,function(){if(!window.PixelAdmin.isMobile){var e=this.parentNode;if(i._isFloatingDropdown(e)&&!pxUtil.hasClass(i.element,r.OFF_CANVAS))if(i.isDropdownOpened(e))i._clearDropdownTimer(e);else{if(t(i.element).find(o.FROZEN_DROPDOWNS).length)return;i.openDropdown(e)}}}).on(this.constructor.Event.MOUSELEAVE,o.DROPDOWN_LINK,function(){if(!window.PixelAdmin.isMobile){var t=this.parentNode;i._isFloatingDropdown(t)&&i.isDropdownOpened(t)&&i._setDropdownTimer(t)}}).on(this.constructor.Event.MOUSEENTER,o.ROOT_LINK,function(){window.PixelAdmin.isMobile||i.config.enableTooltips&&i.isCollapsed()&&!pxUtil.hasClass(i.element,r.OFF_CANVAS)&&i._showTooltip(this.parentNode)}).on(this.constructor.Event.MOUSELEAVE,o.ROOT_LINK,function(){window.PixelAdmin.isMobile||i.config.enableTooltips&&i._clearTooltips()}).on(this.constructor.Event.SCROLL,function(){e.isCollapsed()&&(e.config.enableTooltips&&e._updateTooltipPosition(),e.closeAllDropdowns())})}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId),t(this.element).off(".px.nav"),t(this.content).off(".px.nav").find("."+r.DROPDOWN_MENU).off(".px.nav"),"desktop"!==this._curMode&&pxUtil.hasClass(this.element,r.EXPAND)&&t(this.dimmer).off(".px.nav")}},{key:"_enableAnimation",value:function(){var t=this;this.config.animate&&(pxUtil.addClass(this.element,["off",r.ANIMATE]),setTimeout(function(){pxUtil.removeClass(t.element,"off")},this.config.transitionDuration))}},{key:"_triggerEvent",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this.element).trigger(t.Event(this.constructor.Event[e],{target:i}),[n])}},{key:"_triggerPreventableEvent",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.Event(this.constructor.Event[e],{target:i});return t(this.element).trigger(r,[n]),!r.isDefaultPrevented()}},{key:"_getConfig",value:function(e){return t.extend({},this.constructor.Default,t(this.element).data(),e)}}],[{key:"_jQueryInterface",value:function(e){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=void 0,s=this.each(function(){var n=t(this).data("px.nav"),o="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(n||(n=new i(this,o),t(this).data("px.nav",n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'"');a=n[e].apply(n,r)}});return void 0!==a?a:s}},{key:"Default",get:function(){return n}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"px.nav"}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return".px.nav"}}]),i}();return t(document).on(a.CLICK_DATA_API,o.DATA_TOGGLE,function(e){e.preventDefault();var i=t(t(this).data("target"));i.length||(i=t(this).parents("."+r.NAV)),i.length&&(i.data("px.nav")||l._jQueryInterface.call(i,t(this).data()),l._jQueryInterface.call(i,"toggle"))}),t.fn[e]=l._jQueryInterface,t.fn[e].Constructor=l,t.fn[e].noConflict=function(){return t.fn[e]=i,l._jQueryInterface},l}(jQuery),_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxFooter=function(t){"use strict";var e="pxFooter",i=t.fn[e],n={CONTENT:"px-content",BOTTOM:"px-footer-bottom",FIXED:"px-footer-fixed"},r={RESIZE:"resize.px.footer",SCROLL:"scroll.px.footer",NAV_EXPANDED:"expanded.px.nav",NAV_COLLAPSED:"collapsed.px.nav",DROPDOWN_OPENED:"dropdown-opened.px.nav",DROPDOWN_CLOSED:"dropdown-closed.px.nav"},o=function(){function i(t){_classCallCheck(this,i),this.uniqueId=pxUtil.generateUniqueId(),this.element=t,this.parent=this._getParent(t),this._setListeners(),this.update()}return _createClass(i,[{key:"update",value:function(){this.parent===document.body&&(this._curScreenSize=window.PixelAdmin.getScreenSize(),this._updateBodyMinHeight());var e=t(this.element.parentNode).find("> ."+n.CONTENT)[0];pxUtil.hasClass(this.element,n.BOTTOM)||pxUtil.hasClass(this.element,n.FIXED)?e.style.paddingBottom=t(this.element).outerHeight()+20+"px":e.style.paddingBottom=e.setAttribute("style",(e.getAttribute("style")||"").replace(/\s*padding-bottom:\s*\d+px\s*;?/i))}},{key:"destroy",value:function(){this._unsetListeners(),t(this.element).removeData("px.footer"),t(document.body).css("min-height","");var e=t(this.element.parentNode).find("> ."+n.CONTENT)[0];e.style.paddingBottom=e.setAttribute("style",(e.getAttribute("style")||"").replace(/\s*padding-bottom:\s*\d+px\s*;?/i))}},{key:"_getParent",value:function(t){for(var e=t.parentNode;"ui-view"===e.nodeName.toLowerCase();)e=e.parentNode;return e}},{key:"_updateBodyMinHeight",value:function(){document.body.style.minHeight&&(document.body.style.minHeight=null),"lg"!==this._curScreenSize&&"xl"!==this._curScreenSize||!pxUtil.hasClass(this.element,n.BOTTOM)||t(document.body).height()>=document.body.scrollHeight||(document.body.style.minHeight=document.body.scrollHeight+"px")}},{key:"_setListeners",value:function(){t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,t.proxy(this.update,this)).on(this.constructor.Event.SCROLL+"."+this.uniqueId,t.proxy(this._updateBodyMinHeight,this)).on(this.constructor.Event.NAV_EXPANDED+"."+this.uniqueId+" "+this.constructor.Event.NAV_COLLAPSED+"."+this.uniqueId,".px-nav",t.proxy(this._updateBodyMinHeight,this)),this.parent===document.body&&t(".px-nav").on(this.constructor.Event.DROPDOWN_OPENED+"."+this.uniqueId+" "+this.constructor.Event.DROPDOWN_CLOSED+"."+this.uniqueId,".px-nav-dropdown",t.proxy(this._updateBodyMinHeight,this))}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId+" "+this.constructor.Event.SCROLL+"."+this.uniqueId).off(this.constructor.Event.NAV_EXPANDED+"."+this.uniqueId+" "+this.constructor.Event.NAV_COLLAPSED+"."+this.uniqueId),t(".px-nav").off(this.constructor.Event.DROPDOWN_OPENED+"."+this.uniqueId+" "+this.constructor.Event.DROPDOWN_CLOSED+"."+this.uniqueId)}}],[{key:"_jQueryInterface",value:function(e){return this.each(function(){var n=t(this).data("px.footer");if(n||(n=new i(this),t(this).data("px.footer",n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'"');n[e]()}})}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"px.footer"}},{key:"Event",get:function(){return r}},{key:"EVENT_KEY",get:function(){return".px.footer"}}]),i}();return t.fn[e]=o._jQueryInterface,t.fn[e].Constructor=o,t.fn[e].noConflict=function(){return t.fn[e]=i,o._jQueryInterface},o}(jQuery),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_slicedToArray=function(){function t(t,e){var i=[],n=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){r=!0,o=t}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}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")}}(),_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxWizard=function(t){"use strict";var e="pxWizard",i=".px.wizard",n=t.fn[e],r={minStepWidth:200},o={WRAPPER:"wizard-wrapper",STEPS:"wizard-steps",PANE:"wizard-pane",FROZEN:"frozen",FINISHED:"finished",ACTIVE:"active",COMPLETED:"completed"},a={RESIZE:"resize.px.wizard",CLICK:"click.px.wizard",CHANGE:"stepchange.px.wizard",CHANGED:"stepchanged.px.wizard",FINISH:"finish.px.wizard",FINISHED:"finished.px.wizard",FROZEN:"frozen.px.wizard",UNFROZEN:"unfrozen.px.wizard",RESETED:"reseted.px.wizard",DESTROY:"destroy.px.wizard"},s=function(){function n(e,i){_classCallCheck(this,n),this.uniqueId=pxUtil.generateUniqueId(),this.element=e,this.steps=t(e).find("."+o.STEPS)[0],this.stepItems=t(this.steps).find("li"),this.wrapper=t(e).find("."+o.WRAPPER)[0],this.config=this._getConfig(i),this.activeStep=null,this._isRtl="rtl"===t("html").attr("dir"),this._resetStepsWidth(),this.resizeStepItems(),this.goTo(this.getActiveStepIndex()),this._setListeners()}return _createClass(n,[{key:"resizeStepItems",value:function(){for(var e=this.stepItems.length,i=t(this.wrapper).width(),n=i>this.config.minStepWidth*e?Math.floor(i/e):this.config.minStepWidth,r=0;r<e;r++)this._setStrictWidth(this.stepItems[r],n);null!==this.activeStep&&this._placeStepsContainer()}},{key:"getActiveStepIndex",value:function(){var e=this.activeStep||t(this.steps).find("li."+o.ACTIVE)[0];return e?this._getStepIndex(e):0}},{key:"getStepCount",value:function(){return this.stepItems.length}},{key:"goTo",value:function(t){if(!this.isFrozen()&&!this.isFinished()){var e=void 0,i=void 0,n=void 0,r=this._getStepItemAndTarget(t),o=_slicedToArray(r,3);i=o[0],e=o[1],n=o[2];var a=this.activeStep?this._getStepIndex(this.activeStep):null;null!==a&&i===a||(null===a||this._triggerPreventableEvent("CHANGE",this.element,{activeStepIndex:a,nextStepIndex:i}))&&(this.activeStep=e,this._activateStepItem(e,i),this._activateStepPane(n),null!==a&&this._triggerEvent("CHANGED",this.element,{prevStepIndex:a,activeStepIndex:i}))}}},{key:"getPaneByIndex",value:function(e){var i=void 0,n=this._getStepItemAndTarget(e),r=_slicedToArray(n,3);return r[0],r[1],i=r[2],t(i)}},{key:"getActivePane",value:function(){return this.getPaneByIndex(this.getActiveStepIndex())}},{key:"goNext",value:function(){if(!this.isFrozen()&&!this.isFinished()){var t=this._getStepIndex(this.activeStep)+1;if(t>=this.stepItems.length)return this.finish();this.goTo(t)}}},{key:"goPrev",value:function(){if(!this.isFrozen()&&!this.isFinished()){var t=this._getStepIndex(this.activeStep)-1;t<0||this.goTo(t)}}},{key:"finish",value:function(){if(!this.isFrozen()&&!this.isFinished()&&this._triggerPreventableEvent("FINISH",this.element)){var t=this._getStepIndex(this.activeStep),e=this.stepItems.length-1;t!==e&&this.goTo(e),pxUtil.addClass(this.element,o.FINISHED),this.freeze(),this._triggerEvent("FINISHED",this.element)}}},{key:"isFinished",value:function(){return pxUtil.hasClass(this.element,o.FINISHED)}},{key:"freeze",value:function(){pxUtil.addClass(this.element,o.FROZEN),this._triggerEvent("FROZEN",this.element)}},{key:"unfreeze",value:function(){this.isFinished()||(pxUtil.removeClass(this.element,o.FROZEN),this._triggerEvent("UNFROZEN",this.element))}},{key:"isFrozen",value:function(){return pxUtil.hasClass(this.element,o.FROZEN)}},{key:"reset",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];pxUtil.removeClass(this.element,o.FROZEN),pxUtil.removeClass(this.element,o.FINISHED),t&&this.goTo(0),this._triggerEvent("RESETED",this.element)}},{key:"destroy",value:function(){this._triggerPreventableEvent("DESTROY",this.element)&&(this._unsetListeners(),t(this.element).removeData("px.wizard"))}},{key:"_resetStepsWidth",value:function(){this.steps.style.width="auto"}},{key:"_setStrictWidth",value:function(t,e){t.style.minWidth=e+"px",t.style.maxWidth=e+"px",t.style.width=e+"px"}},{key:"_getStepItemAndTarget",value:function(t){var e=void 0,i=void 0;if("number"==typeof t){if(e=this.stepItems[t],i=t,!e)throw new Error('Step item with index "'+t+'" is not found.')}else e=t[0]||t,i=this._getStepIndex(e);var n=e.getAttribute("data-target");if(!n)throw new Error('The step item has invalid "data-target" attribute.');return[i,e,n]}},{key:"_activateStepItem",value:function(t,e){pxUtil.addClass(t,o.ACTIVE),pxUtil.removeClass(t,o.COMPLETED);for(var i=0;i<e;i++)pxUtil.addClass(this.stepItems[i],o.COMPLETED),pxUtil.removeClass(this.stepItems[i],o.ACTIVE);for(var n=e+1,r=this.stepItems.length;n<r;n++)pxUtil.removeClass(this.stepItems[n],o.ACTIVE),pxUtil.removeClass(this.stepItems[n],o.COMPLETED);this._placeStepsContainer()}},{key:"_activateStepPane",value:function(e){for(var i=t(this.element).find("."+o.PANE+"."+o.ACTIVE),n=0,r=i.length;n<r;n++)pxUtil.removeClass(i[n],o.ACTIVE);pxUtil.addClass(t(this.element).find(e)[0],o.ACTIVE)}},{key:"_placeStepsContainer",value:function(){var e=t(this.wrapper).width(),i=t(this.steps).width(),n=t(this.activeStep).outerWidth(),r=Math.floor((e-n)/2),o=t(this.activeStep).position().left,a=void 0;this._isRtl&&(o=i-o-n),i>e&&o>r?i+(a=-1*o+r)<e&&(a=-1*i+e):a=0,this.steps.style[this._isRtl?"right":"left"]=a+"px"}},{key:"_getStepIndex",value:function(t){for(var e=void 0,i=0,n=this.stepItems.length;i<n;i++)if(t===this.stepItems[i]){e=i;break}if(void 0===e)throw new Error("Cannot find step item index.");return e}},{key:"_setListeners",value:function(){var e=this;t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,t.proxy(this.resizeStepItems,this)),t(this.steps).on(this.constructor.Event.CLICK,"> li",function(){pxUtil.hasClass(this,o.COMPLETED)&&e.goTo(this)}),t(this.element).on(this.constructor.Event.CLICK,"[data-wizard-action]",function(){var t=this.getAttribute("data-wizard-action");if("next"===t)return e.goNext();if("prev"===t)return e.goPrev();if("finish"===t)return e.finish();throw new Error('Action "'+t+'" is not found.')})}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId),t(this.element).off(i),t(this.steps).off(i)}},{key:"_triggerEvent",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t(this.element).trigger(t.Event(this.constructor.Event[e],{target:i}),[n])}},{key:"_triggerPreventableEvent",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.Event(this.constructor.Event[e],{target:i});return t(this.element).trigger(r,[n]),!r.isDefaultPrevented()}},{key:"_getConfig",value:function(e){return t.extend({},this.constructor.Default,t(this.element).data(),e)}}],[{key:"_jQueryInterface",value:function(e){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];var a=void 0,s=this.each(function(){var i=t(this).data("px.wizard"),o="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(i||(i=new n(this,o),t(this).data("px.wizard",i)),"string"==typeof e){if(!i[e])throw new Error('No method named "'+e+'".');a=i[e].apply(i,r)}});return void 0!==a?a:s}},{key:"Default",get:function(){return r}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"px.wizard"}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return i}}]),n}();return t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=n,s._jQueryInterface},s}(jQuery);!function(t){function e(){return"Markdown.mk_block( "+uneval(this.toString())+", "+uneval(this.trailing)+", "+uneval(this.lineNumber)+" )"}function i(){var t=require("util");return"Markdown.mk_block( "+t.inspect(this.toString())+", "+t.inspect(this.trailing)+", "+t.inspect(this.lineNumber)+" )"}function n(t){for(var e=0,i=-1;-1!==(i=t.indexOf("\n",i+1));)e++;return e}function r(t,e){function i(t){this.len_after=t,this.name="close_"+e}var n=t+"_state",r="strong"==t?"em_state":"strong_state";return function(o,a){if(this[n][0]==e)return this[n].shift(),[o.length,new i(o.length-e.length)];var s=this[r].slice(),l=this[n].slice();this[n].unshift(e);var c=this.processInline(o.substr(e.length)),h=c[c.length-1];this[n].shift();return h instanceof i?(c.pop(),[o.length-h.len_after,[t].concat(c)]):(this[r]=s,this[n]=l,[e.length,e])}}function o(t){for(var e=t.split(""),i=[""],n=!1;e.length;){var r=e.shift();switch(r){case" ":n?i[i.length-1]+=r:i.push("");break;case"'":case'"':n=!n;break;case"\\":r=e.shift();default:i[i.length-1]+=r}}return i}function s(t){return m(t)&&t.length>1&&"object"==typeof t[1]&&!m(t[1])?t[1]:void 0}function l(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function c(t){if("string"==typeof t)return l(t);var e=t.shift(),i={},n=[];for(!t.length||"object"!=typeof t[0]||t[0]instanceof Array||(i=t.shift());t.length;)n.push(c(t.shift()));var r="";for(var o in i)r+=" "+o+'="'+l(i[o])+'"';return"img"==e||"br"==e||"hr"==e?"<"+e+r+"/>":"<"+e+r+">"+n.join("")+"</"+e+">"}function h(t,e,i){var n;i=i||{};var r=t.slice(0);"function"==typeof i.preprocessTreeNode&&(r=i.preprocessTreeNode(r,e));var o=s(r);if(o){r[1]={};for(n in o)r[1][n]=o[n];o=r[1]}if("string"==typeof r)return r;switch(r[0]){case"header":r[0]="h"+r[1].level,delete r[1].level;break;case"bulletlist":r[0]="ul";break;case"numberlist":r[0]="ol";break;case"listitem":r[0]="li";break;case"para":r[0]="p";break;case"markdown":r[0]="html",o&&delete o.references;break;case"code_block":r[0]="pre",n=o?2:1;var a=["code"];a.push.apply(a,r.splice(n,r.length-n)),r[n]=a;break;case"inlinecode":r[0]="code";break;case"img":r[1].src=r[1].href,delete r[1].href;break;case"linebreak":r[0]="br";break;case"link":r[0]="a";break;case"link_ref":if(r[0]="a",!(l=e[o.ref]))return o.original;delete o.ref,o.href=l.href,l.title&&(o.title=l.title),delete o.original;break;case"img_ref":r[0]="img";var l=e[o.ref];if(!l)return o.original;delete o.ref,o.src=l.href,l.title&&(o.title=l.title),delete o.original}if(n=1,o){for(var c in r[1]){n=2;break}1===n&&r.splice(n,1)}for(;n<r.length;++n)r[n]=h(r[n],e,i);return r}function u(t){for(var e=s(t)?2:1;e<t.length;)"string"==typeof t[e]?e+1<t.length&&"string"==typeof t[e+1]?t[e]+=t.splice(e+1,1)[0]:++e:(u(t[e]),++e)}var d=t.Markdown=function(t){switch(typeof t){case"undefined":this.dialect=d.dialects.Gruber;break;case"object":this.dialect=t;break;default:if(!(t in d.dialects))throw new Error("Unknown Markdown dialect '"+String(t)+"'");this.dialect=d.dialects[t]}this.em_state=[],this.strong_state=[],this.debug_indent=""};t.parse=function(t,e){return new d(e).toTree(t)},t.toHTML=function(e,i,n){var r=t.toHTMLTree(e,i,n);return t.renderJsonML(r)},t.toHTMLTree=function(t,e,i){"string"==typeof t&&(t=this.parse(t,e));var n=s(t),r={};n&&n.references&&(r=n.references);var o=h(t,r,i);return u(o),o};var f=d.mk_block=function(t,n,r){1==arguments.length&&(n="\n\n");var o=new String(t);return o.trailing=n,o.inspect=i,o.toSource=e,void 0!=r&&(o.lineNumber=r),o};d.prototype.split_blocks=function(t,e){var i,r=/([\s\S]+?)($|\n#|\n(?:\s*\n|$)+)/g,o=[],a=1;for(null!=(i=/^(\s*\n)/.exec(t=t.replace(/(\r\n|\n|\r)/g,"\n")))&&(a+=n(i[0]),r.lastIndex=i[0].length);null!==(i=r.exec(t));)"\n#"==i[2]&&(i[2]="\n",r.lastIndex--),o.push(f(i[1],i[2],a)),a+=n(i[0]);return o},d.prototype.processBlock=function(t,e){var i=this.dialect.block,n=i.__order__;if("__call__"in i)return i.__call__.call(this,t,e);for(var r=0;r<n.length;r++){var o=i[n[r]].call(this,t,e);if(o)return(!m(o)||o.length>0&&!m(o[0]))&&this.debug(n[r],"didn't return a proper array"),o}return[]},d.prototype.processInline=function(t){return this.dialect.inline.__call__.call(this,String(t))},d.prototype.toTree=function(t,e){var i=t instanceof Array?t:this.split_blocks(t),n=this.tree;try{for(this.tree=e||this.tree||["markdown"];i.length;){var r=this.processBlock(i.shift(),i);r.length&&this.tree.push.apply(this.tree,r)}return this.tree}finally{e&&(this.tree=n)}},d.prototype.debug=function(){var t=Array.prototype.slice.call(arguments);t.unshift(this.debug_indent),"undefined"!=typeof print&&print.apply(print,t),"undefined"!=typeof console&&void 0!==console.log&&console.log.apply(null,t)},d.prototype.loop_re_over_block=function(t,e,i){for(var n,r=e.valueOf();r.length&&null!=(n=t.exec(r));)r=r.substr(n[0].length),i.call(this,n);return r},d.dialects={},d.dialects.Gruber={block:{atxHeader:function(t,e){var i=t.match(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/);if(i){var n=["header",{level:i[1].length}];return Array.prototype.push.apply(n,this.processInline(i[2])),i[0].length<t.length&&e.unshift(f(t.substr(i[0].length),t.trailing,t.lineNumber+2)),[n]}},setextHeader:function(t,e){var i=t.match(/^(.*)\n([-=])\2\2+(?:\n|$)/);if(i){var n=["header",{level:"="===i[2]?1:2},i[1]];return i[0].length<t.length&&e.unshift(f(t.substr(i[0].length),t.trailing,t.lineNumber+2)),[n]}},code:function(t,e){var i=[],n=/^(?: {0,3}\t| {4})(.*)\n?/;if(t.match(n)){t:for(;;){var r=this.loop_re_over_block(n,t.valueOf(),function(t){i.push(t[1])});if(r.length){e.unshift(f(r,t.trailing));break t}if(!e.length)break t;if(!e[0].match(n))break t;i.push(t.trailing.replace(/[^\n]/g,"").substring(2)),t=e.shift()}return[["code_block",i.join("\n")]]}},horizRule:function(t,e){var i=t.match(/^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/);if(i){var n=[["hr"]];return i[1]&&n.unshift.apply(n,this.processBlock(i[1],[])),i[3]&&e.unshift(f(i[3])),n}},lists:function(){function t(t){return new RegExp("(?:^("+l+"{0,"+t+"} {0,3})("+o+")\\s+)|(^"+l+"{0,"+(t-1)+"}[ ]{0,4})")}function e(t){return t.replace(/ {0,3}\t/g," ")}function i(t,e,i,n){if(e)t.push(["para"].concat(i));else{var r=t[t.length-1]instanceof Array&&"para"==t[t.length-1][0]?t[t.length-1]:t;n&&t.length>1&&i.unshift(n);for(var o=0;o<i.length;o++){var a=i[o];"string"==typeof a&&r.length>1&&"string"==typeof r[r.length-1]?r[r.length-1]+=a:r.push(a)}}}function n(t,e){for(var i=new RegExp("^("+l+"{"+t+"}.*?\\n?)*$"),n=new RegExp("^"+l+"{"+t+"}","gm"),r=[];e.length>0&&i.exec(e[0]);){var o=e.shift(),a=o.replace(n,"");r.push(f(a,o.trailing,o.lineNumber))}return r}function r(t,e,i){var n=t.list,r=n[n.length-1];if(!(r[1]instanceof Array&&"para"==r[1][0]))if(e+1==i.length)r.push(["para"].concat(r.splice(1,r.length-1)));else{var o=r.pop();r.push(["para"].concat(r.splice(1,r.length-1)),o)}}var o="[*+-]|\\d+\\.",a=/[*+-]/,s=new RegExp("^( {0,3})("+o+")[ \t]+"),l="(?: {0,3}\\t| {4})";return function(o,l){function c(t){var e=a.exec(t[2])?["bulletlist"]:["numberlist"];return f.push({list:e,indent:t[1]}),e}var h=o.match(s);if(h){for(var u,d,f=[],p=c(h),m=!1,v=[f[0].list];;){for(var y=o.split(/(?=\n)/),b="",x=0;x<y.length;x++){var _="",w=y[x].replace(/^\n/,function(t){return _=t,""}),S=t(f.length);if(void 0!==(h=w.match(S))[1]){b.length&&(i(u,m,this.processInline(b),_),m=!1,b=""),h[1]=e(h[1]);var C=Math.floor(h[1].length/4)+1;if(C>f.length)p=c(h),u.push(p),u=p[1]=["listitem"];else{var k=!1;for(d=0;d<f.length;d++)if(f[d].indent==h[1]){p=f[d].list,f.splice(d+1,f.length-(d+1)),k=!0;break}k||(++C<=f.length?(f.splice(C,f.length-C),p=f[C-1].list):(p=c(h),u.push(p))),u=["listitem"],p.push(u)}_=""}w.length>h[0].length&&(b+=_+w.substr(h[0].length))}b.length&&(i(u,m,this.processInline(b),_),m=!1,b="");var T=n(f.length,l);T.length>0&&(g(f,r,this),u.push.apply(u,this.toTree(T,[])));var A=l[0]&&l[0].valueOf()||"";if(!A.match(s)&&!A.match(/^ /))break;o=l.shift();var D=this.dialect.block.horizRule(o,l);if(D){v.push.apply(v,D);break}g(f,r,this),m=!0}return v}}}(),blockquote:function(t,e){if(t.match(/^>/m)){var i=[];if(">"!=t[0]){for(var n=t.split(/\n/),r=[],o=t.lineNumber;n.length&&">"!=n[0][0];)r.push(n.shift()),o++;var a=f(r.join("\n"),"\n",t.lineNumber);i.push.apply(i,this.processBlock(a,[])),t=f(n.join("\n"),t.trailing,o)}for(;e.length&&">"==e[0][0];){var l=e.shift();t=f(t+t.trailing+l,l.trailing,t.lineNumber)}var c=t.replace(/^> ?/gm,""),h=(this.tree,this.toTree(c,["blockquote"])),u=s(h);return u&&u.references&&(delete u.references,v(u)&&h.splice(1,1)),i.push(h),i}},referenceDefn:function(t,e){var i=/^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;if(t.match(i)){s(this.tree)||this.tree.splice(1,0,{});var n=s(this.tree);void 0===n.references&&(n.references={});var r=this.loop_re_over_block(i,t,function(t){t[2]&&"<"==t[2][0]&&">"==t[2][t[2].length-1]&&(t[2]=t[2].substring(1,t[2].length-1));var e=n.references[t[1].toLowerCase()]={href:t[2]};void 0!==t[4]?e.title=t[4]:void 0!==t[5]&&(e.title=t[5])});return r.length&&e.unshift(f(r,t.trailing)),[]}},para:function(t,e){return[["para"].concat(this.processInline(t))]}}},d.dialects.Gruber.inline={__oneElement__:function(t,e,i){var n;if(e=e||this.dialect.inline.__patterns__,!(n=new RegExp("([\\s\\S]*?)("+(e.source||e)+")").exec(t)))return[t.length,t];if(n[1])return[n[1].length,n[1]];var r;return n[2]in this.dialect.inline&&(r=this.dialect.inline[n[2]].call(this,t.substr(n.index),n,i||[])),r=r||[n[2].length,n[2]]},__call__:function(t,e){for(var i,n=[];t.length>0;)i=this.dialect.inline.__oneElement__.call(this,t,e,n),t=t.substr(i.shift()),g(i,function(t){"string"==typeof t&&"string"==typeof n[n.length-1]?n[n.length-1]+=t:n.push(t)});return n},"]":function(){},"}":function(){},__escape__:/^\\[\\`\*_{}\[\]()#\+.!\-]/,"\\":function(t){return this.dialect.inline.__escape__.exec(t)?[2,t.charAt(1)]:[1,"\\"]},"![":function(t){var e=t.match(/^!\[(.*?)\][ \t]*\([ \t]*([^")]*?)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/);if(e){e[2]&&"<"==e[2][0]&&">"==e[2][e[2].length-1]&&(e[2]=e[2].substring(1,e[2].length-1)),e[2]=this.dialect.inline.__call__.call(this,e[2],/\\/)[0];var i={alt:e[1],href:e[2]||""};return void 0!==e[4]&&(i.title=e[4]),[e[0].length,["img",i]]}return(e=t.match(/^!\[(.*?)\][ \t]*\[(.*?)\]/))?[e[0].length,["img_ref",{alt:e[1],ref:e[2].toLowerCase(),original:e[0]}]]:[2,"!["]},"[":function(t){var e=String(t),i=d.DialectHelpers.inline_until_char.call(this,t.substr(1),"]");if(!i)return[1,"["];var n,r,o=1+i[0],a=i[1],s=(t=t.substr(o)).match(/^\s*\([ \t]*([^"']*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/);if(s){var l=s[1];if(o+=s[0].length,l&&"<"==l[0]&&">"==l[l.length-1]&&(l=l.substring(1,l.length-1)),!s[3])for(var c=1,h=0;h<l.length;h++)switch(l[h]){case"(":c++;break;case")":0==--c&&(o-=l.length-h,l=l.substring(0,h))}return l=this.dialect.inline.__call__.call(this,l,/\\/)[0],r={href:l||""},void 0!==s[3]&&(r.title=s[3]),n=["link",r].concat(a),[o,n]}return(s=t.match(/^\s*\[(.*?)\]/))?(o+=s[0].length,r={ref:(s[1]||String(a)).toLowerCase(),original:e.substr(0,o)},n=["link_ref",r].concat(a),[o,n]):1==a.length&&"string"==typeof a[0]?(r={ref:a[0].toLowerCase(),original:e.substr(0,o)},n=["link_ref",r,a[0]],[o,n]):[1,"["]},"<":function(t){var e;return null!=(e=t.match(/^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/))?e[3]?[e[0].length,["link",{href:"mailto:"+e[3]},e[3]]]:"mailto"==e[2]?[e[0].length,["link",{href:e[1]},e[1].substr("mailto:".length)]]:[e[0].length,["link",{href:e[1]},e[1]]]:[1,"<"]},"`":function(t){var e=t.match(/(`+)(([\s\S]*?)\1)/);return e&&e[2]?[e[1].length+e[2].length,["inlinecode",e[3]]]:[1,"`"]}," \n":function(t){return[3,["linebreak"]]}},d.dialects.Gruber.inline["**"]=r("strong","**"),d.dialects.Gruber.inline.__=r("strong","__"),d.dialects.Gruber.inline["*"]=r("em","*"),d.dialects.Gruber.inline._=r("em","_"),d.buildBlockOrder=function(t){var e=[];for(var i in t)"__order__"!=i&&"__call__"!=i&&e.push(i);t.__order__=e},d.buildInlinePatterns=function(t){var e=[];for(var i in t)if(!i.match(/^__.*__$/)){var n=i.replace(/([\\.*+?|()\[\]{}])/g,"\\$1").replace(/\n/,"\\n");e.push(1==i.length?n:"(?:"+n+")")}e=e.join("|"),t.__patterns__=e;var r=t.__call__;t.__call__=function(t,i){return void 0!=i?r.call(this,t,i):r.call(this,t,e)}},d.DialectHelpers={},d.DialectHelpers.inline_until_char=function(t,e){for(var i=0,n=[];;){if(t.charAt(i)==e)return i++,[i,n];if(i>=t.length)return null;var r=this.dialect.inline.__oneElement__.call(this,t.substr(i));i+=r[0],n.push.apply(n,r.slice(1))}},d.subclassDialect=function(t){function e(){}function i(){}return e.prototype=t.block,i.prototype=t.inline,{block:new e,inline:new i}},d.buildBlockOrder(d.dialects.Gruber.block),d.buildInlinePatterns(d.dialects.Gruber.inline),d.dialects.Maruku=d.subclassDialect(d.dialects.Gruber),d.dialects.Maruku.processMetaHash=function(t){for(var e=o(t),i={},n=0;n<e.length;++n)if(/^#/.test(e[n]))i.id=e[n].substring(1);else if(/^\./.test(e[n]))i.class?i.class=i.class+e[n].replace(/./," "):i.class=e[n].substring(1);else if(/\=/.test(e[n])){var r=e[n].split(/\=/);i[r[0]]=r[1]}return i},d.dialects.Maruku.block.document_meta=function(t,e){if(!(t.lineNumber>1)&&t.match(/^(?:\w+:.*\n)*\w+:.*$/)){s(this.tree)||this.tree.splice(1,0,{});var i=t.split(/\n/);for(p in i){var n=i[p].match(/(\w+):\s*(.*)$/),r=n[1].toLowerCase(),o=n[2];this.tree[1][r]=o}return[]}},d.dialects.Maruku.block.block_meta=function(t,e){var i=t.match(/(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/);if(i){var n,r=this.dialect.processMetaHash(i[2]);if(""===i[1]){var o=this.tree[this.tree.length-1];if(n=s(o),"string"==typeof o)return;n||(n={},o.splice(1,0,n));for(a in r)n[a]=r[a];return[]}var l=t.replace(/\n.*$/,""),c=this.processBlock(l,[]);(n=s(c[0]))||(n={},c[0].splice(1,0,n));for(a in r)n[a]=r[a];return c}},d.dialects.Maruku.block.definition_list=function(t,e){var i,n,r=/^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,o=["dl"];if(n=t.match(r)){for(var a=[t];e.length&&r.exec(e[0]);)a.push(e.shift());for(var s=0;s<a.length;++s){var l=(n=a[s].match(r))[1].replace(/\n$/,"").split(/\n/),c=n[2].split(/\n:\s+/);for(i=0;i<l.length;++i)o.push(["dt",l[i]]);for(i=0;i<c.length;++i)o.push(["dd"].concat(this.processInline(c[i].replace(/(\n)\s+/,"$1"))))}return[o]}},d.dialects.Maruku.block.table=function(t,e){var i,n,r=function(t,e){(e=e||"\\s").match(/^[\\|\[\]{}?*.+^$]$/)&&(e="\\"+e);for(var i,n=[],r=new RegExp("^((?:\\\\.|[^\\\\"+e+"])*)"+e+"(.*)");i=t.match(r);)n.push(i[1]),t=i[2];return n.push(t),n};if(n=t.match(/^ {0,3}\|(.+)\n {0,3}\|\s*([\-:]+[\-| :]*)\n((?:\s*\|.*(?:\n|$))*)(?=\n|$)/))n[3]=n[3].replace(/^\s*\|/gm,"");else if(!(n=t.match(/^ {0,3}(\S(?:\\.|[^\\|])*\|.*)\n {0,3}([\-:]+\s*\|[\-| :]*)\n((?:(?:\\.|[^\\|])*\|.*(?:\n|$))*)(?=\n|$)/)))return;var o=["table",["thead",["tr"]],["tbody"]];n[2]=n[2].replace(/\|\s*$/,"").split("|");var a=[];for(g(n[2],function(t){t.match(/^\s*-+:\s*$/)?a.push({align:"right"}):t.match(/^\s*:-+\s*$/)?a.push({align:"left"}):t.match(/^\s*:-+:\s*$/)?a.push({align:"center"}):a.push({})}),n[1]=r(n[1].replace(/\|\s*$/,""),"|"),i=0;i<n[1].length;i++)o[1][1].push(["th",a[i]||{}].concat(this.processInline(n[1][i].trim())));return g(n[3].replace(/\|\s*$/gm,"").split("\n"),function(t){var e=["tr"];for(t=r(t,"|"),i=0;i<t.length;i++)e.push(["td",a[i]||{}].concat(this.processInline(t[i].trim())));o[2].push(e)},this),[o]},d.dialects.Maruku.inline["{:"]=function(t,e,i){if(!i.length)return[2,"{:"];var n=i[i.length-1];if("string"==typeof n)return[2,"{:"];var r=t.match(/^\{:\s*((?:\\\}|[^\}])*)\s*\}/);if(!r)return[2,"{:"];var o=this.dialect.processMetaHash(r[1]),a=s(n);a||(a={},n.splice(1,0,a));for(var l in o)a[l]=o[l];return[r[0].length,""]},d.dialects.Maruku.inline.__escape__=/^\\[\\`\*_{}\[\]()#\+.!\-|:]/,d.buildBlockOrder(d.dialects.Maruku.block),d.buildInlinePatterns(d.dialects.Maruku.inline);var g,m=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)};g=Array.prototype.forEach?function(t,e,i){return t.forEach(e,i)}:function(t,e,i){for(var n=0;n<t.length;n++)e.call(i||t,t[n],n,t)};var v=function(t){for(var e in t)if(hasOwnProperty.call(t,e))return!1;return!0};t.renderJsonML=function(t,e){(e=e||{}).root=e.root||!1;var i=[];if(e.root)i.push(c(t));else for(t.shift(),!t.length||"object"!=typeof t[0]||t[0]instanceof Array||t.shift();t.length;)i.push(c(t.shift()));return i.join("\n\n")}}("undefined"==typeof exports?(window.markdown={},window.markdown):exports),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.moment=e()}(this,function(){"use strict";function t(){return ke.apply(null,arguments)}function e(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function i(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function n(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}function r(t){return void 0===t}function o(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function s(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function l(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){for(var i in e)l(e,i)&&(t[i]=e[i]);return l(e,"toString")&&(t.toString=e.toString),l(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,i,n){return Vt(t,e,i,n,!0).utc()}function u(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function d(t){return null==t._pf&&(t._pf=u()),t._pf}function f(t){if(null==t._isValid){var e=d(t),i=Te.call(e.parsedDateParts,function(t){return null!=t}),n=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&i);if(t._strict&&(n=n&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return n;t._isValid=n}return t._isValid}function p(t){var e=h(NaN);return null!=t?c(d(e),t):d(e).userInvalidated=!0,e}function g(t,e){var i,n,o;if(r(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),r(e._i)||(t._i=e._i),r(e._f)||(t._f=e._f),r(e._l)||(t._l=e._l),r(e._strict)||(t._strict=e._strict),r(e._tzm)||(t._tzm=e._tzm),r(e._isUTC)||(t._isUTC=e._isUTC),r(e._offset)||(t._offset=e._offset),r(e._pf)||(t._pf=d(e)),r(e._locale)||(t._locale=e._locale),Ae.length>0)for(i=0;i<Ae.length;i++)r(o=e[n=Ae[i]])||(t[n]=o);return t}function m(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===De&&(De=!0,t.updateOffset(this),De=!1)}function v(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function y(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function b(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=y(e)),i}function x(t,e,i){var n,r=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(n=0;n<r;n++)(i&&t[n]!==e[n]||!i&&b(t[n])!==b(e[n]))&&a++;return a+o}function _(e){!1===t.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,i){var n=!0;return c(function(){if(null!=t.deprecationHandler&&t.deprecationHandler(null,e),n){for(var r,o=[],a=0;a<arguments.length;a++){if(r="","object"==typeof arguments[a]){r+="\n["+a+"] ";for(var s in arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[a];o.push(r)}_(e+"\nArguments: "+Array.prototype.slice.call(o).join("")+"\n"+(new Error).stack),n=!1}return i.apply(this,arguments)},i)}function S(e,i){null!=t.deprecationHandler&&t.deprecationHandler(e,i),Me[e]||(_(i),Me[e]=!0)}function C(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function k(t,e){var n,r=c({},t);for(n in e)l(e,n)&&(i(t[n])&&i(e[n])?(r[n]={},c(r[n],t[n]),c(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);for(n in t)l(t,n)&&!l(e,n)&&i(t[n])&&(r[n]=c({},r[n]));return r}function T(t){null!=t&&this.set(t)}function A(t,e){var i=t.toLowerCase();Pe[i]=Pe[i+"s"]=Pe[e]=t}function D(t){return"string"==typeof t?Pe[t]||Pe[t.toLowerCase()]:void 0}function M(t){var e,i,n={};for(i in t)l(t,i)&&(e=D(i))&&(n[e]=t[i]);return n}function E(t,e){Le[t]=e}function P(t){var e=[];for(var i in t)e.push({unit:i,priority:Le[i]});return e.sort(function(t,e){return t.priority-e.priority}),e}function L(t,e,i){var n=""+Math.abs(t),r=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}function I(t,e,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),t&&(Ne[t]=r),e&&(Ne[e[0]]=function(){return L(r.apply(this,arguments),e[1],e[2])}),i&&(Ne[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function O(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function R(t){var e,i,n=t.match(Ie);for(e=0,i=n.length;e<i;e++)Ne[n[e]]?n[e]=Ne[n[e]]:n[e]=O(n[e]);return function(e){var r,o="";for(r=0;r<i;r++)o+=C(n[r])?n[r].call(e,t):n[r];return o}}function N(t,e){return t.isValid()?(e=F(e,t.localeData()),Re[e]=Re[e]||R(e),Re[e](t)):t.localeData().invalidDate()}function F(t,e){var i=5;for(Oe.lastIndex=0;i>=0&&Oe.test(t);)t=t.replace(Oe,function(t){return e.longDateFormat(t)||t}),Oe.lastIndex=0,i-=1;return t}function z(t,e,i){Je[t]=C(e)?e:function(t,n){return t&&i?i:e}}function H(t,e){return l(Je,t)?Je[t](e._strict,e._locale):new RegExp($(t))}function $(t){return V(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,i,n,r){return e||i||n||r}))}function V(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function B(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),o(e)&&(n=function(t,i){i[e]=b(t)}),i=0;i<t.length;i++)ti[t[i]]=n}function W(t,e){B(t,function(t,i,n,r){n._w=n._w||{},e(t,n._w,n,r)})}function j(t,e,i){null!=e&&l(ti,t)&&ti[t](e,i._a,i,t)}function U(t){return Y(t)?366:365}function Y(t){return t%4==0&&t%100!=0||t%400==0}function G(e,i){return function(n){return null!=n?(X(this,e,n),t.updateOffset(this,i),this):q(this,e)}}function q(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function X(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Y(t.year())?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Z(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function K(t,e){return(t%e+e)%e}function Z(t,e){if(isNaN(t)||isNaN(e))return NaN;var i=K(e,12);return t+=(e-i)/12,1===i?Y(t)?29:28:31-i%7%2}function Q(t,e,i){var n,r,o,a=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)o=h([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(o,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(r=hi.call(this._shortMonthsParse,a))?r:null:-1!==(r=hi.call(this._longMonthsParse,a))?r:null:"MMM"===e?-1!==(r=hi.call(this._shortMonthsParse,a))?r:-1!==(r=hi.call(this._longMonthsParse,a))?r:null:-1!==(r=hi.call(this._longMonthsParse,a))?r:-1!==(r=hi.call(this._shortMonthsParse,a))?r:null}function J(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=b(e);else if(e=t.localeData().monthsParse(e),!o(e))return t;return i=Math.min(t.date(),Z(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function tt(e){return null!=e?(J(this,e),t.updateOffset(this,!0),this):q(this,"Month")}function et(){function t(t,e){return e.length-t.length}var e,i,n=[],r=[],o=[];for(e=0;e<12;e++)i=h([2e3,e]),n.push(this.monthsShort(i,"")),r.push(this.months(i,"")),o.push(this.months(i,"")),o.push(this.monthsShort(i,""));for(n.sort(t),r.sort(t),o.sort(t),e=0;e<12;e++)n[e]=V(n[e]),r[e]=V(r[e]);for(e=0;e<24;e++)o[e]=V(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function it(t,e,i,n,r,o,a){var s=new Date(t,e,i,n,r,o,a);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function nt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function rt(t,e,i){var n=7+e-i;return-((7+nt(t,0,n).getUTCDay()-e)%7)+n-1}function ot(t,e,i,n,r){var o,a,s=1+7*(e-1)+(7+i-n)%7+rt(t,n,r);return s<=0?a=U(o=t-1)+s:s>U(t)?(o=t+1,a=s-U(t)):(o=t,a=s),{year:o,dayOfYear:a}}function at(t,e,i){var n,r,o=rt(t.year(),e,i),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return a<1?n=a+st(r=t.year()-1,e,i):a>st(t.year(),e,i)?(n=a-st(t.year(),e,i),r=t.year()+1):(r=t.year(),n=a),{week:n,year:r}}function st(t,e,i){var n=rt(t,e,i),r=rt(t+1,e,i);return(U(t)-n+r)/7}function lt(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function ct(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function ht(t,e,i){var n,r,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)o=h([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(o,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(r=hi.call(this._weekdaysParse,a))?r:null:"ddd"===e?-1!==(r=hi.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=hi.call(this._minWeekdaysParse,a))?r:null:"dddd"===e?-1!==(r=hi.call(this._weekdaysParse,a))?r:-1!==(r=hi.call(this._shortWeekdaysParse,a))?r:-1!==(r=hi.call(this._minWeekdaysParse,a))?r:null:"ddd"===e?-1!==(r=hi.call(this._shortWeekdaysParse,a))?r:-1!==(r=hi.call(this._weekdaysParse,a))?r:-1!==(r=hi.call(this._minWeekdaysParse,a))?r:null:-1!==(r=hi.call(this._minWeekdaysParse,a))?r:-1!==(r=hi.call(this._weekdaysParse,a))?r:-1!==(r=hi.call(this._shortWeekdaysParse,a))?r:null}function ut(){function t(t,e){return e.length-t.length}var e,i,n,r,o,a=[],s=[],l=[],c=[];for(e=0;e<7;e++)i=h([2e3,1]).day(e),n=this.weekdaysMin(i,""),r=this.weekdaysShort(i,""),o=this.weekdays(i,""),a.push(n),s.push(r),l.push(o),c.push(n),c.push(r),c.push(o);for(a.sort(t),s.sort(t),l.sort(t),c.sort(t),e=0;e<7;e++)s[e]=V(s[e]),l[e]=V(l[e]),c[e]=V(c[e]);this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function dt(){return this.hours()%12||12}function ft(t,e){I(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function pt(t,e){return e._meridiemParse}function gt(t){return t?t.toLowerCase().replace("_","-"):t}function mt(t){for(var e,i,n,r,o=0;o<t.length;){for(e=(r=gt(t[o]).split("-")).length,i=(i=gt(t[o+1]))?i.split("-"):null;e>0;){if(n=vt(r.slice(0,e).join("-")))return n;if(i&&i.length>=e&&x(r,i,!0)>=e-1)break;e--}o++}return null}function vt(t){var e=null;if(!Ti[t]&&"undefined"!=typeof module&&module&&module.exports)try{e=Si._abbr,require("./locale/"+t),yt(e)}catch(t){}return Ti[t]}function yt(t,e){var i;return t&&(i=r(e)?xt(t):bt(t,e))&&(Si=i),Si._abbr}function bt(t,e){if(null!==e){var i=ki;if(e.abbr=t,null!=Ti[t])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=Ti[t]._config;else if(null!=e.parentLocale){if(null==Ti[e.parentLocale])return Ai[e.parentLocale]||(Ai[e.parentLocale]=[]),Ai[e.parentLocale].push({name:t,config:e}),null;i=Ti[e.parentLocale]._config}return Ti[t]=new T(k(i,e)),Ai[t]&&Ai[t].forEach(function(t){bt(t.name,t.config)}),yt(t),Ti[t]}return delete Ti[t],null}function xt(t){var i;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Si;if(!e(t)){if(i=vt(t))return i;t=[t]}return mt(t)}function _t(t){var e,i=t._a;return i&&-2===d(t).overflow&&(e=i[ii]<0||i[ii]>11?ii:i[ni]<1||i[ni]>Z(i[ei],i[ii])?ni:i[ri]<0||i[ri]>24||24===i[ri]&&(0!==i[oi]||0!==i[ai]||0!==i[si])?ri:i[oi]<0||i[oi]>59?oi:i[ai]<0||i[ai]>59?ai:i[si]<0||i[si]>999?si:-1,d(t)._overflowDayOfYear&&(e<ei||e>ni)&&(e=ni),d(t)._overflowWeeks&&-1===e&&(e=li),d(t)._overflowWeekday&&-1===e&&(e=ci),d(t).overflow=e),t}function wt(t,e,i){return null!=t?t:null!=e?e:i}function St(e){var i=new Date(t.now());return e._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function Ct(t){var e,i,n,r,o=[];if(!t._d){for(n=St(t),t._w&&null==t._a[ni]&&null==t._a[ii]&&kt(t),null!=t._dayOfYear&&(r=wt(t._a[ei],n[ei]),(t._dayOfYear>U(r)||0===t._dayOfYear)&&(d(t)._overflowDayOfYear=!0),i=nt(r,0,t._dayOfYear),t._a[ii]=i.getUTCMonth(),t._a[ni]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=o[e]=n[e];for(;e<7;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ri]&&0===t._a[oi]&&0===t._a[ai]&&0===t._a[si]&&(t._nextDay=!0,t._a[ri]=0),t._d=(t._useUTC?nt:it).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ri]=24),t._w&&void 0!==t._w.d&&t._w.d!==t._d.getDay()&&(d(t).weekdayMismatch=!0)}}function kt(t){var e,i,n,r,o,a,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)o=1,a=4,i=wt(e.GG,t._a[ei],at(Bt(),1,4).year),n=wt(e.W,1),((r=wt(e.E,1))<1||r>7)&&(l=!0);else{o=t._locale._week.dow,a=t._locale._week.doy;var c=at(Bt(),o,a);i=wt(e.gg,t._a[ei],c.year),n=wt(e.w,c.week),null!=e.d?((r=e.d)<0||r>6)&&(l=!0):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(l=!0)):r=o}n<1||n>st(i,o,a)?d(t)._overflowWeeks=!0:null!=l?d(t)._overflowWeekday=!0:(s=ot(i,n,r,o,a),t._a[ei]=s.year,t._dayOfYear=s.dayOfYear)}function Tt(t){var e,i,n,r,o,a,s=t._i,l=Di.exec(s)||Mi.exec(s);if(l){for(d(t).iso=!0,e=0,i=Pi.length;e<i;e++)if(Pi[e][1].exec(l[1])){r=Pi[e][0],n=!1!==Pi[e][2];break}if(null==r)return void(t._isValid=!1);if(l[3]){for(e=0,i=Li.length;e<i;e++)if(Li[e][1].exec(l[3])){o=(l[2]||" ")+Li[e][0];break}if(null==o)return void(t._isValid=!1)}if(!n&&null!=o)return void(t._isValid=!1);if(l[4]){if(!Ei.exec(l[4]))return void(t._isValid=!1);a="Z"}t._f=r+(o||"")+(a||""),Ot(t)}else t._isValid=!1}function At(t,e,i,n,r,o){var a=[Dt(t),pi.indexOf(e),parseInt(i,10),parseInt(n,10),parseInt(r,10)];return o&&a.push(parseInt(o,10)),a}function Dt(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function Mt(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}function Et(t,e,i){return!t||yi.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(d(i).weekdayMismatch=!0,i._isValid=!1,!1)}function Pt(t,e,i){if(t)return Ri[t];if(e)return 0;var n=parseInt(i,10),r=n%100;return 60*((n-r)/100)+r}function Lt(t){var e=Oi.exec(Mt(t._i));if(e){var i=At(e[4],e[3],e[2],e[5],e[6],e[7]);if(!Et(e[1],i,t))return;t._a=i,t._tzm=Pt(e[8],e[9],e[10]),t._d=nt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),d(t).rfc2822=!0}else t._isValid=!1}function It(e){var i=Ii.exec(e._i);null===i?(Tt(e),!1===e._isValid&&(delete e._isValid,Lt(e),!1===e._isValid&&(delete e._isValid,t.createFromInputFallback(e)))):e._d=new Date(+i[1])}function Ot(e){if(e._f!==t.ISO_8601)if(e._f!==t.RFC_2822){e._a=[],d(e).empty=!0;var i,n,r,o,a,s=""+e._i,l=s.length,c=0;for(r=F(e._f,e._locale).match(Ie)||[],i=0;i<r.length;i++)o=r[i],(n=(s.match(H(o,e))||[])[0])&&((a=s.substr(0,s.indexOf(n))).length>0&&d(e).unusedInput.push(a),s=s.slice(s.indexOf(n)+n.length),c+=n.length),Ne[o]?(n?d(e).empty=!1:d(e).unusedTokens.push(o),j(o,n,e)):e._strict&&!n&&d(e).unusedTokens.push(o);d(e).charsLeftOver=l-c,s.length>0&&d(e).unusedInput.push(s),e._a[ri]<=12&&!0===d(e).bigHour&&e._a[ri]>0&&(d(e).bigHour=void 0),d(e).parsedDateParts=e._a.slice(0),d(e).meridiem=e._meridiem,e._a[ri]=Rt(e._locale,e._a[ri],e._meridiem),Ct(e),_t(e)}else Lt(e);else Tt(e)}function Rt(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}function Nt(t){var e,i,n,r,o;if(0===t._f.length)return d(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;r<t._f.length;r++)o=0,e=g({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],Ot(e),f(e)&&(o+=d(e).charsLeftOver,o+=10*d(e).unusedTokens.length,d(e).score=o,(null==n||o<n)&&(n=o,i=e));c(t,i||e)}function Ft(t){if(!t._d){var e=M(t._i);t._a=s([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Ct(t)}}function zt(t){var e=new m(_t(Ht(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ht(t){var i=t._i,n=t._f;return t._locale=t._locale||xt(t._l),null===i||void 0===n&&""===i?p({nullInput:!0}):("string"==typeof i&&(t._i=i=t._locale.preparse(i)),v(i)?new m(_t(i)):(a(i)?t._d=i:e(n)?Nt(t):n?Ot(t):$t(t),f(t)||(t._d=null),t))}function $t(n){var l=n._i;r(l)?n._d=new Date(t.now()):a(l)?n._d=new Date(l.valueOf()):"string"==typeof l?It(n):e(l)?(n._a=s(l.slice(0),function(t){return parseInt(t,10)}),Ct(n)):i(l)?Ft(n):o(l)?n._d=new Date(l):t.createFromInputFallback(n)}function Vt(t,r,o,a,s){var l={};return!0!==o&&!1!==o||(a=o,o=void 0),(i(t)&&n(t)||e(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=o,l._i=t,l._f=r,l._strict=a,zt(l)}function Bt(t,e,i,n){return Vt(t,e,i,n,!1)}function Wt(t,i){var n,r;if(1===i.length&&e(i[0])&&(i=i[0]),!i.length)return Bt();for(n=i[0],r=1;r<i.length;++r)i[r].isValid()&&!i[r][t](n)||(n=i[r]);return n}function jt(t){for(var e in t)if(-1===hi.call(zi,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var i=!1,n=0;n<zi.length;++n)if(t[zi[n]]){if(i)return!1;parseFloat(t[zi[n]])!==b(t[zi[n]])&&(i=!0)}return!0}function Ut(t){var e=M(t),i=e.year||0,n=e.quarter||0,r=e.month||0,o=e.week||0,a=e.day||0,s=e.hour||0,l=e.minute||0,c=e.second||0,h=e.millisecond||0;this._isValid=jt(e),this._milliseconds=+h+1e3*c+6e4*l+1e3*s*60*60,this._days=+a+7*o,this._months=+r+3*n+12*i,this._data={},this._locale=xt(),this._bubble()}function Yt(t){return t instanceof Ut}function Gt(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function qt(t,e){I(t,0,0,function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+L(~~(t/60),2)+e+L(~~t%60,2)})}function Xt(t,e){var i=(e||"").match(t);if(null===i)return null;var n=((i[i.length-1]||[])+"").match(Hi)||["-",0,0],r=60*n[1]+b(n[2]);return 0===r?0:"+"===n[0]?r:-r}function Kt(e,i){var n,r;return i._isUTC?(n=i.clone(),r=(v(e)||a(e)?e.valueOf():Bt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),t.updateOffset(n,!1),n):Bt(e).local()}function Zt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Qt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Jt(t,e){var i,n,r,a=t,s=null;return Yt(t)?a={ms:t._milliseconds,d:t._days,M:t._months}:o(t)?(a={},e?a[e]=t:a.milliseconds=t):(s=$i.exec(t))?(i="-"===s[1]?-1:1,a={y:0,d:b(s[ni])*i,h:b(s[ri])*i,m:b(s[oi])*i,s:b(s[ai])*i,ms:b(Gt(1e3*s[si]))*i}):(s=Vi.exec(t))?(i="-"===s[1]?-1:(s[1],1),a={y:te(s[2],i),M:te(s[3],i),w:te(s[4],i),d:te(s[5],i),h:te(s[6],i),m:te(s[7],i),s:te(s[8],i)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(r=ie(Bt(a.from),Bt(a.to)),(a={}).ms=r.milliseconds,a.M=r.months),n=new Ut(a),Yt(t)&&l(t,"_locale")&&(n._locale=t._locale),n}function te(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function ee(t,e){var i={milliseconds:0,months:0};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function ie(t,e){var i;return t.isValid()&&e.isValid()?(e=Kt(e,t),t.isBefore(e)?i=ee(t,e):((i=ee(e,t)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ne(t,e){return function(i,n){var r,o;return null===n||isNaN(+n)||(S(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),i="string"==typeof i?+i:i,r=Jt(i,n),re(this,r,t),this}}function re(e,i,n,r){var o=i._milliseconds,a=Gt(i._days),s=Gt(i._months);e.isValid()&&(r=null==r||r,s&&J(e,q(e,"Month")+s*n),a&&X(e,"Date",q(e,"Date")+a*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&t.updateOffset(e,a||s))}function oe(t,e){var i,n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,"months");return i=e-r<0?(e-r)/(r-t.clone().add(n-1,"months")):(e-r)/(t.clone().add(n+1,"months")-r),-(n+i)||0}function ae(t){var e;return void 0===t?this._locale._abbr:(null!=(e=xt(t))&&(this._locale=e),this)}function se(){return this._locale}function le(t,e){I(0,[t,t.length],0,e)}function ce(t,e,i,n,r){var o;return null==t?at(this,n,r).year:(o=st(t,n,r),e>o&&(e=o),he.call(this,t,e,i,n,r))}function he(t,e,i,n,r){var o=ot(t,e,i,n,r),a=nt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function ue(t){return t}function de(t,e,i,n){var r=xt(),o=h().set(n,e);return r[i](o,t)}function fe(t,e,i){if(o(t)&&(e=t,t=void 0),t=t||"",null!=e)return de(t,e,i,"month");var n,r=[];for(n=0;n<12;n++)r[n]=de(t,n,i,"month");return r}function pe(t,e,i,n){"boolean"==typeof t?(o(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,o(e)&&(i=e,e=void 0),e=e||"");var r=xt(),a=t?r._week.dow:0;if(null!=i)return de(e,(i+a)%7,n,"day");var s,l=[];for(s=0;s<7;s++)l[s]=de(e,(s+a)%7,n,"day");return l}function ge(t,e,i,n){var r=Jt(e,i);return t._milliseconds+=n*r._milliseconds,t._days+=n*r._days,t._months+=n*r._months,t._bubble()}function me(t){return t<0?Math.floor(t):Math.ceil(t)}function ve(t){return 4800*t/146097}function ye(t){return 146097*t/4800}function be(t){return function(){return this.as(t)}}function xe(t){return function(){return this.isValid()?this._data[t]:NaN}}function _e(t,e,i,n,r){return r.relativeTime(e||1,!!i,t,n)}function we(t,e,i){var n=Jt(t).abs(),r=gn(n.as("s")),o=gn(n.as("m")),a=gn(n.as("h")),s=gn(n.as("d")),l=gn(n.as("M")),c=gn(n.as("y")),h=r<=mn.ss&&["s",r]||r<mn.s&&["ss",r]||o<=1&&["m"]||o<mn.m&&["mm",o]||a<=1&&["h"]||a<mn.h&&["hh",a]||s<=1&&["d"]||s<mn.d&&["dd",s]||l<=1&&["M"]||l<mn.M&&["MM",l]||c<=1&&["y"]||["yy",c];return h[2]=e,h[3]=+t>0,h[4]=i,_e.apply(null,h)}function Se(t){return(t>0)-(t<0)||+t}function Ce(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i,n=vn(this._milliseconds)/1e3,r=vn(this._days),o=vn(this._months);e=y((t=y(n/60))/60),n%=60,t%=60;var a=i=y(o/12),s=o%=12,l=r,c=e,h=t,u=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var f=d<0?"-":"",p=Se(this._months)!==Se(d)?"-":"",g=Se(this._days)!==Se(d)?"-":"",m=Se(this._milliseconds)!==Se(d)?"-":"";return f+"P"+(a?p+a+"Y":"")+(s?p+s+"M":"")+(l?g+l+"D":"")+(c||h||u?"T":"")+(c?m+c+"H":"")+(h?m+h+"M":"")+(u?m+u+"S":"")}var ke,Te;Te=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),i=e.length>>>0,n=0;n<i;n++)if(n in e&&t.call(this,e[n],n,e))return!0;return!1};var Ae=t.momentProperties=[],De=!1,Me={};t.suppressDeprecationWarnings=!1,t.deprecationHandler=null;var Ee;Ee=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)l(t,e)&&i.push(e);return i};var Pe={},Le={},Ie=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Oe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Re={},Ne={},Fe=/\d/,ze=/\d\d/,He=/\d{3}/,$e=/\d{4}/,Ve=/[+-]?\d{6}/,Be=/\d\d?/,We=/\d\d\d\d?/,je=/\d\d\d\d\d\d?/,Ue=/\d{1,3}/,Ye=/\d{1,4}/,Ge=/[+-]?\d{1,6}/,qe=/\d+/,Xe=/[+-]?\d+/,Ke=/Z|[+-]\d\d:?\d\d/gi,Ze=/Z|[+-]\d\d(?::?\d\d)?/gi,Qe=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Je={},ti={},ei=0,ii=1,ni=2,ri=3,oi=4,ai=5,si=6,li=7,ci=8;I("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),I(0,["YY",2],0,function(){return this.year()%100}),I(0,["YYYY",4],0,"year"),I(0,["YYYYY",5],0,"year"),I(0,["YYYYYY",6,!0],0,"year"),A("year","y"),E("year",1),z("Y",Xe),z("YY",Be,ze),z("YYYY",Ye,$e),z("YYYYY",Ge,Ve),z("YYYYYY",Ge,Ve),B(["YYYYY","YYYYYY"],ei),B("YYYY",function(e,i){i[ei]=2===e.length?t.parseTwoDigitYear(e):b(e)}),B("YY",function(e,i){i[ei]=t.parseTwoDigitYear(e)}),B("Y",function(t,e){e[ei]=parseInt(t,10)}),t.parseTwoDigitYear=function(t){return b(t)+(b(t)>68?1900:2e3)};var hi,ui=G("FullYear",!0);hi=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},I("M",["MM",2],"Mo",function(){return this.month()+1}),I("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),I("MMMM",0,0,function(t){return this.localeData().months(this,t)}),A("month","M"),E("month",8),z("M",Be),z("MM",Be,ze),z("MMM",function(t,e){return e.monthsShortRegex(t)}),z("MMMM",function(t,e){return e.monthsRegex(t)}),B(["M","MM"],function(t,e){e[ii]=b(t)-1}),B(["MMM","MMMM"],function(t,e,i,n){var r=i._locale.monthsParse(t,n,i._strict);null!=r?e[ii]=r:d(i).invalidMonth=t});var di=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,fi="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),pi="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),gi=Qe,mi=Qe;I("w",["ww",2],"wo","week"),I("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),E("week",5),E("isoWeek",5),z("w",Be),z("ww",Be,ze),z("W",Be),z("WW",Be,ze),W(["w","ww","W","WW"],function(t,e,i,n){e[n.substr(0,1)]=b(t)});I("d",0,"do","day"),I("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),I("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),I("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),I("e",0,0,"weekday"),I("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),E("day",11),E("weekday",11),E("isoWeekday",11),z("d",Be),z("e",Be),z("E",Be),z("dd",function(t,e){return e.weekdaysMinRegex(t)}),z("ddd",function(t,e){return e.weekdaysShortRegex(t)}),z("dddd",function(t,e){return e.weekdaysRegex(t)}),W(["dd","ddd","dddd"],function(t,e,i,n){var r=i._locale.weekdaysParse(t,n,i._strict);null!=r?e.d=r:d(i).invalidWeekday=t}),W(["d","e","E"],function(t,e,i,n){e[n]=b(t)});var vi="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),yi="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),bi="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),xi=Qe,_i=Qe,wi=Qe;I("H",["HH",2],0,"hour"),I("h",["hh",2],0,dt),I("k",["kk",2],0,function(){return this.hours()||24}),I("hmm",0,0,function(){return""+dt.apply(this)+L(this.minutes(),2)}),I("hmmss",0,0,function(){return""+dt.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)}),I("Hmm",0,0,function(){return""+this.hours()+L(this.minutes(),2)}),I("Hmmss",0,0,function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)}),ft("a",!0),ft("A",!1),A("hour","h"),E("hour",13),z("a",pt),z("A",pt),z("H",Be),z("h",Be),z("k",Be),z("HH",Be,ze),z("hh",Be,ze),z("kk",Be,ze),z("hmm",We),z("hmmss",je),z("Hmm",We),z("Hmmss",je),B(["H","HH"],ri),B(["k","kk"],function(t,e,i){var n=b(t);e[ri]=24===n?0:n}),B(["a","A"],function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t}),B(["h","hh"],function(t,e,i){e[ri]=b(t),d(i).bigHour=!0}),B("hmm",function(t,e,i){var n=t.length-2;e[ri]=b(t.substr(0,n)),e[oi]=b(t.substr(n)),d(i).bigHour=!0}),B("hmmss",function(t,e,i){var n=t.length-4,r=t.length-2;e[ri]=b(t.substr(0,n)),e[oi]=b(t.substr(n,2)),e[ai]=b(t.substr(r)),d(i).bigHour=!0}),B("Hmm",function(t,e,i){var n=t.length-2;e[ri]=b(t.substr(0,n)),e[oi]=b(t.substr(n))}),B("Hmmss",function(t,e,i){var n=t.length-4,r=t.length-2;e[ri]=b(t.substr(0,n)),e[oi]=b(t.substr(n,2)),e[ai]=b(t.substr(r))});var Si,Ci=G("Hours",!0),ki={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:fi,monthsShort:pi,week:{dow:0,doy:6},weekdays:vi,weekdaysMin:bi,weekdaysShort:yi,meridiemParse:/[ap]\.?m?\.?/i},Ti={},Ai={},Di=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Mi=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ei=/Z|[+-]\d\d(?::?\d\d)?/,Pi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Li=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ii=/^\/?Date\((\-?\d+)/i,Oi=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Ri={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};t.createFromInputFallback=w("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),t.ISO_8601=function(){},t.RFC_2822=function(){};var Ni=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Bt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:p()}),Fi=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Bt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:p()}),zi=["year","quarter","month","week","day","hour","minute","second","millisecond"];qt("Z",":"),qt("ZZ",""),z("Z",Ze),z("ZZ",Ze),B(["Z","ZZ"],function(t,e,i){i._useUTC=!0,i._tzm=Xt(Ze,t)});var Hi=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var $i=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Vi=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Jt.fn=Ut.prototype,Jt.invalid=function(){return Jt(NaN)};var Bi=ne(1,"add"),Wi=ne(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",t.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ji=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});I(0,["gg",2],0,function(){return this.weekYear()%100}),I(0,["GG",2],0,function(){return this.isoWeekYear()%100}),le("gggg","weekYear"),le("ggggg","weekYear"),le("GGGG","isoWeekYear"),le("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),E("weekYear",1),E("isoWeekYear",1),z("G",Xe),z("g",Xe),z("GG",Be,ze),z("gg",Be,ze),z("GGGG",Ye,$e),z("gggg",Ye,$e),z("GGGGG",Ge,Ve),z("ggggg",Ge,Ve),W(["gggg","ggggg","GGGG","GGGGG"],function(t,e,i,n){e[n.substr(0,2)]=b(t)}),W(["gg","GG"],function(e,i,n,r){i[r]=t.parseTwoDigitYear(e)}),I("Q",0,"Qo","quarter"),A("quarter","Q"),E("quarter",7),z("Q",Fe),B("Q",function(t,e){e[ii]=3*(b(t)-1)}),I("D",["DD",2],"Do","date"),A("date","D"),E("date",9),z("D",Be),z("DD",Be,ze),z("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),B(["D","DD"],ni),B("Do",function(t,e){e[ni]=b(t.match(Be)[0],10)});var Ui=G("Date",!0);I("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),E("dayOfYear",4),z("DDD",Ue),z("DDDD",He),B(["DDD","DDDD"],function(t,e,i){i._dayOfYear=b(t)}),I("m",["mm",2],0,"minute"),A("minute","m"),E("minute",14),z("m",Be),z("mm",Be,ze),B(["m","mm"],oi);var Yi=G("Minutes",!1);I("s",["ss",2],0,"second"),A("second","s"),E("second",15),z("s",Be),z("ss",Be,ze),B(["s","ss"],ai);var Gi=G("Seconds",!1);I("S",0,0,function(){return~~(this.millisecond()/100)}),I(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),I(0,["SSS",3],0,"millisecond"),I(0,["SSSS",4],0,function(){return 10*this.millisecond()}),I(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),I(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),I(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),I(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),I(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),E("millisecond",16),z("S",Ue,Fe),z("SS",Ue,ze),z("SSS",Ue,He);var qi;for(qi="SSSS";qi.length<=9;qi+="S")z(qi,qe);for(qi="S";qi.length<=9;qi+="S")B(qi,function(t,e){e[si]=b(1e3*("0."+t))});var Xi=G("Milliseconds",!1);I("z",0,0,"zoneAbbr"),I("zz",0,0,"zoneName");var Ki=m.prototype;Ki.add=Bi,Ki.calendar=function(e,i){var n=e||Bt(),r=Kt(n,this).startOf("day"),o=t.calendarFormat(this,r)||"sameElse",a=i&&(C(i[o])?i[o].call(this,n):i[o]);return this.format(a||this.localeData().calendar(o,this,Bt(n)))},Ki.clone=function(){return new m(this)},Ki.diff=function(t,e,i){var n,r,o;if(!this.isValid())return NaN;if(!(n=Kt(t,this)).isValid())return NaN;switch(r=6e4*(n.utcOffset()-this.utcOffset()),e=D(e)){case"year":o=oe(this,n)/12;break;case"month":o=oe(this,n);break;case"quarter":o=oe(this,n)/3;break;case"second":o=(this-n)/1e3;break;case"minute":o=(this-n)/6e4;break;case"hour":o=(this-n)/36e5;break;case"day":o=(this-n-r)/864e5;break;case"week":o=(this-n-r)/6048e5;break;default:o=this-n}return i?o:y(o)},Ki.endOf=function(t){return void 0===(t=D(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},Ki.format=function(e){e||(e=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var i=N(this,e);return this.localeData().postformat(i)},Ki.from=function(t,e){return this.isValid()&&(v(t)&&t.isValid()||Bt(t).isValid())?Jt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Ki.fromNow=function(t){return this.from(Bt(),t)},Ki.to=function(t,e){return this.isValid()&&(v(t)&&t.isValid()||Bt(t).isValid())?Jt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},Ki.toNow=function(t){return this.to(Bt(),t)},Ki.get=function(t){return t=D(t),C(this[t])?this[t]():this},Ki.invalidAt=function(){return d(this).overflow},Ki.isAfter=function(t,e){var i=v(t)?t:Bt(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=D(r(e)?"millisecond":e))?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())},Ki.isBefore=function(t,e){var i=v(t)?t:Bt(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=D(r(e)?"millisecond":e))?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())},Ki.isBetween=function(t,e,i,n){return("("===(n=n||"()")[0]?this.isAfter(t,i):!this.isBefore(t,i))&&(")"===n[1]?this.isBefore(e,i):!this.isAfter(e,i))},Ki.isSame=function(t,e){var i,n=v(t)?t:Bt(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=D(e||"millisecond"))?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))},Ki.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},Ki.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},Ki.isValid=function(){return f(this)},Ki.lang=ji,Ki.locale=ae,Ki.localeData=se,Ki.max=Fi,Ki.min=Ni,Ki.parsingFlags=function(){return c({},d(this))},Ki.set=function(t,e){if("object"==typeof t)for(var i=P(t=M(t)),n=0;n<i.length;n++)this[i[n].unit](t[i[n].unit]);else if(t=D(t),C(this[t]))return this[t](e);return this},Ki.startOf=function(t){switch(t=D(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},Ki.subtract=Wi,Ki.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},Ki.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},Ki.toDate=function(){return new Date(this.valueOf())},Ki.toISOString=function(){if(!this.isValid())return null;var t=this.clone().utc();return t.year()<0||t.year()>9999?N(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):C(Date.prototype.toISOString)?this.toDate().toISOString():N(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},Ki.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+r)},Ki.toJSON=function(){return this.isValid()?this.toISOString():null},Ki.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Ki.unix=function(){return Math.floor(this.valueOf()/1e3)},Ki.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Ki.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Ki.year=ui,Ki.isLeapYear=function(){return Y(this.year())},Ki.weekYear=function(t){return ce.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},Ki.isoWeekYear=function(t){return ce.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},Ki.quarter=Ki.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},Ki.month=tt,Ki.daysInMonth=function(){return Z(this.year(),this.month())},Ki.week=Ki.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},Ki.isoWeek=Ki.isoWeeks=function(t){var e=at(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},Ki.weeksInYear=function(){var t=this.localeData()._week;return st(this.year(),t.dow,t.doy)},Ki.isoWeeksInYear=function(){return st(this.year(),1,4)},Ki.date=Ui,Ki.day=Ki.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=lt(t,this.localeData()),this.add(t-e,"d")):e},Ki.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},Ki.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=ct(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},Ki.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},Ki.hour=Ki.hours=Ci,Ki.minute=Ki.minutes=Yi,Ki.second=Ki.seconds=Gi,Ki.millisecond=Ki.milliseconds=Xi,Ki.utcOffset=function(e,i,n){var r,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Xt(Ze,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&i&&(r=Zt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),o!==e&&(!i||this._changeInProgress?re(this,Jt(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:Zt(this)},Ki.utc=function(t){return this.utcOffset(0,t)},Ki.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Zt(this),"m")),this},Ki.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Xt(Ke,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},Ki.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Bt(t).utcOffset():0,(this.utcOffset()-t)%60==0)},Ki.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Ki.isLocal=function(){return!!this.isValid()&&!this._isUTC},Ki.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Ki.isUtc=Qt,Ki.isUTC=Qt,Ki.zoneAbbr=function(){return this._isUTC?"UTC":""},Ki.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Ki.dates=w("dates accessor is deprecated. Use date instead.",Ui),Ki.months=w("months accessor is deprecated. Use month instead",tt),Ki.years=w("years accessor is deprecated. Use year instead",ui),Ki.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),Ki.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!r(this._isDSTShifted))return this._isDSTShifted;var t={};if(g(t,this),(t=Ht(t))._a){var e=t._isUTC?h(t._a):Bt(t._a);this._isDSTShifted=this.isValid()&&x(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var Zi=T.prototype;Zi.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return C(n)?n.call(e,i):n},Zi.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},Zi.invalidDate=function(){return this._invalidDate},Zi.ordinal=function(t){return this._ordinal.replace("%d",t)},Zi.preparse=ue,Zi.postformat=ue,Zi.relativeTime=function(t,e,i,n){var r=this._relativeTime[i];return C(r)?r(t,e,i,n):r.replace(/%d/i,t)},Zi.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return C(i)?i(e):i.replace(/%s/i,e)},Zi.set=function(t){var e,i;for(i in t)C(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},Zi.months=function(t,i){return t?e(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||di).test(i)?"format":"standalone"][t.month()]:e(this._months)?this._months:this._months.standalone},Zi.monthsShort=function(t,i){return t?e(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[di.test(i)?"format":"standalone"][t.month()]:e(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},Zi.monthsParse=function(t,e,i){var n,r,o;if(this._monthsParseExact)return Q.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(r=h([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(o.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},Zi.monthsRegex=function(t){return this._monthsParseExact?(l(this,"_monthsRegex")||et.call(this),t?this._monthsStrictRegex:this._monthsRegex):(l(this,"_monthsRegex")||(this._monthsRegex=mi),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},Zi.monthsShortRegex=function(t){return this._monthsParseExact?(l(this,"_monthsRegex")||et.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(l(this,"_monthsShortRegex")||(this._monthsShortRegex=gi),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},Zi.week=function(t){return at(t,this._week.dow,this._week.doy).week},Zi.firstDayOfYear=function(){return this._week.doy},Zi.firstDayOfWeek=function(){return this._week.dow},Zi.weekdays=function(t,i){return t?e(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(i)?"format":"standalone"][t.day()]:e(this._weekdays)?this._weekdays:this._weekdays.standalone},Zi.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},Zi.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},Zi.weekdaysParse=function(t,e,i){var n,r,o;if(this._weekdaysParseExact)return ht.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(r=h([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(o.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},Zi.weekdaysRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ut.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=xi),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},Zi.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ut.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=_i),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},Zi.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||ut.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=wi),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},Zi.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},Zi.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},yt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===b(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),t.lang=w("moment.lang is deprecated. Use moment.locale instead.",yt),t.langData=w("moment.langData is deprecated. Use moment.localeData instead.",xt);var Qi=Math.abs,Ji=be("ms"),tn=be("s"),en=be("m"),nn=be("h"),rn=be("d"),on=be("w"),an=be("M"),sn=be("y"),ln=xe("milliseconds"),cn=xe("seconds"),hn=xe("minutes"),un=xe("hours"),dn=xe("days"),fn=xe("months"),pn=xe("years"),gn=Math.round,mn={ss:44,s:45,m:45,h:22,d:26,M:11},vn=Math.abs,yn=Ut.prototype;return yn.isValid=function(){return this._isValid},yn.abs=function(){var t=this._data;return this._milliseconds=Qi(this._milliseconds),this._days=Qi(this._days),this._months=Qi(this._months),t.milliseconds=Qi(t.milliseconds),t.seconds=Qi(t.seconds),t.minutes=Qi(t.minutes),t.hours=Qi(t.hours),t.months=Qi(t.months),t.years=Qi(t.years),this},yn.add=function(t,e){return ge(this,t,e,1)},yn.subtract=function(t,e){return ge(this,t,e,-1)},yn.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=D(t))||"year"===t)return e=this._days+n/864e5,i=this._months+ve(e),"month"===t?i:i/12;switch(e=this._days+Math.round(ye(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},yn.asMilliseconds=Ji,yn.asSeconds=tn,yn.asMinutes=en,yn.asHours=nn,yn.asDays=rn,yn.asWeeks=on,yn.asMonths=an,yn.asYears=sn,yn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12):NaN},yn._bubble=function(){var t,e,i,n,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*me(ye(s)+a),a=0,s=0),l.milliseconds=o%1e3,t=y(o/1e3),l.seconds=t%60,e=y(t/60),l.minutes=e%60,i=y(e/60),l.hours=i%24,a+=y(i/24),r=y(ve(a)),s+=r,a-=me(ye(r)),n=y(s/12),s%=12,l.days=a,l.months=s,l.years=n,this},yn.clone=function(){return Jt(this)},yn.get=function(t){return t=D(t),this.isValid()?this[t+"s"]():NaN},yn.milliseconds=ln,yn.seconds=cn,yn.minutes=hn,yn.hours=un,yn.days=dn,yn.weeks=function(){return y(this.days()/7)},yn.months=fn,yn.years=pn,yn.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=we(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},yn.toISOString=Ce,yn.toString=Ce,yn.toJSON=Ce,yn.locale=ae,yn.localeData=se,yn.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ce),yn.lang=ji,I("X",0,0,"unix"),I("x",0,0,"valueOf"),z("x",Xe),z("X",/[+-]?\d+(\.\d{1,3})?/),B("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),B("x",function(t,e,i){i._d=new Date(b(t))}),t.version="2.19.1",function(t){ke=t}(Bt),t.fn=Ki,t.min=function(){return Wt("isBefore",[].slice.call(arguments,0))},t.max=function(){return Wt("isAfter",[].slice.call(arguments,0))},t.now=function(){return Date.now?Date.now():+new Date},t.utc=h,t.unix=function(t){return Bt(1e3*t)},t.months=function(t,e){return fe(t,e,"months")},t.isDate=a,t.locale=yt,t.invalid=p,t.duration=Jt,t.isMoment=v,t.weekdays=function(t,e,i){return pe(t,e,i,"weekdays")},t.parseZone=function(){return Bt.apply(null,arguments).parseZone()},t.localeData=xt,t.isDuration=Yt,t.monthsShort=function(t,e){return fe(t,e,"monthsShort")},t.weekdaysMin=function(t,e,i){return pe(t,e,i,"weekdaysMin")},t.defineLocale=bt,t.updateLocale=function(t,e){if(null!=e){var i,n=ki;null!=Ti[t]&&(n=Ti[t]._config),(i=new T(e=k(n,e))).parentLocale=Ti[t],Ti[t]=i,yt(t)}else null!=Ti[t]&&(null!=Ti[t].parentLocale?Ti[t]=Ti[t].parentLocale:null!=Ti[t]&&delete Ti[t]);return Ti[t]},t.locales=function(){return Ee(Ti)},t.weekdaysShort=function(t,e,i){return pe(t,e,i,"weekdaysShort")},t.normalizeUnits=D,t.relativeTimeRounding=function(t){return void 0===t?gn:"function"==typeof t&&(gn=t,!0)},t.relativeTimeThreshold=function(t,e){return void 0!==mn[t]&&(void 0===e?mn[t]:(mn[t]=e,"s"===t&&(mn.ss=e-1),!0))},t.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},t.prototype=Ki,t});var PxBlockAlert=function(t){"use strict";function e(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return this.each(function(){if(-1!==["remove","clear","clearAll","destroy"].indexOf(i[0]))return o[i[0]].apply(null,[t(this)].concat(i.slice(1)));o.add.apply(o,[t(this),i[0]].concat(_toConsumableArray(i.slice(1))))})}var i="pxBlockAlert",n=t.fn[i],r={type:null,style:null,namespace:"default",animate:!0,timer:0,closeButton:!0},o={add:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!i)throw new Error("Content is not specified");var r=o._getConfig(n),a=o._getContainer(e),s="px-block-alerts-namespace--"+r.namespace,l=t(a.find("."+s)[0]||t('<div class="'+s+'"></div>').appendTo(a)[0]),c=t('<div class="alert"></div>');r.closeButton&&c.append('<button type="button" class="close">×</button>'),r.type&&c.addClass("alert-"+r.type),r.style&&c.addClass("alert-"+r.style),c.addClass(s+"__alert").append(i),a.removeClass("px-block-alerts-empty"),r.animate&&c.css("display","none").attr("data-animate","true"),l.append(c),r.animate&&c.slideDown(300),r.timer&&c.data("px-block-alert-timer",setTimeout(function(){return o.remove(e,c,r.animate)},1e3*r.timer))},remove:function(t,e){function i(){var e=t.find("> .px-block-alerts");r.remove(),e.find(".alert").length||e.addClass("px-block-alerts-empty")}var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.find(e);if(r.length){var o=r.data("px-block-alert-timer");if(o&&(clearTimeout(o),r.data("px-block-alert-timer",null)),"true"===r.attr("data-animate")&&!0===n)return r.slideUp(300,i);i()}},clear:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("string"!=typeof i)throw new Error("Namespace must be a string.");var r=e.find("> .px-block-alerts .px-block-alerts-namespace--"+i);r.length&&r.find(".alert").each(function(){o.remove(e,t(this),n)})},clearAll:function(e){var i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.find("> .px-block-alerts .alert").each(function(){o.remove(e,t(this),i)})},destroy:function(t){var e=t.find("> .px-block-alerts");e.length&&(o._unsetListeners(e),e.remove())},_getContainer:function(e){var i=e.find("> .px-block-alerts");if(!i.length)if(i=t('<div class="px-block-alerts"></div>'),e.hasClass("panel")){var n=e.find("> .panel-heading");n.length||(n=e.find("> .panel-subtitle")),n.length||(n=e.find("> .panel-title")),n.length?i.insertAfter(n.first()):i.prependTo(e)}else i.prependTo(e);return i.data("pxBlockAlert-listenersDefined")||(o._setListeners(i),i.data("pxBlockAlert-listenersDefined",!0)),i},_getConfig:function(e){var i=t.extend({},r,e);return i.animate=!("false"===i.animate||!1===i.animate),i.closeButton=!("false"===i.closeButton||!1===i.closeButton),i.timer=parseInt(String(i.timer),10)||0,i},_setListeners:function(e){e.on("click",".close",function(){o.remove(e.parent(),t(this).parents(".alert"))})},_unsetListeners:function(t){t.off()}};return t.fn[i]=e,t.fn[i].noConflict=function(){return t.fn[i]=n,e},o}(jQuery),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxTabResize=function(t){"use strict";var e="pxTabResize",i="px.tab-resize",n="."+i,r=t.fn[e],o={template:'\n<li class="dropdown">\n <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"></a>\n <ul class="dropdown-menu"></ul>\n</li>',content:'<span class="tab-resize-icon"></span>'},a={TAB_RESIZE:"tab-resize",TAB_RESIZE_NAV:"tab-resize-nav",SHOW:"show",ACTIVE:"active"},s={NAV_ITEMS:"> li:not(.tab-resize)",NAV_LINK:"> a",DROPDOWN_TOGGLE:"> .dropdown-toggle",DROPDOWN_MENU:"> .dropdown-menu",DROPDOWN_ITEMS:"> li"},l={RESIZE:"resize"+n,CLICK:"click"+n},c=function(){function r(e,i){_classCallCheck(this,r),this.uniqueId=pxUtil.generateUniqueId(),this.config=this._getConfig(i),this.element=t(e).find("> .nav")[0]||e,pxUtil.addClass(e,a.TAB_RESIZE_NAV),this.navItem=this._createNavItemElement(),this.navLink=this._getNavLinkElement(),this.dropdown=this._getDropdownElement(),this._setListeners(),this.placeTabs()}return _createClass(r,[{key:"placeTabs",value:function(){this._resetDropdown();var e=t(this.element).find(s.NAV_ITEMS),i=e.length-1,n=e[i],r=n?e[0].offsetTop:0;if(!n||n.offsetTop<=r)pxUtil.removeClass(this.navItem,a.SHOW);else for(pxUtil.addClass(this.navItem,a.SHOW);n&&!(n.offsetTop<=r);)this._moveItemToDropdown(n),n=e[--i]}},{key:"destroy",value:function(){this._unsetListeners(),this._resetDropdown(),t(this.navItem).remove(),pxUtil.removeClass(this.element,a.TAB_RESIZE_NAV),t(this.element).removeData(i)}},{key:"_createNavItemElement",value:function(){var e=t(this.config.template).addClass(a.TAB_RESIZE)[0];return this.element.insertBefore(e,this.element.firstChild),e}},{key:"_getNavLinkElement",value:function(){return t(this.navItem).find(s.DROPDOWN_TOGGLE).html(this.config.content)[0]}},{key:"_getDropdownElement",value:function(){return t(this.navItem).find(s.DROPDOWN_MENU)[0]}},{key:"_moveItemToDropdown",value:function(e){t(this.dropdown).prepend(e),pxUtil.hasClass(e,a.ACTIVE)&&(pxUtil.addClass(this.navItem,a.ACTIVE),this.navLink.innerHTML=t(e).find(s.NAV_LINK)[0].innerHTML)}},{key:"_resetDropdown",value:function(){pxUtil.removeClass(this.navItem,a.ACTIVE),this.navLink.innerHTML=this.config.content,t(this.element).append(t(this.dropdown).find(s.DROPDOWN_ITEMS))}},{key:"_setListeners",value:function(){var e=this;t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,t.proxy(this.placeTabs,this)),t(this.element).on(this.constructor.Event.CLICK,s.NAV_ITEMS+", > ."+a.TAB_RESIZE+" li",function(){return setTimeout(t.proxy(e.placeTabs,e,10))})}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId),t(this.element).off(n)}},{key:"_getConfig",value:function(e){return t.extend({},this.constructor.Default,e)}}],[{key:"_jQueryInterface",value:function(e){return this.each(function(){var n=t(this).data(i),o="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(n||(n=new r(this,o),t(this).data(i,n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'"');n[e]()}})}},{key:"Default",get:function(){return o}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return l}},{key:"EVENT_KEY",get:function(){return n}}]),r}();return t.fn[e]=c._jQueryInterface,t.fn[e].Constructor=c,t.fn[e].noConflict=function(){return t.fn[e]=r,c._jQueryInterface},c}(jQuery),_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxExpandingInput=function(t){"use strict";var e="pxExpandingInput",i="px.expanding-input",n="."+i,r=t.fn[e],o={EXPANDED:"expanded",CONTROL:"expanding-input-control",OVERLAY:"expanding-input-overlay",CONTENT:"expanding-input-content"},a={FOCUS:"focus"+n,CLICK:"click"+n,EXPAND:"expand"+n,EXPANDED:"expanded"+n,COLLAPSE:"collapse"+n,COLLAPSED:"collapsed"+n},s=function(){function r(e){_classCallCheck(this,r),this.element=e,this.control=t(e).find("."+o.CONTROL)[0],this.overlay=t(e).find("."+o.OVERLAY)[0],this._checkElements(),this._setListeners()}return _createClass(r,[{key:"expand",value:function(){if(!pxUtil.hasClass(this.element,o.EXPANDED)){var e=t.Event(this.constructor.Event.EXPAND,{target:this.element});t(this.element).trigger(e),e.isDefaultPrevented()||(pxUtil.addClass(this.element,o.EXPANDED),t(this.element).trigger(t.Event(this.constructor.Event.EXPANDED,{target:this.element})),t(this.control).trigger("focus"))}}},{key:"collapse",value:function(){if(pxUtil.hasClass(this.element,o.EXPANDED)){var e=t.Event(this.constructor.Event.COLLAPSE,{target:this.element});t(this.element).trigger(e),e.isDefaultPrevented()||(pxUtil.removeClass(this.element,o.EXPANDED),t(this.element).trigger(t.Event(this.constructor.Event.COLLAPSED,{target:this.element})))}}},{key:"destroy",value:function(){this._unsetListeners(),t(this.element).removeData(i)}},{key:"_checkElements",value:function(){if(!pxUtil.hasClass(this.element,"expanding-input"))throw new Error(e+" plugin must be called on an element with 'expanding-input' class.");if(!this.control)throw new Error("Input is not found.");if(this.overlay||(this.overlay=t('<div class="expanding-input-overlay"></div>').insertAfter(this.control)[0]),!t(this.element).find("."+o.CONTENT)[0])throw new Error("Content element is not found.")}},{key:"_setListeners",value:function(){t(this.control).on(this.constructor.Event.FOCUS,t.proxy(this.expand,this)),t(this.overlay).on(this.constructor.Event.CLICK,t.proxy(this.expand,this)),t(this.element).find('[data-collapse="true"]').on(this.constructor.Event.CLICK,t.proxy(this.collapse,this))}},{key:"_unsetListeners",value:function(){t(this.control).off(n),t(this.overlay).off(n),t(this.element).find('[data-collapse="true"]').off(n)}}],[{key:"_jQueryInterface",value:function(e){return this.each(function(){var n=t(this).data(i);if(n||(n=new r(this),t(this).data(i,n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'".');n[e]()}})}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return n}}]),r}();return t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=r,s._jQueryInterface},s}(jQuery);!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){t.extend(t.fn,{validate:function(e){if(this.length){var i=t.data(this[0],"validator");return i||(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.on("click.validate",":submit",function(e){i.submitButton=e.currentTarget,t(this).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(this).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.on("submit.validate",function(e){function n(){var n,r;return i.submitButton&&(i.settings.submitHandler||i.formSubmitted)&&(n=t("<input type='hidden'/>").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),!i.settings.submitHandler||(r=i.settings.submitHandler.call(i,i.currentForm,e),n&&n.remove(),void 0!==r&&r)}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,n()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):n():(i.focusInvalid(),!1)})),i)}e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing.")},valid:function(){var e,i,n;return t(this[0]).is("form")?e=this.validate().form():(n=[],e=!0,i=t(this[0].form).validate(),this.each(function(){(e=i.element(this)&&e)||(n=n.concat(i.errorList))}),i.errorList=n),e},rules:function(e,i){var n,r,o,a,s,l,c=this[0];if(null!=c&&(!c.form&&c.hasAttribute("contenteditable")&&(c.form=this.closest("form")[0],c.name=this.attr("name")),null!=c.form)){if(e)switch(n=t.data(c.form,"validator").settings,r=n.rules,o=t.validator.staticRules(c),e){case"add":t.extend(o,t.validator.normalizeRule(i)),delete o.messages,r[c.name]=o,i.messages&&(n.messages[c.name]=t.extend(n.messages[c.name],i.messages));break;case"remove":return i?(l={},t.each(i.split(/\s/),function(t,e){l[e]=o[e],delete o[e]}),l):(delete r[c.name],o)}return(a=t.validator.normalizeRules(t.extend({},t.validator.classRules(c),t.validator.attributeRules(c),t.validator.dataRules(c),t.validator.staticRules(c)),c)).required&&(s=a.required,delete a.required,a=t.extend({required:s},a)),a.remote&&(s=a.remote,delete a.remote,a=t.extend(a,{remote:s})),a}}}),t.extend(t.expr.pseudos||t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){var i=t(e).val();return null!==i&&!!t.trim(""+i)},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:void 0===i?e:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(new RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(t)))},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(e,i){9===i.which&&""===this.elementValue(e)||-1!==t.inArray(i.keyCode,[16,17,18,20,35,36,37,38,39,40,45,144,225])||(e.name in this.submitted||e.name in this.invalid)&&this.element(e)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,n){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(n):t(e).addClass(i).removeClass(n)},unhighlight:function(e,i,n){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(n):t(e).removeClass(i).addClass(n)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}."),step:t.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){!this.form&&this.hasAttribute("contenteditable")&&(this.form=t(this).closest("form")[0],this.name=t(this).attr("name"));var i=t.data(this.form,"validator"),n="on"+e.type.replace(/^validate/,""),r=i.settings;r[n]&&!t(this).is(r.ignore)&&r[n].call(i,this,e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i,n=this.groups={};t.each(this.settings.groups,function(e,i){"string"==typeof i&&(i=i.split(/\s/)),t.each(i,function(t,i){n[i]=e})}),i=this.settings.rules,t.each(i,function(e,n){i[e]=t.validator.normalizeRule(n)}),t(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",e).on("click.validate","select, option, [type='radio'], [type='checkbox']",e),this.settings.invalidHandler&&t(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){var i,n,r=this.clean(e),o=this.validationTargetFor(r),a=this,s=!0;return void 0===o?delete this.invalid[r.name]:(this.prepareElement(o),this.currentElements=t(o),(n=this.groups[o.name])&&t.each(this.groups,function(t,e){e===n&&t!==o.name&&(r=a.validationTargetFor(a.clean(a.findByName(t))))&&r.name in a.invalid&&(a.currentElements.push(r),s=a.check(r)&&s)}),i=!1!==this.check(o),s=s&&i,this.invalid[o.name]=!i,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),t(e).attr("aria-invalid",!i)),s},showErrors:function(e){if(e){var i=this;t.extend(this.errorMap,e),this.errorList=t.map(this.errorMap,function(t,e){return{message:t,element:i.findByName(e)[0]}}),this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var e=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(e)},resetElements:function(t){var e;if(this.settings.unhighlight)for(e=0;t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,""),this.findByName(t[e].name).removeClass(this.settings.validClass);else t.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(t){var e,i=0;for(e in t)void 0!==t[e]&&null!==t[e]&&!1!==t[e]&&i++;return i},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(t){t.not(this.containers).text(""),this.addWrapper(t).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var n=this.name||t(this).attr("name");return!n&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.hasAttribute("contenteditable")&&(this.form=t(this).closest("form")[0],this.name=n),!(n in i||!e.objectLength(t(this).rules()))&&(i[n]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.split(" ").join(".");return t(this.settings.errorElement+"."+e,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([])},reset:function(){this.resetInternals(),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i,n,r=t(e),o=e.type;return"radio"===o||"checkbox"===o?this.findByName(e.name).filter(":checked").val():"number"===o&&void 0!==e.validity?e.validity.badInput?"NaN":r.val():(i=e.hasAttribute("contenteditable")?r.text():r.val(),"file"===o?"C:\\fakepath\\"===i.substr(0,12)?i.substr(12):(n=i.lastIndexOf("/"))>=0?i.substr(n+1):(n=i.lastIndexOf("\\"))>=0?i.substr(n+1):i:"string"==typeof i?i.replace(/\r/g,""):i)},check:function(e){e=this.validationTargetFor(this.clean(e));var i,n,r,o,a=t(e).rules(),s=t.map(a,function(t,e){return e}).length,l=!1,c=this.elementValue(e);if("function"==typeof a.normalizer?o=a.normalizer:"function"==typeof this.settings.normalizer&&(o=this.settings.normalizer),o){if("string"!=typeof(c=o.call(e,c)))throw new TypeError("The normalizer should return a string value.");delete a.normalizer}for(n in a){r={method:n,parameters:a[n]};try{if("dependency-mismatch"===(i=t.validator.methods[n].call(this,c,e,r.parameters))&&1===s){l=!0;continue}if(l=!1,"pending"===i)return void(this.toHide=this.toHide.not(this.errorsFor(e)));if(!i)return this.formatAndAdd(e,r),!1}catch(t){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+r.method+"' method.",t),t instanceof TypeError&&(t.message+=". Exception occurred when checking element "+e.id+", check the '"+r.method+"' method."),t}}if(!l)return this.objectLength(a)&&this.successList.push(e),!0},customDataMessage:function(e,i){return t(e).data("msg"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase())||t(e).data("msg")},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;t<arguments.length;t++)if(void 0!==arguments[t])return arguments[t]},defaultMessage:function(e,i){"string"==typeof i&&(i={method:i});var n=this.findDefined(this.customMessage(e.name,i.method),this.customDataMessage(e,i.method),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i.method],"<strong>Warning: No message defined for "+e.name+"</strong>"),r=/\$?\{(\d+)\}/g;return"function"==typeof n?n=n.call(this,i.parameters,e):r.test(n)&&(n=t.validator.format(n.replace(r,"{$1}"),i.parameters)),n},formatAndAdd:function(t,e){var i=this.defaultMessage(t,e);this.errorList.push({message:i,element:t,method:e.method}),this.errorMap[t.name]=i,this.submitted[t.name]=i},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e,i;for(t=0;this.errorList[t];t++)i=this.errorList[t],this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var n,r,o,a,s=this.errorsFor(e),l=this.idOrName(e),c=t(e).attr("aria-describedby");s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(n=s=t("<"+this.settings.errorElement+">").attr("id",l+"-error").addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(n=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(n):this.settings.errorPlacement?this.settings.errorPlacement.call(this,n,t(e)):n.insertAfter(e),s.is("label")?s.attr("for",l):0===s.parents("label[for='"+this.escapeCssMeta(l)+"']").length&&(o=s.attr("id"),c?c.match(new RegExp("\\b"+this.escapeCssMeta(o)+"\\b"))||(c+=" "+o):c=o,t(e).attr("aria-describedby",c),(r=this.groups[e.name])&&(a=this,t.each(a.groups,function(e,i){i===r&&t("[name='"+a.escapeCssMeta(e)+"']",a.currentForm).attr("aria-describedby",s.attr("id"))})))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.escapeCssMeta(this.idOrName(e)),n=t(e).attr("aria-describedby"),r="label[for='"+i+"'], label[for='"+i+"'] *";return n&&(r=r+", #"+this.escapeCssMeta(n).replace(/\s+/g,", #")),this.errors().filter(r)},escapeCssMeta:function(t){return t.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(e){return this.checkable(e)&&(e=this.findByName(e.name)),t(e).not(this.settings.ignore)[0]},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+this.escapeCssMeta(e)+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return!this.dependTypes[typeof t]||this.dependTypes[typeof t](t,e)},dependTypes:{boolean:function(t){return t},string:function(e,i){return!!t(e,i.form).length},function:function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(e){this.pending[e.name]||(this.pendingRequest++,t(e).addClass(this.settings.pendingClass),this.pending[e.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[e.name],t(e).removeClass(this.settings.pendingClass),i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.submitButton&&t("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e,i){return i="string"==typeof i&&i||"remote",t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,{method:i})})},destroy:function(){this.resetForm(),t(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},n=t(e).attr("class");return n&&t.each(n.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},normalizeAttributeRule:function(t,e,i,n){/min|max|step/.test(i)&&(null===e||/number|range|text/.test(e))&&(n=Number(n),isNaN(n)&&(n=void 0)),n||0===n?t[i]=n:e===i&&"range"!==e&&(t[i]=!0)},attributeRules:function(e){var i,n,r={},o=t(e),a=e.getAttribute("type");for(i in t.validator.methods)"required"===i?(""===(n=e.getAttribute(i))&&(n=!0),n=!!n):n=o.attr(i),this.normalizeAttributeRule(r,a,i,n);return r.maxlength&&/-1|2147483647|524288/.test(r.maxlength)&&delete r.maxlength,r},dataRules:function(e){var i,n,r={},o=t(e),a=e.getAttribute("type");for(i in t.validator.methods)n=o.data("rule"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase()),this.normalizeAttributeRule(r,a,i,n);return r},staticRules:function(e){var i={},n=t.data(e.form,"validator");return n.settings.rules&&(i=t.validator.normalizeRule(n.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(n,r){if(!1!==r){if(r.param||r.depends){var o=!0;switch(typeof r.depends){case"string":o=!!t(r.depends,i.form).length;break;case"function":o=r.depends.call(i,i)}o?e[n]=void 0===r.param||r.param:(t.data(i.form,"validator").resetElements(t(i)),delete e[n])}}else delete e[n]}),t.each(e,function(n,r){e[n]=t.isFunction(r)&&"normalizer"!==n?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].replace(/[\[\]]/g,"").split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(null!=e.min&&null!=e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),null!=e.minlength&&null!=e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,n){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==n?n:t.validator.messages[e],i.length<3&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,n){if(!this.depend(n,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:e.length>0},email:function(t,e){return this.optional(e)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t)},url:function(t,e){return this.optional(e)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(new Date(t).toString())},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(t)},number:function(t,e){return this.optional(e)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},minlength:function(e,i,n){var r=t.isArray(e)?e.length:this.getLength(e,i);return this.optional(i)||r>=n},maxlength:function(e,i,n){var r=t.isArray(e)?e.length:this.getLength(e,i);return this.optional(i)||r<=n},rangelength:function(e,i,n){var r=t.isArray(e)?e.length:this.getLength(e,i);return this.optional(i)||r>=n[0]&&r<=n[1]},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||t<=i},range:function(t,e,i){return this.optional(e)||t>=i[0]&&t<=i[1]},step:function(e,i,n){var r,o=t(i).attr("type"),a="Step attribute on input type "+o+" is not supported.",s=new RegExp("\\b"+o+"\\b"),l=function(t){var e=(""+t).match(/(?:\.(\d+))?$/);return e&&e[1]?e[1].length:0},c=function(t){return Math.round(t*Math.pow(10,r))},h=!0;if(o&&!s.test(["text","number","range"].join()))throw new Error(a);return r=l(n),(l(e)>r||c(e)%c(n)!=0)&&(h=!1),this.optional(i)||h},equalTo:function(e,i,n){var r=t(n);return this.settings.onfocusout&&r.not(".validate-equalTo-blur").length&&r.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,n,r){if(this.optional(i))return"dependency-mismatch";r="string"==typeof r&&r||"remote";var o,a,s,l=this.previousValue(i,r);return this.settings.messages[i.name]||(this.settings.messages[i.name]={}),l.originalMessage=l.originalMessage||this.settings.messages[i.name][r],this.settings.messages[i.name][r]=l.message,n="string"==typeof n&&{url:n}||n,s=t.param(t.extend({data:e},n.data)),l.old===s?l.valid:(l.old=s,o=this,this.startRequest(i),a={},a[i.name]=e,t.ajax(t.extend(!0,{mode:"abort",port:"validate"+i.name,dataType:"json",data:a,context:o.currentForm,success:function(t){var n,a,s,c=!0===t||"true"===t;o.settings.messages[i.name][r]=l.originalMessage,c?(s=o.formSubmitted,o.resetInternals(),o.toHide=o.errorsFor(i),o.formSubmitted=s,o.successList.push(i),o.invalid[i.name]=!1,o.showErrors()):(n={},a=t||o.defaultMessage(i,{method:r,parameters:e}),n[i.name]=l.message=a,o.invalid[i.name]=!0,o.showErrors(n)),l.valid=c,o.stopRequest(i,c)}},n)),"pending")}}});var e,i={};return t.ajaxPrefilter?t.ajaxPrefilter(function(t,e,n){var r=t.port;"abort"===t.mode&&(i[r]&&i[r].abort(),i[r]=n)}):(e=t.ajax,t.ajax=function(n){var r=("mode"in n?n:t.ajaxSettings).mode,o=("port"in n?n:t.ajaxSettings).port;return"abort"===r?(i[o]&&i[o].abort(),i[o]=e.apply(this,arguments),i[o]):e.apply(this,arguments)}),t}),function(t){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){return function(){function e(t){return t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}t.validator.addMethod("maxWords",function(t,i,n){return this.optional(i)||e(t).match(/\b\w+\b/g).length<=n},t.validator.format("Please enter {0} words or less.")),t.validator.addMethod("minWords",function(t,i,n){return this.optional(i)||e(t).match(/\b\w+\b/g).length>=n},t.validator.format("Please enter at least {0} words.")),t.validator.addMethod("rangeWords",function(t,i,n){var r=e(t),o=/\b\w+\b/g;return this.optional(i)||r.match(o).length>=n[0]&&r.match(o).length<=n[1]},t.validator.format("Please enter between {0} and {1} words."))}(),t.validator.addMethod("accept",function(e,i,n){var r,o,a="string"==typeof n?n.replace(/\s/g,""):"image/*",s=this.optional(i);if(s)return s;if("file"===t(i).attr("type")&&(a=a.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),i.files&&i.files.length))for(o=new RegExp(".?("+a+")$","i"),r=0;r<i.files.length;r++)if(!i.files[r].type.match(o))return!1;return!0},t.validator.format("Please enter a value with a valid mimetype.")),t.validator.addMethod("alphanumeric",function(t,e){return this.optional(e)||/^\w+$/i.test(t)},"Letters, numbers, and underscores only please"),t.validator.addMethod("bankaccountNL",function(t,e){if(this.optional(e))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(t))return!1;var i,n=t.replace(/ /g,""),r=0,o=n.length;for(i=0;i<o;i++)r+=(o-i)*n.substring(i,i+1);return r%11==0},"Please specify a valid bank account number"),t.validator.addMethod("bankorgiroaccountNL",function(e,i){return this.optional(i)||t.validator.methods.bankaccountNL.call(this,e,i)||t.validator.methods.giroaccountNL.call(this,e,i)},"Please specify a valid bank or giro account number"),t.validator.addMethod("bic",function(t,e){return this.optional(e)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(t.toUpperCase())},"Please specify a valid BIC code"),t.validator.addMethod("cifES",function(t,e){"use strict";if(this.optional(e))return!0;var i,n,r,o,a=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),s=t.substring(0,1),l=t.substring(1,8),c=t.substring(8,9),h=0,u=0,d=0;if(9!==t.length||!a.test(t))return!1;for(i=0;i<l.length;i++)n=parseInt(l[i],10),!function(t){return t%2==0}(i)?u+=n:d+=(n*=2)<10?n:n-9;return h=u+d,r=(10-h.toString().substr(-1)).toString(),r=parseInt(r,10)>9?"0":r,o="JABCDEFGHI".substr(r,1).toString(),s.match(/[ABEH]/)?c===r:s.match(/[KPQS]/)?c===o:c===r||c===o},"Please specify a valid CIF number."),t.validator.addMethod("cpfBR",function(t){if(11!==(t=t.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"")).length)return!1;var e,i,n,r,o=0;if(e=parseInt(t.substring(9,10),10),i=parseInt(t.substring(10,11),10),n=function(t,e){var i=10*t%11;return 10!==i&&11!==i||(i=0),i===e},""===t||"00000000000"===t||"11111111111"===t||"22222222222"===t||"33333333333"===t||"44444444444"===t||"55555555555"===t||"66666666666"===t||"77777777777"===t||"88888888888"===t||"99999999999"===t)return!1;for(r=1;r<=9;r++)o+=parseInt(t.substring(r-1,r),10)*(11-r);if(n(o,e)){for(o=0,r=1;r<=10;r++)o+=parseInt(t.substring(r-1,r),10)*(12-r);return n(o,i)}return!1},"Please specify a valid CPF number"),t.validator.addMethod("creditcard",function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i,n,r=0,o=0,a=!1;if((t=t.replace(/\D/g,"")).length<13||t.length>19)return!1;for(i=t.length-1;i>=0;i--)n=t.charAt(i),o=parseInt(n,10),a&&(o*=2)>9&&(o-=9),r+=o,a=!a;return r%10==0},"Please enter a valid credit card number."),t.validator.addMethod("creditcardtypes",function(t,e,i){if(/[^0-9\-]+/.test(t))return!1;t=t.replace(/\D/g,"");var n=0;return i.mastercard&&(n|=1),i.visa&&(n|=2),i.amex&&(n|=4),i.dinersclub&&(n|=8),i.enroute&&(n|=16),i.discover&&(n|=32),i.jcb&&(n|=64),i.unknown&&(n|=128),i.all&&(n=255),1&n&&/^(5[12345])/.test(t)?16===t.length:2&n&&/^(4)/.test(t)?16===t.length:4&n&&/^(3[47])/.test(t)?15===t.length:8&n&&/^(3(0[012345]|[68]))/.test(t)?14===t.length:16&n&&/^(2(014|149))/.test(t)?15===t.length:32&n&&/^(6011)/.test(t)?16===t.length:64&n&&/^(3)/.test(t)?16===t.length:64&n&&/^(2131|1800)/.test(t)?15===t.length:!!(128&n)},"Please enter a valid credit card number."),t.validator.addMethod("currency",function(t,e,i){var n,r="string"==typeof i,o=r?i:i[0],a=!!r||i[1];return o=o.replace(/,/g,""),o=a?o+"]":o+"]?",n="^["+o+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",n=new RegExp(n),this.optional(e)||n.test(t)},"Please specify a valid currency"),t.validator.addMethod("dateFA",function(t,e){return this.optional(e)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(t)},t.validator.messages.date),t.validator.addMethod("dateITA",function(t,e){var i,n,r,o,a,s=!1;return/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(t)?(i=t.split("/"),n=parseInt(i[0],10),r=parseInt(i[1],10),o=parseInt(i[2],10),s=(a=new Date(Date.UTC(o,r-1,n,12,0,0,0))).getUTCFullYear()===o&&a.getUTCMonth()===r-1&&a.getUTCDate()===n):s=!1,this.optional(e)||s},t.validator.messages.date),t.validator.addMethod("dateNL",function(t,e){return this.optional(e)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(t)},t.validator.messages.date),t.validator.addMethod("extension",function(t,e,i){return i="string"==typeof i?i.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(e)||t.match(new RegExp("\\.("+i+")$","i"))},t.validator.format("Please enter a value with a valid extension.")),t.validator.addMethod("giroaccountNL",function(t,e){return this.optional(e)||/^[0-9]{1,7}$/.test(t)},"Please specify a valid giro account number"),t.validator.addMethod("iban",function(t,e){if(this.optional(e))return!0;var i,n,r,o,a,s,l,c=t.replace(/ /g,"").toUpperCase(),h="",u=!0,d="";if(c.length<5)return!1;if(i=c.substring(0,2),a={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},void 0!==(o=a[i])&&!new RegExp("^[A-Z]{2}\\d{2}"+o+"$","").test(c))return!1;for(n=c.substring(4,c.length)+c.substring(0,4),s=0;s<n.length;s++)"0"!==(r=n.charAt(s))&&(u=!1),u||(h+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(r));for(l=0;l<h.length;l++)d=(""+d+h.charAt(l))%97;return 1===d},"Please specify a valid IBAN"),t.validator.addMethod("integer",function(t,e){return this.optional(e)||/^-?\d+$/.test(t)},"A positive or negative non-decimal number please"),t.validator.addMethod("ipv4",function(t,e){return this.optional(e)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(t)},"Please enter a valid IP v4 address."),t.validator.addMethod("ipv6",function(t,e){return this.optional(e)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(t)},"Please enter a valid IP v6 address."),t.validator.addMethod("lettersonly",function(t,e){return this.optional(e)||/^[a-z]+$/i.test(t)},"Letters only please"),t.validator.addMethod("letterswithbasicpunc",function(t,e){return this.optional(e)||/^[a-z\-.,()'"\s]+$/i.test(t)},"Letters or punctuation only please"),t.validator.addMethod("mobileNL",function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(t)},"Please specify a valid mobile number"),t.validator.addMethod("mobileUK",function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),t.validator.addMethod("netmask",function(t,e){return this.optional(e)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(t)},"Please enter a valid netmask."),t.validator.addMethod("nieES",function(t,e){"use strict";if(this.optional(e))return!0;var i,n=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi),r=t.substr(t.length-1).toUpperCase();return!((t=t.toString().toUpperCase()).length>10||t.length<9||!n.test(t))&&(t=t.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2"),i=9===t.length?t.substr(0,8):t.substr(0,9),"TRWAGMYFPDXBNJZSQVHLCKET".charAt(parseInt(i,10)%23)===r)},"Please specify a valid NIE number."),t.validator.addMethod("nifES",function(t,e){"use strict";return!!this.optional(e)||!!(t=t.toUpperCase()).match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")&&(/^[0-9]{8}[A-Z]{1}$/.test(t)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,0)%23)===t.charAt(8):!!/^[KLM]{1}/.test(t)&&t[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(t.substring(8,1)%23))},"Please specify a valid NIF number."),t.validator.addMethod("nipPL",function(t){"use strict";if(10!==(t=t.replace(/[^0-9]/g,"")).length)return!1;for(var e=[6,5,7,2,3,4,5,6,7],i=0,n=0;n<9;n++)i+=e[n]*t[n];var r=i%11;return(10===r?0:r)===parseInt(t[9],10)},"Please specify a valid NIP number."),t.validator.addMethod("notEqualTo",function(e,i,n){return this.optional(i)||!t.validator.methods.equalTo.call(this,e,i,n)},"Please enter a different value, values must not be the same."),t.validator.addMethod("nowhitespace",function(t,e){return this.optional(e)||/^\S+$/i.test(t)},"No white space please"),t.validator.addMethod("pattern",function(t,e,i){return!!this.optional(e)||("string"==typeof i&&(i=new RegExp("^(?:"+i+")$")),i.test(t))},"Invalid format."),t.validator.addMethod("phoneNL",function(t,e){return this.optional(e)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(t)},"Please specify a valid phone number."),t.validator.addMethod("phonesUK",function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),t.validator.addMethod("phoneUK",function(t,e){return t=t.replace(/\(|\)|\s+|-/g,""),this.optional(e)||t.length>9&&t.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),t.validator.addMethod("phoneUS",function(t,e){return t=t.replace(/\s+/g,""),this.optional(e)||t.length>9&&t.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),t.validator.addMethod("postalcodeBR",function(t,e){return this.optional(e)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(t)},"Informe um CEP válido."),t.validator.addMethod("postalCodeCA",function(t,e){return this.optional(e)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(t)},"Please specify a valid postal code"),t.validator.addMethod("postalcodeIT",function(t,e){return this.optional(e)||/^\d{5}$/.test(t)},"Please specify a valid postal code"),t.validator.addMethod("postalcodeNL",function(t,e){return this.optional(e)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(t)},"Please specify a valid postal code"),t.validator.addMethod("postcodeUK",function(t,e){return this.optional(e)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(t)},"Please specify a valid UK postcode"),t.validator.addMethod("require_from_group",function(e,i,n){var r=t(n[1],i.form),o=r.eq(0),a=o.data("valid_req_grp")?o.data("valid_req_grp"):t.extend({},this),s=r.filter(function(){return a.elementValue(this)}).length>=n[0];return o.data("valid_req_grp",a),t(i).data("being_validated")||(r.data("being_validated",!0),r.each(function(){a.element(this)}),r.data("being_validated",!1)),s},t.validator.format("Please fill at least {0} of these fields.")),t.validator.addMethod("skip_or_fill_minimum",function(e,i,n){var r=t(n[1],i.form),o=r.eq(0),a=o.data("valid_skip")?o.data("valid_skip"):t.extend({},this),s=r.filter(function(){return a.elementValue(this)}).length,l=0===s||s>=n[0];return o.data("valid_skip",a),t(i).data("being_validated")||(r.data("being_validated",!0),r.each(function(){a.element(this)}),r.data("being_validated",!1)),l},t.validator.format("Please either skip these fields or fill at least {0} of them.")),t.validator.addMethod("stateUS",function(t,e,i){var n,r=void 0===i,o=!r&&void 0!==i.caseSensitive&&i.caseSensitive,a=!r&&void 0!==i.includeTerritories&&i.includeTerritories,s=!r&&void 0!==i.includeMilitary&&i.includeMilitary;return n=a||s?a&&s?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":a?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",n=o?new RegExp(n):new RegExp(n,"i"),this.optional(e)||n.test(t)},"Please specify a valid state"),t.validator.addMethod("strippedminlength",function(e,i,n){return t(e).text().length>=n},t.validator.format("Please enter at least {0} characters")),t.validator.addMethod("time",function(t,e){return this.optional(e)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(t)},"Please enter a valid time, between 00:00 and 23:59"),t.validator.addMethod("time12h",function(t,e){return this.optional(e)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(t)},"Please enter a valid time in 12-hour am/pm format"),t.validator.addMethod("url2",function(t,e){return this.optional(e)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)},t.validator.messages.url),t.validator.addMethod("vinUS",function(t){if(17!==t.length)return!1;var e,i,n,r,o,a,s=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],l=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],c=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],h=0;for(e=0;e<17;e++){if(r=c[e],n=t.slice(e,e+1),8===e&&(a=n),isNaN(n)){for(i=0;i<s.length;i++)if(n.toUpperCase()===s[i]){n=l[i],n*=r,isNaN(a)&&8===i&&(a=s[i]);break}}else n*=r;h+=n}return 10===(o=h%11)&&(o="X"),o===a},"The specified vehicle identification number (VIN) is invalid."),t.validator.addMethod("zipcodeUS",function(t,e){return this.optional(e)||/^\d{5}(-\d{4})?$/.test(t)},"The specified US ZIP Code is invalid"),t.validator.addMethod("ziprange",function(t,e){return this.optional(e)||/^90[2-5]\d\{2\}-\d{4}$/.test(t)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx"),t});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxValidate=function(t){"use strict";if(!t.fn.validate)throw new Error("jquery.validate.js required.");var e="pxValidate",i=t.fn[e],n={FORM_HELP:"form-help-text",HAS_ERROR:"has-validation-error",ERROR:"validation-error",CONTAINER:"validation-container",NO_ARROW:"validation-error-no-arrow"},r={errorElement:"div",errorClass:"form-message "+n.ERROR},o=new RegExp("(^|\\s)(?:"+n.CONTAINER+"|form-group|col-(?:xs|sm|md|lg)-\\d+)(\\s|$)"),a=function(){function i(e,n){_classCallCheck(this,i),this.element=e,this.validator=t(e).validate(this._getConfig(e,n))}return _createClass(i,[{key:"getValidator",value:function(){return this.validator}},{key:"destroy",value:function(){this.validator.destroy(),t(this.element).removeData("px.validate")}},{key:"_highlight",value:function(e){pxUtil.addClass(t(e).parents(".form-group")[0],"has-error "+n.HAS_ERROR)}},{key:"_unhighlight",value:function(e){pxUtil.removeClass(t(e).parents(".form-group")[0],"has-error "+n.HAS_ERROR)}},{key:"_errorPlacement",value:function(e,i){var r=t(this._getParentContainer(i[0]));if(r.length){r.find("."+n.ERROR).remove();var o=i[0].getAttribute("type");"checkbox"!==(o=o?o.toLowerCase():null)&&"radio"!==o||pxUtil.addClass(e[0],n.NO_ARROW);var a=r.find("."+n.FORM_HELP).first();a.length?e.insertBefore(a):r.append(e)}}},{key:"_getParentContainer",value:function(t){var e=t.parentNode,i=e.nodeName.toUpperCase();return"FORM"===i||"BODY"===i?(console.error(new Error("Cannot find parent container.")),null):o.test(e.className)?e:this._getParentContainer(e)}},{key:"_getConfig",value:function(e,i){return t.extend({},this.constructor.Default,{highlight:this._highlight,unhighlight:this._unhighlight,errorPlacement:t.proxy(this._errorPlacement,this)},t(e).data(),i)}}],[{key:"_jQueryInterface",value:function(e){var n=void 0,r=this.each(function(){var r=t(this).data("px.validate"),o="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(r||(r=new i(this,o),t(this).data("px.validate",r)),"string"==typeof e){if(!r[e])throw new Error('No method named "'+e+'".');n=r[e]()}});return void 0!==n?n:r}},{key:"Default",get:function(){return r}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return"px.validate"}}]),i}();return t.fn[e]=a._jQueryInterface,t.fn[e].Constructor=a,t.fn[e].noConflict=function(){return t.fn[e]=i,a._jQueryInterface},a}(jQuery),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxResponsiveBg=function(t){"use strict";var e="pxResponsiveBg",i="px.responsiveBg",n=t.fn[e],r={backgroundImage:null,backgroundPosition:"center middle",overlay:!1,overlayOpacity:.2},o={CONTAINER:"px-responsive-bg-container",IMAGE:"px-responsive-bg",OVERLAY:"px-responsive-bg-overlay"},a={RESIZE:"resize.px.responsiveBg"},s=function(){function n(t,e){var i=this;_classCallCheck(this,n),this.uniqueId=pxUtil.generateUniqueId(),this.element=t,this.config=this._getConfig(e),null!==this.config.backgroundImage&&this._loadImage(this.config.backgroundImage,function(t){i._sizeRatio=t.height/t.width,i._setupMarkup(t),i._setListeners(),i.update()})}return _createClass(n,[{key:"update",value:function(){var e=this.image.parentNode,i=t(e).height(),n=t(e).width(),r=void 0,o=void 0,a=void 0,s=void 0;n*this._sizeRatio>i?(o="100%",r=Math.ceil(n*this._sizeRatio),s=0,a="top"===this.config.backgroundPosition[1]?0:"bottom"===this.config.backgroundPosition[1]?-1*(r-i):Math.floor(-1*(r-i)/2)):(o=Math.ceil(i/this._sizeRatio),r=i,a=0,s="left"===this.config.backgroundPosition[0]?0:"right"===this.config.backgroundPosition[0]?-1*(o-n):Math.floor(-1*(o-n)/2)),this.image.style.width="100%"===o?o:o+"px",this.image.style.height=r+"px",this.image.style.top=a+"px",this.image.style.left=s+"px"}},{key:"destroy",value:function(e){this._unsetListeners(),e&&t(this.element).removeClass(o.CONTAINER).find("> ."+o.IMAGE).remove(),t(this.element).removeData(i)}},{key:"_loadImage",value:function(t,e){var i=new Image;i.onload=function(){return e(i)},i.src=t}},{key:"_setupMarkup",value:function(e){pxUtil.addClass(this.element,o.CONTAINER);var i=t(this.element).find("> ."+o.IMAGE);if(i.length||(i=t('<div class="'+o.IMAGE+'"></div>').appendTo(this.element)).append('<img alt="">'),this.image=i.find("> img")[0],!this.image)throw new Error("Background <img> element not found!");t(this.image).attr("src",e.src),!1!==this.config.overlay?(i.find("."+o.OVERLAY).remove(),i.prepend("string"==typeof this.config.overlay&&"<"===this.config.overlay[0]?t(this.config.overlay).addClass(o.OVERLAY).css("opacity",this.config.overlayOpacity):t('<div class="'+o.OVERLAY+'"></div>').css({background:"boolean"==typeof this.config.overlay?"#000":this.config.overlay,opacity:this.config.overlayOpacity}))):i.find("> ."+o.OVERLAY).remove()}},{key:"_setListeners",value:function(){t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,t.proxy(this.update,this))}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId)}},{key:"_getConfig",value:function(e){var i=t.extend({},this.constructor.Default,t(this.element).data(),e);if(!i.backgroundImage&&null!==i.backgroundImage)throw new Error("Background image is not specified.");var n=String(i.backgroundPosition).split(" ").slice(0,2);return"center"!==n[0]&&"left"!==n[0]&&"right"!==n[0]&&(n[0]="center"),"middle"!==n[1]&&"top"!==n[1]&&"bottom"!==n[1]&&(n[1]="middle"),i.backgroundPosition=n,i}}],[{key:"_jQueryInterface",value:function(e){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return this.each(function(){var r=t(this).data(i),a="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(r||"destroy"===e||(r=new n(this,a),t(this).data(i,r)),r&&"string"==typeof e){var s;if(!r[e])throw new Error('No method named "'+e+'"');(s=r)[e].apply(s,o)}})}},{key:"Default",get:function(){return r}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return".px.responsiveBg"}}]),n}();return t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=n,s._jQueryInterface},s}(jQuery),_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxCharLimit=function(t){"use strict";var e="pxCharLimit",i="px.charLimit",n="."+i,r=t.fn[e],o={maxlength:null,counter:""},a={CHANGE:"change"+n,KEYUP:"keyup"+n,FOCUS:"focus"+n},s=function(){function r(e,i){_classCallCheck(this,r),this.element=e,this.isTextarea=t(e).is("textarea"),this.config=this._getConfig(i),this.counter=this._getLabel(),this._setMaxLength(),this._setListeners(),this.update()}return _createClass(r,[{key:"update",value:function(){var e=this.config.maxlength,i=this.element.value,n=void 0;this.isTextarea&&(i=i.replace(/\r?\n/g,"\n")),(n=i.length)>e&&(t(this.element).val(i.substr(0,e)).trigger("change"),n=e),this.counter&&(this.counter.innerHTML=e-n)}},{key:"destroy",value:function(){this._unsetListeners(),t(this.element).removeData(i)}},{key:"_getLabel",value:function(){return this.config.counter?"string"==typeof this.config.counter?t(this.config.counter)[0]||null:this.config.counter:null}},{key:"_setMaxLength",value:function(){this.isTextarea?this.element.removeAttribute("maxlength"):this.element.setAttribute("maxlength",this.config.maxlength)}},{key:"_setListeners",value:function(){t(this.element).on(this.constructor.Event.CHANGE,t.proxy(this.update,this)).on(this.constructor.Event.KEYUP,t.proxy(this.update,this)).on(this.constructor.Event.FOCUS,t.proxy(this.update,this))}},{key:"_unsetListeners",value:function(){t(this.element).off(n)}},{key:"_getConfig",value:function(e){var i=t.extend({},this.constructor.Default,{maxlength:this.element.getAttribute("maxlength")},t(this.element).data(),e);if(!i.maxlength)throw new Error("maxlength is not specified.");return this.isTextarea&&this.element.getAttribute("maxlength")&&this.element.removeAttribute("maxlength"),i}}],[{key:"_jQueryInterface",value:function(e){return this.each(function(){var n=t(this).data(i),o="object"===(void 0===e?"undefined":_typeof(e))?e:null;if(n||(n=new r(this,o),t(this).data(i,n)),"string"==typeof e){if(!n[e])throw new Error('No method named "'+e+'"');n[e]()}})}},{key:"Default",get:function(){return o}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return a}},{key:"EVENT_KEY",get:function(){return n}}]),r}();return t.fn[e]=s._jQueryInterface,t.fn[e].Constructor=s,t.fn[e].noConflict=function(){return t.fn[e]=r,s._jQueryInterface},s}(jQuery);!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(i),i}:t(jQuery)}(function(t){var e=function(){if(t&&t.fn&&t.fn.select2&&t.fn.select2.amd)e=t.fn.select2.amd;var e;return function(){if(!e||!e.requirejs){e?i=e:e={};var t,i,n;!function(e){function r(t,e){return _.call(t,e)}function o(t,e){var i,n,r,o,a,s,l,c,h,u,d,f=e&&e.split("/"),p=b.map,g=p&&p["*"]||{};if(t){for(a=(t=t.split("/")).length-1,b.nodeIdCompat&&S.test(t[a])&&(t[a]=t[a].replace(S,"")),"."===t[0].charAt(0)&&f&&(t=f.slice(0,f.length-1).concat(t)),h=0;h<t.length;h++)if("."===(d=t[h]))t.splice(h,1),h-=1;else if(".."===d){if(0===h||1===h&&".."===t[2]||".."===t[h-1])continue;h>0&&(t.splice(h-1,2),h-=2)}t=t.join("/")}if((f||g)&&p){for(h=(i=t.split("/")).length;h>0;h-=1){if(n=i.slice(0,h).join("/"),f)for(u=f.length;u>0;u-=1)if((r=p[f.slice(0,u).join("/")])&&(r=r[n])){o=r,s=h;break}if(o)break;!l&&g&&g[n]&&(l=g[n],c=h)}!o&&l&&(o=l,s=c),o&&(i.splice(0,s,o),t=i.join("/"))}return t}function a(t,i){return function(){var n=w.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),p.apply(e,n.concat([t,i]))}}function s(t){return function(e){return o(e,t)}}function l(t){return function(e){v[t]=e}}function c(t){if(r(y,t)){var i=y[t];delete y[t],x[t]=!0,f.apply(e,i)}if(!r(v,t)&&!r(x,t))throw new Error("No "+t);return v[t]}function h(t){var e,i=t?t.indexOf("!"):-1;return i>-1&&(e=t.substring(0,i),t=t.substring(i+1,t.length)),[e,t]}function u(t){return t?h(t):[]}function d(t){return function(){return b&&b.config&&b.config[t]||{}}}var f,p,g,m,v={},y={},b={},x={},_=Object.prototype.hasOwnProperty,w=[].slice,S=/\.js$/;g=function(t,e){var i,n=h(t),r=n[0],a=e[1];return t=n[1],r&&(i=c(r=o(r,a))),r?t=i&&i.normalize?i.normalize(t,s(a)):o(t,a):(r=(n=h(t=o(t,a)))[0],t=n[1],r&&(i=c(r))),{f:r?r+"!"+t:t,n:t,pr:r,p:i}},m={require:function(t){return a(t)},exports:function(t){var e=v[t];return void 0!==e?e:v[t]={}},module:function(t){return{id:t,uri:"",exports:v[t],config:d(t)}}},f=function(t,i,n,o){var s,h,d,f,p,b,_,w=[],S=typeof n;if(o=o||t,b=u(o),"undefined"===S||"function"===S){for(i=!i.length&&n.length?["require","exports","module"]:i,p=0;p<i.length;p+=1)if(f=g(i[p],b),"require"===(h=f.f))w[p]=m.require(t);else if("exports"===h)w[p]=m.exports(t),_=!0;else if("module"===h)s=w[p]=m.module(t);else if(r(v,h)||r(y,h)||r(x,h))w[p]=c(h);else{if(!f.p)throw new Error(t+" missing "+h);f.p.load(f.n,a(o,!0),l(h),{}),w[p]=v[h]}d=n?n.apply(v[t],w):void 0,t&&(s&&s.exports!==e&&s.exports!==v[t]?v[t]=s.exports:d===e&&_||(v[t]=d))}else t&&(v[t]=n)},t=i=p=function(t,i,n,r,o){if("string"==typeof t)return m[t]?m[t](i):c(g(t,u(i)).f);if(!t.splice){if((b=t).deps&&p(b.deps,b.callback),!i)return;i.splice?(t=i,i=n,n=null):t=e}return i=i||function(){},"function"==typeof n&&(n=r,r=o),r?f(e,t,i,n):setTimeout(function(){f(e,t,i,n)},4),p},p.config=function(t){return p(t)},t._defined=v,(n=function(t,e,i){if("string"!=typeof t)throw new Error("See almond README: incorrect module build, no module name");e.splice||(i=e,e=[]),r(v,t)||r(y,t)||(y[t]=[t,e,i])}).amd={jQuery:!0}}(),e.requirejs=t,e.require=i,e.define=n}}(),e.define("almond",function(){}),e.define("jquery",[],function(){var e=t||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(t){function e(t){var e=t.prototype,i=[];for(var n in e)"function"==typeof e[n]&&"constructor"!==n&&i.push(n);return i}var i={};i.Extend=function(t,e){function i(){this.constructor=t}var n={}.hasOwnProperty;for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},i.Decorate=function(t,i){function n(){var e=Array.prototype.unshift,n=i.prototype.constructor.length,r=t.prototype.constructor;n>0&&(e.call(arguments,t.prototype.constructor),r=i.prototype.constructor),r.apply(this,arguments)}var r=e(i),o=e(t);i.displayName=t.displayName,n.prototype=new function(){this.constructor=n};for(var a=0;a<o.length;a++){var s=o[a];n.prototype[s]=t.prototype[s]}for(var l=0;l<r.length;l++){var c=r[l];n.prototype[c]=function(t){var e=function(){};t in n.prototype&&(e=n.prototype[t]);var r=i.prototype[t];return function(){return Array.prototype.unshift.call(arguments,e),r.apply(this,arguments)}}(c)}return n};var n=function(){this.listeners={}};return n.prototype.on=function(t,e){this.listeners=this.listeners||{},t in this.listeners?this.listeners[t].push(e):this.listeners[t]=[e]},n.prototype.trigger=function(t){var e=Array.prototype.slice,i=e.call(arguments,1);this.listeners=this.listeners||{},null==i&&(i=[]),0===i.length&&i.push({}),i[0]._type=t,t in this.listeners&&this.invoke(this.listeners[t],e.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},n.prototype.invoke=function(t,e){for(var i=0,n=t.length;i<n;i++)t[i].apply(this,e)},i.Observable=n,i.generateChars=function(t){for(var e="",i=0;i<t;i++)e+=Math.floor(36*Math.random()).toString(36);return e},i.bind=function(t,e){return function(){t.apply(e,arguments)}},i._convertData=function(t){for(var e in t){var i=e.split("-"),n=t;if(1!==i.length){for(var r=0;r<i.length;r++){var o=i[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in n||(n[o]={}),r==i.length-1&&(n[o]=t[e]),n=n[o]}delete t[e]}}return t},i.hasScroll=function(e,i){var n=t(i),r=i.style.overflowX,o=i.style.overflowY;return(r!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===r||"scroll"===o||(n.innerHeight()<i.scrollHeight||n.innerWidth()<i.scrollWidth))},i.escapeMarkup=function(t){var e={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof t?t:String(t).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},i.appendMany=function(e,i){if("1.7"===t.fn.jquery.substr(0,3)){var n=t();t.map(i,function(t){n=n.add(t)}),i=n}e.append(i)},i}),e.define("select2/results",["jquery","./utils"],function(t,e){function i(t,e,n){this.$element=t,this.data=n,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e,e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var i=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=t('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(e.message);n.append(i(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(t){this.hideLoading();var e=[];if(null!=t.results&&0!==t.results.length){t.results=this.sort(t.results);for(var i=0;i<t.results.length;i++){var n=t.results[i],r=this.option(n);e.push(r)}this.$results.append(e)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(t,e){e.find(".select2-results").append(t)},i.prototype.sort=function(t){return this.options.get("sorter")(t)},i.prototype.highlightFirstItem=function(){var t=this.$results.find(".select2-results__option[aria-selected]"),e=t.filter("[aria-selected=true]");e.length>0?e.first().trigger("mouseenter"):t.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var e=this;this.data.current(function(i){var n=t.map(i,function(t){return t.id.toString()});e.$results.find(".select2-results__option[aria-selected]").each(function(){var e=t(this),i=t.data(this,"data"),r=""+i.id;null!=i.element&&i.element.selected||null==i.element&&t.inArray(r,n)>-1?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},i.prototype.showLoading=function(t){this.hideLoading();var e={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(t)},i=this.option(e);i.className+=" loading-results",this.$results.prepend(i)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var i=document.createElement("li");i.className="select2-results__option";var n={role:"treeitem","aria-selected":"false"};e.disabled&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(i.id=e._resultId),e.title&&(i.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]);for(var r in n){var o=n[r];i.setAttribute(r,o)}if(e.children){var a=t(i),s=document.createElement("strong");s.className="select2-results__group";t(s);this.template(e,s);for(var l=[],c=0;c<e.children.length;c++){var h=e.children[c],u=this.option(h);l.push(u)}var d=t("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});d.append(l),a.append(s),a.append(d)}else this.template(e,i);return t.data(i,"data",e),i},i.prototype.bind=function(e,i){var n=this,r=e.id+"-results";this.$results.attr("id",r),e.on("results:all",function(t){n.clear(),n.append(t.data),e.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),e.on("results:append",function(t){n.append(t.data),e.isOpen()&&n.setClasses()}),e.on("query",function(t){n.hideMessages(),n.showLoading(t)}),e.on("select",function(){e.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),e.on("unselect",function(){e.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),e.on("open",function(){n.$results.attr("aria-expanded","true"),n.$results.attr("aria-hidden","false"),n.setClasses(),n.ensureHighlightVisible()}),e.on("close",function(){n.$results.attr("aria-expanded","false"),n.$results.attr("aria-hidden","true"),n.$results.removeAttr("aria-activedescendant")}),e.on("results:toggle",function(){var t=n.getHighlightedResults();0!==t.length&&t.trigger("mouseup")}),e.on("results:select",function(){var t=n.getHighlightedResults();if(0!==t.length){var e=t.data("data");"true"==t.attr("aria-selected")?n.trigger("close",{}):n.trigger("select",{data:e})}}),e.on("results:previous",function(){var t=n.getHighlightedResults(),e=n.$results.find("[aria-selected]"),i=e.index(t);if(0!==i){var r=i-1;0===t.length&&(r=0);var o=e.eq(r);o.trigger("mouseenter");var a=n.$results.offset().top,s=o.offset().top,l=n.$results.scrollTop()+(s-a);0===r?n.$results.scrollTop(0):s-a<0&&n.$results.scrollTop(l)}}),e.on("results:next",function(){var t=n.getHighlightedResults(),e=n.$results.find("[aria-selected]"),i=e.index(t)+1;if(!(i>=e.length)){var r=e.eq(i);r.trigger("mouseenter");var o=n.$results.offset().top+n.$results.outerHeight(!1),a=r.offset().top+r.outerHeight(!1),s=n.$results.scrollTop()+a-o;0===i?n.$results.scrollTop(0):a>o&&n.$results.scrollTop(s)}}),e.on("results:focus",function(t){t.element.addClass("select2-results__option--highlighted")}),e.on("results:message",function(t){n.displayMessage(t)}),t.fn.mousewheel&&this.$results.on("mousewheel",function(t){var e=n.$results.scrollTop(),i=n.$results.get(0).scrollHeight-e+t.deltaY,r=t.deltaY>0&&e-t.deltaY<=0,o=t.deltaY<0&&i<=n.$results.height();r?(n.$results.scrollTop(0),t.preventDefault(),t.stopPropagation()):o&&(n.$results.scrollTop(n.$results.get(0).scrollHeight-n.$results.height()),t.preventDefault(),t.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var i=t(this),r=i.data("data");"true"!==i.attr("aria-selected")?n.trigger("select",{originalEvent:e,data:r}):n.options.get("multiple")?n.trigger("unselect",{originalEvent:e,data:r}):n.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var i=t(this).data("data");n.getHighlightedResults().removeClass("select2-results__option--highlighted"),n.trigger("results:focus",{data:i,element:t(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var t=this.getHighlightedResults();if(0!==t.length){var e=this.$results.find("[aria-selected]").index(t),i=this.$results.offset().top,n=t.offset().top,r=this.$results.scrollTop()+(n-i),o=n-i;r-=2*t.outerHeight(!1),e<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,i){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),o=n(e,i);null==o?i.style.display="none":"string"==typeof o?i.innerHTML=r(o):t(i).append(o)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(t,e,i){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e,e},n.prototype.bind=function(t,e){var n=this,r=(t.id,t.id+"-results");this.container=t,this.$selection.on("focus",function(t){n.trigger("focus",t)}),this.$selection.on("blur",function(t){n._handleBlur(t)}),this.$selection.on("keydown",function(t){n.trigger("keypress",t),t.which===i.SPACE&&t.preventDefault()}),t.on("results:focus",function(t){n.$selection.attr("aria-activedescendant",t.data._resultId)}),t.on("selection:update",function(t){n.update(t.data)}),t.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(t)}),t.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.focus(),n._detachCloseHandler(t)}),t.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),t.on("disable",function(){n.$selection.attr("tabindex","-1")})},n.prototype._handleBlur=function(e){var i=this;window.setTimeout(function(){document.activeElement==i.$selection[0]||t.contains(i.$selection[0],document.activeElement)||i.trigger("blur",e)},1)},n.prototype._attachCloseHandler=function(e){t(document.body).on("mousedown.select2."+e.id,function(e){var i=t(e.target).closest(".select2");t(".select2.select2-container--open").each(function(){var e=t(this);this!=i[0]&&e.data("element").select2("close")})})},n.prototype._detachCloseHandler=function(e){t(document.body).off("mousedown.select2."+e.id)},n.prototype.position=function(t,e){e.find(".selection").append(t)},n.prototype.destroy=function(){this._detachCloseHandler(this.container)},n.prototype.update=function(t){throw new Error("The `update` method must be defined in child classes.")},n}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(t,e,i,n){function r(){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,e),r.prototype.render=function(){var t=r.__super__.render.call(this);return t.addClass("select2-selection--single"),t.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),t},r.prototype.bind=function(t,e){var i=this;r.__super__.bind.apply(this,arguments);var n=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",n),this.$selection.attr("aria-labelledby",n),this.$selection.on("mousedown",function(t){1===t.which&&i.trigger("toggle",{originalEvent:t})}),this.$selection.on("focus",function(t){}),this.$selection.on("blur",function(t){}),t.on("focus",function(e){t.isOpen()||i.$selection.focus()}),t.on("selection:update",function(t){i.update(t.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(t,e){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(t,e))},r.prototype.selectionContainer=function(){return t("<span></span>")},r.prototype.update=function(t){if(0!==t.length){var e=t[0],i=this.$selection.find(".select2-selection__rendered"),n=this.display(e,i);i.empty().append(n),i.prop("title",e.title||e.text)}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(t,e,i){function n(t,e){n.__super__.constructor.apply(this,arguments)}return i.Extend(n,e),n.prototype.render=function(){var t=n.__super__.render.call(this);return t.addClass("select2-selection--multiple"),t.html('<ul class="select2-selection__rendered"></ul>'),t},n.prototype.bind=function(e,i){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(t){r.trigger("toggle",{originalEvent:t})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.options.get("disabled")){var i=t(this).parent().data("data");r.trigger("unselect",{originalEvent:e,data:i})}})},n.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},n.prototype.display=function(t,e){var i=this.options.get("templateSelection");return this.options.get("escapeMarkup")(i(t,e))},n.prototype.selectionContainer=function(){return t('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},n.prototype.update=function(t){if(this.clear(),0!==t.length){for(var e=[],n=0;n<t.length;n++){var r=t[n],o=this.selectionContainer(),a=this.display(r,o);o.append(a),o.prop("title",r.title||r.text),o.data("data",r),e.push(o)}var s=this.$selection.find(".select2-selection__rendered");i.appendMany(s,e)}},n}),e.define("select2/selection/placeholder",["../utils"],function(t){function e(t,e,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),t.call(this,e,i)}return e.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},e.prototype.createPlaceholder=function(t,e){var i=this.selectionContainer();return i.html(this.display(e)),i.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),i},e.prototype.update=function(t,e){var i=1==e.length&&e[0].id!=this.placeholder.id;if(e.length>1||i)return t.call(this,e);this.clear();var n=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(n)},e}),e.define("select2/selection/allowClear",["jquery","../keys"],function(t,e){function i(){}return i.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(t){n._handleClear(t)}),e.on("keypress",function(t){n._handleKeyboardClear(t,e)})},i.prototype._handleClear=function(t,e){if(!this.options.get("disabled")){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){e.stopPropagation();for(var n=i.data("data"),r=0;r<n.length;r++){var o={data:n[r]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},i.prototype._handleKeyboardClear=function(t,i,n){n.isOpen()||i.which!=e.DELETE&&i.which!=e.BACKSPACE||this._handleClear(i)},i.prototype.update=function(e,i){if(e.call(this,i),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var n=t('<span class="select2-selection__clear">×</span>');n.data("data",i),this.$selection.find(".select2-selection__rendered").prepend(n)}},i}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(t,e,i){function n(t,e,i){t.call(this,e,i)}return n.prototype.render=function(e){var i=t('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=i,this.$search=i.find("input");var n=e.call(this);return this._transferTabIndex(),n},n.prototype.bind=function(t,e,n){var r=this;t.call(this,e,n),e.on("open",function(){r.$search.trigger("focus")}),e.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),e.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),e.on("disable",function(){r.$search.prop("disabled",!0)}),e.on("focus",function(t){r.$search.trigger("focus")}),e.on("results:focus",function(t){r.$search.attr("aria-activedescendant",t.id)}),this.$selection.on("focusin",".select2-search--inline",function(t){r.trigger("focus",t)}),this.$selection.on("focusout",".select2-search--inline",function(t){r._handleBlur(t)}),this.$selection.on("keydown",".select2-search--inline",function(t){if(t.stopPropagation(),r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented(),t.which===i.BACKSPACE&&""===r.$search.val()){var e=r.$searchContainer.prev(".select2-selection__choice");if(e.length>0){var n=e.data("data");r.searchRemoveChoice(n),t.preventDefault()}}});var o=document.documentMode,a=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(t){a?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(t){if(a&&"input"===t.type)r.$selection.off("input.search input.searchcheck");else{var e=t.which;e!=i.SHIFT&&e!=i.CTRL&&e!=i.ALT&&e!=i.TAB&&r.handleSearch(t)}})},n.prototype._transferTabIndex=function(t){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},n.prototype.createPlaceholder=function(t,e){this.$search.attr("placeholder",e.text)},n.prototype.update=function(t,e){var i=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),t.call(this,e),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),i&&this.$search.focus()},n.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.searchRemoveChoice=function(t,e){this.trigger("unselect",{data:e}),this.$search.val(e.text),this.handleSearch()},n.prototype.resizeSearch=function(){this.$search.css("width","25px");var t="";t=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").innerWidth():.75*(this.$search.val().length+1)+"em",this.$search.css("width",t)},n}),e.define("select2/selection/eventRelay",["jquery"],function(t){function e(){}return e.prototype.bind=function(e,i,n){var r=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],a=["opening","closing","selecting","unselecting"];e.call(this,i,n),i.on("*",function(e,i){if(-1!==t.inArray(e,o)){i=i||{};var n=t.Event("select2:"+e,{params:i});r.$element.trigger(n),-1!==t.inArray(e,a)&&(i.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,e){function i(t){this.dict=t||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(t){return this.dict[t]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(t){if(!(t in i._cache)){var n=e(t);i._cache[t]=n}return new i(i._cache[t])},i}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2/data/base",["../utils"],function(t){function e(t,i){e.__super__.constructor.call(this)}return t.Extend(e,t.Observable),e.prototype.current=function(t){throw new Error("The `current` method must be defined in child classes.")},e.prototype.query=function(t,e){throw new Error("The `query` method must be defined in child classes.")},e.prototype.bind=function(t,e){},e.prototype.destroy=function(){},e.prototype.generateResultId=function(e,i){var n=e.id+"-result-";return n+=t.generateChars(4),null!=i.id?n+="-"+i.id.toString():n+="-"+t.generateChars(4),n},e}),e.define("select2/data/select",["./base","../utils","jquery"],function(t,e,i){function n(t,e){this.$element=t,this.options=e,n.__super__.constructor.call(this)}return e.Extend(n,t),n.prototype.current=function(t){var e=[],n=this;this.$element.find(":selected").each(function(){var t=i(this),r=n.item(t);e.push(r)}),t(e)},n.prototype.select=function(t){var e=this;if(t.selected=!0,i(t.element).is("option"))return t.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(n){var r=[];(t=[t]).push.apply(t,n);for(var o=0;o<t.length;o++){var a=t[o].id;-1===i.inArray(a,r)&&r.push(a)}e.$element.val(r),e.$element.trigger("change")});else{var n=t.id;this.$element.val(n),this.$element.trigger("change")}},n.prototype.unselect=function(t){var e=this;if(this.$element.prop("multiple")){if(t.selected=!1,i(t.element).is("option"))return t.element.selected=!1,void this.$element.trigger("change");this.current(function(n){for(var r=[],o=0;o<n.length;o++){var a=n[o].id;a!==t.id&&-1===i.inArray(a,r)&&r.push(a)}e.$element.val(r),e.$element.trigger("change")})}},n.prototype.bind=function(t,e){var i=this;this.container=t,t.on("select",function(t){i.select(t.data)}),t.on("unselect",function(t){i.unselect(t.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){i.removeData(this,"data")})},n.prototype.query=function(t,e){var n=[],r=this;this.$element.children().each(function(){var e=i(this);if(e.is("option")||e.is("optgroup")){var o=r.item(e),a=r.matches(t,o);null!==a&&n.push(a)}}),e({results:n})},n.prototype.addOptions=function(t){e.appendMany(this.$element,t)},n.prototype.option=function(t){var e;t.children?(e=document.createElement("optgroup")).label=t.text:void 0!==(e=document.createElement("option")).textContent?e.textContent=t.text:e.innerText=t.text,void 0!==t.id&&(e.value=t.id),t.disabled&&(e.disabled=!0),t.selected&&(e.selected=!0),t.title&&(e.title=t.title);var n=i(e),r=this._normalizeItem(t);return r.element=e,i.data(e,"data",r),n},n.prototype.item=function(t){var e={};if(null!=(e=i.data(t[0],"data")))return e;if(t.is("option"))e={id:t.val(),text:t.text(),disabled:t.prop("disabled"),selected:t.prop("selected"),title:t.prop("title")};else if(t.is("optgroup")){e={text:t.prop("label"),children:[],title:t.prop("title")};for(var n=t.children("option"),r=[],o=0;o<n.length;o++){var a=i(n[o]),s=this.item(a);r.push(s)}e.children=r}return e=this._normalizeItem(e),e.element=t[0],i.data(t[0],"data",e),e},n.prototype._normalizeItem=function(t){i.isPlainObject(t)||(t={id:t,text:t});return null!=(t=i.extend({},{text:""},t)).id&&(t.id=t.id.toString()),null!=t.text&&(t.text=t.text.toString()),null==t._resultId&&t.id&&null!=this.container&&(t._resultId=this.generateResultId(this.container,t)),i.extend({},{selected:!1,disabled:!1},t)},n.prototype.matches=function(t,e){return this.options.get("matcher")(t,e)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(t,e,i){function n(t,e){var i=e.get("data")||[];n.__super__.constructor.call(this,t,e),this.addOptions(this.convertToOptions(i))}return e.Extend(n,t),n.prototype.select=function(t){var e=this.$element.find("option").filter(function(e,i){return i.value==t.id.toString()});0===e.length&&(e=this.option(t),this.addOptions(e)),n.__super__.select.call(this,t)},n.prototype.convertToOptions=function(t){for(var n=this,r=this.$element.find("option"),o=r.map(function(){return n.item(i(this)).id}).get(),a=[],s=0;s<t.length;s++){var l=this._normalizeItem(t[s]);if(i.inArray(l.id,o)>=0){var c=r.filter(function(t){return function(){return i(this).val()==t.id}}(l)),h=this.item(c),u=i.extend(!0,{},l,h),d=this.option(u);c.replaceWith(d)}else{var f=this.option(l);if(l.children){var p=this.convertToOptions(l.children);e.appendMany(f,p)}a.push(f)}}return a},n}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(t,e,i){function n(t,e){this.ajaxOptions=this._applyDefaults(e.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,t,e)}return e.Extend(n,t),n.prototype._applyDefaults=function(t){var e={data:function(t){return i.extend({},t,{q:t.term})},transport:function(t,e,n){var r=i.ajax(t);return r.then(e),r.fail(n),r}};return i.extend({},e,t,!0)},n.prototype.processResults=function(t){return t},n.prototype.query=function(t,e){function n(){var n=o.transport(o,function(n){var o=r.processResults(n,t);r.options.get("debug")&&window.console&&console.error&&(o&&o.results&&i.isArray(o.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),e(o)},function(){n.status&&"0"===n.status||r.trigger("results:message",{message:"errorLoading"})});r._request=n}var r=this;null!=this._request&&(i.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=i.extend({type:"GET"},this.ajaxOptions);"function"==typeof o.url&&(o.url=o.url.call(this.$element,t)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,t)),this.ajaxOptions.delay&&null!=t.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(n,this.ajaxOptions.delay)):n()},n}),e.define("select2/data/tags",["jquery"],function(t){function e(e,i,n){var r=n.get("tags"),o=n.get("createTag");void 0!==o&&(this.createTag=o);var a=n.get("insertTag");if(void 0!==a&&(this.insertTag=a),e.call(this,i,n),t.isArray(r))for(var s=0;s<r.length;s++){var l=r[s],c=this._normalizeItem(l),h=this.option(c);this.$element.append(h)}}return e.prototype.query=function(t,e,i){function n(t,o){for(var a=t.results,s=0;s<a.length;s++){var l=a[s],c=null!=l.children&&!n({results:l.children},!0);if((l.text||"").toUpperCase()===(e.term||"").toUpperCase()||c)return!o&&(t.data=a,void i(t))}if(o)return!0;var h=r.createTag(e);if(null!=h){var u=r.option(h);u.attr("data-select2-tag",!0),r.addOptions([u]),r.insertTag(a,h)}t.results=a,i(t)}var r=this;this._removeOldTags(),null!=e.term&&null==e.page?t.call(this,e,n):t.call(this,e,i)},e.prototype.createTag=function(e,i){var n=t.trim(i.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(t,e,i){e.unshift(i)},e.prototype._removeOldTags=function(e){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||t(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(t){function e(t,e,i){var n=i.get("tokenizer");void 0!==n&&(this.tokenizer=n),t.call(this,e,i)}return e.prototype.bind=function(t,e,i){t.call(this,e,i),this.$search=e.dropdown.$search||e.selection.$search||i.find(".select2-search__field")},e.prototype.query=function(e,i,n){function r(t){o.trigger("select",{data:t})}var o=this;i.term=i.term||"";var a=this.tokenizer(i,this.options,function(e){var i=o._normalizeItem(e);if(!o.$element.find("option").filter(function(){return t(this).val()===i.id}).length){var n=o.option(i);n.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([n])}r(i)});a.term!==i.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.focus()),i.term=a.term),e.call(this,i,n)},e.prototype.tokenizer=function(e,i,n,r){for(var o=n.get("tokenSeparators")||[],a=i.term,s=0,l=this.createTag||function(t){return{id:t.term,text:t.term}};s<a.length;){var c=a[s];if(-1!==t.inArray(c,o)){var h=a.substr(0,s),u=l(t.extend({},i,{term:h}));null!=u?(r(u),a=a.substr(s+1)||"",s=0):s++}else s++}return{term:a}},e}),e.define("select2/data/minimumInputLength",[],function(){function t(t,e,i){this.minimumInputLength=i.get("minimumInputLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.term=e.term||"",e.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:e.term,params:e}}):t.call(this,e,i)},t}),e.define("select2/data/maximumInputLength",[],function(){function t(t,e,i){this.maximumInputLength=i.get("maximumInputLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.term=e.term||"",this.maximumInputLength>0&&e.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:e.term,params:e}}):t.call(this,e,i)},t}),e.define("select2/data/maximumSelectionLength",[],function(){function t(t,e,i){this.maximumSelectionLength=i.get("maximumSelectionLength"),t.call(this,e,i)}return t.prototype.query=function(t,e,i){var n=this;this.current(function(r){var o=null!=r?r.length:0;n.maximumSelectionLength>0&&o>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t.call(n,e,i)})},t}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function i(t,e){this.$element=t,this.options=e,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e,e},i.prototype.bind=function(){},i.prototype.position=function(t,e){},i.prototype.destroy=function(){this.$dropdown.remove()},i}),e.define("select2/dropdown/search",["jquery","../utils"],function(t,e){function i(){}return i.prototype.render=function(e){var i=e.call(this),n=t('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),i.prepend(n),i},i.prototype.bind=function(e,i,n){var r=this;e.call(this,i,n),this.$search.on("keydown",function(t){r.trigger("keypress",t),r._keyUpPrevented=t.isDefaultPrevented()}),this.$search.on("input",function(e){t(this).off("keyup")}),this.$search.on("keyup input",function(t){r.handleSearch(t)}),i.on("open",function(){r.$search.attr("tabindex",0),r.$search.focus(),window.setTimeout(function(){r.$search.focus()},0)}),i.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val("")}),i.on("focus",function(){i.isOpen()||r.$search.focus()}),i.on("results:all",function(t){null!=t.query.term&&""!==t.query.term||(r.showSearch(t)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))})},i.prototype.handleSearch=function(t){if(!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.showSearch=function(t,e){return!0},i}),e.define("select2/dropdown/hidePlaceholder",[],function(){function t(t,e,i,n){this.placeholder=this.normalizePlaceholder(i.get("placeholder")),t.call(this,e,i,n)}return t.prototype.append=function(t,e){e.results=this.removePlaceholder(e.results),t.call(this,e)},t.prototype.normalizePlaceholder=function(t,e){return"string"==typeof e&&(e={id:"",text:e}),e},t.prototype.removePlaceholder=function(t,e){for(var i=e.slice(0),n=e.length-1;n>=0;n--){var r=e[n];this.placeholder.id===r.id&&i.splice(n,1)}return i},t}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(t){function e(t,e,i,n){this.lastParams={},t.call(this,e,i,n),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(t,e){this.$loadingMore.remove(),this.loading=!1,t.call(this,e),this.showLoadingMore(e)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,i,n){var r=this;e.call(this,i,n),i.on("query",function(t){r.lastParams=t,r.loading=!0}),i.on("query:append",function(t){r.lastParams=t,r.loading=!0}),this.$results.on("scroll",function(){var e=t.contains(document.documentElement,r.$loadingMore[0]);!r.loading&&e&&r.$results.offset().top+r.$results.outerHeight(!1)+50>=r.$loadingMore.offset().top+r.$loadingMore.outerHeight(!1)&&r.loadMore()})},e.prototype.loadMore=function(){this.loading=!0;var e=t.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(t,e){return e.pagination&&e.pagination.more},e.prototype.createLoadingMore=function(){var e=t('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),i=this.options.get("translations").get("loadingMore");return e.html(i(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(t,e){function i(e,i,n){this.$dropdownParent=n.get("dropdownParent")||t(document.body),e.call(this,i,n)}return i.prototype.bind=function(t,e,i){var n=this,r=!1;t.call(this,e,i),e.on("open",function(){n._showDropdown(),n._attachPositioningHandler(e),r||(r=!0,e.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),e.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}))}),e.on("close",function(){n._hideDropdown(),n._detachPositioningHandler(e)}),this.$dropdownContainer.on("mousedown",function(t){t.stopPropagation()})},i.prototype.destroy=function(t){t.call(this),this.$dropdownContainer.remove()},i.prototype.position=function(t,e,i){e.attr("class",i.attr("class")),e.removeClass("select2"),e.addClass("select2-container--open"),e.css({position:"absolute",top:-999999}),this.$container=i},i.prototype.render=function(e){var i=t("<span></span>"),n=e.call(this);return i.append(n),this.$dropdownContainer=i,i},i.prototype._hideDropdown=function(t){this.$dropdownContainer.detach()},i.prototype._attachPositioningHandler=function(i,n){var r=this,o="scroll.select2."+n.id,a="resize.select2."+n.id,s="orientationchange.select2."+n.id,l=this.$container.parents().filter(e.hasScroll);l.each(function(){t(this).data("select2-scroll-position",{x:t(this).scrollLeft(),y:t(this).scrollTop()})}),l.on(o,function(e){var i=t(this).data("select2-scroll-position");t(this).scrollTop(i.y)}),t(window).on(o+" "+a+" "+s,function(t){r._positionDropdown(),r._resizeDropdown()})},i.prototype._detachPositioningHandler=function(i,n){var r="scroll.select2."+n.id,o="resize.select2."+n.id,a="orientationchange.select2."+n.id;this.$container.parents().filter(e.hasScroll).off(r),t(window).off(r+" "+o+" "+a)},i.prototype._positionDropdown=function(){var e=t(window),i=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var a={height:this.$container.outerHeight(!1)};a.top=o.top,a.bottom=o.top+a.height;var s={height:this.$dropdown.outerHeight(!1)},l={top:e.scrollTop(),bottom:e.scrollTop()+e.height()},c=l.top<o.top-s.height,h=l.bottom>o.bottom+s.height,u={left:o.left,top:a.bottom},d=this.$dropdownParent;"static"===d.css("position")&&(d=d.offsetParent());var f=d.offset();u.top-=f.top,u.left-=f.left,i||n||(r="below"),h||!c||i?!c&&h&&i&&(r="below"):r="above",("above"==r||i&&"below"!==r)&&(u.top=a.top-f.top-s.height),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(u)},i.prototype._resizeDropdown=function(){var t={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(t.minWidth=t.width,t.position="relative",t.width="auto"),this.$dropdown.css(t)},i.prototype._showDropdown=function(t){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},i}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function t(e){for(var i=0,n=0;n<e.length;n++){var r=e[n];r.children?i+=t(r.children):i++}return i}function e(t,e,i,n){this.minimumResultsForSearch=i.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),t.call(this,e,i,n)}return e.prototype.showSearch=function(e,i){return!(t(i.data.results)<this.minimumResultsForSearch)&&e.call(this,i)},e}),e.define("select2/dropdown/selectOnClose",[],function(){function t(){}return t.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("close",function(t){n._handleSelectOnClose(t)})},t.prototype._handleSelectOnClose=function(t,e){if(e&&null!=e.originalSelect2Event){var i=e.originalSelect2Event;if("select"===i._type||"unselect"===i._type)return}var n=this.getHighlightedResults();if(!(n.length<1)){var r=n.data("data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},t}),e.define("select2/dropdown/closeOnSelect",[],function(){function t(){}return t.prototype.bind=function(t,e,i){var n=this;t.call(this,e,i),e.on("select",function(t){n._selectTriggered(t)}),e.on("unselect",function(t){n._selectTriggered(t)})},t.prototype._selectTriggered=function(t,e){var i=e.originalEvent;i&&i.ctrlKey||this.trigger("close",{originalEvent:i,originalSelect2Event:e})},t}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(t){var e=t.input.length-t.maximum,i="Please delete "+e+" character";return 1!=e&&(i+="s"),i},inputTooShort:function(t){return"Please enter "+(t.minimum-t.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){var e="You can only select "+t.maximum+" item";return 1!=t.maximum&&(e+="s"),e},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(t,e,i,n,r,o,a,s,l,c,h,u,d,f,p,g,m,v,y,b,x,_,w,S,C,k,T,A,D){function M(){this.reset()}return M.prototype.apply=function(u){if(null==(u=t.extend(!0,{},this.defaults,u)).dataAdapter){if(null!=u.ajax?u.dataAdapter=p:null!=u.data?u.dataAdapter=f:u.dataAdapter=d,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,b)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null!=u.query){var D=e(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,D)}if(null!=u.initSelection){var M=e(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,M)}}if(null==u.resultsAdapter&&(u.resultsAdapter=i,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,S)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,w)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,T))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=x;else{var E=c.Decorate(x,_);u.dropdownAdapter=E}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,k)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,A)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var P=e(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,P)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=r:u.selectionAdapter=n,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,o)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var L=e(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,L)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}if("string"==typeof u.language)if(u.language.indexOf("-")>0){var I=u.language.split("-")[0];u.language=[u.language,I]}else u.language=[u.language];if(t.isArray(u.language)){var O=new h;u.language.push("en");for(var R=u.language,N=0;N<R.length;N++){var F=R[N],z={};try{z=h.loadPath(F)}catch(t){try{F=this.defaults.amdLanguageBase+F,z=h.loadPath(F)}catch(t){u.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+F+'" could not be automatically loaded. A fallback will be used instead.');continue}}O.extend(z)}u.translations=O}else{var H=h.loadPath(this.defaults.amdLanguageBase+"en"),$=new h(u.language);$.extend(H),u.translations=$}return u},M.prototype.reset=function(){function e(t){return t.replace(/[^\u0000-\u007E]/g,function(t){return u[t]||t})}function i(n,r){if(""===t.trim(n.term))return r;if(r.children&&r.children.length>0){for(var o=t.extend(!0,{},r),a=r.children.length-1;a>=0;a--)null==i(n,r.children[a])&&o.children.splice(a,1);return o.children.length>0?o:i(n,o)}var s=e(r.text).toUpperCase(),l=e(n.term).toUpperCase();return s.indexOf(l)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:D,matcher:i,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(t){return t},templateResult:function(t){return t.text},templateSelection:function(t){return t.text},theme:"default",width:"resolve"}},M.prototype.set=function(e,i){var n={};n[t.camelCase(e)]=i;var r=c._convertData(n);t.extend(this.defaults,r)},new M}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(t,e,i,n){function r(e,r){if(this.options=e,null!=r&&this.fromElement(r),this.options=i.apply(this.options),r&&r.is("input")){var o=t(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=n.Decorate(this.options.dataAdapter,o)}}return r.prototype.fromElement=function(t){var i=["select2"];null==this.options.multiple&&(this.options.multiple=t.prop("multiple")),null==this.options.disabled&&(this.options.disabled=t.prop("disabled")),null==this.options.language&&(t.prop("lang")?this.options.language=t.prop("lang").toLowerCase():t.closest("[lang]").prop("lang")&&(this.options.language=t.closest("[lang]").prop("lang"))),null==this.options.dir&&(t.prop("dir")?this.options.dir=t.prop("dir"):t.closest("[dir]").prop("dir")?this.options.dir=t.closest("[dir]").prop("dir"):this.options.dir="ltr"),t.prop("disabled",this.options.disabled),t.prop("multiple",this.options.multiple),t.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),t.data("data",t.data("select2Tags")),t.data("tags",!0)),t.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),t.attr("ajax--url",t.data("ajaxUrl")),t.data("ajax--url",t.data("ajaxUrl")));var r={};r=e.fn.jquery&&"1."==e.fn.jquery.substr(0,2)&&t[0].dataset?e.extend(!0,{},t[0].dataset,t.data()):t.data();var o=e.extend(!0,{},r);o=n._convertData(o);for(var a in o)e.inArray(a,i)>-1||(e.isPlainObject(this.options[a])?e.extend(this.options[a],o[a]):this.options[a]=o[a]);return this},r.prototype.get=function(t){return this.options[t]},r.prototype.set=function(t,e){this.options[t]=e},r}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(t,e,i,n){var r=function(t,i){null!=t.data("select2")&&t.data("select2").destroy(),this.$element=t,this.id=this._generateId(t),i=i||{},this.options=new e(i,t),r.__super__.constructor.call(this);var n=t.attr("tabindex")||0;t.data("old-tabindex",n),t.attr("tabindex","-1");var o=this.options.get("dataAdapter");this.dataAdapter=new o(t,this.options);var a=this.render();this._placeContainer(a);var s=this.options.get("selectionAdapter");this.selection=new s(t,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var l=this.options.get("dropdownAdapter");this.dropdown=new l(t,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var c=this.options.get("resultsAdapter");this.results=new c(t,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var h=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(t){h.trigger("selection:update",{data:t})}),t.addClass("select2-hidden-accessible"),t.attr("aria-hidden","true"),this._syncAttributes(),t.data("select2",this)};return i.Extend(r,i.Observable),r.prototype._generateId=function(t){var e="";return e=null!=t.attr("id")?t.attr("id"):null!=t.attr("name")?t.attr("name")+"-"+i.generateChars(2):i.generateChars(4),e=e.replace(/(:|\.|\[|\]|,)/g,""),e="select2-"+e},r.prototype._placeContainer=function(t){t.insertAfter(this.$element);var e=this._resolveWidth(this.$element,this.options.get("width"));null!=e&&t.css("width",e)},r.prototype._resolveWidth=function(t,e){var i=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==e){var n=this._resolveWidth(t,"style");return null!=n?n:this._resolveWidth(t,"element")}if("element"==e){var r=t.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==e){var o=t.attr("style");if("string"!=typeof o)return null;for(var a=o.split(";"),s=0,l=a.length;s<l;s+=1){var c=a[s].replace(/\s/g,"").match(i);if(null!==c&&c.length>=1)return c[1]}return null}return e},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",function(){e.dataAdapter.current(function(t){e.trigger("selection:update",{data:t})})}),this.$element.on("focus.select2",function(t){e.trigger("focus",t)}),this._syncA=i.bind(this._syncAttributes,this),this._syncS=i.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var n=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=n?(this._observer=new n(function(i){t.each(i,e._syncA),t.each(i,e._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},r.prototype._registerDataEvents=function(){var t=this;this.dataAdapter.on("*",function(e,i){t.trigger(e,i)})},r.prototype._registerSelectionEvents=function(){var e=this,i=["toggle","focus"];this.selection.on("toggle",function(){e.toggleDropdown()}),this.selection.on("focus",function(t){e.focus(t)}),this.selection.on("*",function(n,r){-1===t.inArray(n,i)&&e.trigger(n,r)})},r.prototype._registerDropdownEvents=function(){var t=this;this.dropdown.on("*",function(e,i){t.trigger(e,i)})},r.prototype._registerResultsEvents=function(){var t=this;this.results.on("*",function(e,i){t.trigger(e,i)})},r.prototype._registerEvents=function(){var t=this;this.on("open",function(){t.$container.addClass("select2-container--open")}),this.on("close",function(){t.$container.removeClass("select2-container--open")}),this.on("enable",function(){t.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){t.$container.addClass("select2-container--disabled")}),this.on("blur",function(){t.$container.removeClass("select2-container--focus")}),this.on("query",function(e){t.isOpen()||t.trigger("open",{}),this.dataAdapter.query(e,function(i){t.trigger("results:all",{data:i,query:e})})}),this.on("query:append",function(e){this.dataAdapter.query(e,function(i){t.trigger("results:append",{data:i,query:e})})}),this.on("keypress",function(e){var i=e.which;t.isOpen()?i===n.ESC||i===n.TAB||i===n.UP&&e.altKey?(t.close(),e.preventDefault()):i===n.ENTER?(t.trigger("results:select",{}),e.preventDefault()):i===n.SPACE&&e.ctrlKey?(t.trigger("results:toggle",{}),e.preventDefault()):i===n.UP?(t.trigger("results:previous",{}),e.preventDefault()):i===n.DOWN&&(t.trigger("results:next",{}),e.preventDefault()):(i===n.ENTER||i===n.SPACE||i===n.DOWN&&e.altKey)&&(t.open(),e.preventDefault())})},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._syncSubtree=function(t,e){var i=!1,n=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(e)if(e.addedNodes&&e.addedNodes.length>0)for(var r=0;r<e.addedNodes.length;r++)e.addedNodes[r].selected&&(i=!0);else e.removedNodes&&e.removedNodes.length>0&&(i=!0);else i=!0;i&&this.dataAdapter.current(function(t){n.trigger("selection:update",{data:t})})}},r.prototype.trigger=function(t,e){var i=r.__super__.trigger,n={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===e&&(e={}),t in n){var o=n[t],a={prevented:!1,name:t,args:e};if(i.call(this,o,a),a.prevented)return void(e.prevented=!0)}i.call(this,t,e)},r.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.trigger("query",{})},r.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},r.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},r.prototype.focus=function(t){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(t){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=t&&0!==t.length||(t=[!0]);var e=!t[0];this.$element.prop("disabled",e)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},r.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var i=e[0];t.isArray(i)&&(i=t.map(i,function(t){return t.toString()})),this.$element.val(i).trigger("change")},r.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var e=t('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},r}),e.define("select2/compat/utils",["jquery"],function(t){return{syncCssClasses:function(e,i,n){var r,o,a=[];(r=t.trim(e.attr("class")))&&t((r=""+r).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&a.push(this)}),(r=t.trim(i.attr("class")))&&t((r=""+r).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(o=n(this))&&a.push(o)}),e.attr("class",a.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(t,e){function i(t){return null}function n(){}return n.prototype.render=function(n){var r=n.call(this),o=this.options.get("containerCssClass")||"";t.isFunction(o)&&(o=o(this.$element));var a=this.options.get("adaptContainerCssClass");if(a=a||i,-1!==o.indexOf(":all:")){o=o.replace(":all:","");var s=a;a=function(t){var e=s(t);return null!=e?e+" "+t:t}}var l=this.options.get("containerCss")||{};return t.isFunction(l)&&(l=l(this.$element)),e.syncCssClasses(r,this.$element,a),r.css(l),r.addClass(o),r},n}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(t,e){function i(t){return null}function n(){}return n.prototype.render=function(n){var r=n.call(this),o=this.options.get("dropdownCssClass")||"";t.isFunction(o)&&(o=o(this.$element));var a=this.options.get("adaptDropdownCssClass");if(a=a||i,-1!==o.indexOf(":all:")){o=o.replace(":all:","");var s=a;a=function(t){var e=s(t);return null!=e?e+" "+t:t}}var l=this.options.get("dropdownCss")||{};return t.isFunction(l)&&(l=l(this.$element)),e.syncCssClasses(r,this.$element,a),r.css(l),r.addClass(o),r},n}),e.define("select2/compat/initSelection",["jquery"],function(t){function e(t,e,i){i.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=i.get("initSelection"),this._isInitialized=!1,t.call(this,e,i)}return e.prototype.current=function(e,i){var n=this;this._isInitialized?e.call(this,i):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,t.isArray(e)||(e=[e]),i(e)})},e}),e.define("select2/compat/inputData",["jquery"],function(t){function e(t,e,i){this._currentData=[],this._valueSeparator=i.get("valueSeparator")||",","hidden"===e.prop("type")&&i.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),t.call(this,e,i)}return e.prototype.current=function(e,i){function n(e,i){var r=[];return e.selected||-1!==t.inArray(e.id,i)?(e.selected=!0,r.push(e)):e.selected=!1,e.children&&r.push.apply(r,n(e.children,i)),r}for(var r=[],o=0;o<this._currentData.length;o++){var a=this._currentData[o];r.push.apply(r,n(a,this.$element.val().split(this._valueSeparator)))}i(r)},e.prototype.select=function(e,i){if(this.options.get("multiple")){var n=this.$element.val();n+=this._valueSeparator+i.id,this.$element.val(n),this.$element.trigger("change")}else this.current(function(e){t.map(e,function(t){t.selected=!1})}),this.$element.val(i.id),this.$element.trigger("change")},e.prototype.unselect=function(t,e){var i=this;e.selected=!1,this.current(function(t){for(var n=[],r=0;r<t.length;r++){var o=t[r];e.id!=o.id&&n.push(o.id)}i.$element.val(n.join(i._valueSeparator)),i.$element.trigger("change")})},e.prototype.query=function(t,e,i){for(var n=[],r=0;r<this._currentData.length;r++){var o=this._currentData[r],a=this.matches(e,o);null!==a&&n.push(a)}i({results:n})},e.prototype.addOptions=function(e,i){var n=t.map(i,function(e){return t.data(e[0],"data")});this._currentData.push.apply(this._currentData,n)},e}),e.define("select2/compat/matcher",["jquery"],function(t){return function(e){return function(i,n){var r=t.extend(!0,{},n);if(null==i.term||""===t.trim(i.term))return r;if(n.children){for(var o=n.children.length-1;o>=0;o--){var a=n.children[o];e(i.term,a.text,a)||r.children.splice(o,1)}if(r.children.length>0)return r}return e(i.term,n.text,n)?r:null}}}),e.define("select2/compat/query",[],function(){function t(t,e,i){i.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),t.call(this,e,i)}return t.prototype.query=function(t,e,i){e.callback=i,this.options.get("query").call(null,e)},t}),e.define("select2/dropdown/attachContainer",[],function(){function t(t,e,i){t.call(this,e,i)}return t.prototype.position=function(t,e,i){i.find(".dropdown-wrapper").append(e),e.addClass("select2-dropdown--below"),i.addClass("select2-container--below")},t}),e.define("select2/dropdown/stopPropagation",[],function(){function t(){}return t.prototype.bind=function(t,e,i){t.call(this,e,i);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(t){t.stopPropagation()})},t}),e.define("select2/selection/stopPropagation",[],function(){function t(){}return t.prototype.bind=function(t,e,i){t.call(this,e,i);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(t){t.stopPropagation()})},t}),function(i){"function"==typeof e.define&&e.define.amd?e.define("jquery-mousewheel",["jquery"],i):"object"==typeof exports?module.exports=i:i(t)}(function(t){function e(e){var a=e||window.event,s=l.call(arguments,1),c=0,u=0,d=0,f=0,p=0,g=0;if(e=t.event.fix(a),e.type="mousewheel","detail"in a&&(d=-1*a.detail),"wheelDelta"in a&&(d=a.wheelDelta),"wheelDeltaY"in a&&(d=a.wheelDeltaY),"wheelDeltaX"in a&&(u=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(u=-1*d,d=0),c=0===d?u:d,"deltaY"in a&&(c=d=-1*a.deltaY),"deltaX"in a&&(u=a.deltaX,0===d&&(c=-1*u)),0!==d||0!==u){if(1===a.deltaMode){var m=t.data(this,"mousewheel-line-height");c*=m,d*=m,u*=m}else if(2===a.deltaMode){var v=t.data(this,"mousewheel-page-height");c*=v,d*=v,u*=v}if(f=Math.max(Math.abs(d),Math.abs(u)),(!o||f<o)&&(o=f,n(a,f)&&(o/=40)),n(a,f)&&(c/=40,u/=40,d/=40),c=Math[c>=1?"floor":"ceil"](c/o),u=Math[u>=1?"floor":"ceil"](u/o),d=Math[d>=1?"floor":"ceil"](d/o),h.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();p=e.clientX-y.left,g=e.clientY-y.top}return e.deltaX=u,e.deltaY=d,e.deltaFactor=o,e.offsetX=p,e.offsetY=g,e.deltaMode=0,s.unshift(e,c,u,d),r&&clearTimeout(r),r=setTimeout(i,200),(t.event.dispatch||t.event.handle).apply(this,s)}}function i(){o=null}function n(t,e){return h.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120==0}var r,o,a=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(t.event.fixHooks)for(var c=a.length;c;)t.event.fixHooks[a[--c]]=t.event.mouseHooks;var h=t.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=s.length;i;)this.addEventListener(s[--i],e,!1);else this.onmousewheel=e;t.data(this,"mousewheel-line-height",h.getLineHeight(this)),t.data(this,"mousewheel-page-height",h.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=s.length;i;)this.removeEventListener(s[--i],e,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var i=t(e),n=i["offsetParent"in t.fn?"offsetParent":"parent"]();return n.length||(n=t("body")),parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(t,e,i,n){if(null==t.fn.select2){var r=["open","close","destroy"];t.fn.select2=function(e){if("object"==typeof(e=e||{}))return this.each(function(){var n=t.extend(!0,{},e);new i(t(this),n)}),this;if("string"==typeof e){var n,o=Array.prototype.slice.call(arguments,1);return this.each(function(){var i=t(this).data("select2");null==i&&window.console&&console.error&&console.error("The select2('"+e+"') method was called on an element that is not using Select2."),n=i[e].apply(i,o)}),t.inArray(e,r)>-1?this:n}throw new Error("Invalid arguments for Select2: "+e)}}return null==t.fn.select2.defaults&&(t.fn.select2.defaults=n),i}),{define:e.define,require:e.require}}(),i=e.require("jquery.select2");return t.fn.select2.amd=e,i}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t,e){function i(){return new Date(Date.UTC.apply(Date,arguments))}function n(){var t=new Date;return i(t.getFullYear(),t.getMonth(),t.getDate())}function r(t,e){return t.getUTCFullYear()===e.getUTCFullYear()&&t.getUTCMonth()===e.getUTCMonth()&&t.getUTCDate()===e.getUTCDate()}function o(i,n){return function(){return n!==e&&t.fn.datepicker.deprecated(n),this[i].apply(this,arguments)}}function a(t){return t&&!isNaN(t.getTime())}function s(e,i){var n=t(e).data(),r={},o=new RegExp("^"+i.toLowerCase()+"([A-Z])");i=new RegExp("^"+i.toLowerCase());for(var a in n)i.test(a)&&(r[a.replace(o,function(t,e){return e.toLowerCase()})]=n[a]);return r}function l(e){var i={};if(m[e]||(e=e.split("-")[0],m[e])){var n=m[e];return t.each(g,function(t,e){e in n&&(i[e]=n[e])}),i}}var c=function(){var e={get:function(t){return this.slice(t)[0]},contains:function(t){for(var e=t&&t.valueOf(),i=0,n=this.length;i<n;i++)if(0<=this[i].valueOf()-e&&this[i].valueOf()-e<864e5)return i;return-1},remove:function(t){this.splice(t,1)},replace:function(e){e&&(t.isArray(e)||(e=[e]),this.clear(),this.push.apply(this,e))},clear:function(){this.length=0},copy:function(){var t=new c;return t.replace(this),t}};return function(){var i=[];return i.push.apply(i,arguments),t.extend(i,e),i}}(),h=function(e,i){t.data(e,"datepicker",this),this._process_options(i),this.dates=new c,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=t(e),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=t(v.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(t,e){return Number(e)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};h.prototype={constructor:h,_resolveViewName:function(e){return t.each(v.viewModes,function(i,n){if(e===i||-1!==t.inArray(e,n.names))return e=i,!1}),e},_resolveDaysOfWeek:function(e){return t.isArray(e)||(e=e.split(/[,\s]*/)),t.map(e,Number)},_check_template:function(i){try{return i!==e&&""!==i&&((i.match(/[<>]/g)||[]).length<=0||t(i).length>0)}catch(t){return!1}},_process_options:function(e){this._o=t.extend({},this._o,e);var r=this.o=t.extend({},this._o),o=r.language;m[o]||(o=o.split("-")[0],m[o]||(o=p.language)),r.language=o,r.startView=this._resolveViewName(r.startView),r.minViewMode=this._resolveViewName(r.minViewMode),r.maxViewMode=this._resolveViewName(r.maxViewMode),r.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,r.startView)),!0!==r.multidate&&(r.multidate=Number(r.multidate)||!1,!1!==r.multidate&&(r.multidate=Math.max(0,r.multidate))),r.multidateSeparator=String(r.multidateSeparator),r.weekStart%=7,r.weekEnd=(r.weekStart+6)%7;var a=v.parseFormat(r.format);r.startDate!==-1/0&&(r.startDate?r.startDate instanceof Date?r.startDate=this._local_to_utc(this._zero_time(r.startDate)):r.startDate=v.parseDate(r.startDate,a,r.language,r.assumeNearbyYear):r.startDate=-1/0),r.endDate!==1/0&&(r.endDate?r.endDate instanceof Date?r.endDate=this._local_to_utc(this._zero_time(r.endDate)):r.endDate=v.parseDate(r.endDate,a,r.language,r.assumeNearbyYear):r.endDate=1/0),r.daysOfWeekDisabled=this._resolveDaysOfWeek(r.daysOfWeekDisabled||[]),r.daysOfWeekHighlighted=this._resolveDaysOfWeek(r.daysOfWeekHighlighted||[]),r.datesDisabled=r.datesDisabled||[],t.isArray(r.datesDisabled)||(r.datesDisabled=r.datesDisabled.split(",")),r.datesDisabled=t.map(r.datesDisabled,function(t){return v.parseDate(t,a,r.language,r.assumeNearbyYear)});var s=String(r.orientation).toLowerCase().split(/\s+/g),l=r.orientation.toLowerCase();if(s=t.grep(s,function(t){return/^auto|left|right|top|bottom$/.test(t)}),r.orientation={x:"auto",y:"auto"},l&&"auto"!==l)if(1===s.length)switch(s[0]){case"top":case"bottom":r.orientation.y=s[0];break;case"left":case"right":r.orientation.x=s[0]}else l=t.grep(s,function(t){return/^left|right$/.test(t)}),r.orientation.x=l[0]||"auto",l=t.grep(s,function(t){return/^top|bottom$/.test(t)}),r.orientation.y=l[0]||"auto";else;if(r.defaultViewDate instanceof Date||"string"==typeof r.defaultViewDate)r.defaultViewDate=v.parseDate(r.defaultViewDate,a,r.language,r.assumeNearbyYear);else if(r.defaultViewDate){var c=r.defaultViewDate.year||(new Date).getFullYear(),h=r.defaultViewDate.month||0,u=r.defaultViewDate.day||1;r.defaultViewDate=i(c,h,u)}else r.defaultViewDate=n()},_events:[],_secondaryEvents:[],_applyEvents:function(t){for(var i,n,r,o=0;o<t.length;o++)i=t[o][0],2===t[o].length?(n=e,r=t[o][1]):3===t[o].length&&(n=t[o][1],r=t[o][2]),i.on(r,n)},_unapplyEvents:function(t){for(var i,n,r,o=0;o<t.length;o++)i=t[o][0],2===t[o].length?(r=e,n=t[o][1]):3===t[o].length&&(r=t[o][1],n=t[o][2]),i.off(n,r)},_buildEvents:function(){var e={keyup:t.proxy(function(e){-1===t.inArray(e.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:t.proxy(this.keydown,this),paste:t.proxy(this.paste,this)};!0===this.o.showOnFocus&&(e.focus=t.proxy(this.show,this)),this.isInput?this._events=[[this.element,e]]:this.component&&this.inputField.length?this._events=[[this.inputField,e],[this.component,{click:t.proxy(this.show,this)}]]:this._events=[[this.element,{click:t.proxy(this.show,this),keydown:t.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:t.proxy(function(t){this._focused_from=t.target},this)}],[this.element,{blur:t.proxy(function(t){this._focused_from=t.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":t.proxy(function(t){this.update(t.date)},this)}]),this._secondaryEvents=[[this.picker,{click:t.proxy(this.click,this)}],[this.picker,".prev, .next",{click:t.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:t.proxy(this.dayCellClick,this)}],[t(window),{resize:t.proxy(this.place,this)}],[t(document),{"mousedown touchstart":t.proxy(function(t){this.element.is(t.target)||this.element.find(t.target).length||this.picker.is(t.target)||this.picker.find(t.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(e,i){var n=i||this.dates.get(-1),r=this._utc_to_local(n);this.element.trigger({type:e,date:r,viewMode:this.viewMode,dates:t.map(this.dates,this._utc_to_local),format:t.proxy(function(t,e){0===arguments.length?(t=this.dates.length-1,e=this.o.format):"string"==typeof t&&(e=t,t=this.dates.length-1),e=e||this.o.format;var i=this.dates.get(t);return v.formatDate(i,e,this.o.language)},this)})},show:function(){if(!(this.inputField.prop("disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&t(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(e){var i;if(e.originalEvent.clipboardData&&e.originalEvent.clipboardData.types&&-1!==t.inArray("text/plain",e.originalEvent.clipboardData.types))i=e.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;i=window.clipboardData.getData("Text")}this.setDate(i),this.update(),e.preventDefault()},_utc_to_local:function(t){if(!t)return t;var e=new Date(t.getTime()+6e4*t.getTimezoneOffset());return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=new Date(t.getTime()+6e4*e.getTimezoneOffset())),e},_local_to_utc:function(t){return t&&new Date(t.getTime()-6e4*t.getTimezoneOffset())},_zero_time:function(t){return t&&new Date(t.getFullYear(),t.getMonth(),t.getDate())},_zero_utc_time:function(t){return t&&i(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},getDates:function(){return t.map(this.dates,this._utc_to_local)},getUTCDates:function(){return t.map(this.dates,function(t){return new Date(t)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var t=this.dates.get(-1);return t!==e?new Date(t):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var e=t.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,e),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var e=t.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,t.map(e,this._utc_to_local)),this},setDate:o("setDates"),setUTCDate:o("setUTCDates"),remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var t=this.getFormattedDate();return this.inputField.val(t),this},getFormattedDate:function(i){i===e&&(i=this.o.format);var n=this.o.language;return t.map(this.dates,function(t){return v.formatDate(t,i,n)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(t){return this._process_options({startDate:t}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(t){return this._process_options({endDate:t}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(t){return this._process_options({daysOfWeekDisabled:t}),this.update(),this},setDaysOfWeekHighlighted:function(t){return this._process_options({daysOfWeekHighlighted:t}),this.update(),this},setDatesDisabled:function(t){return this._process_options({datesDisabled:t}),this.update(),this},place:function(){if(this.isInline)return this;var e=this.picker.outerWidth(),i=this.picker.outerHeight(),n=t(this.o.container),r=n.width(),o="body"===this.o.container?t(document).scrollTop():n.scrollTop(),a=n.offset(),s=[0];this.element.parents().each(function(){var e=t(this).css("z-index");"auto"!==e&&0!==Number(e)&&s.push(Number(e))});var l=Math.max.apply(Math,s)+this.o.zIndexOffset,c=this.component?this.component.parent().offset():this.element.offset(),h=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),u=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),d=c.left-a.left,f=c.top-a.top;"body"!==this.o.container&&(f+=o),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(d-=e-u)):c.left<0?(this.picker.addClass("datepicker-orient-left"),d-=c.left-10):d+e>r?(this.picker.addClass("datepicker-orient-right"),d+=u-e):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var p=this.o.orientation.y;if("auto"===p&&(p=-o+f-i<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?f-=i+parseInt(this.picker.css("padding-top")):f+=h,this.o.rtl){var g=r-(d+u);this.picker.css({top:f,right:g,zIndex:l})}else this.picker.css({top:f,left:d,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var e=this.dates.copy(),i=[],n=!1;return arguments.length?(t.each(arguments,t.proxy(function(t,e){e instanceof Date&&(e=this._local_to_utc(e)),i.push(e)},this)),n=!0):(i=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),i=i&&this.o.multidate?i.split(this.o.multidateSeparator):[i],delete this.element.data().date),i=t.map(i,t.proxy(function(t){return v.parseDate(t,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),i=t.grep(i,t.proxy(function(t){return!this.dateWithinRange(t)||!t},this),!0),this.dates.replace(i),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),n?(this.setValue(),this.element.change()):this.dates.length&&String(e)!==String(this.dates)&&n&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&e.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var e=this.o.weekStart,i="<tr>";for(this.o.calendarWeeks&&(i+='<th class="cw"> </th>');e<this.o.weekStart+7;)i+='<th class="dow',-1!==t.inArray(e,this.o.daysOfWeekDisabled)&&(i+=" disabled"),i+='">'+m[this.o.language].daysMin[e++%7]+"</th>";i+="</tr>",this.picker.find(".datepicker-days thead").append(i)}},fillMonths:function(){for(var t=this._utc_to_local(this.viewDate),e="",i=0;i<12;i++)e+='<span class="month'+(t&&t.getMonth()===i?" focused":"")+'">'+m[this.o.language].monthsShort[i]+"</span>";this.picker.find(".datepicker-months td").html(e)},setRange:function(e){e&&e.length?this.range=t.map(e,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var i=[],o=this.viewDate.getUTCFullYear(),a=this.viewDate.getUTCMonth(),s=n();return e.getUTCFullYear()<o||e.getUTCFullYear()===o&&e.getUTCMonth()<a?i.push("old"):(e.getUTCFullYear()>o||e.getUTCFullYear()===o&&e.getUTCMonth()>a)&&i.push("new"),this.focusDate&&e.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&r(e,s)&&i.push("today"),-1!==this.dates.contains(e)&&i.push("active"),this.dateWithinRange(e)||i.push("disabled"),this.dateIsDisabled(e)&&i.push("disabled","disabled-date"),-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekHighlighted)&&i.push("highlighted"),this.range&&(e>this.range[0]&&e<this.range[this.range.length-1]&&i.push("range"),-1!==t.inArray(e.valueOf(),this.range)&&i.push("selected"),e.valueOf()===this.range[0]&&i.push("range-start"),e.valueOf()===this.range[this.range.length-1]&&i.push("range-end")),i},_fill_yearsView:function(i,n,r,o,a,s,l){for(var c,h,u,d="",f=r/10,p=this.picker.find(i),g=Math.floor(o/r)*r,m=g+9*f,v=Math.floor(this.viewDate.getFullYear()/f)*f,y=t.map(this.dates,function(t){return Math.floor(t.getUTCFullYear()/f)*f}),b=g-f;b<=m+f;b+=f)c=[n],h=null,b===g-f?c.push("old"):b===m+f&&c.push("new"),-1!==t.inArray(b,y)&&c.push("active"),(b<a||b>s)&&c.push("disabled"),b===v&&c.push("focused"),l!==t.noop&&((u=l(new Date(b,0,1)))===e?u={}:"boolean"==typeof u?u={enabled:u}:"string"==typeof u&&(u={classes:u}),!1===u.enabled&&c.push("disabled"),u.classes&&(c=c.concat(u.classes.split(/\s+/))),u.tooltip&&(h=u.tooltip)),d+='<span class="'+c.join(" ")+'"'+(h?' title="'+h+'"':"")+">"+b+"</span>";p.find(".datepicker-switch").text(g+"-"+m),p.find("td").html(d)},fill:function(){var n,r,o=new Date(this.viewDate),a=o.getUTCFullYear(),s=o.getUTCMonth(),l=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,c=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,h=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,u=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,d=m[this.o.language].today||m.en.today||"",f=m[this.o.language].clear||m.en.clear||"",p=m[this.o.language].titleFormat||m.en.titleFormat;if(!isNaN(a)&&!isNaN(s)){this.picker.find(".datepicker-days .datepicker-switch").text(v.formatDate(o,p,this.o.language)),this.picker.find("tfoot .today").text(d).css("display",!0===this.o.todayBtn||"linked"===this.o.todayBtn?"table-cell":"none"),this.picker.find("tfoot .clear").text(f).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var g=i(a,s,0),y=g.getUTCDate();g.setUTCDate(y-(g.getUTCDay()-this.o.weekStart+7)%7);var b=new Date(g);g.getUTCFullYear()<100&&b.setUTCFullYear(g.getUTCFullYear()),b.setUTCDate(b.getUTCDate()+42),b=b.valueOf();for(var x,_,w=[];g.valueOf()<b;){if((x=g.getUTCDay())===this.o.weekStart&&(w.push("<tr>"),this.o.calendarWeeks)){var S=new Date(+g+(this.o.weekStart-x-7)%7*864e5),C=new Date(Number(S)+(11-S.getUTCDay())%7*864e5),k=new Date(Number(k=i(C.getUTCFullYear(),0,1))+(11-k.getUTCDay())%7*864e5),T=(C-k)/864e5/7+1;w.push('<td class="cw">'+T+"</td>")}(_=this.getClassNames(g)).push("day");var A=g.getUTCDate();this.o.beforeShowDay!==t.noop&&((r=this.o.beforeShowDay(this._utc_to_local(g)))===e?r={}:"boolean"==typeof r?r={enabled:r}:"string"==typeof r&&(r={classes:r}),!1===r.enabled&&_.push("disabled"),r.classes&&(_=_.concat(r.classes.split(/\s+/))),r.tooltip&&(n=r.tooltip),r.content&&(A=r.content)),_=t.isFunction(t.uniqueSort)?t.uniqueSort(_):t.unique(_),w.push('<td class="'+_.join(" ")+'"'+(n?' title="'+n+'"':"")+' data-date="'+g.getTime().toString()+'">'+A+"</td>"),n=null,x===this.o.weekEnd&&w.push("</tr>"),g.setUTCDate(g.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(w.join(""));var D=m[this.o.language].monthsTitle||m.en.monthsTitle||"Months",M=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?D:a).end().find("tbody span").removeClass("active");if(t.each(this.dates,function(t,e){e.getUTCFullYear()===a&&M.eq(e.getUTCMonth()).addClass("active")}),(a<l||a>h)&&M.addClass("disabled"),a===l&&M.slice(0,c).addClass("disabled"),a===h&&M.slice(u+1).addClass("disabled"),this.o.beforeShowMonth!==t.noop){var E=this;t.each(M,function(i,n){var r=new Date(a,i,1),o=E.o.beforeShowMonth(r);o===e?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1!==o.enabled||t(n).hasClass("disabled")||t(n).addClass("disabled"),o.classes&&t(n).addClass(o.classes),o.tooltip&&t(n).prop("title",o.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,a,l,h,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,a,l,h,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,a,l,h,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var t,e,i=new Date(this.viewDate),n=i.getUTCFullYear(),r=i.getUTCMonth(),o=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,a=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,s=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,c=1;switch(this.viewMode){case 0:t=n<=o&&r<=a,e=n>=s&&r>=l;break;case 4:c*=10;case 3:c*=10;case 2:c*=10;case 1:t=Math.floor(n/c)*c<=o,e=Math.floor(n/c)*c+c>=s}this.picker.find(".prev").toggleClass("disabled",t),this.picker.find(".next").toggleClass("disabled",e)}},click:function(e){e.preventDefault(),e.stopPropagation();var r,o,a,s;(r=t(e.target)).hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),r.hasClass("today")&&!r.hasClass("day")&&(this.setViewMode(0),this._setDate(n(),"linked"===this.o.todayBtn?null:"view")),r.hasClass("clear")&&this.clearDates(),r.hasClass("disabled")||(r.hasClass("month")||r.hasClass("year")||r.hasClass("decade")||r.hasClass("century"))&&(this.viewDate.setUTCDate(1),o=1,1===this.viewMode?(s=r.parent().find("span").index(r),a=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(s)):(s=0,a=Number(r.text()),this.viewDate.setUTCFullYear(a)),this._trigger(v.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(i(a,s,o)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(e){var i=t(e.currentTarget).data("date"),n=new Date(i);this.o.updateViewDate&&(n.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),n.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(n)},navArrowsClick:function(e){var i=t(e.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(i*=12*v.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,i),this._trigger(v.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t||this.dates.clear(),-1!==e?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(e):!1===this.o.multidate?(this.dates.clear(),this.dates.push(t)):this.dates.push(t),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),(!e&&this.o.updateViewDate||"view"===e)&&(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),e&&"view"===e||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||e&&"date"!==e||this.hide()},moveDay:function(t,e){var i=new Date(t);return i.setUTCDate(t.getUTCDate()+e),i},moveWeek:function(t,e){return this.moveDay(t,7*e)},moveMonth:function(t,e){if(!a(t))return this.o.defaultViewDate;if(!e)return t;var i,n,r=new Date(t.valueOf()),o=r.getUTCDate(),s=r.getUTCMonth(),l=Math.abs(e);if(e=e>0?1:-1,1===l)n=-1===e?function(){return r.getUTCMonth()===s}:function(){return r.getUTCMonth()!==i},i=s+e,r.setUTCMonth(i),i=(i+12)%12;else{for(var c=0;c<l;c++)r=this.moveMonth(r,e);i=r.getUTCMonth(),r.setUTCDate(o),n=function(){return i!==r.getUTCMonth()}}for(;n();)r.setUTCDate(--o),r.setUTCMonth(i);return r},moveYear:function(t,e){return this.moveMonth(t,12*e)},moveAvailableDate:function(t,e,i){do{if(t=this[i](t,e),!this.dateWithinRange(t))return!1;i="moveDay"}while(this.dateIsDisabled(t));return t},weekOfDateIsDisabled:function(e){return-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(e){return this.weekOfDateIsDisabled(e)||t.grep(this.o.datesDisabled,function(t){return r(e,t)}).length>0},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(this.picker.is(":visible")){var e,i,n=!1,r=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault(),t.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;e=37===t.keyCode||38===t.keyCode?-1:1,0===this.viewMode?t.ctrlKey?(i=this.moveAvailableDate(r,e,"moveYear"))&&this._trigger("changeYear",this.viewDate):t.shiftKey?(i=this.moveAvailableDate(r,e,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===t.keyCode||39===t.keyCode?i=this.moveAvailableDate(r,e,"moveDay"):this.weekOfDateIsDisabled(r)||(i=this.moveAvailableDate(r,e,"moveWeek")):1===this.viewMode?(38!==t.keyCode&&40!==t.keyCode||(e*=4),i=this.moveAvailableDate(r,e,"moveMonth")):2===this.viewMode&&(38!==t.keyCode&&40!==t.keyCode||(e*=4),i=this.moveAvailableDate(r,e,"moveYear")),i&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),t.preventDefault());break;case 13:if(!this.o.forceParse)break;r=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(r),n=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),t.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}n&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==t.keyCode&&27!==t.keyCode||(this.show(),t.stopPropagation())},setViewMode:function(t){this.viewMode=t,this.picker.children("div").hide().filter(".datepicker-"+v.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var u=function(e,i){t.data(e,"datepicker",this),this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,this.keepEmptyValues=i.keepEmptyValues,delete i.keepEmptyValues,f.call(t(this.inputs),i).on("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t.data(e,"datepicker")}),this.updateDates()};u.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,i){i.setRange(e)})},dateUpdated:function(i){if(!this.updating){this.updating=!0;var n=t.data(i.target,"datepicker");if(n!==e){var r=n.getUTCDate(),o=this.keepEmptyValues,a=t.inArray(i.target,this.inputs),s=a-1,l=a+1,c=this.inputs.length;if(-1!==a){if(t.each(this.pickers,function(t,e){e.getUTCDate()||e!==n&&o||e.setUTCDate(r)}),r<this.dates[s])for(;s>=0&&r<this.dates[s];)this.pickers[s--].setUTCDate(r);else if(r>this.dates[l])for(;l<c&&r>this.dates[l];)this.pickers[l++].setUTCDate(r);this.updateDates(),delete this.updating}}}},destroy:function(){t.map(this.pickers,function(t){t.destroy()}),t(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var d=t.fn.datepicker,f=function(i){var n=Array.apply(null,arguments);n.shift();var r;if(this.each(function(){var e=t(this),o=e.data("datepicker"),a="object"==typeof i&&i;if(!o){var c=s(this,"date"),d=l(t.extend({},p,c,a).language),f=t.extend({},p,d,c,a);e.hasClass("input-daterange")||f.inputs?(t.extend(f,{inputs:f.inputs||e.find("input").toArray()}),o=new u(this,f)):o=new h(this,f),e.data("datepicker",o)}"string"==typeof i&&"function"==typeof o[i]&&(r=o[i].apply(o,n))}),r===e||r instanceof h||r instanceof u)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+i+" function)");return r};t.fn.datepicker=f;var p=t.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:t.noop,beforeShowMonth:t.noop,beforeShowYear:t.noop,beforeShowDecade:t.noop,beforeShowCentury:t.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"«",rightArrow:"»"},showWeekDays:!0},g=t.fn.datepicker.locale_opts=["format","rtl","weekStart"];t.fn.datepicker.Constructor=h;var m=t.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},v={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(t){if("function"==typeof t.toValue&&"function"==typeof t.toDisplay)return t;var e=t.replace(this.validParts,"\0").split("\0"),i=t.match(this.validParts);if(!e||!e.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:e,parts:i}},parseDate:function(i,r,o,a){function s(t,e){return!0===e&&(e=10),t<100&&(t+=2e3)>(new Date).getFullYear()+e&&(t-=100),t}function l(){var t=this.slice(0,c[f].length),e=c[f].slice(0,t.length);return t.toLowerCase()===e.toLowerCase()}if(!i)return e;if(i instanceof Date)return i;if("string"==typeof r&&(r=v.parseFormat(r)),r.toValue)return r.toValue(i,r,o);var c,u,d,f,p,g={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},y={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(i in y&&(i=y[i]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(i)){for(c=i.match(/([\-+]\d+)([dmwy])/gi),i=new Date,f=0;f<c.length;f++)u=c[f].match(/([\-+]\d+)([dmwy])/i),d=Number(u[1]),p=g[u[2].toLowerCase()],i=h.prototype[p](i,d);return h.prototype._zero_utc_time(i)}c=i&&i.match(this.nonpunctuation)||[];var b,x,_={},w=["yyyy","yy","M","MM","m","mm","d","dd"],S={yyyy:function(t,e){return t.setUTCFullYear(a?s(e,a):e)},m:function(t,e){if(isNaN(t))return t;for(e-=1;e<0;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!==e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}};S.yy=S.yyyy,S.M=S.MM=S.mm=S.m,S.dd=S.d,i=n();var C=r.parts.slice();if(c.length!==C.length&&(C=t(C).filter(function(e,i){return-1!==t.inArray(i,w)}).toArray()),c.length===C.length){var k;for(f=0,k=C.length;f<k;f++){if(b=parseInt(c[f],10),u=C[f],isNaN(b))switch(u){case"MM":x=t(m[o].months).filter(l),b=t.inArray(x[0],m[o].months)+1;break;case"M":x=t(m[o].monthsShort).filter(l),b=t.inArray(x[0],m[o].monthsShort)+1}_[u]=b}var T,A;for(f=0;f<w.length;f++)(A=w[f])in _&&!isNaN(_[A])&&(T=new Date(i),S[A](T,_[A]),isNaN(T)||(i=T))}return i},formatDate:function(e,i,n){if(!e)return"";if("string"==typeof i&&(i=v.parseFormat(i)),i.toDisplay)return i.toDisplay(e,i,n);var r={d:e.getUTCDate(),D:m[n].daysShort[e.getUTCDay()],DD:m[n].days[e.getUTCDay()],m:e.getUTCMonth()+1,M:m[n].monthsShort[e.getUTCMonth()],MM:m[n].months[e.getUTCMonth()],yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear()};r.dd=(r.d<10?"0":"")+r.d,r.mm=(r.m<10?"0":"")+r.m,e=[];for(var o=t.extend([],i.separators),a=0,s=i.parts.length;a<=s;a++)o.length&&e.push(o.shift()),e.push(r[i.parts[a]]);return e.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+p.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+p.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};v.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table></div></div>",t.fn.datepicker.DPGlobal=v,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=d,this},t.fn.datepicker.version="1.7.1",t.fn.datepicker.deprecated=function(t){var e=window.console;e&&e.warn&&e.warn("DEPRECATED: "+t)},t(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var i=t(this);i.data("datepicker")||(e.preventDefault(),f.call(i,"show"))}),t(function(){f.call(t('[data-provide="datepicker-inline"]'))})}),function(t){"use strict";if(!t.fn.datepicker)throw new Error("bootstrap-datepicker.js required.");var e=t.fn.datepicker.Constructor.prototype.place;t.fn.datepicker.Constructor.prototype.place=function(){if(e.call(this),!this.o.rtl)return this;var i=t(this.o.container),n=parseInt(this.picker.css("right"),10);if(n+=i.outerWidth()-i.width(),!this.picker.hasClass("datepicker-orient-left")){var r=this.picker.outerWidth();n+=2*(this.component?this.component.outerWidth(!0):this.element.outerWidth(!1))-2*r}return this.picker.css({right:n}),this},t.fn.datepicker.defaults.rtl="rtl"===t("html").attr("dir")}(jQuery),function(t,e,i){"use strict";var n=function(e,i){this.widget="",this.$element=t(e),this.defaultTime=i.defaultTime,this.disableFocus=i.disableFocus,this.disableMousewheel=i.disableMousewheel,this.isOpen=i.isOpen,this.minuteStep=i.minuteStep,this.modalBackdrop=i.modalBackdrop,this.orientation=i.orientation,this.secondStep=i.secondStep,this.snapToStep=i.snapToStep,this.showInputs=i.showInputs,this.showMeridian=i.showMeridian,this.showSeconds=i.showSeconds,this.template=i.template,this.appendWidgetTo=i.appendWidgetTo,this.showWidgetOnAddonClick=i.showWidgetOnAddonClick,this.icons=i.icons,this.maxHours=i.maxHours,this.explicitMode=i.explicitMode,this.handleDocumentClick=function(t){var e=t.data.scope;e.$element.parent().find(t.target).length||e.$widget.is(t.target)||e.$widget.find(t.target).length||e.hideWidget()},this._init()};n.prototype={constructor:n,_init:function(){var e=this;this.showWidgetOnAddonClick&&this.$element.parent().hasClass("input-group")&&this.$element.parent().hasClass("bootstrap-timepicker")?(this.$element.parent(".input-group.bootstrap-timepicker").find(".input-group-addon").on({"click.timepicker":t.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)})):this.template?this.$element.on({"focus.timepicker":t.proxy(this.showWidget,this),"click.timepicker":t.proxy(this.showWidget,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)}):this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":t.proxy(this.mousewheel,this)}),!1!==this.template?this.$widget=t(this.getTemplate()).on("click",t.proxy(this.widgetClick,this)):this.$widget=!1,this.showInputs&&!1!==this.$widget&&this.$widget.find("input").each(function(){t(this).on({"click.timepicker":function(){t(this).select()},"keydown.timepicker":t.proxy(e.widgetKeydown,e),"keyup.timepicker":t.proxy(e.widgetKeyup,e)})}),this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=null,this.updateFromElementVal()},clear:function(){this.hour="",this.minute="",this.second="",this.meridian="",this.$element.val("")},decrementHour:function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else this.hour<=0?this.hour=this.maxHours-1:this.hour--},decrementMinute:function(t){var e;(e=t?this.minute-t:this.minute-this.minuteStep)<0?(this.decrementHour(),this.minute=e+60):this.minute=e},decrementSecond:function(){var t=this.second-this.secondStep;t<0?(this.decrementMinute(!0),this.second=t+60):this.second=t},elementKeydown:function(t){switch(t.which){case 9:if(t.shiftKey){if("hour"===this.highlightedUnit){this.hideWidget();break}this.highlightPrevUnit()}else{if(this.showMeridian&&"meridian"===this.highlightedUnit||this.showSeconds&&"second"===this.highlightedUnit||!this.showMeridian&&!this.showSeconds&&"minute"===this.highlightedUnit){this.hideWidget();break}this.highlightNextUnit()}t.preventDefault(),this.updateFromElementVal();break;case 27:this.updateFromElementVal();break;case 37:t.preventDefault(),this.highlightPrevUnit(),this.updateFromElementVal();break;case 38:switch(t.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update();break;case 39:t.preventDefault(),this.highlightNextUnit(),this.updateFromElementVal();break;case 40:switch(t.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update()}},getCursorPosition:function(){var t=this.$element.get(0);if("selectionStart"in t)return t.selectionStart;if(i.selection){t.focus();var e=i.selection.createRange(),n=i.selection.createRange().text.length;return e.moveStart("character",-t.value.length),e.text.length-n}},getTemplate:function(){var t,e,i,n,r,o;switch(this.showInputs?(e='<input type="text" class="bootstrap-timepicker-hour" maxlength="2"/>',i='<input type="text" class="bootstrap-timepicker-minute" maxlength="2"/>',n='<input type="text" class="bootstrap-timepicker-second" maxlength="2"/>',r='<input type="text" class="bootstrap-timepicker-meridian" maxlength="2"/>'):(e='<span class="bootstrap-timepicker-hour"></span>',i='<span class="bootstrap-timepicker-minute"></span>',n='<span class="bootstrap-timepicker-second"></span>',r='<span class="bootstrap-timepicker-meridian"></span>'),o='<table><tr><td><a href="#" data-action="incrementHour"><span class="'+this.icons.up+'"></span></a></td><td class="separator"> </td><td><a href="#" data-action="incrementMinute"><span class="'+this.icons.up+'"></span></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="incrementSecond"><span class="'+this.icons.up+'"></span></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><span class="'+this.icons.up+'"></span></a></td>':"")+"</tr><tr><td>"+e+'</td> <td class="separator">:</td><td>'+i+"</td> "+(this.showSeconds?'<td class="separator">:</td><td>'+n+"</td>":"")+(this.showMeridian?'<td class="separator"> </td><td>'+r+"</td>":"")+'</tr><tr><td><a href="#" data-action="decrementHour"><span class="'+this.icons.down+'"></span></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><span class="'+this.icons.down+'"></span></a></td>'+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="decrementSecond"><span class="'+this.icons.down+'"></span></a></td>':"")+(this.showMeridian?'<td class="separator"> </td><td><a href="#" data-action="toggleMeridian"><span class="'+this.icons.down+'"></span></a></td>':"")+"</tr></table>",this.template){case"modal":t='<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+(this.modalBackdrop?"true":"false")+'"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">×</a><h3>Pick a Time</h3></div><div class="modal-content">'+o+'</div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">OK</a></div></div>';break;case"dropdown":t='<div class="bootstrap-timepicker-widget dropdown-menu">'+o+"</div>"}return t},getTime:function(){return""===this.hour?"":this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")},hideWidget:function(){!1!==this.isOpen&&(this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),"modal"===this.template&&this.$widget.modal?this.$widget.modal("hide"):this.$widget.removeClass("open"),t(i).off("mousedown.timepicker, touchend.timepicker",this.handleDocumentClick),this.isOpen=!1,this.$widget.detach())},highlightUnit:function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.showMeridian?this.highlightMeridian():this.showSeconds?this.highlightSecond():this.highlightMinute();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="hour",t.setSelectionRange&&setTimeout(function(){e.hour<10?t.setSelectionRange(0,1):t.setSelectionRange(0,2)},0)},highlightMinute:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="minute",t.setSelectionRange&&setTimeout(function(){e.hour<10?t.setSelectionRange(2,4):t.setSelectionRange(3,5)},0)},highlightSecond:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="second",t.setSelectionRange&&setTimeout(function(){e.hour<10?t.setSelectionRange(5,7):t.setSelectionRange(6,8)},0)},highlightMeridian:function(){var t=this.$element.get(0),e=this;this.highlightedUnit="meridian",t.setSelectionRange&&(this.showSeconds?setTimeout(function(){e.hour<10?t.setSelectionRange(8,10):t.setSelectionRange(9,11)},0):setTimeout(function(){e.hour<10?t.setSelectionRange(5,7):t.setSelectionRange(6,8)},0))},incrementHour:function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}this.hour!==this.maxHours-1?this.hour++:this.hour=0},incrementMinute:function(t){var e;(e=t?this.minute+t:this.minute+this.minuteStep-this.minute%this.minuteStep)>59?(this.incrementHour(),this.minute=e-60):this.minute=e},incrementSecond:function(){var t=this.second+this.secondStep-this.second%this.secondStep;t>59?(this.incrementMinute(!0),this.second=t-60):this.second=t},mousewheel:function(e){if(!this.disableMousewheel){e.preventDefault(),e.stopPropagation();var i=e.originalEvent.wheelDelta||-e.originalEvent.detail,n=null;switch("mousewheel"===e.type?n=-1*e.originalEvent.wheelDelta:"DOMMouseScroll"===e.type&&(n=40*e.originalEvent.detail),n&&(e.preventDefault(),t(this).scrollTop(n+t(this).scrollTop())),this.highlightedUnit){case"minute":i>0?this.incrementMinute():this.decrementMinute(),this.highlightMinute();break;case"second":i>0?this.incrementSecond():this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian();break;default:i>0?this.incrementHour():this.decrementHour(),this.highlightHour()}return!1}},changeToNearestStep:function(t,e){return t%e==0?t:Math.round(t%e/e)?(t+(e-t%e))%60:t-t%e},place:function(){if(!this.isInline){var i=this.$widget.outerWidth(),n=this.$widget.outerHeight(),r=t(e).width(),o=t(e).height(),a=t(e).scrollTop(),s=parseInt(this.$element.parents().filter(function(){return"auto"!==t(this).css("z-index")}).first().css("z-index"),10)+10,l=this.component?this.component.parent().offset():this.$element.offset(),c=this.component?this.component.outerHeight(!0):this.$element.outerHeight(!1),h=this.component?this.component.outerWidth(!0):this.$element.outerWidth(!1),u=l.left,d=l.top;this.$widget.removeClass("timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left"),"auto"!==this.orientation.x?(this.$widget.addClass("timepicker-orient-"+this.orientation.x),"right"===this.orientation.x&&(u-=i-h)):(this.$widget.addClass("timepicker-orient-left"),l.left<0?u-=l.left-10:l.left+i>r&&(u=r-i-10));var f,p,g=this.orientation.y;"auto"===g&&(f=-a+l.top-n,p=a+o-(l.top+c+n),g=Math.max(f,p)===p?"top":"bottom"),this.$widget.addClass("timepicker-orient-"+g),"top"===g?d+=c:d-=n+parseInt(this.$widget.css("padding-top"),10),this.$widget.css({top:d,left:u,zIndex:s})}},remove:function(){t("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(t){if(this.$element.val())this.updateFromElementVal();else if("current"===t){var e=new Date,i=e.getHours(),n=e.getMinutes(),r=e.getSeconds(),o="AM";0!==r&&60===(r=Math.ceil(e.getSeconds()/this.secondStep)*this.secondStep)&&(n+=1,r=0),0!==n&&60===(n=Math.ceil(e.getMinutes()/this.minuteStep)*this.minuteStep)&&(i+=1,n=0),this.showMeridian&&(0===i?i=12:i>=12?(i>12&&(i-=12),o="PM"):o="AM"),this.hour=i,this.minute=n,this.second=r,this.meridian=o,this.update()}else!1===t?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(t)},setTime:function(t,e){if(t){var i,n,r,o,a,s;if("object"==typeof t&&t.getMonth)r=t.getHours(),o=t.getMinutes(),a=t.getSeconds(),this.showMeridian&&(s="AM",r>12&&(s="PM",r%=12),12===r&&(s="PM"));else{if((i=(/a/i.test(t)?1:0)+(/p/i.test(t)?2:0))>2)return void this.clear();if(n=t.replace(/[^0-9\:]/g,"").split(":"),r=n[0]?n[0].toString():n.toString(),this.explicitMode&&r.length>2&&r.length%2!=0)return void this.clear();o=n[1]?n[1].toString():"",a=n[2]?n[2].toString():"",r.length>4&&(a=r.slice(-2),r=r.slice(0,-2)),r.length>2&&(o=r.slice(-2),r=r.slice(0,-2)),o.length>2&&(a=o.slice(-2),o=o.slice(0,-2)),r=parseInt(r,10),o=parseInt(o,10),a=parseInt(a,10),isNaN(r)&&(r=0),isNaN(o)&&(o=0),isNaN(a)&&(a=0),a>59&&(a=59),o>59&&(o=59),r>=this.maxHours&&(r=this.maxHours-1),this.showMeridian?(r>12&&(i=2,r-=12),i||(i=1),0===r&&(r=12),s=1===i?"AM":"PM"):r<12&&2===i?r+=12:r>=this.maxHours?r=this.maxHours-1:(r<0||12===r&&1===i)&&(r=0)}this.hour=r,this.snapToStep?(this.minute=this.changeToNearestStep(o,this.minuteStep),this.second=this.changeToNearestStep(a,this.secondStep)):(this.minute=o,this.second=a),this.meridian=s,this.update(e)}else this.clear()},showWidget:function(){this.isOpen||this.$element.is(":disabled")||(this.$widget.appendTo(this.appendWidgetTo),t(i).on("mousedown.timepicker, touchend.timepicker",{scope:this},this.handleDocumentClick),this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.place(),this.disableFocus&&this.$element.blur(),""===this.hour&&(this.defaultTime?this.setDefaultTime(this.defaultTime):this.setTime("0:0:0")),"modal"===this.template&&this.$widget.modal?this.$widget.modal("show").on("hidden",t.proxy(this.hideWidget,this)):!1===this.isOpen&&this.$widget.addClass("open"),this.isOpen=!0)},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM"},update:function(t){this.updateElement(),t||this.updateWidget(),this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}})},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){this.setTime(this.$element.val())},updateWidget:function(){if(!1!==this.$widget){var t=this.hour,e=1===this.minute.toString().length?"0"+this.minute:this.minute,i=1===this.second.toString().length?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(t),this.$widget.find("input.bootstrap-timepicker-minute").val(e),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(i),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(t),this.$widget.find("span.bootstrap-timepicker-minute").text(e),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(i),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},updateFromWidgetInputs:function(){if(!1!==this.$widget){var t=this.$widget.find("input.bootstrap-timepicker-hour").val()+":"+this.$widget.find("input.bootstrap-timepicker-minute").val()+(this.showSeconds?":"+this.$widget.find("input.bootstrap-timepicker-second").val():"")+(this.showMeridian?this.$widget.find("input.bootstrap-timepicker-meridian").val():"");this.setTime(t,!0)}},widgetClick:function(e){e.stopPropagation(),e.preventDefault();var i=t(e.target),n=i.closest("a").data("action");n&&this[n](),this.update(),i.is("input")&&i.get(0).setSelectionRange(0,2)},widgetKeydown:function(e){var i=t(e.target),n=i.attr("class").replace("bootstrap-timepicker-","");switch(e.which){case 9:if(e.shiftKey){if("hour"===n)return this.hideWidget()}else if(this.showMeridian&&"meridian"===n||this.showSeconds&&"second"===n||!this.showMeridian&&!this.showSeconds&&"minute"===n)return this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(e.preventDefault(),n){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),i.get(0).setSelectionRange(0,2);break;case 40:switch(e.preventDefault(),n){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),i.get(0).setSelectionRange(0,2)}},widgetKeyup:function(t){(65===t.which||77===t.which||80===t.which||46===t.which||8===t.which||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105)&&this.updateFromWidgetInputs()}},t.fn.timepicker=function(e){var i=Array.apply(null,arguments);return i.shift(),this.each(function(){var r=t(this),o=r.data("timepicker"),a="object"==typeof e&&e;o||r.data("timepicker",o=new n(this,t.extend({},t.fn.timepicker.defaults,a,t(this).data()))),"string"==typeof e&&o[e].apply(o,i)})},t.fn.timepicker.defaults={defaultTime:"current",disableFocus:!1,disableMousewheel:!1,isOpen:!1,minuteStep:15,modalBackdrop:!1,orientation:{x:"auto",y:"auto"},secondStep:15,snapToStep:!1,showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",appendWidgetTo:"body",showWidgetOnAddonClick:!0,icons:{up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},maxHours:24,explicitMode:!1},t.fn.timepicker.Constructor=n,t(i).on("focus.timepicker.data-api click.timepicker.data-api",'[data-provide="timepicker"]',function(e){var i=t(this);i.data("timepicker")||(e.preventDefault(),i.timepicker())})}(jQuery,window,document),function(t){"use strict";if(!t.fn.timepicker)throw new Error("bootstrap-timepicker.js required.");var e=t.fn.timepicker.Constructor.prototype._init,i=t.fn.timepicker.Constructor.prototype.place;t.fn.timepicker.Constructor.prototype._init=function(){this.$element.on({"focus.timepicker":t.proxy(this.highlightUnit,this),"click.timepicker":t.proxy(this.highlightUnit,this),"keydown.timepicker":t.proxy(this.elementKeydown,this),"blur.timepicker":t.proxy(this.blurElement,this)}),this.$element.parent(".input-group").find(".input-group-addon").addClass("bootstrap-timepicker-trigger").on("click.timepicker",t.proxy(this.showWidget,this)),e.call(this)},t.fn.timepicker.Constructor.prototype.place=function(){"dropdown"===this.template&&i.call(this)},t.fn.timepicker.Constructor.prototype.getTemplate=function(){var t=void 0,e=void 0,i=void 0,n=void 0;this.showInputs?(t='<input type="text" name="hour" class="bootstrap-timepicker-hour form-control timepicker-input" maxlength="2"/>',e='<input type="text" name="minute" class="bootstrap-timepicker-minute form-control timepicker-input" maxlength="2"/>',i='<input type="text" name="second" class="bootstrap-timepicker-second form-control timepicker-input" maxlength="2"/>',n='<input type="text" name="meridian" class="bootstrap-timepicker-meridian form-control timepicker-input" maxlength="2"/>'):(t='<span class="bootstrap-timepicker-hour timepicker-value"></span>',e='<span class="bootstrap-timepicker-minute timepicker-value"></span>',i='<span class="bootstrap-timepicker-second timepicker-value"></span>',n='<span class="bootstrap-timepicker-meridian timepicker-value"></span>');var r='\n<table class="table">\n<tr>\n <td><a href="#" data-action="incrementHour" class="timepicker-increment">+</a></td>\n <td class="separator"> </td>\n <td><a href="#" data-action="incrementMinute" class="timepicker-increment">+</a></td>\n '+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="incrementSecond" class="timepicker-increment">+</a></td>':"")+"\n "+(this.showMeridian?'<td class="separator"> </td><td class="meridian-column"><a href="#" data-action="toggleMeridian" class="timepicker-increment">+</a></td>':"")+"\n</tr>\n<tr>\n <td>"+t+'</td>\n <td class="separator">:</td>\n <td>'+e+"</td>\n "+(this.showSeconds?'<td class="separator">:</td><td>'+i+"</td>":"")+"\n "+(this.showMeridian?'<td class="separator"> </td><td>'+n+"</td>":"")+'\n</tr>\n<tr>\n <td><a href="#" data-action="decrementHour" class="timepicker-decrement">-</a></td>\n <td class="separator"></td>\n <td><a href="#" data-action="decrementMinute" class="timepicker-decrement">-</a></td>\n '+(this.showSeconds?'<td class="separator"> </td><td><a href="#" data-action="decrementSecond" class="timepicker-decrement">-</a></td>':"")+"\n "+(this.showMeridian?'<td class="separator"> </td><td><a href="#" data-action="toggleMeridian" class="timepicker-decrement">-</a></td>':"")+"\n</tr>\n</table>";return"modal"!==this.template?'<div class="bootstrap-timepicker-widget dropdown-menu">'+r+"</div>":'\n<div class="bootstrap-timepicker-widget modal fade" tabindex="-1" role="dialog">\n<div class="modal-dialog modal-sm" role="document">\n <div class="modal-content">\n <div class="modal-header">\n <button type="button" class="close" data-dismiss="modal" aria-label="Close">\n <span aria-hidden="true">×</span>\n </button>\n <h4 class="modal-title">Pick a Time</h4>\n </div>\n <div class="modal-body">\n '+r+'\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>\n </div>\n </div>\n</div>\n</div>'}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";function e(e,i){var n,r,o,a,s,c=t('<div class="minicolors" />'),h=t.minicolors.defaults;if(!e.data("minicolors-initialized")){if(i=t.extend(!0,{},h,i),c.addClass("minicolors-theme-"+i.theme).toggleClass("minicolors-with-opacity",i.opacity),void 0!==i.position&&t.each(i.position.split(" "),function(){c.addClass("minicolors-position-"+this)}),n="rgb"===i.format?i.opacity?"25":"20":i.keywords?"11":"7",e.addClass("minicolors-input").data("minicolors-initialized",!1).data("minicolors-settings",i).prop("size",n).wrap(c).after('<div class="minicolors-panel minicolors-slider-'+i.control+'"><div class="minicolors-slider minicolors-sprite"><div class="minicolors-picker"></div></div><div class="minicolors-opacity-slider minicolors-sprite"><div class="minicolors-picker"></div></div><div class="minicolors-grid minicolors-sprite"><div class="minicolors-grid-inner"></div><div class="minicolors-picker"><div></div></div></div></div>'),i.inline||(e.after('<span class="minicolors-swatch minicolors-sprite minicolors-input-swatch"><span class="minicolors-swatch-color"></span></span>'),e.next(".minicolors-input-swatch").on("click",function(t){t.preventDefault(),e.focus()})),(a=e.parent().find(".minicolors-panel")).on("selectstart",function(){return!1}).end(),i.swatches&&0!==i.swatches.length)for(a.addClass("minicolors-with-swatches"),r=t('<ul class="minicolors-swatches"></ul>').appendTo(a),s=0;s<i.swatches.length;++s)o=v(o=i.swatches[s])?p(o,!0):k(f(o,!0)),t('<li class="minicolors-swatch minicolors-sprite"><span class="minicolors-swatch-color"></span></li>').appendTo(r).data("swatch-color",i.swatches[s]).find(".minicolors-swatch-color").css({backgroundColor:_(o),opacity:o.a}),i.swatches[s]=o;i.inline&&e.parent().addClass("minicolors-inline"),l(e,!1),e.data("minicolors-initialized",!0)}}function i(t){var e=t.parent();t.removeData("minicolors-initialized").removeData("minicolors-settings").removeProp("size").removeClass("minicolors-input"),e.before(t).remove()}function n(t){var e=t.parent(),i=e.find(".minicolors-panel"),n=t.data("minicolors-settings");!t.data("minicolors-initialized")||t.prop("disabled")||e.hasClass("minicolors-inline")||e.hasClass("minicolors-focus")||(r(),e.addClass("minicolors-focus"),i.stop(!0,!0).fadeIn(n.showSpeed,function(){n.show&&n.show.call(t.get(0))}))}function r(){t(".minicolors-focus").each(function(){var e=t(this),i=e.find(".minicolors-input"),n=e.find(".minicolors-panel"),r=i.data("minicolors-settings");n.fadeOut(r.hideSpeed,function(){r.hide&&r.hide.call(i.get(0)),e.removeClass("minicolors-focus")})})}function o(t,e,i){var n,r,o,s,l=t.parents(".minicolors").find(".minicolors-input"),c=l.data("minicolors-settings"),h=t.find("[class$=-picker]"),u=t.offset().left,d=t.offset().top,f=Math.round(e.pageX-u),p=Math.round(e.pageY-d),g=i?c.animationSpeed:0;e.originalEvent.changedTouches&&(f=e.originalEvent.changedTouches[0].pageX-u,p=e.originalEvent.changedTouches[0].pageY-d),f<0&&(f=0),p<0&&(p=0),f>t.width()&&(f=t.width()),p>t.height()&&(p=t.height()),t.parent().is(".minicolors-slider-wheel")&&h.parent().is(".minicolors-grid")&&(n=75-f,r=75-p,o=Math.sqrt(n*n+r*r),(s=Math.atan2(r,n))<0&&(s+=2*Math.PI),o>75&&(o=75,f=75-75*Math.cos(s),p=75-75*Math.sin(s)),f=Math.round(f),p=Math.round(p)),t.is(".minicolors-grid")?h.stop(!0).animate({top:p+"px",left:f+"px"},g,c.animationEasing,function(){a(l,t)}):h.stop(!0).animate({top:p+"px"},g,c.animationEasing,function(){a(l,t)})}function a(t,e){function i(t,e){var i,n;return t.length&&e?(i=t.offset().left,n=t.offset().top,{x:i-e.offset().left+t.outerWidth()/2,y:n-e.offset().top+t.outerHeight()/2}):null}var n,r,o,a,l,h,u,d=t.val(),f=t.attr("data-opacity"),p=t.parent(),g=t.data("minicolors-settings"),v=p.find(".minicolors-input-swatch"),y=p.find(".minicolors-grid"),b=p.find(".minicolors-slider"),x=p.find(".minicolors-opacity-slider"),_=y.find("[class$=-picker]"),S=b.find("[class$=-picker]"),C=x.find("[class$=-picker]"),k=i(_,y),T=i(S,b),A=i(C,x);if(e.is(".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider")){switch(g.control){case"wheel":a=y.width()/2-k.x,l=y.height()/2-k.y,h=Math.sqrt(a*a+l*l),(u=Math.atan2(l,a))<0&&(u+=2*Math.PI),h>75&&(h=75,k.x=69-75*Math.cos(u),k.y=69-75*Math.sin(u)),r=m(h/.75,0,100),d=w({h:n=m(180*u/Math.PI,0,360),s:r,b:o=m(100-Math.floor(T.y*(100/b.height())),0,100)}),b.css("backgroundColor",w({h:n,s:r,b:100}));break;case"saturation":d=w({h:n=m(parseInt(k.x*(360/y.width()),10),0,360),s:r=m(100-Math.floor(T.y*(100/b.height())),0,100),b:o=m(100-Math.floor(k.y*(100/y.height())),0,100)}),b.css("backgroundColor",w({h:n,s:100,b:o})),p.find(".minicolors-grid-inner").css("opacity",r/100);break;case"brightness":d=w({h:n=m(parseInt(k.x*(360/y.width()),10),0,360),s:r=m(100-Math.floor(k.y*(100/y.height())),0,100),b:o=m(100-Math.floor(T.y*(100/b.height())),0,100)}),b.css("backgroundColor",w({h:n,s:r,b:100})),p.find(".minicolors-grid-inner").css("opacity",1-o/100);break;default:d=w({h:n=m(360-parseInt(T.y*(360/b.height()),10),0,360),s:r=m(Math.floor(k.x*(100/y.width())),0,100),b:o=m(100-Math.floor(k.y*(100/y.height())),0,100)}),y.css("backgroundColor",w({h:n,s:100,b:100}))}s(t,d,f=g.opacity?parseFloat(1-A.y/x.height()).toFixed(2):1)}else v.find("span").css({backgroundColor:d,opacity:f}),c(t,d,f)}function s(t,e,i){var n,r=t.parent(),o=t.data("minicolors-settings"),a=r.find(".minicolors-input-swatch");o.opacity&&t.attr("data-opacity",i),"rgb"===o.format?(n=v(e)?p(e,!0):k(f(e,!0)),i=""===t.attr("data-opacity")?1:m(parseFloat(t.attr("data-opacity")).toFixed(2),0,1),!isNaN(i)&&o.opacity||(i=1),e=t.minicolors("rgbObject").a<=1&&n&&o.opacity?"rgba("+n.r+", "+n.g+", "+n.b+", "+parseFloat(i)+")":"rgb("+n.r+", "+n.g+", "+n.b+")"):(v(e)&&(e=x(e)),e=d(e,o.letterCase)),t.val(e),a.find("span").css({backgroundColor:e,opacity:i}),c(t,e,i)}function l(e,i){var n,r,o,a,s,l,h,u,b,_,C=e.parent(),k=e.data("minicolors-settings"),T=C.find(".minicolors-input-swatch"),A=C.find(".minicolors-grid"),D=C.find(".minicolors-slider"),M=C.find(".minicolors-opacity-slider"),E=A.find("[class$=-picker]"),P=D.find("[class$=-picker]"),L=M.find("[class$=-picker]");switch(v(e.val())?(n=x(e.val()),(s=m(parseFloat(y(e.val())).toFixed(2),0,1))&&e.attr("data-opacity",s)):n=d(f(e.val(),!0),k.letterCase),n||(n=d(g(k.defaultValue,!0),k.letterCase)),r=S(n),a=k.keywords?t.map(k.keywords.split(","),function(e){return t.trim(e.toLowerCase())}):[],l=""!==e.val()&&t.inArray(e.val().toLowerCase(),a)>-1?d(e.val()):v(e.val())?p(e.val()):n,i||e.val(l),k.opacity&&(o=""===e.attr("data-opacity")?1:m(parseFloat(e.attr("data-opacity")).toFixed(2),0,1),isNaN(o)&&(o=1),e.attr("data-opacity",o),T.find("span").css("opacity",o),u=m(M.height()-M.height()*o,0,M.height()),L.css("top",u+"px")),"transparent"===e.val().toLowerCase()&&T.find("span").css("opacity",0),T.find("span").css("backgroundColor",n),k.control){case"wheel":b=m(Math.ceil(.75*r.s),0,A.height()/2),_=r.h*Math.PI/180,h=m(75-Math.cos(_)*b,0,A.width()),u=m(75-Math.sin(_)*b,0,A.height()),E.css({top:u+"px",left:h+"px"}),u=150-r.b/(100/A.height()),""===n&&(u=0),P.css("top",u+"px"),D.css("backgroundColor",w({h:r.h,s:r.s,b:100}));break;case"saturation":h=m(5*r.h/12,0,150),u=m(A.height()-Math.ceil(r.b/(100/A.height())),0,A.height()),E.css({top:u+"px",left:h+"px"}),u=m(D.height()-r.s*(D.height()/100),0,D.height()),P.css("top",u+"px"),D.css("backgroundColor",w({h:r.h,s:100,b:r.b})),C.find(".minicolors-grid-inner").css("opacity",r.s/100);break;case"brightness":h=m(5*r.h/12,0,150),u=m(A.height()-Math.ceil(r.s/(100/A.height())),0,A.height()),E.css({top:u+"px",left:h+"px"}),u=m(D.height()-r.b*(D.height()/100),0,D.height()),P.css("top",u+"px"),D.css("backgroundColor",w({h:r.h,s:r.s,b:100})),C.find(".minicolors-grid-inner").css("opacity",1-r.b/100);break;default:h=m(Math.ceil(r.s/(100/A.width())),0,A.width()),u=m(A.height()-Math.ceil(r.b/(100/A.height())),0,A.height()),E.css({top:u+"px",left:h+"px"}),u=m(D.height()-r.h/(360/D.height()),0,D.height()),P.css("top",u+"px"),A.css("backgroundColor",w({h:r.h,s:100,b:100}))}e.data("minicolors-initialized")&&c(e,l,o)}function c(t,e,i){var n,r,o,a=t.data("minicolors-settings"),s=t.data("minicolors-lastChange");if(!s||s.value!==e||s.opacity!==i){if(t.data("minicolors-lastChange",{value:e,opacity:i}),a.swatches&&0!==a.swatches.length){for(n=v(e)?p(e,!0):k(e),r=-1,o=0;o<a.swatches.length;++o)if(n.r===a.swatches[o].r&&n.g===a.swatches[o].g&&n.b===a.swatches[o].b&&n.a===a.swatches[o].a){r=o;break}t.parent().find(".minicolors-swatches .minicolors-swatch").removeClass("selected"),-1!==r&&t.parent().find(".minicolors-swatches .minicolors-swatch").eq(o).addClass("selected")}a.change&&(a.changeDelay?(clearTimeout(t.data("minicolors-changeTimeout")),t.data("minicolors-changeTimeout",setTimeout(function(){a.change.call(t.get(0),e,i)},a.changeDelay))):a.change.call(t.get(0),e,i)),t.trigger("change").trigger("input")}}function h(e){var i,n=t(e).attr("data-opacity");return(i=v(t(e).val())?p(t(e).val(),!0):k(f(t(e).val(),!0)))?(void 0!==n&&t.extend(i,{a:parseFloat(n)}),i):null}function u(e,i){var n,r=t(e).attr("data-opacity");return(n=v(t(e).val())?p(t(e).val(),!0):k(f(t(e).val(),!0)))?(void 0===r&&(r=1),i?"rgba("+n.r+", "+n.g+", "+n.b+", "+parseFloat(r)+")":"rgb("+n.r+", "+n.g+", "+n.b+")"):null}function d(t,e){return"uppercase"===e?t.toUpperCase():t.toLowerCase()}function f(t,e){return(t=t.replace(/^#/g,"")).match(/^[A-F0-9]{3,6}/gi)?3!==t.length&&6!==t.length?"":(3===t.length&&e&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),"#"+t):""}function p(t,e){var i=t.replace(/[^\d,.]/g,"").split(",");return i[0]=m(parseInt(i[0],10),0,255),i[1]=m(parseInt(i[1],10),0,255),i[2]=m(parseInt(i[2],10),0,255),i[3]&&(i[3]=m(parseFloat(i[3],10),0,1)),e?i[3]?{r:i[0],g:i[1],b:i[2],a:i[3]}:{r:i[0],g:i[1],b:i[2]}:void 0!==i[3]&&i[3]<=1?"rgba("+i[0]+", "+i[1]+", "+i[2]+", "+i[3]+")":"rgb("+i[0]+", "+i[1]+", "+i[2]+")"}function g(t,e){return v(t)?p(t):f(t,e)}function m(t,e,i){return t<e&&(t=e),t>i&&(t=i),t}function v(t){var e=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);return!(!e||4!==e.length)}function y(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+(\.\d{1,2})?|\.\d{1,2})[\s+]?/i))&&6===t.length?t[4]:"1"}function b(t){var e={},i=Math.round(t.h),n=Math.round(255*t.s/100),r=Math.round(255*t.b/100);if(0===n)e.r=e.g=e.b=r;else{var o=r,a=(255-n)*r/255,s=i%60*(o-a)/60;360===i&&(i=0),i<60?(e.r=o,e.b=a,e.g=a+s):i<120?(e.g=o,e.b=a,e.r=o-s):i<180?(e.g=o,e.r=a,e.b=a+s):i<240?(e.b=o,e.r=a,e.g=o-s):i<300?(e.b=o,e.g=a,e.r=a+s):i<360?(e.r=o,e.g=a,e.b=o-s):(e.r=0,e.g=0,e.b=0)}return{r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b)}}function x(t){return(t=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===t.length?"#"+("0"+parseInt(t[1],10).toString(16)).slice(-2)+("0"+parseInt(t[2],10).toString(16)).slice(-2)+("0"+parseInt(t[3],10).toString(16)).slice(-2):""}function _(e){var i=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];return t.each(i,function(t,e){1===e.length&&(i[t]="0"+e)}),"#"+i.join("")}function w(t){return _(b(t))}function S(t){var e=C(k(t));return 0===e.s&&(e.h=360),e}function C(t){var e={h:0,s:0,b:0},i=Math.min(t.r,t.g,t.b),n=Math.max(t.r,t.g,t.b),r=n-i;return e.b=n,e.s=0!==n?255*r/n:0,0!==e.s?t.r===n?e.h=(t.g-t.b)/r:t.g===n?e.h=2+(t.b-t.r)/r:e.h=4+(t.r-t.g)/r:e.h=-1,e.h*=60,e.h<0&&(e.h+=360),e.s*=100/255,e.b*=100/255,e}function k(t){return t=parseInt(t.indexOf("#")>-1?t.substring(1):t,16),{r:t>>16,g:(65280&t)>>8,b:255&t}}t.minicolors={defaults:{animationSpeed:50,animationEasing:"swing",change:null,changeDelay:0,control:"hue",defaultValue:"",format:"hex",hide:null,hideSpeed:100,inline:!1,keywords:"",letterCase:"lowercase",opacity:!1,position:"bottom left",show:null,showSpeed:100,theme:"default",swatches:[]}},t.extend(t.fn,{minicolors:function(o,a){switch(o){case"destroy":return t(this).each(function(){i(t(this))}),t(this);case"hide":return r(),t(this);case"opacity":return void 0===a?t(this).attr("data-opacity"):(t(this).each(function(){l(t(this).attr("data-opacity",a))}),t(this));case"rgbObject":return h(t(this));case"rgbString":case"rgbaString":return u(t(this),"rgbaString"===o);case"settings":return void 0===a?t(this).data("minicolors-settings"):(t(this).each(function(){var e=t(this).data("minicolors-settings")||{};i(t(this)),t(this).minicolors(t.extend(!0,e,a))}),t(this));case"show":return n(t(this).eq(0)),t(this);case"value":return void 0===a?t(this).val():(t(this).each(function(){"object"==typeof a&&"null"!==a?(a.opacity&&t(this).attr("data-opacity",m(a.opacity,0,1)),a.color&&t(this).val(a.color)):t(this).val(a),l(t(this))}),t(this));default:return"create"!==o&&(a=o),t(this).each(function(){e(t(this),a)}),t(this)}}}),t([document,top.document]).on("mousedown.minicolors touchstart.minicolors",function(e){t(e.target).parents().add(e.target).hasClass("minicolors")||r()}).on("mousedown.minicolors touchstart.minicolors",".minicolors-grid, .minicolors-slider, .minicolors-opacity-slider",function(e){var i=t(this);e.preventDefault(),t(e.delegateTarget).data("minicolors-target",i),o(i,e,!0)}).on("mousemove.minicolors touchmove.minicolors",function(e){var i=t(e.delegateTarget).data("minicolors-target");i&&o(i,e)}).on("mouseup.minicolors touchend.minicolors",function(){t(this).removeData("minicolors-target")}).on("click.minicolors",".minicolors-swatches li",function(e){e.preventDefault();var i=t(this),n=i.parents(".minicolors").find(".minicolors-input"),r=i.data("swatch-color");s(n,r,y(r)),l(n)}).on("mousedown.minicolors touchstart.minicolors",".minicolors-input-swatch",function(e){var i=t(this).parent().find(".minicolors-input");e.preventDefault(),n(i)}).on("focus.minicolors",".minicolors-input",function(){var e=t(this);e.data("minicolors-initialized")&&n(e)}).on("blur.minicolors",".minicolors-input",function(){var e,i,n,r,o,a=t(this),s=a.data("minicolors-settings");a.data("minicolors-initialized")&&(e=s.keywords?t.map(s.keywords.split(","),function(e){return t.trim(e.toLowerCase())}):[],o=""!==a.val()&&t.inArray(a.val().toLowerCase(),e)>-1?a.val():null===(n=v(a.val())?p(a.val(),!0):(i=f(a.val(),!0))?k(i):null)?s.defaultValue:"rgb"===s.format?p(s.opacity?"rgba("+n.r+","+n.g+","+n.b+","+a.attr("data-opacity")+")":"rgb("+n.r+","+n.g+","+n.b+")"):_(n),r=s.opacity?a.attr("data-opacity"):1,"transparent"===o.toLowerCase()&&(r=0),a.closest(".minicolors").find(".minicolors-input-swatch > span").css("opacity",r),a.val(o),""===a.val()&&a.val(g(s.defaultValue,!0)),a.val(d(a.val(),s.letterCase)))}).on("keydown.minicolors",".minicolors-input",function(e){var i=t(this);if(i.data("minicolors-initialized"))switch(e.keyCode){case 9:r();break;case 13:case 27:r(),i.blur()}}).on("keyup.minicolors",".minicolors-input",function(){var e=t(this);e.data("minicolors-initialized")&&l(e,!0)}).on("paste.minicolors",".minicolors-input",function(){var e=t(this);e.data("minicolors-initialized")&&setTimeout(function(){l(e,!0)},1)})}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){var e,i=navigator.userAgent,n=/iphone/i.test(i),r=/chrome/i.test(i),o=/android/i.test(i);t.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},t.fn.extend({caret:function(t,e){var i;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof t?(e="number"==typeof e?e:t,this.each(function(){this.setSelectionRange?this.setSelectionRange(t,e):this.createTextRange&&((i=this.createTextRange()).collapse(!0),i.moveEnd("character",e),i.moveStart("character",t),i.select())})):(this[0].setSelectionRange?(t=this[0].selectionStart,e=this[0].selectionEnd):document.selection&&document.selection.createRange&&(i=document.selection.createRange(),t=0-i.duplicate().moveStart("character",-1e5),e=t+i.text.length),{begin:t,end:e})},unmask:function(){return this.trigger("unmask")},mask:function(i,a){var s,l,c,h,u,d,f,p;if(!i&&this.length>0){var g=(s=t(this[0])).data(t.mask.dataName);return g?g():void 0}return a=t.extend({autoclear:t.mask.autoclear,placeholder:t.mask.placeholder,completed:null},a),l=t.mask.definitions,c=[],h=f=i.length,u=null,t.each(i.split(""),function(t,e){"?"==e?(f--,h=t):l[e]?(c.push(new RegExp(l[e])),null===u&&(u=c.length-1),h>t&&(d=c.length-1)):c.push(null)}),this.trigger("unmask").each(function(){function s(){if(a.completed){for(var t=u;d>=t;t++)if(c[t]&&k[t]===g(t))return;a.completed.call(C)}}function g(t){return a.placeholder.charAt(t<a.placeholder.length?t:0)}function m(t){for(;++t<f&&!c[t];);return t}function v(t){for(;--t>=0&&!c[t];);return t}function y(t,e){var i,n;if(!(0>t)){for(i=t,n=m(e);f>i;i++)if(c[i]){if(!(f>n&&c[i].test(k[n])))break;k[i]=k[n],k[n]=g(n),n=m(n)}w(),C.caret(Math.max(u,t))}}function b(t){var e,i,n,r;for(e=t,i=g(t);f>e;e++)if(c[e]){if(n=m(e),r=k[e],k[e]=i,!(f>n&&c[n].test(r)))break;i=r}}function x(){S(),C.val()!=A&&C.change()}function _(t,e){var i;for(i=t;e>i&&f>i;i++)c[i]&&(k[i]=g(i))}function w(){C.val(k.join(""))}function S(t){var e,i,n,r=C.val(),o=-1;for(e=0,n=0;f>e;e++)if(c[e]){for(k[e]=g(e);n++<r.length;)if(i=r.charAt(n-1),c[e].test(i)){k[e]=i,o=e;break}if(n>r.length){_(e+1,f);break}}else k[e]===r.charAt(n)&&n++,h>e&&(o=e);return t?w():h>o+1?a.autoclear||k.join("")===T?(C.val()&&C.val(""),_(0,f)):w():(w(),C.val(C.val().substring(0,o+1))),h?e:u}var C=t(this),k=t.map(i.split(""),function(t,e){return"?"!=t?l[t]?g(e):t:void 0}),T=k.join(""),A=C.val();C.data(t.mask.dataName,function(){return t.map(k,function(t,e){return c[e]&&t!=g(e)?t:null}).join("")}),C.one("unmask",function(){C.off(".mask").removeData(t.mask.dataName)}).on("focus.mask",function(){if(!C.prop("readonly")){clearTimeout(e);var t;A=C.val(),t=S(),e=setTimeout(function(){C.get(0)===document.activeElement&&(w(),t==i.replace("?","").length?C.caret(0,t):C.caret(t))},10)}}).on("blur.mask",x).on("keydown.mask",function(t){if(!C.prop("readonly")){var e,i,r,o=t.which||t.keyCode;p=C.val(),8===o||46===o||n&&127===o?(e=C.caret(),i=e.begin,(r=e.end)-i==0&&(i=46!==o?v(i):r=m(i-1),r=46===o?m(r):r),_(i,r),y(i,r-1),t.preventDefault()):13===o?x.call(this,t):27===o&&(C.val(A),C.caret(0,S()),t.preventDefault())}}).on("keypress.mask",function(e){if(!C.prop("readonly")){var i,n,r,a=e.which||e.keyCode,l=C.caret();e.ctrlKey||e.altKey||e.metaKey||32>a||!a||13===a||(l.end-l.begin!=0&&(_(l.begin,l.end),y(l.begin,l.end-1)),i=m(l.begin-1),f>i&&(n=String.fromCharCode(a),c[i].test(n))&&(b(i),k[i]=n,w(),r=m(i),o?setTimeout(function(){t.proxy(t.fn.caret,C,r)()},0):C.caret(r),l.begin<=d&&s()),e.preventDefault())}}).on("input.mask paste.mask",function(){C.prop("readonly")||setTimeout(function(){var t=S(!0);C.caret(t),s()},0)}),r&&o&&C.off("input.mask").on("input.mask",function(){var t=C.val(),e=C.caret();if(p&&p.length&&p.length>t.length){for(S(!0);e.begin>0&&!c[e.begin-1];)e.begin--;if(0===e.begin)for(;e.begin<u&&!c[e.begin];)e.begin++;C.caret(e.begin,e.begin)}else{for(S(!0);e.begin<f&&!c[e.begin];)e.begin++;C.caret(e.begin,e.begin)}s()}),S()})}})}),function(t){var e,i={className:"autosizejs",id:"autosizejs",append:"\n",callback:!1,resizeDelay:10,placeholder:!0},n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent","whiteSpace"],r=t('<textarea tabindex="-1"/>').data("autosize",!0)[0];r.style.cssText="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;",r.style.lineHeight="99px","99px"===t(r).css("lineHeight")&&n.push("lineHeight"),r.style.lineHeight="",t.fn.autosize=function(o){return this.length?(o=t.extend({},i,o||{}),r.parentNode!==document.body&&t(document.body).append(r),this.each(function(){function i(){var e,i=window.getComputedStyle?window.getComputedStyle(d,null):null;i?(e=parseFloat(i.width),"border-box"!==i.boxSizing&&"border-box"!==i.webkitBoxSizing&&"border-box"!==i.mozBoxSizing||t.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(t,n){e-=parseFloat(i[n])})):e=f.width(),r.style.width=Math.max(e,0)+"px"}function a(){var a={};if(e=d,r.className=o.className,r.id=o.id,c=parseFloat(f.css("maxHeight")),t.each(n,function(t,e){a[e]=f.css(e)}),t(r).css(a).attr("wrap",f.attr("wrap")),i(),window.chrome){var s=d.style.width;d.style.width="0px";d.offsetWidth;d.style.width=s}}function s(){var t,n;e!==d?a():i(),!d.value&&o.placeholder?r.value=f.attr("placeholder")||"":r.value=d.value,r.value+=o.append||"",r.style.overflowY=d.style.overflowY,n=parseFloat(d.style.height)||0,r.scrollTop=0,r.scrollTop=9e4,t=r.scrollTop,c&&t>c?(d.style.overflowY="scroll",t=c):(d.style.overflowY="hidden",t<h&&(t=h)),t+=p,Math.abs(n-t)>.01&&(d.style.height=t+"px",r.className=r.className,g&&o.callback.call(d,d),f.trigger("autosize.resized"))}function l(){clearTimeout(u),u=setTimeout(function(){var t=f.width();t!==v&&(v=t,s())},parseInt(o.resizeDelay,10))}var c,h,u,d=this,f=t(d),p=0,g=t.isFunction(o.callback),m={height:d.style.height,overflow:d.style.overflow,overflowY:d.style.overflowY,wordWrap:d.style.wordWrap,resize:d.style.resize},v=f.width(),y=f.css("resize");f.data("autosize")||(f.data("autosize",!0),"border-box"!==f.css("box-sizing")&&"border-box"!==f.css("-moz-box-sizing")&&"border-box"!==f.css("-webkit-box-sizing")||(p=f.outerHeight()-f.height()),h=Math.max(parseFloat(f.css("minHeight"))-p||0,f.height()),f.css({overflow:"hidden",overflowY:"hidden",wordWrap:"break-word"}),"vertical"===y?f.css("resize","none"):"both"===y&&f.css("resize","horizontal"),"onpropertychange"in d?"oninput"in d?f.on("input.autosize keyup.autosize",s):f.on("propertychange.autosize",function(){"value"===event.propertyName&&s()}):f.on("input.autosize",s),!1!==o.resizeDelay&&t(window).on("resize.autosize",l),f.on("autosize.resize",s),f.on("autosize.resizeIncludeStyle",function(){e=null,s()}),f.on("autosize.destroy",function(){e=null,clearTimeout(u),t(window).off("resize",l),f.off("autosize").off(".autosize").css(m).removeData("autosize")}),s())})):this}}(jQuery||$),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function n(t){var e=m[p.locale];return e?e[t]:m.en[t]}function r(t,i,n){t.stopPropagation(),t.preventDefault(),e.isFunction(n)&&!1===n.call(i,t)||i.modal("hide")}function o(t){var e,i=0;for(e in t)i++;return i}function a(t,i){var n=0;e.each(t,function(t,e){i(t,e,n++)})}function s(t){var i,n;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return(t=e.extend({},p,t)).buttons||(t.buttons={}),i=t.buttons,n=o(i),a(i,function(t,r,o){if(e.isFunction(r)&&(r=i[t]={callback:r}),"object"!==e.type(r))throw new Error("button with key "+t+" must be an object");r.label||(r.label=t),r.className||(r.className=n<=2&&o===n-1?"btn-primary":"btn-default")}),t}function l(t,e){var i=t.length,n={};if(i<1||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(n[e[0]]=t[0],n[e[1]]=t[1]):n=t[0],n}function c(t,i,n){return e.extend(!0,{},t,l(i,n))}function h(t,e,i,n){return d(c({className:"bootbox-"+t,buttons:u.apply(null,e)},n,i),e)}function u(){for(var t={},e=0,i=arguments.length;e<i;e++){var r=arguments[e],o=r.toLowerCase(),a=r.toUpperCase();t[o]={label:n(a)}}return t}function d(t,e){var n={};return a(e,function(t,e){n[e]=!0}),a(t.buttons,function(t){if(n[t]===i)throw new Error("button key "+t+" is not allowed (options are "+e.join("\n")+")")}),t}var f={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>×</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'></select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},p={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},g={};g.alert=function(){var t;if((t=h("alert",["ok"],["message","callback"],arguments)).callback&&!e.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return!e.isFunction(t.callback)||t.callback.call(this)},g.dialog(t)},g.confirm=function(){var t;if(t=h("confirm",["cancel","confirm"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},!e.isFunction(t.callback))throw new Error("confirm requires a callback");return g.dialog(t)},g.prompt=function(){var t,n,r,o,s,l,h;if(o=e(f.form),n={className:"bootbox-prompt",buttons:u("cancel","confirm"),value:"",inputType:"text"},t=d(c(n,arguments,["title","callback"]),["cancel","confirm"]),l=t.show===i||t.show,t.message=o,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=s.val();break;case"checkbox":var n=s.find("input:checked");i=[],a(n,function(t,n){i.push(e(n).val())})}return t.callback.call(this,i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if(!e.isFunction(t.callback))throw new Error("prompt requires a callback");if(!f.inputs[t.inputType])throw new Error("invalid prompt type");switch(s=e(f.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":s.val(t.value);break;case"select":var p={};if(h=t.inputOptions||[],!e.isArray(h))throw new Error("Please pass an array of input options");if(!h.length)throw new Error("prompt with select requires options");a(h,function(t,n){var r=s;if(n.value===i||n.text===i)throw new Error("given options in wrong format");n.group&&(p[n.group]||(p[n.group]=e("<optgroup/>").attr("label",n.group)),r=p[n.group]),r.append("<option value='"+n.value+"'>"+n.text+"</option>")}),a(p,function(t,e){s.append(e)}),s.val(t.value);break;case"checkbox":var m=e.isArray(t.value)?t.value:[t.value];if(!(h=t.inputOptions||[]).length)throw new Error("prompt with checkbox requires options");if(!h[0].value||!h[0].text)throw new Error("given options in wrong format");s=e("<div/>"),a(h,function(i,n){var r=e(f.inputs[t.inputType]);r.find("input").attr("value",n.value),r.find("label").append(n.text),a(m,function(t,e){e===n.value&&r.find("input").prop("checked",!0)}),s.append(r)})}return t.placeholder&&s.attr("placeholder",t.placeholder),t.pattern&&s.attr("pattern",t.pattern),t.maxlength&&s.attr("maxlength",t.maxlength),o.append(s),o.on("submit",function(t){t.preventDefault(),t.stopPropagation(),r.find(".btn-primary").click()}),(r=g.dialog(t)).off("shown.bs.modal"),r.on("shown.bs.modal",function(){s.focus()}),!0===l&&r.modal("show"),r},g.dialog=function(t){t=s(t);var n=e(f.dialog),o=n.find(".modal-dialog"),l=n.find(".modal-body"),c=t.buttons,h="",u={onEscape:t.onEscape};if(e.fn.modal===i)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(a(c,function(t,e){h+="<button data-bb-handler='"+t+"' type='button' class='btn "+e.className+"'>"+e.label+"</button>",u[t]=e.callback}),l.find(".bootbox-body").html(t.message),!0===t.animate&&n.addClass("fade"),t.className&&n.addClass(t.className),"large"===t.size?o.addClass("modal-lg"):"small"===t.size&&o.addClass("modal-sm"),t.title&&l.before(f.header),t.closeButton){var d=e(f.closeButton);t.title?n.find(".modal-header").prepend(d):d.css("margin-top","-10px").prependTo(l)}return t.title&&n.find(".modal-title").html(t.title),h.length&&(l.after(f.footer),n.find(".modal-footer").html(h)),n.on("hidden.bs.modal",function(t){t.target===this&&n.remove()}),n.on("shown.bs.modal",function(){n.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&n.on("click.dismiss.bs.modal",function(t){n.children(".modal-backdrop").length&&(t.currentTarget=n.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&n.trigger("escape.close.bb")}),n.on("escape.close.bb",function(t){u.onEscape&&r(t,n,u.onEscape)}),n.on("click",".modal-footer button",function(t){var i=e(this).data("bb-handler");r(t,n,u[i])}),n.on("click",".bootbox-close-button",function(t){r(t,n,u.onEscape)}),n.on("keyup",function(t){27===t.which&&n.trigger("escape.close.bb")}),e(t.container).append(n),n.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&n.modal("show"),n},g.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(p,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвърждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return g.addLocale=function(t,i){return e.each(["OK","CANCEL","CONFIRM"],function(t,e){if(!i[e])throw new Error("Please supply a translation for '"+e+"'")}),m[t]={OK:i.OK,CANCEL:i.CANCEL,CONFIRM:i.CONFIRM},g},g.removeLocale=function(t){return delete m[t],g},g.setLocale=function(t){return g.setDefaults("locale",t)},g.init=function(i){return t(i||e)},g}),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window,document)}):"object"==typeof exports?module.exports=function(e,i){return e||(e=window),i||(i="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(i,e,e.document)}:t(jQuery,window,document)}(function(t,e,i,n){"use strict";function r(e){var i,n,o={};t.each(e,function(t,a){(i=t.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(i[1]+" ")&&(n=t.replace(i[0],i[2].toLowerCase()),o[n]=t,"o"===i[1]&&r(e[t]))}),e._hungarianMap=o}function o(e,i,a){e._hungarianMap||r(e);var s;t.each(i,function(r,l){(s=e._hungarianMap[r])===n||!a&&i[s]!==n||("o"===s.charAt(0)?(i[s]||(i[s]={}),t.extend(!0,i[s],i[r]),o(e[s],i[s],a)):i[s]=i[r])})}function a(t){var e=Yt.defaults.oLanguage,i=t.sZeroRecords;!t.sEmptyTable&&i&&"No data available in table"===e.sEmptyTable&&Pt(t,t,"sZeroRecords","sEmptyTable"),!t.sLoadingRecords&&i&&"Loading..."===e.sLoadingRecords&&Pt(t,t,"sZeroRecords","sLoadingRecords"),t.sInfoThousands&&(t.sThousands=t.sInfoThousands);var n=t.sDecimal;n&&$t(n)}function s(t){de(t,"ordering","bSort"),de(t,"orderMulti","bSortMulti"),de(t,"orderClasses","bSortClasses"),de(t,"orderCellsTop","bSortCellsTop"),de(t,"order","aaSorting"),de(t,"orderFixed","aaSortingFixed"),de(t,"paging","bPaginate"),de(t,"pagingType","sPaginationType"),de(t,"pageLength","iDisplayLength"),de(t,"searching","bFilter"),"boolean"==typeof t.sScrollX&&(t.sScrollX=t.sScrollX?"100%":""),"boolean"==typeof t.scrollX&&(t.scrollX=t.scrollX?"100%":"");var e=t.aoSearchCols;if(e)for(var i=0,n=e.length;i<n;i++)e[i]&&o(Yt.models.oSearch,e[i])}function l(e){de(e,"orderable","bSortable"),de(e,"orderData","aDataSort"),de(e,"orderSequence","asSorting"),de(e,"orderDataType","sortDataType");var i=e.aDataSort;"number"!=typeof i||t.isArray(i)||(e.aDataSort=[i])}function c(i){if(!Yt.__browser){var n={};Yt.__browser=n;var r=t("<div/>").css({position:"fixed",top:0,left:-1*t(e).scrollLeft(),height:1,width:1,overflow:"hidden"}).append(t("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(t("<div/>").css({width:"100%",height:10}))).appendTo("body"),o=r.children(),a=o.children();n.barWidth=o[0].offsetWidth-o[0].clientWidth,n.bScrollOversize=100===a[0].offsetWidth&&100!==o[0].clientWidth,n.bScrollbarLeft=1!==Math.round(a.offset().left),n.bBounding=!!r[0].getBoundingClientRect().width,r.remove()}t.extend(i.oBrowser,Yt.__browser),i.oScroll.iBarWidth=Yt.__browser.barWidth}function h(t,e,i,r,o,a){var s,l=r,c=!1;for(i!==n&&(s=i,c=!0);l!==o;)t.hasOwnProperty(l)&&(s=c?e(s,t[l],l,t):t[l],c=!0,l+=a);return s}function u(e,n){var r=Yt.defaults.column,o=e.aoColumns.length,a=t.extend({},Yt.models.oColumn,r,{nTh:n||i.createElement("th"),sTitle:r.sTitle?r.sTitle:n?n.innerHTML:"",aDataSort:r.aDataSort?r.aDataSort:[o],mData:r.mData?r.mData:o,idx:o});e.aoColumns.push(a);var s=e.aoPreSearchCols;s[o]=t.extend({},Yt.models.oSearch,s[o]),d(e,o,t(n).data())}function d(e,i,r){var a=e.aoColumns[i],s=e.oClasses,c=t(a.nTh);if(!a.sWidthOrig){a.sWidthOrig=c.attr("width")||null;var h=(c.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);h&&(a.sWidthOrig=h[1])}r!==n&&null!==r&&(l(r),o(Yt.defaults.column,r),r.mDataProp===n||r.mData||(r.mData=r.mDataProp),r.sType&&(a._sManualType=r.sType),r.className&&!r.sClass&&(r.sClass=r.className),r.sClass&&c.addClass(r.sClass),t.extend(a,r),Pt(a,r,"sWidth","sWidthOrig"),r.iDataSort!==n&&(a.aDataSort=[r.iDataSort]),Pt(a,r,"aDataSort"));var u=a.mData,d=k(u),f=a.mRender?k(a.mRender):null,p=function(t){return"string"==typeof t&&-1!==t.indexOf("@")};a._bAttrSrc=t.isPlainObject(u)&&(p(u.sort)||p(u.type)||p(u.filter)),a._setter=null,a.fnGetData=function(t,e,i){var r=d(t,e,n,i);return f&&e?f(r,e,t,i):r},a.fnSetData=function(t,e,i){return T(u)(t,e,i)},"number"!=typeof u&&(e._rowReadObject=!0),e.oFeatures.bSort||(a.bSortable=!1,c.addClass(s.sSortableNone));var g=-1!==t.inArray("asc",a.asSorting),m=-1!==t.inArray("desc",a.asSorting);a.bSortable&&(g||m)?g&&!m?(a.sSortingClass=s.sSortableAsc,a.sSortingClassJUI=s.sSortJUIAscAllowed):!g&&m?(a.sSortingClass=s.sSortableDesc,a.sSortingClassJUI=s.sSortJUIDescAllowed):(a.sSortingClass=s.sSortable,a.sSortingClassJUI=s.sSortJUI):(a.sSortingClass=s.sSortableNone,a.sSortingClassJUI="")}function f(t){if(!1!==t.oFeatures.bAutoWidth){var e=t.aoColumns;gt(t);for(var i=0,n=e.length;i<n;i++)e[i].nTh.style.width=e[i].sWidth}var r=t.oScroll;""===r.sY&&""===r.sX||ft(t),Rt(t,null,"column-sizing",[t])}function p(t,e){var i=v(t,"bVisible");return"number"==typeof i[e]?i[e]:null}function g(e,i){var n=v(e,"bVisible"),r=t.inArray(i,n);return-1!==r?r:null}function m(e){var i=0;return t.each(e.aoColumns,function(e,n){n.bVisible&&"none"!==t(n.nTh).css("display")&&i++}),i}function v(e,i){var n=[];return t.map(e.aoColumns,function(t,e){t[i]&&n.push(e)}),n}function y(t){var e,i,r,o,a,s,l,c,h,u=t.aoColumns,d=t.aoData,f=Yt.ext.type.detect;for(e=0,i=u.length;e<i;e++)if(l=u[e],h=[],!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){for(r=0,o=f.length;r<o;r++){for(a=0,s=d.length;a<s&&(h[a]===n&&(h[a]=w(t,a,e,"type")),(c=f[r](h[a],t))||r===f.length-1)&&"html"!==c;a++);if(c){l.sType=c;break}}l.sType||(l.sType="string")}}function b(e,i,r,o){var a,s,l,c,h,d,f,p=e.aoColumns;if(i)for(a=i.length-1;a>=0;a--){var g=(f=i[a]).targets!==n?f.targets:f.aTargets;for(t.isArray(g)||(g=[g]),l=0,c=g.length;l<c;l++)if("number"==typeof g[l]&&g[l]>=0){for(;p.length<=g[l];)u(e);o(g[l],f)}else if("number"==typeof g[l]&&g[l]<0)o(p.length+g[l],f);else if("string"==typeof g[l])for(h=0,d=p.length;h<d;h++)("_all"==g[l]||t(p[h].nTh).hasClass(g[l]))&&o(h,f)}if(r)for(a=0,s=r.length;a<s;a++)o(a,r[a])}function x(e,i,r,o){var a=e.aoData.length,s=t.extend(!0,{},Yt.models.oRow,{src:r?"dom":"data",idx:a});s._aData=i,e.aoData.push(s);for(var l=e.aoColumns,c=0,h=l.length;c<h;c++)l[c].sType=null;e.aiDisplayMaster.push(a);var u=e.rowIdFn(i);return u!==n&&(e.aIds[u]=s),!r&&e.oFeatures.bDeferRender||L(e,a,r,o),a}function _(e,i){var n;return i instanceof t||(i=t(i)),i.map(function(t,i){return n=P(e,i),x(e,n.data,i,n.cells)})}function w(t,e,i,r){var o=t.iDraw,a=t.aoColumns[i],s=t.aoData[e]._aData,l=a.sDefaultContent,c=a.fnGetData(s,r,{settings:t,row:e,col:i});if(c===n)return t.iDrawError!=o&&null===l&&(Et(t,0,"Requested unknown parameter "+("function"==typeof a.mData?"{function}":"'"+a.mData+"'")+" for row "+e+", column "+i,4),t.iDrawError=o),l;if(c!==s&&null!==c||null===l||r===n){if("function"==typeof c)return c.call(s)}else c=l;return null===c&&"display"==r?"":c}function S(t,e,i,n){var r=t.aoColumns[i],o=t.aoData[e]._aData;r.fnSetData(o,n,{settings:t,row:e,col:i})}function C(e){return t.map(e.match(/(\\.|[^\.])+/g)||[""],function(t){return t.replace(/\\\./g,".")})}function k(e){if(t.isPlainObject(e)){var i={};return t.each(e,function(t,e){e&&(i[t]=k(e))}),function(t,e,r,o){var a=i[e]||i._;return a!==n?a(t,e,r,o):t}}if(null===e)return function(t){return t};if("function"==typeof e)return function(t,i,n,r){return e(t,i,n,r)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,i){return t[e]};var r=function(e,i,o){var a,s,l,c;if(""!==o)for(var h=C(o),u=0,d=h.length;u<d;u++){if(a=h[u].match(fe),s=h[u].match(pe),a){if(h[u]=h[u].replace(fe,""),""!==h[u]&&(e=e[h[u]]),l=[],h.splice(0,u+1),c=h.join("."),t.isArray(e))for(var f=0,p=e.length;f<p;f++)l.push(r(e[f],i,c));var g=a[0].substring(1,a[0].length-1);e=""===g?l:l.join(g);break}if(s)h[u]=h[u].replace(pe,""),e=e[h[u]]();else{if(null===e||e[h[u]]===n)return n;e=e[h[u]]}}return e};return function(t,i){return r(t,i,e)}}function T(e){if(t.isPlainObject(e))return T(e._);if(null===e)return function(){};if("function"==typeof e)return function(t,i,n){e(t,"set",i,n)};if("string"!=typeof e||-1===e.indexOf(".")&&-1===e.indexOf("[")&&-1===e.indexOf("("))return function(t,i){t[e]=i};var i=function(e,r,o){for(var a,s,l,c,h,u=C(o),d=u[u.length-1],f=0,p=u.length-1;f<p;f++){if(s=u[f].match(fe),l=u[f].match(pe),s){if(u[f]=u[f].replace(fe,""),e[u[f]]=[],(a=u.slice()).splice(0,f+1),h=a.join("."),t.isArray(r))for(var g=0,m=r.length;g<m;g++)i(c={},r[g],h),e[u[f]].push(c);else e[u[f]]=r;return}l&&(u[f]=u[f].replace(pe,""),e=e[u[f]](r)),null!==e[u[f]]&&e[u[f]]!==n||(e[u[f]]={}),e=e[u[f]]}d.match(pe)?e=e[d.replace(pe,"")](r):e[d.replace(fe,"")]=r};return function(t,n){return i(t,n,e)}}function A(t){return oe(t.aoData,"_aData")}function D(t){t.aoData.length=0,t.aiDisplayMaster.length=0,t.aiDisplay.length=0,t.aIds={}}function M(t,e,i){for(var r=-1,o=0,a=t.length;o<a;o++)t[o]==e?r=o:t[o]>e&&t[o]--;-1!=r&&i===n&&t.splice(r,1)}function E(t,e,i,r){var o,a,s=t.aoData[e],l=function(i,n){for(;i.childNodes.length;)i.removeChild(i.firstChild);i.innerHTML=w(t,e,n,"display")};if("dom"!==i&&(i&&"auto"!==i||"dom"!==s.src)){var c=s.anCells;if(c)if(r!==n)l(c[r],r);else for(o=0,a=c.length;o<a;o++)l(c[o],o)}else s._aData=P(t,s,r,r===n?n:s._aData).data;s._aSortData=null,s._aFilterData=null;var h=t.aoColumns;if(r!==n)h[r].sType=null;else{for(o=0,a=h.length;o<a;o++)h[o].sType=null;I(t,s)}}function P(e,i,r,o){var a,s,l,c=[],h=i.firstChild,u=0,d=e.aoColumns,f=e._rowReadObject;o=o!==n?o:f?{}:[];var p=function(t,e){if("string"==typeof t){var i=t.indexOf("@");if(-1!==i){var n=t.substring(i+1);T(t)(o,e.getAttribute(n))}}},g=function(e){r!==n&&r!==u||(s=d[u],l=t.trim(e.innerHTML),s&&s._bAttrSrc?(T(s.mData._)(o,l),p(s.mData.sort,e),p(s.mData.type,e),p(s.mData.filter,e)):f?(s._setter||(s._setter=T(s.mData)),s._setter(o,l)):o[u]=l),u++};if(h)for(;h;)"TD"!=(a=h.nodeName.toUpperCase())&&"TH"!=a||(g(h),c.push(h)),h=h.nextSibling;else for(var m=0,v=(c=i.anCells).length;m<v;m++)g(c[m]);var y=i.firstChild?i:i.nTr;if(y){var b=y.getAttribute("id");b&&T(e.rowId)(o,b)}return{data:o,cells:c}}function L(e,n,r,o){var a,s,l,c,h,u=e.aoData[n],d=u._aData,f=[];if(null===u.nTr){for(a=r||i.createElement("tr"),u.nTr=a,u.anCells=f,a._DT_RowIndex=n,I(e,u),c=0,h=e.aoColumns.length;c<h;c++)l=e.aoColumns[c],(s=r?o[c]:i.createElement(l.sCellType))._DT_CellIndex={row:n,column:c},f.push(s),r&&!l.mRender&&l.mData===c||t.isPlainObject(l.mData)&&l.mData._===c+".display"||(s.innerHTML=w(e,n,c,"display")),l.sClass&&(s.className+=" "+l.sClass),l.bVisible&&!r?a.appendChild(s):!l.bVisible&&r&&s.parentNode.removeChild(s),l.fnCreatedCell&&l.fnCreatedCell.call(e.oInstance,s,w(e,n,c),d,n,c);Rt(e,"aoRowCreatedCallback",null,[a,d,n])}u.nTr.setAttribute("role","row")}function I(e,i){var n=i.nTr,r=i._aData;if(n){var o=e.rowIdFn(r);if(o&&(n.id=o),r.DT_RowClass){var a=r.DT_RowClass.split(" ");i.__rowc=i.__rowc?ue(i.__rowc.concat(a)):a,t(n).removeClass(i.__rowc.join(" ")).addClass(r.DT_RowClass)}r.DT_RowAttr&&t(n).attr(r.DT_RowAttr),r.DT_RowData&&t(n).data(r.DT_RowData)}}function O(e){var i,n,r,o,a,s=e.nTHead,l=e.nTFoot,c=0===t("th, td",s).length,h=e.oClasses,u=e.aoColumns;for(c&&(o=t("<tr/>").appendTo(s)),i=0,n=u.length;i<n;i++)a=u[i],r=t(a.nTh).addClass(a.sClass),c&&r.appendTo(o),e.oFeatures.bSort&&(r.addClass(a.sSortingClass),!1!==a.bSortable&&(r.attr("tabindex",e.iTabIndex).attr("aria-controls",e.sTableId),Ct(e,a.nTh,i))),a.sTitle!=r[0].innerHTML&&r.html(a.sTitle),Ft(e,"header")(e,r,a,h);if(c&&H(e.aoHeader,s),t(s).find(">tr").attr("role","row"),t(s).find(">tr>th, >tr>td").addClass(h.sHeaderTH),t(l).find(">tr>th, >tr>td").addClass(h.sFooterTH),null!==l){var d=e.aoFooter[0];for(i=0,n=d.length;i<n;i++)(a=u[i]).nTf=d[i].cell,a.sClass&&t(a.nTf).addClass(a.sClass)}}function R(e,i,r){var o,a,s,l,c,h,u,d,f,p=[],g=[],m=e.aoColumns.length;if(i){for(r===n&&(r=!1),o=0,a=i.length;o<a;o++){for(p[o]=i[o].slice(),p[o].nTr=i[o].nTr,s=m-1;s>=0;s--)e.aoColumns[s].bVisible||r||p[o].splice(s,1);g.push([])}for(o=0,a=p.length;o<a;o++){if(u=p[o].nTr)for(;h=u.firstChild;)u.removeChild(h);for(s=0,l=p[o].length;s<l;s++)if(d=1,f=1,g[o][s]===n){for(u.appendChild(p[o][s].cell),g[o][s]=1;p[o+d]!==n&&p[o][s].cell==p[o+d][s].cell;)g[o+d][s]=1,d++;for(;p[o][s+f]!==n&&p[o][s].cell==p[o][s+f].cell;){for(c=0;c<d;c++)g[o+c][s+f]=1;f++}t(p[o][s].cell).attr("rowspan",d).attr("colspan",f)}}}}function N(e){var i=Rt(e,"aoPreDrawCallback","preDraw",[e]);if(-1===t.inArray(!1,i)){var r=[],o=0,a=e.asStripeClasses,s=a.length,l=(e.aoOpenRows.length,e.oLanguage),c=e.iInitDisplayStart,h="ssp"==zt(e),u=e.aiDisplay;e.bDrawing=!0,c!==n&&-1!==c&&(e._iDisplayStart=h?c:c>=e.fnRecordsDisplay()?0:c,e.iInitDisplayStart=-1);var d=e._iDisplayStart,f=e.fnDisplayEnd();if(e.bDeferLoading)e.bDeferLoading=!1,e.iDraw++,ut(e,!1);else if(h){if(!e.bDestroying&&!B(e))return}else e.iDraw++;if(0!==u.length)for(var p=h?0:d,g=h?e.aoData.length:f,v=p;v<g;v++){var y=u[v],b=e.aoData[y];null===b.nTr&&L(e,y);var x=b.nTr;if(0!==s){var _=a[o%s];b._sRowStripe!=_&&(t(x).removeClass(b._sRowStripe).addClass(_),b._sRowStripe=_)}Rt(e,"aoRowCallback",null,[x,b._aData,o,v]),r.push(x),o++}else{var w=l.sZeroRecords;1==e.iDraw&&"ajax"==zt(e)?w=l.sLoadingRecords:l.sEmptyTable&&0===e.fnRecordsTotal()&&(w=l.sEmptyTable),r[0]=t("<tr/>",{class:s?a[0]:""}).append(t("<td />",{valign:"top",colSpan:m(e),class:e.oClasses.sRowEmpty}).html(w))[0]}Rt(e,"aoHeaderCallback","header",[t(e.nTHead).children("tr")[0],A(e),d,f,u]),Rt(e,"aoFooterCallback","footer",[t(e.nTFoot).children("tr")[0],A(e),d,f,u]);var S=t(e.nTBody);S.children().detach(),S.append(t(r)),Rt(e,"aoDrawCallback","draw",[e]),e.bSorted=!1,e.bFiltered=!1,e.bDrawing=!1}else ut(e,!1)}function F(t,e){var i=t.oFeatures,n=i.bSort,r=i.bFilter;n&&_t(t),r?G(t,t.oPreviousSearch):t.aiDisplay=t.aiDisplayMaster.slice(),!0!==e&&(t._iDisplayStart=0),t._drawHold=e,N(t),t._drawHold=!1}function z(e){var i=e.oClasses,n=t(e.nTable),r=t("<div/>").insertBefore(n),o=e.oFeatures,a=t("<div/>",{id:e.sTableId+"_wrapper",class:i.sWrapper+(e.nTFoot?"":" "+i.sNoFooter)});e.nHolding=r[0],e.nTableWrapper=a[0],e.nTableReinsertBefore=e.nTable.nextSibling;for(var s,l,c,h,u,d,f=e.sDom.split(""),p=0;p<f.length;p++){if(s=null,"<"==(l=f[p])){if(c=t("<div/>")[0],"'"==(h=f[p+1])||'"'==h){for(u="",d=2;f[p+d]!=h;)u+=f[p+d],d++;if("H"==u?u=i.sJUIHeader:"F"==u&&(u=i.sJUIFooter),-1!=u.indexOf(".")){var g=u.split(".");c.id=g[0].substr(1,g[0].length-1),c.className=g[1]}else"#"==u.charAt(0)?c.id=u.substr(1,u.length-1):c.className=u;p+=d}a.append(c),a=t(c)}else if(">"==l)a=a.parent();else if("l"==l&&o.bPaginate&&o.bLengthChange)s=st(e);else if("f"==l&&o.bFilter)s=Y(e);else if("r"==l&&o.bProcessing)s=ht(e);else if("t"==l)s=dt(e);else if("i"==l&&o.bInfo)s=et(e);else if("p"==l&&o.bPaginate)s=lt(e);else if(0!==Yt.ext.feature.length)for(var m=Yt.ext.feature,v=0,y=m.length;v<y;v++)if(l==m[v].cFeature){s=m[v].fnInit(e);break}if(s){var b=e.aanFeatures;b[l]||(b[l]=[]),b[l].push(s),a.append(s)}}r.replaceWith(a),e.nHolding=null}function H(e,i){var n,r,o,a,s,l,c,h,u,d,f,p=t(i).children("tr");for(e.splice(0,e.length),o=0,l=p.length;o<l;o++)e.push([]);for(o=0,l=p.length;o<l;o++)for(h=0,r=(n=p[o]).firstChild;r;){if("TD"==r.nodeName.toUpperCase()||"TH"==r.nodeName.toUpperCase())for(u=1*r.getAttribute("colspan"),d=1*r.getAttribute("rowspan"),u=u&&0!==u&&1!==u?u:1,d=d&&0!==d&&1!==d?d:1,c=function(t,e,i){for(var n=t[e];n[i];)i++;return i}(e,o,h),f=1===u,s=0;s<u;s++)for(a=0;a<d;a++)e[o+a][c+s]={cell:r,unique:f},e[o+a].nTr=n;r=r.nextSibling}}function $(t,e,i){var n=[];i||(i=t.aoHeader,e&&H(i=[],e));for(var r=0,o=i.length;r<o;r++)for(var a=0,s=i[r].length;a<s;a++)!i[r][a].unique||n[a]&&t.bSortCellsTop||(n[a]=i[r][a].cell);return n}function V(e,i,n){if(Rt(e,"aoServerParams","serverParams",[i]),i&&t.isArray(i)){var r={},o=/(.*?)\[\]$/;t.each(i,function(t,e){var i=e.name.match(o);if(i){var n=i[0];r[n]||(r[n]=[]),r[n].push(e.value)}else r[e.name]=e.value}),i=r}var a,s=e.ajax,l=e.oInstance,c=function(t){Rt(e,null,"xhr",[e,t,e.jqXHR]),n(t)};if(t.isPlainObject(s)&&s.data){a=s.data;var h=t.isFunction(a)?a(i,e):a;i=t.isFunction(a)&&h?h:t.extend(!0,i,h),delete s.data}var u={data:i,success:function(t){var i=t.error||t.sError;i&&Et(e,0,i),e.json=t,c(t)},dataType:"json",cache:!1,type:e.sServerMethod,error:function(i,n,r){var o=Rt(e,null,"xhr",[e,null,e.jqXHR]);-1===t.inArray(!0,o)&&("parsererror"==n?Et(e,0,"Invalid JSON response",1):4===i.readyState&&Et(e,0,"Ajax error",7)),ut(e,!1)}};e.oAjaxData=i,Rt(e,null,"preXhr",[e,i]),e.fnServerData?e.fnServerData.call(l,e.sAjaxSource,t.map(i,function(t,e){return{name:e,value:t}}),c,e):e.sAjaxSource||"string"==typeof s?e.jqXHR=t.ajax(t.extend(u,{url:s||e.sAjaxSource})):t.isFunction(s)?e.jqXHR=s.call(l,i,c,e):(e.jqXHR=t.ajax(t.extend(u,s)),s.data=a)}function B(t){return!t.bAjaxDataGet||(t.iDraw++,ut(t,!0),V(t,W(t),function(e){j(t,e)}),!1)}function W(e){var i,n,r,o,a=e.aoColumns,s=a.length,l=e.oFeatures,c=e.oPreviousSearch,h=e.aoPreSearchCols,u=[],d=xt(e),f=e._iDisplayStart,p=!1!==l.bPaginate?e._iDisplayLength:-1,g=function(t,e){u.push({name:t,value:e})};g("sEcho",e.iDraw),g("iColumns",s),g("sColumns",oe(a,"sName").join(",")),g("iDisplayStart",f),g("iDisplayLength",p);var m={draw:e.iDraw,columns:[],order:[],start:f,length:p,search:{value:c.sSearch,regex:c.bRegex}};for(i=0;i<s;i++)r=a[i],o=h[i],n="function"==typeof r.mData?"function":r.mData,m.columns.push({data:n,name:r.sName,searchable:r.bSearchable,orderable:r.bSortable,search:{value:o.sSearch,regex:o.bRegex}}),g("mDataProp_"+i,n),l.bFilter&&(g("sSearch_"+i,o.sSearch),g("bRegex_"+i,o.bRegex),g("bSearchable_"+i,r.bSearchable)),l.bSort&&g("bSortable_"+i,r.bSortable);l.bFilter&&(g("sSearch",c.sSearch),g("bRegex",c.bRegex)),l.bSort&&(t.each(d,function(t,e){m.order.push({column:e.col,dir:e.dir}),g("iSortCol_"+t,e.col),g("sSortDir_"+t,e.dir)}),g("iSortingCols",d.length));var v=Yt.ext.legacy.ajax;return null===v?e.sAjaxSource?u:m:v?u:m}function j(t,e){var i=function(t,i){return e[t]!==n?e[t]:e[i]},r=U(t,e),o=i("sEcho","draw"),a=i("iTotalRecords","recordsTotal"),s=i("iTotalDisplayRecords","recordsFiltered");if(o){if(1*o<t.iDraw)return;t.iDraw=1*o}D(t),t._iRecordsTotal=parseInt(a,10),t._iRecordsDisplay=parseInt(s,10);for(var l=0,c=r.length;l<c;l++)x(t,r[l]);t.aiDisplay=t.aiDisplayMaster.slice(),t.bAjaxDataGet=!1,N(t),t._bInitComplete||ot(t,e),t.bAjaxDataGet=!0,ut(t,!1)}function U(e,i){var r=t.isPlainObject(e.ajax)&&e.ajax.dataSrc!==n?e.ajax.dataSrc:e.sAjaxDataProp;return"data"===r?i.aaData||i[r]:""!==r?k(r)(i):i}function Y(e){var n=e.oClasses,r=e.sTableId,o=e.oLanguage,a=e.oPreviousSearch,s=e.aanFeatures,l='<input type="search" class="'+n.sFilterInput+'"/>',c=o.sSearch;c=c.match(/_INPUT_/)?c.replace("_INPUT_",l):c+l;var h=t("<div/>",{id:s.f?null:r+"_filter",class:n.sFilter}).append(t("<label/>").append(c)),u=function(){s.f;var t=this.value?this.value:"";t!=a.sSearch&&(G(e,{sSearch:t,bRegex:a.bRegex,bSmart:a.bSmart,bCaseInsensitive:a.bCaseInsensitive}),e._iDisplayStart=0,N(e))},d=null!==e.searchDelay?e.searchDelay:"ssp"===zt(e)?400:0,f=t("input",h).val(a.sSearch).attr("placeholder",o.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",d?be(u,d):u).on("keypress.DT",function(t){if(13==t.keyCode)return!1}).attr("aria-controls",r);return t(e.nTable).on("search.dt.DT",function(t,n){if(e===n)try{f[0]!==i.activeElement&&f.val(a.sSearch)}catch(t){}}),h[0]}function G(t,e,i){var r=t.oPreviousSearch,o=t.aoPreSearchCols,a=function(t){r.sSearch=t.sSearch,r.bRegex=t.bRegex,r.bSmart=t.bSmart,r.bCaseInsensitive=t.bCaseInsensitive},s=function(t){return t.bEscapeRegex!==n?!t.bEscapeRegex:t.bRegex};if(y(t),"ssp"!=zt(t)){K(t,e.sSearch,i,s(e),e.bSmart,e.bCaseInsensitive),a(e);for(var l=0;l<o.length;l++)X(t,o[l].sSearch,l,s(o[l]),o[l].bSmart,o[l].bCaseInsensitive);q(t)}else a(e);t.bFiltered=!0,Rt(t,null,"search",[t])}function q(e){for(var i,n,r=Yt.ext.search,o=e.aiDisplay,a=0,s=r.length;a<s;a++){for(var l=[],c=0,h=o.length;c<h;c++)n=o[c],i=e.aoData[n],r[a](e,i._aFilterData,n,i._aData,c)&&l.push(n);o.length=0,t.merge(o,l)}}function X(t,e,i,n,r,o){if(""!==e){for(var a,s=[],l=t.aiDisplay,c=Z(e,n,r,o),h=0;h<l.length;h++)a=t.aoData[l[h]]._aFilterData[i],c.test(a)&&s.push(l[h]);t.aiDisplay=s}}function K(t,e,i,n,r,o){var a,s,l,c=Z(e,n,r,o),h=t.oPreviousSearch.sSearch,u=t.aiDisplayMaster,d=[];if(0!==Yt.ext.search.length&&(i=!0),s=Q(t),e.length<=0)t.aiDisplay=u.slice();else{for((s||i||h.length>e.length||0!==e.indexOf(h)||t.bSorted)&&(t.aiDisplay=u.slice()),a=t.aiDisplay,l=0;l<a.length;l++)c.test(t.aoData[a[l]]._sFilterRow)&&d.push(a[l]);t.aiDisplay=d}}function Z(e,i,n,r){return e=i?e:ge(e),n&&(e="^(?=.*?"+t.map(e.match(/"[^"]+"|[^ ]+/g)||[""],function(t){if('"'===t.charAt(0)){var e=t.match(/^"(.*)"$/);t=e?e[1]:t}return t.replace('"',"")}).join(")(?=.*?")+").*$"),new RegExp(e,r?"i":"")}function Q(t){var e,i,n,r,o,a,s,l,c=t.aoColumns,h=Yt.ext.type.search,u=!1;for(i=0,r=t.aoData.length;i<r;i++)if(!(l=t.aoData[i])._aFilterData){for(a=[],n=0,o=c.length;n<o;n++)(e=c[n]).bSearchable?(s=w(t,i,n,"filter"),h[e.sType]&&(s=h[e.sType](s)),null===s&&(s=""),"string"!=typeof s&&s.toString&&(s=s.toString())):s="",s.indexOf&&-1!==s.indexOf("&")&&(me.innerHTML=s,s=ve?me.textContent:me.innerText),s.replace&&(s=s.replace(/[\r\n]/g,"")),a.push(s);l._aFilterData=a,l._sFilterRow=a.join(" "),u=!0}return u}function J(t){return{search:t.sSearch,smart:t.bSmart,regex:t.bRegex,caseInsensitive:t.bCaseInsensitive}}function tt(t){return{sSearch:t.search,bSmart:t.smart,bRegex:t.regex,bCaseInsensitive:t.caseInsensitive}}function et(e){var i=e.sTableId,n=e.aanFeatures.i,r=t("<div/>",{class:e.oClasses.sInfo,id:n?null:i+"_info"});return n||(e.aoDrawCallback.push({fn:it,sName:"information"}),r.attr("role","status").attr("aria-live","polite"),t(e.nTable).attr("aria-describedby",i+"_info")),r[0]}function it(e){var i=e.aanFeatures.i;if(0!==i.length){var n=e.oLanguage,r=e._iDisplayStart+1,o=e.fnDisplayEnd(),a=e.fnRecordsTotal(),s=e.fnRecordsDisplay(),l=s?n.sInfo:n.sInfoEmpty;s!==a&&(l+=" "+n.sInfoFiltered),l=nt(e,l+=n.sInfoPostFix);var c=n.fnInfoCallback;null!==c&&(l=c.call(e.oInstance,e,r,o,a,s,l)),t(i).html(l)}}function nt(t,e){var i=t.fnFormatNumber,n=t._iDisplayStart+1,r=t._iDisplayLength,o=t.fnRecordsDisplay(),a=-1===r;return e.replace(/_START_/g,i.call(t,n)).replace(/_END_/g,i.call(t,t.fnDisplayEnd())).replace(/_MAX_/g,i.call(t,t.fnRecordsTotal())).replace(/_TOTAL_/g,i.call(t,o)).replace(/_PAGE_/g,i.call(t,a?1:Math.ceil(n/r))).replace(/_PAGES_/g,i.call(t,a?1:Math.ceil(o/r)))}function rt(t){var e,i,n,r=t.iInitDisplayStart,o=t.aoColumns,a=t.oFeatures,s=t.bDeferLoading;if(t.bInitialised){for(z(t),O(t),R(t,t.aoHeader),R(t,t.aoFooter),ut(t,!0),a.bAutoWidth&>(t),e=0,i=o.length;e<i;e++)(n=o[e]).sWidth&&(n.nTh.style.width=bt(n.sWidth));Rt(t,null,"preInit",[t]),F(t);var l=zt(t);("ssp"!=l||s)&&("ajax"==l?V(t,[],function(i){var n=U(t,i);for(e=0;e<n.length;e++)x(t,n[e]);t.iInitDisplayStart=r,F(t),ut(t,!1),ot(t,i)},t):(ut(t,!1),ot(t)))}else setTimeout(function(){rt(t)},200)}function ot(t,e){t._bInitComplete=!0,(e||t.oInit.aaData)&&f(t),Rt(t,null,"plugin-init",[t,e]),Rt(t,"aoInitComplete","init",[t,e])}function at(t,e){var i=parseInt(e,10);t._iDisplayLength=i,Nt(t),Rt(t,null,"length",[t,i])}function st(e){for(var i=e.oClasses,n=e.sTableId,r=e.aLengthMenu,o=t.isArray(r[0]),a=o?r[0]:r,s=o?r[1]:r,l=t("<select/>",{name:n+"_length","aria-controls":n,class:i.sLengthSelect}),c=0,h=a.length;c<h;c++)l[0][c]=new Option("number"==typeof s[c]?e.fnFormatNumber(s[c]):s[c],a[c]);var u=t("<div><label/></div>").addClass(i.sLength);return e.aanFeatures.l||(u[0].id=n+"_length"),u.children().append(e.oLanguage.sLengthMenu.replace("_MENU_",l[0].outerHTML)),t("select",u).val(e._iDisplayLength).on("change.DT",function(i){at(e,t(this).val()),N(e)}),t(e.nTable).on("length.dt.DT",function(i,n,r){e===n&&t("select",u).val(r)}),u[0]}function lt(e){var i=e.sPaginationType,n=Yt.ext.pager[i],r="function"==typeof n,o=function(t){N(t)},a=t("<div/>").addClass(e.oClasses.sPaging+i)[0],s=e.aanFeatures;return r||n.fnInit(e,a,o),s.p||(a.id=e.sTableId+"_paginate",e.aoDrawCallback.push({fn:function(t){if(r){var e,i,a=t._iDisplayStart,l=t._iDisplayLength,c=t.fnRecordsDisplay(),h=-1===l,u=h?0:Math.ceil(a/l),d=h?1:Math.ceil(c/l),f=n(u,d);for(e=0,i=s.p.length;e<i;e++)Ft(t,"pageButton")(t,s.p[e],e,f,u,d)}else n.fnUpdate(t,o)},sName:"pagination"})),a}function ct(t,e,i){var n=t._iDisplayStart,r=t._iDisplayLength,o=t.fnRecordsDisplay();0===o||-1===r?n=0:"number"==typeof e?(n=e*r)>o&&(n=0):"first"==e?n=0:"previous"==e?(n=r>=0?n-r:0)<0&&(n=0):"next"==e?n+r<o&&(n+=r):"last"==e?n=Math.floor((o-1)/r)*r:Et(t,0,"Unknown paging action: "+e,5);var a=t._iDisplayStart!==n;return t._iDisplayStart=n,a&&(Rt(t,null,"page",[t]),i&&N(t)),a}function ht(e){return t("<div/>",{id:e.aanFeatures.r?null:e.sTableId+"_processing",class:e.oClasses.sProcessing}).html(e.oLanguage.sProcessing).insertBefore(e.nTable)[0]}function ut(e,i){e.oFeatures.bProcessing&&t(e.aanFeatures.r).css("display",i?"block":"none"),Rt(e,null,"processing",[e,i])}function dt(e){var i=t(e.nTable);i.attr("role","grid");var n=e.oScroll;if(""===n.sX&&""===n.sY)return e.nTable;var r=n.sX,o=n.sY,a=e.oClasses,s=i.children("caption"),l=s.length?s[0]._captionSide:null,c=t(i[0].cloneNode(!1)),h=t(i[0].cloneNode(!1)),u=i.children("tfoot"),d="<div/>",f=function(t){return t?bt(t):null};u.length||(u=null);var p=t(d,{class:a.sScrollWrapper}).append(t(d,{class:a.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:r?f(r):"100%"}).append(t(d,{class:a.sScrollHeadInner}).css({"box-sizing":"content-box",width:n.sXInner||"100%"}).append(c.removeAttr("id").css("margin-left",0).append("top"===l?s:null).append(i.children("thead"))))).append(t(d,{class:a.sScrollBody}).css({position:"relative",overflow:"auto",width:f(r)}).append(i));u&&p.append(t(d,{class:a.sScrollFoot}).css({overflow:"hidden",border:0,width:r?f(r):"100%"}).append(t(d,{class:a.sScrollFootInner}).append(h.removeAttr("id").css("margin-left",0).append("bottom"===l?s:null).append(i.children("tfoot")))));var g=p.children(),m=g[0],v=g[1],y=u?g[2]:null;return r&&t(v).on("scroll.DT",function(t){var e=this.scrollLeft;m.scrollLeft=e,u&&(y.scrollLeft=e)}),t(v).css(o&&n.bCollapse?"max-height":"height",o),e.nScrollHead=m,e.nScrollBody=v,e.nScrollFoot=y,e.aoDrawCallback.push({fn:ft,sName:"scrolling"}),p[0]}function ft(e){var i,r,o,a,s,l,c,h,u,d=e.oScroll,g=d.sX,m=d.sXInner,v=d.sY,y=d.iBarWidth,b=t(e.nScrollHead),x=b[0].style,_=b.children("div"),w=_[0].style,S=_.children("table"),C=e.nScrollBody,k=t(C),T=C.style,A=t(e.nScrollFoot).children("div"),D=A.children("table"),M=t(e.nTHead),E=t(e.nTable),P=E[0],L=P.style,I=e.nTFoot?t(e.nTFoot):null,O=e.oBrowser,R=O.bScrollOversize,N=oe(e.aoColumns,"nTh"),F=[],z=[],H=[],V=[],B=function(t){var e=t.style;e.paddingTop="0",e.paddingBottom="0",e.borderTopWidth="0",e.borderBottomWidth="0",e.height=0},W=C.scrollHeight>C.clientHeight;if(e.scrollBarVis!==W&&e.scrollBarVis!==n)return e.scrollBarVis=W,void f(e);e.scrollBarVis=W,E.children("thead, tfoot").remove(),I&&(l=I.clone().prependTo(E),r=I.find("tr"),a=l.find("tr")),s=M.clone().prependTo(E),i=M.find("tr"),o=s.find("tr"),s.find("th, td").removeAttr("tabindex"),g||(T.width="100%",b[0].style.width="100%"),t.each($(e,s),function(t,i){c=p(e,t),i.style.width=e.aoColumns[c].sWidth}),I&&pt(function(t){t.style.width=""},a),u=E.outerWidth(),""===g?(L.width="100%",R&&(E.find("tbody").height()>C.offsetHeight||"scroll"==k.css("overflow-y"))&&(L.width=bt(E.outerWidth()-y)),u=E.outerWidth()):""!==m&&(L.width=bt(m),u=E.outerWidth()),pt(B,o),pt(function(e){H.push(e.innerHTML),F.push(bt(t(e).css("width")))},o),pt(function(e,i){-1!==t.inArray(e,N)&&(e.style.width=F[i])},i),t(o).height(0),I&&(pt(B,a),pt(function(e){V.push(e.innerHTML),z.push(bt(t(e).css("width")))},a),pt(function(t,e){t.style.width=z[e]},r),t(a).height(0)),pt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+H[e]+"</div>",t.style.width=F[e]},o),I&&pt(function(t,e){t.innerHTML='<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+V[e]+"</div>",t.style.width=z[e]},a),E.outerWidth()<u?(h=C.scrollHeight>C.offsetHeight||"scroll"==k.css("overflow-y")?u+y:u,R&&(C.scrollHeight>C.offsetHeight||"scroll"==k.css("overflow-y"))&&(L.width=bt(h-y)),""!==g&&""===m||Et(e,1,"Possible column misalignment",6)):h="100%",T.width=bt(h),x.width=bt(h),I&&(e.nScrollFoot.style.width=bt(h)),v||R&&(T.height=bt(P.offsetHeight+y));var j=E.outerWidth();S[0].style.width=bt(j),w.width=bt(j);var U=E.height()>C.clientHeight||"scroll"==k.css("overflow-y"),Y="padding"+(O.bScrollbarLeft?"Left":"Right");w[Y]=U?y+"px":"0px",I&&(D[0].style.width=bt(j),A[0].style.width=bt(j),A[0].style[Y]=U?y+"px":"0px"),E.children("colgroup").insertBefore(E.children("thead")),k.scroll(),!e.bSorted&&!e.bFiltered||e._drawHold||(C.scrollTop=0)}function pt(t,e,i){for(var n,r,o=0,a=0,s=e.length;a<s;){for(n=e[a].firstChild,r=i?i[a].firstChild:null;n;)1===n.nodeType&&(i?t(n,r,o):t(n,o),o++),n=n.nextSibling,r=i?r.nextSibling:null;a++}}function gt(i){var n,r,o,a=i.nTable,s=i.aoColumns,l=i.oScroll,c=l.sY,h=l.sX,u=l.sXInner,d=s.length,g=v(i,"bVisible"),y=t("th",i.nTHead),b=a.getAttribute("width"),x=a.parentNode,_=!1,w=i.oBrowser,S=w.bScrollOversize,C=a.style.width;for(C&&-1!==C.indexOf("%")&&(b=C),n=0;n<g.length;n++)null!==(r=s[g[n]]).sWidth&&(r.sWidth=mt(r.sWidthOrig,x),_=!0);if(S||!_&&!h&&!c&&d==m(i)&&d==y.length)for(n=0;n<d;n++){var k=p(i,n);null!==k&&(s[k].sWidth=bt(y.eq(n).width()))}else{var T=t(a).clone().css("visibility","hidden").removeAttr("id");T.find("tbody tr").remove();var A=t("<tr/>").appendTo(T.find("tbody"));for(T.find("thead, tfoot").remove(),T.append(t(i.nTHead).clone()).append(t(i.nTFoot).clone()),T.find("tfoot th, tfoot td").css("width",""),y=$(i,T.find("thead")[0]),n=0;n<g.length;n++)r=s[g[n]],y[n].style.width=null!==r.sWidthOrig&&""!==r.sWidthOrig?bt(r.sWidthOrig):"",r.sWidthOrig&&h&&t(y[n]).append(t("<div/>").css({width:r.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(i.aoData.length)for(n=0;n<g.length;n++)r=s[o=g[n]],t(vt(i,o)).clone(!1).append(r.sContentPadding).appendTo(A);t("[name]",T).removeAttr("name");var D=t("<div/>").css(h||c?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(T).appendTo(x);h&&u?T.width(u):h?(T.css("width","auto"),T.removeAttr("width"),T.width()<x.clientWidth&&b&&T.width(x.clientWidth)):c?T.width(x.clientWidth):b&&T.width(b);var M=0;for(n=0;n<g.length;n++){var E=t(y[n]),P=E.outerWidth()-E.width(),L=w.bBounding?Math.ceil(y[n].getBoundingClientRect().width):E.outerWidth();M+=L,s[g[n]].sWidth=bt(L-P)}a.style.width=bt(M),D.remove()}if(b&&(a.style.width=bt(b)),(b||h)&&!i._reszEvt){var I=function(){t(e).on("resize.DT-"+i.sInstance,be(function(){f(i)}))};S?setTimeout(I,1e3):I(),i._reszEvt=!0}}function mt(e,n){if(!e)return 0;var r=t("<div/>").css("width",bt(e)).appendTo(n||i.body),o=r[0].offsetWidth;return r.remove(),o}function vt(e,i){var n=yt(e,i);if(n<0)return null;var r=e.aoData[n];return r.nTr?r.anCells[i]:t("<td/>").html(w(e,n,i,"display"))[0]}function yt(t,e){for(var i,n=-1,r=-1,o=0,a=t.aoData.length;o<a;o++)(i=(i=(i=w(t,o,e,"display")+"").replace(ye,"")).replace(/ /g," ")).length>n&&(n=i.length,r=o);return r}function bt(t){return null===t?"0px":"number"==typeof t?t<0?"0px":t+"px":t.match(/\d$/)?t+"px":t}function xt(e){var i,r,o,a,s,l,c,h=[],u=e.aoColumns,d=e.aaSortingFixed,f=t.isPlainObject(d),p=[],g=function(e){e.length&&!t.isArray(e[0])?p.push(e):t.merge(p,e)};for(t.isArray(d)&&g(d),f&&d.pre&&g(d.pre),g(e.aaSorting),f&&d.post&&g(d.post),i=0;i<p.length;i++)for(r=0,o=(a=u[c=p[i][0]].aDataSort).length;r<o;r++)l=u[s=a[r]].sType||"string",p[i]._idx===n&&(p[i]._idx=t.inArray(p[i][1],u[s].asSorting)),h.push({src:c,col:s,dir:p[i][1],index:p[i]._idx,type:l,formatter:Yt.ext.type.order[l+"-pre"]});return h}function _t(t){var e,i,n,r,o,a=[],s=Yt.ext.type.order,l=t.aoData,c=(t.aoColumns,0),h=t.aiDisplayMaster;for(y(t),e=0,i=(o=xt(t)).length;e<i;e++)(r=o[e]).formatter&&c++,Tt(t,r.col);if("ssp"!=zt(t)&&0!==o.length){for(e=0,n=h.length;e<n;e++)a[h[e]]=e;c===o.length?h.sort(function(t,e){var i,n,r,s,c,h=o.length,u=l[t]._aSortData,d=l[e]._aSortData;for(r=0;r<h;r++)if(c=o[r],i=u[c.col],n=d[c.col],0!==(s=i<n?-1:i>n?1:0))return"asc"===c.dir?s:-s;return i=a[t],n=a[e],i<n?-1:i>n?1:0}):h.sort(function(t,e){var i,n,r,c,h,u,d=o.length,f=l[t]._aSortData,p=l[e]._aSortData;for(r=0;r<d;r++)if(h=o[r],i=f[h.col],n=p[h.col],u=s[h.type+"-"+h.dir]||s["string-"+h.dir],0!==(c=u(i,n)))return c;return i=a[t],n=a[e],i<n?-1:i>n?1:0})}t.bSorted=!0}function wt(t){for(var e,i,n=t.aoColumns,r=xt(t),o=t.oLanguage.oAria,a=0,s=n.length;a<s;a++){var l=n[a],c=l.asSorting,h=l.sTitle.replace(/<.*?>/g,""),u=l.nTh;u.removeAttribute("aria-sort"),l.bSortable?(r.length>0&&r[0].col==a?(u.setAttribute("aria-sort","asc"==r[0].dir?"ascending":"descending"),i=c[r[0].index+1]||c[0]):i=c[0],e=h+("asc"===i?o.sSortAscending:o.sSortDescending)):e=h,u.setAttribute("aria-label",e)}}function St(e,i,r,o){var a,s=e.aoColumns[i],l=e.aaSorting,c=s.asSorting,h=function(e,i){var r=e._idx;return r===n&&(r=t.inArray(e[1],c)),r+1<c.length?r+1:i?null:0};if("number"==typeof l[0]&&(l=e.aaSorting=[l]),r&&e.oFeatures.bSortMulti){var u=t.inArray(i,oe(l,"0"));-1!==u?(null===(a=h(l[u],!0))&&1===l.length&&(a=0),null===a?l.splice(u,1):(l[u][1]=c[a],l[u]._idx=a)):(l.push([i,c[0],0]),l[l.length-1]._idx=0)}else l.length&&l[0][0]==i?(a=h(l[0]),l.length=1,l[0][1]=c[a],l[0]._idx=a):(l.length=0,l.push([i,c[0]]),l[0]._idx=0);F(e),"function"==typeof o&&o(e)}function Ct(t,e,i,n){var r=t.aoColumns[i];It(e,{},function(e){!1!==r.bSortable&&(t.oFeatures.bProcessing?(ut(t,!0),setTimeout(function(){St(t,i,e.shiftKey,n),"ssp"!==zt(t)&&ut(t,!1)},0)):St(t,i,e.shiftKey,n))})}function kt(e){var i,n,r,o=e.aLastSort,a=e.oClasses.sSortColumn,s=xt(e),l=e.oFeatures;if(l.bSort&&l.bSortClasses){for(i=0,n=o.length;i<n;i++)r=o[i].src,t(oe(e.aoData,"anCells",r)).removeClass(a+(i<2?i+1:3));for(i=0,n=s.length;i<n;i++)r=s[i].src,t(oe(e.aoData,"anCells",r)).addClass(a+(i<2?i+1:3))}e.aLastSort=s}function Tt(t,e){var i,n=t.aoColumns[e],r=Yt.ext.order[n.sSortDataType];r&&(i=r.call(t.oInstance,t,e,g(t,e)));for(var o,a,s=Yt.ext.type.order[n.sType+"-pre"],l=0,c=t.aoData.length;l<c;l++)(o=t.aoData[l])._aSortData||(o._aSortData=[]),o._aSortData[e]&&!r||(a=r?i[l]:w(t,l,e,"sort"),o._aSortData[e]=s?s(a):a)}function At(e){if(e.oFeatures.bStateSave&&!e.bDestroying){var i={time:+new Date,start:e._iDisplayStart,length:e._iDisplayLength,order:t.extend(!0,[],e.aaSorting),search:J(e.oPreviousSearch),columns:t.map(e.aoColumns,function(t,i){return{visible:t.bVisible,search:J(e.aoPreSearchCols[i])}})};Rt(e,"aoStateSaveParams","stateSaveParams",[e,i]),e.oSavedState=i,e.fnStateSaveCallback.call(e.oInstance,e,i)}}function Dt(e,i,r){var o,a,s=e.aoColumns,l=function(i){if(i&&i.time){var l=Rt(e,"aoStateLoadParams","stateLoadParams",[e,i]);if(-1===t.inArray(!1,l)){var c=e.iStateDuration;if(c>0&&i.time<+new Date-1e3*c)r();else if(i.columns&&s.length!==i.columns.length)r();else{if(e.oLoadedState=t.extend(!0,{},i),i.start!==n&&(e._iDisplayStart=i.start,e.iInitDisplayStart=i.start),i.length!==n&&(e._iDisplayLength=i.length),i.order!==n&&(e.aaSorting=[],t.each(i.order,function(t,i){e.aaSorting.push(i[0]>=s.length?[0,i[1]]:i)})),i.search!==n&&t.extend(e.oPreviousSearch,tt(i.search)),i.columns)for(o=0,a=i.columns.length;o<a;o++){var h=i.columns[o];h.visible!==n&&(s[o].bVisible=h.visible),h.search!==n&&t.extend(e.aoPreSearchCols[o],tt(h.search))}Rt(e,"aoStateLoaded","stateLoaded",[e,i]),r()}}else r()}else r()};if(e.oFeatures.bStateSave){var c=e.fnStateLoadCallback.call(e.oInstance,e,l);c!==n&&l(c)}else r()}function Mt(e){var i=Yt.settings,n=t.inArray(e,oe(i,"nTable"));return-1!==n?i[n]:null}function Et(t,i,n,r){if(n="DataTables warning: "+(t?"table id="+t.sTableId+" - ":"")+n,r&&(n+=". For more information about this error, please see http://datatables.net/tn/"+r),i)e.console&&console.log&&console.log(n);else{var o=Yt.ext,a=o.sErrMode||o.errMode;if(t&&Rt(t,null,"error",[t,r,n]),"alert"==a)alert(n);else{if("throw"==a)throw new Error(n);"function"==typeof a&&a(t,r,n)}}}function Pt(e,i,r,o){t.isArray(r)?t.each(r,function(n,r){t.isArray(r)?Pt(e,i,r[0],r[1]):Pt(e,i,r)}):(o===n&&(o=r),i[r]!==n&&(e[o]=i[r]))}function Lt(e,i,n){var r;for(var o in i)i.hasOwnProperty(o)&&(r=i[o],t.isPlainObject(r)?(t.isPlainObject(e[o])||(e[o]={}),t.extend(!0,e[o],r)):n&&"data"!==o&&"aaData"!==o&&t.isArray(r)?e[o]=r.slice():e[o]=r);return e}function It(e,i,n){t(e).on("click.DT",i,function(t){e.blur(),n(t)}).on("keypress.DT",i,function(t){13===t.which&&(t.preventDefault(),n(t))}).on("selectstart.DT",function(){return!1})}function Ot(t,e,i,n){i&&t[e].push({fn:i,sName:n})}function Rt(e,i,n,r){var o=[];if(i&&(o=t.map(e[i].slice().reverse(),function(t,i){return t.fn.apply(e.oInstance,r)})),null!==n){var a=t.Event(n+".dt");t(e.nTable).trigger(a,r),o.push(a.result)}return o}function Nt(t){var e=t._iDisplayStart,i=t.fnDisplayEnd(),n=t._iDisplayLength;e>=i&&(e=i-n),e-=e%n,(-1===n||e<0)&&(e=0),t._iDisplayStart=e}function Ft(e,i){var n=e.renderer,r=Yt.ext.renderer[i];return t.isPlainObject(n)&&n[i]?r[n[i]]||r._:"string"==typeof n?r[n]||r._:r._}function zt(t){return t.oFeatures.bServerSide?"ssp":t.ajax||t.sAjaxSource?"ajax":"dom"}function Ht(t,e){var i=[],n=He.numbers_length,r=Math.floor(n/2);return e<=n?i=se(0,e):t<=r?((i=se(0,n-2)).push("ellipsis"),i.push(e-1)):t>=e-1-r?((i=se(e-(n-2),e)).splice(0,0,"ellipsis"),i.splice(0,0,0)):((i=se(t-r+2,t+r-1)).push("ellipsis"),i.push(e-1),i.splice(0,0,"ellipsis"),i.splice(0,0,0)),i.DT_el="span",i}function $t(e){t.each({num:function(t){return $e(t,e)},"num-fmt":function(t){return $e(t,e,Qt)},"html-num":function(t){return $e(t,e,Xt)},"html-num-fmt":function(t){return $e(t,e,Xt,Qt)}},function(t,i){Bt.type.order[t+e+"-pre"]=i,t.match(/^html\-/)&&(Bt.type.search[t+e]=Bt.type.search.html)})}function Vt(t){return function(){var e=[Mt(this[Yt.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return Yt.ext.internal[t].apply(this,e)}}var Bt,Wt,jt,Ut,Yt=function(e){this.$=function(t,e){return this.api(!0).$(t,e)},this._=function(t,e){return this.api(!0).rows(t,e).data()},this.api=function(t){return new Wt(t?Mt(this[Bt.iApiIndex]):this)},this.fnAddData=function(e,i){var r=this.api(!0),o=t.isArray(e)&&(t.isArray(e[0])||t.isPlainObject(e[0]))?r.rows.add(e):r.row.add(e);return(i===n||i)&&r.draw(),o.flatten().toArray()},this.fnAdjustColumnSizing=function(t){var e=this.api(!0).columns.adjust(),i=e.settings()[0],r=i.oScroll;t===n||t?e.draw(!1):""===r.sX&&""===r.sY||ft(i)},this.fnClearTable=function(t){var e=this.api(!0).clear();(t===n||t)&&e.draw()},this.fnClose=function(t){this.api(!0).row(t).child.hide()},this.fnDeleteRow=function(t,e,i){var r=this.api(!0),o=r.rows(t),a=o.settings()[0],s=a.aoData[o[0][0]];return o.remove(),e&&e.call(this,a,s),(i===n||i)&&r.draw(),s},this.fnDestroy=function(t){this.api(!0).destroy(t)},this.fnDraw=function(t){this.api(!0).draw(t)},this.fnFilter=function(t,e,i,r,o,a){var s=this.api(!0);null===e||e===n?s.search(t,i,r,a):s.column(e).search(t,i,r,a),s.draw()},this.fnGetData=function(t,e){var i=this.api(!0);if(t!==n){var r=t.nodeName?t.nodeName.toLowerCase():"";return e!==n||"td"==r||"th"==r?i.cell(t,e).data():i.row(t).data()||null}return i.data().toArray()},this.fnGetNodes=function(t){var e=this.api(!0);return t!==n?e.row(t).node():e.rows().nodes().flatten().toArray()},this.fnGetPosition=function(t){var e=this.api(!0),i=t.nodeName.toUpperCase();if("TR"==i)return e.row(t).index();if("TD"==i||"TH"==i){var n=e.cell(t).index();return[n.row,n.columnVisible,n.column]}return null},this.fnIsOpen=function(t){return this.api(!0).row(t).child.isShown()},this.fnOpen=function(t,e,i){return this.api(!0).row(t).child(e,i).show().child()[0]},this.fnPageChange=function(t,e){var i=this.api(!0).page(t);(e===n||e)&&i.draw(!1)},this.fnSetColumnVis=function(t,e,i){var r=this.api(!0).column(t).visible(e);(i===n||i)&&r.columns.adjust().draw()},this.fnSettings=function(){return Mt(this[Bt.iApiIndex])},this.fnSort=function(t){this.api(!0).order(t).draw()},this.fnSortListener=function(t,e,i){this.api(!0).order.listener(t,e,i)},this.fnUpdate=function(t,e,i,r,o){var a=this.api(!0);return i===n||null===i?a.row(e).data(t):a.cell(e,i).data(t),(o===n||o)&&a.columns.adjust(),(r===n||r)&&a.draw(),0},this.fnVersionCheck=Bt.fnVersionCheck;var i=this,r=e===n,h=this.length;r&&(e={}),this.oApi=this.internal=Bt.internal;for(var f in Yt.ext.internal)f&&(this[f]=Vt(f));return this.each(function(){var f,p=h>1?Lt({},e,!0):e,g=0,m=this.getAttribute("id"),v=!1,y=Yt.defaults,w=t(this);if("table"==this.nodeName.toLowerCase()){s(y),l(y.column),o(y,y,!0),o(y.column,y.column,!0),o(y,t.extend(p,w.data()));var S=Yt.settings;for(g=0,f=S.length;g<f;g++){var C=S[g];if(C.nTable==this||C.nTHead.parentNode==this||C.nTFoot&&C.nTFoot.parentNode==this){var T=p.bRetrieve!==n?p.bRetrieve:y.bRetrieve,A=p.bDestroy!==n?p.bDestroy:y.bDestroy;if(r||T)return C.oInstance;if(A){C.oInstance.fnDestroy();break}return void Et(C,0,"Cannot reinitialise DataTable",3)}if(C.sTableId==this.id){S.splice(g,1);break}}null!==m&&""!==m||(m="DataTables_Table_"+Yt.ext._unique++,this.id=m);var D=t.extend(!0,{},Yt.models.oSettings,{sDestroyWidth:w[0].style.width,sInstance:m,sTableId:m});D.nTable=this,D.oApi=i.internal,D.oInit=p,S.push(D),D.oInstance=1===i.length?i:w.dataTable(),s(p),p.oLanguage&&a(p.oLanguage),p.aLengthMenu&&!p.iDisplayLength&&(p.iDisplayLength=t.isArray(p.aLengthMenu[0])?p.aLengthMenu[0][0]:p.aLengthMenu[0]),p=Lt(t.extend(!0,{},y),p),Pt(D.oFeatures,p,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),Pt(D,p,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),Pt(D.oScroll,p,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),Pt(D.oLanguage,p,"fnInfoCallback"),Ot(D,"aoDrawCallback",p.fnDrawCallback,"user"),Ot(D,"aoServerParams",p.fnServerParams,"user"),Ot(D,"aoStateSaveParams",p.fnStateSaveParams,"user"),Ot(D,"aoStateLoadParams",p.fnStateLoadParams,"user"),Ot(D,"aoStateLoaded",p.fnStateLoaded,"user"),Ot(D,"aoRowCallback",p.fnRowCallback,"user"),Ot(D,"aoRowCreatedCallback",p.fnCreatedRow,"user"),Ot(D,"aoHeaderCallback",p.fnHeaderCallback,"user"),Ot(D,"aoFooterCallback",p.fnFooterCallback,"user"),Ot(D,"aoInitComplete",p.fnInitComplete,"user"),Ot(D,"aoPreDrawCallback",p.fnPreDrawCallback,"user"),D.rowIdFn=k(p.rowId),c(D);var M=D.oClasses;if(t.extend(M,Yt.ext.classes,p.oClasses),w.addClass(M.sTable),D.iInitDisplayStart===n&&(D.iInitDisplayStart=p.iDisplayStart,D._iDisplayStart=p.iDisplayStart),null!==p.iDeferLoading){D.bDeferLoading=!0;var E=t.isArray(p.iDeferLoading);D._iRecordsDisplay=E?p.iDeferLoading[0]:p.iDeferLoading,D._iRecordsTotal=E?p.iDeferLoading[1]:p.iDeferLoading}var P=D.oLanguage;t.extend(!0,P,p.oLanguage),P.sUrl&&(t.ajax({dataType:"json",url:P.sUrl,success:function(e){a(e),o(y.oLanguage,e),t.extend(!0,P,e),rt(D)},error:function(){rt(D)}}),v=!0),null===p.asStripeClasses&&(D.asStripeClasses=[M.sStripeOdd,M.sStripeEven]);var L=D.asStripeClasses,I=w.children("tbody").find("tr").eq(0);-1!==t.inArray(!0,t.map(L,function(t,e){return I.hasClass(t)}))&&(t("tbody tr",this).removeClass(L.join(" ")),D.asDestroyStripes=L.slice());var O,R=[],N=this.getElementsByTagName("thead");if(0!==N.length&&(H(D.aoHeader,N[0]),R=$(D)),null===p.aoColumns)for(O=[],g=0,f=R.length;g<f;g++)O.push(null);else O=p.aoColumns;for(g=0,f=O.length;g<f;g++)u(D,R?R[g]:null);if(b(D,p.aoColumnDefs,O,function(t,e){d(D,t,e)}),I.length){var F=function(t,e){return null!==t.getAttribute("data-"+e)?e:null};t(I[0]).children("th, td").each(function(t,e){var i=D.aoColumns[t];if(i.mData===t){var r=F(e,"sort")||F(e,"order"),o=F(e,"filter")||F(e,"search");null===r&&null===o||(i.mData={_:t+".display",sort:null!==r?t+".@data-"+r:n,type:null!==r?t+".@data-"+r:n,filter:null!==o?t+".@data-"+o:n},d(D,t))}})}var z=D.oFeatures,V=function(){if(p.aaSorting===n){var e=D.aaSorting;for(g=0,f=e.length;g<f;g++)e[g][1]=D.aoColumns[g].asSorting[0]}kt(D),z.bSort&&Ot(D,"aoDrawCallback",function(){if(D.bSorted){var e=xt(D),i={};t.each(e,function(t,e){i[e.src]=e.dir}),Rt(D,null,"order",[D,e,i]),wt(D)}}),Ot(D,"aoDrawCallback",function(){(D.bSorted||"ssp"===zt(D)||z.bDeferRender)&&kt(D)},"sc");var i=w.children("caption").each(function(){this._captionSide=t(this).css("caption-side")}),r=w.children("thead");0===r.length&&(r=t("<thead/>").appendTo(w)),D.nTHead=r[0];var o=w.children("tbody");0===o.length&&(o=t("<tbody/>").appendTo(w)),D.nTBody=o[0];var a=w.children("tfoot");if(0===a.length&&i.length>0&&(""!==D.oScroll.sX||""!==D.oScroll.sY)&&(a=t("<tfoot/>").appendTo(w)),0===a.length||0===a.children().length?w.addClass(M.sNoFooter):a.length>0&&(D.nTFoot=a[0],H(D.aoFooter,D.nTFoot)),p.aaData)for(g=0;g<p.aaData.length;g++)x(D,p.aaData[g]);else(D.bDeferLoading||"dom"==zt(D))&&_(D,t(D.nTBody).children("tr"));D.aiDisplay=D.aiDisplayMaster.slice(),D.bInitialised=!0,!1===v&&rt(D)};p.bStateSave?(z.bStateSave=!0,Ot(D,"aoDrawCallback",At,"state_save"),Dt(D,0,V)):V()}else Et(null,0,"Non-table node initialisation ("+this.nodeName+")",2)}),i=null,this},Gt={},qt=/[\r\n]/g,Xt=/<.*?>/g,Kt=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,Zt=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),Qt=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,Jt=function(t){return!t||!0===t||"-"===t},te=function(t){var e=parseInt(t,10);return!isNaN(e)&&isFinite(t)?e:null},ee=function(t,e){return Gt[e]||(Gt[e]=new RegExp(ge(e),"g")),"string"==typeof t&&"."!==e?t.replace(/\./g,"").replace(Gt[e],"."):t},ie=function(t,e,i){var n="string"==typeof t;return!!Jt(t)||(e&&n&&(t=ee(t,e)),i&&n&&(t=t.replace(Qt,"")),!isNaN(parseFloat(t))&&isFinite(t))},ne=function(t){return Jt(t)||"string"==typeof t},re=function(t,e,i){return!!Jt(t)||(ne(t)?!!ie(ce(t),e,i)||null:null)},oe=function(t,e,i){var r=[],o=0,a=t.length;if(i!==n)for(;o<a;o++)t[o]&&t[o][e]&&r.push(t[o][e][i]);else for(;o<a;o++)t[o]&&r.push(t[o][e]);return r},ae=function(t,e,i,r){var o=[],a=0,s=e.length;if(r!==n)for(;a<s;a++)t[e[a]][i]&&o.push(t[e[a]][i][r]);else for(;a<s;a++)o.push(t[e[a]][i]);return o},se=function(t,e){var i,r=[];e===n?(e=0,i=t):(i=e,e=t);for(var o=e;o<i;o++)r.push(o);return r},le=function(t){for(var e=[],i=0,n=t.length;i<n;i++)t[i]&&e.push(t[i]);return e},ce=function(t){return t.replace(Xt,"")},he=function(t){if(t.length<2)return!0;for(var e=t.slice().sort(),i=e[0],n=1,r=e.length;n<r;n++){if(e[n]===i)return!1;i=e[n]}return!0},ue=function(t){if(he(t))return t.slice();var e,i,n,r=[],o=t.length,a=0;t:for(i=0;i<o;i++){for(e=t[i],n=0;n<a;n++)if(r[n]===e)continue t;r.push(e),a++}return r};Yt.util={throttle:function(t,e){var i,r,o=e!==n?e:200;return function(){var e=this,a=+new Date,s=arguments;i&&a<i+o?(clearTimeout(r),r=setTimeout(function(){i=n,t.apply(e,s)},o)):(i=a,t.apply(e,s))}},escapeRegex:function(t){return t.replace(Zt,"\\$1")}};var de=function(t,e,i){t[e]!==n&&(t[i]=t[e])},fe=/\[.*?\]$/,pe=/\(\)$/,ge=Yt.util.escapeRegex,me=t("<div>")[0],ve=me.textContent!==n,ye=/<.*?>/g,be=Yt.util.throttle,xe=[],_e=Array.prototype,we=function(e){var i,n,r=Yt.settings,o=t.map(r,function(t,e){return t.nTable});return e?e.nTable&&e.oApi?[e]:e.nodeName&&"table"===e.nodeName.toLowerCase()?-1!==(i=t.inArray(e,o))?[r[i]]:null:e&&"function"==typeof e.settings?e.settings().toArray():("string"==typeof e?n=t(e):e instanceof t&&(n=e),n?n.map(function(e){return-1!==(i=t.inArray(this,o))?r[i]:null}).toArray():void 0):[]};Wt=function(e,i){if(!(this instanceof Wt))return new Wt(e,i);var n=[],r=function(t){var e=we(t);e&&(n=n.concat(e))};if(t.isArray(e))for(var o=0,a=e.length;o<a;o++)r(e[o]);else r(e);this.context=ue(n),i&&t.merge(this,i),this.selector={rows:null,cols:null,opts:null},Wt.extend(this,this,xe)},Yt.Api=Wt,t.extend(Wt.prototype,{any:function(){return 0!==this.count()},concat:_e.concat,context:[],count:function(){return this.flatten().length},each:function(t){for(var e=0,i=this.length;e<i;e++)t.call(this,this[e],e,this);return this},eq:function(t){var e=this.context;return e.length>t?new Wt(e[t],this[t]):null},filter:function(t){var e=[];if(_e.filter)e=_e.filter.call(this,t,this);else for(var i=0,n=this.length;i<n;i++)t.call(this,this[i],i,this)&&e.push(this[i]);return new Wt(this.context,e)},flatten:function(){var t=[];return new Wt(this.context,t.concat.apply(t,this.toArray()))},join:_e.join,indexOf:_e.indexOf||function(t,e){for(var i=e||0,n=this.length;i<n;i++)if(this[i]===t)return i;return-1},iterator:function(t,e,i,r){var o,a,s,l,c,h,u,d,f=[],p=this.context,g=this.selector;for("string"==typeof t&&(r=i,i=e,e=t,t=!1),a=0,s=p.length;a<s;a++){var m=new Wt(p[a]);if("table"===e)(o=i.call(m,p[a],a))!==n&&f.push(o);else if("columns"===e||"rows"===e)(o=i.call(m,p[a],this[a],a))!==n&&f.push(o);else if("column"===e||"column-rows"===e||"row"===e||"cell"===e)for(u=this[a],"column-rows"===e&&(h=De(p[a],g.opts)),l=0,c=u.length;l<c;l++)d=u[l],(o="cell"===e?i.call(m,p[a],d.row,d.column,a,l):i.call(m,p[a],d,a,l,h))!==n&&f.push(o)}if(f.length||r){var v=new Wt(p,t?f.concat.apply([],f):f),y=v.selector;return y.rows=g.rows,y.cols=g.cols,y.opts=g.opts,v}return this},lastIndexOf:_e.lastIndexOf||function(t,e){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,map:function(t){var e=[];if(_e.map)e=_e.map.call(this,t,this);else for(var i=0,n=this.length;i<n;i++)e.push(t.call(this,this[i],i));return new Wt(this.context,e)},pluck:function(t){return this.map(function(e){return e[t]})},pop:_e.pop,push:_e.push,reduce:_e.reduce||function(t,e){return h(this,t,e,0,this.length,1)},reduceRight:_e.reduceRight||function(t,e){return h(this,t,e,this.length-1,-1,-1)},reverse:_e.reverse,selector:null,shift:_e.shift,slice:function(){return new Wt(this.context,this)},sort:_e.sort,splice:_e.splice,toArray:function(){return _e.slice.call(this)},to$:function(){return t(this)},toJQuery:function(){return t(this)},unique:function(){return new Wt(this.context,ue(this))},unshift:_e.unshift}),Wt.extend=function(e,i,n){if(n.length&&i&&(i instanceof Wt||i.__dt_wrapper)){var r,o,a;for(r=0,o=n.length;r<o;r++)i[(a=n[r]).name]="function"==typeof a.val?function(t,e,i){return function(){var n=e.apply(t,arguments);return Wt.extend(n,n,i.methodExt),n}}(e,a.val,a):t.isPlainObject(a.val)?{}:a.val,i[a.name].__dt_wrapper=!0,Wt.extend(e,i[a.name],a.propExt)}},Wt.register=jt=function(e,i){if(t.isArray(e))for(var n=0,r=e.length;n<r;n++)Wt.register(e[n],i);else{var o,a,s,l,c=e.split("."),h=xe;for(o=0,a=c.length;o<a;o++){var u=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i].name===e)return t[i];return null}(h,s=(l=-1!==c[o].indexOf("()"))?c[o].replace("()",""):c[o]);u||(u={name:s,val:{},methodExt:[],propExt:[]},h.push(u)),o===a-1?u.val=i:h=l?u.methodExt:u.propExt}}},Wt.registerPlural=Ut=function(e,i,r){Wt.register(e,r),Wt.register(i,function(){var e=r.apply(this,arguments);return e===this?this:e instanceof Wt?e.length?t.isArray(e[0])?new Wt(e.context,e[0]):e[0]:n:e})};var Se=function(e,i){if("number"==typeof e)return[i[e]];var n=t.map(i,function(t,e){return t.nTable});return t(n).filter(e).map(function(e){var r=t.inArray(this,n);return i[r]}).toArray()};jt("tables()",function(t){return t?new Wt(Se(t,this.context)):this}),jt("table()",function(t){var e=this.tables(t),i=e.context;return i.length?new Wt(i[0]):e}),Ut("tables().nodes()","table().node()",function(){return this.iterator("table",function(t){return t.nTable},1)}),Ut("tables().body()","table().body()",function(){return this.iterator("table",function(t){return t.nTBody},1)}),Ut("tables().header()","table().header()",function(){return this.iterator("table",function(t){return t.nTHead},1)}),Ut("tables().footer()","table().footer()",function(){return this.iterator("table",function(t){return t.nTFoot},1)}),Ut("tables().containers()","table().container()",function(){return this.iterator("table",function(t){return t.nTableWrapper},1)}),jt("draw()",function(t){return this.iterator("table",function(e){"page"===t?N(e):("string"==typeof t&&(t="full-hold"!==t),F(e,!1===t))})}),jt("page()",function(t){return t===n?this.page.info().page:this.iterator("table",function(e){ct(e,t)})}),jt("page.info()",function(t){if(0===this.context.length)return n;var e=this.context[0],i=e._iDisplayStart,r=e.oFeatures.bPaginate?e._iDisplayLength:-1,o=e.fnRecordsDisplay(),a=-1===r;return{page:a?0:Math.floor(i/r),pages:a?1:Math.ceil(o/r),start:i,end:e.fnDisplayEnd(),length:r,recordsTotal:e.fnRecordsTotal(),recordsDisplay:o,serverSide:"ssp"===zt(e)}}),jt("page.len()",function(t){return t===n?0!==this.context.length?this.context[0]._iDisplayLength:n:this.iterator("table",function(e){at(e,t)})});var Ce=function(t,e,i){if(i){var n=new Wt(t);n.one("draw",function(){i(n.ajax.json())})}if("ssp"==zt(t))F(t,e);else{ut(t,!0);var r=t.jqXHR;r&&4!==r.readyState&&r.abort(),V(t,[],function(i){D(t);for(var n=U(t,i),r=0,o=n.length;r<o;r++)x(t,n[r]);F(t,e),ut(t,!1)})}};jt("ajax.json()",function(){var t=this.context;if(t.length>0)return t[0].json}),jt("ajax.params()",function(){var t=this.context;if(t.length>0)return t[0].oAjaxData}),jt("ajax.reload()",function(t,e){return this.iterator("table",function(i){Ce(i,!1===e,t)})}),jt("ajax.url()",function(e){var i=this.context;return e===n?0===i.length?n:(i=i[0]).ajax?t.isPlainObject(i.ajax)?i.ajax.url:i.ajax:i.sAjaxSource:this.iterator("table",function(i){t.isPlainObject(i.ajax)?i.ajax.url=e:i.ajax=e})}),jt("ajax.url().load()",function(t,e){return this.iterator("table",function(i){Ce(i,!1===e,t)})});var ke=function(e,i,r,o,a){var s,l,c,h,u,d,f=[],p=typeof i;for(i&&"string"!==p&&"function"!==p&&i.length!==n||(i=[i]),c=0,h=i.length;c<h;c++)for(u=0,d=(l=i[c]&&i[c].split&&!i[c].match(/[\[\(:]/)?i[c].split(","):[i[c]]).length;u<d;u++)(s=r("string"==typeof l[u]?t.trim(l[u]):l[u]))&&s.length&&(f=f.concat(s));var g=Bt.selector[e];if(g.length)for(c=0,h=g.length;c<h;c++)f=g[c](o,a,f);return ue(f)},Te=function(e){return e||(e={}),e.filter&&e.search===n&&(e.search=e.filter),t.extend({search:"none",order:"current",page:"all"},e)},Ae=function(t){for(var e=0,i=t.length;e<i;e++)if(t[e].length>0)return t[0]=t[e],t[0].length=1,t.length=1,t.context=[t.context[e]],t;return t.length=0,t},De=function(e,i){var n,r,o,a=[],s=e.aiDisplay,l=e.aiDisplayMaster,c=i.search,h=i.order,u=i.page;if("ssp"==zt(e))return"removed"===c?[]:se(0,l.length);if("current"==u)for(n=e._iDisplayStart,r=e.fnDisplayEnd();n<r;n++)a.push(s[n]);else if("current"==h||"applied"==h)a="none"==c?l.slice():"applied"==c?s.slice():t.map(l,function(e,i){return-1===t.inArray(e,s)?e:null});else if("index"==h||"original"==h)for(n=0,r=e.aoData.length;n<r;n++)"none"==c?a.push(n):(-1===(o=t.inArray(n,s))&&"removed"==c||o>=0&&"applied"==c)&&a.push(n);return a},Me=function(e,i,r){var o;return ke("row",i,function(i){var a=te(i);if(null!==a&&!r)return[a];if(o||(o=De(e,r)),null!==a&&-1!==t.inArray(a,o))return[a];if(null===i||i===n||""===i)return o;if("function"==typeof i)return t.map(o,function(t){var n=e.aoData[t];return i(t,n._aData,n.nTr)?t:null});var s=le(ae(e.aoData,o,"nTr"));if(i.nodeName){if(i._DT_RowIndex!==n)return[i._DT_RowIndex];if(i._DT_CellIndex)return[i._DT_CellIndex.row];var l=t(i).closest("*[data-dt-row]");return l.length?[l.data("dt-row")]:[]}if("string"==typeof i&&"#"===i.charAt(0)){var c=e.aIds[i.replace(/^#/,"")];if(c!==n)return[c.idx]}return t(s).filter(i).map(function(){return this._DT_RowIndex}).toArray()},e,r)};jt("rows()",function(e,i){e===n?e="":t.isPlainObject(e)&&(i=e,e=""),i=Te(i);var r=this.iterator("table",function(t){return Me(t,e,i)},1);return r.selector.rows=e,r.selector.opts=i,r}),jt("rows().nodes()",function(){return this.iterator("row",function(t,e){return t.aoData[e].nTr||n},1)}),jt("rows().data()",function(){return this.iterator(!0,"rows",function(t,e){return ae(t.aoData,e,"_aData")},1)}),Ut("rows().cache()","row().cache()",function(t){return this.iterator("row",function(e,i){var n=e.aoData[i];return"search"===t?n._aFilterData:n._aSortData},1)}),Ut("rows().invalidate()","row().invalidate()",function(t){return this.iterator("row",function(e,i){E(e,i,t)})}),Ut("rows().indexes()","row().index()",function(){return this.iterator("row",function(t,e){return e},1)}),Ut("rows().ids()","row().id()",function(t){for(var e=[],i=this.context,n=0,r=i.length;n<r;n++)for(var o=0,a=this[n].length;o<a;o++){var s=i[n].rowIdFn(i[n].aoData[this[n][o]]._aData);e.push((!0===t?"#":"")+s)}return new Wt(i,e)}),Ut("rows().remove()","row().remove()",function(){var t=this;return this.iterator("row",function(e,i,r){var o,a,s,l,c,h,u=e.aoData,d=u[i];for(u.splice(i,1),o=0,a=u.length;o<a;o++)if(c=u[o],h=c.anCells,null!==c.nTr&&(c.nTr._DT_RowIndex=o),null!==h)for(s=0,l=h.length;s<l;s++)h[s]._DT_CellIndex.row=o;M(e.aiDisplayMaster,i),M(e.aiDisplay,i),M(t[r],i,!1),e._iRecordsDisplay>0&&e._iRecordsDisplay--,Nt(e);var f=e.rowIdFn(d._aData);f!==n&&delete e.aIds[f]}),this.iterator("table",function(t){for(var e=0,i=t.aoData.length;e<i;e++)t.aoData[e].idx=e}),this}),jt("rows.add()",function(e){var i=this.iterator("table",function(t){var i,n,r,o=[];for(n=0,r=e.length;n<r;n++)(i=e[n]).nodeName&&"TR"===i.nodeName.toUpperCase()?o.push(_(t,i)[0]):o.push(x(t,i));return o},1),n=this.rows(-1);return n.pop(),t.merge(n,i),n}),jt("row()",function(t,e){return Ae(this.rows(t,e))}),jt("row().data()",function(t){var e=this.context;return t===n?e.length&&this.length?e[0].aoData[this[0]]._aData:n:(e[0].aoData[this[0]]._aData=t,E(e[0],this[0],"data"),this)}),jt("row().node()",function(){var t=this.context;return t.length&&this.length?t[0].aoData[this[0]].nTr||null:null}),jt("row.add()",function(e){e instanceof t&&e.length&&(e=e[0]);var i=this.iterator("table",function(t){return e.nodeName&&"TR"===e.nodeName.toUpperCase()?_(t,e)[0]:x(t,e)});return this.row(i[0])});var Ee=function(e,i,n,r){var o=[],a=function(i,n){if(t.isArray(i)||i instanceof t)for(var r=0,s=i.length;r<s;r++)a(i[r],n);else if(i.nodeName&&"tr"===i.nodeName.toLowerCase())o.push(i);else{var l=t("<tr><td/></tr>").addClass(n);t("td",l).addClass(n).html(i)[0].colSpan=m(e),o.push(l[0])}};a(n,r),i._details&&i._details.detach(),i._details=t(o),i._detailsShow&&i._details.insertAfter(i.nTr)},Pe=function(t,e){var i=t.context;if(i.length){var r=i[0].aoData[e!==n?e:t[0]];r&&r._details&&(r._details.remove(),r._detailsShow=n,r._details=n)}},Le=function(t,e){var i=t.context;if(i.length&&t.length){var n=i[0].aoData[t[0]];n._details&&(n._detailsShow=e,e?n._details.insertAfter(n.nTr):n._details.detach(),Ie(i[0]))}},Ie=function(t){var e=new Wt(t),i=t.aoData;e.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details"),oe(i,"_details").length>0&&(e.on("draw.dt.DT_details",function(n,r){t===r&&e.rows({page:"current"}).eq(0).each(function(t){var e=i[t];e._detailsShow&&e._details.insertAfter(e.nTr)})}),e.on("column-visibility.dt.DT_details",function(e,n,r,o){if(t===n)for(var a,s=m(n),l=0,c=i.length;l<c;l++)(a=i[l])._details&&a._details.children("td[colspan]").attr("colspan",s)}),e.on("destroy.dt.DT_details",function(n,r){if(t===r)for(var o=0,a=i.length;o<a;o++)i[o]._details&&Pe(e,o)}))};jt("row().child()",function(t,e){var i=this.context;return t===n?i.length&&this.length?i[0].aoData[this[0]]._details:n:(!0===t?this.child.show():!1===t?Pe(this):i.length&&this.length&&Ee(i[0],i[0].aoData[this[0]],t,e),this)}),jt(["row().child.show()","row().child().show()"],function(t){return Le(this,!0),this}),jt(["row().child.hide()","row().child().hide()"],function(){return Le(this,!1),this}),jt(["row().child.remove()","row().child().remove()"],function(){return Pe(this),this}),jt("row().child.isShown()",function(){var t=this.context;return!(!t.length||!this.length)&&(t[0].aoData[this[0]]._detailsShow||!1)});var Oe=/^([^:]+):(name|visIdx|visible)$/,Re=function(t,e,i,n,r){for(var o=[],a=0,s=r.length;a<s;a++)o.push(w(t,r[a],e));return o},Ne=function(e,i,n){var r=e.aoColumns,o=oe(r,"sName"),a=oe(r,"nTh");return ke("column",i,function(i){var s=te(i);if(""===i)return se(r.length);if(null!==s)return[s>=0?s:r.length+s];if("function"==typeof i){var l=De(e,n);return t.map(r,function(t,n){return i(n,Re(e,n,0,0,l),a[n])?n:null})}var c="string"==typeof i?i.match(Oe):"";if(c)switch(c[2]){case"visIdx":case"visible":var h=parseInt(c[1],10);if(h<0){var u=t.map(r,function(t,e){return t.bVisible?e:null});return[u[u.length+h]]}return[p(e,h)];case"name":return t.map(o,function(t,e){return t===c[1]?e:null});default:return[]}if(i.nodeName&&i._DT_CellIndex)return[i._DT_CellIndex.column];var d=t(a).filter(i).map(function(){return t.inArray(this,a)}).toArray();if(d.length||!i.nodeName)return d;var f=t(i).closest("*[data-dt-column]");return f.length?[f.data("dt-column")]:[]},e,n)},Fe=function(e,i,r){var o,a,s,l,c=e.aoColumns,h=c[i],u=e.aoData;if(r===n)return h.bVisible;if(h.bVisible!==r){if(r){var d=t.inArray(!0,oe(c,"bVisible"),i+1);for(a=0,s=u.length;a<s;a++)l=u[a].nTr,o=u[a].anCells,l&&l.insertBefore(o[i],o[d]||null)}else t(oe(e.aoData,"anCells",i)).detach();h.bVisible=r,R(e,e.aoHeader),R(e,e.aoFooter),At(e)}};jt("columns()",function(e,i){e===n?e="":t.isPlainObject(e)&&(i=e,e=""),i=Te(i);var r=this.iterator("table",function(t){return Ne(t,e,i)},1);return r.selector.cols=e,r.selector.opts=i,r}),Ut("columns().header()","column().header()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTh},1)}),Ut("columns().footer()","column().footer()",function(t,e){return this.iterator("column",function(t,e){return t.aoColumns[e].nTf},1)}),Ut("columns().data()","column().data()",function(){return this.iterator("column-rows",Re,1)}),Ut("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(t,e){return t.aoColumns[e].mData},1)}),Ut("columns().cache()","column().cache()",function(t){return this.iterator("column-rows",function(e,i,n,r,o){return ae(e.aoData,o,"search"===t?"_aFilterData":"_aSortData",i)},1)}),Ut("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(t,e,i,n,r){return ae(t.aoData,r,"anCells",e)},1)}),Ut("columns().visible()","column().visible()",function(t,e){var i=this.iterator("column",function(e,i){if(t===n)return e.aoColumns[i].bVisible;Fe(e,i,t)});return t!==n&&(this.iterator("column",function(i,n){Rt(i,null,"column-visibility",[i,n,t,e])}),(e===n||e)&&this.columns.adjust()),i}),Ut("columns().indexes()","column().index()",function(t){return this.iterator("column",function(e,i){return"visible"===t?g(e,i):i},1)}),jt("columns.adjust()",function(){return this.iterator("table",function(t){f(t)},1)}),jt("column.index()",function(t,e){if(0!==this.context.length){var i=this.context[0];if("fromVisible"===t||"toData"===t)return p(i,e);if("fromData"===t||"toVisible"===t)return g(i,e)}}),jt("column()",function(t,e){return Ae(this.columns(t,e))});var ze=function(e,i,r){var o,a,s,l,c,h,u,d=e.aoData,f=De(e,r),p=le(ae(d,f,"anCells")),g=t([].concat.apply([],p)),m=e.aoColumns.length;return ke("cell",i,function(i){var r="function"==typeof i;if(null===i||i===n||r){for(a=[],s=0,l=f.length;s<l;s++)for(o=f[s],c=0;c<m;c++)h={row:o,column:c},r?(u=d[o],i(h,w(e,o,c),u.anCells?u.anCells[c]:null)&&a.push(h)):a.push(h);return a}if(t.isPlainObject(i))return[i];var p=g.filter(i).map(function(t,e){return{row:e._DT_CellIndex.row,column:e._DT_CellIndex.column}}).toArray();return p.length||!i.nodeName?p:(u=t(i).closest("*[data-dt-row]")).length?[{row:u.data("dt-row"),column:u.data("dt-column")}]:[]},e,r)};jt("cells()",function(e,i,r){if(t.isPlainObject(e)&&(e.row===n?(r=e,e=null):(r=i,i=null)),t.isPlainObject(i)&&(r=i,i=null),null===i||i===n)return this.iterator("table",function(t){return ze(t,e,Te(r))});var o,a,s,l,c,h=this.columns(i,r),u=this.rows(e,r),d=this.iterator("table",function(t,e){for(o=[],a=0,s=u[e].length;a<s;a++)for(l=0,c=h[e].length;l<c;l++)o.push({row:u[e][a],column:h[e][l]});return o},1);return t.extend(d.selector,{cols:i,rows:e,opts:r}),d}),Ut("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(t,e,i){var r=t.aoData[e];return r&&r.anCells?r.anCells[i]:n},1)}),jt("cells().data()",function(){return this.iterator("cell",function(t,e,i){return w(t,e,i)},1)}),Ut("cells().cache()","cell().cache()",function(t){return t="search"===t?"_aFilterData":"_aSortData",this.iterator("cell",function(e,i,n){return e.aoData[i][t][n]},1)}),Ut("cells().render()","cell().render()",function(t){return this.iterator("cell",function(e,i,n){return w(e,i,n,t)},1)}),Ut("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(t,e,i){return{row:e,column:i,columnVisible:g(t,i)}},1)}),Ut("cells().invalidate()","cell().invalidate()",function(t){return this.iterator("cell",function(e,i,n){E(e,i,t,n)})}),jt("cell()",function(t,e,i){return Ae(this.cells(t,e,i))}),jt("cell().data()",function(t){var e=this.context,i=this[0];return t===n?e.length&&i.length?w(e[0],i[0].row,i[0].column):n:(S(e[0],i[0].row,i[0].column,t),E(e[0],i[0].row,"data",i[0].column),this)}),jt("order()",function(e,i){var r=this.context;return e===n?0!==r.length?r[0].aaSorting:n:("number"==typeof e?e=[[e,i]]:e.length&&!t.isArray(e[0])&&(e=Array.prototype.slice.call(arguments)),this.iterator("table",function(t){t.aaSorting=e.slice()}))}),jt("order.listener()",function(t,e,i){return this.iterator("table",function(n){Ct(n,t,e,i)})}),jt("order.fixed()",function(e){if(!e){var i=this.context,r=i.length?i[0].aaSortingFixed:n;return t.isArray(r)?{pre:r}:r}return this.iterator("table",function(i){i.aaSortingFixed=t.extend(!0,{},e)})}),jt(["columns().order()","column().order()"],function(e){var i=this;return this.iterator("table",function(n,r){var o=[];t.each(i[r],function(t,i){o.push([i,e])}),n.aaSorting=o})}),jt("search()",function(e,i,r,o){var a=this.context;return e===n?0!==a.length?a[0].oPreviousSearch.sSearch:n:this.iterator("table",function(n){n.oFeatures.bFilter&&G(n,t.extend({},n.oPreviousSearch,{sSearch:e+"",bRegex:null!==i&&i,bSmart:null===r||r,bCaseInsensitive:null===o||o}),1)})}),Ut("columns().search()","column().search()",function(e,i,r,o){return this.iterator("column",function(a,s){var l=a.aoPreSearchCols;if(e===n)return l[s].sSearch;a.oFeatures.bFilter&&(t.extend(l[s],{sSearch:e+"",bRegex:null!==i&&i,bSmart:null===r||r,bCaseInsensitive:null===o||o}),G(a,a.oPreviousSearch,1))})}),jt("state()",function(){return this.context.length?this.context[0].oSavedState:null}),jt("state.clear()",function(){return this.iterator("table",function(t){t.fnStateSaveCallback.call(t.oInstance,t,{})})}),jt("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null}),jt("state.save()",function(){return this.iterator("table",function(t){At(t)})}),Yt.versionCheck=Yt.fnVersionCheck=function(t){for(var e,i,n=Yt.version.split("."),r=t.split("."),o=0,a=r.length;o<a;o++)if(e=parseInt(n[o],10)||0,i=parseInt(r[o],10)||0,e!==i)return e>i;return!0},Yt.isDataTable=Yt.fnIsDataTable=function(e){var i=t(e).get(0),n=!1;return e instanceof Yt.Api||(t.each(Yt.settings,function(e,r){var o=r.nScrollHead?t("table",r.nScrollHead)[0]:null,a=r.nScrollFoot?t("table",r.nScrollFoot)[0]:null;r.nTable!==i&&o!==i&&a!==i||(n=!0)}),n)},Yt.tables=Yt.fnTables=function(e){var i=!1;t.isPlainObject(e)&&(i=e.api,e=e.visible);var n=t.map(Yt.settings,function(i){if(!e||e&&t(i.nTable).is(":visible"))return i.nTable});return i?new Wt(n):n},Yt.camelToHungarian=o,jt("$()",function(e,i){var n=this.rows(i).nodes(),r=t(n);return t([].concat(r.filter(e).toArray(),r.find(e).toArray()))}),t.each(["on","one","off"],function(e,i){jt(i+"()",function(){var e=Array.prototype.slice.call(arguments);e[0]=t.map(e[0].split(/\s/),function(t){return t.match(/\.dt\b/)?t:t+".dt"}).join(" ");var n=t(this.tables().nodes());return n[i].apply(n,e),this})}),jt("clear()",function(){return this.iterator("table",function(t){D(t)})}),jt("settings()",function(){return new Wt(this.context,this.context)}),jt("init()",function(){var t=this.context;return t.length?t[0].oInit:null}),jt("data()",function(){return this.iterator("table",function(t){return oe(t.aoData,"_aData")}).flatten()}),jt("destroy()",function(i){return i=i||!1,this.iterator("table",function(n){var r,o=n.nTableWrapper.parentNode,a=n.oClasses,s=n.nTable,l=n.nTBody,c=n.nTHead,h=n.nTFoot,u=t(s),d=t(l),f=t(n.nTableWrapper),p=t.map(n.aoData,function(t){return t.nTr});n.bDestroying=!0,Rt(n,"aoDestroyCallback","destroy",[n]),i||new Wt(n).columns().visible(!0),f.off(".DT").find(":not(tbody *)").off(".DT"),t(e).off(".DT-"+n.sInstance),s!=c.parentNode&&(u.children("thead").detach(),u.append(c)),h&&s!=h.parentNode&&(u.children("tfoot").detach(),u.append(h)),n.aaSorting=[],n.aaSortingFixed=[],kt(n),t(p).removeClass(n.asStripeClasses.join(" ")),t("th, td",c).removeClass(a.sSortable+" "+a.sSortableAsc+" "+a.sSortableDesc+" "+a.sSortableNone),d.children().detach(),d.append(p);var g=i?"remove":"detach";u[g](),f[g](),!i&&o&&(o.insertBefore(s,n.nTableReinsertBefore),u.css("width",n.sDestroyWidth).removeClass(a.sTable),(r=n.asDestroyStripes.length)&&d.children().each(function(e){t(this).addClass(n.asDestroyStripes[e%r])}));var m=t.inArray(n,Yt.settings);-1!==m&&Yt.settings.splice(m,1)})}),t.each(["column","row","cell"],function(t,e){jt(e+"s().every()",function(t){var i=this.selector.opts,r=this;return this.iterator(e,function(o,a,s,l,c){t.call(r[e](a,"cell"===e?s:i,"cell"===e?i:n),a,s,l,c)})})}),jt("i18n()",function(e,i,r){var o=this.context[0],a=k(e)(o.oLanguage);return a===n&&(a=i),r!==n&&t.isPlainObject(a)&&(a=a[r]!==n?a[r]:a._),a.replace("%d",r)}),Yt.version="1.10.16",Yt.settings=[],Yt.models={},Yt.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0},Yt.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1},Yt.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null},Yt.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(t){try{return JSON.parse((-1===t.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+t.sInstance+"_"+location.pathname))}catch(t){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(t,e){try{(-1===t.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+t.sInstance+"_"+location.pathname,JSON.stringify(e))}catch(t){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:t.extend({},Yt.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"},r(Yt.defaults),Yt.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null},r(Yt.defaults.column),Yt.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:n,oAjaxData:n,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==zt(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==zt(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var t=this._iDisplayLength,e=this._iDisplayStart,i=e+t,n=this.aiDisplay.length,r=this.oFeatures,o=r.bPaginate;return r.bServerSide?!1===o||-1===t?e+n:Math.min(e+t,this._iRecordsDisplay):!o||i>n||-1===t?n:i},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null},Yt.ext=Bt={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:Yt.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:Yt.version},t.extend(Bt,{afnFiltering:Bt.search,aTypes:Bt.type.detect,ofnSearch:Bt.type.search,oSort:Bt.type.order,afnSortData:Bt.order,aoFeatures:Bt.feature,oApi:Bt.internal,oStdClasses:Bt.classes,oPagination:Bt.pager}),t.extend(Yt.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var He=Yt.ext.pager;t.extend(He,{simple:function(t,e){return["previous","next"]},full:function(t,e){return["first","previous","next","last"]},numbers:function(t,e){return[Ht(t,e)]},simple_numbers:function(t,e){return["previous",Ht(t,e),"next"]},full_numbers:function(t,e){return["first","previous",Ht(t,e),"next","last"]},first_last_numbers:function(t,e){return["first",Ht(t,e),"last"]},_numbers:Ht,numbers_length:7}),t.extend(!0,Yt.ext.renderer,{pageButton:{_:function(e,r,o,a,s,l){var c,h,u,d=e.oClasses,f=e.oLanguage.oPaginate,p=e.oLanguage.oAria.paginate||{},g=0,m=function(i,n){var r,a,u;for(r=0,a=n.length;r<a;r++)if(u=n[r],t.isArray(u)){var v=t("<"+(u.DT_el||"div")+"/>").appendTo(i);m(v,u)}else{switch(c=null,h="",u){case"ellipsis":i.append('<span class="ellipsis">…</span>');break;case"first":c=f.sFirst,h=u+(s>0?"":" "+d.sPageButtonDisabled);break;case"previous":c=f.sPrevious,h=u+(s>0?"":" "+d.sPageButtonDisabled);break;case"next":c=f.sNext,h=u+(s<l-1?"":" "+d.sPageButtonDisabled);break;case"last":c=f.sLast,h=u+(s<l-1?"":" "+d.sPageButtonDisabled);break;default:c=u+1,h=s===u?d.sPageButtonActive:""}null!==c&&(It(t("<a>",{class:d.sPageButton+" "+h,"aria-controls":e.sTableId,"aria-label":p[u],"data-dt-idx":g,tabindex:e.iTabIndex,id:0===o&&"string"==typeof u?e.sTableId+"_"+u:null}).html(c).appendTo(i),{action:u},function(t){ct(e,t.data.action,!0)}),g++)}};try{u=t(r).find(i.activeElement).data("dt-idx")}catch(t){}m(t(r).empty(),a),u!==n&&t(r).find("[data-dt-idx="+u+"]").focus()}}}),t.extend(Yt.ext.type.detect,[function(t,e){var i=e.oLanguage.sDecimal;return ie(t,i)?"num"+i:null},function(t,e){if(t&&!(t instanceof Date)&&!Kt.test(t))return null;var i=Date.parse(t);return null!==i&&!isNaN(i)||Jt(t)?"date":null},function(t,e){var i=e.oLanguage.sDecimal;return ie(t,i,!0)?"num-fmt"+i:null},function(t,e){var i=e.oLanguage.sDecimal;return re(t,i)?"html-num"+i:null},function(t,e){var i=e.oLanguage.sDecimal;return re(t,i,!0)?"html-num-fmt"+i:null},function(t,e){return Jt(t)||"string"==typeof t&&-1!==t.indexOf("<")?"html":null}]),t.extend(Yt.ext.type.search,{html:function(t){return Jt(t)?t:"string"==typeof t?t.replace(qt," ").replace(Xt,""):""},string:function(t){return Jt(t)?t:"string"==typeof t?t.replace(qt," "):t}});var $e=function(t,e,i,n){return 0===t||t&&"-"!==t?(e&&(t=ee(t,e)),t.replace&&(i&&(t=t.replace(i,"")),n&&(t=t.replace(n,""))),1*t):-1/0};t.extend(Bt.type.order,{"date-pre":function(t){return Date.parse(t)||-1/0},"html-pre":function(t){return Jt(t)?"":t.replace?t.replace(/<.*?>/g,"").toLowerCase():t+""},"string-pre":function(t){return Jt(t)?"":"string"==typeof t?t.toLowerCase():t.toString?t.toString():""},"string-asc":function(t,e){return t<e?-1:t>e?1:0},"string-desc":function(t,e){return t<e?1:t>e?-1:0}}),$t(""),t.extend(!0,Yt.ext.renderer,{header:{_:function(e,i,n,r){t(e.nTable).on("order.dt.DT",function(t,o,a,s){if(e===o){var l=n.idx;i.removeClass(n.sSortingClass+" "+r.sSortAsc+" "+r.sSortDesc).addClass("asc"==s[l]?r.sSortAsc:"desc"==s[l]?r.sSortDesc:n.sSortingClass)}})},jqueryui:function(e,i,n,r){t("<div/>").addClass(r.sSortJUIWrapper).append(i.contents()).append(t("<span/>").addClass(r.sSortIcon+" "+n.sSortingClassJUI)).appendTo(i),t(e.nTable).on("order.dt.DT",function(t,o,a,s){if(e===o){var l=n.idx;i.removeClass(r.sSortAsc+" "+r.sSortDesc).addClass("asc"==s[l]?r.sSortAsc:"desc"==s[l]?r.sSortDesc:n.sSortingClass),i.find("span."+r.sSortIcon).removeClass(r.sSortJUIAsc+" "+r.sSortJUIDesc+" "+r.sSortJUI+" "+r.sSortJUIAscAllowed+" "+r.sSortJUIDescAllowed).addClass("asc"==s[l]?r.sSortJUIAsc:"desc"==s[l]?r.sSortJUIDesc:n.sSortingClassJUI)}})}}});var Ve=function(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):t};return Yt.render={number:function(t,e,i,n,r){return{display:function(o){if("number"!=typeof o&&"string"!=typeof o)return o;var a=o<0?"-":"",s=parseFloat(o);if(isNaN(s))return Ve(o);s=s.toFixed(i),o=Math.abs(s);var l=parseInt(o,10),c=i?e+(o-l).toFixed(i).substring(2):"";return a+(n||"")+l.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t)+c+(r||"")}}},text:function(){return{display:Ve}}},t.extend(Yt.ext.internal,{_fnExternApiFunc:Vt,_fnBuildAjax:V,_fnAjaxUpdate:B,_fnAjaxParameters:W,_fnAjaxUpdateDraw:j,_fnAjaxDataSrc:U,_fnAddColumn:u,_fnColumnOptions:d,_fnAdjustColumnSizing:f,_fnVisibleToColumnIndex:p,_fnColumnIndexToVisible:g,_fnVisbleColumns:m,_fnGetColumns:v,_fnColumnTypes:y,_fnApplyColumnDefs:b,_fnHungarianMap:r,_fnCamelToHungarian:o,_fnLanguageCompat:a,_fnBrowserDetect:c,_fnAddData:x,_fnAddTr:_,_fnNodeToDataIndex:function(t,e){return e._DT_RowIndex!==n?e._DT_RowIndex:null},_fnNodeToColumnIndex:function(e,i,n){return t.inArray(n,e.aoData[i].anCells)},_fnGetCellData:w,_fnSetCellData:S,_fnSplitObjNotation:C,_fnGetObjectDataFn:k,_fnSetObjectDataFn:T,_fnGetDataMaster:A,_fnClearTable:D,_fnDeleteIndex:M,_fnInvalidate:E,_fnGetRowElements:P,_fnCreateTr:L,_fnBuildHead:O,_fnDrawHead:R,_fnDraw:N,_fnReDraw:F,_fnAddOptionsHtml:z,_fnDetectHeader:H,_fnGetUniqueThs:$,_fnFeatureHtmlFilter:Y,_fnFilterComplete:G,_fnFilterCustom:q,_fnFilterColumn:X,_fnFilter:K,_fnFilterCreateSearch:Z,_fnEscapeRegex:ge,_fnFilterData:Q,_fnFeatureHtmlInfo:et,_fnUpdateInfo:it,_fnInfoMacros:nt,_fnInitialise:rt,_fnInitComplete:ot,_fnLengthChange:at,_fnFeatureHtmlLength:st,_fnFeatureHtmlPaginate:lt,_fnPageChange:ct,_fnFeatureHtmlProcessing:ht,_fnProcessingDisplay:ut,_fnFeatureHtmlTable:dt,_fnScrollDraw:ft,_fnApplyToChildren:pt,_fnCalculateColumnWidths:gt,_fnThrottle:be,_fnConvertToWidth:mt,_fnGetWidestNode:vt,_fnGetMaxLenString:yt,_fnStringToCss:bt,_fnSortFlatten:xt,_fnSort:_t,_fnSortAria:wt,_fnSortListener:St,_fnSortAttachListener:Ct,_fnSortingClasses:kt,_fnSortData:Tt,_fnSaveState:At,_fnLoadState:Dt,_fnSettingsFromNode:Mt,_fnLog:Et,_fnMap:Pt,_fnBindAction:It,_fnCallbackReg:Ot,_fnCallbackFire:Rt,_fnLengthOverflow:Nt,_fnRenderer:Ft,_fnDataSource:zt,_fnRowAttributes:I,_fnCalculateEnd:function(){}}),t.fn.dataTable=Yt,Yt.$=t,t.fn.dataTableSettings=Yt.settings,t.fn.dataTableExt=Yt.ext,t.fn.DataTable=function(e){return t(this).dataTable(e).api()},t.each(Yt,function(e,i){t.fn.DataTable[e]=i}),t.fn.dataTable}),function(t){"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?module.exports=function(e,i){return e||(e=window),i&&i.fn.dataTable||(i=require("datatables.net")(e,i).$),t(i,e,e.document)}:t(jQuery,window,document)}(function(t,e,i,n){"use strict";var r=t.fn.dataTable;return t.extend(!0,r.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"}),t.extend(r.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"}),r.ext.renderer.pageButton.bootstrap=function(e,o,a,s,l,c){var h,u,d,f=new r.Api(e),p=e.oClasses,g=e.oLanguage.oPaginate,m=e.oLanguage.oAria.paginate||{},v=0,y=function(i,n){var r,o,s,d;for(r=0,o=n.length;r<o;r++)if(d=n[r],t.isArray(d))y(i,d);else{switch(h="",u="",d){case"ellipsis":h="…",u="disabled";break;case"first":h=g.sFirst,u=d+(l>0?"":" disabled");break;case"previous":h=g.sPrevious,u=d+(l>0?"":" disabled");break;case"next":h=g.sNext,u=d+(l<c-1?"":" disabled");break;case"last":h=g.sLast,u=d+(l<c-1?"":" disabled");break;default:h=d+1,u=l===d?"active":""}h&&(s=t("<li>",{class:p.sPageButton+" "+u,id:0===a&&"string"==typeof d?e.sTableId+"_"+d:null}).append(t("<a>",{href:"#","aria-controls":e.sTableId,"aria-label":m[d],"data-dt-idx":v,tabindex:e.iTabIndex}).html(h)).appendTo(i),e.oApi._fnBindAction(s,{action:d},function(e){e.preventDefault(),t(e.currentTarget).hasClass("disabled")||f.page()==e.data.action||f.page(e.data.action).draw("page")}),v++)}};try{d=t(o).find(i.activeElement).data("dt-idx")}catch(t){}y(t(o).empty().html('<ul class="pagination"/>').children("ul"),s),d!==n&&t(o).find("[data-dt-idx="+d+"]").focus()},r}),function(t){"use strict";if(!t.fn.dataTable)throw new Error("jquery.dataTables.js required.");t.extend(!0,t.fn.dataTable.defaults,{dom:"<'table-header clearfix'<'table-caption'><'DT-lf-right'<'DT-per-page'l><'DT-search'f>>><'dataTables_table_wrapper't><r><'table-footer clearfix'<'DT-label'i><'DT-pagination'p>>",oLanguage:{sLengthMenu:"Per page: _MENU_",sSearch:""}}),t.extend(!0,t.fn.dataTable.ext.classes,{sProcessing:"dataTables_processing bg-primary darker"})}(jQuery),function(){"use strict";var t,e,i,n=function(t,e){return function(){return t.apply(e,arguments)}};t=jQuery,e=function(){function t(){}return t.transitions={webkitTransition:"webkitTransitionEnd",mozTransition:"mozTransitionEnd",oTransition:"oTransitionEnd",transition:"transitionend"},t.transition=function(t){var e,i,n,r;e=t[0],i=this.transitions;for(r in i)if(n=i[r],null!=e.style[r])return n},t}(),i=function(){function i(e){null==e&&(e={}),this.container=n(this.container,this),this.content=n(this.content,this),this.html=n(this.html,this),this.$growl=n(this.$growl,this),this.$growls=n(this.$growls,this),this.animate=n(this.animate,this),this.remove=n(this.remove,this),this.dismiss=n(this.dismiss,this),this.present=n(this.present,this),this.waitAndDismiss=n(this.waitAndDismiss,this),this.cycle=n(this.cycle,this),this.close=n(this.close,this),this.click=n(this.click,this),this.mouseLeave=n(this.mouseLeave,this),this.mouseEnter=n(this.mouseEnter,this),this.unbind=n(this.unbind,this),this.bind=n(this.bind,this),this.render=n(this.render,this),this.settings=t.extend({},i.settings,e),this.$growls().attr("class",this.settings.location),this.render()}return i.settings={namespace:"growl",duration:3200,close:"×",location:"default",style:"default",size:"medium",delayOnHover:!0},i.growl=function(t){return null==t&&(t={}),this.initialize(),new i(t)},i.initialize=function(){return t("body:not(:has(#growls))").append('<div id="growls" />')},i.prototype.render=function(){var t;t=this.$growl(),this.$growls().append(t),this.settings.fixed?this.present():this.cycle()},i.prototype.bind=function(t){return null==t&&(t=this.$growl()),t.on("click",this.click),this.settings.delayOnHover&&(t.on("mouseenter",this.mouseEnter),t.on("mouseleave",this.mouseLeave)),t.on("contextmenu",this.close).find("."+this.settings.namespace+"-close").on("click",this.close)},i.prototype.unbind=function(t){return null==t&&(t=this.$growl()),t.off("click",this.click),this.settings.delayOnHover&&(t.off("mouseenter",this.mouseEnter),t.off("mouseleave",this.mouseLeave)),t.off("contextmenu",this.close).find("."+this.settings.namespace+"-close").off("click",this.close)},i.prototype.mouseEnter=function(t){return this.$growl().stop(!0,!0)},i.prototype.mouseLeave=function(t){return this.waitAndDismiss()},i.prototype.click=function(t){if(null!=this.settings.url)return t.preventDefault(),t.stopPropagation(),window.open(this.settings.url)},i.prototype.close=function(t){return t.preventDefault(),t.stopPropagation(),this.$growl().stop().queue(this.dismiss).queue(this.remove)},i.prototype.cycle=function(){return this.$growl().queue(this.present).queue(this.waitAndDismiss())},i.prototype.waitAndDismiss=function(){return this.$growl().delay(this.settings.duration).queue(this.dismiss).queue(this.remove)},i.prototype.present=function(t){var e;return e=this.$growl(),this.bind(e),this.animate(e,this.settings.namespace+"-incoming","out",t)},i.prototype.dismiss=function(t){var e;return e=this.$growl(),this.unbind(e),this.animate(e,this.settings.namespace+"-outgoing","in",t)},i.prototype.remove=function(t){return this.$growl().remove(),"function"==typeof t?t():void 0},i.prototype.animate=function(t,i,n,r){var o;null==n&&(n="in"),o=e.transition(t),t["in"===n?"removeClass":"addClass"](i),t.offset().position,t["in"===n?"addClass":"removeClass"](i),null!=r&&(null!=o?t.one(o,r):r())},i.prototype.$growls=function(){return null!=this.$_growls?this.$_growls:this.$_growls=t("#growls")},i.prototype.$growl=function(){return null!=this.$_growl?this.$_growl:this.$_growl=t(this.html())},i.prototype.html=function(){return this.container(this.content())},i.prototype.content=function(){return"<div class='"+this.settings.namespace+"-close'>"+this.settings.close+"</div>\n<div class='"+this.settings.namespace+"-title'>"+this.settings.title+"</div>\n<div class='"+this.settings.namespace+"-message'>"+this.settings.message+"</div>"},i.prototype.container=function(t){return"<div class='"+this.settings.namespace+" "+this.settings.namespace+"-"+this.settings.style+" "+this.settings.namespace+"-"+this.settings.size+"'>\n "+t+"\n</div>"},i}(),this.Growl=i,t.growl=function(t){return null==t&&(t={}),i.growl(t)},t.growl.error=function(e){var i;return null==e&&(e={}),i={title:"Error!",style:"error"},t.growl(t.extend(i,e))},t.growl.notice=function(e){var i;return null==e&&(e={}),i={title:"Notice!",style:"notice"},t.growl(t.extend(i,e))},t.growl.warning=function(e){var i;return null==e&&(e={}),i={title:"Warning!",style:"warning"},t.growl(t.extend(i,e))}}.call(this),function(t){"use strict";if(!t.growl)throw new Error("jquery.growl.js required.");t.growl.success=function(e){return t.growl(t.extend({title:"Success!",style:"success"},e||{}))}}(jQuery),function(){var t,e,i,n,r,o,a,s,l,c=[].slice,h=function(t,e){function i(){this.constructor=t}for(var n in e)u.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},u={}.hasOwnProperty;s=function(){},e=function(){function t(){}return t.prototype.addEventListener=t.prototype.on,t.prototype.on=function(t,e){return this._callbacks=this._callbacks||{},this._callbacks[t]||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},t.prototype.emit=function(){var t,e,i,n,r;if(i=arguments[0],t=2<=arguments.length?c.call(arguments,1):[],this._callbacks=this._callbacks||{},e=this._callbacks[i])for(n=0,r=e.length;n<r;n++)e[n].apply(this,t);return this},t.prototype.removeListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.off=function(t,e){var i,n,r,o;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(!(i=this._callbacks[t]))return this;if(1===arguments.length)return delete this._callbacks[t],this;for(n=r=0,o=i.length;r<o;n=++r)if(i[n]===e){i.splice(n,1);break}return this},t}(),(t=function(t){function n(t,e){var i,o,a;if(this.element=t,this.version=n.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");if(n.instances.push(this),this.element.dropzone=this,i=null!=(a=n.optionsForElement(this.element))?a:{},this.options=r({},this.defaultOptions,i,null!=e?e:{}),this.options.forceFallback||!n.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),null!=this.options.renameFilename&&(this.options.renameFile=function(t){return function(e){return t.options.renameFilename.call(t,e.name,e)}}(this)),this.options.method=this.options.method.toUpperCase(),(o=this.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=n.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=n.getElements(this.options.clickable,"clickable")),this.init()}var r,o;return h(n,e),n.prototype.Emitter=e,n.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],n.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,params:{},headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){return s},accept:function(t,e){return e()},fallback:function(){var t,e,i,r,o,a;for(this.element.className=this.element.className+" dz-browser-not-supported",e=0,i=(o=this.element.getElementsByTagName("div")).length;e<i;e++)/(^| )dz-message($| )/.test((t=o[e]).className)&&(r=t,t.className="dz-message");return r||(r=n.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(r)),(a=r.getElementsByTagName("span")[0])&&(null!=a.textContent?a.textContent=this.options.dictFallbackMessage:null!=a.innerText&&(a.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(t,e,i,n){var r,o,a;if(r={srcX:0,srcY:0,srcWidth:t.width,srcHeight:t.height},o=t.width/t.height,null==e&&null==i?(e=r.srcWidth,i=r.srcHeight):null==e?e=i*o:null==i&&(i=e/o),e=Math.min(e,r.srcWidth),i=Math.min(i,r.srcHeight),a=e/i,r.srcWidth>e||r.srcHeight>i)if("crop"===n)o>a?(r.srcHeight=t.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=t.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==n)throw new Error("Unknown resizeMethod '"+n+"'");o>a?i=e/o:e=i*o}return r.srcX=(t.width-r.srcWidth)/2,r.srcY=(t.height-r.srcHeight)/2,r.trgWidth=e,r.trgHeight=i,r},transformFile:function(t,e){return(this.options.resizeWidth||this.options.resizeHeight)&&t.type.match(/image.*/)?this.resizeImage(t,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,e):e(t)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(t){return this.element.classList.remove("dz-drag-hover")},dragstart:s,dragend:function(t){return this.element.classList.remove("dz-drag-hover")},dragenter:function(t){return this.element.classList.add("dz-drag-hover")},dragover:function(t){return this.element.classList.add("dz-drag-hover")},dragleave:function(t){return this.element.classList.remove("dz-drag-hover")},paste:s,reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var e,i,r,o,a,s,l,c,h,u,d,f;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(t.previewElement=n.createElement(this.options.previewTemplate.trim()),t.previewTemplate=t.previewElement,this.previewsContainer.appendChild(t.previewElement),e=0,o=(l=t.previewElement.querySelectorAll("[data-dz-name]")).length;e<o;e++)l[e].textContent=t.name;for(i=0,a=(c=t.previewElement.querySelectorAll("[data-dz-size]")).length;i<a;i++)c[i].innerHTML=this.filesize(t.size);for(this.options.addRemoveLinks&&(t._removeLink=n.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),t.previewElement.appendChild(t._removeLink)),u=function(e){return function(i){return i.preventDefault(),i.stopPropagation(),t.status===n.UPLOADING?n.confirm(e.options.dictCancelUploadConfirmation,function(){return e.removeFile(t)}):e.options.dictRemoveFileConfirmation?n.confirm(e.options.dictRemoveFileConfirmation,function(){return e.removeFile(t)}):e.removeFile(t)}}(this),f=[],r=0,s=(h=t.previewElement.querySelectorAll("[data-dz-remove]")).length;r<s;r++)d=h[r],f.push(d.addEventListener("click",u));return f}},removedfile:function(t){var e;return t.previewElement&&null!=(e=t.previewElement)&&e.parentNode.removeChild(t.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(t,e){var i,n,r,o;if(t.previewElement){for(t.previewElement.classList.remove("dz-file-preview"),i=0,n=(r=t.previewElement.querySelectorAll("[data-dz-thumbnail]")).length;i<n;i++)(o=r[i]).alt=t.name,o.src=e;return setTimeout(function(){return t.previewElement.classList.add("dz-image-preview")},1)}},error:function(t,e){var i,n,r,o,a;if(t.previewElement){for(t.previewElement.classList.add("dz-error"),"String"!=typeof e&&e.error&&(e=e.error),a=[],i=0,n=(o=t.previewElement.querySelectorAll("[data-dz-errormessage]")).length;i<n;i++)r=o[i],a.push(r.textContent=e);return a}},errormultiple:s,processing:function(t){if(t.previewElement&&(t.previewElement.classList.add("dz-processing"),t._removeLink))return t._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:s,uploadprogress:function(t,e,i){var n,r,o,a,s;if(t.previewElement){for(s=[],n=0,r=(a=t.previewElement.querySelectorAll("[data-dz-uploadprogress]")).length;n<r;n++)"PROGRESS"===(o=a[n]).nodeName?s.push(o.value=e):s.push(o.style.width=e+"%");return s}},totaluploadprogress:s,sending:s,sendingmultiple:s,success:function(t){if(t.previewElement)return t.previewElement.classList.add("dz-success")},successmultiple:s,canceled:function(t){return this.emit("error",t,"Upload canceled.")},canceledmultiple:s,complete:function(t){if(t._removeLink&&(t._removeLink.textContent=this.options.dictRemoveFile),t.previewElement)return t.previewElement.classList.add("dz-complete")},completemultiple:s,maxfilesexceeded:s,maxfilesreached:s,queuecomplete:s,addedfiles:s},r=function(){var t,e,i,n,r,o,a;for(o=arguments[0],t=0,i=(r=2<=arguments.length?c.call(arguments,1):[]).length;t<i;t++){n=r[t];for(e in n)a=n[e],o[e]=a}return o},n.prototype.getAcceptedFiles=function(){var t,e,i,n,r;for(r=[],e=0,i=(n=this.files).length;e<i;e++)(t=n[e]).accepted&&r.push(t);return r},n.prototype.getRejectedFiles=function(){var t,e,i,n,r;for(r=[],e=0,i=(n=this.files).length;e<i;e++)(t=n[e]).accepted||r.push(t);return r},n.prototype.getFilesWithStatus=function(t){var e,i,n,r,o;for(o=[],i=0,n=(r=this.files).length;i<n;i++)(e=r[i]).status===t&&o.push(e);return o},n.prototype.getQueuedFiles=function(){return this.getFilesWithStatus(n.QUEUED)},n.prototype.getUploadingFiles=function(){return this.getFilesWithStatus(n.UPLOADING)},n.prototype.getAddedFiles=function(){return this.getFilesWithStatus(n.ADDED)},n.prototype.getActiveFiles=function(){var t,e,i,r,o;for(o=[],e=0,i=(r=this.files).length;e<i;e++)(t=r[e]).status!==n.UPLOADING&&t.status!==n.QUEUED||o.push(t);return o},n.prototype.init=function(){var t,e,i,r,o,a,s;for("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(n.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length&&(s=function(t){return function(){return t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null==t.options.maxFiles||t.options.maxFiles>1)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!=t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!=t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",document.querySelector(t.options.hiddenInputContainer).appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var e,i,n,r;if((i=t.hiddenFileInput.files).length)for(n=0,r=i.length;n<r;n++)e=i[n],t.addFile(e);return t.emit("addedfiles",i),s()})}}(this))(),this.URL=null!=(o=window.URL)?o:window.webkitURL,e=0,i=(a=this.events).length;e<i;e++)t=a[e],this.on(t,this.options[t]);return this.on("uploadprogress",function(t){return function(){return t.updateTotalUploadProgress()}}(this)),this.on("removedfile",function(t){return function(){return t.updateTotalUploadProgress()}}(this)),this.on("canceled",function(t){return function(e){return t.emit("complete",e)}}(this)),this.on("complete",function(t){return function(e){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout(function(){return t.emit("queuecomplete")},0)}}(this)),r=function(t){return t.stopPropagation(),t.preventDefault?t.preventDefault():t.returnValue=!1},this.listeners=[{element:this.element,events:{dragstart:function(t){return function(e){return t.emit("dragstart",e)}}(this),dragenter:function(t){return function(e){return r(e),t.emit("dragenter",e)}}(this),dragover:function(t){return function(e){var i;try{i=e.dataTransfer.effectAllowed}catch(t){}return e.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",r(e),t.emit("dragover",e)}}(this),dragleave:function(t){return function(e){return t.emit("dragleave",e)}}(this),drop:function(t){return function(e){return r(e),t.drop(e)}}(this),dragend:function(t){return function(e){return t.emit("dragend",e)}}(this)}}],this.clickableElements.forEach(function(t){return function(e){return t.listeners.push({element:e,events:{click:function(i){return(e!==t.element||i.target===t.element||n.elementInside(i.target,t.element.querySelector(".dz-message")))&&t.hiddenFileInput.click(),!0}}})}}(this)),this.enable(),this.options.init.call(this)},n.prototype.destroy=function(){var t;return this.disable(),this.removeAllFiles(!0),(null!=(t=this.hiddenFileInput)?t.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,n.instances.splice(n.instances.indexOf(this),1)},n.prototype.updateTotalUploadProgress=function(){var t,e,i,n,r,o,a;if(o=0,r=0,this.getActiveFiles().length){for(e=0,i=(n=this.getActiveFiles()).length;e<i;e++)o+=(t=n[e]).upload.bytesSent,r+=t.upload.total;a=100*o/r}else a=100;return this.emit("totaluploadprogress",a,r,o)},n.prototype._getParamName=function(t){return"function"==typeof this.options.paramName?this.options.paramName(t):this.options.paramName+(this.options.uploadMultiple?"["+t+"]":"")},n.prototype._renameFile=function(t){return"function"!=typeof this.options.renameFile?t.name:this.options.renameFile(t)},n.prototype.getFallbackForm=function(){var t,e,i,r;return(t=this.getExistingFallback())?t:(i='<div class="dz-fallback">',this.options.dictFallbackText&&(i+="<p>"+this.options.dictFallbackText+"</p>"),i+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>',e=n.createElement(i),"FORM"!==this.element.tagName?(r=n.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>')).appendChild(e):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=r?r:e)},n.prototype.getExistingFallback=function(){var t,e,i,n,r,o;for(e=function(t){var e,i,n;for(i=0,n=t.length;i<n;i++)if(e=t[i],/(^| )fallback($| )/.test(e.className))return e},i=0,n=(r=["div","form"]).length;i<n;i++)if(o=r[i],t=e(this.element.getElementsByTagName(o)))return t},n.prototype.setupEventListeners=function(){var t,e,i,n,r,o,a;for(a=[],i=0,n=(o=this.listeners).length;i<n;i++)t=o[i],a.push(function(){var i,n;i=t.events,n=[];for(e in i)r=i[e],n.push(t.element.addEventListener(e,r,!1));return n}());return a},n.prototype.removeEventListeners=function(){var t,e,i,n,r,o,a;for(a=[],i=0,n=(o=this.listeners).length;i<n;i++)t=o[i],a.push(function(){var i,n;i=t.events,n=[];for(e in i)r=i[e],n.push(t.element.removeEventListener(e,r,!1));return n}());return a},n.prototype.disable=function(){var t,e,i,n,r;for(this.clickableElements.forEach(function(t){return t.classList.remove("dz-clickable")}),this.removeEventListeners(),r=[],e=0,i=(n=this.files).length;e<i;e++)t=n[e],r.push(this.cancelUpload(t));return r},n.prototype.enable=function(){return this.clickableElements.forEach(function(t){return t.classList.add("dz-clickable")}),this.setupEventListeners()},n.prototype.filesize=function(t){var e,i,n,r,o,a,s,l;if(o=0,a="b",t>0){for(i=n=0,r=(l=["tb","gb","mb","kb","b"]).length;n<r;i=++n)if(s=l[i],e=Math.pow(this.options.filesizeBase,4-i)/10,t>=e){o=t/Math.pow(this.options.filesizeBase,4-i),a=s;break}o=Math.round(10*o)/10}return"<strong>"+o+"</strong> "+this.options.dictFileSizeUnits[a]},n.prototype._updateMaxFilesReachedClass=function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")},n.prototype.drop=function(t){var e,i;t.dataTransfer&&(this.emit("drop",t),e=t.dataTransfer.files,this.emit("addedfiles",e),e.length&&((i=t.dataTransfer.items)&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(e)))},n.prototype.paste=function(t){var e,i;if(null!=(null!=t&&null!=(i=t.clipboardData)?i.items:void 0))return this.emit("paste",t),(e=t.clipboardData.items).length?this._addFilesFromItems(e):void 0},n.prototype.handleFiles=function(t){var e,i,n,r;for(r=[],i=0,n=t.length;i<n;i++)e=t[i],r.push(this.addFile(e));return r},n.prototype._addFilesFromItems=function(t){var e,i,n,r,o;for(o=[],n=0,r=t.length;n<r;n++)null!=(i=t[n]).webkitGetAsEntry&&(e=i.webkitGetAsEntry())?e.isFile?o.push(this.addFile(i.getAsFile())):e.isDirectory?o.push(this._addFilesFromDirectory(e,e.name)):o.push(void 0):null!=i.getAsFile&&(null==i.kind||"file"===i.kind)?o.push(this.addFile(i.getAsFile())):o.push(void 0);return o},n.prototype._addFilesFromDirectory=function(t,e){var i,n,r;return i=t.createReader(),n=function(t){return"undefined"!=typeof console&&null!==console&&"function"==typeof console.log?console.log(t):void 0},(r=function(t){return function(){return i.readEntries(function(i){var n,o,a;if(i.length>0){for(o=0,a=i.length;o<a;o++)(n=i[o]).isFile?n.file(function(i){if(!t.options.ignoreHiddenFiles||"."!==i.name.substring(0,1))return i.fullPath=e+"/"+i.name,t.addFile(i)}):n.isDirectory&&t._addFilesFromDirectory(n,e+"/"+n.name);r()}return null},n)}}(this))()},n.prototype.accept=function(t,e){return t.size>1024*this.options.maxFilesize*1024?e(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):n.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(e(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,e):e(this.options.dictInvalidFileType)},n.prototype.addFile=function(t){return t.upload={progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)},this.files.push(t),t.status=n.ADDED,this.emit("addedfile",t),this._enqueueThumbnail(t),this.accept(t,function(e){return function(i){return i?(t.accepted=!1,e._errorProcessing([t],i)):(t.accepted=!0,e.options.autoQueue&&e.enqueueFile(t)),e._updateMaxFilesReachedClass()}}(this))},n.prototype.enqueueFiles=function(t){var e,i,n;for(i=0,n=t.length;i<n;i++)e=t[i],this.enqueueFile(e);return null},n.prototype.enqueueFile=function(t){if(t.status!==n.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=n.QUEUED,this.options.autoProcessQueue)return setTimeout(function(t){return function(){return t.processQueue()}}(this),0)},n.prototype._thumbnailQueue=[],n.prototype._processingThumbnail=!1,n.prototype._enqueueThumbnail=function(t){if(this.options.createImageThumbnails&&t.type.match(/image.*/)&&t.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(t),setTimeout(function(t){return function(){return t._processThumbnailQueue()}}(this),0)},n.prototype._processThumbnailQueue=function(){var t;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,t=this._thumbnailQueue.shift(),this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(e){return function(i){return e.emit("thumbnail",t,i),e._processingThumbnail=!1,e._processThumbnailQueue()}}(this))},n.prototype.removeFile=function(t){if(t.status===n.UPLOADING&&this.cancelUpload(t),this.files=l(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")},n.prototype.removeAllFiles=function(t){var e,i,r,o;for(null==t&&(t=!1),i=0,r=(o=this.files.slice()).length;i<r;i++)((e=o[i]).status!==n.UPLOADING||t)&&this.removeFile(e);return null},n.prototype.resizeImage=function(t,e,r,o,a){return this.createThumbnail(t,e,r,o,!1,function(e){return function(r,o){var s,l;return null===o?a(t):(null==(s=e.options.resizeMimeType)&&(s=t.type),l=o.toDataURL(s,e.options.resizeQuality),"image/jpeg"!==s&&"image/jpg"!==s||(l=i.restore(t.dataURL,l)),a(n.dataURItoBlob(l)))}}(this))},n.prototype.createThumbnail=function(t,e,i,n,r,o){var a;return a=new FileReader,a.onload=function(s){return function(){t.dataURL=a.result;{if("image/svg+xml"!==t.type)return s.createThumbnailFromUrl(t,e,i,n,r,o);null!=o&&o(a.result)}}}(this),a.readAsDataURL(t)},n.prototype.createThumbnailFromUrl=function(t,e,i,n,r,o,s){var l;return l=document.createElement("img"),s&&(l.crossOrigin=s),l.onload=function(s){return function(){var c;return c=function(t){return t(1)},"undefined"!=typeof EXIF&&null!==EXIF&&r&&(c=function(t){return EXIF.getData(l,function(){return t(EXIF.getTag(this,"Orientation"))})}),c(function(r){var c,h,u,d,f,p,g,m;switch(t.width=l.width,t.height=l.height,g=s.options.resize.call(s,t,e,i,n),c=document.createElement("canvas"),h=c.getContext("2d"),c.width=g.trgWidth,c.height=g.trgHeight,r>4&&(c.width=g.trgHeight,c.height=g.trgWidth),r){case 2:h.translate(c.width,0),h.scale(-1,1);break;case 3:h.translate(c.width,c.height),h.rotate(Math.PI);break;case 4:h.translate(0,c.height),h.scale(1,-1);break;case 5:h.rotate(.5*Math.PI),h.scale(1,-1);break;case 6:h.rotate(.5*Math.PI),h.translate(0,-c.height);break;case 7:h.rotate(.5*Math.PI),h.translate(c.width,-c.height),h.scale(-1,1);break;case 8:h.rotate(-.5*Math.PI),h.translate(-c.width,0)}if(a(h,l,null!=(u=g.srcX)?u:0,null!=(d=g.srcY)?d:0,g.srcWidth,g.srcHeight,null!=(f=g.trgX)?f:0,null!=(p=g.trgY)?p:0,g.trgWidth,g.trgHeight),m=c.toDataURL("image/png"),null!=o)return o(m,c)})}}(this),null!=o&&(l.onerror=o),l.src=t.dataURL},n.prototype.processQueue=function(){var t,e,i,n;if(e=this.options.parallelUploads,i=this.getUploadingFiles().length,t=i,!(i>=e)&&(n=this.getQueuedFiles()).length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-i));for(;t<e;){if(!n.length)return;this.processFile(n.shift()),t++}}},n.prototype.processFile=function(t){return this.processFiles([t])},n.prototype.processFiles=function(t){var e,i,r;for(i=0,r=t.length;i<r;i++)(e=t[i]).processing=!0,e.status=n.UPLOADING,this.emit("processing",e);return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)},n.prototype._getFilesWithXhr=function(t){var e;return function(){var i,n,r,o;for(o=[],i=0,n=(r=this.files).length;i<n;i++)(e=r[i]).xhr===t&&o.push(e);return o}.call(this)},n.prototype.cancelUpload=function(t){var e,i,r,o,a,s,l;if(t.status===n.UPLOADING){for(r=0,a=(i=this._getFilesWithXhr(t.xhr)).length;r<a;r++)(e=i[r]).status=n.CANCELED;for(t.xhr.abort(),o=0,s=i.length;o<s;o++)e=i[o],this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else(l=t.status)!==n.ADDED&&l!==n.QUEUED||(t.status=n.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()},o=function(){var t,e;return e=arguments[0],t=2<=arguments.length?c.call(arguments,1):[],"function"==typeof e?e.apply(this,t):e},n.prototype.uploadFile=function(t){return this.uploadFiles([t])},n.prototype.uploadFiles=function(t){var e,i,a,s,l,c,h,u,d,f,p,g,m,v,y,b,x,_,w,S,C,k,T,A,D,M,E,P,L,I,O,R,N,F,z,H;for(H=new XMLHttpRequest,m=0,x=t.length;m<x;m++)(a=t[m]).xhr=H;k=o(this.options.method,t),F=o(this.options.url,t),H.open(k,F,!0),H.timeout=o(this.options.timeout,t),H.withCredentials=!!this.options.withCredentials,O=null,l=function(e){return function(){var i,n,r;for(r=[],i=0,n=t.length;i<n;i++)a=t[i],r.push(e._errorProcessing(t,O||e.options.dictResponseError.replace("{{statusCode}}",H.status),H));return r}}(this),N=function(e){return function(i){var n,r,o,s,l,c,h,u,d;if(null!=i)for(u=100*i.loaded/i.total,r=0,s=t.length;r<s;r++)(a=t[r]).upload.progress=u,a.upload.total=i.total,a.upload.bytesSent=i.loaded;else{for(n=!0,u=100,o=0,l=t.length;o<l;o++)100===(a=t[o]).upload.progress&&a.upload.bytesSent===a.upload.total||(n=!1),a.upload.progress=u,a.upload.bytesSent=a.upload.total;if(n)return}for(d=[],h=0,c=t.length;h<c;h++)a=t[h],d.push(e.emit("uploadprogress",a,u,a.upload.bytesSent));return d}}(this),H.onload=function(e){return function(i){var r;if(t[0].status!==n.CANCELED&&4===H.readyState){if("arraybuffer"!==H.responseType&&"blob"!==H.responseType&&(O=H.responseText,H.getResponseHeader("content-type")&&~H.getResponseHeader("content-type").indexOf("application/json")))try{O=JSON.parse(O)}catch(t){i=t,O="Invalid JSON response from server."}return N(),200<=(r=H.status)&&r<300?e._finished(t,O,i):l()}}}(this),H.onerror=function(){if(t[0].status!==n.CANCELED)return l()},(null!=(D=H.upload)?D:H).onprogress=N,u={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"},this.options.headers&&r(u,this.options.headers);for(c in u)(h=u[c])&&H.setRequestHeader(c,h);if(s=new FormData,this.options.params){M=this.options.params;for(y in M)z=M[y],s.append(y,z)}for(v=0,_=t.length;v<_;v++)a=t[v],this.emit("sending",a,H,s);if(this.options.uploadMultiple&&this.emit("sendingmultiple",t,H,s),"FORM"===this.element.tagName)for(b=0,w=(E=this.element.querySelectorAll("input, textarea, select, button")).length;b<w;b++)if(f=E[b],p=f.getAttribute("name"),g=f.getAttribute("type"),"SELECT"===f.tagName&&f.hasAttribute("multiple"))for(C=0,S=(P=f.options).length;C<S;C++)(A=P[C]).selected&&s.append(p,A.value);else(!g||"checkbox"!==(L=g.toLowerCase())&&"radio"!==L||f.checked)&&s.append(p,f.value);for(e=0,R=[],d=T=0,I=t.length-1;0<=I?T<=I:T>=I;d=0<=I?++T:--T)i=function(i){return function(n,r,o){return function(n){if(s.append(r,n,o),++e===t.length)return i.submitRequest(H,s,t)}}}(this),R.push(this.options.transformFile.call(this,t[d],i(t[d],this._getParamName(d),t[d].upload.filename)));return R},n.prototype.submitRequest=function(t,e,i){return t.send(e)},n.prototype._finished=function(t,e,i){var r,o,a;for(o=0,a=t.length;o<a;o++)(r=t[o]).status=n.SUCCESS,this.emit("success",r,e,i),this.emit("complete",r);if(this.options.uploadMultiple&&(this.emit("successmultiple",t,e,i),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()},n.prototype._errorProcessing=function(t,e,i){var r,o,a;for(o=0,a=t.length;o<a;o++)(r=t[o]).status=n.ERROR,this.emit("error",r,e,i),this.emit("complete",r);if(this.options.uploadMultiple&&(this.emit("errormultiple",t,e,i),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()},n}()).version="5.1.1",t.options={},t.optionsForElement=function(e){return e.getAttribute("id")?t.options[n(e.getAttribute("id"))]:void 0},t.instances=[],t.forElement=function(t){if("string"==typeof t&&(t=document.querySelector(t)),null==(null!=t?t.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return t.dropzone},t.autoDiscover=!0,t.discover=function(){var e,i,n,r,o,a;for(document.querySelectorAll?n=document.querySelectorAll(".dropzone"):(n=[],(e=function(t){var e,i,r,o;for(o=[],i=0,r=t.length;i<r;i++)/(^| )dropzone($| )/.test((e=t[i]).className)?o.push(n.push(e)):o.push(void 0);return o})(document.getElementsByTagName("div")),e(document.getElementsByTagName("form"))),a=[],r=0,o=n.length;r<o;r++)i=n[r],!1!==t.optionsForElement(i)?a.push(new t(i)):a.push(void 0);return a},t.blacklistedBrowsers=[/opera.*Macintosh.*version\/12/i],t.isBrowserSupported=function(){var e,i,n,r;if(e=!0,window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(i=0,n=(r=t.blacklistedBrowsers).length;i<n;i++)r[i].test(navigator.userAgent)&&(e=!1);else e=!1;else e=!1;return e},t.dataURItoBlob=function(t){var e,i,n,r,o,a,s;for(i=atob(t.split(",")[1]),a=t.split(",")[0].split(":")[1].split(";")[0],e=new ArrayBuffer(i.length),r=new Uint8Array(e),n=o=0,s=i.length;0<=s?o<=s:o>=s;n=0<=s?++o:--o)r[n]=i.charCodeAt(n);return new Blob([e],{type:a})},l=function(t,e){var i,n,r,o;for(o=[],n=0,r=t.length;n<r;n++)(i=t[n])!==e&&o.push(i);return o},n=function(t){return t.replace(/[\-_](\w)/g,function(t){return t.charAt(1).toUpperCase()})},t.createElement=function(t){var e;return e=document.createElement("div"),e.innerHTML=t,e.childNodes[0]},t.elementInside=function(t,e){if(t===e)return!0;for(;t=t.parentNode;)if(t===e)return!0;return!1},t.getElement=function(t,e){var i;if("string"==typeof t?i=document.querySelector(t):null!=t.nodeType&&(i=t),null==i)throw new Error("Invalid `"+e+"` option provided. Please provide a CSS selector or a plain HTML element.");return i},t.getElements=function(t,e){var i,n,r,o,a,s,l;if(t instanceof Array){n=[];try{for(r=0,a=t.length;r<a;r++)i=t[r],n.push(this.getElement(i,e))}catch(t){t,n=null}}else if("string"==typeof t)for(n=[],o=0,s=(l=document.querySelectorAll(t)).length;o<s;o++)i=l[o],n.push(i);else null!=t.nodeType&&(n=[t]);if(null==n||!n.length)throw new Error("Invalid `"+e+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return n},t.confirm=function(t,e,i){return window.confirm(t)?e():null!=i?i():void 0},t.isValidFile=function(t,e){var i,n,r,o,a;if(!e)return!0;for(e=e.split(","),i=(o=t.type).replace(/\/.*$/,""),n=0,r=e.length;n<r;n++)if(a=e[n],"."===(a=a.trim()).charAt(0)){if(-1!==t.name.toLowerCase().indexOf(a.toLowerCase(),t.name.length-a.length))return!0}else if(/\/\*$/.test(a)){if(i===a.replace(/\/.*$/,""))return!0}else if(o===a)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new t(this,e)})}),"undefined"!=typeof module&&null!==module?module.exports=t:window.Dropzone=t,t.ADDED="added",t.QUEUED="queued",t.ACCEPTED=t.QUEUED,t.UPLOADING="uploading",t.PROCESSING=t.UPLOADING,t.CANCELED="canceled",t.ERROR="error",t.SUCCESS="success",o=function(t){var e,i,n,r,o,a,s,l;for(t.naturalWidth,o=t.naturalHeight,(e=document.createElement("canvas")).width=1,e.height=o,(i=e.getContext("2d")).drawImage(t,0,0),n=i.getImageData(1,0,1,o).data,l=0,r=o,a=o;a>l;)0===n[4*(a-1)+3]?r=a:l=a,a=r+l>>1;return 0===(s=a/o)?1:s},a=function(t,e,i,n,r,a,s,l,c,h){var u;return u=o(e),t.drawImage(e,i,n,r,a,s,l,c,h/u)},i=function(){function t(){}return t.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",t.encode64=function(t){var e,i,n,r,o,a,s,l,c;for(c="",e=void 0,i=void 0,n="",r=void 0,o=void 0,a=void 0,s="",l=0;;)if(e=t[l++],i=t[l++],n=t[l++],r=e>>2,o=(3&e)<<4|i>>4,a=(15&i)<<2|n>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),c=c+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(s),e=i=n="",r=o=a=s="",!(l<t.length))break;return c},t.restore=function(t,e){var i,n,r;return t.match("data:image/jpeg;base64,")?(n=this.decode64(t.replace("data:image/jpeg;base64,","")),r=this.slice2Segments(n),i=this.exifManipulation(e,r),"data:image/jpeg;base64,"+this.encode64(i)):e},t.exifManipulation=function(t,e){var i,n;return i=this.getExifArray(e),n=this.insertExif(t,i),new Uint8Array(n)},t.getExifArray=function(t){var e,i;for(e=void 0,i=0;i<t.length;){if(255===(e=t[i])[0]&225===e[1])return e;i++}return[]},t.insertExif=function(t,e){var i,n,r,o,a,s;return o=t.replace("data:image/jpeg;base64,",""),r=this.decode64(o),s=r.indexOf(255,3),a=r.slice(0,s),n=r.slice(s),i=a,i=i.concat(e),i=i.concat(n)},t.slice2Segments=function(t){var e,i,n,r;for(i=0,r=[];;){if(255===t[i]&218===t[i+1])break;if(255===t[i]&216===t[i+1]?i+=2:(e=i+(256*t[i+2]+t[i+3])+2,n=t.slice(i,e),r.push(n),i=e),i>t.length)break}return r},t.decode64=function(t){var e,i,n,r,o,a,s,l,c;for("",i=void 0,n=void 0,r="",o=void 0,a=void 0,s=void 0,l="",c=0,e=[],/[^A-Za-z0-9\+\/\=]/g.exec(t)&&console.warning("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");;)if(o=this.KEY_STR.indexOf(t.charAt(c++)),a=this.KEY_STR.indexOf(t.charAt(c++)),s=this.KEY_STR.indexOf(t.charAt(c++)),l=this.KEY_STR.indexOf(t.charAt(c++)),i=o<<2|a>>4,n=(15&a)<<4|s>>2,r=(3&s)<<6|l,e.push(i),64!==s&&e.push(n),64!==l&&e.push(r),i=n=r="",o=a=s=l="",!(c<t.length))break;return e},t}(),r=function(t,e){var i,n,r,o,a,s,l,c,h;if(r=!1,h=!0,n=t.document,c=n.documentElement,i=n.addEventListener?"addEventListener":"attachEvent",l=n.addEventListener?"removeEventListener":"detachEvent",s=n.addEventListener?"":"on",o=function(i){if("readystatechange"!==i.type||"complete"===n.readyState)return("load"===i.type?t:n)[l](s+i.type,o,!1),!r&&(r=!0)?e.call(t,i.type||i):void 0},a=function(){try{c.doScroll("left")}catch(t){return t,void setTimeout(a,50)}return o("poll")},"complete"!==n.readyState){if(n.createEventObject&&c.doScroll){try{h=!t.frameElement}catch(t){}h&&a()}return n[i](s+"DOMContentLoaded",o,!1),n[i](s+"readystatechange",o,!1),t[i](s+"load",o,!1)}},t._autoDiscoverFunction=function(){if(t.autoDiscover)return t.discover()},r(window,t._autoDiscoverFunction)}.call(this);var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"use strict";if(!e)throw new Error("dropzone.js required.");var i=e.prototype.defaultOptions.error;e.prototype.defaultOptions=t.extend({},e.prototype.defaultOptions,{previewTemplate:'\n<div class="dz-preview dz-file-preview">\n <div class="dz-details">\n <div class="dz-filename" data-dz-name></div>\n <div class="dz-size" data-dz-size></div>\n <div class="dz-thumbnail">\n <img data-dz-thumbnail>\n <span class="dz-nopreview">No preview</span>\n <div class="dz-success-mark"></div>\n <div class="dz-error-mark"></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n </div>\n </div>\n <div class="progress">\n <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" data-dz-uploadprogress></div>\n </div>\n</div>',addRemoveLinks:!0,error:function(e,n){var r=i.call(this,e,n);return e.previewElement&&t(e.previewElement).find(".progress-bar-success").removeClass("progress-bar-success").addClass("progress-bar-danger"),r}}),t.fn.dropzone=function(i){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a=void 0,s=this.each(function(){var n=t(this).data("dropzone"),o="object"===(void 0===i?"undefined":_typeof(i))?i:null;if(n||(n=new e(this,o),t(this).data("dropzone",n)),"string"==typeof i){var s;if(!n[i])throw new Error('No method named "'+i+'".');a=(s=n)[i].apply(s,r)}});return void 0!==a?a:s}}(jQuery,window.Dropzone),function(t){"object"==typeof exports?module.exports=t(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){"use strict";var e={},i=Math.max,n=Math.min;e.c={},e.c.d=t(document),e.c.t=function(t){return t.originalEvent.touches.length-1},e.o=function(){var i=this;this.o=null,this.$=null,this.i=null,this.g=null,this.v=null,this.cv=null,this.x=0,this.y=0,this.w=0,this.h=0,this.$c=null,this.c=null,this.t=0,this.isInit=!1,this.fgColor=null,this.pColor=null,this.dH=null,this.cH=null,this.eH=null,this.rH=null,this.scale=1,this.relative=!1,this.relativeWidth=!1,this.relativeHeight=!1,this.$div=null,this.run=function(){var e=function(t,e){var n;for(n in e)i.o[n]=e[n];i._carve().init(),i._configure()._draw()};if(!this.$.data("kontroled")){if(this.$.data("kontroled",!0),this.extend(),this.o=t.extend({min:void 0!==this.$.data("min")?this.$.data("min"):0,max:void 0!==this.$.data("max")?this.$.data("max"):100,stopper:!0,readOnly:this.$.data("readonly")||"readonly"===this.$.attr("readonly"),cursor:!0===this.$.data("cursor")&&30||this.$.data("cursor")||0,thickness:this.$.data("thickness")&&Math.max(Math.min(this.$.data("thickness"),1),.01)||.35,lineCap:this.$.data("linecap")||"butt",width:this.$.data("width")||200,height:this.$.data("height")||200,displayInput:null==this.$.data("displayinput")||this.$.data("displayinput"),displayPrevious:this.$.data("displayprevious"),fgColor:this.$.data("fgcolor")||"#87CEEB",inputColor:this.$.data("inputcolor"),font:this.$.data("font")||"Arial",fontWeight:this.$.data("font-weight")||"bold",inline:!1,step:this.$.data("step")||1,rotation:this.$.data("rotation"),draw:null,change:null,cancel:null,release:null,format:function(t){return t},parse:function(t){return parseFloat(t)}},this.o),this.o.flip="anticlockwise"===this.o.rotation||"acw"===this.o.rotation,this.o.inputColor||(this.o.inputColor=this.o.fgColor),this.$.is("fieldset")?(this.v={},this.i=this.$.find("input"),this.i.each(function(e){var n=t(this);i.i[e]=n,i.v[e]=i.o.parse(n.val()),n.bind("change blur",function(){var t={};t[e]=n.val(),i.val(i._validate(t))})}),this.$.find("legend").remove()):(this.i=this.$,this.v=this.o.parse(this.$.val()),""===this.v&&(this.v=this.o.min),this.$.bind("change blur",function(){i.val(i._validate(i.o.parse(i.$.val())))})),!this.o.displayInput&&this.$.hide(),this.$c=t(document.createElement("canvas")).attr({width:this.o.width,height:this.o.height}),this.$div=t('<div style="'+(this.o.inline?"display:inline;":"")+"width:"+this.o.width+"px;height:"+this.o.height+'px;"></div>'),this.$.wrap(this.$div).before(this.$c),this.$div=this.$.parent(),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(this.$c[0]),this.c=this.$c[0].getContext?this.$c[0].getContext("2d"):null,!this.c)throw{name:"CanvasNotSupportedException",message:"Canvas not supported. Please use excanvas on IE8.0.",toString:function(){return this.name+": "+this.message}};return this.scale=(window.devicePixelRatio||1)/(this.c.webkitBackingStorePixelRatio||this.c.mozBackingStorePixelRatio||this.c.msBackingStorePixelRatio||this.c.oBackingStorePixelRatio||this.c.backingStorePixelRatio||1),this.relativeWidth=this.o.width%1!=0&&this.o.width.indexOf("%"),this.relativeHeight=this.o.height%1!=0&&this.o.height.indexOf("%"),this.relative=this.relativeWidth||this.relativeHeight,this._carve(),this.v instanceof Object?(this.cv={},this.copy(this.v,this.cv)):this.cv=this.v,this.$.bind("configure",e).parent().bind("configure",e),this._listen()._configure()._xy().init(),this.isInit=!0,this.$.val(this.o.format(this.v)),this._draw(),this}},this._carve=function(){if(this.relative){var t=this.relativeWidth?this.$div.parent().width()*parseInt(this.o.width)/100:this.$div.parent().width(),e=this.relativeHeight?this.$div.parent().height()*parseInt(this.o.height)/100:this.$div.parent().height();this.w=this.h=Math.min(t,e)}else this.w=this.o.width,this.h=this.o.height;return this.$div.css({width:this.w+"px",height:this.h+"px"}),this.$c.attr({width:this.w,height:this.h}),1!==this.scale&&(this.$c[0].width=this.$c[0].width*this.scale,this.$c[0].height=this.$c[0].height*this.scale,this.$c.width(this.w),this.$c.height(this.h)),this},this._draw=function(){var t=!0;i.g=i.c,i.clear(),i.dH&&(t=i.dH()),!1!==t&&i.draw()},this._touch=function(t){var n=function(t){var e=i.xy2val(t.originalEvent.touches[i.t].pageX,t.originalEvent.touches[i.t].pageY);e!=i.cv&&(i.cH&&!1===i.cH(e)||(i.change(i._validate(e)),i._draw()))};return this.t=e.c.t(t),n(t),e.c.d.bind("touchmove.k",n).bind("touchend.k",function(){e.c.d.unbind("touchmove.k touchend.k"),i.val(i.cv)}),this},this._mouse=function(t){var n=function(t){var e=i.xy2val(t.pageX,t.pageY);e!=i.cv&&(i.cH&&!1===i.cH(e)||(i.change(i._validate(e)),i._draw()))};return n(t),e.c.d.bind("mousemove.k",n).bind("keyup.k",function(t){if(27===t.keyCode){if(e.c.d.unbind("mouseup.k mousemove.k keyup.k"),i.eH&&!1===i.eH())return;i.cancel()}}).bind("mouseup.k",function(t){e.c.d.unbind("mousemove.k mouseup.k keyup.k"),i.val(i.cv)}),this},this._xy=function(){var t=this.$c.offset();return this.x=t.left,this.y=t.top,this},this._listen=function(){return this.o.readOnly?this.$.attr("readonly","readonly"):(this.$c.bind("mousedown",function(t){t.preventDefault(),i._xy()._mouse(t)}).bind("touchstart",function(t){t.preventDefault(),i._xy()._touch(t)}),this.listen()),this.relative&&t(window).resize(function(){i._carve().init(),i._draw()}),this},this._configure=function(){return this.o.draw&&(this.dH=this.o.draw),this.o.change&&(this.cH=this.o.change),this.o.cancel&&(this.eH=this.o.cancel),this.o.release&&(this.rH=this.o.release),this.o.displayPrevious?(this.pColor=this.h2rgba(this.o.fgColor,"0.4"),this.fgColor=this.h2rgba(this.o.fgColor,"0.6")):this.fgColor=this.o.fgColor,this},this._clear=function(){this.$c[0].width=this.$c[0].width},this._validate=function(t){var e=~~((t<0?-.5:.5)+t/this.o.step)*this.o.step;return Math.round(100*e)/100},this.listen=function(){},this.extend=function(){},this.init=function(){},this.change=function(t){},this.val=function(t){},this.xy2val=function(t,e){},this.draw=function(){},this.clear=function(){this._clear()},this.h2rgba=function(t,e){var i;return t=t.substring(1,7),"rgba("+(i=[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)])[0]+","+i[1]+","+i[2]+","+e+")"},this.copy=function(t,e){for(var i in t)e[i]=t[i]}},e.Dial=function(){e.o.call(this),this.startAngle=null,this.xy=null,this.radius=null,this.lineWidth=null,this.cursorExt=null,this.w2=null,this.PI2=2*Math.PI,this.extend=function(){this.o=t.extend({bgColor:this.$.data("bgcolor")||"#EEEEEE",angleOffset:this.$.data("angleoffset")||0,angleArc:this.$.data("anglearc")||360,inline:!0},this.o)},this.val=function(t,e){if(null==t)return this.v;t=this.o.parse(t),!1!==e&&t!=this.v&&this.rH&&!1===this.rH(t)||(this.cv=this.o.stopper?i(n(t,this.o.max),this.o.min):t,this.v=this.cv,this.$.val(this.o.format(this.v)),this._draw())},this.xy2val=function(t,e){var r,o;return r=Math.atan2(t-(this.x+this.w2),-(e-this.y-this.w2))-this.angleOffset,this.o.flip&&(r=this.angleArc-r-this.PI2),this.angleArc!=this.PI2&&r<0&&r>-.5?r=0:r<0&&(r+=this.PI2),o=r*(this.o.max-this.o.min)/this.angleArc+this.o.min,this.o.stopper&&(o=i(n(o,this.o.max),this.o.min)),o},this.listen=function(){var e,r,o,a,s=this,l=function(t){t.preventDefault();var o=t.originalEvent,a=o.detail||o.wheelDeltaX,l=o.detail||o.wheelDeltaY,c=s._validate(s.o.parse(s.$.val()))+(a>0||l>0?s.o.step:a<0||l<0?-s.o.step:0);c=i(n(c,s.o.max),s.o.min),s.val(c,!1),s.rH&&(clearTimeout(e),e=setTimeout(function(){s.rH(c),e=null},100),r||(r=setTimeout(function(){e&&s.rH(c),r=null},200)))},c=1,h={37:-s.o.step,38:s.o.step,39:s.o.step,40:-s.o.step};this.$.bind("keydown",function(e){var r=e.keyCode;if(r>=96&&r<=105&&(r=e.keyCode=r-48),o=parseInt(String.fromCharCode(r)),isNaN(o)&&(13!==r&&8!==r&&9!==r&&189!==r&&(190!==r||s.$.val().match(/\./))&&e.preventDefault(),t.inArray(r,[37,38,39,40])>-1)){e.preventDefault();var l=s.o.parse(s.$.val())+h[r]*c;s.o.stopper&&(l=i(n(l,s.o.max),s.o.min)),s.change(s._validate(l)),s._draw(),a=window.setTimeout(function(){c*=2},30)}}).bind("keyup",function(t){isNaN(o)?a&&(window.clearTimeout(a),a=null,c=1,s.val(s.$.val())):s.$.val()>s.o.max&&s.$.val(s.o.max)||s.$.val()<s.o.min&&s.$.val(s.o.min)}),this.$c.bind("mousewheel DOMMouseScroll",l),this.$.bind("mousewheel DOMMouseScroll",l)},this.init=function(){(this.v<this.o.min||this.v>this.o.max)&&(this.v=this.o.min),this.$.val(this.v),this.w2=this.w/2,this.cursorExt=this.o.cursor/100,this.xy=this.w2*this.scale,this.lineWidth=this.xy*this.o.thickness,this.lineCap=this.o.lineCap,this.radius=this.xy-this.lineWidth/2,this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset),this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc),this.angleOffset=this.o.angleOffset*Math.PI/180,this.angleArc=this.o.angleArc*Math.PI/180,this.startAngle=1.5*Math.PI+this.angleOffset,this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var t=i(String(Math.abs(this.o.max)).length,String(Math.abs(this.o.min)).length,2)+2;this.o.displayInput&&this.i.css({width:(this.w/2+4>>0)+"px",height:(this.w/3>>0)+"px",position:"absolute","vertical-align":"middle","margin-top":(this.w/3>>0)+"px","margin-left":"-"+(3*this.w/4+2>>0)+"px",border:0,background:"none",font:this.o.fontWeight+" "+(this.w/t>>0)+"px "+this.o.font,"text-align":"center",color:this.o.inputColor||this.o.fgColor,padding:"0px","-webkit-appearance":"none"})||this.i.css({width:"0px",visibility:"hidden"})},this.change=function(t){this.cv=t,this.$.val(this.o.format(t))},this.angle=function(t){return(t-this.o.min)*this.angleArc/(this.o.max-this.o.min)},this.arc=function(t){var e,i;return t=this.angle(t),i=this.o.flip?(e=this.endAngle+1e-5)-t-1e-5:(e=this.startAngle-1e-5)+t+1e-5,this.o.cursor&&(e=i-this.cursorExt)&&(i+=this.cursorExt),{s:e,e:i,d:this.o.flip&&!this.o.cursor}},this.draw=function(){var t,e=this.g,i=this.arc(this.cv),n=1;e.lineWidth=this.lineWidth,e.lineCap=this.lineCap,"none"!==this.o.bgColor&&(e.beginPath(),e.strokeStyle=this.o.bgColor,e.arc(this.xy,this.xy,this.radius,this.endAngle-1e-5,this.startAngle+1e-5,!0),e.stroke()),this.o.displayPrevious&&(t=this.arc(this.v),e.beginPath(),e.strokeStyle=this.pColor,e.arc(this.xy,this.xy,this.radius,t.s,t.e,t.d),e.stroke(),n=this.cv==this.v),e.beginPath(),e.strokeStyle=n?this.o.fgColor:this.fgColor,e.arc(this.xy,this.xy,this.radius,i.s,i.e,i.d),e.stroke()},this.cancel=function(){this.val(this.v)}},t.fn.dial=t.fn.knob=function(i){return this.each(function(){var n=new e.Dial;n.o=i,n.$=t(this),n.run()}).parent()}}),function(t){"use strict";if(!t.fn.knob)throw new Error("jquery.knob.js required.");var e=t.fn.knob;t.fn.knob=function(i){var n=e.call(this,i);return"rtl"===t("html").attr("dir")?n.each(function(){var e=t(this).find("input");e.css({"margin-left":0,"margin-right":e.css("margin-left")})}):n}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(window.jQuery)}(function(t){"use strict";var e,i="function"==typeof define&&define.amd,n=navigator.userAgent,r=/MSIE|Trident/i.test(n);if(r){var o=/MSIE (\d+[.]\d+)/.exec(n);o&&(e=parseFloat(o[1])),(o=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(n))&&(e=parseFloat(o[1]))}var a=/Edge\/\d+/.test(n),s=!!window.CodeMirror;if(!s&&i)if("function"==typeof __webpack_require__)try{require.resolve("codemirror"),s=!0}catch(t){}else if("undefined"!=typeof require)if(void 0!==require.resolve)try{require.resolve("codemirror"),s=!0}catch(t){}else void 0!==require.specified&&(s=require.specified("codemirror"));var l="ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0,c={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:r,isEdge:a,isFF:!a&&/firefox/i.test(n),isPhantom:/PhantomJS/i.test(n),isWebkit:!a&&/webkit/i.test(n),isChrome:!a&&/chrome/i.test(n),isSafari:!a&&/safari/i.test(n),browserVersion:e,jqueryVersion:parseFloat(t.fn.jquery),isSupportAmd:i,isSupportTouch:l,hasCodeMirror:s,isFontInstalled:function(e){var i="Comic Sans MS"===e?"Courier New":"Comic Sans MS",n=t("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),r=n.css("fontFamily",i).width(),o=n.css("fontFamily",e+","+i).width();return n.remove(),r!==o},isW3CRangeSupport:!!document.createRange},h=function(){var e=0;return{eq:function(t){return function(e){return t===e}},eq2:function(t,e){return t===e},peq2:function(t){return function(e,i){return e[t]===i[t]}},ok:function(){return!0},fail:function(){return!1},self:function(t){return t},not:function(t){return function(){return!t.apply(t,arguments)}},and:function(t,e){return function(i){return t(i)&&e(i)}},invoke:function(t,e){return function(){return t[e].apply(t,arguments)}},uniqueId:function(t){var i=++e+"";return t?t+i:i},rect2bnd:function(e){var i=t(document);return{top:e.top+i.scrollTop(),left:e.left+i.scrollLeft(),width:e.right-e.left,height:e.bottom-e.top}},invertObject:function(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[t[i]]=i);return e},namespaceToCamel:function(t,e){return(e=e||"")+t.split(".").map(function(t){return t.substring(0,1).toUpperCase()+t.substring(1)}).join("")},debounce:function(t,e,i){var n;return function(){var r=this,o=arguments,a=i&&!n;clearTimeout(n),n=setTimeout(function(){n=null,i||t.apply(r,o)},e),a&&t.apply(r,o)}}}}(),u=function(){var e=function(t){return t[0]},i=function(t){return t[t.length-1]},n=function(t){return t.slice(1)},r=function(e,i){return t.inArray(i,e)},o=function(t,e){return-1!==r(t,e)};return{head:e,last:i,initial:function(t){return t.slice(0,t.length-1)},tail:n,prev:function(t,e){var i=r(t,e);return-1===i?null:t[i-1]},next:function(t,e){var i=r(t,e);return-1===i?null:t[i+1]},find:function(t,e){for(var i=0,n=t.length;i<n;i++){var r=t[i];if(e(r))return r}},contains:o,all:function(t,e){for(var i=0,n=t.length;i<n;i++)if(!e(t[i]))return!1;return!0},sum:function(t,e){return e=e||h.self,t.reduce(function(t,i){return t+e(i)},0)},from:function(t){for(var e=[],i=-1,n=t.length;++i<n;)e[i]=t[i];return e},isEmpty:function(t){return!t||!t.length},clusterBy:function(t,r){return t.length?n(t).reduce(function(t,e){var n=i(t);return r(i(n),e)?n[n.length]=e:t[t.length]=[e],t},[[e(t)]]):[]},compact:function(t){for(var e=[],i=0,n=t.length;i<n;i++)t[i]&&e.push(t[i]);return e},unique:function(t){for(var e=[],i=0,n=t.length;i<n;i++)o(e,t[i])||e.push(t[i]);return e}}}(),d=String.fromCharCode(160),f=function(){var e=function(e){return e&&t(e).hasClass("note-editable")},i=function(t){return t=t.toUpperCase(),function(e){return e&&e.nodeName.toUpperCase()===t}},n=function(t){return t&&3===t.nodeType},r=function(t){return t&&/^BR|^IMG|^HR|^IFRAME|^BUTTON|^INPUT/.test(t.nodeName.toUpperCase())},o=function(t){return!e(t)&&(t&&/^DIV|^P|^LI|^H[1-7]/.test(t.nodeName.toUpperCase()))},a=i("PRE"),s=i("LI"),l=i("TABLE"),p=i("DATA"),g=function(t){return!(x(t)||m(t)||v(t)||o(t)||l(t)||b(t)||p(t))},m=function(t){return t&&/^UL|^OL/.test(t.nodeName.toUpperCase())},v=i("HR"),y=function(t){return t&&/^TD|^TH/.test(t.nodeName.toUpperCase())},b=i("BLOCKQUOTE"),x=function(t){return y(t)||b(t)||e(t)},_=i("A"),w=i("BODY"),S=c.isMSIE&&c.browserVersion<11?" ":"<br>",C=function(t){return n(t)?t.nodeValue.length:t?t.childNodes.length:0},k=function(t){var e=C(t);return 0===e||(!n(t)&&1===e&&t.innerHTML===S||!(!u.all(t.childNodes,n)||""!==t.innerHTML))},T=function(t){r(t)||C(t)||(t.innerHTML=S)},A=function(t,i){for(;t;){if(i(t))return t;if(e(t))break;t=t.parentNode}return null},D=function(t,i){i=i||h.fail;var n=[];return A(t,function(t){return e(t)||n.push(t),i(t)}),n},M=function(t,e){e=e||h.fail;for(var i=[];t&&!e(t);)i.push(t),t=t.nextSibling;return i},E=function(t,e){var i=e.nextSibling,n=e.parentNode;return i?n.insertBefore(t,i):n.appendChild(t),t},P=function(e,i){return t.each(i,function(t,i){e.appendChild(i)}),e},L=function(t){return 0===t.offset},I=function(t){return t.offset===C(t.node)},O=function(t){return L(t)||I(t)},R=function(t,e){for(;t&&t!==e;){if(0!==F(t))return!1;t=t.parentNode}return!0},N=function(t,e){if(!e)return!1;for(;t&&t!==e;){if(F(t)!==C(t.parentNode)-1)return!1;t=t.parentNode}return!0},F=function(t){for(var e=0;t=t.previousSibling;)e+=1;return e},z=function(t){return!!(t&&t.childNodes&&t.childNodes.length)},H=function(t,i){var n,r;if(0===t.offset){if(e(t.node))return null;n=t.node.parentNode,r=F(t.node)}else z(t.node)?(n=t.node.childNodes[t.offset-1],r=C(n)):(n=t.node,r=i?0:t.offset-1);return{node:n,offset:r}},$=function(t,i){var n,r;if(C(t.node)===t.offset){if(e(t.node))return null;n=t.node.parentNode,r=F(t.node)+1}else z(t.node)?(n=t.node.childNodes[t.offset],r=0):(n=t.node,r=i?C(t.node):t.offset+1);return{node:n,offset:r}},V=function(t,e){return t.node===e.node&&t.offset===e.offset},B=function(t,e){var i=e&&e.isSkipPaddingBlankHTML,r=e&&e.isNotSplitEdgePoint;if(O(t)&&(n(t.node)||r)){if(L(t))return t.node;if(I(t))return t.node.nextSibling}if(n(t.node))return t.node.splitText(t.offset);var o=t.node.childNodes[t.offset],a=E(t.node.cloneNode(!1),t.node);return P(a,M(o)),i||(T(t.node),T(a)),a},W=function(t,e,i){var n=D(e.node,h.eq(t));return n.length?1===n.length?B(e,i):n.reduce(function(t,n){return t===e.node&&(t=B(e,i)),B({node:n,offset:t?f.position(t):C(n)},i)}):null},j=function(t){return document.createElement(t)},U=function(t,e){if(t&&t.parentNode){if(t.removeNode)return t.removeNode(e);var i=t.parentNode;if(!e){var n,r,o=[];for(n=0,r=t.childNodes.length;n<r;n++)o.push(t.childNodes[n]);for(n=0,r=o.length;n<r;n++)i.insertBefore(o[n],t)}i.removeChild(t)}},Y=i("TEXTAREA"),G=function(t,e){var i=Y(t[0])?t.val():t.html();return e?i.replace(/[\n\r]/g,""):i};return{NBSP_CHAR:d,ZERO_WIDTH_NBSP_CHAR:"\ufeff",blank:S,emptyPara:"<p>"+S+"</p>",makePredByNodeName:i,isEditable:e,isControlSizing:function(e){return e&&t(e).hasClass("note-control-sizing")},isText:n,isElement:function(t){return t&&1===t.nodeType},isVoid:r,isPara:o,isPurePara:function(t){return o(t)&&!s(t)},isHeading:function(t){return t&&/^H[1-7]/.test(t.nodeName.toUpperCase())},isInline:g,isBlock:h.not(g),isBodyInline:function(t){return g(t)&&!A(t,o)},isBody:w,isParaInline:function(t){return g(t)&&!!A(t,o)},isPre:a,isList:m,isTable:l,isData:p,isCell:y,isBlockquote:b,isBodyContainer:x,isAnchor:_,isDiv:i("DIV"),isLi:s,isBR:i("BR"),isSpan:i("SPAN"),isB:i("B"),isU:i("U"),isS:i("S"),isI:i("I"),isImg:i("IMG"),isTextarea:Y,isEmpty:k,isEmptyAnchor:h.and(_,k),isClosestSibling:function(t,e){return t.nextSibling===e||t.previousSibling===e},withClosestSiblings:function(t,e){e=e||h.ok;var i=[];return t.previousSibling&&e(t.previousSibling)&&i.push(t.previousSibling),i.push(t),t.nextSibling&&e(t.nextSibling)&&i.push(t.nextSibling),i},nodeLength:C,isLeftEdgePoint:L,isRightEdgePoint:I,isEdgePoint:O,isLeftEdgeOf:R,isRightEdgeOf:N,isLeftEdgePointOf:function(t,e){return L(t)&&R(t.node,e)},isRightEdgePointOf:function(t,e){return I(t)&&N(t.node,e)},prevPoint:H,nextPoint:$,isSamePoint:V,isVisiblePoint:function(t){if(n(t.node)||!z(t.node)||k(t.node))return!0;var e=t.node.childNodes[t.offset-1],i=t.node.childNodes[t.offset];return!(e&&!r(e)||i&&!r(i))},prevPointUntil:function(t,e){for(;t;){if(e(t))return t;t=H(t)}return null},nextPointUntil:function(t,e){for(;t;){if(e(t))return t;t=$(t)}return null},isCharPoint:function(t){if(!n(t.node))return!1;var e=t.node.nodeValue.charAt(t.offset-1);return e&&" "!==e&&e!==d},walkPoint:function(t,e,i,n){for(var r=t;r&&(i(r),!V(r,e));){var o=n&&t.node!==r.node&&e.node!==r.node;r=$(r,o)}},ancestor:A,singleChildAncestor:function(t,i){for(t=t.parentNode;t&&1===C(t);){if(i(t))return t;if(e(t))break;t=t.parentNode}return null},listAncestor:D,lastAncestor:function(t,e){var i=D(t);return u.last(i.filter(e))},listNext:M,listPrev:function(t,e){e=e||h.fail;for(var i=[];t&&!e(t);)i.push(t),t=t.previousSibling;return i},listDescendant:function(t,e){var i=[];return e=e||h.ok,function n(r){t!==r&&e(r)&&i.push(r);for(var o=0,a=r.childNodes.length;o<a;o++)n(r.childNodes[o])}(t),i},commonAncestor:function(e,i){for(var n=D(e),r=i;r;r=r.parentNode)if(t.inArray(r,n)>-1)return r;return null},wrap:function(e,i){var n=e.parentNode,r=t("<"+i+">")[0];return n.insertBefore(r,e),r.appendChild(e),r},insertAfter:E,appendChildNodes:P,position:F,hasChildren:z,makeOffsetPath:function(t,e){return D(e,h.eq(t)).map(F).reverse()},fromOffsetPath:function(t,e){for(var i=t,n=0,r=e.length;n<r;n++)i=i.childNodes.length<=e[n]?i.childNodes[i.childNodes.length-1]:i.childNodes[e[n]];return i},splitTree:W,splitPoint:function(t,e){var i,n,r=e?o:x,a=D(t.node,r),s=u.last(a)||t.node;r(s)?(i=a[a.length-2],n=s):n=(i=s).parentNode;var l=i&&W(i,t,{isSkipPaddingBlankHTML:e,isNotSplitEdgePoint:e});return l||n!==t.node||(l=t.node.childNodes[t.offset]),{rightNode:l,container:n}},create:j,createText:function(t){return document.createTextNode(t)},remove:U,removeWhile:function(t,i){for(;t&&!e(t)&&i(t);){var n=t.parentNode;U(t),t=n}},replace:function(t,e){if(t.nodeName.toUpperCase()===e.toUpperCase())return t;var i=j(e);return t.style.cssText&&(i.style.cssText=t.style.cssText),P(i,u.from(t.childNodes)),E(i,t),U(t),i},html:function(e,i){var n=G(e);i&&(n=n.replace(/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g,function(t,e,i){var n=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(i=i.toUpperCase())&&!!e,r=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(i);return t+(n||r?"\n":"")}),n=t.trim(n));return n},value:G,posFromPlaceholder:function(e){var i=t(e),n=i.offset(),r=i.outerHeight(!0);return{left:n.left,top:n.top+r}},attachEvents:function(t,e){Object.keys(e).forEach(function(i){t.on(i,e[i])})},detachEvents:function(t,e){Object.keys(e).forEach(function(i){t.off(i,e[i])})},isCustomStyleTag:function(t){return t&&!f.isText(t)&&u.contains(t.classList,"note-styletag")}}}(),p=function(e,i){var n=this,r=t.summernote.ui;return this.memos={},this.modules={},this.layoutInfo={},this.options=i,this.initialize=function(){return this.layoutInfo=r.createLayout(e,i),this._initialize(),e.hide(),this},this.destroy=function(){this._destroy(),e.removeData("summernote"),r.removeLayout(e,this.layoutInfo)},this.reset=function(){var t=n.isDisabled();this.code(f.emptyPara),this._destroy(),this._initialize(),t&&n.disable()},this._initialize=function(){var e=t.extend({},this.options.buttons);Object.keys(e).forEach(function(t){n.memo("button."+t,e[t])});var i=t.extend({},this.options.modules,t.summernote.plugins||{});Object.keys(i).forEach(function(t){n.module(t,i[t],!0)}),Object.keys(this.modules).forEach(function(t){n.initializeModule(t)})},this._destroy=function(){Object.keys(this.modules).reverse().forEach(function(t){n.removeModule(t)}),Object.keys(this.memos).forEach(function(t){n.removeMemo(t)}),this.triggerEvent("destroy",this)},this.code=function(t){var i=this.invoke("codeview.isActivated");if(void 0===t)return this.invoke("codeview.sync"),i?this.layoutInfo.codable.val():this.layoutInfo.editable.html();i?this.layoutInfo.codable.val(t):this.layoutInfo.editable.html(t),e.val(t),this.triggerEvent("change",t)},this.isDisabled=function(){return"false"===this.layoutInfo.editable.attr("contenteditable")},this.enable=function(){this.layoutInfo.editable.attr("contenteditable",!0),this.invoke("toolbar.activate",!0),this.triggerEvent("disable",!1)},this.disable=function(){this.invoke("codeview.isActivated")&&this.invoke("codeview.deactivate"),this.layoutInfo.editable.attr("contenteditable",!1),this.invoke("toolbar.deactivate",!0),this.triggerEvent("disable",!0)},this.triggerEvent=function(){var t=u.head(arguments),i=u.tail(u.from(arguments)),n=this.options.callbacks[h.namespaceToCamel(t,"on")];n&&n.apply(e[0],i),e.trigger("summernote."+t,i)},this.initializeModule=function(t){var i=this.modules[t];i.shouldInitialize=i.shouldInitialize||h.ok,i.shouldInitialize()&&(i.initialize&&i.initialize(),i.events&&f.attachEvents(e,i.events))},this.module=function(t,e,i){if(1===arguments.length)return this.modules[t];this.modules[t]=new e(this),i||this.initializeModule(t)},this.removeModule=function(t){var i=this.modules[t];i.shouldInitialize()&&(i.events&&f.detachEvents(e,i.events),i.destroy&&i.destroy()),delete this.modules[t]},this.memo=function(t,e){if(1===arguments.length)return this.memos[t];this.memos[t]=e},this.removeMemo=function(t){this.memos[t]&&this.memos[t].destroy&&this.memos[t].destroy(),delete this.memos[t]},this.createInvokeHandlerAndUpdateState=function(t,e){return function(i){n.createInvokeHandler(t,e)(i),n.invoke("buttons.updateCurrentStyle")}},this.createInvokeHandler=function(e,i){return function(r){r.preventDefault();var o=t(r.target);n.invoke(e,i||o.closest("[data-value]").data("value"),o)}},this.invoke=function(){var t=u.head(arguments),e=u.tail(u.from(arguments)),i=t.split("."),n=i.length>1,r=n&&u.head(i),o=n?u.last(i):u.head(i),a=this.modules[r||"editor"];return!r&&this[o]?this[o].apply(this,e):a&&a[o]&&a.shouldInitialize()?a[o].apply(a,e):void 0},this.initialize()};t.fn.extend({summernote:function(){var e=t.type(u.head(arguments)),i="string"===e,n="object"===e?u.head(arguments):{};(n=t.extend({},t.summernote.options,n)).langInfo=t.extend(!0,{},t.summernote.lang["en-US"],t.summernote.lang[n.lang]),n.icons=t.extend(!0,{},t.summernote.options.icons,n.icons),n.tooltip="auto"===n.tooltip?!c.isSupportTouch:n.tooltip,this.each(function(e,i){var r=t(i);if(!r.data("summernote")){var o=new p(r,n);r.data("summernote",o),r.data("summernote").triggerEvent("init",o.layoutInfo)}});var r=this.first();if(r.length){var o=r.data("summernote");if(i)return o.invoke.apply(o,u.from(arguments));n.focus&&o.invoke("editor.focus")}return this}});var g=function(e,i,n,r){this.render=function(o){var a=t(e);if(n&&n.contents&&a.html(n.contents),n&&n.className&&a.addClass(n.className),n&&n.data&&t.each(n.data,function(t,e){a.attr("data-"+t,e)}),n&&n.click&&a.on("click",n.click),i){var s=a.find(".note-children-container");i.forEach(function(t){t.render(s.length?s:a)})}return r&&r(a,n),n&&n.callback&&n.callback(a),o&&o.append(a),a}},m={create:function(e,i){return function(){var n=t.isArray(arguments[0])?arguments[0]:[],r="object"==typeof arguments[1]?arguments[1]:arguments[0];return r&&r.children&&(n=r.children),new g(e,n,r,i)}}},v=m.create('<div class="note-editor note-frame panel panel-default"/>'),y=m.create('<div class="note-toolbar panel-heading"/>'),b=m.create('<div class="note-editing-area"/>'),x=m.create('<textarea class="note-codable"/>'),_=m.create('<div class="note-editable panel-body" contentEditable="true"/>'),w=m.create(['<div class="note-statusbar">',' <div class="note-resizebar">',' <div class="note-icon-bar"/>',' <div class="note-icon-bar"/>',' <div class="note-icon-bar"/>'," </div>","</div>"].join("")),S=m.create('<div class="note-editor"/>'),C=m.create('<div class="note-editable" contentEditable="true"/>'),k=m.create('<div class="note-btn-group btn-group">'),T=m.create('<div class="dropdown-menu">',function(e,i){var n=t.isArray(i.items)?i.items.map(function(t){var e="string"==typeof t?t:t.value||"",n=i.template?i.template(t):t,r="object"==typeof t?t.option:void 0;return'<li><a href="#" '+('data-value="'+e+'"'+(void 0!==r?' data-option="'+r+'"':""))+">"+n+"</a></li>"}).join(""):i.items;e.html(n)}),A=m.create('<div class="dropdown-menu note-check">',function(e,i){var n=t.isArray(i.items)?i.items.map(function(t){var e="string"==typeof t?t:t.value||"",n=i.template?i.template(t):t;return'<li><a href="#" data-value="'+e+'">'+D(i.checkClassName)+" "+n+"</a></li>"}).join(""):i.items;e.html(n)}),D=function(t,e){return"<"+(e=e||"i")+' class="'+t+'"/>'},M={editor:v,toolbar:y,editingArea:b,codable:x,editable:_,statusbar:w,airEditor:S,airEditable:C,buttonGroup:k,dropdown:T,dropdownButtonContents:function(t,e){return t+" "+D(e.icons.caret,"span")},dropdownCheck:A,palette:m.create('<div class="note-color-palette"/>',function(t,e){for(var i=[],n=0,r=e.colors.length;n<r;n++){for(var o=e.eventName,a=e.colors[n],s=[],l=0,c=a.length;l<c;l++){var h=a[l];s.push(['<button type="button" class="note-color-btn"','style="background-color:',h,'" ','data-event="',o,'" ','data-value="',h,'" ','title="',h,'" ','data-toggle="button" tabindex="-1"></button>'].join(""))}i.push('<div class="note-color-row">'+s.join("")+"</div>")}t.html(i.join("")),e.tooltip&&t.find(".note-color-btn").tooltip({container:"body",trigger:"hover",placement:"bottom"})}),dialog:m.create('<div class="modal" aria-hidden="false" tabindex="-1"/>',function(t,e){e.fade&&t.addClass("fade"),t.html(['<div class="modal-dialog">',' <div class="modal-content">',e.title?' <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">'+e.title+"</h4> </div>":"",' <div class="modal-body">'+e.body+"</div>",e.footer?' <div class="modal-footer">'+e.footer+"</div>":""," </div>","</div>"].join(""))}),popover:m.create(['<div class="note-popover popover in">',' <div class="arrow"/>',' <div class="popover-content note-children-container"/>',"</div>"].join(""),function(t,e){var i=void 0!==e.direction?e.direction:"bottom";t.addClass(i),e.hideArrow&&t.find(".arrow").hide()}),checkbox:m.create('<div class="checkbox"></div>',function(t,e){t.html([" <label"+(e.id?' for="'+e.id+'"':"")+">",' <input type="checkbox"'+(e.id?' id="'+e.id+'"':""),(e.checked?" checked":"")+"/>",e.text?e.text:"","</label>"].join(""))}),icon:D,options:{},button:function(t,e){return m.create('<button type="button" class="note-btn btn btn-default btn-sm" tabindex="-1">',function(t,e){e&&e.tooltip&&self.options.tooltip&&t.attr({title:e.tooltip}).tooltip({container:"body",trigger:"hover",placement:"bottom"})})(t,e)},toggleBtn:function(t,e){t.toggleClass("disabled",!e),t.attr("disabled",!e)},toggleBtnActive:function(t,e){t.toggleClass("active",e)},onDialogShown:function(t,e){t.one("shown.bs.modal",e)},onDialogHidden:function(t,e){t.one("hidden.bs.modal",e)},showDialog:function(t){t.modal("show")},hideDialog:function(t){t.modal("hide")},createLayout:function(t,e){self.options=e;var i=(e.airMode?M.airEditor([M.editingArea([M.airEditable()])]):M.editor([M.toolbar(),M.editingArea([M.codable(),M.editable()]),M.statusbar()])).render();return i.insertAfter(t),{note:t,editor:i,toolbar:i.find(".note-toolbar"),editingArea:i.find(".note-editing-area"),editable:i.find(".note-editable"),codable:i.find(".note-codable"),statusbar:i.find(".note-statusbar")}},removeLayout:function(t,e){t.html(e.editable.html()),e.editor.remove(),t.show()}};t.summernote=t.summernote||{lang:{}},t.extend(t.summernote.lang,{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize Full",resizeHalf:"Resize Half",resizeQuarter:"Resize Quarter",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Float None",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image"},video:{video:"Video",videoLink:"Video Link",insert:"Insert Video",url:"Video URL?",providers:"(YouTube, Vimeo, Vine, Instagram, DailyMotion or Youku)"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table",addRowAbove:"Add row above",addRowBelow:"Add row below",addColLeft:"Add column left",addColRight:"Add column right",delRow:"Delete row",delCol:"Delete column",delTable:"Delete table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",p:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Foreground Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},help:{insertParagraph:"Insert Paragraph",undo:"Undoes the last command",redo:"Redoes the last command",tab:"Tab",untab:"Untab",bold:"Set a bold style",italic:"Set a italic style",underline:"Set a underline style",strikethrough:"Set a strikethrough style",removeFormat:"Clean a style",justifyLeft:"Set left align",justifyCenter:"Set center align",justifyRight:"Set right align",justifyFull:"Set full align",insertUnorderedList:"Toggle unordered list",insertOrderedList:"Toggle ordered list",outdent:"Outdent on current paragraph",indent:"Indent on current paragraph",formatPara:"Change current block's format as a paragraph(P tag)",formatH1:"Change current block's format as H1",formatH2:"Change current block's format as H2",formatH3:"Change current block's format as H3",formatH4:"Change current block's format as H4",formatH5:"Change current block's format as H5",formatH6:"Change current block's format as H6",insertHorizontalRule:"Insert horizontal rule","linkDialog.show":"Show Link Dialog"},history:{undo:"Undo",redo:"Redo"},specialChar:{specialChar:"SPECIAL CHARACTERS",select:"Select Special characters"}}});var E=function(){var t={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,DELETE:46,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,V:86,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221};return{isEdit:function(e){return u.contains([t.BACKSPACE,t.TAB,t.ENTER,t.SPACE,t.DELETE],e)},isMove:function(e){return u.contains([t.LEFT,t.UP,t.RIGHT,t.DOWN],e)},nameFromCode:h.invertObject(t),code:t}}(),P=function(){var e=function(t,e){var i,n,r=t.parentElement(),o=document.body.createTextRange(),a=u.from(r.childNodes);for(i=0;i<a.length;i++)if(!f.isText(a[i])){if(o.moveToElementText(a[i]),o.compareEndPoints("StartToStart",t)>=0)break;n=a[i]}if(0!==i&&f.isText(a[i-1])){var s=document.body.createTextRange(),l=null;s.moveToElementText(n||r),s.collapse(!n),l=n?n.nextSibling:r.firstChild;var c=t.duplicate();c.setEndPoint("StartToStart",s);for(var h=c.text.replace(/[\r\n]/g,"").length;h>l.nodeValue.length&&l.nextSibling;)h-=l.nodeValue.length,l=l.nextSibling;l.nodeValue;e&&l.nextSibling&&f.isText(l.nextSibling)&&h===l.nodeValue.length&&(h-=l.nodeValue.length,l=l.nextSibling),r=l,i=h}return{cont:r,offset:i}},i=function(t){var e=function(t,i){var n,r;if(f.isText(t)){var o=f.listPrev(t,h.not(f.isText)),a=u.last(o).previousSibling;n=a||t.parentNode,i+=u.sum(u.tail(o),f.nodeLength),r=!a}else{if(n=t.childNodes[i]||t,f.isText(n))return e(n,0);i=0,r=!1}return{node:n,collapseToStart:r,offset:i}},i=document.body.createTextRange(),n=e(t.node,t.offset);return i.moveToElementText(n.node),i.collapse(n.collapseToStart),i.moveStart("character",n.offset),i},n=function(e,r,o,a){this.sc=e,this.so=r,this.ec=o,this.eo=a;var s=function(){if(c.isW3CRangeSupport){var t=document.createRange();return t.setStart(e,r),t.setEnd(o,a),t}var n=i({node:e,offset:r});return n.setEndPoint("EndToEnd",i({node:o,offset:a})),n};this.getPoints=function(){return{sc:e,so:r,ec:o,eo:a}},this.getStartPoint=function(){return{node:e,offset:r}},this.getEndPoint=function(){return{node:o,offset:a}},this.select=function(){var t=s();if(c.isW3CRangeSupport){var e=document.getSelection();e.rangeCount>0&&e.removeAllRanges(),e.addRange(t)}else t.select();return this},this.scrollIntoView=function(e){var i=t(e).height();return e.scrollTop+i<this.sc.offsetTop&&(e.scrollTop+=Math.abs(e.scrollTop+i-this.sc.offsetTop)),this},this.normalize=function(){var t=function(t,e){if(f.isVisiblePoint(t)&&!f.isEdgePoint(t)||f.isVisiblePoint(t)&&f.isRightEdgePoint(t)&&!e||f.isVisiblePoint(t)&&f.isLeftEdgePoint(t)&&e||f.isVisiblePoint(t)&&f.isBlock(t.node)&&f.isEmpty(t.node))return t;var i=f.ancestor(t.node,f.isBlock);if((f.isLeftEdgePointOf(t,i)||f.isVoid(f.prevPoint(t).node))&&!e||(f.isRightEdgePointOf(t,i)||f.isVoid(f.nextPoint(t).node))&&e){if(f.isVisiblePoint(t))return t;e=!e}return(e?f.nextPointUntil(f.nextPoint(t),f.isVisiblePoint):f.prevPointUntil(f.prevPoint(t),f.isVisiblePoint))||t},e=t(this.getEndPoint(),!1),i=this.isCollapsed()?e:t(this.getStartPoint(),!0);return new n(i.node,i.offset,e.node,e.offset)},this.nodes=function(t,e){t=t||h.ok;var i=e&&e.includeAncestor,n=e&&e.fullyContains,r=this.getStartPoint(),o=this.getEndPoint(),a=[],s=[];return f.walkPoint(r,o,function(e){if(!f.isEditable(e.node)){var r;n?(f.isLeftEdgePoint(e)&&s.push(e.node),f.isRightEdgePoint(e)&&u.contains(s,e.node)&&(r=e.node)):r=i?f.ancestor(e.node,t):e.node,r&&t(r)&&a.push(r)}},!0),u.unique(a)},this.commonAncestor=function(){return f.commonAncestor(e,o)},this.expand=function(t){var i=f.ancestor(e,t),s=f.ancestor(o,t);if(!i&&!s)return new n(e,r,o,a);var l=this.getPoints();return i&&(l.sc=i,l.so=0),s&&(l.ec=s,l.eo=f.nodeLength(s)),new n(l.sc,l.so,l.ec,l.eo)},this.collapse=function(t){return t?new n(e,r,e,r):new n(o,a,o,a)},this.splitText=function(){var t=e===o,i=this.getPoints();return f.isText(o)&&!f.isEdgePoint(this.getEndPoint())&&o.splitText(a),f.isText(e)&&!f.isEdgePoint(this.getStartPoint())&&(i.sc=e.splitText(r),i.so=0,t&&(i.ec=i.sc,i.eo=a-r)),new n(i.sc,i.so,i.ec,i.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var e=this.splitText(),i=e.nodes(null,{fullyContains:!0}),r=f.prevPointUntil(e.getStartPoint(),function(t){return!u.contains(i,t.node)}),o=[];return t.each(i,function(t,e){var i=e.parentNode;r.node!==i&&1===f.nodeLength(i)&&o.push(i),f.remove(e,!1)}),t.each(o,function(t,e){f.remove(e,!1)}),new n(r.node,r.offset,r.node,r.offset).normalize()};var l=function(t){return function(){var i=f.ancestor(e,t);return!!i&&i===f.ancestor(o,t)}};this.isOnEditable=l(f.isEditable),this.isOnList=l(f.isList),this.isOnAnchor=l(f.isAnchor),this.isOnCell=l(f.isCell),this.isOnData=l(f.isData),this.isLeftEdgeOf=function(t){if(!f.isLeftEdgePoint(this.getStartPoint()))return!1;var e=f.ancestor(this.sc,t);return e&&f.isLeftEdgeOf(this.sc,e)},this.isCollapsed=function(){return e===o&&r===a},this.wrapBodyInlineWithPara=function(){if(f.isBodyContainer(e)&&f.isEmpty(e))return e.innerHTML=f.emptyPara,new n(e.firstChild,0,e.firstChild,0);var t=this.normalize();if(f.isParaInline(e)||f.isPara(e))return t;var i;if(f.isInline(t.sc)){var r=f.listAncestor(t.sc,h.not(f.isInline));i=u.last(r),f.isInline(i)||(i=r[r.length-2]||t.sc.childNodes[t.so])}else i=t.sc.childNodes[t.so>0?t.so-1:0];var o=f.listPrev(i,f.isParaInline).reverse();if((o=o.concat(f.listNext(i.nextSibling,f.isParaInline))).length){var a=f.wrap(u.head(o),"p");f.appendChildNodes(a,u.tail(o))}return this.normalize()},this.insertNode=function(t){var e=this.wrapBodyInlineWithPara().deleteContents(),i=f.splitPoint(e.getStartPoint(),f.isInline(t));return i.rightNode?i.rightNode.parentNode.insertBefore(t,i.rightNode):i.container.appendChild(t),t},this.pasteHTML=function(e){var i=t("<div></div>").html(e)[0],n=u.from(i.childNodes),r=this.wrapBodyInlineWithPara().deleteContents();return n.reverse().map(function(t){return r.insertNode(t)}).reverse()},this.toString=function(){var t=s();return c.isW3CRangeSupport?t.toString():t.text},this.getWordRange=function(t){var e=this.getEndPoint();if(!f.isCharPoint(e))return this;var i=f.prevPointUntil(e,function(t){return!f.isCharPoint(t)});return t&&(e=f.nextPointUntil(e,function(t){return!f.isCharPoint(t)})),new n(i.node,i.offset,e.node,e.offset)},this.bookmark=function(t){return{s:{path:f.makeOffsetPath(t,e),offset:r},e:{path:f.makeOffsetPath(t,o),offset:a}}},this.paraBookmark=function(t){return{s:{path:u.tail(f.makeOffsetPath(u.head(t),e)),offset:r},e:{path:u.tail(f.makeOffsetPath(u.last(t),o)),offset:a}}},this.getClientRects=function(){return s().getClientRects()}};return{create:function(t,e,i,r){if(4===arguments.length)return new n(t,e,i,r);if(2===arguments.length)return i=t,r=e,new n(t,e,i,r);var o=this.createFromSelection();return o||1!==arguments.length?o:(o=this.createFromNode(arguments[0])).collapse(f.emptyPara===arguments[0].innerHTML)},createFromSelection:function(){var t,i,r,o;if(c.isW3CRangeSupport){var a=document.getSelection();if(!a||0===a.rangeCount)return null;if(f.isBody(a.anchorNode))return null;var s=a.getRangeAt(0);t=s.startContainer,i=s.startOffset,r=s.endContainer,o=s.endOffset}else{var l=document.selection.createRange(),h=l.duplicate();h.collapse(!1);var u=l;u.collapse(!0);var d=e(u,!0),p=e(h,!1);f.isText(d.node)&&f.isLeftEdgePoint(d)&&f.isTextNode(p.node)&&f.isRightEdgePoint(p)&&p.node.nextSibling===d.node&&(d=p),t=d.cont,i=d.offset,r=p.cont,o=p.offset}return new n(t,i,r,o)},createFromNode:function(t){var e=t,i=0,n=t,r=f.nodeLength(n);return f.isVoid(e)&&(i=f.listPrev(e).length-1,e=e.parentNode),f.isBR(n)?(r=f.listPrev(n).length-1,n=n.parentNode):f.isVoid(n)&&(r=f.listPrev(n).length,n=n.parentNode),this.create(e,i,n,r)},createFromNodeBefore:function(t){return this.createFromNode(t).collapse(!0)},createFromNodeAfter:function(t){return this.createFromNode(t).collapse()},createFromBookmark:function(t,e){var i=f.fromOffsetPath(t,e.s.path),r=e.s.offset,o=f.fromOffsetPath(t,e.e.path),a=e.e.offset;return new n(i,r,o,a)},createFromParaBookmark:function(t,e){var i=t.s.offset,r=t.e.offset,o=f.fromOffsetPath(u.head(e),t.s.path),a=f.fromOffsetPath(u.last(e),t.e.path);return new n(o,i,a,r)}}}(),L={readFileAsDataURL:function(e){return t.Deferred(function(i){t.extend(new FileReader,{onload:function(t){var e=t.target.result;i.resolve(e)},onerror:function(){i.reject(this)}}).readAsDataURL(e)}).promise()},createImage:function(e){return t.Deferred(function(i){var n=t("<img>");n.one("load",function(){n.off("error abort"),i.resolve(n)}).one("error abort",function(){n.off("load").detach(),i.reject(n)}).css({display:"none"}).appendTo(document.body).attr("src",e)}).promise()}},I=function(t){var e=[],i=-1,n=t[0],r=function(){var e=P.create(n);return{contents:t.html(),bookmark:e?e.bookmark(n):{s:{path:[],offset:0},e:{path:[],offset:0}}}},o=function(e){null!==e.contents&&t.html(e.contents),null!==e.bookmark&&P.createFromBookmark(n,e.bookmark).select()};this.rewind=function(){t.html()!==e[i].contents&&this.recordUndo(),o(e[i=0])},this.reset=function(){e=[],i=-1,t.html(""),this.recordUndo()},this.undo=function(){t.html()!==e[i].contents&&this.recordUndo(),0<i&&o(e[--i])},this.redo=function(){e.length-1>i&&o(e[++i])},this.recordUndo=function(){i++,e.length>i&&(e=e.slice(0,i)),e.push(r())}},O=function(){var e=function(e,i){if(c.jqueryVersion<1.9){var n={};return t.each(i,function(t,i){n[i]=e.css(i)}),n}return e.css.call(e,i)};this.fromNode=function(t){var i=e(t,["font-family","font-size","text-align","list-style-type","line-height"])||{};return i["font-size"]=parseInt(i["font-size"],10),i},this.stylePara=function(e,i){t.each(e.nodes(f.isPara,{includeAncestor:!0}),function(e,n){t(n).css(i)})},this.styleNodes=function(e,i){e=e.splitText();var n=i&&i.nodeName||"SPAN",r=!(!i||!i.expandClosestSibling),o=!(!i||!i.onlyPartialContains);if(e.isCollapsed())return[e.insertNode(f.create(n))];var a=f.makePredByNodeName(n),s=e.nodes(f.isText,{fullyContains:!0}).map(function(t){return f.singleChildAncestor(t,a)||f.wrap(t,n)});if(r){if(o){var l=e.nodes();a=h.and(a,function(t){return u.contains(l,t)})}return s.map(function(e){var i=f.withClosestSiblings(e,a),n=u.head(i),r=u.tail(i);return t.each(r,function(t,e){f.appendChildNodes(n,e.childNodes),f.remove(e)}),u.head(i)})}return s},this.current=function(e){var i=t(f.isElement(e.sc)?e.sc:e.sc.parentNode),n=this.fromNode(i);try{n=t.extend(n,{"font-bold":document.queryCommandState("bold")?"bold":"normal","font-italic":document.queryCommandState("italic")?"italic":"normal","font-underline":document.queryCommandState("underline")?"underline":"normal","font-subscript":document.queryCommandState("subscript")?"subscript":"normal","font-superscript":document.queryCommandState("superscript")?"superscript":"normal","font-strikethrough":document.queryCommandState("strikethrough")?"strikethrough":"normal","font-family":document.queryCommandValue("fontname")||n["font-family"]})}catch(t){}if(e.isOnList()){var r=t.inArray(n["list-style-type"],["circle","disc","disc-leading-zero","square"])>-1;n["list-style"]=r?"unordered":"ordered"}else n["list-style"]="none";var o=f.ancestor(e.sc,f.isPara);if(o&&o.style["line-height"])n["line-height"]=o.style.lineHeight;else{var a=parseInt(n["line-height"],10)/parseInt(n["font-size"],10);n["line-height"]=a.toFixed(1)}return n.anchor=e.isOnAnchor()&&f.ancestor(e.sc,f.isAnchor),n.ancestors=f.listAncestor(e.sc,f.isEditable),n.range=e,n}},R=function(){var e=this;this.insertOrderedList=function(t){this.toggleList("OL",t)},this.insertUnorderedList=function(t){this.toggleList("UL",t)},this.indent=function(e){var i=this,n=P.create(e).wrapBodyInlineWithPara(),r=n.nodes(f.isPara,{includeAncestor:!0}),o=u.clusterBy(r,h.peq2("parentNode"));t.each(o,function(e,n){var r=u.head(n);f.isLi(r)?i.wrapList(n,r.parentNode.nodeName):t.each(n,function(e,i){t(i).css("marginLeft",function(t,e){return(parseInt(e,10)||0)+25})})}),n.select()},this.outdent=function(e){var i=this,n=P.create(e).wrapBodyInlineWithPara(),r=n.nodes(f.isPara,{includeAncestor:!0}),o=u.clusterBy(r,h.peq2("parentNode"));t.each(o,function(e,n){var r=u.head(n);f.isLi(r)?i.releaseList([n]):t.each(n,function(e,i){t(i).css("marginLeft",function(t,e){return(e=parseInt(e,10)||0)>25?e-25:""})})}),n.select()},this.toggleList=function(i,n){var r=P.create(n).wrapBodyInlineWithPara(),o=r.nodes(f.isPara,{includeAncestor:!0}),a=r.paraBookmark(o),s=u.clusterBy(o,h.peq2("parentNode"));if(u.find(o,f.isPurePara)){var l=[];t.each(s,function(t,n){l=l.concat(e.wrapList(n,i))}),o=l}else{var c=r.nodes(f.isList,{includeAncestor:!0}).filter(function(e){return!t.nodeName(e,i)});c.length?t.each(c,function(t,e){f.replace(e,i)}):o=this.releaseList(s,!0)}P.createFromParaBookmark(a,o).select()},this.wrapList=function(t,e){var i=u.head(t),n=u.last(t),r=f.isList(i.previousSibling)&&i.previousSibling,o=f.isList(n.nextSibling)&&n.nextSibling,a=r||f.insertAfter(f.create(e||"UL"),n);return t=t.map(function(t){return f.isPurePara(t)?f.replace(t,"LI"):t}),f.appendChildNodes(a,t),o&&(f.appendChildNodes(a,u.from(o.childNodes)),f.remove(o)),t},this.releaseList=function(e,i){var n=[];return t.each(e,function(e,r){var o=u.head(r),a=u.last(r),s=i?f.lastAncestor(o,f.isList):o.parentNode,l=s.childNodes.length>1?f.splitTree(s,{node:a.parentNode,offset:f.position(a)+1},{isSkipPaddingBlankHTML:!0}):null,c=f.splitTree(s,{node:o.parentNode,offset:f.position(o)},{isSkipPaddingBlankHTML:!0});r=i?f.listDescendant(c,f.isLi):u.from(c.childNodes).filter(f.isLi),!i&&f.isList(s.parentNode)||(r=r.map(function(t){return f.replace(t,"P")})),t.each(u.from(r).reverse(),function(t,e){f.insertAfter(e,s)});var h=u.compact([s,c,l]);t.each(h,function(e,i){var n=[i].concat(f.listDescendant(i,f.isList));t.each(n.reverse(),function(t,e){f.nodeLength(e)||f.remove(e,!0)})}),n=n.concat(r)}),n}},N=function(){var e=new R;this.insertTab=function(t,e){var i=f.createText(new Array(e+1).join(f.NBSP_CHAR));(t=t.deleteContents()).insertNode(i,!0),(t=P.create(i,e)).select()},this.insertParagraph=function(i){var n=P.create(i);n=(n=n.deleteContents()).wrapBodyInlineWithPara();var r,o=f.ancestor(n.sc,f.isPara);if(o){if(f.isEmpty(o)&&f.isLi(o))return void e.toggleList(o.parentNode.nodeName);if(f.isEmpty(o)&&f.isPara(o)&&f.isBlockquote(o.parentNode))f.insertAfter(o,o.parentNode),r=o;else{r=f.splitTree(o,n.getStartPoint());var a=f.listDescendant(o,f.isEmptyAnchor);a=a.concat(f.listDescendant(r,f.isEmptyAnchor)),t.each(a,function(t,e){f.remove(e)}),(f.isHeading(r)||f.isPre(r)||f.isCustomStyleTag(r))&&f.isEmpty(r)&&(r=f.replace(r,"p"))}}else{var s=n.sc.childNodes[n.so];r=t(f.emptyPara)[0],s?n.sc.insertBefore(r,s):n.sc.appendChild(r)}P.create(r,0).normalize().select().scrollIntoView(i)}},F=function(t,e,i,n){function r(){t&&t.tagName&&("td"===t.tagName.toLowerCase()||"th"===t.tagName.toLowerCase())?(f.colPos=t.cellIndex,t.parentElement&&t.parentElement.tagName&&"tr"===t.parentElement.tagName.toLowerCase()?f.rowPos=t.parentElement.rowIndex:console.error("Impossible to identify start Row point.",t)):console.error("Impossible to identify start Cell point.",t)}function o(t,e,i,n,r,o,a){var s={baseRow:i,baseCell:n,isRowSpan:r,isColSpan:o,isVirtual:a};p[t]||(p[t]=[]),p[t][e]=s}function a(t,e,i,n){return{baseCell:t.baseCell,action:e,virtualTable:{rowIndex:i,cellIndex:n}}}function s(t,e){if(!p[t])return e;if(!p[t][e])return e;for(var i=e;p[t][i];)if(i++,!p[t][i])return i}function l(t,e){var i=s(t.rowIndex,e.cellIndex),n=e.colSpan>1,r=e.rowSpan>1,a=t.rowIndex===f.rowPos&&e.cellIndex===f.colPos;o(t.rowIndex,i,t,e,r,n,!1);var l=e.attributes.rowSpan?parseInt(e.attributes.rowSpan.value,10):0;if(l>1)for(var h=1;h<l;h++){var u=t.rowIndex+h;c(u,i,e,a),o(u,i,t,e,!0,n,!0)}var d=e.attributes.colSpan?parseInt(e.attributes.colSpan.value,10):0;if(d>1)for(var p=1;p<d;p++){var g=s(t.rowIndex,i+p);c(t.rowIndex,g,e,a),o(t.rowIndex,g,t,e,r,!0,!0)}}function c(t,e,i,n){t===f.rowPos&&f.colPos>=i.cellIndex&&i.cellIndex<=e&&!n&&f.colPos++}function h(){for(var t=n.rows,e=0;e<t.length;e++)for(var i=t[e].cells,r=0;r<i.length;r++)l(t[e],i[r])}function u(t){switch(e){case F.where.Column:if(t.isColSpan)return F.resultAction.SubtractSpanCount;break;case F.where.Row:if(!t.isVirtual&&t.isRowSpan)return F.resultAction.AddCell;if(t.isRowSpan)return F.resultAction.SubtractSpanCount}return F.resultAction.RemoveCell}function d(t){switch(e){case F.where.Column:if(t.isColSpan)return F.resultAction.SumSpanCount;if(t.isRowSpan&&t.isVirtual)return F.resultAction.Ignore;break;case F.where.Row:if(t.isRowSpan)return F.resultAction.SumSpanCount;if(t.isColSpan&&t.isVirtual)return F.resultAction.Ignore}return F.resultAction.AddCell}var f={colPos:0,rowPos:0},p=[],g=[];this.getActionList=function(){for(var t=e===F.where.Row?f.rowPos:-1,n=e===F.where.Column?f.colPos:-1,r=0,o=!0;o;){var s=t>=0?t:r,l=n>=0?n:r,c=p[s];if(!c)return o=!1,g;var h=c[l];if(!h)return o=!1,g;var m=F.resultAction.Ignore;switch(i){case F.requestAction.Add:m=d(h);break;case F.requestAction.Delete:m=u(h)}g.push(a(h,m,s,l)),r++}return g},r(),h()};F.where={Row:0,Column:1},F.requestAction={Add:0,Delete:1},F.resultAction={Ignore:0,SubtractSpanCount:1,RemoveCell:2,AddCell:3,SumSpanCount:4};var z,H=function(){this.tab=function(t,e){var i=f.ancestor(t.commonAncestor(),f.isCell),n=f.ancestor(i,f.isTable),r=f.listDescendant(n,f.isCell),o=u[e?"prev":"next"](r,i);o&&P.create(o,0).select()},this.addRow=function(e,i){for(var n=f.ancestor(e.commonAncestor(),f.isCell),r=t(n).closest("tr"),o=this.recoverAttributes(r),a=t("<tr"+o+"></tr>"),s=new F(n,F.where.Row,F.requestAction.Add,t(r).closest("table")[0]).getActionList(),l=0;l<s.length;l++){var c=s[l],h=this.recoverAttributes(c.baseCell);switch(c.action){case F.resultAction.AddCell:a.append("<td"+h+">"+f.blank+"</td>");break;case F.resultAction.SumSpanCount:if("top"===i&&(c.baseCell.parent?c.baseCell.closest("tr").rowIndex:0)<=r[0].rowIndex){var u=t("<div></div>").append(t("<td"+h+">"+f.blank+"</td>").removeAttr("rowspan")).html();a.append(u);break}var d=parseInt(c.baseCell.rowSpan,10);d++,c.baseCell.setAttribute("rowSpan",d)}}if("top"===i)r.before(a);else{if(n.rowSpan>1){var p=r[0].rowIndex+(n.rowSpan-2);return void t(t(r).parent().find("tr")[p]).after(t(a))}r.after(a)}},this.addCol=function(e,i){var n=f.ancestor(e.commonAncestor(),f.isCell),r=t(n).closest("tr");t(r).siblings().push(r);for(var o=new F(n,F.where.Column,F.requestAction.Add,t(r).closest("table")[0]).getActionList(),a=0;a<o.length;a++){var s=o[a],l=this.recoverAttributes(s.baseCell);switch(s.action){case F.resultAction.AddCell:"right"===i?t(s.baseCell).after("<td"+l+">"+f.blank+"</td>"):t(s.baseCell).before("<td"+l+">"+f.blank+"</td>");break;case F.resultAction.SumSpanCount:if("right"===i){var c=parseInt(s.baseCell.colSpan,10);c++,s.baseCell.setAttribute("colSpan",c)}else t(s.baseCell).before("<td"+l+">"+f.blank+"</td>")}}},this.recoverAttributes=function(t){var e="";if(!t)return e;for(var i=t.attributes||[],n=0;n<i.length;n++)"id"!==i[n].name.toLowerCase()&&i[n].specified&&(e+=" "+i[n].name+"='"+i[n].value+"'");return e},this.deleteRow=function(e){for(var i=f.ancestor(e.commonAncestor(),f.isCell),n=t(i).closest("tr"),r=n.children("td, th").index(t(i)),o=n[0].rowIndex,a=new F(i,F.where.Row,F.requestAction.Delete,t(n).closest("table")[0]).getActionList(),s=0;s<a.length;s++)if(a[s]){var l=a[s].baseCell,c=a[s].virtualTable,h=l.rowSpan&&l.rowSpan>1,u=h?parseInt(l.rowSpan,10):0;switch(a[s].action){case F.resultAction.Ignore:continue;case F.resultAction.AddCell:var d=n.next("tr")[0];if(!d)continue;var p=n[0].cells[r];h&&(u>2?(u--,d.insertBefore(p,d.cells[r]),d.cells[r].setAttribute("rowSpan",u),d.cells[r].innerHTML=""):2===u&&(d.insertBefore(p,d.cells[r]),d.cells[r].removeAttribute("rowSpan"),d.cells[r].innerHTML=""));continue;case F.resultAction.SubtractSpanCount:h&&(u>2?(u--,l.setAttribute("rowSpan",u),c.rowIndex!==o&&l.cellIndex===r&&(l.innerHTML="")):2===u&&(l.removeAttribute("rowSpan"),c.rowIndex!==o&&l.cellIndex===r&&(l.innerHTML="")));continue;case F.resultAction.RemoveCell:continue}}n.remove()},this.deleteCol=function(e){for(var i=f.ancestor(e.commonAncestor(),f.isCell),n=t(i).closest("tr"),r=n.children("td, th").index(t(i)),o=new F(i,F.where.Column,F.requestAction.Delete,t(n).closest("table")[0]).getActionList(),a=0;a<o.length;a++)if(o[a])switch(o[a].action){case F.resultAction.Ignore:continue;case F.resultAction.SubtractSpanCount:var s=o[a].baseCell;if(s.colSpan&&s.colSpan>1){var l=s.colSpan?parseInt(s.colSpan,10):0;l>2?(l--,s.setAttribute("colSpan",l),s.cellIndex===r&&(s.innerHTML="")):2===l&&(s.removeAttribute("colSpan"),s.cellIndex===r&&(s.innerHTML=""))}continue;case F.resultAction.RemoveCell:f.remove(o[a].baseCell,!0);continue}},this.createTable=function(e,i,n){for(var r,o=[],a=0;a<e;a++)o.push("<td>"+f.blank+"</td>");r=o.join("");for(var s,l=[],c=0;c<i;c++)l.push("<tr>"+r+"</tr>");s=l.join("");var h=t("<table>"+s+"</table>");return n&&n.tableClassName&&h.addClass(n.tableClassName),h[0]},this.deleteTable=function(e){var i=f.ancestor(e.commonAncestor(),f.isCell);t(i).closest("table").remove()}};c.hasCodeMirror&&(c.isSupportAmd?require(["codemirror"],function(t){z=t}):z=window.CodeMirror);t.summernote=t.extend(t.summernote,{version:"0.8.8",ui:M,dom:f,plugins:{},options:{modules:{editor:function(e){var i=this,n=e.layoutInfo.note,r=e.layoutInfo.editor,o=e.layoutInfo.editable,a=e.options,s=a.langInfo,l=o[0],d=null,p=new O,g=new H,m=new N,v=new R,y=new I(o);this.initialize=function(){o.on("keydown",function(t){t.keyCode===E.code.ENTER&&e.triggerEvent("enter",t),e.triggerEvent("keydown",t),t.isDefaultPrevented()||(a.shortcuts?i.handleKeyMap(t):i.preventDefaultEditableShortCuts(t))}).on("keyup",function(t){e.triggerEvent("keyup",t)}).on("focus",function(t){e.triggerEvent("focus",t)}).on("blur",function(t){e.triggerEvent("blur",t)}).on("mousedown",function(t){e.triggerEvent("mousedown",t)}).on("mouseup",function(t){e.triggerEvent("mouseup",t)}).on("scroll",function(t){e.triggerEvent("scroll",t)}).on("paste",function(t){e.triggerEvent("paste",t)}),o.html(f.html(n)||f.emptyPara);var t=c.isMSIE?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input";o.on(t,h.debounce(function(){e.triggerEvent("change",o.html())},100)),r.on("focusin",function(t){e.triggerEvent("focusin",t)}).on("focusout",function(t){e.triggerEvent("focusout",t)}),a.airMode||(a.width&&r.outerWidth(a.width),a.height&&o.outerHeight(a.height),a.maxHeight&&o.css("max-height",a.maxHeight),a.minHeight&&o.css("min-height",a.minHeight)),y.recordUndo()},this.destroy=function(){o.off()},this.handleKeyMap=function(t){var i=a.keyMap[c.isMac?"mac":"pc"],n=[];t.metaKey&&n.push("CMD"),t.ctrlKey&&!t.altKey&&n.push("CTRL"),t.shiftKey&&n.push("SHIFT");var r=E.nameFromCode[t.keyCode];r&&n.push(r);var o=i[n.join("+")];o?(t.preventDefault(),e.invoke(o)):E.isEdit(t.keyCode)&&this.afterCommand()},this.preventDefaultEditableShortCuts=function(t){(t.ctrlKey||t.metaKey)&&u.contains([66,73,85],t.keyCode)&&t.preventDefault()},this.createRange=function(){return this.focus(),P.create(l)},this.saveRange=function(t){d=this.createRange(),t&&d.collapse().select()},this.restoreRange=function(){d&&(d.select(),this.focus())},this.saveTarget=function(t){o.data("target",t)},this.clearTarget=function(){o.removeData("target")},this.restoreTarget=function(){return o.data("target")},this.currentStyle=function(){var t=P.create();return t&&(t=t.normalize()),t?p.current(t):p.fromNode(o)},this.styleFromNode=function(t){return p.fromNode(t)},this.undo=function(){e.triggerEvent("before.command",o.html()),y.undo(),e.triggerEvent("change",o.html())},e.memo("help.undo",s.help.undo),this.redo=function(){e.triggerEvent("before.command",o.html()),y.redo(),e.triggerEvent("change",o.html())},e.memo("help.redo",s.help.redo);for(var b=this.beforeCommand=function(){e.triggerEvent("before.command",o.html()),i.focus()},x=this.afterCommand=function(t){y.recordUndo(),t||e.triggerEvent("change",o.html())},_=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","fontName"],w=0,S=_.length;w<S;w++)this[_[w]]=function(t){return function(e){b(),document.execCommand(t,!1,e),x(!0)}}(_[w]),e.memo("help."+_[w],s.help[_[w]]);this.tab=function(){var t=this.createRange();t.isCollapsed()&&t.isOnCell()?g.tab(t):(b(),m.insertTab(t,a.tabSize),x())},e.memo("help.tab",s.help.tab),this.untab=function(){var t=this.createRange();t.isCollapsed()&&t.isOnCell()&&g.tab(t,!0)},e.memo("help.untab",s.help.untab),this.wrapCommand=function(t){return function(){b(),t.apply(i,arguments),x()}},this.insertParagraph=this.wrapCommand(function(){m.insertParagraph(l)}),e.memo("help.insertParagraph",s.help.insertParagraph),this.insertOrderedList=this.wrapCommand(function(){v.insertOrderedList(l)}),e.memo("help.insertOrderedList",s.help.insertOrderedList),this.insertUnorderedList=this.wrapCommand(function(){v.insertUnorderedList(l)}),e.memo("help.insertUnorderedList",s.help.insertUnorderedList),this.indent=this.wrapCommand(function(){v.indent(l)}),e.memo("help.indent",s.help.indent),this.outdent=this.wrapCommand(function(){v.outdent(l)}),e.memo("help.outdent",s.help.outdent),this.insertImage=function(t,i){return L.createImage(t,i).then(function(t){b(),"function"==typeof i?i(t):("string"==typeof i&&t.attr("data-filename",i),t.css("width",Math.min(o.width(),t.width()))),t.show(),P.create(l).insertNode(t[0]),P.createFromNodeAfter(t[0]).select(),x()}).fail(function(t){e.triggerEvent("image.upload.error",t)})},this.insertImages=function(n){t.each(n,function(t,n){var r=n.name;a.maximumImageFileSize&&a.maximumImageFileSize<n.size?e.triggerEvent("image.upload.error",s.image.maximumFileSizeError):L.readFileAsDataURL(n).then(function(t){return i.insertImage(t,r)}).fail(function(){e.triggerEvent("image.upload.error")})})},this.insertImagesOrCallback=function(t){a.callbacks.onImageUpload?e.triggerEvent("image.upload",t):this.insertImages(t)},this.insertNode=this.wrapCommand(function(t){this.createRange().insertNode(t),P.createFromNodeAfter(t).select()}),this.insertText=this.wrapCommand(function(t){var e=this.createRange().insertNode(f.createText(t));P.create(e,f.nodeLength(e)).select()}),this.getSelectedText=function(){var t=this.createRange();return t.isOnAnchor()&&(t=P.createFromNode(f.ancestor(t.sc,f.isAnchor))),t.toString()},this.pasteHTML=this.wrapCommand(function(t){var e=this.createRange().pasteHTML(t);P.createFromNodeAfter(u.last(e)).select()}),this.formatBlock=this.wrapCommand(function(t,i){var n=e.options.callbacks.onApplyCustomStyle;n?n.call(this,i,e,this.onFormatBlock):this.onFormatBlock(t)}),this.onFormatBlock=function(t){t=c.isMSIE?"<"+t+">":t,document.execCommand("FormatBlock",!1,t)},this.formatPara=function(){this.formatBlock("P")},e.memo("help.formatPara",s.help.formatPara);for(w=1;w<=6;w++)this["formatH"+w]=function(t){return function(){this.formatBlock("H"+t)}}(w),e.memo("help.formatH"+w,s.help["formatH"+w]);this.fontSize=function(e){var i=this.createRange();if(i&&i.isCollapsed()){var n=p.styleNodes(i),r=u.head(n);t(n).css({"font-size":e+"px"}),r&&!f.nodeLength(r)&&(r.innerHTML=f.ZERO_WIDTH_NBSP_CHAR,P.createFromNodeAfter(r.firstChild).select(),o.data("bogus",r))}else b(),t(p.styleNodes(i)).css({"font-size":e+"px"}),x()},this.insertHorizontalRule=this.wrapCommand(function(){var t=this.createRange().insertNode(f.create("HR"));t.nextSibling&&P.create(t.nextSibling,0).normalize().select()}),e.memo("help.insertHorizontalRule",s.help.insertHorizontalRule),this.removeBogus=function(){var t=o.data("bogus");if(t){var e=u.find(u.from(t.childNodes),f.isText),i=e.nodeValue.indexOf(f.ZERO_WIDTH_NBSP_CHAR);-1!==i&&e.deleteData(i,1),f.isEmpty(t)&&f.remove(t),o.removeData("bogus")}},this.lineHeight=this.wrapCommand(function(t){p.stylePara(this.createRange(),{lineHeight:t})}),this.unlink=function(){var t=this.createRange();if(t.isOnAnchor()){var e=f.ancestor(t.sc,f.isAnchor);(t=P.createFromNode(e)).select(),b(),document.execCommand("unlink"),x()}},this.createLink=this.wrapCommand(function(e){var i=e.url,n=e.text,r=e.isNewWindow,o=e.range||this.createRange(),s=o.toString()!==n;"string"==typeof i&&(i=i.trim()),i=a.onCreateLink?a.onCreateLink(i):/^[A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?/.test(i)?i:"http://"+i;var l=[];if(s){var c=(o=o.deleteContents()).insertNode(t("<A>"+n+"</A>")[0]);l.push(c)}else l=p.styleNodes(o,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});t.each(l,function(e,n){t(n).attr("href",i),r?t(n).attr("target","_blank"):t(n).removeAttr("target")});var h=P.createFromNodeBefore(u.head(l)).getStartPoint(),d=P.createFromNodeAfter(u.last(l)).getEndPoint();P.create(h.node,h.offset,d.node,d.offset).select()}),this.getLinkInfo=function(){var e=this.createRange().expand(f.isAnchor),i=t(u.head(e.nodes(f.isAnchor))),n={range:e,text:e.toString(),url:i.length?i.attr("href"):""};return i.length&&(n.isNewWindow="_blank"===i.attr("target")),n},this.color=this.wrapCommand(function(t){var e=t.foreColor,i=t.backColor;e&&document.execCommand("foreColor",!1,e),i&&document.execCommand("backColor",!1,i)}),this.foreColor=this.wrapCommand(function(t){document.execCommand("styleWithCSS",!1,!0),document.execCommand("foreColor",!1,t)}),this.insertTable=this.wrapCommand(function(t){var e=t.split("x");this.createRange().deleteContents().insertNode(g.createTable(e[0],e[1],a))}),this.addRow=function(t){var e=this.createRange(o);e.isCollapsed()&&e.isOnCell()&&(b(),g.addRow(e,t),x())},this.addCol=function(t){var e=this.createRange(o);e.isCollapsed()&&e.isOnCell()&&(b(),g.addCol(e,t),x())},this.deleteRow=function(){var t=this.createRange(o);t.isCollapsed()&&t.isOnCell()&&(b(),g.deleteRow(t),x())},this.deleteCol=function(){var t=this.createRange(o);t.isCollapsed()&&t.isOnCell()&&(b(),g.deleteCol(t),x())},this.deleteTable=function(){var t=this.createRange(o);t.isCollapsed()&&t.isOnCell()&&(b(),g.deleteTable(t),x())},this.floatMe=this.wrapCommand(function(e){var i=t(this.restoreTarget());i.toggleClass("note-float-left","left"===e),i.toggleClass("note-float-right","right"===e),i.css("float",e)}),this.resize=this.wrapCommand(function(e){t(this.restoreTarget()).css({width:100*e+"%",height:""})}),this.resizeTo=function(t,e,i){var n;if(i){var r=t.y/t.x,o=e.data("ratio");n={width:o>r?t.x:t.y/o,height:o>r?t.x*o:t.y}}else n={width:t.x,height:t.y};e.css(n)},this.removeMedia=this.wrapCommand(function(){var i=t(this.restoreTarget()).detach();e.triggerEvent("media.delete",i,o)}),this.hasFocus=function(){return o.is(":focus")},this.focus=function(){this.hasFocus()||o.focus()},this.isEmpty=function(){return f.isEmpty(o[0])||f.emptyPara===o.html()},this.empty=function(){e.invoke("code",f.emptyPara)}},clipboard:function(e){var i=this,n=e.layoutInfo.editable;this.events={"summernote.keydown":function(t,n){i.needKeydownHook()&&(n.ctrlKey||n.metaKey)&&n.keyCode===E.code.V&&(e.invoke("editor.saveRange"),i.$paste.focus(),setTimeout(function(){i.pasteByHook()},0))}},this.needKeydownHook=function(){return c.isMSIE&&c.browserVersion>10||c.isFF},this.initialize=function(){this.needKeydownHook()?(this.$paste=t('<div tabindex="-1" />').attr("contenteditable",!0).css({position:"absolute",left:-1e5,opacity:0}),n.before(this.$paste),this.$paste.on("paste",function(t){e.triggerEvent("paste",t)})):n.on("paste",this.pasteByEvent)},this.destroy=function(){this.needKeydownHook()&&(this.$paste.remove(),this.$paste=null)},this.pasteByHook=function(){var i=this.$paste[0].firstChild,n=i&&i.src;if(f.isImg(i)&&0===n.indexOf("data:")){for(var r=atob(i.src.split(",")[1]),o=new Uint8Array(r.length),a=0;a<r.length;a++)o[a]=r.charCodeAt(a);var s=new Blob([o],{type:"image/png"});s.name="clipboard.png",e.invoke("editor.restoreRange"),e.invoke("editor.focus"),e.invoke("editor.insertImagesOrCallback",[s])}else{var l=t("<div />").html(this.$paste.html()).html();e.invoke("editor.restoreRange"),e.invoke("editor.focus"),l&&e.invoke("editor.pasteHTML",l)}this.$paste.empty()},this.pasteByEvent=function(t){var i=t.originalEvent.clipboardData;if(i&&i.items&&i.items.length){var n=u.head(i.items);"file"===n.kind&&-1!==n.type.indexOf("image/")&&e.invoke("editor.insertImagesOrCallback",[n.getAsFile()]),e.invoke("editor.afterCommand")}}},dropzone:function(e){var i=t(document),n=e.layoutInfo.editor,r=e.layoutInfo.editable,o=e.options,a=o.langInfo,s={},l=t(['<div class="note-dropzone">',' <div class="note-dropzone-message"/>',"</div>"].join("")).prependTo(n),c=function(){Object.keys(s).forEach(function(t){i.off(t.substr(2).toLowerCase(),s[t])}),s={}};this.initialize=function(){o.disableDragAndDrop?(s.onDrop=function(t){t.preventDefault()},i.on("drop",s.onDrop)):this.attachDragAndDropEvent()},this.attachDragAndDropEvent=function(){var o=t(),c=l.find(".note-dropzone-message");s.onDragenter=function(t){var i=e.invoke("codeview.isActivated"),r=n.width()>0&&n.height()>0;i||o.length||!r||(n.addClass("dragover"),l.width(n.width()),l.height(n.height()),c.text(a.image.dragImageHere)),o=o.add(t.target)},s.onDragleave=function(t){(o=o.not(t.target)).length||n.removeClass("dragover")},s.onDrop=function(){o=t(),n.removeClass("dragover")},i.on("dragenter",s.onDragenter).on("dragleave",s.onDragleave).on("drop",s.onDrop),l.on("dragenter",function(){l.addClass("hover"),c.text(a.image.dropImage)}).on("dragleave",function(){l.removeClass("hover"),c.text(a.image.dragImageHere)}),l.on("drop",function(i){var n=i.originalEvent.dataTransfer;n&&n.files&&n.files.length?(i.preventDefault(),r.focus(),e.invoke("editor.insertImagesOrCallback",n.files)):t.each(n.types,function(i,r){var o=n.getData(r);r.toLowerCase().indexOf("text")>-1?e.invoke("editor.pasteHTML",o):t(o).each(function(){e.invoke("editor.insertNode",this)})})}).on("dragover",!1)},this.destroy=function(){c()}},codeview:function(t){var e=t.layoutInfo.editor,i=t.layoutInfo.editable,n=t.layoutInfo.codable,r=t.options;this.sync=function(){this.isActivated()&&c.hasCodeMirror&&n.data("cmEditor").save()},this.isActivated=function(){return e.hasClass("codeview")},this.toggle=function(){this.isActivated()?this.deactivate():this.activate(),t.triggerEvent("codeview.toggled")},this.activate=function(){if(n.val(f.html(i,r.prettifyHtml)),n.height(i.height()),t.invoke("toolbar.updateCodeview",!0),e.addClass("codeview"),n.focus(),c.hasCodeMirror){var o=z.fromTextArea(n[0],r.codemirror);if(r.codemirror.tern){var a=new z.TernServer(r.codemirror.tern);o.ternServer=a,o.on("cursorActivity",function(t){a.updateArgHints(t)})}o.setSize(null,i.outerHeight()),n.data("cmEditor",o)}},this.deactivate=function(){if(c.hasCodeMirror){var o=n.data("cmEditor");n.val(o.getValue()),o.toTextArea()}var a=f.value(n,r.prettifyHtml)||f.emptyPara,s=i.html()!==a;i.html(a),i.height(r.height?n.height():"auto"),e.removeClass("codeview"),s&&t.triggerEvent("change",i.html(),i),i.focus(),t.invoke("toolbar.updateCodeview",!1)},this.destroy=function(){this.isActivated()&&this.deactivate()}},statusbar:function(e){var i=t(document),n=e.layoutInfo.statusbar,r=e.layoutInfo.editable,o=e.options;this.initialize=function(){o.airMode||o.disableResizeEditor?this.destroy():n.on("mousedown",function(t){t.preventDefault(),t.stopPropagation();var e=r.offset().top-i.scrollTop(),n=function(t){var i=t.clientY-(e+24);i=o.minheight>0?Math.max(i,o.minheight):i,i=o.maxHeight>0?Math.min(i,o.maxHeight):i,r.height(i)};i.on("mousemove",n).one("mouseup",function(){i.off("mousemove",n)})})},this.destroy=function(){n.off(),n.remove()}},fullscreen:function(e){var i=this,n=e.layoutInfo.editor,r=e.layoutInfo.toolbar,o=e.layoutInfo.editable,a=e.layoutInfo.codable,s=t(window),l=t("html, body");this.resizeTo=function(t){o.css("height",t.h),a.css("height",t.h),a.data("cmeditor")&&a.data("cmeditor").setsize(null,t.h)},this.onResize=function(){i.resizeTo({h:s.height()-r.outerHeight()})},this.toggle=function(){n.toggleClass("fullscreen"),this.isFullscreen()?(o.data("orgHeight",o.css("height")),s.on("resize",this.onResize).trigger("resize"),l.css("overflow","hidden")):(s.off("resize",this.onResize),this.resizeTo({h:o.data("orgHeight")}),l.css("overflow","visible")),e.invoke("toolbar.updateFullscreen",this.isFullscreen())},this.isFullscreen=function(){return n.hasClass("fullscreen")}},handle:function(e){var i=this,n=t(document),r=e.layoutInfo.editingArea,o=e.options;this.events={"summernote.mousedown":function(t,e){i.update(e.target)&&e.preventDefault()},"summernote.keyup summernote.scroll summernote.change summernote.dialog.shown":function(){i.update()},"summernote.disable":function(){i.hide()},"summernote.codeview.toggled":function(){i.update()}},this.initialize=function(){this.$handle=t(['<div class="note-handle">','<div class="note-control-selection">','<div class="note-control-selection-bg"></div>','<div class="note-control-holder note-control-nw"></div>','<div class="note-control-holder note-control-ne"></div>','<div class="note-control-holder note-control-sw"></div>','<div class="',o.disableResizeImage?"note-control-holder":"note-control-sizing",' note-control-se"></div>',o.disableResizeImage?"":'<div class="note-control-selection-info"></div>',"</div>","</div>"].join("")).prependTo(r),this.$handle.on("mousedown",function(t){if(f.isControlSizing(t.target)){t.preventDefault(),t.stopPropagation();var r=i.$handle.find(".note-control-selection").data("target"),o=r.offset(),a=n.scrollTop(),s=function(t){e.invoke("editor.resizeTo",{x:t.clientX-o.left,y:t.clientY-(o.top-a)},r,!t.shiftKey),i.update(r[0])};n.on("mousemove",s).one("mouseup",function(t){t.preventDefault(),n.off("mousemove",s),e.invoke("editor.afterCommand")}),r.data("ratio")||r.data("ratio",r.height()/r.width())}}),this.$handle.on("wheel",function(t){t.preventDefault(),i.update()})},this.destroy=function(){this.$handle.remove()},this.update=function(i){if(e.isDisabled())return!1;var n=f.isImg(i),r=this.$handle.find(".note-control-selection");if(e.invoke("imagePopover.update",i),n){var o=t(i),a=o.position(),s={left:a.left+parseInt(o.css("marginLeft"),10),top:a.top+parseInt(o.css("marginTop"),10)},l={w:o.outerWidth(!1),h:o.outerHeight(!1)};r.css({display:"block",left:s.left,top:s.top,width:l.w,height:l.h}).data("target",o);var c=l.w+"x"+l.h;r.find(".note-control-selection-info").text(c),e.invoke("editor.saveTarget",i)}else this.hide();return n},this.hide=function(){e.invoke("editor.clearTarget"),this.$handle.children().hide()}},hintPopover:function(e){var i=this,n=t.summernote.ui,r=e.options.hint||[],o=e.options.hintDirection||"bottom",a=t.isArray(r)?r:[r];this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||i.handleKeyup(e)},"summernote.keydown":function(t,e){i.handleKeydown(e)},"summernote.disable summernote.dialog.shown":function(){i.hide()}},this.shouldInitialize=function(){return a.length>0},this.initialize=function(){this.lastWordRange=null,this.$popover=n.popover({className:"note-hint-popover",hideArrow:!0,direction:""}).render().appendTo("body"),this.$popover.hide(),this.$content=this.$popover.find(".popover-content,.note-popover-content"),this.$content.on("click",".note-hint-item",function(){i.$content.find(".active").removeClass("active"),t(this).addClass("active"),i.replace()})},this.destroy=function(){this.$popover.remove()},this.selectItem=function(t){this.$content.find(".active").removeClass("active"),t.addClass("active"),this.$content[0].scrollTop=t[0].offsetTop-this.$content.innerHeight()/2},this.moveDown=function(){var t=this.$content.find(".note-hint-item.active"),e=t.next();if(e.length)this.selectItem(e);else{var i=t.parent().next();i.length||(i=this.$content.find(".note-hint-group").first()),this.selectItem(i.find(".note-hint-item").first())}},this.moveUp=function(){var t=this.$content.find(".note-hint-item.active"),e=t.prev();if(e.length)this.selectItem(e);else{var i=t.parent().prev();i.length||(i=this.$content.find(".note-hint-group").last()),this.selectItem(i.find(".note-hint-item").last())}},this.replace=function(){var t=this.$content.find(".note-hint-item.active");if(t.length){var i=this.nodeFromItem(t);this.lastWordRange.insertNode(i),P.createFromNode(i).collapse().select(),this.lastWordRange=null,this.hide(),e.triggerEvent("change",e.layoutInfo.editable.html(),e.layoutInfo.editable),e.invoke("editor.focus")}},this.nodeFromItem=function(t){var e=a[t.data("index")],i=t.data("item"),n=e.content?e.content(i):i;return"string"==typeof n&&(n=f.createText(n)),n},this.createItemTemplates=function(e,i){var n=a[e];return i.map(function(i,r){var o=t('<div class="note-hint-item"/>');return o.append(n.template?n.template(i):i+""),o.data({index:e,item:i}),0===e&&0===r&&o.addClass("active"),o})},this.handleKeydown=function(t){this.$popover.is(":visible")&&(t.keyCode===E.code.ENTER?(t.preventDefault(),this.replace()):t.keyCode===E.code.UP?(t.preventDefault(),this.moveUp()):t.keyCode===E.code.DOWN&&(t.preventDefault(),this.moveDown()))},this.searchKeyword=function(t,e,i){var n=a[t];if(n&&n.match.test(e)&&n.search){var r=n.match.exec(e);n.search(r[1],i)}else i()},this.createGroup=function(e,n){var r=t('<div class="note-hint-group note-hint-group-'+e+'"/>');return this.searchKeyword(e,n,function(t){(t=t||[]).length&&(r.html(i.createItemTemplates(e,t)),i.show())}),r},this.handleKeyup=function(t){if(u.contains([E.code.ENTER,E.code.UP,E.code.DOWN],t.keyCode)){if(t.keyCode===E.code.ENTER&&this.$popover.is(":visible"))return}else{var n=e.invoke("editor.createRange").getWordRange(),r=n.toString();if(a.length&&r){this.$content.empty();var s=h.rect2bnd(u.last(n.getClientRects()));s&&(this.$popover.hide(),this.lastWordRange=n,a.forEach(function(t,e){t.match.test(r)&&i.createGroup(e,r).appendTo(i.$content)}),"top"===o?this.$popover.css({left:s.left,top:s.top-this.$popover.outerHeight()-5}):this.$popover.css({left:s.left,top:s.top+s.height+5}))}else this.hide()}},this.show=function(){this.$popover.show()},this.hide=function(){this.$popover.hide()}},autoLink:function(e){var i=this,n=/^([A-Za-z][A-Za-z0-9+-.]*\:[\/\/]?|mailto:[A-Z0-9._%+-]+@)?(www\.)?(.+)$/i;this.events={"summernote.keyup":function(t,e){e.isDefaultPrevented()||i.handleKeyup(e)},"summernote.keydown":function(t,e){i.handleKeydown(e)}},this.initialize=function(){this.lastWordRange=null},this.destroy=function(){this.lastWordRange=null},this.replace=function(){if(this.lastWordRange){var i=this.lastWordRange.toString(),r=i.match(n);if(r&&(r[1]||r[2])){var o=r[1]?i:"http://"+i,a=t("<a />").html(i).attr("href",o)[0];this.lastWordRange.insertNode(a),this.lastWordRange=null,e.invoke("editor.focus")}}},this.handleKeydown=function(t){if(u.contains([E.code.ENTER,E.code.SPACE],t.keyCode)){var i=e.invoke("editor.createRange").getWordRange();this.lastWordRange=i}},this.handleKeyup=function(t){u.contains([E.code.ENTER,E.code.SPACE],t.keyCode)&&this.replace()}},autoSync:function(t){var e=t.layoutInfo.note;this.events={"summernote.change":function(){e.val(t.invoke("code"))}},this.shouldInitialize=function(){return f.isTextarea(e[0])}},placeholder:function(e){var i=this,n=e.layoutInfo.editingArea,r=e.options;this.events={"summernote.init summernote.change":function(){i.update()},"summernote.codeview.toggled":function(){i.update()}},this.shouldInitialize=function(){return!!r.placeholder},this.initialize=function(){this.$placeholder=t('<div class="note-placeholder">'),this.$placeholder.on("click",function(){e.invoke("focus")}).text(r.placeholder).prependTo(n),this.update()},this.destroy=function(){this.$placeholder.remove()},this.update=function(){var t=!e.invoke("codeview.isActivated")&&e.invoke("editor.isEmpty");this.$placeholder.toggle(t)}},buttons:function(e){var i=this,n=t.summernote.ui,r=e.layoutInfo.toolbar,o=e.options,a=o.langInfo,s=h.invertObject(o.keyMap[c.isMac?"mac":"pc"]),l=this.representShortcut=function(t){var e=s[t];return o.shortcuts&&e?(c.isMac&&(e=e.replace("CMD","⌘").replace("SHIFT","⇧"))," ("+(e=e.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]"))+")"):""};this.initialize=function(){this.addToolbarButtons(),this.addImagePopoverButtons(),this.addLinkPopoverButtons(),this.addTablePopoverButtons(),this.fontInstalledMap={}},this.destroy=function(){delete this.fontInstalledMap},this.isFontInstalled=function(t){return i.fontInstalledMap.hasOwnProperty(t)||(i.fontInstalledMap[t]=c.isFontInstalled(t)||u.contains(o.fontNamesIgnoreCheck,t)),i.fontInstalledMap[t]},this.addToolbarButtons=function(){e.memo("button.style",function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents(n.icon(o.icons.magic),o),tooltip:a.style.style,data:{toggle:"dropdown"}}),n.dropdown({className:"dropdown-style",items:e.options.styleTags,template:function(t){"string"==typeof t&&(t={tag:t,title:a.style.hasOwnProperty(t)?a.style[t]:t});var e=t.tag,i=t.title;return"<"+e+(t.style?' style="'+t.style+'" ':"")+(t.className?' class="'+t.className+'"':"")+">"+i+"</"+e+">"},click:e.createInvokeHandler("editor.formatBlock")})]).render()}),e.memo("button.bold",function(){return n.button({className:"note-btn-bold",contents:n.icon(o.icons.bold),tooltip:a.font.bold+l("bold"),click:e.createInvokeHandlerAndUpdateState("editor.bold")}).render()}),e.memo("button.italic",function(){return n.button({className:"note-btn-italic",contents:n.icon(o.icons.italic),tooltip:a.font.italic+l("italic"),click:e.createInvokeHandlerAndUpdateState("editor.italic")}).render()}),e.memo("button.underline",function(){return n.button({className:"note-btn-underline",contents:n.icon(o.icons.underline),tooltip:a.font.underline+l("underline"),click:e.createInvokeHandlerAndUpdateState("editor.underline")}).render()}),e.memo("button.clear",function(){return n.button({contents:n.icon(o.icons.eraser),tooltip:a.font.clear+l("removeFormat"),click:e.createInvokeHandler("editor.removeFormat")}).render()}),e.memo("button.strikethrough",function(){return n.button({className:"note-btn-strikethrough",contents:n.icon(o.icons.strikethrough),tooltip:a.font.strikethrough+l("strikethrough"),click:e.createInvokeHandlerAndUpdateState("editor.strikethrough")}).render()}),e.memo("button.superscript",function(){return n.button({className:"note-btn-superscript",contents:n.icon(o.icons.superscript),tooltip:a.font.superscript,click:e.createInvokeHandlerAndUpdateState("editor.superscript")}).render()}),e.memo("button.subscript",function(){return n.button({className:"note-btn-subscript",contents:n.icon(o.icons.subscript),tooltip:a.font.subscript,click:e.createInvokeHandlerAndUpdateState("editor.subscript")}).render()}),e.memo("button.fontname",function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents('<span class="note-current-fontname"/>',o),tooltip:a.font.name,data:{toggle:"dropdown"}}),n.dropdownCheck({className:"dropdown-fontname",checkClassName:o.icons.menuCheck,items:o.fontNames.filter(i.isFontInstalled),template:function(t){return'<span style="font-family:'+t+'">'+t+"</span>"},click:e.createInvokeHandlerAndUpdateState("editor.fontName")})]).render()}),e.memo("button.fontsize",function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents('<span class="note-current-fontsize"/>',o),tooltip:a.font.size,data:{toggle:"dropdown"}}),n.dropdownCheck({className:"dropdown-fontsize",checkClassName:o.icons.menuCheck,items:o.fontSizes,click:e.createInvokeHandlerAndUpdateState("editor.fontSize")})]).render()}),e.memo("button.color",function(){return n.buttonGroup({className:"note-color",children:[n.button({className:"note-current-color-button",contents:n.icon(o.icons.font+" note-recent-color"),tooltip:a.color.recent,click:function(i){var n=t(i.currentTarget);e.invoke("editor.color",{backColor:n.attr("data-backColor"),foreColor:n.attr("data-foreColor")})},callback:function(t){t.find(".note-recent-color").css("background-color","#FFFF00"),t.attr("data-backColor","#FFFF00")}}),n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents("",o),tooltip:a.color.more,data:{toggle:"dropdown"}}),n.dropdown({items:['<div class="note-palette">',' <div class="note-palette-title">'+a.color.background+"</div>"," <div>",' <button type="button" class="note-color-reset btn btn-light" data-event="backColor" data-value="inherit">',a.color.transparent," </button>"," </div>",' <div class="note-holder" data-event="backColor"/>',"</div>",'<div class="note-palette">',' <div class="note-palette-title">'+a.color.foreground+"</div>"," <div>",' <button type="button" class="note-color-reset btn btn-light" data-event="removeFormat" data-value="foreColor">',a.color.resetToDefault," </button>"," </div>",' <div class="note-holder" data-event="foreColor"/>',"</div>"].join(""),callback:function(e){e.find(".note-holder").each(function(){var e=t(this);e.append(n.palette({colors:o.colors,eventName:e.data("event"),tooltip:o.tooltip}).render())})},click:function(i){var n=t(i.target),r=n.data("event"),o=n.data("value");if(r&&o){var a="backColor"===r?"background-color":"color",s=n.closest(".note-color").find(".note-recent-color"),l=n.closest(".note-color").find(".note-current-color-button");s.css(a,o),l.attr("data-"+r,o),e.invoke("editor."+r,o)}}})]}).render()}),e.memo("button.ul",function(){return n.button({contents:n.icon(o.icons.unorderedlist),tooltip:a.lists.unordered+l("insertUnorderedList"),click:e.createInvokeHandler("editor.insertUnorderedList")}).render()}),e.memo("button.ol",function(){return n.button({contents:n.icon(o.icons.orderedlist),tooltip:a.lists.ordered+l("insertOrderedList"),click:e.createInvokeHandler("editor.insertOrderedList")}).render()});var r=n.button({contents:n.icon(o.icons.alignLeft),tooltip:a.paragraph.left+l("justifyLeft"),click:e.createInvokeHandler("editor.justifyLeft")}),s=n.button({contents:n.icon(o.icons.alignCenter),tooltip:a.paragraph.center+l("justifyCenter"),click:e.createInvokeHandler("editor.justifyCenter")}),c=n.button({contents:n.icon(o.icons.alignRight),tooltip:a.paragraph.right+l("justifyRight"),click:e.createInvokeHandler("editor.justifyRight")}),u=n.button({contents:n.icon(o.icons.alignJustify),tooltip:a.paragraph.justify+l("justifyFull"),click:e.createInvokeHandler("editor.justifyFull")}),d=n.button({contents:n.icon(o.icons.outdent),tooltip:a.paragraph.outdent+l("outdent"),click:e.createInvokeHandler("editor.outdent")}),f=n.button({contents:n.icon(o.icons.indent),tooltip:a.paragraph.indent+l("indent"),click:e.createInvokeHandler("editor.indent")});e.memo("button.justifyLeft",h.invoke(r,"render")),e.memo("button.justifyCenter",h.invoke(s,"render")),e.memo("button.justifyRight",h.invoke(c,"render")),e.memo("button.justifyFull",h.invoke(u,"render")),e.memo("button.outdent",h.invoke(d,"render")),e.memo("button.indent",h.invoke(f,"render")),e.memo("button.paragraph",function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents(n.icon(o.icons.alignLeft),o),tooltip:a.paragraph.paragraph,data:{toggle:"dropdown"}}),n.dropdown([n.buttonGroup({className:"note-align",children:[r,s,c,u]}),n.buttonGroup({className:"note-list",children:[d,f]})])]).render()}),e.memo("button.height",function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents(n.icon(o.icons.textHeight),o),tooltip:a.font.height,data:{toggle:"dropdown"}}),n.dropdownCheck({items:o.lineHeights,checkClassName:o.icons.menuCheck,className:"dropdown-line-height",click:e.createInvokeHandler("editor.lineHeight")})]).render()}),e.memo("button.table",function(){return n.buttonGroup([n.button({className:"dropdown-toggle",contents:n.dropdownButtonContents(n.icon(o.icons.table),o),tooltip:a.table.table,data:{toggle:"dropdown"}}),n.dropdown({className:"note-table",items:['<div class="note-dimension-picker">',' <div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"/>',' <div class="note-dimension-picker-highlighted"/>',' <div class="note-dimension-picker-unhighlighted"/>',"</div>",'<div class="note-dimension-display">1 x 1</div>'].join("")})],{callback:function(t){t.find(".note-dimension-picker-mousecatcher").css({width:o.insertTableMaxSize.col+"em",height:o.insertTableMaxSize.row+"em"}).mousedown(e.createInvokeHandler("editor.insertTable")).on("mousemove",i.tableMoveHandler)}}).render()}),e.memo("button.link",function(){return n.button({contents:n.icon(o.icons.link),tooltip:a.link.link+l("linkDialog.show"),click:e.createInvokeHandler("linkDialog.show")}).render()}),e.memo("button.picture",function(){return n.button({contents:n.icon(o.icons.picture),tooltip:a.image.image,click:e.createInvokeHandler("imageDialog.show")}).render()}),e.memo("button.video",function(){return n.button({contents:n.icon(o.icons.video),tooltip:a.video.video,click:e.createInvokeHandler("videoDialog.show")}).render()}),e.memo("button.hr",function(){return n.button({contents:n.icon(o.icons.minus),tooltip:a.hr.insert+l("insertHorizontalRule"),click:e.createInvokeHandler("editor.insertHorizontalRule")}).render()}),e.memo("button.fullscreen",function(){return n.button({className:"btn-fullscreen",contents:n.icon(o.icons.arrowsAlt),tooltip:a.options.fullscreen,click:e.createInvokeHandler("fullscreen.toggle")}).render()}),e.memo("button.codeview",function(){return n.button({className:"btn-codeview",contents:n.icon(o.icons.code),tooltip:a.options.codeview,click:e.createInvokeHandler("codeview.toggle")}).render()}),e.memo("button.redo",function(){return n.button({contents:n.icon(o.icons.redo),tooltip:a.history.redo+l("redo"),click:e.createInvokeHandler("editor.redo")}).render()}),e.memo("button.undo",function(){return n.button({contents:n.icon(o.icons.undo),tooltip:a.history.undo+l("undo"),click:e.createInvokeHandler("editor.undo")}).render()}),e.memo("button.help",function(){return n.button({contents:n.icon(o.icons.question),tooltip:a.options.help,click:e.createInvokeHandler("helpDialog.show")}).render()})},this.addImagePopoverButtons=function(){e.memo("button.imageSize100",function(){return n.button({contents:'<span class="note-fontsize-10">100%</span>',tooltip:a.image.resizeFull,click:e.createInvokeHandler("editor.resize","1")}).render()}),e.memo("button.imageSize50",function(){return n.button({contents:'<span class="note-fontsize-10">50%</span>',tooltip:a.image.resizeHalf,click:e.createInvokeHandler("editor.resize","0.5")}).render()}),e.memo("button.imageSize25",function(){return n.button({contents:'<span class="note-fontsize-10">25%</span>',tooltip:a.image.resizeQuarter,click:e.createInvokeHandler("editor.resize","0.25")}).render()}),e.memo("button.floatLeft",function(){return n.button({contents:n.icon(o.icons.alignLeft),tooltip:a.image.floatLeft,click:e.createInvokeHandler("editor.floatMe","left")}).render()}),e.memo("button.floatRight",function(){return n.button({contents:n.icon(o.icons.alignRight),tooltip:a.image.floatRight,click:e.createInvokeHandler("editor.floatMe","right")}).render()}),e.memo("button.floatNone",function(){return n.button({contents:n.icon(o.icons.alignJustify),tooltip:a.image.floatNone,click:e.createInvokeHandler("editor.floatMe","none")}).render()}),e.memo("button.removeMedia",function(){return n.button({contents:n.icon(o.icons.trash),tooltip:a.image.remove,click:e.createInvokeHandler("editor.removeMedia")}).render()})},this.addLinkPopoverButtons=function(){e.memo("button.linkDialogShow",function(){return n.button({contents:n.icon(o.icons.link),tooltip:a.link.edit,click:e.createInvokeHandler("linkDialog.show")}).render()}),e.memo("button.unlink",function(){return n.button({contents:n.icon(o.icons.unlink),tooltip:a.link.unlink,click:e.createInvokeHandler("editor.unlink")}).render()})},this.addTablePopoverButtons=function(){e.memo("button.addRowUp",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.rowAbove),tooltip:a.table.addRowAbove,click:e.createInvokeHandler("editor.addRow","top")}).render()}),e.memo("button.addRowDown",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.rowBelow),tooltip:a.table.addRowBelow,click:e.createInvokeHandler("editor.addRow","bottom")}).render()}),e.memo("button.addColLeft",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.colBefore),tooltip:a.table.addColLeft,click:e.createInvokeHandler("editor.addCol","left")}).render()}),e.memo("button.addColRight",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.colAfter),tooltip:a.table.addColRight,click:e.createInvokeHandler("editor.addCol","right")}).render()}),e.memo("button.deleteRow",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.rowRemove),tooltip:a.table.delRow,click:e.createInvokeHandler("editor.deleteRow")}).render()}),e.memo("button.deleteCol",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.colRemove),tooltip:a.table.delCol,click:e.createInvokeHandler("editor.deleteCol")}).render()}),e.memo("button.deleteTable",function(){return n.button({className:"btn-md",contents:n.icon(o.icons.trash),tooltip:a.table.delTable,click:e.createInvokeHandler("editor.deleteTable")}).render()})},this.build=function(t,i){for(var r=0,o=i.length;r<o;r++){for(var a=i[r],s=a[0],l=a[1],c=n.buttonGroup({className:"note-"+s}).render(),h=0,u=l.length;h<u;h++){var d=e.memo("button."+l[h]);d&&c.append("function"==typeof d?d(e):d)}c.appendTo(t)}},this.updateCurrentStyle=function(n){var o=n||r,a=e.invoke("editor.currentStyle");if(this.updateBtnStates(o,{".note-btn-bold":function(){return"bold"===a["font-bold"]},".note-btn-italic":function(){return"italic"===a["font-italic"]},".note-btn-underline":function(){return"underline"===a["font-underline"]},".note-btn-subscript":function(){return"subscript"===a["font-subscript"]},".note-btn-superscript":function(){return"superscript"===a["font-superscript"]},".note-btn-strikethrough":function(){return"strikethrough"===a["font-strikethrough"]}}),a["font-family"]){var s=a["font-family"].split(",").map(function(t){return t.replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,"")}),l=u.find(s,i.isFontInstalled);o.find(".dropdown-fontname a").each(function(){var e=t(this),i=e.data("value")+""==l+"";e.toggleClass("checked",i)}),o.find(".note-current-fontname").text(l)}if(a["font-size"]){var c=a["font-size"];o.find(".dropdown-fontsize a").each(function(){var e=t(this),i=e.data("value")+""==c+"";e.toggleClass("checked",i)}),o.find(".note-current-fontsize").text(c)}if(a["line-height"]){var h=a["line-height"];o.find(".dropdown-line-height li a").each(function(){var e=t(this).data("value")+""==h+"";this.className=e?"checked":""})}},this.updateBtnStates=function(e,i){t.each(i,function(t,i){n.toggleBtnActive(e.find(t),i())})},this.tableMoveHandler=function(e){var i,n=t(e.target.parentNode),r=n.next(),a=n.find(".note-dimension-picker-mousecatcher"),s=n.find(".note-dimension-picker-highlighted"),l=n.find(".note-dimension-picker-unhighlighted");if(void 0===e.offsetX){var c=t(e.target).offset();i={x:e.pageX-c.left,y:e.pageY-c.top}}else i={x:e.offsetX,y:e.offsetY};var h={c:Math.ceil(i.x/18)||1,r:Math.ceil(i.y/18)||1};s.css({width:h.c+"em",height:h.r+"em"}),a.data("value",h.c+"x"+h.r),3<h.c&&h.c<o.insertTableMaxSize.col&&l.css({width:h.c+1+"em"}),3<h.r&&h.r<o.insertTableMaxSize.row&&l.css({height:h.r+1+"em"}),r.html(h.c+" x "+h.r)}},toolbar:function(e){var i=t.summernote.ui,n=e.layoutInfo.note,r=e.layoutInfo.editor,o=e.layoutInfo.toolbar,a=e.options;this.shouldInitialize=function(){return!a.airMode},this.initialize=function(){a.toolbar=a.toolbar||[],a.toolbar.length?e.invoke("buttons.build",o,a.toolbar):o.hide(),a.toolbarContainer&&o.appendTo(a.toolbarContainer),this.changeContainer(!1),n.on("summernote.keyup summernote.mouseup summernote.change",function(){e.invoke("buttons.updateCurrentStyle")}),e.invoke("buttons.updateCurrentStyle")},this.destroy=function(){o.children().remove()},this.changeContainer=function(t){t?o.prependTo(r):a.toolbarContainer&&o.appendTo(a.toolbarContainer)},this.updateFullscreen=function(t){i.toggleBtnActive(o.find(".btn-fullscreen"),t),this.changeContainer(t)},this.updateCodeview=function(t){i.toggleBtnActive(o.find(".btn-codeview"),t),t?this.deactivate():this.activate()},this.activate=function(t){var e=o.find("button");t||(e=e.not(".btn-codeview")),i.toggleBtn(e,!0)},this.deactivate=function(t){var e=o.find("button");t||(e=e.not(".btn-codeview")),i.toggleBtn(e,!1)}},linkDialog:function(e){var i=this,n=t.summernote.ui,r=e.layoutInfo.editor,o=e.options,a=o.langInfo;this.initialize=function(){var e=o.dialogsInBody?t(document.body):r,i='<div class="form-group note-form-group"><label class="note-form-label">'+a.link.textToDisplay+'</label><input class="note-link-text form-control note-form-control note-input" type="text" /></div><div class="form-group note-form-group"><label class="note-form-label">'+a.link.url+'</label><input class="note-link-url form-control note-form-control note-input" type="text" value="http://" /></div>'+(o.disableLinkTarget?"":t("<div/>").append(n.checkbox({id:"sn-checkbox-open-in-new-window",text:a.link.openInNewWindow,checked:!0}).render()).html()),s='<button href="#" class="btn btn-primary note-btn note-btn-primary note-link-btn disabled" disabled>'+a.link.insert+"</button>";this.$dialog=n.dialog({className:"link-dialog",title:a.link.insert,fade:o.dialogsFade,body:i,footer:s}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.bindEnterKey=function(t,e){t.on("keypress",function(t){t.keyCode===E.code.ENTER&&e.trigger("click")})},this.toggleLinkBtn=function(t,e,i){n.toggleBtn(t,e.val()&&i.val())},this.showLinkDialog=function(r){return t.Deferred(function(t){var o=i.$dialog.find(".note-link-text"),a=i.$dialog.find(".note-link-url"),s=i.$dialog.find(".note-link-btn"),l=i.$dialog.find("input[type=checkbox]");n.onDialogShown(i.$dialog,function(){e.triggerEvent("dialog.shown"),r.url||(r.url=r.text),o.val(r.text);var c=function(){i.toggleLinkBtn(s,o,a),r.text=o.val()};o.on("input",c).on("paste",function(){setTimeout(c,0)});var h=function(){i.toggleLinkBtn(s,o,a),r.text||o.val(a.val())};a.on("input",h).on("paste",function(){setTimeout(h,0)}).val(r.url).trigger("focus"),i.toggleLinkBtn(s,o,a),i.bindEnterKey(a,s),i.bindEnterKey(o,s);var u=void 0!==r.isNewWindow?r.isNewWindow:e.options.linkTargetBlank;l.prop("checked",u),s.one("click",function(e){e.preventDefault(),t.resolve({range:r.range,url:a.val(),text:o.val(),isNewWindow:l.is(":checked")}),n.hideDialog(i.$dialog)})}),n.onDialogHidden(i.$dialog,function(){o.off("input paste keypress"),a.off("input paste keypress"),s.off("click"),"pending"===t.state()&&t.reject()}),n.showDialog(i.$dialog)}).promise()},this.show=function(){var t=e.invoke("editor.getLinkInfo");e.invoke("editor.saveRange"),this.showLinkDialog(t).then(function(t){e.invoke("editor.restoreRange"),e.invoke("editor.createLink",t)}).fail(function(){e.invoke("editor.restoreRange")})},e.memo("help.linkDialog.show",o.langInfo.help["linkDialog.show"])},linkPopover:function(e){var i=this,n=t.summernote.ui,r=e.options;this.events={"summernote.keyup summernote.mouseup summernote.change summernote.scroll":function(){i.update()},"summernote.disable summernote.dialog.shown":function(){i.hide()}},this.shouldInitialize=function(){return!u.isEmpty(r.popover.link)},this.initialize=function(){this.$popover=n.popover({className:"note-link-popover",callback:function(t){t.find(".popover-content,.note-popover-content").prepend('<span><a target="_blank"></a> </span>')}}).render().appendTo("body");var t=this.$popover.find(".popover-content,.note-popover-content");e.invoke("buttons.build",t,r.popover.link)},this.destroy=function(){this.$popover.remove()},this.update=function(){if(e.invoke("editor.hasFocus")){var i=e.invoke("editor.createRange");if(i.isCollapsed()&&i.isOnAnchor()){var n=f.ancestor(i.sc,f.isAnchor),r=t(n).attr("href");this.$popover.find("a").attr("href",r).html(r);var o=f.posFromPlaceholder(n);this.$popover.css({display:"block",left:o.left,top:o.top})}else this.hide()}else this.hide()},this.hide=function(){this.$popover.hide()}},imageDialog:function(e){var i=this,n=t.summernote.ui,r=e.layoutInfo.editor,o=e.options,a=o.langInfo;this.initialize=function(){var e=o.dialogsInBody?t(document.body):r,i="";if(o.maximumImageFileSize){var s=Math.floor(Math.log(o.maximumImageFileSize)/Math.log(1024)),l=1*(o.maximumImageFileSize/Math.pow(1024,s)).toFixed(2)+" "+" KMGTP"[s]+"B";i="<small>"+a.image.maximumFileSize+" : "+l+"</small>"}var c='<div class="form-group note-form-group note-group-select-from-files"><label class="note-form-label">'+a.image.selectFromFiles+'</label><input class="note-image-input form-control note-form-control note-input" type="file" name="files" accept="image/*" multiple="multiple" />'+i+'</div><div class="form-group note-group-image-url" style="overflow:auto;"><label class="note-form-label">'+a.image.url+'</label><input class="note-image-url form-control note-form-control note-input col-md-12" type="text" /></div>',h='<button href="#" class="btn btn-primary note-btn note-btn-primary note-image-btn disabled" disabled>'+a.image.insert+"</button>";this.$dialog=n.dialog({title:a.image.insert,fade:o.dialogsFade,body:c,footer:h}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.bindEnterKey=function(t,e){t.on("keypress",function(t){t.keyCode===E.code.ENTER&&e.trigger("click")})},this.show=function(){e.invoke("editor.saveRange"),this.showImageDialog().then(function(t){n.hideDialog(i.$dialog),e.invoke("editor.restoreRange"),"string"==typeof t?e.invoke("editor.insertImage",t):e.invoke("editor.insertImagesOrCallback",t)}).fail(function(){e.invoke("editor.restoreRange")})},this.showImageDialog=function(){return t.Deferred(function(t){var r=i.$dialog.find(".note-image-input"),o=i.$dialog.find(".note-image-url"),a=i.$dialog.find(".note-image-btn");n.onDialogShown(i.$dialog,function(){e.triggerEvent("dialog.shown"),r.replaceWith(r.clone().on("change",function(){t.resolve(this.files||this.value)}).val("")),a.click(function(e){e.preventDefault(),t.resolve(o.val())}),o.on("keyup paste",function(){var t=o.val();n.toggleBtn(a,t)}).val("").trigger("focus"),i.bindEnterKey(o,a)}),n.onDialogHidden(i.$dialog,function(){r.off("change"),o.off("keyup paste keypress"),a.off("click"),"pending"===t.state()&&t.reject()}),n.showDialog(i.$dialog)})}},imagePopover:function(e){var i=this,n=t.summernote.ui,r=e.layoutInfo.editable[0],o=e.options;this.events={"summernote.disable":function(){i.hide()}},this.shouldInitialize=function(){return!u.isEmpty(o.popover.image)},this.initialize=function(){this.$popover=n.popover({className:"note-image-popover"}).render().appendTo("body");var t=this.$popover.find(".popover-content,.note-popover-content");e.invoke("buttons.build",t,o.popover.image)},this.destroy=function(){this.$popover.remove()},this.update=function(t){if(f.isImg(t)){var e=f.posFromPlaceholder(t),i=f.posFromPlaceholder(r);this.$popover.css({display:"block",left:e.left,top:Math.min(e.top,i.top)})}else this.hide()},this.hide=function(){this.$popover.hide()}},tablePopover:function(e){var i=this,n=t.summernote.ui,r=e.options;this.events={"summernote.mousedown":function(t,e){i.update(e.target)},"summernote.keyup summernote.scroll summernote.change":function(){i.update()},"summernote.disable":function(){i.hide()}},this.shouldInitialize=function(){return!u.isEmpty(r.popover.table)},this.initialize=function(){this.$popover=n.popover({className:"note-table-popover"}).render().appendTo("body");var t=this.$popover.find(".popover-content,.note-popover-content");e.invoke("buttons.build",t,r.popover.table),c.isFF&&document.execCommand("enableInlineTableEditing",!1,!1)},this.destroy=function(){this.$popover.remove()},this.update=function(t){if(e.isDisabled())return!1;var i=f.isCell(t);if(i){var n=f.posFromPlaceholder(t);this.$popover.css({display:"block",left:n.left,top:n.top})}else this.hide();return i},this.hide=function(){this.$popover.hide()}},videoDialog:function(e){var i=this,n=t.summernote.ui,r=e.layoutInfo.editor,o=e.options,a=o.langInfo;this.initialize=function(){var e=o.dialogsInBody?t(document.body):r,i='<div class="form-group note-form-group row-fluid"><label class="note-form-label">'+a.video.url+' <small class="text-muted">'+a.video.providers+'</small></label><input class="note-video-url form-control note-form-control note-input span12" type="text" /></div>',s='<button href="#" class="btn btn-primary note-btn note-btn-primary note-video-btn disabled" disabled>'+a.video.insert+"</button>";this.$dialog=n.dialog({title:a.video.insert,fade:o.dialogsFade,body:i,footer:s}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.bindEnterKey=function(t,e){t.on("keypress",function(t){t.keyCode===E.code.ENTER&&e.trigger("click")})},this.createVideoNode=function(e){var i,n=e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/),r=e.match(/(?:www\.|\/\/)instagram\.com\/p\/(.[a-zA-Z0-9_-]*)/),o=e.match(/\/\/vine\.co\/v\/([a-zA-Z0-9]+)/),a=e.match(/\/\/(player\.)?vimeo\.com\/([a-z]*\/)*(\d+)[?]?.*/),s=e.match(/.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/),l=e.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),c=e.match(/\/\/v\.qq\.com.*?vid=(.+)/),h=e.match(/\/\/v\.qq\.com\/x?\/?(page|cover).*?\/([^\/]+)\.html\??.*/),u=e.match(/^.+.(mp4|m4v)$/),d=e.match(/^.+.(ogg|ogv)$/),f=e.match(/^.+.(webm)$/);if(n&&11===n[1].length){var p=n[1];i=t("<iframe>").attr("frameborder",0).attr("src","//www.youtube.com/embed/"+p).attr("width","640").attr("height","360")}else if(r&&r[0].length)i=t("<iframe>").attr("frameborder",0).attr("src","https://instagram.com/p/"+r[1]+"/embed/").attr("width","612").attr("height","710").attr("scrolling","no").attr("allowtransparency","true");else if(o&&o[0].length)i=t("<iframe>").attr("frameborder",0).attr("src",o[0]+"/embed/simple").attr("width","600").attr("height","600").attr("class","vine-embed");else if(a&&a[3].length)i=t("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("src","//player.vimeo.com/video/"+a[3]).attr("width","640").attr("height","360");else if(s&&s[2].length)i=t("<iframe>").attr("frameborder",0).attr("src","//www.dailymotion.com/embed/video/"+s[2]).attr("width","640").attr("height","360");else if(l&&l[1].length)i=t("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","498").attr("width","510").attr("src","//player.youku.com/embed/"+l[1]);else if(c&&c[1].length||h&&h[2].length){var g=c&&c[1].length?c[1]:h[2];i=t("<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>").attr("frameborder",0).attr("height","310").attr("width","500").attr("src","http://v.qq.com/iframe/player.html?vid="+g+"&auto=0")}else{if(!(u||d||f))return!1;i=t("<video controls>").attr("src",e).attr("width","640").attr("height","360")}return i.addClass("note-video-clip"),i[0]},this.show=function(){var t=e.invoke("editor.getSelectedText");e.invoke("editor.saveRange"),this.showVideoDialog(t).then(function(t){n.hideDialog(i.$dialog),e.invoke("editor.restoreRange");var r=i.createVideoNode(t);r&&e.invoke("editor.insertNode",r)}).fail(function(){e.invoke("editor.restoreRange")})},this.showVideoDialog=function(r){return t.Deferred(function(t){var o=i.$dialog.find(".note-video-url"),a=i.$dialog.find(".note-video-btn");n.onDialogShown(i.$dialog,function(){e.triggerEvent("dialog.shown"),o.val(r).on("input",function(){n.toggleBtn(a,o.val())}).trigger("focus"),a.click(function(e){e.preventDefault(),t.resolve(o.val())}),i.bindEnterKey(o,a)}),n.onDialogHidden(i.$dialog,function(){o.off("input"),a.off("click"),"pending"===t.state()&&t.reject()}),n.showDialog(i.$dialog)})}},helpDialog:function(e){var i=this,n=t.summernote.ui,r=e.layoutInfo.editor,o=e.options,a=o.langInfo;this.createShortCutList=function(){var i=o.keyMap[c.isMac?"mac":"pc"];return Object.keys(i).map(function(n){var r=i[n],o=t('<div><div class="help-list-item"/></div>');return o.append(t("<label><kbd>"+n+"</kdb></label>").css({width:180,"margin-right":10})).append(t("<span/>").html(e.memo("help."+r)||r)),o.html()}).join("")},this.initialize=function(){var e=o.dialogsInBody?t(document.body):r,i=['<p class="text-center">','<a href="http://summernote.org/" target="_blank">Summernote 0.8.8</a> · ','<a href="https://github.com/summernote/summernote" target="_blank">Project</a> · ','<a href="https://github.com/summernote/summernote/issues" target="_blank">Issues</a>',"</p>"].join("");this.$dialog=n.dialog({title:a.options.help,fade:o.dialogsFade,body:this.createShortCutList(),footer:i,callback:function(t){t.find(".modal-body,.note-modal-body").css({"max-height":300,overflow:"scroll"})}}).render().appendTo(e)},this.destroy=function(){n.hideDialog(this.$dialog),this.$dialog.remove()},this.showHelpDialog=function(){return t.Deferred(function(t){n.onDialogShown(i.$dialog,function(){e.triggerEvent("dialog.shown"),t.resolve()}),n.showDialog(i.$dialog)}).promise()},this.show=function(){e.invoke("editor.saveRange"),this.showHelpDialog().then(function(){e.invoke("editor.restoreRange")})}},airPopover:function(e){var i=this,n=t.summernote.ui,r=e.options;this.events={"summernote.keyup summernote.mouseup summernote.scroll":function(){i.update()},"summernote.disable summernote.change summernote.dialog.shown":function(){i.hide()},"summernote.focusout":function(t,e){c.isFF||e.relatedTarget&&f.ancestor(e.relatedTarget,h.eq(i.$popover[0]))||i.hide()}},this.shouldInitialize=function(){return r.airMode&&!u.isEmpty(r.popover.air)},this.initialize=function(){this.$popover=n.popover({className:"note-air-popover"}).render().appendTo("body");var t=this.$popover.find(".popover-content");e.invoke("buttons.build",t,r.popover.air)},this.destroy=function(){this.$popover.remove()},this.update=function(){var t=e.invoke("editor.currentStyle");if(t.range&&!t.range.isCollapsed()){var i=u.last(t.range.getClientRects());if(i){var n=h.rect2bnd(i);this.$popover.css({display:"block",left:Math.max(n.left+n.width/2,0)-20,top:n.top+n.height}),e.invoke("buttons.updateCurrentStyle",this.$popover)}}else this.hide()},this.hide=function(){this.$popover.hide()}}},buttons:{},lang:"en-US",toolbar:[["style",["style"]],["font",["bold","underline","clear"]],["fontname",["fontname"]],["color",["color"]],["para",["ul","ol","paragraph"]],["table",["table"]],["insert",["link","picture","video"]],["view",["fullscreen","codeview","help"]]],popover:{image:[["imagesize",["imageSize100","imageSize50","imageSize25"]],["float",["floatLeft","floatRight","floatNone"]],["remove",["removeMedia"]]],link:[["link",["linkDialogShow","unlink"]]],table:[["add",["addRowDown","addRowUp","addColLeft","addColRight"]],["delete",["deleteRow","deleteCol","deleteTable"]]],air:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]]},airMode:!1,width:null,height:null,linkTargetBlank:!0,focus:!1,tabSize:4,styleWithSpan:!0,shortcuts:!0,textareaAutoSync:!0,direction:null,tooltip:"auto",styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontSizes:["8","9","10","11","12","14","18","24","36"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],tableClassName:"table table-bordered",insertTableMaxSize:{col:10,row:10},dialogsInBody:!1,dialogsFade:!1,maximumImageFileSize:null,callbacks:{onInit:null,onFocus:null,onBlur:null,onEnter:null,onKeyup:null,onKeydown:null,onImageUpload:null,onImageUploadError:null},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"linkDialog.show"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"linkDialog.show"}},icons:{align:"note-icon-align",alignCenter:"note-icon-align-center",alignJustify:"note-icon-align-justify",alignLeft:"note-icon-align-left",alignRight:"note-icon-align-right",rowBelow:"note-icon-row-below",colBefore:"note-icon-col-before",colAfter:"note-icon-col-after",rowAbove:"note-icon-row-above",rowRemove:"note-icon-row-remove",colRemove:"note-icon-col-remove",indent:"note-icon-align-indent",outdent:"note-icon-align-outdent",arrowsAlt:"note-icon-arrows-alt",bold:"note-icon-bold",caret:"note-icon-caret",circle:"note-icon-circle",close:"note-icon-close",code:"note-icon-code",eraser:"note-icon-eraser",font:"note-icon-font",frame:"note-icon-frame",italic:"note-icon-italic",link:"note-icon-link",unlink:"note-icon-chain-broken",magic:"note-icon-magic",menuCheck:"note-icon-menu-check",minus:"note-icon-minus",orderedlist:"note-icon-orderedlist",pencil:"note-icon-pencil",picture:"note-icon-picture",question:"note-icon-question",redo:"note-icon-redo",square:"note-icon-square",strikethrough:"note-icon-strikethrough",subscript:"note-icon-subscript",superscript:"note-icon-superscript",table:"note-icon-table",textHeight:"note-icon-text-height",trash:"note-icon-trash",underline:"note-icon-underline",undo:"note-icon-undo",unorderedlist:"note-icon-unorderedlist",video:"note-icon-video"}}})}),function(t){"use strict";if(!t.summernote)throw new Error("summernote.js required.");var e=t.summernote.options.icons;t.summernote.options=t.extend(t.summernote.options,{defaultIcons:e,icons:{align:"fa fa-align-left",alignCenter:"fa fa-align-center",alignJustify:"fa fa-align-justify",alignLeft:"fa fa-align-left",alignRight:"fa fa-align-right",indent:"fa fa-indent",outdent:"fa fa-outdent",arrowsAlt:"fa fa-arrows-alt",bold:"fa fa-bold",caret:"fa fa-caret-down",circle:"fa fa-circle-o",close:"fa fa-close",code:"fa fa-code",eraser:"fa fa-eraser",font:"fa fa-font",frame:"fa fa-",italic:"fa fa-italic",link:"fa fa-link",unlink:"fa fa-unlink",magic:"fa fa-magic",menuCheck:"fa fa-check",minus:"fa fa-minus",orderedlist:"fa fa-list-ol",pencil:"fa fa-pencil",picture:"fa fa-picture-o",question:"fa fa-question",redo:"fa fa-repeat",square:"fa fa-square-o",strikethrough:"fa fa-strikethrough",subscript:"fa fa-subscript",superscript:"fa fa-superscript",table:"fa fa-table",textHeight:"fa fa-text-height",trash:"fa fa-trash",underline:"fa fa-underline",undo:"fa fa-undo",unorderedlist:"fa fa-list-ul",video:"fa fa-video-camera"}}),t.summernote.options.modules=t.extend(t.summernote.options.modules,{fullscreen:function(e){var i=e.layoutInfo.editor,n=e.layoutInfo.toolbar,r=e.layoutInfo.editable,o=e.layoutInfo.codable,a=t(window),s=t("html, body");this.toggle=function(){function t(t){r.css("height",t.h),o.css("height",t.h),o.data("cmeditor")&&o.data("cmeditor").setsize(null,t.h)}i.toggleClass("fullscreen"),this.isFullscreen()?(r.data("orgHeight",r.css("height")),a.on("resize.px.summernote",function(){t({h:a.height()-n.outerHeight()})}).trigger("resize"),s.addClass("summernote-fullscreen")):(a.off("resize.px.summernote"),t({h:r.data("orgHeight")}),s.removeClass("summernote-fullscreen")),e.invoke("toolbar.updateFullscreen",this.isFullscreen())},this.isFullscreen=function(){return i.hasClass("fullscreen")}}})}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t){"use strict";var e=function(e,i){t.each(["autofocus","savable","hideable","width","height","resize","iconlibrary","language","footer","fullscreen","hiddenButtons","disabledButtons"],function(n,r){void 0!==t(e).data(r)&&((i="object"==typeof i?i:{})[r]=t(e).data(r))}),this.$ns="bootstrap-markdown",this.$element=t(e),this.$editable={el:null,type:null,attrKeys:[],attrValues:[],content:null},this.$options=t.extend(!0,{},t.fn.markdown.defaults,i,this.$element.data("options")),this.$oldContent=null,this.$isPreview=!1,this.$isFullscreen=!1,this.$editor=null,this.$textarea=null,this.$handler=[],this.$callback=[],this.$nextTab=[],this.showEditor()};e.prototype={constructor:e,__alterButtons:function(e,i){var n=this.$handler,r="all"==e,o=this;t.each(n,function(t,n){!1===(!r&&n.indexOf(e)<0)&&i(o.$editor.find('button[data-handler="'+n+'"]'))})},__buildButtons:function(e,i){var n,r=this.$ns,o=this.$handler,a=this.$callback;for(n=0;n<e.length;n++){var s,l=e[n];for(s=0;s<l.length;s++){var c,h=l[s].data,u=t("<div/>",{class:"btn-group"});for(c=0;c<h.length;c++){var d,f,p=h[c],g=r+"-"+p.name,m=this.__getIcon(p.icon),v=p.btnText?p.btnText:"",y=p.btnClass?p.btnClass:"btn",b=p.tabIndex?p.tabIndex:"-1",x=void 0!==p.hotkey?p.hotkey:"",_=void 0!==jQuery.hotkeys&&""!==x?" ("+x+")":"";(d=t("<button></button>")).text(" "+this.__localize(v)).addClass("btn-default btn-sm").addClass(y),y.match(/btn\-(primary|success|info|warning|danger|link)/)&&d.removeClass("btn-default"),d.attr({type:"button",title:this.__localize(p.title)+_,tabindex:b,"data-provider":r,"data-handler":g,"data-hotkey":x}),!0===p.toggle&&d.attr("data-toggle","button"),(f=t("<span/>")).addClass(m),f.prependTo(d),u.append(d),o.push(g),a.push(p.callback)}i.append(u)}}return i},__setListener:function(){var e=void 0!==this.$textarea.attr("rows"),i=this.$textarea.val().split("\n").length>5?this.$textarea.val().split("\n").length:"5",n=e?this.$textarea.attr("rows"):i;this.$textarea.attr("rows",n),this.$options.resize&&this.$textarea.css("resize",this.$options.resize),this.$textarea.on({focus:t.proxy(this.focus,this),keyup:t.proxy(this.keyup,this),change:t.proxy(this.change,this),select:t.proxy(this.select,this)}),this.eventSupported("keydown")&&this.$textarea.on("keydown",t.proxy(this.keydown,this)),this.eventSupported("keypress")&&this.$textarea.on("keypress",t.proxy(this.keypress,this)),this.$textarea.data("markdown",this)},__handle:function(e){var i=t(e.currentTarget),n=this.$handler,r=this.$callback,o=i.attr("data-handler"),a=r[n.indexOf(o)];t(e.currentTarget).focus(),a(this),this.change(this),o.indexOf("cmdSave")<0&&this.$textarea.focus(),e.preventDefault()},__localize:function(e){var i=t.fn.markdown.messages,n=this.$options.language;return void 0!==i&&void 0!==i[n]&&void 0!==i[n][e]?i[n][e]:e},__getIcon:function(t){return"object"==typeof t?t[this.$options.iconlibrary]:t},setFullscreen:function(e){var i=this.$editor,n=this.$textarea;!0===e?(i.addClass("md-fullscreen-mode"),t("body").addClass("md-nooverflow"),this.$options.onFullscreen(this)):(i.removeClass("md-fullscreen-mode"),t("body").removeClass("md-nooverflow"),1==this.$isPreview&&this.hidePreview().showPreview()),this.$isFullscreen=e,n.focus()},showEditor:function(){var e,i=this,n=this.$ns,r=this.$element,o=(r.css("height"),r.css("width"),this.$editable),a=this.$handler,s=this.$callback,l=this.$options,c=t("<div/>",{class:"md-editor",click:function(){i.focus()}});if(null===this.$editor){var h=t("<div/>",{class:"md-header btn-toolbar"}),u=[];if(l.buttons.length>0&&(u=u.concat(l.buttons[0])),l.additionalButtons.length>0&&t.each(l.additionalButtons[0],function(e,i){var n=t.grep(u,function(t,e){return t.name===i.name});n.length>0?n[0].data=n[0].data.concat(i.data):u.push(l.additionalButtons[0][e])}),l.reorderButtonGroups.length>0&&(u=u.filter(function(t){return l.reorderButtonGroups.indexOf(t.name)>-1}).sort(function(t,e){return l.reorderButtonGroups.indexOf(t.name)<l.reorderButtonGroups.indexOf(e.name)?-1:l.reorderButtonGroups.indexOf(t.name)>l.reorderButtonGroups.indexOf(e.name)?1:0})),u.length>0&&(h=this.__buildButtons([u],h)),l.fullscreen.enable&&h.append('<div class="md-controls"><a class="md-control md-control-fullscreen" href="#"><span class="'+this.__getIcon(l.fullscreen.icons.fullscreenOn)+'"></span></a></div>').on("click",".md-control-fullscreen",function(t){t.preventDefault(),i.setFullscreen(!0)}),c.append(h),r.is("textarea"))r.before(c),(e=r).addClass("md-input"),c.append(e);else{var d="function"==typeof toMarkdown?toMarkdown(r.html()):r.html(),f=t.trim(d);e=t("<textarea/>",{class:"md-input",val:f}),c.append(e),o.el=r,o.type=r.prop("tagName").toLowerCase(),o.content=r.html(),t(r[0].attributes).each(function(){o.attrKeys.push(this.nodeName),o.attrValues.push(this.nodeValue)}),r.replaceWith(c)}var p=t("<div/>",{class:"md-footer"}),g=!1,m="";if(l.savable){g=!0;a.push("cmdSave"),s.push(l.onSave),p.append('<button class="btn btn-success" data-provider="'+n+'" data-handler="cmdSave"><i class="icon icon-white icon-ok"></i> '+this.__localize("Save")+"</button>")}if(m="function"==typeof l.footer?l.footer(this):l.footer,""!==t.trim(m)&&(g=!0,p.append(m)),g&&c.append(p),l.width&&"inherit"!==l.width&&(jQuery.isNumeric(l.width)?(c.css("display","table"),e.css("width",l.width+"px")):c.addClass(l.width)),l.height&&"inherit"!==l.height)if(jQuery.isNumeric(l.height)){var v=l.height;h&&(v=Math.max(0,v-h.outerHeight())),p&&(v=Math.max(0,v-p.outerHeight())),e.css("height",v+"px")}else c.addClass(l.height);this.$editor=c,this.$textarea=e,this.$editable=o,this.$oldContent=this.getContent(),this.__setListener(),this.$editor.attr("id",(new Date).getTime()),this.$editor.on("click",'[data-provider="bootstrap-markdown"]',t.proxy(this.__handle,this)),(this.$element.is(":disabled")||this.$element.is("[readonly]"))&&(this.$editor.addClass("md-editor-disabled"),this.disableButtons("all")),this.eventSupported("keydown")&&"object"==typeof jQuery.hotkeys&&h.find('[data-provider="bootstrap-markdown"]').each(function(){var i=t(this),n=i.attr("data-hotkey");""!==n.toLowerCase()&&e.bind("keydown",n,function(){return i.trigger("click"),!1})}),"preview"===l.initialstate?this.showPreview():"fullscreen"===l.initialstate&&l.fullscreen.enable&&this.setFullscreen(!0)}else this.$editor.show();return l.autofocus&&(this.$textarea.focus(),this.$editor.addClass("active")),l.fullscreen.enable&&!1!==l.fullscreen&&(this.$editor.append('<div class="md-fullscreen-controls"><a href="#" class="exit-fullscreen" title="Exit fullscreen"><span class="'+this.__getIcon(l.fullscreen.icons.fullscreenOff)+'"></span></a></div>'),this.$editor.on("click",".exit-fullscreen",function(t){t.preventDefault(),i.setFullscreen(!1)})),this.hideButtons(l.hiddenButtons),this.disableButtons(l.disabledButtons),l.onShow(this),this},parseContent:function(t){var t=t||this.$textarea.val();return this.$options.parser?this.$options.parser(t):"object"==typeof markdown?markdown.toHTML(t):"function"==typeof marked?marked(t):t},showPreview:function(){var e,i,n=this.$options,r=this.$textarea,o=r.next(),a=t("<div/>",{class:"md-preview","data-provider":"markdown-preview"});return 1==this.$isPreview?this:(this.$isPreview=!0,this.disableButtons("all").enableButtons("cmdPreview"),i=n.onPreview(this),e="string"==typeof i?i:this.parseContent(),a.html(e),o&&"md-footer"==o.attr("class")?a.insertBefore(o):r.parent().append(a),a.css({width:r.outerWidth()+"px",height:r.outerHeight()+"px"}),this.$options.resize&&a.css("resize",this.$options.resize),r.hide(),a.data("markdown",this),(this.$element.is(":disabled")||this.$element.is("[readonly]"))&&(this.$editor.addClass("md-editor-disabled"),this.disableButtons("all")),this)},hidePreview:function(){return this.$isPreview=!1,this.$editor.find('div[data-provider="markdown-preview"]').remove(),this.enableButtons("all"),this.disableButtons(this.$options.disabledButtons),this.$textarea.show(),this.__setListener(),this},isDirty:function(){return this.$oldContent!=this.getContent()},getContent:function(){return this.$textarea.val()},setContent:function(t){return this.$textarea.val(t),this},findSelection:function(t){var e;if((e=this.getContent().indexOf(t))>=0&&t.length>0){var i,n=this.getSelection();return this.setSelection(e,e+t.length),i=this.getSelection(),this.setSelection(n.start,n.end),i}return null},getSelection:function(){var t=this.$textarea[0];return("selectionStart"in t&&function(){var e=t.selectionEnd-t.selectionStart;return{start:t.selectionStart,end:t.selectionEnd,length:e,text:t.value.substr(t.selectionStart,e)}}||function(){return null})()},setSelection:function(t,e){var i=this.$textarea[0];return("selectionStart"in i&&function(){i.selectionStart=t,i.selectionEnd=e}||function(){return null})()},replaceSelection:function(t){var e=this.$textarea[0];return("selectionStart"in e&&function(){return e.value=e.value.substr(0,e.selectionStart)+t+e.value.substr(e.selectionEnd,e.value.length),e.selectionStart=e.value.length,this}||function(){return e.value+=t,jQuery(e)})()},getNextTab:function(){if(0===this.$nextTab.length)return null;var t,e=this.$nextTab.shift();return"function"==typeof e?t=e():"object"==typeof e&&e.length>0&&(t=e),t},setNextTab:function(t,e){if("string"==typeof t){var i=this;this.$nextTab.push(function(){return i.findSelection(t)})}else if("number"==typeof t&&"number"==typeof e){var n=this.getSelection();this.setSelection(t,e),this.$nextTab.push(this.getSelection()),this.setSelection(n.start,n.end)}},__parseButtonNameParam:function(t){return"string"==typeof t?t.split(" "):t},enableButtons:function(e){var i=this.__parseButtonNameParam(e),n=this;return t.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.removeAttr("disabled")})}),this},disableButtons:function(e){var i=this.__parseButtonNameParam(e),n=this;return t.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.attr("disabled","disabled")})}),this},hideButtons:function(e){var i=this.__parseButtonNameParam(e),n=this;return t.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.addClass("hidden")})}),this},showButtons:function(e){var i=this.__parseButtonNameParam(e),n=this;return t.each(i,function(t,e){n.__alterButtons(i[t],function(t){t.removeClass("hidden")})}),this},eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},keyup:function(t){var e=!1;switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:var i;if(null!==(i=this.getNextTab())){var n=this;setTimeout(function(){n.setSelection(i.start,i.end)},500),e=!0}else{var r=this.getSelection();r.start==r.end&&r.end==this.getContent().length?e=!1:(this.setSelection(this.getContent().length,this.getContent().length),e=!0)}break;case 13:e=!1;break;case 27:this.$isFullscreen&&this.setFullscreen(!1),e=!1;break;default:e=!1}e&&(t.stopPropagation(),t.preventDefault()),this.$options.onChange(this)},change:function(t){return this.$options.onChange(this),this},select:function(t){return this.$options.onSelect(this),this},focus:function(e){var i=this.$options,n=(i.hideable,this.$editor);return n.addClass("active"),t(document).find(".md-editor").each(function(){if(t(this).attr("id")!==n.attr("id")){var e;null===(e=t(this).find("textarea").data("markdown"))&&(e=t(this).find('div[data-provider="markdown-preview"]').data("markdown")),e&&e.blur()}}),i.onFocus(this),this},blur:function(e){var i=this.$options,n=i.hideable,r=this.$editor,o=this.$editable;if(r.hasClass("active")||0===this.$element.parent().length){if(r.removeClass("active"),n)if(null!==o.el){var a=t("<"+o.type+"/>"),s=this.getContent(),l=this.parseContent(s);t(o.attrKeys).each(function(t,e){a.attr(o.attrKeys[t],o.attrValues[t])}),a.html(l),r.replaceWith(a)}else r.hide();i.onBlur(this)}return this}};var i=t.fn.markdown;t.fn.markdown=function(i){return this.each(function(){var n=t(this),r=n.data("markdown"),o="object"==typeof i&&i;r||n.data("markdown",r=new e(this,o))})},t.fn.markdown.messages={},t.fn.markdown.defaults={autofocus:!1,hideable:!1,savable:!1,width:"inherit",height:"inherit",resize:"none",iconlibrary:"glyph",language:"en",initialstate:"editor",parser:null,buttons:[[{name:"groupFont",data:[{name:"cmdBold",hotkey:"Ctrl+B",title:"Bold",icon:{glyph:"glyphicon glyphicon-bold",fa:"fa fa-bold","fa-3":"icon-bold"},callback:function(t){var e,i,n=t.getSelection(),r=t.getContent();e=0===n.length?t.__localize("strong text"):n.text,"**"===r.substr(n.start-2,2)&&"**"===r.substr(n.end,2)?(t.setSelection(n.start-2,n.end+2),t.replaceSelection(e),i=n.start-2):(t.replaceSelection("**"+e+"**"),i=n.start+2),t.setSelection(i,i+e.length)}},{name:"cmdItalic",title:"Italic",hotkey:"Ctrl+I",icon:{glyph:"glyphicon glyphicon-italic",fa:"fa fa-italic","fa-3":"icon-italic"},callback:function(t){var e,i,n=t.getSelection(),r=t.getContent();e=0===n.length?t.__localize("emphasized text"):n.text,"_"===r.substr(n.start-1,1)&&"_"===r.substr(n.end,1)?(t.setSelection(n.start-1,n.end+1),t.replaceSelection(e),i=n.start-1):(t.replaceSelection("_"+e+"_"),i=n.start+1),t.setSelection(i,i+e.length)}},{name:"cmdHeading",title:"Heading",hotkey:"Ctrl+H",icon:{glyph:"glyphicon glyphicon-header",fa:"fa fa-header","fa-3":"icon-font"},callback:function(t){var e,i,n,r,o=t.getSelection(),a=t.getContent();e=0===o.length?t.__localize("heading text"):o.text+"\n",n=4,"### "===a.substr(o.start-n,n)||(n=3,"###"===a.substr(o.start-n,n))?(t.setSelection(o.start-n,o.end),t.replaceSelection(e),i=o.start-n):o.start>0&&(r=a.substr(o.start-1,1))&&"\n"!=r?(t.replaceSelection("\n\n### "+e),i=o.start+6):(t.replaceSelection("### "+e),i=o.start+4),t.setSelection(i,i+e.length)}}]},{name:"groupLink",data:[{name:"cmdUrl",title:"URL/Link",hotkey:"Ctrl+L",icon:{glyph:"glyphicon glyphicon-link",fa:"fa fa-link","fa-3":"icon-link"},callback:function(e){var i,n,r,o=e.getSelection();e.getContent();i=0===o.length?e.__localize("enter link description here"):o.text,r=prompt(e.__localize("Insert Hyperlink"),"http://");var a=new RegExp("^((http|https)://|(mailto:)|(//))[a-z0-9]","i");if(null!==r&&""!==r&&"http://"!==r&&a.test(r)){var s=t("<div>"+r+"</div>").text();e.replaceSelection("["+i+"]("+s+")"),n=o.start+1,e.setSelection(n,n+i.length)}}},{name:"cmdImage",title:"Image",hotkey:"Ctrl+G",icon:{glyph:"glyphicon glyphicon-picture",fa:"fa fa-picture-o","fa-3":"icon-picture"},callback:function(e){var i,n,r,o=e.getSelection();e.getContent();i=0===o.length?e.__localize("enter image description here"):o.text,r=prompt(e.__localize("Insert Image Hyperlink"),"http://");var a=new RegExp("^((http|https)://|(//))[a-z0-9]","i");if(null!==r&&""!==r&&"http://"!==r&&a.test(r)){var s=t("<div>"+r+"</div>").text();e.replaceSelection("+'")'),n=o.start+2,e.setNextTab(e.__localize("enter image title here")),e.setSelection(n,n+i.length)}}}]},{name:"groupMisc",data:[{name:"cmdList",hotkey:"Ctrl+U",title:"Unordered List",icon:{glyph:"glyphicon glyphicon-list",fa:"fa fa-list","fa-3":"icon-list-ul"},callback:function(e){var i,n,r=e.getSelection();e.getContent();if(0===r.length)i=e.__localize("list text here"),e.replaceSelection("- "+i),n=r.start+2;else if(r.text.indexOf("\n")<0)i=r.text,e.replaceSelection("- "+i),n=r.start+2;else{var o=[];i=(o=r.text.split("\n"))[0],t.each(o,function(t,e){o[t]="- "+e}),e.replaceSelection("\n\n"+o.join("\n")),n=r.start+4}e.setSelection(n,n+i.length)}},{name:"cmdListO",hotkey:"Ctrl+O",title:"Ordered List",icon:{glyph:"glyphicon glyphicon-th-list",fa:"fa fa-list-ol","fa-3":"icon-list-ol"},callback:function(e){var i,n,r=e.getSelection();e.getContent();if(0===r.length)i=e.__localize("list text here"),e.replaceSelection("1. "+i),n=r.start+3;else if(r.text.indexOf("\n")<0)i=r.text,e.replaceSelection("1. "+i),n=r.start+3;else{var o=[];i=(o=r.text.split("\n"))[0],t.each(o,function(t,e){o[t]="1. "+e}),e.replaceSelection("\n\n"+o.join("\n")),n=r.start+5}e.setSelection(n,n+i.length)}},{name:"cmdCode",hotkey:"Ctrl+K",title:"Code",icon:{glyph:"glyphicon glyphicon-asterisk",fa:"fa fa-code","fa-3":"icon-code"},callback:function(t){var e,i,n=t.getSelection(),r=t.getContent();e=0===n.length?t.__localize("code text here"):n.text,"```\n"===r.substr(n.start-4,4)&&"\n```"===r.substr(n.end,4)?(t.setSelection(n.start-4,n.end+4),t.replaceSelection(e),i=n.start-4):"`"===r.substr(n.start-1,1)&&"`"===r.substr(n.end,1)?(t.setSelection(n.start-1,n.end+1),t.replaceSelection(e),i=n.start-1):r.indexOf("\n")>-1?(t.replaceSelection("```\n"+e+"\n```"),i=n.start+4):(t.replaceSelection("`"+e+"`"),i=n.start+1),t.setSelection(i,i+e.length)}},{name:"cmdQuote",hotkey:"Ctrl+Q",title:"Quote",icon:{glyph:"glyphicon glyphicon-comment",fa:"fa fa-quote-left","fa-3":"icon-quote-left"},callback:function(e){var i,n,r=e.getSelection();e.getContent();if(0===r.length)i=e.__localize("quote here"),e.replaceSelection("> "+i),n=r.start+2;else if(r.text.indexOf("\n")<0)i=r.text,e.replaceSelection("> "+i),n=r.start+2;else{var o=[];i=(o=r.text.split("\n"))[0],t.each(o,function(t,e){o[t]="> "+e}),e.replaceSelection("\n\n"+o.join("\n")),n=r.start+4}e.setSelection(n,n+i.length)}}]},{name:"groupUtil",data:[{name:"cmdPreview",toggle:!0,hotkey:"Ctrl+P",title:"Preview",btnText:"Preview",btnClass:"btn btn-primary btn-sm",icon:{glyph:"glyphicon glyphicon-search",fa:"fa fa-search","fa-3":"icon-search"},callback:function(t){!1===t.$isPreview?t.showPreview():t.hidePreview()}}]}]],additionalButtons:[],reorderButtonGroups:[],hiddenButtons:[],disabledButtons:[],footer:"",fullscreen:{enable:!0,icons:{fullscreenOn:{fa:"fa fa-expand",glyph:"glyphicon glyphicon-fullscreen","fa-3":"icon-resize-full"},fullscreenOff:{fa:"fa fa-compress",glyph:"glyphicon glyphicon-fullscreen","fa-3":"icon-resize-small"}}},onShow:function(t){},onPreview:function(t){},onSave:function(t){},onBlur:function(t){},onFocus:function(t){},onChange:function(t){},onFullscreen:function(t){},onSelect:function(t){}},t.fn.markdown.Constructor=e,t.fn.markdown.noConflict=function(){return t.fn.markdown=i,this};var n=function(t){var e=t;e.data("markdown")?e.data("markdown").showEditor():e.markdown()},r=function(e){var i=t(document.activeElement);t(document).find(".md-editor").each(function(){var e=t(this),n=i.closest(".md-editor")[0]===this,r=e.find("textarea").data("markdown")||e.find('div[data-provider="markdown-preview"]').data("markdown");r&&!n&&r.blur()})};t(document).on("click.markdown.data-api",'[data-provide="markdown-editable"]',function(e){n(t(this)),e.preventDefault()}).on("click focusin",function(t){r()}).ready(function(){t('textarea[data-provide="markdown"]').each(function(){n(t(this))})})}),function(t){"use strict";function e(t){var e=t.outerHeight(),i=this.$editor.find(".md-preview");this.$textarea[0].style.top=e+"px",i.length&&(i[0].style.top=e+"px")}if(!t.fn.markdown)throw new Error("bootstrap-markdown.js required.");var i=t.fn.markdown.Constructor.prototype.__buildButtons,n=t.fn.markdown.Constructor.prototype.setFullscreen,r=t.fn.markdown.Constructor.prototype.showPreview;t.fn.markdown.Constructor.prototype.__buildButtons=function(t,e){var n=i.call(this,t,e);return n.find(".btn-default").removeClass("btn-default").addClass("btn-secondary"),n},t.fn.markdown.Constructor.prototype.setFullscreen=function(i){if(n.call(this,i),i){var r=this.$editor.find(".md-header");e.call(this,r),t(window).on("resize.md-editor",t.proxy(e,this,r))}else this.$textarea[0].style.top="auto",this.$editor.find(".md-preview").css("top","auto"),t(window).off("resize.md-editor")},t.fn.markdown.Constructor.prototype.showPreview=function(){r.call(this),this.$editor.hasClass("md-fullscreen-mode")&&e.call(this,this.$editor.find(".md-header"))}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,document,window,navigator)}):"object"==typeof exports?t(require("jquery"),document,window,navigator):t(jQuery,document,window,navigator)}(function(t,e,i,n,r){"use strict";var o=0,a=function(){var e,i=n.userAgent,r=/msie\s\d+/i;return i.search(r)>0&&(e=r.exec(i).toString(),(e=e.split(" ")[1])<9)&&(t("html").addClass("lt-ie9"),!0)}();Function.prototype.bind||(Function.prototype.bind=function(t){var e=this,i=[].slice;if("function"!=typeof e)throw new TypeError;var n=i.call(arguments,1),r=function(){if(this instanceof r){var o=function(){};o.prototype=e.prototype;var a=new o,s=e.apply(a,n.concat(i.call(arguments)));return Object(s)===s?s:a}return e.apply(t,n.concat(i.call(arguments)))};return r}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var i;if(null==this)throw new TypeError('"this" is null or not defined');var n=Object(this),r=n.length>>>0;if(0===r)return-1;var o=+e||0;if(Math.abs(o)===1/0&&(o=0),o>=r)return-1;for(i=Math.max(o>=0?o:r-Math.abs(o),0);i<r;){if(i in n&&n[i]===t)return i;i++}return-1});var s=function(n,o,a){this.VERSION="2.2.0",this.input=n,this.plugin_count=a,this.current_plugin=0,this.calc_count=0,this.update_tm=0,this.old_from=0,this.old_to=0,this.old_min_interval=null,this.raf_id=null,this.dragging=!1,this.force_redraw=!1,this.no_diapason=!1,this.has_tab_index=!0,this.is_key=!1,this.is_update=!1,this.is_start=!0,this.is_finish=!1,this.is_active=!1,this.is_resize=!1,this.is_click=!1,o=o||{},this.$cache={win:t(i),body:t(e.body),input:t(n),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]},this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]},this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,p_single_fake:0,p_single_left:0};var s,l,c,h=this.$cache.input,u=h.prop("value");s={type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!0,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",postfix:"",max_postfix:"",decorate_both:!0,values_separator:" — ",input_values_separator:";",disable:!1,block:!1,extra_classes:"",scope:null,onStart:null,onChange:null,onFinish:null,onUpdate:null},"INPUT"!==h[0].nodeName&&console&&console.warn&&console.warn("Base element should be <input>!",h[0]),(l={type:h.data("type"),min:h.data("min"),max:h.data("max"),from:h.data("from"),to:h.data("to"),step:h.data("step"),min_interval:h.data("minInterval"),max_interval:h.data("maxInterval"),drag_interval:h.data("dragInterval"),values:h.data("values"),from_fixed:h.data("fromFixed"),from_min:h.data("fromMin"),from_max:h.data("fromMax"),from_shadow:h.data("fromShadow"),to_fixed:h.data("toFixed"),to_min:h.data("toMin"),to_max:h.data("toMax"),to_shadow:h.data("toShadow"),prettify_enabled:h.data("prettifyEnabled"),prettify_separator:h.data("prettifySeparator"),force_edges:h.data("forceEdges"),keyboard:h.data("keyboard"),grid:h.data("grid"),grid_margin:h.data("gridMargin"),grid_num:h.data("gridNum"),grid_snap:h.data("gridSnap"),hide_min_max:h.data("hideMinMax"),hide_from_to:h.data("hideFromTo"),prefix:h.data("prefix"),postfix:h.data("postfix"),max_postfix:h.data("maxPostfix"),decorate_both:h.data("decorateBoth"),values_separator:h.data("valuesSeparator"),input_values_separator:h.data("inputValuesSeparator"),disable:h.data("disable"),block:h.data("block"),extra_classes:h.data("extraClasses")}).values=l.values&&l.values.split(",");for(c in l)l.hasOwnProperty(c)&&(l[c]!==r&&""!==l[c]||delete l[c]);u!==r&&""!==u&&((u=u.split(l.input_values_separator||o.input_values_separator||";"))[0]&&u[0]==+u[0]&&(u[0]=+u[0]),u[1]&&u[1]==+u[1]&&(u[1]=+u[1]),o&&o.values&&o.values.length?(s.from=u[0]&&o.values.indexOf(u[0]),s.to=u[1]&&o.values.indexOf(u[1])):(s.from=u[0]&&+u[0],s.to=u[1]&&+u[1])),t.extend(s,o),t.extend(s,l),this.options=s,this.update_check={},this.validate(),this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null},this.init()};s.prototype={init:function(t){this.no_diapason=!1,this.coords.p_step=this.convertToPercent(this.options.step,!0),this.target="base",this.toggleInput(),this.append(),this.setMinMax(),t?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart()),this.updateScene()},append:function(){var t='<span class="irs js-irs-'+this.plugin_count+" "+this.options.extra_classes+'"></span>';this.$cache.input.before(t),this.$cache.input.prop("readonly",!0),this.$cache.cont=this.$cache.input.prev(),this.result.slider=this.$cache.cont,this.$cache.cont.html('<span class="irs"><span class="irs-line" tabindex="0"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>'),this.$cache.rs=this.$cache.cont.find(".irs"),this.$cache.min=this.$cache.cont.find(".irs-min"),this.$cache.max=this.$cache.cont.find(".irs-max"),this.$cache.from=this.$cache.cont.find(".irs-from"),this.$cache.to=this.$cache.cont.find(".irs-to"),this.$cache.single=this.$cache.cont.find(".irs-single"),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.line=this.$cache.cont.find(".irs-line"),this.$cache.grid=this.$cache.cont.find(".irs-grid"),"single"===this.options.type?(this.$cache.cont.append('<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>'),this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append('<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>'),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler()),this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none"),this.appendGrid(),this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.input[0].disabled=!1,this.removeDisableMask(),this.bindEvents()),this.options.disable||(this.options.block?this.appendDisableMask():this.removeDisableMask()),this.options.drag_interval&&(this.$cache.bar[0].style.cursor="ew-resize")},setTopHandler:function(){var t=this.options.min,e=this.options.max,i=this.options.from,n=this.options.to;i>t&&n===e?this.$cache.s_from.addClass("type_last"):n<e&&this.$cache.s_to.addClass("type_last")},changeLevel:function(t){switch(t){case"single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake),this.$cache.s_single.addClass("state_hover");break;case"from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.$cache.s_from.addClass("state_hover"),this.$cache.s_from.addClass("type_last"),this.$cache.s_to.removeClass("type_last");break;case"to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to_fake),this.$cache.s_to.addClass("state_hover"),this.$cache.s_to.addClass("type_last"),this.$cache.s_from.removeClass("type_last");break;case"both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},appendDisableMask:function(){this.$cache.cont.append('<span class="irs-disable-mask"></span>'),this.$cache.cont.addClass("irs-disabled")},removeDisableMask:function(){this.$cache.cont.remove(".irs-disable-mask"),this.$cache.cont.removeClass("irs-disabled")},remove:function(){this.$cache.cont.remove(),this.$cache.cont=null,this.$cache.line.off("keydown.irs_"+this.plugin_count),this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),a&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)),this.$cache.grid_labels=[],this.coords.big=[],this.coords.big_w=[],this.coords.big_p=[],this.coords.big_x=[],cancelAnimationFrame(this.raf_id)},bindEvents:function(){this.no_diapason||(this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("focus.irs_"+this.plugin_count,this.pointerFocus.bind(this)),this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),"single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),this.options.keyboard&&this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard")),a&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this))))},pointerFocus:function(t){if(!this.target){var e,i;e=(i="single"===this.options.type?this.$cache.single:this.$cache.from).offset().left,e+=i.width()/2-1,this.pointerClick("single",{preventDefault:function(){},pageX:e})}},pointerMove:function(t){if(this.dragging){var e=t.pageX||t.originalEvent.touches&&t.originalEvent.touches[0].pageX;this.coords.x_pointer=e-this.coords.x_gap,this.calc()}},pointerUp:function(e){this.current_plugin===this.plugin_count&&this.is_active&&(this.is_active=!1,this.$cache.cont.find(".state_hover").removeClass("state_hover"),this.force_redraw=!0,a&&t("*").prop("unselectable",!1),this.updateScene(),this.restoreOriginalMinInterval(),(t.contains(this.$cache.cont[0],e.target)||this.dragging)&&this.callOnFinish(),this.dragging=!1)},pointerDown:function(e,i){i.preventDefault();var n=i.pageX||i.originalEvent.touches&&i.originalEvent.touches[0].pageX;2!==i.button&&("both"===e&&this.setTempMinInterval(),e||(e=this.target||"from"),this.current_plugin=this.plugin_count,this.target=e,this.is_active=!0,this.dragging=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=n-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(e),a&&t("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),this.updateScene())},pointerClick:function(t,e){e.preventDefault();var i=e.pageX||e.originalEvent.touches&&e.originalEvent.touches[0].pageX;2!==e.button&&(this.current_plugin=this.plugin_count,this.target=t,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(i-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(t,e){if(!(this.current_plugin!==this.plugin_count||e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)){switch(e.which){case 83:case 65:case 40:case 37:e.preventDefault(),this.moveByKey(!1);break;case 87:case 68:case 38:case 39:e.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(t){var e=this.coords.p_pointer,i=(this.options.max-this.options.min)/100;i=this.options.step/i,t?e+=i:e-=i,this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*e),this.is_key=!0,this.calc()},setMinMax:function(){if(this.options){if(this.options.hide_min_max)return this.$cache.min[0].style.display="none",void(this.$cache.max[0].style.display="none");if(this.options.values.length)this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]));else{var t=this._prettify(this.options.min),e=this._prettify(this.options.max);this.result.min_pretty=t,this.result.max_pretty=e,this.$cache.min.html(this.decorate(t,this.options.min)),this.$cache.max.html(this.decorate(e,this.options.max))}this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)}},setTempMinInterval:function(){var t=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval),this.options.min_interval=t},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},calc:function(t){if(this.options&&(this.calc_count++,(10===this.calc_count||t)&&(this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.calcHandlePercent()),this.coords.w_rs)){this.calcPointerPercent();var e=this.getHandleX();switch("both"===this.target&&(this.coords.p_gap=0,e=this.getHandleX()),"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,e=this.getHandleX(),this.options.drag_interval?this.target="both_one":this.target=this.chooseHandle(e)),this.target){case"base":var i=(this.options.max-this.options.min)/100,n=(this.result.from-this.options.min)/i,r=(this.result.to-this.options.min)/i;this.coords.p_single_real=this.toFixed(n),this.coords.p_from_real=this.toFixed(n),this.coords.p_to_real=this.toFixed(r),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real),this.target=null;break;case"single":if(this.options.from_fixed)break;this.coords.p_single_real=this.convertToRealPercent(e),this.coords.p_single_real=this.calcWithStep(this.coords.p_single_real),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);break;case"from":if(this.options.from_fixed)break;this.coords.p_from_real=this.convertToRealPercent(e),this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);break;case"to":if(this.options.to_fixed)break;this.coords.p_to_real=this.convertToRealPercent(e),this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case"both":if(this.options.from_fixed||this.options.to_fixed)break;e=this.toFixed(e+.001*this.coords.p_handle),this.coords.p_from_real=this.convertToRealPercent(e)-this.coords.p_gap_left,this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.convertToRealPercent(e)+this.coords.p_gap_right,this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case"both_one":if(this.options.from_fixed||this.options.to_fixed)break;var o=this.convertToRealPercent(e),a=this.result.from_percent,s=this.result.to_percent-a,l=s/2,c=o-l,h=o+l;c<0&&(h=(c=0)+s),h>100&&(c=(h=100)-s),this.coords.p_from_real=this.calcWithStep(c),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.calcWithStep(h),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real)}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.result.from_pretty=this._prettify(this.result.from),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.from_pretty=this._prettify(this.result.from),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.result.to_pretty=this._prettify(this.result.to),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to])),this.calcMinMax(),this.calcLabels()}},calcPointerPercent:function(){this.coords.w_rs?(this.coords.x_pointer<0||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(t){return t/(100-this.coords.p_handle)*100},convertToFakePercent:function(t){return t/100*(100-this.coords.p_handle)},getHandleX:function(){var t=100-this.coords.p_handle,e=this.toFixed(this.coords.p_pointer-this.coords.p_gap);return e<0?e=0:e>t&&(e=t),e},calcHandlePercent:function(){"single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100)},chooseHandle:function(t){return"single"===this.options.type?"single":t>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake)):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to_fake)/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake)))},updateScene:function(){this.raf_id&&(cancelAnimationFrame(this.raf_id),this.raf_id=null),clearTimeout(this.update_tm),this.update_tm=null,this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0),(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)&&(this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow()),this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)&&((this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key)&&(this.drawLabels(),this.$cache.bar[0].style.left=this.coords.p_bar_x+"%",this.$cache.bar[0].style.width=this.coords.p_bar_w+"%","single"===this.options.type?(this.$cache.s_single[0].style.left=this.coords.p_single_fake+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%"):(this.$cache.s_from[0].style.left=this.coords.p_from_fake+"%",this.$cache.s_to[0].style.left=this.coords.p_to_fake+"%",(this.old_from!==this.result.from||this.force_redraw)&&(this.$cache.from[0].style.left=this.labels.p_from_left+"%"),(this.old_to!==this.result.to||this.force_redraw)&&(this.$cache.to[0].style.left=this.labels.p_to_left+"%"),this.$cache.single[0].style.left=this.labels.p_single_left+"%"),this.writeToInput(),this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||(this.$cache.input.trigger("change"),this.$cache.input.trigger("input")),this.old_from=this.result.from,this.old_to=this.result.to,this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange(),(this.is_key||this.is_click)&&(this.is_key=!1,this.is_click=!1,this.callOnFinish()),this.is_update=!1,this.is_resize=!1,this.is_finish=!1),this.is_start=!1,this.is_key=!1,this.is_click=!1,this.force_redraw=!1))},drawLabels:function(){if(this.options){var t,e,i,n,r,o=this.options.values.length,a=this.options.p_values;if(!this.options.hide_from_to)if("single"===this.options.type)o?(t=this.decorate(a[this.result.from]),this.$cache.single.html(t)):(n=this._prettify(this.result.from),t=this.decorate(n,this.result.from),this.$cache.single.html(t)),this.calcLabels(),this.labels.p_single_left<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",this.labels.p_single_left+this.labels.p_single_fake>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible";else{o?(this.options.decorate_both?(t=this.decorate(a[this.result.from]),t+=this.options.values_separator,t+=this.decorate(a[this.result.to])):t=this.decorate(a[this.result.from]+this.options.values_separator+a[this.result.to]),e=this.decorate(a[this.result.from]),i=this.decorate(a[this.result.to]),this.$cache.single.html(t),this.$cache.from.html(e),this.$cache.to.html(i)):(n=this._prettify(this.result.from),r=this._prettify(this.result.to),this.options.decorate_both?(t=this.decorate(n,this.result.from),t+=this.options.values_separator,t+=this.decorate(r,this.result.to)):t=this.decorate(n+this.options.values_separator+r,this.result.to),e=this.decorate(n,this.result.from),i=this.decorate(r,this.result.to),this.$cache.single.html(t),this.$cache.from.html(e),this.$cache.to.html(i)),this.calcLabels();var s=Math.min(this.labels.p_single_left,this.labels.p_from_left),l=this.labels.p_single_left+this.labels.p_single_fake,c=this.labels.p_to_left+this.labels.p_to_fake,h=Math.max(l,c);this.labels.p_from_left+this.labels.p_from_fake>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?("from"===this.target?this.$cache.from[0].style.visibility="visible":"to"===this.target?this.$cache.to[0].style.visibility="visible":this.target||(this.$cache.from[0].style.visibility="visible"),this.$cache.single[0].style.visibility="hidden",h=c):(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",h=Math.max(l,c))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden"),s<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",h>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible"}}},drawShadow:function(){var t,e,i,n,r=this.options,o=this.$cache,a="number"==typeof r.from_min&&!isNaN(r.from_min),s="number"==typeof r.from_max&&!isNaN(r.from_max),l="number"==typeof r.to_min&&!isNaN(r.to_min),c="number"==typeof r.to_max&&!isNaN(r.to_max);"single"===r.type?r.from_shadow&&(a||s)?(t=this.convertToPercent(a?r.from_min:r.min),e=this.convertToPercent(s?r.from_max:r.max)-t,t=this.toFixed(t-this.coords.p_handle/100*t),e=this.toFixed(e-this.coords.p_handle/100*e),t+=this.coords.p_handle/2,o.shad_single[0].style.display="block",o.shad_single[0].style.left=t+"%",o.shad_single[0].style.width=e+"%"):o.shad_single[0].style.display="none":(r.from_shadow&&(a||s)?(t=this.convertToPercent(a?r.from_min:r.min),e=this.convertToPercent(s?r.from_max:r.max)-t,t=this.toFixed(t-this.coords.p_handle/100*t),e=this.toFixed(e-this.coords.p_handle/100*e),t+=this.coords.p_handle/2,o.shad_from[0].style.display="block",o.shad_from[0].style.left=t+"%",o.shad_from[0].style.width=e+"%"):o.shad_from[0].style.display="none",r.to_shadow&&(l||c)?(i=this.convertToPercent(l?r.to_min:r.min),n=this.convertToPercent(c?r.to_max:r.max)-i,i=this.toFixed(i-this.coords.p_handle/100*i),n=this.toFixed(n-this.coords.p_handle/100*n),i+=this.coords.p_handle/2,o.shad_to[0].style.display="block",o.shad_to[0].style.left=i+"%",o.shad_to[0].style.width=n+"%"):o.shad_to[0].style.display="none")},writeToInput:function(){"single"===this.options.type?(this.options.values.length?this.$cache.input.prop("value",this.result.from_value):this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from)):(this.options.values.length?this.$cache.input.prop("value",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop("value",this.result.from+this.options.input_values_separator+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))},callOnStart:function(){this.writeToInput(),this.options.onStart&&"function"==typeof this.options.onStart&&(this.options.scope?this.options.onStart.call(this.options.scope,this.result):this.options.onStart(this.result))},callOnChange:function(){this.writeToInput(),this.options.onChange&&"function"==typeof this.options.onChange&&(this.options.scope?this.options.onChange.call(this.options.scope,this.result):this.options.onChange(this.result))},callOnFinish:function(){this.writeToInput(),this.options.onFinish&&"function"==typeof this.options.onFinish&&(this.options.scope?this.options.onFinish.call(this.options.scope,this.result):this.options.onFinish(this.result))},callOnUpdate:function(){this.writeToInput(),this.options.onUpdate&&"function"==typeof this.options.onUpdate&&(this.options.scope?this.options.onUpdate.call(this.options.scope,this.result):this.options.onUpdate(this.result))},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input"),this.has_tab_index?this.$cache.input.prop("tabindex",-1):this.$cache.input.removeProp("tabindex"),this.has_tab_index=!this.has_tab_index},convertToPercent:function(t,e){var i,n,r=this.options.max-this.options.min,o=r/100;return r?(i=e?t:t-this.options.min,n=i/o,this.toFixed(n)):(this.no_diapason=!0,0)},convertToValue:function(t){var e,i,n=this.options.min,r=this.options.max,o=n.toString().split(".")[1],a=r.toString().split(".")[1],s=0,l=0;if(0===t)return this.options.min;if(100===t)return this.options.max;o&&(s=e=o.length),a&&(s=i=a.length),e&&i&&(s=e>=i?e:i),n<0&&(n=+(n+(l=Math.abs(n))).toFixed(s),r=+(r+l).toFixed(s));var c,h=(r-n)/100*t+n,u=this.options.step.toString().split(".")[1];return u?h=+h.toFixed(u.length):(h/=this.options.step,h=+(h*=this.options.step).toFixed(0)),l&&(h-=l),(c=u?+h.toFixed(u.length):this.toFixed(h))<this.options.min?c=this.options.min:c>this.options.max&&(c=this.options.max),c},calcWithStep:function(t){var e=Math.round(t/this.coords.p_step)*this.coords.p_step;return e>100&&(e=100),100===t&&(e=100),this.toFixed(e)},checkMinInterval:function(t,e,i){var n,r,o=this.options;return o.min_interval?(n=this.convertToValue(t),r=this.convertToValue(e),"from"===i?r-n<o.min_interval&&(n=r-o.min_interval):n-r<o.min_interval&&(n=r+o.min_interval),this.convertToPercent(n)):t},checkMaxInterval:function(t,e,i){var n,r,o=this.options;return o.max_interval?(n=this.convertToValue(t),r=this.convertToValue(e),"from"===i?r-n>o.max_interval&&(n=r-o.max_interval):n-r>o.max_interval&&(n=r+o.max_interval),this.convertToPercent(n)):t},checkDiapason:function(t,e,i){var n=this.convertToValue(t),r=this.options;return"number"!=typeof e&&(e=r.min),"number"!=typeof i&&(i=r.max),n<e&&(n=e),n>i&&(n=i),this.convertToPercent(n)},toFixed:function(t){return+(t=t.toFixed(20))},_prettify:function(t){return this.options.prettify_enabled?this.options.prettify&&"function"==typeof this.options.prettify?this.options.prettify(t):this.prettify(t):t},prettify:function(t){return t.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(t,e){return this.options.force_edges?(t<0?t=0:t>100-e&&(t=100-e),this.toFixed(t)):this.toFixed(t)},validate:function(){var t,e,i=this.options,n=this.result,r=i.values,o=r.length;if("string"==typeof i.min&&(i.min=+i.min),"string"==typeof i.max&&(i.max=+i.max),"string"==typeof i.from&&(i.from=+i.from),"string"==typeof i.to&&(i.to=+i.to),"string"==typeof i.step&&(i.step=+i.step),"string"==typeof i.from_min&&(i.from_min=+i.from_min),"string"==typeof i.from_max&&(i.from_max=+i.from_max),"string"==typeof i.to_min&&(i.to_min=+i.to_min),"string"==typeof i.to_max&&(i.to_max=+i.to_max),"string"==typeof i.grid_num&&(i.grid_num=+i.grid_num),i.max<i.min&&(i.max=i.min),o)for(i.p_values=[],i.min=0,i.max=o-1,i.step=1,i.grid_num=i.max,i.grid_snap=!0,e=0;e<o;e++)t=+r[e],isNaN(t)?t=r[e]:(r[e]=t,t=this._prettify(t)),i.p_values.push(t);("number"!=typeof i.from||isNaN(i.from))&&(i.from=i.min),("number"!=typeof i.to||isNaN(i.to))&&(i.to=i.max),"single"===i.type?(i.from<i.min&&(i.from=i.min),i.from>i.max&&(i.from=i.max)):(i.from<i.min&&(i.from=i.min),i.from>i.max&&(i.from=i.max),i.to<i.min&&(i.to=i.min),i.to>i.max&&(i.to=i.max),this.update_check.from&&(this.update_check.from!==i.from&&i.from>i.to&&(i.from=i.to),this.update_check.to!==i.to&&i.to<i.from&&(i.to=i.from)),i.from>i.to&&(i.from=i.to),i.to<i.from&&(i.to=i.from)),("number"!=typeof i.step||isNaN(i.step)||!i.step||i.step<0)&&(i.step=1),"number"==typeof i.from_min&&i.from<i.from_min&&(i.from=i.from_min),"number"==typeof i.from_max&&i.from>i.from_max&&(i.from=i.from_max),"number"==typeof i.to_min&&i.to<i.to_min&&(i.to=i.to_min),"number"==typeof i.to_max&&i.from>i.to_max&&(i.to=i.to_max),n&&(n.min!==i.min&&(n.min=i.min),n.max!==i.max&&(n.max=i.max),(n.from<n.min||n.from>n.max)&&(n.from=i.from),(n.to<n.min||n.to>n.max)&&(n.to=i.to)),("number"!=typeof i.min_interval||isNaN(i.min_interval)||!i.min_interval||i.min_interval<0)&&(i.min_interval=0),("number"!=typeof i.max_interval||isNaN(i.max_interval)||!i.max_interval||i.max_interval<0)&&(i.max_interval=0),i.min_interval&&i.min_interval>i.max-i.min&&(i.min_interval=i.max-i.min),i.max_interval&&i.max_interval>i.max-i.min&&(i.max_interval=i.max-i.min)},decorate:function(t,e){var i="",n=this.options;return n.prefix&&(i+=n.prefix),i+=t,n.max_postfix&&(n.values.length&&t===n.p_values[n.max]?(i+=n.max_postfix,n.postfix&&(i+=" ")):e===n.max&&(i+=n.max_postfix,n.postfix&&(i+=" "))),n.postfix&&(i+=n.postfix),i},updateFrom:function(){this.result.from=this.options.from,this.result.from_percent=this.convertToPercent(this.result.from),this.result.from_pretty=this._prettify(this.result.from),this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to,this.result.to_percent=this.convertToPercent(this.result.to),this.result.to_pretty=this._prettify(this.result.to),this.options.values&&(this.result.to_value=this.options.values[this.result.to])},updateResult:function(){this.result.min=this.options.min,this.result.max=this.options.max,this.updateFrom(),this.updateTo()},appendGrid:function(){if(this.options.grid){var t,e,i,n,r,o=this.options,a=o.max-o.min,s=o.grid_num,l=0,c=0,h=4,u="";for(this.calcGridMargin(),o.grid_snap?a>50?(s=50/o.step,l=this.toFixed(o.step/.5)):(s=a/o.step,l=this.toFixed(o.step/(a/100))):l=this.toFixed(100/s),s>4&&(h=3),s>7&&(h=2),s>14&&(h=1),s>28&&(h=0),t=0;t<s+1;t++){for(i=h,(c=this.toFixed(l*t))>100&&(c=100),this.coords.big[t]=c,n=(c-l*(t-1))/(i+1),e=1;e<=i&&0!==c;e++)u+='<span class="irs-grid-pol small" style="left: '+this.toFixed(c-n*e)+'%"></span>';u+='<span class="irs-grid-pol" style="left: '+c+'%"></span>',r=this.convertToValue(c),u+='<span class="irs-grid-text js-grid-text-'+t+'" style="left: '+c+'%">'+(r=o.values.length?o.p_values[r]:this._prettify(r))+"</span>"}this.coords.big_num=Math.ceil(s+1),this.$cache.cont.addClass("irs-with-grid"),this.$cache.grid.html(u),this.cacheGridLabels()}},cacheGridLabels:function(){var t,e,i=this.coords.big_num;for(e=0;e<i;e++)t=this.$cache.grid.find(".js-grid-text-"+e),this.$cache.grid_labels.push(t);this.calcGridLabels()},calcGridLabels:function(){var t,e,i=[],n=[],r=this.coords.big_num;for(t=0;t<r;t++)this.coords.big_w[t]=this.$cache.grid_labels[t].outerWidth(!1),this.coords.big_p[t]=this.toFixed(this.coords.big_w[t]/this.coords.w_rs*100),this.coords.big_x[t]=this.toFixed(this.coords.big_p[t]/2),i[t]=this.toFixed(this.coords.big[t]-this.coords.big_x[t]),n[t]=this.toFixed(i[t]+this.coords.big_p[t]);for(this.options.force_edges&&(i[0]<-this.coords.grid_gap&&(i[0]=-this.coords.grid_gap,n[0]=this.toFixed(i[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),n[r-1]>100+this.coords.grid_gap&&(n[r-1]=100+this.coords.grid_gap,i[r-1]=this.toFixed(n[r-1]-this.coords.big_p[r-1]),this.coords.big_x[r-1]=this.toFixed(this.coords.big_p[r-1]-this.coords.grid_gap))),this.calcGridCollision(2,i,n),this.calcGridCollision(4,i,n),t=0;t<r;t++)e=this.$cache.grid_labels[t][0],this.coords.big_x[t]!==Number.POSITIVE_INFINITY&&(e.style.marginLeft=-this.coords.big_x[t]+"%")},calcGridCollision:function(t,e,i){var n,r,o,a=this.coords.big_num;for(n=0;n<a&&!((r=n+t/2)>=a);n+=t)o=this.$cache.grid_labels[r][0],i[n]<=e[r]?o.style.visibility="visible":o.style.visibility="hidden"},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&("single"===this.options.type?this.coords.w_handle=this.$cache.s_single.outerWidth(!1):this.coords.w_handle=this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(e){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.update_check.from=this.result.from,this.update_check.to=this.result.to,this.options=t.extend(this.options,e),this.validate(),this.updateResult(e),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),t.data(this.input,"ionRangeSlider",null),this.remove(),this.input=null,this.options=null)}},t.fn.ionRangeSlider=function(e){return this.each(function(){t.data(this,"ionRangeSlider")||t.data(this,"ionRangeSlider",new s(this,e,o++))})},function(){for(var t=0,e=["ms","moz","webkit","o"],n=0;n<e.length&&!i.requestAnimationFrame;++n)i.requestAnimationFrame=i[e[n]+"RequestAnimationFrame"],i.cancelAnimationFrame=i[e[n]+"CancelAnimationFrame"]||i[e[n]+"CancelRequestAnimationFrame"];i.requestAnimationFrame||(i.requestAnimationFrame=function(e,n){var r=(new Date).getTime(),o=Math.max(0,16-(r-t)),a=i.setTimeout(function(){e(r+o)},o);return t=r+o,a}),i.cancelAnimationFrame||(i.cancelAnimationFrame=function(t){clearTimeout(t)})}()}),function(t,e,i,n){function r(t,e){return Math.max(0,t[0]-e[0],e[0]-t[1])+Math.max(0,t[2]-e[1],e[1]-t[3])}function o(e,i,n,r){var o=e.length,a=r?"offset":"position";for(n=n||0;o--;){var s=e[o].el?e[o].el:t(e[o]),l=s[a]();l.left+=parseInt(s.css("margin-left"),10),l.top+=parseInt(s.css("margin-top"),10),i[o]=[l.left-n,l.left+s.outerWidth()+n,l.top-n,l.top+s.outerHeight()+n]}}function a(t,e){var i=e.offset();return{left:t.left-i.left,top:t.top-i.top}}function s(t,e,i){e=[e.left,e.top],i=i&&[i.left,i.top];for(var n,o=t.length,a=[];o--;)n=t[o],a[o]=[o,r(n,e),i&&r(n,i)];return a=a.sort(function(t,e){return e[1]-t[1]||e[2]-t[2]||e[0]-t[0]})}function l(e){this.options=t.extend({},u,e),this.containers=[],this.options.rootGroup||(this.scrollProxy=t.proxy(this.scroll,this),this.dragProxy=t.proxy(this.drag,this),this.dropProxy=t.proxy(this.drop,this),this.placeholder=t(this.options.placeholder),e.isValidTarget||(this.options.isValidTarget=n))}function c(e,i){this.el=e,this.options=t.extend({},h,i),this.group=l.get(this.options),this.rootGroup=this.options.rootGroup||this.group,this.handle=this.rootGroup.options.handle||this.rootGroup.options.itemSelector;var n=this.rootGroup.options.itemPath;this.target=n?this.el.find(n):this.el,this.target.on(g.start,this.handle,t.proxy(this.dragInit,this)),this.options.drop&&this.group.containers.push(this)}var h={drag:!0,drop:!0,exclude:"",nested:!0,vertical:!0},u={afterMove:function(t,e,i){},containerPath:"",containerSelector:"ol, ul",distance:0,delay:0,handle:"",itemPath:"",itemSelector:"li",bodyClass:"dragging",draggedClass:"dragged",isValidTarget:function(t,e){return!0},onCancel:function(t,e,i,n){},onDrag:function(t,e,i,n){t.css(e)},onDragStart:function(e,i,n,r){e.css({height:e.outerHeight(),width:e.outerWidth()}),e.addClass(i.group.options.draggedClass),t("body").addClass(i.group.options.bodyClass)},onDrop:function(e,i,n,r){e.removeClass(i.group.options.draggedClass).removeAttr("style"),t("body").removeClass(i.group.options.bodyClass)},onMousedown:function(t,e,i){if(!i.target.nodeName.match(/^(input|select|textarea)$/i))return i.preventDefault(),!0},placeholderClass:"placeholder",placeholder:'<li class="placeholder"></li>',pullPlaceholder:!0,serialize:function(e,i,n){var r=t.extend({},e.data());return n?[i]:(i[0]&&(r.children=i),delete r.subContainers,delete r.sortable,r)},tolerance:0},d={},f=0,p={left:0,top:0,bottom:0,right:0},g={start:"touchstart.sortable mousedown.sortable",drop:"touchend.sortable touchcancel.sortable mouseup.sortable",drag:"touchmove.sortable mousemove.sortable",scroll:"scroll.sortable"};l.get=function(t){return d[t.group]||(t.group===n&&(t.group=f++),d[t.group]=new l(t)),d[t.group]},l.prototype={dragInit:function(e,i){this.$document=t(i.el[0].ownerDocument);var n=t(e.target).closest(this.options.itemSelector);if(n.length){if(this.item=n,this.itemContainer=i,this.item.is(this.options.exclude)||!this.options.onMousedown(this.item,u.onMousedown,e))return;this.setPointer(e),this.toggleListeners("on"),this.setupDelayTimer(),this.dragInitDone=!0}},drag:function(t){if(!this.dragging){if(!this.distanceMet(t)||!this.delayMet)return;this.options.onDragStart(this.item,this.itemContainer,u.onDragStart,t),this.item.before(this.placeholder),this.dragging=!0}this.setPointer(t),this.options.onDrag(this.item,a(this.pointer,this.item.offsetParent()),u.onDrag,t);var e=this.getPointer(t),i=this.sameResultBox,r=this.options.tolerance;(!i||i.top-r>e.top||i.bottom+r<e.top||i.left-r>e.left||i.right+r<e.left)&&(this.searchValidTarget()||(this.placeholder.detach(),this.lastAppendedItem=n))},drop:function(t){this.toggleListeners("off"),this.dragInitDone=!1,this.dragging&&(this.placeholder.closest("html")[0]?this.placeholder.before(this.item).detach():this.options.onCancel(this.item,this.itemContainer,u.onCancel,t),this.options.onDrop(this.item,this.getContainer(this.item),u.onDrop,t),this.clearDimensions(),this.clearOffsetParent(),this.lastAppendedItem=this.sameResultBox=n,this.dragging=!1)},searchValidTarget:function(t,e){t||(t=this.relativePointer||this.pointer,e=this.lastRelativePointer||this.lastPointer);for(var i=s(this.getContainerDimensions(),t,e),r=i.length;r--;){var o=i[r][0];if(!i[r][1]||this.options.pullPlaceholder){var l=this.containers[o];if(!l.disabled){if(!this.$getOffsetParent()){var c=l.getItemOffsetParent();t=a(t,c),e=a(e,c)}if(l.searchValidTarget(t,e))return!0}}}this.sameResultBox&&(this.sameResultBox=n)},movePlaceholder:function(t,e,i,n){var r=this.lastAppendedItem;!n&&r&&r[0]===e[0]||(e[i](this.placeholder),this.lastAppendedItem=e,this.sameResultBox=n,this.options.afterMove(this.placeholder,t,e))},getContainerDimensions:function(){return this.containerDimensions||o(this.containers,this.containerDimensions=[],this.options.tolerance,!this.$getOffsetParent()),this.containerDimensions},getContainer:function(t){return t.closest(this.options.containerSelector).data("sortable")},$getOffsetParent:function(){if(this.offsetParent===n){var t=this.containers.length-1,e=this.containers[t].getItemOffsetParent();if(!this.options.rootGroup)for(;t--;)if(e[0]!=this.containers[t].getItemOffsetParent()[0]){e=!1;break}this.offsetParent=e}return this.offsetParent},setPointer:function(t){var e=this.getPointer(t);if(this.$getOffsetParent()){var i=a(e,this.$getOffsetParent());this.lastRelativePointer=this.relativePointer,this.relativePointer=i}this.lastPointer=this.pointer,this.pointer=e},distanceMet:function(t){var e=this.getPointer(t);return Math.max(Math.abs(this.pointer.left-e.left),Math.abs(this.pointer.top-e.top))>=this.options.distance},getPointer:function(t){var e=t.originalEvent||t.originalEvent.touches&&t.originalEvent.touches[0];return{left:t.pageX||e.pageX,top:t.pageY||e.pageY}},setupDelayTimer:function(){var t=this;this.delayMet=!this.options.delay,this.delayMet||(clearTimeout(this._mouseDelayTimer),this._mouseDelayTimer=setTimeout(function(){t.delayMet=!0},this.options.delay))},scroll:function(t){this.clearDimensions(),this.clearOffsetParent()},toggleListeners:function(e){var i=this;t.each(["drag","drop","scroll"],function(t,n){i.$document[e](g[n],i[n+"Proxy"])})},clearOffsetParent:function(){this.offsetParent=n},clearDimensions:function(){this.traverse(function(t){t._clearDimensions()})},traverse:function(t){t(this);for(var e=this.containers.length;e--;)this.containers[e].traverse(t)},_clearDimensions:function(){this.containerDimensions=n},_destroy:function(){d[this.options.group]=n}},c.prototype={dragInit:function(t){var e=this.rootGroup;!this.disabled&&!e.dragInitDone&&this.options.drag&&this.isValidDrag(t)&&e.dragInit(t,this)},isValidDrag:function(t){return 1==t.which||"touchstart"==t.type&&1==t.originalEvent.touches.length},searchValidTarget:function(t,e){var i=s(this.getItemDimensions(),t,e),n=i.length,r=this.rootGroup,o=!r.options.isValidTarget||r.options.isValidTarget(r.item,this);if(!n&&o)return r.movePlaceholder(this,this.target,"append"),!0;for(;n--;){var a=i[n][0];if(!i[n][1]&&this.hasChildGroup(a)){if(this.getContainerGroup(a).searchValidTarget(t,e))return!0}else if(o)return this.movePlaceholder(a,t),!0}},movePlaceholder:function(e,i){var n=t(this.items[e]),r=this.itemDimensions[e],o="after",a=n.outerWidth(),s=n.outerHeight(),l=n.offset(),c={left:l.left,right:l.left+a,top:l.top,bottom:l.top+s};if(this.options.vertical){var h=(r[2]+r[3])/2;i.top<=h?(o="before",c.bottom-=s/2):c.top+=s/2}else{var u=(r[0]+r[1])/2;i.left<=u?(o="before",c.right-=a/2):c.left+=a/2}this.hasChildGroup(e)&&(c=p),this.rootGroup.movePlaceholder(this,n,o,c)},getItemDimensions:function(){return this.itemDimensions||(this.items=this.$getChildren(this.el,"item").filter(":not(."+this.group.options.placeholderClass+", ."+this.group.options.draggedClass+")").get(),o(this.items,this.itemDimensions=[],this.options.tolerance)),this.itemDimensions},getItemOffsetParent:function(){var t=this.el;return"relative"===t.css("position")||"absolute"===t.css("position")||"fixed"===t.css("position")?t:t.offsetParent()},hasChildGroup:function(t){return this.options.nested&&this.getContainerGroup(t)},getContainerGroup:function(e){var i=t.data(this.items[e],"subContainers");if(i===n){var r=this.$getChildren(this.items[e],"container");if(i=!1,r[0]){var o=t.extend({},this.options,{rootGroup:this.rootGroup,group:f++});i=r.sortable(o).data("sortable").group}t.data(this.items[e],"subContainers",i)}return i},$getChildren:function(e,i){var n=this.rootGroup.options,r=n[i+"Path"],o=n[i+"Selector"];return e=t(e),r&&(e=e.find(r)),e.children(o)},_serialize:function(e,i){var n=this,r=i?"item":"container",o=this.$getChildren(e,r).not(this.options.exclude).map(function(){return n._serialize(t(this),!i)}).get();return this.rootGroup.options.serialize(e,o,i)},traverse:function(e){t.each(this.items||[],function(i){var n=t.data(this,"subContainers");n&&n.traverse(e)}),e(this)},_clearDimensions:function(){this.itemDimensions=n},_destroy:function(){var e=this;this.target.off(g.start,this.handle),this.el.removeData("sortable"),this.options.drop&&(this.group.containers=t.grep(this.group.containers,function(t){return t!=e})),t.each(this.items||[],function(){t.removeData(this,"subContainers")})}};var m={enable:function(){this.traverse(function(t){t.disabled=!1})},disable:function(){this.traverse(function(t){t.disabled=!0})},serialize:function(){return this._serialize(this.el,!0)},refresh:function(){this.traverse(function(t){t._clearDimensions()})},destroy:function(){this.traverse(function(t){t._destroy()})}};t.extend(c.prototype,m),t.fn.sortable=function(e){var i=Array.prototype.slice.call(arguments,1);return this.map(function(){var r=t(this),o=r.data("sortable");return o&&m[e]?m[e].apply(o,i)||this:(o||e!==n&&"object"!=typeof e||r.data("sortable",new c(r,e)),this)})}}(jQuery,window),function(t){"use strict";function e(t,e){return t+".touchspin_"+e}function i(i,n){return t.map(i,function(t){return e(t,n)})}var n=0;t.fn.TouchSpin=function(e){if("destroy"!==e){var r={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalupclass:"glyphicon glyphicon-chevron-up",verticaldownclass:"glyphicon glyphicon-chevron-down",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-default",buttonup_class:"btn btn-default",buttondown_txt:"-",buttonup_txt:"+"},o={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each(function(){function a(){""!==T.initval&&""===O.val()&&O.val(T.initval)}function s(t){h(t),b();var e=D.input.val();""!==e&&(e=Number(D.input.val()),D.input.val(e.toFixed(T.decimals)))}function l(){T=t.extend({},r,R,c(),e)}function c(){var e={};return t.each(o,function(t,i){var n="bts-"+i;O.is("[data-"+n+"]")&&(e[t]=O.data(n))}),e}function h(e){T=t.extend({},T,e),e.postfix&&O.parent().find(".bootstrap-touchspin-postfix").text(e.postfix),e.prefix&&O.parent().find(".bootstrap-touchspin-prefix").text(e.prefix)}function u(){var t=O.val(),e=O.parent();""!==t&&(t=Number(t).toFixed(T.decimals)),O.data("initvalue",t).val(t),O.addClass("form-control"),e.hasClass("input-group")?d(e):f()}function d(e){e.addClass("bootstrap-touchspin");var i,n,r=O.prev(),o=O.next(),a='<span class="input-group-addon bootstrap-touchspin-prefix">'+T.prefix+"</span>",s='<span class="input-group-addon bootstrap-touchspin-postfix">'+T.postfix+"</span>";r.hasClass("input-group-btn")?(i='<button class="'+T.buttondown_class+' bootstrap-touchspin-down" type="button">'+T.buttondown_txt+"</button>",r.append(i)):(i='<span class="input-group-btn"><button class="'+T.buttondown_class+' bootstrap-touchspin-down" type="button">'+T.buttondown_txt+"</button></span>",t(i).insertBefore(O)),o.hasClass("input-group-btn")?(n='<button class="'+T.buttonup_class+' bootstrap-touchspin-up" type="button">'+T.buttonup_txt+"</button>",o.prepend(n)):(n='<span class="input-group-btn"><button class="'+T.buttonup_class+' bootstrap-touchspin-up" type="button">'+T.buttonup_txt+"</button></span>",t(n).insertAfter(O)),t(a).insertBefore(O),t(s).insertAfter(O),A=e}function f(){var e;e=T.verticalbuttons?'<div class="input-group bootstrap-touchspin"><span class="input-group-addon bootstrap-touchspin-prefix">'+T.prefix+'</span><span class="input-group-addon bootstrap-touchspin-postfix">'+T.postfix+'</span><span class="input-group-btn-vertical"><button class="'+T.buttondown_class+' bootstrap-touchspin-up" type="button"><i class="'+T.verticalupclass+'"></i></button><button class="'+T.buttonup_class+' bootstrap-touchspin-down" type="button"><i class="'+T.verticaldownclass+'"></i></button></span></div>':'<div class="input-group bootstrap-touchspin"><span class="input-group-btn"><button class="'+T.buttondown_class+' bootstrap-touchspin-down" type="button">'+T.buttondown_txt+'</button></span><span class="input-group-addon bootstrap-touchspin-prefix">'+T.prefix+'</span><span class="input-group-addon bootstrap-touchspin-postfix">'+T.postfix+'</span><span class="input-group-btn"><button class="'+T.buttonup_class+' bootstrap-touchspin-up" type="button">'+T.buttonup_txt+"</button></span></div>",A=t(e).insertBefore(O),t(".bootstrap-touchspin-prefix",A).after(O),O.hasClass("input-sm")?A.addClass("input-group-sm"):O.hasClass("input-lg")&&A.addClass("input-group-lg")}function p(){D={down:t(".bootstrap-touchspin-down",A),up:t(".bootstrap-touchspin-up",A),input:t("input",A),prefix:t(".bootstrap-touchspin-prefix",A).addClass(T.prefix_extraclass),postfix:t(".bootstrap-touchspin-postfix",A).addClass(T.postfix_extraclass)}}function g(){""===T.prefix&&D.prefix.hide(),""===T.postfix&&D.postfix.hide()}function m(){O.on("keydown",function(t){var e=t.keyCode||t.which;38===e?("up"!==F&&(_(),C()),t.preventDefault()):40===e&&("down"!==F&&(w(),S()),t.preventDefault())}),O.on("keyup",function(t){var e=t.keyCode||t.which;38===e?k():40===e&&k()}),O.on("blur",function(){b()}),D.down.on("keydown",function(t){var e=t.keyCode||t.which;32!==e&&13!==e||("down"!==F&&(w(),S()),t.preventDefault())}),D.down.on("keyup",function(t){var e=t.keyCode||t.which;32!==e&&13!==e||k()}),D.up.on("keydown",function(t){var e=t.keyCode||t.which;32!==e&&13!==e||("up"!==F&&(_(),C()),t.preventDefault())}),D.up.on("keyup",function(t){var e=t.keyCode||t.which;32!==e&&13!==e||k()}),D.down.on("mousedown.touchspin",function(t){D.down.off("touchstart.touchspin"),O.is(":disabled")||(w(),S(),t.preventDefault(),t.stopPropagation())}),D.down.on("touchstart.touchspin",function(t){D.down.off("mousedown.touchspin"),O.is(":disabled")||(w(),S(),t.preventDefault(),t.stopPropagation())}),D.up.on("mousedown.touchspin",function(t){D.up.off("touchstart.touchspin"),O.is(":disabled")||(_(),C(),t.preventDefault(),t.stopPropagation())}),D.up.on("touchstart.touchspin",function(t){D.up.off("mousedown.touchspin"),O.is(":disabled")||(_(),C(),t.preventDefault(),t.stopPropagation())}),D.up.on("mouseout touchleave touchend touchcancel",function(t){F&&(t.stopPropagation(),k())}),D.down.on("mouseout touchleave touchend touchcancel",function(t){F&&(t.stopPropagation(),k())}),D.down.on("mousemove touchmove",function(t){F&&(t.stopPropagation(),t.preventDefault())}),D.up.on("mousemove touchmove",function(t){F&&(t.stopPropagation(),t.preventDefault())}),t(document).on(i(["mouseup","touchend","touchcancel"],n).join(" "),function(t){F&&(t.preventDefault(),k())}),t(document).on(i(["mousemove","touchmove","scroll","scrollstart"],n).join(" "),function(t){F&&(t.preventDefault(),k())}),O.on("mousewheel DOMMouseScroll",function(t){if(T.mousewheel&&O.is(":focus")){var e=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;t.stopPropagation(),t.preventDefault(),e<0?w():_()}})}function v(){O.on("touchspin.uponce",function(){k(),_()}),O.on("touchspin.downonce",function(){k(),w()}),O.on("touchspin.startupspin",function(){C()}),O.on("touchspin.startdownspin",function(){S()}),O.on("touchspin.stopspin",function(){k()}),O.on("touchspin.updatesettings",function(t,e){s(e)})}function y(t){switch(T.forcestepdivisibility){case"round":return(Math.round(t/T.step)*T.step).toFixed(T.decimals);case"floor":return(Math.floor(t/T.step)*T.step).toFixed(T.decimals);case"ceil":return(Math.ceil(t/T.step)*T.step).toFixed(T.decimals);default:return t}}function b(){var t,e,i;""!==(t=O.val())?T.decimals>0&&"."===t||(e=parseFloat(t),isNaN(e)&&(e=""!==T.replacementval?T.replacementval:0),i=e,e.toString()!==t&&(i=e),e<T.min&&(i=T.min),e>T.max&&(i=T.max),i=y(i),Number(t).toString()!==i.toString()&&(O.val(i),O.trigger("change"))):""!==T.replacementval&&(O.val(T.replacementval),O.trigger("change"))}function x(){if(T.booster){var t=Math.pow(2,Math.floor(N/T.boostat))*T.step;return T.maxboostedstep&&t>T.maxboostedstep&&(t=T.maxboostedstep,M=Math.round(M/t)*t),Math.max(T.step,t)}return T.step}function _(){b(),M=parseFloat(D.input.val()),isNaN(M)&&(M=0);var t=M,e=x();(M+=e)>T.max&&(M=T.max,O.trigger("touchspin.on.max"),k()),D.input.val(Number(M).toFixed(T.decimals)),t!==M&&O.trigger("change")}function w(){b(),M=parseFloat(D.input.val()),isNaN(M)&&(M=0);var t=M,e=x();(M-=e)<T.min&&(M=T.min,O.trigger("touchspin.on.min"),k()),D.input.val(M.toFixed(T.decimals)),t!==M&&O.trigger("change")}function S(){k(),N=0,F="down",O.trigger("touchspin.on.startspin"),O.trigger("touchspin.on.startdownspin"),L=setTimeout(function(){E=setInterval(function(){N++,w()},T.stepinterval)},T.stepintervaldelay)}function C(){k(),N=0,F="up",O.trigger("touchspin.on.startspin"),O.trigger("touchspin.on.startupspin"),I=setTimeout(function(){P=setInterval(function(){N++,_()},T.stepinterval)},T.stepintervaldelay)}function k(){switch(clearTimeout(L),clearTimeout(I),clearInterval(E),clearInterval(P),F){case"up":O.trigger("touchspin.on.stopupspin"),O.trigger("touchspin.on.stopspin");break;case"down":O.trigger("touchspin.on.stopdownspin"),O.trigger("touchspin.on.stopspin")}N=0,F=!1}var T,A,D,M,E,P,L,I,O=t(this),R=O.data(),N=0,F=!1;O.data("alreadyinitialized")||(O.data("alreadyinitialized",!0),n+=1,O.data("spinnerid",n),O.is("input")?(l(),a(),b(),u(),p(),g(),m(),v(),D.input.css("display","block")):console.log("Must be an input."))})}this.each(function(){var e=t(this).data();t(document).off(i(["mouseup","touchend","touchcancel","mousemove","touchmove","scroll","scrollstart"],e.spinnerid).join(" "))})}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t,e,i,n){"use strict";function r(e,i){this.element=e,this.settings=t.extend({},a,i),this._defaults=a,this._name=o,this.init()}var o="quickselect",a={activeButtonClass:"active",breakOutAll:!1,breakOutValues:[],buttonClass:"",buttonDefaultClass:"",buttonRequiredClass:"",namespace:o,selectDefaultText:"More…",wrapperClass:"",buttonTag:"button"};t.extend(r.prototype,{init:function(){var e=this.element,i=this.settings.activeButtonClass,n=this.settings.breakOutAll,r=this.settings.breakOutValues,o=this.settings.buttonClass,a=this.settings.buttonDefaultClass,s=this.settings.buttonRequiredClass,l=this.settings.namespace,c=this.settings.selectDefaultText,h=this.settings.wrapperClass,u=this.settings.buttonTag,d=t('<div class="'+l+"__wrapper "+h+'"></div>');t(e).addClass(l+"__select").before(d),r=n?t("option",e).map(function(){return this.value}).get():r;var f=t(e).is(":disabled")?" disabled ":"",p=o+" "+(t(e).is(":required")?s:a);t.each(r,function(i,n){var r=t('option[value="'+n+'"]',e).attr("value"),o=t('option[value="'+n+'"]',e).text();r&&t(d).append("<"+u+' aria-pressed="false" data-'+l+'-value="'+r+'" class="'+l+"__btn "+p+'"'+f+">"+o+"</"+u+">")}),n?t(e).addClass(l+"__hidden"):t(e).wrap('<div class="'+l+"__btn "+l+"__more "+p+'"'+f+"></div>").before('<span class="'+l+'__more--label">'+c+"</span>").parent().detach().appendTo(d),t(e).change(function(){var o=t(this).val();t("."+l+"__btn",t(d)).removeClass(i);var a=c;-1!==t.inArray(o,r)||!0===n?t("."+l+"__btn[data-"+l+'-value="'+o+'"]',t(d)).addClass(i):o&&(a=t(e).find("option:selected").text(),t("."+l+"__more",t(d)).addClass(i)),t("."+l+"__more--label",t(d)).html(a)}),t("."+l+"__btn[data-"+l+"-value]",t(d)).click(function(){t(this).hasClass(i)?t(e).val(t("option:first",e).val()).change():t(e).val(t(this).attr("data-"+l+"-value")).change()}),t(e).val(t(e).val()).change(),t(e).focus(function(){t(this).css("opacity","1")}).blur(function(){t(this).css("opacity","0")})}}),t.fn[o]=function(e){return this.each(function(){t.data(this,"plugin_"+o)||t.data(this,"plugin_"+o,new r(this,e))})}}),$.fn.editableTableWidget=function(t){"use strict";return $(this).each(function(){var e,i=$.extend(function(){var t=$.extend({},$.fn.editableTableWidget.defaultOptions);return t.editor=t.editor.clone(),t}(),t),n=$(this),r=i.editor.css("position","absolute").hide().appendTo(n.parent()),o=function(t){(e=n.find("td:focus")).length&&(r.val(e.text()).removeClass("error").show().offset(e.offset()).css(e.css(i.cloneProperties)).width(e.width()).height(e.height()).focus(),t&&r.select())},a=function(){var t,i=r.val(),n=$.Event("change");if(e.text()===i||r.hasClass("error"))return!0;t=e.html(),e.text(i).trigger(n,i),!1===n.result&&e.html(t)},s=function(t,e){return 39===e?t.next("td"):37===e?t.prev("td"):38===e?t.parent().prev().children().eq(t.index()):40===e?t.parent().next().children().eq(t.index()):[]};r.blur(function(){a(),r.hide()}).keydown(function(t){if(13===t.which)a(),r.hide(),e.focus(),t.preventDefault(),t.stopPropagation();else if(27===t.which)r.val(e.text()),t.preventDefault(),t.stopPropagation(),r.hide(),e.focus();else if(9===t.which)e.focus();else if(this.selectionEnd-this.selectionStart===this.value.length){var i=s(e,t.which);i.length>0&&(i.focus(),t.preventDefault(),t.stopPropagation())}}).on("input paste",function(){var t=$.Event("validate");e.trigger(t,r.val()),!1===t.result?r.addClass("error"):r.removeClass("error")}),n.on("click keypress dblclick",o).css("cursor","pointer").keydown(function(t){var e=!0,i=s($(t.target),t.which);i.length>0?i.focus():13===t.which?o(!1):17===t.which||91===t.which||93===t.which?(o(!0),e=!1):e=!1,e&&(t.stopPropagation(),t.preventDefault())}),n.find("td").prop("tabindex",1),$(window).on("resize",function(){r.is(":visible")&&r.offset(e.offset()).width(e.width()).height(e.height())})})},$.fn.editableTableWidget.defaultOptions={cloneProperties:["padding","padding-top","padding-bottom","padding-left","padding-right","text-align","font","font-size","font-family","font-weight","border","border-top","border-bottom","border-left","border-right"],editor:$("<input>")},function(t){t(["jquery"],function(t){return function(){function e(e,i){return e||(e=l()),(h=t("#"+e.containerId)).length?h:(i&&(h=r(e)),h)}function i(e){for(var i=h.children(),r=i.length-1;r>=0;r--)n(t(i[r]),e)}function n(e,i,n){var r=!(!n||!n.force)&&n.force;return!(!e||!r&&0!==t(":focus",e).length)&&(e[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){c(e)}}),!0)}function r(e){return(h=t("<div/>").attr("id",e.containerId).addClass(e.positionClass)).appendTo(t(e.target)),h}function o(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">×</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function a(t){u&&u(t)}function s(i){function n(t){return null==t&&(t=""),t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function r(){var t="";switch(i.iconClass){case"toast-success":case"toast-info":t="polite";break;default:t="assertive"}k.attr("aria-live",t)}function o(){i.iconClass&&k.addClass(w.toastClass).addClass(S)}function s(){w.newestOnTop?h.prepend(k):h.append(k)}function u(){if(i.title){var t=i.title;w.escapeHtml&&(t=n(i.title)),T.append(t).addClass(w.titleClass),k.append(T)}}function p(){if(i.message){var t=i.message;w.escapeHtml&&(t=n(i.message)),A.append(t).addClass(w.messageClass),k.append(A)}}function g(){w.closeButton&&(M.addClass(w.closeClass).attr("role","button"),k.prepend(M))}function m(){w.progressBar&&(D.addClass(w.progressClass),k.prepend(D))}function v(){w.rtl&&k.addClass("rtl")}function y(e){var i=e&&!1!==w.closeMethod?w.closeMethod:w.hideMethod,n=e&&!1!==w.closeDuration?w.closeDuration:w.hideDuration,r=e&&!1!==w.closeEasing?w.closeEasing:w.hideEasing;if(!t(":focus",k).length||e)return clearTimeout(E.intervalId),k[i]({duration:n,easing:r,complete:function(){c(k),clearTimeout(C),w.onHidden&&"hidden"!==P.state&&w.onHidden(),P.state="hidden",P.endTime=new Date,a(P)}})}function b(){(w.timeOut>0||w.extendedTimeOut>0)&&(C=setTimeout(y,w.extendedTimeOut),E.maxHideTime=parseFloat(w.extendedTimeOut),E.hideEta=(new Date).getTime()+E.maxHideTime)}function x(){clearTimeout(C),E.hideEta=0,k.stop(!0,!0)[w.showMethod]({duration:w.showDuration,easing:w.showEasing})}function _(){var t=(E.hideEta-(new Date).getTime())/E.maxHideTime*100;D.width(t+"%")}var w=l(),S=i.iconClass||w.iconClass;if(void 0!==i.optionsOverride&&(w=t.extend(w,i.optionsOverride),S=i.optionsOverride.iconClass||S),!function(t,e){if(t.preventDuplicates){if(e.message===d)return!0;d=e.message}return!1}(w,i)){f++,h=e(w,!0);var C=null,k=t("<div/>"),T=t("<div/>"),A=t("<div/>"),D=t("<div/>"),M=t(w.closeHtml),E={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:f,state:"visible",startTime:new Date,options:w,map:i};return o(),u(),p(),g(),m(),v(),s(),r(),k.hide(),k[w.showMethod]({duration:w.showDuration,easing:w.showEasing,complete:w.onShown}),w.timeOut>0&&(C=setTimeout(y,w.timeOut),E.maxHideTime=parseFloat(w.timeOut),E.hideEta=(new Date).getTime()+E.maxHideTime,w.progressBar&&(E.intervalId=setInterval(_,10))),w.closeOnHover&&k.hover(x,b),!w.onclick&&w.tapToDismiss&&k.click(y),w.closeButton&&M&&M.click(function(t){t.stopPropagation?t.stopPropagation():void 0!==t.cancelBubble&&!0!==t.cancelBubble&&(t.cancelBubble=!0),w.onCloseClick&&w.onCloseClick(t),y(!0)}),w.onclick&&k.click(function(t){w.onclick(t),y()}),a(P),w.debug&&console&&console.log(P),k}}function l(){return t.extend({},o(),g.options)}function c(t){h||(h=e()),t.is(":visible")||(t.remove(),t=null,0===h.children().length&&(h.remove(),d=void 0))}var h,u,d,f=0,p={error:"error",info:"info",success:"success",warning:"warning"},g={clear:function(t,r){var o=l();h||e(o),n(t,o,r)||i(o)},remove:function(i){var n=l();h||e(n),i&&0===t(":focus",i).length?c(i):h.children().length&&h.remove()},error:function(t,e,i){return s({type:p.error,iconClass:l().iconClasses.error,message:t,optionsOverride:i,title:e})},getContainer:e,info:function(t,e,i){return s({type:p.info,iconClass:l().iconClasses.info,message:t,optionsOverride:i,title:e})},options:{},subscribe:function(t){u=t},success:function(t,e,i){return s({type:p.success,iconClass:l().iconClasses.success,message:t,optionsOverride:i,title:e})},version:"2.1.3",warning:function(t,e,i){return s({type:p.warning,iconClass:l().iconClasses.warning,message:t,optionsOverride:i,title:e})}};return g}()})}("function"==typeof define&&define.amd?define:function(t,e){"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):window.toastr=e(window.jQuery)}),function(t,e){if("function"==typeof define&&define.amd)define(["moment","jquery"],function(i,n){return t.daterangepicker=e(i,n)});else if("object"==typeof module&&module.exports){var i="undefined"!=typeof window?window.jQuery:void 0;i||(i=require("jquery")).fn||(i.fn={}),module.exports=e(require("moment"),i)}else t.daterangepicker=e(t.moment,t.jQuery)}(this,function(t,e){var i=function(i,n,r){if(this.parentEl="body",this.element=e(i),this.startDate=t().startOf("day"),this.endDate=t().endOf("day"),this.minDate=!1,this.maxDate=!1,this.dateLimit=!1,this.autoApply=!1,this.singleDatePicker=!1,this.showDropdowns=!1,this.showWeekNumbers=!1,this.showISOWeekNumbers=!1,this.showCustomRangeLabel=!0,this.timePicker=!1,this.timePicker24Hour=!1,this.timePickerIncrement=1,this.timePickerSeconds=!1,this.linkedCalendars=!0,this.autoUpdateInput=!0,this.alwaysShowCalendars=!1,this.ranges={},this.opens="right",this.element.hasClass("pull-right")&&(this.opens="left"),this.drops="down",this.element.hasClass("dropup")&&(this.drops="up"),this.buttonClasses="btn btn-sm",this.applyClass="btn-success",this.cancelClass="btn-default",this.locale={direction:"ltr",format:t.localeData().longDateFormat("L"),separator:" - ",applyLabel:"Apply",cancelLabel:"Cancel",weekLabel:"W",customRangeLabel:"Custom Range",daysOfWeek:t.weekdaysMin(),monthNames:t.monthsShort(),firstDay:t.localeData().firstDayOfWeek()},this.callback=function(){},this.isShowing=!1,this.leftCalendar={},this.rightCalendar={},"object"==typeof n&&null!==n||(n={}),"string"==typeof(n=e.extend(this.element.data(),n)).template||n.template instanceof e||(n.template='<div class="daterangepicker dropdown-menu"><div class="calendar left"><div class="daterangepicker_input"><input class="input-mini form-control" type="text" name="daterangepicker_start" value="" /><i class="fa fa-calendar glyphicon glyphicon-calendar"></i><div class="calendar-time"><div></div><i class="fa fa-clock-o glyphicon glyphicon-time"></i></div></div><div class="calendar-table"></div></div><div class="calendar right"><div class="daterangepicker_input"><input class="input-mini form-control" type="text" name="daterangepicker_end" value="" /><i class="fa fa-calendar glyphicon glyphicon-calendar"></i><div class="calendar-time"><div></div><i class="fa fa-clock-o glyphicon glyphicon-time"></i></div></div><div class="calendar-table"></div></div><div class="ranges"><div class="range_inputs"><button class="applyBtn" disabled="disabled" type="button"></button> <button class="cancelBtn" type="button"></button></div></div></div>'),this.parentEl=e(n.parentEl&&e(n.parentEl).length?n.parentEl:this.parentEl),this.container=e(n.template).appendTo(this.parentEl),"object"==typeof n.locale&&("string"==typeof n.locale.direction&&(this.locale.direction=n.locale.direction),"string"==typeof n.locale.format&&(this.locale.format=n.locale.format),"string"==typeof n.locale.separator&&(this.locale.separator=n.locale.separator),"object"==typeof n.locale.daysOfWeek&&(this.locale.daysOfWeek=n.locale.daysOfWeek.slice()),"object"==typeof n.locale.monthNames&&(this.locale.monthNames=n.locale.monthNames.slice()),"number"==typeof n.locale.firstDay&&(this.locale.firstDay=n.locale.firstDay),"string"==typeof n.locale.applyLabel&&(this.locale.applyLabel=n.locale.applyLabel),"string"==typeof n.locale.cancelLabel&&(this.locale.cancelLabel=n.locale.cancelLabel),"string"==typeof n.locale.weekLabel&&(this.locale.weekLabel=n.locale.weekLabel),"string"==typeof n.locale.customRangeLabel)){(d=document.createElement("textarea")).innerHTML=n.locale.customRangeLabel;f=d.value;this.locale.customRangeLabel=f}if(this.container.addClass(this.locale.direction),"string"==typeof n.startDate&&(this.startDate=t(n.startDate,this.locale.format)),"string"==typeof n.endDate&&(this.endDate=t(n.endDate,this.locale.format)),"string"==typeof n.minDate&&(this.minDate=t(n.minDate,this.locale.format)),"string"==typeof n.maxDate&&(this.maxDate=t(n.maxDate,this.locale.format)),"object"==typeof n.startDate&&(this.startDate=t(n.startDate)),"object"==typeof n.endDate&&(this.endDate=t(n.endDate)),"object"==typeof n.minDate&&(this.minDate=t(n.minDate)),"object"==typeof n.maxDate&&(this.maxDate=t(n.maxDate)),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),"string"==typeof n.applyClass&&(this.applyClass=n.applyClass),"string"==typeof n.cancelClass&&(this.cancelClass=n.cancelClass),"object"==typeof n.dateLimit&&(this.dateLimit=n.dateLimit),"string"==typeof n.opens&&(this.opens=n.opens),"string"==typeof n.drops&&(this.drops=n.drops),"boolean"==typeof n.showWeekNumbers&&(this.showWeekNumbers=n.showWeekNumbers),"boolean"==typeof n.showISOWeekNumbers&&(this.showISOWeekNumbers=n.showISOWeekNumbers),"string"==typeof n.buttonClasses&&(this.buttonClasses=n.buttonClasses),"object"==typeof n.buttonClasses&&(this.buttonClasses=n.buttonClasses.join(" ")),"boolean"==typeof n.showDropdowns&&(this.showDropdowns=n.showDropdowns),"boolean"==typeof n.showCustomRangeLabel&&(this.showCustomRangeLabel=n.showCustomRangeLabel),"boolean"==typeof n.singleDatePicker&&(this.singleDatePicker=n.singleDatePicker,this.singleDatePicker&&(this.endDate=this.startDate.clone())),"boolean"==typeof n.timePicker&&(this.timePicker=n.timePicker),"boolean"==typeof n.timePickerSeconds&&(this.timePickerSeconds=n.timePickerSeconds),"number"==typeof n.timePickerIncrement&&(this.timePickerIncrement=n.timePickerIncrement),"boolean"==typeof n.timePicker24Hour&&(this.timePicker24Hour=n.timePicker24Hour),"boolean"==typeof n.autoApply&&(this.autoApply=n.autoApply),"boolean"==typeof n.autoUpdateInput&&(this.autoUpdateInput=n.autoUpdateInput),"boolean"==typeof n.linkedCalendars&&(this.linkedCalendars=n.linkedCalendars),"function"==typeof n.isInvalidDate&&(this.isInvalidDate=n.isInvalidDate),"function"==typeof n.isCustomDate&&(this.isCustomDate=n.isCustomDate),"boolean"==typeof n.alwaysShowCalendars&&(this.alwaysShowCalendars=n.alwaysShowCalendars),0!=this.locale.firstDay)for(var o=this.locale.firstDay;o>0;)this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()),o--;var a,s,l;if(void 0===n.startDate&&void 0===n.endDate&&e(this.element).is("input[type=text]")){var c=e(this.element).val(),h=c.split(this.locale.separator);a=s=null,2==h.length?(a=t(h[0],this.locale.format),s=t(h[1],this.locale.format)):this.singleDatePicker&&""!==c&&(a=t(c,this.locale.format),s=t(c,this.locale.format)),null!==a&&null!==s&&(this.setStartDate(a),this.setEndDate(s))}if("object"==typeof n.ranges){for(l in n.ranges){a="string"==typeof n.ranges[l][0]?t(n.ranges[l][0],this.locale.format):t(n.ranges[l][0]),s="string"==typeof n.ranges[l][1]?t(n.ranges[l][1],this.locale.format):t(n.ranges[l][1]),this.minDate&&a.isBefore(this.minDate)&&(a=this.minDate.clone());var u=this.maxDate;if(this.dateLimit&&u&&a.clone().add(this.dateLimit).isAfter(u)&&(u=a.clone().add(this.dateLimit)),u&&s.isAfter(u)&&(s=u.clone()),!(this.minDate&&s.isBefore(this.minDate,this.timepicker?"minute":"day")||u&&a.isAfter(u,this.timepicker?"minute":"day"))){var d=document.createElement("textarea");d.innerHTML=l;var f=d.value;this.ranges[f]=[a,s]}}var p="<ul>";for(l in this.ranges)p+='<li data-range-key="'+l+'">'+l+"</li>";this.showCustomRangeLabel&&(p+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+"</li>"),p+="</ul>",this.container.find(".ranges").prepend(p)}"function"==typeof r&&(this.callback=r),this.timePicker||(this.startDate=this.startDate.startOf("day"),this.endDate=this.endDate.endOf("day"),this.container.find(".calendar-time").hide()),this.timePicker&&this.autoApply&&(this.autoApply=!1),this.autoApply&&"object"!=typeof n.ranges?this.container.find(".ranges").hide():this.autoApply&&this.container.find(".applyBtn, .cancelBtn").addClass("hide"),this.singleDatePicker&&(this.container.addClass("single"),this.container.find(".calendar.left").addClass("single"),this.container.find(".calendar.left").show(),this.container.find(".calendar.right").hide(),this.container.find(".daterangepicker_input input, .daterangepicker_input > i").hide(),this.timePicker?this.container.find(".ranges ul").hide():this.container.find(".ranges").hide()),(void 0===n.ranges&&!this.singleDatePicker||this.alwaysShowCalendars)&&this.container.addClass("show-calendar"),this.container.addClass("opens"+this.opens),void 0!==n.ranges&&"right"==this.opens&&this.container.find(".ranges").prependTo(this.container.find(".calendar.left").parent()),this.container.find(".applyBtn, .cancelBtn").addClass(this.buttonClasses),this.applyClass.length&&this.container.find(".applyBtn").addClass(this.applyClass),this.cancelClass.length&&this.container.find(".cancelBtn").addClass(this.cancelClass),this.container.find(".applyBtn").html(this.locale.applyLabel),this.container.find(".cancelBtn").html(this.locale.cancelLabel),this.container.find(".calendar").on("click.daterangepicker",".prev",e.proxy(this.clickPrev,this)).on("click.daterangepicker",".next",e.proxy(this.clickNext,this)).on("mousedown.daterangepicker","td.available",e.proxy(this.clickDate,this)).on("mouseenter.daterangepicker","td.available",e.proxy(this.hoverDate,this)).on("mouseleave.daterangepicker","td.available",e.proxy(this.updateFormInputs,this)).on("change.daterangepicker","select.yearselect",e.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.monthselect",e.proxy(this.monthOrYearChanged,this)).on("change.daterangepicker","select.hourselect,select.minuteselect,select.secondselect,select.ampmselect",e.proxy(this.timeChanged,this)).on("click.daterangepicker",".daterangepicker_input input",e.proxy(this.showCalendars,this)).on("focus.daterangepicker",".daterangepicker_input input",e.proxy(this.formInputsFocused,this)).on("blur.daterangepicker",".daterangepicker_input input",e.proxy(this.formInputsBlurred,this)).on("change.daterangepicker",".daterangepicker_input input",e.proxy(this.formInputsChanged,this)),this.container.find(".ranges").on("click.daterangepicker","button.applyBtn",e.proxy(this.clickApply,this)).on("click.daterangepicker","button.cancelBtn",e.proxy(this.clickCancel,this)).on("click.daterangepicker","li",e.proxy(this.clickRange,this)).on("mouseenter.daterangepicker","li",e.proxy(this.hoverRange,this)).on("mouseleave.daterangepicker","li",e.proxy(this.updateFormInputs,this)),this.element.is("input")||this.element.is("button")?this.element.on({"click.daterangepicker":e.proxy(this.show,this),"focus.daterangepicker":e.proxy(this.show,this),"keyup.daterangepicker":e.proxy(this.elementChanged,this),"keydown.daterangepicker":e.proxy(this.keydown,this)}):this.element.on("click.daterangepicker",e.proxy(this.toggle,this)),this.element.is("input")&&!this.singleDatePicker&&this.autoUpdateInput?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&this.autoUpdateInput&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))};return i.prototype={constructor:i,setStartDate:function(e){"string"==typeof e&&(this.startDate=t(e,this.locale.format)),"object"==typeof e&&(this.startDate=t(e)),this.timePicker||(this.startDate=this.startDate.startOf("day")),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.minDate&&this.startDate.isBefore(this.minDate)&&(this.startDate=this.minDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.maxDate&&this.startDate.isAfter(this.maxDate)&&(this.startDate=this.maxDate.clone(),this.timePicker&&this.timePickerIncrement&&this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)),this.isShowing||this.updateElement(),this.updateMonthsInView()},setEndDate:function(e){"string"==typeof e&&(this.endDate=t(e,this.locale.format)),"object"==typeof e&&(this.endDate=t(e)),this.timePicker||(this.endDate=this.endDate.endOf("day")),this.timePicker&&this.timePickerIncrement&&this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement),this.endDate.isBefore(this.startDate)&&(this.endDate=this.startDate.clone()),this.maxDate&&this.endDate.isAfter(this.maxDate)&&(this.endDate=this.maxDate.clone()),this.dateLimit&&this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)&&(this.endDate=this.startDate.clone().add(this.dateLimit)),this.previousRightTime=this.endDate.clone(),this.isShowing||this.updateElement(),this.updateMonthsInView()},isInvalidDate:function(){return!1},isCustomDate:function(){return!1},updateView:function(){this.timePicker&&(this.renderTimePicker("left"),this.renderTimePicker("right"),this.endDate?this.container.find(".right .calendar-time select").removeAttr("disabled").removeClass("disabled"):this.container.find(".right .calendar-time select").attr("disabled","disabled").addClass("disabled")),this.endDate?(this.container.find('input[name="daterangepicker_end"]').removeClass("active"),this.container.find('input[name="daterangepicker_start"]').addClass("active")):(this.container.find('input[name="daterangepicker_end"]').addClass("active"),this.container.find('input[name="daterangepicker_start"]').removeClass("active")),this.updateMonthsInView(),this.updateCalendars(),this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.startDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM"))&&(this.endDate.format("YYYY-MM")==this.leftCalendar.month.format("YYYY-MM")||this.endDate.format("YYYY-MM")==this.rightCalendar.month.format("YYYY-MM")))return;this.leftCalendar.month=this.startDate.clone().date(2),this.linkedCalendars||this.endDate.month()==this.startDate.month()&&this.endDate.year()==this.startDate.year()?this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"):this.rightCalendar.month=this.endDate.clone().date(2)}else this.leftCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&this.rightCalendar.month.format("YYYY-MM")!=this.startDate.format("YYYY-MM")&&(this.leftCalendar.month=this.startDate.clone().date(2),this.rightCalendar.month=this.startDate.clone().date(2).add(1,"month"));this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate&&(this.rightCalendar.month=this.maxDate.clone().date(2),this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,"month"))},updateCalendars:function(){if(this.timePicker){var t,e,i;if(this.endDate)t=parseInt(this.container.find(".left .hourselect").val(),10),e=parseInt(this.container.find(".left .minuteselect").val(),10),i=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0,this.timePicker24Hour||("PM"===(n=this.container.find(".left .ampmselect").val())&&t<12&&(t+=12),"AM"===n&&12===t&&(t=0));else if(t=parseInt(this.container.find(".right .hourselect").val(),10),e=parseInt(this.container.find(".right .minuteselect").val(),10),i=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0,!this.timePicker24Hour){var n=this.container.find(".right .ampmselect").val();"PM"===n&&t<12&&(t+=12),"AM"===n&&12===t&&(t=0)}this.leftCalendar.month.hour(t).minute(e).second(i),this.rightCalendar.month.hour(t).minute(e).second(i)}this.renderCalendar("left"),this.renderCalendar("right"),this.container.find(".ranges li").removeClass("active"),null!=this.endDate&&this.calculateChosenLabel()},renderCalendar:function(i){var n="left"==i?this.leftCalendar:this.rightCalendar,r=n.month.month(),o=n.month.year(),a=n.month.hour(),s=n.month.minute(),l=n.month.second(),c=t([o,r]).daysInMonth(),h=t([o,r,1]),u=t([o,r,c]),d=t(h).subtract(1,"month").month(),f=t(h).subtract(1,"month").year(),p=t([f,d]).daysInMonth(),g=h.day();(n=[]).firstDay=h,n.lastDay=u;for(y=0;y<6;y++)n[y]=[];var m=p-g+this.locale.firstDay+1;m>p&&(m-=7),g==this.locale.firstDay&&(m=p-6);for(var v=t([f,d,m,12,s,l]),y=0,b=0,x=0;y<42;y++,b++,v=t(v).add(24,"hour"))y>0&&b%7==0&&(b=0,x++),n[x][b]=v.clone().hour(a).minute(s).second(l),v.hour(12),this.minDate&&n[x][b].format("YYYY-MM-DD")==this.minDate.format("YYYY-MM-DD")&&n[x][b].isBefore(this.minDate)&&"left"==i&&(n[x][b]=this.minDate.clone()),this.maxDate&&n[x][b].format("YYYY-MM-DD")==this.maxDate.format("YYYY-MM-DD")&&n[x][b].isAfter(this.maxDate)&&"right"==i&&(n[x][b]=this.maxDate.clone());"left"==i?this.leftCalendar.calendar=n:this.rightCalendar.calendar=n;var _="left"==i?this.minDate:this.startDate,w=this.maxDate,S=("left"==i?this.startDate:this.endDate,"ltr"==this.locale.direction?{left:"chevron-left",right:"chevron-right"}:{left:"chevron-right",right:"chevron-left"}),C='<table class="table-condensed">';C+="<thead>",C+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(C+="<th></th>"),_&&!_.isBefore(n.firstDay)||this.linkedCalendars&&"left"!=i?C+="<th></th>":C+='<th class="prev available"><i class="fa fa-'+S.left+" glyphicon glyphicon-"+S.left+'"></i></th>';var k=this.locale.monthNames[n[1][1].month()]+n[1][1].format(" YYYY");if(this.showDropdowns){for(var T=n[1][1].month(),A=n[1][1].year(),D=w&&w.year()||A+5,M=_&&_.year()||A-50,E=A==M,P=A==D,L='<select class="monthselect">',I=0;I<12;I++)(!E||I>=_.month())&&(!P||I<=w.month())?L+="<option value='"+I+"'"+(I===T?" selected='selected'":"")+">"+this.locale.monthNames[I]+"</option>":L+="<option value='"+I+"'"+(I===T?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[I]+"</option>";L+="</select>";for(var O='<select class="yearselect">',R=M;R<=D;R++)O+='<option value="'+R+'"'+(R===A?' selected="selected"':"")+">"+R+"</option>";k=L+(O+="</select>")}if(C+='<th colspan="5" class="month">'+k+"</th>",w&&!w.isAfter(n.lastDay)||this.linkedCalendars&&"right"!=i&&!this.singleDatePicker?C+="<th></th>":C+='<th class="next available"><i class="fa fa-'+S.right+" glyphicon glyphicon-"+S.right+'"></i></th>',C+="</tr>",C+="<tr>",(this.showWeekNumbers||this.showISOWeekNumbers)&&(C+='<th class="week">'+this.locale.weekLabel+"</th>"),e.each(this.locale.daysOfWeek,function(t,e){C+="<th>"+e+"</th>"}),C+="</tr>",C+="</thead>",C+="<tbody>",null==this.endDate&&this.dateLimit){var N=this.startDate.clone().add(this.dateLimit).endOf("day");w&&!N.isBefore(w)||(w=N)}for(x=0;x<6;x++){C+="<tr>",this.showWeekNumbers?C+='<td class="week">'+n[x][0].week()+"</td>":this.showISOWeekNumbers&&(C+='<td class="week">'+n[x][0].isoWeek()+"</td>");for(b=0;b<7;b++){var F=[];n[x][b].isSame(new Date,"day")&&F.push("today"),n[x][b].isoWeekday()>5&&F.push("weekend"),n[x][b].month()!=n[1][1].month()&&F.push("off"),this.minDate&&n[x][b].isBefore(this.minDate,"day")&&F.push("off","disabled"),w&&n[x][b].isAfter(w,"day")&&F.push("off","disabled"),this.isInvalidDate(n[x][b])&&F.push("off","disabled"),n[x][b].format("YYYY-MM-DD")==this.startDate.format("YYYY-MM-DD")&&F.push("active","start-date"),null!=this.endDate&&n[x][b].format("YYYY-MM-DD")==this.endDate.format("YYYY-MM-DD")&&F.push("active","end-date"),null!=this.endDate&&n[x][b]>this.startDate&&n[x][b]<this.endDate&&F.push("in-range");var z=this.isCustomDate(n[x][b]);!1!==z&&("string"==typeof z?F.push(z):Array.prototype.push.apply(F,z));for(var H="",$=!1,y=0;y<F.length;y++)H+=F[y]+" ","disabled"==F[y]&&($=!0);$||(H+="available"),C+='<td class="'+H.replace(/^\s+|\s+$/g,"")+'" data-title="r'+x+"c"+b+'">'+n[x][b].date()+"</td>"}C+="</tr>"}C+="</tbody>",C+="</table>",this.container.find(".calendar."+i+" .calendar-table").html(C)},renderTimePicker:function(t){if("right"!=t||this.endDate){var e,i,n,r=this.maxDate;if(!this.dateLimit||this.maxDate&&!this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate)||(r=this.startDate.clone().add(this.dateLimit)),"left"==t)i=this.startDate.clone(),n=this.minDate;else if("right"==t){i=this.endDate.clone(),n=this.startDate;var o=this.container.find(".calendar.right .calendar-time div");if(""!=o.html()&&(i.hour(o.find(".hourselect option:selected").val()||i.hour()),i.minute(o.find(".minuteselect option:selected").val()||i.minute()),i.second(o.find(".secondselect option:selected").val()||i.second()),!this.timePicker24Hour)){var a=o.find(".ampmselect option:selected").val();"PM"===a&&i.hour()<12&&i.hour(i.hour()+12),"AM"===a&&12===i.hour()&&i.hour(0)}i.isBefore(this.startDate)&&(i=this.startDate.clone()),r&&i.isAfter(r)&&(i=r.clone())}e='<select class="hourselect">';for(var s=this.timePicker24Hour?0:1,l=this.timePicker24Hour?23:12,c=s;c<=l;c++){var h=c;this.timePicker24Hour||(h=i.hour()>=12?12==c?12:c+12:12==c?0:c);var u=i.clone().hour(h),d=!1;n&&u.minute(59).isBefore(n)&&(d=!0),r&&u.minute(0).isAfter(r)&&(d=!0),h!=i.hour()||d?e+=d?'<option value="'+c+'" disabled="disabled" class="disabled">'+c+"</option>":'<option value="'+c+'">'+c+"</option>":e+='<option value="'+c+'" selected="selected">'+c+"</option>"}e+="</select> ",e+=': <select class="minuteselect">';for(c=0;c<60;c+=this.timePickerIncrement){var f=c<10?"0"+c:c,u=i.clone().minute(c),d=!1;n&&u.second(59).isBefore(n)&&(d=!0),r&&u.second(0).isAfter(r)&&(d=!0),i.minute()!=c||d?e+=d?'<option value="'+c+'" disabled="disabled" class="disabled">'+f+"</option>":'<option value="'+c+'">'+f+"</option>":e+='<option value="'+c+'" selected="selected">'+f+"</option>"}if(e+="</select> ",this.timePickerSeconds){e+=': <select class="secondselect">';for(c=0;c<60;c++){var f=c<10?"0"+c:c,u=i.clone().second(c),d=!1;n&&u.isBefore(n)&&(d=!0),r&&u.isAfter(r)&&(d=!0),i.second()!=c||d?e+=d?'<option value="'+c+'" disabled="disabled" class="disabled">'+f+"</option>":'<option value="'+c+'">'+f+"</option>":e+='<option value="'+c+'" selected="selected">'+f+"</option>"}e+="</select> "}if(!this.timePicker24Hour){e+='<select class="ampmselect">';var p="",g="";n&&i.clone().hour(12).minute(0).second(0).isBefore(n)&&(p=' disabled="disabled" class="disabled"'),r&&i.clone().hour(0).minute(0).second(0).isAfter(r)&&(g=' disabled="disabled" class="disabled"'),i.hour()>=12?e+='<option value="AM"'+p+'>AM</option><option value="PM" selected="selected"'+g+">PM</option>":e+='<option value="AM" selected="selected"'+p+'>AM</option><option value="PM"'+g+">PM</option>",e+="</select>"}this.container.find(".calendar."+t+" .calendar-time div").html(e)}},updateFormInputs:function(){this.container.find("input[name=daterangepicker_start]").is(":focus")||this.container.find("input[name=daterangepicker_end]").is(":focus")||(this.container.find("input[name=daterangepicker_start]").val(this.startDate.format(this.locale.format)),this.endDate&&this.container.find("input[name=daterangepicker_end]").val(this.endDate.format(this.locale.format)),this.singleDatePicker||this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate))?this.container.find("button.applyBtn").removeAttr("disabled"):this.container.find("button.applyBtn").attr("disabled","disabled"))},move:function(){var t,i={top:0,left:0},n=e(window).width();this.parentEl.is("body")||(i={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()},n=this.parentEl[0].clientWidth+this.parentEl.offset().left),t="up"==this.drops?this.element.offset().top-this.container.outerHeight()-i.top:this.element.offset().top+this.element.outerHeight()-i.top,this.container["up"==this.drops?"addClass":"removeClass"]("dropup"),"left"==this.opens?(this.container.css({top:t,right:n-this.element.offset().left-this.element.outerWidth(),left:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):"center"==this.opens?(this.container.css({top:t,left:this.element.offset().left-i.left+this.element.outerWidth()/2-this.container.outerWidth()/2,right:"auto"}),this.container.offset().left<0&&this.container.css({right:"auto",left:9})):(this.container.css({top:t,left:this.element.offset().left-i.left,right:"auto"}),this.container.offset().left+this.container.outerWidth()>e(window).width()&&this.container.css({left:"auto",right:0}))},show:function(t){this.isShowing||(this._outsideClickProxy=e.proxy(function(t){this.outsideClick(t)},this),e(document).on("mousedown.daterangepicker",this._outsideClickProxy).on("touchend.daterangepicker",this._outsideClickProxy).on("click.daterangepicker","[data-toggle=dropdown]",this._outsideClickProxy).on("focusin.daterangepicker",this._outsideClickProxy),e(window).on("resize.daterangepicker",e.proxy(function(t){this.move(t)},this)),this.oldStartDate=this.startDate.clone(),this.oldEndDate=this.endDate.clone(),this.previousRightTime=this.endDate.clone(),this.updateView(),this.container.show(),this.move(),this.element.trigger("show.daterangepicker",this),this.isShowing=!0)},hide:function(t){this.isShowing&&(this.endDate||(this.startDate=this.oldStartDate.clone(),this.endDate=this.oldEndDate.clone()),this.startDate.isSame(this.oldStartDate)&&this.endDate.isSame(this.oldEndDate)||this.callback(this.startDate,this.endDate,this.chosenLabel),this.updateElement(),e(document).off(".daterangepicker"),e(window).off(".daterangepicker"),this.container.hide(),this.element.trigger("hide.daterangepicker",this),this.isShowing=!1)},toggle:function(t){this.isShowing?this.hide():this.show()},outsideClick:function(t){var i=e(t.target);"focusin"==t.type||i.closest(this.element).length||i.closest(this.container).length||i.closest(".calendar-table").length||(this.hide(),this.element.trigger("outsideClick.daterangepicker",this))},showCalendars:function(){this.container.addClass("show-calendar"),this.move(),this.element.trigger("showCalendar.daterangepicker",this)},hideCalendars:function(){this.container.removeClass("show-calendar"),this.element.trigger("hideCalendar.daterangepicker",this)},hoverRange:function(t){if(!this.container.find("input[name=daterangepicker_start]").is(":focus")&&!this.container.find("input[name=daterangepicker_end]").is(":focus")){var e=t.target.getAttribute("data-range-key");if(e==this.locale.customRangeLabel)this.updateView();else{var i=this.ranges[e];this.container.find("input[name=daterangepicker_start]").val(i[0].format(this.locale.format)),this.container.find("input[name=daterangepicker_end]").val(i[1].format(this.locale.format))}}},clickRange:function(t){var e=t.target.getAttribute("data-range-key");if(this.chosenLabel=e,e==this.locale.customRangeLabel)this.showCalendars();else{var i=this.ranges[e];this.startDate=i[0],this.endDate=i[1],this.timePicker||(this.startDate.startOf("day"),this.endDate.endOf("day")),this.alwaysShowCalendars||this.hideCalendars(),this.clickApply()}},clickPrev:function(t){e(t.target).parents(".calendar").hasClass("left")?(this.leftCalendar.month.subtract(1,"month"),this.linkedCalendars&&this.rightCalendar.month.subtract(1,"month")):this.rightCalendar.month.subtract(1,"month"),this.updateCalendars()},clickNext:function(t){e(t.target).parents(".calendar").hasClass("left")?this.leftCalendar.month.add(1,"month"):(this.rightCalendar.month.add(1,"month"),this.linkedCalendars&&this.leftCalendar.month.add(1,"month")),this.updateCalendars()},hoverDate:function(t){if(e(t.target).hasClass("available")){var i=e(t.target).attr("data-title"),n=i.substr(1,1),r=i.substr(3,1),o=e(t.target).parents(".calendar").hasClass("left")?this.leftCalendar.calendar[n][r]:this.rightCalendar.calendar[n][r];this.endDate&&!this.container.find("input[name=daterangepicker_start]").is(":focus")?this.container.find("input[name=daterangepicker_start]").val(o.format(this.locale.format)):this.endDate||this.container.find("input[name=daterangepicker_end]").is(":focus")||this.container.find("input[name=daterangepicker_end]").val(o.format(this.locale.format));var a=this.leftCalendar,s=this.rightCalendar,l=this.startDate;this.endDate||this.container.find(".calendar tbody td").each(function(t,i){if(!e(i).hasClass("week")){var n=e(i).attr("data-title"),r=n.substr(1,1),c=n.substr(3,1),h=e(i).parents(".calendar").hasClass("left")?a.calendar[r][c]:s.calendar[r][c];h.isAfter(l)&&h.isBefore(o)||h.isSame(o,"day")?e(i).addClass("in-range"):e(i).removeClass("in-range")}})}},clickDate:function(t){if(e(t.target).hasClass("available")){var i=e(t.target).attr("data-title"),n=i.substr(1,1),r=i.substr(3,1),o=e(t.target).parents(".calendar").hasClass("left")?this.leftCalendar.calendar[n][r]:this.rightCalendar.calendar[n][r];if(this.endDate||o.isBefore(this.startDate,"day")){if(this.timePicker){l=parseInt(this.container.find(".left .hourselect").val(),10);this.timePicker24Hour||("PM"===(c=this.container.find(".left .ampmselect").val())&&l<12&&(l+=12),"AM"===c&&12===l&&(l=0));var a=parseInt(this.container.find(".left .minuteselect").val(),10),s=this.timePickerSeconds?parseInt(this.container.find(".left .secondselect").val(),10):0;o=o.clone().hour(l).minute(a).second(s)}this.endDate=null,this.setStartDate(o.clone())}else if(!this.endDate&&o.isBefore(this.startDate))this.setEndDate(this.startDate.clone());else{if(this.timePicker){var l=parseInt(this.container.find(".right .hourselect").val(),10);if(!this.timePicker24Hour){var c=this.container.find(".right .ampmselect").val();"PM"===c&&l<12&&(l+=12),"AM"===c&&12===l&&(l=0)}var a=parseInt(this.container.find(".right .minuteselect").val(),10),s=this.timePickerSeconds?parseInt(this.container.find(".right .secondselect").val(),10):0;o=o.clone().hour(l).minute(a).second(s)}this.setEndDate(o.clone()),this.autoApply&&(this.calculateChosenLabel(),this.clickApply())}this.singleDatePicker&&(this.setEndDate(this.startDate),this.timePicker||this.clickApply()),this.updateView(),t.stopPropagation()}},calculateChosenLabel:function(){var t=!0,e=0;for(var i in this.ranges){if(this.timePicker){if(this.startDate.isSame(this.ranges[i][0])&&this.endDate.isSame(this.ranges[i][1])){t=!1,this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").html();break}}else if(this.startDate.format("YYYY-MM-DD")==this.ranges[i][0].format("YYYY-MM-DD")&&this.endDate.format("YYYY-MM-DD")==this.ranges[i][1].format("YYYY-MM-DD")){t=!1,this.chosenLabel=this.container.find(".ranges li:eq("+e+")").addClass("active").html();break}e++}t&&(this.showCustomRangeLabel?this.chosenLabel=this.container.find(".ranges li:last").addClass("active").html():this.chosenLabel=null,this.showCalendars())},clickApply:function(t){this.hide(),this.element.trigger("apply.daterangepicker",this)},clickCancel:function(t){this.startDate=this.oldStartDate,this.endDate=this.oldEndDate,this.hide(),this.element.trigger("cancel.daterangepicker",this)},monthOrYearChanged:function(t){var i=e(t.target).closest(".calendar").hasClass("left"),n=i?"left":"right",r=this.container.find(".calendar."+n),o=parseInt(r.find(".monthselect").val(),10),a=r.find(".yearselect").val();i||(a<this.startDate.year()||a==this.startDate.year()&&o<this.startDate.month())&&(o=this.startDate.month(),a=this.startDate.year()),this.minDate&&(a<this.minDate.year()||a==this.minDate.year()&&o<this.minDate.month())&&(o=this.minDate.month(),a=this.minDate.year()),this.maxDate&&(a>this.maxDate.year()||a==this.maxDate.year()&&o>this.maxDate.month())&&(o=this.maxDate.month(),a=this.maxDate.year()),i?(this.leftCalendar.month.month(o).year(a),this.linkedCalendars&&(this.rightCalendar.month=this.leftCalendar.month.clone().add(1,"month"))):(this.rightCalendar.month.month(o).year(a),this.linkedCalendars&&(this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,"month"))),this.updateCalendars()},timeChanged:function(t){var i=e(t.target).closest(".calendar"),n=i.hasClass("left"),r=parseInt(i.find(".hourselect").val(),10),o=parseInt(i.find(".minuteselect").val(),10),a=this.timePickerSeconds?parseInt(i.find(".secondselect").val(),10):0;if(!this.timePicker24Hour){var s=i.find(".ampmselect").val();"PM"===s&&r<12&&(r+=12),"AM"===s&&12===r&&(r=0)}if(n){var l=this.startDate.clone();l.hour(r),l.minute(o),l.second(a),this.setStartDate(l),this.singleDatePicker?this.endDate=this.startDate.clone():this.endDate&&this.endDate.format("YYYY-MM-DD")==l.format("YYYY-MM-DD")&&this.endDate.isBefore(l)&&this.setEndDate(l.clone())}else if(this.endDate){var c=this.endDate.clone();c.hour(r),c.minute(o),c.second(a),this.setEndDate(c)}this.updateCalendars(),this.updateFormInputs(),this.renderTimePicker("left"),this.renderTimePicker("right")},formInputsChanged:function(i){var n=e(i.target).closest(".calendar").hasClass("right"),r=t(this.container.find('input[name="daterangepicker_start"]').val(),this.locale.format),o=t(this.container.find('input[name="daterangepicker_end"]').val(),this.locale.format);r.isValid()&&o.isValid()&&(n&&o.isBefore(r)&&(r=o.clone()),this.setStartDate(r),this.setEndDate(o),n?this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format)):this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format))),this.updateView()},formInputsFocused:function(t){this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass("active"),e(t.target).addClass("active"),e(t.target).closest(".calendar").hasClass("right")&&(this.endDate=null,this.setStartDate(this.startDate.clone()),this.updateView())},formInputsBlurred:function(e){if(!this.endDate){var i=this.container.find('input[name="daterangepicker_end"]').val(),n=t(i,this.locale.format);n.isValid()&&(this.setEndDate(n),this.updateView())}},elementChanged:function(){if(this.element.is("input")&&this.element.val().length&&!(this.element.val().length<this.locale.format.length)){var e=this.element.val().split(this.locale.separator),i=null,n=null;2===e.length&&(i=t(e[0],this.locale.format),n=t(e[1],this.locale.format)),(this.singleDatePicker||null===i||null===n)&&(n=i=t(this.element.val(),this.locale.format)),i.isValid()&&n.isValid()&&(this.setStartDate(i),this.setEndDate(n),this.updateView())}},keydown:function(t){9!==t.keyCode&&13!==t.keyCode||this.hide()},updateElement:function(){this.element.is("input")&&!this.singleDatePicker&&this.autoUpdateInput?(this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format)),this.element.trigger("change")):this.element.is("input")&&this.autoUpdateInput&&(this.element.val(this.startDate.format(this.locale.format)),this.element.trigger("change"))},remove:function(){this.container.remove(),this.element.off(".daterangepicker"),this.element.removeData()}},e.fn.daterangepicker=function(t,n){return this.each(function(){var r=e(this);r.data("daterangepicker")&&r.data("daterangepicker").remove(),r.data("daterangepicker",new i(r,t,n))}),this},i}),function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):e(t.jQuery)}(this,function(t){"use strict";var e=function(e,i){this.$element=t(e),this.options=t.extend({},t.fn.typeahead.defaults,i),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"!=typeof this.options.autoSelect||this.options.autoSelect,this.highlighter=this.options.highlighter||this.highlighter,this.render=this.options.render||this.render,this.updater=this.options.updater||this.updater,this.displayText=this.options.displayText||this.displayText,this.source=this.options.source,this.delay=this.options.delay,this.$menu=t(this.options.menu),this.$appendTo=this.options.appendTo?t(this.options.appendTo):null,this.fitToElement="boolean"==typeof this.options.fitToElement&&this.options.fitToElement,this.shown=!1,this.listen(),this.showHintOnFocus=("boolean"==typeof this.options.showHintOnFocus||"all"===this.options.showHintOnFocus)&&this.options.showHintOnFocus,this.afterSelect=this.options.afterSelect,this.addItem=!1,this.value=this.$element.val()||this.$element.text()};e.prototype={constructor:e,select:function(){var t=this.$menu.find(".active").data("value");if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.afterSelect(e)}return this.hide()},updater:function(t){return t},setSource:function(t){this.source=t},show:function(){var e,i=t.extend({},this.$element.position(),{height:this.$element[0].offsetHeight}),n="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight;if(this.shown?e=this.$menu:this.$appendTo?(e=this.$menu.appendTo(this.$appendTo),this.hasSameParent=this.$appendTo.is(this.$element.parent())):(e=this.$menu.insertAfter(this.$element),this.hasSameParent=!0),!this.hasSameParent){e.css("position","fixed");var r=this.$element.offset();i.top=r.top,i.left=r.left}var o=t(e).parent().hasClass("dropup")?"auto":i.top+i.height+n,a=t(e).hasClass("dropdown-menu-right")?"auto":i.left;return e.css({top:o,left:a}).show(),!0===this.options.fitToElement&&e.css("width",this.$element.outerWidth()+"px"),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(e){if(this.query=void 0!==e&&null!==e?e:this.$element.val()||this.$element.text()||"",this.query.length<this.options.minLength&&!this.options.showHintOnFocus)return this.shown?this.hide():this;var i=t.proxy(function(){t.isFunction(this.source)?this.source(this.query,t.proxy(this.process,this)):this.source&&this.process(this.source)},this);clearTimeout(this.lookupWorker),this.lookupWorker=setTimeout(i,this.delay)},process:function(e){var i=this;return e=t.grep(e,function(t){return i.matcher(t)}),(e=this.sorter(e)).length||this.options.addItem?(e.length>0?this.$element.data("active",e[0]):this.$element.data("active",null),this.options.addItem&&e.push(this.options.addItem),"all"==this.options.items?this.render(e).show():this.render(e.slice(0,this.options.items)).show()):this.shown?this.hide():this},matcher:function(t){return~this.displayText(t).toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,i=[],n=[],r=[];e=t.shift();){var o=this.displayText(e);o.toLowerCase().indexOf(this.query.toLowerCase())?~o.indexOf(this.query)?n.push(e):r.push(e):i.push(e)}return i.concat(n,r)},highlighter:function(e){var i,n,r,o,a=t("<div></div>"),s=this.query,l=e.toLowerCase().indexOf(s.toLowerCase()),c=s.length;if(0===c)return a.text(e).html();for(;l>-1;)i=e.substr(0,l),n=e.substr(l,c),r=e.substr(l+c),o=t("<strong></strong>").text(n),a.append(document.createTextNode(i)).append(o),l=(e=r).toLowerCase().indexOf(s.toLowerCase());return a.append(document.createTextNode(e)).html()},render:function(e){var i=this,n=this,r=!1,o=[],a=i.options.separator;return t.each(e,function(t,i){t>0&&i[a]!==e[t-1][a]&&o.push({__type:"divider"}),!i[a]||0!==t&&i[a]===e[t-1][a]||o.push({__type:"category",name:i[a]}),o.push(i)}),e=t(o).map(function(e,o){if("category"==(o.__type||!1))return t(i.options.headerHtml).text(o.name)[0];if("divider"==(o.__type||!1))return t(i.options.headerDivider)[0];var a=n.displayText(o);return(e=t(i.options.item).data("value",o)).find("a").html(i.highlighter(a,o)),a==n.$element.val()&&(e.addClass("active"),n.$element.data("active",o),r=!0),e[0]}),this.autoSelect&&!r&&(e.filter(":not(.dropdown-header)").first().addClass("active"),this.$element.data("active",e.first().data("value"))),this.$menu.html(e),this},displayText:function(t){return void 0!==t&&void 0!==t.name&&t.name||t},next:function(e){var i=this.$menu.find(".active").removeClass("active").next();i.length||(i=t(this.$menu.find("li")[0])),i.addClass("active")},prev:function(t){var e=this.$menu.find(".active").removeClass("active").prev();e.length||(e=this.$menu.find("li").last()),e.addClass("active")},listen:function(){this.$element.on("focus",t.proxy(this.focus,this)).on("blur",t.proxy(this.blur,this)).on("keypress",t.proxy(this.keypress,this)).on("input",t.proxy(this.input,this)).on("keyup",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",t.proxy(this.keydown,this)),this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter","li",t.proxy(this.mouseenter,this)).on("mouseleave","li",t.proxy(this.mouseleave,this)).on("mousedown",t.proxy(this.mousedown,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.data("active",null),this.$element.off("focus").off("blur").off("keypress").off("input").off("keyup"),this.eventSupported("keydown")&&this.$element.off("keydown"),this.$menu.remove(),this.destroyed=!0},eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},move:function(t){if(this.shown)switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:if(t.shiftKey)return;t.preventDefault(),this.prev();break;case 40:if(t.shiftKey)return;t.preventDefault(),this.next()}},keydown:function(e){this.suppressKeyPressRepeat=~t.inArray(e.keyCode,[40,38,9,13,27]),this.shown||40!=e.keyCode?this.move(e):this.lookup()},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},input:function(t){var e=this.$element.val()||this.$element.text();this.value!==e&&(this.value=e,this.lookup())},keyup:function(t){if(!this.destroyed)switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide()}},focus:function(t){this.focused||(this.focused=!0,this.options.showHintOnFocus&&!0!==this.skipShowHintOnFocus&&("all"===this.options.showHintOnFocus?this.lookup(""):this.lookup())),this.skipShowHintOnFocus&&(this.skipShowHintOnFocus=!1)},blur:function(t){this.mousedover||this.mouseddown||!this.shown?this.mouseddown&&(this.skipShowHintOnFocus=!0,this.$element.focus(),this.mouseddown=!1):(this.hide(),this.focused=!1)},click:function(t){t.preventDefault(),this.skipShowHintOnFocus=!0,this.select(),this.$element.focus(),this.hide()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},mouseleave:function(t){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},mousedown:function(t){this.mouseddown=!0,this.$menu.one("mouseup",function(t){this.mouseddown=!1}.bind(this))}};var i=t.fn.typeahead;t.fn.typeahead=function(i){var n=arguments;return"string"==typeof i&&"getActive"==i?this.data("active"):this.each(function(){var r=t(this),o=r.data("typeahead"),a="object"==typeof i&&i;o||r.data("typeahead",o=new e(this,a)),"string"==typeof i&&o[i]&&(n.length>1?o[i].apply(o,Array.prototype.slice.call(n,1)):o[i]())})},t.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu" role="listbox"></ul>',item:'<li><a class="dropdown-item" href="#" role="option"></a></li>',minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:t.noop,addItem:!1,delay:0,separator:"category",headerHtml:'<li class="dropdown-header"></li>',headerDivider:'<li class="divider" role="separator"></li>'},t.fn.typeahead.Constructor=e,t.fn.typeahead.noConflict=function(){return t.fn.typeahead=i,this},t(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var i=t(this);i.data("typeahead")||i.typeahead(i.data())})}),function(t){"use strict";function e(e,i){this.isInit=!0,this.itemsArray=[],this.$element=t(e),this.$element.hide(),this.isSelect="SELECT"===e.tagName,this.multiple=this.isSelect&&e.hasAttribute("multiple"),this.objectItems=i&&i.itemValue,this.placeholderText=e.hasAttribute("placeholder")?this.$element.attr("placeholder"):"",this.inputSize=Math.max(1,this.placeholderText.length),this.$container=t('<div class="bootstrap-tagsinput"></div>'),this.$input=t('<input type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container),this.$element.before(this.$container),this.build(i),this.isInit=!1}function i(t,e){if("function"!=typeof t[e]){var i=t[e];t[e]=function(t){return t[i]}}}function n(t,e){if("function"!=typeof t[e]){var i=t[e];t[e]=function(){return i}}}function r(t){return t?l.text(t).html():""}function o(t){var e=0;if(document.selection){t.focus();var i=document.selection.createRange();i.moveStart("character",-t.value.length),e=i.text.length}else(t.selectionStart||"0"==t.selectionStart)&&(e=t.selectionStart);return e}function a(e,i){var n=!1;return t.each(i,function(t,i){if("number"==typeof i&&e.which===i)return n=!0,!1;if(e.which===i.which){var r=!i.hasOwnProperty("altKey")||e.altKey===i.altKey,o=!i.hasOwnProperty("shiftKey")||e.shiftKey===i.shiftKey,a=!i.hasOwnProperty("ctrlKey")||e.ctrlKey===i.ctrlKey;if(r&&o&&a)return n=!0,!1}}),n}var s={tagClass:function(t){return"label label-info"},focusClass:"focus",itemValue:function(t){return t?t.toString():t},itemText:function(t){return this.itemValue(t)},itemTitle:function(t){return null},freeInput:!0,addOnBlur:!0,maxTags:void 0,maxChars:void 0,confirmKeys:[13,44],delimiter:",",delimiterRegex:null,cancelConfirmKeysOnEmpty:!1,onTagExists:function(t,e){e.hide().fadeIn()},trimValue:!1,allowDuplicates:!1,triggerChange:!0};e.prototype={constructor:e,add:function(e,i,n){var o=this;if(!(o.options.maxTags&&o.itemsArray.length>=o.options.maxTags)&&(!1===e||e)){if("string"==typeof e&&o.options.trimValue&&(e=t.trim(e)),"object"==typeof e&&!o.objectItems)throw"Can't add objects when itemValue option is not set";if(!e.toString().match(/^\s*$/)){if(o.isSelect&&!o.multiple&&o.itemsArray.length>0&&o.remove(o.itemsArray[0]),"string"==typeof e&&"INPUT"===this.$element[0].tagName){var a=o.options.delimiterRegex?o.options.delimiterRegex:o.options.delimiter,s=e.split(a);if(s.length>1){for(var l=0;l<s.length;l++)this.add(s[l],!0);return void(i||o.pushVal(o.options.triggerChange))}}var c=o.options.itemValue(e),h=o.options.itemText(e),u=o.options.tagClass(e),d=o.options.itemTitle(e),f=t.grep(o.itemsArray,function(t){return o.options.itemValue(t)===c})[0];if(!f||o.options.allowDuplicates){if(!(o.items().toString().length+e.length+1>o.options.maxInputLength)){var p=t.Event("beforeItemAdd",{item:e,cancel:!1,options:n});if(o.$element.trigger(p),!p.cancel){o.itemsArray.push(e);var g=t('<span class="tag '+r(u)+(null!==d?'" title="'+d:"")+'">'+r(h)+'<span data-role="remove"></span></span>');g.data("item",e),o.findInputWrapper().before(g),g.after(" ");var m=t('option[value="'+encodeURIComponent(c)+'"]',o.$element).length||t('option[value="'+r(c)+'"]',o.$element).length;if(o.isSelect&&!m){var v=t("<option selected>"+r(h)+"</option>");v.data("item",e),v.attr("value",c),o.$element.append(v)}i||o.pushVal(o.options.triggerChange),o.options.maxTags!==o.itemsArray.length&&o.items().toString().length!==o.options.maxInputLength||o.$container.addClass("bootstrap-tagsinput-max"),t(".typeahead, .twitter-typeahead",o.$container).length&&o.$input.typeahead("val",""),this.isInit?o.$element.trigger(t.Event("itemAddedOnInit",{item:e,options:n})):o.$element.trigger(t.Event("itemAdded",{item:e,options:n}))}}}else if(o.options.onTagExists){var y=t(".tag",o.$container).filter(function(){return t(this).data("item")===f});o.options.onTagExists(e,y)}}}},remove:function(e,i,n){var r=this;if(r.objectItems&&(e="object"==typeof e?t.grep(r.itemsArray,function(t){return r.options.itemValue(t)==r.options.itemValue(e)}):t.grep(r.itemsArray,function(t){return r.options.itemValue(t)==e}),e=e[e.length-1]),e){var o=t.Event("beforeItemRemove",{item:e,cancel:!1,options:n});if(r.$element.trigger(o),o.cancel)return;t(".tag",r.$container).filter(function(){return t(this).data("item")===e}).remove(),t("option",r.$element).filter(function(){return t(this).data("item")===e}).remove(),-1!==t.inArray(e,r.itemsArray)&&r.itemsArray.splice(t.inArray(e,r.itemsArray),1)}i||r.pushVal(r.options.triggerChange),r.options.maxTags>r.itemsArray.length&&r.$container.removeClass("bootstrap-tagsinput-max"),r.$element.trigger(t.Event("itemRemoved",{item:e,options:n}))},removeAll:function(){var e=this;for(t(".tag",e.$container).remove(),t("option",e.$element).remove();e.itemsArray.length>0;)e.itemsArray.pop();e.pushVal(e.options.triggerChange)},refresh:function(){var e=this;t(".tag",e.$container).each(function(){var i=t(this),n=i.data("item"),o=e.options.itemValue(n),a=e.options.itemText(n),s=e.options.tagClass(n);i.attr("class",null),i.addClass("tag "+r(s)),i.contents().filter(function(){return 3==this.nodeType})[0].nodeValue=r(a),e.isSelect&&t("option",e.$element).filter(function(){return t(this).data("item")===n}).attr("value",o)})},items:function(){return this.itemsArray},pushVal:function(){var e=this,i=t.map(e.items(),function(t){return e.options.itemValue(t).toString()});e.$element.val(i,!0),e.options.triggerChange&&e.$element.trigger("change")},build:function(e){var r=this;if(r.options=t.extend({},s,e),r.objectItems&&(r.options.freeInput=!1),i(r.options,"itemValue"),i(r.options,"itemText"),n(r.options,"tagClass"),r.options.typeahead){var l=r.options.typeahead||{};n(l,"source"),r.$input.typeahead(t.extend({},l,{source:function(e,i){function n(t){for(var e=[],n=0;n<t.length;n++){var a=r.options.itemText(t[n]);o[a]=t[n],e.push(a)}i(e)}this.map={};var o=this.map,a=l.source(e);t.isFunction(a.success)?a.success(n):t.isFunction(a.then)?a.then(n):t.when(a).then(n)},updater:function(t){return r.add(this.map[t]),this.map[t]},matcher:function(t){return-1!==t.toLowerCase().indexOf(this.query.trim().toLowerCase())},sorter:function(t){return t.sort()},highlighter:function(t){var e=new RegExp("("+this.query+")","gi");return t.replace(e,"<strong>$1</strong>")}}))}if(r.options.typeaheadjs){var c=null,h={},u=r.options.typeaheadjs;t.isArray(u)?(c=u[0],h=u[1]):h=u,r.$input.typeahead(c,h).on("typeahead:selected",t.proxy(function(t,e){h.valueKey?r.add(e[h.valueKey]):r.add(e),r.$input.typeahead("val","")},r))}r.$container.on("click",t.proxy(function(t){r.$element.attr("disabled")||r.$input.removeAttr("disabled"),r.$input.focus()},r)),r.options.addOnBlur&&r.options.freeInput&&r.$input.on("focusout",t.proxy(function(e){0===t(".typeahead, .twitter-typeahead",r.$container).length&&(r.add(r.$input.val()),r.$input.val(""))},r)),r.$container.on({focusin:function(){r.$container.addClass(r.options.focusClass)},focusout:function(){r.$container.removeClass(r.options.focusClass)}}),r.$container.on("keydown","input",t.proxy(function(e){var i=t(e.target),n=r.findInputWrapper();if(r.$element.attr("disabled"))r.$input.attr("disabled","disabled");else{switch(e.which){case 8:if(0===o(i[0])){var a=n.prev();a.length&&r.remove(a.data("item"))}break;case 46:if(0===o(i[0])){var s=n.next();s.length&&r.remove(s.data("item"))}break;case 37:var l=n.prev();0===i.val().length&&l[0]&&(l.before(n),i.focus());break;case 39:var c=n.next();0===i.val().length&&c[0]&&(c.after(n),i.focus())}var h=i.val().length;Math.ceil(h/5);i.attr("size",Math.max(this.inputSize,i.val().length))}},r)),r.$container.on("keypress","input",t.proxy(function(e){var i=t(e.target);if(r.$element.attr("disabled"))r.$input.attr("disabled","disabled");else{var n=i.val(),o=r.options.maxChars&&n.length>=r.options.maxChars;r.options.freeInput&&(a(e,r.options.confirmKeys)||o)&&(0!==n.length&&(r.add(o?n.substr(0,r.options.maxChars):n),i.val("")),!1===r.options.cancelConfirmKeysOnEmpty&&e.preventDefault());var s=i.val().length;Math.ceil(s/5);i.attr("size",Math.max(this.inputSize,i.val().length))}},r)),r.$container.on("click","[data-role=remove]",t.proxy(function(e){r.$element.attr("disabled")||r.remove(t(e.target).closest(".tag").data("item"))},r)),r.options.itemValue===s.itemValue&&("INPUT"===r.$element[0].tagName?r.add(r.$element.val()):t("option",r.$element).each(function(){r.add(t(this).attr("value"),!0)}))},destroy:function(){var t=this;t.$container.off("keypress","input"),t.$container.off("click","[role=remove]"),t.$container.remove(),t.$element.removeData("tagsinput"),t.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var e=this.$input[0],i=this.$container[0];e&&e.parentNode!==i;)e=e.parentNode;return t(e)}},t.fn.tagsinput=function(i,n,r){var o=[];return this.each(function(){var a=t(this).data("tagsinput");if(a)if(i||n){if(void 0!==a[i]){if(3===a[i].length&&void 0!==r)s=a[i](n,null,r);else var s=a[i](n);void 0!==s&&o.push(s)}}else o.push(a);else a=new e(this,i),t(this).data("tagsinput",a),o.push(a),"SELECT"===this.tagName&&t("option",t(this)).attr("selected","selected"),t(this).val(t(this).val())}),"string"==typeof i?o.length>1?o:o[0]:o},t.fn.tagsinput.Constructor=e;var l=t("<div />");t(function(){t("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(window.jQuery),function(t){"use strict";if(!t.fn.tagsinput)throw new Error("bootstrap-tagsinput.js required.");var e=t.fn.tagsinput.Constructor.prototype.build,i=t.fn.tagsinput.Constructor.prototype.destroy;t.fn.tagsinput.Constructor.prototype.build=function(i){function n(t){return Math.ceil(r.$inpWidth.html((t||"").replace(a,"#")).outerWidth()+12)+"px"}var r=this,o=e.call(this,i),a=/<|>/g;return this.$inpWidth=t('<div class="bootstrap-tagsinput-input" style="position:absolute;z-index:-101;top:-9999px;opacity:0;white-space:nowrap;"></div>'),t('<div style="position:absolute;width:0;height:0;z-index:-100;opacity:0;overflow:hidden;"></div>').append(this.$inpWidth).prependTo(this.$container),this.$input[0].style.width=n(),this.$input.on("keydown keyup focusout",function(){this.style.width=n(this.value)}),this.$input.on("paste",function(){setTimeout(t.proxy(function(){this.style.width=n(this.value)},this),100)}),o},t.fn.tagsinput.Constructor.prototype.destroy=function(){return this.$input.off("keydown keyup focusout paste"),i.call(this)},t(function(){t("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput("destroy"),t("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(jQuery),function(t){"use strict";"function"==typeof define&&define.amd?define(t):"undefined"!=typeof module&&void 0!==module.exports?module.exports=t():window.Sortable=t()}(function(){"use strict";function t(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(t);this.el=t,this.options=e=b({},e),t[U]=this;var i={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(t.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0}};for(var n in i)!(n in e)&&(e[n]=i[n]);at(e);for(var r in this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Q,o(t,"mousedown",this._onTapStart),o(t,"touchstart",this._onTapStart),o(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(o(t,"dragover",this),o(t,"dragenter",this)),rt.push(this._onDragOver),e.store&&this.sort(e.store.get(this))}function e(t,e){"clone"!==t.lastPullMode&&(e=!0),k&&k.state!==e&&(l(k,"display",e?"none":""),e||k.state&&(t.options.group.revertClone?(T.insertBefore(k,A),t._animate(w,k)):T.insertBefore(k,w)),k.state=e)}function i(t,e,i){if(t){i=i||G;do{if(">*"===e&&t.parentNode===i||v(t,e))return t}while(t=n(t))}return null}function n(t){var e=t.host;return e&&e.nodeType?e:t.parentNode}function r(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.preventDefault()}function o(t,e,i){t.addEventListener(e,i,Z)}function a(t,e,i){t.removeEventListener(e,i,Z)}function s(t,e,i){if(t)if(t.classList)t.classList[i?"add":"remove"](e);else{var n=(" "+t.className+" ").replace(W," ").replace(" "+e+" "," ");t.className=(n+(i?" "+e:"")).replace(W," ")}}function l(t,e,i){var n=t&&t.style;if(n){if(void 0===i)return G.defaultView&&G.defaultView.getComputedStyle?i=G.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),void 0===e?i:i[e];e in n||(e="-webkit-"+e),n[e]=i+("string"==typeof i?"":"px")}}function c(t,e,i){if(t){var n=t.getElementsByTagName(e),r=0,o=n.length;if(i)for(;r<o;r++)i(n[r],r);return n}return[]}function h(t,e,i,n,r,o,a){t=t||e[U];var s=G.createEvent("Event"),l=t.options,c="on"+i.charAt(0).toUpperCase()+i.substr(1);s.initEvent(i,!0,!0),s.to=e,s.from=r||e,s.item=n||e,s.clone=k,s.oldIndex=o,s.newIndex=a,e.dispatchEvent(s),l[c]&&l[c].call(t,s)}function u(t,e,i,n,r,o,a,s){var l,c,h=t[U],u=h.options.onMove;return(l=G.createEvent("Event")).initEvent("move",!0,!0),l.to=e,l.from=t,l.dragged=i,l.draggedRect=n,l.related=r||e,l.relatedRect=o||e.getBoundingClientRect(),l.willInsertAfter=s,t.dispatchEvent(l),u&&(c=u.call(h,l,a)),c}function d(t){t.draggable=!1}function f(){tt=!1}function p(t,e){var i=t.lastElementChild.getBoundingClientRect();return e.clientY-(i.top+i.height)>5||e.clientX-(i.left+i.width)>5}function g(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,i=e.length,n=0;i--;)n+=e.charCodeAt(i);return n.toString(36)}function m(t,e){var i=0;if(!t||!t.parentNode)return-1;for(;t&&(t=t.previousElementSibling);)"TEMPLATE"===t.nodeName.toUpperCase()||">*"!==e&&!v(t,e)||i++;return i}function v(t,e){if(t){var i=(e=e.split(".")).shift().toUpperCase(),n=new RegExp("\\s("+e.join("|")+")(?=\\s)","g");return!(""!==i&&t.nodeName.toUpperCase()!=i||e.length&&((" "+t.className+" ").match(n)||[]).length!=e.length)}return!1}function y(t,e){var i,n;return function(){void 0===i&&(i=arguments,n=this,setTimeout(function(){1===i.length?t.call(n,i[0]):t.apply(n,i),i=void 0},e))}}function b(t,e){if(t&&e)for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function x(t){return X?X(t).clone(!0)[0]:K&&K.dom?K.dom(t).cloneNode(!0):t.cloneNode(!0)}function _(t){for(var e=t.getElementsByTagName("input"),i=e.length;i--;){var n=e[i];n.checked&&nt.push(n)}}if("undefined"==typeof window||!window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var w,S,C,k,T,A,D,M,E,P,L,I,O,R,N,F,z,H,$,V,B={},W=/\s+/g,j=/left|right|inline/,U="Sortable"+(new Date).getTime(),Y=window,G=Y.document,q=Y.parseInt,X=Y.jQuery||Y.Zepto,K=Y.Polymer,Z=!1,Q=!!("draggable"in G.createElement("div")),J=function(t){return!navigator.userAgent.match(/Trident.*rv[ :]?11\./)&&(t=G.createElement("x"),t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents)}(),tt=!1,et=Math.abs,it=Math.min,nt=[],rt=[],ot=y(function(t,e,i){if(i&&e.scroll){var n,r,o,a,s,l,c=i[U],h=e.scrollSensitivity,u=e.scrollSpeed,d=t.clientX,f=t.clientY,p=window.innerWidth,g=window.innerHeight;if(E!==i&&(M=e.scroll,E=i,P=e.scrollFn,!0===M)){M=i;do{if(M.offsetWidth<M.scrollWidth||M.offsetHeight<M.scrollHeight)break}while(M=M.parentNode)}M&&(n=M,r=M.getBoundingClientRect(),o=(et(r.right-d)<=h)-(et(r.left-d)<=h),a=(et(r.bottom-f)<=h)-(et(r.top-f)<=h)),o||a||(a=(g-f<=h)-(f<=h),((o=(p-d<=h)-(d<=h))||a)&&(n=Y)),B.vx===o&&B.vy===a&&B.el===n||(B.el=n,B.vx=o,B.vy=a,clearInterval(B.pid),n&&(B.pid=setInterval(function(){if(l=a?a*u:0,s=o?o*u:0,"function"==typeof P)return P.call(c,s,l,t);n===Y?Y.scrollTo(Y.pageXOffset+s,Y.pageYOffset+l):(n.scrollTop+=l,n.scrollLeft+=s)},24)))}},30),at=function(t){function e(t,e){return void 0!==t&&!0!==t||(t=i.name),"function"==typeof t?t:function(i,n){var r=n.options.group.name;return e?t:t&&(t.join?t.indexOf(r)>-1:r==t)}}var i={},n=t.group;n&&"object"==typeof n||(n={name:n}),i.name=n.name,i.checkPull=e(n.pull,!0),i.checkPut=e(n.put),i.revertClone=n.revertClone,t.group=i};t.prototype={constructor:t,_onTapStart:function(t){var e,n=this,r=this.el,o=this.options,a=o.preventOnFilter,s=t.type,l=t.touches&&t.touches[0],c=(l||t).target,u=t.target.shadowRoot&&t.path[0]||c,d=o.filter;if(_(r),!w&&!("mousedown"===s&&0!==t.button||o.disabled)&&(c=i(c,o.draggable,r))&&D!==c){if(e=m(c,o.draggable),"function"==typeof d){if(d.call(this,t,c,this))return h(n,u,"filter",c,r,e),void(a&&t.preventDefault())}else if(d&&(d=d.split(",").some(function(t){if(t=i(u,t.trim(),r))return h(n,t,"filter",c,r,e),!0})))return void(a&&t.preventDefault());o.handle&&!i(u,o.handle,r)||this._prepareDragStart(t,l,c,e)}},_prepareDragStart:function(t,e,i,n){var r,a=this,l=a.el,u=a.options,f=l.ownerDocument;i&&!w&&i.parentNode===l&&(H=t,T=l,S=(w=i).parentNode,A=w.nextSibling,D=i,F=u.group,R=n,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,w.style["will-change"]="transform",r=function(){a._disableDelayedDrag(),w.draggable=a.nativeDraggable,s(w,u.chosenClass,!0),a._triggerDragStart(t,e),h(a,T,"choose",w,T,R)},u.ignore.split(",").forEach(function(t){c(w,t.trim(),d)}),o(f,"mouseup",a._onDrop),o(f,"touchend",a._onDrop),o(f,"touchcancel",a._onDrop),o(f,"pointercancel",a._onDrop),o(f,"selectstart",a),u.delay?(o(f,"mouseup",a._disableDelayedDrag),o(f,"touchend",a._disableDelayedDrag),o(f,"touchcancel",a._disableDelayedDrag),o(f,"mousemove",a._disableDelayedDrag),o(f,"touchmove",a._disableDelayedDrag),o(f,"pointermove",a._disableDelayedDrag),a._dragStartTimer=setTimeout(r,u.delay)):r())},_disableDelayedDrag:function(){var t=this.el.ownerDocument;clearTimeout(this._dragStartTimer),a(t,"mouseup",this._disableDelayedDrag),a(t,"touchend",this._disableDelayedDrag),a(t,"touchcancel",this._disableDelayedDrag),a(t,"mousemove",this._disableDelayedDrag),a(t,"touchmove",this._disableDelayedDrag),a(t,"pointermove",this._disableDelayedDrag)},_triggerDragStart:function(t,e){(e=e||("touch"==t.pointerType?t:null))?(H={target:w,clientX:e.clientX,clientY:e.clientY},this._onDragStart(H,"touch")):this.nativeDraggable?(o(w,"dragend",this),o(T,"dragstart",this._onDragStart)):this._onDragStart(H,!0);try{G.selection?setTimeout(function(){G.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(){if(T&&w){var e=this.options;s(w,e.ghostClass,!0),s(w,e.dragClass,!1),t.active=this,h(this,T,"start",w,T,R)}else this._nulling()},_emulateDragOver:function(){if($){if(this._lastX===$.clientX&&this._lastY===$.clientY)return;this._lastX=$.clientX,this._lastY=$.clientY,J||l(C,"display","none");var t=G.elementFromPoint($.clientX,$.clientY),e=t,i=rt.length;if(e)do{if(e[U]){for(;i--;)rt[i]({clientX:$.clientX,clientY:$.clientY,target:t,rootEl:e});break}t=e}while(e=e.parentNode);J||l(C,"display","")}},_onTouchMove:function(e){if(H){var i=this.options,n=i.fallbackTolerance,r=i.fallbackOffset,o=e.touches?e.touches[0]:e,a=o.clientX-H.clientX+r.x,s=o.clientY-H.clientY+r.y,c=e.touches?"translate3d("+a+"px,"+s+"px,0)":"translate("+a+"px,"+s+"px)";if(!t.active){if(n&&it(et(o.clientX-this._lastX),et(o.clientY-this._lastY))<n)return;this._dragStarted()}this._appendGhost(),V=!0,$=o,l(C,"webkitTransform",c),l(C,"mozTransform",c),l(C,"msTransform",c),l(C,"transform",c),e.preventDefault()}},_appendGhost:function(){if(!C){var t,e=w.getBoundingClientRect(),i=l(w),n=this.options;s(C=w.cloneNode(!0),n.ghostClass,!1),s(C,n.fallbackClass,!0),s(C,n.dragClass,!0),l(C,"top",e.top-q(i.marginTop,10)),l(C,"left",e.left-q(i.marginLeft,10)),l(C,"width",e.width),l(C,"height",e.height),l(C,"opacity","0.8"),l(C,"position","fixed"),l(C,"zIndex","100000"),l(C,"pointerEvents","none"),n.fallbackOnBody&&G.body.appendChild(C)||T.appendChild(C),t=C.getBoundingClientRect(),l(C,"width",2*e.width-t.width),l(C,"height",2*e.height-t.height)}},_onDragStart:function(t,e){var i=t.dataTransfer,n=this.options;this._offUpEvents(),F.checkPull(this,this,w,t)&&((k=x(w)).draggable=!1,k.style["will-change"]="",l(k,"display","none"),s(k,this.options.chosenClass,!1),T.insertBefore(k,w),h(this,T,"clone",w)),s(w,n.dragClass,!0),e?("touch"===e?(o(G,"touchmove",this._onTouchMove),o(G,"touchend",this._onDrop),o(G,"touchcancel",this._onDrop),o(G,"pointermove",this._onTouchMove),o(G,"pointerup",this._onDrop)):(o(G,"mousemove",this._onTouchMove),o(G,"mouseup",this._onDrop)),this._loopId=setInterval(this._emulateDragOver,50)):(i&&(i.effectAllowed="move",n.setData&&n.setData.call(this,i,w)),o(G,"drop",this),setTimeout(this._dragStarted,0))},_onDragOver:function(n){var r,o,a,s,c=this.el,h=this.options,d=h.group,g=t.active,m=F===d,v=!1,y=h.sort;if(void 0!==n.preventDefault&&(n.preventDefault(),!h.dragoverBubble&&n.stopPropagation()),!w.animated&&(V=!0,g&&!h.disabled&&(m?y||(s=!T.contains(w)):z===this||(g.lastPullMode=F.checkPull(this,g,w,n))&&d.checkPut(this,g,w,n))&&(void 0===n.rootEl||n.rootEl===this.el))){if(ot(n,h,this.el),tt)return;if(r=i(n.target,h.draggable,c),o=w.getBoundingClientRect(),z!==this&&(z=this,v=!0),s)return e(g,!0),S=T,void(k||A?T.insertBefore(w,k||A):y||T.appendChild(w));if(0===c.children.length||c.children[0]===C||c===n.target&&p(c,n)){if(0!==c.children.length&&c.children[0]!==C&&c===n.target&&(r=c.lastElementChild),r){if(r.animated)return;a=r.getBoundingClientRect()}e(g,m),!1!==u(T,c,w,o,r,a,n)&&(w.contains(c)||(c.appendChild(w),S=c),this._animate(o,w),r&&this._animate(a,r))}else if(r&&!r.animated&&r!==w&&void 0!==r.parentNode[U]){L!==r&&(L=r,I=l(r),O=l(r.parentNode));var b=(a=r.getBoundingClientRect()).right-a.left,x=a.bottom-a.top,_=j.test(I.cssFloat+I.display)||"flex"==O.display&&0===O["flex-direction"].indexOf("row"),D=r.offsetWidth>w.offsetWidth,M=r.offsetHeight>w.offsetHeight,E=(_?(n.clientX-a.left)/b:(n.clientY-a.top)/x)>.5,P=r.nextElementSibling,R=!1;if(_){var N=w.offsetTop,H=r.offsetTop;R=N===H?r.previousElementSibling===w&&!D||E&&D:r.previousElementSibling===w||w.previousElementSibling===r?(n.clientY-a.top)/x>.5:H>N}else v||(R=P!==w&&!M||E&&M);var $=u(T,c,w,o,r,a,n,R);!1!==$&&(1!==$&&-1!==$||(R=1===$),tt=!0,setTimeout(f,30),e(g,m),w.contains(c)||(R&&!P?c.appendChild(w):r.parentNode.insertBefore(w,R?P:r)),S=w.parentNode,this._animate(o,w),this._animate(a,r))}}},_animate:function(t,e){var i=this.options.animation;if(i){var n=e.getBoundingClientRect();1===t.nodeType&&(t=t.getBoundingClientRect()),l(e,"transition","none"),l(e,"transform","translate3d("+(t.left-n.left)+"px,"+(t.top-n.top)+"px,0)"),e.offsetWidth,l(e,"transition","all "+i+"ms"),l(e,"transform","translate3d(0,0,0)"),clearTimeout(e.animated),e.animated=setTimeout(function(){l(e,"transition",""),l(e,"transform",""),e.animated=!1},i)}},_offUpEvents:function(){var t=this.el.ownerDocument;a(G,"touchmove",this._onTouchMove),a(G,"pointermove",this._onTouchMove),a(t,"mouseup",this._onDrop),a(t,"touchend",this._onDrop),a(t,"pointerup",this._onDrop),a(t,"touchcancel",this._onDrop),a(t,"pointercancel",this._onDrop),a(t,"selectstart",this)},_onDrop:function(e){var i=this.el,n=this.options;clearInterval(this._loopId),clearInterval(B.pid),clearTimeout(this._dragStartTimer),a(G,"mousemove",this._onTouchMove),this.nativeDraggable&&(a(G,"drop",this),a(i,"dragstart",this._onDragStart)),this._offUpEvents(),e&&(V&&(e.preventDefault(),!n.dropBubble&&e.stopPropagation()),C&&C.parentNode&&C.parentNode.removeChild(C),T!==S&&"clone"===t.active.lastPullMode||k&&k.parentNode&&k.parentNode.removeChild(k),w&&(this.nativeDraggable&&a(w,"dragend",this),d(w),w.style["will-change"]="",s(w,this.options.ghostClass,!1),s(w,this.options.chosenClass,!1),h(this,T,"unchoose",w,T,R),T!==S?(N=m(w,n.draggable))>=0&&(h(null,S,"add",w,T,R,N),h(this,T,"remove",w,T,R,N),h(null,S,"sort",w,T,R,N),h(this,T,"sort",w,T,R,N)):w.nextSibling!==A&&(N=m(w,n.draggable))>=0&&(h(this,T,"update",w,T,R,N),h(this,T,"sort",w,T,R,N)),t.active&&(null!=N&&-1!==N||(N=R),h(this,T,"end",w,T,R,N),this.save()))),this._nulling()},_nulling:function(){T=w=S=C=A=k=D=M=E=H=$=V=N=L=I=z=F=t.active=null,nt.forEach(function(t){t.checked=!0}),nt.length=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragover":case"dragenter":w&&(this._onDragOver(t),r(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,r=0,o=n.length,a=this.options;r<o;r++)i(t=n[r],a.draggable,this.el)&&e.push(t.getAttribute(a.dataIdAttr)||g(t));return e},sort:function(t){var e={},n=this.el;this.toArray().forEach(function(t,r){var o=n.children[r];i(o,this.options.draggable,n)&&(e[t]=o)},this),t.forEach(function(t){e[t]&&(n.removeChild(e[t]),n.appendChild(e[t]))})},save:function(){var t=this.options.store;t&&t.set(this)},closest:function(t,e){return i(t,e||this.options.draggable,this.el)},option:function(t,e){var i=this.options;if(void 0===e)return i[t];i[t]=e,"group"===t&&at(i)},destroy:function(){var t=this.el;t[U]=null,a(t,"mousedown",this._onTapStart),a(t,"touchstart",this._onTapStart),a(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(a(t,"dragover",this),a(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),rt.splice(rt.indexOf(this._onDragOver),1),this._onDrop(),this.el=t=null}},o(G,"touchmove",function(e){t.active&&e.preventDefault()});try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){Z={capture:!1,passive:!1}}}))}catch(t){}return t.utils={on:o,off:a,css:l,find:c,is:function(t,e){return!!i(t,e,t)},extend:b,throttle:y,closest:i,toggleClass:s,clone:x,index:m},t.create=function(e,i){return new t(e,i)},t.version="1.6.0",t});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},windowIsDefined="object"===("undefined"==typeof window?"undefined":_typeof(window));!function(t){if("function"==typeof define&&define.amd)define(["jquery"],t);else if("object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports){var e;try{e=require("jquery")}catch(t){e=null}module.exports=t(e)}else window&&(window.Slider=t(window.jQuery))}(function(t){windowIsDefined&&!window.console&&(window.console={}),windowIsDefined&&!window.console.log&&(window.console.log=function(){}),windowIsDefined&&!window.console.warn&&(window.console.warn=function(){});var e;return function(t){"use strict";function e(){}var i=Array.prototype.slice;!function(t){function n(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function r(e,n){t.fn[e]=function(r){if("string"==typeof r){for(var a=i.call(arguments,1),s=0,l=this.length;s<l;s++){var c=this[s],h=t.data(c,e);if(h)if(t.isFunction(h[r])&&"_"!==r.charAt(0)){var u=h[r].apply(h,a);if(void 0!==u&&u!==h)return u}else o("no such method '"+r+"' for "+e+" instance");else o("cannot call methods on "+e+" prior to initialization; attempted to call '"+r+"'")}return this}var d=this.map(function(){var i=t.data(this,e);return i?(i.option(r),i._init()):(i=new n(this,r),t.data(this,e,i)),t(this)});return!d||d.length>1?d:d[0]}}if(t){var o="undefined"==typeof console?e:function(t){console.error(t)};t.bridget=function(t,e){n(e),r(t,e)},t.bridget}}(t)}(t),function(t){function i(e,i){this._state={value:null,enabled:null,offset:null,size:null,percentage:null,inDrag:!1,over:!1},this.ticksCallbackMap={},this.handleCallbackMap={},"string"==typeof e?this.element=document.querySelector(e):e instanceof HTMLElement&&(this.element=e),i=i||{};for(var n=Object.keys(this.defaultOptions),o=0;o<n.length;o++){var a=n[o],s=i[a];s=null!==(s=void 0!==s?s:function(t,e){var i="data-slider-"+e.replace(/_/g,"-"),n=t.getAttribute(i);try{return JSON.parse(n)}catch(t){return n}}(this.element,a))?s:this.defaultOptions[a],this.options||(this.options={}),this.options[a]=s}"auto"===this.options.rtl&&(this.options.rtl="rtl"===window.getComputedStyle(this.element).direction),"vertical"!==this.options.orientation||"top"!==this.options.tooltip_position&&"bottom"!==this.options.tooltip_position?"horizontal"!==this.options.orientation||"left"!==this.options.tooltip_position&&"right"!==this.options.tooltip_position||(this.options.tooltip_position="top"):this.options.rtl?this.options.tooltip_position="left":this.options.tooltip_position="right";var l,c,h,u,d,f=this.element.style.width,p=!1,g=this.element.parentNode;if(this.sliderElem)p=!0;else{this.sliderElem=document.createElement("div"),this.sliderElem.className="slider";var m=document.createElement("div");m.className="slider-track",(c=document.createElement("div")).className="slider-track-low",(l=document.createElement("div")).className="slider-selection",(h=document.createElement("div")).className="slider-track-high",(u=document.createElement("div")).className="slider-handle min-slider-handle",u.setAttribute("role","slider"),u.setAttribute("aria-valuemin",this.options.min),u.setAttribute("aria-valuemax",this.options.max),(d=document.createElement("div")).className="slider-handle max-slider-handle",d.setAttribute("role","slider"),d.setAttribute("aria-valuemin",this.options.min),d.setAttribute("aria-valuemax",this.options.max),m.appendChild(c),m.appendChild(l),m.appendChild(h),this.rangeHighlightElements=[];var v=this.options.rangeHighlights;if(Array.isArray(v)&&v.length>0)for(var y=0;y<v.length;y++){var b=document.createElement("div"),x=v[y].class||"";b.className="slider-rangeHighlight slider-selection "+x,this.rangeHighlightElements.push(b),m.appendChild(b)}var _=Array.isArray(this.options.labelledby);if(_&&this.options.labelledby[0]&&u.setAttribute("aria-labelledby",this.options.labelledby[0]),_&&this.options.labelledby[1]&&d.setAttribute("aria-labelledby",this.options.labelledby[1]),!_&&this.options.labelledby&&(u.setAttribute("aria-labelledby",this.options.labelledby),d.setAttribute("aria-labelledby",this.options.labelledby)),this.ticks=[],Array.isArray(this.options.ticks)&&this.options.ticks.length>0){for(this.ticksContainer=document.createElement("div"),this.ticksContainer.className="slider-tick-container",o=0;o<this.options.ticks.length;o++){var w=document.createElement("div");if(w.className="slider-tick",this.options.ticks_tooltip){var S=this._addTickListener(),C=S.addMouseEnter(this,w,o),k=S.addMouseLeave(this,w);this.ticksCallbackMap[o]={mouseEnter:C,mouseLeave:k}}this.ticks.push(w),this.ticksContainer.appendChild(w)}l.className+=" tick-slider-selection"}if(this.tickLabels=[],Array.isArray(this.options.ticks_labels)&&this.options.ticks_labels.length>0)for(this.tickLabelContainer=document.createElement("div"),this.tickLabelContainer.className="slider-tick-label-container",o=0;o<this.options.ticks_labels.length;o++){var T=document.createElement("div"),A=0===this.options.ticks_positions.length,D=this.options.reversed&&A?this.options.ticks_labels.length-(o+1):o;T.className="slider-tick-label",T.innerHTML=this.options.ticks_labels[D],this.tickLabels.push(T),this.tickLabelContainer.appendChild(T)}var M=function(t){var e=document.createElement("div");e.className="tooltip-arrow";var i=document.createElement("div");i.className="tooltip-inner",t.appendChild(e),t.appendChild(i)},E=document.createElement("div");E.className="tooltip tooltip-main",E.setAttribute("role","presentation"),M(E);var P=document.createElement("div");P.className="tooltip tooltip-min",P.setAttribute("role","presentation"),M(P);var L=document.createElement("div");L.className="tooltip tooltip-max",L.setAttribute("role","presentation"),M(L),this.sliderElem.appendChild(m),this.sliderElem.appendChild(E),this.sliderElem.appendChild(P),this.sliderElem.appendChild(L),this.tickLabelContainer&&this.sliderElem.appendChild(this.tickLabelContainer),this.ticksContainer&&this.sliderElem.appendChild(this.ticksContainer),this.sliderElem.appendChild(u),this.sliderElem.appendChild(d),g.insertBefore(this.sliderElem,this.element),this.element.style.display="none"}if(t&&(this.$element=t(this.element),this.$sliderElem=t(this.sliderElem)),this.eventToCallbackMap={},this.sliderElem.id=this.options.id,this.touchCapable="ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch,this.touchX=0,this.touchY=0,this.tooltip=this.sliderElem.querySelector(".tooltip-main"),this.tooltipInner=this.tooltip.querySelector(".tooltip-inner"),this.tooltip_min=this.sliderElem.querySelector(".tooltip-min"),this.tooltipInner_min=this.tooltip_min.querySelector(".tooltip-inner"),this.tooltip_max=this.sliderElem.querySelector(".tooltip-max"),this.tooltipInner_max=this.tooltip_max.querySelector(".tooltip-inner"),r[this.options.scale]&&(this.options.scale=r[this.options.scale]),!0===p&&(this._removeClass(this.sliderElem,"slider-horizontal"),this._removeClass(this.sliderElem,"slider-vertical"),this._removeClass(this.sliderElem,"slider-rtl"),this._removeClass(this.tooltip,"hide"),this._removeClass(this.tooltip_min,"hide"),this._removeClass(this.tooltip_max,"hide"),["left","right","top","width","height"].forEach(function(t){this._removeProperty(this.trackLow,t),this._removeProperty(this.trackSelection,t),this._removeProperty(this.trackHigh,t)},this),[this.handle1,this.handle2].forEach(function(t){this._removeProperty(t,"left"),this._removeProperty(t,"right"),this._removeProperty(t,"top")},this),[this.tooltip,this.tooltip_min,this.tooltip_max].forEach(function(t){this._removeProperty(t,"left"),this._removeProperty(t,"right"),this._removeProperty(t,"top"),this._removeProperty(t,"margin-left"),this._removeProperty(t,"margin-right"),this._removeProperty(t,"margin-top"),this._removeClass(t,"right"),this._removeClass(t,"left"),this._removeClass(t,"top")},this)),"vertical"===this.options.orientation?(this._addClass(this.sliderElem,"slider-vertical"),this.stylePos="top",this.mousePos="pageY",this.sizePos="offsetHeight"):(this._addClass(this.sliderElem,"slider-horizontal"),this.sliderElem.style.width=f,this.options.orientation="horizontal",this.options.rtl?this.stylePos="right":this.stylePos="left",this.mousePos="pageX",this.sizePos="offsetWidth"),this.options.rtl&&this._addClass(this.sliderElem,"slider-rtl"),this._setTooltipPosition(),Array.isArray(this.options.ticks)&&this.options.ticks.length>0&&(this.options.max=Math.max.apply(Math,this.options.ticks),this.options.min=Math.min.apply(Math,this.options.ticks)),Array.isArray(this.options.value)?(this.options.range=!0,this._state.value=this.options.value):this.options.range?this._state.value=[this.options.value,this.options.max]:this._state.value=this.options.value,this.trackLow=c||this.trackLow,this.trackSelection=l||this.trackSelection,this.trackHigh=h||this.trackHigh,"none"===this.options.selection?(this._addClass(this.trackLow,"hide"),this._addClass(this.trackSelection,"hide"),this._addClass(this.trackHigh,"hide")):"after"!==this.options.selection&&"before"!==this.options.selection||(this._removeClass(this.trackLow,"hide"),this._removeClass(this.trackSelection,"hide"),this._removeClass(this.trackHigh,"hide")),this.handle1=u||this.handle1,this.handle2=d||this.handle2,!0===p)for(this._removeClass(this.handle1,"round triangle"),this._removeClass(this.handle2,"round triangle hide"),o=0;o<this.ticks.length;o++)this._removeClass(this.ticks[o],"round triangle hide");if(-1!==["round","triangle","custom"].indexOf(this.options.handle))for(this._addClass(this.handle1,this.options.handle),this._addClass(this.handle2,this.options.handle),o=0;o<this.ticks.length;o++)this._addClass(this.ticks[o],this.options.handle);if(this._state.offset=this._offset(this.sliderElem),this._state.size=this.sliderElem[this.sizePos],this.setValue(this._state.value),this.handle1Keydown=this._keydown.bind(this,0),this.handle1.addEventListener("keydown",this.handle1Keydown,!1),this.handle2Keydown=this._keydown.bind(this,1),this.handle2.addEventListener("keydown",this.handle2Keydown,!1),this.mousedown=this._mousedown.bind(this),this.touchstart=this._touchstart.bind(this),this.touchmove=this._touchmove.bind(this),this.touchCapable){var I=!1;try{var O=Object.defineProperty({},"passive",{get:function(){I=!0}});window.addEventListener("test",null,O)}catch(t){}var R=!!I&&{passive:!0};this.sliderElem.addEventListener("touchstart",this.touchstart,R),this.sliderElem.addEventListener("touchmove",this.touchmove,R)}if(this.sliderElem.addEventListener("mousedown",this.mousedown,!1),this.resize=this._resize.bind(this),window.addEventListener("resize",this.resize,!1),"hide"===this.options.tooltip)this._addClass(this.tooltip,"hide"),this._addClass(this.tooltip_min,"hide"),this._addClass(this.tooltip_max,"hide");else if("always"===this.options.tooltip)this._showTooltip(),this._alwaysShowTooltip=!0;else{if(this.showTooltip=this._showTooltip.bind(this),this.hideTooltip=this._hideTooltip.bind(this),this.options.ticks_tooltip){var N=this._addTickListener(),F=N.addMouseEnter(this,this.handle1),z=N.addMouseLeave(this,this.handle1);this.handleCallbackMap.handle1={mouseEnter:F,mouseLeave:z},F=N.addMouseEnter(this,this.handle2),z=N.addMouseLeave(this,this.handle2),this.handleCallbackMap.handle2={mouseEnter:F,mouseLeave:z}}else this.sliderElem.addEventListener("mouseenter",this.showTooltip,!1),this.sliderElem.addEventListener("mouseleave",this.hideTooltip,!1);this.handle1.addEventListener("focus",this.showTooltip,!1),this.handle1.addEventListener("blur",this.hideTooltip,!1),this.handle2.addEventListener("focus",this.showTooltip,!1),this.handle2.addEventListener("blur",this.hideTooltip,!1)}this.options.enabled?this.enable():this.disable()}var n={formatInvalidInputErrorMsg:function(t){return"Invalid input value '"+t+"' passed in"},callingContextNotSliderInstance:"Calling context element does not have instance of Slider bound to it. Check your code to make sure the JQuery object returned from the call to the slider() initializer is calling the method"},r={linear:{toValue:function(t){var e=t/100*(this.options.max-this.options.min),i=!0;if(this.options.ticks_positions.length>0){for(var n,r,o,a=0,s=1;s<this.options.ticks_positions.length;s++)if(t<=this.options.ticks_positions[s]){n=this.options.ticks[s-1],o=this.options.ticks_positions[s-1],r=this.options.ticks[s],a=this.options.ticks_positions[s];break}e=n+(t-o)/(a-o)*(r-n),i=!1}var l=(i?this.options.min:0)+Math.round(e/this.options.step)*this.options.step;return l<this.options.min?this.options.min:l>this.options.max?this.options.max:l},toPercentage:function(t){if(this.options.max===this.options.min)return 0;if(this.options.ticks_positions.length>0){for(var e,i,n,r=0,o=0;o<this.options.ticks.length;o++)if(t<=this.options.ticks[o]){e=o>0?this.options.ticks[o-1]:0,n=o>0?this.options.ticks_positions[o-1]:0,i=this.options.ticks[o],r=this.options.ticks_positions[o];break}if(o>0)return n+(t-e)/(i-e)*(r-n)}return 100*(t-this.options.min)/(this.options.max-this.options.min)}},logarithmic:{toValue:function(t){var e=0===this.options.min?0:Math.log(this.options.min),i=Math.log(this.options.max),n=Math.exp(e+(i-e)*t/100);return Math.round(n)===this.options.max?this.options.max:(n=this.options.min+Math.round((n-this.options.min)/this.options.step)*this.options.step)<this.options.min?this.options.min:n>this.options.max?this.options.max:n},toPercentage:function(t){if(this.options.max===this.options.min)return 0;var e=Math.log(this.options.max),i=0===this.options.min?0:Math.log(this.options.min);return 100*((0===t?0:Math.log(t))-i)/(e-i)}}};if(e=function(t,e){return i.call(this,t,e),this},e.prototype={_init:function(){},constructor:e,defaultOptions:{id:"",min:0,max:10,step:1,precision:0,orientation:"horizontal",value:5,range:!1,selection:"before",tooltip:"show",tooltip_split:!1,handle:"round",reversed:!1,rtl:"auto",enabled:!0,formatter:function(t){return Array.isArray(t)?t[0]+" : "+t[1]:t},natural_arrow_keys:!1,ticks:[],ticks_positions:[],ticks_labels:[],ticks_snap_bounds:0,ticks_tooltip:!1,scale:"linear",focus:!1,tooltip_position:null,labelledby:null,rangeHighlights:[]},getElement:function(){return this.sliderElem},getValue:function(){return this.options.range?this._state.value:this._state.value[0]},setValue:function(t,e,i){t||(t=0);var n=this.getValue();this._state.value=this._validateInputValue(t);var r=this._applyPrecision.bind(this);this.options.range?(this._state.value[0]=r(this._state.value[0]),this._state.value[1]=r(this._state.value[1]),this._state.value[0]=Math.max(this.options.min,Math.min(this.options.max,this._state.value[0])),this._state.value[1]=Math.max(this.options.min,Math.min(this.options.max,this._state.value[1]))):(this._state.value=r(this._state.value),this._state.value=[Math.max(this.options.min,Math.min(this.options.max,this._state.value))],this._addClass(this.handle2,"hide"),"after"===this.options.selection?this._state.value[1]=this.options.max:this._state.value[1]=this.options.min),this.options.max>this.options.min?this._state.percentage=[this._toPercentage(this._state.value[0]),this._toPercentage(this._state.value[1]),100*this.options.step/(this.options.max-this.options.min)]:this._state.percentage=[0,0,100],this._layout();var o=this.options.range?this._state.value:this._state.value[0];return this._setDataVal(o),!0===e&&this._trigger("slide",o),n!==o&&!0===i&&this._trigger("change",{oldValue:n,newValue:o}),this},destroy:function(){this._removeSliderEventHandlers(),this.sliderElem.parentNode.removeChild(this.sliderElem),this.element.style.display="",this._cleanUpEventCallbacksMap(),this.element.removeAttribute("data"),t&&(this._unbindJQueryEventHandlers(),this.$element.removeData("slider"))},disable:function(){return this._state.enabled=!1,this.handle1.removeAttribute("tabindex"),this.handle2.removeAttribute("tabindex"),this._addClass(this.sliderElem,"slider-disabled"),this._trigger("slideDisabled"),this},enable:function(){return this._state.enabled=!0,this.handle1.setAttribute("tabindex",0),this.handle2.setAttribute("tabindex",0),this._removeClass(this.sliderElem,"slider-disabled"),this._trigger("slideEnabled"),this},toggle:function(){return this._state.enabled?this.disable():this.enable(),this},isEnabled:function(){return this._state.enabled},on:function(t,e){return this._bindNonQueryEventHandler(t,e),this},off:function(e,i){t?(this.$element.off(e,i),this.$sliderElem.off(e,i)):this._unbindNonQueryEventHandler(e,i)},getAttribute:function(t){return t?this.options[t]:this.options},setAttribute:function(t,e){return this.options[t]=e,this},refresh:function(){return this._removeSliderEventHandlers(),i.call(this,this.element,this.options),t&&t.data(this.element,"slider",this),this},relayout:function(){return this._resize(),this._layout(),this},_removeSliderEventHandlers:function(){if(this.handle1.removeEventListener("keydown",this.handle1Keydown,!1),this.handle2.removeEventListener("keydown",this.handle2Keydown,!1),this.options.ticks_tooltip){for(var t=this.ticksContainer.getElementsByClassName("slider-tick"),e=0;e<t.length;e++)t[e].removeEventListener("mouseenter",this.ticksCallbackMap[e].mouseEnter,!1),t[e].removeEventListener("mouseleave",this.ticksCallbackMap[e].mouseLeave,!1);this.handle1.removeEventListener("mouseenter",this.handleCallbackMap.handle1.mouseEnter,!1),this.handle2.removeEventListener("mouseenter",this.handleCallbackMap.handle2.mouseEnter,!1),this.handle1.removeEventListener("mouseleave",this.handleCallbackMap.handle1.mouseLeave,!1),this.handle2.removeEventListener("mouseleave",this.handleCallbackMap.handle2.mouseLeave,!1)}this.handleCallbackMap=null,this.ticksCallbackMap=null,this.showTooltip&&(this.handle1.removeEventListener("focus",this.showTooltip,!1),this.handle2.removeEventListener("focus",this.showTooltip,!1)),this.hideTooltip&&(this.handle1.removeEventListener("blur",this.hideTooltip,!1),this.handle2.removeEventListener("blur",this.hideTooltip,!1)),this.showTooltip&&this.sliderElem.removeEventListener("mouseenter",this.showTooltip,!1),this.hideTooltip&&this.sliderElem.removeEventListener("mouseleave",this.hideTooltip,!1),this.sliderElem.removeEventListener("touchstart",this.touchstart,!1),this.sliderElem.removeEventListener("touchmove",this.touchmove,!1),this.sliderElem.removeEventListener("mousedown",this.mousedown,!1),window.removeEventListener("resize",this.resize,!1)},_bindNonQueryEventHandler:function(t,e){void 0===this.eventToCallbackMap[t]&&(this.eventToCallbackMap[t]=[]),this.eventToCallbackMap[t].push(e)},_unbindNonQueryEventHandler:function(t,e){var i=this.eventToCallbackMap[t];if(void 0!==i)for(var n=0;n<i.length;n++)if(i[n]===e){i.splice(n,1);break}},_cleanUpEventCallbacksMap:function(){for(var t=Object.keys(this.eventToCallbackMap),e=0;e<t.length;e++){var i=t[e];delete this.eventToCallbackMap[i]}},_showTooltip:function(){!1===this.options.tooltip_split?(this._addClass(this.tooltip,"in"),this.tooltip_min.style.display="none",this.tooltip_max.style.display="none"):(this._addClass(this.tooltip_min,"in"),this._addClass(this.tooltip_max,"in"),this.tooltip.style.display="none"),this._state.over=!0},_hideTooltip:function(){!1===this._state.inDrag&&!0!==this.alwaysShowTooltip&&(this._removeClass(this.tooltip,"in"),this._removeClass(this.tooltip_min,"in"),this._removeClass(this.tooltip_max,"in")),this._state.over=!1},_setToolTipOnMouseOver:function(t){function e(t,e){return e?[100-t.percentage[0],this.options.range?100-t.percentage[1]:t.percentage[1]]:[t.percentage[0],t.percentage[1]]}var i=this.options.formatter(t?t.value[0]:this._state.value[0]),n=t?e(t,this.options.reversed):e(this._state,this.options.reversed);this._setText(this.tooltipInner,i),this.tooltip.style[this.stylePos]=n[0]+"%","vertical"===this.options.orientation?this._css(this.tooltip,"margin-"+this.stylePos,-this.tooltip.offsetHeight/2+"px"):this._css(this.tooltip,"margin-"+this.stylePos,-this.tooltip.offsetWidth/2+"px")},_addTickListener:function(){return{addMouseEnter:function(t,e,i){var n=function(){var e=t._state,n=i>=0?i:this.attributes["aria-valuenow"].value,r=parseInt(n,10);e.value[0]=r,e.percentage[0]=t.options.ticks_positions[r],t._setToolTipOnMouseOver(e),t._showTooltip()};return e.addEventListener("mouseenter",n,!1),n},addMouseLeave:function(t,e){var i=function(){t._hideTooltip()};return e.addEventListener("mouseleave",i,!1),i}}},_layout:function(){var t;if(t=this.options.reversed?[100-this._state.percentage[0],this.options.range?100-this._state.percentage[1]:this._state.percentage[1]]:[this._state.percentage[0],this._state.percentage[1]],this.handle1.style[this.stylePos]=t[0]+"%",this.handle1.setAttribute("aria-valuenow",this._state.value[0]),isNaN(this.options.formatter(this._state.value[0]))&&this.handle1.setAttribute("aria-valuetext",this.options.formatter(this._state.value[0])),this.handle2.style[this.stylePos]=t[1]+"%",this.handle2.setAttribute("aria-valuenow",this._state.value[1]),isNaN(this.options.formatter(this._state.value[1]))&&this.handle2.setAttribute("aria-valuetext",this.options.formatter(this._state.value[1])),this.rangeHighlightElements.length>0&&Array.isArray(this.options.rangeHighlights)&&this.options.rangeHighlights.length>0)for(var e=0;e<this.options.rangeHighlights.length;e++){var i=this._toPercentage(this.options.rangeHighlights[e].start),n=this._toPercentage(this.options.rangeHighlights[e].end);if(this.options.reversed){var r=100-n;n=100-i,i=r}var o=this._createHighlightRange(i,n);o?"vertical"===this.options.orientation?(this.rangeHighlightElements[e].style.top=o.start+"%",this.rangeHighlightElements[e].style.height=o.size+"%"):(this.options.rtl?this.rangeHighlightElements[e].style.right=o.start+"%":this.rangeHighlightElements[e].style.left=o.start+"%",this.rangeHighlightElements[e].style.width=o.size+"%"):this.rangeHighlightElements[e].style.display="none"}if(Array.isArray(this.options.ticks)&&this.options.ticks.length>0){var a,s="vertical"===this.options.orientation?"height":"width";a="vertical"===this.options.orientation?"marginTop":this.options.rtl?"marginRight":"marginLeft";var l=this._state.size/(this.options.ticks.length-1);if(this.tickLabelContainer){var c=0;if(0===this.options.ticks_positions.length)"vertical"!==this.options.orientation&&(this.tickLabelContainer.style[a]=-l/2+"px"),c=this.tickLabelContainer.offsetHeight;else for(h=0;h<this.tickLabelContainer.childNodes.length;h++)this.tickLabelContainer.childNodes[h].offsetHeight>c&&(c=this.tickLabelContainer.childNodes[h].offsetHeight);"horizontal"===this.options.orientation&&(this.sliderElem.style.marginBottom=c+"px")}for(var h=0;h<this.options.ticks.length;h++){var u=this.options.ticks_positions[h]||this._toPercentage(this.options.ticks[h]);this.options.reversed&&(u=100-u),this.ticks[h].style[this.stylePos]=u+"%",this._removeClass(this.ticks[h],"in-selection"),this.options.range?u>=t[0]&&u<=t[1]&&this._addClass(this.ticks[h],"in-selection"):"after"===this.options.selection&&u>=t[0]?this._addClass(this.ticks[h],"in-selection"):"before"===this.options.selection&&u<=t[0]&&this._addClass(this.ticks[h],"in-selection"),this.tickLabels[h]&&(this.tickLabels[h].style[s]=l+"px","vertical"!==this.options.orientation&&void 0!==this.options.ticks_positions[h]?(this.tickLabels[h].style.position="absolute",this.tickLabels[h].style[this.stylePos]=u+"%",this.tickLabels[h].style[a]=-l/2+"px"):"vertical"===this.options.orientation&&(this.options.rtl?this.tickLabels[h].style.marginRight=this.sliderElem.offsetWidth+"px":this.tickLabels[h].style.marginLeft=this.sliderElem.offsetWidth+"px",this.tickLabelContainer.style[a]=this.sliderElem.offsetWidth/2*-1+"px"))}}var d;if(this.options.range){d=this.options.formatter(this._state.value),this._setText(this.tooltipInner,d),this.tooltip.style[this.stylePos]=(t[1]+t[0])/2+"%","vertical"===this.options.orientation?this._css(this.tooltip,"margin-"+this.stylePos,-this.tooltip.offsetHeight/2+"px"):this._css(this.tooltip,"margin-"+this.stylePos,-this.tooltip.offsetWidth/2+"px");var f=this.options.formatter(this._state.value[0]);this._setText(this.tooltipInner_min,f);var p=this.options.formatter(this._state.value[1]);this._setText(this.tooltipInner_max,p),this.tooltip_min.style[this.stylePos]=t[0]+"%","vertical"===this.options.orientation?this._css(this.tooltip_min,"margin-"+this.stylePos,-this.tooltip_min.offsetHeight/2+"px"):this._css(this.tooltip_min,"margin-"+this.stylePos,-this.tooltip_min.offsetWidth/2+"px"),this.tooltip_max.style[this.stylePos]=t[1]+"%","vertical"===this.options.orientation?this._css(this.tooltip_max,"margin-"+this.stylePos,-this.tooltip_max.offsetHeight/2+"px"):this._css(this.tooltip_max,"margin-"+this.stylePos,-this.tooltip_max.offsetWidth/2+"px")}else d=this.options.formatter(this._state.value[0]),this._setText(this.tooltipInner,d),this.tooltip.style[this.stylePos]=t[0]+"%","vertical"===this.options.orientation?this._css(this.tooltip,"margin-"+this.stylePos,-this.tooltip.offsetHeight/2+"px"):this._css(this.tooltip,"margin-"+this.stylePos,-this.tooltip.offsetWidth/2+"px");if("vertical"===this.options.orientation)this.trackLow.style.top="0",this.trackLow.style.height=Math.min(t[0],t[1])+"%",this.trackSelection.style.top=Math.min(t[0],t[1])+"%",this.trackSelection.style.height=Math.abs(t[0]-t[1])+"%",this.trackHigh.style.bottom="0",this.trackHigh.style.height=100-Math.min(t[0],t[1])-Math.abs(t[0]-t[1])+"%";else{"right"===this.stylePos?this.trackLow.style.right="0":this.trackLow.style.left="0",this.trackLow.style.width=Math.min(t[0],t[1])+"%","right"===this.stylePos?this.trackSelection.style.right=Math.min(t[0],t[1])+"%":this.trackSelection.style.left=Math.min(t[0],t[1])+"%",this.trackSelection.style.width=Math.abs(t[0]-t[1])+"%","right"===this.stylePos?this.trackHigh.style.left="0":this.trackHigh.style.right="0",this.trackHigh.style.width=100-Math.min(t[0],t[1])-Math.abs(t[0]-t[1])+"%";var g=this.tooltip_min.getBoundingClientRect(),m=this.tooltip_max.getBoundingClientRect();"bottom"===this.options.tooltip_position?g.right>m.left?(this._removeClass(this.tooltip_max,"bottom"),this._addClass(this.tooltip_max,"top"),this.tooltip_max.style.top="",this.tooltip_max.style.bottom="22px"):(this._removeClass(this.tooltip_max,"top"),this._addClass(this.tooltip_max,"bottom"),this.tooltip_max.style.top=this.tooltip_min.style.top,this.tooltip_max.style.bottom=""):g.right>m.left?(this._removeClass(this.tooltip_max,"top"),this._addClass(this.tooltip_max,"bottom"),this.tooltip_max.style.top="18px"):(this._removeClass(this.tooltip_max,"bottom"),this._addClass(this.tooltip_max,"top"),this.tooltip_max.style.top=this.tooltip_min.style.top)}},_createHighlightRange:function(t,e){return this._isHighlightRange(t,e)?t>e?{start:e,size:t-e}:{start:t,size:e-t}:null},_isHighlightRange:function(t,e){return 0<=t&&t<=100&&0<=e&&e<=100},_resize:function(t){this._state.offset=this._offset(this.sliderElem),this._state.size=this.sliderElem[this.sizePos],this._layout()},_removeProperty:function(t,e){t.style.removeProperty?t.style.removeProperty(e):t.style.removeAttribute(e)},_mousedown:function(t){if(!this._state.enabled)return!1;this._state.offset=this._offset(this.sliderElem),this._state.size=this.sliderElem[this.sizePos];var e=this._getPercentage(t);if(this.options.range){var i=Math.abs(this._state.percentage[0]-e),n=Math.abs(this._state.percentage[1]-e);this._state.dragged=i<n?0:1,this._adjustPercentageForRangeSliders(e)}else this._state.dragged=0;this._state.percentage[this._state.dragged]=e,this._layout(),this.touchCapable&&(document.removeEventListener("touchmove",this.mousemove,!1),document.removeEventListener("touchend",this.mouseup,!1)),this.mousemove&&document.removeEventListener("mousemove",this.mousemove,!1),this.mouseup&&document.removeEventListener("mouseup",this.mouseup,!1),this.mousemove=this._mousemove.bind(this),this.mouseup=this._mouseup.bind(this),this.touchCapable&&(document.addEventListener("touchmove",this.mousemove,!1),document.addEventListener("touchend",this.mouseup,!1)),document.addEventListener("mousemove",this.mousemove,!1),document.addEventListener("mouseup",this.mouseup,!1),this._state.inDrag=!0;var r=this._calculateValue();return this._trigger("slideStart",r),this._setDataVal(r),this.setValue(r,!1,!0),t.returnValue=!1,this.options.focus&&this._triggerFocusOnHandle(this._state.dragged),!0},_touchstart:function(t){if(void 0!==t.changedTouches){var e=t.changedTouches[0];this.touchX=e.pageX,this.touchY=e.pageY}else this._mousedown(t)},_triggerFocusOnHandle:function(t){0===t&&this.handle1.focus(),1===t&&this.handle2.focus()},_keydown:function(t,e){if(!this._state.enabled)return!1;var i;switch(e.keyCode){case 37:case 40:i=-1;break;case 39:case 38:i=1}if(i){if(this.options.natural_arrow_keys){var n="vertical"===this.options.orientation&&!this.options.reversed,r="horizontal"===this.options.orientation&&this.options.reversed;(n||r)&&(i=-i)}var o=this._state.value[t]+i*this.options.step,a=o/this.options.max*100;return this._state.keyCtrl=t,this.options.range&&(this._adjustPercentageForRangeSliders(a),o=[this._state.keyCtrl?this._state.value[0]:o,this._state.keyCtrl?o:this._state.value[1]]),this._trigger("slideStart",o),this._setDataVal(o),this.setValue(o,!0,!0),this._setDataVal(o),this._trigger("slideStop",o),this._layout(),this._pauseEvent(e),delete this._state.keyCtrl,!1}},_pauseEvent:function(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,t.returnValue=!1},_mousemove:function(t){if(!this._state.enabled)return!1;var e=this._getPercentage(t);this._adjustPercentageForRangeSliders(e),this._state.percentage[this._state.dragged]=e,this._layout();var i=this._calculateValue(!0);return this.setValue(i,!0,!0),!1},_touchmove:function(t){if(void 0!==t.changedTouches){var e=t.changedTouches[0],i=e.pageX-this.touchX,n=e.pageY-this.touchY;this._state.inDrag||("vertical"===this.options.orientation&&i<=5&&i>=-5&&(n>=15||n<=-15)?this._mousedown(t):n<=5&&n>=-5&&(i>=15||i<=-15)&&this._mousedown(t))}},_adjustPercentageForRangeSliders:function(t){if(this.options.range){var e=this._getNumDigitsAfterDecimalPlace(t);e=e?e-1:0;var i=this._applyToFixedAndParseFloat(t,e);0===this._state.dragged&&this._applyToFixedAndParseFloat(this._state.percentage[1],e)<i?(this._state.percentage[0]=this._state.percentage[1],this._state.dragged=1):1===this._state.dragged&&this._applyToFixedAndParseFloat(this._state.percentage[0],e)>i?(this._state.percentage[1]=this._state.percentage[0],this._state.dragged=0):0===this._state.keyCtrl&&this._state.value[1]/this.options.max*100<t?(this._state.percentage[0]=this._state.percentage[1],this._state.keyCtrl=1,this.handle2.focus()):1===this._state.keyCtrl&&this._state.value[0]/this.options.max*100>t&&(this._state.percentage[1]=this._state.percentage[0],this._state.keyCtrl=0,this.handle1.focus())}},_mouseup:function(){if(!this._state.enabled)return!1;this.touchCapable&&(document.removeEventListener("touchmove",this.mousemove,!1),document.removeEventListener("touchend",this.mouseup,!1)),document.removeEventListener("mousemove",this.mousemove,!1),document.removeEventListener("mouseup",this.mouseup,!1),this._state.inDrag=!1,!1===this._state.over&&this._hideTooltip();var t=this._calculateValue(!0);return this._layout(),this._setDataVal(t),this._trigger("slideStop",t),!1},_calculateValue:function(t){var e;if(this.options.range?(e=[this.options.min,this.options.max],0!==this._state.percentage[0]&&(e[0]=this._toValue(this._state.percentage[0]),e[0]=this._applyPrecision(e[0])),100!==this._state.percentage[1]&&(e[1]=this._toValue(this._state.percentage[1]),e[1]=this._applyPrecision(e[1]))):(e=this._toValue(this._state.percentage[0]),e=parseFloat(e),e=this._applyPrecision(e)),t){for(var i=[e,1/0],n=0;n<this.options.ticks.length;n++){var r=Math.abs(this.options.ticks[n]-e);r<=i[1]&&(i=[this.options.ticks[n],r])}if(i[1]<=this.options.ticks_snap_bounds)return i[0]}return e},_applyPrecision:function(t){var e=this.options.precision||this._getNumDigitsAfterDecimalPlace(this.options.step);return this._applyToFixedAndParseFloat(t,e)},_getNumDigitsAfterDecimalPlace:function(t){var e=(""+t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0},_applyToFixedAndParseFloat:function(t,e){var i=t.toFixed(e);return parseFloat(i)},_getPercentage:function(t){!this.touchCapable||"touchstart"!==t.type&&"touchmove"!==t.type||(t=t.touches[0]);var e=t[this.mousePos]-this._state.offset[this.stylePos];"right"===this.stylePos&&(e=-e);var i=e/this._state.size*100;return i=Math.round(i/this._state.percentage[2])*this._state.percentage[2],this.options.reversed&&(i=100-i),Math.max(0,Math.min(100,i))},_validateInputValue:function(t){if(isNaN(+t)){if(Array.isArray(t))return this._validateArray(t),t;throw new Error(n.formatInvalidInputErrorMsg(t))}return+t},_validateArray:function(t){for(var e=0;e<t.length;e++){var i=t[e];if("number"!=typeof i)throw new Error(n.formatInvalidInputErrorMsg(i))}},_setDataVal:function(t){this.element.setAttribute("data-value",t),this.element.setAttribute("value",t),this.element.value=t},_trigger:function(e,i){i=i||0===i?i:void 0;var n=this.eventToCallbackMap[e];if(n&&n.length)for(var r=0;r<n.length;r++)(0,n[r])(i);t&&this._triggerJQueryEvent(e,i)},_triggerJQueryEvent:function(t,e){var i={type:t,value:e};this.$element.trigger(i),this.$sliderElem.trigger(i)},_unbindJQueryEventHandlers:function(){this.$element.off(),this.$sliderElem.off()},_setText:function(t,e){void 0!==t.textContent?t.textContent=e:void 0!==t.innerText&&(t.innerText=e)},_removeClass:function(t,e){for(var i=e.split(" "),n=t.className,r=0;r<i.length;r++){var o=i[r],a=new RegExp("(?:\\s|^)"+o+"(?:\\s|$)");n=n.replace(a," ")}t.className=n.trim()},_addClass:function(t,e){for(var i=e.split(" "),n=t.className,r=0;r<i.length;r++){var o=i[r];new RegExp("(?:\\s|^)"+o+"(?:\\s|$)").test(n)||(n+=" "+o)}t.className=n.trim()},_offsetLeft:function(t){return t.getBoundingClientRect().left},_offsetRight:function(t){return t.getBoundingClientRect().right},_offsetTop:function(t){for(var e=t.offsetTop;(t=t.offsetParent)&&!isNaN(t.offsetTop);)e+=t.offsetTop,"BODY"!==t.tagName&&(e-=t.scrollTop);return e},_offset:function(t){return{left:this._offsetLeft(t),right:this._offsetRight(t),top:this._offsetTop(t)}},_css:function(e,i,n){if(t)t.style(e,i,n);else{var r=i.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()});e.style[r]=n}},_toValue:function(t){return this.options.scale.toValue.apply(this,[t])},_toPercentage:function(t){return this.options.scale.toPercentage.apply(this,[t])},_setTooltipPosition:function(){var t=[this.tooltip,this.tooltip_min,this.tooltip_max];if("vertical"===this.options.orientation){var e,i="left"===(e=this.options.tooltip_position?this.options.tooltip_position:this.options.rtl?"left":"right")?"right":"left";t.forEach(function(t){this._addClass(t,e),t.style[i]="100%"}.bind(this))}else"bottom"===this.options.tooltip_position?t.forEach(function(t){this._addClass(t,"bottom"),t.style.top="22px"}.bind(this)):t.forEach(function(t){this._addClass(t,"top"),t.style.top=-this.tooltip.outerHeight-14+"px"}.bind(this))}},t&&t.fn){var o=void 0;t.fn.slider?(windowIsDefined&&window.console.warn("bootstrap-slider.js - WARNING: $.fn.slider namespace is already bound. Use the $.fn.bootstrapSlider namespace instead."),o="bootstrapSlider"):(t.bridget("slider",e),o="slider"),t.bridget("bootstrapSlider",e),t(function(){t("input[data-provide=slider]")[o]()})}}(t),e}),function(t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.noUiSlider=t()}(function(){"use strict";function t(t){return"object"==typeof t&&"function"==typeof t.to&&"function"==typeof t.from}function e(t){t.parentElement.removeChild(t)}function i(t){t.preventDefault()}function n(t){return t.filter(function(t){return!this[t]&&(this[t]=!0)},{})}function r(t,e){return Math.round(t/e)*e}function o(t,e){var i=t.getBoundingClientRect(),n=t.ownerDocument,r=n.documentElement,o=p(n);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0),e?i.top+o.y-r.clientTop:i.left+o.x-r.clientLeft}function a(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function s(t,e,i){i>0&&(u(t,e),setTimeout(function(){d(t,e)},i))}function l(t){return Math.max(Math.min(t,100),0)}function c(t){return Array.isArray(t)?t:[t]}function h(t){var e=(t=String(t)).split(".");return e.length>1?e[1].length:0}function u(t,e){t.classList?t.classList.add(e):t.className+=" "+e}function d(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(t,e){return t.classList?t.classList.contains(e):new RegExp("\\b"+e+"\\b").test(t.className)}function p(t){var e=void 0!==window.pageXOffset,i="CSS1Compat"===(t.compatMode||"");return{x:e?window.pageXOffset:i?t.documentElement.scrollLeft:t.body.scrollLeft,y:e?window.pageYOffset:i?t.documentElement.scrollTop:t.body.scrollTop}}function g(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function m(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}function v(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function y(t,e){return 100/(e-t)}function b(t,e){return 100*e/(t[1]-t[0])}function x(t,e){return b(t,t[0]<0?e+Math.abs(t[0]):e-t[0])}function _(t,e){return e*(t[1]-t[0])/100+t[0]}function w(t,e){for(var i=1;t>=e[i];)i+=1;return i}function S(t,e,i){if(i>=t.slice(-1)[0])return 100;var n,r,o,a,s=w(i,t);return n=t[s-1],r=t[s],o=e[s-1],a=e[s],o+x([n,r],i)/y(o,a)}function C(t,e,i){if(i>=100)return t.slice(-1)[0];var n,r,o,a,s=w(i,e);return n=t[s-1],r=t[s],o=e[s-1],a=e[s],_([n,r],(i-o)*y(o,a))}function k(t,e,i,n){if(100===n)return n;var o,a,s=w(n,t);return i?(o=t[s-1],a=t[s],n-o>(a-o)/2?a:o):e[s-1]?t[s-1]+r(n-t[s-1],e[s-1]):n}function T(t,e,i){var n;if("number"==typeof e&&(e=[e]),"[object Array]"!==Object.prototype.toString.call(e))throw new Error("noUiSlider ("+Q+"): 'range' contains invalid value.");if(n="min"===t?0:"max"===t?100:parseFloat(t),!a(n)||!a(e[0]))throw new Error("noUiSlider ("+Q+"): 'range' value isn't numeric.");i.xPct.push(n),i.xVal.push(e[0]),n?i.xSteps.push(!isNaN(e[1])&&e[1]):isNaN(e[1])||(i.xSteps[0]=e[1]),i.xHighestCompleteStep.push(0)}function A(t,e,i){if(!e)return!0;i.xSteps[t]=b([i.xVal[t],i.xVal[t+1]],e)/y(i.xPct[t],i.xPct[t+1]);var n=(i.xVal[t+1]-i.xVal[t])/i.xNumSteps[t],r=Math.ceil(Number(n.toFixed(3))-1),o=i.xVal[t]+i.xNumSteps[t]*r;i.xHighestCompleteStep[t]=o}function D(t,e,i){this.xPct=[],this.xVal=[],this.xSteps=[i||!1],this.xNumSteps=[!1],this.xHighestCompleteStep=[],this.snap=e;var n,r=[];for(n in t)t.hasOwnProperty(n)&&r.push([t[n],n]);for(r.length&&"object"==typeof r[0][0]?r.sort(function(t,e){return t[0][0]-e[0][0]}):r.sort(function(t,e){return t[0]-e[0]}),n=0;n<r.length;n++)T(r[n][1],r[n][0],this);for(this.xNumSteps=this.xSteps.slice(0),n=0;n<this.xNumSteps.length;n++)A(n,this.xNumSteps[n],this)}function M(e){if(t(e))return!0;throw new Error("noUiSlider ("+Q+"): 'format' requires 'to' and 'from' methods.")}function E(t,e){if(!a(e))throw new Error("noUiSlider ("+Q+"): 'step' is not numeric.");t.singleStep=e}function P(t,e){if("object"!=typeof e||Array.isArray(e))throw new Error("noUiSlider ("+Q+"): 'range' is not an object.");if(void 0===e.min||void 0===e.max)throw new Error("noUiSlider ("+Q+"): Missing 'min' or 'max' in 'range'.");if(e.min===e.max)throw new Error("noUiSlider ("+Q+"): 'range' 'min' and 'max' cannot be equal.");t.spectrum=new D(e,t.snap,t.singleStep)}function L(t,e){if(e=c(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider ("+Q+"): 'start' option is incorrect.");t.handles=e.length,t.start=e}function I(t,e){if(t.snap=e,"boolean"!=typeof e)throw new Error("noUiSlider ("+Q+"): 'snap' option must be a boolean.")}function O(t,e){if(t.animate=e,"boolean"!=typeof e)throw new Error("noUiSlider ("+Q+"): 'animate' option must be a boolean.")}function R(t,e){if(t.animationDuration=e,"number"!=typeof e)throw new Error("noUiSlider ("+Q+"): 'animationDuration' option must be a number.")}function N(t,e){var i,n=[!1];if("lower"===e?e=[!0,!1]:"upper"===e&&(e=[!1,!0]),!0===e||!1===e){for(i=1;i<t.handles;i++)n.push(e);n.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==t.handles+1)throw new Error("noUiSlider ("+Q+"): 'connect' option doesn't match handle count.");n=e}t.connect=n}function F(t,e){switch(e){case"horizontal":t.ort=0;break;case"vertical":t.ort=1;break;default:throw new Error("noUiSlider ("+Q+"): 'orientation' option is invalid.")}}function z(t,e){if(!a(e))throw new Error("noUiSlider ("+Q+"): 'margin' option must be numeric.");if(0!==e&&(t.margin=t.spectrum.getMargin(e),!t.margin))throw new Error("noUiSlider ("+Q+"): 'margin' option is only supported on linear sliders.")}function H(t,e){if(!a(e))throw new Error("noUiSlider ("+Q+"): 'limit' option must be numeric.");if(t.limit=t.spectrum.getMargin(e),!t.limit||t.handles<2)throw new Error("noUiSlider ("+Q+"): 'limit' option is only supported on linear sliders with 2 or more handles.")}function $(t,e){if(!a(e))throw new Error("noUiSlider ("+Q+"): 'padding' option must be numeric.");if(0!==e){if(t.padding=t.spectrum.getMargin(e),!t.padding)throw new Error("noUiSlider ("+Q+"): 'padding' option is only supported on linear sliders.");if(t.padding<0)throw new Error("noUiSlider ("+Q+"): 'padding' option must be a positive number.");if(t.padding>=50)throw new Error("noUiSlider ("+Q+"): 'padding' option must be less than half the range.")}}function V(t,e){switch(e){case"ltr":t.dir=0;break;case"rtl":t.dir=1;break;default:throw new Error("noUiSlider ("+Q+"): 'direction' option was not recognized.")}}function B(t,e){if("string"!=typeof e)throw new Error("noUiSlider ("+Q+"): 'behaviour' must be a string containing options.");var i=e.indexOf("tap")>=0,n=e.indexOf("drag")>=0,r=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,a=e.indexOf("hover")>=0;if(r){if(2!==t.handles)throw new Error("noUiSlider ("+Q+"): 'fixed' behaviour must be used with 2 handles");z(t,t.start[1]-t.start[0])}t.events={tap:i||o,drag:n,fixed:r,snap:o,hover:a}}function W(t,e){if(t.multitouch=e,"boolean"!=typeof e)throw new Error("noUiSlider ("+Q+"): 'multitouch' option must be a boolean.")}function j(t,e){if(!1!==e)if(!0===e){t.tooltips=[];for(var i=0;i<t.handles;i++)t.tooltips.push(!0)}else{if(t.tooltips=c(e),t.tooltips.length!==t.handles)throw new Error("noUiSlider ("+Q+"): must pass a formatter for all handles.");t.tooltips.forEach(function(t){if("boolean"!=typeof t&&("object"!=typeof t||"function"!=typeof t.to))throw new Error("noUiSlider ("+Q+"): 'tooltips' must be passed a formatter or 'false'.")})}}function U(t,e){t.ariaFormat=e,M(e)}function Y(t,e){t.format=e,M(e)}function G(t,e){if(void 0!==e&&"string"!=typeof e&&!1!==e)throw new Error("noUiSlider ("+Q+"): 'cssPrefix' must be a string or `false`.");t.cssPrefix=e}function q(t,e){if(void 0!==e&&"object"!=typeof e)throw new Error("noUiSlider ("+Q+"): 'cssClasses' must be an object.");if("string"==typeof t.cssPrefix){t.cssClasses={};for(var i in e)e.hasOwnProperty(i)&&(t.cssClasses[i]=t.cssPrefix+e[i])}else t.cssClasses=e}function X(t,e){if(!0!==e&&!1!==e)throw new Error("noUiSlider ("+Q+"): 'useRequestAnimationFrame' option should be true (default) or false.");t.useRequestAnimationFrame=e}function K(t){var e={margin:0,limit:0,padding:0,animate:!0,animationDuration:300,ariaFormat:J,format:J},i={step:{r:!1,t:E},start:{r:!0,t:L},connect:{r:!0,t:N},direction:{r:!0,t:V},snap:{r:!1,t:I},animate:{r:!1,t:O},animationDuration:{r:!1,t:R},range:{r:!0,t:P},orientation:{r:!1,t:F},margin:{r:!1,t:z},limit:{r:!1,t:H},padding:{r:!1,t:$},behaviour:{r:!0,t:B},multitouch:{r:!0,t:W},ariaFormat:{r:!1,t:U},format:{r:!1,t:Y},tooltips:{r:!1,t:j},cssPrefix:{r:!1,t:G},cssClasses:{r:!1,t:q},useRequestAnimationFrame:{r:!1,t:X}},n={connect:!1,direction:"ltr",behaviour:"tap",multitouch:!1,orientation:"horizontal",cssPrefix:"noUi-",cssClasses:{target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",ltr:"ltr",rtl:"rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},useRequestAnimationFrame:!0};t.format&&!t.ariaFormat&&(t.ariaFormat=t.format),Object.keys(i).forEach(function(r){if(void 0===t[r]&&void 0===n[r]){if(i[r].r)throw new Error("noUiSlider ("+Q+"): '"+r+"' is required.");return!0}i[r].t(e,void 0===t[r]?n[r]:t[r])}),e.pips=t.pips;var r=[["left","top"],["right","bottom"]];return e.style=r[e.dir][e.ort],e.styleOposite=r[e.dir?0:1][e.ort],e}function Z(t,r,a){function h(t,e){var i=ut.createElement("div");return e&&u(i,e),t.appendChild(i),i}function y(t,e){var i=h(t,r.cssClasses.origin),n=h(i,r.cssClasses.handle);return n.setAttribute("data-handle",e),n.setAttribute("tabindex","0"),n.setAttribute("role","slider"),n.setAttribute("aria-orientation",r.ort?"vertical":"horizontal"),0===e?u(n,r.cssClasses.handleLower):e===r.handles-1&&u(n,r.cssClasses.handleUpper),i}function b(t,e){return!!e&&h(t,r.cssClasses.connect)}function x(t,e){return!!r.tooltips[e]&&h(t.firstChild,r.cssClasses.tooltip)}function _(t,e,i){if("range"===t||"steps"===t)return lt.xVal;if("count"===t){if(!e)throw new Error("noUiSlider ("+Q+"): 'values' required for mode 'count'.");var n,r=100/(e-1),o=0;for(e=[];(n=o++*r)<=100;)e.push(n);t="positions"}return"positions"===t?e.map(function(t){return lt.fromStepping(i?lt.getStep(t):t)}):"values"===t?i?e.map(function(t){return lt.fromStepping(lt.getStep(lt.toStepping(t)))}):e:void 0}function w(t,e,i){function r(t,e){return(t+e).toFixed(7)/1}var o={},a=lt.xVal[0],s=lt.xVal[lt.xVal.length-1],l=!1,c=!1,h=0;return(i=n(i.slice().sort(function(t,e){return t-e})))[0]!==a&&(i.unshift(a),l=!0),i[i.length-1]!==s&&(i.push(s),c=!0),i.forEach(function(n,a){var s,u,d,f,p,g,m,v,y,b=n,x=i[a+1];if("steps"===e&&(s=lt.xNumSteps[a]),s||(s=x-b),!1!==b&&void 0!==x)for(s=Math.max(s,1e-7),u=b;u<=x;u=r(u,s)){for(m=(p=(f=lt.toStepping(u))-h)/t,y=p/(v=Math.round(m)),d=1;d<=v;d+=1)o[(h+d*y).toFixed(5)]=["x",0];g=i.indexOf(u)>-1?1:"steps"===e?2:0,!a&&l&&(g=0),u===x&&c||(o[f.toFixed(5)]=[u,g]),h=f}}),o}function S(t,e,i){function n(t,e){var i=e===r.cssClasses.value,n=i?c:d,o=i?s:l;return e+" "+n[r.ort]+" "+o[t]}function o(t,o){o[1]=o[1]&&e?e(o[0],o[1]):o[1];var s=h(a,!1);s.className=n(o[1],r.cssClasses.marker),s.style[r.style]=t+"%",o[1]&&((s=h(a,!1)).className=n(o[1],r.cssClasses.value),s.style[r.style]=t+"%",s.innerText=i.to(o[0]))}var a=ut.createElement("div"),s=[r.cssClasses.valueNormal,r.cssClasses.valueLarge,r.cssClasses.valueSub],l=[r.cssClasses.markerNormal,r.cssClasses.markerLarge,r.cssClasses.markerSub],c=[r.cssClasses.valueHorizontal,r.cssClasses.valueVertical],d=[r.cssClasses.markerHorizontal,r.cssClasses.markerVertical];return u(a,r.cssClasses.pips),u(a,0===r.ort?r.cssClasses.pipsHorizontal:r.cssClasses.pipsVertical),Object.keys(t).forEach(function(e){o(e,t[e])}),a}function C(){et&&(e(et),et=null)}function k(t){C();var e=t.mode,i=t.density||1,n=t.filter||!1,r=w(i,e,_(e,t.values||!1,t.stepped||!1)),o=t.format||{to:Math.round};return et=rt.appendChild(S(r,n,o))}function T(){var t=X.getBoundingClientRect(),e="offset"+["Width","Height"][r.ort];return 0===r.ort?t.width||X[e]:t.height||X[e]}function A(t,e,i,n){var o=function(o){return!rt.hasAttribute("disabled")&&(!f(rt,r.cssClasses.tap)&&(!!(o=D(o,n.pageOffset,n.target||e))&&(!(t===it.start&&void 0!==o.buttons&&o.buttons>1)&&((!n.hover||!o.buttons)&&(nt||o.preventDefault(),o.calcPoint=o.points[r.ort],void i(o,n))))))},a=[];return t.split(" ").forEach(function(t){e.addEventListener(t,o,!!nt&&{passive:!0}),a.push([t,o])}),a}function D(t,e,i){var n,o,a=0===t.type.indexOf("touch"),s=0===t.type.indexOf("mouse"),l=0===t.type.indexOf("pointer");if(0===t.type.indexOf("MSPointer")&&(l=!0),a&&r.multitouch){var c=function(t){return t.target===i||i.contains(t.target)};if("touchstart"===t.type){var h=Array.prototype.filter.call(t.touches,c);if(h.length>1)return!1;n=h[0].pageX,o=h[0].pageY}else{var u=Array.prototype.find.call(t.changedTouches,c);if(!u)return!1;n=u.pageX,o=u.pageY}}else if(a){if(t.touches.length>1)return!1;n=t.changedTouches[0].pageX,o=t.changedTouches[0].pageY}return e=e||p(ut),(s||l)&&(n=t.clientX+e.x,o=t.clientY+e.y),t.pageOffset=e,t.points=[n,o],t.cursor=s||l,t}function M(t){var e=100*(t-o(X,r.ort))/T();return r.dir?100-e:e}function E(t){var e=100,i=!1;return Z.forEach(function(n,r){if(!n.hasAttribute("disabled")){var o=Math.abs(ot[r]-t);o<e&&(i=r,e=o)}}),i}function P(t,e,i,n){var r=i.slice(),o=[!t,t],a=[t,!t];n=n.slice(),t&&n.reverse(),n.length>1?n.forEach(function(t,i){var n=H(r,t,r[t]+e,o[i],a[i],!1);!1===n?e=0:(e=n-r[t],r[t]=n)}):o=a=[!0];var s=!1;n.forEach(function(t,n){s=W(t,i[t]+e,o[n],a[n])||s}),s&&n.forEach(function(t){L("update",t),L("slide",t)})}function L(t,e,i){Object.keys(ht).forEach(function(n){var o=n.split(".")[0];t===o&&ht[n].forEach(function(t){t.call(tt,ct.map(r.format.to),e,ct.slice(),i||!1,ot.slice())})})}function I(t,e){"mouseout"===t.type&&"HTML"===t.target.nodeName&&null===t.relatedTarget&&R(t,e)}function O(t,e){if(-1===navigator.appVersion.indexOf("MSIE 9")&&0===t.buttons&&0!==e.buttonsProperty)return R(t,e);var i=(r.dir?-1:1)*(t.calcPoint-e.startCalcPoint);P(i>0,100*i/e.baseSize,e.locations,e.handleNumbers)}function R(t,e){e.handle&&(d(e.handle,r.cssClasses.active),st-=1),e.listeners.forEach(function(t){dt.removeEventListener(t[0],t[1])}),0===st&&(d(rt,r.cssClasses.drag),B(),t.cursor&&(ft.style.cursor="",ft.removeEventListener("selectstart",i))),e.handleNumbers.forEach(function(t){L("change",t),L("set",t),L("end",t)})}function N(t,e){var n;if(1===e.handleNumbers.length){var o=Z[e.handleNumbers[0]];if(o.hasAttribute("disabled"))return!1;n=o.children[0],st+=1,u(n,r.cssClasses.active)}t.stopPropagation();var a=[],s=A(it.move,dt,O,{target:t.target,handle:n,listeners:a,startCalcPoint:t.calcPoint,baseSize:T(),pageOffset:t.pageOffset,handleNumbers:e.handleNumbers,buttonsProperty:t.buttons,locations:ot.slice()}),l=A(it.end,dt,R,{target:t.target,handle:n,listeners:a,handleNumbers:e.handleNumbers}),c=A("mouseout",dt,I,{target:t.target,handle:n,listeners:a,handleNumbers:e.handleNumbers});a.push.apply(a,s.concat(l,c)),t.cursor&&(ft.style.cursor=getComputedStyle(t.target).cursor,Z.length>1&&u(rt,r.cssClasses.drag),ft.addEventListener("selectstart",i,!1)),e.handleNumbers.forEach(function(t){L("start",t)})}function F(t){t.stopPropagation();var e=M(t.calcPoint),i=E(e);if(!1===i)return!1;r.events.snap||s(rt,r.cssClasses.tap,r.animationDuration),W(i,e,!0,!0),B(),L("slide",i,!0),L("update",i,!0),L("change",i,!0),L("set",i,!0),r.events.snap&&N(t,{handleNumbers:[i]})}function z(t){var e=M(t.calcPoint),i=lt.getStep(e),n=lt.fromStepping(i);Object.keys(ht).forEach(function(t){"hover"===t.split(".")[0]&&ht[t].forEach(function(t){t.call(tt,n)})})}function H(t,e,i,n,o,a){return Z.length>1&&(n&&e>0&&(i=Math.max(i,t[e-1]+r.margin)),o&&e<Z.length-1&&(i=Math.min(i,t[e+1]-r.margin))),Z.length>1&&r.limit&&(n&&e>0&&(i=Math.min(i,t[e-1]+r.limit)),o&&e<Z.length-1&&(i=Math.max(i,t[e+1]-r.limit))),r.padding&&(0===e&&(i=Math.max(i,r.padding)),e===Z.length-1&&(i=Math.min(i,100-r.padding))),i=lt.getStep(i),!((i=l(i))===t[e]&&!a)&&i}function $(t){return t+"%"}function V(t,e){ot[t]=e,ct[t]=lt.fromStepping(e);var i=function(){Z[t].style[r.style]=$(e),j(t),j(t+1)};window.requestAnimationFrame&&r.useRequestAnimationFrame?window.requestAnimationFrame(i):i()}function B(){at.forEach(function(t){var e=ot[t]>50?-1:1,i=3+(Z.length+e*t);Z[t].childNodes[0].style.zIndex=i})}function W(t,e,i,n){return!1!==(e=H(ot,t,e,i,n,!1))&&(V(t,e),!0)}function j(t){if(J[t]){var e=0,i=100;0!==t&&(e=ot[t-1]),t!==J.length-1&&(i=ot[t]),J[t].style[r.style]=$(e),J[t].style[r.styleOposite]=$(100-i)}}function U(t,e){null!==t&&!1!==t&&("number"==typeof t&&(t=String(t)),!1===(t=r.format.from(t))||isNaN(t)||W(e,lt.toStepping(t),!1,!1))}function Y(t,e){var i=c(t),n=void 0===ot[0];e=void 0===e||!!e,i.forEach(U),r.animate&&!n&&s(rt,r.cssClasses.tap,r.animationDuration),at.forEach(function(t){W(t,ot[t],!0,!1)}),B(),at.forEach(function(t){L("update",t),null!==i[t]&&e&&L("set",t)})}function G(){var t=ct.map(r.format.to);return 1===t.length?t[0]:t}function q(t,e){ht[t]=ht[t]||[],ht[t].push(e),"update"===t.split(".")[0]&&Z.forEach(function(t,e){L("update",e)})}var X,Z,J,tt,et,it=g(),nt=v()&&m(),rt=t,ot=[],at=[],st=0,lt=r.spectrum,ct=[],ht={},ut=t.ownerDocument,dt=ut.documentElement,ft=ut.body;if(rt.noUiSlider)throw new Error("noUiSlider ("+Q+"): Slider was already initialized.");return function(t){u(t,r.cssClasses.target),0===r.dir?u(t,r.cssClasses.ltr):u(t,r.cssClasses.rtl),0===r.ort?u(t,r.cssClasses.horizontal):u(t,r.cssClasses.vertical),X=h(t,r.cssClasses.base)}(rt),function(t,e){Z=[],(J=[]).push(b(e,t[0]));for(var i=0;i<r.handles;i++)Z.push(y(e,i)),at[i]=i,J.push(b(e,t[i+1]))}(r.connect,X),tt={destroy:function(){for(var t in r.cssClasses)r.cssClasses.hasOwnProperty(t)&&d(rt,r.cssClasses[t]);for(;rt.firstChild;)rt.removeChild(rt.firstChild);delete rt.noUiSlider},steps:function(){return ot.map(function(t,e){var i=lt.getNearbySteps(t),n=ct[e],r=i.thisStep.step,o=null;!1!==r&&n+r>i.stepAfter.startValue&&(r=i.stepAfter.startValue-n),o=n>i.thisStep.startValue?i.thisStep.step:!1!==i.stepBefore.step&&n-i.stepBefore.highestStep,100===t?r=null:0===t&&(o=null);var a=lt.countStepDecimals();return null!==r&&!1!==r&&(r=Number(r.toFixed(a))),null!==o&&!1!==o&&(o=Number(o.toFixed(a))),[o,r]})},on:q,off:function(t){var e=t&&t.split(".")[0],i=e&&t.substring(e.length);Object.keys(ht).forEach(function(t){var n=t.split(".")[0],r=t.substring(n.length);e&&e!==n||i&&i!==r||delete ht[t]})},get:G,set:Y,reset:function(t){Y(r.start,t)},__moveHandles:function(t,e,i){P(t,e,ot,i)},options:a,updateOptions:function(t,e){var i=G(),n=["margin","limit","padding","range","animate","snap","step","format"];n.forEach(function(e){void 0!==t[e]&&(a[e]=t[e])});var o=K(a);n.forEach(function(e){void 0!==t[e]&&(r[e]=o[e])}),lt=o.spectrum,r.margin=o.margin,r.limit=o.limit,r.padding=o.padding,r.pips&&k(r.pips),ot=[],Y(t.start||i,e)},target:rt,removePips:C,pips:k},function(t){t.fixed||Z.forEach(function(t,e){A(it.start,t.children[0],N,{handleNumbers:[e]})}),t.tap&&A(it.start,X,F,{}),t.hover&&A(it.move,X,z,{hover:!0}),t.drag&&J.forEach(function(e,i){if(!1!==e&&0!==i&&i!==J.length-1){var n=Z[i-1],o=Z[i],a=[e];u(e,r.cssClasses.draggable),t.fixed&&(a.push(n.children[0]),a.push(o.children[0])),a.forEach(function(t){A(it.start,t,N,{handles:[n,o],handleNumbers:[i-1,i]})})}})}(r.events),Y(r.start),r.pips&&k(r.pips),r.tooltips&&function(){var t=Z.map(x);q("update",function(e,i,n){if(t[i]){var o=e[i];!0!==r.tooltips[i]&&(o=r.tooltips[i].to(n[i])),t[i].innerHTML=o}})}(),q("update",function(t,e,i,n,o){at.forEach(function(t){var e=Z[t],n=H(ot,t,0,!0,!0,!0),a=H(ot,t,100,!0,!0,!0),s=o[t],l=r.ariaFormat.to(i[t]);e.children[0].setAttribute("aria-valuemin",n.toFixed(1)),e.children[0].setAttribute("aria-valuemax",a.toFixed(1)),e.children[0].setAttribute("aria-valuenow",s.toFixed(1)),e.children[0].setAttribute("aria-valuetext",l)})}),tt}var Q="10.1.0";D.prototype.getMargin=function(t){var e=this.xNumSteps[0];if(e&&t/e%1!=0)throw new Error("noUiSlider ("+Q+"): 'limit', 'margin' and 'padding' must be divisible by step.");return 2===this.xPct.length&&b(this.xVal,t)},D.prototype.toStepping=function(t){return t=S(this.xVal,this.xPct,t)},D.prototype.fromStepping=function(t){return C(this.xVal,this.xPct,t)},D.prototype.getStep=function(t){return t=k(this.xPct,this.xSteps,this.snap,t)},D.prototype.getNearbySteps=function(t){var e=w(t,this.xPct);return{stepBefore:{startValue:this.xVal[e-2],step:this.xNumSteps[e-2],highestStep:this.xHighestCompleteStep[e-2]},thisStep:{startValue:this.xVal[e-1],step:this.xNumSteps[e-1],highestStep:this.xHighestCompleteStep[e-1]},stepAfter:{startValue:this.xVal[e-0],step:this.xNumSteps[e-0],highestStep:this.xHighestCompleteStep[e-0]}}},D.prototype.countStepDecimals=function(){var t=this.xNumSteps.map(h);return Math.max.apply(null,t)},D.prototype.convert=function(t){return this.getStep(this.toStepping(t))};var J={to:function(t){return void 0!==t&&t.toFixed(2)},from:Number};return{version:Q,create:function(t,e){if(!t||!t.nodeName)throw new Error("noUiSlider ("+Q+"): create requires a single element, got: "+t);var i=Z(t,K(e,t),e);return t.noUiSlider=i,i}}}),function(t,e,i,n){function r(e,i){this.settings=null,this.options=t.extend({},r.Defaults,i),this.$element=t(e),this._handlers={},this._plugins={},this._supress={},this._current=null,this._speed=null,this._coordinates=[],this._breakpoint=null,this._width=null,this._items=[],this._clones=[],this._mergers=[],this._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},t.each(["onResize","onThrottledResize"],t.proxy(function(e,i){this._handlers[i]=t.proxy(this[i],this)},this)),t.each(r.Plugins,t.proxy(function(t,e){this._plugins[t.charAt(0).toLowerCase()+t.slice(1)]=new e(this)},this)),t.each(r.Workers,t.proxy(function(e,i){this._pipe.push({filter:i.filter,run:t.proxy(i.run,this)})},this)),this.setup(),this.initialize()}r.Defaults={items:3,loop:!1,center:!1,rewind:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:e,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},r.Width={Default:"default",Inner:"inner",Outer:"outer"},r.Type={Event:"event",State:"state"},r.Plugins={},r.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(t){t.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(t){var e=this.settings.margin||"",i=!this.settings.autoWidth,n=this.settings.rtl,r={width:"auto","margin-left":n?e:"","margin-right":n?"":e};!i&&this.$stage.children().css(r),t.css=r}},{filter:["width","items","settings"],run:function(t){var e=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,i=null,n=this._items.length,r=!this.settings.autoWidth,o=[];for(t.items={merge:!1,width:e};n--;)i=this._mergers[n],i=this.settings.mergeFit&&Math.min(i,this.settings.items)||i,t.items.merge=i>1||t.items.merge,o[n]=r?e*i:this._items[n].width();this._widths=o}},{filter:["items","settings"],run:function(){var e=[],i=this._items,n=this.settings,r=Math.max(2*n.items,4),o=2*Math.ceil(i.length/2),a=n.loop&&i.length?n.rewind?r:Math.max(r,o):0,s="",l="";for(a/=2;a--;)e.push(this.normalize(e.length/2,!0)),s+=i[e[e.length-1]][0].outerHTML,e.push(this.normalize(i.length-1-(e.length-1)/2,!0)),l=i[e[e.length-1]][0].outerHTML+l;this._clones=e,t(s).addClass("cloned").appendTo(this.$stage),t(l).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var t=this.settings.rtl?1:-1,e=this._clones.length+this._items.length,i=-1,n=0,r=0,o=[];++i<e;)n=o[i-1]||0,r=this._widths[this.relative(i)]+this.settings.margin,o.push(n+r*t);this._coordinates=o}},{filter:["width","items","settings"],run:function(){var t=this.settings.stagePadding,e=this._coordinates,i={width:Math.ceil(Math.abs(e[e.length-1]))+2*t,"padding-left":t||"","padding-right":t||""};this.$stage.css(i)}},{filter:["width","items","settings"],run:function(t){var e=this._coordinates.length,i=!this.settings.autoWidth,n=this.$stage.children();if(i&&t.items.merge)for(;e--;)t.css.width=this._widths[this.relative(e)],n.eq(e).css(t.css);else i&&(t.css.width=t.items.width,n.css(t.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(t){t.current=t.current?this.$stage.children().index(t.current):0,t.current=Math.max(this.minimum(),Math.min(this.maximum(),t.current)),this.reset(t.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var t,e,i,n,r=this.settings.rtl?1:-1,o=2*this.settings.stagePadding,a=this.coordinates(this.current())+o,s=a+this.width()*r,l=[];for(i=0,n=this._coordinates.length;i<n;i++)t=this._coordinates[i-1]||0,e=Math.abs(this._coordinates[i])+o*r,(this.op(t,"<=",a)&&this.op(t,">",s)||this.op(e,"<",a)&&this.op(e,">",s))&&l.push(i);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+l.join("), :eq(")+")").addClass("active"),this.settings.center&&(this.$stage.children(".center").removeClass("center"),this.$stage.children().eq(this.current()).addClass("center"))}}],r.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var e,i,n;e=this.$element.find("img"),i=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:void 0,n=this.$element.children(i).width(),e.length&&n<=0&&this.preloadAutoWidthImages(e)}this.$element.addClass(this.options.loadingClass),this.$stage=t("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('<div class="'+this.settings.stageOuterClass+'"/>'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this.$element.is(":visible")?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},r.prototype.setup=function(){var e=this.viewport(),i=this.options.responsive,n=-1,r=null;i?(t.each(i,function(t){t<=e&&t>n&&(n=Number(t))}),"function"==typeof(r=t.extend({},this.options,i[n])).stagePadding&&(r.stagePadding=r.stagePadding()),delete r.responsive,r.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+n))):r=t.extend({},this.options),this.trigger("change",{property:{name:"settings",value:r}}),this._breakpoint=n,this.settings=r,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},r.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},r.prototype.prepare=function(e){var i=this.trigger("prepare",{content:e});return i.data||(i.data=t("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(e)),this.trigger("prepared",{content:i.data}),i.data},r.prototype.update=function(){for(var e=0,i=this._pipe.length,n=t.proxy(function(t){return this[t]},this._invalidated),r={};e<i;)(this._invalidated.all||t.grep(this._pipe[e].filter,n).length>0)&&this._pipe[e].run(r),e++;this._invalidated={},!this.is("valid")&&this.enter("valid")},r.prototype.width=function(t){switch(t=t||r.Width.Default){case r.Width.Inner:case r.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},r.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},r.prototype.onThrottledResize=function(){e.clearTimeout(this.resizeTimer),this.resizeTimer=e.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},r.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.$element.is(":visible")&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},r.prototype.registerEventHandlers=function(){t.support.transition&&this.$stage.on(t.support.transition.end+".owl.core",t.proxy(this.onTransitionEnd,this)),!1!==this.settings.responsive&&this.on(e,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",t.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",t.proxy(this.onDragEnd,this)))},r.prototype.onDragStart=function(e){var n=null;3!==e.which&&(t.support.transform?n={x:(n=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","))[16===n.length?12:4],y:n[16===n.length?13:5]}:(n=this.$stage.position(),n={x:this.settings.rtl?n.left+this.$stage.width()-this.width()+this.settings.margin:n.left,y:n.top}),this.is("animating")&&(t.support.transform?this.animate(n.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===e.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=t(e.target),this._drag.stage.start=n,this._drag.stage.current=n,this._drag.pointer=this.pointer(e),t(i).on("mouseup.owl.core touchend.owl.core",t.proxy(this.onDragEnd,this)),t(i).one("mousemove.owl.core touchmove.owl.core",t.proxy(function(e){var n=this.difference(this._drag.pointer,this.pointer(e));t(i).on("mousemove.owl.core touchmove.owl.core",t.proxy(this.onDragMove,this)),Math.abs(n.x)<Math.abs(n.y)&&this.is("valid")||(e.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},r.prototype.onDragMove=function(t){var e=null,i=null,n=null,r=this.difference(this._drag.pointer,this.pointer(t)),o=this.difference(this._drag.stage.start,r);this.is("dragging")&&(t.preventDefault(),this.settings.loop?(e=this.coordinates(this.minimum()),i=this.coordinates(this.maximum()+1)-e,o.x=((o.x-e)%i+i)%i+e):(e=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),i=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),n=this.settings.pullDrag?-1*r.x/5:0,o.x=Math.max(Math.min(o.x,e+n),i+n)),this._drag.stage.current=o,this.animate(o.x))},r.prototype.onDragEnd=function(e){var n=this.difference(this._drag.pointer,this.pointer(e)),r=this._drag.stage.current,o=n.x>0^this.settings.rtl?"left":"right";t(i).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==n.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(r.x,0!==n.x?o:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=o,(Math.abs(n.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},r.prototype.closest=function(e,i){var n=-1,r=this.width(),o=this.coordinates();return this.settings.freeDrag||t.each(o,t.proxy(function(t,a){return"left"===i&&e>a-30&&e<a+30?n=t:"right"===i&&e>a-r-30&&e<a-r+30?n=t+1:this.op(e,"<",a)&&this.op(e,">",o[t+1]||a-r)&&(n="left"===i?t+1:t),-1===n},this)),this.settings.loop||(this.op(e,">",o[this.minimum()])?n=e=this.minimum():this.op(e,"<",o[this.maximum()])&&(n=e=this.maximum())),n},r.prototype.animate=function(e){var i=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),i&&(this.enter("animating"),this.trigger("translate")),t.support.transform3d&&t.support.transition?this.$stage.css({transform:"translate3d("+e+"px,0px,0px)",transition:this.speed()/1e3+"s"}):i?this.$stage.animate({left:e+"px"},this.speed(),this.settings.fallbackEasing,t.proxy(this.onTransitionEnd,this)):this.$stage.css({left:e+"px"})},r.prototype.is=function(t){return this._states.current[t]&&this._states.current[t]>0},r.prototype.current=function(t){if(void 0===t)return this._current;if(0!==this._items.length){if(t=this.normalize(t),this._current!==t){var e=this.trigger("change",{property:{name:"position",value:t}});void 0!==e.data&&(t=this.normalize(e.data)),this._current=t,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current}},r.prototype.invalidate=function(e){return"string"===t.type(e)&&(this._invalidated[e]=!0,this.is("valid")&&this.leave("valid")),t.map(this._invalidated,function(t,e){return e})},r.prototype.reset=function(t){void 0!==(t=this.normalize(t))&&(this._speed=0,this._current=t,this.suppress(["translate","translated"]),this.animate(this.coordinates(t)),this.release(["translate","translated"]))},r.prototype.normalize=function(t,e){var i=this._items.length,n=e?0:this._clones.length;return!this.isNumeric(t)||i<1?t=void 0:(t<0||t>=i+n)&&(t=((t-n/2)%i+i)%i+n/2),t},r.prototype.relative=function(t){return t-=this._clones.length/2,this.normalize(t,!0)},r.prototype.maximum=function(t){var e,i,n,r=this.settings,o=this._coordinates.length;if(r.loop)o=this._clones.length/2+this._items.length-1;else if(r.autoWidth||r.merge){for(e=this._items.length,i=this._items[--e].width(),n=this.$element.width();e--&&!((i+=this._items[e].width()+this.settings.margin)>n););o=e+1}else o=r.center?this._items.length-1:this._items.length-r.items;return t&&(o-=this._clones.length/2),Math.max(o,0)},r.prototype.minimum=function(t){return t?0:this._clones.length/2},r.prototype.items=function(t){return void 0===t?this._items.slice():(t=this.normalize(t,!0),this._items[t])},r.prototype.mergers=function(t){return void 0===t?this._mergers.slice():(t=this.normalize(t,!0),this._mergers[t])},r.prototype.clones=function(e){var i=this._clones.length/2,n=i+this._items.length,r=function(t){return t%2==0?n+t/2:i-(t+1)/2};return void 0===e?t.map(this._clones,function(t,e){return r(e)}):t.map(this._clones,function(t,i){return t===e?r(i):null})},r.prototype.speed=function(t){return void 0!==t&&(this._speed=t),this._speed},r.prototype.coordinates=function(e){var i,n=1,r=e-1;return void 0===e?t.map(this._coordinates,t.proxy(function(t,e){return this.coordinates(e)},this)):(this.settings.center?(this.settings.rtl&&(n=-1,r=e+1),i=this._coordinates[e],i+=(this.width()-i+(this._coordinates[r]||0))/2*n):i=this._coordinates[r]||0,i=Math.ceil(i))},r.prototype.duration=function(t,e,i){return 0===i?0:Math.min(Math.max(Math.abs(e-t),1),6)*Math.abs(i||this.settings.smartSpeed)},r.prototype.to=function(t,e){var i=this.current(),n=null,r=t-this.relative(i),o=(r>0)-(r<0),a=this._items.length,s=this.minimum(),l=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(r)>a/2&&(r+=-1*o*a),(n=(((t=i+r)-s)%a+a)%a+s)!==t&&n-r<=l&&n-r>0&&(i=n-r,t=n,this.reset(i))):t=this.settings.rewind?(t%(l+=1)+l)%l:Math.max(s,Math.min(l,t)),this.speed(this.duration(i,t,e)),this.current(t),this.$element.is(":visible")&&this.update()},r.prototype.next=function(t){t=t||!1,this.to(this.relative(this.current())+1,t)},r.prototype.prev=function(t){t=t||!1,this.to(this.relative(this.current())-1,t)},r.prototype.onTransitionEnd=function(t){if(void 0!==t&&(t.stopPropagation(),(t.target||t.srcElement||t.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},r.prototype.viewport=function(){var n;return this.options.responsiveBaseElement!==e?n=t(this.options.responsiveBaseElement).width():e.innerWidth?n=e.innerWidth:i.documentElement&&i.documentElement.clientWidth?n=i.documentElement.clientWidth:console.warn("Can not detect viewport width."),n},r.prototype.replace=function(e){this.$stage.empty(),this._items=[],e&&(e=e instanceof jQuery?e:t(e)),this.settings.nestedItemSelector&&(e=e.find("."+this.settings.nestedItemSelector)),e.filter(function(){return 1===this.nodeType}).each(t.proxy(function(t,e){e=this.prepare(e),this.$stage.append(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},r.prototype.add=function(e,i){var n=this.relative(this._current);i=void 0===i?this._items.length:this.normalize(i,!0),e=e instanceof jQuery?e:t(e),this.trigger("add",{content:e,position:i}),e=this.prepare(e),0===this._items.length||i===this._items.length?(0===this._items.length&&this.$stage.append(e),0!==this._items.length&&this._items[i-1].after(e),this._items.push(e),this._mergers.push(1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[i].before(e),this._items.splice(i,0,e),this._mergers.splice(i,0,1*e.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[n]&&this.reset(this._items[n].index()),this.invalidate("items"),this.trigger("added",{content:e,position:i})},r.prototype.remove=function(t){void 0!==(t=this.normalize(t,!0))&&(this.trigger("remove",{content:this._items[t],position:t}),this._items[t].remove(),this._items.splice(t,1),this._mergers.splice(t,1),this.invalidate("items"),this.trigger("removed",{content:null,position:t}))},r.prototype.preloadAutoWidthImages=function(e){e.each(t.proxy(function(e,i){this.enter("pre-loading"),i=t(i),t(new Image).one("load",t.proxy(function(t){i.attr("src",t.target.src),i.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",i.attr("src")||i.attr("data-src")||i.attr("data-src-retina"))},this))},r.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),t(i).off(".owl.core"),!1!==this.settings.responsive&&(e.clearTimeout(this.resizeTimer),this.off(e,"resize",this._handlers.onThrottledResize));for(var n in this._plugins)this._plugins[n].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},r.prototype.op=function(t,e,i){var n=this.settings.rtl;switch(e){case"<":return n?t>i:t<i;case">":return n?t<i:t>i;case">=":return n?t<=i:t>=i;case"<=":return n?t>=i:t<=i}},r.prototype.on=function(t,e,i,n){t.addEventListener?t.addEventListener(e,i,n):t.attachEvent&&t.attachEvent("on"+e,i)},r.prototype.off=function(t,e,i,n){t.removeEventListener?t.removeEventListener(e,i,n):t.detachEvent&&t.detachEvent("on"+e,i)},r.prototype.trigger=function(e,i,n,o,a){var s={item:{count:this._items.length,index:this.current()}},l=t.camelCase(t.grep(["on",e,n],function(t){return t}).join("-").toLowerCase()),c=t.Event([e,"owl",n||"carousel"].join(".").toLowerCase(),t.extend({relatedTarget:this},s,i));return this._supress[e]||(t.each(this._plugins,function(t,e){e.onTrigger&&e.onTrigger(c)}),this.register({type:r.Type.Event,name:e}),this.$element.trigger(c),this.settings&&"function"==typeof this.settings[l]&&this.settings[l].call(this,c)),c},r.prototype.enter=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){void 0===this._states.current[e]&&(this._states.current[e]=0),this._states.current[e]++},this))},r.prototype.leave=function(e){t.each([e].concat(this._states.tags[e]||[]),t.proxy(function(t,e){this._states.current[e]--},this))},r.prototype.register=function(e){if(e.type===r.Type.Event){if(t.event.special[e.name]||(t.event.special[e.name]={}),!t.event.special[e.name].owl){var i=t.event.special[e.name]._default;t.event.special[e.name]._default=function(t){return!i||!i.apply||t.namespace&&-1!==t.namespace.indexOf("owl")?t.namespace&&t.namespace.indexOf("owl")>-1:i.apply(this,arguments)},t.event.special[e.name].owl=!0}}else e.type===r.Type.State&&(this._states.tags[e.name]?this._states.tags[e.name]=this._states.tags[e.name].concat(e.tags):this._states.tags[e.name]=e.tags,this._states.tags[e.name]=t.grep(this._states.tags[e.name],t.proxy(function(i,n){return t.inArray(i,this._states.tags[e.name])===n},this)))},r.prototype.suppress=function(e){t.each(e,t.proxy(function(t,e){this._supress[e]=!0},this))},r.prototype.release=function(e){t.each(e,t.proxy(function(t,e){delete this._supress[e]},this))},r.prototype.pointer=function(t){var i={x:null,y:null};return t=t.originalEvent||t||e.event,(t=t.touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(i.x=t.pageX,i.y=t.pageY):(i.x=t.clientX,i.y=t.clientY),i},r.prototype.isNumeric=function(t){return!isNaN(parseFloat(t))},r.prototype.difference=function(t,e){return{x:t.x-e.x,y:t.y-e.y}},t.fn.owlCarousel=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=t(this),o=n.data("owl.carousel");o||(o=new r(this,"object"==typeof e&&e),n.data("owl.carousel",o),t.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(e,i){o.register({type:r.Type.Event,name:i}),o.$element.on(i+".owl.carousel.core",t.proxy(function(t){t.namespace&&t.relatedTarget!==this&&(this.suppress([i]),o[i].apply(this,[].slice.call(arguments,1)),this.release([i]))},o))})),"string"==typeof e&&"_"!==e.charAt(0)&&o[e].apply(o,i)})},t.fn.owlCarousel.Constructor=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){var r=function(e){this._core=e,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=t.extend({},r.Defaults,this._core.options),this._core.$element.on(this._handlers)};r.Defaults={autoRefresh:!0,autoRefreshInterval:500},r.prototype.watch=function(){this._interval||(this._visible=this._core.$element.is(":visible"),this._interval=e.setInterval(t.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},r.prototype.refresh=function(){this._core.$element.is(":visible")!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},r.prototype.destroy=function(){var t,i;e.clearInterval(this._interval);for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoRefresh=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){var r=function(e){this._core=e,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":t.proxy(function(e){if(e.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(e.property&&"position"==e.property.name||"initialized"==e.type))for(var i=this._core.settings,n=i.center&&Math.ceil(i.items/2)||i.items,r=i.center&&-1*n||0,o=(e.property&&void 0!==e.property.value?e.property.value:this._core.current())+r,a=this._core.clones().length,s=t.proxy(function(t,e){this.load(e)},this);r++<n;)this.load(a/2+this._core.relative(o)),a&&t.each(this._core.clones(this._core.relative(o)),s),o++},this)},this._core.options=t.extend({},r.Defaults,this._core.options),this._core.$element.on(this._handlers)};r.Defaults={lazyLoad:!1},r.prototype.load=function(i){var n=this._core.$stage.children().eq(i),r=n&&n.find(".owl-lazy");!r||t.inArray(n.get(0),this._loaded)>-1||(r.each(t.proxy(function(i,n){var r,o=t(n),a=e.devicePixelRatio>1&&o.attr("data-src-retina")||o.attr("data-src");this._core.trigger("load",{element:o,url:a},"lazy"),o.is("img")?o.one("load.owl.lazy",t.proxy(function(){o.css("opacity",1),this._core.trigger("loaded",{element:o,url:a},"lazy")},this)).attr("src",a):((r=new Image).onload=t.proxy(function(){o.css({"background-image":'url("'+a+'")',opacity:"1"}),this._core.trigger("loaded",{element:o,url:a},"lazy")},this),r.src=a)},this)),this._loaded.push(n.get(0)))},r.prototype.destroy=function(){var t,e;for(t in this.handlers)this._core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Lazy=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){var r=function(e){this._core=e,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&"position"==t.property.name&&this.update()},this),"loaded.owl.lazy":t.proxy(function(t){t.namespace&&this._core.settings.autoHeight&&t.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=t.extend({},r.Defaults,this._core.options),this._core.$element.on(this._handlers)};r.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},r.prototype.update=function(){var e=this._core._current,i=e+this._core.settings.items,n=this._core.$stage.children().toArray().slice(e,i),r=[],o=0;t.each(n,function(e,i){r.push(t(i).height())}),o=Math.max.apply(null,r),this._core.$stage.parent().height(o).addClass(this._core.settings.autoHeightClass)},r.prototype.destroy=function(){var t,e;for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.AutoHeight=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){var r=function(e){this._core=e,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.video&&this.isInFullScreen()&&t.preventDefault()},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"===t.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find(".owl-video");i.length&&(i.css("display","none"),this.fetch(i,t(e.content)))}},this)},this._core.options=t.extend({},r.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",t.proxy(function(t){this.play(t)},this))};r.Defaults={video:!1,videoHeight:!1,videoWidth:!1},r.prototype.fetch=function(t,e){var i=t.attr("data-vimeo-id")?"vimeo":t.attr("data-vzaar-id")?"vzaar":"youtube",n=t.attr("data-vimeo-id")||t.attr("data-youtube-id")||t.attr("data-vzaar-id"),r=t.attr("data-width")||this._core.settings.videoWidth,o=t.attr("data-height")||this._core.settings.videoHeight,a=t.attr("href");if(!a)throw new Error("Missing video URL.");if((n=a.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/))[3].indexOf("youtu")>-1)i="youtube";else if(n[3].indexOf("vimeo")>-1)i="vimeo";else{if(!(n[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");i="vzaar"}n=n[6],this._videos[a]={type:i,id:n,width:r,height:o},e.attr("data-video",a),this.thumbnail(t,this._videos[a])},r.prototype.thumbnail=function(e,i){var n,r,o,a=i.width&&i.height?'style="width:'+i.width+"px;height:"+i.height+'px;"':"",s=e.find("img"),l="src",c="",h=this._core.settings,u=function(t){r='<div class="owl-video-play-icon"></div>',n=h.lazyLoad?'<div class="owl-video-tn '+c+'" '+l+'="'+t+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+t+')"></div>',e.after(n),e.after(r)};if(e.wrap('<div class="owl-video-wrapper"'+a+"></div>"),this._core.settings.lazyLoad&&(l="data-src",c="owl-lazy"),s.length)return u(s.attr(l)),s.remove(),!1;"youtube"===i.type?(o="//img.youtube.com/vi/"+i.id+"/hqdefault.jpg",u(o)):"vimeo"===i.type?t.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){o=t[0].thumbnail_large,u(o)}}):"vzaar"===i.type&&t.ajax({type:"GET",url:"//vzaar.com/api/videos/"+i.id+".json",jsonp:"callback",dataType:"jsonp",success:function(t){o=t.framegrab_url,u(o)}})},r.prototype.stop=function(){this._core.trigger("stop",null,"video"),this._playing.find(".owl-video-frame").remove(),this._playing.removeClass("owl-video-playing"),this._playing=null,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},r.prototype.play=function(e){var i,n=t(e.target).closest("."+this._core.settings.itemClass),r=this._videos[n.attr("data-video")],o=r.width||"100%",a=r.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),n=this._core.items(this._core.relative(n.index())),this._core.reset(n.index()),"youtube"===r.type?i='<iframe width="'+o+'" height="'+a+'" src="//www.youtube.com/embed/'+r.id+"?autoplay=1&rel=0&v="+r.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===r.type?i='<iframe src="//player.vimeo.com/video/'+r.id+'?autoplay=1" width="'+o+'" height="'+a+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>':"vzaar"===r.type&&(i='<iframe frameborder="0"height="'+a+'"width="'+o+'" allowfullscreen mozallowfullscreen webkitAllowFullScreen src="//view.vzaar.com/'+r.id+'/player?autoplay=true"></iframe>'),t('<div class="owl-video-frame">'+i+"</div>").insertAfter(n.find(".owl-video")),this._playing=n.addClass("owl-video-playing"))},r.prototype.isInFullScreen=function(){var e=i.fullscreenElement||i.mozFullScreenElement||i.webkitFullscreenElement;return e&&t(e).parent().hasClass("owl-video-frame")},r.prototype.destroy=function(){var t,e;this._core.$element.off("click.owl.video");for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Video=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){var r=function(e){this.core=e,this.core.options=t.extend({},r.Defaults,this.core.options),this.swapping=!0,this.previous=void 0,this.next=void 0,this.handlers={"change.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&(this.previous=this.core.current(),this.next=t.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":t.proxy(function(t){t.namespace&&(this.swapping="translated"==t.type)},this),"translate.owl.carousel":t.proxy(function(t){t.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};r.Defaults={animateOut:!1,animateIn:!1},r.prototype.swap=function(){if(1===this.core.settings.items&&t.support.animation&&t.support.transition){this.core.speed(0);var e,i=t.proxy(this.clear,this),n=this.core.$stage.children().eq(this.previous),r=this.core.$stage.children().eq(this.next),o=this.core.settings.animateIn,a=this.core.settings.animateOut;this.core.current()!==this.previous&&(a&&(e=this.core.coordinates(this.previous)-this.core.coordinates(this.next),n.one(t.support.animation.end,i).css({left:e+"px"}).addClass("animated owl-animated-out").addClass(a)),o&&r.one(t.support.animation.end,i).addClass("animated owl-animated-in").addClass(o))}},r.prototype.clear=function(e){t(e.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},r.prototype.destroy=function(){var t,e;for(t in this.handlers)this.core.$element.off(t,this.handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.Animate=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){var r=function(e){this._core=e,this._timeout=null,this._paused=!1,this._handlers={"changed.owl.carousel":t.proxy(function(t){t.namespace&&"settings"===t.property.name?this._core.settings.autoplay?this.play():this.stop():t.namespace&&"position"===t.property.name&&this._core.settings.autoplay&&this._setAutoPlayInterval()},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":t.proxy(function(t,e,i){t.namespace&&this.play(e,i)},this),"stop.owl.autoplay":t.proxy(function(t){t.namespace&&this.stop()},this),"mouseover.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":t.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=t.extend({},r.Defaults,this._core.options)};r.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},r.prototype.play=function(t,e){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._setAutoPlayInterval())},r.prototype._getNextTimeout=function(n,r){return this._timeout&&e.clearTimeout(this._timeout),e.setTimeout(t.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||i.hidden||this._core.next(r||this._core.settings.autoplaySpeed)},this),n||this._core.settings.autoplayTimeout)},r.prototype._setAutoPlayInterval=function(){this._timeout=this._getNextTimeout()},r.prototype.stop=function(){this._core.is("rotating")&&(e.clearTimeout(this._timeout),this._core.leave("rotating"))},r.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},r.prototype.destroy=function(){var t,e;this.stop();for(t in this._handlers)this._core.$element.off(t,this._handlers[t]);for(e in Object.getOwnPropertyNames(this))"function"!=typeof this[e]&&(this[e]=null)},t.fn.owlCarousel.Constructor.Plugins.autoplay=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){"use strict";var r=function(e){this._core=e,this._initialized=!1,this._pages=[],this._controls={},this._templates=[],this.$element=this._core.$element,this._overrides={next:this._core.next,prev:this._core.prev,to:this._core.to},this._handlers={"prepared.owl.carousel":t.proxy(function(e){e.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+t(e.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,0,this._templates.pop())},this),"remove.owl.carousel":t.proxy(function(t){t.namespace&&this._core.settings.dotsData&&this._templates.splice(t.position,1)},this),"changed.owl.carousel":t.proxy(function(t){t.namespace&&"position"==t.property.name&&this.draw()},this),"initialized.owl.carousel":t.proxy(function(t){t.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":t.proxy(function(t){t.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=t.extend({},r.Defaults,this._core.options),this.$element.on(this._handlers)};r.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},r.prototype.initialize=function(){var e,i=this._core.settings;this._controls.$relative=(i.navContainer?t(i.navContainer):t("<div>").addClass(i.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=t("<"+i.navElement+">").addClass(i.navClass[0]).html(i.navText[0]).prependTo(this._controls.$relative).on("click",t.proxy(function(t){this.prev(i.navSpeed)},this)),this._controls.$next=t("<"+i.navElement+">").addClass(i.navClass[1]).html(i.navText[1]).appendTo(this._controls.$relative).on("click",t.proxy(function(t){this.next(i.navSpeed)},this)),i.dotsData||(this._templates=[t("<div>").addClass(i.dotClass).append(t("<span>")).prop("outerHTML")]),this._controls.$absolute=(i.dotsContainer?t(i.dotsContainer):t("<div>").addClass(i.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",t.proxy(function(e){var n=t(e.target).parent().is(this._controls.$absolute)?t(e.target).index():t(e.target).parent().index();e.preventDefault(),this.to(n,i.dotsSpeed)},this));for(e in this._overrides)this._core[e]=t.proxy(this[e],this)},r.prototype.destroy=function(){var t,e,i,n;for(t in this._handlers)this.$element.off(t,this._handlers[t]);for(e in this._controls)this._controls[e].remove();for(n in this.overides)this._core[n]=this._overrides[n];for(i in Object.getOwnPropertyNames(this))"function"!=typeof this[i]&&(this[i]=null)},r.prototype.update=function(){var t,e,i=this._core.clones().length/2,n=i+this._core.items().length,r=this._core.maximum(!0),o=this._core.settings,a=o.center||o.autoWidth||o.dotsData?1:o.dotsEach||o.items;if("page"!==o.slideBy&&(o.slideBy=Math.min(o.slideBy,o.items)),o.dots||"page"==o.slideBy)for(this._pages=[],t=i,e=0,0;t<n;t++){if(e>=a||0===e){if(this._pages.push({start:Math.min(r,t-i),end:t-i+a-1}),Math.min(r,t-i)===r)break;e=0,0}e+=this._core.mergers(this._core.relative(t))}},r.prototype.draw=function(){var e,i=this._core.settings,n=this._core.items().length<=i.items,r=this._core.relative(this._core.current()),o=i.loop||i.rewind;this._controls.$relative.toggleClass("disabled",!i.nav||n),i.nav&&(this._controls.$previous.toggleClass("disabled",!o&&r<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!o&&r>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!i.dots||n),i.dots&&(e=this._pages.length-this._controls.$absolute.children().length,i.dotsData&&0!==e?this._controls.$absolute.html(this._templates.join("")):e>0?this._controls.$absolute.append(new Array(e+1).join(this._templates[0])):e<0&&this._controls.$absolute.children().slice(e).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(t.inArray(this.current(),this._pages)).addClass("active"))},r.prototype.onTrigger=function(e){var i=this._core.settings;e.page={index:t.inArray(this.current(),this._pages),count:this._pages.length,size:i&&(i.center||i.autoWidth||i.dotsData?1:i.dotsEach||i.items)}},r.prototype.current=function(){var e=this._core.relative(this._core.current());return t.grep(this._pages,t.proxy(function(t,i){return t.start<=e&&t.end>=e},this)).pop()},r.prototype.getPosition=function(e){var i,n,r=this._core.settings;return"page"==r.slideBy?(i=t.inArray(this.current(),this._pages),n=this._pages.length,e?++i:--i,i=this._pages[(i%n+n)%n].start):(i=this._core.relative(this._core.current()),n=this._core.items().length,e?i+=r.slideBy:i-=r.slideBy),i},r.prototype.next=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!0),e)},r.prototype.prev=function(e){t.proxy(this._overrides.to,this._core)(this.getPosition(!1),e)},r.prototype.to=function(e,i,n){var r;!n&&this._pages.length?(r=this._pages.length,t.proxy(this._overrides.to,this._core)(this._pages[(e%r+r)%r].start,i)):t.proxy(this._overrides.to,this._core)(e,i)},t.fn.owlCarousel.Constructor.Plugins.Navigation=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){"use strict";var r=function(i){this._core=i,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":t.proxy(function(i){i.namespace&&"URLHash"===this._core.settings.startPosition&&t(e).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":t.proxy(function(e){if(e.namespace){var i=t(e.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!i)return;this._hashes[i]=e.content}},this),"changed.owl.carousel":t.proxy(function(i){if(i.namespace&&"position"===i.property.name){var n=this._core.items(this._core.relative(this._core.current())),r=t.map(this._hashes,function(t,e){return t===n?e:null}).join();if(!r||e.location.hash.slice(1)===r)return;e.location.hash=r}},this)},this._core.options=t.extend({},r.Defaults,this._core.options),this.$element.on(this._handlers),t(e).on("hashchange.owl.navigation",t.proxy(function(t){var i=e.location.hash.substring(1),n=this._core.$stage.children(),r=this._hashes[i]&&n.index(this._hashes[i]);void 0!==r&&r!==this._core.current()&&this._core.to(this._core.relative(r),!1,!0)},this))};r.Defaults={URLhashListener:!1},r.prototype.destroy=function(){var i,n;t(e).off("hashchange.owl.navigation");for(i in this._handlers)this._core.$element.off(i,this._handlers[i]);for(n in Object.getOwnPropertyNames(this))"function"!=typeof this[n]&&(this[n]=null)},t.fn.owlCarousel.Constructor.Plugins.Hash=r}(window.Zepto||window.jQuery,window,document),function(t,e,i,n){function r(e,i){var r=!1,o=e.charAt(0).toUpperCase()+e.slice(1);return t.each((e+" "+s.join(o+" ")+o).split(" "),function(t,e){if(a[e]!==n)return r=!i||e,!1}),r}function o(t){return r(t,!0)}var a=t("<support>").get(0).style,s="Webkit Moz O ms".split(" "),l={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},c={csstransforms:function(){return!!r("transform")},csstransforms3d:function(){return!!r("perspective")},csstransitions:function(){return!!r("transition")},cssanimations:function(){return!!r("animation")}};c.csstransitions()&&(t.support.transition=new String(o("transition")),t.support.transition.end=l.transition.end[t.support.transition]),c.cssanimations()&&(t.support.animation=new String(o("animation")),t.support.animation.end=l.animation.end[t.support.animation]),c.csstransforms()&&(t.support.transform=new String(o("transform")),t.support.transform3d=c.csstransforms3d())}(window.Zepto||window.jQuery,window,document),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Raphael=e():t.Raphael=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){var n;void 0!==(n=function(t){return t}.apply(e,[i(1),i(3),i(4)]))&&(t.exports=n)},function(t,e,i){var n;void 0!==(n=function(t){function e(i){if(e.is(i,"function"))return b?i():t.on("raphael.DOMload",i);if(e.is(i,U))return e._engine.create[D](e,i.splice(0,3+e.is(i[0],j))).add(i);var n=Array.prototype.slice.call(arguments,0);if(e.is(n[n.length-1],"function")){var r=n.pop();return b?r.call(e._engine.create[D](e,n)):t.on("raphael.DOMload",function(){r.call(e._engine.create[D](e,n))})}return e._engine.create[D](e,arguments)}function i(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var n in t)t[C](n)&&(e[n]=i(t[n]));return e}function n(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return t.push(t.splice(i,1)[0])}function r(t,e,i){function r(){var o=Array.prototype.slice.call(arguments,0),a=o.join("␀"),s=r.cache=r.cache||{},l=r.count=r.count||[];return s[C](a)?(n(l,a),i?i(s[a]):s[a]):(l.length>=1e3&&delete s[l.shift()],l.push(a),s[a]=t[D](e,o),i?i(s[a]):s[a])}return r}function o(){return this.hex}function a(t,e){for(var i=[],n=0,r=t.length;r-2*!e>n;n+=2){var o=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?r-4==n?o[3]={x:+t[0],y:+t[1]}:r-2==n&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[r-2],y:+t[r-1]}:r-4==n?o[3]=o[2]:n||(o[0]={x:+t[n],y:+t[n+1]}),i.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return i}function s(t,e,i,n,r){return t*(t*(-3*e+9*i-9*n+3*r)+6*e-12*i+6*n)-3*e+3*i}function l(t,e,i,n,r,o,a,l,c){null==c&&(c=1);for(var h=(c=c>1?1:c<0?0:c)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,p=0;p<12;p++){var g=h*u[p]+h,m=s(g,t,i,r,a),v=s(g,e,n,o,l),y=m*m+v*v;f+=d[p]*z.sqrt(y)}return h*f}function c(t,e,i,n,r,o,a,s,c){if(!(c<0||l(t,e,i,n,r,o,a,s)<c)){var h,u=.5,d=1-u;for(h=l(t,e,i,n,r,o,a,s,d);V(h-c)>.01;)u/=2,h=l(t,e,i,n,r,o,a,s,d+=(h<c?1:-1)*u);return d}}function h(t,e,i,n,r,o,a,s){if(!(H(t,i)<$(r,a)||$(t,i)>H(r,a)||H(e,n)<$(o,s)||$(e,n)>H(o,s))){var l=(t*n-e*i)*(r-a)-(t-i)*(r*s-o*a),c=(t*n-e*i)*(o-s)-(e-n)*(r*s-o*a),h=(t-i)*(o-s)-(e-n)*(r-a);if(h){var u=l/h,d=c/h,f=+u.toFixed(2),p=+d.toFixed(2);if(!(f<+$(t,i).toFixed(2)||f>+H(t,i).toFixed(2)||f<+$(r,a).toFixed(2)||f>+H(r,a).toFixed(2)||p<+$(e,n).toFixed(2)||p>+H(e,n).toFixed(2)||p<+$(o,s).toFixed(2)||p>+H(o,s).toFixed(2)))return{x:u,y:d}}}}function u(t,i,n){var r=e.bezierBBox(t),o=e.bezierBBox(i);if(!e.isBBoxIntersect(r,o))return n?0:[];for(var a=l.apply(0,t),s=l.apply(0,i),c=H(~~(a/5),1),u=H(~~(s/5),1),d=[],f=[],p={},g=n?0:[],m=0;m<c+1;m++){var v=e.findDotsAtSegment.apply(e,t.concat(m/c));d.push({x:v.x,y:v.y,t:m/c})}for(m=0;m<u+1;m++)v=e.findDotsAtSegment.apply(e,i.concat(m/u)),f.push({x:v.x,y:v.y,t:m/u});for(m=0;m<c;m++)for(var y=0;y<u;y++){var b=d[m],x=d[m+1],_=f[y],w=f[y+1],S=V(x.x-b.x)<.001?"y":"x",C=V(w.x-_.x)<.001?"y":"x",k=h(b.x,b.y,x.x,x.y,_.x,_.y,w.x,w.y);if(k){if(p[k.x.toFixed(4)]==k.y.toFixed(4))continue;p[k.x.toFixed(4)]=k.y.toFixed(4);var T=b.t+V((k[S]-b[S])/(x[S]-b[S]))*(x.t-b.t),A=_.t+V((k[C]-_[C])/(w[C]-_[C]))*(w.t-_.t);T>=0&&T<=1.001&&A>=0&&A<=1.001&&(n?g++:g.push({x:k.x,y:k.y,t1:$(T,1),t2:$(A,1)}))}}return g}function d(t,i,n){t=e._path2curve(t),i=e._path2curve(i);for(var r,o,a,s,l,c,h,d,f,p,g=n?0:[],m=0,v=t.length;m<v;m++){var y=t[m];if("M"==y[0])r=l=y[1],o=c=y[2];else{"C"==y[0]?(r=(f=[r,o].concat(y.slice(1)))[6],o=f[7]):(f=[r,o,r,o,l,c,l,c],r=l,o=c);for(var b=0,x=i.length;b<x;b++){var _=i[b];if("M"==_[0])a=h=_[1],s=d=_[2];else{"C"==_[0]?(a=(p=[a,s].concat(_.slice(1)))[6],s=p[7]):(p=[a,s,a,s,h,d,h,d],a=h,s=d);var w=u(f,p,n);if(n)g+=w;else{for(var S=0,C=w.length;S<C;S++)w[S].segment1=m,w[S].segment2=b,w[S].bez1=f,w[S].bez2=p;g=g.concat(w)}}}}}return g}function f(t,e,i,n,r,o){null!=t?(this.a=+t,this.b=+e,this.c=+i,this.d=+n,this.e=+r,this.f=+o):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function p(){return this.x+L+this.y+L+this.width+" × "+this.height}function g(t,e,i,n,r,o){function a(t){return((h*t+c)*t+l)*t}function s(t,e){var i,n,r,o,s,u;for(r=t,u=0;u<8;u++){if(o=a(r)-t,V(o)<e)return r;if(s=(3*h*r+2*c)*r+l,V(s)<1e-6)break;r-=o/s}if(i=0,n=1,(r=t)<i)return i;if(r>n)return n;for(;i<n;){if(o=a(r),V(o-t)<e)return r;t>o?i=r:n=r,r=(n-i)/2+i}return r}var l=3*e,c=3*(n-e)-l,h=1-l-c,u=3*i,d=3*(r-i)-u,f=1-u-d;return function(t,e){var i=s(t,e);return((f*i+d)*i+u)*i}(t,1/(200*o))}function m(t,e){var i=[],n={};if(this.ms=e,this.times=1,t){for(var r in t)t[C](r)&&(n[Z(r)]=t[r],i.push(Z(r)));i.sort(ct)}this.anim=n,this.top=i[i.length-1],this.percents=i}function v(i,n,r,o,a,s){r=Z(r);var l,c,h,u,d,p,m=i.ms,v={},y={},b={};if(o)for(w=0,S=re.length;w<S;w++){var x=re[w];if(x.el.id==n.id&&x.anim==i){x.percent!=r?(re.splice(w,1),h=1):c=x,n.attr(x.totalOrigin);break}}else o=+y;for(var w=0,S=i.percents.length;w<S;w++){if(i.percents[w]==r||i.percents[w]>o*i.top){r=i.percents[w],d=i.percents[w-1]||0,m=m/i.top*(r-d),u=i.percents[w+1],l=i.anim[r];break}o&&n.attr(i.anim[i.percents[w]])}if(l){if(c)c.initstatus=o,c.start=new Date-c.ms*o;else{for(var k in l)if(l[C](k)&&(et[C](k)||n.paper.customAttributes[C](k)))switch(v[k]=n.attr(k),null==v[k]&&(v[k]=tt[k]),y[k]=l[k],et[k]){case j:b[k]=(y[k]-v[k])/m;break;case"colour":v[k]=e.getRGB(v[k]);var T=e.getRGB(y[k]);b[k]={r:(T.r-v[k].r)/m,g:(T.g-v[k].g)/m,b:(T.b-v[k].b)/m};break;case"path":var A=It(v[k],y[k]),D=A[1];for(v[k]=A[0],b[k]=[],w=0,S=v[k].length;w<S;w++){b[k][w]=[0];for(var E=1,P=v[k][w].length;E<P;E++)b[k][w][E]=(D[w][E]-v[k][w][E])/m}break;case"transform":var L=n._,R=zt(L[k],y[k]);if(R)for(v[k]=R.from,y[k]=R.to,b[k]=[],b[k].real=!0,w=0,S=v[k].length;w<S;w++)for(b[k][w]=[v[k][w][0]],E=1,P=v[k][w].length;E<P;E++)b[k][w][E]=(y[k][w][E]-v[k][w][E])/m;else{var N=n.matrix||new f,F={_:{transform:L.transform},getBBox:function(){return n.getBBox(1)}};v[k]=[N.a,N.b,N.c,N.d,N.e,N.f],Nt(F,y[k]),y[k]=F._.transform,b[k]=[(F.matrix.a-N.a)/m,(F.matrix.b-N.b)/m,(F.matrix.c-N.c)/m,(F.matrix.d-N.d)/m,(F.matrix.e-N.e)/m,(F.matrix.f-N.f)/m]}break;case"csv":var z=I(l[k])[O](_),H=I(v[k])[O](_);if("clip-rect"==k)for(v[k]=H,b[k]=[],w=H.length;w--;)b[k][w]=(z[w]-v[k][w])/m;y[k]=z;break;default:for(z=[][M](l[k]),H=[][M](v[k]),b[k]=[],w=n.paper.customAttributes[k].length;w--;)b[k][w]=((z[w]||0)-(H[w]||0))/m}var $=l.easing,V=e.easing_formulas[$];if(!V)if((V=I($).match(X))&&5==V.length){var B=V;V=function(t){return g(t,+B[1],+B[2],+B[3],+B[4],m)}}else V=ht;if(p=l.start||i.start||+new Date,x={anim:i,percent:r,timestamp:p,start:p+(i.del||0),status:0,initstatus:o||0,stop:!1,ms:m,easing:V,from:v,diff:b,to:y,el:n,callback:l.callback,prev:d,next:u,repeat:s||i.times,origin:n.attr(),totalOrigin:a},re.push(x),o&&!c&&!h&&(x.stop=!0,x.start=new Date-m*o,1==re.length))return ae();h&&(x.start=new Date-x.ms*o),1==re.length&&oe(ae)}t("raphael.anim.start."+n.id,n,i)}}function y(t){for(var e=0;e<re.length;e++)re[e].el.paper==t&&re.splice(e--,1)}e.version="2.2.0",e.eve=t;var b,x,_=/[, ]+/,w={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},S=/\{(\d+)\}/g,C="hasOwnProperty",k={doc:document,win:window},T={was:Object.prototype[C].call(k.win,"Raphael"),is:k.win.Raphael},A=function(){this.ca=this.customAttributes={}},D="apply",M="concat",E="ontouchstart"in k.win||k.win.DocumentTouch&&k.doc instanceof DocumentTouch,P="",L=" ",I=String,O="split",R="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[O](L),N={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},F=I.prototype.toLowerCase,z=Math,H=z.max,$=z.min,V=z.abs,B=z.pow,W=z.PI,j="number",U="array",Y=Object.prototype.toString,G=(e._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),q={NaN:1,Infinity:1,"-Infinity":1},X=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,K=z.round,Z=parseFloat,Q=parseInt,J=I.prototype.toUpperCase,tt=e._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},et=e._availableAnimAttrs={blur:j,"clip-rect":"csv",cx:j,cy:j,fill:"colour","fill-opacity":j,"font-size":j,height:j,opacity:j,path:"path",r:j,rx:j,ry:j,stroke:"colour","stroke-opacity":j,"stroke-width":j,transform:"transform",width:j,x:j,y:j},it=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,nt={hs:1,rg:1},rt=/,?([achlmqrstvxz]),?/gi,ot=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,at=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,st=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,lt=(e._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),ct=function(t,e){return Z(t)-Z(e)},ht=function(t){return t},ut=e._rectPath=function(t,e,i,n,r){return r?[["M",t+r,e],["l",i-2*r,0],["a",r,r,0,0,1,r,r],["l",0,n-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-i,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-n],["a",r,r,0,0,1,r,-r],["z"]]:[["M",t,e],["l",i,0],["l",0,n],["l",-i,0],["z"]]},dt=function(t,e,i,n){return null==n&&(n=i),[["M",t,e],["m",0,-n],["a",i,n,0,1,1,0,2*n],["a",i,n,0,1,1,0,-2*n],["z"]]},ft=e._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return dt(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return dt(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return ut(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return ut(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return ut(e.x,e.y,e.width,e.height)},set:function(t){var e=t._getBBox();return ut(e.x,e.y,e.width,e.height)}},pt=e.mapPath=function(t,e){if(!e)return t;var i,n,r,o,a,s,l;for(r=0,a=(t=It(t)).length;r<a;r++)for(o=1,s=(l=t[r]).length;o<s;o+=2)i=e.x(l[o],l[o+1]),n=e.y(l[o],l[o+1]),l[o]=i,l[o+1]=n;return t};if(e._g=k,e.type=k.win.SVGAngle||k.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==e.type){var gt,mt=k.doc.createElement("div");if(mt.innerHTML='<v:shape adj="1"/>',gt=mt.firstChild,gt.style.behavior="url(#default#VML)",!gt||"object"!=typeof gt.adj)return e.type=P;mt=null}e.svg=!(e.vml="VML"==e.type),e._Paper=A,e.fn=x=A.prototype=e.prototype,e._id=0,e.is=function(t,e){return"finite"==(e=F.call(e))?!q[C](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||Y.call(t).slice(8,-1).toLowerCase()==e},e.angle=function(t,i,n,r,o,a){if(null==o){var s=t-n,l=i-r;return s||l?(180+180*z.atan2(-l,-s)/W+360)%360:0}return e.angle(t,i,o,a)-e.angle(n,r,o,a)},e.rad=function(t){return t%360*W/180},e.deg=function(t){return Math.round(180*t/W%360*1e3)/1e3},e.snapTo=function(t,i,n){if(n=e.is(n,"finite")?n:10,e.is(t,U)){for(var r=t.length;r--;)if(V(t[r]-i)<=n)return t[r]}else{var o=i%(t=+t);if(o<n)return i-o;if(o>t-n)return i-o+t}return i};e.createUUID=function(t,e){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(t,e).toUpperCase()}}(/[xy]/g,function(t){var e=16*z.random()|0;return("x"==t?e:3&e|8).toString(16)});e.setWindow=function(i){t("raphael.setWindow",e,k.win,i),k.win=i,k.doc=k.win.document,e._engine.initWin&&e._engine.initWin(k.win)};var vt=function(t){if(e.vml){var i,n=/^\s+|\s+$/g;try{var o=new ActiveXObject("htmlfile");o.write("<body>"),o.close(),i=o.body}catch(t){i=createPopup().document.body}var a=i.createTextRange();vt=r(function(t){try{i.style.color=I(t).replace(n,P);var e=a.queryCommandValue("ForeColor");return"#"+("000000"+(e=(255&e)<<16|65280&e|(16711680&e)>>>16).toString(16)).slice(-6)}catch(t){return"none"}})}else{var s=k.doc.createElement("i");s.title="Raphaël Colour Picker",s.style.display="none",k.doc.body.appendChild(s),vt=r(function(t){return s.style.color=t,k.doc.defaultView.getComputedStyle(s,P).getPropertyValue("color")})}return vt(t)},yt=function(){return"hsb("+[this.h,this.s,this.b]+")"},bt=function(){return"hsl("+[this.h,this.s,this.l]+")"},xt=function(){return this.hex},_t=function(t,i,n){if(null==i&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(n=t.b,i=t.g,t=t.r),null==i&&e.is(t,"string")){var r=e.getRGB(t);t=r.r,i=r.g,n=r.b}return(t>1||i>1||n>1)&&(t/=255,i/=255,n/=255),[t,i,n]},wt=function(t,i,n,r){var o={r:t*=255,g:i*=255,b:n*=255,hex:e.rgb(t,i,n),toString:xt};return e.is(r,"finite")&&(o.opacity=r),o};e.color=function(t){var i;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(i=e.hsb2rgb(t),t.r=i.r,t.g=i.g,t.b=i.b,t.hex=i.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(i=e.hsl2rgb(t),t.r=i.r,t.g=i.g,t.b=i.b,t.hex=i.hex):(e.is(t,"string")&&(t=e.getRGB(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(i=e.rgb2hsl(t),t.h=i.h,t.s=i.s,t.l=i.l,i=e.rgb2hsb(t),t.v=i.b):(t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1),t.toString=xt,t},e.hsb2rgb=function(t,e,i,n){this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(i=t.b,e=t.s,n=t.o,t=t.h);var r,o,a,s,l;return t=(t*=360)%360/60,l=i*e,s=l*(1-V(t%2-1)),r=o=a=i-l,t=~~t,r+=[l,s,0,0,s,l][t],o+=[s,l,l,s,0,0][t],a+=[0,0,s,l,l,s][t],wt(r,o,a,n)},e.hsl2rgb=function(t,e,i,n){this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(i=t.l,e=t.s,t=t.h),(t>1||e>1||i>1)&&(t/=360,e/=100,i/=100);var r,o,a,s,l;return t=(t*=360)%360/60,l=2*e*(i<.5?i:1-i),s=l*(1-V(t%2-1)),r=o=a=i-l/2,t=~~t,r+=[l,s,0,0,s,l][t],o+=[s,l,l,s,0,0][t],a+=[0,0,s,l,l,s][t],wt(r,o,a,n)},e.rgb2hsb=function(t,e,i){t=(i=_t(t,e,i))[0],e=i[1],i=i[2];var n,r,o,a;return o=H(t,e,i),a=o-$(t,e,i),n=0==a?null:o==t?(e-i)/a:o==e?(i-t)/a+2:(t-e)/a+4,n=(n+360)%6*60/360,r=0==a?0:a/o,{h:n,s:r,b:o,toString:yt}},e.rgb2hsl=function(t,e,i){t=(i=_t(t,e,i))[0],e=i[1],i=i[2];var n,r,o,a,s,l;return a=H(t,e,i),s=$(t,e,i),l=a-s,n=0==l?null:a==t?(e-i)/l:a==e?(i-t)/l+2:(t-e)/l+4,n=(n+360)%6*60/360,o=(a+s)/2,r=0==l?0:o<.5?l/(2*o):l/(2-2*o),{h:n,s:r,l:o,toString:bt}},e._path2string=function(){return this.join(",").replace(rt,"$1")};e._preload=function(t,e){var i=k.doc.createElement("img");i.style.cssText="position:absolute;left:-9999em;top:-9999em",i.onload=function(){e.call(this),this.onload=null,k.doc.body.removeChild(this)},i.onerror=function(){k.doc.body.removeChild(this)},k.doc.body.appendChild(i),i.src=t};e.getRGB=r(function(t){if(!t||(t=I(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:o};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:o};!(nt[C](t.toLowerCase().substring(0,2))||"#"==t.charAt())&&(t=vt(t));var i,n,r,a,s,l,c=t.match(G);return c?(c[2]&&(r=Q(c[2].substring(5),16),n=Q(c[2].substring(3,5),16),i=Q(c[2].substring(1,3),16)),c[3]&&(r=Q((s=c[3].charAt(3))+s,16),n=Q((s=c[3].charAt(2))+s,16),i=Q((s=c[3].charAt(1))+s,16)),c[4]&&(l=c[4][O](it),i=Z(l[0]),"%"==l[0].slice(-1)&&(i*=2.55),n=Z(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),r=Z(l[2]),"%"==l[2].slice(-1)&&(r*=2.55),"rgba"==c[1].toLowerCase().slice(0,4)&&(a=Z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100)),c[5]?(l=c[5][O](it),i=Z(l[0]),"%"==l[0].slice(-1)&&(i*=2.55),n=Z(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),r=Z(l[2]),"%"==l[2].slice(-1)&&(r*=2.55),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(i/=360),"hsba"==c[1].toLowerCase().slice(0,4)&&(a=Z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),e.hsb2rgb(i,n,r,a)):c[6]?(l=c[6][O](it),i=Z(l[0]),"%"==l[0].slice(-1)&&(i*=2.55),n=Z(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),r=Z(l[2]),"%"==l[2].slice(-1)&&(r*=2.55),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(i/=360),"hsla"==c[1].toLowerCase().slice(0,4)&&(a=Z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),e.hsl2rgb(i,n,r,a)):(c={r:i,g:n,b:r,toString:o},c.hex="#"+(16777216|r|n<<8|i<<16).toString(16).slice(1),e.is(a,"finite")&&(c.opacity=a),c)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:o}},e),e.hsb=r(function(t,i,n){return e.hsb2rgb(t,i,n).hex}),e.hsl=r(function(t,i,n){return e.hsl2rgb(t,i,n).hex}),e.rgb=r(function(t,e,i){function n(t){return t+.5|0}return"#"+(16777216|n(i)|n(e)<<8|n(t)<<16).toString(16).slice(1)}),e.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},i=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),i.hex},e.getColor.reset=function(){delete this.start},e.parsePathString=function(t){if(!t)return null;var i=St(t);if(i.arr)return kt(i.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[];return e.is(t,U)&&e.is(t[0],U)&&(r=kt(t)),r.length||I(t).replace(ot,function(t,e,i){var o=[],a=e.toLowerCase();if(i.replace(st,function(t,e){e&&o.push(+e)}),"m"==a&&o.length>2&&(r.push([e][M](o.splice(0,2))),a="l",e="m"==e?"l":"L"),"r"==a)r.push([e][M](o));else for(;o.length>=n[a]&&(r.push([e][M](o.splice(0,n[a]))),n[a]););}),r.toString=e._path2string,i.arr=kt(r),r},e.parseTransformString=r(function(t){if(!t)return null;var i=[];return e.is(t,U)&&e.is(t[0],U)&&(i=kt(t)),i.length||I(t).replace(at,function(t,e,n){var r=[];F.call(e);n.replace(st,function(t,e){e&&r.push(+e)}),i.push([e][M](r))}),i.toString=e._path2string,i});var St=function(t){var e=St.ps=St.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var i in e)e[C](i)&&i!=t&&(e[i].sleep--,!e[i].sleep&&delete e[i])}),e[t]};e.findDotsAtSegment=function(t,e,i,n,r,o,a,s,l){var c=1-l,h=B(c,3),u=B(c,2),d=l*l,f=d*l,p=h*t+3*u*l*i+3*c*l*l*r+f*a,g=h*e+3*u*l*n+3*c*l*l*o+f*s,m=t+2*l*(i-t)+d*(r-2*i+t),v=e+2*l*(n-e)+d*(o-2*n+e),y=i+2*l*(r-i)+d*(a-2*r+i),b=n+2*l*(o-n)+d*(s-2*o+n),x=c*t+l*i,_=c*e+l*n,w=c*r+l*a,S=c*o+l*s,C=90-180*z.atan2(m-y,v-b)/W;return(m>y||v<b)&&(C+=180),{x:p,y:g,m:{x:m,y:v},n:{x:y,y:b},start:{x:x,y:_},end:{x:w,y:S},alpha:C}},e.bezierBBox=function(t,i,n,r,o,a,s,l){e.is(t,"array")||(t=[t,i,n,r,o,a,s,l]);var c=Lt.apply(null,t);return{x:c.min.x,y:c.min.y,x2:c.max.x,y2:c.max.y,width:c.max.x-c.min.x,height:c.max.y-c.min.y}},e.isPointInsideBBox=function(t,e,i){return e>=t.x&&e<=t.x2&&i>=t.y&&i<=t.y2},e.isBBoxIntersect=function(t,i){var n=e.isPointInsideBBox;return n(i,t.x,t.y)||n(i,t.x2,t.y)||n(i,t.x,t.y2)||n(i,t.x2,t.y2)||n(t,i.x,i.y)||n(t,i.x2,i.y)||n(t,i.x,i.y2)||n(t,i.x2,i.y2)||(t.x<i.x2&&t.x>i.x||i.x<t.x2&&i.x>t.x)&&(t.y<i.y2&&t.y>i.y||i.y<t.y2&&i.y>t.y)},e.pathIntersection=function(t,e){return d(t,e)},e.pathIntersectionNumber=function(t,e){return d(t,e,1)},e.isPointInsidePath=function(t,i,n){var r=e.pathBBox(t);return e.isPointInsideBBox(r,i,n)&&d(t,[["M",i,n],["H",r.x2+10]],1)%2==1},e._removedFactory=function(e){return function(){t("raphael.log",null,"Raphaël: you are calling to method “"+e+"” of removed object",e)}};var Ct=e.pathBBox=function(t){var e=St(t);if(e.bbox)return i(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var n,r=0,o=0,a=[],s=[],l=0,c=(t=It(t)).length;l<c;l++)if("M"==(n=t[l])[0])r=n[1],o=n[2],a.push(r),s.push(o);else{var h=Lt(r,o,n[1],n[2],n[3],n[4],n[5],n[6]);a=a[M](h.min.x,h.max.x),s=s[M](h.min.y,h.max.y),r=n[5],o=n[6]}var u=$[D](0,a),d=$[D](0,s),f=H[D](0,a),p=H[D](0,s),g=f-u,m=p-d,v={x:u,y:d,x2:f,y2:p,width:g,height:m,cx:u+g/2,cy:d+m/2};return e.bbox=i(v),v},kt=function(t){var n=i(t);return n.toString=e._path2string,n},Tt=e._pathToRelative=function(t){var i=St(t);if(i.rel)return kt(i.rel);e.is(t,U)&&e.is(t&&t[0],U)||(t=e.parsePathString(t));var n=[],r=0,o=0,a=0,s=0,l=0;"M"==t[0][0]&&(a=r=t[0][1],s=o=t[0][2],l++,n.push(["M",r,o]));for(var c=l,h=t.length;c<h;c++){var u=n[c]=[],d=t[c];if(d[0]!=F.call(d[0]))switch(u[0]=F.call(d[0]),u[0]){case"a":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+(d[6]-r).toFixed(3),u[7]=+(d[7]-o).toFixed(3);break;case"v":u[1]=+(d[1]-o).toFixed(3);break;case"m":a=d[1],s=d[2];default:for(var f=1,p=d.length;f<p;f++)u[f]=+(d[f]-(f%2?r:o)).toFixed(3)}else{u=n[c]=[],"m"==d[0]&&(a=d[1]+r,s=d[2]+o);for(var g=0,m=d.length;g<m;g++)n[c][g]=d[g]}var v=n[c].length;switch(n[c][0]){case"z":r=a,o=s;break;case"h":r+=+n[c][v-1];break;case"v":o+=+n[c][v-1];break;default:r+=+n[c][v-2],o+=+n[c][v-1]}}return n.toString=e._path2string,i.rel=kt(n),n},At=e._pathToAbsolute=function(t){var i=St(t);if(i.abs)return kt(i.abs);if(e.is(t,U)&&e.is(t&&t[0],U)||(t=e.parsePathString(t)),!t||!t.length)return[["M",0,0]];var n=[],r=0,o=0,s=0,l=0,c=0;"M"==t[0][0]&&(s=r=+t[0][1],l=o=+t[0][2],c++,n[0]=["M",r,o]);for(var h,u,d=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),f=c,p=t.length;f<p;f++){if(n.push(h=[]),(u=t[f])[0]!=J.call(u[0]))switch(h[0]=J.call(u[0]),h[0]){case"A":h[1]=u[1],h[2]=u[2],h[3]=u[3],h[4]=u[4],h[5]=u[5],h[6]=+(u[6]+r),h[7]=+(u[7]+o);break;case"V":h[1]=+u[1]+o;break;case"H":h[1]=+u[1]+r;break;case"R":for(var g=[r,o][M](u.slice(1)),m=2,v=g.length;m<v;m++)g[m]=+g[m]+r,g[++m]=+g[m]+o;n.pop(),n=n[M](a(g,d));break;case"M":s=+u[1]+r,l=+u[2]+o;default:for(m=1,v=u.length;m<v;m++)h[m]=+u[m]+(m%2?r:o)}else if("R"==u[0])g=[r,o][M](u.slice(1)),n.pop(),n=n[M](a(g,d)),h=["R"][M](u.slice(-2));else for(var y=0,b=u.length;y<b;y++)h[y]=u[y];switch(h[0]){case"Z":r=s,o=l;break;case"H":r=h[1];break;case"V":o=h[1];break;case"M":s=h[h.length-2],l=h[h.length-1];default:r=h[h.length-2],o=h[h.length-1]}}return n.toString=e._path2string,i.abs=kt(n),n},Dt=function(t,e,i,n){return[t,e,i,n,i,n]},Mt=function(t,e,i,n,r,o){return[1/3*t+2/3*i,1/3*e+2/3*n,1/3*r+2/3*i,1/3*o+2/3*n,r,o]},Et=function(t,e,i,n,o,a,s,l,c,h){var u,d=120*W/180,f=W/180*(+o||0),p=[],g=r(function(t,e,i){return{x:t*z.cos(i)-e*z.sin(i),y:t*z.sin(i)+e*z.cos(i)}});if(h)C=h[0],k=h[1],w=h[2],S=h[3];else{t=(u=g(t,e,-f)).x,e=u.y,l=(u=g(l,c,-f)).x,c=u.y;z.cos(W/180*o),z.sin(W/180*o);var m=(t-l)/2,v=(e-c)/2,y=m*m/(i*i)+v*v/(n*n);y>1&&(i*=y=z.sqrt(y),n*=y);var b=i*i,x=n*n,_=(a==s?-1:1)*z.sqrt(V((b*x-b*v*v-x*m*m)/(b*v*v+x*m*m))),w=_*i*v/n+(t+l)/2,S=_*-n*m/i+(e+c)/2,C=z.asin(((e-S)/n).toFixed(9)),k=z.asin(((c-S)/n).toFixed(9));C=t<w?W-C:C,k=l<w?W-k:k,C<0&&(C=2*W+C),k<0&&(k=2*W+k),s&&C>k&&(C-=2*W),!s&&k>C&&(k-=2*W)}var T=k-C;if(V(T)>d){var A=k,D=l,E=c;k=C+d*(s&&k>C?1:-1),l=w+i*z.cos(k),c=S+n*z.sin(k),p=Et(l,c,i,n,o,0,s,D,E,[k,A,w,S])}T=k-C;var P=z.cos(C),L=z.sin(C),I=z.cos(k),R=z.sin(k),N=z.tan(T/4),F=4/3*i*N,H=4/3*n*N,$=[t,e],B=[t+F*L,e-H*P],j=[l+F*R,c-H*I],U=[l,c];if(B[0]=2*$[0]-B[0],B[1]=2*$[1]-B[1],h)return[B,j,U][M](p);for(var Y=[],G=0,q=(p=[B,j,U][M](p).join()[O](",")).length;G<q;G++)Y[G]=G%2?g(p[G-1],p[G],f).y:g(p[G],p[G+1],f).x;return Y},Pt=function(t,e,i,n,r,o,a,s,l){var c=1-l;return{x:B(c,3)*t+3*B(c,2)*l*i+3*c*l*l*r+B(l,3)*a,y:B(c,3)*e+3*B(c,2)*l*n+3*c*l*l*o+B(l,3)*s}},Lt=r(function(t,e,i,n,r,o,a,s){var l,c=r-2*i+t-(a-2*r+i),h=2*(i-t)-2*(r-i),u=t-i,d=(-h+z.sqrt(h*h-4*c*u))/2/c,f=(-h-z.sqrt(h*h-4*c*u))/2/c,p=[e,s],g=[t,a];return V(d)>"1e12"&&(d=.5),V(f)>"1e12"&&(f=.5),d>0&&d<1&&(l=Pt(t,e,i,n,r,o,a,s,d),g.push(l.x),p.push(l.y)),f>0&&f<1&&(l=Pt(t,e,i,n,r,o,a,s,f),g.push(l.x),p.push(l.y)),c=o-2*n+e-(s-2*o+n),h=2*(n-e)-2*(o-n),u=e-n,d=(-h+z.sqrt(h*h-4*c*u))/2/c,f=(-h-z.sqrt(h*h-4*c*u))/2/c,V(d)>"1e12"&&(d=.5),V(f)>"1e12"&&(f=.5),d>0&&d<1&&(l=Pt(t,e,i,n,r,o,a,s,d),g.push(l.x),p.push(l.y)),f>0&&f<1&&(l=Pt(t,e,i,n,r,o,a,s,f),g.push(l.x),p.push(l.y)),{min:{x:$[D](0,g),y:$[D](0,p)},max:{x:H[D](0,g),y:H[D](0,p)}}}),It=e._path2curve=r(function(t,e){var i=!e&&St(t);if(!e&&i.curve)return kt(i.curve);for(var n=At(t),r=e&&At(e),o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=function(t,e,i){var n,r;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][M](Et[D](0,[e.x,e.y][M](t.slice(1))));break;case"S":"C"==i||"S"==i?(n=2*e.x-e.bx,r=2*e.y-e.by):(n=e.x,r=e.y),t=["C",n,r][M](t.slice(1));break;case"T":"Q"==i||"T"==i?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][M](Mt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][M](Mt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][M](Dt(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][M](Dt(e.x,e.y,t[1],e.y));break;case"V":t=["C"][M](Dt(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][M](Dt(e.x,e.y,e.X,e.Y))}return t},l=function(t,e){if(t[e].length>7){t[e].shift();for(var i=t[e];i.length;)h[e]="A",r&&(u[e]="A"),t.splice(e++,0,["C"][M](i.splice(0,6)));t.splice(e,1),g=H(n.length,r&&r.length||0)}},c=function(t,e,i,o,a){t&&e&&"M"==t[a][0]&&"M"!=e[a][0]&&(e.splice(a,0,["M",o.x,o.y]),i.bx=0,i.by=0,i.x=t[a][1],i.y=t[a][2],g=H(n.length,r&&r.length||0))},h=[],u=[],d="",f="",p=0,g=H(n.length,r&&r.length||0);p<g;p++){n[p]&&(d=n[p][0]),"C"!=d&&(h[p]=d,p&&(f=h[p-1])),n[p]=s(n[p],o,f),"A"!=h[p]&&"C"==d&&(h[p]="C"),l(n,p),r&&(r[p]&&(d=r[p][0]),"C"!=d&&(u[p]=d,p&&(f=u[p-1])),r[p]=s(r[p],a,f),"A"!=u[p]&&"C"==d&&(u[p]="C"),l(r,p)),c(n,r,o,a,p),c(r,n,a,o,p);var m=n[p],v=r&&r[p],y=m.length,b=r&&v.length;o.x=m[y-2],o.y=m[y-1],o.bx=Z(m[y-4])||o.x,o.by=Z(m[y-3])||o.y,a.bx=r&&(Z(v[b-4])||a.x),a.by=r&&(Z(v[b-3])||a.y),a.x=r&&v[b-2],a.y=r&&v[b-1]}return r||(i.curve=kt(n)),r?[n,r]:n},null,kt),Ot=(e._parseDots=r(function(t){for(var i=[],n=0,r=t.length;n<r;n++){var o={},a=t[n].match(/^([^:]*):?([\d\.]*)/);if(o.color=e.getRGB(a[1]),o.color.error)return null;o.opacity=o.color.opacity,o.color=o.color.hex,a[2]&&(o.offset=a[2]+"%"),i.push(o)}for(n=1,r=i.length-1;n<r;n++)if(!i[n].offset){for(var s=Z(i[n-1].offset||0),l=0,c=n+1;c<r;c++)if(i[c].offset){l=i[c].offset;break}l||(l=100,c=r);for(var h=((l=Z(l))-s)/(c-n+1);n<c;n++)s+=h,i[n].offset=s+"%"}return i}),e._tear=function(t,e){t==e.top&&(e.top=t.prev),t==e.bottom&&(e.bottom=t.next),t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next)}),Rt=(e._tofront=function(t,e){e.top!==t&&(Ot(t,e),t.next=null,t.prev=e.top,e.top.next=t,e.top=t)},e._toback=function(t,e){e.bottom!==t&&(Ot(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},e._insertafter=function(t,e,i){Ot(t,i),e==i.top&&(i.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},e._insertbefore=function(t,e,i){Ot(t,i),e==i.bottom&&(i.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},e.toMatrix=function(t,e){var i=Ct(t),n={_:{transform:P},getBBox:function(){return i}};return Nt(n,e),n.matrix}),Nt=(e.transformPath=function(t,e){return pt(t,Rt(t,e))},e._extractTransform=function(t,i){if(null==i)return t._.transform;i=I(i).replace(/\.{3}|\u2026/g,t._.transform||P);var n=e.parseTransformString(i),r=0,o=0,a=0,s=1,l=1,c=t._,h=new f;if(c.transform=n||[],n)for(var u=0,d=n.length;u<d;u++){var p,g,m,v,y,b=n[u],x=b.length,_=I(b[0]).toLowerCase(),w=b[0]!=_,S=w?h.invert():0;"t"==_&&3==x?w?(p=S.x(0,0),g=S.y(0,0),m=S.x(b[1],b[2]),v=S.y(b[1],b[2]),h.translate(m-p,v-g)):h.translate(b[1],b[2]):"r"==_?2==x?(y=y||t.getBBox(1),h.rotate(b[1],y.x+y.width/2,y.y+y.height/2),r+=b[1]):4==x&&(w?(m=S.x(b[2],b[3]),v=S.y(b[2],b[3]),h.rotate(b[1],m,v)):h.rotate(b[1],b[2],b[3]),r+=b[1]):"s"==_?2==x||3==x?(y=y||t.getBBox(1),h.scale(b[1],b[x-1],y.x+y.width/2,y.y+y.height/2),s*=b[1],l*=b[x-1]):5==x&&(w?(m=S.x(b[3],b[4]),v=S.y(b[3],b[4]),h.scale(b[1],b[2],m,v)):h.scale(b[1],b[2],b[3],b[4]),s*=b[1],l*=b[2]):"m"==_&&7==x&&h.add(b[1],b[2],b[3],b[4],b[5],b[6]),c.dirtyT=1,t.matrix=h}t.matrix=h,c.sx=s,c.sy=l,c.deg=r,c.dx=o=h.e,c.dy=a=h.f,1==s&&1==l&&!r&&c.bbox?(c.bbox.x+=+o,c.bbox.y+=+a):c.dirtyT=1}),Ft=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},zt=e._equaliseTransform=function(t,i){i=I(i).replace(/\.{3}|\u2026/g,t),t=e.parseTransformString(t)||[],i=e.parseTransformString(i)||[];for(var n,r,o,a,s=H(t.length,i.length),l=[],c=[],h=0;h<s;h++){if(o=t[h]||Ft(i[h]),a=i[h]||Ft(o),o[0]!=a[0]||"r"==o[0].toLowerCase()&&(o[2]!=a[2]||o[3]!=a[3])||"s"==o[0].toLowerCase()&&(o[3]!=a[3]||o[4]!=a[4]))return;for(l[h]=[],c[h]=[],n=0,r=H(o.length,a.length);n<r;n++)n in o&&(l[h][n]=o[n]),n in a&&(c[h][n]=a[n])}return{from:l,to:c}};e._getContainer=function(t,i,n,r){var o;if(null!=(o=null!=r||e.is(t,"object")?t:k.doc.getElementById(t)))return o.tagName?null==i?{container:o,width:o.style.pixelWidth||o.offsetWidth,height:o.style.pixelHeight||o.offsetHeight}:{container:o,width:i,height:n}:{container:1,x:t,y:i,width:n,height:r}},e.pathToRelative=Tt,e._engine={},e.path2curve=It,e.matrix=function(t,e,i,n,r,o){return new f(t,e,i,n,r,o)},function(t){function i(t){return t[0]*t[0]+t[1]*t[1]}function n(t){var e=z.sqrt(i(t));t[0]&&(t[0]/=e),t[1]&&(t[1]/=e)}t.add=function(t,e,i,n,r,o){var a,s,l,c,h=[[],[],[]],u=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],d=[[t,i,r],[e,n,o],[0,0,1]];for(t&&t instanceof f&&(d=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),a=0;a<3;a++)for(s=0;s<3;s++){for(c=0,l=0;l<3;l++)c+=u[a][l]*d[l][s];h[a][s]=c}this.a=h[0][0],this.b=h[1][0],this.c=h[0][1],this.d=h[1][1],this.e=h[0][2],this.f=h[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new f(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new f(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,i,n){null==e&&(e=t),(i||n)&&this.add(1,0,0,1,i,n),this.add(t,0,0,e,0,0),(i||n)&&this.add(1,0,0,1,-i,-n)},t.rotate=function(t,i,n){t=e.rad(t),i=i||0,n=n||0;var r=+z.cos(t).toFixed(9),o=+z.sin(t).toFixed(9);this.add(r,o,-o,r,i,n),this.add(1,0,0,1,-i,-n)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[I.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return e.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var r=[[this.a,this.c],[this.b,this.d]];t.scalex=z.sqrt(i(r[0])),n(r[0]),t.shear=r[0][0]*r[1][0]+r[0][1]*r[1][1],r[1]=[r[1][0]-r[0][0]*t.shear,r[1][1]-r[0][1]*t.shear],t.scaley=z.sqrt(i(r[1])),n(r[1]),t.shear/=t.scaley;var o=-r[0][1],a=r[1][1];return a<0?(t.rotate=e.deg(z.acos(a)),o<0&&(t.rotate=360-t.rotate)):t.rotate=e.deg(z.asin(o)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[O]();return e.isSimple?(e.scalex=+e.scalex.toFixed(4),e.scaley=+e.scaley.toFixed(4),e.rotate=+e.rotate.toFixed(4),(e.dx||e.dy?"t"+[e.dx,e.dy]:P)+(1!=e.scalex||1!=e.scaley?"s"+[e.scalex,e.scaley,0,0]:P)+(e.rotate?"r"+[e.rotate,0,0]:P)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(f.prototype);for(var Ht=function(){this.returnValue=!1},$t=function(){return this.originalEvent.preventDefault()},Vt=function(){this.cancelBubble=!0},Bt=function(){return this.originalEvent.stopPropagation()},Wt=function(t){var e=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,i=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft;return{x:t.clientX+i,y:t.clientY+e}},jt=k.doc.addEventListener?function(t,e,i,n){var r=function(t){var e=Wt(t);return i.call(n,t,e.x,e.y)};if(t.addEventListener(e,r,!1),E&&N[e]){var o=function(e){for(var r=Wt(e),o=e,a=0,s=e.targetTouches&&e.targetTouches.length;a<s;a++)if(e.targetTouches[a].target==t){(e=e.targetTouches[a]).originalEvent=o,e.preventDefault=$t,e.stopPropagation=Bt;break}return i.call(n,e,r.x,r.y)};t.addEventListener(N[e],o,!1)}return function(){return t.removeEventListener(e,r,!1),E&&N[e]&&t.removeEventListener(N[e],o,!1),!0}}:k.doc.attachEvent?function(t,e,i,n){var r=function(t){t=t||k.win.event;var e=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,r=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft,o=t.clientX+r,a=t.clientY+e;return t.preventDefault=t.preventDefault||Ht,t.stopPropagation=t.stopPropagation||Vt,i.call(n,t,o,a)};t.attachEvent("on"+e,r);return function(){return t.detachEvent("on"+e,r),!0}}:void 0,Ut=[],Yt=function(e){for(var i,n=e.clientX,r=e.clientY,o=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,a=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft,s=Ut.length;s--;){if(i=Ut[s],E&&e.touches){for(var l,c=e.touches.length;c--;)if((l=e.touches[c]).identifier==i.el._drag.id){n=l.clientX,r=l.clientY,(e.originalEvent?e.originalEvent:e).preventDefault();break}}else e.preventDefault();var h,u=i.el.node,d=u.nextSibling,f=u.parentNode,p=u.style.display;k.win.opera&&f.removeChild(u),u.style.display="none",h=i.el.paper.getElementByPoint(n,r),u.style.display=p,k.win.opera&&(d?f.insertBefore(u,d):f.appendChild(u)),h&&t("raphael.drag.over."+i.el.id,i.el,h),n+=a,r+=o,t("raphael.drag.move."+i.el.id,i.move_scope||i.el,n-i.el._drag.x,r-i.el._drag.y,n,r,e)}},Gt=function(i){e.unmousemove(Yt).unmouseup(Gt);for(var n,r=Ut.length;r--;)(n=Ut[r]).el._drag={},t("raphael.drag.end."+n.el.id,n.end_scope||n.start_scope||n.move_scope||n.el,i);Ut=[]},qt=e.el={},Xt=R.length;Xt--;)!function(t){e[t]=qt[t]=function(i,n){return e.is(i,"function")&&(this.events=this.events||[],this.events.push({name:t,f:i,unbind:jt(this.shape||this.node||k.doc,t,i,n||this)})),this},e["un"+t]=qt["un"+t]=function(i){for(var n=this.events||[],r=n.length;r--;)n[r].name!=t||!e.is(i,"undefined")&&n[r].f!=i||(n[r].unbind(),n.splice(r,1),!n.length&&delete this.events);return this}}(R[Xt]);qt.data=function(i,n){var r=lt[this.id]=lt[this.id]||{};if(0==arguments.length)return r;if(1==arguments.length){if(e.is(i,"object")){for(var o in i)i[C](o)&&this.data(o,i[o]);return this}return t("raphael.data.get."+this.id,this,r[i],i),r[i]}return r[i]=n,t("raphael.data.set."+this.id,this,n,i),this},qt.removeData=function(t){return null==t?lt[this.id]={}:lt[this.id]&&delete lt[this.id][t],this},qt.getData=function(){return i(lt[this.id]||{})},qt.hover=function(t,e,i,n){return this.mouseover(t,i).mouseout(e,n||i)},qt.unhover=function(t,e){return this.unmouseover(t).unmouseout(e)};var Kt=[];qt.drag=function(i,n,r,o,a,s){function l(l){(l.originalEvent||l).preventDefault();var c=l.clientX,h=l.clientY,u=k.doc.documentElement.scrollTop||k.doc.body.scrollTop,d=k.doc.documentElement.scrollLeft||k.doc.body.scrollLeft;if(this._drag.id=l.identifier,E&&l.touches)for(var f,p=l.touches.length;p--;)if(f=l.touches[p],this._drag.id=f.identifier,f.identifier==this._drag.id){c=f.clientX,h=f.clientY;break}this._drag.x=c+d,this._drag.y=h+u,!Ut.length&&e.mousemove(Yt).mouseup(Gt),Ut.push({el:this,move_scope:o,start_scope:a,end_scope:s}),n&&t.on("raphael.drag.start."+this.id,n),i&&t.on("raphael.drag.move."+this.id,i),r&&t.on("raphael.drag.end."+this.id,r),t("raphael.drag.start."+this.id,a||o||this,l.clientX+d,l.clientY+u,l)}return this._drag={},Kt.push({el:this,start:l}),this.mousedown(l),this},qt.onDragOver=function(e){e?t.on("raphael.drag.over."+this.id,e):t.unbind("raphael.drag.over."+this.id)},qt.undrag=function(){for(var i=Kt.length;i--;)Kt[i].el==this&&(this.unmousedown(Kt[i].start),Kt.splice(i,1),t.unbind("raphael.drag.*."+this.id));!Kt.length&&e.unmousemove(Yt).unmouseup(Gt),Ut=[]},x.circle=function(t,i,n){var r=e._engine.circle(this,t||0,i||0,n||0);return this.__set__&&this.__set__.push(r),r},x.rect=function(t,i,n,r,o){var a=e._engine.rect(this,t||0,i||0,n||0,r||0,o||0);return this.__set__&&this.__set__.push(a),a},x.ellipse=function(t,i,n,r){var o=e._engine.ellipse(this,t||0,i||0,n||0,r||0);return this.__set__&&this.__set__.push(o),o},x.path=function(t){t&&!e.is(t,"string")&&!e.is(t[0],U)&&(t+=P);var i=e._engine.path(e.format[D](e,arguments),this);return this.__set__&&this.__set__.push(i),i},x.image=function(t,i,n,r,o){var a=e._engine.image(this,t||"about:blank",i||0,n||0,r||0,o||0);return this.__set__&&this.__set__.push(a),a},x.text=function(t,i,n){var r=e._engine.text(this,t||0,i||0,I(n));return this.__set__&&this.__set__.push(r),r},x.set=function(t){!e.is(t,"array")&&(t=Array.prototype.splice.call(arguments,0,arguments.length));var i=new le(t);return this.__set__&&this.__set__.push(i),i.paper=this,i.type="set",i},x.setStart=function(t){this.__set__=t||this.set()},x.setFinish=function(t){var e=this.__set__;return delete this.__set__,e},x.getSize=function(){var t=this.canvas.parentNode;return{width:t.offsetWidth,height:t.offsetHeight}},x.setSize=function(t,i){return e._engine.setSize.call(this,t,i)},x.setViewBox=function(t,i,n,r,o){return e._engine.setViewBox.call(this,t,i,n,r,o)},x.top=x.bottom=null,x.raphael=e;var Zt=function(t){var e=t.getBoundingClientRect(),i=t.ownerDocument,n=i.body,r=i.documentElement,o=r.clientTop||n.clientTop||0,a=r.clientLeft||n.clientLeft||0;return{y:e.top+(k.win.pageYOffset||r.scrollTop||n.scrollTop)-o,x:e.left+(k.win.pageXOffset||r.scrollLeft||n.scrollLeft)-a}};x.getElementByPoint=function(t,e){var i=this,n=i.canvas,r=k.doc.elementFromPoint(t,e);if(k.win.opera&&"svg"==r.tagName){var o=Zt(n),a=n.createSVGRect();a.x=t-o.x,a.y=e-o.y,a.width=a.height=1;var s=n.getIntersectionList(a,null);s.length&&(r=s[s.length-1])}if(!r)return null;for(;r.parentNode&&r!=n.parentNode&&!r.raphael;)r=r.parentNode;return r==i.canvas.parentNode&&(r=n),r=r&&r.raphael?i.getById(r.raphaelid):null},x.getElementsByBBox=function(t){var i=this.set();return this.forEach(function(n){e.isBBoxIntersect(n.getBBox(),t)&&i.push(n)}),i},x.getById=function(t){for(var e=this.bottom;e;){if(e.id==t)return e;e=e.next}return null},x.forEach=function(t,e){for(var i=this.bottom;i;){if(!1===t.call(e,i))return this;i=i.next}return this},x.getElementsByPoint=function(t,e){var i=this.set();return this.forEach(function(n){n.isPointInside(t,e)&&i.push(n)}),i},qt.isPointInside=function(t,i){var n=this.realPath=ft[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(n=e.transformPath(n,this.attr("transform"))),e.isPointInsidePath(n,t,i)},qt.getBBox=function(t){if(this.removed)return{};var e=this._;return t?(!e.dirty&&e.bboxwt||(this.realPath=ft[this.type](this),e.bboxwt=Ct(this.realPath),e.bboxwt.toString=p,e.dirty=0),e.bboxwt):((e.dirty||e.dirtyT||!e.bbox)&&(!e.dirty&&this.realPath||(e.bboxwt=0,this.realPath=ft[this.type](this)),e.bbox=Ct(pt(this.realPath,this.matrix)),e.bbox.toString=p,e.dirty=e.dirtyT=0),e.bbox)},qt.clone=function(){if(this.removed)return null;var t=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(t),t},qt.glow=function(t){if("text"==this.type)return null;var e={width:((t=t||{}).width||10)+(+this.attr("stroke-width")||1),fill:t.fill||!1,opacity:null==t.opacity?.5:t.opacity,offsetx:t.offsetx||0,offsety:t.offsety||0,color:t.color||"#000"},i=e.width/2,n=this.paper,r=n.set(),o=this.realPath||ft[this.type](this);o=this.matrix?pt(o,this.matrix):o;for(var a=1;a<i+1;a++)r.push(n.path(o).attr({stroke:e.color,fill:e.fill?e.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(e.width/i*a).toFixed(3),opacity:+(e.opacity/i).toFixed(3)}));return r.insertBefore(this).translate(e.offsetx,e.offsety)};var Qt=function(t,i,n,r,o,a,s,h,u){return null==u?l(t,i,n,r,o,a,s,h):e.findDotsAtSegment(t,i,n,r,o,a,s,h,c(t,i,n,r,o,a,s,h,u))},Jt=function(t,i){return function(n,r,o){for(var a,s,l,c,h,u="",d={},f=0,p=0,g=(n=It(n)).length;p<g;p++){if("M"==(l=n[p])[0])a=+l[1],s=+l[2];else{if(c=Qt(a,s,l[1],l[2],l[3],l[4],l[5],l[6]),f+c>r){if(i&&!d.start){if(h=Qt(a,s,l[1],l[2],l[3],l[4],l[5],l[6],r-f),u+=["C"+h.start.x,h.start.y,h.m.x,h.m.y,h.x,h.y],o)return u;d.start=u,u=["M"+h.x,h.y+"C"+h.n.x,h.n.y,h.end.x,h.end.y,l[5],l[6]].join(),f+=c,a=+l[5],s=+l[6];continue}if(!t&&!i)return h=Qt(a,s,l[1],l[2],l[3],l[4],l[5],l[6],r-f),{x:h.x,y:h.y,alpha:h.alpha}}f+=c,a=+l[5],s=+l[6]}u+=l.shift()+l}return d.end=u,(h=t?f:i?d:e.findDotsAtSegment(a,s,l[0],l[1],l[2],l[3],l[4],l[5],1)).alpha&&(h={x:h.x,y:h.y,alpha:h.alpha}),h}},te=Jt(1),ee=Jt(),ie=Jt(0,1);e.getTotalLength=te,e.getPointAtLength=ee,e.getSubpath=function(t,e,i){if(this.getTotalLength(t)-i<1e-6)return ie(t,e).end;var n=ie(t,i,1);return e?ie(n,e).end:n},qt.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():te(t)},qt.getPointAtLength=function(t){var e=this.getPath();if(e)return ee(e,t)},qt.getPath=function(){var t,i=e._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return i&&(t=i(this)),t},qt.getSubpath=function(t,i){var n=this.getPath();if(n)return e.getSubpath(n,t,i)};var ne=e.easing_formulas={linear:function(t){return t},"<":function(t){return B(t,1.7)},">":function(t){return B(t,.48)},"<>":function(t){var e=.48-t/1.04,i=z.sqrt(.1734+e*e),n=i-e,r=-i-e,o=B(V(n),1/3)*(n<0?-1:1)+B(V(r),1/3)*(r<0?-1:1)+.5;return 3*(1-o)*o*o+o*o*o},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:B(2,-10*t)*z.sin(2*W*(t-.075)/.3)+1},bounce:function(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}};ne.easeIn=ne["ease-in"]=ne["<"],ne.easeOut=ne["ease-out"]=ne[">"],ne.easeInOut=ne["ease-in-out"]=ne["<>"],ne["back-in"]=ne.backIn,ne["back-out"]=ne.backOut;var re=[],oe=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},ae=function(){for(var i=+new Date,n=0;n<re.length;n++){var r=re[n];if(!r.el.removed&&!r.paused){var o,a,s=i-r.start,l=r.ms,c=r.easing,h=r.from,u=r.diff,d=r.to,f=(r.t,r.el),p={},g={};if(r.initstatus?(s=(r.initstatus*r.anim.top-r.prev)/(r.percent-r.prev)*l,r.status=r.initstatus,delete r.initstatus,r.stop&&re.splice(n--,1)):r.status=(r.prev+(r.percent-r.prev)*(s/l))/r.anim.top,!(s<0))if(s<l){var m=c(s/l);for(var y in h)if(h[C](y)){switch(et[y]){case j:o=+h[y]+m*l*u[y];break;case"colour":o="rgb("+[se(K(h[y].r+m*l*u[y].r)),se(K(h[y].g+m*l*u[y].g)),se(K(h[y].b+m*l*u[y].b))].join(",")+")";break;case"path":o=[];for(var b=0,x=h[y].length;b<x;b++){o[b]=[h[y][b][0]];for(var _=1,w=h[y][b].length;_<w;_++)o[b][_]=+h[y][b][_]+m*l*u[y][b][_];o[b]=o[b].join(L)}o=o.join(L);break;case"transform":if(u[y].real)for(o=[],b=0,x=h[y].length;b<x;b++)for(o[b]=[h[y][b][0]],_=1,w=h[y][b].length;_<w;_++)o[b][_]=h[y][b][_]+m*l*u[y][b][_];else{var S=function(t){return+h[y][t]+m*l*u[y][t]};o=[["m",S(0),S(1),S(2),S(3),S(4),S(5)]]}break;case"csv":if("clip-rect"==y)for(o=[],b=4;b--;)o[b]=+h[y][b]+m*l*u[y][b];break;default:var k=[][M](h[y]);for(o=[],b=f.paper.customAttributes[y].length;b--;)o[b]=+k[b]+m*l*u[y][b]}p[y]=o}f.attr(p),function(e,i,n){setTimeout(function(){t("raphael.anim.frame."+e,i,n)})}(f.id,f,r.anim)}else{if(function(i,n,r){setTimeout(function(){t("raphael.anim.frame."+n.id,n,r),t("raphael.anim.finish."+n.id,n,r),e.is(i,"function")&&i.call(n)})}(r.callback,f,r.anim),f.attr(d),re.splice(n--,1),r.repeat>1&&!r.next){for(a in d)d[C](a)&&(g[a]=r.totalOrigin[a]);r.el.attr(g),v(r.anim,r.el,r.anim.percents[0],null,r.totalOrigin,r.repeat-1)}r.next&&!r.stop&&v(r.anim,r.el,r.next,null,r.totalOrigin,r.repeat)}}}re.length&&oe(ae)},se=function(t){return t>255?255:t<0?0:t};qt.animateWith=function(t,i,n,r,o,a){var s=this;if(s.removed)return a&&a.call(s),s;var l=n instanceof m?n:e.animation(n,r,o,a);v(l,s,l.percents[0],null,s.attr());for(var c=0,h=re.length;c<h;c++)if(re[c].anim==i&&re[c].el==t){re[h-1].start=re[c].start;break}return s},qt.onAnimation=function(e){return e?t.on("raphael.anim.frame."+this.id,e):t.unbind("raphael.anim.frame."+this.id),this},m.prototype.delay=function(t){var e=new m(this.anim,this.ms);return e.times=this.times,e.del=+t||0,e},m.prototype.repeat=function(t){var e=new m(this.anim,this.ms);return e.del=this.del,e.times=z.floor(H(t,0))||1,e},e.animation=function(t,i,n,r){if(t instanceof m)return t;!e.is(n,"function")&&n||(r=r||n||null,n=null),t=Object(t),i=+i||0;var o,a,s={};for(a in t)t[C](a)&&Z(a)!=a&&Z(a)+"%"!=a&&(o=!0,s[a]=t[a]);if(o)return n&&(s.easing=n),r&&(s.callback=r),new m({100:s},i);if(r){var l=0;for(var c in t){var h=Q(c);t[C](c)&&h>l&&(l=h)}!t[l+="%"].callback&&(t[l].callback=r)}return new m(t,i)},qt.animate=function(t,i,n,r){var o=this;if(o.removed)return r&&r.call(o),o;var a=t instanceof m?t:e.animation(t,i,n,r);return v(a,o,a.percents[0],null,o.attr()),o},qt.setTime=function(t,e){return t&&null!=e&&this.status(t,$(e,t.ms)/t.ms),this},qt.status=function(t,e){var i,n,r=[],o=0;if(null!=e)return v(t,this,-1,$(e,1)),this;for(i=re.length;o<i;o++)if((n=re[o]).el.id==this.id&&(!t||n.anim==t)){if(t)return n.status;r.push({anim:n.anim,status:n.status})}return t?0:r},qt.pause=function(e){for(var i=0;i<re.length;i++)re[i].el.id!=this.id||e&&re[i].anim!=e||!1!==t("raphael.anim.pause."+this.id,this,re[i].anim)&&(re[i].paused=!0);return this},qt.resume=function(e){for(var i=0;i<re.length;i++)if(re[i].el.id==this.id&&(!e||re[i].anim==e)){var n=re[i];!1!==t("raphael.anim.resume."+this.id,this,n.anim)&&(delete n.paused,this.status(n.anim,n.status))}return this},qt.stop=function(e){for(var i=0;i<re.length;i++)re[i].el.id!=this.id||e&&re[i].anim!=e||!1!==t("raphael.anim.stop."+this.id,this,re[i].anim)&&re.splice(i--,1);return this},t.on("raphael.remove",y),t.on("raphael.clear",y),qt.toString=function(){return"Raphaël’s object"};var le=function(t){if(this.items=[],this.length=0,this.type="set",t)for(var e=0,i=t.length;e<i;e++)!t[e]||t[e].constructor!=qt.constructor&&t[e].constructor!=le||(this[this.items.length]=this.items[this.items.length]=t[e],this.length++)},ce=le.prototype;ce.push=function(){for(var t,e,i=0,n=arguments.length;i<n;i++)!(t=arguments[i])||t.constructor!=qt.constructor&&t.constructor!=le||(this[e=this.items.length]=this.items[e]=t,this.length++);return this},ce.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},ce.forEach=function(t,e){for(var i=0,n=this.items.length;i<n;i++)if(!1===t.call(e,this.items[i],i))return this;return this};for(var he in qt)qt[C](he)&&(ce[he]=function(t){return function(){var e=arguments;return this.forEach(function(i){i[t][D](i,e)})}}(he));return ce.attr=function(t,i){if(t&&e.is(t,U)&&e.is(t[0],"object"))for(var n=0,r=t.length;n<r;n++)this.items[n].attr(t[n]);else for(var o=0,a=this.items.length;o<a;o++)this.items[o].attr(t,i);return this},ce.clear=function(){for(;this.length;)this.pop()},ce.splice=function(t,e,i){t=t<0?H(this.length+t,0):t,e=H(0,$(this.length-t,e));var n,r=[],o=[],a=[];for(n=2;n<arguments.length;n++)a.push(arguments[n]);for(n=0;n<e;n++)o.push(this[t+n]);for(;n<this.length-t;n++)r.push(this[t+n]);var s=a.length;for(n=0;n<s+r.length;n++)this.items[t+n]=this[t+n]=n<s?a[n]:r[n-s];for(n=this.items.length=this.length-=e-s;this[n];)delete this[n++];return new le(o)},ce.exclude=function(t){for(var e=0,i=this.length;e<i;e++)if(this[e]==t)return this.splice(e,1),!0},ce.animate=function(t,i,n,r){(e.is(n,"function")||!n)&&(r=n||null);var o,a,s=this.items.length,l=s,c=this;if(!s)return this;r&&(a=function(){!--s&&r.call(c)}),n=e.is(n,"string")?n:a;var h=e.animation(t,i,n,a);for(o=this.items[--l].animate(h);l--;)this.items[l]&&!this.items[l].removed&&this.items[l].animateWith(o,h,h),this.items[l]&&!this.items[l].removed||s--;return this},ce.insertAfter=function(t){for(var e=this.items.length;e--;)this.items[e].insertAfter(t);return this},ce.getBBox=function(){for(var t=[],e=[],i=[],n=[],r=this.items.length;r--;)if(!this.items[r].removed){var o=this.items[r].getBBox();t.push(o.x),e.push(o.y),i.push(o.x+o.width),n.push(o.y+o.height)}return t=$[D](0,t),e=$[D](0,e),i=H[D](0,i),n=H[D](0,n),{x:t,y:e,x2:i,y2:n,width:i-t,height:n-e}},ce.clone=function(t){t=this.paper.set();for(var e=0,i=this.items.length;e<i;e++)t.push(this.items[e].clone());return t},ce.toString=function(){return"Raphaël‘s set"},ce.glow=function(t){var e=this.paper.set();return this.forEach(function(i,n){var r=i.glow(t);null!=r&&r.forEach(function(t,i){e.push(t)})}),e},ce.isPointInside=function(t,e){var i=!1;return this.forEach(function(n){if(n.isPointInside(t,e))return i=!0,!1}),i},e.registerFont=function(t){if(!t.face)return t;this.fonts=this.fonts||{};var e={w:t.w,face:{},glyphs:{}},i=t.face["font-family"];for(var n in t.face)t.face[C](n)&&(e.face[n]=t.face[n]);if(this.fonts[i]?this.fonts[i].push(e):this.fonts[i]=[e],!t.svg){e.face["units-per-em"]=Q(t.face["units-per-em"],10);for(var r in t.glyphs)if(t.glyphs[C](r)){var o=t.glyphs[r];if(e.glyphs[r]={w:o.w,k:{},d:o.d&&"M"+o.d.replace(/[mlcxtrv]/g,function(t){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[t]||"M"})+"z"},o.k)for(var a in o.k)o[C](a)&&(e.glyphs[r].k[a]=o.k[a])}}return t},x.getFont=function(t,i,n,r){if(r=r||"normal",n=n||"normal",i=+i||{normal:400,bold:700,lighter:300,bolder:800}[i]||400,e.fonts){var o=e.fonts[t];if(!o){var a=new RegExp("(^|\\s)"+t.replace(/[^\w\d\s+!~.:_-]/g,P)+"(\\s|$)","i");for(var s in e.fonts)if(e.fonts[C](s)&&a.test(s)){o=e.fonts[s];break}}var l;if(o)for(var c=0,h=o.length;c<h&&((l=o[c]).face["font-weight"]!=i||l.face["font-style"]!=n&&l.face["font-style"]||l.face["font-stretch"]!=r);c++);return l}},x.print=function(t,i,n,r,o,a,s,l){a=a||"middle",s=H($(s||0,1),-1),l=H($(l||1,3),1);var c,h=I(n)[O](P),u=0,d=0,f=P;if(e.is(r,"string")&&(r=this.getFont(r)),r){c=(o||16)/r.face["units-per-em"];for(var p=r.face.bbox[O](_),g=+p[0],m=p[3]-p[1],v=0,y=+p[1]+("baseline"==a?m+ +r.face.descent:m/2),b=0,x=h.length;b<x;b++){if("\n"==h[b])u=0,S=0,d=0,v+=m*l;else{var w=d&&r.glyphs[h[b-1]]||{},S=r.glyphs[h[b]];u+=d?(w.w||r.w)+(w.k&&w.k[h[b]]||0)+r.w*s:0,d=1}S&&S.d&&(f+=e.transformPath(S.d,["t",u*c,v*c,"s",c,c,g,y,"t",(t-g)/c,(i-y)/c]))}}return this.path(f).attr({fill:"#000",stroke:"none"})},x.add=function(t){if(e.is(t,"array"))for(var i,n=this.set(),r=0,o=t.length;r<o;r++)i=t[r]||{},w[C](i.type)&&n.push(this[i.type]().attr(i));return n},e.format=function(t,i){var n=e.is(i,U)?[0][M](i):arguments;return t&&e.is(t,"string")&&n.length-1&&(t=t.replace(S,function(t,e){return null==n[++e]?P:n[e]})),t||P},e.fullfill=function(){var t=/\{([^\}]+)\}/g,e=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,i=function(t,i,n){var r=n;return i.replace(e,function(t,e,i,n,o){e=e||n,r&&(e in r&&(r=r[e]),"function"==typeof r&&o&&(r=r()))}),r=(null==r||r==n?t:r)+""};return function(e,n){return String(e).replace(t,function(t,e){return i(t,e,n)})}}(),e.ninja=function(){if(T.was)k.win.Raphael=T.is;else{window.Raphael=void 0;try{delete window.Raphael}catch(t){}}return e},e.st=ce,t.on("raphael.DOMload",function(){b=!0}),function(t,i,n){function r(){/in/.test(t.readyState)?setTimeout(r,9):e.eve("raphael.DOMload")}null==t.readyState&&t.addEventListener&&(t.addEventListener("DOMContentLoaded",n=function(){t.removeEventListener("DOMContentLoaded",n,!1),t.readyState="complete"},!1),t.readyState="loading"),r()}(document),e}.apply(e,[i(2)]))&&(t.exports=n)},function(t,e,i){var n,r;!function(i){var o,a,s="hasOwnProperty",l=/[\.\/]/,c=/\s*,\s*/,h=function(t,e){return t-e},u={n:{}},d=function(){for(var t=0,e=this.length;t<e;t++)if(void 0!==this[t])return this[t]},f=function(){for(var t=this.length;--t;)if(void 0!==this[t])return this[t]},p=Object.prototype.toString,g=String,m=Array.isArray||function(t){return t instanceof Array||"[object Array]"==p.call(t)};eve=function(t,e){var i,n=a,r=Array.prototype.slice.call(arguments,2),s=eve.listeners(t),l=0,c=[],u={},p=[],g=o;p.firstDefined=d,p.lastDefined=f,o=t,a=0;for(var m=0,v=s.length;m<v;m++)"zIndex"in s[m]&&(c.push(s[m].zIndex),s[m].zIndex<0&&(u[s[m].zIndex]=s[m]));for(c.sort(h);c[l]<0;)if(i=u[c[l++]],p.push(i.apply(e,r)),a)return a=n,p;for(m=0;m<v;m++)if("zIndex"in(i=s[m]))if(i.zIndex==c[l]){if(p.push(i.apply(e,r)),a)break;do{if(l++,(i=u[c[l]])&&p.push(i.apply(e,r)),a)break}while(i)}else u[i.zIndex]=i;else if(p.push(i.apply(e,r)),a)break;return a=n,o=g,p},eve._events=u,eve.listeners=function(t){var e,i,n,r,o,a,s,c,h=m(t)?t:t.split(l),d=u,f=[d],p=[];for(r=0,o=h.length;r<o;r++){for(c=[],a=0,s=f.length;a<s;a++)for(i=[(d=f[a].n)[h[r]],d["*"]],n=2;n--;)(e=i[n])&&(c.push(e),p=p.concat(e.f||[]));f=c}return p},eve.separator=function(t){t?(t="["+(t=g(t).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",l=new RegExp(t)):l=/[\.\/]/},eve.on=function(t,e){if("function"!=typeof e)return function(){};for(var i=m(t)?m(t[0])?t:[t]:g(t).split(c),n=0,r=i.length;n<r;n++)!function(t){for(var i,n=m(t)?t:g(t).split(l),r=u,o=0,a=n.length;o<a;o++)r=(r=r.n).hasOwnProperty(n[o])&&r[n[o]]||(r[n[o]]={n:{}});for(r.f=r.f||[],o=0,a=r.f.length;o<a;o++)if(r.f[o]==e){i=!0;break}!i&&r.f.push(e)}(i[n]);return function(t){+t==+t&&(e.zIndex=+t)}},eve.f=function(t){var e=[].slice.call(arguments,1);return function(){eve.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},eve.stop=function(){a=1},eve.nt=function(t){var e=m(o)?o.join("."):o;return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},eve.nts=function(){return m(o)?o:o.split(l)},eve.off=eve.unbind=function(t,e){if(t){var i=m(t)?m(t[0])?t:[t]:g(t).split(c);if(i.length>1)for(var n=0,r=i.length;n<r;n++)eve.off(i[n],e);else{i=m(t)?t:g(t).split(l);var o,a,h,d,f,p=[u];for(n=0,r=i.length;n<r;n++)for(d=0;d<p.length;d+=h.length-2){if(h=[d,1],o=p[d].n,"*"!=i[n])o[i[n]]&&h.push(o[i[n]]);else for(a in o)o[s](a)&&h.push(o[a]);p.splice.apply(p,h)}for(n=0,r=p.length;n<r;n++)for(o=p[n];o.n;){if(e){if(o.f){for(d=0,f=o.f.length;d<f;d++)if(o.f[d]==e){o.f.splice(d,1);break}!o.f.length&&delete o.f}for(a in o.n)if(o.n[s](a)&&o.n[a].f){var v=o.n[a].f;for(d=0,f=v.length;d<f;d++)if(v[d]==e){v.splice(d,1);break}!v.length&&delete o.n[a].f}}else{delete o.f;for(a in o.n)o.n[s](a)&&o.n[a].f&&delete o.n[a].f}o=o.n}}}else eve._events=u={n:{}}},eve.once=function(t,e){var i=function(){return eve.off(t,i),e.apply(this,arguments)};return eve.on(t,i)},eve.version="0.5.0",eve.toString=function(){return"You are running Eve 0.5.0"},void 0!==t&&t.exports?t.exports=eve:(n=[],void 0!==(r=function(){return eve}.apply(e,n))&&(t.exports=r))}()},function(t,e,i){var n;void 0!==(n=function(t){if(!t||t.svg){var e="hasOwnProperty",i=String,n=parseFloat,r=parseInt,o=Math,a=o.max,s=o.abs,l=o.pow,c=/[, ]+/,h=t.eve,u="",d=" ",f="http://www.w3.org/1999/xlink",p={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var m=function(n,r){if(r){"string"==typeof n&&(n=m(n));for(var o in r)r[e](o)&&("xlink:"==o.substring(0,6)?n.setAttributeNS(f,o.substring(6),i(r[o])):n.setAttribute(o,i(r[o])))}else(n=t._g.doc.createElementNS("http://www.w3.org/2000/svg",n)).style&&(n.style.webkitTapHighlightColor="rgba(0,0,0,0)");return n},v=function(e,r){var c="linear",h=e.id+r,d=.5,f=.5,p=e.node,g=e.paper,v=p.style,y=t._g.doc.getElementById(h);if(!y){if(r=i(r).replace(t._radial_gradient,function(t,e,i){if(c="radial",e&&i){d=n(e);var r=2*((f=n(i))>.5)-1;l(d-.5,2)+l(f-.5,2)>.25&&(f=o.sqrt(.25-l(d-.5,2))*r+.5)&&.5!=f&&(f=f.toFixed(5)-1e-5*r)}return u}),r=r.split(/\s*\-\s*/),"linear"==c){var x=r.shift();if(x=-n(x),isNaN(x))return null;var _=[0,0,o.cos(t.rad(x)),o.sin(t.rad(x))],w=1/(a(s(_[2]),s(_[3]))||1);_[2]*=w,_[3]*=w,_[2]<0&&(_[0]=-_[2],_[2]=0),_[3]<0&&(_[1]=-_[3],_[3]=0)}var S=t._parseDots(r);if(!S)return null;if(h=h.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&h!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=m(c+"Gradient",{id:h}),e.gradient=y,m(y,"radial"==c?{fx:d,fy:f}:{x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(y);for(var C=0,k=S.length;C<k;C++)y.appendChild(m("stop",{offset:S[C].offset?S[C].offset:C?"100%":"0%","stop-color":S[C].color||"#fff","stop-opacity":isFinite(S[C].opacity)?S[C].opacity:1}))}}return m(p,{fill:b(h),opacity:1,"fill-opacity":1}),v.fill=u,v.opacity=1,v.fillOpacity=1,1},y=function(){var t=document.documentMode;return t&&(9===t||10===t)},b=function(t){if(y())return"url('#"+t+"')";var e=document.location;return"url('"+(e.protocol+"//"+e.host+e.pathname+e.search)+"#"+t+"')"},x=function(t){var e=t.getBBox(1);m(t.pattern,{patternTransform:t.matrix.invert()+" translate("+e.x+","+e.y+")"})},_=function(n,r,o){if("path"==n.type){for(var a,s,l,c,h,d=i(r).toLowerCase().split("-"),f=n.paper,v=o?"end":"start",y=n.node,b=n.attrs,x=b["stroke-width"],_=d.length,w="classic",S=3,C=3,k=5;_--;)switch(d[_]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":w=d[_];break;case"wide":C=5;break;case"narrow":C=2;break;case"long":S=5;break;case"short":S=2}if("open"==w?(S+=2,C+=2,k+=2,l=1,c=o?4:1,h={fill:"none",stroke:b.stroke}):(c=l=S/2,h={fill:b.stroke,stroke:"none"}),n._.arrows?o?(n._.arrows.endPath&&g[n._.arrows.endPath]--,n._.arrows.endMarker&&g[n._.arrows.endMarker]--):(n._.arrows.startPath&&g[n._.arrows.startPath]--,n._.arrows.startMarker&&g[n._.arrows.startMarker]--):n._.arrows={},"none"!=w){var T="raphael-marker-"+w,A="raphael-marker-"+v+w+S+C+"-obj"+n.id;t._g.doc.getElementById(T)?g[T]++:(f.defs.appendChild(m(m("path"),{"stroke-linecap":"round",d:p[w],id:T})),g[T]=1);var D,M=t._g.doc.getElementById(A);M?(g[A]++,D=M.getElementsByTagName("use")[0]):(M=m(m("marker"),{id:A,markerHeight:C,markerWidth:S,orient:"auto",refX:c,refY:C/2}),D=m(m("use"),{"xlink:href":"#"+T,transform:(o?"rotate(180 "+S/2+" "+C/2+") ":u)+"scale("+S/k+","+C/k+")","stroke-width":(1/((S/k+C/k)/2)).toFixed(4)}),M.appendChild(D),f.defs.appendChild(M),g[A]=1),m(D,h);var E=l*("diamond"!=w&&"oval"!=w);o?(a=n._.arrows.startdx*x||0,s=t.getTotalLength(b.path)-E*x):(a=E*x,s=t.getTotalLength(b.path)-(n._.arrows.enddx*x||0)),(h={})["marker-"+v]="url(#"+A+")",(s||a)&&(h.d=t.getSubpath(b.path,a,s)),m(y,h),n._.arrows[v+"Path"]=T,n._.arrows[v+"Marker"]=A,n._.arrows[v+"dx"]=E,n._.arrows[v+"Type"]=w,n._.arrows[v+"String"]=r}else o?(a=n._.arrows.startdx*x||0,s=t.getTotalLength(b.path)-a):(a=0,s=t.getTotalLength(b.path)-(n._.arrows.enddx*x||0)),n._.arrows[v+"Path"]&&m(y,{d:t.getSubpath(b.path,a,s)}),delete n._.arrows[v+"Path"],delete n._.arrows[v+"Marker"],delete n._.arrows[v+"dx"],delete n._.arrows[v+"Type"],delete n._.arrows[v+"String"];for(h in g)if(g[e](h)&&!g[h]){var P=t._g.doc.getElementById(h);P&&P.parentNode.removeChild(P)}}},w={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},S=function(t,e,n){if(e=w[i(e).toLowerCase()]){for(var r=t.attrs["stroke-width"]||"1",o={round:r,square:r,butt:0}[t.attrs["stroke-linecap"]||n["stroke-linecap"]]||0,a=[],s=e.length;s--;)a[s]=e[s]*r+(s%2?1:-1)*o;m(t.node,{"stroke-dasharray":a.join(",")})}else m(t.node,{"stroke-dasharray":"none"})},C=function(n,o){var l=n.node,h=n.attrs,d=l.style.visibility;l.style.visibility="hidden";for(var p in o)if(o[e](p)){if(!t._availableAttrs[e](p))continue;var g=o[p];switch(h[p]=g,p){case"blur":n.blur(g);break;case"title":var y=l.getElementsByTagName("title");if(y.length&&(y=y[0]))y.firstChild.nodeValue=g;else{y=m("title");var b=t._g.doc.createTextNode(g);y.appendChild(b),l.appendChild(y)}break;case"href":case"target":var w=l.parentNode;if("a"!=w.tagName.toLowerCase()){var C=m("a");w.insertBefore(C,l),C.appendChild(l),w=C}"target"==p?w.setAttributeNS(f,"show","blank"==g?"new":g):w.setAttributeNS(f,p,g);break;case"cursor":l.style.cursor=g;break;case"transform":n.transform(g);break;case"arrow-start":_(n,g);break;case"arrow-end":_(n,g,1);break;case"clip-rect":var T=i(g).split(c);if(4==T.length){n.clip&&n.clip.parentNode.parentNode.removeChild(n.clip.parentNode);var A=m("clipPath"),D=m("rect");A.id=t.createUUID(),m(D,{x:T[0],y:T[1],width:T[2],height:T[3]}),A.appendChild(D),n.paper.defs.appendChild(A),m(l,{"clip-path":"url(#"+A.id+")"}),n.clip=D}if(!g){var M=l.getAttribute("clip-path");if(M){var E=t._g.doc.getElementById(M.replace(/(^url\(#|\)$)/g,u));E&&E.parentNode.removeChild(E),m(l,{"clip-path":u}),delete n.clip}}break;case"path":"path"==n.type&&(m(l,{d:g?h.path=t._pathToAbsolute(g):"M0,0"}),n._.dirty=1,n._.arrows&&("startString"in n._.arrows&&_(n,n._.arrows.startString),"endString"in n._.arrows&&_(n,n._.arrows.endString,1)));break;case"width":if(l.setAttribute(p,g),n._.dirty=1,!h.fx)break;p="x",g=h.x;case"x":h.fx&&(g=-h.x-(h.width||0));case"rx":if("rx"==p&&"rect"==n.type)break;case"cx":l.setAttribute(p,g),n.pattern&&x(n),n._.dirty=1;break;case"height":if(l.setAttribute(p,g),n._.dirty=1,!h.fy)break;p="y",g=h.y;case"y":h.fy&&(g=-h.y-(h.height||0));case"ry":if("ry"==p&&"rect"==n.type)break;case"cy":l.setAttribute(p,g),n.pattern&&x(n),n._.dirty=1;break;case"r":"rect"==n.type?m(l,{rx:g,ry:g}):l.setAttribute(p,g),n._.dirty=1;break;case"src":"image"==n.type&&l.setAttributeNS(f,"href",g);break;case"stroke-width":1==n._.sx&&1==n._.sy||(g/=a(s(n._.sx),s(n._.sy))||1),l.setAttribute(p,g),h["stroke-dasharray"]&&S(n,h["stroke-dasharray"],o),n._.arrows&&("startString"in n._.arrows&&_(n,n._.arrows.startString),"endString"in n._.arrows&&_(n,n._.arrows.endString,1));break;case"stroke-dasharray":S(n,g,o);break;case"fill":var P=i(g).match(t._ISURL);if(P){A=m("pattern");var L=m("image");A.id=t.createUUID(),m(A,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(L,{x:0,y:0,"xlink:href":P[1]}),A.appendChild(L),function(e){t._preload(P[1],function(){var t=this.offsetWidth,i=this.offsetHeight;m(e,{width:t,height:i}),m(L,{width:t,height:i})})}(A),n.paper.defs.appendChild(A),m(l,{fill:"url(#"+A.id+")"}),n.pattern=A,n.pattern&&x(n);break}var I=t.getRGB(g);if(I.error){if(("circle"==n.type||"ellipse"==n.type||"r"!=i(g).charAt())&&v(n,g)){if("opacity"in h||"fill-opacity"in h){var O=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,u));if(O){var R=O.getElementsByTagName("stop");m(R[R.length-1],{"stop-opacity":("opacity"in h?h.opacity:1)*("fill-opacity"in h?h["fill-opacity"]:1)})}}h.gradient=g,h.fill="none";break}}else delete o.gradient,delete h.gradient,!t.is(h.opacity,"undefined")&&t.is(o.opacity,"undefined")&&m(l,{opacity:h.opacity}),!t.is(h["fill-opacity"],"undefined")&&t.is(o["fill-opacity"],"undefined")&&m(l,{"fill-opacity":h["fill-opacity"]});I[e]("opacity")&&m(l,{"fill-opacity":I.opacity>1?I.opacity/100:I.opacity});case"stroke":I=t.getRGB(g),l.setAttribute(p,I.hex),"stroke"==p&&I[e]("opacity")&&m(l,{"stroke-opacity":I.opacity>1?I.opacity/100:I.opacity}),"stroke"==p&&n._.arrows&&("startString"in n._.arrows&&_(n,n._.arrows.startString),"endString"in n._.arrows&&_(n,n._.arrows.endString,1));break;case"gradient":("circle"==n.type||"ellipse"==n.type||"r"!=i(g).charAt())&&v(n,g);break;case"opacity":h.gradient&&!h[e]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(h.gradient){(O=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,u)))&&(R=O.getElementsByTagName("stop"),m(R[R.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=r(g,10)+"px");var N=p.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[N]=g,n._.dirty=1,l.setAttribute(p,g)}}k(n,o),l.style.visibility=d},k=function(n,o){if("text"==n.type&&(o[e]("text")||o[e]("font")||o[e]("font-size")||o[e]("x")||o[e]("y"))){var a=n.attrs,s=n.node,l=s.firstChild?r(t._g.doc.defaultView.getComputedStyle(s.firstChild,u).getPropertyValue("font-size"),10):10;if(o[e]("text")){for(a.text=o.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,h=i(o.text).split("\n"),d=[],f=0,p=h.length;f<p;f++)c=m("tspan"),f&&m(c,{dy:1.2*l,x:a.x}),c.appendChild(t._g.doc.createTextNode(h[f])),s.appendChild(c),d[f]=c}else for(f=0,p=(d=s.getElementsByTagName("tspan")).length;f<p;f++)f?m(d[f],{dy:1.2*l,x:a.x}):m(d[0],{dy:0});m(s,{x:a.x,y:a.y}),n._.dirty=1;var g=n._getBBox(),v=a.y-(g.y+g.height/2);v&&t.is(v,"finite")&&m(d[0],{dy:v})}},T=function(t){return t.parentNode&&"a"===t.parentNode.tagName.toLowerCase()?t.parentNode:t},A=function(e,i){this[0]=this.node=e,e.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),e.raphaelid=this.id,this.matrix=t.matrix(),this.realPath=null,this.paper=i,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!i.bottom&&(i.bottom=this),this.prev=i.top,i.top&&(i.top.next=this),i.top=this,this.next=null},D=t.el;A.prototype=D,D.constructor=A,t._engine.path=function(t,e){var i=m("path");e.canvas&&e.canvas.appendChild(i);var n=new A(i,e);return n.type="path",C(n,{fill:"none",stroke:"#000",path:t}),n},D.rotate=function(t,e,r){if(this.removed)return this;if((t=i(t).split(c)).length-1&&(e=n(t[1]),r=n(t[2])),t=n(t[0]),null==r&&(e=r),null==e||null==r){var o=this.getBBox(1);e=o.x+o.width/2,r=o.y+o.height/2}return this.transform(this._.transform.concat([["r",t,e,r]])),this},D.scale=function(t,e,r,o){if(this.removed)return this;if((t=i(t).split(c)).length-1&&(e=n(t[1]),r=n(t[2]),o=n(t[3])),t=n(t[0]),null==e&&(e=t),null==o&&(r=o),null==r||null==o)var a=this.getBBox(1);return r=null==r?a.x+a.width/2:r,o=null==o?a.y+a.height/2:o,this.transform(this._.transform.concat([["s",t,e,r,o]])),this},D.translate=function(t,e){return this.removed?this:((t=i(t).split(c)).length-1&&(e=n(t[1])),t=n(t[0])||0,e=+e||0,this.transform(this._.transform.concat([["t",t,e]])),this)},D.transform=function(i){var n=this._;if(null==i)return n.transform;if(t._extractTransform(this,i),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&x(this),this.node&&m(this.node,{transform:this.matrix}),1!=n.sx||1!=n.sy){var r=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":r})}return this},D.hide=function(){return this.removed||(this.node.style.display="none"),this},D.show=function(){return this.removed||(this.node.style.display=""),this},D.remove=function(){var e=T(this.node);if(!this.removed&&e.parentNode){var i=this.paper;i.__set__&&i.__set__.exclude(this),h.unbind("raphael.*.*."+this.id),this.gradient&&i.defs.removeChild(this.gradient),t._tear(this,i),e.parentNode.removeChild(e),this.removeData();for(var n in this)this[n]="function"==typeof this[n]?t._removedFactory(n):null;this.removed=!0}},D._getBBox=function(){if("none"==this.node.style.display){this.show();var t=!0}var e,i=!1;this.paper.canvas.parentElement?e=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(e=this.paper.canvas.parentNode.style),e&&"none"==e.display&&(i=!0,e.display="");var n={};try{n=this.node.getBBox()}catch(t){n={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{n=n||{},i&&(e.display="none")}return t&&this.hide(),n},D.attr=function(i,n){if(this.removed)return this;if(null==i){var r={};for(var o in this.attrs)this.attrs[e](o)&&(r[o]=this.attrs[o]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==n&&t.is(i,"string")){if("fill"==i&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==i)return this._.transform;for(var a=i.split(c),s={},l=0,u=a.length;l<u;l++)(i=a[l])in this.attrs?s[i]=this.attrs[i]:t.is(this.paper.customAttributes[i],"function")?s[i]=this.paper.customAttributes[i].def:s[i]=t._availableAttrs[i];return u-1?s:s[a[0]]}if(null==n&&t.is(i,"array")){for(s={},l=0,u=i.length;l<u;l++)s[i[l]]=this.attr(i[l]);return s}if(null!=n){var d={};d[i]=n}else null!=i&&t.is(i,"object")&&(d=i);for(var f in d)h("raphael.attr."+f+"."+this.id,this,d[f]);for(f in this.paper.customAttributes)if(this.paper.customAttributes[e](f)&&d[e](f)&&t.is(this.paper.customAttributes[f],"function")){var p=this.paper.customAttributes[f].apply(this,[].concat(d[f]));this.attrs[f]=d[f];for(var g in p)p[e](g)&&(d[g]=p[g])}return C(this,d),this},D.toFront=function(){if(this.removed)return this;var e=T(this.node);e.parentNode.appendChild(e);var i=this.paper;return i.top!=this&&t._tofront(this,i),this},D.toBack=function(){if(this.removed)return this;var e=T(this.node),i=e.parentNode;i.insertBefore(e,i.firstChild),t._toback(this,this.paper);this.paper;return this},D.insertAfter=function(e){if(this.removed||!e)return this;var i=T(this.node),n=T(e.node||e[e.length-1].node);return n.nextSibling?n.parentNode.insertBefore(i,n.nextSibling):n.parentNode.appendChild(i),t._insertafter(this,e,this.paper),this},D.insertBefore=function(e){if(this.removed||!e)return this;var i=T(this.node),n=T(e.node||e[0].node);return n.parentNode.insertBefore(i,n),t._insertbefore(this,e,this.paper),this},D.blur=function(e){var i=this;if(0!=+e){var n=m("filter"),r=m("feGaussianBlur");i.attrs.blur=e,n.id=t.createUUID(),m(r,{stdDeviation:+e||1.5}),n.appendChild(r),i.paper.defs.appendChild(n),i._blur=n,m(i.node,{filter:"url(#"+n.id+")"})}else i._blur&&(i._blur.parentNode.removeChild(i._blur),delete i._blur,delete i.attrs.blur),i.node.removeAttribute("filter");return i},t._engine.circle=function(t,e,i,n){var r=m("circle");t.canvas&&t.canvas.appendChild(r);var o=new A(r,t);return o.attrs={cx:e,cy:i,r:n,fill:"none",stroke:"#000"},o.type="circle",m(r,o.attrs),o},t._engine.rect=function(t,e,i,n,r,o){var a=m("rect");t.canvas&&t.canvas.appendChild(a);var s=new A(a,t);return s.attrs={x:e,y:i,width:n,height:r,rx:o||0,ry:o||0,fill:"none",stroke:"#000"},s.type="rect",m(a,s.attrs),s},t._engine.ellipse=function(t,e,i,n,r){var o=m("ellipse");t.canvas&&t.canvas.appendChild(o);var a=new A(o,t);return a.attrs={cx:e,cy:i,rx:n,ry:r,fill:"none",stroke:"#000"},a.type="ellipse",m(o,a.attrs),a},t._engine.image=function(t,e,i,n,r,o){var a=m("image");m(a,{x:i,y:n,width:r,height:o,preserveAspectRatio:"none"}),a.setAttributeNS(f,"href",e),t.canvas&&t.canvas.appendChild(a);var s=new A(a,t);return s.attrs={x:i,y:n,width:r,height:o,src:e},s.type="image",s},t._engine.text=function(e,i,n,r){var o=m("text");e.canvas&&e.canvas.appendChild(o);var a=new A(o,e);return a.attrs={x:i,y:n,"text-anchor":"middle",text:r,"font-family":t._availableAttrs["font-family"],"font-size":t._availableAttrs["font-size"],stroke:"none",fill:"#000"},a.type="text",C(a,a.attrs),a},t._engine.setSize=function(t,e){return this.width=t||this.width,this.height=e||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},t._engine.create=function(){var e=t._getContainer.apply(0,arguments),i=e&&e.container,n=e.x,r=e.y,o=e.width,a=e.height;if(!i)throw new Error("SVG container not found.");var s,l=m("svg"),c="overflow:hidden;";return n=n||0,r=r||0,o=o||512,a=a||342,m(l,{height:a,version:1.1,width:o,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==i?(l.style.cssText=c+"position:absolute;left:"+n+"px;top:"+r+"px",t._g.doc.body.appendChild(l),s=1):(l.style.cssText=c+"position:relative",i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l)),i=new t._Paper,i.width=o,i.height=a,i.canvas=l,i.clear(),i._left=i._top=0,s&&(i.renderfix=function(){}),i.renderfix(),i},t._engine.setViewBox=function(t,e,i,n,r){h("raphael.setViewBox",this,this._viewBox,[t,e,i,n,r]);var o,s,l=this.getSize(),c=a(i/l.width,n/l.height),u=this.top,f=r?"xMidYMid meet":"xMinYMin";for(null==t?(this._vbSize&&(c=1),delete this._vbSize,o="0 0 "+this.width+d+this.height):(this._vbSize=c,o=t+d+e+d+i+d+n),m(this.canvas,{viewBox:o,preserveAspectRatio:f});c&&u;)s="stroke-width"in u.attrs?u.attrs["stroke-width"]:1,u.attr({"stroke-width":s}),u._.dirty=1,u._.dirtyT=1,u=u.prev;return this._viewBox=[t,e,i,n,!!r],this},t.prototype.renderfix=function(){var t,e=this.canvas,i=e.style;try{t=e.getScreenCTM()||e.createSVGMatrix()}catch(i){t=e.createSVGMatrix()}var n=-t.e%1,r=-t.f%1;(n||r)&&(n&&(this._left=(this._left+n)%1,i.left=this._left+"px"),r&&(this._top=(this._top+r)%1,i.top=this._top+"px"))},t.prototype.clear=function(){t.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=m("desc")).appendChild(t._g.doc.createTextNode("Created with Raphaël "+t.version)),e.appendChild(this.desc),e.appendChild(this.defs=m("defs"))},t.prototype.remove=function(){h("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null};var M=t.st;for(var E in D)D[e](E)&&!M[e](E)&&(M[E]=function(t){return function(){var e=arguments;return this.forEach(function(i){i[t].apply(i,e)})}}(E))}}.apply(e,[i(1)]))&&(t.exports=n)},function(t,e,i){var n;void 0!==(n=function(t){if(!t||t.vml){var e="hasOwnProperty",i=String,n=parseFloat,r=Math,o=r.round,a=r.max,s=r.min,l=r.abs,c=/[, ]+/,h=t.eve,u=" ",d="",f={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},p=/([clmz]),?([^clmz]*)/gi,g=/ progid:\S+Blur\([^\)]+\)/g,m=/-?[^,\s-]+/g,v="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",y=21600,b={path:1,rect:1,image:1},x={circle:1,ellipse:1},_=function(e){var n=/[ahqstv]/gi,r=t._pathToAbsolute;if(i(e).match(n)&&(r=t._path2curve),n=/[clmz]/g,r==t._pathToAbsolute&&!i(e).match(n)){var a=i(e).replace(p,function(t,e,i){var n=[],r="m"==e.toLowerCase(),a=f[e];return i.replace(m,function(t){r&&2==n.length&&(a+=n+f["m"==e?"l":"L"],n=[]),n.push(o(t*y))}),a+n});return a}var s,l,c=r(e);a=[];for(var h=0,g=c.length;h<g;h++){s=c[h],"z"==(l=c[h][0].toLowerCase())&&(l="x");for(var v=1,b=s.length;v<b;v++)l+=o(s[v]*y)+(v!=b-1?",":d);a.push(l)}return a.join(u)},w=function(e,i,n){var r=t.matrix();return r.rotate(-e,.5,.5),{dx:r.x(i,n),dy:r.y(i,n)}},S=function(t,e,i,n,r,o){var a=t._,s=t.matrix,c=a.fillpos,h=t.node,d=h.style,f=1,p="",g=y/e,m=y/i;if(d.visibility="hidden",e&&i){if(h.coordsize=l(g)+u+l(m),d.rotation=o*(e*i<0?-1:1),o){var v=w(o,n,r);n=v.dx,r=v.dy}if(e<0&&(p+="x"),i<0&&(p+=" y")&&(f=-1),d.flip=p,h.coordorigin=n*-g+u+r*-m,c||a.fillsize){var b=h.getElementsByTagName("fill");b=b&&b[0],h.removeChild(b),c&&(v=w(o,s.x(c[0],c[1]),s.y(c[0],c[1])),b.position=v.dx*f+u+v.dy*f),a.fillsize&&(b.size=a.fillsize[0]*l(e)+u+a.fillsize[1]*l(i)),h.appendChild(b)}d.visibility="visible"}};t.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var C=function(t,e,n){for(var r=i(e).toLowerCase().split("-"),o=n?"end":"start",a=r.length,s="classic",l="medium",c="medium";a--;)switch(r[a]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":s=r[a];break;case"wide":case"narrow":c=r[a];break;case"long":case"short":l=r[a]}var h=t.node.getElementsByTagName("stroke")[0];h[o+"arrow"]=s,h[o+"arrowlength"]=l,h[o+"arrowwidth"]=c},k=function(r,l){r.attrs=r.attrs||{};var h=r.node,f=r.attrs,p=h.style,g=b[r.type]&&(l.x!=f.x||l.y!=f.y||l.width!=f.width||l.height!=f.height||l.cx!=f.cx||l.cy!=f.cy||l.rx!=f.rx||l.ry!=f.ry||l.r!=f.r),m=x[r.type]&&(f.cx!=l.cx||f.cy!=l.cy||f.r!=l.r||f.rx!=l.rx||f.ry!=l.ry),v=r;for(var w in l)l[e](w)&&(f[w]=l[w]);if(g&&(f.path=t._getPath[r.type](r),r._.dirty=1),l.href&&(h.href=l.href),l.title&&(h.title=l.title),l.target&&(h.target=l.target),l.cursor&&(p.cursor=l.cursor),"blur"in l&&r.blur(l.blur),(l.path&&"path"==r.type||g)&&(h.path=_(~i(f.path).toLowerCase().indexOf("r")?t._pathToAbsolute(f.path):f.path),r._.dirty=1,"image"==r.type&&(r._.fillpos=[f.x,f.y],r._.fillsize=[f.width,f.height],S(r,1,1,0,0,0))),"transform"in l&&r.transform(l.transform),m){var k=+f.cx,A=+f.cy,D=+f.rx||+f.r||0,E=+f.ry||+f.r||0;h.path=t.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",o((k-D)*y),o((A-E)*y),o((k+D)*y),o((A+E)*y),o(k*y)),r._.dirty=1}if("clip-rect"in l){var P=i(l["clip-rect"]).split(c);if(4==P.length){P[2]=+P[2]+ +P[0],P[3]=+P[3]+ +P[1];var L=h.clipRect||t._g.doc.createElement("div"),I=L.style;I.clip=t.format("rect({1}px {2}px {3}px {0}px)",P),h.clipRect||(I.position="absolute",I.top=0,I.left=0,I.width=r.paper.width+"px",I.height=r.paper.height+"px",h.parentNode.insertBefore(L,h),L.appendChild(h),h.clipRect=L)}l["clip-rect"]||h.clipRect&&(h.clipRect.style.clip="auto")}if(r.textpath){var O=r.textpath.style;l.font&&(O.font=l.font),l["font-family"]&&(O.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,d)+'"'),l["font-size"]&&(O.fontSize=l["font-size"]),l["font-weight"]&&(O.fontWeight=l["font-weight"]),l["font-style"]&&(O.fontStyle=l["font-style"])}if("arrow-start"in l&&C(v,l["arrow-start"]),"arrow-end"in l&&C(v,l["arrow-end"],1),null!=l.opacity||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var R=h.getElementsByTagName("fill");if(!(R=R&&R[0])&&(R=M("fill")),"image"==r.type&&l.src&&(R.src=l.src),l.fill&&(R.on=!0),null!=R.on&&"none"!=l.fill&&null!==l.fill||(R.on=!1),R.on&&l.fill){var N=i(l.fill).match(t._ISURL);if(N){R.parentNode==h&&h.removeChild(R),R.rotate=!0,R.src=N[1],R.type="tile";var F=r.getBBox(1);R.position=F.x+u+F.y,r._.fillpos=[F.x,F.y],t._preload(N[1],function(){r._.fillsize=[this.offsetWidth,this.offsetHeight]})}else R.color=t.getRGB(l.fill).hex,R.src=d,R.type="solid",t.getRGB(l.fill).error&&(v.type in{circle:1,ellipse:1}||"r"!=i(l.fill).charAt())&&T(v,l.fill,R)&&(f.fill="none",f.gradient=l.fill,R.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var z=((+f["fill-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+t.getRGB(l.fill).o+1||2)-1);z=s(a(z,0),1),R.opacity=z,R.src&&(R.color="none")}h.appendChild(R);var H=h.getElementsByTagName("stroke")&&h.getElementsByTagName("stroke")[0],$=!1;!H&&($=H=M("stroke")),(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(H.on=!0),("none"==l.stroke||null===l.stroke||null==H.on||0==l.stroke||0==l["stroke-width"])&&(H.on=!1);var V=t.getRGB(l.stroke);H.on&&l.stroke&&(H.color=V.hex),z=((+f["stroke-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+V.o+1||2)-1);var B=.75*(n(l["stroke-width"])||1);if(z=s(a(z,0),1),null==l["stroke-width"]&&(B=f["stroke-width"]),l["stroke-width"]&&(H.weight=B),B&&B<1&&(z*=B)&&(H.weight=1),H.opacity=z,l["stroke-linejoin"]&&(H.joinstyle=l["stroke-linejoin"]||"miter"),H.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(H.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),"stroke-dasharray"in l){var W={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};H.dashstyle=W[e](l["stroke-dasharray"])?W[l["stroke-dasharray"]]:d}$&&h.appendChild(H)}if("text"==v.type){v.paper.canvas.style.display=d;var j=v.paper.span,U=f.font&&f.font.match(/\d+(?:\.\d*)?(?=px)/);p=j.style,f.font&&(p.font=f.font),f["font-family"]&&(p.fontFamily=f["font-family"]),f["font-weight"]&&(p.fontWeight=f["font-weight"]),f["font-style"]&&(p.fontStyle=f["font-style"]),U=n(f["font-size"]||U&&U[0])||10,p.fontSize=100*U+"px",v.textpath.string&&(j.innerHTML=i(v.textpath.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>"));var Y=j.getBoundingClientRect();v.W=f.w=(Y.right-Y.left)/100,v.H=f.h=(Y.bottom-Y.top)/100,v.X=f.x,v.Y=f.y+v.H/2,("x"in l||"y"in l)&&(v.path.v=t.format("m{0},{1}l{2},{1}",o(f.x*y),o(f.y*y),o(f.x*y)+1));for(var G=["x","y","text","font","font-family","font-weight","font-style","font-size"],q=0,X=G.length;q<X;q++)if(G[q]in l){v._.dirty=1;break}switch(f["text-anchor"]){case"start":v.textpath.style["v-text-align"]="left",v.bbx=v.W/2;break;case"end":v.textpath.style["v-text-align"]="right",v.bbx=-v.W/2;break;default:v.textpath.style["v-text-align"]="center",v.bbx=0}v.textpath.style["v-text-kern"]=!0}},T=function(e,o,a){e.attrs=e.attrs||{};e.attrs;var s=Math.pow,l="linear",c=".5 .5";if(e.attrs.gradient=o,o=i(o).replace(t._radial_gradient,function(t,e,i){return l="radial",e&&i&&(e=n(e),i=n(i),s(e-.5,2)+s(i-.5,2)>.25&&(i=r.sqrt(.25-s(e-.5,2))*(2*(i>.5)-1)+.5),c=e+u+i),d}),o=o.split(/\s*\-\s*/),"linear"==l){var h=o.shift();if(h=-n(h),isNaN(h))return null}var f=t._parseDots(o);if(!f)return null;if(e=e.shape||e.node,f.length){e.removeChild(a),a.on=!0,a.method="none",a.color=f[0].color,a.color2=f[f.length-1].color;for(var p=[],g=0,m=f.length;g<m;g++)f[g].offset&&p.push(f[g].offset+u+f[g].color);a.colors=p.length?p.join():"0% "+a.color,"radial"==l?(a.type="gradientTitle",a.focus="100%",a.focussize="0 0",a.focusposition=c,a.angle=0):(a.type="gradient",a.angle=(270-h)%360),e.appendChild(a)}return 1},A=function(e,i){this[0]=this.node=e,e.raphael=!0,this.id=t._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=i,this.matrix=t.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!i.bottom&&(i.bottom=this),this.prev=i.top,i.top&&(i.top.next=this),i.top=this,this.next=null},D=t.el;A.prototype=D,D.constructor=A,D.transform=function(e){if(null==e)return this._.transform;var n,r=this.paper._viewBoxShift,o=r?"s"+[r.scale,r.scale]+"-1-1t"+[r.dx,r.dy]:d;r&&(n=e=i(e).replace(/\.{3}|\u2026/g,this._.transform||d)),t._extractTransform(this,o+e);var a,s=this.matrix.clone(),l=this.skew,c=this.node,h=~i(this.attrs.fill).indexOf("-"),f=!i(this.attrs.fill).indexOf("url(");if(s.translate(1,1),f||h||"image"==this.type)if(l.matrix="1 0 0 1",l.offset="0 0",a=s.split(),h&&a.noRotation||!a.isSimple){c.style.filter=s.toFilter();var p=this.getBBox(),g=this.getBBox(1),m=p.x-g.x,v=p.y-g.y;c.coordorigin=m*-y+u+v*-y,S(this,1,1,m,v,0)}else c.style.filter=d,S(this,a.scalex,a.scaley,a.dx,a.dy,a.rotate);else c.style.filter=d,l.matrix=i(s),l.offset=s.offset();return null!==n&&(this._.transform=n,t._extractTransform(this,n)),this},D.rotate=function(t,e,r){if(this.removed)return this;if(null!=t){if((t=i(t).split(c)).length-1&&(e=n(t[1]),r=n(t[2])),t=n(t[0]),null==r&&(e=r),null==e||null==r){var o=this.getBBox(1);e=o.x+o.width/2,r=o.y+o.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",t,e,r]])),this}},D.translate=function(t,e){return this.removed?this:((t=i(t).split(c)).length-1&&(e=n(t[1])),t=n(t[0])||0,e=+e||0,this._.bbox&&(this._.bbox.x+=t,this._.bbox.y+=e),this.transform(this._.transform.concat([["t",t,e]])),this)},D.scale=function(t,e,r,o){if(this.removed)return this;if((t=i(t).split(c)).length-1&&(e=n(t[1]),r=n(t[2]),o=n(t[3]),isNaN(r)&&(r=null),isNaN(o)&&(o=null)),t=n(t[0]),null==e&&(e=t),null==o&&(r=o),null==r||null==o)var a=this.getBBox(1);return r=null==r?a.x+a.width/2:r,o=null==o?a.y+a.height/2:o,this.transform(this._.transform.concat([["s",t,e,r,o]])),this._.dirtyT=1,this},D.hide=function(){return!this.removed&&(this.node.style.display="none"),this},D.show=function(){return!this.removed&&(this.node.style.display=d),this},D.auxGetBBox=t.el.getBBox,D.getBBox=function(){var t=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var e={},i=1/this.paper._viewBoxShift.scale;return e.x=t.x-this.paper._viewBoxShift.dx,e.x*=i,e.y=t.y-this.paper._viewBoxShift.dy,e.y*=i,e.width=t.width*i,e.height=t.height*i,e.x2=e.x+e.width,e.y2=e.y+e.height,e}return t},D._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},D.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),t.eve.unbind("raphael.*.*."+this.id),t._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;this.removed=!0}},D.attr=function(i,n){if(this.removed)return this;if(null==i){var r={};for(var o in this.attrs)this.attrs[e](o)&&(r[o]=this.attrs[o]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==n&&t.is(i,"string")){if("fill"==i&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var a=i.split(c),s={},l=0,u=a.length;l<u;l++)(i=a[l])in this.attrs?s[i]=this.attrs[i]:t.is(this.paper.customAttributes[i],"function")?s[i]=this.paper.customAttributes[i].def:s[i]=t._availableAttrs[i];return u-1?s:s[a[0]]}if(this.attrs&&null==n&&t.is(i,"array")){for(s={},l=0,u=i.length;l<u;l++)s[i[l]]=this.attr(i[l]);return s}var d;null!=n&&((d={})[i]=n),null==n&&t.is(i,"object")&&(d=i);for(var f in d)h("raphael.attr."+f+"."+this.id,this,d[f]);if(d){for(f in this.paper.customAttributes)if(this.paper.customAttributes[e](f)&&d[e](f)&&t.is(this.paper.customAttributes[f],"function")){var p=this.paper.customAttributes[f].apply(this,[].concat(d[f]));this.attrs[f]=d[f];for(var g in p)p[e](g)&&(d[g]=p[g])}d.text&&"text"==this.type&&(this.textpath.string=d.text),k(this,d)}return this},D.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&t._tofront(this,this.paper),this},D.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),t._toback(this,this.paper)),this)},D.insertAfter=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),t._insertafter(this,e,this.paper),this)},D.insertBefore=function(e){return this.removed?this:(e.constructor==t.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),t._insertbefore(this,e,this.paper),this)},D.blur=function(e){var i=this.node.runtimeStyle,n=i.filter;return n=n.replace(g,d),0!=+e?(this.attrs.blur=e,i.filter=n+u+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+e||1.5)+")",i.margin=t.format("-{0}px 0 0 -{0}px",o(+e||1.5))):(i.filter=n,i.margin=0,delete this.attrs.blur),this},t._engine.path=function(t,e){var i=M("shape");i.style.cssText=v,i.coordsize=y+u+y,i.coordorigin=e.coordorigin;var n=new A(i,e),r={fill:"none",stroke:"#000"};t&&(r.path=t),n.type="path",n.path=[],n.Path=d,k(n,r),e.canvas&&e.canvas.appendChild(i);var o=M("skew");return o.on=!0,i.appendChild(o),n.skew=o,n.transform(d),n},t._engine.rect=function(e,i,n,r,o,a){var s=t._rectPath(i,n,r,o,a),l=e.path(s),c=l.attrs;return l.X=c.x=i,l.Y=c.y=n,l.W=c.width=r,l.H=c.height=o,c.r=a,c.path=s,l.type="rect",l},t._engine.ellipse=function(t,e,i,n,r){var o=t.path();o.attrs;return o.X=e-n,o.Y=i-r,o.W=2*n,o.H=2*r,o.type="ellipse",k(o,{cx:e,cy:i,rx:n,ry:r}),o},t._engine.circle=function(t,e,i,n){var r=t.path();r.attrs;return r.X=e-n,r.Y=i-n,r.W=r.H=2*n,r.type="circle",k(r,{cx:e,cy:i,r:n}),r},t._engine.image=function(e,i,n,r,o,a){var s=t._rectPath(n,r,o,a),l=e.path(s).attr({stroke:"none"}),c=l.attrs,h=l.node,u=h.getElementsByTagName("fill")[0];return c.src=i,l.X=c.x=n,l.Y=c.y=r,l.W=c.width=o,l.H=c.height=a,c.path=s,l.type="image",u.parentNode==h&&h.removeChild(u),u.rotate=!0,u.src=i,u.type="tile",l._.fillpos=[n,r],l._.fillsize=[o,a],h.appendChild(u),S(l,1,1,0,0,0),l},t._engine.text=function(e,n,r,a){var s=M("shape"),l=M("path"),c=M("textpath");n=n||0,r=r||0,a=a||"",l.v=t.format("m{0},{1}l{2},{1}",o(n*y),o(r*y),o(n*y)+1),l.textpathok=!0,c.string=i(a),c.on=!0,s.style.cssText=v,s.coordsize=y+u+y,s.coordorigin="0 0";var h=new A(s,e),f={fill:"#000",stroke:"none",font:t._availableAttrs.font,text:a};h.shape=s,h.path=l,h.textpath=c,h.type="text",h.attrs.text=i(a),h.attrs.x=n,h.attrs.y=r,h.attrs.w=1,h.attrs.h=1,k(h,f),s.appendChild(c),s.appendChild(l),e.canvas.appendChild(s);var p=M("skew");return p.on=!0,s.appendChild(p),h.skew=p,h.transform(d),h},t._engine.setSize=function(e,i){var n=this.canvas.style;return this.width=e,this.height=i,e==+e&&(e+="px"),i==+i&&(i+="px"),n.width=e,n.height=i,n.clip="rect(0 "+e+" "+i+" 0)",this._viewBox&&t._engine.setViewBox.apply(this,this._viewBox),this},t._engine.setViewBox=function(e,i,n,r,o){t.eve("raphael.setViewBox",this,this._viewBox,[e,i,n,r,o]);var a,s,l=this.getSize(),c=l.width,h=l.height;return o&&(s=c/n,n*(a=h/r)<c&&(e-=(c-n*a)/2/a),r*s<h&&(i-=(h-r*s)/2/s)),this._viewBox=[e,i,n,r,!!o],this._viewBoxShift={dx:-e,dy:-i,scale:l},this.forEach(function(t){t.transform("...")}),this};var M;t._engine.initWin=function(t){var e=t.document;e.styleSheets.length<31?e.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):e.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!e.namespaces.rvml&&e.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),M=function(t){return e.createElement("<rvml:"+t+' class="rvml">')}}catch(t){M=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),i=e.container,n=e.height,r=e.width,o=e.x,a=e.y;if(!i)throw new Error("VML container not found.");var s=new t._Paper,l=s.canvas=t._g.doc.createElement("div"),c=l.style;return o=o||0,a=a||0,r=r||512,n=n||342,s.width=r,s.height=n,r==+r&&(r+="px"),n==+n&&(n+="px"),s.coordsize=216e5+u+216e5,s.coordorigin="0 0",s.span=t._g.doc.createElement("span"),s.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(s.span),c.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",r,n),1==i?(t._g.doc.body.appendChild(l),c.left=o+"px",c.top=a+"px",c.position="absolute"):i.firstChild?i.insertBefore(l,i.firstChild):i.appendChild(l),s.renderfix=function(){},s},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=d,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var E=t.st;for(var P in D)D[e](P)&&!E[e](P)&&(E[P]=function(t){return function(){var e=arguments;return this.forEach(function(i){i[t].apply(i,e)})}}(P))}}.apply(e,[i(1)]))&&(t.exports=n)}])}),function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function e(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function n(t){return null===t?NaN:+t}function r(t){return!isNaN(t)}function o(t){return{left:function(e,i,n,r){for(arguments.length<3&&(n=0),arguments.length<4&&(r=e.length);n<r;){var o=n+r>>>1;t(e[o],i)<0?n=o+1:r=o}return n},right:function(e,i,n,r){for(arguments.length<3&&(n=0),arguments.length<4&&(r=e.length);n<r;){var o=n+r>>>1;t(e[o],i)>0?r=o:n=o+1}return n}}}function a(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function l(t,e){for(var i in e)Object.defineProperty(t.prototype,i,{value:e[i],enumerable:!1})}function c(){this._=Object.create(null)}function h(t){return(t+="")===Jo||t[0]===ta?ta+t:t}function u(t){return(t+="")[0]===ta?t.slice(1):t}function d(t){return h(t)in this._}function f(t){return(t=h(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(u(e));return t}function g(){var t=0;for(var e in this._)++t;return t}function m(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function b(t,e,i){return function(){var n=i.apply(e,arguments);return n===e?t:n}}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var i=0,n=ea.length;i<n;++i){var r=ea[i]+e;if(r in t)return r}}function _(){}function w(){}function S(t){function e(){for(var e,n=i,r=-1,o=n.length;++r<o;)(e=n[r].on)&&e.apply(this,arguments);return t}var i=[],n=new c;return e.on=function(e,r){var o,a=n.get(e);return arguments.length<2?a&&a.on:(a&&(a.on=null,i=i.slice(0,o=i.indexOf(a)).concat(i.slice(o+1)),n.remove(e)),r&&i.push(n.set(e,{on:r})),t)},e}function C(){Bo.event.preventDefault()}function k(){for(var t,e=Bo.event;t=e.sourceEvent;)e=t;return e}function T(t){for(var e=new w,i=0,n=arguments.length;++i<n;)e[arguments[i]]=S(e);return e.of=function(i,n){return function(r){try{var o=r.sourceEvent=Bo.event;r.target=t,Bo.event=r,e[r.type].apply(i,n)}finally{Bo.event=o}}},e}function A(t){return na(t,sa),t}function D(t){return"function"==typeof t?t:function(){return ra(t,this)}}function M(t){return"function"==typeof t?t:function(){return oa(t,this)}}function E(t,e){return t=Bo.ns.qualify(t),null==e?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"==typeof e?t.local?function(){var i=e.apply(this,arguments);null==i?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}:function(){var i=e.apply(this,arguments);null==i?this.removeAttribute(t):this.setAttribute(t,i)}:t.local?function(){this.setAttributeNS(t.space,t.local,e)}:function(){this.setAttribute(t,e)}}function P(t){return t.trim().replace(/\s+/g," ")}function L(t){return new RegExp("(?:^|\\s+)"+Bo.requote(t)+"(?:\\s+|$)","g")}function I(t){return(t+"").trim().split(/^|\s+/)}function O(t,e){var i=(t=I(t).map(R)).length;return"function"==typeof e?function(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}:function(){for(var n=-1;++n<i;)t[n](this,e)}}function R(t){var e=L(t);return function(i,n){if(r=i.classList)return n?r.add(t):r.remove(t);var r=i.getAttribute("class")||"";n?(e.lastIndex=0,e.test(r)||i.setAttribute("class",P(r+" "+t))):i.setAttribute("class",P(r.replace(e," ")))}}function N(t,e,i){return null==e?function(){this.style.removeProperty(t)}:"function"==typeof e?function(){var n=e.apply(this,arguments);null==n?this.style.removeProperty(t):this.style.setProperty(t,n,i)}:function(){this.style.setProperty(t,e,i)}}function F(t,e){return null==e?function(){delete this[t]}:"function"==typeof e?function(){var i=e.apply(this,arguments);null==i?delete this[t]:this[t]=i}:function(){this[t]=e}}function z(t){return"function"==typeof t?t:(t=Bo.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,i=this.namespaceURI;return i===la&&e.documentElement.namespaceURI===la?e.createElement(t):e.createElementNS(i,t)}}function H(){var t=this.parentNode;t&&t.removeChild(this)}function $(t){return{__data__:t}}function V(t){return function(){return aa(this,t)}}function B(t){return arguments.length||(t=i),function(e,i){return e&&i?t(e.__data__,i.__data__):!e-!i}}function W(t,e){for(var i=0,n=t.length;i<n;i++)for(var r,o=t[i],a=0,s=o.length;a<s;a++)(r=o[a])&&e(r,a,i);return t}function j(t){return na(t,ha),t}function U(t){var e,i;return function(n,r,o){var a,s=t[o].update,l=s.length;for(o!=i&&(i=o,e=0),r>=e&&(e=r+1);!(a=s[e])&&++e<l;);return a}}function Y(t,e,i){function n(){var e=this[r];e&&(this.removeEventListener(t,e,e.$),delete this[r])}var r="__on"+t,o=t.indexOf("."),a=G;o>0&&(t=t.slice(0,o));var s=ua.get(t);return s&&(t=s,a=q),o?e?function(){var o=a(e,jo(arguments));n.call(this),this.addEventListener(t,this[r]=o,o.$=i),o._=e}:n:e?_:function(){var e,i=new RegExp("^__on([^.]+)"+Bo.requote(t)+"$");for(var n in this)if(e=n.match(i)){var r=this[n];this.removeEventListener(e[1],r,r.$),delete this[n]}}}function G(t,e){return function(i){var n=Bo.event;Bo.event=i,e[0]=this.__data__;try{t.apply(this,e)}finally{Bo.event=n}}}function q(t,e){var i=G(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||i.call(e,t)}}function X(i){var n=".dragsuppress-"+ ++fa,r="click"+n,o=Bo.select(e(i)).on("touchmove"+n,C).on("dragstart"+n,C).on("selectstart"+n,C);if(null==da&&(da=!("onselectstart"in i)&&x(i.style,"userSelect")),da){var a=t(i).style,s=a[da];a[da]="none"}return function(t){if(o.on(n,null),da&&(a[da]=s),t){var e=function(){o.on(r,null)};o.on(r,function(){C(),e()},!0),setTimeout(e,0)}}}function K(t,i){i.changedTouches&&(i=i.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(pa<0){var o=e(t);if(o.scrollX||o.scrollY){var a=(n=Bo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();pa=!(a.f||a.e),n.remove()}}return pa?(r.x=i.pageX,r.y=i.pageY):(r.x=i.clientX,r.y=i.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var s=t.getBoundingClientRect();return[i.clientX-s.left-t.clientLeft,i.clientY-s.top-t.clientTop]}function Z(){return Bo.event.changedTouches[0].identifier}function Q(t){return t>0?1:t<0?-1:0}function J(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(e[1]-t[1])*(i[0]-t[0])}function tt(t){return t>1?0:t<-1?va:Math.acos(t)}function et(t){return t>1?xa:t<-1?-xa:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function nt(t){return((t=Math.exp(t))+1/t)/2}function rt(t){return((t=Math.exp(2*t))-1)/(t+1)}function ot(t){return(t=Math.sin(t/2))*t}function at(){}function st(t,e,i){return this instanceof st?(this.h=+t,this.s=+e,void(this.l=+i)):arguments.length<2?t instanceof st?new st(t.h,t.s,t.l):_t(""+t,wt,st):new st(t,e,i)}function lt(t,e,i){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?o+(a-o)*t/60:t<180?a:t<240?o+(a-o)*(240-t)/60:o}function r(t){return Math.round(255*n(t))}var o,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,i=i<0?0:i>1?1:i,a=i<=.5?i*(1+e):i+e-i*e,o=2*i-a,new vt(r(t+120),r(t),r(t-120))}function ct(t,e,i){return this instanceof ct?(this.h=+t,this.c=+e,void(this.l=+i)):arguments.length<2?t instanceof ct?new ct(t.h,t.c,t.l):t instanceof ut?ft(t.l,t.a,t.b):ft((t=St((t=Bo.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ct(t,e,i)}function ht(t,e,i){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ut(i,Math.cos(t*=_a)*e,Math.sin(t)*e)}function ut(t,e,i){return this instanceof ut?(this.l=+t,this.a=+e,void(this.b=+i)):arguments.length<2?t instanceof ut?new ut(t.l,t.a,t.b):t instanceof ct?ht(t.h,t.c,t.l):St((t=vt(t)).r,t.g,t.b):new ut(t,e,i)}function dt(t,e,i){var n=(t+16)/116,r=n+e/500,o=n-i/200;return r=pt(r)*Ea,n=pt(n)*Pa,o=pt(o)*La,new vt(mt(3.2404542*r-1.5371385*n-.4985314*o),mt(-.969266*r+1.8760108*n+.041556*o),mt(.0556434*r-.2040259*n+1.0572252*o))}function ft(t,e,i){return t>0?new ct(Math.atan2(i,e)*wa,Math.sqrt(e*e+i*i),t):new ct(NaN,NaN,t)}function pt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function mt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function vt(t,e,i){return this instanceof vt?(this.r=~~t,this.g=~~e,void(this.b=~~i)):arguments.length<2?t instanceof vt?new vt(t.r,t.g,t.b):_t(""+t,vt,lt):new vt(t,e,i)}function yt(t){return new vt(t>>16,t>>8&255,255&t)}function bt(t){return yt(t)+""}function xt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function _t(t,e,i){var n,r,o,a=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(t=t.toLowerCase()))switch(r=n[2].split(","),n[1]){case"hsl":return i(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100);case"rgb":return e(kt(r[0]),kt(r[1]),kt(r[2]))}return(o=Ra.get(t))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a|=a>>4,s=240&o,s|=s>>4,l=15&o,l|=l<<4):7===t.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,l=255&o)),e(a,s,l))}function wt(t,e,i){var n,r,o=Math.min(t/=255,e/=255,i/=255),a=Math.max(t,e,i),s=a-o,l=(a+o)/2;return s?(r=l<.5?s/(a+o):s/(2-a-o),n=t==a?(e-i)/s+(e<i?6:0):e==a?(i-t)/s+2:(t-e)/s+4,n*=60):(n=NaN,r=l>0&&l<1?0:n),new st(n,r,l)}function St(t,e,i){var n=gt((.4124564*(t=Ct(t))+.3575761*(e=Ct(e))+.1804375*(i=Ct(i)))/Ea),r=gt((.2126729*t+.7151522*e+.072175*i)/Pa);return ut(116*r-16,500*(n-r),200*(r-gt((.0193339*t+.119192*e+.9503041*i)/La)))}function Ct(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function kt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Tt(t){return"function"==typeof t?t:function(){return t}}function At(t){return function(e,i,n){return 2===arguments.length&&"function"==typeof i&&(n=i,i=null),Dt(e,i,t,n)}}function Dt(t,e,i,n){function r(){var t,e=l.status;if(!e&&Et(l)||e>=200&&e<300||304===e){try{t=i.call(o,l)}catch(t){return void a.error.call(o,t)}a.load.call(o,t)}else a.error.call(o,l)}var o={},a=Bo.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=r:l.onreadystatechange=function(){l.readyState>3&&r()},l.onprogress=function(t){var e=Bo.event;Bo.event=t;try{a.progress.call(o,l)}finally{Bo.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(c=t,o):c},o.response=function(t){return i=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(jo(arguments)))}}),o.send=function(i,n,r){if(2===arguments.length&&"function"==typeof n&&(r=n,n=null),l.open(i,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var h in s)l.setRequestHeader(h,s[h]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=r&&o.on("error",r).on("load",function(t){r(null,t)}),a.beforesend.call(o,l),l.send(null==n?null:n),o},o.abort=function(){return l.abort(),o},Bo.rebind(o,a,"on"),null==n?o:o.get(Mt(n))}function Mt(t){return 1===t.length?function(e,i){t(null==e?i:null)}:t}function Et(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,i){var n=arguments.length;n<2&&(e=0),n<3&&(i=Date.now());var r={c:t,t:i+e,n:null};return Fa?Fa.n=r:Na=r,Fa=r,za||(Ha=clearTimeout(Ha),za=1,$a(Lt)),r}function Lt(){var t=It(),e=Ot()-t;e>24?(isFinite(e)&&(clearTimeout(Ha),Ha=setTimeout(Lt,e)),za=0):(za=1,$a(Lt))}function It(){for(var t=Date.now(),e=Na;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Ot(){for(var t,e=Na,i=1/0;e;)e.c?(e.t<i&&(i=e.t),e=(t=e).n):e=t?t.n=e.n:Na=e.n;return Fa=t,i}function Rt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Nt(t){var e=t.decimal,i=t.thousands,n=t.grouping,r=t.currency,o=n&&i?function(t,e){for(var r=t.length,o=[],a=0,s=n[0],l=0;r>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),o.push(t.substring(r-=s,r+s)),!((l+=s+1)>e));)s=n[a=(a+1)%n.length];return o.reverse().join(i)}:y;return function(t){var i=Ba.exec(t),n=i[1]||" ",a=i[2]||">",s=i[3]||"-",l=i[4]||"",c=i[5],h=+i[6],u=i[7],d=i[8],f=i[9],p=1,g="",m="",v=!1,y=!0;switch(d&&(d=+d.substring(1)),(c||"0"===n&&"="===a)&&(c=n="0",a="="),f){case"n":u=!0,f="g";break;case"%":p=100,m="%",f="f";break;case"p":p=100,m="%",f="r";break;case"b":case"o":case"x":case"X":"#"===l&&(g="0"+f.toLowerCase());case"c":y=!1;case"d":v=!0,d=0;break;case"s":p=-1,f="r"}"$"===l&&(g=r[0],m=r[1]),"r"!=f||d||(f="g"),null!=d&&("g"==f?d=Math.max(1,Math.min(21,d)):"e"!=f&&"f"!=f||(d=Math.max(0,Math.min(20,d)))),f=Wa.get(f)||Ft;var b=c&&u;return function(t){var i=m;if(v&&t%1)return"";var r=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=Bo.formatPrefix(t,d);t=l.scale(t),i=l.symbol+m}else t*=p;var x,_,w=(t=f(t,d)).lastIndexOf(".");if(w<0){var S=y?t.lastIndexOf("e"):-1;S<0?(x=t,_=""):(x=t.substring(0,S),_=t.substring(S))}else x=t.substring(0,w),_=e+t.substring(w+1);!c&&u&&(x=o(x,1/0));var C=g.length+x.length+_.length+(b?0:r.length),k=C<h?new Array(C=h-C+1).join(n):"";return b&&(x=o(k+x,k.length?h-_.length:1/0)),r+=g,t=x+_,("<"===a?r+t+k:">"===a?k+r+t:"^"===a?k.substring(0,C>>=1)+r+t+k.substring(C):r+(b?t:k+t))+i}}}function Ft(t){return t+""}function zt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(t,e,i){function n(e){var i=t(e),n=o(i,1);return e-i<n-e?i:n}function r(i){return e(i=t(new Ua(i-1)),1),i}function o(t,i){return e(t=new Ua(+t),i),t}function a(t,n,o){var a=r(t),s=[];if(o>1)for(;a<n;)i(a)%o||s.push(new Date(+a)),e(a,1);else for(;a<n;)s.push(new Date(+a)),e(a,1);return s}t.floor=t,t.round=n,t.ceil=r,t.offset=o,t.range=a;var s=t.utc=$t(t);return s.floor=s,s.round=$t(n),s.ceil=$t(r),s.offset=$t(o),s.range=function(t,e,i){try{Ua=zt;var n=new zt;return n._=t,a(n,e,i)}finally{Ua=Date}},t}function $t(t){return function(e,i){try{Ua=zt;var n=new zt;return n._=e,t(n,i)._}finally{Ua=Date}}}function Vt(t){function e(t){function e(e){for(var i,r,o,a=[],s=-1,l=0;++s<n;)37===t.charCodeAt(s)&&(a.push(t.slice(l,s)),null!=(r=Ga[i=t.charAt(++s)])&&(i=t.charAt(++s)),(o=x[i])&&(i=o(e,null==r?"e"===i?" ":"0":r)),a.push(i),l=s+1);return a.push(t.slice(l,s)),a.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(i(n,t,e,0)!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&Ua!==zt,o=new(r?zt:Ua);return"j"in n?o.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),o.setFullYear(n.y,0,1),o.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(o.getDay()+5)%7:n.w+7*n.U-(o.getDay()+6)%7)):o.setFullYear(n.y,n.m,n.d),o.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),r?o._:o},e.toString=function(){return t},e}function i(t,e,i,n){for(var r,o,a,s=0,l=e.length,c=i.length;s<l;){if(n>=c)return-1;if(37===(r=e.charCodeAt(s++))){if(a=e.charAt(s++),!(o=_[a in Ga?e.charAt(s++):a])||(n=o(t,i,n))<0)return-1}else if(r!=i.charCodeAt(n++))return-1}return n}var n=t.dateTime,r=t.date,o=t.time,a=t.periods,s=t.days,l=t.shortDays,c=t.months,h=t.shortMonths;e.multi=(e.utc=function(t){function i(t){try{var e=new(Ua=zt);return e._=t,n(e)}finally{Ua=Date}}var n=e(t);return i.parse=function(t){try{Ua=zt;var e=n.parse(t);return e&&e._}finally{Ua=Date}},i.toString=n.toString,i}).multi=se;var u=Bo.map(),d=Wt(s),f=jt(s),p=Wt(l),g=jt(l),m=Wt(c),v=jt(c),y=Wt(h),b=jt(h);a.forEach(function(t,e){u.set(t.toLowerCase(),e)});var x={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return h[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Bt(t.getDate(),e,2)},e:function(t,e){return Bt(t.getDate(),e,2)},H:function(t,e){return Bt(t.getHours(),e,2)},I:function(t,e){return Bt(t.getHours()%12||12,e,2)},j:function(t,e){return Bt(1+ja.dayOfYear(t),e,3)},L:function(t,e){return Bt(t.getMilliseconds(),e,3)},m:function(t,e){return Bt(t.getMonth()+1,e,2)},M:function(t,e){return Bt(t.getMinutes(),e,2)},p:function(t){return a[+(t.getHours()>=12)]},S:function(t,e){return Bt(t.getSeconds(),e,2)},U:function(t,e){return Bt(ja.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Bt(ja.mondayOfYear(t),e,2)},x:e(r),X:e(o),y:function(t,e){return Bt(t.getFullYear()%100,e,2)},Y:function(t,e){return Bt(t.getFullYear()%1e4,e,4)},Z:oe,"%":function(){return"%"}},_={a:function(t,e,i){p.lastIndex=0;var n=p.exec(e.slice(i));return n?(t.w=g.get(n[0].toLowerCase()),i+n[0].length):-1},A:function(t,e,i){d.lastIndex=0;var n=d.exec(e.slice(i));return n?(t.w=f.get(n[0].toLowerCase()),i+n[0].length):-1},b:function(t,e,i){y.lastIndex=0;var n=y.exec(e.slice(i));return n?(t.m=b.get(n[0].toLowerCase()),i+n[0].length):-1},B:function(t,e,i){m.lastIndex=0;var n=m.exec(e.slice(i));return n?(t.m=v.get(n[0].toLowerCase()),i+n[0].length):-1},c:function(t,e,n){return i(t,x.c.toString(),e,n)},d:Jt,e:Jt,H:ee,I:ee,j:te,L:re,m:Qt,M:ie,p:function(t,e,i){var n=u.get(e.slice(i,i+=2).toLowerCase());return null==n?-1:(t.p=n,i)},S:ne,U:Yt,w:Ut,W:Gt,x:function(t,e,n){return i(t,x.x.toString(),e,n)},X:function(t,e,n){return i(t,x.X.toString(),e,n)},y:Xt,Y:qt,Z:Kt,"%":ae};return e}function Bt(t,e,i){var n=t<0?"-":"",r=(n?-t:t)+"",o=r.length;return n+(o<i?new Array(i-o+1).join(e)+r:r)}function Wt(t){return new RegExp("^(?:"+t.map(Bo.requote).join("|")+")","i")}function jt(t){for(var e=new c,i=-1,n=t.length;++i<n;)e.set(t[i].toLowerCase(),i);return e}function Ut(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+1));return n?(t.w=+n[0],i+n[0].length):-1}function Yt(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i));return n?(t.U=+n[0],i+n[0].length):-1}function Gt(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i));return n?(t.W=+n[0],i+n[0].length):-1}function qt(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+4));return n?(t.y=+n[0],i+n[0].length):-1}function Xt(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+2));return n?(t.y=Zt(+n[0]),i+n[0].length):-1}function Kt(t,e,i){return/^[+-]\d{4}$/.test(e=e.slice(i,i+5))?(t.Z=-e,i+5):-1}function Zt(t){return t+(t>68?1900:2e3)}function Qt(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+2));return n?(t.m=n[0]-1,i+n[0].length):-1}function Jt(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+2));return n?(t.d=+n[0],i+n[0].length):-1}function te(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+3));return n?(t.j=+n[0],i+n[0].length):-1}function ee(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+2));return n?(t.H=+n[0],i+n[0].length):-1}function ie(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+2));return n?(t.M=+n[0],i+n[0].length):-1}function ne(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+2));return n?(t.S=+n[0],i+n[0].length):-1}function re(t,e,i){qa.lastIndex=0;var n=qa.exec(e.slice(i,i+3));return n?(t.L=+n[0],i+n[0].length):-1}function oe(t){var e=t.getTimezoneOffset(),i=e>0?"-":"+",n=Qo(e)/60|0,r=Qo(e)%60;return i+Bt(n,"0",2)+Bt(r,"0",2)}function ae(t,e,i){Xa.lastIndex=0;var n=Xa.exec(e.slice(i,i+1));return n?i+n[0].length:-1}function se(t){for(var e=t.length,i=-1;++i<e;)t[i][0]=this(t[i][0]);return function(e){for(var i=0,n=t[i];!n[1](e);)n=t[++i];return n[0](e)}}function le(){}function ce(t,e,i){var n=i.s=t+e,r=n-t,o=n-r;i.t=t-o+(e-r)}function he(t,e){t&&Ja.hasOwnProperty(t.type)&&Ja[t.type](t,e)}function ue(t,e,i){var n,r=-1,o=t.length-i;for(e.lineStart();++r<o;)n=t[r],e.point(n[0],n[1],n[2]);e.lineEnd()}function de(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)ue(t[i],e,1);e.polygonEnd()}function fe(){function t(t,e){e=e*_a/2+va/4;var i=(t*=_a)-n,a=i>=0?1:-1,s=a*i,l=Math.cos(e),c=Math.sin(e),h=o*c,u=r*l+h*Math.cos(s),d=h*a*Math.sin(s);es.add(Math.atan2(d,u)),n=t,r=l,o=c}var e,i,n,r,o;is.point=function(a,s){is.point=t,n=(e=a)*_a,r=Math.cos(s=(i=s)*_a/2+va/4),o=Math.sin(s)},is.lineEnd=function(){t(e,i)}}function pe(t){var e=t[0],i=t[1],n=Math.cos(i);return[n*Math.cos(e),n*Math.sin(e),Math.sin(i)]}function ge(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function me(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ve(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function ye(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function be(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xe(t){return[Math.atan2(t[1],t[0]),et(t[2])]}function _e(t,e){return Qo(t[0]-e[0])<ga&&Qo(t[1]-e[1])<ga}function we(t,e){t*=_a;var i=Math.cos(e*=_a);Se(i*Math.cos(t),i*Math.sin(t),Math.sin(e))}function Se(t,e,i){os+=(t-os)/++ns,as+=(e-as)/ns,ss+=(i-ss)/ns}function Ce(){function t(t,r){t*=_a;var o=Math.cos(r*=_a),a=o*Math.cos(t),s=o*Math.sin(t),l=Math.sin(r),c=Math.atan2(Math.sqrt((c=i*l-n*s)*c+(c=n*a-e*l)*c+(c=e*s-i*a)*c),e*a+i*s+n*l);rs+=c,ls+=c*(e+(e=a)),cs+=c*(i+(i=s)),hs+=c*(n+(n=l)),Se(e,i,n)}var e,i,n;ps.point=function(r,o){r*=_a;var a=Math.cos(o*=_a);e=a*Math.cos(r),i=a*Math.sin(r),n=Math.sin(o),ps.point=t,Se(e,i,n)}}function ke(){ps.point=we}function Te(){function t(t,e){t*=_a;var i=Math.cos(e*=_a),a=i*Math.cos(t),s=i*Math.sin(t),l=Math.sin(e),c=r*l-o*s,h=o*a-n*l,u=n*s-r*a,d=Math.sqrt(c*c+h*h+u*u),f=n*a+r*s+o*l,p=d&&-tt(f)/d,g=Math.atan2(d,f);us+=p*c,ds+=p*h,fs+=p*u,rs+=g,ls+=g*(n+(n=a)),cs+=g*(r+(r=s)),hs+=g*(o+(o=l)),Se(n,r,o)}var e,i,n,r,o;ps.point=function(a,s){e=a,i=s,ps.point=t,a*=_a;var l=Math.cos(s*=_a);n=l*Math.cos(a),r=l*Math.sin(a),o=Math.sin(s),Se(n,r,o)},ps.lineEnd=function(){t(e,i),ps.lineEnd=ke,ps.point=we}}function Ae(t,e){function i(i,n){return i=t(i,n),e(i[0],i[1])}return t.invert&&e.invert&&(i.invert=function(i,n){return(i=e.invert(i,n))&&t.invert(i[0],i[1])}),i}function De(){return!0}function Me(t,e,i,n,r){var o=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,i=t[0],n=t[e];if(_e(i,n)){r.lineStart();for(var s=0;s<e;++s)r.point((i=t[s])[0],i[1]);r.lineEnd()}else{var l=new Pe(i,t,null,!0),c=new Pe(i,null,l,!1);l.o=c,o.push(l),a.push(c),c=new Pe(n,null,l=new Pe(n,t,null,!1),!0),l.o=c,o.push(l),a.push(c)}}}),a.sort(e),Ee(o),Ee(a),o.length){for(var s=0,l=i,c=a.length;s<c;++s)a[s].e=l=!l;for(var h,u,d=o[0];;){for(var f=d,p=!0;f.v;)if((f=f.n)===d)return;h=f.z,r.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(var s=0,c=h.length;s<c;++s)r.point((u=h[s])[0],u[1]);else n(f.x,f.n.x,1,r);f=f.n}else{if(p)for(s=(h=f.p.z).length-1;s>=0;--s)r.point((u=h[s])[0],u[1]);else n(f.x,f.p.x,-1,r);f=f.p}h=(f=f.o).z,p=!p}while(!f.v);r.lineEnd()}}}function Ee(t){if(e=t.length){for(var e,i,n=0,r=t[0];++n<e;)r.n=i=t[n],i.p=r,r=i;r.n=i=t[0],i.p=r}}function Pe(t,e,i,n){this.x=t,this.z=e,this.o=i,this.e=n,this.v=!1,this.n=this.p=null}function Le(t,e,i,n){return function(r,o){function a(e,i){var n=r(e,i);t(e=n[0],i=n[1])&&o.point(e,i)}function s(t,e){var i=r(t,e);m.point(i[0],i[1])}function l(){y.point=s,m.lineStart()}function c(){y.point=a,m.lineEnd()}function h(t,e){g.push([t,e]);var i=r(t,e);x.point(i[0],i[1])}function u(){x.lineStart(),g=[]}function d(){h(g[0][0],g[0][1]),x.lineEnd();var t,e=x.clean(),i=b.buffer(),n=i.length;if(g.pop(),p.push(g),g=null,n)if(1&e){var r,a=-1;if((n=(t=i[0]).length-1)>0){for(_||(o.polygonStart(),_=!0),o.lineStart();++a<n;)o.point((r=t[a])[0],r[1]);o.lineEnd()}}else n>1&&2&e&&i.push(i.pop().concat(i.shift())),f.push(i.filter(Ie))}var f,p,g,m=e(o),v=r.invert(n[0],n[1]),y={point:a,lineStart:l,lineEnd:c,polygonStart:function(){y.point=h,y.lineStart=u,y.lineEnd=d,f=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=c,f=Bo.merge(f);var t=Fe(v,p);f.length?(_||(o.polygonStart(),_=!0),Me(f,Re,t,i,o)):t&&(_||(o.polygonStart(),_=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),_&&(o.polygonEnd(),_=!1),f=p=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}},b=Oe(),x=e(b),_=!1;return y}}function Ie(t){return t.length>1}function Oe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,i){t.push([e,i])},lineEnd:_,buffer:function(){var i=e;return e=[],t=null,i},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Re(t,e){return((t=t.x)[0]<0?t[1]-xa-ga:xa-t[1])-((e=e.x)[0]<0?e[1]-xa-ga:xa-e[1])}function Ne(t,e,i,n){var r,o,a=Math.sin(t-i);return Qo(a)>ga?Math.atan((Math.sin(e)*(o=Math.cos(n))*Math.sin(i)-Math.sin(n)*(r=Math.cos(e))*Math.sin(t))/(r*o*a)):(e+n)/2}function Fe(t,e){var i=t[0],n=t[1],r=[Math.sin(i),-Math.cos(i),0],o=0,a=0;es.reset();for(var s=0,l=e.length;s<l;++s){var c=e[s],h=c.length;if(h)for(var u=c[0],d=u[0],f=u[1]/2+va/4,p=Math.sin(f),g=Math.cos(f),m=1;;){m===h&&(m=0);var v=(t=c[m])[0],y=t[1]/2+va/4,b=Math.sin(y),x=Math.cos(y),_=v-d,w=_>=0?1:-1,S=w*_,C=S>va,k=p*b;if(es.add(Math.atan2(k*w*Math.sin(S),g*x+k*Math.cos(S))),o+=C?_+w*ya:_,C^d>=i^v>=i){var T=me(pe(u),pe(t));be(T);var A=me(r,T);be(A);var D=(C^_>=0?-1:1)*et(A[2]);(n>D||n===D&&(T[0]||T[1]))&&(a+=C^_>=0?1:-1)}if(!m++)break;d=v,p=b,g=x,u=t}}return(o<-ga||o<ga&&es<-ga)^1&a}function ze(t){function e(t,e){return Math.cos(t)*Math.cos(e)>r}function i(t,e,i){var n=[1,0,0],o=me(pe(t),pe(e)),a=ge(o,o),s=o[0],l=a-s*s;if(!l)return!i&&t;var c=r*a/l,h=-r*s/l,u=me(n,o),d=ye(n,c);ve(d,ye(o,h));var f=u,p=ge(d,f),g=ge(f,f),m=p*p-g*(ge(d,d)-1);if(!(m<0)){var v=Math.sqrt(m),y=ye(f,(-p-v)/g);if(ve(y,d),y=xe(y),!i)return y;var b,x=t[0],_=e[0],w=t[1],S=e[1];_<x&&(b=x,x=_,_=b);var C=_-x,k=Qo(C-va)<ga,T=k||C<ga;if(!k&&S<w&&(b=w,w=S,S=b),T?k?w+S>0^y[1]<(Qo(y[0]-x)<ga?w:S):w<=y[1]&&y[1]<=S:C>va^(x<=y[0]&&y[0]<=_)){var A=ye(f,(-p+v)/g);return ve(A,d),[y,xe(A)]}}}function n(e,i){var n=o?t:va-t,r=0;return e<-n?r|=1:e>n&&(r|=2),i<-n?r|=4:i>n&&(r|=8),r}var r=Math.cos(t),o=r>0,a=Qo(r)>ga;return Le(e,function(t){var r,s,l,c,h;return{lineStart:function(){c=l=!1,h=1},point:function(u,d){var f,p=[u,d],g=e(u,d),m=o?g?0:n(u,d):g?n(u+(u<0?va:-va),d):0;if(!r&&(c=l=g)&&t.lineStart(),g!==l&&(f=i(r,p),(_e(r,f)||_e(p,f))&&(p[0]+=ga,p[1]+=ga,g=e(p[0],p[1]))),g!==l)h=0,g?(t.lineStart(),f=i(p,r),t.point(f[0],f[1])):(f=i(r,p),t.point(f[0],f[1]),t.lineEnd()),r=f;else if(a&&r&&o^g){var v;m&s||!(v=i(p,r,!0))||(h=0,o?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!g||r&&_e(r,p)||t.point(p[0],p[1]),r=p,l=g,s=m},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return h|(c&&l)<<1}}},hi(t,6*_a),o?[0,-t]:[-va,t-va])}function He(t,e,i,n){return function(r){var o,a=r.a,s=r.b,l=a.x,c=a.y,h=0,u=1,d=s.x-l,f=s.y-c;if(o=t-l,d||!(o>0)){if(o/=d,d<0){if(o<h)return;o<u&&(u=o)}else if(d>0){if(o>u)return;o>h&&(h=o)}if(o=i-l,d||!(o<0)){if(o/=d,d<0){if(o>u)return;o>h&&(h=o)}else if(d>0){if(o<h)return;o<u&&(u=o)}if(o=e-c,f||!(o>0)){if(o/=f,f<0){if(o<h)return;o<u&&(u=o)}else if(f>0){if(o>u)return;o>h&&(h=o)}if(o=n-c,f||!(o<0)){if(o/=f,f<0){if(o>u)return;o>h&&(h=o)}else if(f>0){if(o<h)return;o<u&&(u=o)}return h>0&&(r.a={x:l+h*d,y:c+h*f}),u<1&&(r.b={x:l+u*d,y:c+u*f}),r}}}}}}function $e(t,e,i,n){function r(n,r){return Qo(n[0]-t)<ga?r>0?0:3:Qo(n[0]-i)<ga?r>0?2:1:Qo(n[1]-e)<ga?r>0?1:0:r>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var i=r(t,1),n=r(e,1);return i!==n?i-n:0===i?e[1]-t[1]:1===i?t[0]-e[0]:2===i?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,i=p.length,n=t[1],r=0;r<i;++r)for(var o,a=1,s=p[r],l=s.length,c=s[0];a<l;++a)o=s[a],c[1]<=n?o[1]>n&&J(c,o,t)>0&&++e:o[1]<=n&&J(c,o,t)<0&&--e,c=o;return 0!==e}function c(o,s,l,c){var h=0,u=0;if(null==o||(h=r(o,l))!==(u=r(s,l))||a(o,s)<0^l>0)do{c.point(0===h||3===h?t:i,h>1?n:e)}while((h=(h+l+4)%4)!==u);else c.point(s[0],s[1])}function h(r,o){return t<=r&&r<=i&&e<=o&&o<=n}function u(t,e){h(t,e)&&s.point(t,e)}function d(t,e){var i=h(t=Math.max(-ms,Math.min(ms,t)),e=Math.max(-ms,Math.min(ms,e)));if(p&&g.push([t,e]),w)m=t,v=e,y=i,w=!1,i&&(s.lineStart(),s.point(t,e));else if(i&&_)s.point(t,e);else{var n={a:{x:b,y:x},b:{x:t,y:e}};T(n)?(_||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),i||s.lineEnd(),S=!1):i&&(s.lineStart(),s.point(t,e),S=!1)}b=t,x=e,_=i}var f,p,g,m,v,y,b,x,_,w,S,C=s,k=Oe(),T=He(t,e,i,n),A={point:u,lineStart:function(){A.point=d,p&&p.push(g=[]),w=!0,_=!1,b=x=NaN},lineEnd:function(){f&&(d(m,v),y&&_&&k.rejoin(),f.push(k.buffer())),A.point=u,_&&s.lineEnd()},polygonStart:function(){s=k,f=[],p=[],S=!0},polygonEnd:function(){s=C,f=Bo.merge(f);var e=l([t,n]),i=S&&e,r=f.length;(i||r)&&(s.polygonStart(),i&&(s.lineStart(),c(null,null,1,s),s.lineEnd()),r&&Me(f,o,e,c,s),s.polygonEnd()),f=p=g=null}};return A}}function Ve(t){var e=0,i=va/3,n=ii(t),r=n(e,i);return r.parallels=function(t){return arguments.length?n(e=t[0]*va/180,i=t[1]*va/180):[e/va*180,i/va*180]},r}function Be(t,e){function i(t,e){var i=Math.sqrt(o-2*r*Math.sin(e))/r;return[i*Math.sin(t*=r),a-i*Math.cos(t)]}var n=Math.sin(t),r=(n+Math.sin(e))/2,o=1+n*(2*r-n),a=Math.sqrt(o)/r;return i.invert=function(t,e){var i=a-e;return[Math.atan2(t,i)/r,et((o-(t*t+i*i)*r*r)/(2*r))]},i}function We(){function t(t,e){ys+=r*t-n*e,n=t,r=e}var e,i,n,r;Ss.point=function(o,a){Ss.point=t,e=n=o,i=r=a},Ss.lineEnd=function(){t(e,i)}}function je(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e),s.point=i}function i(t,e){a.push("L",t,",",e)}function n(){s.point=t}function r(){a.push("Z")}var o=Ue(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=r},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return o=Ue(t),s},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return s}function Ue(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ye(t,e){os+=t,as+=e,++ss}function Ge(){function t(t,n){var r=t-e,o=n-i,a=Math.sqrt(r*r+o*o);ls+=a*(e+t)/2,cs+=a*(i+n)/2,hs+=a,Ye(e=t,i=n)}var e,i;ks.point=function(n,r){ks.point=t,Ye(e=n,i=r)}}function qe(){ks.point=Ye}function Xe(){function t(t,e){var i=t-n,o=e-r,a=Math.sqrt(i*i+o*o);ls+=a*(n+t)/2,cs+=a*(r+e)/2,hs+=a,us+=(a=r*t-n*e)*(n+t),ds+=a*(r+e),fs+=3*a,Ye(n=t,r=e)}var e,i,n,r;ks.point=function(o,a){ks.point=t,Ye(e=n=o,i=r=a)},ks.lineEnd=function(){t(e,i)}}function Ke(t){function e(e,i){t.moveTo(e+a,i),t.arc(e,i,a,0,ya)}function i(e,i){t.moveTo(e,i),s.point=n}function n(e,i){t.lineTo(e,i)}function r(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=i},lineEnd:r,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=r,s.point=e},pointRadius:function(t){return a=t,s},result:_};return s}function Ze(t){function e(t){return(s?n:i)(t)}function i(e){return ti(e,function(i,n){i=t(i,n),e.point(i[0],i[1])})}function n(e){function i(i,n){i=t(i,n),e.point(i[0],i[1])}function n(){b=NaN,C.point=o,e.lineStart()}function o(i,n){var o=pe([i,n]),a=t(i,n);r(b,x,y,_,w,S,b=a[0],x=a[1],y=i,_=o[0],w=o[1],S=o[2],s,e),e.point(b,x)}function a(){C.point=i,e.lineEnd()}function l(){n(),C.point=c,C.lineEnd=h}function c(t,e){o(u=t,d=e),f=b,p=x,g=_,m=w,v=S,C.point=o}function h(){r(b,x,y,_,w,S,f,p,u,g,m,v,s,e),C.lineEnd=a,a()}var u,d,f,p,g,m,v,y,b,x,_,w,S,C={point:i,lineStart:n,lineEnd:a,polygonStart:function(){e.polygonStart(),C.lineStart=l},polygonEnd:function(){e.polygonEnd(),C.lineStart=n}};return C}function r(e,i,n,s,l,c,h,u,d,f,p,g,m,v){var y=h-e,b=u-i,x=y*y+b*b;if(x>4*o&&m--){var _=s+f,w=l+p,S=c+g,C=Math.sqrt(_*_+w*w+S*S),k=Math.asin(S/=C),T=Qo(Qo(S)-1)<ga||Qo(n-d)<ga?(n+d)/2:Math.atan2(w,_),A=t(T,k),D=A[0],M=A[1],E=D-e,P=M-i,L=b*E-y*P;(L*L/x>o||Qo((y*E+b*P)/x-.5)>.3||s*f+l*p+c*g<a)&&(r(e,i,n,s,l,c,D,M,T,_/=C,w/=C,S,m,v),v.point(D,M),r(D,M,T,_,w,S,h,u,d,f,p,g,m,v))}}var o=.5,a=Math.cos(30*_a),s=16;return e.precision=function(t){return arguments.length?(s=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function Qe(t){var e=Ze(function(e,i){return t([e*wa,i*wa])});return function(t){return ni(e(t))}}function Je(t){this.stream=t}function ti(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function ei(t){return ii(function(){return t})()}function ii(t){function e(t){return t=s(t[0]*_a,t[1]*_a),[t[0]*d+l,c-t[1]*d]}function i(t){return(t=s.invert((t[0]-l)/d,(c-t[1])/d))&&[t[0]*wa,t[1]*wa]}function n(){s=Ae(a=ai(v,b,x),o);var t=o(g,m);return l=f-t[0]*d,c=p+t[1]*d,r()}function r(){return h&&(h.valid=!1,h=null),e}var o,a,s,l,c,h,u=Ze(function(t,e){return t=o(t,e),[t[0]*d+l,c-t[1]*d]}),d=150,f=480,p=250,g=0,m=0,v=0,b=0,x=0,_=gs,w=y,S=null,C=null;return e.stream=function(t){return h&&(h.valid=!1),h=ni(_(a,u(w(t)))),h.valid=!0,h},e.clipAngle=function(t){return arguments.length?(_=null==t?(S=t,gs):ze((S=+t)*_a),r()):S},e.clipExtent=function(t){return arguments.length?(C=t,w=t?$e(t[0][0],t[0][1],t[1][0],t[1][1]):y,r()):C},e.scale=function(t){return arguments.length?(d=+t,n()):d},e.translate=function(t){return arguments.length?(f=+t[0],p=+t[1],n()):[f,p]},e.center=function(t){return arguments.length?(g=t[0]%360*_a,m=t[1]%360*_a,n()):[g*wa,m*wa]},e.rotate=function(t){return arguments.length?(v=t[0]%360*_a,b=t[1]%360*_a,x=t.length>2?t[2]%360*_a:0,n()):[v*wa,b*wa,x*wa]},Bo.rebind(e,u,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&i,n()}}function ni(t){return ti(t,function(e,i){t.point(e*_a,i*_a)})}function ri(t,e){return[t,e]}function oi(t,e){return[t>va?t-ya:t<-va?t+ya:t,e]}function ai(t,e,i){return t?e||i?Ae(li(t),ci(e,i)):li(t):e||i?ci(e,i):oi}function si(t){return function(e,i){return e+=t,[e>va?e-ya:e<-va?e+ya:e,i]}}function li(t){var e=si(t);return e.invert=si(-t),e}function ci(t,e){function i(t,e){var i=Math.cos(e),s=Math.cos(t)*i,l=Math.sin(t)*i,c=Math.sin(e),h=c*n+s*r;return[Math.atan2(l*o-h*a,s*n-c*r),et(h*o+l*a)]}var n=Math.cos(t),r=Math.sin(t),o=Math.cos(e),a=Math.sin(e);return i.invert=function(t,e){var i=Math.cos(e),s=Math.cos(t)*i,l=Math.sin(t)*i,c=Math.sin(e),h=c*o-l*a;return[Math.atan2(l*o+c*a,s*n+h*r),et(h*n-s*r)]},i}function hi(t,e){var i=Math.cos(t),n=Math.sin(t);return function(r,o,a,s){var l=a*e;null!=r?(r=ui(i,r),o=ui(i,o),(a>0?r<o:r>o)&&(r+=a*ya)):(r=t+a*ya,o=t-.5*l);for(var c,h=r;a>0?h>o:h<o;h-=l)s.point((c=xe([i,-n*Math.cos(h),-n*Math.sin(h)]))[0],c[1])}}function ui(t,e){var i=pe(e);i[0]-=t,be(i);var n=tt(-i[1]);return((-i[2]<0?-n:n)+2*Math.PI-ga)%(2*Math.PI)}function di(t,e,i){var n=Bo.range(t,e-ga,i).concat(e);return function(t){return n.map(function(e){return[t,e]})}}function fi(t,e,i){var n=Bo.range(t,e-ga,i).concat(e);return function(t){return n.map(function(e){return[e,t]})}}function pi(t){return t.source}function gi(t){return t.target}function mi(t,e,i,n){var r=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n),l=r*Math.cos(t),c=r*Math.sin(t),h=a*Math.cos(i),u=a*Math.sin(i),d=2*Math.asin(Math.sqrt(ot(n-e)+r*a*ot(i-t))),f=1/Math.sin(d),p=d?function(t){var e=Math.sin(t*=d)*f,i=Math.sin(d-t)*f,n=i*l+e*h,r=i*c+e*u,a=i*o+e*s;return[Math.atan2(r,n)*wa,Math.atan2(a,Math.sqrt(n*n+r*r))*wa]}:function(){return[t*wa,e*wa]};return p.distance=d,p}function vi(t,e){function i(e,i){var n=Math.cos(e),r=Math.cos(i),o=t(n*r);return[o*r*Math.sin(e),o*Math.sin(i)]}return i.invert=function(t,i){var n=Math.sqrt(t*t+i*i),r=e(n),o=Math.sin(r),a=Math.cos(r);return[Math.atan2(t*o,n*a),Math.asin(n&&i*o/n)]},i}function yi(t,e){function i(t,e){a>0?e<-xa+ga&&(e=-xa+ga):e>xa-ga&&(e=xa-ga);var i=a/Math.pow(r(e),o);return[i*Math.sin(o*t),a-i*Math.cos(o*t)]}var n=Math.cos(t),r=function(t){return Math.tan(va/4+t/2)},o=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(r(e)/r(t)),a=n*Math.pow(r(t),o)/o;return o?(i.invert=function(t,e){var i=a-e,n=Q(o)*Math.sqrt(t*t+i*i);return[Math.atan2(t,i)/o,2*Math.atan(Math.pow(a/n,1/o))-xa]},i):xi}function bi(t,e){function i(t,e){var i=o-e;return[i*Math.sin(r*t),o-i*Math.cos(r*t)]}var n=Math.cos(t),r=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),o=n/r+t;return Qo(r)<ga?ri:(i.invert=function(t,e){var i=o-e;return[Math.atan2(t,i)/r,o-Q(r)*Math.sqrt(t*t+i*i)]},i)}function xi(t,e){return[t,Math.log(Math.tan(va/4+e/2))]}function _i(t){var e,i=ei(t),n=i.scale,r=i.translate,o=i.clipExtent;return i.scale=function(){var t=n.apply(i,arguments);return t===i?e?i.clipExtent(null):i:t},i.translate=function(){var t=r.apply(i,arguments);return t===i?e?i.clipExtent(null):i:t},i.clipExtent=function(t){var a=o.apply(i,arguments);if(a===i){if(e=null==t){var s=va*n(),l=r();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else e&&(a=null);return a},i.clipExtent(null)}function wi(t,e){return[Math.log(Math.tan(va/4+e/2)),-t]}function Si(t){return t[0]}function Ci(t){return t[1]}function ki(t){for(var e=t.length,i=[0,1],n=2,r=2;r<e;r++){for(;n>1&&J(t[i[n-2]],t[i[n-1]],t[r])<=0;)--n;i[n++]=r}return i.slice(0,n)}function Ti(t,e){return t[0]-e[0]||t[1]-e[1]}function Ai(t,e,i){return(i[0]-e[0])*(t[1]-e[1])<(i[1]-e[1])*(t[0]-e[0])}function Di(t,e,i,n){var r=t[0],o=i[0],a=e[0]-r,s=n[0]-o,l=t[1],c=i[1],h=e[1]-l,u=n[1]-c,d=(s*(l-c)-u*(r-o))/(u*a-s*h);return[r+d*a,l+d*h]}function Mi(t){var e=t[0],i=t[t.length-1];return!(e[0]-i[0]||e[1]-i[1])}function Ei(){Zi(this),this.edge=this.site=this.circle=null}function Pi(t){var e=Hs.pop()||new Ei;return e.site=t,e}function Li(t){Bi(t),Ns.remove(t),Hs.push(t),Zi(t)}function Ii(t){var e=t.circle,i=e.x,n=e.cy,r={x:i,y:n},o=t.P,a=t.N,s=[t];Li(t);for(var l=o;l.circle&&Qo(i-l.circle.x)<ga&&Qo(n-l.circle.cy)<ga;)o=l.P,s.unshift(l),Li(l),l=o;s.unshift(l),Bi(l);for(var c=a;c.circle&&Qo(i-c.circle.x)<ga&&Qo(n-c.circle.cy)<ga;)a=c.N,s.push(c),Li(c),c=a;s.push(c),Bi(c);var h,u=s.length;for(h=1;h<u;++h)c=s[h],l=s[h-1],qi(c.edge,l.site,c.site,r);l=s[0],(c=s[u-1]).edge=Yi(l.site,c.site,null,r),Vi(l),Vi(c)}function Oi(t){for(var e,i,n,r,o=t.x,a=t.y,s=Ns._;s;)if((n=Ri(s,a)-o)>ga)s=s.L;else{if(!((r=o-Ni(s,a))>ga)){n>-ga?(e=s.P,i=s):r>-ga?(e=s,i=s.N):e=i=s;break}if(!s.R){e=s;break}s=s.R}var l=Pi(t);if(Ns.insert(e,l),e||i){if(e===i)return Bi(e),i=Pi(e.site),Ns.insert(l,i),l.edge=i.edge=Yi(e.site,l.site),Vi(e),void Vi(i);if(i){Bi(e),Bi(i);var c=e.site,h=c.x,u=c.y,d=t.x-h,f=t.y-u,p=i.site,g=p.x-h,m=p.y-u,v=2*(d*m-f*g),y=d*d+f*f,b=g*g+m*m,x={x:(m*y-f*b)/v+h,y:(d*b-g*y)/v+u};qi(i.edge,c,p,x),l.edge=Yi(c,t,null,x),i.edge=Yi(t,p,null,x),Vi(e),Vi(i)}else l.edge=Yi(e.site,l.site)}}function Ri(t,e){var i=t.site,n=i.x,r=i.y,o=r-e;if(!o)return n;var a=t.P;if(!a)return-1/0;var s=(i=a.site).x,l=i.y,c=l-e;if(!c)return s;var h=s-n,u=1/o-1/c,d=h/c;return u?(-d+Math.sqrt(d*d-2*u*(h*h/(-2*c)-l+c/2+r-o/2)))/u+n:(n+s)/2}function Ni(t,e){var i=t.N;if(i)return Ri(i,e);var n=t.site;return n.y===e?n.x:1/0}function Fi(t){this.site=t,this.edges=[]}function zi(t){for(var e,i,n,r,o,a,s,l,c,h,u=t[0][0],d=t[1][0],f=t[0][1],p=t[1][1],g=Rs,m=g.length;m--;)if((o=g[m])&&o.prepare())for(l=(s=o.edges).length,a=0;a<l;)n=(h=s[a].end()).x,r=h.y,e=(c=s[++a%l].start()).x,i=c.y,(Qo(n-e)>ga||Qo(r-i)>ga)&&(s.splice(a,0,new Xi(Gi(o.site,h,Qo(n-u)<ga&&p-r>ga?{x:u,y:Qo(e-u)<ga?i:p}:Qo(r-p)<ga&&d-n>ga?{x:Qo(i-p)<ga?e:d,y:p}:Qo(n-d)<ga&&r-f>ga?{x:d,y:Qo(e-d)<ga?i:f}:Qo(r-f)<ga&&n-u>ga?{x:Qo(i-f)<ga?e:u,y:f}:null),o.site,null)),++l)}function Hi(t,e){return e.angle-t.angle}function $i(){Zi(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vi(t){var e=t.P,i=t.N;if(e&&i){var n=e.site,r=t.site,o=i.site;if(n!==o){var a=r.x,s=r.y,l=n.x-a,c=n.y-s,h=o.x-a,u=2*(l*(m=o.y-s)-c*h);if(!(u>=-ma)){var d=l*l+c*c,f=h*h+m*m,p=(m*d-c*f)/u,g=(l*f-h*d)/u,m=g+s,v=$s.pop()||new $i;v.arc=t,v.site=r,v.x=p+a,v.y=m+Math.sqrt(p*p+g*g),v.cy=m,t.circle=v;for(var y=null,b=zs._;b;)if(v.y<b.y||v.y===b.y&&v.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}zs.insert(y,v),y||(Fs=v)}}}}function Bi(t){var e=t.circle;e&&(e.P||(Fs=e.N),zs.remove(e),$s.push(e),Zi(e),t.circle=null)}function Wi(t){for(var e,i=Os,n=He(t[0][0],t[0][1],t[1][0],t[1][1]),r=i.length;r--;)(!ji(e=i[r],t)||!n(e)||Qo(e.a.x-e.b.x)<ga&&Qo(e.a.y-e.b.y)<ga)&&(e.a=e.b=null,i.splice(r,1))}function ji(t,e){var i=t.b;if(i)return!0;var n,r,o=t.a,a=e[0][0],s=e[1][0],l=e[0][1],c=e[1][1],h=t.l,u=t.r,d=h.x,f=h.y,p=u.x,g=u.y,m=(d+p)/2,v=(f+g)/2;if(g===f){if(m<a||m>=s)return;if(d>p){if(o){if(o.y>=c)return}else o={x:m,y:l};i={x:m,y:c}}else{if(o){if(o.y<l)return}else o={x:m,y:c};i={x:m,y:l}}}else if(n=(d-p)/(g-f),r=v-n*m,n<-1||n>1)if(d>p){if(o){if(o.y>=c)return}else o={x:(l-r)/n,y:l};i={x:(c-r)/n,y:c}}else{if(o){if(o.y<l)return}else o={x:(c-r)/n,y:c};i={x:(l-r)/n,y:l}}else if(f<g){if(o){if(o.x>=s)return}else o={x:a,y:n*a+r};i={x:s,y:n*s+r}}else{if(o){if(o.x<a)return}else o={x:s,y:n*s+r};i={x:a,y:n*a+r}}return t.a=o,t.b=i,!0}function Ui(t,e){this.l=t,this.r=e,this.a=this.b=null}function Yi(t,e,i,n){var r=new Ui(t,e);return Os.push(r),i&&qi(r,t,e,i),n&&qi(r,e,t,n),Rs[t.i].edges.push(new Xi(r,t,e)),Rs[e.i].edges.push(new Xi(r,e,t)),r}function Gi(t,e,i){var n=new Ui(t,null);return n.a=e,n.b=i,Os.push(n),n}function qi(t,e,i,n){t.a||t.b?t.l===i?t.b=n:t.a=n:(t.a=n,t.l=e,t.r=i)}function Xi(t,e,i){var n=t.a,r=t.b;this.edge=t,this.site=e,this.angle=i?Math.atan2(i.y-e.y,i.x-e.x):t.l===e?Math.atan2(r.x-n.x,n.y-r.y):Math.atan2(n.x-r.x,r.y-n.y)}function Ki(){this._=null}function Zi(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function Qi(t,e){var i=e,n=e.R,r=i.U;r?r.L===i?r.L=n:r.R=n:t._=n,n.U=r,i.U=n,i.R=n.L,i.R&&(i.R.U=i),n.L=i}function Ji(t,e){var i=e,n=e.L,r=i.U;r?r.L===i?r.L=n:r.R=n:t._=n,n.U=r,i.U=n,i.L=n.R,i.L&&(i.L.U=i),n.R=i}function tn(t){for(;t.L;)t=t.L;return t}function en(t,e){var i,n,r,o=t.sort(nn).pop();for(Os=[],Rs=new Array(t.length),Ns=new Ki,zs=new Ki;;)if(r=Fs,o&&(!r||o.y<r.y||o.y===r.y&&o.x<r.x))o.x===i&&o.y===n||(Rs[o.i]=new Fi(o),Oi(o),i=o.x,n=o.y),o=t.pop();else{if(!r)break;Ii(r.arc)}e&&(Wi(e),zi(e));var a={cells:Rs,edges:Os};return Ns=zs=Os=Rs=null,a}function nn(t,e){return e.y-t.y||e.x-t.x}function rn(t,e,i){return(t.x-i.x)*(e.y-t.y)-(t.x-e.x)*(i.y-t.y)}function on(t){return t.x}function an(t){return t.y}function sn(t,e,i,n,r,o){if(!t(e,i,n,r,o)){var a=.5*(i+r),s=.5*(n+o),l=e.nodes;l[0]&&sn(t,l[0],i,n,a,s),l[1]&&sn(t,l[1],a,n,r,s),l[2]&&sn(t,l[2],i,s,a,o),l[3]&&sn(t,l[3],a,s,r,o)}}function ln(t,e,i,n,r,o,a){var s,l=1/0;return function t(c,h,u,d,f){if(!(h>o||u>a||d<n||f<r)){if(p=c.point){var p,g=e-c.x,m=i-c.y,v=g*g+m*m;if(v<l){var y=Math.sqrt(l=v);n=e-y,r=i-y,o=e+y,a=i+y,s=p}}for(var b=c.nodes,x=.5*(h+d),_=.5*(u+f),w=(i>=_)<<1|e>=x,S=w+4;w<S;++w)if(c=b[3&w])switch(3&w){case 0:t(c,h,u,x,_);break;case 1:t(c,x,u,d,_);break;case 2:t(c,h,_,x,f);break;case 3:t(c,x,_,d,f)}}}(t,n,r,o,a),s}function cn(t,e){t=Bo.rgb(t),e=Bo.rgb(e);var i=t.r,n=t.g,r=t.b,o=e.r-i,a=e.g-n,s=e.b-r;return function(t){return"#"+xt(Math.round(i+o*t))+xt(Math.round(n+a*t))+xt(Math.round(r+s*t))}}function hn(t,e){var i,n={},r={};for(i in t)i in e?n[i]=fn(t[i],e[i]):r[i]=t[i];for(i in e)i in t||(r[i]=e[i]);return function(t){for(i in n)r[i]=n[i](t);return r}}function un(t,e){return t=+t,e=+e,function(i){return t*(1-i)+e*i}}function dn(t,e){var i,n,r,o=Bs.lastIndex=Ws.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(i=Bs.exec(t))&&(n=Ws.exec(e));)(r=n.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(i=i[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,l.push({i:a,x:un(i,n)})),o=Ws.lastIndex;return o<e.length&&(r=e.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?(e=l[0].x,function(t){return e(t)+""}):function(){return e}:(e=l.length,function(t){for(var i,n=0;n<e;++n)s[(i=l[n]).i]=i.x(t);return s.join("")})}function fn(t,e){for(var i,n=Bo.interpolators.length;--n>=0&&!(i=Bo.interpolators[n](t,e)););return i}function pn(t,e){var i,n=[],r=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(i=0;i<s;++i)n.push(fn(t[i],e[i]));for(;i<o;++i)r[i]=t[i];for(;i<a;++i)r[i]=e[i];return function(t){for(i=0;i<s;++i)r[i]=n[i](t);return r}}function gn(t){return function(e){return e<=0?0:e>=1?1:t(e)}}function mn(t){return function(e){return 1-t(1-e)}}function vn(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function yn(t){return t*t}function bn(t){return t*t*t}function xn(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function _n(t){return 1-Math.cos(t*xa)}function wn(t){return Math.pow(2,10*(t-1))}function Sn(t){return 1-Math.sqrt(1-t*t)}function Cn(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}function kn(t,e){return e-=t,function(i){return Math.round(t+e*i)}}function Tn(t){var e=[t.a,t.b],i=[t.c,t.d],n=Dn(e),r=An(e,i),o=Dn(Mn(i,e,-r))||0;e[0]*i[1]<i[0]*e[1]&&(e[0]*=-1,e[1]*=-1,n*=-1,r*=-1),this.rotate=(n?Math.atan2(e[1],e[0]):Math.atan2(-i[0],i[1]))*wa,this.translate=[t.e,t.f],this.scale=[n,o],this.skew=o?Math.atan2(r,o)*wa:0}function An(t,e){return t[0]*e[0]+t[1]*e[1]}function Dn(t){var e=Math.sqrt(An(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Mn(t,e,i){return t[0]+=i*e[0],t[1]+=i*e[1],t}function En(t){return t.length?t.pop()+",":""}function Pn(t,e,i,n){if(t[0]!==e[0]||t[1]!==e[1]){var r=i.push("translate(",null,",",null,")");n.push({i:r-4,x:un(t[0],e[0])},{i:r-2,x:un(t[1],e[1])})}else(e[0]||e[1])&&i.push("translate("+e+")")}function Ln(t,e,i,n){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),n.push({i:i.push(En(i)+"rotate(",null,")")-2,x:un(t,e)})):e&&i.push(En(i)+"rotate("+e+")")}function In(t,e,i,n){t!==e?n.push({i:i.push(En(i)+"skewX(",null,")")-2,x:un(t,e)}):e&&i.push(En(i)+"skewX("+e+")")}function On(t,e,i,n){if(t[0]!==e[0]||t[1]!==e[1]){var r=i.push(En(i)+"scale(",null,",",null,")");n.push({i:r-4,x:un(t[0],e[0])},{i:r-2,x:un(t[1],e[1])})}else 1===e[0]&&1===e[1]||i.push(En(i)+"scale("+e+")")}function Rn(t,e){var i=[],n=[];return t=Bo.transform(t),e=Bo.transform(e),Pn(t.translate,e.translate,i,n),Ln(t.rotate,e.rotate,i,n),In(t.skew,e.skew,i,n),On(t.scale,e.scale,i,n),t=e=null,function(t){for(var e,r=-1,o=n.length;++r<o;)i[(e=n[r]).i]=e.x(t);return i.join("")}}function Nn(t,e){return e=(e-=t=+t)||1/e,function(i){return(i-t)/e}}function Fn(t,e){return e=(e-=t=+t)||1/e,function(i){return Math.max(0,Math.min(1,(i-t)/e))}}function zn(t){for(var e=t.source,i=t.target,n=$n(e,i),r=[e];e!==n;)e=e.parent,r.push(e);for(var o=r.length;i!==n;)r.splice(o,0,i),i=i.parent;return r}function Hn(t){for(var e=[],i=t.parent;null!=i;)e.push(t),t=i,i=i.parent;return e.push(t),e}function $n(t,e){if(t===e)return t;for(var i=Hn(t),n=Hn(e),r=i.pop(),o=n.pop(),a=null;r===o;)a=r,r=i.pop(),o=n.pop();return a}function Vn(t){t.fixed|=2}function Bn(t){t.fixed&=-7}function Wn(t){t.fixed|=4,t.px=t.x,t.py=t.y}function jn(t){t.fixed&=-5}function Un(t,e,i){var n=0,r=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,s=a.length,l=-1;++l<s;)null!=(o=a[l])&&(Un(o,e,i),t.charge+=o.charge,n+=o.charge*o.cx,r+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*i[t.point.index];t.charge+=t.pointCharge=c,n+=c*t.point.x,r+=c*t.point.y}t.cx=n/t.charge,t.cy=r/t.charge}function Yn(t,e){return Bo.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=Qn,t}function Gn(t,e){for(var i=[t];null!=(t=i.pop());)if(e(t),(r=t.children)&&(n=r.length))for(var n,r;--n>=0;)i.push(r[n])}function qn(t,e){for(var i=[t],n=[];null!=(t=i.pop());)if(n.push(t),(o=t.children)&&(r=o.length))for(var r,o,a=-1;++a<r;)i.push(o[a]);for(;null!=(t=n.pop());)e(t)}function Xn(t){return t.children}function Kn(t){return t.value}function Zn(t,e){return e.value-t.value}function Qn(t){return Bo.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function Jn(t){return t.x}function tr(t){return t.y}function er(t,e,i){t.y0=e,t.y=i}function ir(t){return Bo.range(t.length)}function nr(t){for(var e=-1,i=t[0].length,n=[];++e<i;)n[e]=0;return n}function rr(t){for(var e,i=1,n=0,r=t[0][1],o=t.length;i<o;++i)(e=t[i][1])>r&&(n=i,r=e);return n}function or(t){return t.reduce(ar,0)}function ar(t,e){return t+e[1]}function sr(t,e){return lr(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function lr(t,e){for(var i=-1,n=+t[0],r=(t[1]-n)/e,o=[];++i<=e;)o[i]=r*i+n;return o}function cr(t){return[Bo.min(t),Bo.max(t)]}function hr(t,e){return t.value-e.value}function ur(t,e){var i=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=i,i._pack_prev=e}function dr(t,e){t._pack_next=e,e._pack_prev=t}function fr(t,e){var i=e.x-t.x,n=e.y-t.y,r=t.r+e.r;return.999*r*r>i*i+n*n}function pr(t){function e(t){h=Math.min(t.x-t.r,h),u=Math.max(t.x+t.r,u),d=Math.min(t.y-t.r,d),f=Math.max(t.y+t.r,f)}if((i=t.children)&&(c=i.length)){var i,n,r,o,a,s,l,c,h=1/0,u=-1/0,d=1/0,f=-1/0;if(i.forEach(gr),n=i[0],n.x=-n.r,n.y=0,e(n),c>1&&(r=i[1],r.x=r.r,r.y=0,e(r),c>2))for(yr(n,r,o=i[2]),e(o),ur(n,o),n._pack_prev=o,ur(o,r),r=n._pack_next,a=3;a<c;a++){yr(n,r,o=i[a]);var p=0,g=1,m=1;for(s=r._pack_next;s!==r;s=s._pack_next,g++)if(fr(s,o)){p=1;break}if(1==p)for(l=n._pack_prev;l!==s._pack_prev&&!fr(l,o);l=l._pack_prev,m++);p?(g<m||g==m&&r.r<n.r?dr(n,r=s):dr(n=l,r),a--):(ur(n,o),r=o,e(o))}var v=(h+u)/2,y=(d+f)/2,b=0;for(a=0;a<c;a++)(o=i[a]).x-=v,o.y-=y,b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=b,i.forEach(mr)}}function gr(t){t._pack_next=t._pack_prev=t}function mr(t){delete t._pack_next,delete t._pack_prev}function vr(t,e,i,n){var r=t.children;if(t.x=e+=n*t.x,t.y=i+=n*t.y,t.r*=n,r)for(var o=-1,a=r.length;++o<a;)vr(r[o],e,i,n)}function yr(t,e,i){var n=t.r+i.r,r=e.x-t.x,o=e.y-t.y;if(n&&(r||o)){var a=e.r+i.r,s=r*r+o*o,l=.5+((n*=n)-(a*=a))/(2*s),c=Math.sqrt(Math.max(0,2*a*(n+s)-(n-=s)*n-a*a))/(2*s);i.x=t.x+l*r+c*o,i.y=t.y+l*o-c*r}else i.x=t.x+n,i.y=t.y}function br(t,e){return t.parent==e.parent?1:2}function xr(t){var e=t.children;return e.length?e[0]:t.t}function _r(t){var e,i=t.children;return(e=i.length)?i[e-1]:t.t}function wr(t,e,i){var n=i/(e.i-t.i);e.c-=n,e.s+=i,t.c+=n,e.z+=i,e.m+=i}function Sr(t){for(var e,i=0,n=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=i,e.m+=i,i+=e.s+(n+=e.c)}function Cr(t,e,i){return t.a.parent===e.parent?t.a:i}function kr(t){return 1+Bo.max(t,function(t){return t.y})}function Tr(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ar(t){var e=t.children;return e&&e.length?Ar(e[0]):t}function Dr(t){var e,i=t.children;return i&&(e=i.length)?Dr(i[e-1]):t}function Mr(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Er(t,e){var i=t.x+e[3],n=t.y+e[0],r=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return r<0&&(i+=r/2,r=0),o<0&&(n+=o/2,o=0),{x:i,y:n,dx:r,dy:o}}function Pr(t){var e=t[0],i=t[t.length-1];return e<i?[e,i]:[i,e]}function Lr(t){return t.rangeExtent?t.rangeExtent():Pr(t.range())}function Ir(t,e,i,n){var r=i(t[0],t[1]),o=n(e[0],e[1]);return function(t){return o(r(t))}}function Or(t,e){var i,n=0,r=t.length-1,o=t[n],a=t[r];return a<o&&(i=n,n=r,r=i,i=o,o=a,a=i),t[n]=e.floor(o),t[r]=e.ceil(a),t}function Rr(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:tl}function Nr(t,e,i,n){var r=[],o=[],a=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=s;)r.push(i(t[a-1],t[a])),o.push(n(e[a-1],e[a]));return function(e){var i=Bo.bisect(t,e,1,s)-1;return o[i](r[i](e))}}function Fr(t,e,i,n){function r(){var r=Math.min(t.length,e.length)>2?Nr:Ir,l=n?Fn:Nn;return a=r(t,e,l,i),s=r(e,t,l,fn),o}function o(t){return a(t)}var a,s;return o.invert=function(t){return s(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),r()):t},o.range=function(t){return arguments.length?(e=t,r()):e},o.rangeRound=function(t){return o.range(t).interpolate(kn)},o.clamp=function(t){return arguments.length?(n=t,r()):n},o.interpolate=function(t){return arguments.length?(i=t,r()):i},o.ticks=function(e){return Vr(t,e)},o.tickFormat=function(e,i){return Br(t,e,i)},o.nice=function(e){return Hr(t,e),r()},o.copy=function(){return Fr(t,e,i,n)},r()}function zr(t,e){return Bo.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Hr(t,e){return Or(t,Rr($r(t,e)[2])),Or(t,Rr($r(t,e)[2])),t}function $r(t,e){null==e&&(e=10);var i=Pr(t),n=i[1]-i[0],r=Math.pow(10,Math.floor(Math.log(n/e)/Math.LN10)),o=e/n*r;return o<=.15?r*=10:o<=.35?r*=5:o<=.75&&(r*=2),i[0]=Math.ceil(i[0]/r)*r,i[1]=Math.floor(i[1]/r)*r+.5*r,i[2]=r,i}function Vr(t,e){return Bo.range.apply(Bo,$r(t,e))}function Br(t,e,i){var n=$r(t,e);if(i){var r=Ba.exec(i);if(r.shift(),"s"===r[8]){var o=Bo.formatPrefix(Math.max(Qo(n[0]),Qo(n[1])));return r[7]||(r[7]="."+Wr(o.scale(n[2]))),r[8]="f",i=Bo.format(r.join("")),function(t){return i(o.scale(t))+o.symbol}}r[7]||(r[7]="."+jr(r[8],n)),i=r.join("")}else i=",."+Wr(n[2])+"f";return Bo.format(i)}function Wr(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function jr(t,e){var i=Wr(e[2]);return t in el?Math.abs(i-Wr(Math.max(Qo(e[0]),Qo(e[1]))))+ +("e"!==t):i-2*("%"===t)}function Ur(t,e,i,n){function r(t){return(i?Math.log(t<0?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return i?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(r(e))}return a.invert=function(e){return o(t.invert(e))},a.domain=function(e){return arguments.length?(i=e[0]>=0,t.domain((n=e.map(Number)).map(r)),a):n},a.base=function(i){return arguments.length?(e=+i,t.domain(n.map(r)),a):e},a.nice=function(){var e=Or(n.map(r),i?Math:nl);return t.domain(e),n=e.map(o),a},a.ticks=function(){var t=Pr(n),a=[],s=t[0],l=t[1],c=Math.floor(r(s)),h=Math.ceil(r(l)),u=e%1?2:e;if(isFinite(h-c)){if(i){for(;c<h;c++)for(d=1;d<u;d++)a.push(o(c)*d);a.push(o(c))}else for(a.push(o(c));c++<h;)for(var d=u-1;d>0;d--)a.push(o(c)*d);for(c=0;a[c]<s;c++);for(h=a.length;a[h-1]>l;h--);a=a.slice(c,h)}return a},a.tickFormat=function(t,i){if(!arguments.length)return il;arguments.length<2?i=il:"function"!=typeof i&&(i=Bo.format(i));var n=Math.max(1,e*t/a.ticks().length);return function(t){var a=t/o(Math.round(r(t)));return a*e<e-.5&&(a*=e),a<=n?i(t):""}},a.copy=function(){return Ur(t.copy(),e,i,n)},zr(a,t)}function Yr(t,e,i){function n(e){return t(r(e))}var r=Gr(e),o=Gr(1/e);return n.invert=function(e){return o(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain((i=e.map(Number)).map(r)),n):i},n.ticks=function(t){return Vr(i,t)},n.tickFormat=function(t,e){return Br(i,t,e)},n.nice=function(t){return n.domain(Hr(i,t))},n.exponent=function(a){return arguments.length?(r=Gr(e=a),o=Gr(1/e),t.domain(i.map(r)),n):e},n.copy=function(){return Yr(t.copy(),e,i)},zr(n,t)}function Gr(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function qr(t,e){function i(i){return o[((r.get(i)||("range"===e.t?r.set(i,t.push(i)):NaN))-1)%o.length]}function n(e,i){return Bo.range(t.length).map(function(t){return e+i*t})}var r,o,a;return i.domain=function(n){if(!arguments.length)return t;t=[],r=new c;for(var o,a=-1,s=n.length;++a<s;)r.has(o=n[a])||r.set(o,t.push(o));return i[e.t].apply(i,e.a)},i.range=function(t){return arguments.length?(o=t,a=0,e={t:"range",a:arguments},i):o},i.rangePoints=function(r,s){arguments.length<2&&(s=0);var l=r[0],c=r[1],h=t.length<2?(l=(l+c)/2,0):(c-l)/(t.length-1+s);return o=n(l+h*s/2,h),a=0,e={t:"rangePoints",a:arguments},i},i.rangeRoundPoints=function(r,s){arguments.length<2&&(s=0);var l=r[0],c=r[1],h=t.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(t.length-1+s)|0;return o=n(l+Math.round(h*s/2+(c-l-(t.length-1+s)*h)/2),h),a=0,e={t:"rangeRoundPoints",a:arguments},i},i.rangeBands=function(r,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var c=r[1]<r[0],h=r[c-0],u=(r[1-c]-h)/(t.length-s+2*l);return o=n(h+u*l,u),c&&o.reverse(),a=u*(1-s),e={t:"rangeBands",a:arguments},i},i.rangeRoundBands=function(r,s,l){arguments.length<2&&(s=0),arguments.length<3&&(l=s);var c=r[1]<r[0],h=r[c-0],u=r[1-c],d=Math.floor((u-h)/(t.length-s+2*l));return o=n(h+Math.round((u-h-(t.length-s)*d)/2),d),c&&o.reverse(),a=Math.round(d*(1-s)),e={t:"rangeRoundBands",a:arguments},i},i.rangeBand=function(){return a},i.rangeExtent=function(){return Pr(e.a[0])},i.copy=function(){return qr(t,e)},i.domain(t)}function Xr(t,e){function o(){var i=0,n=e.length;for(s=[];++i<n;)s[i-1]=Bo.quantile(t,i/n);return a}function a(t){if(!isNaN(t=+t))return e[Bo.bisect(s,t)]}var s;return a.domain=function(e){return arguments.length?(t=e.map(n).filter(r).sort(i),o()):t},a.range=function(t){return arguments.length?(e=t,o()):e},a.quantiles=function(){return s},a.invertExtent=function(i){return(i=e.indexOf(i))<0?[NaN,NaN]:[i>0?s[i-1]:t[0],i<s.length?s[i]:t[t.length-1]]},a.copy=function(){return Xr(t,e)},o()}function Kr(t,e,i){function n(e){return i[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function r(){return o=i.length/(e-t),a=i.length-1,n}var o,a;return n.domain=function(i){return arguments.length?(t=+i[0],e=+i[i.length-1],r()):[t,e]},n.range=function(t){return arguments.length?(i=t,r()):i},n.invertExtent=function(e){return e=i.indexOf(e),e=e<0?NaN:e/o+t,[e,e+1/o]},n.copy=function(){return Kr(t,e,i)},r()}function Zr(t,e){function i(i){if(i<=i)return e[Bo.bisect(t,i)]}return i.domain=function(e){return arguments.length?(t=e,i):t},i.range=function(t){return arguments.length?(e=t,i):e},i.invertExtent=function(i){return i=e.indexOf(i),[t[i-1],t[i]]},i.copy=function(){return Zr(t,e)},i}function Qr(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(i){return arguments.length?(t=i.map(e),e):t},e.ticks=function(e){return Vr(t,e)},e.tickFormat=function(e,i){return Br(t,e,i)},e.copy=function(){return Qr(t)},e}function Jr(){return 0}function to(t){return t.innerRadius}function eo(t){return t.outerRadius}function io(t){return t.startAngle}function no(t){return t.endAngle}function ro(t){return t&&t.padAngle}function oo(t,e,i,n){return(t-i)*e-(e-n)*t>0?0:1}function ao(t,e,i,n,r){var o=t[0]-e[0],a=t[1]-e[1],s=(r?n:-n)/Math.sqrt(o*o+a*a),l=s*a,c=-s*o,h=t[0]+l,u=t[1]+c,d=e[0]+l,f=e[1]+c,p=(h+d)/2,g=(u+f)/2,m=d-h,v=f-u,y=m*m+v*v,b=i-n,x=h*f-d*u,_=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*v-m*_)/y,S=(-x*m-v*_)/y,C=(x*v+m*_)/y,k=(-x*m+v*_)/y,T=w-p,A=S-g,D=C-p,M=k-g;return T*T+A*A>D*D+M*M&&(w=C,S=k),[[w-l,S-c],[w*i/b,S*i/b]]}function so(t){function e(e){function a(){c.push("M",o(t(h),s))}for(var l,c=[],h=[],u=-1,d=e.length,f=Tt(i),p=Tt(n);++u<d;)r.call(this,l=e[u],u)?h.push([+f.call(this,l,u),+p.call(this,l,u)]):h.length&&(a(),h=[]);return h.length&&a(),c.length?c.join(""):null}var i=Si,n=Ci,r=De,o=lo,a=o.key,s=.7;return e.x=function(t){return arguments.length?(i=t,e):i},e.y=function(t){return arguments.length?(n=t,e):n},e.defined=function(t){return arguments.length?(r=t,e):r},e.interpolate=function(t){return arguments.length?(a="function"==typeof t?o=t:(o=cl.get(t)||lo).key,e):a},e.tension=function(t){return arguments.length?(s=t,e):s},e}function lo(t){return t.length>1?t.join("L"):t+"Z"}function co(t){return t.join("L")+"Z"}function ho(t){for(var e=0,i=t.length,n=t[0],r=[n[0],",",n[1]];++e<i;)r.push("V",(n=t[e])[1],"H",n[0]);return r.join("")}function uo(t){for(var e=0,i=t.length,n=t[0],r=[n[0],",",n[1]];++e<i;)r.push("H",(n=t[e])[0],"V",n[1]);return r.join("")}function fo(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return lo(t);var i=t.length!=e.length,n="",r=t[0],o=t[1],a=e[0],s=a,l=1;if(i&&(n+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],r=t[1],l=2),e.length>1){s=e[1],o=t[l],l++,n+="C"+(r[0]+a[0])+","+(r[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var c=2;c<e.length;c++,l++)o=t[l],s=e[c],n+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(i){var h=t[l];n+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+h[0]+","+h[1]}return n}function po(t,e){for(var i,n=[],r=(1-e)/2,o=t[0],a=t[1],s=1,l=t.length;++s<l;)i=o,o=a,a=t[s],n.push([r*(a[0]-i[0]),r*(a[1]-i[1])]);return n}function go(t){if(t.length<3)return lo(t);var e=1,i=t.length,n=t[0],r=n[0],o=n[1],a=[r,r,r,(n=t[1])[0]],s=[o,o,o,n[1]],l=[r,",",o,"L",mo(dl,a),",",mo(dl,s)];for(t.push(t[i-1]);++e<=i;)n=t[e],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),vo(l,a,s);return t.pop(),l.push("L",n),l.join("")}function mo(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function vo(t,e,i){t.push("C",mo(hl,e),",",mo(hl,i),",",mo(ul,e),",",mo(ul,i),",",mo(dl,e),",",mo(dl,i))}function yo(t,e){return(e[1]-t[1])/(e[0]-t[0])}function bo(t){for(var e=0,i=t.length-1,n=[],r=t[0],o=t[1],a=n[0]=yo(r,o);++e<i;)n[e]=(a+(a=yo(r=o,o=t[e+1])))/2;return n[e]=a,n}function xo(t){for(var e,i,n,r,o=[],a=bo(t),s=-1,l=t.length-1;++s<l;)e=yo(t[s],t[s+1]),Qo(e)<ga?a[s]=a[s+1]=0:(r=(i=a[s]/e)*i+(n=a[s+1]/e)*n)>9&&(r=3*e/Math.sqrt(r),a[s]=r*i,a[s+1]=r*n);for(s=-1;++s<=l;)r=(t[Math.min(l,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([r||0,a[s]*r||0]);return o}function _o(t){for(var e,i,n,r=-1,o=t.length;++r<o;)i=(e=t[r])[0],n=e[1]-xa,e[0]=i*Math.cos(n),e[1]=i*Math.sin(n);return t}function wo(t){function e(e){function l(){g.push("M",s(t(v),u),h,c(t(m.reverse()),u),"Z")}for(var d,f,p,g=[],m=[],v=[],y=-1,b=e.length,x=Tt(i),_=Tt(r),w=i===n?function(){return f}:Tt(n),S=r===o?function(){return p}:Tt(o);++y<b;)a.call(this,d=e[y],y)?(m.push([f=+x.call(this,d,y),p=+_.call(this,d,y)]),v.push([+w.call(this,d,y),+S.call(this,d,y)])):m.length&&(l(),m=[],v=[]);return m.length&&l(),g.length?g.join(""):null}var i=Si,n=Si,r=0,o=Ci,a=De,s=lo,l=s.key,c=s,h="L",u=.7;return e.x=function(t){return arguments.length?(i=n=t,e):n},e.x0=function(t){return arguments.length?(i=t,e):i},e.x1=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=o=t,e):o},e.y0=function(t){return arguments.length?(r=t,e):r},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?s=t:(s=cl.get(t)||lo).key,c=s.reverse||s,h=s.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(u=t,e):u},e}function So(t){return t.radius}function Co(t){return[t.x,t.y]}function ko(t){return function(){var e=t.apply(this,arguments),i=e[0],n=e[1]-xa;return[i*Math.cos(n),i*Math.sin(n)]}}function To(){return 64}function Ao(){return"circle"}function Do(t){var e=Math.sqrt(t/va);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Mo(t){return function(){var e,i,n;(e=this[t])&&(n=e[i=e.active])&&(n.timer.c=null,n.timer.t=NaN,--e.count?delete e[i]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Eo(t,e,i){return na(t,bl),t.namespace=e,t.id=i,t}function Po(t,e,i,n){var r=t.id,o=t.namespace;return W(t,"function"==typeof i?function(t,a,s){t[o][r].tween.set(e,n(i.call(t,t.__data__,a,s)))}:(i=n(i),function(t){t[o][r].tween.set(e,i)}))}function Lo(t){return null==t&&(t=""),function(){this.textContent=t}}function Io(t){return null==t?"__transition__":"__transition_"+t+"__"}function Oo(t,e,i,n,r){function o(i){var r=f.active,o=f[r];o&&(o.timer.c=null,o.timer.t=NaN,--f.count,delete f[r],o.event&&o.event.interrupt.call(t,t.__data__,o.index));for(var c in f)if(+c<n){var g=f[c];g.timer.c=null,g.timer.t=NaN,--f.count,delete f[c]}l.c=a,Pt(function(){return l.c&&a(i||1)&&(l.c=null,l.t=NaN),1},0,s),f.active=n,p.event&&p.event.start.call(t,t.__data__,e),d=[],p.tween.forEach(function(i,n){(n=n.call(t,t.__data__,e))&&d.push(n)}),u=p.ease,h=p.duration}function a(r){for(var o=r/h,a=u(o),s=d.length;s>0;)d[--s].call(t,a);if(o>=1)return p.event&&p.event.end.call(t,t.__data__,e),--f.count?delete f[n]:delete t[i],1}var s,l,h,u,d,f=t[i]||(t[i]={active:0,count:0}),p=f[n];p||(s=r.time,l=Pt(function(t){var e=p.delay;if(l.t=e+s,e<=t)return o(t-e);l.c=o},0,s),p=f[n]={tween:new c,time:s,timer:l,delay:r.delay,duration:r.duration,ease:r.ease,index:e},r=null,++f.count)}function Ro(t,e,i){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:i(t))+",0)"})}function No(t,e,i){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:i(t))+")"})}function Fo(t){return t.toISOString()}function zo(t,e,i){function n(e){return t(e)}function r(t,i){var n=(t[1]-t[0])/i,r=Bo.bisect(Dl,n);return r==Dl.length?[e.year,$r(t.map(function(t){return t/31536e6}),i)[2]]:r?e[n/Dl[r-1]<Dl[r]/n?r-1:r]:[Pl,$r(t,i)[2]]}return n.invert=function(e){return Ho(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e),n):t.domain().map(Ho)},n.nice=function(t,e){function i(i){return!isNaN(i)&&!t.range(i,Ho(+i+1),e).length}var o=n.domain(),a=Pr(o),s=null==t?r(a,10):"number"==typeof t&&r(a,t);return s&&(t=s[0],e=s[1]),n.domain(Or(o,e>1?{floor:function(e){for(;i(e=t.floor(e));)e=Ho(e-1);return e},ceil:function(e){for(;i(e=t.ceil(e));)e=Ho(+e+1);return e}}:t))},n.ticks=function(t,e){var i=Pr(n.domain()),o=null==t?r(i,10):"number"==typeof t?r(i,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(i[0],Ho(+i[1]+1),e<1?1:e)},n.tickFormat=function(){return i},n.copy=function(){return zo(t.copy(),e,i)},zr(n,t)}function Ho(t){return new Date(t)}function $o(t){return JSON.parse(t.responseText)}function Vo(t){var e=Uo.createRange();return e.selectNode(Uo.body),e.createContextualFragment(t.responseText)}var Bo={version:"3.5.17"},Wo=[].slice,jo=function(t){return Wo.call(t)},Uo=this.document;if(Uo)try{jo(Uo.documentElement.childNodes)[0].nodeType}catch(t){jo=function(t){for(var e=t.length,i=new Array(e);e--;)i[e]=t[e];return i}}if(Date.now||(Date.now=function(){return+new Date}),Uo)try{Uo.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var Yo=this.Element.prototype,Go=Yo.setAttribute,qo=Yo.setAttributeNS,Xo=this.CSSStyleDeclaration.prototype,Ko=Xo.setProperty;Yo.setAttribute=function(t,e){Go.call(this,t,e+"")},Yo.setAttributeNS=function(t,e,i){qo.call(this,t,e,i+"")},Xo.setProperty=function(t,e,i){Ko.call(this,t,e+"",i)}}Bo.ascending=i,Bo.descending=function(t,e){return e<t?-1:e>t?1:e>=t?0:NaN},Bo.min=function(t,e){var i,n,r=-1,o=t.length;if(1===arguments.length){for(;++r<o;)if(null!=(n=t[r])&&n>=n){i=n;break}for(;++r<o;)null!=(n=t[r])&&i>n&&(i=n)}else{for(;++r<o;)if(null!=(n=e.call(t,t[r],r))&&n>=n){i=n;break}for(;++r<o;)null!=(n=e.call(t,t[r],r))&&i>n&&(i=n)}return i},Bo.max=function(t,e){var i,n,r=-1,o=t.length;if(1===arguments.length){for(;++r<o;)if(null!=(n=t[r])&&n>=n){i=n;break}for(;++r<o;)null!=(n=t[r])&&n>i&&(i=n)}else{for(;++r<o;)if(null!=(n=e.call(t,t[r],r))&&n>=n){i=n;break}for(;++r<o;)null!=(n=e.call(t,t[r],r))&&n>i&&(i=n)}return i},Bo.extent=function(t,e){var i,n,r,o=-1,a=t.length;if(1===arguments.length){for(;++o<a;)if(null!=(n=t[o])&&n>=n){i=r=n;break}for(;++o<a;)null!=(n=t[o])&&(i>n&&(i=n),r<n&&(r=n))}else{for(;++o<a;)if(null!=(n=e.call(t,t[o],o))&&n>=n){i=r=n;break}for(;++o<a;)null!=(n=e.call(t,t[o],o))&&(i>n&&(i=n),r<n&&(r=n))}return[i,r]},Bo.sum=function(t,e){var i,n=0,o=t.length,a=-1;if(1===arguments.length)for(;++a<o;)r(i=+t[a])&&(n+=i);else for(;++a<o;)r(i=+e.call(t,t[a],a))&&(n+=i);return n},Bo.mean=function(t,e){var i,o=0,a=t.length,s=-1,l=a;if(1===arguments.length)for(;++s<a;)r(i=n(t[s]))?o+=i:--l;else for(;++s<a;)r(i=n(e.call(t,t[s],s)))?o+=i:--l;if(l)return o/l},Bo.quantile=function(t,e){var i=(t.length-1)*e+1,n=Math.floor(i),r=+t[n-1],o=i-n;return o?r+o*(t[n]-r):r},Bo.median=function(t,e){var o,a=[],s=t.length,l=-1;if(1===arguments.length)for(;++l<s;)r(o=n(t[l]))&&a.push(o);else for(;++l<s;)r(o=n(e.call(t,t[l],l)))&&a.push(o);if(a.length)return Bo.quantile(a.sort(i),.5)},Bo.variance=function(t,e){var i,o,a=t.length,s=0,l=0,c=-1,h=0;if(1===arguments.length)for(;++c<a;)r(i=n(t[c]))&&(l+=(o=i-s)*(i-(s+=o/++h)));else for(;++c<a;)r(i=n(e.call(t,t[c],c)))&&(l+=(o=i-s)*(i-(s+=o/++h)));if(h>1)return l/(h-1)},Bo.deviation=function(){var t=Bo.variance.apply(this,arguments);return t?Math.sqrt(t):t};var Zo=o(i);Bo.bisectLeft=Zo.left,Bo.bisect=Bo.bisectRight=Zo.right,Bo.bisector=function(t){return o(1===t.length?function(e,n){return i(t(e),n)}:t)},Bo.shuffle=function(t,e,i){(o=arguments.length)<3&&(i=t.length,o<2&&(e=0));for(var n,r,o=i-e;o;)r=Math.random()*o--|0,n=t[o+e],t[o+e]=t[r+e],t[r+e]=n;return t},Bo.permute=function(t,e){for(var i=e.length,n=new Array(i);i--;)n[i]=t[e[i]];return n},Bo.pairs=function(t){for(var e=0,i=t.length-1,n=t[0],r=new Array(i<0?0:i);e<i;)r[e]=[n,n=t[++e]];return r},Bo.transpose=function(t){if(!(r=t.length))return[];for(var e=-1,i=Bo.min(t,a),n=new Array(i);++e<i;)for(var r,o=-1,s=n[e]=new Array(r);++o<r;)s[o]=t[o][e];return n},Bo.zip=function(){return Bo.transpose(arguments)},Bo.keys=function(t){var e=[];for(var i in t)e.push(i);return e},Bo.values=function(t){var e=[];for(var i in t)e.push(t[i]);return e},Bo.entries=function(t){var e=[];for(var i in t)e.push({key:i,value:t[i]});return e},Bo.merge=function(t){for(var e,i,n,r=t.length,o=-1,a=0;++o<r;)a+=t[o].length;for(i=new Array(a);--r>=0;)for(e=(n=t[r]).length;--e>=0;)i[--a]=n[e];return i};var Qo=Math.abs;Bo.range=function(t,e,i){if(arguments.length<3&&(i=1,arguments.length<2&&(e=t,t=0)),(e-t)/i==1/0)throw new Error("infinite range");var n,r=[],o=s(Qo(i)),a=-1;if(t*=o,e*=o,(i*=o)<0)for(;(n=t+i*++a)>e;)r.push(n/o);else for(;(n=t+i*++a)<e;)r.push(n/o);return r},Bo.map=function(t,e){var i=new c;if(t instanceof c)t.forEach(function(t,e){i.set(t,e)});else if(Array.isArray(t)){var n,r=-1,o=t.length;if(1===arguments.length)for(;++r<o;)i.set(r,t[r]);else for(;++r<o;)i.set(e.call(t,n=t[r],r),n)}else for(var a in t)i.set(a,t[a]);return i};var Jo="__proto__",ta="\0";l(c,{has:d,get:function(t){return this._[h(t)]},set:function(t,e){return this._[h(t)]=e},remove:f,keys:p,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:u(e),value:this._[e]});return t},size:g,empty:m,forEach:function(t){for(var e in this._)t.call(this,u(e),this._[e])}}),Bo.nest=function(){function t(e,a,s){if(s>=o.length)return n?n.call(r,a):i?a.sort(i):a;for(var l,h,u,d,f=-1,p=a.length,g=o[s++],m=new c;++f<p;)(d=m.get(l=g(h=a[f])))?d.push(h):m.set(l,[h]);return e?(h=e(),u=function(i,n){h.set(i,t(e,n,s))}):(h={},u=function(i,n){h[i]=t(e,n,s)}),m.forEach(u),h}function e(t,i){if(i>=o.length)return t;var n=[],r=a[i++];return t.forEach(function(t,r){n.push({key:t,values:e(r,i)})}),r?n.sort(function(t,e){return r(t.key,e.key)}):n}var i,n,r={},o=[],a=[];return r.map=function(e,i){return t(i,e,0)},r.entries=function(i){return e(t(Bo.map,i,0),0)},r.key=function(t){return o.push(t),r},r.sortKeys=function(t){return a[o.length-1]=t,r},r.sortValues=function(t){return i=t,r},r.rollup=function(t){return n=t,r},r},Bo.set=function(t){var e=new v;if(t)for(var i=0,n=t.length;i<n;++i)e.add(t[i]);return e},l(v,{has:d,add:function(t){return this._[h(t+="")]=!0,t},remove:f,values:p,size:g,empty:m,forEach:function(t){for(var e in this._)t.call(this,u(e))}}),Bo.behavior={},Bo.rebind=function(t,e){for(var i,n=1,r=arguments.length;++n<r;)t[i=arguments[n]]=b(t,e,e[i]);return t};var ea=["webkit","ms","moz","Moz","o","O"];Bo.dispatch=function(){for(var t=new w,e=-1,i=arguments.length;++e<i;)t[arguments[e]]=S(t);return t},w.prototype.on=function(t,e){var i=t.indexOf("."),n="";if(i>=0&&(n=t.slice(i+1),t=t.slice(0,i)),t)return arguments.length<2?this[t].on(n):this[t].on(n,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(n,null);return this}},Bo.event=null,Bo.requote=function(t){return t.replace(ia,"\\$&")};var ia=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,na={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)t[i]=e[i]},ra=function(t,e){return e.querySelector(t)},oa=function(t,e){return e.querySelectorAll(t)},aa=function(t,e){var i=t.matches||t[x(t,"matchesSelector")];return(aa=function(t,e){return i.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ra=function(t,e){return Sizzle(t,e)[0]||null},oa=Sizzle,aa=Sizzle.matchesSelector),Bo.selection=function(){return Bo.select(Uo.documentElement)};var sa=Bo.selection.prototype=[];sa.select=function(t){var e,i,n,r,o=[];t=D(t);for(var a=-1,s=this.length;++a<s;){o.push(e=[]),e.parentNode=(n=this[a]).parentNode;for(var l=-1,c=n.length;++l<c;)(r=n[l])?(e.push(i=t.call(r,r.__data__,l,a)),i&&"__data__"in r&&(i.__data__=r.__data__)):e.push(null)}return A(o)},sa.selectAll=function(t){var e,i,n=[];t=M(t);for(var r=-1,o=this.length;++r<o;)for(var a=this[r],s=-1,l=a.length;++s<l;)(i=a[s])&&(n.push(e=jo(t.call(i,i.__data__,s,r))),e.parentNode=i);return A(n)};var la="http://www.w3.org/1999/xhtml",ca={svg:"http://www.w3.org/2000/svg",xhtml:la,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Bo.ns={prefix:ca,qualify:function(t){var e=t.indexOf(":"),i=t;return e>=0&&"xmlns"!==(i=t.slice(0,e))&&(t=t.slice(e+1)),ca.hasOwnProperty(i)?{space:ca[i],local:t}:t}},sa.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var i=this.node();return(t=Bo.ns.qualify(t)).local?i.getAttributeNS(t.space,t.local):i.getAttribute(t)}for(e in t)this.each(E(e,t[e]));return this}return this.each(E(t,e))},sa.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var i=this.node(),n=(t=I(t)).length,r=-1;if(e=i.classList){for(;++r<n;)if(!e.contains(t[r]))return!1}else for(e=i.getAttribute("class");++r<n;)if(!L(t[r]).test(e))return!1;return!0}for(e in t)this.each(O(e,t[e]));return this}return this.each(O(t,e))},sa.style=function(t,i,n){var r=arguments.length;if(r<3){if("string"!=typeof t){r<2&&(i="");for(n in t)this.each(N(n,t[n],i));return this}if(r<2){var o=this.node();return e(o).getComputedStyle(o,null).getPropertyValue(t)}n=""}return this.each(N(t,i,n))},sa.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(F(e,t[e]));return this}return this.each(F(t,e))},sa.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},sa.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},sa.append=function(t){return t=z(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},sa.insert=function(t,e){return t=z(t),e=D(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},sa.remove=function(){return this.each(H)},sa.data=function(t,e){function i(t,i){var n,r,o,a=t.length,u=i.length,d=Math.min(a,u),f=new Array(u),p=new Array(u),g=new Array(a);if(e){var m,v=new c,y=new Array(a);for(n=-1;++n<a;)(r=t[n])&&(v.has(m=e.call(r,r.__data__,n))?g[n]=r:v.set(m,r),y[n]=m);for(n=-1;++n<u;)(r=v.get(m=e.call(i,o=i[n],n)))?!0!==r&&(f[n]=r,r.__data__=o):p[n]=$(o),v.set(m,!0);for(n=-1;++n<a;)n in y&&!0!==v.get(y[n])&&(g[n]=t[n])}else{for(n=-1;++n<d;)r=t[n],o=i[n],r?(r.__data__=o,f[n]=r):p[n]=$(o);for(;n<u;++n)p[n]=$(i[n]);for(;n<a;++n)g[n]=t[n]}p.update=f,p.parentNode=f.parentNode=g.parentNode=t.parentNode,s.push(p),l.push(f),h.push(g)}var n,r,o=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(n=this[0]).length);++o<a;)(r=n[o])&&(t[o]=r.__data__);return t}var s=j([]),l=A([]),h=A([]);if("function"==typeof t)for(;++o<a;)i(n=this[o],t.call(n,n.parentNode.__data__,o));else for(;++o<a;)i(n=this[o],t);return l.enter=function(){return s},l.exit=function(){return h},l},sa.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},sa.filter=function(t){var e,i,n,r=[];"function"!=typeof t&&(t=V(t));for(var o=0,a=this.length;o<a;o++){r.push(e=[]),e.parentNode=(i=this[o]).parentNode;for(var s=0,l=i.length;s<l;s++)(n=i[s])&&t.call(n,n.__data__,s,o)&&e.push(n)}return A(r)},sa.order=function(){for(var t=-1,e=this.length;++t<e;)for(var i,n=this[t],r=n.length-1,o=n[r];--r>=0;)(i=n[r])&&(o&&o!==i.nextSibling&&o.parentNode.insertBefore(i,o),o=i);return this},sa.sort=function(t){t=B.apply(this,arguments);for(var e=-1,i=this.length;++e<i;)this[e].sort(t);return this.order()},sa.each=function(t){return W(this,function(e,i,n){t.call(e,e.__data__,i,n)})},sa.call=function(t){var e=jo(arguments);return t.apply(e[0]=this,e),this},sa.empty=function(){return!this.node()},sa.node=function(){for(var t=0,e=this.length;t<e;t++)for(var i=this[t],n=0,r=i.length;n<r;n++){var o=i[n];if(o)return o}return null},sa.size=function(){var t=0;return W(this,function(){++t}),t};var ha=[];Bo.selection.enter=j,Bo.selection.enter.prototype=ha,ha.append=sa.append,ha.empty=sa.empty,ha.node=sa.node,ha.call=sa.call,ha.size=sa.size,ha.select=function(t){for(var e,i,n,r,o,a=[],s=-1,l=this.length;++s<l;){n=(r=this[s]).update,a.push(e=[]),e.parentNode=r.parentNode;for(var c=-1,h=r.length;++c<h;)(o=r[c])?(e.push(n[c]=i=t.call(r.parentNode,o.__data__,c,s)),i.__data__=o.__data__):e.push(null)}return A(a)},ha.insert=function(t,e){return arguments.length<2&&(e=U(this)),sa.insert.call(this,t,e)},Bo.select=function(e){var i;return"string"==typeof e?(i=[ra(e,Uo)]).parentNode=Uo.documentElement:(i=[e]).parentNode=t(e),A([i])},Bo.selectAll=function(t){var e;return"string"==typeof t?(e=jo(oa(t,Uo))).parentNode=Uo.documentElement:(e=jo(t)).parentNode=null,A([e])},sa.on=function(t,e,i){var n=arguments.length;if(n<3){if("string"!=typeof t){n<2&&(e=!1);for(i in t)this.each(Y(i,t[i],e));return this}if(n<2)return(n=this.node()["__on"+t])&&n._;i=!1}return this.each(Y(t,e,i))};var ua=Bo.map({mouseenter:"mouseover",mouseleave:"mouseout"});Uo&&ua.forEach(function(t){"on"+t in Uo&&ua.remove(t)});var da,fa=0;Bo.mouse=function(t){return K(t,k())};var pa=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;Bo.touch=function(t,e,i){if(arguments.length<3&&(i=e,e=k().changedTouches),e)for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).identifier===i)return K(t,n)},Bo.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function i(t,e,i,o,a){return function(){var s,l=this,c=Bo.event.target.correspondingElement||Bo.event.target,h=l.parentNode,u=n.of(l,arguments),d=0,f=t(),p=".drag"+(null==f?"":"-"+f),g=Bo.select(i(c)).on(o+p,function(){var t,i,n=e(h,f);n&&(t=n[0]-v[0],i=n[1]-v[1],d|=t|i,v=n,u({type:"drag",x:n[0]+s[0],y:n[1]+s[1],dx:t,dy:i}))}).on(a+p,function(){e(h,f)&&(g.on(o+p,null).on(a+p,null),m(d),u({type:"dragend"}))}),m=X(c),v=e(h,f);r?(s=r.apply(l,arguments),s=[s.x-v[0],s.y-v[1]]):s=[0,0],u({type:"dragstart"})}}var n=T(t,"drag","dragstart","dragend"),r=null,o=i(_,Bo.mouse,e,"mousemove","mouseup"),a=i(Z,Bo.touch,y,"touchmove","touchend");return t.origin=function(e){return arguments.length?(r=e,t):r},Bo.rebind(t,n,"on")},Bo.touches=function(t,e){return arguments.length<2&&(e=k().touches),e?jo(e).map(function(e){var i=K(t,e);return i.identifier=e.identifier,i}):[]};var ga=1e-6,ma=ga*ga,va=Math.PI,ya=2*va,ba=ya-ga,xa=va/2,_a=va/180,wa=180/va,Sa=Math.SQRT2;Bo.interpolateZoom=function(t,e){var i,n,r=t[0],o=t[1],a=t[2],s=e[0],l=e[1],c=e[2],h=s-r,u=l-o,d=h*h+u*u;if(d<ma)n=Math.log(c/a)/Sa,i=function(t){return[r+t*h,o+t*u,a*Math.exp(Sa*t*n)]};else{var f=Math.sqrt(d),p=(c*c-a*a+4*d)/(2*a*2*f),g=(c*c-a*a-4*d)/(2*c*2*f),m=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(g*g+1)-g);n=(v-m)/Sa,i=function(t){var e=t*n,i=nt(m),s=a/(2*f)*(i*rt(Sa*e+m)-it(m));return[r+s*h,o+s*u,a*i/nt(Sa*e+m)]}}return i.duration=1e3*n,i},Bo.behavior.zoom=function(){function t(t){t.on(P,u).on(ka+".zoom",f).on("dblclick.zoom",p).on(O,d)}function i(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function n(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function r(t){k.k=Math.max(D[0],Math.min(D[1],t))}function o(t,e){e=n(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function a(e,i,n,a){e.__chart__={x:k.x,y:k.y,k:k.k},r(Math.pow(2,a)),o(m=i,n),e=Bo.select(e),M>0&&(e=e.transition().duration(M)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),S&&S.domain(w.range().map(function(t){return(t-k.y)/k.k}).map(w.invert))}function l(t){E++||t({type:"zoomstart"})}function c(t){s(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function h(t){--E||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=R.of(t,arguments),r=0,a=Bo.select(e(t)).on(L,function(){r=1,o(Bo.mouse(t),s),c(n)}).on(I,function(){a.on(L,null).on(I,null),u(r),h(n)}),s=i(Bo.mouse(t)),u=X(t);yl.call(t),l(n)}function d(){function t(){var t=Bo.touches(p);return f=k.k,t.forEach(function(t){t.identifier in m&&(m[t.identifier]=i(t))}),t}function e(){var e=Bo.event.target;Bo.select(e).on(x,n).on(_,s),w.push(e);for(var i=Bo.event.changedTouches,r=0,o=i.length;r<o;++r)m[i[r].identifier]=null;var l=t(),c=Date.now();if(1===l.length){if(c-b<500){h=l[0];a(p,h,m[h.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),C()}b=c}else if(l.length>1){var h=l[0],u=l[1],d=h[0]-u[0],f=h[1]-u[1];v=d*d+f*f}}function n(){var t,e,i,n,a=Bo.touches(p);yl.call(p);for(var s=0,l=a.length;s<l;++s,n=null)if(i=a[s],n=m[i.identifier]){if(e)break;t=i,e=n}if(n){var h=(h=i[0]-t[0])*h+(h=i[1]-t[1])*h,u=v&&Math.sqrt(h/v);t=[(t[0]+i[0])/2,(t[1]+i[1])/2],e=[(e[0]+n[0])/2,(e[1]+n[1])/2],r(u*f)}b=null,o(t,e),c(g)}function s(){if(Bo.event.touches.length){for(var e=Bo.event.changedTouches,i=0,n=e.length;i<n;++i)delete m[e[i].identifier];for(var r in m)return void t()}Bo.selectAll(w).on(y,null),S.on(P,u).on(O,d),T(),h(g)}var f,p=this,g=R.of(p,arguments),m={},v=0,y=".zoom-"+Bo.event.changedTouches[0].identifier,x="touchmove"+y,_="touchend"+y,w=[],S=Bo.select(p),T=X(p);e(),l(g),S.on(P,null).on(O,e)}function f(){var t=R.of(this,arguments);y?clearTimeout(y):(yl.call(this),g=i(m=v||Bo.mouse(this)),l(t)),y=setTimeout(function(){y=null,h(t)},50),C(),r(Math.pow(2,.002*Ca())*k.k),o(m,g),c(t)}function p(){var t=Bo.mouse(this),e=Math.log(k.k)/Math.LN2;a(this,t,i(t),Bo.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)}var g,m,v,y,b,x,_,w,S,k={x:0,y:0,k:1},A=[960,500],D=Ta,M=250,E=0,P="mousedown.zoom",L="mousemove.zoom",I="mouseup.zoom",O="touchstart.zoom",R=T(t,"zoomstart","zoom","zoomend");return ka||(ka="onwheel"in Uo?(Ca=function(){return-Bo.event.deltaY*(Bo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in Uo?(Ca=function(){return Bo.event.wheelDelta},"mousewheel"):(Ca=function(){return-Bo.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=R.of(this,arguments),e=k;ml?Bo.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(t)}).tween("zoom:zoom",function(){var i=A[0],n=A[1],r=m?m[0]:i/2,o=m?m[1]:n/2,a=Bo.interpolateZoom([(r-k.x)/k.k,(o-k.y)/k.k,i/k.k],[(r-e.x)/e.k,(o-e.y)/e.k,i/e.k]);return function(e){var n=a(e),s=i/n[2];this.__chart__=k={x:r-n[0]*s,y:o-n[1]*s,k:s},c(t)}}).each("interrupt.zoom",function(){h(t)}).each("end.zoom",function(){h(t)}):(this.__chart__=k,l(t),c(t),h(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},s(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:null},r(+e),s(),t):k.k},t.scaleExtent=function(e){return arguments.length?(D=null==e?Ta:[+e[0],+e[1]],t):D},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(A=e&&[+e[0],+e[1]],t):A},t.duration=function(e){return arguments.length?(M=+e,t):M},t.x=function(e){return arguments.length?(_=e,x=e.copy(),k={x:0,y:0,k:1},t):_},t.y=function(e){return arguments.length?(S=e,w=e.copy(),k={x:0,y:0,k:1},t):S},Bo.rebind(t,R,"on")};var Ca,ka,Ta=[0,1/0];Bo.color=at,at.prototype.toString=function(){return this.rgb()+""},Bo.hsl=st;var Aa=st.prototype=new at;Aa.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,this.l/t)},Aa.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new st(this.h,this.s,t*this.l)},Aa.rgb=function(){return lt(this.h,this.s,this.l)},Bo.hcl=ct;var Da=ct.prototype=new at;Da.brighter=function(t){return new ct(this.h,this.c,Math.min(100,this.l+Ma*(arguments.length?t:1)))},Da.darker=function(t){return new ct(this.h,this.c,Math.max(0,this.l-Ma*(arguments.length?t:1)))},Da.rgb=function(){return ht(this.h,this.c,this.l).rgb()},Bo.lab=ut;var Ma=18,Ea=.95047,Pa=1,La=1.08883,Ia=ut.prototype=new at;Ia.brighter=function(t){return new ut(Math.min(100,this.l+Ma*(arguments.length?t:1)),this.a,this.b)},Ia.darker=function(t){return new ut(Math.max(0,this.l-Ma*(arguments.length?t:1)),this.a,this.b)},Ia.rgb=function(){return dt(this.l,this.a,this.b)},Bo.rgb=vt;var Oa=vt.prototype=new at;Oa.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,i=this.g,n=this.b,r=30;return e||i||n?(e&&e<r&&(e=r),i&&i<r&&(i=r),n&&n<r&&(n=r),new vt(Math.min(255,e/t),Math.min(255,i/t),Math.min(255,n/t))):new vt(r,r,r)},Oa.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new vt(t*this.r,t*this.g,t*this.b)},Oa.hsl=function(){return wt(this.r,this.g,this.b)},Oa.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ra=Bo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ra.forEach(function(t,e){Ra.set(t,yt(e))}),Bo.functor=Tt,Bo.xhr=At(y),Bo.dsv=function(t,e){function i(t,i,o){arguments.length<3&&(o=i,i=null);var a=Dt(t,e,null==i?n:r(i),o);return a.row=function(t){return arguments.length?a.response(null==(i=t)?n:r(t)):i},a}function n(t){return i.parse(t.responseText)}function r(t){return function(e){return i.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),l=t.charCodeAt(0);return i.parse=function(t,e){var n;return i.parseRows(t,function(t,i){if(n)return n(t,i-1);var r=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");n=e?function(t,i){return e(r(t),i)}:r})},i.parseRows=function(t,e){function i(){if(h>=c)return a;if(r)return r=!1,o;var e=h;if(34===t.charCodeAt(e)){for(var i=e;i++<c;)if(34===t.charCodeAt(i)){if(34!==t.charCodeAt(i+1))break;++i}return h=i+2,13===(n=t.charCodeAt(i+1))?(r=!0,10===t.charCodeAt(i+2)&&++h):10===n&&(r=!0),t.slice(e+1,i).replace(/""/g,'"')}for(;h<c;){var n=t.charCodeAt(h++),s=1;if(10===n)r=!0;else if(13===n)r=!0,10===t.charCodeAt(h)&&(++h,++s);else if(n!==l)continue;return t.slice(e,h-s)}return t.slice(e)}for(var n,r,o={},a={},s=[],c=t.length,h=0,u=0;(n=i())!==a;){for(var d=[];n!==o&&n!==a;)d.push(n),n=i();e&&null==(d=e(d,u++))||s.push(d)}return s},i.format=function(e){if(Array.isArray(e[0]))return i.formatRows(e);var n=new v,r=[];return e.forEach(function(t){for(var e in t)n.has(e)||r.push(n.add(e))}),[r.map(a).join(t)].concat(e.map(function(e){return r.map(function(t){return a(e[t])}).join(t)})).join("\n")},i.formatRows=function(t){return t.map(o).join("\n")},i},Bo.csv=Bo.dsv(",","text/csv"),Bo.tsv=Bo.dsv("\t","text/tab-separated-values");var Na,Fa,za,Ha,$a=this[x(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};Bo.timer=function(){Pt.apply(this,arguments)},Bo.timer.flush=function(){It(),Ot()},Bo.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var Va=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(t,e){var i=Math.pow(10,3*Qo(8-e));return{scale:e>8?function(t){return t/i}:function(t){return t*i},symbol:t}});Bo.formatPrefix=function(t,e){var i=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=Bo.round(t,Rt(t,e))),i=1+Math.floor(1e-12+Math.log(t)/Math.LN10),i=Math.max(-24,Math.min(24,3*Math.floor((i-1)/3)))),Va[8+i/3]};var Ba=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Wa=Bo.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Bo.round(t,Rt(t,e))).toFixed(Math.max(0,Math.min(20,Rt(t*(1+1e-15),e))))}}),ja=Bo.time={},Ua=Date;zt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Ya.setUTCDate.apply(this._,arguments)},setDay:function(){Ya.setUTCDay.apply(this._,arguments)},setFullYear:function(){Ya.setUTCFullYear.apply(this._,arguments)},setHours:function(){Ya.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Ya.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Ya.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Ya.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Ya.setUTCSeconds.apply(this._,arguments)},setTime:function(){Ya.setTime.apply(this._,arguments)}};var Ya=Date.prototype;ja.year=Ht(function(t){return(t=ja.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ja.years=ja.year.range,ja.years.utc=ja.year.utc.range,ja.day=Ht(function(t){var e=new Ua(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),ja.days=ja.day.range,ja.days.utc=ja.day.utc.range,ja.dayOfYear=function(t){var e=ja.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var i=ja[t]=Ht(function(t){return(t=ja.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var i=ja.year(t).getDay();return Math.floor((ja.dayOfYear(t)+(i+e)%7)/7)-(i!==e)});ja[t+"s"]=i.range,ja[t+"s"].utc=i.utc.range,ja[t+"OfYear"]=function(t){var i=ja.year(t).getDay();return Math.floor((ja.dayOfYear(t)+(i+e)%7)/7)}}),ja.week=ja.sunday,ja.weeks=ja.sunday.range,ja.weeks.utc=ja.sunday.utc.range,ja.weekOfYear=ja.sundayOfYear;var Ga={"-":"",_:" ",0:"0"},qa=/^\s*\d+/,Xa=/^%/;Bo.locale=function(t){return{numberFormat:Nt(t),timeFormat:Vt(t)}};var Ka=Bo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Bo.format=Ka.numberFormat,Bo.geo={},le.prototype={s:0,t:0,add:function(t){ce(t,this.t,Za),ce(Za.s,this.s,this),this.s?this.t+=Za.t:this.s=Za.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Za=new le;Bo.geo.stream=function(t,e){t&&Qa.hasOwnProperty(t.type)?Qa[t.type](t,e):he(t,e)};var Qa={Feature:function(t,e){he(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,n=-1,r=i.length;++n<r;)he(i[n].geometry,e)}},Ja={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var i=t.coordinates,n=-1,r=i.length;++n<r;)t=i[n],e.point(t[0],t[1],t[2])},LineString:function(t,e){ue(t.coordinates,e,0)},MultiLineString:function(t,e){for(var i=t.coordinates,n=-1,r=i.length;++n<r;)ue(i[n],e,0)},Polygon:function(t,e){de(t.coordinates,e)},MultiPolygon:function(t,e){for(var i=t.coordinates,n=-1,r=i.length;++n<r;)de(i[n],e)},GeometryCollection:function(t,e){for(var i=t.geometries,n=-1,r=i.length;++n<r;)he(i[n],e)}};Bo.geo.area=function(t){return ts=0,Bo.geo.stream(t,is),ts};var ts,es=new le,is={sphere:function(){ts+=4*va},point:_,lineStart:_,lineEnd:_,polygonStart:function(){es.reset(),is.lineStart=fe},polygonEnd:function(){var t=2*es;ts+=t<0?4*va+t:t,is.lineStart=is.lineEnd=is.point=_}};Bo.geo.bounds=function(){function t(t,e){b.push(x=[h=t,d=t]),e<u&&(u=e),e>f&&(f=e)}function e(e,i){var n=pe([e*_a,i*_a]);if(v){var r=me(v,n),o=me([r[1],-r[0],0],r);be(o),o=xe(o);var a=e-p,l=a>0?1:-1,c=o[0]*wa*l,g=Qo(a)>180;if(g^(l*p<c&&c<l*e))(m=o[1]*wa)>f&&(f=m);else if(c=(c+360)%360-180,g^(l*p<c&&c<l*e)){var m=-o[1]*wa;m<u&&(u=m)}else i<u&&(u=i),i>f&&(f=i);g?e<p?s(h,e)>s(h,d)&&(d=e):s(e,d)>s(h,d)&&(h=e):d>=h?(e<h&&(h=e),e>d&&(d=e)):e>p?s(h,e)>s(h,d)&&(d=e):s(e,d)>s(h,d)&&(h=e)}else t(e,i);v=n,p=e}function i(){_.point=e}function n(){x[0]=h,x[1]=d,_.point=t,v=null}function r(t,i){if(v){var n=t-p;y+=Qo(n)>180?n+(n>0?360:-360):n}else g=t,m=i;is.point(t,i),e(t,i)}function o(){is.lineStart()}function a(){r(g,m),is.lineEnd(),Qo(y)>ga&&(h=-(d=180)),x[0]=h,x[1]=d,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var h,u,d,f,p,g,m,v,y,b,x,_={point:t,lineStart:i,lineEnd:n,polygonStart:function(){_.point=r,_.lineStart=o,_.lineEnd=a,y=0,is.polygonStart()},polygonEnd:function(){is.polygonEnd(),_.point=t,_.lineStart=i,_.lineEnd=n,es<0?(h=-(d=180),u=-(f=90)):y>ga?f=90:y<-ga&&(u=-90),x[0]=h,x[1]=d}};return function(t){f=d=-(h=u=1/0),b=[],Bo.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var i=1,n=[p=b[0]];i<e;++i)c((o=b[i])[0],p)||c(o[1],p)?(s(p[0],o[1])>s(p[0],p[1])&&(p[1]=o[1]),s(o[0],p[1])>s(p[0],p[1])&&(p[0]=o[0])):n.push(p=o);for(var r,o,a=-1/0,i=0,p=n[e=n.length-1];i<=e;p=o,++i)o=n[i],(r=s(p[1],o[0]))>a&&(a=r,h=o[0],d=p[1])}return b=x=null,h===1/0||u===1/0?[[NaN,NaN],[NaN,NaN]]:[[h,u],[d,f]]}}(),Bo.geo.centroid=function(t){ns=rs=os=as=ss=ls=cs=hs=us=ds=fs=0,Bo.geo.stream(t,ps);var e=us,i=ds,n=fs,r=e*e+i*i+n*n;return r<ma&&(e=ls,i=cs,n=hs,rs<ga&&(e=os,i=as,n=ss),(r=e*e+i*i+n*n)<ma)?[NaN,NaN]:[Math.atan2(i,e)*wa,et(n/Math.sqrt(r))*wa]};var ns,rs,os,as,ss,ls,cs,hs,us,ds,fs,ps={sphere:_,point:we,lineStart:Ce,lineEnd:ke,polygonStart:function(){ps.lineStart=Te},polygonEnd:function(){ps.lineStart=Ce}},gs=Le(De,function(t){var e,i=NaN,n=NaN,r=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?va:-va,l=Qo(o-i);Qo(l-va)<ga?(t.point(i,n=(n+a)/2>0?xa:-xa),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(o,n),e=0):r!==s&&l>=va&&(Qo(i-r)<ga&&(i-=r*ga),Qo(o-s)<ga&&(o-=s*ga),n=Ne(i,n,o,a),t.point(r,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(i=o,n=a),r=s},lineEnd:function(){t.lineEnd(),i=n=NaN},clean:function(){return 2-e}}},function(t,e,i,n){var r;if(null==t)r=i*xa,n.point(-va,r),n.point(0,r),n.point(va,r),n.point(va,0),n.point(va,-r),n.point(0,-r),n.point(-va,-r),n.point(-va,0),n.point(-va,r);else if(Qo(t[0]-e[0])>ga){var o=t[0]<e[0]?va:-va;r=i*o/2,n.point(-o,r),n.point(0,r),n.point(o,r)}else n.point(e[0],e[1])},[-va,-va/2]),ms=1e9;Bo.geo.clipExtent=function(){var t,e,i,n,r,o,a={stream:function(t){return r&&(r.valid=!1),r=o(t),r.valid=!0,r},extent:function(s){return arguments.length?(o=$e(t=+s[0][0],e=+s[0][1],i=+s[1][0],n=+s[1][1]),r&&(r.valid=!1,r=null),a):[[t,e],[i,n]]}};return a.extent([[0,0],[960,500]])},(Bo.geo.conicEqualArea=function(){return Ve(Be)}).raw=Be,Bo.geo.albers=function(){return Bo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Bo.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return e=null,i(o,a),e||(n(o,a),e)||r(o,a),e}var e,i,n,r,o=Bo.geo.albers(),a=Bo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=Bo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,i){e=[t,i]}};return t.invert=function(t){var e=o.scale(),i=o.translate(),n=(t[0]-i[0])/e,r=(t[1]-i[1])/e;return(r>=.12&&r<.234&&n>=-.425&&n<-.214?a:r>=.166&&r<.234&&n>=-.214&&n<-.115?s:o).invert(t)},t.stream=function(t){var e=o.stream(t),i=a.stream(t),n=s.stream(t);return{point:function(t,r){e.point(t,r),i.point(t,r),n.point(t,r)},sphere:function(){e.sphere(),i.sphere(),n.sphere()},lineStart:function(){e.lineStart(),i.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),i.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),i.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),i.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(o.precision(e),a.precision(e),s.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),a.scale(.35*e),s.scale(e),t.translate(o.translate())):o.scale()},t.translate=function(e){if(!arguments.length)return o.translate();var c=o.scale(),h=+e[0],u=+e[1];return i=o.translate(e).clipExtent([[h-.455*c,u-.238*c],[h+.455*c,u+.238*c]]).stream(l).point,n=a.translate([h-.307*c,u+.201*c]).clipExtent([[h-.425*c+ga,u+.12*c+ga],[h-.214*c-ga,u+.234*c-ga]]).stream(l).point,r=s.translate([h-.205*c,u+.212*c]).clipExtent([[h-.214*c+ga,u+.166*c+ga],[h-.115*c-ga,u+.234*c-ga]]).stream(l).point,t},t.scale(1070)};var vs,ys,bs,xs,_s,ws,Ss={point:_,lineStart:_,lineEnd:_,polygonStart:function(){ys=0,Ss.lineStart=We},polygonEnd:function(){Ss.lineStart=Ss.lineEnd=Ss.point=_,vs+=Qo(ys/2)}},Cs={point:function(t,e){t<bs&&(bs=t),t>_s&&(_s=t),e<xs&&(xs=e),e>ws&&(ws=e)},lineStart:_,lineEnd:_,polygonStart:_,polygonEnd:_},ks={point:Ye,lineStart:Ge,lineEnd:qe,polygonStart:function(){ks.lineStart=Xe},polygonEnd:function(){ks.point=Ye,ks.lineStart=Ge,ks.lineEnd=qe}};Bo.geo.path=function(){function t(t){return t&&("function"==typeof s&&o.pointRadius(+s.apply(this,arguments)),a&&a.valid||(a=r(o)),Bo.geo.stream(t,a)),o.result()}function e(){return a=null,t}var i,n,r,o,a,s=4.5;return t.area=function(t){return vs=0,Bo.geo.stream(t,r(Ss)),vs},t.centroid=function(t){return os=as=ss=ls=cs=hs=us=ds=fs=0,Bo.geo.stream(t,r(ks)),fs?[us/fs,ds/fs]:hs?[ls/hs,cs/hs]:ss?[os/ss,as/ss]:[NaN,NaN]},t.bounds=function(t){return _s=ws=-(bs=xs=1/0),Bo.geo.stream(t,r(Cs)),[[bs,xs],[_s,ws]]},t.projection=function(t){return arguments.length?(r=(i=t)?t.stream||Qe(t):y,e()):i},t.context=function(t){return arguments.length?(o=null==(n=t)?new je:new Ke(t),"function"!=typeof s&&o.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(o.pointRadius(+e),+e),t):s},t.projection(Bo.geo.albersUsa()).context(null)},Bo.geo.transform=function(t){return{stream:function(e){var i=new Je(e);for(var n in t)i[n]=t[n];return i}}},Je.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Bo.geo.projection=ei,Bo.geo.projectionMutator=ii,(Bo.geo.equirectangular=function(){return ei(ri)}).raw=ri.invert=ri,Bo.geo.rotation=function(t){function e(e){return e=t(e[0]*_a,e[1]*_a),e[0]*=wa,e[1]*=wa,e}return t=ai(t[0]%360*_a,t[1]*_a,t.length>2?t[2]*_a:0),e.invert=function(e){return e=t.invert(e[0]*_a,e[1]*_a),e[0]*=wa,e[1]*=wa,e},e},oi.invert=ri,Bo.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=ai(-t[0]*_a,-t[1]*_a,0).invert,r=[];return i(null,null,1,{point:function(t,i){r.push(t=e(t,i)),t[0]*=wa,t[1]*=wa}}),{type:"Polygon",coordinates:[r]}}var e,i,n=[0,0],r=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(i=hi((e=+n)*_a,r*_a),t):e},t.precision=function(n){return arguments.length?(i=hi(e*_a,(r=+n)*_a),t):r},t.angle(90)},Bo.geo.distance=function(t,e){var i,n=(e[0]-t[0])*_a,r=t[1]*_a,o=e[1]*_a,a=Math.sin(n),s=Math.cos(n),l=Math.sin(r),c=Math.cos(r),h=Math.sin(o),u=Math.cos(o);return Math.atan2(Math.sqrt((i=u*a)*i+(i=c*h-l*u*s)*i),l*h+c*u*s)},Bo.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Bo.range(Math.ceil(o/m)*m,r,m).map(d).concat(Bo.range(Math.ceil(c/v)*v,l,v).map(f)).concat(Bo.range(Math.ceil(n/p)*p,i,p).filter(function(t){return Qo(t%m)>ga}).map(h)).concat(Bo.range(Math.ceil(s/g)*g,a,g).filter(function(t){return Qo(t%v)>ga}).map(u))}var i,n,r,o,a,s,l,c,h,u,d,f,p=10,g=p,m=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(o).concat(f(l).slice(1),d(r).reverse().slice(1),f(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],r=+e[1][0],c=+e[0][1],l=+e[1][1],o>r&&(e=o,o=r,r=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[o,c],[r,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],i=+e[1][0],s=+e[0][1],a=+e[1][1],n>i&&(e=n,n=i,i=e),s>a&&(e=s,s=a,a=e),t.precision(y)):[[n,s],[i,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(m=+e[0],v=+e[1],t):[m,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],g=+e[1],t):[p,g]},t.precision=function(e){return arguments.length?(y=+e,h=di(s,a,90),u=fi(n,i,y),d=di(c,l,90),f=fi(o,r,y),t):y},t.majorExtent([[-180,-90+ga],[180,90-ga]]).minorExtent([[-180,-80-ga],[180,80+ga]])},Bo.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),i||r.apply(this,arguments)]}}var e,i,n=pi,r=gi;return t.distance=function(){return Bo.geo.distance(e||n.apply(this,arguments),i||r.apply(this,arguments))},t.source=function(i){return arguments.length?(n=i,e="function"==typeof i?null:i,t):n},t.target=function(e){return arguments.length?(r=e,i="function"==typeof e?null:e,t):r},t.precision=function(){return arguments.length?t:0},t},Bo.geo.interpolate=function(t,e){return mi(t[0]*_a,t[1]*_a,e[0]*_a,e[1]*_a)},Bo.geo.length=function(t){return Ts=0,Bo.geo.stream(t,As),Ts};var Ts,As={sphere:_,point:_,lineStart:function(){function t(t,r){var o=Math.sin(r*=_a),a=Math.cos(r),s=Qo((t*=_a)-e),l=Math.cos(s);Ts+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=n*o-i*a*l)*s),i*o+n*a*l),e=t,i=o,n=a}var e,i,n;As.point=function(r,o){e=r*_a,i=Math.sin(o*=_a),n=Math.cos(o),As.point=t},As.lineEnd=function(){As.point=As.lineEnd=_}},lineEnd:_,polygonStart:_,polygonEnd:_},Ds=vi(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Bo.geo.azimuthalEqualArea=function(){return ei(Ds)}).raw=Ds;var Ms=vi(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);(Bo.geo.azimuthalEquidistant=function(){return ei(Ms)}).raw=Ms,(Bo.geo.conicConformal=function(){return Ve(yi)}).raw=yi,(Bo.geo.conicEquidistant=function(){return Ve(bi)}).raw=bi;var Es=vi(function(t){return 1/t},Math.atan);(Bo.geo.gnomonic=function(){return ei(Es)}).raw=Es,xi.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-xa]},(Bo.geo.mercator=function(){return _i(xi)}).raw=xi;var Ps=vi(function(){return 1},Math.asin);(Bo.geo.orthographic=function(){return ei(Ps)}).raw=Ps;var Ls=vi(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Bo.geo.stereographic=function(){return ei(Ls)}).raw=Ls,wi.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-xa]},(Bo.geo.transverseMercator=function(){var t=_i(wi),e=t.center,i=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?i([t[0],t[1],t.length>2?t[2]+90:90]):(t=i(),[t[0],t[1],t[2]-90])},i([0,0,90])}).raw=wi,Bo.geom={},Bo.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,r=Tt(i),o=Tt(n),a=t.length,s=[],l=[];for(e=0;e<a;e++)s.push([+r.call(this,t[e],e),+o.call(this,t[e],e),e]);for(s.sort(Ti),e=0;e<a;e++)l.push([s[e][0],-s[e][1]]);var c=ki(s),h=ki(l),u=h[0]===c[0],d=h[h.length-1]===c[c.length-1],f=[];for(e=c.length-1;e>=0;--e)f.push(t[s[c[e]][2]]);for(e=+u;e<h.length-d;++e)f.push(t[s[h[e]][2]]);return f}var i=Si,n=Ci;return arguments.length?e(t):(e.x=function(t){return arguments.length?(i=t,e):i},e.y=function(t){return arguments.length?(n=t,e):n},e)},Bo.geom.polygon=function(t){return na(t,Is),t};var Is=Bo.geom.polygon.prototype=[];Is.area=function(){for(var t,e=-1,i=this.length,n=this[i-1],r=0;++e<i;)t=n,n=this[e],r+=t[1]*n[0]-t[0]*n[1];return.5*r},Is.centroid=function(t){var e,i,n=-1,r=this.length,o=0,a=0,s=this[r-1];for(arguments.length||(t=-1/(6*this.area()));++n<r;)e=s,s=this[n],i=e[0]*s[1]-s[0]*e[1],o+=(e[0]+s[0])*i,a+=(e[1]+s[1])*i;return[o*t,a*t]},Is.clip=function(t){for(var e,i,n,r,o,a,s=Mi(t),l=-1,c=this.length-Mi(this),h=this[c-1];++l<c;){for(e=t.slice(),t.length=0,r=this[l],o=e[(n=e.length-s)-1],i=-1;++i<n;)Ai(a=e[i],h,r)?(Ai(o,h,r)||t.push(Di(o,a,h,r)),t.push(a)):Ai(o,h,r)&&t.push(Di(o,a,h,r)),o=a;s&&t.push(t[0]),h=r}return t};var Os,Rs,Ns,Fs,zs,Hs=[],$s=[];Fi.prototype.prepare=function(){for(var t,e=this.edges,i=e.length;i--;)(t=e[i].edge).b&&t.a||e.splice(i,1);return e.sort(Hi),e.length},Xi.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},Ki.prototype={insert:function(t,e){var i,n,r;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;i=t}else this._?(t=tn(this._),e.P=null,e.N=t,t.P=t.L=e,i=t):(e.P=e.N=null,this._=e,i=null);for(e.L=e.R=null,e.U=i,e.C=!0,t=e;i&&i.C;)i===(n=i.U).L?(r=n.R)&&r.C?(i.C=r.C=!1,n.C=!0,t=n):(t===i.R&&(Qi(this,i),i=(t=i).U),i.C=!1,n.C=!0,Ji(this,n)):(r=n.L)&&r.C?(i.C=r.C=!1,n.C=!0,t=n):(t===i.L&&(Ji(this,i),i=(t=i).U),i.C=!1,n.C=!0,Qi(this,n)),i=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,i,n,r=t.U,o=t.L,a=t.R;if(i=o?a?tn(a):o:a,r?r.L===t?r.L=i:r.R=i:this._=i,o&&a?(n=i.C,i.C=t.C,i.L=o,o.U=i,i!==a?(r=i.U,i.U=t.U,t=i.R,r.L=t,i.R=a,a.U=i):(i.U=r,r=i,t=i.R)):(n=t.C,t=i),t&&(t.U=r),!n)if(t&&t.C)t.C=!1;else{do{if(t===this._)break;if(t===r.L){if((e=r.R).C&&(e.C=!1,r.C=!0,Qi(this,r),e=r.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,Ji(this,e),e=r.R),e.C=r.C,r.C=e.R.C=!1,Qi(this,r),t=this._;break}}else if((e=r.L).C&&(e.C=!1,r.C=!0,Ji(this,r),e=r.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,Qi(this,e),e=r.L),e.C=r.C,r.C=e.L.C=!1,Ji(this,r),t=this._;break}e.C=!0,t=r,r=r.U}while(!t.C);t&&(t.C=!1)}}},Bo.geom.voronoi=function(t){function e(t){var e=new Array(t.length),n=s[0][0],r=s[0][1],o=s[1][0],a=s[1][1];return en(i(t),s).cells.forEach(function(i,s){var l=i.edges,c=i.site;(e[s]=l.length?l.map(function(t){var e=t.start();return[e.x,e.y]}):c.x>=n&&c.x<=o&&c.y>=r&&c.y<=a?[[n,a],[o,a],[o,r],[n,r]]:[]).point=t[s]}),e}function i(t){return t.map(function(t,e){return{x:Math.round(o(t,e)/ga)*ga,y:Math.round(a(t,e)/ga)*ga,i:e}})}var n=Si,r=Ci,o=n,a=r,s=Vs;return t?e(t):(e.links=function(t){return en(i(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return en(i(t)).cells.forEach(function(i,n){for(var r,o=i.site,a=i.edges.sort(Hi),s=-1,l=a.length,c=a[l-1].edge,h=c.l===o?c.r:c.l;++s<l;)c,r=h,h=(c=a[s].edge).l===o?c.r:c.l,n<r.i&&n<h.i&&rn(o,r,h)<0&&e.push([t[n],t[r.i],t[h.i]])}),e},e.x=function(t){return arguments.length?(o=Tt(n=t),e):n},e.y=function(t){return arguments.length?(a=Tt(r=t),e):r},e.clipExtent=function(t){return arguments.length?(s=null==t?Vs:t,e):s===Vs?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===Vs?null:s&&s[1]},e)};var Vs=[[-1e6,-1e6],[1e6,1e6]];Bo.geom.delaunay=function(t){return Bo.geom.voronoi().triangles(t)},Bo.geom.quadtree=function(t,e,i,n,r){function o(t){function o(t,e,i,n,r,o,a,s){if(!isNaN(i)&&!isNaN(n))if(t.leaf){var l=t.x,h=t.y;if(null!=l)if(Qo(l-i)+Qo(h-n)<.01)c(t,e,i,n,r,o,a,s);else{var u=t.point;t.x=t.y=t.point=null,c(t,u,l,h,r,o,a,s),c(t,e,i,n,r,o,a,s)}else t.x=i,t.y=n,t.point=e}else c(t,e,i,n,r,o,a,s)}function c(t,e,i,n,r,a,s,l){var c=.5*(r+s),h=.5*(a+l),u=i>=c,d=n>=h,f=d<<1|u;t.leaf=!1,t=t.nodes[f]||(t.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),u?r=c:s=c,d?a=h:l=h,o(t,e,i,n,r,a,s,l)}var h,u,d,f,p,g,m,v,y,b=Tt(s),x=Tt(l);if(null!=e)g=e,m=i,v=n,y=r;else if(v=y=-(g=m=1/0),u=[],d=[],p=t.length,a)for(f=0;f<p;++f)(h=t[f]).x<g&&(g=h.x),h.y<m&&(m=h.y),h.x>v&&(v=h.x),h.y>y&&(y=h.y),u.push(h.x),d.push(h.y);else for(f=0;f<p;++f){var _=+b(h=t[f],f),w=+x(h,f);_<g&&(g=_),w<m&&(m=w),_>v&&(v=_),w>y&&(y=w),u.push(_),d.push(w)}var S=v-g,C=y-m;S>C?y=m+S:v=g+C;var k={leaf:!0,nodes:[],point:null,x:null,y:null};if(k.add=function(t){o(k,t,+b(t,++f),+x(t,f),g,m,v,y)},k.visit=function(t){sn(t,k,g,m,v,y)},k.find=function(t){return ln(k,t[0],t[1],g,m,v,y)},f=-1,null==e){for(;++f<p;)o(k,t[f],u[f],d[f],g,m,v,y);--f}else t.forEach(k.add);return u=d=t=h=null,k}var a,s=Si,l=Ci;return(a=arguments.length)?(s=on,l=an,3===a&&(r=i,n=e,i=e=0),o(t)):(o.x=function(t){return arguments.length?(s=t,o):s},o.y=function(t){return arguments.length?(l=t,o):l},o.extent=function(t){return arguments.length?(null==t?e=i=n=r=null:(e=+t[0][0],i=+t[0][1],n=+t[1][0],r=+t[1][1]),o):null==e?null:[[e,i],[n,r]]},o.size=function(t){return arguments.length?(null==t?e=i=n=r=null:(e=i=0,n=+t[0],r=+t[1]),o):null==e?null:[n-e,r-i]},o)},Bo.interpolateRgb=cn,Bo.interpolateObject=hn,Bo.interpolateNumber=un,Bo.interpolateString=dn;var Bs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ws=new RegExp(Bs.source,"g");Bo.interpolate=fn,Bo.interpolators=[function(t,e){var i=typeof e;return("string"===i?Ra.has(e.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(e)?cn:dn:e instanceof at?cn:Array.isArray(e)?pn:"object"===i&&isNaN(e)?hn:un)(t,e)}],Bo.interpolateArray=pn;var js=function(){return y},Us=Bo.map({linear:js,poly:function(t){return function(e){return Math.pow(e,t)}},quad:function(){return yn},cubic:function(){return bn},sin:function(){return _n},exp:function(){return wn},circle:function(){return Sn},elastic:function(t,e){var i;return arguments.length<2&&(e=.45),arguments.length?i=e/ya*Math.asin(1/t):(t=1,i=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-i)*ya/e)}},back:function(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}},bounce:function(){return Cn}}),Ys=Bo.map({in:y,out:mn,"in-out":vn,"out-in":function(t){return vn(mn(t))}});Bo.ease=function(t){var e=t.indexOf("-"),i=e>=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return i=Us.get(i)||js,n=Ys.get(n)||y,gn(n(i.apply(null,Wo.call(arguments,1))))},Bo.interpolateHcl=function(t,e){t=Bo.hcl(t),e=Bo.hcl(e);var i=t.h,n=t.c,r=t.l,o=e.h-i,a=e.c-n,s=e.l-r;return isNaN(a)&&(a=0,n=isNaN(n)?e.c:n),isNaN(o)?(o=0,i=isNaN(i)?e.h:i):o>180?o-=360:o<-180&&(o+=360),function(t){return ht(i+o*t,n+a*t,r+s*t)+""}},Bo.interpolateHsl=function(t,e){t=Bo.hsl(t),e=Bo.hsl(e);var i=t.h,n=t.s,r=t.l,o=e.h-i,a=e.s-n,s=e.l-r;return isNaN(a)&&(a=0,n=isNaN(n)?e.s:n),isNaN(o)?(o=0,i=isNaN(i)?e.h:i):o>180?o-=360:o<-180&&(o+=360),function(t){return lt(i+o*t,n+a*t,r+s*t)+""}},Bo.interpolateLab=function(t,e){t=Bo.lab(t),e=Bo.lab(e);var i=t.l,n=t.a,r=t.b,o=e.l-i,a=e.a-n,s=e.b-r;return function(t){return dt(i+o*t,n+a*t,r+s*t)+""}},Bo.interpolateRound=kn,Bo.transform=function(t){var e=Uo.createElementNS(Bo.ns.prefix.svg,"g");return(Bo.transform=function(t){if(null!=t){e.setAttribute("transform",t);var i=e.transform.baseVal.consolidate()}return new Tn(i?i.matrix:Gs)})(t)},Tn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Gs={a:1,b:0,c:0,d:1,e:0,f:0};Bo.interpolateTransform=Rn,Bo.layout={},Bo.layout.bundle=function(){return function(t){for(var e=[],i=-1,n=t.length;++i<n;)e.push(zn(t[i]));return e}},Bo.layout.chord=function(){function t(){var t,c,u,d,f,p={},g=[],m=Bo.range(o),v=[];for(i=[],n=[],t=0,d=-1;++d<o;){for(c=0,f=-1;++f<o;)c+=r[d][f];g.push(c),v.push(Bo.range(o)),t+=c}for(a&&m.sort(function(t,e){return a(g[t],g[e])}),s&&v.forEach(function(t,e){t.sort(function(t,i){return s(r[e][t],r[e][i])})}),t=(ya-h*o)/t,c=0,d=-1;++d<o;){for(u=c,f=-1;++f<o;){var y=m[d],b=v[y][f],x=r[y][b],_=c,w=c+=x*t;p[y+"-"+b]={index:y,subindex:b,startAngle:_,endAngle:w,value:x}}n[y]={index:y,startAngle:u,endAngle:c,value:g[y]},c+=h}for(d=-1;++d<o;)for(f=d-1;++f<o;){var S=p[d+"-"+f],C=p[f+"-"+d];(S.value||C.value)&&i.push(S.value<C.value?{source:C,target:S}:{source:S,target:C})}l&&e()}function e(){i.sort(function(t,e){return l((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var i,n,r,o,a,s,l,c={},h=0;return c.matrix=function(t){return arguments.length?(o=(r=t)&&r.length,i=n=null,c):r},c.padding=function(t){return arguments.length?(h=t,i=n=null,c):h},c.sortGroups=function(t){return arguments.length?(a=t,i=n=null,c):a},c.sortSubgroups=function(t){return arguments.length?(s=t,i=null,c):s},c.sortChords=function(t){return arguments.length?(l=t,i&&e(),c):l},c.chords=function(){return i||t(),i},c.groups=function(){return n||t(),n},c},Bo.layout.force=function(){function t(t){return function(e,i,n,r){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,s=r-i,l=o*o+a*a;if(s*s/v<l){if(l<g){c=e.charge/l;t.px-=o*c,t.py-=a*c}return!0}if(e.point&&l&&l<g){var c=e.pointCharge/l;t.px-=o*c,t.py-=a*c}}return!e.charge}}function e(t){t.px=Bo.event.x,t.py=Bo.event.y,l.resume()}var i,n,r,o,a,s,l={},c=Bo.dispatch("start","tick","end"),h=[1,1],u=.9,d=qs,f=Xs,p=-30,g=Ks,m=.1,v=.64,b=[],x=[];return l.tick=function(){if((r*=.99)<.005)return i=null,c.end({type:"end",alpha:r=0}),!0;var e,n,l,d,f,g,v,y,_,w=b.length,S=x.length;for(n=0;n<S;++n)d=(l=x[n]).source,(g=(y=(f=l.target).x-d.x)*y+(_=f.y-d.y)*_)&&(y*=g=r*a[n]*((g=Math.sqrt(g))-o[n])/g,_*=g,f.x-=y*(v=d.weight+f.weight?d.weight/(d.weight+f.weight):.5),f.y-=_*v,d.x+=y*(v=1-v),d.y+=_*v);if((v=r*m)&&(y=h[0]/2,_=h[1]/2,n=-1,v))for(;++n<w;)(l=b[n]).x+=(y-l.x)*v,l.y+=(_-l.y)*v;if(p)for(Un(e=Bo.geom.quadtree(b),r,s),n=-1;++n<w;)(l=b[n]).fixed||e.visit(t(l));for(n=-1;++n<w;)(l=b[n]).fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*u,l.y-=(l.py-(l.py=l.y))*u);c.tick({type:"tick",alpha:r})},l.nodes=function(t){return arguments.length?(b=t,l):b},l.links=function(t){return arguments.length?(x=t,l):x},l.size=function(t){return arguments.length?(h=t,l):h},l.linkDistance=function(t){return arguments.length?(d="function"==typeof t?t:+t,l):d},l.distance=l.linkDistance,l.linkStrength=function(t){return arguments.length?(f="function"==typeof t?t:+t,l):f},l.friction=function(t){return arguments.length?(u=+t,l):u},l.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,l):p},l.chargeDistance=function(t){return arguments.length?(g=t*t,l):Math.sqrt(g)},l.gravity=function(t){return arguments.length?(m=+t,l):m},l.theta=function(t){return arguments.length?(v=t*t,l):Math.sqrt(v)},l.alpha=function(t){return arguments.length?(t=+t,r?t>0?r=t:(i.c=null,i.t=NaN,i=null,c.end({type:"end",alpha:r=0})):t>0&&(c.start({type:"start",alpha:r=t}),i=Pt(l.tick)),l):r},l.start=function(){function t(t,n){if(!i){for(i=new Array(r),l=0;l<r;++l)i[l]=[];for(l=0;l<c;++l){var o=x[l];i[o.source.index].push(o.target),i[o.target.index].push(o.source)}}for(var a,s=i[e],l=-1,h=s.length;++l<h;)if(!isNaN(a=s[l][t]))return a;return Math.random()*n}var e,i,n,r=b.length,c=x.length,u=h[0],g=h[1];for(e=0;e<r;++e)(n=b[e]).index=e,n.weight=0;for(e=0;e<c;++e)"number"==typeof(n=x[e]).source&&(n.source=b[n.source]),"number"==typeof n.target&&(n.target=b[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<r;++e)n=b[e],isNaN(n.x)&&(n.x=t("x",u)),isNaN(n.y)&&(n.y=t("y",g)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(o=[],"function"==typeof d)for(e=0;e<c;++e)o[e]=+d.call(this,x[e],e);else for(e=0;e<c;++e)o[e]=d;if(a=[],"function"==typeof f)for(e=0;e<c;++e)a[e]=+f.call(this,x[e],e);else for(e=0;e<c;++e)a[e]=f;if(s=[],"function"==typeof p)for(e=0;e<r;++e)s[e]=+p.call(this,b[e],e);else for(e=0;e<r;++e)s[e]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){if(n||(n=Bo.behavior.drag().origin(y).on("dragstart.force",Vn).on("drag.force",e).on("dragend.force",Bn)),!arguments.length)return n;this.on("mouseover.force",Wn).on("mouseout.force",jn).call(n)},Bo.rebind(l,c,"on")};var qs=20,Xs=1,Ks=1/0;Bo.layout.hierarchy=function(){function t(r){var o,a=[r],s=[];for(r.depth=0;null!=(o=a.pop());)if(s.push(o),(c=i.call(t,o,o.depth))&&(l=c.length)){for(var l,c,h;--l>=0;)a.push(h=c[l]),h.parent=o,h.depth=o.depth+1;n&&(o.value=0),o.children=c}else n&&(o.value=+n.call(t,o,o.depth)||0),delete o.children;return qn(r,function(t){var i,r;e&&(i=t.children)&&i.sort(e),n&&(r=t.parent)&&(r.value+=t.value)}),s}var e=Zn,i=Xn,n=Kn;return t.sort=function(i){return arguments.length?(e=i,t):e},t.children=function(e){return arguments.length?(i=e,t):i},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(Gn(e,function(t){t.children&&(t.value=0)}),qn(e,function(e){var i;e.children||(e.value=+n.call(t,e,e.depth)||0),(i=e.parent)&&(i.value+=e.value)})),e},t},Bo.layout.partition=function(){function t(e,i,n,r){var o=e.children;if(e.x=i,e.y=e.depth*r,e.dx=n,e.dy=r,o&&(a=o.length)){var a,s,l,c=-1;for(n=e.value?n/e.value:0;++c<a;)t(s=o[c],i,l=s.value*n,r),i+=l}}function e(t){var i=t.children,n=0;if(i&&(r=i.length))for(var r,o=-1;++o<r;)n=Math.max(n,e(i[o]));return 1+n}function i(i,o){var a=n.call(this,i,o);return t(a[0],0,r[0],r[1]/e(a[0])),a}var n=Bo.layout.hierarchy(),r=[1,1];return i.size=function(t){return arguments.length?(r=t,i):r},Yn(i,n)},Bo.layout.pie=function(){function t(a){var s,l=a.length,c=a.map(function(i,n){return+e.call(t,i,n)}),h=+("function"==typeof n?n.apply(this,arguments):n),u=("function"==typeof r?r.apply(this,arguments):r)-h,d=Math.min(Math.abs(u)/l,+("function"==typeof o?o.apply(this,arguments):o)),f=d*(u<0?-1:1),p=Bo.sum(c),g=p?(u-l*f)/p:0,m=Bo.range(l),v=[];return null!=i&&m.sort(i===Zs?function(t,e){return c[e]-c[t]}:function(t,e){return i(a[t],a[e])}),m.forEach(function(t){v[t]={data:a[t],value:s=c[t],startAngle:h,endAngle:h+=s*g+f,padAngle:d}}),v}var e=Number,i=Zs,n=0,r=ya,o=0;return t.value=function(i){return arguments.length?(e=i,t):e},t.sort=function(e){return arguments.length?(i=e,t):i},t.startAngle=function(e){return arguments.length?(n=e,t):n},t.endAngle=function(e){return arguments.length?(r=e,t):r},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var Zs={};Bo.layout.stack=function(){function t(s,l){if(!(d=s.length))return s;var c=s.map(function(i,n){return e.call(t,i,n)}),h=c.map(function(e){return e.map(function(e,i){return[o.call(t,e,i),a.call(t,e,i)]})}),u=i.call(t,h,l);c=Bo.permute(c,u),h=Bo.permute(h,u);var d,f,p,g,m=n.call(t,h,l),v=c[0].length;for(p=0;p<v;++p)for(r.call(t,c[0][p],g=m[p],h[0][p][1]),f=1;f<d;++f)r.call(t,c[f][p],g+=h[f-1][p][1],h[f][p][1]);return s}var e=y,i=ir,n=nr,r=er,o=Jn,a=tr;return t.values=function(i){return arguments.length?(e=i,t):e},t.order=function(e){return arguments.length?(i="function"==typeof e?e:Qs.get(e)||ir,t):i},t.offset=function(e){return arguments.length?(n="function"==typeof e?e:Js.get(e)||nr,t):n},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(r=e,t):r},t};var Qs=Bo.map({"inside-out":function(t){var e,i,n=t.length,r=t.map(rr),o=t.map(or),a=Bo.range(n).sort(function(t,e){return r[t]-r[e]}),s=0,l=0,c=[],h=[];for(e=0;e<n;++e)i=a[e],s<l?(s+=o[i],c.push(i)):(l+=o[i],h.push(i));return h.reverse().concat(c)},reverse:function(t){return Bo.range(t.length).reverse()},default:ir}),Js=Bo.map({silhouette:function(t){var e,i,n,r=t.length,o=t[0].length,a=[],s=0,l=[];for(i=0;i<o;++i){for(e=0,n=0;e<r;e++)n+=t[e][i][1];n>s&&(s=n),a.push(n)}for(i=0;i<o;++i)l[i]=(s-a[i])/2;return l},wiggle:function(t){var e,i,n,r,o,a,s,l,c,h=t.length,u=t[0],d=u.length,f=[];for(f[0]=l=c=0,i=1;i<d;++i){for(e=0,r=0;e<h;++e)r+=t[e][i][1];for(e=0,o=0,s=u[i][0]-u[i-1][0];e<h;++e){for(n=0,a=(t[e][i][1]-t[e][i-1][1])/(2*s);n<e;++n)a+=(t[n][i][1]-t[n][i-1][1])/s;o+=a*t[e][i][1]}f[i]=l-=r?o/r*s:0,l<c&&(c=l)}for(i=0;i<d;++i)f[i]-=c;return f},expand:function(t){var e,i,n,r=t.length,o=t[0].length,a=1/r,s=[];for(i=0;i<o;++i){for(e=0,n=0;e<r;e++)n+=t[e][i][1];if(n)for(e=0;e<r;e++)t[e][i][1]/=n;else for(e=0;e<r;e++)t[e][i][1]=a}for(i=0;i<o;++i)s[i]=0;return s},zero:nr});Bo.layout.histogram=function(){function t(t,o){for(var a,s,l=[],c=t.map(i,this),h=n.call(this,c,o),u=r.call(this,h,c,o),o=-1,d=c.length,f=u.length-1,p=e?1:1/d;++o<f;)(a=l[o]=[]).dx=u[o+1]-(a.x=u[o]),a.y=0;if(f>0)for(o=-1;++o<d;)(s=c[o])>=h[0]&&s<=h[1]&&((a=l[Bo.bisect(u,s,1,f)-1]).y+=p,a.push(t[o]));return l}var e=!0,i=Number,n=cr,r=sr;return t.value=function(e){return arguments.length?(i=e,t):i},t.range=function(e){return arguments.length?(n=Tt(e),t):n},t.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return lr(t,e)}:Tt(e),t):r},t.frequency=function(i){return arguments.length?(e=!!i,t):e},t},Bo.layout.pack=function(){function t(t,o){var a=i.call(this,t,o),s=a[0],l=r[0],c=r[1],h=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,qn(s,function(t){t.r=+h(t.value)}),qn(s,pr),n){var u=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;qn(s,function(t){t.r+=u}),qn(s,pr),qn(s,function(t){t.r-=u})}return vr(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),a}var e,i=Bo.layout.hierarchy().sort(hr),n=0,r=[1,1];return t.size=function(e){return arguments.length?(r=e,t):r},t.radius=function(i){return arguments.length?(e=null==i||"function"==typeof i?i:+i,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},Yn(t,i)},Bo.layout.tree=function(){function t(t,r){var h=a.call(this,t,r),u=h[0],d=e(u);if(qn(d,i),d.parent.m=-d.z,Gn(d,n),c)Gn(u,o);else{var f=u,p=u,g=u;Gn(u,function(t){t.x<f.x&&(f=t),t.x>p.x&&(p=t),t.depth>g.depth&&(g=t)});var m=s(f,p)/2-f.x,v=l[0]/(p.x+s(p,f)/2+m),y=l[1]/(g.depth||1);Gn(u,function(t){t.x=(t.x+m)*v,t.y=t.depth*y})}return h}function e(t){for(var e,i={A:null,children:[t]},n=[i];null!=(e=n.pop());)for(var r,o=e.children,a=0,s=o.length;a<s;++a)n.push((o[a]=r={_:o[a],parent:e,children:(r=o[a].children)&&r.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=r);return i.children[0]}function i(t){var e=t.children,i=t.parent.children,n=t.i?i[t.i-1]:null;if(e.length){Sr(t);var o=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+s(t._,n._),t.m=t.z-o):t.z=o}else n&&(t.z=n.z+s(t._,n._));t.parent.A=r(t,n,t.parent.A||i[0])}function n(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function r(t,e,i){if(e){for(var n,r=t,o=t,a=e,l=r.parent.children[0],c=r.m,h=o.m,u=a.m,d=l.m;a=_r(a),r=xr(r),a&&r;)l=xr(l),(o=_r(o)).a=t,(n=a.z+u-r.z-c+s(a._,r._))>0&&(wr(Cr(a,t,i),t,n),c+=n,h+=n),u+=a.m,c+=r.m,d+=l.m,h+=o.m;a&&!_r(o)&&(o.t=a,o.m+=u-h),r&&!xr(l)&&(l.t=r,l.m+=c-d,i=t)}return i}function o(t){t.x*=l[0],t.y=t.depth*l[1]}var a=Bo.layout.hierarchy().sort(null).value(null),s=br,l=[1,1],c=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(c=null==(l=e)?o:null,t):c?null:l},t.nodeSize=function(e){return arguments.length?(c=null==(l=e)?null:o,t):c?l:null},Yn(t,a)},Bo.layout.cluster=function(){function t(t,o){var a,s=e.call(this,t,o),l=s[0],c=0;qn(l,function(t){var e=t.children;e&&e.length?(t.x=Tr(e),t.y=kr(e)):(t.x=a?c+=i(t,a):0,t.y=0,a=t)});var h=Ar(l),u=Dr(l),d=h.x-i(h,u)/2,f=u.x+i(u,h)/2;return qn(l,r?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-d)/(f-d)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=Bo.layout.hierarchy().sort(null).value(null),i=br,n=[1,1],r=!1;return t.separation=function(e){return arguments.length?(i=e,t):i},t.size=function(e){return arguments.length?(r=null==(n=e),t):r?null:n},t.nodeSize=function(e){return arguments.length?(r=null!=(n=e),t):r?n:null},Yn(t,e)},Bo.layout.treemap=function(){function t(t,e){for(var i,n,r=-1,o=t.length;++r<o;)n=(i=t[r]).value*(e<0?0:e),i.area=isNaN(n)||n<=0?0:n}function e(i){var o=i.children;if(o&&o.length){var a,s,l,c=u(i),h=[],d=o.slice(),p=1/0,g="slice"===f?c.dx:"dice"===f?c.dy:"slice-dice"===f?1&i.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(d,c.dx*c.dy/i.value),h.area=0;(l=d.length)>0;)h.push(a=d[l-1]),h.area+=a.area,"squarify"!==f||(s=n(h,g))<=p?(d.pop(),p=s):(h.area-=h.pop().area,r(h,g,c,!1),g=Math.min(c.dx,c.dy),h.length=h.area=0,p=1/0);h.length&&(r(h,g,c,!0),h.length=h.area=0),o.forEach(e)}}function i(e){var n=e.children;if(n&&n.length){var o,a=u(e),s=n.slice(),l=[];for(t(s,a.dx*a.dy/e.value),l.area=0;o=s.pop();)l.push(o),l.area+=o.area,null!=o.z&&(r(l,o.z?a.dx:a.dy,a,!s.length),l.length=l.area=0);n.forEach(i)}}function n(t,e){for(var i,n=t.area,r=0,o=1/0,a=-1,s=t.length;++a<s;)(i=t[a].area)&&(i<o&&(o=i),i>r&&(r=i));return n*=n,e*=e,n?Math.max(e*r*p/n,n/(e*o*p)):1/0}function r(t,e,i,n){var r,o=-1,a=t.length,s=i.x,c=i.y,h=e?l(t.area/e):0;if(e==i.dx){for((n||h>i.dy)&&(h=i.dy);++o<a;)(r=t[o]).x=s,r.y=c,r.dy=h,s+=r.dx=Math.min(i.x+i.dx-s,h?l(r.area/h):0);r.z=!0,r.dx+=i.x+i.dx-s,i.y+=h,i.dy-=h}else{for((n||h>i.dx)&&(h=i.dx);++o<a;)(r=t[o]).x=s,r.y=c,r.dx=h,c+=r.dy=Math.min(i.y+i.dy-c,h?l(r.area/h):0);r.z=!1,r.dy+=i.y+i.dy-c,i.x+=h,i.dx-=h}}function o(n){var r=a||s(n),o=r[0];return o.x=o.y=0,o.value?(o.dx=c[0],o.dy=c[1]):o.dx=o.dy=0,a&&s.revalue(o),t([o],o.dx*o.dy/o.value),(a?i:e)(o),d&&(a=r),r}var a,s=Bo.layout.hierarchy(),l=Math.round,c=[1,1],h=null,u=Mr,d=!1,f="squarify",p=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(c=t,o):c},o.padding=function(t){function e(e){return Er(e,t)}if(!arguments.length)return h;var i;return u=null==(h=t)?Mr:"function"==(i=typeof t)?function(e){var i=t.call(o,e,e.depth);return null==i?Mr(e):Er(e,"number"==typeof i?[i,i,i,i]:i)}:"number"===i?(t=[t,t,t,t],e):e,o},o.round=function(t){return arguments.length?(l=t?Math.round:Number,o):l!=Number},o.sticky=function(t){return arguments.length?(d=t,a=null,o):d},o.ratio=function(t){return arguments.length?(p=t,o):p},o.mode=function(t){return arguments.length?(f=t+"",o):f},Yn(o,s)},Bo.random={normal:function(t,e){var i=arguments.length;return i<2&&(e=1),i<1&&(t=0),function(){var i,n,r;do{r=(i=2*Math.random()-1)*i+(n=2*Math.random()-1)*n}while(!r||r>1);return t+e*i*Math.sqrt(-2*Math.log(r)/r)}},logNormal:function(){var t=Bo.random.normal.apply(Bo,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Bo.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,i=0;i<t;i++)e+=Math.random();return e}}},Bo.scale={};var tl={floor:y,ceil:y};Bo.scale.linear=function(){return Fr([0,1],[0,1],fn,!1)};var el={s:1,g:1,p:1,r:1,e:1};Bo.scale.log=function(){return Ur(Bo.scale.linear().domain([0,1]),10,!0,[1,10])};var il=Bo.format(".0e"),nl={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};Bo.scale.pow=function(){return Yr(Bo.scale.linear(),1,[0,1])},Bo.scale.sqrt=function(){return Bo.scale.pow().exponent(.5)},Bo.scale.ordinal=function(){return qr([],{t:"range",a:[[]]})},Bo.scale.category10=function(){return Bo.scale.ordinal().range(rl)},Bo.scale.category20=function(){return Bo.scale.ordinal().range(ol)},Bo.scale.category20b=function(){return Bo.scale.ordinal().range(al)},Bo.scale.category20c=function(){return Bo.scale.ordinal().range(sl)};var rl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(bt),ol=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(bt),al=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(bt),sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(bt);Bo.scale.quantile=function(){return Xr([],[])},Bo.scale.quantize=function(){return Kr(0,1,[0,1])},Bo.scale.threshold=function(){return Zr([.5],[0,1])},Bo.scale.identity=function(){return Qr([0,1])},Bo.svg={},Bo.svg.arc=function(){function t(){var t=Math.max(0,+i.apply(this,arguments)),c=Math.max(0,+n.apply(this,arguments)),h=a.apply(this,arguments)-xa,u=s.apply(this,arguments)-xa,d=Math.abs(u-h),f=h>u?0:1;if(c<t&&(p=c,c=t,t=p),d>=ba)return e(c,f)+(t?e(t,1-f):"")+"Z";var p,g,m,v,y,b,x,_,w,S,C,k,T=0,A=0,D=[];if((v=(+l.apply(this,arguments)||0)/2)&&(m=o===ll?Math.sqrt(t*t+c*c):+o.apply(this,arguments),f||(A*=-1),c&&(A=et(m/c*Math.sin(v))),t&&(T=et(m/t*Math.sin(v)))),c){y=c*Math.cos(h+A),b=c*Math.sin(h+A),x=c*Math.cos(u-A),_=c*Math.sin(u-A);var M=Math.abs(u-h-2*A)<=va?0:1;if(A&&oo(y,b,x,_)===f^M){var E=(h+u)/2;y=c*Math.cos(E),b=c*Math.sin(E),x=_=null}}else y=b=0;if(t){w=t*Math.cos(u-T),S=t*Math.sin(u-T),C=t*Math.cos(h+T),k=t*Math.sin(h+T);var P=Math.abs(h-u+2*T)<=va?0:1;if(T&&oo(w,S,C,k)===1-f^P){var L=(h+u)/2;w=t*Math.cos(L),S=t*Math.sin(L),C=k=null}}else w=S=0;if(d>ga&&(p=Math.min(Math.abs(c-t)/2,+r.apply(this,arguments)))>.001){g=t<c^f?0:1;var I=p,O=p;if(d<va){var R=null==C?[w,S]:null==x?[y,b]:Di([y,b],[C,k],[x,_],[w,S]),N=y-R[0],F=b-R[1],z=x-R[0],H=_-R[1],$=1/Math.sin(Math.acos((N*z+F*H)/(Math.sqrt(N*N+F*F)*Math.sqrt(z*z+H*H)))/2),V=Math.sqrt(R[0]*R[0]+R[1]*R[1]);O=Math.min(p,(t-V)/($-1)),I=Math.min(p,(c-V)/($+1))}if(null!=x){var B=ao(null==C?[w,S]:[C,k],[y,b],c,I,f),W=ao([x,_],[w,S],c,I,f);p===I?D.push("M",B[0],"A",I,",",I," 0 0,",g," ",B[1],"A",c,",",c," 0 ",1-f^oo(B[1][0],B[1][1],W[1][0],W[1][1]),",",f," ",W[1],"A",I,",",I," 0 0,",g," ",W[0]):D.push("M",B[0],"A",I,",",I," 0 1,",g," ",W[0])}else D.push("M",y,",",b);if(null!=C){var j=ao([y,b],[C,k],t,-O,f),U=ao([w,S],null==x?[y,b]:[x,_],t,-O,f);p===O?D.push("L",U[0],"A",O,",",O," 0 0,",g," ",U[1],"A",t,",",t," 0 ",f^oo(U[1][0],U[1][1],j[1][0],j[1][1]),",",1-f," ",j[1],"A",O,",",O," 0 0,",g," ",j[0]):D.push("L",U[0],"A",O,",",O," 0 0,",g," ",j[0])}else D.push("L",w,",",S)}else D.push("M",y,",",b),null!=x&&D.push("A",c,",",c," 0 ",M,",",f," ",x,",",_),D.push("L",w,",",S),null!=C&&D.push("A",t,",",t," 0 ",P,",",1-f," ",C,",",k);return D.push("Z"),D.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var i=to,n=eo,r=Jr,o=ll,a=io,s=no,l=ro;return t.innerRadius=function(e){return arguments.length?(i=Tt(e),t):i},t.outerRadius=function(e){return arguments.length?(n=Tt(e),t):n},t.cornerRadius=function(e){return arguments.length?(r=Tt(e),t):r},t.padRadius=function(e){return arguments.length?(o=e==ll?ll:Tt(e),t):o},t.startAngle=function(e){return arguments.length?(a=Tt(e),t):a},t.endAngle=function(e){return arguments.length?(s=Tt(e),t):s},t.padAngle=function(e){return arguments.length?(l=Tt(e),t):l},t.centroid=function(){var t=(+i.apply(this,arguments)+ +n.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-xa;return[Math.cos(e)*t,Math.sin(e)*t]},t};var ll="auto";Bo.svg.line=function(){return so(y)};var cl=Bo.map({linear:lo,"linear-closed":co,step:function(t){for(var e=0,i=t.length,n=t[0],r=[n[0],",",n[1]];++e<i;)r.push("H",(n[0]+(n=t[e])[0])/2,"V",n[1]);return i>1&&r.push("H",n[0]),r.join("")},"step-before":ho,"step-after":uo,basis:go,"basis-open":function(t){if(t.length<4)return lo(t);for(var e,i=[],n=-1,r=t.length,o=[0],a=[0];++n<3;)e=t[n],o.push(e[0]),a.push(e[1]);for(i.push(mo(dl,o)+","+mo(dl,a)),--n;++n<r;)e=t[n],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),vo(i,o,a);return i.join("")},"basis-closed":function(t){for(var e,i,n=-1,r=t.length,o=r+4,a=[],s=[];++n<4;)i=t[n%r],a.push(i[0]),s.push(i[1]);for(e=[mo(dl,a),",",mo(dl,s)],--n;++n<o;)i=t[n%r],a.shift(),a.push(i[0]),s.shift(),s.push(i[1]),vo(e,a,s);return e.join("")},bundle:function(t,e){var i=t.length-1;if(i)for(var n,r,o=t[0][0],a=t[0][1],s=t[i][0]-o,l=t[i][1]-a,c=-1;++c<=i;)r=c/i,(n=t[c])[0]=e*n[0]+(1-e)*(o+r*s),n[1]=e*n[1]+(1-e)*(a+r*l);return go(t)},cardinal:function(t,e){return t.length<3?lo(t):t[0]+fo(t,po(t,e))},"cardinal-open":function(t,e){return t.length<4?lo(t):t[1]+fo(t.slice(1,-1),po(t,e))},"cardinal-closed":function(t,e){return t.length<3?co(t):t[0]+fo((t.push(t[0]),t),po([t[t.length-2]].concat(t,[t[1]]),e))},monotone:function(t){return t.length<3?lo(t):t[0]+fo(t,xo(t))}});cl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var hl=[0,2/3,1/3,0],ul=[0,1/3,2/3,0],dl=[0,1/6,2/3,1/6];Bo.svg.line.radial=function(){var t=so(_o);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ho.reverse=uo,uo.reverse=ho,Bo.svg.area=function(){return wo(y)},Bo.svg.area.radial=function(){var t=wo(_o);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Bo.svg.chord=function(){function t(t,s){var l=e(this,o,t,s),c=e(this,a,t,s);return"M"+l.p0+n(l.r,l.p1,l.a1-l.a0)+(i(l,c)?r(l.r,l.p1,l.r,l.p0):r(l.r,l.p1,c.r,c.p0)+n(c.r,c.p1,c.a1-c.a0)+r(c.r,c.p1,l.r,l.p0))+"Z"}function e(t,e,i,n){var r=e.call(t,i,n),o=s.call(t,r,n),a=l.call(t,r,n)-xa,h=c.call(t,r,n)-xa;return{r:o,a0:a,a1:h,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(h),o*Math.sin(h)]}}function i(t,e){return t.a0==e.a0&&t.a1==e.a1}function n(t,e,i){return"A"+t+","+t+" 0 "+ +(i>va)+",1 "+e}function r(t,e,i,n){return"Q 0,0 "+n}var o=pi,a=gi,s=So,l=io,c=no;return t.radius=function(e){return arguments.length?(s=Tt(e),t):s},t.source=function(e){return arguments.length?(o=Tt(e),t):o},t.target=function(e){return arguments.length?(a=Tt(e),t):a},t.startAngle=function(e){return arguments.length?(l=Tt(e),t):l},t.endAngle=function(e){return arguments.length?(c=Tt(e),t):c},t},Bo.svg.diagonal=function(){function t(t,r){var o=e.call(this,t,r),a=i.call(this,t,r),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=pi,i=gi,n=Co;return t.source=function(i){return arguments.length?(e=Tt(i),t):e},t.target=function(e){return arguments.length?(i=Tt(e),t):i},t.projection=function(e){return arguments.length?(n=e,t):n},t},Bo.svg.diagonal.radial=function(){var t=Bo.svg.diagonal(),e=Co,i=t.projection;return t.projection=function(t){return arguments.length?i(ko(e=t)):e},t},Bo.svg.symbol=function(){function t(t,n){return(fl.get(e.call(this,t,n))||Do)(i.call(this,t,n))}var e=Ao,i=To;return t.type=function(i){return arguments.length?(e=Tt(i),t):e},t.size=function(e){return arguments.length?(i=Tt(e),t):i},t};var fl=Bo.map({circle:Do,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*gl)),i=e*gl;return"M0,"+-e+"L"+i+",0 0,"+e+" "+-i+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/pl),i=e*pl/2;return"M0,"+i+"L"+e+","+-i+" "+-e+","+-i+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/pl),i=e*pl/2;return"M0,"+-i+"L"+e+","+i+" "+-e+","+i+"Z"}});Bo.svg.symbolTypes=fl.keys();var pl=Math.sqrt(3),gl=Math.tan(30*_a);sa.transition=function(t){for(var e,i,n=ml||++xl,r=Io(t),o=[],a=vl||{time:Date.now(),ease:xn,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(e=[]);for(var c=this[s],h=-1,u=c.length;++h<u;)(i=c[h])&&Oo(i,h,r,n,a),e.push(i)}return Eo(o,r,n)},sa.interrupt=function(t){return this.each(null==t?yl:Mo(Io(t)))};var ml,vl,yl=Mo(Io()),bl=[],xl=0;bl.call=sa.call,bl.empty=sa.empty,bl.node=sa.node,bl.size=sa.size,Bo.transition=function(t,e){return t&&t.transition?ml?t.transition(e):t:Bo.selection().transition(t)},Bo.transition.prototype=bl,bl.select=function(t){var e,i,n,r=this.id,o=this.namespace,a=[];t=D(t);for(var s=-1,l=this.length;++s<l;){a.push(e=[]);for(var c=this[s],h=-1,u=c.length;++h<u;)(n=c[h])&&(i=t.call(n,n.__data__,h,s))?("__data__"in n&&(i.__data__=n.__data__),Oo(i,h,o,r,n[o][r]),e.push(i)):e.push(null)}return Eo(a,o,r)},bl.selectAll=function(t){var e,i,n,r,o,a=this.id,s=this.namespace,l=[];t=M(t);for(var c=-1,h=this.length;++c<h;)for(var u=this[c],d=-1,f=u.length;++d<f;)if(n=u[d]){o=n[s][a],i=t.call(n,n.__data__,d,c),l.push(e=[]);for(var p=-1,g=i.length;++p<g;)(r=i[p])&&Oo(r,p,s,a,o),e.push(r)}return Eo(l,s,a)},bl.filter=function(t){var e,i,n,r=[];"function"!=typeof t&&(t=V(t));for(var o=0,a=this.length;o<a;o++){r.push(e=[]);for(var s=0,l=(i=this[o]).length;s<l;s++)(n=i[s])&&t.call(n,n.__data__,s,o)&&e.push(n)}return Eo(r,this.namespace,this.id)},bl.tween=function(t,e){var i=this.id,n=this.namespace;return arguments.length<2?this.node()[n][i].tween.get(t):W(this,null==e?function(e){e[n][i].tween.remove(t)}:function(r){r[n][i].tween.set(t,e)})},bl.attr=function(t,e){function i(){this.removeAttribute(o)}function n(){this.removeAttributeNS(o.space,o.local)}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var r="transform"==t?Rn:fn,o=Bo.ns.qualify(t);return Po(this,"attr."+t,e,o.local?function(t){return null==t?n:(t+="",function(){var e,i=this.getAttributeNS(o.space,o.local);return i!==t&&(e=r(i,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})})}:function(t){return null==t?i:(t+="",function(){var e,i=this.getAttribute(o);return i!==t&&(e=r(i,t),function(t){this.setAttribute(o,e(t))})})})},bl.attrTween=function(t,e){var i=Bo.ns.qualify(t);return this.tween("attr."+t,i.local?function(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}:function(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}})},bl.style=function(t,i,n){function r(){this.style.removeProperty(t)}var o=arguments.length;if(o<3){if("string"!=typeof t){o<2&&(i="");for(n in t)this.style(n,t[n],i);return this}n=""}return Po(this,"style."+t,i,function(i){return null==i?r:(i+="",function(){var r,o=e(this).getComputedStyle(this,null).getPropertyValue(t);return o!==i&&(r=fn(o,i),function(e){this.style.setProperty(t,r(e),n)})})})},bl.styleTween=function(t,i,n){return arguments.length<3&&(n=""),this.tween("style."+t,function(r,o){var a=i.call(this,r,o,e(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),n)}})},bl.text=function(t){return Po(this,"text",t,Lo)},bl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},bl.ease=function(t){var e=this.id,i=this.namespace;return arguments.length<1?this.node()[i][e].ease:("function"!=typeof t&&(t=Bo.ease.apply(Bo,arguments)),W(this,function(n){n[i][e].ease=t}))},bl.delay=function(t){var e=this.id,i=this.namespace;return arguments.length<1?this.node()[i][e].delay:W(this,"function"==typeof t?function(n,r,o){n[i][e].delay=+t.call(n,n.__data__,r,o)}:(t=+t,function(n){n[i][e].delay=t}))},bl.duration=function(t){var e=this.id,i=this.namespace;return arguments.length<1?this.node()[i][e].duration:W(this,"function"==typeof t?function(n,r,o){n[i][e].duration=Math.max(1,t.call(n,n.__data__,r,o))}:(t=Math.max(1,t),function(n){n[i][e].duration=t}))},bl.each=function(t,e){var i=this.id,n=this.namespace;if(arguments.length<2){var r=vl,o=ml;try{ml=i,W(this,function(e,r,o){vl=e[n][i],t.call(e,e.__data__,r,o)})}finally{vl=r,ml=o}}else W(this,function(r){var o=r[n][i];(o.event||(o.event=Bo.dispatch("start","end","interrupt"))).on(t,e)});return this},bl.transition=function(){for(var t,e,i,n,r=this.id,o=++xl,a=this.namespace,s=[],l=0,c=this.length;l<c;l++){s.push(t=[]);for(var h=0,u=(e=this[l]).length;h<u;h++)(i=e[h])&&Oo(i,h,a,o,{time:(n=i[a][r]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),t.push(i)}return Eo(s,a,o)},Bo.svg.axis=function(){function t(t){t.each(function(){var t,c=Bo.select(this),h=this.__chart__||i,u=this.__chart__=i.copy(),d=null==l?u.ticks?u.ticks.apply(u,s):u.domain():l,f=null==e?u.tickFormat?u.tickFormat.apply(u,s):y:e,p=c.selectAll(".tick").data(d,u),g=p.enter().insert("g",".domain").attr("class","tick").style("opacity",ga),m=Bo.transition(p.exit()).style("opacity",ga).remove(),v=Bo.transition(p.order()).style("opacity",1),b=Math.max(r,0)+a,x=Lr(u),_=c.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),Bo.transition(_));g.append("line"),g.append("text");var S,C,k,T,A=g.select("line"),D=v.select("line"),M=p.select("text").text(f),E=g.select("text"),P=v.select("text"),L="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(t=Ro,S="x",k="y",C="x2",T="y2",M.attr("dy",L<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+x[0]+","+L*o+"V0H"+x[1]+"V"+L*o)):(t=No,S="y",k="x",C="y2",T="x2",M.attr("dy",".32em").style("text-anchor",L<0?"end":"start"),w.attr("d","M"+L*o+","+x[0]+"H0V"+x[1]+"H"+L*o)),A.attr(T,L*r),E.attr(k,L*b),D.attr(C,0).attr(T,L*r),P.attr(S,0).attr(k,L*b),u.rangeBand){var I=u,O=I.rangeBand()/2;h=u=function(t){return I(t)+O}}else h.rangeBand?h=u:m.call(t,u,h);g.call(t,h,u),v.call(t,u,u)})}var e,i=Bo.scale.linear(),n=_l,r=6,o=6,a=3,s=[10],l=null;return t.scale=function(e){return arguments.length?(i=e,t):i},t.orient=function(e){return arguments.length?(n=e in wl?e+"":_l,t):n},t.ticks=function(){return arguments.length?(s=jo(arguments),t):s},t.tickValues=function(e){return arguments.length?(l=e,t):l},t.tickFormat=function(i){return arguments.length?(e=i,t):e},t.tickSize=function(e){var i=arguments.length;return i?(r=+e,o=+arguments[i-1],t):r},t.innerTickSize=function(e){return arguments.length?(r=+e,t):r},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var _l="bottom",wl={top:1,right:1,bottom:1,left:1};Bo.svg.brush=function(){function t(e){e.each(function(){var e=Bo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=e.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=e.selectAll(".resize").data(g,y);s.exit().remove(),s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Sl[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",t.empty()?"none":null);var l,u=Bo.transition(e),d=Bo.transition(a);c&&(l=Lr(c),d.attr("x",l[0]).attr("width",l[1]-l[0]),n(u)),h&&(l=Lr(h),d.attr("y",l[0]).attr("height",l[1]-l[0]),r(u)),i(u)})}function i(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+u[+/e$/.test(t)]+","+d[+/^s/.test(t)]+")"})}function n(t){t.select(".extent").attr("x",u[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",u[1]-u[0])}function r(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function o(){function o(){var t=Bo.mouse(b),e=!1;y&&(t[0]+=y[0],t[1]+=y[1]),A||(Bo.event.altKey?(v||(v=[(u[0]+u[1])/2,(d[0]+d[1])/2]),M[0]=u[+(t[0]<v[0])],M[1]=d[+(t[1]<v[1])]):v=null),k&&g(t,c,0)&&(n(w),e=!0),T&&g(t,h,1)&&(r(w),e=!0),e&&(i(w),_({type:"brush",mode:A?"move":"resize"}))}function g(t,e,i){var n,r,o=Lr(e),l=o[0],c=o[1],h=M[i],g=i?d:u,m=g[1]-g[0];if(A&&(l-=h,c-=m+h),n=(i?p:f)?Math.max(l,Math.min(c,t[i])):t[i],A?r=(n+=h)+m:(v&&(h=Math.max(l,Math.min(c,2*v[i]-n))),h<n?(r=n,n=h):r=h),g[0]!=n||g[1]!=r)return i?s=null:a=null,g[0]=n,g[1]=r,!0}function m(){o(),w.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Bo.select("body").style("cursor",null),E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),_({type:"brushend"})}var v,y,b=this,x=Bo.select(Bo.event.target),_=l.of(b,arguments),w=Bo.select(b),S=x.datum(),k=!/^(n|s)$/.test(S)&&c,T=!/^(e|w)$/.test(S)&&h,A=x.classed("extent"),D=X(b),M=Bo.mouse(b),E=Bo.select(e(b)).on("keydown.brush",function(){32==Bo.event.keyCode&&(A||(v=null,M[0]-=u[1],M[1]-=d[1],A=2),C())}).on("keyup.brush",function(){32==Bo.event.keyCode&&2==A&&(M[0]+=u[1],M[1]+=d[1],A=0,C())});if(Bo.event.changedTouches?E.on("touchmove.brush",o).on("touchend.brush",m):E.on("mousemove.brush",o).on("mouseup.brush",m),w.interrupt().selectAll("*").interrupt(),A)M[0]=u[0]-M[0],M[1]=d[0]-M[1];else if(S){var P=+/w$/.test(S),L=+/^n/.test(S);y=[u[1-P]-M[0],d[1-L]-M[1]],M[0]=u[P],M[1]=d[L]}else Bo.event.altKey&&(v=M.slice());w.style("pointer-events","none").selectAll(".resize").style("display",null),Bo.select("body").style("cursor",x.style("cursor")),_({type:"brushstart"}),o()}var a,s,l=T(t,"brushstart","brush","brushend"),c=null,h=null,u=[0,0],d=[0,0],f=!0,p=!0,g=Cl[0];return t.event=function(t){t.each(function(){var t=l.of(this,arguments),e={x:u,y:d,i:a,j:s},i=this.__chart__||e;this.__chart__=e,ml?Bo.select(this).transition().each("start.brush",function(){a=i.i,s=i.j,u=i.x,d=i.y,t({type:"brushstart"})}).tween("brush:brush",function(){var i=pn(u,e.x),n=pn(d,e.y);return a=s=null,function(r){u=e.x=i(r),d=e.y=n(r),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(c=e,g=Cl[!c<<1|!h],t):c},t.y=function(e){return arguments.length?(h=e,g=Cl[!c<<1|!h],t):h},t.clamp=function(e){return arguments.length?(c&&h?(f=!!e[0],p=!!e[1]):c?f=!!e:h&&(p=!!e),t):c&&h?[f,p]:c?f:h?p:null},t.extent=function(e){var i,n,r,o,l;return arguments.length?(c&&(i=e[0],n=e[1],h&&(i=i[0],n=n[0]),a=[i,n],c.invert&&(i=c(i),n=c(n)),n<i&&(l=i,i=n,n=l),i==u[0]&&n==u[1]||(u=[i,n])),h&&(r=e[0],o=e[1],c&&(r=r[1],o=o[1]),s=[r,o],h.invert&&(r=h(r),o=h(o)),o<r&&(l=r,r=o,o=l),r==d[0]&&o==d[1]||(d=[r,o])),t):(c&&(a?(i=a[0],n=a[1]):(i=u[0],n=u[1],c.invert&&(i=c.invert(i),n=c.invert(n)),n<i&&(l=i,i=n,n=l))),h&&(s?(r=s[0],o=s[1]):(r=d[0],o=d[1],h.invert&&(r=h.invert(r),o=h.invert(o)),o<r&&(l=r,r=o,o=l))),c&&h?[[i,r],[n,o]]:c?[i,n]:h&&[r,o])},t.clear=function(){return t.empty()||(u=[0,0],d=[0,0],a=s=null),t},t.empty=function(){return!!c&&u[0]==u[1]||!!h&&d[0]==d[1]},Bo.rebind(t,l,"on")};var Sl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Cl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],kl=ja.format=Ka.timeFormat,Tl=kl.utc,Al=Tl("%Y-%m-%dT%H:%M:%S.%LZ");kl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Fo:Al,Fo.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Fo.toString=Al.toString,ja.second=Ht(function(t){return new Ua(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ja.seconds=ja.second.range,ja.seconds.utc=ja.second.utc.range,ja.minute=Ht(function(t){return new Ua(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ja.minutes=ja.minute.range,ja.minutes.utc=ja.minute.utc.range,ja.hour=Ht(function(t){var e=t.getTimezoneOffset()/60;return new Ua(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ja.hours=ja.hour.range,ja.hours.utc=ja.hour.utc.range,ja.month=Ht(function(t){return(t=ja.day(t)).setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ja.months=ja.month.range,ja.months.utc=ja.month.utc.range;var Dl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ml=[[ja.second,1],[ja.second,5],[ja.second,15],[ja.second,30],[ja.minute,1],[ja.minute,5],[ja.minute,15],[ja.minute,30],[ja.hour,1],[ja.hour,3],[ja.hour,6],[ja.hour,12],[ja.day,1],[ja.day,2],[ja.week,1],[ja.month,1],[ja.month,3],[ja.year,1]],El=kl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",De]]),Pl={range:function(t,e,i){return Bo.range(Math.ceil(t/i)*i,+e,i).map(Ho)},floor:y,ceil:y};Ml.year=ja.year,ja.scale=function(){return zo(Bo.scale.linear(),Ml,El)};var Ll=Ml.map(function(t){return[t[0].utc,t[1]]}),Il=Tl.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",De]]);Ll.year=ja.year.utc,ja.scale.utc=function(){return zo(Bo.scale.linear(),Ll,Il)},Bo.text=At(function(t){return t.responseText}),Bo.json=function(t,e){return Dt(t,"application/json",$o,e)},Bo.html=function(t,e){return Dt(t,"text/html",Vo,e)},Bo.xml=At(function(t){return t.responseXML}),"function"==typeof define&&define.amd?(this.d3=Bo,define(Bo)):"object"==typeof module&&module.exports?module.exports=Bo:this.d3=Bo}(),function(){var t,e,i,n,r=[].slice,o=function(t,e){return function(){return t.apply(e,arguments)}},a={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var n in e)a.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},l=[].indexOf||function(t){for(var e=0,i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1};e=window.Morris={},t=jQuery,e.EventEmitter=function(){function t(){}return t.prototype.on=function(t,e){return null==this.handlers&&(this.handlers={}),null==this.handlers[t]&&(this.handlers[t]=[]),this.handlers[t].push(e),this},t.prototype.fire=function(){var t,e,i,n,o,a,s;if(i=arguments[0],t=2<=arguments.length?r.call(arguments,1):[],null!=this.handlers&&null!=this.handlers[i]){for(s=[],n=0,o=(a=this.handlers[i]).length;n<o;n++)e=a[n],s.push(e.apply(null,t));return s}},t}(),e.commas=function(t){var e,i,n,r;return null!=t?(n=t<0?"-":"",e=Math.abs(t),i=Math.floor(e).toFixed(0),n+=i.replace(/(?=(?:\d{3})+$)(?!^)/g,","),(r=e.toString()).length>i.length&&(n+=r.slice(i.length)),n):"-"},e.pad2=function(t){return(t<10?"0":"")+t},e.Grid=function(i){function n(e){this.resizeHandler=o(this.resizeHandler,this);var i=this;if("string"==typeof e.element?this.el=t(document.getElementById(e.element)):this.el=t(e.element),null==this.el||0===this.el.length)throw new Error("Graph container element not found");"static"===this.el.css("position")&&this.el.css("position","relative"),this.options=t.extend({},this.gridDefaults,this.defaults||{},e),"string"==typeof this.options.units&&(this.options.postUnits=e.units),this.raphael=new Raphael(this.el[0]),this.elementWidth=null,this.elementHeight=null,this.dirty=!1,this.selectFrom=null,this.init&&this.init(),this.setData(this.options.data),this.el.bind("mousemove",function(t){var e,n,r,o,a;return n=i.el.offset(),a=t.pageX-n.left,i.selectFrom?(e=i.data[i.hitTest(Math.min(a,i.selectFrom))]._x,r=i.data[i.hitTest(Math.max(a,i.selectFrom))]._x,o=r-e,i.selectionRect.attr({x:e,width:o})):i.fire("hovermove",a,t.pageY-n.top)}),this.el.bind("mouseleave",function(t){return i.selectFrom&&(i.selectionRect.hide(),i.selectFrom=null),i.fire("hoverout")}),this.el.bind("touchstart touchmove touchend",function(t){var e,n;return n=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],e=i.el.offset(),i.fire("hovermove",n.pageX-e.left,n.pageY-e.top)}),this.el.bind("click",function(t){var e;return e=i.el.offset(),i.fire("gridclick",t.pageX-e.left,t.pageY-e.top)}),this.options.rangeSelect&&(this.selectionRect=this.raphael.rect(0,0,0,this.el.innerHeight()).attr({fill:this.options.rangeSelectColor,stroke:!1}).toBack().hide(),this.el.bind("mousedown",function(t){var e;return e=i.el.offset(),i.startRange(t.pageX-e.left)}),this.el.bind("mouseup",function(t){var e;return e=i.el.offset(),i.endRange(t.pageX-e.left),i.fire("hovermove",t.pageX-e.left,t.pageY-e.top)})),this.options.resize&&t(window).bind("resize",function(t){return null!=i.timeoutId&&window.clearTimeout(i.timeoutId),i.timeoutId=window.setTimeout(i.resizeHandler,100)}),this.el.css("-webkit-tap-highlight-color","rgba(0,0,0,0)"),this.postInit&&this.postInit()}return s(n,i),n.prototype.gridDefaults={dateFormat:null,axes:!0,grid:!0,gridLineColor:"#aaa",gridStrokeWidth:.5,gridTextColor:"#888",gridTextSize:12,gridTextFamily:"sans-serif",gridTextWeight:"normal",hideHover:!1,yLabelFormat:null,xLabelAngle:0,numLines:5,padding:25,parseTime:!0,postUnits:"",preUnits:"",ymax:"auto",ymin:"auto 0",goals:[],goalStrokeWidth:1,goalLineColors:["#666633","#999966","#cc6666","#663333"],events:[],eventStrokeWidth:1,eventLineColors:["#005a04","#ccffbb","#3a5f0b","#005502"],rangeSelect:null,rangeSelectColor:"#eef",resize:!1},n.prototype.setData=function(t,i){var n,r,o,a,s,l,c,h,u,d,f,p,g,m,v;return null==i&&(i=!0),this.options.data=t,null==t||0===t.length?(this.data=[],this.raphael.clear(),void(null!=this.hover&&this.hover.hide())):(p=this.cumulative?0:null,g=this.cumulative?0:null,this.options.goals.length>0&&(s=Math.min.apply(Math,this.options.goals),a=Math.max.apply(Math,this.options.goals),g=null!=g?Math.min(g,s):s,p=null!=p?Math.max(p,a):a),this.data=function(){var i,n,a;for(a=[],o=i=0,n=t.length;i<n;o=++i)c=t[o],(l={src:c}).label=c[this.options.xkey],this.options.parseTime?(l.x=e.parseDate(l.label),this.options.dateFormat?l.label=this.options.dateFormat(l.x):"number"==typeof l.label&&(l.label=new Date(l.label).toString())):(l.x=o,this.options.xLabelFormat&&(l.label=this.options.xLabelFormat(l))),u=0,l.y=function(){var t,e,i,n;for(i=this.options.ykeys,n=[],r=t=0,e=i.length;t<e;r=++t)f=i[r],"string"==typeof(m=c[f])&&(m=parseFloat(m)),null!=m&&"number"!=typeof m&&(m=null),null!=m&&(this.cumulative?u+=m:null!=p?(p=Math.max(m,p),g=Math.min(m,g)):p=g=m),this.cumulative&&null!=u&&(p=Math.max(u,p),g=Math.min(u,g)),n.push(m);return n}.call(this),a.push(l);return a}.call(this),this.options.parseTime&&(this.data=this.data.sort(function(t,e){return(t.x>e.x)-(e.x>t.x)})),this.xmin=this.data[0].x,this.xmax=this.data[this.data.length-1].x,this.events=[],this.options.events.length>0&&(this.options.parseTime?this.events=function(){var t,i,r,o;for(o=[],t=0,i=(r=this.options.events).length;t<i;t++)n=r[t],o.push(e.parseDate(n));return o}.call(this):this.events=this.options.events,this.xmax=Math.max(this.xmax,Math.max.apply(Math,this.events)),this.xmin=Math.min(this.xmin,Math.min.apply(Math,this.events))),this.xmin===this.xmax&&(this.xmin-=1,this.xmax+=1),this.ymin=this.yboundary("min",g),this.ymax=this.yboundary("max",p),this.ymin===this.ymax&&(g&&(this.ymin-=1),this.ymax+=1),!0!==(v=this.options.axes)&&"both"!==v&&"y"!==v&&!0!==this.options.grid||(this.options.ymax===this.gridDefaults.ymax&&this.options.ymin===this.gridDefaults.ymin?(this.grid=this.autoGridLines(this.ymin,this.ymax,this.options.numLines),this.ymin=Math.min(this.ymin,this.grid[0]),this.ymax=Math.max(this.ymax,this.grid[this.grid.length-1])):(h=(this.ymax-this.ymin)/(this.options.numLines-1),this.grid=function(){var t,e,i;for(i=[],d=t=this.ymin,e=this.ymax;h>0?t<=e:t>=e;d=t+=h)i.push(d);return i}.call(this))),this.dirty=!0,i?this.redraw():void 0)},n.prototype.yboundary=function(t,e){var i,n;return"string"==typeof(i=this.options["y"+t])?"auto"===i.slice(0,4)?i.length>5?(n=parseInt(i.slice(5),10),null==e?n:Math[t](e,n)):null!=e?e:0:parseInt(i,10):i},n.prototype.autoGridLines=function(t,e,i){var n,r,o,a,s,l,c,h,u;return s=e-t,u=Math.floor(Math.log(s)/Math.log(10)),c=Math.pow(10,u),r=Math.floor(t/c)*c,n=Math.ceil(e/c)*c,l=(n-r)/(i-1),1===c&&l>1&&Math.ceil(l)!==l&&(l=Math.ceil(l),n=r+l*(i-1)),r<0&&n>0&&(r=Math.floor(t/l)*l,n=Math.ceil(e/l)*l),l<1?(a=Math.floor(Math.log(l)/Math.log(10)),o=function(){var t,e;for(e=[],h=t=r;l>0?t<=n:t>=n;h=t+=l)e.push(parseFloat(h.toFixed(1-a)));return e}()):o=function(){var t,e;for(e=[],h=t=r;l>0?t<=n:t>=n;h=t+=l)e.push(h);return e}(),o},n.prototype._calc=function(){var t,e,i,n,r,o,a,s;if(r=this.el.width(),i=this.el.height(),(this.elementWidth!==r||this.elementHeight!==i||this.dirty)&&(this.elementWidth=r,this.elementHeight=i,this.dirty=!1,this.left=this.options.padding,this.right=this.elementWidth-this.options.padding,this.top=this.options.padding,this.bottom=this.elementHeight-this.options.padding,!0!==(a=this.options.axes)&&"both"!==a&&"y"!==a||(o=function(){var t,i,n,r;for(r=[],t=0,i=(n=this.grid).length;t<i;t++)e=n[t],r.push(this.measureText(this.yAxisFormat(e)).width);return r}.call(this),this.left+=Math.max.apply(Math,o)),!0!==(s=this.options.axes)&&"both"!==s&&"x"!==s||(t=function(){var t,e,i;for(i=[],n=t=0,e=this.data.length;0<=e?t<e:t>e;n=0<=e?++t:--t)i.push(this.measureText(this.data[n].text,-this.options.xLabelAngle).height);return i}.call(this),this.bottom-=Math.max.apply(Math,t)),this.width=Math.max(1,this.right-this.left),this.height=Math.max(1,this.bottom-this.top),this.dx=this.width/(this.xmax-this.xmin),this.dy=this.height/(this.ymax-this.ymin),this.calc))return this.calc()},n.prototype.transY=function(t){return this.bottom-(t-this.ymin)*this.dy},n.prototype.transX=function(t){return 1===this.data.length?(this.left+this.right)/2:this.left+(t-this.xmin)*this.dx},n.prototype.redraw=function(){if(this.raphael.clear(),this._calc(),this.drawGrid(),this.drawGoals(),this.drawEvents(),this.draw)return this.draw()},n.prototype.measureText=function(t,e){var i,n;return null==e&&(e=0),n=this.raphael.text(100,100,t).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).rotate(e),i=n.getBBox(),n.remove(),i},n.prototype.yAxisFormat=function(t){return this.yLabelFormat(t)},n.prototype.yLabelFormat=function(t){return"function"==typeof this.options.yLabelFormat?this.options.yLabelFormat(t):""+this.options.preUnits+e.commas(t)+this.options.postUnits},n.prototype.drawGrid=function(){var t,e,i,n,r,o,a,s;if(!1!==this.options.grid||!0===(r=this.options.axes)||"both"===r||"y"===r){for(s=[],i=0,n=(o=this.grid).length;i<n;i++)t=o[i],e=this.transY(t),!0!==(a=this.options.axes)&&"both"!==a&&"y"!==a||this.drawYAxisLabel(this.left-this.options.padding/2,e,this.yAxisFormat(t)),this.options.grid?s.push(this.drawGridLine("M"+this.left+","+e+"H"+(this.left+this.width))):s.push(void 0);return s}},n.prototype.drawGoals=function(){var t,e,i,n,r,o,a;for(a=[],i=n=0,r=(o=this.options.goals).length;n<r;i=++n)e=o[i],t=this.options.goalLineColors[i%this.options.goalLineColors.length],a.push(this.drawGoal(e,t));return a},n.prototype.drawEvents=function(){var t,e,i,n,r,o,a;for(a=[],i=n=0,r=(o=this.events).length;n<r;i=++n)e=o[i],t=this.options.eventLineColors[i%this.options.eventLineColors.length],a.push(this.drawEvent(e,t));return a},n.prototype.drawGoal=function(t,e){return this.raphael.path("M"+this.left+","+this.transY(t)+"H"+this.right).attr("stroke",e).attr("stroke-width",this.options.goalStrokeWidth)},n.prototype.drawEvent=function(t,e){return this.raphael.path("M"+this.transX(t)+","+this.bottom+"V"+this.top).attr("stroke",e).attr("stroke-width",this.options.eventStrokeWidth)},n.prototype.drawYAxisLabel=function(t,e,i){return this.raphael.text(t,e,i).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor).attr("text-anchor","end")},n.prototype.drawGridLine=function(t){return this.raphael.path(t).attr("stroke",this.options.gridLineColor).attr("stroke-width",this.options.gridStrokeWidth)},n.prototype.startRange=function(t){return this.hover.hide(),this.selectFrom=t,this.selectionRect.attr({x:t,width:0}).show()},n.prototype.endRange=function(t){var e,i;if(this.selectFrom)return i=Math.min(this.selectFrom,t),e=Math.max(this.selectFrom,t),this.options.rangeSelect.call(this.el,{start:this.data[this.hitTest(i)].x,end:this.data[this.hitTest(e)].x}),this.selectFrom=null},n.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},n}(e.EventEmitter),e.parseDate=function(t){var e,i,n,r,o,a,s,l,c,h,u;return"number"==typeof t?t:(i=t.match(/^(\d+) Q(\d)$/),r=t.match(/^(\d+)-(\d+)$/),o=t.match(/^(\d+)-(\d+)-(\d+)$/),s=t.match(/^(\d+) W(\d+)$/),l=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+)(Z|([+-])(\d\d):?(\d\d))?$/),c=t.match(/^(\d+)-(\d+)-(\d+)[ T](\d+):(\d+):(\d+(\.\d+)?)(Z|([+-])(\d\d):?(\d\d))?$/),i?new Date(parseInt(i[1],10),3*parseInt(i[2],10)-1,1).getTime():r?new Date(parseInt(r[1],10),parseInt(r[2],10)-1,1).getTime():o?new Date(parseInt(o[1],10),parseInt(o[2],10)-1,parseInt(o[3],10)).getTime():s?(4!==(h=new Date(parseInt(s[1],10),0,1)).getDay()&&h.setMonth(0,1+(4-h.getDay()+7)%7),h.getTime()+6048e5*parseInt(s[2],10)):l?l[6]?(a=0,"Z"!==l[6]&&(a=60*parseInt(l[8],10)+parseInt(l[9],10),"+"===l[7]&&(a=0-a)),Date.UTC(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)+a)):new Date(parseInt(l[1],10),parseInt(l[2],10)-1,parseInt(l[3],10),parseInt(l[4],10),parseInt(l[5],10)).getTime():c?(u=parseFloat(c[6]),e=Math.floor(u),n=Math.round(1e3*(u-e)),c[8]?(a=0,"Z"!==c[8]&&(a=60*parseInt(c[10],10)+parseInt(c[11],10),"+"===c[9]&&(a=0-a)),Date.UTC(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10)+a,e,n)):new Date(parseInt(c[1],10),parseInt(c[2],10)-1,parseInt(c[3],10),parseInt(c[4],10),parseInt(c[5],10),e,n).getTime()):new Date(parseInt(t,10),0,1).getTime())},e.Hover=function(){function i(i){null==i&&(i={}),this.options=t.extend({},e.Hover.defaults,i),this.el=t("<div class='"+this.options.class+"'></div>"),this.el.hide(),this.options.parent.append(this.el)}return i.defaults={class:"morris-hover morris-default-style"},i.prototype.update=function(t,e,i){return t?(this.html(t),this.show(),this.moveTo(e,i)):this.hide()},i.prototype.html=function(t){return this.el.html(t)},i.prototype.moveTo=function(t,e){var i,n,r,o,a,s;return a=this.options.parent.innerWidth(),o=this.options.parent.innerHeight(),n=this.el.outerWidth(),i=this.el.outerHeight(),r=Math.min(Math.max(0,t-n/2),a-n),null!=e?(s=e-i-10)<0&&(s=e+10)+i>o&&(s=o/2-i/2):s=o/2-i/2,this.el.css({left:r+"px",top:parseInt(s)+"px"})},i.prototype.show=function(){return this.el.show()},i.prototype.hide=function(){return this.el.hide()},i}(),e.Line=function(t){function i(t){if(this.hilight=o(this.hilight,this),this.onHoverOut=o(this.onHoverOut,this),this.onHoverMove=o(this.onHoverMove,this),this.onGridClick=o(this.onGridClick,this),!(this instanceof e.Line))return new e.Line(t);i.__super__.constructor.call(this,t)}return s(i,t),i.prototype.init=function(){if("always"!==this.options.hideHover)return this.hover=new e.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)},i.prototype.defaults={lineWidth:3,pointSize:4,lineColors:["#0b62a4","#7A92A3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],pointStrokeWidths:[1],pointStrokeColors:["#ffffff"],pointFillColors:[],smooth:!0,xLabels:"auto",xLabelFormat:null,xLabelMargin:24,hideHover:!1},i.prototype.calc=function(){return this.calcPoints(),this.generatePaths()},i.prototype.calcPoints=function(){var t,e,i,n,r,o;for(o=[],i=0,n=(r=this.data).length;i<n;i++)(t=r[i])._x=this.transX(t.x),t._y=function(){var i,n,r,o;for(o=[],i=0,n=(r=t.y).length;i<n;i++)null!=(e=r[i])?o.push(this.transY(e)):o.push(e);return o}.call(this),o.push(t._ymax=Math.min.apply(Math,[this.bottom].concat(function(){var i,n,r,o;for(o=[],i=0,n=(r=t._y).length;i<n;i++)null!=(e=r[i])&&o.push(e);return o}())));return o},i.prototype.hitTest=function(t){var e,i,n,r,o;if(0===this.data.length)return null;for(e=n=0,r=(o=this.data.slice(1)).length;n<r&&(i=o[e],!(t<(i._x+this.data[e]._x)/2));e=++n);return e},i.prototype.onGridClick=function(t,e){var i;return i=this.hitTest(t),this.fire("click",i,this.data[i].src,t,e)},i.prototype.onHoverMove=function(t,e){var i;return i=this.hitTest(t),this.displayHoverForRow(i)},i.prototype.onHoverOut=function(){if(!1!==this.options.hideHover)return this.displayHoverForRow(null)},i.prototype.displayHoverForRow=function(t){var e;return null!=t?((e=this.hover).update.apply(e,this.hoverContentForRow(t)),this.hilight(t)):(this.hover.hide(),this.hilight())},i.prototype.hoverContentForRow=function(t){var e,i,n,r,o,a,s;for(e="<div class='morris-hover-row-label'>"+(n=this.data[t]).label+"</div>",i=o=0,a=(s=n.y).length;o<a;i=++o)r=s[i],e+="<div class='morris-hover-point' style='color: "+this.colorFor(n,i,"label")+"'>\n "+this.options.labels[i]+":\n "+this.yLabelFormat(r)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(e=this.options.hoverCallback(t,this.options,e,n.src)),[e,n._x,n._ymax]},i.prototype.generatePaths=function(){var t,i,n,r;return this.paths=function(){var o,a,s,c;for(c=[],i=o=0,a=this.options.ykeys.length;0<=a?o<a:o>a;i=0<=a?++o:--o)r="boolean"==typeof this.options.smooth?this.options.smooth:(s=this.options.ykeys[i],l.call(this.options.smooth,s)>=0),(t=function(){var t,e,r,o;for(o=[],t=0,e=(r=this.data).length;t<e;t++)void 0!==(n=r[t])._y[i]&&o.push({x:n._x,y:n._y[i]});return o}.call(this)).length>1?c.push(e.Line.createPath(t,r,this.bottom)):c.push(null);return c}.call(this)},i.prototype.draw=function(){var t;if(!0!==(t=this.options.axes)&&"both"!==t&&"x"!==t||this.drawXAxis(),this.drawSeries(),!1===this.options.hideHover)return this.displayHoverForRow(this.data.length-1)},i.prototype.drawXAxis=function(){var t,i,n,r,o,a,s,l,c,h,u=this;for(s=this.bottom+this.options.padding/2,o=null,r=null,t=function(t,e){var i,n,a,l,c;return i=u.drawXAxisLabel(u.transX(e),s,t),c=i.getBBox(),i.transform("r"+-u.options.xLabelAngle),n=i.getBBox(),i.transform("t0,"+n.height/2+"..."),0!==u.options.xLabelAngle&&(l=-.5*c.width*Math.cos(u.options.xLabelAngle*Math.PI/180),i.transform("t"+l+",0...")),n=i.getBBox(),(null==o||o>=n.x+n.width||null!=r&&r>=n.x)&&n.x>=0&&n.x+n.width<u.el.width()?(0!==u.options.xLabelAngle&&(a=1.25*u.options.gridTextSize/Math.sin(u.options.xLabelAngle*Math.PI/180),r=n.x-a),o=n.x-u.options.xLabelMargin):i.remove()},(n=this.options.parseTime?1===this.data.length&&"auto"===this.options.xLabels?[[this.data[0].label,this.data[0].x]]:e.labelSeries(this.xmin,this.xmax,this.width,this.options.xLabels,this.options.xLabelFormat):function(){var t,e,i,n;for(n=[],t=0,e=(i=this.data).length;t<e;t++)a=i[t],n.push([a.label,a.x]);return n}.call(this)).reverse(),h=[],l=0,c=n.length;l<c;l++)i=n[l],h.push(t(i[0],i[1]));return h},i.prototype.drawSeries=function(){var t,e,i,n,r,o;for(this.seriesPoints=[],t=e=n=this.options.ykeys.length-1;n<=0?e<=0:e>=0;t=n<=0?++e:--e)this._drawLineFor(t);for(o=[],t=i=r=this.options.ykeys.length-1;r<=0?i<=0:i>=0;t=r<=0?++i:--i)o.push(this._drawPointFor(t));return o},i.prototype._drawPointFor=function(t){var e,i,n,r,o,a;for(this.seriesPoints[t]=[],a=[],n=0,r=(o=this.data).length;n<r;n++)e=null,null!=(i=o[n])._y[t]&&(e=this.drawLinePoint(i._x,i._y[t],this.colorFor(i,t,"point"),t)),a.push(this.seriesPoints[t].push(e));return a},i.prototype._drawLineFor=function(t){var e;if(null!==(e=this.paths[t]))return this.drawLinePath(e,this.colorFor(null,t,"line"),t)},i.createPath=function(t,i,n){var r,o,a,s,l,c,h,u,d,f;for(h="",i&&(a=e.Line.gradients(t)),u={y:null},s=d=0,f=t.length;d<f;s=++d)null!=(r=t[s]).y&&(null!=u.y?i?(o=a[s],c=a[s-1],l=(r.x-u.x)/4,h+="C"+(u.x+l)+","+Math.min(n,u.y+l*c)+","+(r.x-l)+","+Math.min(n,r.y-l*o)+","+r.x+","+r.y):h+="L"+r.x+","+r.y:i&&null==a[s]||(h+="M"+r.x+","+r.y)),u=r;return h},i.gradients=function(t){var e,i,n,r,o,a,s,l;for(i=function(t,e){return(t.y-e.y)/(t.x-e.x)},l=[],n=a=0,s=t.length;a<s;n=++a)null!=(e=t[n]).y?(r=t[n+1]||{y:null},null!=(o=t[n-1]||{y:null}).y&&null!=r.y?l.push(i(o,r)):null!=o.y?l.push(i(o,e)):null!=r.y?l.push(i(e,r)):l.push(null)):l.push(null);return l},i.prototype.hilight=function(t){var e,i,n,r,o;if(null!==this.prevHilight&&this.prevHilight!==t)for(e=i=0,r=this.seriesPoints.length-1;0<=r?i<=r:i>=r;e=0<=r?++i:--i)this.seriesPoints[e][this.prevHilight]&&this.seriesPoints[e][this.prevHilight].animate(this.pointShrinkSeries(e));if(null!==t&&this.prevHilight!==t)for(e=n=0,o=this.seriesPoints.length-1;0<=o?n<=o:n>=o;e=0<=o?++n:--n)this.seriesPoints[e][t]&&this.seriesPoints[e][t].animate(this.pointGrowSeries(e));return this.prevHilight=t},i.prototype.colorFor=function(t,e,i){return"function"==typeof this.options.lineColors?this.options.lineColors.call(this,t,e,i):"point"===i?this.options.pointFillColors[e%this.options.pointFillColors.length]||this.options.lineColors[e%this.options.lineColors.length]:this.options.lineColors[e%this.options.lineColors.length]},i.prototype.drawXAxisLabel=function(t,e,i){return this.raphael.text(t,e,i).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},i.prototype.drawLinePath=function(t,e,i){return this.raphael.path(t).attr("stroke",e).attr("stroke-width",this.lineWidthForSeries(i))},i.prototype.drawLinePoint=function(t,e,i,n){return this.raphael.circle(t,e,this.pointSizeForSeries(n)).attr("fill",i).attr("stroke-width",this.pointStrokeWidthForSeries(n)).attr("stroke",this.pointStrokeColorForSeries(n))},i.prototype.pointStrokeWidthForSeries=function(t){return this.options.pointStrokeWidths[t%this.options.pointStrokeWidths.length]},i.prototype.pointStrokeColorForSeries=function(t){return this.options.pointStrokeColors[t%this.options.pointStrokeColors.length]},i.prototype.lineWidthForSeries=function(t){return this.options.lineWidth instanceof Array?this.options.lineWidth[t%this.options.lineWidth.length]:this.options.lineWidth},i.prototype.pointSizeForSeries=function(t){return this.options.pointSize instanceof Array?this.options.pointSize[t%this.options.pointSize.length]:this.options.pointSize},i.prototype.pointGrowSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)+3},25,"linear")},i.prototype.pointShrinkSeries=function(t){return Raphael.animation({r:this.pointSizeForSeries(t)},25,"linear")},i}(e.Grid),e.labelSeries=function(i,n,r,o,a){var s,l,c,h,u,d,f,p,g,m,v;if(c=200*(n-i)/r,l=new Date(i),void 0===(f=e.LABEL_SPECS[o]))for(g=0,m=(v=e.AUTO_LABEL_ORDER).length;g<m;g++)if(h=v[g],d=e.LABEL_SPECS[h],c>=d.span){f=d;break}for(void 0===f&&(f=e.LABEL_SPECS.second),a&&(f=t.extend({},f,{fmt:a})),s=f.start(l),u=[];(p=s.getTime())<=n;)p>=i&&u.push([f.fmt(s),p]),f.incr(s);return u},i=function(t){return{span:60*t*1e3,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours())},fmt:function(t){return e.pad2(t.getHours())+":"+e.pad2(t.getMinutes())},incr:function(e){return e.setUTCMinutes(e.getUTCMinutes()+t)}}},n=function(t){return{span:1e3*t,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes())},fmt:function(t){return e.pad2(t.getHours())+":"+e.pad2(t.getMinutes())+":"+e.pad2(t.getSeconds())},incr:function(e){return e.setUTCSeconds(e.getUTCSeconds()+t)}}},e.LABEL_SPECS={decade:{span:1728e8,start:function(t){return new Date(t.getFullYear()-t.getFullYear()%10,0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+10)}},year:{span:1728e7,start:function(t){return new Date(t.getFullYear(),0,1)},fmt:function(t){return""+t.getFullYear()},incr:function(t){return t.setFullYear(t.getFullYear()+1)}},month:{span:24192e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),1)},fmt:function(t){return t.getFullYear()+"-"+e.pad2(t.getMonth()+1)},incr:function(t){return t.setMonth(t.getMonth()+1)}},week:{span:6048e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return t.getFullYear()+"-"+e.pad2(t.getMonth()+1)+"-"+e.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+7)}},day:{span:864e5,start:function(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())},fmt:function(t){return t.getFullYear()+"-"+e.pad2(t.getMonth()+1)+"-"+e.pad2(t.getDate())},incr:function(t){return t.setDate(t.getDate()+1)}},hour:i(60),"30min":i(30),"15min":i(15),"10min":i(10),"5min":i(5),minute:i(1),"30sec":n(30),"15sec":n(15),"10sec":n(10),"5sec":n(5),second:n(1)},e.AUTO_LABEL_ORDER=["decade","year","month","week","day","hour","30min","15min","10min","5min","minute","30sec","15sec","10sec","5sec","second"],e.Area=function(i){function n(i){var o;if(!(this instanceof e.Area))return new e.Area(i);o=t.extend({},r,i),this.cumulative=!o.behaveLikeLine,"auto"===o.fillOpacity&&(o.fillOpacity=o.behaveLikeLine?.8:1),n.__super__.constructor.call(this,o)}var r;return s(n,i),r={fillOpacity:"auto",behaveLikeLine:!1},n.prototype.calcPoints=function(){var t,e,i,n,r,o,a;for(a=[],n=0,r=(o=this.data).length;n<r;n++)(t=o[n])._x=this.transX(t.x),e=0,t._y=function(){var n,r,o,a;for(a=[],n=0,r=(o=t.y).length;n<r;n++)i=o[n],this.options.behaveLikeLine?a.push(this.transY(i)):(e+=i||0,a.push(this.transY(e)));return a}.call(this),a.push(t._ymax=Math.max.apply(Math,t._y));return a},n.prototype.drawSeries=function(){var t,e,i,n,r,o,a,s;for(this.seriesPoints=[],s=[],i=0,n=(e=this.options.behaveLikeLine?function(){o=[];for(var t=0,e=this.options.ykeys.length-1;0<=e?t<=e:t>=e;0<=e?t++:t--)o.push(t);return o}.apply(this):function(){a=[];for(var t=r=this.options.ykeys.length-1;r<=0?t<=0:t>=0;r<=0?t++:t--)a.push(t);return a}.apply(this)).length;i<n;i++)t=e[i],this._drawFillFor(t),this._drawLineFor(t),s.push(this._drawPointFor(t));return s},n.prototype._drawFillFor=function(t){var e;if(null!==(e=this.paths[t]))return e=e+"L"+this.transX(this.xmax)+","+this.bottom+"L"+this.transX(this.xmin)+","+this.bottom+"Z",this.drawFilledPath(e,this.fillForSeries(t))},n.prototype.fillForSeries=function(t){var e;return e=Raphael.rgb2hsl(this.colorFor(this.data[t],t,"line")),Raphael.hsl(e.h,this.options.behaveLikeLine?.9*e.s:.75*e.s,Math.min(.98,this.options.behaveLikeLine?1.2*e.l:1.25*e.l))},n.prototype.drawFilledPath=function(t,e){return this.raphael.path(t).attr("fill",e).attr("fill-opacity",this.options.fillOpacity).attr("stroke","none")},n}(e.Line),e.Bar=function(i){function n(i){if(this.onHoverOut=o(this.onHoverOut,this),this.onHoverMove=o(this.onHoverMove,this),this.onGridClick=o(this.onGridClick,this),!(this instanceof e.Bar))return new e.Bar(i);n.__super__.constructor.call(this,t.extend({},i,{parseTime:!1}))}return s(n,i),n.prototype.init=function(){if(this.cumulative=this.options.stacked,"always"!==this.options.hideHover)return this.hover=new e.Hover({parent:this.el}),this.on("hovermove",this.onHoverMove),this.on("hoverout",this.onHoverOut),this.on("gridclick",this.onGridClick)},n.prototype.defaults={barSizeRatio:.75,barGap:3,barColors:["#0b62a4","#7a92a3","#4da74d","#afd8f8","#edc240","#cb4b4b","#9440ed"],barOpacity:1,barRadius:[0,0,0,0],xLabelMargin:50},n.prototype.calc=function(){var t;if(this.calcBars(),!1===this.options.hideHover)return(t=this.hover).update.apply(t,this.hoverContentForRow(this.data.length-1))},n.prototype.calcBars=function(){var t,e,i,n,r,o,a;for(a=[],t=n=0,r=(o=this.data).length;n<r;t=++n)(e=o[t])._x=this.left+this.width*(t+.5)/this.data.length,a.push(e._y=function(){var t,n,r,o;for(o=[],t=0,n=(r=e.y).length;t<n;t++)null!=(i=r[t])?o.push(this.transY(i)):o.push(null);return o}.call(this));return a},n.prototype.draw=function(){var t;return!0!==(t=this.options.axes)&&"both"!==t&&"x"!==t||this.drawXAxis(),this.drawSeries()},n.prototype.drawXAxis=function(){var t,e,i,n,r,o,a,s,l,c,h,u,d;for(c=this.bottom+(this.options.xAxisLabelTopPadding||this.options.padding/2),a=null,o=null,d=[],t=h=0,u=this.data.length;0<=u?h<u:h>u;t=0<=u?++h:--h)s=this.data[this.data.length-1-t],l=(e=this.drawXAxisLabel(s._x,c,s.label)).getBBox(),e.transform("r"+-this.options.xLabelAngle),i=e.getBBox(),e.transform("t0,"+i.height/2+"..."),0!==this.options.xLabelAngle&&(r=-.5*l.width*Math.cos(this.options.xLabelAngle*Math.PI/180),e.transform("t"+r+",0...")),(null==a||a>=i.x+i.width||null!=o&&o>=i.x)&&i.x>=0&&i.x+i.width<this.el.width()?(0!==this.options.xLabelAngle&&(n=1.25*this.options.gridTextSize/Math.sin(this.options.xLabelAngle*Math.PI/180),o=i.x-n),d.push(a=i.x-this.options.xLabelMargin)):d.push(e.remove());return d},n.prototype.drawSeries=function(){var t,e,i,n,r,o,a,s,l,c,h,u,d,f,p;return i=this.width/this.options.data.length,s=this.options.stacked?1:this.options.ykeys.length,t=(i*this.options.barSizeRatio-this.options.barGap*(s-1))/s,this.options.barSize&&(t=Math.min(t,this.options.barSize)),u=i-t*s-this.options.barGap*(s-1),a=u/2,p=this.ymin<=0&&this.ymax>=0?this.transY(0):null,this.bars=function(){var s,u,g,m;for(g=this.data,m=[],n=s=0,u=g.length;s<u;n=++s)l=g[n],r=0,m.push(function(){var s,u,g,m;for(g=l._y,m=[],c=s=0,u=g.length;s<u;c=++s)null!==(f=g[c])?(p?(d=Math.min(f,p),e=Math.max(f,p)):(d=f,e=this.bottom),o=this.left+n*i+a,this.options.stacked||(o+=c*(t+this.options.barGap)),h=e-d,this.options.verticalGridCondition&&this.options.verticalGridCondition(l.x)&&this.drawBar(this.left+n*i,this.top,i,Math.abs(this.top-this.bottom),this.options.verticalGridColor,this.options.verticalGridOpacity,this.options.barRadius),this.options.stacked&&(d-=r),this.drawBar(o,d,t,h,this.colorFor(l,c,"bar"),this.options.barOpacity,this.options.barRadius),m.push(r+=h)):m.push(null);return m}.call(this));return m}.call(this)},n.prototype.colorFor=function(t,e,i){var n,r;return"function"==typeof this.options.barColors?(n={x:t.x,y:t.y[e],label:t.label},r={index:e,key:this.options.ykeys[e],label:this.options.labels[e]},this.options.barColors.call(this,n,r,i)):this.options.barColors[e%this.options.barColors.length]},n.prototype.hitTest=function(t){return 0===this.data.length?null:(t=Math.max(Math.min(t,this.right),this.left),Math.min(this.data.length-1,Math.floor((t-this.left)/(this.width/this.data.length))))},n.prototype.onGridClick=function(t,e){var i;return i=this.hitTest(t),this.fire("click",i,this.data[i].src,t,e)},n.prototype.onHoverMove=function(t,e){var i,n;return i=this.hitTest(t),(n=this.hover).update.apply(n,this.hoverContentForRow(i))},n.prototype.onHoverOut=function(){if(!1!==this.options.hideHover)return this.hover.hide()},n.prototype.hoverContentForRow=function(t){var e,i,n,r,o,a,s,l;for(e="<div class='morris-hover-row-label'>"+(n=this.data[t]).label+"</div>",i=a=0,s=(l=n.y).length;a<s;i=++a)o=l[i],e+="<div class='morris-hover-point' style='color: "+this.colorFor(n,i,"label")+"'>\n "+this.options.labels[i]+":\n "+this.yLabelFormat(o)+"\n</div>";return"function"==typeof this.options.hoverCallback&&(e=this.options.hoverCallback(t,this.options,e,n.src)),r=this.left+(t+.5)*this.width/this.data.length,[e,r]},n.prototype.drawXAxisLabel=function(t,e,i){return this.raphael.text(t,e,i).attr("font-size",this.options.gridTextSize).attr("font-family",this.options.gridTextFamily).attr("font-weight",this.options.gridTextWeight).attr("fill",this.options.gridTextColor)},n.prototype.drawBar=function(t,e,i,n,r,o,a){var s;return s=Math.max.apply(Math,a),(0===s||s>n?this.raphael.rect(t,e,i,n):this.raphael.path(this.roundedRect(t,e,i,n,a))).attr("fill",r).attr("fill-opacity",o).attr("stroke","none")},n.prototype.roundedRect=function(t,e,i,n,r){return null==r&&(r=[0,0,0,0]),["M",t,r[0]+e,"Q",t,e,t+r[0],e,"L",t+i-r[1],e,"Q",t+i,e,t+i,e+r[1],"L",t+i,e+n-r[2],"Q",t+i,e+n,t+i-r[2],e+n,"L",t+r[3],e+n,"Q",t,e+n,t,e+n-r[3],"Z"]},n}(e.Grid),e.Donut=function(i){function n(i){this.resizeHandler=o(this.resizeHandler,this),this.select=o(this.select,this),this.click=o(this.click,this);var n=this;if(!(this instanceof e.Donut))return new e.Donut(i);if(this.options=t.extend({},this.defaults,i),"string"==typeof i.element?this.el=t(document.getElementById(i.element)):this.el=t(i.element),null===this.el||0===this.el.length)throw new Error("Graph placeholder not found.");void 0!==i.data&&0!==i.data.length&&(this.raphael=new Raphael(this.el[0]),this.options.resize&&t(window).bind("resize",function(t){return null!=n.timeoutId&&window.clearTimeout(n.timeoutId),n.timeoutId=window.setTimeout(n.resizeHandler,100)}),this.setData(i.data))}return s(n,i),n.prototype.defaults={colors:["#0B62A4","#3980B5","#679DC6","#95BBD7","#B0CCE1","#095791","#095085","#083E67","#052C48","#042135"],backgroundColor:"#FFFFFF",labelColor:"#000000",formatter:e.commas,resize:!1},n.prototype.redraw=function(){var t,i,n,r,o,a,s,l,c,h,u,d,f,p,g,m,v,y,b,x,_,w;for(this.raphael.clear(),i=this.el.width()/2,n=this.el.height()/2,d=(Math.min(i,n)-10)/3,u=0,f=0,m=(b=this.values).length;f<m;f++)u+=b[f];for(l=5/(2*d),t=1.9999*Math.PI-l*this.data.length,a=0,o=0,this.segments=[],r=p=0,v=(x=this.values).length;p<v;r=++p)c=a+l+t*(x[r]/u),(h=new e.DonutSegment(i,n,2*d,d,a,c,this.data[r].color||this.options.colors[o%this.options.colors.length],this.options.backgroundColor,o,this.raphael)).render(),this.segments.push(h),h.on("hover",this.select),h.on("click",this.click),a=c,o+=1;for(this.text1=this.drawEmptyDonutLabel(i,n-10,this.options.labelColor,15,800),this.text2=this.drawEmptyDonutLabel(i,n+10,this.options.labelColor,14),s=Math.max.apply(Math,this.values),o=0,w=[],g=0,y=(_=this.values).length;g<y;g++){if(_[g]===s){this.select(o);break}w.push(o+=1)}return w},n.prototype.setData=function(t){var e;return this.data=t,this.values=function(){var t,i,n,r;for(r=[],t=0,i=(n=this.data).length;t<i;t++)e=n[t],r.push(parseFloat(e.value));return r}.call(this),this.redraw()},n.prototype.click=function(t){return this.fire("click",t,this.data[t])},n.prototype.select=function(t){var e,i,n,r;for(i=0,n=(r=this.segments).length;i<n;i++)r[i].deselect();return this.segments[t].select(),e=this.data[t],this.setLabels(e.label,this.options.formatter(e.value,e))},n.prototype.setLabels=function(t,e){var i,n,r,o,a,s,l,c;return i=2*(Math.min(this.el.width()/2,this.el.height()/2)-10)/3,o=1.8*i,r=i/2,n=i/3,this.text1.attr({text:t,transform:""}),a=this.text1.getBBox(),s=Math.min(o/a.width,r/a.height),this.text1.attr({transform:"S"+s+","+s+","+(a.x+a.width/2)+","+(a.y+a.height)}),this.text2.attr({text:e,transform:""}),l=this.text2.getBBox(),c=Math.min(o/l.width,n/l.height),this.text2.attr({transform:"S"+c+","+c+","+(l.x+l.width/2)+","+l.y})},n.prototype.drawEmptyDonutLabel=function(t,e,i,n,r){var o;return o=this.raphael.text(t,e,"").attr("font-size",n).attr("fill",i),null!=r&&o.attr("font-weight",r),o},n.prototype.resizeHandler=function(){return this.timeoutId=null,this.raphael.setSize(this.el.width(),this.el.height()),this.redraw()},n}(e.EventEmitter),e.DonutSegment=function(t){function e(t,e,i,n,r,a,s,l,c,h){this.cx=t,this.cy=e,this.inner=i,this.outer=n,this.color=s,this.backgroundColor=l,this.index=c,this.raphael=h,this.deselect=o(this.deselect,this),this.select=o(this.select,this),this.sin_p0=Math.sin(r),this.cos_p0=Math.cos(r),this.sin_p1=Math.sin(a),this.cos_p1=Math.cos(a),this.is_long=a-r>Math.PI?1:0,this.path=this.calcSegment(this.inner+3,this.inner+this.outer-5),this.selectedPath=this.calcSegment(this.inner+3,this.inner+this.outer),this.hilight=this.calcArc(this.inner)}return s(e,t),e.prototype.calcArcPoints=function(t){return[this.cx+t*this.sin_p0,this.cy+t*this.cos_p0,this.cx+t*this.sin_p1,this.cy+t*this.cos_p1]},e.prototype.calcSegment=function(t,e){var i,n,r,o,a,s,l,c,h,u;return h=this.calcArcPoints(t),i=h[0],r=h[1],n=h[2],o=h[3],u=this.calcArcPoints(e),a=u[0],l=u[1],s=u[2],c=u[3],"M"+i+","+r+"A"+t+","+t+",0,"+this.is_long+",0,"+n+","+o+"L"+s+","+c+"A"+e+","+e+",0,"+this.is_long+",1,"+a+","+l+"Z"},e.prototype.calcArc=function(t){var e,i,n,r,o;return o=this.calcArcPoints(t),e=o[0],n=o[1],i=o[2],r=o[3],"M"+e+","+n+"A"+t+","+t+",0,"+this.is_long+",0,"+i+","+r},e.prototype.render=function(){var t=this;return this.arc=this.drawDonutArc(this.hilight,this.color),this.seg=this.drawDonutSegment(this.path,this.color,this.backgroundColor,function(){return t.fire("hover",t.index)},function(){return t.fire("click",t.index)})},e.prototype.drawDonutArc=function(t,e){return this.raphael.path(t).attr({stroke:e,"stroke-width":2,opacity:0})},e.prototype.drawDonutSegment=function(t,e,i,n,r){return this.raphael.path(t).attr({fill:e,stroke:i,"stroke-width":3}).hover(n).click(r)},e.prototype.select=function(){if(!this.selected)return this.seg.animate({path:this.selectedPath},150,"<>"),this.arc.animate({opacity:1},150,"<>"),this.selected=!0},e.prototype.deselect=function(){if(this.selected)return this.seg.animate({path:this.path},150,"<>"),this.arc.animate({opacity:0},150,"<>"),this.selected=!1},e}(e.EventEmitter)}.call(this),function(t){t.color={},t.color.make=function(e,i,n,r){var o={};return o.r=e||0,o.g=i||0,o.b=n||0,o.a=null!=r?r:1,o.add=function(t,e){for(var i=0;i<t.length;++i)o[t.charAt(i)]+=e;return o.normalize()},o.scale=function(t,e){for(var i=0;i<t.length;++i)o[t.charAt(i)]*=e;return o.normalize()},o.toString=function(){return o.a>=1?"rgb("+[o.r,o.g,o.b].join(",")+")":"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"},o.normalize=function(){function t(t,e,i){return e<t?t:e>i?i:e}return o.r=t(0,parseInt(o.r),255),o.g=t(0,parseInt(o.g),255),o.b=t(0,parseInt(o.b),255),o.a=t(0,o.a,1),o},o.clone=function(){return t.color.make(o.r,o.b,o.g,o.a)},o.normalize()},t.color.extract=function(e,i){var n;do{if(""!=(n=e.css(i).toLowerCase())&&"transparent"!=n)break;e=e.parent()}while(e.length&&!t.nodeName(e.get(0),"body"));return"rgba(0, 0, 0, 0)"==n&&(n="transparent"),t.color.parse(n)},t.color.parse=function(i){var n,r=t.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return r(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return r(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return r(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return r(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return r(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return r(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var o=t.trim(i).toLowerCase();return"transparent"==o?r(255,255,255,0):(n=e[o]||[0,0,0],r(n[0],n[1],n[2]))};var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],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],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(t){function e(e,i){var n=i.children("."+e)[0];if(null==n&&(n=document.createElement("canvas"),n.className=e,t(n).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(i),!n.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");n=window.G_vmlCanvasManager.initElement(n)}this.element=n;var r=this.context=n.getContext("2d"),o=window.devicePixelRatio||1,a=r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;this.pixelRatio=o/a,this.resize(i.width(),i.height()),this.textContainer=null,this.text={},this._textCache={}}function i(i,r,o,a){function s(t,e){e=[ut].concat(e);for(var i=0;i<t.length;++i)t[i].apply(this,e)}function l(t){Q=c(t),p(),g()}function c(e){for(var i=[],n=0;n<e.length;++n){var r=t.extend(!0,{},J.series);null!=e[n].data?(r.data=e[n].data,delete e[n].data,t.extend(!0,r,e[n]),e[n].data=r.data):r.data=e[n],i.push(r)}return i}function h(t,e){var i=t[e+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function u(){return t.grep(ot.concat(at),function(t){return t})}function d(t){var e,i,n={};for(e=0;e<ot.length;++e)(i=ot[e])&&i.used&&(n["x"+i.n]=i.c2p(t.left));for(e=0;e<at.length;++e)(i=at[e])&&i.used&&(n["y"+i.n]=i.c2p(t.top));return void 0!==n.x1&&(n.x=n.x1),void 0!==n.y1&&(n.y=n.y1),n}function f(e,i){return e[i-1]||(e[i-1]={n:i,direction:e==ot?"x":"y",options:t.extend(!0,{},e==ot?J.xaxis:J.yaxis)}),e[i-1]}function p(){var e,i=Q.length,n=-1;for(e=0;e<Q.length;++e){var r=Q[e].color;null!=r&&(i--,"number"==typeof r&&r>n&&(n=r))}i<=n&&(i=n+1);var o,a=[],s=J.colors,l=s.length,c=0;for(e=0;e<i;e++)o=t.color.parse(s[e%l]||"#666"),e%l==0&&e&&(c=c>=0?c<.5?-c-.2:0:-c),a[e]=o.scale("rgb",1+c);var u,d=0;for(e=0;e<Q.length;++e){if(null==(u=Q[e]).color?(u.color=a[d].toString(),++d):"number"==typeof u.color&&(u.color=a[u.color].toString()),null==u.lines.show){var p,g=!0;for(p in u)if(u[p]&&u[p].show){g=!1;break}g&&(u.lines.show=!0)}null==u.lines.zero&&(u.lines.zero=!!u.lines.fill),u.xaxis=f(ot,h(u,"x")),u.yaxis=f(at,h(u,"y"))}}function g(){function e(t,e,i){e<t.datamin&&e!=-y&&(t.datamin=e),i>t.datamax&&i!=y&&(t.datamax=i)}var i,n,r,o,a,l,c,h,d,f,p,g,m=Number.POSITIVE_INFINITY,v=Number.NEGATIVE_INFINITY,y=Number.MAX_VALUE;for(t.each(u(),function(t,e){e.datamin=m,e.datamax=v,e.used=!1}),i=0;i<Q.length;++i)(a=Q[i]).datapoints={points:[]},s(ht.processRawData,[a,a.data,a.datapoints]);for(i=0;i<Q.length;++i){if(a=Q[i],p=a.data,!(g=a.datapoints.format)){if((g=[]).push({x:!0,number:!0,required:!0}),g.push({y:!0,number:!0,required:!0}),a.bars.show||a.lines.show&&a.lines.fill){var b=!!(a.bars.show&&a.bars.zero||a.lines.show&&a.lines.zero);g.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:b}),a.bars.horizontal&&(delete g[g.length-1].y,g[g.length-1].x=!0)}a.datapoints.format=g}if(null==a.datapoints.pointsize){a.datapoints.pointsize=g.length,c=a.datapoints.pointsize,l=a.datapoints.points;var x=a.lines.show&&a.lines.steps;for(a.xaxis.used=a.yaxis.used=!0,n=r=0;n<p.length;++n,r+=c){var _=null==(f=p[n]);if(!_)for(o=0;o<c;++o)h=f[o],(d=g[o])&&(d.number&&null!=h&&(h=+h,isNaN(h)?h=null:h==1/0?h=y:h==-1/0&&(h=-y)),null==h&&(d.required&&(_=!0),null!=d.defaultValue&&(h=d.defaultValue))),l[r+o]=h;if(_)for(o=0;o<c;++o)null!=(h=l[r+o])&&!1!==(d=g[o]).autoscale&&(d.x&&e(a.xaxis,h,h),d.y&&e(a.yaxis,h,h)),l[r+o]=null;else if(x&&r>0&&null!=l[r-c]&&l[r-c]!=l[r]&&l[r-c+1]!=l[r+1]){for(o=0;o<c;++o)l[r+c+o]=l[r+o];l[r+1]=l[r-c+1],r+=c}}}}for(i=0;i<Q.length;++i)a=Q[i],s(ht.processDatapoints,[a,a.datapoints]);for(i=0;i<Q.length;++i){l=(a=Q[i]).datapoints.points,c=a.datapoints.pointsize,g=a.datapoints.format;var w=m,S=m,C=v,k=v;for(n=0;n<l.length;n+=c)if(null!=l[n])for(o=0;o<c;++o)h=l[n+o],(d=g[o])&&!1!==d.autoscale&&h!=y&&h!=-y&&(d.x&&(h<w&&(w=h),h>C&&(C=h)),d.y&&(h<S&&(S=h),h>k&&(k=h)));if(a.bars.show){var T;switch(a.bars.align){case"left":T=0;break;case"right":T=-a.bars.barWidth;break;default:T=-a.bars.barWidth/2}a.bars.horizontal?(S+=T,k+=T+a.bars.barWidth):(w+=T,C+=T+a.bars.barWidth)}e(a.xaxis,w,C),e(a.yaxis,S,k)}t.each(u(),function(t,e){e.datamin==m&&(e.datamin=null),e.datamax==v&&(e.datamax=null)})}function m(){ft&&clearTimeout(ft),it.unbind("mousemove",$),it.unbind("mouseleave",V),it.unbind("click",B),s(ht.shutdown,[it])}function v(t){function e(t){return t}var i,n,r=t.options.transform||e,o=t.options.inverseTransform;"x"==t.direction?(i=t.scale=lt/Math.abs(r(t.max)-r(t.min)),n=Math.min(r(t.max),r(t.min))):(i=t.scale=ct/Math.abs(r(t.max)-r(t.min)),i=-i,n=Math.max(r(t.max),r(t.min))),t.p2c=r==e?function(t){return(t-n)*i}:function(t){return(r(t)-n)*i},t.c2p=o?function(t){return o(n+t/i)}:function(t){return n+t/i}}function y(t){for(var e=t.options,i=t.ticks||[],n=e.labelWidth||0,r=e.labelHeight||0,o=n||("x"==t.direction?Math.floor(tt.width/(i.length||1)):null),a=t.direction+"Axis "+t.direction+t.n+"Axis",s="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+a,l=e.font||"flot-tick-label tickLabel",c=0;c<i.length;++c){var h=i[c];if(h.label){var u=tt.getTextInfo(s,h.label,l,null,o);n=Math.max(n,u.width),r=Math.max(r,u.height)}}t.labelWidth=e.labelWidth||n,t.labelHeight=e.labelHeight||r}function b(e){var i=e.labelWidth,n=e.labelHeight,r=e.options.position,o="x"===e.direction,a=e.options.tickLength,s=J.grid.axisMargin,l=J.grid.labelMargin,c=!0,h=!0,u=!0,d=!1;t.each(o?ot:at,function(t,i){i&&(i.show||i.reserveSpace)&&(i===e?d=!0:i.options.position===r&&(d?h=!1:c=!1),d||(u=!1))}),h&&(s=0),null==a&&(a=u?"full":5),isNaN(+a)||(l+=+a),o?(n+=l,"bottom"==r?(st.bottom+=n+s,e.box={top:tt.height-st.bottom,height:n}):(e.box={top:st.top+s,height:n},st.top+=n+s)):(i+=l,"left"==r?(e.box={left:st.left+s,width:i},st.left+=i+s):(st.right+=i+s,e.box={left:tt.width-st.right,width:i})),e.position=r,e.tickLength=a,e.box.padding=l,e.innermost=c}function x(t){"x"==t.direction?(t.box.left=st.left-t.labelWidth/2,t.box.width=tt.width-st.left-st.right+t.labelWidth):(t.box.top=st.top-t.labelHeight/2,t.box.height=tt.height-st.bottom-st.top+t.labelHeight)}function _(){var e,i=J.grid.minBorderMargin;if(null==i)for(i=0,e=0;e<Q.length;++e)i=Math.max(i,2*(Q[e].points.radius+Q[e].points.lineWidth/2));var n={left:i,right:i,top:i,bottom:i};t.each(u(),function(t,e){e.reserveSpace&&e.ticks&&e.ticks.length&&("x"===e.direction?(n.left=Math.max(n.left,e.labelWidth/2),n.right=Math.max(n.right,e.labelWidth/2)):(n.bottom=Math.max(n.bottom,e.labelHeight/2),n.top=Math.max(n.top,e.labelHeight/2)))}),st.left=Math.ceil(Math.max(n.left,st.left)),st.right=Math.ceil(Math.max(n.right,st.right)),st.top=Math.ceil(Math.max(n.top,st.top)),st.bottom=Math.ceil(Math.max(n.bottom,st.bottom))}function w(){var e,i=u(),n=J.grid.show;for(var r in st){var o=J.grid.margin||0;st[r]="number"==typeof o?o:o[r]||0}s(ht.processOffset,[st]);for(var r in st)"object"==typeof J.grid.borderWidth?st[r]+=n?J.grid.borderWidth[r]:0:st[r]+=n?J.grid.borderWidth:0;if(t.each(i,function(t,e){var i=e.options;e.show=null==i.show?e.used:i.show,e.reserveSpace=null==i.reserveSpace?e.show:i.reserveSpace,S(e)}),n){var a=t.grep(i,function(t){return t.show||t.reserveSpace});for(t.each(a,function(t,e){C(e),k(e),T(e,e.ticks),y(e)}),e=a.length-1;e>=0;--e)b(a[e]);_(),t.each(a,function(t,e){x(e)})}lt=tt.width-st.left-st.right,ct=tt.height-st.bottom-st.top,t.each(i,function(t,e){v(e)}),n&&P(),z()}function S(t){var e=t.options,i=+(null!=e.min?e.min:t.datamin),n=+(null!=e.max?e.max:t.datamax),r=n-i;if(0==r){var o=0==n?1:.01;null==e.min&&(i-=o),null!=e.max&&null==e.min||(n+=o)}else{var a=e.autoscaleMargin;null!=a&&(null==e.min&&(i-=r*a)<0&&null!=t.datamin&&t.datamin>=0&&(i=0),null==e.max&&(n+=r*a)>0&&null!=t.datamax&&t.datamax<=0&&(n=0))}t.min=i,t.max=n}function C(e){var i,r=e.options;i="number"==typeof r.ticks&&r.ticks>0?r.ticks:.3*Math.sqrt("x"==e.direction?tt.width:tt.height);var o=(e.max-e.min)/i,a=-Math.floor(Math.log(o)/Math.LN10),s=r.tickDecimals;null!=s&&a>s&&(a=s);var l,c=Math.pow(10,-a),h=o/c;if(h<1.5?l=1:h<3?(l=2,h>2.25&&(null==s||a+1<=s)&&(l=2.5,++a)):l=h<7.5?5:10,l*=c,null!=r.minTickSize&&l<r.minTickSize&&(l=r.minTickSize),e.delta=o,e.tickDecimals=Math.max(0,null!=s?s:a),e.tickSize=r.tickSize||l,"time"==r.mode&&!e.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");if(e.tickGenerator||(e.tickGenerator=function(t){var e,i=[],r=n(t.min,t.tickSize),o=0,a=Number.NaN;do{e=a,a=r+o*t.tickSize,i.push(a),++o}while(a<t.max&&a!=e);return i},e.tickFormatter=function(t,e){var i=e.tickDecimals?Math.pow(10,e.tickDecimals):1,n=""+Math.round(t*i)/i;if(null!=e.tickDecimals){var r=n.indexOf("."),o=-1==r?0:n.length-r-1;if(o<e.tickDecimals)return(o?n:n+".")+(""+i).substr(1,e.tickDecimals-o)}return n}),t.isFunction(r.tickFormatter)&&(e.tickFormatter=function(t,e){return""+r.tickFormatter(t,e)}),null!=r.alignTicksWithAxis){var u=("x"==e.direction?ot:at)[r.alignTicksWithAxis-1];if(u&&u.used&&u!=e){var d=e.tickGenerator(e);if(d.length>0&&(null==r.min&&(e.min=Math.min(e.min,d[0])),null==r.max&&d.length>1&&(e.max=Math.max(e.max,d[d.length-1]))),e.tickGenerator=function(t){var e,i,n=[];for(i=0;i<u.ticks.length;++i)e=(u.ticks[i].v-u.min)/(u.max-u.min),e=t.min+e*(t.max-t.min),n.push(e);return n},!e.mode&&null==r.tickDecimals){var f=Math.max(0,1-Math.floor(Math.log(e.delta)/Math.LN10)),p=e.tickGenerator(e);p.length>1&&/\..*0$/.test((p[1]-p[0]).toFixed(f))||(e.tickDecimals=f)}}}}function k(e){var i=e.options.ticks,n=[];null==i||"number"==typeof i&&i>0?n=e.tickGenerator(e):i&&(n=t.isFunction(i)?i(e):i);var r,o;for(e.ticks=[],r=0;r<n.length;++r){var a=null,s=n[r];"object"==typeof s?(o=+s[0],s.length>1&&(a=s[1])):o=+s,null==a&&(a=e.tickFormatter(o,e)),isNaN(o)||e.ticks.push({v:o,label:a})}}function T(t,e){t.options.autoscaleMargin&&e.length>0&&(null==t.options.min&&(t.min=Math.min(t.min,e[0].v)),null==t.options.max&&e.length>1&&(t.max=Math.max(t.max,e[e.length-1].v)))}function A(){tt.clear(),s(ht.drawBackground,[nt]);var t=J.grid;t.show&&t.backgroundColor&&M(),t.show&&!t.aboveData&&E();for(var e=0;e<Q.length;++e)s(ht.drawSeries,[nt,Q[e]]),L(Q[e]);s(ht.draw,[nt]),t.show&&t.aboveData&&E(),tt.render(),j()}function D(t,e){for(var i,n,r,o,a=u(),s=0;s<a.length;++s)if((i=a[s]).direction==e&&(o=e+i.n+"axis",t[o]||1!=i.n||(o=e+"axis"),t[o])){n=t[o].from,r=t[o].to;break}if(t[o]||(i="x"==e?ot[0]:at[0],n=t[e+"1"],r=t[e+"2"]),null!=n&&null!=r&&n>r){var l=n;n=r,r=l}return{from:n,to:r,axis:i}}function M(){nt.save(),nt.translate(st.left,st.top),nt.fillStyle=Z(J.grid.backgroundColor,ct,0,"rgba(255, 255, 255, 0)"),nt.fillRect(0,0,lt,ct),nt.restore()}function E(){var e,i,n,r;nt.save(),nt.translate(st.left,st.top);var o=J.grid.markings;if(o)for(t.isFunction(o)&&((i=ut.getAxes()).xmin=i.xaxis.min,i.xmax=i.xaxis.max,i.ymin=i.yaxis.min,i.ymax=i.yaxis.max,o=o(i)),e=0;e<o.length;++e){var a=o[e],s=D(a,"x"),l=D(a,"y");if(null==s.from&&(s.from=s.axis.min),null==s.to&&(s.to=s.axis.max),null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),!(s.to<s.axis.min||s.from>s.axis.max||l.to<l.axis.min||l.from>l.axis.max)){s.from=Math.max(s.from,s.axis.min),s.to=Math.min(s.to,s.axis.max),l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max);var c=s.from===s.to,h=l.from===l.to;if(!c||!h)if(s.from=Math.floor(s.axis.p2c(s.from)),s.to=Math.floor(s.axis.p2c(s.to)),l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),c||h){var d=a.lineWidth||J.grid.markingsLineWidth,f=d%2?.5:0;nt.beginPath(),nt.strokeStyle=a.color||J.grid.markingsColor,nt.lineWidth=d,c?(nt.moveTo(s.to+f,l.from),nt.lineTo(s.to+f,l.to)):(nt.moveTo(s.from,l.to+f),nt.lineTo(s.to,l.to+f)),nt.stroke()}else nt.fillStyle=a.color||J.grid.markingsColor,nt.fillRect(s.from,l.to,s.to-s.from,l.from-l.to)}}i=u(),n=J.grid.borderWidth;for(var p=0;p<i.length;++p){var g,m,v,y,b=i[p],x=b.box,_=b.tickLength;if(b.show&&0!=b.ticks.length){for(nt.lineWidth=1,"x"==b.direction?(g=0,m="full"==_?"top"==b.position?0:ct:x.top-st.top+("top"==b.position?x.height:0)):(m=0,g="full"==_?"left"==b.position?0:lt:x.left-st.left+("left"==b.position?x.width:0)),b.innermost||(nt.strokeStyle=b.options.color,nt.beginPath(),v=y=0,"x"==b.direction?v=lt+1:y=ct+1,1==nt.lineWidth&&("x"==b.direction?m=Math.floor(m)+.5:g=Math.floor(g)+.5),nt.moveTo(g,m),nt.lineTo(g+v,m+y),nt.stroke()),nt.strokeStyle=b.options.tickColor,nt.beginPath(),e=0;e<b.ticks.length;++e){var w=b.ticks[e].v;v=y=0,isNaN(w)||w<b.min||w>b.max||"full"==_&&("object"==typeof n&&n[b.position]>0||n>0)&&(w==b.min||w==b.max)||("x"==b.direction?(g=b.p2c(w),y="full"==_?-ct:_,"top"==b.position&&(y=-y)):(m=b.p2c(w),v="full"==_?-lt:_,"left"==b.position&&(v=-v)),1==nt.lineWidth&&("x"==b.direction?g=Math.floor(g)+.5:m=Math.floor(m)+.5),nt.moveTo(g,m),nt.lineTo(g+v,m+y))}nt.stroke()}}n&&(r=J.grid.borderColor,"object"==typeof n||"object"==typeof r?("object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),"object"!=typeof r&&(r={top:r,right:r,bottom:r,left:r}),n.top>0&&(nt.strokeStyle=r.top,nt.lineWidth=n.top,nt.beginPath(),nt.moveTo(0-n.left,0-n.top/2),nt.lineTo(lt,0-n.top/2),nt.stroke()),n.right>0&&(nt.strokeStyle=r.right,nt.lineWidth=n.right,nt.beginPath(),nt.moveTo(lt+n.right/2,0-n.top),nt.lineTo(lt+n.right/2,ct),nt.stroke()),n.bottom>0&&(nt.strokeStyle=r.bottom,nt.lineWidth=n.bottom,nt.beginPath(),nt.moveTo(lt+n.right,ct+n.bottom/2),nt.lineTo(0,ct+n.bottom/2),nt.stroke()),n.left>0&&(nt.strokeStyle=r.left,nt.lineWidth=n.left,nt.beginPath(),nt.moveTo(0-n.left/2,ct+n.bottom),nt.lineTo(0-n.left/2,0),nt.stroke())):(nt.lineWidth=n,nt.strokeStyle=J.grid.borderColor,nt.strokeRect(-n/2,-n/2,lt+n,ct+n))),nt.restore()}function P(){t.each(u(),function(t,e){var i,n,r,o,a,s=e.box,l=e.direction+"Axis "+e.direction+e.n+"Axis",c="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+l,h=e.options.font||"flot-tick-label tickLabel";if(tt.removeText(c),e.show&&0!=e.ticks.length)for(var u=0;u<e.ticks.length;++u)!(i=e.ticks[u]).label||i.v<e.min||i.v>e.max||("x"==e.direction?(o="center",n=st.left+e.p2c(i.v),"bottom"==e.position?r=s.top+s.padding:(r=s.top+s.height-s.padding,a="bottom")):(a="middle",r=st.top+e.p2c(i.v),"left"==e.position?(n=s.left+s.width-s.padding,o="right"):n=s.left+s.padding),tt.addText(c,n,r,i.label,h,null,null,o,a))})}function L(t){t.lines.show&&I(t),t.bars.show&&N(t),t.points.show&&O(t)}function I(t){function e(t,e,i,n,r){var o=t.points,a=t.pointsize,s=null,l=null;nt.beginPath();for(var c=a;c<o.length;c+=a){var h=o[c-a],u=o[c-a+1],d=o[c],f=o[c+1];if(null!=h&&null!=d){if(u<=f&&u<r.min){if(f<r.min)continue;h=(r.min-u)/(f-u)*(d-h)+h,u=r.min}else if(f<=u&&f<r.min){if(u<r.min)continue;d=(r.min-u)/(f-u)*(d-h)+h,f=r.min}if(u>=f&&u>r.max){if(f>r.max)continue;h=(r.max-u)/(f-u)*(d-h)+h,u=r.max}else if(f>=u&&f>r.max){if(u>r.max)continue;d=(r.max-u)/(f-u)*(d-h)+h,f=r.max}if(h<=d&&h<n.min){if(d<n.min)continue;u=(n.min-h)/(d-h)*(f-u)+u,h=n.min}else if(d<=h&&d<n.min){if(h<n.min)continue;f=(n.min-h)/(d-h)*(f-u)+u,d=n.min}if(h>=d&&h>n.max){if(d>n.max)continue;u=(n.max-h)/(d-h)*(f-u)+u,h=n.max}else if(d>=h&&d>n.max){if(h>n.max)continue;f=(n.max-h)/(d-h)*(f-u)+u,d=n.max}h==s&&u==l||nt.moveTo(n.p2c(h)+e,r.p2c(u)+i),s=d,l=f,nt.lineTo(n.p2c(d)+e,r.p2c(f)+i)}}nt.stroke()}nt.save(),nt.translate(st.left,st.top),nt.lineJoin="round";var i=t.lines.lineWidth,n=t.shadowSize;if(i>0&&n>0){nt.lineWidth=n,nt.strokeStyle="rgba(0,0,0,0.1)";var r=Math.PI/18;e(t.datapoints,Math.sin(r)*(i/2+n/2),Math.cos(r)*(i/2+n/2),t.xaxis,t.yaxis),nt.lineWidth=n/2,e(t.datapoints,Math.sin(r)*(i/2+n/4),Math.cos(r)*(i/2+n/4),t.xaxis,t.yaxis)}nt.lineWidth=i,nt.strokeStyle=t.color;var o=F(t.lines,t.color,0,ct);o&&(nt.fillStyle=o,function(t,e,i){for(var n=t.points,r=t.pointsize,o=Math.min(Math.max(0,i.min),i.max),a=0,s=!1,l=1,c=0,h=0;!(r>0&&a>n.length+r);){var u=n[(a+=r)-r],d=n[a-r+l],f=n[a],p=n[a+l];if(s){if(r>0&&null!=u&&null==f){h=a,r=-r,l=2;continue}if(r<0&&a==c+r){nt.fill(),s=!1,l=1,a=c=h+(r=-r);continue}}if(null!=u&&null!=f){if(u<=f&&u<e.min){if(f<e.min)continue;d=(e.min-u)/(f-u)*(p-d)+d,u=e.min}else if(f<=u&&f<e.min){if(u<e.min)continue;p=(e.min-u)/(f-u)*(p-d)+d,f=e.min}if(u>=f&&u>e.max){if(f>e.max)continue;d=(e.max-u)/(f-u)*(p-d)+d,u=e.max}else if(f>=u&&f>e.max){if(u>e.max)continue;p=(e.max-u)/(f-u)*(p-d)+d,f=e.max}if(s||(nt.beginPath(),nt.moveTo(e.p2c(u),i.p2c(o)),s=!0),d>=i.max&&p>=i.max)nt.lineTo(e.p2c(u),i.p2c(i.max)),nt.lineTo(e.p2c(f),i.p2c(i.max));else if(d<=i.min&&p<=i.min)nt.lineTo(e.p2c(u),i.p2c(i.min)),nt.lineTo(e.p2c(f),i.p2c(i.min));else{var g=u,m=f;d<=p&&d<i.min&&p>=i.min?(u=(i.min-d)/(p-d)*(f-u)+u,d=i.min):p<=d&&p<i.min&&d>=i.min&&(f=(i.min-d)/(p-d)*(f-u)+u,p=i.min),d>=p&&d>i.max&&p<=i.max?(u=(i.max-d)/(p-d)*(f-u)+u,d=i.max):p>=d&&p>i.max&&d<=i.max&&(f=(i.max-d)/(p-d)*(f-u)+u,p=i.max),u!=g&&nt.lineTo(e.p2c(g),i.p2c(d)),nt.lineTo(e.p2c(u),i.p2c(d)),nt.lineTo(e.p2c(f),i.p2c(p)),f!=m&&(nt.lineTo(e.p2c(f),i.p2c(p)),nt.lineTo(e.p2c(m),i.p2c(p)))}}}}(t.datapoints,t.xaxis,t.yaxis)),i>0&&e(t.datapoints,0,0,t.xaxis,t.yaxis),nt.restore()}function O(t){function e(t,e,i,n,r,o,a,s){for(var l=t.points,c=t.pointsize,h=0;h<l.length;h+=c){var u=l[h],d=l[h+1];null==u||u<o.min||u>o.max||d<a.min||d>a.max||(nt.beginPath(),u=o.p2c(u),d=a.p2c(d)+n,"circle"==s?nt.arc(u,d,e,0,r?Math.PI:2*Math.PI,!1):s(nt,u,d,e,r),nt.closePath(),i&&(nt.fillStyle=i,nt.fill()),nt.stroke())}}nt.save(),nt.translate(st.left,st.top);var i=t.points.lineWidth,n=t.shadowSize,r=t.points.radius,o=t.points.symbol;if(0==i&&(i=1e-4),i>0&&n>0){var a=n/2;nt.lineWidth=a,nt.strokeStyle="rgba(0,0,0,0.1)",e(t.datapoints,r,null,a+a/2,!0,t.xaxis,t.yaxis,o),nt.strokeStyle="rgba(0,0,0,0.2)",e(t.datapoints,r,null,a/2,!0,t.xaxis,t.yaxis,o)}nt.lineWidth=i,nt.strokeStyle=t.color,e(t.datapoints,r,F(t.points,t.color),0,!1,t.xaxis,t.yaxis,o),nt.restore()}function R(t,e,i,n,r,o,a,s,l,c,h){var u,d,f,p,g,m,v,y,b;c?(y=m=v=!0,g=!1,p=e+n,f=e+r,(d=t)<(u=i)&&(b=d,d=u,u=b,g=!0,m=!1)):(g=m=v=!0,y=!1,u=t+n,d=t+r,(p=e)<(f=i)&&(b=p,p=f,f=b,y=!0,v=!1)),d<a.min||u>a.max||p<s.min||f>s.max||(u<a.min&&(u=a.min,g=!1),d>a.max&&(d=a.max,m=!1),f<s.min&&(f=s.min,y=!1),p>s.max&&(p=s.max,v=!1),u=a.p2c(u),f=s.p2c(f),d=a.p2c(d),p=s.p2c(p),o&&(l.fillStyle=o(f,p),l.fillRect(u,p,d-u,f-p)),h>0&&(g||m||v||y)&&(l.beginPath(),l.moveTo(u,f),g?l.lineTo(u,p):l.moveTo(u,p),v?l.lineTo(d,p):l.moveTo(d,p),m?l.lineTo(d,f):l.moveTo(d,f),y?l.lineTo(u,f):l.moveTo(u,f),l.stroke()))}function N(t){nt.save(),nt.translate(st.left,st.top),nt.lineWidth=t.bars.lineWidth,nt.strokeStyle=t.color;var e;switch(t.bars.align){case"left":e=0;break;case"right":e=-t.bars.barWidth;break;default:e=-t.bars.barWidth/2}var i=t.bars.fill?function(e,i){return F(t.bars,t.color,e,i)}:null;!function(e,i,n,r,o,a){for(var s=e.points,l=e.pointsize,c=0;c<s.length;c+=l)null!=s[c]&&R(s[c],s[c+1],s[c+2],i,n,r,o,a,nt,t.bars.horizontal,t.bars.lineWidth)}(t.datapoints,e,e+t.bars.barWidth,i,t.xaxis,t.yaxis),nt.restore()}function F(e,i,n,r){var o=e.fill;if(!o)return null;if(e.fillColor)return Z(e.fillColor,n,r,i);var a=t.color.parse(i);return a.a="number"==typeof o?o:.4,a.normalize(),a.toString()}function z(){if(null!=J.legend.container?t(J.legend.container).html(""):i.find(".legend").remove(),J.legend.show){for(var e,n,r=[],o=[],a=!1,s=J.legend.labelFormatter,l=0;l<Q.length;++l)(e=Q[l]).label&&(n=s?s(e.label,e):e.label)&&o.push({label:n,color:e.color});if(J.legend.sorted)if(t.isFunction(J.legend.sorted))o.sort(J.legend.sorted);else if("reverse"==J.legend.sorted)o.reverse();else{var c="descending"!=J.legend.sorted;o.sort(function(t,e){return t.label==e.label?0:t.label<e.label!=c?1:-1})}for(l=0;l<o.length;++l){var h=o[l];l%J.legend.noColumns==0&&(a&&r.push("</tr>"),r.push("<tr>"),a=!0),r.push('<td class="legendColorBox"><div style="border:1px solid '+J.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+h.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+h.label+"</td>")}if(a&&r.push("</tr>"),0!=r.length){var u='<table style="font-size:smaller;color:'+J.grid.color+'">'+r.join("")+"</table>";if(null!=J.legend.container)t(J.legend.container).html(u);else{var d="",f=J.legend.position,p=J.legend.margin;null==p[0]&&(p=[p,p]),"n"==f.charAt(0)?d+="top:"+(p[1]+st.top)+"px;":"s"==f.charAt(0)&&(d+="bottom:"+(p[1]+st.bottom)+"px;"),"e"==f.charAt(1)?d+="right:"+(p[0]+st.right)+"px;":"w"==f.charAt(1)&&(d+="left:"+(p[0]+st.left)+"px;");var g=t('<div class="legend">'+u.replace('style="','style="position:absolute;'+d+";")+"</div>").appendTo(i);if(0!=J.legend.backgroundOpacity){var m=J.legend.backgroundColor;null==m&&((m=(m=J.grid.backgroundColor)&&"string"==typeof m?t.color.parse(m):t.color.extract(g,"background-color")).a=1,m=m.toString());var v=g.children();t('<div style="position:absolute;width:'+v.width()+"px;height:"+v.height()+"px;"+d+"background-color:"+m+';"> </div>').prependTo(g).css("opacity",J.legend.backgroundOpacity)}}}}}function H(t,e,i){var n,r,o,a=J.grid.mouseActiveRadius,s=a*a+1,l=null;for(n=Q.length-1;n>=0;--n)if(i(Q[n])){var c=Q[n],h=c.xaxis,u=c.yaxis,d=c.datapoints.points,f=h.c2p(t),p=u.c2p(e),g=a/h.scale,m=a/u.scale;if(o=c.datapoints.pointsize,h.options.inverseTransform&&(g=Number.MAX_VALUE),u.options.inverseTransform&&(m=Number.MAX_VALUE),c.lines.show||c.points.show)for(r=0;r<d.length;r+=o){var v=d[r],y=d[r+1];if(null!=v&&!(v-f>g||v-f<-g||y-p>m||y-p<-m)){var b=Math.abs(h.p2c(v)-t),x=Math.abs(u.p2c(y)-e),_=b*b+x*x;_<s&&(s=_,l=[n,r/o])}}if(c.bars.show&&!l){var w,S;switch(c.bars.align){case"left":w=0;break;case"right":w=-c.bars.barWidth;break;default:w=-c.bars.barWidth/2}for(S=w+c.bars.barWidth,r=0;r<d.length;r+=o){var v=d[r],y=d[r+1],C=d[r+2];null!=v&&((Q[n].bars.horizontal?f<=Math.max(C,v)&&f>=Math.min(C,v)&&p>=y+w&&p<=y+S:f>=v+w&&f<=v+S&&p>=Math.min(C,y)&&p<=Math.max(C,y))&&(l=[n,r/o]))}}}return l?(n=l[0],r=l[1],o=Q[n].datapoints.pointsize,{datapoint:Q[n].datapoints.points.slice(r*o,(r+1)*o),dataIndex:r,series:Q[n],seriesIndex:n}):null}function $(t){J.grid.hoverable&&W("plothover",t,function(t){return 0!=t.hoverable})}function V(t){J.grid.hoverable&&W("plothover",t,function(t){return!1})}function B(t){W("plotclick",t,function(t){return 0!=t.clickable})}function W(t,e,n){var r=it.offset(),o=e.pageX-r.left-st.left,a=e.pageY-r.top-st.top,s=d({left:o,top:a});s.pageX=e.pageX,s.pageY=e.pageY;var l=H(o,a,n);if(l&&(l.pageX=parseInt(l.series.xaxis.p2c(l.datapoint[0])+r.left+st.left,10),l.pageY=parseInt(l.series.yaxis.p2c(l.datapoint[1])+r.top+st.top,10)),J.grid.autoHighlight){for(var c=0;c<dt.length;++c){var h=dt[c];h.auto!=t||l&&h.series==l.series&&h.point[0]==l.datapoint[0]&&h.point[1]==l.datapoint[1]||G(h.series,h.point)}l&&Y(l.series,l.datapoint,t)}i.trigger(t,[s,l])}function j(){var t=J.interaction.redrawOverlayInterval;-1!=t?ft||(ft=setTimeout(U,t)):U()}function U(){ft=null,rt.save(),et.clear(),rt.translate(st.left,st.top);var t,e;for(t=0;t<dt.length;++t)(e=dt[t]).series.bars.show?K(e.series,e.point):X(e.series,e.point);rt.restore(),s(ht.drawOverlay,[rt])}function Y(t,e,i){if("number"==typeof t&&(t=Q[t]),"number"==typeof e){var n=t.datapoints.pointsize;e=t.datapoints.points.slice(n*e,n*(e+1))}var r=q(t,e);-1==r?(dt.push({series:t,point:e,auto:i}),j()):i||(dt[r].auto=!1)}function G(t,e){if(null==t&&null==e)return dt=[],void j();if("number"==typeof t&&(t=Q[t]),"number"==typeof e){var i=t.datapoints.pointsize;e=t.datapoints.points.slice(i*e,i*(e+1))}var n=q(t,e);-1!=n&&(dt.splice(n,1),j())}function q(t,e){for(var i=0;i<dt.length;++i){var n=dt[i];if(n.series==t&&n.point[0]==e[0]&&n.point[1]==e[1])return i}return-1}function X(e,i){var n=i[0],r=i[1],o=e.xaxis,a=e.yaxis,s="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString();if(!(n<o.min||n>o.max||r<a.min||r>a.max)){var l=e.points.radius+e.points.lineWidth/2;rt.lineWidth=l,rt.strokeStyle=s;var c=1.5*l;n=o.p2c(n),r=a.p2c(r),rt.beginPath(),"circle"==e.points.symbol?rt.arc(n,r,c,0,2*Math.PI,!1):e.points.symbol(rt,n,r,c,!1),rt.closePath(),rt.stroke()}}function K(e,i){var n,r="string"==typeof e.highlightColor?e.highlightColor:t.color.parse(e.color).scale("a",.5).toString(),o=r;switch(e.bars.align){case"left":n=0;break;case"right":n=-e.bars.barWidth;break;default:n=-e.bars.barWidth/2}rt.lineWidth=e.bars.lineWidth,rt.strokeStyle=r,R(i[0],i[1],i[2]||0,n,n+e.bars.barWidth,function(){return o},e.xaxis,e.yaxis,rt,e.bars.horizontal,e.bars.lineWidth)}function Z(e,i,n,r){if("string"==typeof e)return e;for(var o=nt.createLinearGradient(0,n,0,i),a=0,s=e.colors.length;a<s;++a){var l=e.colors[a];if("string"!=typeof l){var c=t.color.parse(r);null!=l.brightness&&(c=c.scale("rgb",l.brightness)),null!=l.opacity&&(c.a*=l.opacity),l=c.toString()}o.addColorStop(a/(s-1),l)}return o}var Q=[],J={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},tt=null,et=null,it=null,nt=null,rt=null,ot=[],at=[],st={left:0,right:0,top:0,bottom:0},lt=0,ct=0,ht={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},ut=this;ut.setData=l,ut.setupGrid=w,ut.draw=A,ut.getPlaceholder=function(){return i},ut.getCanvas=function(){return tt.element},ut.getPlotOffset=function(){return st},ut.width=function(){return lt},ut.height=function(){return ct},ut.offset=function(){var t=it.offset();return t.left+=st.left,t.top+=st.top,t},ut.getData=function(){return Q},ut.getAxes=function(){var e={};return t.each(ot.concat(at),function(t,i){i&&(e[i.direction+(1!=i.n?i.n:"")+"axis"]=i)}),e},ut.getXAxes=function(){return ot},ut.getYAxes=function(){return at},ut.c2p=d,ut.p2c=function(t){var e,i,n,r={};for(e=0;e<ot.length;++e)if((i=ot[e])&&i.used&&(n="x"+i.n,null==t[n]&&1==i.n&&(n="x"),null!=t[n])){r.left=i.p2c(t[n]);break}for(e=0;e<at.length;++e)if((i=at[e])&&i.used&&(n="y"+i.n,null==t[n]&&1==i.n&&(n="y"),null!=t[n])){r.top=i.p2c(t[n]);break}return r},ut.getOptions=function(){return J},ut.highlight=Y,ut.unhighlight=G,ut.triggerRedrawOverlay=j,ut.pointOffset=function(t){return{left:parseInt(ot[h(t,"x")-1].p2c(+t.x)+st.left,10),top:parseInt(at[h(t,"y")-1].p2c(+t.y)+st.top,10)}},ut.shutdown=m,ut.destroy=function(){m(),i.removeData("plot").empty(),Q=[],J=null,tt=null,et=null,it=null,nt=null,rt=null,ot=[],at=[],ht=null,dt=[],ut=null},ut.resize=function(){var t=i.width(),e=i.height();tt.resize(t,e),et.resize(t,e)},ut.hooks=ht,function(){for(var i={Canvas:e},n=0;n<a.length;++n){var r=a[n];r.init(ut,i),r.options&&t.extend(!0,J,r.options)}}(),function(e){t.extend(!0,J,e),e&&e.colors&&(J.colors=e.colors),null==J.xaxis.color&&(J.xaxis.color=t.color.parse(J.grid.color).scale("a",.22).toString()),null==J.yaxis.color&&(J.yaxis.color=t.color.parse(J.grid.color).scale("a",.22).toString()),null==J.xaxis.tickColor&&(J.xaxis.tickColor=J.grid.tickColor||J.xaxis.color),null==J.yaxis.tickColor&&(J.yaxis.tickColor=J.grid.tickColor||J.yaxis.color),null==J.grid.borderColor&&(J.grid.borderColor=J.grid.color),null==J.grid.tickColor&&(J.grid.tickColor=t.color.parse(J.grid.color).scale("a",.22).toString());var n,r,o,a=i.css("font-size"),l=a?+a.replace("px",""):13,c={style:i.css("font-style"),size:Math.round(.8*l),variant:i.css("font-variant"),weight:i.css("font-weight"),family:i.css("font-family")};for(o=J.xaxes.length||1,n=0;n<o;++n)(r=J.xaxes[n])&&!r.tickColor&&(r.tickColor=r.color),r=t.extend(!0,{},J.xaxis,r),J.xaxes[n]=r,r.font&&(r.font=t.extend({},c,r.font),r.font.color||(r.font.color=r.color),r.font.lineHeight||(r.font.lineHeight=Math.round(1.15*r.font.size)));for(o=J.yaxes.length||1,n=0;n<o;++n)(r=J.yaxes[n])&&!r.tickColor&&(r.tickColor=r.color),r=t.extend(!0,{},J.yaxis,r),J.yaxes[n]=r,r.font&&(r.font=t.extend({},c,r.font),r.font.color||(r.font.color=r.color),r.font.lineHeight||(r.font.lineHeight=Math.round(1.15*r.font.size)));for(J.xaxis.noTicks&&null==J.xaxis.ticks&&(J.xaxis.ticks=J.xaxis.noTicks),J.yaxis.noTicks&&null==J.yaxis.ticks&&(J.yaxis.ticks=J.yaxis.noTicks),J.x2axis&&(J.xaxes[1]=t.extend(!0,{},J.xaxis,J.x2axis),J.xaxes[1].position="top",null==J.x2axis.min&&(J.xaxes[1].min=null),null==J.x2axis.max&&(J.xaxes[1].max=null)),J.y2axis&&(J.yaxes[1]=t.extend(!0,{},J.yaxis,J.y2axis),J.yaxes[1].position="right",null==J.y2axis.min&&(J.yaxes[1].min=null),null==J.y2axis.max&&(J.yaxes[1].max=null)),J.grid.coloredAreas&&(J.grid.markings=J.grid.coloredAreas),J.grid.coloredAreasColor&&(J.grid.markingsColor=J.grid.coloredAreasColor),J.lines&&t.extend(!0,J.series.lines,J.lines),J.points&&t.extend(!0,J.series.points,J.points),J.bars&&t.extend(!0,J.series.bars,J.bars),null!=J.shadowSize&&(J.series.shadowSize=J.shadowSize),null!=J.highlightColor&&(J.series.highlightColor=J.highlightColor),n=0;n<J.xaxes.length;++n)f(ot,n+1).options=J.xaxes[n];for(n=0;n<J.yaxes.length;++n)f(at,n+1).options=J.yaxes[n];for(var h in ht)J.hooks[h]&&J.hooks[h].length&&(ht[h]=ht[h].concat(J.hooks[h]));s(ht.processOptions,[J])}(o),function(){i.css("padding",0).children().filter(function(){return!t(this).hasClass("flot-overlay")&&!t(this).hasClass("flot-base")}).remove(),"static"==i.css("position")&&i.css("position","relative"),tt=new e("flot-base",i),et=new e("flot-overlay",i),nt=tt.context,rt=et.context,it=t(et.element).unbind();var n=i.data("plot");n&&(n.shutdown(),et.clear()),i.data("plot",ut)}(),l(r),w(),A(),J.grid.hoverable&&(it.mousemove($),it.bind("mouseleave",V)),J.grid.clickable&&it.click(B),s(ht.bindEvents,[it]);var dt=[],ft=null}function n(t,e){return e*Math.floor(t/e)}var r=Object.prototype.hasOwnProperty;t.fn.detach||(t.fn.detach=function(){return this.each(function(){this.parentNode&&this.parentNode.removeChild(this)})}),e.prototype.resize=function(t,e){if(t<=0||e<=0)throw new Error("Invalid dimensions for plot, width = "+t+", height = "+e);var i=this.element,n=this.context,r=this.pixelRatio;this.width!=t&&(i.width=t*r,i.style.width=t+"px",this.width=t),this.height!=e&&(i.height=e*r,i.style.height=e+"px",this.height=e),n.restore(),n.save(),n.scale(r,r)},e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.render=function(){var t=this._textCache;for(var e in t)if(r.call(t,e)){var i=this.getTextLayer(e),n=t[e];i.hide();for(var o in n)if(r.call(n,o)){var a=n[o];for(var s in a)if(r.call(a,s)){for(var l,c=a[s].positions,h=0;l=c[h];h++)l.active?l.rendered||(i.append(l.element),l.rendered=!0):(c.splice(h--,1),l.rendered&&l.element.detach());0==c.length&&delete a[s]}}i.show()}},e.prototype.getTextLayer=function(e){var i=this.text[e];return null==i&&(null==this.textContainer&&(this.textContainer=t("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),i=this.text[e]=t("<div></div>").addClass(e).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),i},e.prototype.getTextInfo=function(e,i,n,r,o){var a,s,l,c;if(i=""+i,a="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(s=this._textCache[e])&&(s=this._textCache[e]={}),null==(l=s[a])&&(l=s[a]={}),null==(c=l[i])){var h=t("<div></div>").html(i).css({position:"absolute","max-width":o,top:-9999}).appendTo(this.getTextLayer(e));"object"==typeof n?h.css({font:a,color:n.color}):"string"==typeof n&&h.addClass(n),c=l[i]={width:h.outerWidth(!0),height:h.outerHeight(!0),element:h,positions:[]},h.detach()}return c},e.prototype.addText=function(t,e,i,n,r,o,a,s,l){var c=this.getTextInfo(t,n,r,o,a),h=c.positions;"center"==s?e-=c.width/2:"right"==s&&(e-=c.width),"middle"==l?i-=c.height/2:"bottom"==l&&(i-=c.height);for(var u,d=0;u=h[d];d++)if(u.x==e&&u.y==i)return void(u.active=!0);u={active:!0,rendered:!1,element:h.length?c.element.clone():c.element,x:e,y:i},h.push(u),u.element.css({top:Math.round(i),left:Math.round(e),"text-align":s})},e.prototype.removeText=function(t,e,i,n,o,a){if(null==n){var s=this._textCache[t];if(null!=s)for(var l in s)if(r.call(s,l)){var c=s[l];for(var h in c)if(r.call(c,h))for(var u=c[h].positions,d=0;f=u[d];d++)f.active=!1}}else for(var f,u=this.getTextInfo(t,n,o,a).positions,d=0;f=u[d];d++)f.x==e&&f.y==i&&(f.active=!1)},t.plot=function(e,n,r){return new i(t(e),n,r,t.plot.plugins)},t.plot.version="0.8.3",t.plot.plugins=[],t.fn.plot=function(e,i){return this.each(function(){t.plot(this,e,i)})}}(jQuery),function(t){var e=10,i=.95,n={series:{pie:{show:!1,radius:"auto",innerRadius:0,startAngle:1.5,tilt:1,shadow:{left:5,top:15,alpha:.02},offset:{top:0,left:"auto"},stroke:{color:"#fff",width:1},label:{show:"auto",formatter:function(t,e){return"<div style='font-size:x-small;text-align:center;padding:2px;color:"+e.color+";'>"+t+"<br/>"+Math.round(e.percent)+"%</div>"},radius:1,background:{color:null,opacity:0},threshold:0},combine:{threshold:-1,color:null,label:"Other"},highlight:{opacity:.5}}}};t.plot.plugins.push({init:function(n){function r(e,i,n){S||(S=!0,v=e.getCanvas(),y=t(v).parent(),b=e.getOptions(),e.setData(o(e.getData())))}function o(e){for(var i=0,n=0,r=0,o=b.series.pie.combine.color,a=[],s=0;s<e.length;++s)l=e[s].data,t.isArray(l)&&1==l.length&&(l=l[0]),t.isArray(l)?!isNaN(parseFloat(l[1]))&&isFinite(l[1])?l[1]=+l[1]:l[1]=0:l=!isNaN(parseFloat(l))&&isFinite(l)?[1,+l]:[1,0],e[s].data=[l];for(s=0;s<e.length;++s)i+=e[s].data[0][1];for(s=0;s<e.length;++s)(l=e[s].data[0][1])/i<=b.series.pie.combine.threshold&&(n+=l,r++,o||(o=e[s].color));for(s=0;s<e.length;++s){var l=e[s].data[0][1];(r<2||l/i>b.series.pie.combine.threshold)&&a.push(t.extend(e[s],{data:[[1,l]],color:e[s].color,label:e[s].label,angle:l*Math.PI*2/i,percent:l/(i/100)}))}return r>1&&a.push({data:[[1,n]],color:o,label:b.series.pie.combine.label,angle:n*Math.PI*2/i,percent:n/(i/100)}),a}function a(n,r){function o(){C.clearRect(0,0,a,l),y.children().filter(".pieLabel, .pieLabelBackground").remove()}if(y){var a=n.getPlaceholder().width(),l=n.getPlaceholder().height(),c=y.children().filter(".legend").children().width()||0;C=r,S=!1,x=Math.min(a,l/b.series.pie.tilt)/2,w=l/2+b.series.pie.offset.top,_=a/2,"auto"==b.series.pie.offset.left?(b.legend.position.match("w")?_+=c/2:_-=c/2,_<x?_=x:_>a-x&&(_=a-x)):_+=b.series.pie.offset.left;var h=n.getData(),u=0;do{u>0&&(x*=i),u+=1,o(),b.series.pie.tilt<=.8&&function(){var t=b.series.pie.shadow.left,e=b.series.pie.shadow.top,i=b.series.pie.shadow.alpha,n=b.series.pie.radius>1?b.series.pie.radius:x*b.series.pie.radius;if(!(n>=a/2-t||n*b.series.pie.tilt>=l/2-e||n<=10)){C.save(),C.translate(t,e),C.globalAlpha=i,C.fillStyle="#000",C.translate(_,w),C.scale(1,b.series.pie.tilt);for(var r=1;r<=10;r++)C.beginPath(),C.arc(0,0,n,0,2*Math.PI,!1),C.fill(),n-=r;C.restore()}}()}while(!function(){function e(t,e,i){t<=0||isNaN(t)||(i?C.fillStyle=e:(C.strokeStyle=e,C.lineJoin="round"),C.beginPath(),Math.abs(t-2*Math.PI)>1e-9&&C.moveTo(0,0),C.arc(0,0,n,r,r+t/2,!1),C.arc(0,0,n,r+t/2,r+t,!1),C.closePath(),r+=t,i?C.fill():C.stroke())}var i=Math.PI*b.series.pie.startAngle,n=b.series.pie.radius>1?b.series.pie.radius:x*b.series.pie.radius;C.save(),C.translate(_,w),C.scale(1,b.series.pie.tilt),C.save();for(var r=i,o=0;o<h.length;++o)h[o].startAngle=r,e(h[o].angle,h[o].color,!0);if(C.restore(),b.series.pie.stroke.width>0){for(C.save(),C.lineWidth=b.series.pie.stroke.width,r=i,o=0;o<h.length;++o)e(h[o].angle,b.series.pie.stroke.color,!1);C.restore()}return s(C),C.restore(),!b.series.pie.label.show||function(){for(var e=i,n=b.series.pie.label.radius>1?b.series.pie.label.radius:x*b.series.pie.label.radius,r=0;r<h.length;++r){if(h[r].percent>=100*b.series.pie.label.threshold&&!function(e,i,r){if(0==e.data[0][1])return!0;var o,s=b.legend.labelFormatter,c=b.series.pie.label.formatter;o=s?s(e.label,e):e.label,c&&(o=c(o,e));var h=(i+e.angle+i)/2,u=_+Math.round(Math.cos(h)*n),d=w+Math.round(Math.sin(h)*n)*b.series.pie.tilt,f="<span class='pieLabel' id='pieLabel"+r+"' style='position:absolute;top:"+d+"px;left:"+u+"px;'>"+o+"</span>";y.append(f);var p=y.children("#pieLabel"+r),g=d-p.height()/2,m=u-p.width()/2;if(p.css("top",g),p.css("left",m),0-g>0||0-m>0||l-(g+p.height())<0||a-(m+p.width())<0)return!1;if(0!=b.series.pie.label.background.opacity){var v=b.series.pie.label.background.color;null==v&&(v=e.color);var x="top:"+g+"px;left:"+m+"px;";t("<div class='pieLabelBackground' style='position:absolute;width:"+p.width()+"px;height:"+p.height()+"px;"+x+"background-color:"+v+";'></div>").css("opacity",b.series.pie.label.background.opacity).insertBefore(p)}return!0}(h[r],e,r))return!1;e+=h[r].angle}return!0}()}()&&u<e);u>=e&&(o(),y.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>")),n.setSeries&&n.insertLegend&&(n.setSeries(h),n.insertLegend())}}function s(t){if(b.series.pie.innerRadius>0){t.save();var e=b.series.pie.innerRadius>1?b.series.pie.innerRadius:x*b.series.pie.innerRadius;t.globalCompositeOperation="destination-out",t.beginPath(),t.fillStyle=b.series.pie.stroke.color,t.arc(0,0,e,0,2*Math.PI,!1),t.fill(),t.closePath(),t.restore(),t.save(),t.beginPath(),t.strokeStyle=b.series.pie.stroke.color,t.arc(0,0,e,0,2*Math.PI,!1),t.stroke(),t.closePath(),t.restore()}}function l(t,e){for(var i=!1,n=-1,r=t.length,o=r-1;++n<r;o=n)(t[n][1]<=e[1]&&e[1]<t[o][1]||t[o][1]<=e[1]&&e[1]<t[n][1])&&e[0]<(t[o][0]-t[n][0])*(e[1]-t[n][1])/(t[o][1]-t[n][1])+t[n][0]&&(i=!i);return i}function c(t,e){for(var i,r,o=n.getData(),a=n.getOptions(),s=a.series.pie.radius>1?a.series.pie.radius:x*a.series.pie.radius,c=0;c<o.length;++c){var h=o[c];if(h.pie.show){if(C.save(),C.beginPath(),C.moveTo(0,0),C.arc(0,0,s,h.startAngle,h.startAngle+h.angle/2,!1),C.arc(0,0,s,h.startAngle+h.angle/2,h.startAngle+h.angle,!1),C.closePath(),i=t-_,r=e-w,C.isPointInPath){if(C.isPointInPath(t-_,e-w))return C.restore(),{datapoint:[h.percent,h.data],dataIndex:0,series:h,seriesIndex:c}}else if(l([[0,0],[s*Math.cos(h.startAngle),s*Math.sin(h.startAngle)],[s*Math.cos(h.startAngle+h.angle/4),s*Math.sin(h.startAngle+h.angle/4)],[s*Math.cos(h.startAngle+h.angle/2),s*Math.sin(h.startAngle+h.angle/2)],[s*Math.cos(h.startAngle+h.angle/1.5),s*Math.sin(h.startAngle+h.angle/1.5)],[s*Math.cos(h.startAngle+h.angle),s*Math.sin(h.startAngle+h.angle)]],[i,r]))return C.restore(),{datapoint:[h.percent,h.data],dataIndex:0,series:h,seriesIndex:c};C.restore()}}return null}function h(t){d("plothover",t)}function u(t){d("plotclick",t)}function d(t,e){var i=n.offset(),r=c(parseInt(e.pageX-i.left),parseInt(e.pageY-i.top));if(b.grid.autoHighlight)for(var o=0;o<k.length;++o){var a=k[o];a.auto!=t||r&&a.series==r.series||p(a.series)}r&&f(r.series,t);var s={pageX:e.pageX,pageY:e.pageY};y.trigger(t,[s,r])}function f(t,e){var i=g(t);-1==i?(k.push({series:t,auto:e}),n.triggerRedrawOverlay()):e||(k[i].auto=!1)}function p(t){null==t&&(k=[],n.triggerRedrawOverlay());var e=g(t);-1!=e&&(k.splice(e,1),n.triggerRedrawOverlay())}function g(t){for(var e=0;e<k.length;++e)if(k[e].series==t)return e;return-1}function m(t,e){var i=t.getOptions(),n=i.series.pie.radius>1?i.series.pie.radius:x*i.series.pie.radius;e.save(),e.translate(_,w),e.scale(1,i.series.pie.tilt);for(var r=0;r<k.length;++r)!function(t){t.angle<=0||isNaN(t.angle)||(e.fillStyle="rgba(255, 255, 255, "+i.series.pie.highlight.opacity+")",e.beginPath(),Math.abs(t.angle-2*Math.PI)>1e-9&&e.moveTo(0,0),e.arc(0,0,n,t.startAngle,t.startAngle+t.angle/2,!1),e.arc(0,0,n,t.startAngle+t.angle/2,t.startAngle+t.angle,!1),e.closePath(),e.fill())}(k[r].series);s(e),e.restore()}var v=null,y=null,b=null,x=null,_=null,w=null,S=!1,C=null,k=[];n.hooks.processOptions.push(function(t,e){e.series.pie.show&&(e.grid.show=!1,"auto"==e.series.pie.label.show&&(e.legend.show?e.series.pie.label.show=!1:e.series.pie.label.show=!0),"auto"==e.series.pie.radius&&(e.series.pie.label.show?e.series.pie.radius=.75:e.series.pie.radius=1),e.series.pie.tilt>1?e.series.pie.tilt=1:e.series.pie.tilt<0&&(e.series.pie.tilt=0))}),n.hooks.bindEvents.push(function(t,e){var i=t.getOptions();i.series.pie.show&&(i.grid.hoverable&&e.unbind("mousemove").mousemove(h),i.grid.clickable&&e.unbind("click").click(u))}),n.hooks.processDatapoints.push(function(t,e,i,n){t.getOptions().series.pie.show&&r(t)}),n.hooks.drawOverlay.push(function(t,e){t.getOptions().series.pie.show&&m(t,e)}),n.hooks.draw.push(function(t,e){t.getOptions().series.pie.show&&a(t,e)})},options:n,name:"pie",version:"1.1"})}(jQuery),function(t){function e(t,e,i,n){var r="categories"==e.xaxis.options.mode,o="categories"==e.yaxis.options.mode;if(r||o){var a=n.format;if(!a){var s=e;if((a=[]).push({x:!0,number:!0,required:!0}),a.push({y:!0,number:!0,required:!0}),s.bars.show||s.lines.show&&s.lines.fill){var l=!!(s.bars.show&&s.bars.zero||s.lines.show&&s.lines.zero);a.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:l}),s.bars.horizontal&&(delete a[a.length-1].y,a[a.length-1].x=!0)}n.format=a}for(var c=0;c<a.length;++c)a[c].x&&r&&(a[c].number=!1),a[c].y&&o&&(a[c].number=!1)}}function i(t){var e=-1;for(var i in t)t[i]>e&&(e=t[i]);return e+1}function n(t){var e=[];for(var i in t.categories){var n=t.categories[i];n>=t.min&&n<=t.max&&e.push([n,i])}return e.sort(function(t,e){return t[0]-e[0]}),e}function r(e,i,r){if("categories"==e[i].options.mode){if(!e[i].categories){var a={},s=e[i].options.categories||{};if(t.isArray(s))for(var l=0;l<s.length;++l)a[s[l]]=l;else for(var c in s)a[c]=s[c];e[i].categories=a}e[i].options.ticks||(e[i].options.ticks=n),o(r,i,e[i].categories)}}function o(t,e,n){for(var r=t.points,o=t.pointsize,a=t.format,s=e.charAt(0),l=i(n),c=0;c<r.length;c+=o)if(null!=r[c])for(var h=0;h<o;++h){var u=r[c+h];null!=u&&a[h][s]&&(u in n||(n[u]=l,++l),r[c+h]=n[u])}}function a(t,e,i){r(e,"xaxis",i),r(e,"yaxis",i)}t.plot.plugins.push({init:function(t){t.hooks.processRawData.push(e),t.hooks.processDatapoints.push(a)},options:{xaxis:{categories:null},yaxis:{categories:null}},name:"categories",version:"1.0"})}(jQuery),function(t,e,i){"$:nomunge";function n(i){!0===s&&(s=i||1);for(var l=o.length-1;l>=0;l--){var d=t(o[l]);if(d[0]==e||d.is(":visible")){var f=d.width(),p=d.height(),g=d.data(h);!g||f===g.w&&p===g.h||(d.trigger(c,[g.w=f,g.h=p]),s=i||!0)}else(g=d.data(h)).w=0,g.h=0}null!==r&&(s&&(null==i||i-s<1e3)?r=e.requestAnimationFrame(n):(r=setTimeout(n,a[u]),s=!1))}var r,o=[],a=t.resize=t.extend(t.resize,{}),s=!1,l="setTimeout",c="resize",h=c+"-special-event",u="pendingDelay",d="activeDelay",f="throttleWindow";a[u]=200,a[d]=20,a[f]=!0,t.event.special[c]={setup:function(){if(!a[f]&&this[l])return!1;var e=t(this);o.push(this),e.data(h,{w:e.width(),h:e.height()}),1===o.length&&(r=i,n())},teardown:function(){if(!a[f]&&this[l])return!1;for(var e=t(this),i=o.length-1;i>=0;i--)if(o[i]==this){o.splice(i,1);break}e.removeData(h),o.length||(s?cancelAnimationFrame(r):clearTimeout(r),r=null)},add:function(e){function n(e,n,o){var a=t(this),s=a.data(h)||{};s.w=n!==i?n:a.width(),s.h=o!==i?o:a.height(),r.apply(this,arguments)}if(!a[f]&&this[l])return!1;var r;if(t.isFunction(e))return r=e,n;r=e.handler,e.handler=n}},e.requestAnimationFrame||(e.requestAnimationFrame=e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t,i){return e.setTimeout(function(){t((new Date).getTime())},a[d])}),e.cancelAnimationFrame||(e.cancelAnimationFrame=e.webkitCancelRequestAnimationFrame||e.mozCancelRequestAnimationFrame||e.oCancelRequestAnimationFrame||e.msCancelRequestAnimationFrame||clearTimeout)}(jQuery,this),function(t){jQuery.plot.plugins.push({init:function(t){function e(){var e=t.getPlaceholder();0!=e.width()&&0!=e.height()&&(t.resize(),t.setupGrid(),t.draw())}t.hooks.bindEvents.push(function(t,i){t.getPlaceholder().resize(e)}),t.hooks.shutdown.push(function(t,i){t.getPlaceholder().unbind("resize",e)})},options:{},name:"resize",version:"1.0"})}(),function(t){var e={tooltip:{show:!1,cssClass:"flotTip",content:"%s | X: %x | Y: %y",xDateFormat:null,yDateFormat:null,monthNames:null,dayNames:null,shifts:{x:10,y:20},defaultTheme:!0,snap:!0,lines:!1,clickTips:!1,onHover:function(t,e){},$compat:!1}};e.tooltipOpts=e.tooltip;var i=function(t){this.tipPosition={x:0,y:0},this.init(t)};i.prototype.init=function(e){function i(t){var i={};i.x=t.pageX,i.y=t.pageY,e.setTooltipPosition(i)}function n(i,n,a){o.clickmode?(t(e.getPlaceholder()).bind("plothover",r),e.hideTooltip(),o.clickmode=!1):(r(i,n,a),o.getDomElement().is(":visible")&&(t(e.getPlaceholder()).unbind("plothover",r),o.clickmode=!0))}function r(i,n,r){var a=function(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))},s=function(t,e,i,n,r,o,s){if(!s||(s=function(t,e,i,n,r,o){if(void 0!==i)return{x:i,y:e};if(void 0!==n)return{x:t,y:n};var a,s=-1/((o-n)/(r-i));return{x:a=(r*(t*s-e+n)+i*(t*-s+e-o))/(s*(r-i)+n-o),y:s*a-s*t+e}}(t,e,i,n,r,o)).x>=Math.min(i,r)&&s.x<=Math.max(i,r)&&s.y>=Math.min(n,o)&&s.y<=Math.max(n,o)){var l=n-o,c=r-i,h=i*o-n*r;return Math.abs(l*t+c*e+h)/Math.sqrt(l*l+c*c)}var u=a(t,e,i,n),d=a(t,e,r,o);return u>d?d:u};if(r)e.showTooltip(r,o.tooltipOptions.snap?r:n);else if(o.plotOptions.series.lines.show&&!0===o.tooltipOptions.lines){var l=o.plotOptions.grid.mouseActiveRadius,c={distance:l+1},h=n;t.each(e.getData(),function(t,i){for(var r=0,l=-1,u=1;u<i.data.length;u++)i.data[u-1][0]<=n.x&&i.data[u][0]>=n.x&&(r=u-1,l=u);if(-1!==l){var d={x:i.data[r][0],y:i.data[r][1]},f={x:i.data[l][0],y:i.data[l][1]},p=s(i.xaxis.p2c(n.x),i.yaxis.p2c(n.y),i.xaxis.p2c(d.x),i.yaxis.p2c(d.y),i.xaxis.p2c(f.x),i.yaxis.p2c(f.y),!1);if(p<c.distance){var g=a(d.x,d.y,n.x,n.y)<a(n.x,n.y,f.x,f.y)?r:l,m=(i.datapoints.pointsize,[n.x,d.y+(f.y-d.y)*((n.x-d.x)/(f.x-d.x))]);c={distance:p,item:{datapoint:m,dataIndex:g,series:i,seriesIndex:t}},o.tooltipOptions.snap&&(h={pageX:i.xaxis.p2c(m[0]),pageY:i.yaxis.p2c(m[1])})}}else e.hideTooltip()}),c.distance<l+1?e.showTooltip(c.item,h):e.hideTooltip()}else e.hideTooltip()}var o=this,a=t.plot.plugins.length;if(this.plotPlugins=[],a)for(var s=0;s<a;s++)this.plotPlugins.push(t.plot.plugins[s].name);e.hooks.bindEvents.push(function(e,a){if(o.plotOptions=e.getOptions(),"boolean"==typeof o.plotOptions.tooltip&&(o.plotOptions.tooltipOpts.show=o.plotOptions.tooltip,o.plotOptions.tooltip=o.plotOptions.tooltipOpts,delete o.plotOptions.tooltipOpts),!1!==o.plotOptions.tooltip.show&&void 0!==o.plotOptions.tooltip.show){o.tooltipOptions=o.plotOptions.tooltip,o.tooltipOptions.$compat?(o.wfunc="width",o.hfunc="height"):(o.wfunc="innerWidth",o.hfunc="innerHeight");o.getDomElement();t(e.getPlaceholder()).bind("plothover",r),o.tooltipOptions.clickTips&&t(e.getPlaceholder()).bind("plotclick",n),o.clickmode=!1,t(a).bind("mousemove",i)}}),e.hooks.shutdown.push(function(e,o){t(e.getPlaceholder()).unbind("plothover",r),t(e.getPlaceholder()).unbind("plotclick",n),e.removeTooltip(),t(o).unbind("mousemove",i)}),e.setTooltipPosition=function(e){var i=o.getDomElement(),n=i.outerWidth()+o.tooltipOptions.shifts.x,r=i.outerHeight()+o.tooltipOptions.shifts.y;e.x-t(window).scrollLeft()>t(window)[o.wfunc]()-n&&(e.x-=n,e.x=Math.max(e.x,0)),e.y-t(window).scrollTop()>t(window)[o.hfunc]()-r&&(e.y-=r),isNaN(e.x)?o.tipPosition.x=o.tipPosition.xPrev:(o.tipPosition.x=e.x,o.tipPosition.xPrev=e.x),isNaN(e.y)?o.tipPosition.y=o.tipPosition.yPrev:(o.tipPosition.y=e.y,o.tipPosition.yPrev=e.y)},e.showTooltip=function(t,i,n){var r=o.getDomElement(),a=o.stringFormat(o.tooltipOptions.content,t);""!==a&&(r.html(a),e.setTooltipPosition({x:o.tipPosition.x,y:o.tipPosition.y}),r.css({left:o.tipPosition.x+o.tooltipOptions.shifts.x,top:o.tipPosition.y+o.tooltipOptions.shifts.y}).show(),"function"==typeof o.tooltipOptions.onHover&&o.tooltipOptions.onHover(t,r))},e.hideTooltip=function(){o.getDomElement().hide().html("")},e.removeTooltip=function(){o.getDomElement().remove()}},i.prototype.getDomElement=function(){var e=t("<div>");return this.tooltipOptions&&this.tooltipOptions.cssClass&&0===(e=t("."+this.tooltipOptions.cssClass)).length&&((e=t("<div />").addClass(this.tooltipOptions.cssClass)).appendTo("body").hide().css({position:"absolute"}),this.tooltipOptions.defaultTheme&&e.css({background:"#fff","z-index":"1040",padding:"0.4em 0.6em","border-radius":"0.5em","font-size":"0.8em",border:"1px solid #111",display:"none","white-space":"nowrap"})),e},i.prototype.stringFormat=function(t,e){var i,n,r,o,a,s=/%s/,l=/%c/,c=/%lx/,h=/%ly/,u=/%x\.{0,1}(\d{0,})/,d=/%y\.{0,1}(\d{0,})/;if(void 0!==e.series.threshold?(i=e.datapoint[0],n=e.datapoint[1],r=e.datapoint[2]):void 0!==e.series.curvedLines?(i=e.datapoint[0],n=e.datapoint[1]):void 0!==e.series.lines&&e.series.lines.steps?(i=e.series.datapoints.points[2*e.dataIndex],n=e.series.datapoints.points[2*e.dataIndex+1],r=""):(i=e.series.data[e.dataIndex][0],n=e.series.data[e.dataIndex][1],r=e.series.data[e.dataIndex][2]),null===e.series.label&&e.series.originSeries&&(e.series.label=e.series.originSeries.label),"function"==typeof t&&(t=t(e.series.label,i,n,e)),"boolean"==typeof t&&!t)return"";if(r&&(t=t.replace("%ct",r)),void 0!==e.series.percent?o=e.series.percent:void 0!==e.series.percents&&(o=e.series.percents[e.dataIndex]),"number"==typeof o&&(t=this.adjustValPrecision(/%p\.{0,1}(\d{0,})/,t,o)),e.series.hasOwnProperty("pie")&&void 0!==e.series.data[0][1]&&(a=e.series.data[0][1]),"number"==typeof a&&(t=t.replace("%n",a)),t=void 0!==e.series.label?t.replace(s,e.series.label):t.replace(s,""),t=void 0!==e.series.color?t.replace(l,e.series.color):t.replace(l,""),t=this.hasAxisLabel("xaxis",e)?t.replace(c,e.series.xaxis.options.axisLabel):t.replace(c,""),t=this.hasAxisLabel("yaxis",e)?t.replace(h,e.series.yaxis.options.axisLabel):t.replace(h,""),this.isTimeMode("xaxis",e)&&this.isXDateFormat(e)&&(t=t.replace(u,this.timestampToDate(i,this.tooltipOptions.xDateFormat,e.series.xaxis.options))),this.isTimeMode("yaxis",e)&&this.isYDateFormat(e)&&(t=t.replace(d,this.timestampToDate(n,this.tooltipOptions.yDateFormat,e.series.yaxis.options))),"number"==typeof i&&(t=this.adjustValPrecision(u,t,i)),"number"==typeof n&&(t=this.adjustValPrecision(d,t,n)),void 0!==e.series.xaxis.ticks){var f;f=this.hasRotatedXAxisTicks(e)?"rotatedTicks":"ticks";var p=e.dataIndex+e.seriesIndex;for(var g in e.series.xaxis[f])e.series.xaxis[f].hasOwnProperty(p)&&!this.isTimeMode("xaxis",e)&&(this.isCategoriesMode("xaxis",e)?e.series.xaxis[f][p].label:e.series.xaxis[f][p].v)===i&&(t=t.replace(u,e.series.xaxis[f][p].label.replace(/\$/g,"$$$$")))}if(void 0!==e.series.yaxis.ticks)for(var m in e.series.yaxis.ticks)e.series.yaxis.ticks.hasOwnProperty(m)&&(this.isCategoriesMode("yaxis",e)?e.series.yaxis.ticks[m].label:e.series.yaxis.ticks[m].v)===n&&(t=t.replace(d,e.series.yaxis.ticks[m].label.replace(/\$/g,"$$$$")));return void 0!==e.series.xaxis.tickFormatter&&(t=t.replace("%x",e.series.xaxis.tickFormatter(i,e.series.xaxis).replace(/\$/g,"$$"))),void 0!==e.series.yaxis.tickFormatter&&(t=t.replace("%y",e.series.yaxis.tickFormatter(n,e.series.yaxis).replace(/\$/g,"$$"))),t},i.prototype.isTimeMode=function(t,e){return void 0!==e.series[t].options.mode&&"time"===e.series[t].options.mode},i.prototype.isXDateFormat=function(t){return void 0!==this.tooltipOptions.xDateFormat&&null!==this.tooltipOptions.xDateFormat},i.prototype.isYDateFormat=function(t){return void 0!==this.tooltipOptions.yDateFormat&&null!==this.tooltipOptions.yDateFormat},i.prototype.isCategoriesMode=function(t,e){return void 0!==e.series[t].options.mode&&"categories"===e.series[t].options.mode},i.prototype.timestampToDate=function(e,i,n){var r=t.plot.dateGenerator(e,n);return t.plot.formatDate(r,i,this.tooltipOptions.monthNames,this.tooltipOptions.dayNames)},i.prototype.adjustValPrecision=function(t,e,i){var n;return null!==e.match(t)&&""!==RegExp.$1&&(n=RegExp.$1,i=i.toFixed(n),e=e.replace(t,i)),e},i.prototype.hasAxisLabel=function(e,i){return-1!==t.inArray("axisLabels",this.plotPlugins)&&void 0!==i.series[e].options.axisLabel&&i.series[e].options.axisLabel.length>0},i.prototype.hasRotatedXAxisTicks=function(e){return-1!==t.inArray("tickRotor",this.plotPlugins)&&void 0!==e.series.xaxis.rotatedTicks};t.plot.plugins.push({init:function(t){new i(t)},options:e,name:"tooltip",version:"0.8.5"})}(jQuery),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function t(e,i,n){function r(a,s){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[a]={exports:{}};e[a][0].call(h.exports,function(t){var i=e[a][1][t];return r(i||t)},h,h.exports,t,e,i,n)}return i[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(t,e,i){},{}],2:[function(t,e,i){function n(t){if(t){var e=[0,0,0],i=1,n=t.match(/^#([a-fA-F0-9]{3})$/i);if(n){n=n[1];for(r=0;r<e.length;r++)e[r]=parseInt(n[r]+n[r],16)}else if(n=t.match(/^#([a-fA-F0-9]{6})$/i)){n=n[1];for(r=0;r<e.length;r++)e[r]=parseInt(n.slice(2*r,2*r+2),16)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=parseInt(n[r+1]);i=parseFloat(n[4])}else if(n=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(r=0;r<e.length;r++)e[r]=Math.round(2.55*parseFloat(n[r+1]));i=parseFloat(n[4])}else if(n=t.match(/(\w+)/)){if("transparent"==n[1])return[0,0,0,0];if(!(e=u[n[1]]))return}for(var r=0;r<e.length;r++)e[r]=c(e[r],0,255);return i=i||0==i?c(i,0,1):1,e[3]=i,e}}function r(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[c(parseInt(e[1]),0,360),c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(i)?1:i,0,1)]}}}function o(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var i=parseFloat(e[4]);return[c(parseInt(e[1]),0,360),c(parseFloat(e[2]),0,100),c(parseFloat(e[3]),0,100),c(isNaN(i)?1:i,0,1)]}}}function a(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function s(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function l(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function c(t,e,i){return Math.min(Math.max(e,t),i)}function h(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var u=t(6);e.exports={getRgba:n,getHsla:r,getRgb:function(t){var e=n(t);return e&&e.slice(0,3)},getHsl:function(t){var e=r(t);return e&&e.slice(0,3)},getHwb:o,getAlpha:function(t){var e=n(t);return e?e[3]:(e=r(t))?e[3]:(e=o(t))?e[3]:void 0},hexString:function(t){return"#"+h(t[0])+h(t[1])+h(t[2])},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?a(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:a,percentString:function(t,e){return e<1||t[3]&&t[3]<1?s(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:s,hslString:function(t,e){return e<1||t[3]&&t[3]<1?l(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:l,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return d[t.slice(0,3)]}};var d={};for(var f in u)d[u[f]]=f},{6:6}],3:[function(t,e,i){var n=t(5),r=t(2),o=function(t){if(t instanceof o)return t;if(!(this instanceof o))return new o(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=r.getRgba(t))?this.setValues("rgb",e):(e=r.getHsla(t))?this.setValues("hsl",e):(e=r.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};o.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return r.hexString(this.values.rgb)},rgbString:function(){return r.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return r.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return r.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return r.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return r.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return r.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return r.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(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,n=t,r=void 0===e?.5:e,o=2*r-1,a=i.alpha()-n.alpha(),s=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return this.rgb(s*i.red()+l*n.red(),s*i.green()+l*n.green(),s*i.blue()+l*n.blue()).alpha(i.alpha()*r+n.alpha()*(1-r))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new o,n=this.values,r=i.values;for(var a in n)n.hasOwnProperty(a)&&(t=n[a],"[object Array]"===(e={}.toString.call(t))?r[a]=t.slice(0):"[object Number]"===e?r[a]=t:console.error("unexpected color value:",t));return i}},o.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},o.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},o.prototype.getValues=function(t){for(var e=this.values,i={},n=0;n<t.length;n++)i[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(i.a=e.alpha),i},o.prototype.setValues=function(t,e){var i,r=this.values,o=this.spaces,a=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)r[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(i=0;i<t.length;i++)r[t][i]=e[t.charAt(i)];s=e.a}else if(void 0!==e[o[t][0]]){var l=o[t];for(i=0;i<t.length;i++)r[t][i]=e[l[i]];s=e.alpha}if(r.alpha=Math.max(0,Math.min(1,void 0===s?r.alpha:s)),"alpha"===t)return!1;var c;for(i=0;i<t.length;i++)c=Math.max(0,Math.min(a[t][i],r[t][i])),r[t][i]=Math.round(c);for(var h in o)h!==t&&(r[h]=n[t][h](r[t]));return!0},o.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},o.prototype.setChannel=function(t,e,i){var n=this.values[t];return void 0===i?n[e]:i===n[e]?this:(n[e]=i,this.setValues(t,n),this)},"undefined"!=typeof window&&(window.Color=o),e.exports=o},{2:2,5:5}],4:[function(t,e,i){function n(t){var e,i,n,r=t[0]/255,o=t[1]/255,a=t[2]/255,s=Math.min(r,o,a),l=Math.max(r,o,a),c=l-s;return l==s?e=0:r==l?e=(o-a)/c:o==l?e=2+(a-r)/c:a==l&&(e=4+(r-o)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,i=l==s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*i,100*n]}function o(t){var e,i,n,r=t[0],o=t[1],a=t[2],s=Math.min(r,o,a),l=Math.max(r,o,a),c=l-s;return i=0==l?0:c/l*1e3/10,l==s?e=0:r==l?e=(o-a)/c:o==l?e=2+(a-r)/c:a==l&&(e=4+(r-o)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=l/255*1e3/10,[e,i,n]}function a(t){var e=t[0],i=t[1],r=t[2];return[n(t)[0],100*(1/255*Math.min(e,Math.min(i,r))),100*(r=1-1/255*Math.max(e,Math.max(i,r)))]}function s(t){var e,i,n,r,o=t[0]/255,a=t[1]/255,s=t[2]/255;return r=Math.min(1-o,1-a,1-s),e=(1-o-r)/(1-r)||0,i=(1-a-r)/(1-r)||0,n=(1-s-r)/(1-r)||0,[100*e,100*i,100*n,100*r]}function l(t){return k[JSON.stringify(t)]}function c(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]}function h(t){var e,i,n,r=c(t),o=r[0],a=r[1],s=r[2];return o/=95.047,a/=100,s/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*a-16,i=500*(o-a),n=200*(a-s),[e,i,n]}function u(t){var e,i,n,r,o,a=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return o=255*l,[o,o,o];e=2*l-(i=l<.5?l*(1+s):l+s-l*s),r=[0,0,0];for(var c=0;c<3;c++)(n=a+1/3*-(c-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,r[c]=255*o;return r}function d(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-i),s=255*n*(1-i*o),l=255*n*(1-i*(1-o)),n=255*n;switch(r){case 0:return[n,l,a];case 1:return[s,n,a];case 2:return[a,n,l];case 3:return[a,s,n];case 4:return[l,a,n];case 5:return[n,a,s]}}function f(t){var e,i,n,o,a=t[0]/360,s=t[1]/100,l=t[2]/100,c=s+l;switch(c>1&&(s/=c,l/=c),e=Math.floor(6*a),i=1-l,n=6*a-e,0!=(1&e)&&(n=1-n),o=s+n*(i-s),e){default:case 6:case 0:r=i,g=o,b=s;break;case 1:r=o,g=i,b=s;break;case 2:r=s,g=i,b=o;break;case 3:r=s,g=o,b=i;break;case 4:r=o,g=s,b=i;break;case 5:r=i,g=s,b=o}return[255*r,255*g,255*b]}function p(t){var e,i,n,r=t[0]/100,o=t[1]/100,a=t[2]/100,s=t[3]/100;return e=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),n=1-Math.min(1,a*(1-s)+s),[255*e,255*i,255*n]}function m(t){var e,i,n,r=t[0]/100,o=t[1]/100,a=t[2]/100;return e=3.2406*r+-1.5372*o+-.4986*a,i=-.9689*r+1.8758*o+.0415*a,n=.0557*r+-.204*o+1.057*a,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,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),n=Math.min(Math.max(0,n),1),[255*e,255*i,255*n]}function v(t){var e,i,n,r=t[0],o=t[1],a=t[2];return r/=95.047,o/=100,a/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,e=116*o-16,i=500*(r-o),n=200*(o-a),[e,i,n]}function y(t){var e,i,n,r,o=t[0],a=t[1],s=t[2];return o<=8?r=(i=100*o/903.3)/100*7.787+16/116:(i=100*Math.pow((o+16)/116,3),r=Math.pow(i/100,1/3)),e=e/95.047<=.008856?e=95.047*(a/500+r-16/116)/7.787:95.047*Math.pow(a/500+r,3),n=n/108.883<=.008859?n=108.883*(r-s/200-16/116)/7.787:108.883*Math.pow(r-s/200,3),[e,i,n]}function x(t){var e,i,n,r=t[0],o=t[1],a=t[2];return e=Math.atan2(a,o),(i=360*e/2/Math.PI)<0&&(i+=360),n=Math.sqrt(o*o+a*a),[r,n,i]}function _(t){return m(y(t))}function w(t){var e,i,n,r=t[0],o=t[1];return n=t[2]/360*2*Math.PI,e=o*Math.cos(n),i=o*Math.sin(n),[r,e,i]}function S(t){return C[t]}e.exports={rgb2hsl:n,rgb2hsv:o,rgb2hwb:a,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:c,rgb2lab:h,rgb2lch:function(t){return x(h(t))},hsl2rgb:u,hsl2hsv:function(t){var e,i,n=t[0],r=t[1]/100,o=t[2]/100;return 0===o?[0,0,0]:(o*=2,r*=o<=1?o:2-o,i=(o+r)/2,e=2*r/(o+r),[n,100*e,100*i])},hsl2hwb:function(t){return a(u(t))},hsl2cmyk:function(t){return s(u(t))},hsl2keyword:function(t){return l(u(t))},hsv2rgb:d,hsv2hsl:function(t){var e,i,n=t[0],r=t[1]/100,o=t[2]/100;return i=(2-r)*o,e=r*o,e/=i<=1?i:2-i,e=e||0,i/=2,[n,100*e,100*i]},hsv2hwb:function(t){return a(d(t))},hsv2cmyk:function(t){return s(d(t))},hsv2keyword:function(t){return l(d(t))},hwb2rgb:f,hwb2hsl:function(t){return n(f(t))},hwb2hsv:function(t){return o(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:p,cmyk2hsl:function(t){return n(p(t))},cmyk2hsv:function(t){return o(p(t))},cmyk2hwb:function(t){return a(p(t))},cmyk2keyword:function(t){return l(p(t))},keyword2rgb:S,keyword2hsl:function(t){return n(S(t))},keyword2hsv:function(t){return o(S(t))},keyword2hwb:function(t){return a(S(t))},keyword2cmyk:function(t){return s(S(t))},keyword2lab:function(t){return h(S(t))},keyword2xyz:function(t){return c(S(t))},xyz2rgb:m,xyz2lab:v,xyz2lch:function(t){return x(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:x,lch2lab:w,lch2xyz:function(t){return y(w(t))},lch2rgb:function(t){return _(w(t))}};var C={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]},k={};for(var T in C)k[JSON.stringify(C[T])]=T},{}],5:[function(t,e,i){var n=t(4),r=function(){return new c};for(var o in n){r[o+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),n[t](e)}}(o);var a=/(\w+)2(\w+)/.exec(o),s=a[1],l=a[2];(r[s]=r[s]||{})[l]=r[o]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var i=n[t](e);if("string"==typeof i||void 0===i)return i;for(var r=0;r<i.length;r++)i[r]=Math.round(i[r]);return i}}(o)}var c=function(){this.convs={}};c.prototype.routeSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i))},c.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},c.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,n=this.convs[i];e=r[i][t](n),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){c.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=r},{4:4}],6:[function(t,e,i){"use strict";e.exports={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]}},{}],7:[function(t,e,i){var n=t(29)();n.helpers=t(45),t(27)(n),n.defaults=t(25),n.Element=t(26),n.elements=t(40),n.Interaction=t(28),n.platform=t(48),t(31)(n),t(22)(n),t(23)(n),t(24)(n),t(30)(n),t(33)(n),t(32)(n),t(35)(n),t(54)(n),t(52)(n),t(53)(n),t(55)(n),t(56)(n),t(57)(n),t(15)(n),t(16)(n),t(17)(n),t(18)(n),t(19)(n),t(20)(n),t(21)(n),t(8)(n),t(9)(n),t(10)(n),t(11)(n),t(12)(n),t(13)(n),t(14)(n);var r=[];r.push(t(49)(n),t(50)(n),t(51)(n)),n.plugins.register(r),n.platform.initialize(),e.exports=n,"undefined"!=typeof window&&(window.Chart=n),n.canvasHelpers=n.helpers.canvas},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,35:35,40:40,45:45,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,8:8,9:9}],8:[function(t,e,i){"use strict";e.exports=function(t){t.Bar=function(e,i){return i.type="bar",new t(e,i)}}},{}],9:[function(t,e,i){"use strict";e.exports=function(t){t.Bubble=function(e,i){return i.type="bubble",new t(e,i)}}},{}],10:[function(t,e,i){"use strict";e.exports=function(t){t.Doughnut=function(e,i){return i.type="doughnut",new t(e,i)}}},{}],11:[function(t,e,i){"use strict";e.exports=function(t){t.Line=function(e,i){return i.type="line",new t(e,i)}}},{}],12:[function(t,e,i){"use strict";e.exports=function(t){t.PolarArea=function(e,i){return i.type="polarArea",new t(e,i)}}},{}],13:[function(t,e,i){"use strict";e.exports=function(t){t.Radar=function(e,i){return i.type="radar",new t(e,i)}}},{}],14:[function(t,e,i){"use strict";e.exports=function(t){t.Scatter=function(e,i){return i.type="scatter",new t(e,i)}}},{}],15:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),n._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var i="";return t.length>0&&(t[0].yLabel?i=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(i=e.labels[t[0].index])),i},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(t){t.controllers.bar=t.DatasetController.extend({dataElementType:r.Rectangle,initialize:function(){var e,i=this;t.DatasetController.prototype.initialize.apply(i,arguments),(e=i.getMeta()).stack=i.getDataset().stack,e.bar=!0},update:function(t){var e,i,n=this,r=n.getMeta().data;for(n._ruler=n.getRuler(),e=0,i=r.length;e<i;++e)n.updateElement(r[e],e,t)},updateElement:function(t,e,i){var n=this,r=n.chart,a=n.getMeta(),s=n.getDataset(),l=t.custom||{},c=r.options.elements.rectangle;t._xScale=n.getScaleForId(a.xAxisID),t._yScale=n.getScaleForId(a.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={datasetLabel:s.label,label:r.data.labels[e],borderSkipped:l.borderSkipped?l.borderSkipped:c.borderSkipped,backgroundColor:l.backgroundColor?l.backgroundColor:o.valueAtIndexOrDefault(s.backgroundColor,e,c.backgroundColor),borderColor:l.borderColor?l.borderColor:o.valueAtIndexOrDefault(s.borderColor,e,c.borderColor),borderWidth:l.borderWidth?l.borderWidth:o.valueAtIndexOrDefault(s.borderWidth,e,c.borderWidth)},n.updateElementGeometry(t,e,i),t.pivot()},updateElementGeometry:function(t,e,i){var n=this,r=t._model,o=n.getValueScale(),a=o.getBasePixel(),s=o.isHorizontal(),l=n._ruler||n.getRuler(),c=n.calculateBarValuePixels(n.index,e),h=n.calculateBarIndexPixels(n.index,e,l);r.horizontal=s,r.base=i?a:c.base,r.x=s?i?a:c.head:h.center,r.y=s?h.center:i?a:c.head,r.height=s?h.size:void 0,r.width=s?void 0:h.size},getValueScaleId:function(){return this.getMeta().yAxisID},getIndexScaleId:function(){return this.getMeta().xAxisID},getValueScale:function(){return this.getScaleForId(this.getValueScaleId())},getIndexScale:function(){return this.getScaleForId(this.getIndexScaleId())},getStackCount:function(t){var e,i,n=this,r=n.chart,o=n.getIndexScale().options.stacked,a=void 0===t?r.data.datasets.length:t+1,s=[];for(e=0;e<a;++e)(i=r.getDatasetMeta(e)).bar&&r.isDatasetVisible(e)&&(!1===o||!0===o&&-1===s.indexOf(i.stack)||void 0===o&&(void 0===i.stack||-1===s.indexOf(i.stack)))&&s.push(i.stack);return s.length},getStackIndex:function(t){return this.getStackCount(t)-1},getRuler:function(){var t,e,i=this,n=i.getIndexScale(),r=i.getStackCount(),o=i.index,a=[],s=n.isHorizontal(),l=s?n.left:n.top,c=l+(s?n.width:n.height);for(t=0,e=i.getMeta().data.length;t<e;++t)a.push(n.getPixelForValue(null,t,o));return{pixels:a,start:l,end:c,stackCount:r,scale:n}},calculateBarValuePixels:function(t,e){var i,n,r,o,a,s,l=this,c=l.chart,h=l.getMeta(),u=l.getValueScale(),d=c.data.datasets,f=u.getRightValue(d[t].data[e]),p=u.options.stacked,g=h.stack,m=0;if(p||void 0===p&&void 0!==g)for(i=0;i<t;++i)(n=c.getDatasetMeta(i)).bar&&n.stack===g&&n.controller.getValueScaleId()===u.id&&c.isDatasetVisible(i)&&(r=u.getRightValue(d[i].data[e]),(f<0&&r<0||f>=0&&r>0)&&(m+=r));return o=u.getPixelForValue(m),a=u.getPixelForValue(m+f),s=(a-o)/2,{size:s,base:o,head:a,center:a+s/2}},calculateBarIndexPixels:function(t,e,i){var n,r,a,s,l,c,h=this,u=i.scale.options,d=h.getStackIndex(t),f=i.pixels,p=f[e],g=f.length,m=i.start,v=i.end;return 1===g?(n=p>m?p-m:v-p,r=p<v?v-p:p-m):(e>0&&(n=(p-f[e-1])/2,e===g-1&&(r=n)),e<g-1&&(r=(f[e+1]-p)/2,0===e&&(n=r))),a=n*u.categoryPercentage,s=r*u.categoryPercentage,l=(a+s)/i.stackCount,c=l*u.barPercentage,c=Math.min(o.valueOrDefault(u.barThickness,c),o.valueOrDefault(u.maxBarThickness,1/0)),p-=a,p+=l*d,p+=(l-c)/2,{size:c,base:p,head:p+c,center:p+c/2}},draw:function(){var t=this,e=t.chart,i=t.getValueScale(),n=t.getMeta().data,r=t.getDataset(),a=n.length,s=0;for(o.canvas.clipArea(e.ctx,e.chartArea);s<a;++s)isNaN(i.getRightValue(r.data[s]))||n[s].draw();o.canvas.unclipArea(e.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},r=t._model;r.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:o.valueAtIndexOrDefault(e.hoverBackgroundColor,i,o.getHoverColor(r.backgroundColor)),r.borderColor=n.hoverBorderColor?n.hoverBorderColor:o.valueAtIndexOrDefault(e.hoverBorderColor,i,o.getHoverColor(r.borderColor)),r.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:o.valueAtIndexOrDefault(e.hoverBorderWidth,i,r.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},r=t._model,a=this.chart.options.elements.rectangle;r.backgroundColor=n.backgroundColor?n.backgroundColor:o.valueAtIndexOrDefault(e.backgroundColor,i,a.backgroundColor),r.borderColor=n.borderColor?n.borderColor:o.valueAtIndexOrDefault(e.borderColor,i,a.borderColor),r.borderWidth=n.borderWidth?n.borderWidth:o.valueAtIndexOrDefault(e.borderWidth,i,a.borderWidth)}}),t.controllers.horizontalBar=t.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{25:25,40:40,45:45}],16:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return i+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:r.Point,update:function(t){var e=this,i=e.getMeta().data;o.each(i,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){var n=this,r=n.getMeta(),o=t.custom||{},a=n.getScaleForId(r.xAxisID),s=n.getScaleForId(r.yAxisID),l=n._resolveElementOptions(t,e),c=n.getDataset().data[e],h=n.index,u=i?a.getPixelForDecimal(.5):a.getPixelForValue("object"==typeof c?c:NaN,e,h),d=i?s.getBasePixel():s.getPixelForValue(c,e,h);t._xScale=a,t._yScale=s,t._options=l,t._datasetIndex=h,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,radius:i?0:l.radius,skip:o.skip||isNaN(u)||isNaN(d),x:u,y:d},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options;e.backgroundColor=o.valueOrDefault(i.hoverBackgroundColor,o.getHoverColor(i.backgroundColor)),e.borderColor=o.valueOrDefault(i.hoverBorderColor,o.getHoverColor(i.borderColor)),e.borderWidth=o.valueOrDefault(i.hoverBorderWidth,i.borderWidth),e.radius=i.radius+i.hoverRadius},removeHoverStyle:function(t){var e=t._model,i=t._options;e.backgroundColor=i.backgroundColor,e.borderColor=i.borderColor,e.borderWidth=i.borderWidth,e.radius=i.radius},_resolveElementOptions:function(t,e){var i,n,r,a=this,s=a.chart,l=s.data.datasets[a.index],c=t.custom||{},h=s.options.elements.point,u=o.options.resolve,d=l.data[e],f={},p={chart:s,dataIndex:e,dataset:l,datasetIndex:a.index},g=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(i=0,n=g.length;i<n;++i)f[r=g[i]]=u([c[r],l[r],h[r]],p,e);return f.radius=u([c.radius,d?d.r:void 0,l.radius,h.radius],p,e),f}})}},{25:25,40:40,45:45}],17:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,r=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[0].backgroundColor[o]+'"></span>'),r[o]&&e.push(r[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,n){var r=t.getDatasetMeta(0),a=e.datasets[0],s=r.data[n],l=s&&s.custom||{},c=o.valueAtIndexOrDefault,h=t.options.elements.arc;return{text:i,fillStyle:l.backgroundColor?l.backgroundColor:c(a.backgroundColor,n,h.backgroundColor),strokeStyle:l.borderColor?l.borderColor:c(a.borderColor,n,h.borderColor),lineWidth:l.borderWidth?l.borderWidth:c(a.borderWidth,n,h.borderWidth),hidden:isNaN(a.data[n])||r.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,r,o=e.index,a=this.chart;for(i=0,n=(a.data.datasets||[]).length;i<n;++i)(r=a.getDatasetMeta(i)).data[o]&&(r.data[o].hidden=!r.data[o].hidden);a.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return o.isArray(i)?(i=i.slice())[0]+=n:i+=n,i}}}}),n._set("pie",o.clone(n.doughnut)),n._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:r.Arc,linkScales:o.noop,getRingIndex:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&++e;return e},update:function(t){var e=this,i=e.chart,n=i.chartArea,r=i.options,a=r.elements.arc,s=n.right-n.left-a.borderWidth,l=n.bottom-n.top-a.borderWidth,c=Math.min(s,l),h={x:0,y:0},u=e.getMeta(),d=r.cutoutPercentage,f=r.circumference;if(f<2*Math.PI){var p=r.rotation%(2*Math.PI),g=(p+=2*Math.PI*(p>=Math.PI?-1:p<-Math.PI?1:0))+f,m={x:Math.cos(p),y:Math.sin(p)},v={x:Math.cos(g),y:Math.sin(g)},y=p<=0&&g>=0||p<=2*Math.PI&&2*Math.PI<=g,b=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,_=p<=.5*-Math.PI&&.5*-Math.PI<=g||p<=1.5*Math.PI&&1.5*Math.PI<=g,w=d/100,S={x:x?-1:Math.min(m.x*(m.x<0?1:w),v.x*(v.x<0?1:w)),y:_?-1:Math.min(m.y*(m.y<0?1:w),v.y*(v.y<0?1:w))},C={x:y?1:Math.max(m.x*(m.x>0?1:w),v.x*(v.x>0?1:w)),y:b?1:Math.max(m.y*(m.y>0?1:w),v.y*(v.y>0?1:w))},k={width:.5*(C.x-S.x),height:.5*(C.y-S.y)};c=Math.min(s/k.width,l/k.height),h={x:-.5*(C.x+S.x),y:-.5*(C.y+S.y)}}i.borderWidth=e.getMaxBorderWidth(u.data),i.outerRadius=Math.max((c-i.borderWidth)/2,0),i.innerRadius=Math.max(d?i.outerRadius/100*d:0,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),i.offsetX=h.x*i.outerRadius,i.offsetY=h.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),o.each(u.data,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){var n=this,r=n.chart,a=r.chartArea,s=r.options,l=s.animation,c=(a.left+a.right)/2,h=(a.top+a.bottom)/2,u=s.rotation,d=s.rotation,f=n.getDataset(),p=i&&l.animateRotate?0:t.hidden?0:n.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),g=i&&l.animateScale?0:n.innerRadius,m=i&&l.animateScale?0:n.outerRadius,v=o.valueAtIndexOrDefault;o.extend(t,{_datasetIndex:n.index,_index:e,_model:{x:c+r.offsetX,y:h+r.offsetY,startAngle:u,endAngle:d,circumference:p,outerRadius:m,innerRadius:g,label:v(f.label,e,r.data.labels[e])}});var y=t._model;this.removeHoverStyle(t),i&&l.animateRotate||(y.startAngle=0===e?s.rotation:n.getMeta().data[e-1]._model.endAngle,y.endAngle=y.startAngle+y.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),n=0;return o.each(i.data,function(i,r){t=e.data[r],isNaN(t)||i.hidden||(n+=Math.abs(t))}),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,i,n=0,r=this.index,o=t.length,a=0;a<o;a++)e=t[a]._model?t[a]._model.borderWidth:0,n=(i=t[a]._chart?t[a]._chart.config.data.datasets[r].hoverBorderWidth:0)>(n=e>n?e:n)?i:n;return n}})}},{25:25,40:40,45:45}],18:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._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 o.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:r.Line,dataElementType:r.Point,update:function(t){var i,n,r,a=this,s=a.getMeta(),l=s.dataset,c=s.data||[],h=a.chart.options,u=h.elements.line,d=a.getScaleForId(s.yAxisID),f=a.getDataset(),p=e(f,h);for(p&&(r=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=d,l._datasetIndex=a.index,l._children=c,l._model={spanGaps:f.spanGaps?f.spanGaps:h.spanGaps,tension:r.tension?r.tension:o.valueOrDefault(f.lineTension,u.tension),backgroundColor:r.backgroundColor?r.backgroundColor:f.backgroundColor||u.backgroundColor,borderWidth:r.borderWidth?r.borderWidth:f.borderWidth||u.borderWidth,borderColor:r.borderColor?r.borderColor:f.borderColor||u.borderColor,borderCapStyle:r.borderCapStyle?r.borderCapStyle:f.borderCapStyle||u.borderCapStyle,borderDash:r.borderDash?r.borderDash:f.borderDash||u.borderDash,borderDashOffset:r.borderDashOffset?r.borderDashOffset:f.borderDashOffset||u.borderDashOffset,borderJoinStyle:r.borderJoinStyle?r.borderJoinStyle:f.borderJoinStyle||u.borderJoinStyle,fill:r.fill?r.fill:void 0!==f.fill?f.fill:u.fill,steppedLine:r.steppedLine?r.steppedLine:o.valueOrDefault(f.steppedLine,u.stepped),cubicInterpolationMode:r.cubicInterpolationMode?r.cubicInterpolationMode:o.valueOrDefault(f.cubicInterpolationMode,u.cubicInterpolationMode)},l.pivot()),i=0,n=c.length;i<n;++i)a.updateElement(c[i],i,t);for(p&&0!==l._model.tension&&a.updateBezierControlPoints(),i=0,n=c.length;i<n;++i)c[i].pivot()},getPointBackgroundColor:function(t,e){var i=this.chart.options.elements.point.backgroundColor,n=this.getDataset(),r=t.custom||{};return r.backgroundColor?i=r.backgroundColor:n.pointBackgroundColor?i=o.valueAtIndexOrDefault(n.pointBackgroundColor,e,i):n.backgroundColor&&(i=n.backgroundColor),i},getPointBorderColor:function(t,e){var i=this.chart.options.elements.point.borderColor,n=this.getDataset(),r=t.custom||{};return r.borderColor?i=r.borderColor:n.pointBorderColor?i=o.valueAtIndexOrDefault(n.pointBorderColor,e,i):n.borderColor&&(i=n.borderColor),i},getPointBorderWidth:function(t,e){var i=this.chart.options.elements.point.borderWidth,n=this.getDataset(),r=t.custom||{};return isNaN(r.borderWidth)?!isNaN(n.pointBorderWidth)||o.isArray(n.pointBorderWidth)?i=o.valueAtIndexOrDefault(n.pointBorderWidth,e,i):isNaN(n.borderWidth)||(i=n.borderWidth):i=r.borderWidth,i},updateElement:function(t,e,i){var n,r,a=this,s=a.getMeta(),l=t.custom||{},c=a.getDataset(),h=a.index,u=c.data[e],d=a.getScaleForId(s.yAxisID),f=a.getScaleForId(s.xAxisID),p=a.chart.options.elements.point;void 0!==c.radius&&void 0===c.pointRadius&&(c.pointRadius=c.radius),void 0!==c.hitRadius&&void 0===c.pointHitRadius&&(c.pointHitRadius=c.hitRadius),n=f.getPixelForValue("object"==typeof u?u:NaN,e,h),r=i?d.getBasePixel():a.calculatePointY(u,e,h),t._xScale=f,t._yScale=d,t._datasetIndex=h,t._index=e,t._model={x:n,y:r,skip:l.skip||isNaN(n)||isNaN(r),radius:l.radius||o.valueAtIndexOrDefault(c.pointRadius,e,p.radius),pointStyle:l.pointStyle||o.valueAtIndexOrDefault(c.pointStyle,e,p.pointStyle),backgroundColor:a.getPointBackgroundColor(t,e),borderColor:a.getPointBorderColor(t,e),borderWidth:a.getPointBorderWidth(t,e),tension:s.dataset._model?s.dataset._model.tension:0,steppedLine:!!s.dataset._model&&s.dataset._model.steppedLine,hitRadius:l.hitRadius||o.valueAtIndexOrDefault(c.pointHitRadius,e,p.hitRadius)}},calculatePointY:function(t,e,i){var n,r,o,a=this,s=a.chart,l=a.getMeta(),c=a.getScaleForId(l.yAxisID),h=0,u=0;if(c.options.stacked){for(n=0;n<i;n++)if(r=s.data.datasets[n],"line"===(o=s.getDatasetMeta(n)).type&&o.yAxisID===c.id&&s.isDatasetVisible(n)){var d=Number(c.getRightValue(r.data[e]));d<0?u+=d||0:h+=d||0}var f=Number(c.getRightValue(t));return f<0?c.getPixelForValue(u+f):c.getPixelForValue(h+f)}return c.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,i){return Math.max(Math.min(t,i),e)}var e,i,n,r,a=this,s=a.getMeta(),l=a.chart.chartArea,c=s.data||[];if(s.dataset._model.spanGaps&&(c=c.filter(function(t){return!t._model.skip})),"monotone"===s.dataset._model.cubicInterpolationMode)o.splineCurveMonotone(c);else for(e=0,i=c.length;e<i;++e)n=c[e]._model,r=o.splineCurve(o.previousItem(c,e)._model,n,o.nextItem(c,e)._model,s.dataset._model.tension),n.controlPointPreviousX=r.previous.x,n.controlPointPreviousY=r.previous.y,n.controlPointNextX=r.next.x,n.controlPointNextY=r.next.y;if(a.chart.options.elements.line.capBezierPoints)for(e=0,i=c.length;e<i;++e)(n=c[e]._model).controlPointPreviousX=t(n.controlPointPreviousX,l.left,l.right),n.controlPointPreviousY=t(n.controlPointPreviousY,l.top,l.bottom),n.controlPointNextX=t(n.controlPointNextX,l.left,l.right),n.controlPointNextY=t(n.controlPointNextY,l.top,l.bottom)},draw:function(){var t=this,i=t.chart,n=t.getMeta(),r=n.data||[],a=i.chartArea,s=r.length,l=0;for(o.canvas.clipArea(i.ctx,a),e(t.getDataset(),i.options)&&n.dataset.draw(),o.canvas.unclipArea(i.ctx);l<s;++l)r[l].draw(a)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},r=t._model;r.radius=n.hoverRadius||o.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),r.backgroundColor=n.hoverBackgroundColor||o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,o.getHoverColor(r.backgroundColor)),r.borderColor=n.hoverBorderColor||o.valueAtIndexOrDefault(e.pointHoverBorderColor,i,o.getHoverColor(r.borderColor)),r.borderWidth=n.hoverBorderWidth||o.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,r.borderWidth)},removeHoverStyle:function(t){var e=this,i=e.chart.data.datasets[t._datasetIndex],n=t._index,r=t.custom||{},a=t._model;void 0!==i.radius&&void 0===i.pointRadius&&(i.pointRadius=i.radius),a.radius=r.radius||o.valueAtIndexOrDefault(i.pointRadius,n,e.chart.options.elements.point.radius),a.backgroundColor=e.getPointBackgroundColor(t,n),a.borderColor=e.getPointBorderColor(t,n),a.borderWidth=e.getPointBorderWidth(t,n)}})}},{25:25,40:40,45:45}],19:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var i=t.data,n=i.datasets,r=i.labels;if(n.length)for(var o=0;o<n[0].data.length;++o)e.push('<li><span style="background-color:'+n[0].backgroundColor[o]+'"></span>'),r[o]&&e.push(r[o]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,n){var r=t.getDatasetMeta(0),a=e.datasets[0],s=r.data[n].custom||{},l=o.valueAtIndexOrDefault,c=t.options.elements.arc;return{text:i,fillStyle:s.backgroundColor?s.backgroundColor:l(a.backgroundColor,n,c.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(a.borderColor,n,c.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(a.borderWidth,n,c.borderWidth),hidden:isNaN(a.data[n])||r.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,r,o=e.index,a=this.chart;for(i=0,n=(a.data.datasets||[]).length;i<n;++i)(r=a.getDatasetMeta(i)).data[o].hidden=!r.data[o].hidden;a.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:r.Arc,linkScales:o.noop,update:function(t){var e=this,i=e.chart,n=i.chartArea,r=e.getMeta(),a=i.options,s=a.elements.arc,l=Math.min(n.right-n.left,n.bottom-n.top);i.outerRadius=Math.max((l-s.borderWidth/2)/2,0),i.innerRadius=Math.max(a.cutoutPercentage?i.outerRadius/100*a.cutoutPercentage:1,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),e.outerRadius=i.outerRadius-i.radiusLength*e.index,e.innerRadius=e.outerRadius-i.radiusLength,r.count=e.countVisibleElements(),o.each(r.data,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){for(var n=this,r=n.chart,a=n.getDataset(),s=r.options,l=s.animation,c=r.scale,h=r.data.labels,u=n.calculateCircumference(a.data[e]),d=c.xCenter,f=c.yCenter,p=0,g=n.getMeta(),m=0;m<e;++m)isNaN(a.data[m])||g.data[m].hidden||++p;var v=s.startAngle,y=t.hidden?0:c.getDistanceFromCenterForValue(a.data[e]),b=v+u*p,x=b+(t.hidden?0:u),_=l.animateScale?0:c.getDistanceFromCenterForValue(a.data[e]);o.extend(t,{_datasetIndex:n.index,_index:e,_scale:c,_model:{x:d,y:f,innerRadius:0,outerRadius:i?_:y,startAngle:i&&l.animateRotate?v:b,endAngle:i&&l.animateRotate?v:x,label:o.valueAtIndexOrDefault(h,e,h[e])}}),n.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),i=0;return o.each(e.data,function(e,n){isNaN(t.data[n])||e.hidden||i++}),i},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:r.Line,dataElementType:r.Point,linkScales:o.noop,update:function(t){var e=this,i=e.getMeta(),n=i.dataset,r=i.data,a=n.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,c=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),o.extend(i.dataset,{_datasetIndex:e.index,_scale:c,_children:r,_loop:!0,_model:{tension:a.tension?a.tension:o.valueOrDefault(s.lineTension,l.tension),backgroundColor:a.backgroundColor?a.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:s.borderWidth||l.borderWidth,borderColor:a.borderColor?a.borderColor:s.borderColor||l.borderColor,fill:a.fill?a.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:a.borderCapStyle?a.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:a.borderDash?a.borderDash:s.borderDash||l.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),i.dataset.pivot(),o.each(r,function(i,n){e.updateElement(i,n,t)},e),e.updateBezierControlPoints()},updateElement:function(t,e,i){var n=this,r=t.custom||{},a=n.getDataset(),s=n.chart.scale,l=n.chart.options.elements.point,c=s.getPointPositionForValue(e,a.data[e]);void 0!==a.radius&&void 0===a.pointRadius&&(a.pointRadius=a.radius),void 0!==a.hitRadius&&void 0===a.pointHitRadius&&(a.pointHitRadius=a.hitRadius),o.extend(t,{_datasetIndex:n.index,_index:e,_scale:s,_model:{x:i?s.xCenter:c.x,y:i?s.yCenter:c.y,tension:r.tension?r.tension:o.valueOrDefault(a.lineTension,n.chart.options.elements.line.tension),radius:r.radius?r.radius:o.valueAtIndexOrDefault(a.pointRadius,e,l.radius),backgroundColor:r.backgroundColor?r.backgroundColor:o.valueAtIndexOrDefault(a.pointBackgroundColor,e,l.backgroundColor),borderColor:r.borderColor?r.borderColor:o.valueAtIndexOrDefault(a.pointBorderColor,e,l.borderColor),borderWidth:r.borderWidth?r.borderWidth:o.valueAtIndexOrDefault(a.pointBorderWidth,e,l.borderWidth),pointStyle:r.pointStyle?r.pointStyle:o.valueAtIndexOrDefault(a.pointStyle,e,l.pointStyle),hitRadius:r.hitRadius?r.hitRadius:o.valueAtIndexOrDefault(a.pointHitRadius,e,l.hitRadius)}}),t._model.skip=r.skip?r.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();o.each(e.data,function(i,n){var r=i._model,a=o.splineCurve(o.previousItem(e.data,n,!0)._model,r,o.nextItem(e.data,n,!0)._model,r.tension);r.controlPointPreviousX=Math.max(Math.min(a.previous.x,t.right),t.left),r.controlPointPreviousY=Math.max(Math.min(a.previous.y,t.bottom),t.top),r.controlPointNextX=Math.max(Math.min(a.next.x,t.right),t.left),r.controlPointNextY=Math.max(Math.min(a.next.y,t.bottom),t.top),i.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},n=t._index,r=t._model;r.radius=i.hoverRadius?i.hoverRadius:o.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),r.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:o.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,o.getHoverColor(r.backgroundColor)),r.borderColor=i.hoverBorderColor?i.hoverBorderColor:o.valueAtIndexOrDefault(e.pointHoverBorderColor,n,o.getHoverColor(r.borderColor)),r.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:o.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,r.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},n=t._index,r=t._model,a=this.chart.options.elements.point;r.radius=i.radius?i.radius:o.valueAtIndexOrDefault(e.pointRadius,n,a.radius),r.backgroundColor=i.backgroundColor?i.backgroundColor:o.valueAtIndexOrDefault(e.pointBackgroundColor,n,a.backgroundColor),r.borderColor=i.borderColor?i.borderColor:o.valueAtIndexOrDefault(e.pointBorderColor,n,a.borderColor),r.borderWidth=i.borderWidth?i.borderWidth:o.valueAtIndexOrDefault(e.pointBorderWidth,n,a.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,i){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45);n._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:o.noop,onComplete:o.noop}}),e.exports=function(t){t.Animation=r.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,i,n){var r,o,a=this.animations;for(e.chart=t,n||(t.animating=!0),r=0,o=a.length;r<o;++r)if(a[r].chart===t)return void(a[r]=e);a.push(e),1===a.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=o.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=o.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),i=0;t.dropFrames>1&&(i=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+i);var n=Date.now();t.dropFrames+=(n-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,i,n=this.animations,r=0;r<n.length;)i=(e=n[r]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),o.callback(e.render,[i,e],i),o.callback(e.onAnimationProgress,[e],i),e.currentStep>=e.numSteps?(o.callback(e.onAnimationComplete,[e],i),i.animating=!1,n.splice(r,1)):++r}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,i){"use strict";var n=t(25),r=t(45),o=t(28),a=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=r.configMerge(n.global,n[t.type],t.options||{}),t}function i(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function s(t){return"top"===t||"bottom"===t}var l=t.plugins;t.types={},t.instances={},t.controllers={},r.extend(t.prototype,{construct:function(i,n){var o=this;n=e(n);var s=a.acquireContext(i,n),l=s&&s.canvas,c=l&&l.height,h=l&&l.width;o.id=r.uid(),o.ctx=s,o.canvas=l,o.config=n,o.width=h,o.height=c,o.aspectRatio=c?h/c:null,o.options=n.options,o._bufferedRender=!1,o.chart=o,o.controller=o,t.instances[o.id]=o,Object.defineProperty(o,"data",{get:function(){return o.config.data},set:function(t){o.config.data=t}}),s&&l?(o.initialize(),o.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return l.notify(t,"beforeInit"),r.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),l.notify(t,"afterInit"),t},clear:function(){return r.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,o=i.maintainAspectRatio&&e.aspectRatio||null,a=Math.max(0,Math.floor(r.getMaximumWidth(n))),s=Math.max(0,Math.floor(o?a/o:r.getMaximumHeight(n)));if((e.width!==a||e.height!==s)&&(n.width=e.width=a,n.height=e.height=s,n.style.width=a+"px",n.style.height=s+"px",r.retinaScale(e,i.devicePixelRatio),!t)){var c={width:a,height:s};l.notify(e,"resize",[c]),e.options.onResize&&e.options.onResize(e,c),e.stop(),e.update(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")},buildScales:function(){var e=this,i=e.options,n=e.scales={},o=[];i.scales&&(o=o.concat((i.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(i.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),i.scale&&o.push({options:i.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),r.each(o,function(i){var o=i.options,a=r.valueOrDefault(o.type,i.dtype),l=t.scaleService.getScaleConstructor(a);if(l){s(o.position)!==s(i.dposition)&&(o.position=i.dposition);var c=new l({id:o.id,options:o,ctx:e.ctx,chart:e});n[c.id]=c,c.mergeTicksOptions(),i.isDefault&&(e.scale=c)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,i=[],n=[];return r.each(e.data.datasets,function(r,o){var a=e.getDatasetMeta(o),s=r.type||e.config.type;if(a.type&&a.type!==s&&(e.destroyDatasetMeta(o),a=e.getDatasetMeta(o)),a.type=s,i.push(a.type),a.controller)a.controller.updateIndex(o);else{var l=t.controllers[a.type];if(void 0===l)throw new Error('"'+a.type+'" is not a chart type.');a.controller=new l(e,o),n.push(a.controller)}},e),n},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),!1!==l.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var n=e.buildOrUpdateControllers();r.each(e.data.datasets,function(t,i){e.getDatasetMeta(i).controller.buildOrUpdateElements()},e),e.updateLayout(),r.each(n,function(t){t.reset()}),e.updateDatasets(),l.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==l.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),l.notify(e,"afterScaleUpdate"),l.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==l.notify(t,"beforeDatasetsUpdate")){for(var e=0,i=t.data.datasets.length;e<i;++e)t.updateDataset(e);l.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,i=e.getDatasetMeta(t),n={meta:i,index:t};!1!==l.notify(e,"beforeDatasetUpdate",[n])&&(i.controller.update(),l.notify(e,"afterDatasetUpdate",[n]))},render:function(e){var i=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=e.duration,o=e.lazy;if(!1!==l.notify(i,"beforeRender")){var a=i.options.animation,s=function(t){l.notify(i,"afterRender"),r.callback(a&&a.onComplete,[t],i)};if(a&&(void 0!==n&&0!==n||void 0===n&&0!==a.duration)){var c=new t.Animation({numSteps:(n||a.duration)/16.66,easing:e.easing||a.easing,render:function(t,e){var i=r.easing.effects[e.easing],n=e.currentStep,o=n/e.numSteps;t.draw(i(o),o,n)},onAnimationProgress:a.onProgress,onAnimationComplete:s});t.animationService.addAnimation(i,c,n,o)}else i.draw(),s(new t.Animation({numSteps:0,chart:i}));return i}},draw:function(t){var e=this;e.clear(),r.isNullOrUndef(t)&&(t=1),e.transition(t),!1!==l.notify(e,"beforeDraw",[t])&&(r.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e.tooltip.draw(),l.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=this,i=0,n=(e.data.datasets||[]).length;i<n;++i)e.isDatasetVisible(i)&&e.getDatasetMeta(i).controller.transition(t);e.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==l.notify(e,"beforeDatasetsDraw",[t])){for(var i=(e.data.datasets||[]).length-1;i>=0;--i)e.isDatasetVisible(i)&&e.drawDataset(i,t);l.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var i=this,n=i.getDatasetMeta(t),r={meta:n,index:t,easingValue:e};!1!==l.notify(i,"beforeDatasetDraw",[r])&&(n.controller.draw(e),l.notify(i,"afterDatasetDraw",[r]))},getElementAtEvent:function(t){return o.modes.single(this,t)},getElementsAtEvent:function(t){return o.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return o.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=o.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return o.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,i=e.data.datasets[t];i._meta||(i._meta={});var n=i._meta[e.id];return n||(n=i._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e<i;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,i=this.data.datasets[t],n=i._meta&&i._meta[e];n&&(n.controller.destroy(),delete i._meta[e])},destroy:function(){var e,i,n=this,o=n.canvas;for(n.stop(),e=0,i=n.data.datasets.length;e<i;++e)n.destroyDatasetMeta(e);o&&(n.unbindEvents(),r.canvas.clear(n),a.releaseContext(n.ctx),n.canvas=null,n.ctx=null),l.notify(n,"destroy"),delete t.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this,e=t._listeners={},i=function(){t.eventHandler.apply(t,arguments)};r.each(t.options.events,function(n){a.addEventListener(t,n,i),e[n]=i}),t.options.responsive&&(i=function(){t.resize()},a.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,r.each(e,function(e,i){a.removeEventListener(t,i,e)}))},updateHoverStyle:function(t,e,i){var n,r,o,a=i?"setHoverStyle":"removeHoverStyle";for(r=0,o=t.length;r<o;++r)(n=t[r])&&this.getDatasetMeta(n._datasetIndex).controller[a](n)},eventHandler:function(t){var e=this,i=e.tooltip;if(!1!==l.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var n=e.handleEvent(t);n|=i&&i.handleEvent(t),l.notify(e,"afterEvent",[t]);var r=e._bufferedRequest;return r?e.render(r):n&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,i=e.options||{},n=i.hover,o=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,n.mode,n),r.callback(i.onHover||i.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,n.mode,!1),e.active.length&&n.mode&&e.updateHoverStyle(e.active,n.mode,!0),o=!r.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,o}}),t.Controller=t}},{25:25,28:28,45:45,48:48}],24:[function(t,e,i){"use strict";var n=t(45);e.exports=function(t){function e(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),r.forEach(function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),o=r.apply(this,e);return n.each(t._chartjs.listeners,function(t){"function"==typeof t[i]&&t[i].apply(t,e)}),o}})}))}function i(t,e){var i=t._chartjs;if(i){var n=i.listeners,o=n.indexOf(e);-1!==o&&n.splice(o,1),n.length>0||(r.forEach(function(e){delete t[e]}),delete t._chartjs)}}var r=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},n.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=i.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(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,n=i.getMeta(),r=i.getDataset().data||[],o=n.data;for(t=0,e=r.length;t<e;++t)o[t]=o[t]||i.createMetaData(t);n.dataset=n.dataset||i.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,n=t.getDataset(),r=n.data||(n.data=[]);t._data!==r&&(t._data&&i(t._data,t),e(r,t),t._data=r),t.resyncElements()},update:n.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,r=0;r<n;++r)i[r].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],i=e.length,n=0;for(t.dataset&&t.dataset.draw();n<i;++n)e[n].draw()},removeHoverStyle:function(t,e){var i=this.chart.data.datasets[t._datasetIndex],r=t._index,o=t.custom||{},a=n.valueAtIndexOrDefault,s=t._model;s.backgroundColor=o.backgroundColor?o.backgroundColor:a(i.backgroundColor,r,e.backgroundColor),s.borderColor=o.borderColor?o.borderColor:a(i.borderColor,r,e.borderColor),s.borderWidth=o.borderWidth?o.borderWidth:a(i.borderWidth,r,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,r=t.custom||{},o=n.valueAtIndexOrDefault,a=n.getHoverColor,s=t._model;s.backgroundColor=r.hoverBackgroundColor?r.hoverBackgroundColor:o(e.hoverBackgroundColor,i,a(s.backgroundColor)),s.borderColor=r.hoverBorderColor?r.hoverBorderColor:o(e.hoverBorderColor,i,a(s.borderColor)),s.borderWidth=r.hoverBorderWidth?r.hoverBorderWidth:o(e.hoverBorderWidth,i,s.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),i=t.getDataset().data,n=e.data.length,r=i.length;r<n?e.data.splice(r,n-r):r>n&&t.insertElements(n,r-n)},insertElements:function(t,e){for(var i=0;i<e;++i)this.addElementAndReset(t+i)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=n.inherits}},{45:45}],25:[function(t,e,i){"use strict";var n=t(45);e.exports={_set:function(t,e){return n.merge(this[t]||(this[t]={}),e)}}},{45:45}],26:[function(t,e,i){"use strict";function n(t,e,i,n){var o,a,s,l,c,h,u,d,f,p=Object.keys(i);for(o=0,a=p.length;o<a;++o)if(s=p[o],h=i[s],e.hasOwnProperty(s)||(e[s]=h),(l=e[s])!==h&&"_"!==s[0]){if(t.hasOwnProperty(s)||(t[s]=l),c=t[s],(u=typeof h)===typeof c)if("string"===u){if((d=r(c)).valid&&(f=r(h)).valid){e[s]=f.mix(d,n).rgbString();continue}}else if("number"===u&&isFinite(c)&&isFinite(h)){e[s]=c+(h-c)*n;continue}e[s]=h}}var r=t(3),o=t(45),a=function(t){o.extend(this,t),this.initialize.apply(this,arguments)};o.extend(a.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=o.clone(t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,r=e._start,o=e._view;return i&&1!==t?(o||(o=e._view={}),r||(r=e._start={}),n(r,o,i,t),e):(e._view=i,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return o.isNumber(this._model.x)&&o.isNumber(this._model.y)}}),a.extend=o.inherits,e.exports=a},{3:3,45:45}],27:[function(t,e,i){"use strict";var n=t(3),r=t(25),o=t(45);e.exports=function(t){function e(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function i(t){return void 0!==t&&null!==t&&"none"!==t}function a(t,n,r){var o=document.defaultView,a=t.parentNode,s=o.getComputedStyle(t)[n],l=o.getComputedStyle(a)[n],c=i(s),h=i(l),u=Number.POSITIVE_INFINITY;return c||h?Math.min(c?e(s,t,r):u,h?e(l,a,r):u):"none"}o.extend=function(t){for(var e=1,i=arguments.length;e<i;e++)o.each(arguments[e],function(e,i){t[i]=e});return t},o.configMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,i,n,r){var a=i[e]||{},s=n[e];"scales"===e?i[e]=o.scaleMerge(a,s):"scale"===e?i[e]=o.merge(a,[t.scaleService.getScaleDefaults(s.type),s]):o._merger(e,i,n,r)}})},o.scaleMerge=function(){return o.merge(o.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,i,n,r){if("xAxes"===e||"yAxes"===e){var a,s,l,c=n[e].length;for(i[e]||(i[e]=[]),a=0;a<c;++a)l=n[e][a],s=o.valueOrDefault(l.type,"xAxes"===e?"category":"linear"),a>=i[e].length&&i[e].push({}),!i[e][a].type||l.type&&l.type!==i[e][a].type?o.merge(i[e][a],[t.scaleService.getScaleDefaults(s),l]):o.merge(i[e][a],l)}else o._merger(e,i,n,r)}})},o.where=function(t,e){if(o.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return o.each(t,function(t){e(t)&&i.push(t)}),i},o.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 n=0,r=t.length;n<r;++n)if(e.call(i,t[n],n,t))return n;return-1},o.findNextWhere=function(t,e,i){o.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var r=t[n];if(e(r))return r}},o.findPreviousWhere=function(t,e,i){o.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var r=t[n];if(e(r))return r}},o.inherits=function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=o.inherits,t&&o.extend(i.prototype,t),i.__super__=e.prototype,i},o.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o.almostEquals=function(t,e,i){return Math.abs(t-e)<i},o.almostWhole=function(t,e){var i=Math.round(t);return i-e<t&&i+e>t},o.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},o.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},o.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},o.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},o.toRadians=function(t){return t*(Math.PI/180)},o.toDegrees=function(t){return t*(180/Math.PI)},o.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,r=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:r}},o.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},o.aliasPixel=function(t){return t%2==0?0:.5},o.splineCurve=function(t,e,i,n){var r=t.skip?e:t,o=e,a=i.skip?e:i,s=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),l=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),c=s/(s+l),h=l/(s+l),u=n*(c=isNaN(c)?0:c),d=n*(h=isNaN(h)?0:h);return{previous:{x:o.x-u*(a.x-r.x),y:o.y-u*(a.y-r.y)},next:{x:o.x+d*(a.x-r.x),y:o.y+d*(a.y-r.y)}}},o.EPSILON=Number.EPSILON||1e-14,o.splineCurveMonotone=function(t){var e,i,n,r,a=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=a.length;for(e=0;e<s;++e)if(!(n=a[e]).model.skip){if(i=e>0?a[e-1]:null,(r=e<s-1?a[e+1]:null)&&!r.model.skip){var l=r.model.x-n.model.x;n.deltaK=0!==l?(r.model.y-n.model.y)/l:0}!i||i.model.skip?n.mK=n.deltaK:!r||r.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}var c,h,u,d;for(e=0;e<s-1;++e)n=a[e],r=a[e+1],n.model.skip||r.model.skip||(o.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=r.mK=0:(c=n.mK/n.deltaK,h=r.mK/n.deltaK,(d=Math.pow(c,2)+Math.pow(h,2))<=9||(u=3/Math.sqrt(d),n.mK=c*u*n.deltaK,r.mK=h*u*n.deltaK)));var f;for(e=0;e<s;++e)(n=a[e]).model.skip||(i=e>0?a[e-1]:null,r=e<s-1?a[e+1]:null,i&&!i.model.skip&&(f=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-f,n.model.controlPointPreviousY=n.model.y-f*n.mK),r&&!r.model.skip&&(f=(r.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+f,n.model.controlPointNextY=n.model.y+f*n.mK))},o.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},o.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},o.niceNum=function(t,e){var i=Math.floor(o.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},o.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},o.getRelativePosition=function(t,e){var i,n,r=t.originalEvent||t,a=t.currentTarget||t.srcElement,s=a.getBoundingClientRect(),l=r.touches;l&&l.length>0?(i=l[0].clientX,n=l[0].clientY):(i=r.clientX,n=r.clientY);var c=parseFloat(o.getStyle(a,"padding-left")),h=parseFloat(o.getStyle(a,"padding-top")),u=parseFloat(o.getStyle(a,"padding-right")),d=parseFloat(o.getStyle(a,"padding-bottom")),f=s.right-s.left-c-u,p=s.bottom-s.top-h-d;return i=Math.round((i-s.left-c)/f*a.width/e.currentDevicePixelRatio),n=Math.round((n-s.top-h)/p*a.height/e.currentDevicePixelRatio),{x:i,y:n}},o.getConstraintWidth=function(t){return a(t,"max-width","clientWidth")},o.getConstraintHeight=function(t){return a(t,"max-height","clientHeight")},o.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var i=parseInt(o.getStyle(e,"padding-left"),10),n=parseInt(o.getStyle(e,"padding-right"),10),r=e.clientWidth-i-n,a=o.getConstraintWidth(t);return isNaN(a)?r:Math.min(r,a)},o.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var i=parseInt(o.getStyle(e,"padding-top"),10),n=parseInt(o.getStyle(e,"padding-bottom"),10),r=e.clientHeight-i-n,a=o.getConstraintHeight(t);return isNaN(a)?r:Math.min(r,a)},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t,e){var i=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==i){var n=t.canvas,r=t.height,o=t.width;n.height=r*i,n.width=o*i,t.ctx.scale(i,i),n.style.height=r+"px",n.style.width=o+"px"}},o.fontString=function(t,e,i){return e+" "+t+"px "+i},o.longestText=function(t,e,i,n){var r=(n=n||{}).data=n.data||{},a=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(r=n.data={},a=n.garbageCollect=[],n.font=e),t.font=e;var s=0;o.each(i,function(e){void 0!==e&&null!==e&&!0!==o.isArray(e)?s=o.measureText(t,r,a,s,e):o.isArray(e)&&o.each(e,function(e){void 0===e||null===e||o.isArray(e)||(s=o.measureText(t,r,a,s,e))})});var l=a.length/2;if(l>i.length){for(var c=0;c<l;c++)delete r[a[c]];a.splice(0,l)}return s},o.measureText=function(t,e,i,n,r){var o=e[r];return o||(o=e[r]=t.measureText(r).width,i.push(r)),o>n&&(n=o),n},o.numberOfLabelLines=function(t){var e=1;return o.each(t,function(t){o.isArray(t)&&t.length>e&&(e=t.length)}),e},o.color=n?function(t){return t instanceof CanvasGradient&&(t=r.global.defaultColor),n(t)}:function(t){return console.error("Color.js not found!"),t},o.getHoverColor=function(t){return t instanceof CanvasPattern?t:o.color(t).saturate(.5).darken(.1).rgbString()}}},{25:25,3:3,45:45}],28:[function(t,e,i){"use strict";function n(t,e){return t.native?{x:t.x,y:t.y}:c.getRelativePosition(t,e)}function r(t,e){var i,n,r,o,a;for(n=0,o=t.data.datasets.length;n<o;++n)if(t.isDatasetVisible(n))for(r=0,a=(i=t.getDatasetMeta(n)).data.length;r<a;++r){var s=i.data[r];s._view.skip||e(s)}}function o(t,e){var i=[];return r(t,function(t){t.inRange(e.x,e.y)&&i.push(t)}),i}function a(t,e,i,n){var o=Number.POSITIVE_INFINITY,a=[];return r(t,function(t){if(!i||t.inRange(e.x,e.y)){var r=t.getCenterPoint(),s=n(e,r);s<o?(a=[t],o=s):s===o&&a.push(t)}}),a}function s(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var r=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function l(t,e,i){var r=n(e,t);i.axis=i.axis||"x";var l=s(i.axis),c=i.intersect?o(t,r):a(t,r,!1,l),h=[];return c.length?(t.data.datasets.forEach(function(e,i){if(t.isDatasetVisible(i)){var n=t.getDatasetMeta(i).data[c[0]._index];n&&!n._view.skip&&h.push(n)}}),h):[]}var c=t(45);e.exports={modes:{single:function(t,e){var i=n(e,t),o=[];return r(t,function(t){if(t.inRange(i.x,i.y))return o.push(t),o}),o.slice(0,1)},label:l,index:l,dataset:function(t,e,i){var r=n(e,t);i.axis=i.axis||"xy";var l=s(i.axis),c=i.intersect?o(t,r):a(t,r,!1,l);return c.length>0&&(c=t.getDatasetMeta(c[0]._datasetIndex).data),c},"x-axis":function(t,e){return l(t,e,{intersect:!0})},point:function(t,e){return o(t,n(e,t))},nearest:function(t,e,i){var r=n(e,t);i.axis=i.axis||"xy";var o=s(i.axis),l=a(t,r,i.intersect,o);return l.length>1&&l.sort(function(t,e){var i=t.getArea()-e.getArea();return 0===i&&(i=t._datasetIndex-e._datasetIndex),i}),l.slice(0,1)},x:function(t,e,i){var o=n(e,t),a=[],s=!1;return r(t,function(t){t.inXRange(o.x)&&a.push(t),t.inRange(o.x,o.y)&&(s=!0)}),i.intersect&&!s&&(a=[]),a},y:function(t,e,i){var o=n(e,t),a=[],s=!1;return r(t,function(t){t.inYRange(o.y)&&a.push(t),t.inRange(o.x,o.y)&&(s=!0)}),i.intersect&&!s&&(a=[]),a}}}},{45:45}],29:[function(t,e,i){"use strict";t(25)._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}},{25:25}],30:[function(t,e,i){"use strict";var n=t(45);e.exports=function(t){function e(t,e){return n.where(t,function(t){return t.position===e})}function i(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,i){var n=e?i:t,r=e?t:i;return n.weight===r.weight?n._tmpIndex_-r._tmpIndex_:n.weight-r.weight}),t.forEach(function(t){delete t._tmpIndex_})}t.layoutService={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 n,r=["fullWidth","position","weight"],o=r.length,a=0;a<o;++a)n=r[a],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,r,o){function a(t){var e=n.findNextWhere(T,function(e){return e.box===t});if(e)if(t.isHorizontal()){var i={left:Math.max(P,A),right:Math.max(L,D),top:0,bottom:0};t.update(t.fullWidth?b:C,x/2,i)}else t.update(e.minSize.width,k)}function s(t){t.isHorizontal()?(t.left=t.fullWidth?h:P,t.right=t.fullWidth?r-u:P+C,t.top=$,t.bottom=$+t.height,$=t.bottom):(t.left=H,t.right=H+t.width,t.top=I,t.bottom=I+k,H=t.right)}if(t){var l=t.options.layout||{},c=n.options.toPadding(l.padding),h=c.left,u=c.right,d=c.top,f=c.bottom,p=e(t.boxes,"left"),g=e(t.boxes,"right"),m=e(t.boxes,"top"),v=e(t.boxes,"bottom"),y=e(t.boxes,"chartArea");i(p,!0),i(g,!1),i(m,!0),i(v,!1);var b=r-h-u,x=o-d-f,_=x/2,w=(r-b/2)/(p.length+g.length),S=(o-_)/(m.length+v.length),C=b,k=x,T=[];n.each(p.concat(g,m,v),function(t){var e,i=t.isHorizontal();i?(e=t.update(t.fullWidth?b:C,S),k-=e.height):(e=t.update(w,_),C-=e.width),T.push({horizontal:i,minSize:e,box:t})});var A=0,D=0,M=0,E=0;n.each(m.concat(v),function(t){if(t.getPadding){var e=t.getPadding();A=Math.max(A,e.left),D=Math.max(D,e.right)}}),n.each(p.concat(g),function(t){if(t.getPadding){var e=t.getPadding();M=Math.max(M,e.top),E=Math.max(E,e.bottom)}});var P=h,L=u,I=d,O=f;n.each(p.concat(g),a),n.each(p,function(t){P+=t.width}),n.each(g,function(t){L+=t.width}),n.each(m.concat(v),a),n.each(m,function(t){I+=t.height}),n.each(v,function(t){O+=t.height}),n.each(p.concat(g),function(t){var e=n.findNextWhere(T,function(e){return e.box===t}),i={left:0,right:0,top:I,bottom:O};e&&t.update(e.minSize.width,k,i)}),P=h,L=u,I=d,O=f,n.each(p,function(t){P+=t.width}),n.each(g,function(t){L+=t.width}),n.each(m,function(t){I+=t.height}),n.each(v,function(t){O+=t.height});var R=Math.max(A-P,0);P+=R,L+=Math.max(D-L,0);var N=Math.max(M-I,0);I+=N,O+=Math.max(E-O,0);var F=o-I-O,z=r-P-L;z===C&&F===k||(n.each(p,function(t){t.height=F}),n.each(g,function(t){t.height=F}),n.each(m,function(t){t.fullWidth||(t.width=z)}),n.each(v,function(t){t.fullWidth||(t.width=z)}),k=F,C=z);var H=h+R,$=d+N;n.each(p.concat(m),s),H+=C,$+=k,n.each(g,s),n.each(v,s),t.chartArea={left:P,top:I,right:P+C,bottom:I+k},n.each(y,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(C,k)})}}}}},{45:45}],31:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45);n._set("global",{plugins:{}}),e.exports=function(t){t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,r,o,a,s,l=this.descriptors(t),c=l.length;for(n=0;n<c;++n)if(r=l[n],o=r.plugin,"function"==typeof(s=o[e])&&((a=[t].concat(i||[])).push(r.options),!1===s.apply(o,a)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],r=[],a=t&&t.config||{},s=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach(function(t){if(-1===i.indexOf(t)){var e=t.id,a=s[e];!1!==a&&(!0===a&&(a=o.clone(n.global.plugins[e])),i.push(t),r.push({plugin:t,options:a||{}}))}}),e.descriptors=r,e.id=this._cacheId,r}},t.pluginService=t.plugins,t.PluginBase=r.extend({})}},{25:25,26:26,45:45}],32:[function(t,e,i){"use strict";function n(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(t[e].label);return n}function r(t,e,i){var n=t.getPixelForTick(e);return i&&(n-=0===e?(t.getPixelForTick(1)-n)/2:(n-t.getPixelForTick(e-1))/2),n}var o=t(25),a=t(26),s=t(45),l=t(34);o._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",lineHeight:1.2,padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:l.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,i){return s.isArray(e)?s.longestText(t,i,e):t.measureText(e).width}function i(t){var e=s.valueOrDefault,i=o.global,n=e(t.fontSize,i.defaultFontSize),r=e(t.fontStyle,i.defaultFontStyle),a=e(t.fontFamily,i.defaultFontFamily);return{size:n,style:r,family:a,font:s.fontString(n,r,a)}}function l(t){return s.options.toLineHeight(s.valueOrDefault(t.lineHeight,1.2),s.valueOrDefault(t.fontSize,o.global.defaultFontSize))}t.Scale=a.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1});for(var e in t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){s.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,r,o,a,l,c,h=this;for(h.beforeUpdate(),h.maxWidth=t,h.maxHeight=e,h.margins=s.extend({left:0,right:0,top:0,bottom:0},i),h.longestTextCache=h.longestTextCache||{},h.beforeSetDimensions(),h.setDimensions(),h.afterSetDimensions(),h.beforeDataLimits(),h.determineDataLimits(),h.afterDataLimits(),h.beforeBuildTicks(),l=h.buildTicks()||[],h.afterBuildTicks(),h.beforeTickToLabelConversion(),o=h.convertTicksToLabels(l)||h.ticks,h.afterTickToLabelConversion(),h.ticks=o,n=0,r=o.length;n<r;++n)a=o[n],(c=l[n])?c.label=a:l.push(c={label:a,major:!1});return h._ticks=l,h.beforeCalculateTickRotation(),h.calculateTickRotation(),h.afterCalculateTickRotation(),h.beforeFit(),h.fit(),h.afterFit(),h.afterUpdate(),h.minSize},afterUpdate:function(){s.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){s.callback(this.options.beforeSetDimensions,[this])},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},afterSetDimensions:function(){s.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){s.callback(this.options.beforeDataLimits,[this])},determineDataLimits:s.noop,afterDataLimits:function(){s.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){s.callback(this.options.beforeBuildTicks,[this])},buildTicks:s.noop,afterBuildTicks:function(){s.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){s.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){s.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){s.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,r=t.options.ticks,o=n(t._ticks),a=i(r);e.font=a.font;var l=r.minRotation||0;if(o.length&&t.options.display&&t.isHorizontal())for(var c,h=s.longestText(e,a.font,o,t.longestTextCache),u=h,d=t.getPixelForTick(1)-t.getPixelForTick(0)-6;u>d&&l<r.maxRotation;){var f=s.toRadians(l);if(c=Math.cos(f),Math.sin(f)*h>t.maxHeight){l--;break}l++,u=c*h}t.labelRotation=l},afterCalculateTickRotation:function(){s.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){s.callback(this.options.beforeFit,[this])},fit:function(){var t=this,r=t.minSize={width:0,height:0},o=n(t._ticks),a=t.options,c=a.ticks,h=a.scaleLabel,u=a.gridLines,d=a.display,f=t.isHorizontal(),p=i(c),g=a.gridLines.tickMarkLength;if(r.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:d&&u.drawTicks?g:0,r.height=f?d&&u.drawTicks?g:0:t.maxHeight,h.display&&d){var m=l(h)+s.options.toPadding(h.padding).height;f?r.height+=m:r.width+=m}if(c.display&&d){var v=s.longestText(t.ctx,p.font,o,t.longestTextCache),y=s.numberOfLabelLines(o),b=.5*p.size,x=t.options.ticks.padding;if(f){t.longestLabelWidth=v;var _=s.toRadians(t.labelRotation),w=Math.cos(_),S=Math.sin(_)*v+p.size*y+b*(y-1)+b;r.height=Math.min(t.maxHeight,r.height+S+x),t.ctx.font=p.font;var C=e(t.ctx,o[0],p.font),k=e(t.ctx,o[o.length-1],p.font);0!==t.labelRotation?(t.paddingLeft="bottom"===a.position?w*C+3:w*b+3,t.paddingRight="bottom"===a.position?w*b+3:w*k+3):(t.paddingLeft=C/2+3,t.paddingRight=k/2+3)}else c.mirror?v=0:v+=x+b,r.width=Math.min(t.maxWidth,r.width+v),t.paddingTop=p.size/2,t.paddingBottom=p.size/2}t.handleMargins(),t.width=r.width,t.height=r.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(){s.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(s.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:s.noop,getPixelForValue:s.noop,getValueForPixel:s.noop,getPixelForTick:function(t){var e=this,i=e.options.offset;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(i?0:1),1),r=n*t+e.paddingLeft;i&&(r+=n/2);var o=e.left+Math.round(r);return o+=e.isFullWidth()?e.margins.left:0}var a=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(a/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,n=e.left+Math.round(i);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,n,r,o=this,a=o.isHorizontal(),l=o.options.ticks.minor,c=t.length,h=s.toRadians(o.labelRotation),u=Math.cos(h),d=o.longestLabelWidth*u,f=[];for(l.maxTicksLimit&&(r=l.maxTicksLimit),a&&(e=!1,(d+l.autoSkipPadding)*c>o.width-(o.paddingLeft+o.paddingRight)&&(e=1+Math.floor((d+l.autoSkipPadding)*c/(o.width-(o.paddingLeft+o.paddingRight)))),r&&c>r&&(e=Math.max(e,Math.floor(c/r)))),i=0;i<c;i++)n=t[i],((e>1&&i%e>0||i%e==0&&i+e>=c)&&i!==c-1||s.isNullOrUndef(n.label))&&delete n.label,f.push(n);return f},draw:function(t){var e=this,n=e.options;if(n.display){var a=e.ctx,c=o.global,h=n.ticks.minor,u=n.ticks.major||h,d=n.gridLines,f=n.scaleLabel,p=0!==e.labelRotation,g=e.isHorizontal(),m=h.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),v=s.valueOrDefault(h.fontColor,c.defaultFontColor),y=i(h),b=s.valueOrDefault(u.fontColor,c.defaultFontColor),x=i(u),_=d.drawTicks?d.tickMarkLength:0,w=s.valueOrDefault(f.fontColor,c.defaultFontColor),S=i(f),C=s.options.toPadding(f.padding),k=s.toRadians(e.labelRotation),T=[],A="right"===n.position?e.left:e.right-_,D="right"===n.position?e.left+_:e.right,M="bottom"===n.position?e.top:e.bottom-_,E="bottom"===n.position?e.top+_:e.bottom;if(s.each(m,function(i,o){if(void 0!==i.label){var a,l,u,f,v=i.label;o===e.zeroLineIndex&&n.offset===d.offsetGridLines?(a=d.zeroLineWidth,l=d.zeroLineColor,u=d.zeroLineBorderDash,f=d.zeroLineBorderDashOffset):(a=s.valueAtIndexOrDefault(d.lineWidth,o),l=s.valueAtIndexOrDefault(d.color,o),u=s.valueOrDefault(d.borderDash,c.borderDash),f=s.valueOrDefault(d.borderDashOffset,c.borderDashOffset));var y,b,x,w,S,C,P,L,I,O,R="middle",N="middle",F=h.padding;if(g){var z=_+F;"bottom"===n.position?(N=p?"middle":"top",R=p?"right":"center",O=e.top+z):(N=p?"middle":"bottom",R=p?"left":"center",O=e.bottom-z);var H=r(e,o,d.offsetGridLines&&m.length>1);H<e.left&&(l="rgba(0,0,0,0)"),H+=s.aliasPixel(a),I=e.getPixelForTick(o)+h.labelOffset,y=x=S=P=H,b=M,w=E,C=t.top,L=t.bottom}else{var $,V="left"===n.position;h.mirror?(R=V?"left":"right",$=F):(R=V?"right":"left",$=_+F),I=V?e.right-$:e.left+$;var B=r(e,o,d.offsetGridLines&&m.length>1);B<e.top&&(l="rgba(0,0,0,0)"),B+=s.aliasPixel(a),O=e.getPixelForTick(o)+h.labelOffset,y=A,x=D,S=t.left,P=t.right,b=w=C=L=B}T.push({tx1:y,ty1:b,tx2:x,ty2:w,x1:S,y1:C,x2:P,y2:L,labelX:I,labelY:O,glWidth:a,glColor:l,glBorderDash:u,glBorderDashOffset:f,rotation:-1*k,label:v,major:i.major,textBaseline:N,textAlign:R})}}),s.each(T,function(t){if(d.display&&(a.save(),a.lineWidth=t.glWidth,a.strokeStyle=t.glColor,a.setLineDash&&(a.setLineDash(t.glBorderDash),a.lineDashOffset=t.glBorderDashOffset),a.beginPath(),d.drawTicks&&(a.moveTo(t.tx1,t.ty1),a.lineTo(t.tx2,t.ty2)),d.drawOnChartArea&&(a.moveTo(t.x1,t.y1),a.lineTo(t.x2,t.y2)),a.stroke(),a.restore()),h.display){a.save(),a.translate(t.labelX,t.labelY),a.rotate(t.rotation),a.font=t.major?x.font:y.font,a.fillStyle=t.major?b:v,a.textBaseline=t.textBaseline,a.textAlign=t.textAlign;var e=t.label;if(s.isArray(e))for(var i=0,n=0;i<e.length;++i)a.fillText(""+e[i],0,n),n+=1.5*y.size;else a.fillText(e,0,0);a.restore()}}),f.display){var P,L,I=0,O=l(f)/2;if(g)P=e.left+(e.right-e.left)/2,L="bottom"===n.position?e.bottom-O-C.bottom:e.top+O+C.top;else{var R="left"===n.position;P=R?e.left+O+C.top:e.right-O-C.top,L=e.top+(e.bottom-e.top)/2,I=R?-.5*Math.PI:.5*Math.PI}a.save(),a.translate(P,L),a.rotate(I),a.textAlign="center",a.textBaseline="middle",a.fillStyle=w,a.font=S.font,a.fillText(f.labelString,0,0),a.restore()}if(d.drawBorder){a.lineWidth=s.valueAtIndexOrDefault(d.lineWidth,0),a.strokeStyle=s.valueAtIndexOrDefault(d.color,0);var N=e.left,F=e.right,z=e.top,H=e.bottom,$=s.aliasPixel(a.lineWidth);g?(z=H="top"===n.position?e.bottom:e.top,z+=$,H+=$):(N=F="left"===n.position?e.right:e.left,N+=$,F+=$),a.beginPath(),a.moveTo(N,z),a.lineTo(F,H),a.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,i){"use strict";var n=t(25),r=t(45);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=r.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?r.merge({},[n.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var i=this;i.defaults.hasOwnProperty(t)&&(i.defaults[t]=r.extend(i.defaults[t],e))},addScalesToLayout:function(e){r.each(e.scales,function(i){i.fullWidth=i.options.fullWidth,i.position=i.options.position,i.weight=i.options.weight,t.layoutService.addBox(e,i)})}}}},{25:25,45:45}],34:[function(t,e,i){"use strict";var n=t(45);e.exports={generators:{linear:function(t,e){var i,r=[];if(t.stepSize&&t.stepSize>0)i=t.stepSize;else{var o=n.niceNum(e.max-e.min,!1);i=n.niceNum(o/(t.maxTicks-1),!0)}var a=Math.floor(e.min/i)*i,s=Math.ceil(e.max/i)*i;t.min&&t.max&&t.stepSize&&n.almostWhole((t.max-t.min)/t.stepSize,i/1e3)&&(a=t.min,s=t.max);var l=(s-a)/i;l=n.almostEquals(l,Math.round(l),i/1e3)?Math.round(l):Math.ceil(l),r.push(void 0!==t.min?t.min:a);for(var c=1;c<l;++c)r.push(a+c*i);return r.push(void 0!==t.max?t.max:s),r},logarithmic:function(t,e){var i,r,o=[],a=n.valueOrDefault,s=a(t.min,Math.pow(10,Math.floor(n.log10(e.min)))),l=Math.floor(n.log10(e.max)),c=Math.ceil(e.max/Math.pow(10,l));0===s?(i=Math.floor(n.log10(e.minNotZero)),r=Math.floor(e.minNotZero/Math.pow(10,i)),o.push(s),s=r*Math.pow(10,i)):(i=Math.floor(n.log10(s)),r=Math.floor(s/Math.pow(10,i)));do{o.push(s),10===++r&&(r=1,++i),s=r*Math.pow(10,i)}while(i<l||i===l&&r<c);var h=a(t.max,s);return o.push(h),o}},formatters:{values:function(t){return n.isArray(t)?t:""+t},linear:function(t,e,i){var r=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(r)>1&&t!==Math.floor(t)&&(r=t-Math.floor(t));var o=n.log10(Math.abs(r)),a="";if(0!==t){var s=-1*Math.floor(o);s=Math.max(Math.min(s,20),0),a=t.toFixed(s)}else a="0";return a},logarithmic:function(t,e,i){var r=t/Math.pow(10,Math.floor(n.log10(t)));return 0===t?"0":1===r||2===r||5===r||0===e||e===i.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45);n._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:o.noop,title:function(t,e){var i="",n=e.labels,r=n?n.length:0;if(t.length>0){var o=t[0];o.xLabel?i=o.xLabel:r>0&&o.index<r&&(i=n[o.index])}return i},afterTitle:o.noop,beforeBody:o.noop,beforeLabel:o.noop,label:function(t,e){var i=e.datasets[t.datasetIndex].label||"";return i&&(i+=": "),i+=t.yLabel},labelColor:function(t,e){var i=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:i.borderColor,backgroundColor:i.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:o.noop,afterBody:o.noop,beforeFooter:o.noop,footer:o.noop,afterFooter:o.noop}}}),e.exports=function(t){function e(t,e){var i=o.color(t);return i.alpha(e*i.alpha()).rgbaString()}function i(t,e){return e&&(o.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function a(t){var e=t._xScale,i=t._yScale||t._scale,n=t._index,r=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(n,r):"",yLabel:i?i.getLabelForIndex(n,r):"",index:n,datasetIndex:r,x:t._model.x,y:t._model.y}}function s(t){var e=n.global,i=o.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,n=2*e.yPadding,r=0,a=e.body,s=a.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);s+=e.beforeBody.length+e.afterBody.length;var l=e.title.length,c=e.footer.length,h=e.titleFontSize,u=e.bodyFontSize,d=e.footerFontSize;n+=l*h,n+=l?(l-1)*e.titleSpacing:0,n+=l?e.titleMarginBottom:0,n+=s*u,n+=s?(s-1)*e.bodySpacing:0,n+=c?e.footerMarginTop:0,n+=c*d,n+=c?(c-1)*e.footerSpacing:0;var f=0,p=function(t){r=Math.max(r,i.measureText(t).width+f)};return i.font=o.fontString(h,e._titleFontStyle,e._titleFontFamily),o.each(e.title,p),i.font=o.fontString(u,e._bodyFontStyle,e._bodyFontFamily),o.each(e.beforeBody.concat(e.afterBody),p),f=e.displayColors?u+2:0,o.each(a,function(t){o.each(t.before,p),o.each(t.lines,p),o.each(t.after,p)}),f=0,i.font=o.fontString(d,e._footerFontStyle,e._footerFontFamily),o.each(e.footer,p),r+=2*e.xPadding,{width:r,height:n}}function c(t,e){var i=t._model,n=t._chart,r=t._chart.chartArea,o="center",a="center";i.y<e.height?a="top":i.y>n.height-e.height&&(a="bottom");var s,l,c,h,u,d=(r.left+r.right)/2,f=(r.top+r.bottom)/2;"center"===a?(s=function(t){return t<=d},l=function(t){return t>d}):(s=function(t){return t<=e.width/2},l=function(t){return t>=n.width-e.width/2}),c=function(t){return t+e.width>n.width},h=function(t){return t-e.width<0},u=function(t){return t<=f?"top":"bottom"},s(i.x)?(o="left",c(i.x)&&(o="center",a=u(i.y))):l(i.x)&&(o="right",h(i.x)&&(o="center",a=u(i.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:o,yAlign:p.yAlign?p.yAlign:a}}function h(t,e,i){var n=t.x,r=t.y,o=t.caretSize,a=t.caretPadding,s=t.cornerRadius,l=i.xAlign,c=i.yAlign,h=o+a,u=s+a;return"right"===l?n-=e.width:"center"===l&&(n-=e.width/2),"top"===c?r+=h:r-="bottom"===c?e.height+h:e.height/2,"center"===c?"left"===l?n+=h:"right"===l&&(n-=h):"left"===l?n-=u:"right"===l&&(n+=u),{x:n,y:r}}t.Tooltip=r.extend({initialize:function(){this._model=s(this._options)},getTitle:function(){var t=this,e=t._options.callbacks,n=e.beforeTitle.apply(t,arguments),r=e.title.apply(t,arguments),o=e.afterTitle.apply(t,arguments),a=[];return a=i(a,n),a=i(a,r),a=i(a,o)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var n=this,r=n._options.callbacks,a=[];return o.each(t,function(t){var o={before:[],lines:[],after:[]};i(o.before,r.beforeLabel.call(n,t,e)),i(o.lines,r.label.call(n,t,e)),i(o.after,r.afterLabel.call(n,t,e)),a.push(o)}),a},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return o.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),r=e.footer.apply(t,arguments),o=e.afterFooter.apply(t,arguments),a=[];return a=i(a,n),a=i(a,r),a=i(a,o)},update:function(e){var i,n,r=this,u=r._options,d=r._model,f=r._model=s(u),p=r._active,g=r._data,m={xAlign:d.xAlign,yAlign:d.yAlign},v={x:d.x,y:d.y},y={width:d.width,height:d.height},b={x:d.caretX,y:d.caretY};if(p.length){f.opacity=1;var x=[],_=[];b=t.Tooltip.positioners[u.position](p,r._eventPosition);var w=[];for(i=0,n=p.length;i<n;++i)w.push(a(p[i]));u.filter&&(w=w.filter(function(t){return u.filter(t,g)})),u.itemSort&&(w=w.sort(function(t,e){return u.itemSort(t,e,g)})),o.each(w,function(t){x.push(u.callbacks.labelColor.call(r,t,r._chart)),_.push(u.callbacks.labelTextColor.call(r,t,r._chart))}),f.title=r.getTitle(w,g),f.beforeBody=r.getBeforeBody(w,g),f.body=r.getBody(w,g),f.afterBody=r.getAfterBody(w,g),f.footer=r.getFooter(w,g),f.x=Math.round(b.x),f.y=Math.round(b.y),f.caretPadding=u.caretPadding,f.labelColors=x,f.labelTextColors=_,f.dataPoints=w,v=h(f,y=l(this,f),m=c(this,y))}else f.opacity=0;return f.xAlign=m.xAlign,f.yAlign=m.yAlign,f.x=v.x,f.y=v.y,f.width=y.width,f.height=y.height,f.caretX=b.x,f.caretY=b.y,r._model=f,e&&u.custom&&u.custom.call(r,f),r},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,r=this.getCaretPosition(t,e,n);i.lineTo(r.x1,r.y1),i.lineTo(r.x2,r.y2),i.lineTo(r.x3,r.y3)},getCaretPosition:function(t,e,i){var n,r,o,a,s,l,c=i.caretSize,h=i.cornerRadius,u=i.xAlign,d=i.yAlign,f=t.x,p=t.y,g=e.width,m=e.height;if("center"===d)s=p+m/2,"left"===u?(r=(n=f)-c,o=n,a=s+c,l=s-c):(r=(n=f+g)+c,o=n,a=s-c,l=s+c);else if("left"===u?(n=(r=f+h+c)-c,o=r+c):"right"===u?(n=(r=f+g-h-c)-c,o=r+c):(n=(r=f+g/2)-c,o=r+c),"top"===d)s=(a=p)-c,l=a;else{s=(a=p+m)+c,l=a;var v=o;o=n,n=v}return{x1:n,x2:r,x3:o,y1:a,y2:s,y3:l}},drawTitle:function(t,i,n,r){var a=i.title;if(a.length){n.textAlign=i._titleAlign,n.textBaseline="top";var s=i.titleFontSize,l=i.titleSpacing;n.fillStyle=e(i.titleFontColor,r),n.font=o.fontString(s,i._titleFontStyle,i._titleFontFamily);var c,h;for(c=0,h=a.length;c<h;++c)n.fillText(a[c],t.x,t.y),t.y+=s+l,c+1===a.length&&(t.y+=i.titleMarginBottom-l)}},drawBody:function(t,i,n,r){var a=i.bodyFontSize,s=i.bodySpacing,l=i.body;n.textAlign=i._bodyAlign,n.textBaseline="top",n.font=o.fontString(a,i._bodyFontStyle,i._bodyFontFamily);var c=0,h=function(e){n.fillText(e,t.x+c,t.y),t.y+=a+s};o.each(i.beforeBody,h);var u=i.displayColors;c=u?a+2:0,o.each(l,function(s,l){o.each(s.before,h),o.each(s.lines,function(o){if(u){n.fillStyle=e(i.legendColorBackground,r),n.fillRect(t.x,t.y,a,a),n.lineWidth=1,n.strokeStyle=e(i.labelColors[l].borderColor,r),n.strokeRect(t.x,t.y,a,a),n.fillStyle=e(i.labelColors[l].backgroundColor,r),n.fillRect(t.x+1,t.y+1,a-2,a-2);var s=e(i.labelTextColors[l],r);n.fillStyle=s}h(o)}),o.each(s.after,h)}),c=0,o.each(i.afterBody,h),t.y-=s},drawFooter:function(t,i,n,r){var a=i.footer;a.length&&(t.y+=i.footerMarginTop,n.textAlign=i._footerAlign,n.textBaseline="top",n.fillStyle=e(i.footerFontColor,r),n.font=o.fontString(i.footerFontSize,i._footerFontStyle,i._footerFontFamily),o.each(a,function(e){n.fillText(e,t.x,t.y),t.y+=i.footerFontSize+i.footerSpacing}))},drawBackground:function(t,i,n,r,o){n.fillStyle=e(i.backgroundColor,o),n.strokeStyle=e(i.borderColor,o),n.lineWidth=i.borderWidth;var a=i.xAlign,s=i.yAlign,l=t.x,c=t.y,h=r.width,u=r.height,d=i.cornerRadius;n.beginPath(),n.moveTo(l+d,c),"top"===s&&this.drawCaret(t,r),n.lineTo(l+h-d,c),n.quadraticCurveTo(l+h,c,l+h,c+d),"center"===s&&"right"===a&&this.drawCaret(t,r),n.lineTo(l+h,c+u-d),n.quadraticCurveTo(l+h,c+u,l+h-d,c+u),"bottom"===s&&this.drawCaret(t,r),n.lineTo(l+d,c+u),n.quadraticCurveTo(l,c+u,l,c+u-d),"center"===s&&"left"===a&&this.drawCaret(t,r),n.lineTo(l,c+d),n.quadraticCurveTo(l,c,l+d,c),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},n={x:e.x,y:e.y},r=Math.abs(e.opacity<.001)?0:e.opacity,o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(this.drawBackground(n,e,t,i,r),n.x+=e.xPadding,n.y+=e.yPadding,this.drawTitle(n,e,t,r),this.drawBody(n,e,t,r),this.drawFooter(n,e,t,r))}},handleEvent:function(t){var e=this,i=e._options,n=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,i.mode,i),!(n=!o.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,i.enabled||i.custom){e._eventPosition={x:t.x,y:t.y};var r=e._model;e.update(!0),e.pivot(),n|=r.x!==e._model.x||r.y!==e._model.y}return n}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,i,n=0,r=0,o=0;for(e=0,i=t.length;e<i;++e){var a=t[e];if(a&&a.hasValue()){var s=a.tooltipPosition();n+=s.x,r+=s.y,++o}}return{x:Math.round(n/o),y:Math.round(r/o)}},nearest:function(t,e){var i,n,r,a=e.x,s=e.y,l=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var c=t[i];if(c&&c.hasValue()){var h=c.getCenterPoint(),u=o.distanceBetweenPoints(e,h);u<l&&(l=u,r=c)}}if(r){var d=r.tooltipPosition();a=d.x,s=d.y}return{x:a,y:s}}}}},{25:25,26:26,45:45}],36:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45);n._set("global",{elements:{arc:{backgroundColor:n.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=r.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var i=this._view;if(i){for(var n=o.getAngleFromPoint(i,{x:t,y:e}),r=n.angle,a=n.distance,s=i.startAngle,l=i.endAngle;l<s;)l+=2*Math.PI;for(;r>l;)r-=2*Math.PI;for(;r<s;)r+=2*Math.PI;var c=r>=s&&r<=l,h=a>=i.innerRadius&&a<=i.outerRadius;return c&&h}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,n=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,i,n),t.arc(e.x,e.y,e.innerRadius,n,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()}})},{25:25,26:26,45:45}],37:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45),a=n.global;n._set("global",{elements:{line:{tension:.4,backgroundColor:a.defaultColor,borderWidth:3,borderColor:a.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=r.extend({draw:function(){var t,e,i,n,r=this,s=r._view,l=r._chart.ctx,c=s.spanGaps,h=r._children.slice(),u=a.elements.line,d=-1;for(r._loop&&h.length&&h.push(h[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||a.defaultColor,l.beginPath(),d=-1,t=0;t<h.length;++t)e=h[t],i=o.previousItem(h,t),n=e._view,0===t?n.skip||(l.moveTo(n.x,n.y),d=t):(i=-1===d?i:h[d],n.skip||(d!==t-1&&!c||-1===d?l.moveTo(n.x,n.y):o.canvas.lineTo(l,i._view,e._view),d=t));l.stroke(),l.restore()}})},{25:25,26:26,45:45}],38:[function(t,e,i){"use strict";function n(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hitRadius,2)}var r=t(25),o=t(26),a=t(45),s=r.global.defaultColor;r._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:s,borderColor:s,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=o.extend({inRange:function(t,e){var i=this._view;return!!i&&Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:n,inXRange:n,inYRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.y,2)<Math.pow(e.radius+e.hitRadius,2)},getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,i=this._model,n=this._chart.ctx,o=e.pointStyle,l=e.radius,c=e.x,h=e.y,u=a.color,d=0;e.skip||(n.strokeStyle=e.borderColor||s,n.lineWidth=a.valueOrDefault(e.borderWidth,r.global.elements.point.borderWidth),n.fillStyle=e.backgroundColor||s,void 0!==t&&(i.x<t.left||1.01*t.right<i.x||i.y<t.top||1.01*t.bottom<i.y)&&(i.x<t.left?d=(c-i.x)/(t.left-i.x):1.01*t.right<i.x?d=(i.x-c)/(i.x-t.right):i.y<t.top?d=(h-i.y)/(t.top-i.y):1.01*t.bottom<i.y&&(d=(i.y-h)/(i.y-t.bottom)),d=Math.round(100*d)/100,n.strokeStyle=u(n.strokeStyle).alpha(d).rgbString(),n.fillStyle=u(n.fillStyle).alpha(d).rgbString()),a.canvas.drawPoint(n,o,l,c,h))}})},{25:25,26:26,45:45}],39:[function(t,e,i){"use strict";function n(t){return void 0!==t._view.width}function r(t){var e,i,r,o,a=t._view;if(n(t)){var s=a.width/2;e=a.x-s,i=a.x+s,r=Math.min(a.y,a.base),o=Math.max(a.y,a.base)}else{var l=a.height/2;e=Math.min(a.x,a.base),i=Math.max(a.x,a.base),r=a.y-l,o=a.y+l}return{left:e,top:r,right:i,bottom:o}}var o=t(25),a=t(26);o._set("global",{elements:{rectangle:{backgroundColor:o.global.defaultColor,borderColor:o.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=a.extend({draw:function(){function t(t){return v[(y+t)%4]}var e,i,n,r,o,a,s,l=this._chart.ctx,c=this._view,h=c.borderWidth;if(c.horizontal?(e=c.base,i=c.x,n=c.y-c.height/2,r=c.y+c.height/2,o=i>e?1:-1,a=1,s=c.borderSkipped||"left"):(e=c.x-c.width/2,i=c.x+c.width/2,n=c.y,o=1,a=(r=c.base)>n?1:-1,s=c.borderSkipped||"bottom"),h){var u=Math.min(Math.abs(e-i),Math.abs(n-r)),d=(h=h>u?u:h)/2,f=e+("left"!==s?d*o:0),p=i+("right"!==s?-d*o:0),g=n+("top"!==s?d*a:0),m=r+("bottom"!==s?-d*a:0);f!==p&&(n=g,r=m),g!==m&&(e=f,i=p)}l.beginPath(),l.fillStyle=c.backgroundColor,l.strokeStyle=c.borderColor,l.lineWidth=h;var v=[[e,r],[e,n],[i,n],[i,r]],y=["bottom","left","top","right"].indexOf(s,0);-1===y&&(y=0);var b=t(0);l.moveTo(b[0],b[1]);for(var x=1;x<4;x++)b=t(x),l.lineTo(b[0],b[1]);l.fill(),h&&l.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=!1;if(this._view){var n=r(this);i=t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}return i},inLabelRange:function(t,e){var i=this;if(!i._view)return!1;var o=r(i);return n(i)?t>=o.left&&t<=o.right:e>=o.top&&e<=o.bottom},inXRange:function(t){var e=r(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=r(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,i=this._view;return n(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}}})},{25:25,26:26}],40:[function(t,e,i){"use strict";e.exports={},e.exports.Arc=t(36),e.exports.Line=t(37),e.exports.Point=t(38),e.exports.Rectangle=t(39)},{36:36,37:37,38:38,39:39}],41:[function(t,e,i){"use strict";var n=t(42),i=e.exports={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,n,r,o){if(o){var a=Math.min(o,n/2),s=Math.min(o,r/2);t.moveTo(e+a,i),t.lineTo(e+n-a,i),t.quadraticCurveTo(e+n,i,e+n,i+s),t.lineTo(e+n,i+r-s),t.quadraticCurveTo(e+n,i+r,e+n-a,i+r),t.lineTo(e+a,i+r),t.quadraticCurveTo(e,i+r,e,i+r-s),t.lineTo(e,i+s),t.quadraticCurveTo(e,i,e+a,i)}else t.rect(e,i,n,r)},drawPoint:function(t,e,i,n,r){var o,a,s,l,c,h;if("object"!=typeof e||"[object HTMLImageElement]"!==(o=e.toString())&&"[object HTMLCanvasElement]"!==o){if(!(isNaN(i)||i<=0)){switch(e){default:t.beginPath(),t.arc(n,r,i,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),c=(a=3*i/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(n-a/2,r+c/3),t.lineTo(n+a/2,r+c/3),t.lineTo(n,r-2*c/3),t.closePath(),t.fill();break;case"rect":h=1/Math.SQRT2*i,t.beginPath(),t.fillRect(n-h,r-h,2*h,2*h),t.strokeRect(n-h,r-h,2*h,2*h);break;case"rectRounded":var u=i/Math.SQRT2,d=n-u,f=r-u,p=Math.SQRT2*i;t.beginPath(),this.roundedRect(t,d,f,p,p,i/2),t.closePath(),t.fill();break;case"rectRot":h=1/Math.SQRT2*i,t.beginPath(),t.moveTo(n-h,r),t.lineTo(n,r+h),t.lineTo(n+h,r),t.lineTo(n,r-h),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(n,r+i),t.lineTo(n,r-i),t.moveTo(n-i,r),t.lineTo(n+i,r),t.closePath();break;case"crossRot":t.beginPath(),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,r-l),t.lineTo(n+s,r+l),t.moveTo(n-s,r+l),t.lineTo(n+s,r-l),t.closePath();break;case"star":t.beginPath(),t.moveTo(n,r+i),t.lineTo(n,r-i),t.moveTo(n-i,r),t.lineTo(n+i,r),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,r-l),t.lineTo(n+s,r+l),t.moveTo(n-s,r+l),t.lineTo(n+s,r-l),t.closePath();break;case"line":t.beginPath(),t.moveTo(n-i,r),t.lineTo(n+i,r),t.closePath();break;case"dash":t.beginPath(),t.moveTo(n,r),t.lineTo(n+i,r),t.closePath()}t.stroke()}}else t.drawImage(e,n-e.width/2,r-e.height/2,e.width,e.height)},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,n){if(i.steppedLine)return"after"===i.steppedLine&&!n||"after"!==i.steppedLine&&n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y),void t.lineTo(i.x,i.y);i.tension?t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?i.controlPointNextX:i.controlPointPreviousX,n?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y):t.lineTo(i.x,i.y)}};n.clear=i.clear,n.drawRoundedRectangle=function(t){t.beginPath(),i.roundedRect.apply(i,arguments),t.closePath()}},{42:42}],42:[function(t,e,i){"use strict";var n={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 n.valueOrDefault(n.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,r){var o,a,s;if(n.isArray(t))if(a=t.length,r)for(o=a-1;o>=0;o--)e.call(i,t[o],o);else for(o=0;o<a;o++)e.call(i,t[o],o);else if(n.isObject(t))for(a=(s=Object.keys(t)).length,o=0;o<a;o++)e.call(i,t[s[o]],s[o])},arrayEquals:function(t,e){var i,r,o,a;if(!t||!e||t.length!==e.length)return!1;for(i=0,r=t.length;i<r;++i)if(o=t[i],a=e[i],o instanceof Array&&a instanceof Array){if(!n.arrayEquals(o,a))return!1}else if(o!==a)return!1;return!0},clone:function(t){if(n.isArray(t))return t.map(n.clone);if(n.isObject(t)){for(var e={},i=Object.keys(t),r=i.length,o=0;o<r;++o)e[i[o]]=n.clone(t[i[o]]);return e}return t},_merger:function(t,e,i,r){var o=e[t],a=i[t];n.isObject(o)&&n.isObject(a)?n.merge(o,a,r):e[t]=n.clone(a)},_mergerIf:function(t,e,i){var r=e[t],o=i[t];n.isObject(r)&&n.isObject(o)?n.mergeIf(r,o):e.hasOwnProperty(t)||(e[t]=n.clone(o))},merge:function(t,e,i){var r,o,a,s,l,c=n.isArray(e)?e:[e],h=c.length;if(!n.isObject(t))return t;for(r=(i=i||{}).merger||n._merger,o=0;o<h;++o)if(e=c[o],n.isObject(e))for(l=0,s=(a=Object.keys(e)).length;l<s;++l)r(a[l],t,e,i);return t},mergeIf:function(t,e){return n.merge(t,e,{merger:n._mergerIf})}};e.exports=n,n.callCallback=n.callback,n.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},n.getValueOrDefault=n.valueOrDefault,n.getValueAtIndexOrDefault=n.valueAtIndexOrDefault},{}],43:[function(t,e,i){"use strict";var n=t(42),r={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=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,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*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-r.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*r.easeInBounce(2*t):.5*r.easeOutBounce(2*t-1)+.5}};e.exports={effects:r},n.easingEffects=r},{42:42}],44:[function(t,e,i){"use strict";var n=t(42);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,r,o;return n.isObject(t)?(e=+t.top||0,i=+t.right||0,r=+t.bottom||0,o=+t.left||0):e=i=r=o=+t||0,{top:e,right:i,bottom:r,left:o,height:e+r,width:o+i}},resolve:function(t,e,i){var r,o,a;for(r=0,o=t.length;r<o;++r)if(void 0!==(a=t[r])&&(void 0!==e&&"function"==typeof a&&(a=a(e)),void 0!==i&&n.isArray(a)&&(a=a[i]),void 0!==a))return a}}},{42:42}],45:[function(t,e,i){"use strict";e.exports=t(42),e.exports.easing=t(43),e.exports.canvas=t(41),e.exports.options=t(44)},{41:41,42:42,43:43,44:44}],46:[function(t,e,i){e.exports={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}}},{}],47:[function(t,e,i){"use strict";function n(t,e){var i=m.getStyle(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}function r(t,e){var i=t.style,r=t.getAttribute("height"),o=t.getAttribute("width");if(t[v]={initial:{height:r,width:o,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===o||""===o){var a=n(t,"width");void 0!==a&&(t.width=a)}if(null===r||""===r)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var s=n(t,"height");void 0!==a&&(t.height=s)}return t}function o(t,e,i){t.addEventListener(e,i,S)}function a(t,e,i){t.removeEventListener(e,i,S)}function s(t,e,i,n,r){return{type:t,chart:e,native:r||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function l(t,e){var i=w[t.type]||t.type,n=m.getRelativePosition(t,e);return s(i,e,n.x,n.y,t)}function c(t,e){var i=!1,n=[];return function(){n=Array.prototype.slice.call(arguments),e=e||this,i||(i=!0,m.requestAnimFrame.call(window,function(){i=!1,t.apply(e,n)}))}}function h(t){var e=document.createElement("div"),i=y+"size-monitor",n="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;";e.style.cssText=n,e.className=i,e.innerHTML='<div class="'+i+'-expand" style="'+n+'"><div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div></div><div class="'+i+'-shrink" style="'+n+'"><div style="position:absolute;width:200%;height:200%;left:0; top:0"></div></div>';var r=e.childNodes[0],a=e.childNodes[1];e._reset=function(){r.scrollLeft=1e6,r.scrollTop=1e6,a.scrollLeft=1e6,a.scrollTop=1e6};var s=function(){e._reset(),t()};return o(r,"scroll",s.bind(r,"expand")),o(a,"scroll",s.bind(a,"shrink")),e}function u(t,e){var i=(t[v]||(t[v]={})).renderProxy=function(t){t.animationName===x&&e()};m.each(_,function(e){o(t,e,i)}),t.classList.add(b)}function d(t){var e=t[v]||{},i=e.renderProxy;i&&(m.each(_,function(e){a(t,e,i)}),delete e.renderProxy),t.classList.remove(b)}function f(t,e,i){var n=t[v]||(t[v]={}),r=n.resizer=h(c(function(){if(n.resizer)return e(s("resize",i))}));u(t,function(){if(n.resizer){var e=t.parentNode;e&&e!==r.parentNode&&e.insertBefore(r,e.firstChild),r._reset()}})}function p(t){var e=t[v]||{},i=e.resizer;delete e.resizer,d(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(45),v="$chartjs",y="chartjs-",b=y+"render-monitor",x=y+"render-animation",_=["animationstart","webkitAnimationStart"],w={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},S=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{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+"}."+b+"{-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?(r(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 n=i[t];m.isNullOrUndef(n)?e.removeAttribute(t):e.setAttribute(t,n)}),m.each(i.style||{},function(t,i){e.style[i]=t}),e.width=e.width,delete e[v]}},addEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var r=i[v]||(i[v]={});o(n,e,(r.proxies||(r.proxies={}))[t.id+"_"+e]=function(e){i(l(e,t))})}else f(n,i,t)},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var r=((i[v]||{}).proxies||{})[t.id+"_"+e];r&&a(n,e,r)}else p(n)}},m.addEvent=o,m.removeEvent=a},{45:45}],48:[function(t,e,i){"use strict";var n=t(45),r=t(46),o=t(47),a=o._enabled?o:r;e.exports=n.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},a)},{45:45,46:46,47:47}],49:[function(t,e,i){"use strict";var n=t(25),r=t(40),o=t(45);n._set("global",{plugins:{filler:{propagate:!0}}}),e.exports=function(){function t(t,e,i){var n,r=t._model||{},o=r.fill;if(void 0===o&&(o=!!r.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(n=parseFloat(o,10),isFinite(n)&&Math.floor(n)===n)return"-"!==o[0]&&"+"!==o[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function e(t){var e,i=t.el._model||{},n=t.el._scale||{},r=t.fill,o=null;if(isFinite(r))return null;if("start"===r?o=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===r?o=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?o=i.scaleZero:n.getBasePosition?o=n.getBasePosition():n.getBasePixel&&(o=n.getBasePixel()),void 0!==o&&null!==o){if(void 0!==o.x&&void 0!==o.y)return o;if("number"==typeof o&&isFinite(o))return e=n.isHorizontal(),{x:e?o:null,y:e?null:o}}return null}function i(t,e,i){var n,r=t[e].fill,o=[e];if(!i)return r;for(;!1!==r&&-1===o.indexOf(r);){if(!isFinite(r))return r;if(!(n=t[r]))return!1;if(n.visible)return r;o.push(r),r=n.fill}return!1}function a(t){var e=t.fill,i="dataset";return!1===e?null:(isFinite(e)||(i="boundary"),h[i](t))}function s(t){return t&&!t.skip}function l(t,e,i,n,r){var a;if(n&&r){for(t.moveTo(e[0].x,e[0].y),a=1;a<n;++a)o.canvas.lineTo(t,e[a-1],e[a]);for(t.lineTo(i[r-1].x,i[r-1].y),a=r-1;a>0;--a)o.canvas.lineTo(t,i[a],i[a-1],!0)}}function c(t,e,i,n,r,o){var a,c,h,u,d,f,p,g=e.length,m=n.spanGaps,v=[],y=[],b=0,x=0;for(t.beginPath(),a=0,c=g+!!o;a<c;++a)d=i(u=e[h=a%g]._view,h,n),f=s(u),p=s(d),f&&p?(b=v.push(u),x=y.push(d)):b&&x&&(m?(f&&v.push(u),p&&y.push(d)):(l(t,v,y,b,x),b=x=0,v=[],y=[]));l(t,v,y,b,x),t.closePath(),t.fillStyle=r,t.fill()}var h={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),r=n&&i.isDatasetVisible(e)&&n.dataset._children||[],o=r.length||0;return o?function(t,e){return e<o&&r[e]._view||null}:null},boundary:function(t){var e=t.boundary,i=e?e.x:null,n=e?e.y:null;return function(t){return{x:null===i?t.x:i,y:null===n?t.y:n}}}};return{id:"filler",afterDatasetsUpdate:function(n,o){var s,l,c,h,u=(n.data.datasets||[]).length,d=o.propagate,f=[];for(l=0;l<u;++l)h=null,(c=(s=n.getDatasetMeta(l)).dataset)&&c._model&&c instanceof r.Line&&(h={visible:n.isDatasetVisible(l),fill:t(c,l,u),chart:n,el:c}),s.$filler=h,f.push(h);for(l=0;l<u;++l)(h=f[l])&&(h.fill=i(f,l,d),h.boundary=e(h),h.mapper=a(h))},beforeDatasetDraw:function(t,e){var i=e.meta.$filler;if(i){var r=t.ctx,a=i.el,s=a._view,l=a._children||[],h=i.mapper,u=s.backgroundColor||n.global.defaultColor;h&&u&&l.length&&(o.canvas.clipArea(r,t.chartArea),c(r,l,h,s,u,a._loop),o.canvas.unclipArea(r))}}}}},{25:25,40:40,45:45}],50:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45);n._set("global",{legend:{display:!0,position:"top",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,r=n.getDatasetMeta(i);r.hidden=null===r.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return o.isArray(e.datasets)?e.datasets.map(function(e,i){return{text:e.label,fillStyle:o.isArray(e.backgroundColor)?e.backgroundColor[0]:e.backgroundColor,hidden:!t.isDatasetVisible(i),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,datasetIndex:i}},this):[]}}},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');for(var i=0;i<t.data.datasets.length;i++)e.push('<li><span style="background-color:'+t.data.datasets[i].backgroundColor+'"></span>'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("</li>");return e.push("</ul>"),e.join("")}}),e.exports=function(t){function e(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}function i(e,i){var n=new t.Legend({ctx:e.ctx,options:i,chart:e});a.configure(e,n,i),a.addBox(e,n),e.legend=n}var a=t.layoutService,s=o.noop;return t.Legend=r.extend({initialize:function(t){o.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:s,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:s,beforeSetDimensions:s,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:s,beforeBuildLabels:s,buildLabels:function(){var t=this,e=t.options.labels||{},i=o.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:s,beforeFit:s,fit:function(){var t=this,i=t.options,r=i.labels,a=i.display,s=t.ctx,l=n.global,c=o.valueOrDefault,h=c(r.fontSize,l.defaultFontSize),u=c(r.fontStyle,l.defaultFontStyle),d=c(r.fontFamily,l.defaultFontFamily),f=o.fontString(h,u,d),p=t.legendHitBoxes=[],g=t.minSize,m=t.isHorizontal();if(m?(g.width=t.maxWidth,g.height=a?10:0):(g.width=a?10:0,g.height=t.maxHeight),a)if(s.font=f,m){var v=t.lineWidths=[0],y=t.legendItems.length?h+r.padding:0;s.textAlign="left",s.textBaseline="top",o.each(t.legendItems,function(i,n){var o=e(r,h)+h/2+s.measureText(i.text).width;v[v.length-1]+o+r.padding>=t.width&&(y+=h+r.padding,v[v.length]=t.left),p[n]={left:0,top:0,width:o,height:h},v[v.length-1]+=o+r.padding}),g.height+=y}else{var b=r.padding,x=t.columnWidths=[],_=r.padding,w=0,S=0,C=h+b;o.each(t.legendItems,function(t,i){var n=e(r,h)+h/2+s.measureText(t.text).width;S+C>g.height&&(_+=w+r.padding,x.push(w),w=0,S=0),w=Math.max(w,n),S+=C,p[i]={left:0,top:0,width:n,height:h}}),_+=w,x.push(w),g.width+=_}t.width=g.width,t.height=g.height},afterFit:s,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,i=t.options,r=i.labels,a=n.global,s=a.elements.line,l=t.width,c=t.lineWidths;if(i.display){var h,u=t.ctx,d=o.valueOrDefault,f=d(r.fontColor,a.defaultFontColor),p=d(r.fontSize,a.defaultFontSize),g=d(r.fontStyle,a.defaultFontStyle),m=d(r.fontFamily,a.defaultFontFamily),v=o.fontString(p,g,m);u.textAlign="left",u.textBaseline="middle",u.lineWidth=.5,u.strokeStyle=f,u.fillStyle=f,u.font=v;var y=e(r,p),b=t.legendHitBoxes,x=function(t,e,n){if(!(isNaN(y)||y<=0)){u.save(),u.fillStyle=d(n.fillStyle,a.defaultColor),u.lineCap=d(n.lineCap,s.borderCapStyle),u.lineDashOffset=d(n.lineDashOffset,s.borderDashOffset),u.lineJoin=d(n.lineJoin,s.borderJoinStyle),u.lineWidth=d(n.lineWidth,s.borderWidth),u.strokeStyle=d(n.strokeStyle,a.defaultColor);var r=0===d(n.lineWidth,s.borderWidth);if(u.setLineDash&&u.setLineDash(d(n.lineDash,s.borderDash)),i.labels&&i.labels.usePointStyle){var l=p*Math.SQRT2/2,c=l/Math.SQRT2,h=t+c,f=e+c;o.canvas.drawPoint(u,n.pointStyle,l,h,f)}else r||u.strokeRect(t,e,y,p),u.fillRect(t,e,y,p);u.restore()}},_=function(t,e,i,n){var r=p/2,o=y+r+t,a=e+r;u.fillText(i.text,o,a),i.hidden&&(u.beginPath(),u.lineWidth=2,u.moveTo(o,a),u.lineTo(o+n,a),u.stroke())},w=t.isHorizontal();h=w?{x:t.left+(l-c[0])/2,y:t.top+r.padding,line:0}:{x:t.left+r.padding,y:t.top+r.padding,line:0};var S=p+r.padding;o.each(t.legendItems,function(e,i){var n=u.measureText(e.text).width,o=y+p/2+n,a=h.x,s=h.y;w?a+o>=l&&(s=h.y+=S,h.line++,a=h.x=t.left+(l-c[h.line])/2):s+S>t.bottom&&(a=h.x=a+t.columnWidths[h.line]+r.padding,s=h.y=t.top+r.padding,h.line++),x(a,s,e),b[i].left=a,b[i].top=s,_(a,s,e,n),w?h.x+=o+r.padding:h.y+=S})}},handleEvent:function(t){var e=this,i=e.options,n="mouseup"===t.type?"click":t.type,r=!1;if("mousemove"===n){if(!i.onHover)return}else{if("click"!==n)return;if(!i.onClick)return}var o=t.x,a=t.y;if(o>=e.left&&o<=e.right&&a>=e.top&&a<=e.bottom)for(var s=e.legendHitBoxes,l=0;l<s.length;++l){var c=s[l];if(o>=c.left&&o<=c.left+c.width&&a>=c.top&&a<=c.top+c.height){if("click"===n){i.onClick.call(e,t.native,e.legendItems[l]),r=!0;break}if("mousemove"===n){i.onHover.call(e,t.native,e.legendItems[l]),r=!0;break}}}return r}}),{id:"legend",beforeInit:function(t){var e=t.options.legend;e&&i(t,e)},beforeUpdate:function(t){var e=t.options.legend,r=t.legend;e?(o.mergeIf(e,n.global.legend),r?(a.configure(t,r,e),r.options=e):i(t,e)):r&&(a.removeBox(t,r),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}}}},{25:25,26:26,45:45}],51:[function(t,e,i){"use strict";var n=t(25),r=t(26),o=t(45);n._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}}),e.exports=function(t){function e(e,n){var r=new t.Title({ctx:e.ctx,options:n,chart:e});i.configure(e,r,n),i.addBox(e,r),e.titleBlock=r}var i=t.layoutService,a=o.noop;return t.Title=r.extend({initialize:function(t){var e=this;o.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:a,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:a,beforeSetDimensions:a,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:a,beforeBuildLabels:a,buildLabels:a,afterBuildLabels:a,beforeFit:a,fit:function(){var t=this,e=o.valueOrDefault,i=t.options,r=i.display,a=e(i.fontSize,n.global.defaultFontSize),s=t.minSize,l=o.isArray(i.text)?i.text.length:1,c=o.options.toLineHeight(i.lineHeight,a),h=r?l*c+2*i.padding:0;t.isHorizontal()?(s.width=t.maxWidth,s.height=h):(s.width=h,s.height=t.maxHeight),t.width=s.width,t.height=s.height},afterFit:a,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=o.valueOrDefault,r=t.options,a=n.global;if(r.display){var s,l,c,h=i(r.fontSize,a.defaultFontSize),u=i(r.fontStyle,a.defaultFontStyle),d=i(r.fontFamily,a.defaultFontFamily),f=o.fontString(h,u,d),p=o.options.toLineHeight(r.lineHeight,h),g=p/2+r.padding,m=0,v=t.top,y=t.left,b=t.bottom,x=t.right;e.fillStyle=i(r.fontColor,a.defaultFontColor),e.font=f,t.isHorizontal()?(l=y+(x-y)/2,c=v+g,s=x-y):(l="left"===r.position?y+g:x-g,c=v+(b-v)/2,s=b-v,m=Math.PI*("left"===r.position?-.5:.5)),e.save(),e.translate(l,c),e.rotate(m),e.textAlign="center",e.textBaseline="middle";var _=r.text;if(o.isArray(_))for(var w=0,S=0;S<_.length;++S)e.fillText(_[S],0,w,s),w+=p;else e.fillText(_,0,0,s);e.restore()}}}),{id:"title",beforeInit:function(t){var i=t.options.title;i&&e(t,i)},beforeUpdate:function(r){var a=r.options.title,s=r.titleBlock;a?(o.mergeIf(a,n.global.title),s?(i.configure(r,s,a),s.options=a):e(r,a)):s&&(t.layoutService.removeBox(r,s),delete r.titleBlock)}}}},{25:25,26:26,45:45}],52:[function(t,e,i){"use strict";e.exports=function(t){var e=t.Scale.extend({getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t=this,e=t.getLabels();t.minIndex=0,t.maxIndex=e.length-1;var i;void 0!==t.options.ticks.min&&(i=e.indexOf(t.options.ticks.min),t.minIndex=-1!==i?i:t.minIndex),void 0!==t.options.ticks.max&&(i=e.indexOf(t.options.ticks.max),t.maxIndex=-1!==i?i:t.maxIndex),t.min=e[t.minIndex],t.max=e[t.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var i=this,n=i.chart.data,r=i.isHorizontal();return n.yLabels&&!r?i.getRightValue(n.datasets[e].data[t]):i.ticks[t-i.minIndex]},getPixelForValue:function(t,e){var i,n=this,r=n.options.offset,o=Math.max(n.maxIndex+1-n.minIndex-(r?0:1),1);if(void 0!==t&&null!==t&&(i=n.isHorizontal()?t.x:t.y),void 0!==i||void 0!==t&&isNaN(e)){var a=n.getLabels();t=i||t;var s=a.indexOf(t);e=-1!==s?s:e}if(n.isHorizontal()){var l=n.width/o,c=l*(e-n.minIndex);return r&&(c+=l/2),n.left+Math.round(c)}var h=n.height/o,u=h*(e-n.minIndex);return r&&(u+=h/2),n.top+Math.round(u)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this,i=e.options.offset,n=Math.max(e._ticks.length-(i?0:1),1),r=e.isHorizontal(),o=(r?e.width:e.height)/n;return t-=r?e.left:e.top,i&&(t-=o/2),(t<=0?0:Math.round(t/o))+e.minIndex},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",e,{position:"bottom"})}},{}],53:[function(t,e,i){"use strict";var n=t(25),r=t(45),o=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:o.formatters.linear}},i=t.LinearScaleBase.extend({determineDataLimits:function(){function t(t){return a?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,i=e.options,n=e.chart,o=n.data.datasets,a=e.isHorizontal();e.min=null,e.max=null;var s=i.stacked;if(void 0===s&&r.each(o,function(e,i){if(!s){var r=n.getDatasetMeta(i);n.isDatasetVisible(i)&&t(r)&&void 0!==r.stack&&(s=!0)}}),i.stacked||s){var l={};r.each(o,function(o,a){var s=n.getDatasetMeta(a),c=[s.type,void 0===i.stacked&&void 0===s.stack?a:"",s.stack].join(".");void 0===l[c]&&(l[c]={positiveValues:[],negativeValues:[]});var h=l[c].positiveValues,u=l[c].negativeValues;n.isDatasetVisible(a)&&t(s)&&r.each(o.data,function(t,n){var r=+e.getRightValue(t);isNaN(r)||s.data[n].hidden||(h[n]=h[n]||0,u[n]=u[n]||0,i.relativePoints?h[n]=100:r<0?u[n]+=r:h[n]+=r)})}),r.each(l,function(t){var i=t.positiveValues.concat(t.negativeValues),n=r.min(i),o=r.max(i);e.min=null===e.min?n:Math.min(e.min,n),e.max=null===e.max?o:Math.max(e.max,o)})}else r.each(o,function(i,o){var a=n.getDatasetMeta(o);n.isDatasetVisible(o)&&t(a)&&r.each(i.data,function(t,i){var n=+e.getRightValue(t);isNaN(n)||a.data[i].hidden||(null===e.min?e.min=n:n<e.min&&(e.min=n),null===e.max?e.max=n:n>e.max&&(e.max=n))})});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 o=r.valueOrDefault(i.fontSize,n.global.defaultFontSize);t=Math.min(i.maxTicksLimit?i.maxTicksLimit:11,Math.ceil(e.height/(2*o)))}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,i=this,n=i.start,r=+i.getRightValue(t),o=i.end-n;return i.isHorizontal()?(e=i.left+i.width/o*(r-n),Math.round(e)):(e=i.bottom-i.height/o*(r-n),Math.round(e))},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),n=i?e.width:e.height,r=(i?t-e.left:e.bottom-t)/n;return e.start+(e.end-e.start)*r},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",i,e)}},{25:25,34:34,45:45}],54:[function(t,e,i){"use strict";var n=t(45),r=t(34);e.exports=function(t){var e=n.noop;t.LinearScaleBase=t.Scale.extend({getRightValue:function(e){return"string"==typeof e?+e:t.Scale.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var i=n.sign(t.min),r=n.sign(t.max);i<0&&r<0?t.max=0:i>0&&r>0&&(t.min=0)}var o=void 0!==e.min||void 0!==e.suggestedMin,a=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),o!==a&&t.min>=t.max&&(o?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:e,handleDirectionalChanges:e,buildTicks:function(){var t=this,e=t.options.ticks,i=t.getTickLimit(),o={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,stepSize:n.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=r.generators.linear(o,t);t.handleDirectionalChanges(),t.max=n.max(a),t.min=n.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{34:34,45:45}],55:[function(t,e,i){"use strict";var n=t(45),r=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:r.formatters.logarithmic}},i=t.Scale.extend({determineDataLimits:function(){function t(t){return l?t.xAxisID===e.id:t.yAxisID===e.id}var e=this,i=e.options,r=i.ticks,o=e.chart,a=o.data.datasets,s=n.valueOrDefault,l=e.isHorizontal();e.min=null,e.max=null,e.minNotZero=null;var c=i.stacked;if(void 0===c&&n.each(a,function(e,i){if(!c){var n=o.getDatasetMeta(i);o.isDatasetVisible(i)&&t(n)&&void 0!==n.stack&&(c=!0)}}),i.stacked||c){var h={};n.each(a,function(r,a){var s=o.getDatasetMeta(a),l=[s.type,void 0===i.stacked&&void 0===s.stack?a:"",s.stack].join(".");o.isDatasetVisible(a)&&t(s)&&(void 0===h[l]&&(h[l]=[]),n.each(r.data,function(t,n){var r=h[l],o=+e.getRightValue(t);isNaN(o)||s.data[n].hidden||(r[n]=r[n]||0,i.relativePoints?r[n]=100:r[n]+=o)}))}),n.each(h,function(t){var i=n.min(t),r=n.max(t);e.min=null===e.min?i:Math.min(e.min,i),e.max=null===e.max?r:Math.max(e.max,r)})}else n.each(a,function(i,r){var a=o.getDatasetMeta(r);o.isDatasetVisible(r)&&t(a)&&n.each(i.data,function(t,i){var n=+e.getRightValue(t);isNaN(n)||a.data[i].hidden||(null===e.min?e.min=n:n<e.min&&(e.min=n),null===e.max?e.max=n:n>e.max&&(e.max=n),0!==n&&(null===e.minNotZero||n<e.minNotZero)&&(e.minNotZero=n))})});e.min=s(r.min,e.min),e.max=s(r.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(n.log10(e.min))-1),e.max=Math.pow(10,Math.floor(n.log10(e.max))+1)):(e.min=1,e.max=10))},buildTicks:function(){var t=this,e=t.options.ticks,i={min:e.min,max:e.max},o=t.ticks=r.generators.logarithmic(i,t);t.isHorizontal()||o.reverse(),t.max=n.max(o),t.min=n.min(o),e.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),t.Scale.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])},getPixelForValue:function(t){var e,i,r,o=this,a=o.start,s=+o.getRightValue(t),l=o.options.ticks;return o.isHorizontal()?(r=n.log10(o.end)-n.log10(a),0===s?i=o.left:(e=o.width,i=o.left+e/r*(n.log10(s)-n.log10(a)))):(e=o.height,0!==a||l.reverse?0===o.end&&l.reverse?(r=n.log10(o.start)-n.log10(o.minNotZero),i=s===o.end?o.top:s===o.minNotZero?o.top+.02*e:o.top+.02*e+.98*e/r*(n.log10(s)-n.log10(o.minNotZero))):0===s?i=l.reverse?o.top:o.bottom:(r=n.log10(o.end)-n.log10(a),e=o.height,i=o.bottom-e/r*(n.log10(s)-n.log10(a))):(r=n.log10(o.end)-n.log10(o.minNotZero),i=s===a?o.bottom:s===o.minNotZero?o.bottom-.02*e:o.bottom-.02*e-.98*e/r*(n.log10(s)-n.log10(o.minNotZero)))),i},getValueForPixel:function(t){var e,i,r=this,o=n.log10(r.end)-n.log10(r.start);return r.isHorizontal()?(i=r.width,e=r.start*Math.pow(10,(t-r.left)*o/i)):(i=r.height,e=Math.pow(10,(r.bottom-t)*o/i)/r.start),e}});t.scaleService.registerScaleType("logarithmic",i,e)}},{34:34,45:45}],56:[function(t,e,i){"use strict";var n=t(25),r=t(45),o=t(34);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=r.valueOrDefault(e.fontSize,m.defaultFontSize),n=r.valueOrDefault(e.fontStyle,m.defaultFontStyle),o=r.valueOrDefault(e.fontFamily,m.defaultFontFamily);return{size:i,style:n,family:o,font:r.fontString(i,n,o)}}function a(t,e,i){return r.isArray(i)?{w:r.longestText(t,t.font,i),h:i.length*e+1.5*(i.length-1)*e}:{w:t.measureText(i).width,h:e}}function s(t,e,i,n,r){return t===n||t===r?{start:e-i/2,end:e+i/2}:t<n||t>r?{start:e-i-5,end:e}:{start:e,end:e+i+5}}function l(t){var n,o,l,c=i(t),h=Math.min(t.height/2,t.width/2),u={r:t.width,l:0,t:t.height,b:0},d={};t.ctx.font=c.font,t._pointLabelSizes=[];var f=e(t);for(n=0;n<f;n++){l=t.getPointPosition(n,h),o=a(t.ctx,c.size,t.pointLabels[n]||""),t._pointLabelSizes[n]=o;var p=t.getIndexAngle(n),g=r.toDegrees(p)%360,m=s(g,l.x,o.w,0,180),v=s(g,l.y,o.h,90,270);m.start<u.l&&(u.l=m.start,d.l=p),m.end>u.r&&(u.r=m.end,d.r=p),v.start<u.t&&(u.t=v.start,d.t=p),v.end>u.b&&(u.b=v.end,d.b=p)}t.setReductions(h,u,d)}function c(t){var e=Math.min(t.height/2,t.width/2);t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0)}function h(t){return 0===t||180===t?"center":t<180?"left":"right"}function u(t,e,i,n){if(r.isArray(e))for(var o=i.y,a=1.5*n,s=0;s<e.length;++s)t.fillText(e[s],i.x,o),o+=a;else t.fillText(e,i.x,i.y)}function d(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function f(t){var n=t.ctx,o=r.valueOrDefault,a=t.options,s=a.angleLines,l=a.pointLabels;n.lineWidth=s.lineWidth,n.strokeStyle=s.color;var c=t.getDistanceFromCenterForValue(a.ticks.reverse?t.min:t.max),f=i(t);n.textBaseline="top";for(var p=e(t)-1;p>=0;p--){if(s.display){var g=t.getPointPosition(p,c);n.beginPath(),n.moveTo(t.xCenter,t.yCenter),n.lineTo(g.x,g.y),n.stroke(),n.closePath()}if(l.display){var v=t.getPointPosition(p,c+5),y=o(l.fontColor,m.defaultFontColor);n.font=f.font,n.fillStyle=y;var b=t.getIndexAngle(p),x=r.toDegrees(b);n.textAlign=h(x),d(x,t._pointLabelSizes[p],v),u(n,t.pointLabels[p]||"",v,f.size)}}}function p(t,i,n,o){var a=t.ctx;if(a.strokeStyle=r.valueAtIndexOrDefault(i.color,o-1),a.lineWidth=r.valueAtIndexOrDefault(i.lineWidth,o-1),t.options.gridLines.circular)a.beginPath(),a.arc(t.xCenter,t.yCenter,n,0,2*Math.PI),a.closePath(),a.stroke();else{var s=e(t);if(0===s)return;a.beginPath();var l=t.getPointPosition(0,n);a.moveTo(l.x,l.y);for(var c=1;c<s;c++)l=t.getPointPosition(c,n),a.lineTo(l.x,l.y);a.closePath(),a.stroke()}}function g(t){return r.isNumber(t)?t:0}var m=n.global,v={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:o.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}},y=t.LinearScaleBase.extend({setDimensions:function(){var t=this,e=t.options,i=e.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var n=r.min([t.height,t.width]),o=r.valueOrDefault(i.fontSize,m.defaultFontSize);t.drawingArea=e.display?n/2-(o/2+i.backdropPaddingY):n/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;r.each(e.data.datasets,function(o,a){if(e.isDatasetVisible(a)){var s=e.getDatasetMeta(a);r.each(o.data,function(e,r){var o=+t.getRightValue(e);isNaN(o)||s.data[r].hidden||(i=Math.min(o,i),n=Math.max(o,n))})}}),t.min=i===Number.POSITIVE_INFINITY?0:i,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,e=r.valueOrDefault(t.fontSize,m.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*e)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){this.options.pointLabels.display?l(this):c(this)},setReductions:function(t,e,i){var n=this,r=e.l/Math.sin(i.l),o=Math.max(e.r-n.width,0)/Math.sin(i.r),a=-e.t/Math.cos(i.t),s=-Math.max(e.b-n.height,0)/Math.cos(i.b);r=g(r),o=g(o),a=g(a),s=g(s),n.drawingArea=Math.min(Math.round(t-(r+o)/2),Math.round(t-(a+s)/2)),n.setCenterPoint(r,o,a,s)},setCenterPoint:function(t,e,i,n){var r=this,o=r.width-e-r.drawingArea,a=t+r.drawingArea,s=i+r.drawingArea,l=r.height-n-r.drawingArea;r.xCenter=Math.round((a+o)/2+r.left),r.yCenter=Math.round((s+l)/2+r.top)},getIndexAngle:function(t){return t*(2*Math.PI/e(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(null===t)return 0;var i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this,n=i.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(n)*e)+i.xCenter,y:Math.round(Math.sin(n)*e)+i.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this,e=t.min,i=t.max;return t.getPointPositionForValue(0,t.beginAtZero?0:e<0&&i<0?i:e>0&&i>0?e:0)},draw:function(){var t=this,e=t.options,i=e.gridLines,n=e.ticks,o=r.valueOrDefault;if(e.display){var a=t.ctx,s=this.getIndexAngle(0),l=o(n.fontSize,m.defaultFontSize),c=o(n.fontStyle,m.defaultFontStyle),h=o(n.fontFamily,m.defaultFontFamily),u=r.fontString(l,c,h);r.each(t.ticks,function(e,r){if(r>0||n.reverse){var c=t.getDistanceFromCenterForValue(t.ticksAsNumbers[r]);if(i.display&&0!==r&&p(t,i,c,r),n.display){var h=o(n.fontColor,m.defaultFontColor);if(a.font=u,a.save(),a.translate(t.xCenter,t.yCenter),a.rotate(s),n.showLabelBackdrop){var d=a.measureText(e).width;a.fillStyle=n.backdropColor,a.fillRect(-d/2-n.backdropPaddingX,-c-l/2-n.backdropPaddingY,d+2*n.backdropPaddingX,l+2*n.backdropPaddingY)}a.textAlign="center",a.textBaseline="middle",a.fillStyle=h,a.fillText(e,0,-c),a.restore()}}}),(e.angleLines.display||e.pointLabels.display)&&f(t)}}});t.scaleService.registerScaleType("radialLinear",y,v)}},{25:25,34:34,45:45}],57:[function(t,e,i){"use strict";function n(t,e){return t-e}function r(t){var e,i,n,r={},o=[];for(e=0,i=t.length;e<i;++e)r[n=t[e]]||(r[n]=!0,o.push(n));return o}function o(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var r,o,a,s,l,c=[],h=[e];for(r=0,o=t.length;r<o;++r)(s=t[r])>e&&s<i&&h.push(s);for(h.push(i),r=0,o=h.length;r<o;++r)l=h[r+1],a=h[r-1],s=h[r],void 0!==a&&void 0!==l&&Math.round((l+a)/2)===s||c.push({time:s,pos:r/(o-1)});return c}function a(t,e,i){for(var n,r,o,a=0,s=t.length-1;a>=0&&a<=s;){if(n=a+s>>1,r=t[n-1]||null,o=t[n],!r)return{lo:null,hi:o};if(o[e]<i)a=n+1;else{if(!(r[e]>i))return{lo:r,hi:o};s=n-1}}return{lo:o,hi:null}}function s(t,e,i,n){var r=a(t,e,i),o=r.lo?r.hi?r.lo:t[t.length-2]:t[0],s=r.lo?r.hi?r.hi:t[t.length-1]:t[1],l=s[e]-o[e],c=l?(i-o[e])/l:0,h=(s[n]-o[n])*c;return o[n]+h}function l(t,e){var i=e.parser,n=e.parser||e.format;return"function"==typeof i?i(t):"string"==typeof t&&"string"==typeof n?m(t,n):(t instanceof m||(t=m(t)),t.isValid()?t:"function"==typeof n?n(t):t)}function c(t,e){if(y.isNullOrUndef(t))return null;var i=e.options.time,n=l(e.getRightValue(t),i);return n.isValid()?(i.round&&n.startOf(i.round),n.valueOf()):null}function h(t,e,i,n){var r,o,a,s=e-t,l=_[i],c=l.size,h=l.steps;if(!h)return Math.ceil(s/((n||1)*c));for(r=0,o=h.length;r<o&&(a=h[r],!(Math.ceil(s/(c*a))<=n));++r);return a}function u(t,e,i,n){var r,o,a,s=w.length;for(r=w.indexOf(t);r<s-1;++r)if(o=_[w[r]],a=o.steps?o.steps[o.steps.length-1]:x,Math.ceil((i-e)/(a*o.size))<=n)return w[r];return w[s-1]}function d(t){for(var e=w.indexOf(t)+1,i=w.length;e<i;++e)if(_[w[e]].major)return w[e]}function f(t,e,i,n,r,o){var a,s=o.time,l=y.valueOrDefault(s.stepSize,s.unitStepSize),c="week"===i&&s.isoWeekday,u=o.ticks.major.enabled,d=_[i],f=m(t),p=m(e),g=[];for(l||(l=h(t,e,i,r)),c&&(f=f.isoWeekday(c),p=p.isoWeekday(c)),f=f.startOf(c?"day":i),(p=p.startOf(c?"day":i))<e&&p.add(1,i),a=m(f),u&&n&&!c&&!s.round&&(a.startOf(n),a.add(~~((f-a)/(d.size*l))*l,i));a<p;a.add(l,i))g.push(+a);return g.push(+a),g}function p(t,e,i,n,r){var o,a,l=0,c=0;return r.offset&&e.length&&(r.time.min||(o=e.length>1?e[1]:n,a=e[0],l=(s(t,"time",o,"pos")-s(t,"time",a,"pos"))/2),r.time.max||(o=e[e.length-1],a=e.length>1?e[e.length-2]:i,c=(s(t,"time",o,"pos")-s(t,"time",a,"pos"))/2)),{left:l,right:c}}function g(t,e){var i,n,r,o,a=[];for(i=0,n=t.length;i<n;++i)r=t[i],o=!!e&&r===+m(r).startOf(e),a.push({value:r,major:o});return a}var m=t(1);m="function"==typeof m?m:window.moment;var v=t(25),y=t(45),b=Number.MIN_SAFE_INTEGER||-9007199254740991,x=Number.MAX_SAFE_INTEGER||9007199254740991,_={millisecond:{major:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{major:!0,size:1e3,steps:[1,2,5,10,30]},minute:{major:!0,size:6e4,steps:[1,2,5,10,30]},hour:{major:!0,size:36e5,steps:[1,2,3,6,12]},day:{major:!0,size:864e5,steps:[1,2,5]},week:{major:!1,size:6048e5,steps:[1,2,3,4]},month:{major:!0,size:2628e6,steps:[1,2,3]},quarter:{major:!1,size:7884e6,steps:[1,2,3,4]},year:{major:!0,size:3154e7}},w=Object.keys(_);e.exports=function(t){var e=t.Scale.extend({initialize:function(){if(!m)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");this.mergeTicksOptions(),t.Scale.prototype.initialize.call(this)},update:function(){var e=this,i=e.options;return i.time&&i.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),t.Scale.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),t.Scale.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var t,e,i,o,a,s,l=this,h=l.chart,u=l.options.time,d=c(u.min,l)||x,f=c(u.max,l)||b,p=[],g=[],v=[];for(t=0,i=h.data.labels.length;t<i;++t)v.push(c(h.data.labels[t],l));for(t=0,i=(h.data.datasets||[]).length;t<i;++t)if(h.isDatasetVisible(t))if(a=h.data.datasets[t].data,y.isObject(a[0]))for(g[t]=[],e=0,o=a.length;e<o;++e)s=c(a[e],l),p.push(s),g[t][e]=s;else p.push.apply(p,v),g[t]=v.slice(0);else g[t]=[];v.length&&(v=r(v).sort(n),d=Math.min(d,v[0]),f=Math.max(f,v[v.length-1])),p.length&&(p=r(p).sort(n),d=Math.min(d,p[0]),f=Math.max(f,p[p.length-1])),d=d===x?+m().startOf("day"):d,f=f===b?+m().endOf("day")+1:f,l.min=Math.min(d,f),l.max=Math.max(d+1,f),l._horizontal=l.isHorizontal(),l._table=[],l._timestamps={data:p,datasets:g,labels:v}},buildTicks:function(){var t,e,i,n=this,r=n.min,a=n.max,s=n.options,l=s.time,h=l.displayFormats,m=n.getLabelCapacity(r),v=l.unit||u(l.minUnit,r,a,m),y=d(v),b=[],x=[];switch(s.ticks.source){case"data":b=n._timestamps.data;break;case"labels":b=n._timestamps.labels;break;case"auto":default:b=f(r,a,v,y,m,s)}for("ticks"===s.bounds&&b.length&&(r=b[0],a=b[b.length-1]),r=c(l.min,n)||r,a=c(l.max,n)||a,t=0,e=b.length;t<e;++t)(i=b[t])>=r&&i<=a&&x.push(i);return n.min=r,n.max=a,n._unit=v,n._majorUnit=y,n._minorFormat=h[v],n._majorFormat=h[y],n._table=o(n._timestamps.data,r,a,s.distribution),n._offsets=p(n._table,x,r,a,s),g(x,y)},getLabelForIndex:function(t,e){var i=this,n=i.chart.data,r=i.options.time,o=n.labels&&t<n.labels.length?n.labels[t]:"",a=n.datasets[e].data[t];return y.isObject(a)&&(o=i.getRightValue(a)),r.tooltipFormat&&(o=l(o,r).format(r.tooltipFormat)),o},tickFormatFunction:function(t,e,i){var n=this,r=n.options,o=t.valueOf(),a=n._majorUnit,s=n._majorFormat,l=t.clone().startOf(n._majorUnit).valueOf(),c=r.ticks.major,h=c.enabled&&a&&s&&o===l,u=t.format(h?s:n._minorFormat),d=h?c:r.ticks.minor,f=y.valueOrDefault(d.callback,d.userCallback);return f?f(u,e,i):u},convertTicksToLabels:function(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(this.tickFormatFunction(m(t[e].value),e,t));return n},getPixelForOffset:function(t){var e=this,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,r=s(e._table,"time",t,"pos");return n+i*(e._offsets.left+r)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,i){var n=this,r=null;if(void 0!==e&&void 0!==i&&(r=n._timestamps.datasets[i][e]),null===r&&(r=c(t,n)),null!==r)return n.getPixelForOffset(r)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,r=(i?(t-n)/i:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,o=s(e._table,"pos",r,"time");return m(o)},getLabelWidth:function(t){var e=this,i=e.options.ticks,n=e.ctx.measureText(t).width,r=y.toRadians(i.maxRotation),o=Math.cos(r),a=Math.sin(r);return n*o+y.valueOrDefault(i.fontSize,v.global.defaultFontSize)*a},getLabelCapacity:function(t){var e=this;e._minorFormat=e.options.time.displayFormats.millisecond;var i=e.tickFormatFunction(m(t),0,[]),n=e.getLabelWidth(i),r=e.isHorizontal()?e.width:e.height;return Math.floor(r/n)}});t.scaleService.registerScaleType("time",e,{position:"bottom",distribution:"linear",bounds:"data",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}})}},{1:1,25:25,45:45}]},{},[7])(7)}),function(t,e){"function"==typeof define&&define.amd?define("Chartist",[],function(){return t.Chartist=e()}):"object"==typeof module&&module.exports?module.exports=e():t.Chartist=e()}(this,function(){var t={version:"0.11.0"};return function(t,e,i){"use strict";i.namespaces={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},i.noop=function(t){return t},i.alphaNumerate=function(t){return String.fromCharCode(97+t%26)},i.extend=function(t){var e,n,r;for(t=t||{},e=1;e<arguments.length;e++){n=arguments[e];for(var o in n)"object"!=typeof(r=n[o])||null===r||r instanceof Array?t[o]=r:t[o]=i.extend(t[o],r)}return t},i.replaceAll=function(t,e,i){return t.replace(new RegExp(e,"g"),i)},i.ensureUnit=function(t,e){return"number"==typeof t&&(t+=e),t},i.quantity=function(t){if("string"==typeof t){var e=/^(\d+)\s*(.*)$/g.exec(t);return{value:+e[1],unit:e[2]||void 0}}return{value:t}},i.querySelector=function(t){return t instanceof Node?t:e.querySelector(t)},i.times=function(t){return Array.apply(null,new Array(t))},i.sum=function(t,e){return t+(e||0)},i.mapMultiply=function(t){return function(e){return e*t}},i.mapAdd=function(t){return function(e){return e+t}},i.serialMap=function(t,e){var n=[],r=Math.max.apply(null,t.map(function(t){return t.length}));return i.times(r).forEach(function(i,r){var o=t.map(function(t){return t[r]});n[r]=e.apply(null,o)}),n},i.roundWithPrecision=function(t,e){var n=Math.pow(10,e||i.precision);return Math.round(t*n)/n},i.precision=8,i.escapingMap={"&":"&","<":"<",">":">",'"':""","'":"'"},i.serialize=function(t){return null===t||void 0===t?t:("number"==typeof t?t=""+t:"object"==typeof t&&(t=JSON.stringify({data:t})),Object.keys(i.escapingMap).reduce(function(t,e){return i.replaceAll(t,e,i.escapingMap[e])},t))},i.deserialize=function(t){if("string"!=typeof t)return t;t=Object.keys(i.escapingMap).reduce(function(t,e){return i.replaceAll(t,i.escapingMap[e],e)},t);try{t=void 0!==(t=JSON.parse(t)).data?t.data:t}catch(t){}return t},i.createSvg=function(t,e,n,r){var o;return e=e||"100%",n=n||"100%",Array.prototype.slice.call(t.querySelectorAll("svg")).filter(function(t){return t.getAttributeNS(i.namespaces.xmlns,"ct")}).forEach(function(e){t.removeChild(e)}),o=new i.Svg("svg").attr({width:e,height:n}).addClass(r),o._node.style.width=e,o._node.style.height=n,t.appendChild(o._node),o},i.normalizeData=function(t,e,n){var r,o={raw:t,normalized:{}};return o.normalized.series=i.getDataArray({series:t.series||[]},e,n),r=o.normalized.series.every(function(t){return t instanceof Array})?Math.max.apply(null,o.normalized.series.map(function(t){return t.length})):o.normalized.series.length,o.normalized.labels=(t.labels||[]).slice(),Array.prototype.push.apply(o.normalized.labels,i.times(Math.max(0,r-o.normalized.labels.length)).map(function(){return""})),e&&i.reverseData(o.normalized),o},i.safeHasProperty=function(t,e){return null!==t&&"object"==typeof t&&t.hasOwnProperty(e)},i.isDataHoleValue=function(t){return null===t||void 0===t||"number"==typeof t&&isNaN(t)},i.reverseData=function(t){t.labels.reverse(),t.series.reverse();for(var e=0;e<t.series.length;e++)"object"==typeof t.series[e]&&void 0!==t.series[e].data?t.series[e].data.reverse():t.series[e]instanceof Array&&t.series[e].reverse()},i.getDataArray=function(t,e,n){function r(t){if(i.safeHasProperty(t,"value"))return r(t.value);if(i.safeHasProperty(t,"data"))return r(t.data);if(t instanceof Array)return t.map(r);if(!i.isDataHoleValue(t)){if(n){var e={};return"string"==typeof n?e[n]=i.getNumberOrUndefined(t):e.y=i.getNumberOrUndefined(t),e.x=t.hasOwnProperty("x")?i.getNumberOrUndefined(t.x):e.x,e.y=t.hasOwnProperty("y")?i.getNumberOrUndefined(t.y):e.y,e}return i.getNumberOrUndefined(t)}}return t.series.map(r)},i.normalizePadding=function(t,e){return e=e||0,"number"==typeof t?{top:t,right:t,bottom:t,left:t}:{top:"number"==typeof t.top?t.top:e,right:"number"==typeof t.right?t.right:e,bottom:"number"==typeof t.bottom?t.bottom:e,left:"number"==typeof t.left?t.left:e}},i.getMetaData=function(t,e){var i=t.data?t.data[e]:t[e];return i?i.meta:void 0},i.orderOfMagnitude=function(t){return Math.floor(Math.log(Math.abs(t))/Math.LN10)},i.projectLength=function(t,e,i){return e/i.range*t},i.getAvailableHeight=function(t,e){return Math.max((i.quantity(e.height).value||t.height())-(e.chartPadding.top+e.chartPadding.bottom)-e.axisX.offset,0)},i.getHighLow=function(t,e,n){function r(t){if(void 0!==t)if(t instanceof Array)for(var e=0;e<t.length;e++)r(t[e]);else{var i=n?+t[n]:+t;a&&i>o.high&&(o.high=i),s&&i<o.low&&(o.low=i)}}var o={high:void 0===(e=i.extend({},e,n?e["axis"+n.toUpperCase()]:{})).high?-Number.MAX_VALUE:+e.high,low:void 0===e.low?Number.MAX_VALUE:+e.low},a=void 0===e.high,s=void 0===e.low;return(a||s)&&r(t),(e.referenceValue||0===e.referenceValue)&&(o.high=Math.max(e.referenceValue,o.high),o.low=Math.min(e.referenceValue,o.low)),o.high<=o.low&&(0===o.low?o.high=1:o.low<0?o.high=0:o.high>0?o.low=0:(o.high=1,o.low=0)),o},i.isNumeric=function(t){return null!==t&&isFinite(t)},i.isFalseyButZero=function(t){return!t&&0!==t},i.getNumberOrUndefined=function(t){return i.isNumeric(t)?+t:void 0},i.isMultiValue=function(t){return"object"==typeof t&&("x"in t||"y"in t)},i.getMultiValue=function(t,e){return i.isMultiValue(t)?i.getNumberOrUndefined(t[e||"y"]):i.getNumberOrUndefined(t)},i.rho=function(t){function e(t,i){return t%i==0?i:e(i,t%i)}function i(t){return t*t+1}if(1===t)return t;var n,r=2,o=2;if(t%2==0)return 2;do{r=i(r)%t,o=i(i(o))%t,n=e(Math.abs(r-o),t)}while(1===n);return n},i.getBounds=function(t,e,n,r){function o(t,e){return t===(t+=e)&&(t*=1+(e>0?f:-f)),t}var a,s,l,c=0,h={high:e.high,low:e.low};h.valueRange=h.high-h.low,h.oom=i.orderOfMagnitude(h.valueRange),h.step=Math.pow(10,h.oom),h.min=Math.floor(h.low/h.step)*h.step,h.max=Math.ceil(h.high/h.step)*h.step,h.range=h.max-h.min,h.numberOfSteps=Math.round(h.range/h.step);var u=i.projectLength(t,h.step,h)<n,d=r?i.rho(h.range):0;if(r&&i.projectLength(t,1,h)>=n)h.step=1;else if(r&&d<h.step&&i.projectLength(t,d,h)>=n)h.step=d;else for(;;){if(u&&i.projectLength(t,h.step,h)<=n)h.step*=2;else{if(u||!(i.projectLength(t,h.step/2,h)>=n))break;if(h.step/=2,r&&h.step%1!=0){h.step*=2;break}}if(c++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}var f=2.221e-16;for(h.step=Math.max(h.step,f),s=h.min,l=h.max;s+h.step<=h.low;)s=o(s,h.step);for(;l-h.step>=h.high;)l=o(l,-h.step);h.min=s,h.max=l,h.range=h.max-h.min;var p=[];for(a=h.min;a<=h.max;a=o(a,h.step)){var g=i.roundWithPrecision(a);g!==p[p.length-1]&&p.push(g)}return h.values=p,h},i.polarToCartesian=function(t,e,i,n){var r=(n-90)*Math.PI/180;return{x:t+i*Math.cos(r),y:e+i*Math.sin(r)}},i.createChartRect=function(t,e,n){var r=!(!e.axisX&&!e.axisY),o=r?e.axisY.offset:0,a=r?e.axisX.offset:0,s=t.width()||i.quantity(e.width).value||0,l=t.height()||i.quantity(e.height).value||0,c=i.normalizePadding(e.chartPadding,n);s=Math.max(s,o+c.left+c.right),l=Math.max(l,a+c.top+c.bottom);var h={padding:c,width:function(){return this.x2-this.x1},height:function(){return this.y1-this.y2}};return r?("start"===e.axisX.position?(h.y2=c.top+a,h.y1=Math.max(l-c.bottom,h.y2+1)):(h.y2=c.top,h.y1=Math.max(l-c.bottom-a,h.y2+1)),"start"===e.axisY.position?(h.x1=c.left+o,h.x2=Math.max(s-c.right,h.x1+1)):(h.x1=c.left,h.x2=Math.max(s-c.right-o,h.x1+1))):(h.x1=c.left,h.x2=Math.max(s-c.right,h.x1+1),h.y2=c.top,h.y1=Math.max(l-c.bottom,h.y2+1)),h},i.createGrid=function(t,e,n,r,o,a,s,l){var c={};c[n.units.pos+"1"]=t,c[n.units.pos+"2"]=t,c[n.counterUnits.pos+"1"]=r,c[n.counterUnits.pos+"2"]=r+o;var h=a.elem("line",c,s.join(" "));l.emit("draw",i.extend({type:"grid",axis:n,index:e,group:a,element:h},c))},i.createGridBackground=function(t,e,i,n){var r=t.elem("rect",{x:e.x1,y:e.y2,width:e.width(),height:e.height()},i,!0);n.emit("draw",{type:"gridBackground",group:t,element:r})},i.createLabel=function(t,n,r,o,a,s,l,c,h,u,d){var f,p={};if(p[a.units.pos]=t+l[a.units.pos],p[a.counterUnits.pos]=l[a.counterUnits.pos],p[a.units.len]=n,p[a.counterUnits.len]=Math.max(0,s-10),u){var g=e.createElement("span");g.className=h.join(" "),g.setAttribute("xmlns",i.namespaces.xhtml),g.innerText=o[r],g.style[a.units.len]=Math.round(p[a.units.len])+"px",g.style[a.counterUnits.len]=Math.round(p[a.counterUnits.len])+"px",f=c.foreignObject(g,i.extend({style:"overflow: visible;"},p))}else f=c.elem("text",p,h.join(" ")).text(o[r]);d.emit("draw",i.extend({type:"label",axis:a,index:r,group:c,element:f,text:o[r]},p))},i.getSeriesOption=function(t,e,i){if(t.name&&e.series&&e.series[t.name]){var n=e.series[t.name];return n.hasOwnProperty(i)?n[i]:e[i]}return e[i]},i.optionsProvider=function(e,n,r){function o(e){var o=a;if(a=i.extend({},l),n)for(s=0;s<n.length;s++)t.matchMedia(n[s][0]).matches&&(a=i.extend(a,n[s][1]));r&&e&&r.emit("optionsChanged",{previousOptions:o,currentOptions:a})}var a,s,l=i.extend({},e),c=[];if(!t.matchMedia)throw"window.matchMedia not found! Make sure you're using a polyfill.";if(n)for(s=0;s<n.length;s++){var h=t.matchMedia(n[s][0]);h.addListener(o),c.push(h)}return o(),{removeMediaQueryListeners:function(){c.forEach(function(t){t.removeListener(o)})},getCurrentOptions:function(){return i.extend({},a)}}},i.splitIntoSegments=function(t,e,n){n=i.extend({},{increasingX:!1,fillHoles:!1},n);for(var r=[],o=!0,a=0;a<t.length;a+=2)void 0===i.getMultiValue(e[a/2].value)?n.fillHoles||(o=!0):(n.increasingX&&a>=2&&t[a]<=t[a-2]&&(o=!0),o&&(r.push({pathCoordinates:[],valueData:[]}),o=!1),r[r.length-1].pathCoordinates.push(t[a],t[a+1]),r[r.length-1].valueData.push(e[a/2]));return r}}(window,document,t),function(t,e,i){"use strict";i.Interpolation={},i.Interpolation.none=function(t){return t=i.extend({},{fillHoles:!1},t),function(e,n){for(var r=new i.Svg.Path,o=!0,a=0;a<e.length;a+=2){var s=e[a],l=e[a+1],c=n[a/2];void 0!==i.getMultiValue(c.value)?(o?r.move(s,l,!1,c):r.line(s,l,!1,c),o=!1):t.fillHoles||(o=!0)}return r}},i.Interpolation.simple=function(t){t=i.extend({},{divisor:2,fillHoles:!1},t);var e=1/Math.max(1,t.divisor);return function(n,r){for(var o,a,s,l=new i.Svg.Path,c=0;c<n.length;c+=2){var h=n[c],u=n[c+1],d=(h-o)*e,f=r[c/2];void 0!==f.value?(void 0===s?l.move(h,u,!1,f):l.curve(o+d,a,h-d,u,h,u,!1,f),o=h,a=u,s=f):t.fillHoles||(o=h=s=void 0)}return l}},i.Interpolation.cardinal=function(t){t=i.extend({},{tension:1,fillHoles:!1},t);var e=Math.min(1,Math.max(0,t.tension)),n=1-e;return function r(o,a){var s=i.splitIntoSegments(o,a,{fillHoles:t.fillHoles});if(s.length){if(s.length>1){var l=[];return s.forEach(function(t){l.push(r(t.pathCoordinates,t.valueData))}),i.Svg.Path.join(l)}if(o=s[0].pathCoordinates,a=s[0].valueData,o.length<=4)return i.Interpolation.none()(o,a);for(var c=(new i.Svg.Path).move(o[0],o[1],!1,a[0]),h=0,u=o.length;u-2>h;h+=2){var d=[{x:+o[h-2],y:+o[h-1]},{x:+o[h],y:+o[h+1]},{x:+o[h+2],y:+o[h+3]},{x:+o[h+4],y:+o[h+5]}];u-4===h?d[3]=d[2]:h||(d[0]={x:+o[h],y:+o[h+1]}),c.curve(e*(-d[0].x+6*d[1].x+d[2].x)/6+n*d[2].x,e*(-d[0].y+6*d[1].y+d[2].y)/6+n*d[2].y,e*(d[1].x+6*d[2].x-d[3].x)/6+n*d[2].x,e*(d[1].y+6*d[2].y-d[3].y)/6+n*d[2].y,d[2].x,d[2].y,!1,a[(h+2)/2])}return c}return i.Interpolation.none()([])}},i.Interpolation.monotoneCubic=function(t){return t=i.extend({},{fillHoles:!1},t),function e(n,r){var o=i.splitIntoSegments(n,r,{fillHoles:t.fillHoles,increasingX:!0});if(o.length){if(o.length>1){var a=[];return o.forEach(function(t){a.push(e(t.pathCoordinates,t.valueData))}),i.Svg.Path.join(a)}if(n=o[0].pathCoordinates,r=o[0].valueData,n.length<=4)return i.Interpolation.none()(n,r);var s,l,c=[],h=[],u=n.length/2,d=[],f=[],p=[],g=[];for(s=0;s<u;s++)c[s]=n[2*s],h[s]=n[2*s+1];for(s=0;s<u-1;s++)p[s]=h[s+1]-h[s],g[s]=c[s+1]-c[s],f[s]=p[s]/g[s];for(d[0]=f[0],d[u-1]=f[u-2],s=1;s<u-1;s++)0===f[s]||0===f[s-1]||f[s-1]>0!=f[s]>0?d[s]=0:(d[s]=3*(g[s-1]+g[s])/((2*g[s]+g[s-1])/f[s-1]+(g[s]+2*g[s-1])/f[s]),isFinite(d[s])||(d[s]=0));for(l=(new i.Svg.Path).move(c[0],h[0],!1,r[0]),s=0;s<u-1;s++)l.curve(c[s]+g[s]/3,h[s]+d[s]*g[s]/3,c[s+1]-g[s]/3,h[s+1]-d[s+1]*g[s]/3,c[s+1],h[s+1],!1,r[s+1]);return l}return i.Interpolation.none()([])}},i.Interpolation.step=function(t){return t=i.extend({},{postpone:!0,fillHoles:!1},t),function(e,n){for(var r,o,a,s=new i.Svg.Path,l=0;l<e.length;l+=2){var c=e[l],h=e[l+1],u=n[l/2];void 0!==u.value?(void 0===a?s.move(c,h,!1,u):(t.postpone?s.line(c,o,!1,a):s.line(r,h,!1,u),s.line(c,h,!1,u)),r=c,o=h,a=u):t.fillHoles||(r=o=a=void 0)}return s}}}(window,document,t),function(t,e,i){"use strict";i.EventEmitter=function(){var t=[];return{addEventHandler:function(e,i){t[e]=t[e]||[],t[e].push(i)},removeEventHandler:function(e,i){t[e]&&(i?(t[e].splice(t[e].indexOf(i),1),0===t[e].length&&delete t[e]):delete t[e])},emit:function(e,i){t[e]&&t[e].forEach(function(t){t(i)}),t["*"]&&t["*"].forEach(function(t){t(e,i)})}}}}(window,document,t),function(t,e,i){"use strict";function n(t){var e=[];if(t.length)for(var i=0;i<t.length;i++)e.push(t[i]);return e}i.Class={extend:function(t,e){var n=e||this.prototype||i.Class,r=Object.create(n);i.Class.cloneDefinitions(r,t);var o=function(){var t,e=r.constructor||function(){};return t=this===i?Object.create(r):this,e.apply(t,Array.prototype.slice.call(arguments,0)),t};return o.prototype=r,o.super=n,o.extend=this.extend,o},cloneDefinitions:function(){var t=n(arguments),e=t[0];return t.splice(1,t.length-1).forEach(function(t){Object.getOwnPropertyNames(t).forEach(function(i){delete e[i],Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}),e}}}(window,document,t),function(t,e,i){"use strict";function n(){t.addEventListener("resize",this.resizeListener),this.optionsProvider=i.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.addEventHandler("optionsChanged",function(){this.update()}.bind(this)),this.options.plugins&&this.options.plugins.forEach(function(t){t instanceof Array?t[0](this,t[1]):t(this)}.bind(this)),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=void 0}i.Base=i.Class.extend({constructor:function(t,e,r,o,a){this.container=i.querySelector(t),this.data=e||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.defaultOptions=r,this.options=o,this.responsiveOptions=a,this.eventEmitter=i.EventEmitter(),this.supportsForeignObject=i.Svg.isSupported("Extensibility"),this.supportsAnimations=i.Svg.isSupported("AnimationEventsAttribute"),this.resizeListener=function(){this.update()}.bind(this),this.container&&(this.container.__chartist__&&this.container.__chartist__.detach(),this.container.__chartist__=this),this.initializeTimeoutId=setTimeout(n.bind(this),0)},optionsProvider:void 0,container:void 0,svg:void 0,eventEmitter:void 0,createChart:function(){throw new Error("Base chart type can't be instantiated!")},update:function(t,e,n){return t&&(this.data=t||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),e&&(this.options=i.extend({},n?this.options:this.defaultOptions,e),this.initializeTimeoutId||(this.optionsProvider.removeMediaQueryListeners(),this.optionsProvider=i.optionsProvider(this.options,this.responsiveOptions,this.eventEmitter))),this.initializeTimeoutId||this.createChart(this.optionsProvider.getCurrentOptions()),this},detach:function(){return this.initializeTimeoutId?t.clearTimeout(this.initializeTimeoutId):(t.removeEventListener("resize",this.resizeListener),this.optionsProvider.removeMediaQueryListeners()),this},on:function(t,e){return this.eventEmitter.addEventHandler(t,e),this},off:function(t,e){return this.eventEmitter.removeEventHandler(t,e),this},version:i.version,supportsForeignObject:!1})}(window,document,t),function(t,e,i){"use strict";i.Svg=i.Class.extend({constructor:function(t,n,r,o,a){t instanceof Element?this._node=t:(this._node=e.createElementNS(i.namespaces.svg,t),"svg"===t&&this.attr({"xmlns:ct":i.namespaces.ct})),n&&this.attr(n),r&&this.addClass(r),o&&(a&&o._node.firstChild?o._node.insertBefore(this._node,o._node.firstChild):o._node.appendChild(this._node))},attr:function(t,e){return"string"==typeof t?e?this._node.getAttributeNS(e,t):this._node.getAttribute(t):(Object.keys(t).forEach(function(e){if(void 0!==t[e])if(-1!==e.indexOf(":")){var n=e.split(":");this._node.setAttributeNS(i.namespaces[n[0]],e,t[e])}else this._node.setAttribute(e,t[e])}.bind(this)),this)},elem:function(t,e,n,r){return new i.Svg(t,e,n,this,r)},parent:function(){return this._node.parentNode instanceof SVGElement?new i.Svg(this._node.parentNode):null},root:function(){for(var t=this._node;"svg"!==t.nodeName;)t=t.parentNode;return new i.Svg(t)},querySelector:function(t){var e=this._node.querySelector(t);return e?new i.Svg(e):null},querySelectorAll:function(t){var e=this._node.querySelectorAll(t);return e.length?new i.Svg.List(e):null},getNode:function(){return this._node},foreignObject:function(t,n,r,o){if("string"==typeof t){var a=e.createElement("div");a.innerHTML=t,t=a.firstChild}t.setAttribute("xmlns",i.namespaces.xmlns);var s=this.elem("foreignObject",n,r,o);return s._node.appendChild(t),s},text:function(t){return this._node.appendChild(e.createTextNode(t)),this},empty:function(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this},remove:function(){return this._node.parentNode.removeChild(this._node),this.parent()},replace:function(t){return this._node.parentNode.replaceChild(t._node,this._node),t},append:function(t,e){return e&&this._node.firstChild?this._node.insertBefore(t._node,this._node.firstChild):this._node.appendChild(t._node),this},classes:function(){return this._node.getAttribute("class")?this._node.getAttribute("class").trim().split(/\s+/):[]},addClass:function(t){return this._node.setAttribute("class",this.classes(this._node).concat(t.trim().split(/\s+/)).filter(function(t,e,i){return i.indexOf(t)===e}).join(" ")),this},removeClass:function(t){var e=t.trim().split(/\s+/);return this._node.setAttribute("class",this.classes(this._node).filter(function(t){return-1===e.indexOf(t)}).join(" ")),this},removeAllClasses:function(){return this._node.setAttribute("class",""),this},height:function(){return this._node.getBoundingClientRect().height},width:function(){return this._node.getBoundingClientRect().width},animate:function(t,e,n){return void 0===e&&(e=!0),Object.keys(t).forEach(function(r){function o(t,e){var o,a,s,l={};t.easing&&(s=t.easing instanceof Array?t.easing:i.Svg.Easing[t.easing],delete t.easing),t.begin=i.ensureUnit(t.begin,"ms"),t.dur=i.ensureUnit(t.dur,"ms"),s&&(t.calcMode="spline",t.keySplines=s.join(" "),t.keyTimes="0;1"),e&&(t.fill="freeze",l[r]=t.from,this.attr(l),a=i.quantity(t.begin||0).value,t.begin="indefinite"),o=this.elem("animate",i.extend({attributeName:r},t)),e&&setTimeout(function(){try{o._node.beginElement()}catch(e){l[r]=t.to,this.attr(l),o.remove()}}.bind(this),a),n&&o._node.addEventListener("beginEvent",function(){n.emit("animationBegin",{element:this,animate:o._node,params:t})}.bind(this)),o._node.addEventListener("endEvent",function(){n&&n.emit("animationEnd",{element:this,animate:o._node,params:t}),e&&(l[r]=t.to,this.attr(l),o.remove())}.bind(this))}t[r]instanceof Array?t[r].forEach(function(t){o.bind(this)(t,!1)}.bind(this)):o.bind(this)(t[r],e)}.bind(this)),this}}),i.Svg.isSupported=function(t){return e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#"+t,"1.1")};i.Svg.Easing={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]},i.Svg.List=i.Class.extend({constructor:function(t){var e=this;this.svgElements=[];for(var n=0;n<t.length;n++)this.svgElements.push(new i.Svg(t[n]));Object.keys(i.Svg.prototype).filter(function(t){return-1===["constructor","parent","querySelector","querySelectorAll","replace","append","classes","height","width"].indexOf(t)}).forEach(function(t){e[t]=function(){var n=Array.prototype.slice.call(arguments,0);return e.svgElements.forEach(function(e){i.Svg.prototype[t].apply(e,n)}),e}})}})}(window,document,t),function(t,e,i){"use strict";function n(t,e,n,r,o,a){var s=i.extend({command:o?t.toLowerCase():t.toUpperCase()},e,a?{data:a}:{});n.splice(r,0,s)}function r(t,e){t.forEach(function(i,n){o[i.command.toLowerCase()].forEach(function(r,o){e(i,r,n,o,t)})})}var o={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},a={accuracy:3};i.Svg.Path=i.Class.extend({constructor:function(t,e){this.pathElements=[],this.pos=0,this.close=t,this.options=i.extend({},a,e)},position:function(t){return void 0!==t?(this.pos=Math.max(0,Math.min(this.pathElements.length,t)),this):this.pos},remove:function(t){return this.pathElements.splice(this.pos,t),this},move:function(t,e,i,r){return n("M",{x:+t,y:+e},this.pathElements,this.pos++,i,r),this},line:function(t,e,i,r){return n("L",{x:+t,y:+e},this.pathElements,this.pos++,i,r),this},curve:function(t,e,i,r,o,a,s,l){return n("C",{x1:+t,y1:+e,x2:+i,y2:+r,x:+o,y:+a},this.pathElements,this.pos++,s,l),this},arc:function(t,e,i,r,o,a,s,l,c){return n("A",{rx:+t,ry:+e,xAr:+i,lAf:+r,sf:+o,x:+a,y:+s},this.pathElements,this.pos++,l,c),this},scale:function(t,e){return r(this.pathElements,function(i,n){i[n]*="x"===n[0]?t:e}),this},translate:function(t,e){return r(this.pathElements,function(i,n){i[n]+="x"===n[0]?t:e}),this},transform:function(t){return r(this.pathElements,function(e,i,n,r,o){var a=t(e,i,n,r,o);(a||0===a)&&(e[i]=a)}),this},parse:function(t){var e=t.replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce(function(t,e){return e.match(/[A-Za-z]/)&&t.push([]),t[t.length-1].push(e),t},[]);"Z"===e[e.length-1][0].toUpperCase()&&e.pop();var n=e.map(function(t){var e=t.shift(),n=o[e.toLowerCase()];return i.extend({command:e},n.reduce(function(e,i,n){return e[i]=+t[n],e},{}))}),r=[this.pos,0];return Array.prototype.push.apply(r,n),Array.prototype.splice.apply(this.pathElements,r),this.pos+=n.length,this},stringify:function(){var t=Math.pow(10,this.options.accuracy);return this.pathElements.reduce(function(e,i){var n=o[i.command.toLowerCase()].map(function(e){return this.options.accuracy?Math.round(i[e]*t)/t:i[e]}.bind(this));return e+i.command+n.join(",")}.bind(this),"")+(this.close?"Z":"")},clone:function(t){var e=new i.Svg.Path(t||this.close);return e.pos=this.pos,e.pathElements=this.pathElements.slice().map(function(t){return i.extend({},t)}),e.options=i.extend({},this.options),e},splitByCommand:function(t){var e=[new i.Svg.Path];return this.pathElements.forEach(function(n){n.command===t.toUpperCase()&&0!==e[e.length-1].pathElements.length&&e.push(new i.Svg.Path),e[e.length-1].pathElements.push(n)}),e}}),i.Svg.Path.elementDescriptions=o,i.Svg.Path.join=function(t,e,n){for(var r=new i.Svg.Path(e,n),o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.pathElements.length;s++)r.pathElements.push(a.pathElements[s]);return r}}(window,document,t),function(t,e,i){"use strict";var n={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}};i.Axis=i.Class.extend({constructor:function(t,e,i,r){this.units=t,this.counterUnits=t===n.x?n.y:n.x,this.chartRect=e,this.axisLength=e[t.rectEnd]-e[t.rectStart],this.gridOffset=e[t.rectOffset],this.ticks=i,this.options=r},createGridAndLabels:function(t,e,n,r,o){var a=r["axis"+this.units.pos.toUpperCase()],s=this.ticks.map(this.projectValue.bind(this)),l=this.ticks.map(a.labelInterpolationFnc);s.forEach(function(c,h){var u,d={x:0,y:0};u=s[h+1]?s[h+1]-c:Math.max(this.axisLength-c,30),i.isFalseyButZero(l[h])&&""!==l[h]||("x"===this.units.pos?(c=this.chartRect.x1+c,d.x=r.axisX.labelOffset.x,"start"===r.axisX.position?d.y=this.chartRect.padding.top+r.axisX.labelOffset.y+(n?5:20):d.y=this.chartRect.y1+r.axisX.labelOffset.y+(n?5:20)):(c=this.chartRect.y1-c,d.y=r.axisY.labelOffset.y-(n?u:0),"start"===r.axisY.position?d.x=n?this.chartRect.padding.left+r.axisY.labelOffset.x:this.chartRect.x1-10:d.x=this.chartRect.x2+r.axisY.labelOffset.x+10),a.showGrid&&i.createGrid(c,h,this,this.gridOffset,this.chartRect[this.counterUnits.len](),t,[r.classNames.grid,r.classNames[this.units.dir]],o),a.showLabel&&i.createLabel(c,u,h,l,this,a.offset,d,e,[r.classNames.label,r.classNames[this.units.dir],"start"===a.position?r.classNames[a.position]:r.classNames.end],n,o))}.bind(this))},projectValue:function(t,e,i){throw new Error("Base axis can't be instantiated!")}}),i.Axis.units=n}(window,document,t),function(t,e,i){"use strict";i.AutoScaleAxis=i.Axis.extend({constructor:function(t,e,n,r){var o=r.highLow||i.getHighLow(e,r,t.pos);this.bounds=i.getBounds(n[t.rectEnd]-n[t.rectStart],o,r.scaleMinSpace||20,r.onlyInteger),this.range={min:this.bounds.min,max:this.bounds.max},i.AutoScaleAxis.super.constructor.call(this,t,n,this.bounds.values,r)},projectValue:function(t){return this.axisLength*(+i.getMultiValue(t,this.units.pos)-this.bounds.min)/this.bounds.range}})}(window,document,t),function(t,e,i){"use strict";i.FixedScaleAxis=i.Axis.extend({constructor:function(t,e,n,r){var o=r.highLow||i.getHighLow(e,r,t.pos);this.divisor=r.divisor||1,this.ticks=r.ticks||i.times(this.divisor).map(function(t,e){return o.low+(o.high-o.low)/this.divisor*e}.bind(this)),this.ticks.sort(function(t,e){return t-e}),this.range={min:o.low,max:o.high},i.FixedScaleAxis.super.constructor.call(this,t,n,this.ticks,r),this.stepLength=this.axisLength/this.divisor},projectValue:function(t){return this.axisLength*(+i.getMultiValue(t,this.units.pos)-this.range.min)/(this.range.max-this.range.min)}})}(window,document,t),function(t,e,i){"use strict";i.StepAxis=i.Axis.extend({constructor:function(t,e,n,r){i.StepAxis.super.constructor.call(this,t,n,r.ticks,r);var o=Math.max(1,r.ticks.length-(r.stretch?1:0));this.stepLength=this.axisLength/o},projectValue:function(t,e){return this.stepLength*e}})}(window,document,t),function(t,e,i){"use strict";var n={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:i.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:i.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};i.Line=i.Base.extend({constructor:function(t,e,r,o){i.Line.super.constructor.call(this,t,e,n,i.extend({},n,r),o)},createChart:function(t){var e=i.normalizeData(this.data,t.reverseData,!0);this.svg=i.createSvg(this.container,t.width,t.height,t.classNames.chart);var r,o,a=this.svg.elem("g").addClass(t.classNames.gridGroup),s=this.svg.elem("g"),l=this.svg.elem("g").addClass(t.classNames.labelGroup),c=i.createChartRect(this.svg,t,n.padding);r=void 0===t.axisX.type?new i.StepAxis(i.Axis.units.x,e.normalized.series,c,i.extend({},t.axisX,{ticks:e.normalized.labels,stretch:t.fullWidth})):t.axisX.type.call(i,i.Axis.units.x,e.normalized.series,c,t.axisX),o=void 0===t.axisY.type?new i.AutoScaleAxis(i.Axis.units.y,e.normalized.series,c,i.extend({},t.axisY,{high:i.isNumeric(t.high)?t.high:t.axisY.high,low:i.isNumeric(t.low)?t.low:t.axisY.low})):t.axisY.type.call(i,i.Axis.units.y,e.normalized.series,c,t.axisY),r.createGridAndLabels(a,l,this.supportsForeignObject,t,this.eventEmitter),o.createGridAndLabels(a,l,this.supportsForeignObject,t,this.eventEmitter),t.showGridBackground&&i.createGridBackground(a,c,t.classNames.gridBackground,this.eventEmitter),e.raw.series.forEach(function(n,a){var l=s.elem("g");l.attr({"ct:series-name":n.name,"ct:meta":i.serialize(n.meta)}),l.addClass([t.classNames.series,n.className||t.classNames.series+"-"+i.alphaNumerate(a)].join(" "));var h=[],u=[];e.normalized.series[a].forEach(function(t,s){var l={x:c.x1+r.projectValue(t,s,e.normalized.series[a]),y:c.y1-o.projectValue(t,s,e.normalized.series[a])};h.push(l.x,l.y),u.push({value:t,valueIndex:s,meta:i.getMetaData(n,s)})}.bind(this));var d={lineSmooth:i.getSeriesOption(n,t,"lineSmooth"),showPoint:i.getSeriesOption(n,t,"showPoint"),showLine:i.getSeriesOption(n,t,"showLine"),showArea:i.getSeriesOption(n,t,"showArea"),areaBase:i.getSeriesOption(n,t,"areaBase")},f=("function"==typeof d.lineSmooth?d.lineSmooth:d.lineSmooth?i.Interpolation.monotoneCubic():i.Interpolation.none())(h,u);if(d.showPoint&&f.pathElements.forEach(function(e){var s=l.elem("line",{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y},t.classNames.point).attr({"ct:value":[e.data.value.x,e.data.value.y].filter(i.isNumeric).join(","),"ct:meta":i.serialize(e.data.meta)});this.eventEmitter.emit("draw",{type:"point",value:e.data.value,index:e.data.valueIndex,meta:e.data.meta,series:n,seriesIndex:a,axisX:r,axisY:o,group:l,element:s,x:e.x,y:e.y})}.bind(this)),d.showLine){var p=l.elem("path",{d:f.stringify()},t.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:e.normalized.series[a],path:f.clone(),chartRect:c,index:a,series:n,seriesIndex:a,seriesMeta:n.meta,axisX:r,axisY:o,group:l,element:p})}if(d.showArea&&o.range){var g=Math.max(Math.min(d.areaBase,o.range.max),o.range.min),m=c.y1-o.projectValue(g);f.splitByCommand("M").filter(function(t){return t.pathElements.length>1}).map(function(t){var e=t.pathElements[0],i=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,m).line(e.x,e.y).position(t.pathElements.length+1).line(i.x,m)}).forEach(function(i){var s=l.elem("path",{d:i.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:e.normalized.series[a],path:i.clone(),series:n,seriesIndex:a,axisX:r,axisY:o,chartRect:c,index:a,group:l,element:s})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:o.bounds,chartRect:c,axisX:r,axisY:o,svg:this.svg,options:t})}})}(window,document,t),function(t,e,i){"use strict";var n={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:i.noop,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:i.noop,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:"accumulate",horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:"ct-chart-bar",horizontalBars:"ct-horizontal-bars",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",bar:"ct-bar",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}};i.Bar=i.Base.extend({constructor:function(t,e,r,o){i.Bar.super.constructor.call(this,t,e,n,i.extend({},n,r),o)},createChart:function(t){var e,r;t.distributeSeries?(e=i.normalizeData(this.data,t.reverseData,t.horizontalBars?"x":"y")).normalized.series=e.normalized.series.map(function(t){return[t]}):e=i.normalizeData(this.data,t.reverseData,t.horizontalBars?"x":"y"),this.svg=i.createSvg(this.container,t.width,t.height,t.classNames.chart+(t.horizontalBars?" "+t.classNames.horizontalBars:""));var o=this.svg.elem("g").addClass(t.classNames.gridGroup),a=this.svg.elem("g"),s=this.svg.elem("g").addClass(t.classNames.labelGroup);if(t.stackBars&&0!==e.normalized.series.length){var l=i.serialMap(e.normalized.series,function(){return Array.prototype.slice.call(arguments).map(function(t){return t}).reduce(function(t,e){return{x:t.x+(e&&e.x)||0,y:t.y+(e&&e.y)||0}},{x:0,y:0})});r=i.getHighLow([l],t,t.horizontalBars?"x":"y")}else r=i.getHighLow(e.normalized.series,t,t.horizontalBars?"x":"y");r.high=+t.high||(0===t.high?0:r.high),r.low=+t.low||(0===t.low?0:r.low);var c,h,u,d,f,p=i.createChartRect(this.svg,t,n.padding);h=t.distributeSeries&&t.stackBars?e.normalized.labels.slice(0,1):e.normalized.labels,t.horizontalBars?(c=d=void 0===t.axisX.type?new i.AutoScaleAxis(i.Axis.units.x,e.normalized.series,p,i.extend({},t.axisX,{highLow:r,referenceValue:0})):t.axisX.type.call(i,i.Axis.units.x,e.normalized.series,p,i.extend({},t.axisX,{highLow:r,referenceValue:0})),u=f=void 0===t.axisY.type?new i.StepAxis(i.Axis.units.y,e.normalized.series,p,{ticks:h}):t.axisY.type.call(i,i.Axis.units.y,e.normalized.series,p,t.axisY)):(u=d=void 0===t.axisX.type?new i.StepAxis(i.Axis.units.x,e.normalized.series,p,{ticks:h}):t.axisX.type.call(i,i.Axis.units.x,e.normalized.series,p,t.axisX),c=f=void 0===t.axisY.type?new i.AutoScaleAxis(i.Axis.units.y,e.normalized.series,p,i.extend({},t.axisY,{highLow:r,referenceValue:0})):t.axisY.type.call(i,i.Axis.units.y,e.normalized.series,p,i.extend({},t.axisY,{highLow:r,referenceValue:0})));var g=t.horizontalBars?p.x1+c.projectValue(0):p.y1-c.projectValue(0),m=[];u.createGridAndLabels(o,s,this.supportsForeignObject,t,this.eventEmitter),c.createGridAndLabels(o,s,this.supportsForeignObject,t,this.eventEmitter),t.showGridBackground&&i.createGridBackground(o,p,t.classNames.gridBackground,this.eventEmitter),e.raw.series.forEach(function(n,r){var o,s,l=r-(e.raw.series.length-1)/2;o=t.distributeSeries&&!t.stackBars?u.axisLength/e.normalized.series.length/2:t.distributeSeries&&t.stackBars?u.axisLength/2:u.axisLength/e.normalized.series[r].length/2,(s=a.elem("g")).attr({"ct:series-name":n.name,"ct:meta":i.serialize(n.meta)}),s.addClass([t.classNames.series,n.className||t.classNames.series+"-"+i.alphaNumerate(r)].join(" ")),e.normalized.series[r].forEach(function(a,h){var v,y,b,x;if(x=t.distributeSeries&&!t.stackBars?r:t.distributeSeries&&t.stackBars?0:h,v=t.horizontalBars?{x:p.x1+c.projectValue(a&&a.x?a.x:0,h,e.normalized.series[r]),y:p.y1-u.projectValue(a&&a.y?a.y:0,x,e.normalized.series[r])}:{x:p.x1+u.projectValue(a&&a.x?a.x:0,x,e.normalized.series[r]),y:p.y1-c.projectValue(a&&a.y?a.y:0,h,e.normalized.series[r])},u instanceof i.StepAxis&&(u.options.stretch||(v[u.units.pos]+=o*(t.horizontalBars?-1:1)),v[u.units.pos]+=t.stackBars||t.distributeSeries?0:l*t.seriesBarDistance*(t.horizontalBars?-1:1)),b=m[h]||g,m[h]=b-(g-v[u.counterUnits.pos]),void 0!==a){var _={};_[u.units.pos+"1"]=v[u.units.pos],_[u.units.pos+"2"]=v[u.units.pos],!t.stackBars||"accumulate"!==t.stackMode&&t.stackMode?(_[u.counterUnits.pos+"1"]=g,_[u.counterUnits.pos+"2"]=v[u.counterUnits.pos]):(_[u.counterUnits.pos+"1"]=b,_[u.counterUnits.pos+"2"]=m[h]),_.x1=Math.min(Math.max(_.x1,p.x1),p.x2),_.x2=Math.min(Math.max(_.x2,p.x1),p.x2),_.y1=Math.min(Math.max(_.y1,p.y2),p.y1),_.y2=Math.min(Math.max(_.y2,p.y2),p.y1);var w=i.getMetaData(n,h);y=s.elem("line",_,t.classNames.bar).attr({"ct:value":[a.x,a.y].filter(i.isNumeric).join(","),"ct:meta":i.serialize(w)}),this.eventEmitter.emit("draw",i.extend({type:"bar",value:a,index:h,meta:w,series:n,seriesIndex:r,axisX:d,axisY:f,chartRect:p,group:s,element:y},_))}}.bind(this))}.bind(this)),this.eventEmitter.emit("created",{bounds:c.bounds,chartRect:p,axisX:d,axisY:f,svg:this.svg,options:t})}})}(window,document,t),function(t,e,i){"use strict";function n(t,e,i){var n=e.x>t.x;return n&&"explode"===i||!n&&"implode"===i?"start":n&&"implode"===i||!n&&"explode"===i?"end":"middle"}var r={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:"ct-chart-pie",chartDonut:"ct-chart-donut",series:"ct-series",slicePie:"ct-slice-pie",sliceDonut:"ct-slice-donut",sliceDonutSolid:"ct-slice-donut-solid",label:"ct-label"},startAngle:0,total:void 0,donut:!1,donutSolid:!1,donutWidth:60,showLabel:!0,labelOffset:0,labelPosition:"inside",labelInterpolationFnc:i.noop,labelDirection:"neutral",reverseData:!1,ignoreEmptyValues:!1};i.Pie=i.Base.extend({constructor:function(t,e,n,o){i.Pie.super.constructor.call(this,t,e,r,i.extend({},r,n),o)},createChart:function(t){var e,o,a,s,l,c=i.normalizeData(this.data),h=[],u=t.startAngle;this.svg=i.createSvg(this.container,t.width,t.height,t.donut?t.classNames.chartDonut:t.classNames.chartPie),o=i.createChartRect(this.svg,t,r.padding),a=Math.min(o.width()/2,o.height()/2),l=t.total||c.normalized.series.reduce(function(t,e){return t+e},0);var d=i.quantity(t.donutWidth);"%"===d.unit&&(d.value*=a/100),a-=t.donut&&!t.donutSolid?d.value/2:0,s="outside"===t.labelPosition||t.donut&&!t.donutSolid?a:"center"===t.labelPosition?0:t.donutSolid?a-d.value/2:a/2,s+=t.labelOffset;var f={x:o.x1+o.width()/2,y:o.y2+o.height()/2},p=1===c.raw.series.filter(function(t){return t.hasOwnProperty("value")?0!==t.value:0!==t}).length;c.raw.series.forEach(function(t,e){h[e]=this.svg.elem("g",null,null)}.bind(this)),t.showLabel&&(e=this.svg.elem("g",null,null)),c.raw.series.forEach(function(r,o){if(0!==c.normalized.series[o]||!t.ignoreEmptyValues){h[o].attr({"ct:series-name":r.name}),h[o].addClass([t.classNames.series,r.className||t.classNames.series+"-"+i.alphaNumerate(o)].join(" "));var g=l>0?u+c.normalized.series[o]/l*360:0,m=Math.max(0,u-(0===o||p?0:.2));g-m>=359.99&&(g=m+359.99);var v,y,b,x=i.polarToCartesian(f.x,f.y,a,m),_=i.polarToCartesian(f.x,f.y,a,g),w=new i.Svg.Path(!t.donut||t.donutSolid).move(_.x,_.y).arc(a,a,0,g-u>180,0,x.x,x.y);t.donut?t.donutSolid&&(b=a-d.value,v=i.polarToCartesian(f.x,f.y,b,u-(0===o||p?0:.2)),y=i.polarToCartesian(f.x,f.y,b,g),w.line(v.x,v.y),w.arc(b,b,0,g-u>180,1,y.x,y.y)):w.line(f.x,f.y);var S=t.classNames.slicePie;t.donut&&(S=t.classNames.sliceDonut,t.donutSolid&&(S=t.classNames.sliceDonutSolid));var C=h[o].elem("path",{d:w.stringify()},S);if(C.attr({"ct:value":c.normalized.series[o],"ct:meta":i.serialize(r.meta)}),t.donut&&!t.donutSolid&&(C._node.style.strokeWidth=d.value+"px"),this.eventEmitter.emit("draw",{type:"slice",value:c.normalized.series[o],totalDataSum:l,index:o,meta:r.meta,series:r,group:h[o],element:C,path:w.clone(),center:f,radius:a,startAngle:u,endAngle:g}),t.showLabel){var k;k=1===c.raw.series.length?{x:f.x,y:f.y}:i.polarToCartesian(f.x,f.y,s,u+(g-u)/2);var T;T=c.normalized.labels&&!i.isFalseyButZero(c.normalized.labels[o])?c.normalized.labels[o]:c.normalized.series[o];var A=t.labelInterpolationFnc(T,o);if(A||0===A){var D=e.elem("text",{dx:k.x,dy:k.y,"text-anchor":n(f,k,t.labelDirection)},t.classNames.label).text(""+A);this.eventEmitter.emit("draw",{type:"label",index:o,group:e,element:D,text:""+A,x:k.x,y:k.y})}}u=g}}.bind(this)),this.eventEmitter.emit("created",{chartRect:o,svg:this.svg,options:t})},determineAnchorPosition:n})}(window,document,t),t}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.c3=e()}(this,function(){"use strict";function t(t,e){var i=this;i.component=t,i.params=e||{},i.d3=t.d3,i.scale=i.d3.scale.linear(),i.range,i.orient="bottom",i.innerTickSize=6,i.outerTickSize=this.params.withOuterTick?6:0,i.tickPadding=3,i.tickValues=null,i.tickFormat,i.tickArguments,i.tickOffset=0,i.tickCulling=!0,i.tickCentered,i.tickTextCharSize,i.tickTextRotate=i.params.tickTextRotate,i.tickLength,i.axis=i.generateAxis()}function e(t,e,i){this.owner=t,M.chart.internal[e]=i}function i(t){var e=this.internal=new n(this);e.loadConfig(t),e.beforeInit(t),e.init(),e.afterInit(t),function t(e,i,n){Object.keys(e).forEach(function(r){i[r]=e[r].bind(n),Object.keys(e[r]).length>0&&t(e[r],i[r],n)})}(A,this,this)}function n(t){var e=this;e.d3=window.d3?window.d3:"undefined"!=typeof require?require("d3"):void 0,e.api=t,e.config=e.getDefaultConfig(),e.data={},e.cache={},e.axes={}}var r,o,a={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"},s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},c=function(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)},h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},u=function(t){return t||0===t},d=function(t){return"function"==typeof t},f=function(t){return Array.isArray(t)},p=function(t){return"string"==typeof t},g=function(t){return void 0===t},m=function(t){return void 0!==t},v=function(t){return 10*Math.ceil(t/10)},y=function(t){return Math.ceil(t)+.5},b=function(t){return t[1]-t[0]},x=function(t){return void 0===t||null===t||p(t)&&0===t.length||"object"===(void 0===t?"undefined":s(t))&&0===Object.keys(t).length},_=function(t){return!D.isEmpty(t)},w=function(t,e,i){return m(t[e])?t[e]:i},S=function(t,e){var i=!1;return Object.keys(t).forEach(function(n){t[n]===e&&(i=!0)}),i},C=function(t){return"string"==typeof t?t.replace(/</g,"<").replace(/>/g,">"):t},k=function(t){var e=t.getBoundingClientRect(),i=[t.pathSegList.getItem(0),t.pathSegList.getItem(1)];return{x:i[0].x,y:Math.min(i[0].y,i[1].y),width:e.width,height:e.height}};(o=t.prototype).axisX=function(t,e,i){t.attr("transform",function(t){return"translate("+Math.ceil(e(t)+i)+", 0)"})},o.axisY=function(t,e){t.attr("transform",function(t){return"translate(0,"+Math.ceil(e(t))+")"})},o.scaleExtent=function(t){var e=t[0],i=t[t.length-1];return e<i?[e,i]:[i,e]},o.generateTicks=function(t){var e,i,n=this,r=[];if(t.ticks)return t.ticks.apply(t,n.tickArguments);for(i=t.domain(),e=Math.ceil(i[0]);e<i[1];e++)r.push(e);return r.length>0&&r[0]>0&&r.unshift(r[0]-(r[1]-r[0])),r},o.copyScale=function(){var t,e=this,i=e.scale.copy();return e.params.isCategory&&(t=e.scale.domain(),i.domain([t[0],t[1]-1])),i},o.textFormatted=function(t){var e=this,i=e.tickFormat?e.tickFormat(t):t;return void 0!==i?i:""},o.updateRange=function(){var t=this;return t.range=t.scale.rangeExtent?t.scale.rangeExtent():t.scaleExtent(t.scale.range()),t.range},o.updateTickTextCharSize=function(t){var e=this;if(e.tickTextCharSize)return e.tickTextCharSize;var i={h:11.5,w:5.5};return t.select("text").text(function(t){return e.textFormatted(t)}).each(function(t){var n=this.getBoundingClientRect(),r=e.textFormatted(t),o=n.height,a=r?n.width/r.length:void 0;o&&a&&(i.h=o,i.w=a)}).text(""),e.tickTextCharSize=i,i},o.transitionise=function(t){return this.params.withoutTransition?t:this.d3.transition(t)},o.isVertical=function(){return"left"===this.orient||"right"===this.orient},o.tspanData=function(t,e,i,n){var r=this,o=r.params.tickMultiline?r.splitTickText(t,i,n):[].concat(r.textFormatted(t));return o.map(function(t){return{index:e,splitted:t,length:o.length}})},o.splitTickText=function(t,e,i){function n(t,e){o=void 0;for(var i=1;i<e.length;i++)if(" "===e.charAt(i)&&(o=i),r=e.substr(0,i+1),a=s.tickTextCharSize.w*r.length,c<a)return n(t.concat(e.substr(0,o||i)),e.slice(o?o+1:i));return t.concat(e)}var r,o,a,s=this,l=s.textFormatted(t),c=s.params.tickWidth;return"[object Array]"===Object.prototype.toString.call(l)?l:((!c||c<=0)&&(c=s.isVertical()?95:s.params.isCategory?Math.ceil(i(e[1])-i(e[0]))-12:110),n([],l+""))},o.updateTickLength=function(){var t=this;t.tickLength=Math.max(t.innerTickSize,0)+t.tickPadding},o.lineY2=function(t){var e=this,i=e.scale(t)+(e.tickCentered?0:e.tickOffset);return e.range[0]<i&&i<e.range[1]?e.innerTickSize:0},o.textY=function(){var t=this,e=t.tickTextRotate;return e?11.5-e/15*2.5*(e>0?1:-1):t.tickLength},o.textTransform=function(){var t=this.tickTextRotate;return t?"rotate("+t+")":""},o.textTextAnchor=function(){var t=this.tickTextRotate;return t?t>0?"start":"end":"middle"},o.tspanDx=function(){var t=this.tickTextRotate;return t?8*Math.sin(Math.PI*(t/180)):0},o.tspanDy=function(t,e){var i=this,n=i.tickTextCharSize.h;return 0===e&&(n=i.isVertical()?-((t.length-1)*(i.tickTextCharSize.h/2)-3):".71em"),n},o.generateAxis=function(){function t(r){r.each(function(){var r,o,a,s=t.g=i.select(this),l=this.__chart__||e.scale,c=this.__chart__=e.copyScale(),h=e.tickValues?e.tickValues:e.generateTicks(c),u=s.selectAll(".tick").data(h,c),d=u.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),f=u.exit().remove(),p=e.transitionise(u).style("opacity",1);n.isCategory?(e.tickOffset=Math.ceil((c(1)-c(0))/2),o=e.tickCentered?0:e.tickOffset,a=e.tickCentered?e.tickOffset:0):e.tickOffset=o=0,d.append("line"),d.append("text"),e.updateRange(),e.updateTickLength(),e.updateTickTextCharSize(s.select(".tick"));var g=p.select("line"),m=p.select("text"),v=u.select("text").selectAll("tspan").data(function(t,i){return e.tspanData(t,i,h,c)});v.enter().append("tspan"),v.exit().remove(),v.text(function(t){return t.splitted});var y=s.selectAll(".domain").data([0]),b=(y.enter().append("path").attr("class","domain"),e.transitionise(y));switch(e.orient){case"bottom":r=e.axisX,g.attr("x1",o).attr("x2",o).attr("y2",function(t,i){return e.lineY2(t,i)}),m.attr("x",0).attr("y",function(t,i){return e.textY(t,i)}).attr("transform",function(t,i){return e.textTransform(t,i)}).style("text-anchor",function(t,i){return e.textTextAnchor(t,i)}),v.attr("x",0).attr("dy",function(t,i){return e.tspanDy(t,i)}).attr("dx",function(t,i){return e.tspanDx(t,i)}),b.attr("d","M"+e.range[0]+","+e.outerTickSize+"V0H"+e.range[1]+"V"+e.outerTickSize);break;case"top":r=e.axisX,g.attr("x2",0).attr("y2",-e.innerTickSize),m.attr("x",0).attr("y",-e.tickLength).style("text-anchor","middle"),v.attr("x",0).attr("dy","0em"),b.attr("d","M"+e.range[0]+","+-e.outerTickSize+"V0H"+e.range[1]+"V"+-e.outerTickSize);break;case"left":r=e.axisY,g.attr("x2",-e.innerTickSize).attr("y1",a).attr("y2",a),m.attr("x",-e.tickLength).attr("y",e.tickOffset).style("text-anchor","end"),v.attr("x",-e.tickLength).attr("dy",function(t,i){return e.tspanDy(t,i)}),b.attr("d","M"+-e.outerTickSize+","+e.range[0]+"H0V"+e.range[1]+"H"+-e.outerTickSize);break;case"right":r=e.axisY,g.attr("x2",e.innerTickSize).attr("y2",0),m.attr("x",e.tickLength).attr("y",0).style("text-anchor","start"),v.attr("x",e.tickLength).attr("dy",function(t,i){return e.tspanDy(t,i)}),b.attr("d","M"+e.outerTickSize+","+e.range[0]+"H0V"+e.range[1]+"H"+e.outerTickSize)}if(c.rangeBand){var x=c,_=x.rangeBand()/2;l=c=function(t){return x(t)+_}}else l.rangeBand?l=c:f.call(r,c,e.tickOffset);d.call(r,l,e.tickOffset),p.call(r,c,e.tickOffset)})}var e=this,i=e.d3,n=e.params;return t.scale=function(i){return arguments.length?(e.scale=i,t):e.scale},t.orient=function(i){return arguments.length?(e.orient=i in{top:1,right:1,bottom:1,left:1}?i+"":"bottom",t):e.orient},t.tickFormat=function(i){return arguments.length?(e.tickFormat=i,t):e.tickFormat},t.tickCentered=function(i){return arguments.length?(e.tickCentered=i,t):e.tickCentered},t.tickOffset=function(){return e.tickOffset},t.tickInterval=function(){var i;return(i=n.isCategory?2*e.tickOffset:(t.g.select("path.domain").node().getTotalLength()-2*e.outerTickSize)/t.g.selectAll("line").size())===1/0?0:i},t.ticks=function(){return arguments.length?(e.tickArguments=arguments,t):e.tickArguments},t.tickCulling=function(i){return arguments.length?(e.tickCulling=i,t):e.tickCulling},t.tickValues=function(i){if("function"==typeof i)e.tickValues=function(){return i(e.scale.domain())};else{if(!arguments.length)return e.tickValues;e.tickValues=i}return t},t};var T=function(i){function n(e){l(this,n);var i={fn:r,internal:{fn:o}},a=h(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e,"axis",i));return a.d3=e.d3,a.internal=t,a}return c(n,e),n}();(r=T.prototype).init=function(){var t=this.owner,e=t.config,i=t.main;t.axes.x=i.append("g").attr("class",a.axis+" "+a.axisX).attr("clip-path",t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",e.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",a.axisXLabel).attr("transform",e.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=i.append("g").attr("class",a.axis+" "+a.axisY).attr("clip-path",e.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",e.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",a.axisYLabel).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=i.append("g").attr("class",a.axis+" "+a.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",e.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",a.axisY2Label).attr("transform",e.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},r.getXAxis=function(t,e,i,n,r,o,a){var s=this.owner,l=s.config,c={isCategory:s.isCategorized(),withOuterTick:r,tickMultiline:l.axis_x_tick_multiline,tickWidth:l.axis_x_tick_width,tickTextRotate:a?0:l.axis_x_tick_rotate,withoutTransition:o},h=new this.internal(this,c).axis.scale(t).orient(e);return s.isTimeSeries()&&n&&"function"!=typeof n&&(n=n.map(function(t){return s.parseDate(t)})),h.tickFormat(i).tickValues(n),s.isCategorized()&&(h.tickCentered(l.axis_x_tick_centered),x(l.axis_x_tick_culling)&&(l.axis_x_tick_culling=!1)),h},r.updateXAxisTickValues=function(t,e){var i,n=this.owner,r=n.config;return(r.axis_x_tick_fit||r.axis_x_tick_count)&&(i=this.generateTickValues(n.mapTargetsToUniqueXs(t),r.axis_x_tick_count,n.isTimeSeries())),e?e.tickValues(i):(n.xAxis.tickValues(i),n.subXAxis.tickValues(i)),i},r.getYAxis=function(t,e,i,n,r,o,a){var s=this.owner,l=s.config,c={withOuterTick:r,withoutTransition:o,tickTextRotate:a?0:l.axis_y_tick_rotate},h=new this.internal(this,c).axis.scale(t).orient(e).tickFormat(i);return s.isTimeSeriesY()?h.ticks(s.d3.time[l.axis_y_tick_time_value],l.axis_y_tick_time_interval):h.tickValues(n),h},r.getId=function(t){var e=this.owner.config;return t in e.data_axes?e.data_axes[t]:"y"},r.getXAxisTickFormat=function(){var t=this.owner,e=t.config,i=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(t){return t<0?t.toFixed(0):t};return e.axis_x_tick_format&&(d(e.axis_x_tick_format)?i=e.axis_x_tick_format:t.isTimeSeries()&&(i=function(i){return i?t.axisTimeFormat(e.axis_x_tick_format)(i):""})),d(i)?function(e){return i.call(t,e)}:i},r.getTickValues=function(t,e){return t||(e?e.tickValues():void 0)},r.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},r.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},r.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},r.getLabelOptionByAxisId=function(t){var e,i=this.owner.config;return"y"===t?e=i.axis_y_label:"y2"===t?e=i.axis_y2_label:"x"===t&&(e=i.axis_x_label),e},r.getLabelText=function(t){var e=this.getLabelOptionByAxisId(t);return p(e)?e:e?e.text:null},r.setLabelText=function(t,e){var i=this.owner.config,n=this.getLabelOptionByAxisId(t);p(n)?"y"===t?i.axis_y_label=e:"y2"===t?i.axis_y2_label=e:"x"===t&&(i.axis_x_label=e):n&&(n.text=e)},r.getLabelPosition=function(t,e){var i=this.getLabelOptionByAxisId(t),n=i&&"object"===(void 0===i?"undefined":s(i))&&i.position?i.position:e;return{isInner:n.indexOf("inner")>=0,isOuter:n.indexOf("outer")>=0,isLeft:n.indexOf("left")>=0,isCenter:n.indexOf("center")>=0,isRight:n.indexOf("right")>=0,isTop:n.indexOf("top")>=0,isMiddle:n.indexOf("middle")>=0,isBottom:n.indexOf("bottom")>=0}},r.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},r.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},r.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},r.getLabelPositionById=function(t){return"y2"===t?this.getY2AxisLabelPosition():"y"===t?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},r.textForXAxisLabel=function(){return this.getLabelText("x")},r.textForYAxisLabel=function(){return this.getLabelText("y")},r.textForY2AxisLabel=function(){return this.getLabelText("y2")},r.xForAxisLabel=function(t,e){var i=this.owner;return t?e.isLeft?0:e.isCenter?i.width/2:i.width:e.isBottom?-i.height:e.isMiddle?-i.height/2:0},r.dxForAxisLabel=function(t,e){return t?e.isLeft?"0.5em":e.isRight?"-0.5em":"0":e.isTop?"-0.5em":e.isBottom?"0.5em":"0"},r.textAnchorForAxisLabel=function(t,e){return t?e.isLeft?"start":e.isCenter?"middle":"end":e.isBottom?"start":e.isMiddle?"middle":"end"},r.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},r.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},r.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},r.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},r.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},r.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},r.dyForXAxisLabel=function(){var t=this.owner.config,e=this.getXAxisLabelPosition();return t.axis_rotated?e.isInner?"1.2em":-25-this.getMaxTickWidth("x"):e.isInner?"-0.5em":t.axis_x_height?t.axis_x_height-10:"3em"},r.dyForYAxisLabel=function(){var t=this.owner,e=this.getYAxisLabelPosition();return t.config.axis_rotated?e.isInner?"-0.5em":"3em":e.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},r.dyForY2AxisLabel=function(){var t=this.owner,e=this.getY2AxisLabelPosition();return t.config.axis_rotated?e.isInner?"1.2em":"-2.2em":e.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},r.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},r.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},r.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},r.getMaxTickWidth=function(t,e){var i,n,r,o,a=this.owner,s=a.config,l=0;return e&&a.currentMaxTickWidths[t]?a.currentMaxTickWidths[t]:(a.svg&&(i=a.filterTargetsToShow(a.data.targets),"y"===t?(n=a.y.copy().domain(a.getYDomain(i,"y")),r=this.getYAxis(n,a.yOrient,s.axis_y_tick_format,a.yAxisTickValues,!1,!0,!0)):"y2"===t?(n=a.y2.copy().domain(a.getYDomain(i,"y2")),r=this.getYAxis(n,a.y2Orient,s.axis_y2_tick_format,a.y2AxisTickValues,!1,!0,!0)):(n=a.x.copy().domain(a.getXDomain(i)),r=this.getXAxis(n,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(i,r)),(o=a.d3.select("body").append("div").classed("c3",!0)).append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0).append("g").call(r).each(function(){a.d3.select(this).selectAll("text").each(function(){var t=this.getBoundingClientRect();l<t.width&&(l=t.width)}),o.remove()})),a.currentMaxTickWidths[t]=l<=0?a.currentMaxTickWidths[t]:l,a.currentMaxTickWidths[t])},r.updateLabels=function(t){var e=this.owner,i=e.main.select("."+a.axisX+" ."+a.axisXLabel),n=e.main.select("."+a.axisY+" ."+a.axisYLabel),r=e.main.select("."+a.axisY2+" ."+a.axisY2Label);(t?i.transition():i).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?n.transition():n).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?r.transition():r).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},r.getPadding=function(t,e,i,n){var r="number"==typeof t?t:t[e];return u(r)?"ratio"===t.unit?t[e]*n:this.convertPixelsToAxisPadding(r,n):i},r.convertPixelsToAxisPadding=function(t,e){var i=this.owner;return e*(t/(i.config.axis_rotated?i.width:i.height))},r.generateTickValues=function(t,e,i){var n,r,o,a,s,l,c,h=t;if(e)if(1===(n=d(e)?e():e))h=[t[0]];else if(2===n)h=[t[0],t[t.length-1]];else if(n>2){for(a=n-2,r=t[0],s=((o=t[t.length-1])-r)/(a+1),h=[r],l=0;l<a;l++)c=+r+s*(l+1),h.push(i?new Date(c):c);h.push(o)}return i||(h=h.sort(function(t,e){return t-e})),h},r.generateTransitions=function(t){var e=this.owner.axes;return{axisX:t?e.x.transition().duration(t):e.x,axisY:t?e.y.transition().duration(t):e.y,axisY2:t?e.y2.transition().duration(t):e.y2,axisSubX:t?e.subx.transition().duration(t):e.subx}},r.redraw=function(t,e){var i=this.owner;i.axes.x.style("opacity",e?0:1),i.axes.y.style("opacity",e?0:1),i.axes.y2.style("opacity",e?0:1),i.axes.subx.style("opacity",e?0:1),t.axisX.call(i.xAxis),t.axisY.call(i.yAxis),t.axisY2.call(i.y2Axis),t.axisSubX.call(i.subXAxis)};var A,D,M={version:"0.4.18"};return M.generate=function(t){return new i(t)},M.chart={fn:i.prototype,internal:{fn:n.prototype}},A=M.chart.fn,D=M.chart.internal.fn,D.beforeInit=function(){},D.afterInit=function(){},D.init=function(){var t=this,e=t.config;if(t.initParams(),e.data_url)t.convertUrlToData(e.data_url,e.data_mimeType,e.data_headers,e.data_keys,t.initWithData);else if(e.data_json)t.initWithData(t.convertJsonToData(e.data_json,e.data_keys));else if(e.data_rows)t.initWithData(t.convertRowsToData(e.data_rows));else{if(!e.data_columns)throw Error("url or json or rows or columns is required.");t.initWithData(t.convertColumnsToData(e.data_columns))}},D.initParams=function(){var t=this,e=t.d3,i=t.config;t.clipId="c3-"+ +new Date+"-clip",t.clipIdForXAxis=t.clipId+"-xaxis",t.clipIdForYAxis=t.clipId+"-yaxis",t.clipIdForGrid=t.clipId+"-grid",t.clipIdForSubchart=t.clipId+"-subchart",t.clipPath=t.getClipPath(t.clipId),t.clipPathForXAxis=t.getClipPath(t.clipIdForXAxis),t.clipPathForYAxis=t.getClipPath(t.clipIdForYAxis),t.clipPathForGrid=t.getClipPath(t.clipIdForGrid),t.clipPathForSubchart=t.getClipPath(t.clipIdForSubchart),t.dragStart=null,t.dragging=!1,t.flowing=!1,t.cancelClick=!1,t.mouseover=!1,t.transiting=!1,t.color=t.generateColor(),t.levelColor=t.generateLevelColor(),t.dataTimeFormat=i.data_xLocaltime?e.time.format:e.time.format.utc,t.axisTimeFormat=i.axis_x_localtime?e.time.format:e.time.format.utc,t.defaultAxisTimeFormat=t.axisTimeFormat.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%-m/%-d",function(t){return t.getDay()&&1!==t.getDate()}],["%-m/%-d",function(t){return 1!==t.getDate()}],["%-m/%-d",function(t){return t.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),t.hiddenTargetIds=[],t.hiddenLegendIds=[],t.focusedTargetIds=[],t.defocusedTargetIds=[],t.xOrient=i.axis_rotated?"left":"bottom",t.yOrient=i.axis_rotated?i.axis_y_inner?"top":"bottom":i.axis_y_inner?"right":"left",t.y2Orient=i.axis_rotated?i.axis_y2_inner?"bottom":"top":i.axis_y2_inner?"left":"right",t.subXOrient=i.axis_rotated?"left":"bottom",t.isLegendRight="right"===i.legend_position,t.isLegendInset="inset"===i.legend_position,t.isLegendTop="top-left"===i.legend_inset_anchor||"top-right"===i.legend_inset_anchor,t.isLegendLeft="top-left"===i.legend_inset_anchor||"bottom-left"===i.legend_inset_anchor,t.legendStep=0,t.legendItemWidth=0,t.legendItemHeight=0,t.currentMaxTickWidths={x:0,y:0,y2:0},t.rotated_padding_left=30,t.rotated_padding_right=i.axis_rotated&&!i.axis_x_show?0:30,t.rotated_padding_top=5,t.withoutFadeIn={},t.intervalForObserveInserted=void 0,t.axes.subx=e.selectAll([])},D.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},D.initWithData=function(t){var e,i,n=this,r=n.d3,o=n.config,s=!0;n.axis=new T(n),n.initPie&&n.initPie(),n.initBrush&&n.initBrush(),n.initZoom&&n.initZoom(),o.bindto?"function"==typeof o.bindto.node?n.selectChart=o.bindto:n.selectChart=r.select(o.bindto):n.selectChart=r.selectAll([]),n.selectChart.empty()&&(n.selectChart=r.select(document.createElement("div")).style("opacity",0),n.observeInserted(n.selectChart),s=!1),n.selectChart.html("").classed("c3",!0),n.data.xs={},n.data.targets=n.convertDataToTargets(t),o.data_filter&&(n.data.targets=n.data.targets.filter(o.data_filter)),o.data_hide&&n.addHiddenTargetIds(!0===o.data_hide?n.mapToIds(n.data.targets):o.data_hide),o.legend_hide&&n.addHiddenLegendIds(!0===o.legend_hide?n.mapToIds(n.data.targets):o.legend_hide),n.hasType("gauge")&&(o.legend_show=!1),n.updateSizes(),n.updateScales(),n.x.domain(r.extent(n.getXDomain(n.data.targets))),n.y.domain(n.getYDomain(n.data.targets,"y")),n.y2.domain(n.getYDomain(n.data.targets,"y2")),n.subX.domain(n.x.domain()),n.subY.domain(n.y.domain()),n.subY2.domain(n.y2.domain()),n.orgXDomain=n.x.domain(),n.brush&&n.brush.scale(n.subX),o.zoom_enabled&&n.zoom.scale(n.x),n.svg=n.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return o.onmouseover.call(n)}).on("mouseleave",function(){return o.onmouseout.call(n)}),n.config.svg_classname&&n.svg.attr("class",n.config.svg_classname),e=n.svg.append("defs"),n.clipChart=n.appendClip(e,n.clipId),n.clipXAxis=n.appendClip(e,n.clipIdForXAxis),n.clipYAxis=n.appendClip(e,n.clipIdForYAxis),n.clipGrid=n.appendClip(e,n.clipIdForGrid),n.clipSubchart=n.appendClip(e,n.clipIdForSubchart),n.updateSvgSize(),i=n.main=n.svg.append("g").attr("transform",n.getTranslate("main")),n.initSubchart&&n.initSubchart(),n.initTooltip&&n.initTooltip(),n.initLegend&&n.initLegend(),n.initTitle&&n.initTitle(),i.append("text").attr("class",a.text+" "+a.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),n.initRegion(),n.initGrid(),i.append("g").attr("clip-path",n.clipPath).attr("class",a.chart),o.grid_lines_front&&n.initGridLines(),n.initEventRect(),n.initChartElements(),i.insert("rect",o.zoom_privileged?null:"g."+a.regions).attr("class",a.zoomRect).attr("width",n.width).attr("height",n.height).style("opacity",0).on("dblclick.zoom",null),o.axis_x_extent&&n.brush.extent(n.getDefaultExtent()),n.axis.init(),n.updateTargets(n.data.targets),s&&(n.updateDimension(),n.config.oninit.call(n),n.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),n.bindResize(),n.api.element=n.selectChart.node()},D.smoothLines=function(t,e){var i=this;"grid"===e&&t.each(function(){var t=i.d3.select(this),e=t.attr("x1"),n=t.attr("x2"),r=t.attr("y1"),o=t.attr("y2");t.attr({x1:Math.ceil(e),x2:Math.ceil(n),y1:Math.ceil(r),y2:Math.ceil(o)})})},D.updateSizes=function(){var t=this,e=t.config,i=t.legend?t.getLegendHeight():0,n=t.legend?t.getLegendWidth():0,r=t.isLegendRight||t.isLegendInset?0:i,o=t.hasArcType(),a=e.axis_rotated||o?0:t.getHorizontalAxisHeight("x"),s=e.subchart_show&&!o?e.subchart_size_height+a:0;t.currentWidth=t.getCurrentWidth(),t.currentHeight=t.getCurrentHeight(),t.margin=e.axis_rotated?{top:t.getHorizontalAxisHeight("y2")+t.getCurrentPaddingTop(),right:o?0:t.getCurrentPaddingRight(),bottom:t.getHorizontalAxisHeight("y")+r+t.getCurrentPaddingBottom(),left:s+(o?0:t.getCurrentPaddingLeft())}:{top:4+t.getCurrentPaddingTop(),right:o?0:t.getCurrentPaddingRight(),bottom:a+s+r+t.getCurrentPaddingBottom(),left:o?0:t.getCurrentPaddingLeft()},t.margin2=e.axis_rotated?{top:t.margin.top,right:NaN,bottom:20+r,left:t.rotated_padding_left}:{top:t.currentHeight-s-r,right:NaN,bottom:a+r,left:t.margin.left},t.margin3={top:0,right:NaN,bottom:0,left:0},t.updateSizeForLegend&&t.updateSizeForLegend(i,n),t.width=t.currentWidth-t.margin.left-t.margin.right,t.height=t.currentHeight-t.margin.top-t.margin.bottom,t.width<0&&(t.width=0),t.height<0&&(t.height=0),t.width2=e.axis_rotated?t.margin.left-t.rotated_padding_left-t.rotated_padding_right:t.width,t.height2=e.axis_rotated?t.height:t.currentHeight-t.margin2.top-t.margin2.bottom,t.width2<0&&(t.width2=0),t.height2<0&&(t.height2=0),t.arcWidth=t.width-(t.isLegendRight?n+10:0),t.arcHeight=t.height-(t.isLegendRight?0:10),t.hasType("gauge")&&!e.gauge_fullCircle&&(t.arcHeight+=t.height-t.getGaugeLabelHeight()),t.updateRadius&&t.updateRadius(),t.isLegendRight&&o&&(t.margin3.left=t.arcWidth/2+1.1*t.radiusExpanded)},D.updateTargets=function(t){var e=this;e.updateTargetsForText(t),e.updateTargetsForBar(t),e.updateTargetsForLine(t),e.hasArcType()&&e.updateTargetsForArc&&e.updateTargetsForArc(t),e.updateTargetsForSubchart&&e.updateTargetsForSubchart(t),e.showTargets()},D.showTargets=function(){var t=this;t.svg.selectAll("."+a.target).filter(function(e){return t.isTargetToShow(e.id)}).transition().duration(t.config.transition_duration).style("opacity",1)},D.redraw=function(t,e){var i,n,r,o,s,l,c,h,u,d,f,p,g,m,v,y,b,x,_,S,C,k,T,A,D,M,E,P,L,I=this,O=I.main,R=I.d3,N=I.config,F=I.getShapeIndices(I.isAreaType),z=I.getShapeIndices(I.isBarType),H=I.getShapeIndices(I.isLineType),$=I.hasArcType(),V=I.filterTargetsToShow(I.data.targets),B=I.xv.bind(I);if(t=t||{},i=w(t,"withY",!0),n=w(t,"withSubchart",!0),r=w(t,"withTransition",!0),l=w(t,"withTransform",!1),c=w(t,"withUpdateXDomain",!1),h=w(t,"withUpdateOrgXDomain",!1),u=w(t,"withTrimXDomain",!0),g=w(t,"withUpdateXAxis",c),d=w(t,"withLegend",!1),f=w(t,"withEventRect",!0),p=w(t,"withDimension",!0),o=w(t,"withTransitionForExit",r),s=w(t,"withTransitionForAxis",r),_=r?N.transition_duration:0,S=o?_:0,C=s?_:0,e=e||I.axis.generateTransitions(C),d&&N.legend_show?I.updateLegend(I.mapToIds(I.data.targets),t,e):p&&I.updateDimension(!0),I.isCategorized()&&0===V.length&&I.x.domain([0,I.axes.x.selectAll(".tick").size()]),V.length?(I.updateXDomain(V,c,h,u),N.axis_x_tick_values||(A=I.axis.updateXAxisTickValues(V))):(I.xAxis.tickValues([]),I.subXAxis.tickValues([])),N.zoom_rescale&&!t.flow&&(E=I.x.orgDomain()),I.y.domain(I.getYDomain(V,"y",E)),I.y2.domain(I.getYDomain(V,"y2",E)),!N.axis_y_tick_values&&N.axis_y_tick_count&&I.yAxis.tickValues(I.axis.generateTickValues(I.y.domain(),N.axis_y_tick_count)),!N.axis_y2_tick_values&&N.axis_y2_tick_count&&I.y2Axis.tickValues(I.axis.generateTickValues(I.y2.domain(),N.axis_y2_tick_count)),I.axis.redraw(e,$),I.axis.updateLabels(r),(c||g)&&V.length)if(N.axis_x_tick_culling&&A){for(D=1;D<A.length;D++)if(A.length/D<N.axis_x_tick_culling_max){M=D;break}I.svg.selectAll("."+a.axisX+" .tick text").each(function(t){var e=A.indexOf(t);e>=0&&R.select(this).style("display",e%M?"none":"block")})}else I.svg.selectAll("."+a.axisX+" .tick text").style("display","block");m=I.generateDrawArea?I.generateDrawArea(F,!1):void 0,v=I.generateDrawBar?I.generateDrawBar(z):void 0,y=I.generateDrawLine?I.generateDrawLine(H,!1):void 0,b=I.generateXYForText(F,z,H,!0),x=I.generateXYForText(F,z,H,!1),i&&(I.subY.domain(I.getYDomain(V,"y")),I.subY2.domain(I.getYDomain(V,"y2"))),I.updateXgridFocus(),O.select("text."+a.text+"."+a.empty).attr("x",I.width/2).attr("y",I.height/2).text(N.data_empty_label_text).transition().style("opacity",V.length?0:1),I.updateGrid(_),I.updateRegion(_),I.updateBar(S),I.updateLine(S),I.updateArea(S),I.updateCircle(),I.hasDataLabel()&&I.updateText(S),I.redrawTitle&&I.redrawTitle(),I.redrawArc&&I.redrawArc(_,S,l),I.redrawSubchart&&I.redrawSubchart(n,e,_,S,F,z,H),O.selectAll("."+a.selectedCircles).filter(I.isBarType.bind(I)).selectAll("circle").remove(),N.interaction_enabled&&!t.flow&&f&&(I.redrawEventRect(),I.updateZoom&&I.updateZoom()),I.updateCircleY(),P=(I.config.axis_rotated?I.circleY:I.circleX).bind(I),L=(I.config.axis_rotated?I.circleX:I.circleY).bind(I),t.flow&&(T=I.generateFlow({targets:V,flow:t.flow,duration:t.flow.duration,drawBar:v,drawLine:y,drawArea:m,cx:P,cy:L,xv:B,xForText:b,yForText:x})),(_||T)&&I.isTabVisible()?R.transition().duration(_).each(function(){var e=[];[I.redrawBar(v,!0),I.redrawLine(y,!0),I.redrawArea(m,!0),I.redrawCircle(P,L,!0),I.redrawText(b,x,t.flow,!0),I.redrawRegion(!0),I.redrawGrid(!0)].forEach(function(t){t.forEach(function(t){e.push(t)})}),k=I.generateWait(),e.forEach(function(t){k.add(t)})}).call(k,function(){T&&T(),N.onrendered&&N.onrendered.call(I)}):(I.redrawBar(v),I.redrawLine(y),I.redrawArea(m),I.redrawCircle(P,L),I.redrawText(b,x,t.flow),I.redrawRegion(),I.redrawGrid(),N.onrendered&&N.onrendered.call(I)),I.mapToIds(I.data.targets).forEach(function(t){I.withoutFadeIn[t]=!0})},D.updateAndRedraw=function(t){var e,i=this,n=i.config;(t=t||{}).withTransition=w(t,"withTransition",!0),t.withTransform=w(t,"withTransform",!1),t.withLegend=w(t,"withLegend",!1),t.withUpdateXDomain=!0,t.withUpdateOrgXDomain=!0,t.withTransitionForExit=!1,t.withTransitionForTransform=w(t,"withTransitionForTransform",t.withTransition),i.updateSizes(),t.withLegend&&n.legend_show||(e=i.axis.generateTransitions(t.withTransitionForAxis?n.transition_duration:0),i.updateScales(),i.updateSvgSize(),i.transformAll(t.withTransitionForTransform,e)),i.redraw(t,e)},D.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},D.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},D.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},D.isCustomX=function(){var t=this,e=t.config;return!t.isTimeSeries()&&(e.data_x||_(e.data_xs))},D.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},D.getTranslate=function(t){var e,i,n=this,r=n.config;return"main"===t?(e=y(n.margin.left),i=y(n.margin.top)):"context"===t?(e=y(n.margin2.left),i=y(n.margin2.top)):"legend"===t?(e=n.margin3.left,i=n.margin3.top):"x"===t?(e=0,i=r.axis_rotated?0:n.height):"y"===t?(e=0,i=r.axis_rotated?n.height:0):"y2"===t?(e=r.axis_rotated?0:n.width,i=r.axis_rotated?1:0):"subx"===t?(e=0,i=r.axis_rotated?0:n.height2):"arc"===t&&(e=n.arcWidth/2,i=n.arcHeight/2),"translate("+e+","+i+")"},D.initialOpacity=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?1:0},D.initialOpacityForCircle=function(t){return null!==t.value&&this.withoutFadeIn[t.id]?this.opacityForCircle(t):0},D.opacityForCircle=function(t){var e=(d(this.config.point_show)?this.config.point_show(t):this.config.point_show)?1:0;return u(t.value)?this.isScatterType(t)?.5:e:0},D.opacityForText=function(){return this.hasDataLabel()?1:0},D.xx=function(t){return t?this.x(t.x):null},D.xv=function(t){var e=this,i=t.value;return e.isTimeSeries()?i=e.parseDate(t.value):e.isCategorized()&&"string"==typeof t.value&&(i=e.config.axis_x_categories.indexOf(t.value)),Math.ceil(e.x(i))},D.yv=function(t){var e=this,i=t.axis&&"y2"===t.axis?e.y2:e.y;return Math.ceil(i(t.value))},D.subxx=function(t){return t?this.subX(t.x):null},D.transformMain=function(t,e){var i,n,r,o=this;e&&e.axisX?i=e.axisX:(i=o.main.select("."+a.axisX),t&&(i=i.transition())),e&&e.axisY?n=e.axisY:(n=o.main.select("."+a.axisY),t&&(n=n.transition())),e&&e.axisY2?r=e.axisY2:(r=o.main.select("."+a.axisY2),t&&(r=r.transition())),(t?o.main.transition():o.main).attr("transform",o.getTranslate("main")),i.attr("transform",o.getTranslate("x")),n.attr("transform",o.getTranslate("y")),r.attr("transform",o.getTranslate("y2")),o.main.select("."+a.chartArcs).attr("transform",o.getTranslate("arc"))},D.transformAll=function(t,e){var i=this;i.transformMain(t,e),i.config.subchart_show&&i.transformContext(t,e),i.legend&&i.transformLegend(t)},D.updateSvgSize=function(){var t=this,e=t.svg.select(".c3-brush .background");t.svg.attr("width",t.currentWidth).attr("height",t.currentHeight),t.svg.selectAll(["#"+t.clipId,"#"+t.clipIdForGrid]).select("rect").attr("width",t.width).attr("height",t.height),t.svg.select("#"+t.clipIdForXAxis).select("rect").attr("x",t.getXAxisClipX.bind(t)).attr("y",t.getXAxisClipY.bind(t)).attr("width",t.getXAxisClipWidth.bind(t)).attr("height",t.getXAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForYAxis).select("rect").attr("x",t.getYAxisClipX.bind(t)).attr("y",t.getYAxisClipY.bind(t)).attr("width",t.getYAxisClipWidth.bind(t)).attr("height",t.getYAxisClipHeight.bind(t)),t.svg.select("#"+t.clipIdForSubchart).select("rect").attr("width",t.width).attr("height",e.size()?e.attr("height"):0),t.svg.select("."+a.zoomRect).attr("width",t.width).attr("height",t.height),t.selectChart.style("max-height",t.currentHeight+"px")},D.updateDimension=function(t){var e=this;t||(e.config.axis_rotated?(e.axes.x.call(e.xAxis),e.axes.subx.call(e.subXAxis)):(e.axes.y.call(e.yAxis),e.axes.y2.call(e.y2Axis))),e.updateSizes(),e.updateScales(),e.updateSvgSize(),e.transformAll(!1)},D.observeInserted=function(t){var e,i=this;"undefined"!=typeof MutationObserver?(e=new MutationObserver(function(n){n.forEach(function(n){"childList"===n.type&&n.previousSibling&&(e.disconnect(),i.intervalForObserveInserted=window.setInterval(function(){t.node().parentNode&&(window.clearInterval(i.intervalForObserveInserted),i.updateDimension(),i.brush&&i.brush.update(),i.config.oninit.call(i),i.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})})).observe(t.node(),{attributes:!0,childList:!0,characterData:!0}):window.console.error("MutationObserver not defined.")},D.bindResize=function(){var t=this,e=t.config;if(t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){e.onresize.call(t)}),e.resize_auto&&t.resizeFunction.add(function(){void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),t.resizeTimeout=window.setTimeout(function(){delete t.resizeTimeout,t.api.flush()},100)}),t.resizeFunction.add(function(){e.onresized.call(t)}),window.attachEvent)window.attachEvent("onresize",t.resizeFunction);else if(window.addEventListener)window.addEventListener("resize",t.resizeFunction,!1);else{var i=window.onresize;i?i.add&&i.remove||(i=t.generateResize()).add(window.onresize):i=t.generateResize(),i.add(t.resizeFunction),window.onresize=i}},D.generateResize=function(){function t(){e.forEach(function(t){t()})}var e=[];return t.add=function(t){e.push(t)},t.remove=function(t){for(var i=0;i<e.length;i++)if(e[i]===t){e.splice(i,1);break}},t},D.endall=function(t,e){var i=0;t.each(function(){++i}).each("end",function(){--i||e.apply(this,arguments)})},D.generateWait=function(){var t=[],e=function(e,i){var n=setInterval(function(){var e=0;t.forEach(function(t){if(t.empty())e+=1;else try{t.transition()}catch(t){e+=1}}),e===t.length&&(clearInterval(n),i&&i())},10)};return e.add=function(e){t.push(e)},e},D.parseDate=function(t){var e,i=this;return t instanceof Date?e=t:"string"==typeof t?e=i.dataTimeFormat(i.config.data_xFormat).parse(t):"object"===(void 0===t?"undefined":s(t))?e=new Date(+t):"number"!=typeof t||isNaN(t)||(e=new Date(+t)),e&&!isNaN(+e)||window.console.error("Failed to parse x '"+t+"' to Date object"),e},D.isTabVisible=function(){var t;return void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden"),!document[t]},D.isValue=u,D.isFunction=d,D.isString=p,D.isUndefined=g,D.isDefined=m,D.ceil10=v,D.asHalfPixel=y,D.diffDomain=b,D.isEmpty=x,D.notEmpty=_,D.notEmpty=_,D.getOption=w,D.hasValue=S,D.sanitise=C,D.getPathBox=k,D.CLASS=a,Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,n=function(){},r=function(){return i.apply(this instanceof n?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,r.prototype=new n,r}),"SVGPathSeg"in window||(window.SVGPathSeg=function(t,e,i){this.pathSegType=t,this.pathSegTypeAsLetter=e,this._owningPathSegList=i},window.SVGPathSeg.prototype.classname="SVGPathSeg",window.SVGPathSeg.PATHSEG_UNKNOWN=0,window.SVGPathSeg.PATHSEG_CLOSEPATH=1,window.SVGPathSeg.PATHSEG_MOVETO_ABS=2,window.SVGPathSeg.PATHSEG_MOVETO_REL=3,window.SVGPathSeg.PATHSEG_LINETO_ABS=4,window.SVGPathSeg.PATHSEG_LINETO_REL=5,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,window.SVGPathSeg.PATHSEG_ARC_ABS=10,window.SVGPathSeg.PATHSEG_ARC_REL=11,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,window.SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},window.SVGPathSegClosePath=function(t){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CLOSEPATH,"z",t)},window.SVGPathSegClosePath.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},window.SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},window.SVGPathSegClosePath.prototype.clone=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathSegMovetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_ABS,"M",t),this._x=e,this._y=i},window.SVGPathSegMovetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},window.SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoAbs.prototype.clone=function(){return new window.SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegMovetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_MOVETO_REL,"m",t),this._x=e,this._y=i},window.SVGPathSegMovetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},window.SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegMovetoRel.prototype.clone=function(){return new window.SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_ABS,"L",t),this._x=e,this._y=i},window.SVGPathSegLinetoAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},window.SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoAbs.prototype.clone=function(){return new window.SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_REL,"l",t),this._x=e,this._y=i},window.SVGPathSegLinetoRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},window.SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegLinetoRel.prototype.clone=function(){return new window.SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicAbs=function(t,e,i,n,r,o,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",t),this._x=e,this._y=i,this._x1=n,this._y1=r,this._x2=o,this._y2=a},window.SVGPathSegCurvetoCubicAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},window.SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicRel=function(t,e,i,n,r,o,a){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",t),this._x=e,this._y=i,this._x1=n,this._y1=r,this._x2=o,this._y2=a},window.SVGPathSegCurvetoCubicRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},window.SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticAbs=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",t),this._x=e,this._y=i,this._x1=n,this._y1=r},window.SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},window.SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticRel=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",t),this._x=e,this._y=i,this._x1=n,this._y1=r},window.SVGPathSegCurvetoQuadraticRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},window.SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(t){this._x1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(t){this._y1=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcAbs=function(t,e,i,n,r,o,a,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_ABS,"A",t),this._x=e,this._y=i,this._r1=n,this._r2=r,this._angle=o,this._largeArcFlag=a,this._sweepFlag=s},window.SVGPathSegArcAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},window.SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcAbs.prototype.clone=function(){return new window.SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegArcRel=function(t,e,i,n,r,o,a,s){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_ARC_REL,"a",t),this._x=e,this._y=i,this._r1=n,this._r2=r,this._angle=o,this._largeArcFlag=a,this._sweepFlag=s},window.SVGPathSegArcRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},window.SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},window.SVGPathSegArcRel.prototype.clone=function(){return new window.SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(window.SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(t){this._r1=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(t){this._r2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",t),this._x=e},window.SVGPathSegLinetoHorizontalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},window.SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoHorizontalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",t),this._x=e},window.SVGPathSegLinetoHorizontalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},window.SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},window.SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new window.SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(window.SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalAbs=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",t),this._y=e},window.SVGPathSegLinetoVerticalAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},window.SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegLinetoVerticalRel=function(t,e){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",t),this._y=e},window.SVGPathSegLinetoVerticalRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},window.SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},window.SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new window.SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(window.SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",t),this._x=e,this._y=i,this._x2=n,this._y2=r},window.SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},window.SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n,r){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",t),this._x=e,this._y=i,this._x2=n,this._y2=r},window.SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},window.SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},window.SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(t){this._x2=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(t){this._y2=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothAbs=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathSegCurvetoQuadraticSmoothRel=function(t,e,i){window.SVGPathSeg.call(this,window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",t),this._x=e,this._y=i},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(window.SVGPathSeg.prototype),window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},window.SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(t){this._x=t,this._segmentChanged()},enumerable:!0}),Object.defineProperty(window.SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(t){this._y=t,this._segmentChanged()},enumerable:!0}),window.SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new window.SVGPathSegClosePath(void 0)},window.SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(t,e){return new window.SVGPathSegMovetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegMovetoRel=function(t,e){return new window.SVGPathSegMovetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(t,e){return new window.SVGPathSegLinetoAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegLinetoRel=function(t,e){return new window.SVGPathSegLinetoRel(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(t,e,i,n,r,o){return new window.SVGPathSegCurvetoCubicAbs(void 0,t,e,i,n,r,o)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(t,e,i,n,r,o){return new window.SVGPathSegCurvetoCubicRel(void 0,t,e,i,n,r,o)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(t,e,i,n){return new window.SVGPathSegCurvetoQuadraticRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegArcAbs=function(t,e,i,n,r,o,a){return new window.SVGPathSegArcAbs(void 0,t,e,i,n,r,o,a)},window.SVGPathElement.prototype.createSVGPathSegArcRel=function(t,e,i,n,r,o,a){return new window.SVGPathSegArcRel(void 0,t,e,i,n,r,o,a)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(t){return new window.SVGPathSegLinetoHorizontalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(t){return new window.SVGPathSegLinetoHorizontalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(t){return new window.SVGPathSegLinetoVerticalAbs(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(t){return new window.SVGPathSegLinetoVerticalRel(void 0,t)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothAbs(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(t,e,i,n){return new window.SVGPathSegCurvetoCubicSmoothRel(void 0,t,e,i,n)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothAbs(void 0,t,e)},window.SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(t,e){return new window.SVGPathSegCurvetoQuadraticSmoothRel(void 0,t,e)},"getPathSegAtLength"in window.SVGPathElement.prototype||(window.SVGPathElement.prototype.getPathSegAtLength=function(t){if(void 0===t||!isFinite(t))throw"Invalid arguments.";var e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d",this.getAttribute("d"));var i=e.pathSegList.numberOfItems-1;if(i<=0)return 0;do{if(e.pathSegList.removeItem(i),t>e.getTotalLength())break;i--}while(i>0);return i})),"SVGPathSegList"in window||(window.SVGPathSegList=function(t){this._pathElement=t,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.classname="SVGPathSegList",Object.defineProperty(window.SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new window.SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(window.SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),window.SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},window.SVGPathSegList.prototype._updateListFromPathMutations=function(t){if(this._pathElement){var e=!1;t.forEach(function(t){"d"==t.attributeName&&(e=!0)}),e&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},window.SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",window.SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},window.SVGPathSegList.prototype.segmentChanged=function(t){this._writeListToPath()},window.SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(t){t._owningPathSegList=null}),this._list=[],this._writeListToPath()},window.SVGPathSegList.prototype.initialize=function(t){return this._checkPathSynchronizedToList(),this._list=[t],t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype._checkValidIndex=function(t){if(isNaN(t)||t<0||t>=this.numberOfItems)throw"INDEX_SIZE_ERR"},window.SVGPathSegList.prototype.getItem=function(t){return this._checkPathSynchronizedToList(),this._checkValidIndex(t),this._list[t]},window.SVGPathSegList.prototype.insertItemBefore=function(t,e){return this._checkPathSynchronizedToList(),e>this.numberOfItems&&(e=this.numberOfItems),t._owningPathSegList&&(t=t.clone()),this._list.splice(e,0,t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.replaceItem=function(t,e){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._checkValidIndex(e),this._list[e]=t,t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList.prototype.removeItem=function(t){this._checkPathSynchronizedToList(),this._checkValidIndex(t);var e=this._list[t];return this._list.splice(t,1),this._writeListToPath(),e},window.SVGPathSegList.prototype.appendItem=function(t){return this._checkPathSynchronizedToList(),t._owningPathSegList&&(t=t.clone()),this._list.push(t),t._owningPathSegList=this,this._writeListToPath(),t},window.SVGPathSegList._pathSegArrayAsString=function(t){var e="",i=!0;return t.forEach(function(t){i?(i=!1,e+=t._asPathString()):e+=" "+t._asPathString()}),e},window.SVGPathSegList.prototype._parsePath=function(t){if(!t||0==t.length)return[];var e=this,i=function(){this.pathSegList=[]};i.prototype.appendSegment=function(t){this.pathSegList.push(t)};var n=function(t){this._string=t,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=window.SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};n.prototype._isCurrentSpace=function(){var t=this._string[this._currentIndex];return t<=" "&&(" "==t||"\n"==t||"\t"==t||"\r"==t||"\f"==t)},n.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},n.prototype._skipOptionalSpacesOrDelimiter=function(){return!(this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex))&&(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},n.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},n.prototype.peekSegmentType=function(){var t=this._string[this._currentIndex];return this._pathSegTypeFromChar(t)},n.prototype._pathSegTypeFromChar=function(t){switch(t){case"Z":case"z":return window.SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return window.SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return window.SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return window.SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return window.SVGPathSeg.PATHSEG_LINETO_REL;case"C":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return window.SVGPathSeg.PATHSEG_ARC_ABS;case"a":return window.SVGPathSeg.PATHSEG_ARC_REL;case"H":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return window.SVGPathSeg.PATHSEG_UNKNOWN}},n.prototype._nextCommandHelper=function(t,e){return("+"==t||"-"==t||"."==t||t>="0"&&t<="9")&&e!=window.SVGPathSeg.PATHSEG_CLOSEPATH?e==window.SVGPathSeg.PATHSEG_MOVETO_ABS?window.SVGPathSeg.PATHSEG_LINETO_ABS:e==window.SVGPathSeg.PATHSEG_MOVETO_REL?window.SVGPathSeg.PATHSEG_LINETO_REL:e:window.SVGPathSeg.PATHSEG_UNKNOWN},n.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var t=this.peekSegmentType();return t==window.SVGPathSeg.PATHSEG_MOVETO_ABS||t==window.SVGPathSeg.PATHSEG_MOVETO_REL},n.prototype._parseNumber=function(){var t=0,e=0,i=1,n=0,r=1,o=1,a=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,r=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var s=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=s)for(var l=this._currentIndex-1,c=1;l>=s;)e+=c*(this._string.charAt(l--)-"0"),c*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)i*=10,n+=(this._string.charAt(this._currentIndex)-"0")/i,this._currentIndex+=1}if(this._currentIndex!=a&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,o=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)t*=10,t+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var h=e+n;if(h*=r,t&&(h*=Math.pow(10,o*t)),a!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),h}},n.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var t=!1,e=this._string.charAt(this._currentIndex++);if("0"==e)t=!1;else{if("1"!=e)return;t=!0}return this._skipOptionalSpacesOrDelimiter(),t}},n.prototype.parseSegment=function(){var t=this._string[this._currentIndex],i=this._pathSegTypeFromChar(t);if(i==window.SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==window.SVGPathSeg.PATHSEG_UNKNOWN)return null;if((i=this._nextCommandHelper(t,this._previousCommand))==window.SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=i,i){case window.SVGPathSeg.PATHSEG_MOVETO_REL:return new window.SVGPathSegMovetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_MOVETO_ABS:return new window.SVGPathSegMovetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_REL:return new window.SVGPathSegLinetoRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_ABS:return new window.SVGPathSegLinetoAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new window.SVGPathSegLinetoHorizontalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new window.SVGPathSegLinetoHorizontalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new window.SVGPathSegLinetoVerticalRel(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new window.SVGPathSegLinetoVerticalAbs(e,this._parseNumber());case window.SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new window.SVGPathSegClosePath(e);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicRel(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:n={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicAbs(e,n.x,n.y,n.x1,n.y1,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicSmoothRel(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:n={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoCubicSmoothAbs(e,n.x,n.y,n.x2,n.y2);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoQuadraticRel(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:n={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegCurvetoQuadraticAbs(e,n.x,n.y,n.x1,n.y1);case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new window.SVGPathSegCurvetoQuadraticSmoothRel(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new window.SVGPathSegCurvetoQuadraticSmoothAbs(e,this._parseNumber(),this._parseNumber());case window.SVGPathSeg.PATHSEG_ARC_REL:n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegArcRel(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);case window.SVGPathSeg.PATHSEG_ARC_ABS:var n={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new window.SVGPathSegArcAbs(e,n.x,n.y,n.x1,n.y1,n.arcAngle,n.arcLarge,n.arcSweep);default:throw"Unknown path seg type."}};var r=new i,o=new n(t);if(!o.initialCommandIsMoveTo())return[];for(;o.hasMoreData();){var a=o.parseSegment();if(!a)return[];r.appendSegment(a)}return r.pathSegList}),A.axis=function(){},A.axis.labels=function(t){var e=this.internal;arguments.length&&(Object.keys(t).forEach(function(i){e.axis.setLabelText(i,t[i])}),e.axis.updateLabels())},A.axis.max=function(t){var e=this.internal,i=e.config;if(!arguments.length)return{x:i.axis_x_max,y:i.axis_y_max,y2:i.axis_y2_max};"object"===(void 0===t?"undefined":s(t))?(u(t.x)&&(i.axis_x_max=t.x),u(t.y)&&(i.axis_y_max=t.y),u(t.y2)&&(i.axis_y2_max=t.y2)):i.axis_y_max=i.axis_y2_max=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},A.axis.min=function(t){var e=this.internal,i=e.config;if(!arguments.length)return{x:i.axis_x_min,y:i.axis_y_min,y2:i.axis_y2_min};"object"===(void 0===t?"undefined":s(t))?(u(t.x)&&(i.axis_x_min=t.x),u(t.y)&&(i.axis_y_min=t.y),u(t.y2)&&(i.axis_y2_min=t.y2)):i.axis_y_min=i.axis_y2_min=t,e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},A.axis.range=function(t){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};m(t.max)&&this.axis.max(t.max),m(t.min)&&this.axis.min(t.min)},A.category=function(t,e){var i=this.internal,n=i.config;return arguments.length>1&&(n.axis_x_categories[t]=e,i.redraw()),n.axis_x_categories[t]},A.categories=function(t){var e=this.internal,i=e.config;return arguments.length?(i.axis_x_categories=t,e.redraw(),i.axis_x_categories):i.axis_x_categories},A.resize=function(t){var e=this.internal.config;e.size_width=t?t.width:null,e.size_height=t?t.height:null,this.flush()},A.flush=function(){this.internal.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},A.destroy=function(){var t=this.internal;if(window.clearInterval(t.intervalForObserveInserted),void 0!==t.resizeTimeout&&window.clearTimeout(t.resizeTimeout),window.detachEvent)window.detachEvent("onresize",t.resizeFunction);else if(window.removeEventListener)window.removeEventListener("resize",t.resizeFunction);else{var e=window.onresize;e&&e.add&&e.remove&&e.remove(t.resizeFunction)}return t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},A.color=function(t){return this.internal.color(t)},A.data=function(t){var e=this.internal.data.targets;return void 0===t?e:e.filter(function(e){return[].concat(t).indexOf(e.id)>=0})},A.data.shown=function(t){return this.internal.filterTargetsToShow(this.data(t))},A.data.values=function(t){var e,i=null;return t&&(i=(e=this.data(t))[0]?e[0].values.map(function(t){return t.value}):null),i},A.data.names=function(t){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",t)},A.data.colors=function(t){return this.internal.updateDataAttributes("colors",t)},A.data.axes=function(t){return this.internal.updateDataAttributes("axes",t)},A.flow=function(t){var e,i,n,r,o,a,s,l=this.internal,c=[],h=l.getMaxDataCount(),d=0,f=0;if(t.json)i=l.convertJsonToData(t.json,t.keys);else if(t.rows)i=l.convertRowsToData(t.rows);else{if(!t.columns)return;i=l.convertColumnsToData(t.columns)}e=l.convertDataToTargets(i,!0),l.data.targets.forEach(function(t){var i,n,r=!1;for(i=0;i<e.length;i++)if(t.id===e[i].id){for(r=!0,t.values[t.values.length-1]&&(f=t.values[t.values.length-1].index+1),d=e[i].values.length,n=0;n<d;n++)e[i].values[n].index=f+n,l.isTimeSeries()||(e[i].values[n].x=f+n);t.values=t.values.concat(e[i].values),e.splice(i,1);break}r||c.push(t.id)}),l.data.targets.forEach(function(t){var e,i;for(e=0;e<c.length;e++)if(t.id===c[e])for(f=t.values[t.values.length-1].index+1,i=0;i<d;i++)t.values.push({id:t.id,index:f+i,x:l.isTimeSeries()?l.getOtherTargetX(f+i):f+i,value:null})}),l.data.targets.length&&e.forEach(function(t){var e,i=[];for(e=l.data.targets[0].values[0].index;e<f;e++)i.push({id:t.id,index:e,x:l.isTimeSeries()?l.getOtherTargetX(e):e,value:null});t.values.forEach(function(t){t.index+=f,l.isTimeSeries()||(t.x+=f)}),t.values=i.concat(t.values)}),l.data.targets=l.data.targets.concat(e),l.getMaxDataCount(),o=(r=l.data.targets[0]).values[0],m(t.to)?(d=0,s=l.isTimeSeries()?l.parseDate(t.to):t.to,r.values.forEach(function(t){t.x<s&&d++})):m(t.length)&&(d=t.length),h?1===h&&l.isTimeSeries()&&(a=(r.values[r.values.length-1].x-o.x)/2,n=[new Date(+o.x-a),new Date(+o.x+a)],l.updateXDomain(null,!0,!0,!1,n)):(a=l.isTimeSeries()?r.values.length>1?r.values[r.values.length-1].x-o.x:o.x-l.getXDomain(l.data.targets)[0]:1,n=[o.x-a,o.x],l.updateXDomain(null,!0,!0,!1,n)),l.updateTargets(l.data.targets),l.redraw({flow:{index:o.index,length:d,duration:u(t.duration)?t.duration:l.config.transition_duration,done:t.done,orgDataCount:h},withLegend:!0,withTransition:h>1,withTrimXDomain:!1,withUpdateXAxis:!0})},D.generateFlow=function(t){var e=this,i=e.config,n=e.d3;return function(){var r,o,s,l=t.targets,c=t.flow,h=t.drawBar,u=t.drawLine,d=t.drawArea,f=t.cx,p=t.cy,g=t.xv,m=t.xForText,v=t.yForText,y=t.duration,x=1,_=c.index,w=c.length,S=e.getValueOnIndex(e.data.targets[0].values,_),C=e.getValueOnIndex(e.data.targets[0].values,_+w),k=e.x.domain(),T=c.duration||y,A=c.done||function(){},D=e.generateWait(),M=e.xgrid||n.selectAll([]),E=e.xgridLines||n.selectAll([]),P=e.mainRegion||n.selectAll([]),L=e.mainText||n.selectAll([]),I=e.mainBar||n.selectAll([]),O=e.mainLine||n.selectAll([]),R=e.mainArea||n.selectAll([]),N=e.mainCircle||n.selectAll([]);e.flowing=!0,e.data.targets.forEach(function(t){t.values.splice(0,w)}),s=e.updateXDomain(l,!0,!0),e.updateXGrid&&e.updateXGrid(!0),c.orgDataCount?r=1===c.orgDataCount||(S&&S.x)===(C&&C.x)?e.x(k[0])-e.x(s[0]):e.isTimeSeries()?e.x(k[0])-e.x(s[0]):e.x(S.x)-e.x(C.x):1!==e.data.targets[0].values.length?r=e.x(k[0])-e.x(s[0]):e.isTimeSeries()?(S=e.getValueOnIndex(e.data.targets[0].values,0),C=e.getValueOnIndex(e.data.targets[0].values,e.data.targets[0].values.length-1),r=e.x(S.x)-e.x(C.x)):r=b(s)/2,x=b(k)/b(s),o="translate("+r+",0) scale("+x+",1)",e.hideXGridFocus(),n.transition().ease("linear").duration(T).each(function(){D.add(e.axes.x.transition().call(e.xAxis)),D.add(I.transition().attr("transform",o)),D.add(O.transition().attr("transform",o)),D.add(R.transition().attr("transform",o)),D.add(N.transition().attr("transform",o)),D.add(L.transition().attr("transform",o)),D.add(P.filter(e.isRegionOnX).transition().attr("transform",o)),D.add(M.transition().attr("transform",o)),D.add(E.transition().attr("transform",o))}).call(D,function(){var t,n=[],r=[],o=[];if(w){for(t=0;t<w;t++)n.push("."+a.shape+"-"+(_+t)),r.push("."+a.text+"-"+(_+t)),o.push("."+a.eventRect+"-"+(_+t));e.svg.selectAll("."+a.shapes).selectAll(n).remove(),e.svg.selectAll("."+a.texts).selectAll(r).remove(),e.svg.selectAll("."+a.eventRects).selectAll(o).remove(),e.svg.select("."+a.xgrid).remove()}M.attr("transform",null).attr(e.xgridAttr),E.attr("transform",null),E.select("line").attr("x1",i.axis_rotated?0:g).attr("x2",i.axis_rotated?e.width:g),E.select("text").attr("x",i.axis_rotated?e.width:0).attr("y",g),I.attr("transform",null).attr("d",h),O.attr("transform",null).attr("d",u),R.attr("transform",null).attr("d",d),N.attr("transform",null).attr("cx",f).attr("cy",p),L.attr("transform",null).attr("x",m).attr("y",v).style("fill-opacity",e.opacityForText.bind(e)),P.attr("transform",null),P.select("rect").filter(e.isRegionOnX).attr("x",e.regionX.bind(e)).attr("width",e.regionWidth.bind(e)),i.interaction_enabled&&e.redrawEventRect(),A(),e.flowing=!1})}},A.focus=function(t){var e,i=this.internal;t=i.mapToTargetIds(t),e=i.svg.selectAll(i.selectorTargets(t.filter(i.isTargetToShow,i))),this.revert(),this.defocus(),e.classed(a.focused,!0).classed(a.defocused,!1),i.hasArcType()&&i.expandArc(t),i.toggleFocusLegend(t,!0),i.focusedTargetIds=t,i.defocusedTargetIds=i.defocusedTargetIds.filter(function(e){return t.indexOf(e)<0})},A.defocus=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t.filter(e.isTargetToShow,e))).classed(a.focused,!1).classed(a.defocused,!0),e.hasArcType()&&e.unexpandArc(t),e.toggleFocusLegend(t,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(e){return t.indexOf(e)<0}),e.defocusedTargetIds=t},A.revert=function(t){var e=this.internal;t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t)).classed(a.focused,!1).classed(a.defocused,!1),e.hasArcType()&&e.unexpandArc(t),e.config.legend_show&&(e.showLegend(t.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(t)).filter(function(){return e.d3.select(this).classed(a.legendItemFocused)}).classed(a.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]},A.xgrids=function(t){var e=this.internal,i=e.config;return t?(i.grid_x_lines=t,e.redrawWithoutRescale(),i.grid_x_lines):i.grid_x_lines},A.xgrids.add=function(t){var e=this.internal;return this.xgrids(e.config.grid_x_lines.concat(t||[]))},A.xgrids.remove=function(t){this.internal.removeGridLines(t,!0)},A.ygrids=function(t){var e=this.internal,i=e.config;return t?(i.grid_y_lines=t,e.redrawWithoutRescale(),i.grid_y_lines):i.grid_y_lines},A.ygrids.add=function(t){var e=this.internal;return this.ygrids(e.config.grid_y_lines.concat(t||[]))},A.ygrids.remove=function(t){this.internal.removeGridLines(t,!1)},A.groups=function(t){var e=this.internal,i=e.config;return g(t)?i.data_groups:(i.data_groups=t,e.redraw(),i.data_groups)},A.legend=function(){},A.legend.show=function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},A.legend.hide=function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},A.load=function(t){var e=this.internal,i=e.config;t.xs&&e.addXs(t.xs),"names"in t&&A.data.names.bind(this)(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(e){i.data_classes[e]=t.classes[e]}),"categories"in t&&e.isCategorized()&&(i.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(e){i.data_axes[e]=t.axes[e]}),"colors"in t&&Object.keys(t.colors).forEach(function(e){i.data_colors[e]=t.colors[e]}),"cacheIds"in t&&e.hasCaches(t.cacheIds)?e.load(e.getCaches(t.cacheIds),t.done):"unload"in t?e.unload(e.mapToTargetIds("boolean"==typeof t.unload&&t.unload?null:t.unload),function(){e.loadFromArgs(t)}):e.loadFromArgs(t)},A.unload=function(t){var e=this.internal;(t=t||{})instanceof Array?t={ids:t}:"string"==typeof t&&(t={ids:[t]}),e.unload(e.mapToTargetIds(t.ids),function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()})},A.regions=function(t){var e=this.internal,i=e.config;return t?(i.regions=t,e.redrawWithoutRescale(),i.regions):i.regions},A.regions.add=function(t){var e=this.internal,i=e.config;return t?(i.regions=i.regions.concat(t),e.redrawWithoutRescale(),i.regions):i.regions},A.regions.remove=function(t){var e,i,n,r=this.internal,o=r.config;return t=t||{},e=r.getOption(t,"duration",o.transition_duration),i=r.getOption(t,"classes",[a.region]),n=r.main.select("."+a.regions).selectAll(i.map(function(t){return"."+t})),(e?n.transition().duration(e):n).style("opacity",0).remove(),o.regions=o.regions.filter(function(t){var e=!1;return!t.class||(t.class.split(" ").forEach(function(t){i.indexOf(t)>=0&&(e=!0)}),!e)}),o.regions},A.selected=function(t){var e=this.internal,i=e.d3;return i.merge(e.main.selectAll("."+a.shapes+e.getTargetSelectorSuffix(t)).selectAll("."+a.shape).filter(function(){return i.select(this).classed(a.SELECTED)}).map(function(t){return t.map(function(t){var e=t.__data__;return e.data?e.data:e})}))},A.select=function(t,e,i){var n=this.internal,r=n.d3,o=n.config;o.data_selection_enabled&&n.main.selectAll("."+a.shapes).selectAll("."+a.shape).each(function(s,l){var c=r.select(this),h=s.data?s.data.id:s.id,u=n.getToggle(this,s).bind(n),d=o.data_selection_grouped||!t||t.indexOf(h)>=0,f=!e||e.indexOf(l)>=0,p=c.classed(a.SELECTED);c.classed(a.line)||c.classed(a.area)||(d&&f?o.data_selection_isselectable(s)&&!p&&u(!0,c.classed(a.SELECTED,!0),s,l):m(i)&&i&&p&&u(!1,c.classed(a.SELECTED,!1),s,l))})},A.unselect=function(t,e){var i=this.internal,n=i.d3,r=i.config;r.data_selection_enabled&&i.main.selectAll("."+a.shapes).selectAll("."+a.shape).each(function(o,s){var l=n.select(this),c=o.data?o.data.id:o.id,h=i.getToggle(this,o).bind(i),u=r.data_selection_grouped||!t||t.indexOf(c)>=0,d=!e||e.indexOf(s)>=0,f=l.classed(a.SELECTED);l.classed(a.line)||l.classed(a.area)||u&&d&&r.data_selection_isselectable(o)&&f&&h(!1,l.classed(a.SELECTED,!1),o,s)})},A.show=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.removeHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("opacity",1,"important").call(n.endall,function(){i.style("opacity",null).style("opacity",1)}),e.withLegend&&n.showLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},A.hide=function(t,e){var i,n=this.internal;t=n.mapToTargetIds(t),e=e||{},n.addHiddenTargetIds(t),(i=n.svg.selectAll(n.selectorTargets(t))).transition().style("opacity",0,"important").call(n.endall,function(){i.style("opacity",null).style("opacity",0)}),e.withLegend&&n.hideLegend(t),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},A.toggle=function(t,e){var i=this,n=this.internal;n.mapToTargetIds(t).forEach(function(t){n.isTargetToShow(t)?i.hide(t,e):i.show(t,e)})},A.tooltip=function(){},A.tooltip.show=function(t){var e,i,n=this.internal;t.mouse&&(i=t.mouse),t.data?n.isMultipleX()?(i=[n.x(t.data.x),n.getYScale(t.data.id)(t.data.value)],e=null):e=u(t.data.index)?t.data.index:n.getIndexByX(t.data.x):void 0!==t.x?e=n.getIndexByX(t.x):void 0!==t.index&&(e=t.index),n.dispatchEvent("mouseover",e,i),n.dispatchEvent("mousemove",e,i),n.config.tooltip_onshow.call(n,t.data)},A.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)},A.transform=function(t,e){var i=this.internal,n=["pie","donut"].indexOf(t)>=0?{withTransform:!0}:null;i.transformTo(e,t,n)},D.transformTo=function(t,e,i){var n=this,r=!n.hasArcType(),o=i||{withTransitionForAxis:r};o.withTransitionForTransform=!1,n.transiting=!1,n.setTargetType(t,e),n.updateTargets(n.data.targets),n.updateAndRedraw(o)},A.x=function(t){var e=this.internal;return arguments.length&&(e.updateTargetX(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},A.xs=function(t){var e=this.internal;return arguments.length&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs},A.zoom=function(t){var e=this.internal;return t&&(e.isTimeSeries()&&(t=t.map(function(t){return e.parseDate(t)})),e.brush.extent(t),e.redraw({withUpdateXDomain:!0,withY:e.config.zoom_rescale}),e.config.zoom_onzoom.call(this,e.x.orgDomain())),e.brush.extent()},A.zoom.enable=function(t){var e=this.internal;e.config.zoom_enabled=t,e.updateAndRedraw()},A.unzoom=function(){var t=this.internal;t.brush.clear().update(),t.redraw({withUpdateXDomain:!0})},A.zoom.max=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_max;i.zoom_x_max=n.max([e.orgXDomain[1],t])},A.zoom.min=function(t){var e=this.internal,i=e.config,n=e.d3;if(0!==t&&!t)return i.zoom_x_min;i.zoom_x_min=n.min([e.orgXDomain[0],t])},A.zoom.range=function(t){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};m(t.max)&&this.domain.max(t.max),m(t.min)&&this.domain.min(t.min)},D.initPie=function(){var t=this,e=t.d3;t.pie=e.layout.pie().value(function(t){return t.values.reduce(function(t,e){return t+e.value},0)}),t.pie.sort(t.getOrderFunction()||null)},D.updateRadius=function(){var t=this,e=t.config,i=e.gauge_width||e.donut_width;t.radiusExpanded=Math.min(t.arcWidth,t.arcHeight)/2,t.radius=.95*t.radiusExpanded,t.innerRadiusRatio=i?(t.radius-i)/t.radius:.6,t.innerRadius=t.hasType("donut")||t.hasType("gauge")?t.radius*t.innerRadiusRatio:0},D.updateArc=function(){var t=this;t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded(),t.svgArcExpandedSub=t.getSvgArcExpanded(.98)},D.updateAngle=function(t){var e,i,n,r,o=this,a=o.config,s=!1,l=0;return a?(o.pie(o.filterTargetsToShow(o.data.targets)).forEach(function(e){s||e.data.id!==t.data.id||(s=!0,(t=e).index=l),l++}),isNaN(t.startAngle)&&(t.startAngle=0),isNaN(t.endAngle)&&(t.endAngle=t.startAngle),o.isGaugeType(t.data)&&(e=a.gauge_min,i=a.gauge_max,n=Math.PI*(a.gauge_fullCircle?2:1)/(i-e),r=t.value<e?0:t.value<i?t.value-e:i-e,t.startAngle=a.gauge_startingAngle,t.endAngle=t.startAngle+n*r),s?t:null):null},D.getSvgArc=function(){var t=this,e=t.d3.svg.arc().outerRadius(t.radius).innerRadius(t.innerRadius),i=function(i,n){var r;return n?e(i):(r=t.updateAngle(i))?e(r):"M 0 0"};return i.centroid=e.centroid,i},D.getSvgArcExpanded=function(t){var e=this,i=e.d3.svg.arc().outerRadius(e.radiusExpanded*(t||1)).innerRadius(e.innerRadius);return function(t){var n=e.updateAngle(t);return n?i(n):"M 0 0"}},D.getArc=function(t,e,i){return i||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},D.transformForArcLabel=function(t){var e,i,n,r,o,a=this,s=a.config,l=a.updateAngle(t),c="";return l&&!a.hasType("gauge")&&(e=this.svgArc.centroid(l),i=isNaN(e[0])?0:e[0],n=isNaN(e[1])?0:e[1],r=Math.sqrt(i*i+n*n),c="translate("+i*(o=a.hasType("donut")&&s.donut_label_ratio?d(s.donut_label_ratio)?s.donut_label_ratio(t,a.radius,r):s.donut_label_ratio:a.hasType("pie")&&s.pie_label_ratio?d(s.pie_label_ratio)?s.pie_label_ratio(t,a.radius,r):s.pie_label_ratio:a.radius&&r?(36/a.radius>.375?1.175-36/a.radius:.8)*a.radius/r:0)+","+n*o+")"),c},D.getArcRatio=function(t){var e=this,i=e.config,n=Math.PI*(e.hasType("gauge")&&!i.gauge_fullCircle?1:2);return t?(t.endAngle-t.startAngle)/n:null},D.convertToArcData=function(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getArcRatio(t),index:t.index})},D.textForArcLabel=function(t){var e,i,n,r,o,a=this;return a.shouldShowArcLabel()?(e=a.updateAngle(t),i=e?e.value:null,n=a.getArcRatio(e),r=t.data.id,a.hasType("gauge")||a.meetsArcLabelThreshold(n)?(o=a.getArcLabelFormat())?o(i,n,r):a.defaultArcValueFormat(i,n):""):""},D.textForGaugeMinMax=function(t,e){var i=this.getGaugeLabelExtents();return i?i(t,e):t},D.expandArc=function(t){var e,i=this;i.transiting?e=window.setInterval(function(){i.transiting||(window.clearInterval(e),i.legend.selectAll(".c3-legend-item-focused").size()>0&&i.expandArc(t))},10):(t=i.mapToTargetIds(t),i.svg.selectAll(i.selectorTargets(t,"."+a.chartArc)).each(function(t){i.shouldExpand(t.data.id)&&i.d3.select(this).selectAll("path").transition().duration(i.expandDuration(t.data.id)).attr("d",i.svgArcExpanded).transition().duration(2*i.expandDuration(t.data.id)).attr("d",i.svgArcExpandedSub).each(function(t){i.isDonutType(t.data)})}))},D.unexpandArc=function(t){var e=this;e.transiting||(t=e.mapToTargetIds(t),e.svg.selectAll(e.selectorTargets(t,"."+a.chartArc)).selectAll("path").transition().duration(function(t){return e.expandDuration(t.data.id)}).attr("d",e.svgArc),e.svg.selectAll("."+a.arc))},D.expandDuration=function(t){var e=this,i=e.config;return e.isDonutType(t)?i.donut_expand_duration:e.isGaugeType(t)?i.gauge_expand_duration:e.isPieType(t)?i.pie_expand_duration:50},D.shouldExpand=function(t){var e=this,i=e.config;return e.isDonutType(t)&&i.donut_expand||e.isGaugeType(t)&&i.gauge_expand||e.isPieType(t)&&i.pie_expand},D.shouldShowArcLabel=function(){var t=this,e=t.config,i=!0;return t.hasType("donut")?i=e.donut_label_show:t.hasType("pie")&&(i=e.pie_label_show),i},D.meetsArcLabelThreshold=function(t){var e=this,i=e.config;return t>=(e.hasType("donut")?i.donut_label_threshold:i.pie_label_threshold)},D.getArcLabelFormat=function(){var t=this,e=t.config,i=e.pie_label_format;return t.hasType("gauge")?i=e.gauge_label_format:t.hasType("donut")&&(i=e.donut_label_format),i},D.getGaugeLabelExtents=function(){return this.config.gauge_label_extents},D.getArcTitle=function(){var t=this;return t.hasType("donut")?t.config.donut_title:""},D.updateTargetsForArc=function(t){var e,i=this,n=i.main,r=i.classChartArc.bind(i),o=i.classArcs.bind(i),s=i.classFocus.bind(i);(e=n.select("."+a.chartArcs).selectAll("."+a.chartArc).data(i.pie(t)).attr("class",function(t){return r(t)+s(t.data)}).enter().append("g").attr("class",r)).append("g").attr("class",o),e.append("text").attr("dy",i.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},D.initArc=function(){var t=this;t.arcs=t.main.select("."+a.chart).append("g").attr("class",a.chartArcs).attr("transform",t.getTranslate("arc")),t.arcs.append("text").attr("class",a.chartArcsTitle).style("text-anchor","middle").text(t.getArcTitle())},D.redrawArc=function(t,e,i){var n,r=this,o=r.d3,s=r.config,l=r.main;(n=l.selectAll("."+a.arcs).selectAll("."+a.arc).data(r.arcData.bind(r))).enter().append("path").attr("class",r.classArc.bind(r)).style("fill",function(t){return r.color(t.data)}).style("cursor",function(t){return s.interaction_enabled&&s.data_selection_isselectable(t)?"pointer":null}).each(function(t){r.isGaugeType(t.data)&&(t.startAngle=t.endAngle=s.gauge_startingAngle),this._current=t}),n.attr("transform",function(t){return!r.isGaugeType(t.data)&&i?"scale(0)":""}).on("mouseover",s.interaction_enabled?function(t){var e,i;r.transiting||(e=r.updateAngle(t))&&(i=r.convertToArcData(e),r.expandArc(e.data.id),r.api.focus(e.data.id),r.toggleFocusLegend(e.data.id,!0),r.config.data_onmouseover(i,this))}:null).on("mousemove",s.interaction_enabled?function(t){var e,i=r.updateAngle(t);i&&(e=[r.convertToArcData(i)],r.showTooltip(e,this))}:null).on("mouseout",s.interaction_enabled?function(t){var e,i;r.transiting||(e=r.updateAngle(t))&&(i=r.convertToArcData(e),r.unexpandArc(e.data.id),r.api.revert(),r.revertLegend(),r.hideTooltip(),r.config.data_onmouseout(i,this))}:null).on("click",s.interaction_enabled?function(t,e){var i,n=r.updateAngle(t);n&&(i=r.convertToArcData(n),r.toggleShape&&r.toggleShape(this,i,e),r.config.data_onclick.call(r.api,i,this))}:null).each(function(){r.transiting=!0}).transition().duration(t).attrTween("d",function(t){var e,i=r.updateAngle(t);return i?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),e=o.interpolate(this._current,i),this._current=e(0),function(i){var n=e(i);return n.data=t.data,r.getArc(n,!0)}):function(){return"M 0 0"}}).attr("transform",i?"scale(1)":"").style("fill",function(t){return r.levelColor?r.levelColor(t.data.values[0].value):r.color(t.data.id)}).call(r.endall,function(){r.transiting=!1}),n.exit().transition().duration(e).style("opacity",0).remove(),l.selectAll("."+a.chartArc).select("text").style("opacity",0).attr("class",function(t){return r.isGaugeType(t.data)?a.gaugeValue:""}).text(r.textForArcLabel.bind(r)).attr("transform",r.transformForArcLabel.bind(r)).style("font-size",function(t){return r.isGaugeType(t.data)?Math.round(r.radius/5)+"px":""}).transition().duration(t).style("opacity",function(t){return r.isTargetToShow(t.data.id)&&r.isArcType(t.data)?1:0}),l.select("."+a.chartArcsTitle).style("opacity",r.hasType("donut")||r.hasType("gauge")?1:0),r.hasType("gauge")&&(r.arcs.select("."+a.chartArcsBackground).attr("d",function(){var t={data:[{value:s.gauge_max}],startAngle:s.gauge_startingAngle,endAngle:-1*s.gauge_startingAngle};return r.getArc(t,!0,!0)}),r.arcs.select("."+a.chartArcsGaugeUnit).attr("dy",".75em").text(s.gauge_label_show?s.gauge_units:""),r.arcs.select("."+a.chartArcsGaugeMin).attr("dx",-1*(r.innerRadius+(r.radius-r.innerRadius)/(s.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(s.gauge_label_show?r.textForGaugeMinMax(s.gauge_min,!1):""),r.arcs.select("."+a.chartArcsGaugeMax).attr("dx",r.innerRadius+(r.radius-r.innerRadius)/(s.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(s.gauge_label_show?r.textForGaugeMinMax(s.gauge_max,!0):""))},D.initGauge=function(){var t=this.arcs;this.hasType("gauge")&&(t.append("path").attr("class",a.chartArcsBackground),t.append("text").attr("class",a.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",a.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),t.append("text").attr("class",a.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},D.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},D.hasCaches=function(t){for(var e=0;e<t.length;e++)if(!(t[e]in this.cache))return!1;return!0},D.addCache=function(t,e){this.cache[t]=this.cloneTarget(e)},D.getCaches=function(t){var e,i=[];for(e=0;e<t.length;e++)t[e]in this.cache&&i.push(this.cloneTarget(this.cache[t[e]]));return i},D.categoryName=function(t){var e=this.config;return t<e.axis_x_categories.length?e.axis_x_categories[t]:t},D.generateClass=function(t,e){return" "+t+" "+t+this.getTargetSelectorSuffix(e)},D.classText=function(t){return this.generateClass(a.text,t.index)},D.classTexts=function(t){return this.generateClass(a.texts,t.id)},D.classShape=function(t){return this.generateClass(a.shape,t.index)},D.classShapes=function(t){return this.generateClass(a.shapes,t.id)},D.classLine=function(t){return this.classShape(t)+this.generateClass(a.line,t.id)},D.classLines=function(t){return this.classShapes(t)+this.generateClass(a.lines,t.id)},D.classCircle=function(t){return this.classShape(t)+this.generateClass(a.circle,t.index)},D.classCircles=function(t){return this.classShapes(t)+this.generateClass(a.circles,t.id)},D.classBar=function(t){return this.classShape(t)+this.generateClass(a.bar,t.index)},D.classBars=function(t){return this.classShapes(t)+this.generateClass(a.bars,t.id)},D.classArc=function(t){return this.classShape(t.data)+this.generateClass(a.arc,t.data.id)},D.classArcs=function(t){return this.classShapes(t.data)+this.generateClass(a.arcs,t.data.id)},D.classArea=function(t){return this.classShape(t)+this.generateClass(a.area,t.id)},D.classAreas=function(t){return this.classShapes(t)+this.generateClass(a.areas,t.id)},D.classRegion=function(t,e){return this.generateClass(a.region,e)+" "+("class"in t?t.class:"")},D.classEvent=function(t){return this.generateClass(a.eventRect,t.index)},D.classTarget=function(t){var e=this,i=e.config.data_classes[t],n="";return i&&(n=" "+a.target+"-"+i),e.generateClass(a.target,t)+n},D.classFocus=function(t){return this.classFocused(t)+this.classDefocused(t)},D.classFocused=function(t){return" "+(this.focusedTargetIds.indexOf(t.id)>=0?a.focused:"")},D.classDefocused=function(t){return" "+(this.defocusedTargetIds.indexOf(t.id)>=0?a.defocused:"")},D.classChartText=function(t){return a.chartText+this.classTarget(t.id)},D.classChartLine=function(t){return a.chartLine+this.classTarget(t.id)},D.classChartBar=function(t){return a.chartBar+this.classTarget(t.id)},D.classChartArc=function(t){return a.chartArc+this.classTarget(t.data.id)},D.getTargetSelectorSuffix=function(t){return t||0===t?("-"+t).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},D.selectorTarget=function(t,e){return(e||"")+"."+a.target+this.getTargetSelectorSuffix(t)},D.selectorTargets=function(t,e){var i=this;return(t=t||[]).length?t.map(function(t){return i.selectorTarget(t,e)}):null},D.selectorLegend=function(t){return"."+a.legendItem+this.getTargetSelectorSuffix(t)},D.selectorLegends=function(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null},D.getClipPath=function(t){return"url("+(window.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0?"":document.URL.split("#")[0])+"#"+t+")"},D.appendClip=function(t,e){return t.append("clipPath").attr("id",e).append("rect")},D.getAxisClipX=function(t){var e=Math.max(30,this.margin.left);return t?-(1+e):-(e-1)},D.getAxisClipY=function(t){return t?-20:-this.margin.top},D.getXAxisClipX=function(){var t=this;return t.getAxisClipX(!t.config.axis_rotated)},D.getXAxisClipY=function(){var t=this;return t.getAxisClipY(!t.config.axis_rotated)},D.getYAxisClipX=function(){var t=this;return t.config.axis_y_inner?-1:t.getAxisClipX(t.config.axis_rotated)},D.getYAxisClipY=function(){var t=this;return t.getAxisClipY(t.config.axis_rotated)},D.getAxisClipWidth=function(t){var e=this,i=Math.max(30,e.margin.left),n=Math.max(30,e.margin.right);return t?e.width+2+i+n:e.margin.left+20},D.getAxisClipHeight=function(t){return(t?this.margin.bottom:this.margin.top+this.height)+20},D.getXAxisClipWidth=function(){var t=this;return t.getAxisClipWidth(!t.config.axis_rotated)},D.getXAxisClipHeight=function(){var t=this;return t.getAxisClipHeight(!t.config.axis_rotated)},D.getYAxisClipWidth=function(){var t=this;return t.getAxisClipWidth(t.config.axis_rotated)+(t.config.axis_y_inner?20:0)},D.getYAxisClipHeight=function(){var t=this;return t.getAxisClipHeight(t.config.axis_rotated)},D.generateColor=function(){var t=this,e=t.config,i=t.d3,n=e.data_colors,r=_(e.color_pattern)?e.color_pattern:i.scale.category10().range(),o=e.data_color,a=[];return function(t){var e,i=t.id||t.data&&t.data.id||t;return n[i]instanceof Function?e=n[i](t):n[i]?e=n[i]:(a.indexOf(i)<0&&a.push(i),e=r[a.indexOf(i)%r.length],n[i]=e),o instanceof Function?o(e,t):e}},D.generateLevelColor=function(){var t=this.config,e=t.color_pattern,i=t.color_threshold,n="value"===i.unit,r=i.values&&i.values.length?i.values:[],o=i.max||100;return _(t.color_threshold)?function(t){var i,a=e[e.length-1];for(i=0;i<r.length;i++)if((n?t:100*t/o)<r[i]){a=e[i];break}return a}:null},D.getDefaultConfig=function(){var t={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(t){return t},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,bar_space:0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_label_extents:void 0,gauge_units:void 0,gauge_width:void 0,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_order:void 0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(t,e,i,n){return this.getTooltipContent?this.getTooltipContent(t,e,i,n):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(e){t[e]=this.additionalConfig[e]},this),t},D.additionalConfig={},D.loadConfig=function(t){function e(){var t=n.shift();return t&&i&&"object"===(void 0===i?"undefined":s(i))&&t in i?(i=i[t],e()):t?void 0:i}var i,n,r,o=this.config;Object.keys(o).forEach(function(a){i=t,n=a.split("_"),r=e(),m(r)&&(o[a]=r)})},D.convertUrlToData=function(t,e,i,n,r){var o=this,a=e||"csv",s=o.d3.xhr(t);i&&Object.keys(i).forEach(function(t){s.header(t,i[t])}),s.get(function(t,e){var i,s=e.response||e.responseText;if(!e)throw new Error(t.responseURL+" "+t.status+" ("+t.statusText+")");i="json"===a?o.convertJsonToData(JSON.parse(s),n):"tsv"===a?o.convertTsvToData(s):o.convertCsvToData(s),r.call(o,i)})},D.convertXsvToData=function(t,e){var i,n=e.parseRows(t);return 1===n.length?(i=[{}],n[0].forEach(function(t){i[0][t]=null})):i=e.parse(t),i},D.convertCsvToData=function(t){return this.convertXsvToData(t,this.d3.csv)},D.convertTsvToData=function(t){return this.convertXsvToData(t,this.d3.tsv)},D.convertJsonToData=function(t,e){var i,n,r=this,o=[];return e?(e.x?(i=e.value.concat(e.x),r.config.data_x=e.x):i=e.value,o.push(i),t.forEach(function(t){var e=[];i.forEach(function(i){var n=r.findValueInJson(t,i);g(n)&&(n=null),e.push(n)}),o.push(e)}),n=r.convertRowsToData(o)):(Object.keys(t).forEach(function(e){o.push([e].concat(t[e]))}),n=r.convertColumnsToData(o)),n},D.findValueInJson=function(t,e){for(var i=(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),n=0;n<i.length;++n){var r=i[n];if(!(r in t))return;t=t[r]}return t},D.convertRowsToData=function(t){for(var e=[],i=t[0],n=1;n<t.length;n++){for(var r={},o=0;o<t[n].length;o++){if(g(t[n][o]))throw new Error("Source data is missing a component at ("+n+","+o+")!");r[i[o]]=t[n][o]}e.push(r)}return e},D.convertColumnsToData=function(t){for(var e=[],i=0;i<t.length;i++)for(var n=t[i][0],r=1;r<t[i].length;r++){if(g(e[r-1])&&(e[r-1]={}),g(t[i][r]))throw new Error("Source data is missing a component at ("+i+","+r+")!");e[r-1][n]=t[i][r]}return e},D.convertDataToTargets=function(t,e){var i,n=this,r=n.config,o=n.d3.keys(t[0]).filter(n.isNotX,n),a=n.d3.keys(t[0]).filter(n.isX,n);return o.forEach(function(i){var o=n.getXKey(i);n.isCustomX()||n.isTimeSeries()?a.indexOf(o)>=0?n.data.xs[i]=(e&&n.data.xs[i]?n.data.xs[i]:[]).concat(t.map(function(t){return t[o]}).filter(u).map(function(t,e){return n.generateTargetX(t,i,e)})):r.data_x?n.data.xs[i]=n.getOtherTargetXs():_(r.data_xs)&&(n.data.xs[i]=n.getXValuesOfXKey(o,n.data.targets)):n.data.xs[i]=t.map(function(t,e){return e})}),o.forEach(function(t){if(!n.data.xs[t])throw new Error('x is not defined for id = "'+t+'".')}),(i=o.map(function(e,i){var o=r.data_idConverter(e);return{id:o,id_org:e,values:t.map(function(t,a){var s,l=t[n.getXKey(e)],c=null===t[e]||isNaN(t[e])?null:+t[e];return n.isCustomX()&&n.isCategorized()&&!g(l)?(0===i&&0===a&&(r.axis_x_categories=[]),-1===(s=r.axis_x_categories.indexOf(l))&&(s=r.axis_x_categories.length,r.axis_x_categories.push(l))):s=n.generateTargetX(l,e,a),(g(t[e])||n.data.xs[e].length<=a)&&(s=void 0),{x:s,value:c,id:o}}).filter(function(t){return m(t.x)})}})).forEach(function(t){var e;r.data_xSort&&(t.values=t.values.sort(function(t,e){return(t.x||0===t.x?t.x:1/0)-(e.x||0===e.x?e.x:1/0)})),e=0,t.values.forEach(function(t){t.index=e++}),n.data.xs[t.id].sort(function(t,e){return t-e})}),n.hasNegativeValue=n.hasNegativeValueInTargets(i),n.hasPositiveValue=n.hasPositiveValueInTargets(i),r.data_type&&n.setTargetType(n.mapToIds(i).filter(function(t){return!(t in r.data_types)}),r.data_type),i.forEach(function(t){n.addCache(t.id_org,t)}),i},D.isX=function(t){var e=this.config;return e.data_x&&t===e.data_x||_(e.data_xs)&&S(e.data_xs,t)},D.isNotX=function(t){return!this.isX(t)},D.getXKey=function(t){var e=this.config;return e.data_x?e.data_x:_(e.data_xs)?e.data_xs[t]:null},D.getXValuesOfXKey=function(t,e){var i,n=this;return(e&&_(e)?n.mapToIds(e):[]).forEach(function(e){n.getXKey(e)===t&&(i=n.data.xs[e])}),i},D.getIndexByX=function(t){var e=this,i=e.filterByX(e.data.targets,t);return i.length?i[0].index:null},D.getXValue=function(t,e){var i=this;return t in i.data.xs&&i.data.xs[t]&&u(i.data.xs[t][e])?i.data.xs[t][e]:e},D.getOtherTargetXs=function(){var t=this,e=Object.keys(t.data.xs);return e.length?t.data.xs[e[0]]:null},D.getOtherTargetX=function(t){var e=this.getOtherTargetXs();return e&&t<e.length?e[t]:null},D.addXs=function(t){var e=this;Object.keys(t).forEach(function(i){e.config.data_xs[i]=t[i]})},D.hasMultipleX=function(t){return this.d3.set(Object.keys(t).map(function(e){return t[e]})).size()>1},D.isMultipleX=function(){return _(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},D.addName=function(t){var e,i=this;return t&&(e=i.config.data_names[t.id],t.name=void 0!==e?e:t.id),t},D.getValueOnIndex=function(t,e){var i=t.filter(function(t){return t.index===e});return i.length?i[0]:null},D.updateTargetX=function(t,e){var i=this;t.forEach(function(t){t.values.forEach(function(n,r){n.x=i.generateTargetX(e[r],t.id,r)}),i.data.xs[t.id]=e})},D.updateTargetXs=function(t,e){var i=this;t.forEach(function(t){e[t.id]&&i.updateTargetX([t],e[t.id])})},D.generateTargetX=function(t,e,i){var n=this;return n.isTimeSeries()?t?n.parseDate(t):n.parseDate(n.getXValue(e,i)):n.isCustomX()&&!n.isCategorized()?u(t)?+t:n.getXValue(e,i):i},D.cloneTarget=function(t){return{id:t.id,id_org:t.id_org,values:t.values.map(function(t){return{x:t.x,value:t.value,id:t.id}})}},D.updateXs=function(){var t=this;t.data.targets.length&&(t.xs=[],t.data.targets[0].values.forEach(function(e){t.xs[e.index]=e.x}))},D.getPrevX=function(t){var e=this.xs[t-1];return void 0!==e?e:null},D.getNextX=function(t){var e=this.xs[t+1];return void 0!==e?e:null},D.getMaxDataCount=function(){var t=this;return t.d3.max(t.data.targets,function(t){return t.values.length})},D.getMaxDataCountTarget=function(t){var e,i=t.length,n=0;return i>1?t.forEach(function(t){t.values.length>n&&(e=t,n=t.values.length)}):e=i?t[0]:null,e},D.getEdgeX=function(t){var e=this;return t.length?[e.d3.min(t,function(t){return t.values[0].x}),e.d3.max(t,function(t){return t.values[t.values.length-1].x})]:[0,0]},D.mapToIds=function(t){return t.map(function(t){return t.id})},D.mapToTargetIds=function(t){var e=this;return t?[].concat(t):e.mapToIds(e.data.targets)},D.hasTarget=function(t,e){var i,n=this.mapToIds(t);for(i=0;i<n.length;i++)if(n[i]===e)return!0;return!1},D.isTargetToShow=function(t){return this.hiddenTargetIds.indexOf(t)<0},D.isLegendToShow=function(t){return this.hiddenLegendIds.indexOf(t)<0},D.filterTargetsToShow=function(t){var e=this;return t.filter(function(t){return e.isTargetToShow(t.id)})},D.mapTargetsToUniqueXs=function(t){var e=this,i=e.d3.set(e.d3.merge(t.map(function(t){return t.values.map(function(t){return+t.x})}))).values();return(i=e.isTimeSeries()?i.map(function(t){return new Date(+t)}):i.map(function(t){return+t})).sort(function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN})},D.addHiddenTargetIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenTargetIds.indexOf(t[e])<0&&(this.hiddenTargetIds=this.hiddenTargetIds.concat(t[e]))},D.removeHiddenTargetIds=function(t){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(e){return t.indexOf(e)<0})},D.addHiddenLegendIds=function(t){t=t instanceof Array?t:new Array(t);for(var e=0;e<t.length;e++)this.hiddenLegendIds.indexOf(t[e])<0&&(this.hiddenLegendIds=this.hiddenLegendIds.concat(t[e]))},D.removeHiddenLegendIds=function(t){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(e){return t.indexOf(e)<0})},D.getValuesAsIdKeyed=function(t){var e={};return t.forEach(function(t){e[t.id]=[],t.values.forEach(function(i){e[t.id].push(i.value)})}),e},D.checkValueInTargets=function(t,e){var i,n,r,o=Object.keys(t);for(i=0;i<o.length;i++)for(r=t[o[i]].values,n=0;n<r.length;n++)if(e(r[n].value))return!0;return!1},D.hasNegativeValueInTargets=function(t){return this.checkValueInTargets(t,function(t){return t<0})},D.hasPositiveValueInTargets=function(t){return this.checkValueInTargets(t,function(t){return t>0})},D.isOrderDesc=function(){var t=this.config;return"string"==typeof t.data_order&&"desc"===t.data_order.toLowerCase()},D.isOrderAsc=function(){var t=this.config;return"string"==typeof t.data_order&&"asc"===t.data_order.toLowerCase()},D.getOrderFunction=function(){var t=this,e=t.config,i=t.isOrderAsc(),n=t.isOrderDesc();if(i||n)return function(t,e){var i=function(t,e){return t+Math.abs(e.value)},r=t.values.reduce(i,0),o=e.values.reduce(i,0);return n?o-r:r-o};if(d(e.data_order))return e.data_order;if(f(e.data_order)){var r=e.data_order;return function(t,e){return r.indexOf(t.id)-r.indexOf(e.id)}}},D.orderTargets=function(t){var e=this.getOrderFunction();return e&&(t.sort(e),(this.isOrderAsc()||this.isOrderDesc())&&t.reverse()),t},D.filterByX=function(t,e){return this.d3.merge(t.map(function(t){return t.values})).filter(function(t){return t.x-e==0})},D.filterRemoveNull=function(t){return t.filter(function(t){return u(t.value)})},D.filterByXDomain=function(t,e){return t.map(function(t){return{id:t.id,id_org:t.id_org,values:t.values.filter(function(t){return e[0]<=t.x&&t.x<=e[1]})}})},D.hasDataLabel=function(){var t=this.config;return!("boolean"!=typeof t.data_labels||!t.data_labels)||!("object"!==s(t.data_labels)||!_(t.data_labels))},D.getDataLabelLength=function(t,e,i){var n=this,r=[0,0];return n.selectChart.select("svg").selectAll(".dummy").data([t,e]).enter().append("text").text(function(t){return n.dataLabelFormat(t.id)(t)}).each(function(t,e){r[e]=1.3*this.getBoundingClientRect()[i]}).remove(),r},D.isNoneArc=function(t){return this.hasTarget(this.data.targets,t.id)},D.isArc=function(t){return"data"in t&&this.hasTarget(this.data.targets,t.data.id)},D.findSameXOfValues=function(t,e){var i,n=t[e].x,r=[];for(i=e-1;i>=0&&n===t[i].x;i--)r.push(t[i]);for(i=e;i<t.length&&n===t[i].x;i++)r.push(t[i]);return r},D.findClosestFromTargets=function(t,e){var i,n=this;return i=t.map(function(t){return n.findClosest(t.values,e)}),n.findClosest(i,e)},D.findClosest=function(t,e){var i,n=this,r=n.config.point_sensitivity;return t.filter(function(t){return t&&n.isBarType(t.id)}).forEach(function(t){var e=n.main.select("."+a.bars+n.getTargetSelectorSuffix(t.id)+" ."+a.bar+"-"+t.index).node();!i&&n.isWithinBar(e)&&(i=t)}),t.filter(function(t){return t&&!n.isBarType(t.id)}).forEach(function(t){var o=n.dist(t,e);o<r&&(r=o,i=t)}),i},D.dist=function(t,e){var i=this,n=i.config,r=n.axis_rotated?1:0,o=n.axis_rotated?0:1,a=i.circleY(t,t.index),s=i.x(t.x);return Math.sqrt(Math.pow(s-e[r],2)+Math.pow(a-e[o],2))},D.convertValuesToStep=function(t){var e,i=[].concat(t);if(!this.isCategorized())return t;for(e=t.length+1;0<e;e--)i[e]=i[e-1];return i[0]={x:i[0].x-1,value:i[0].value,id:i[0].id},i[t.length+1]={x:i[t.length].x+1,value:i[t.length].value,id:i[t.length].id},i},D.updateDataAttributes=function(t,e){var i=this,n=i.config["data_"+t];return void 0===e?n:(Object.keys(e).forEach(function(t){n[t]=e[t]}),i.redraw({withLegend:!0}),n)},D.load=function(t,e){var i=this;t&&(e.filter&&(t=t.filter(e.filter)),(e.type||e.types)&&t.forEach(function(t){var n=e.types&&e.types[t.id]?e.types[t.id]:e.type;i.setTargetType(t.id,n)}),i.data.targets.forEach(function(e){for(var i=0;i<t.length;i++)if(e.id===t[i].id){e.values=t[i].values,t.splice(i,1);break}}),i.data.targets=i.data.targets.concat(t)),i.updateTargets(i.data.targets),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()},D.loadFromArgs=function(t){var e=this;t.data?e.load(e.convertDataToTargets(t.data),t):t.url?e.convertUrlToData(t.url,t.mimeType,t.headers,t.keys,function(i){e.load(e.convertDataToTargets(i),t)}):t.json?e.load(e.convertDataToTargets(e.convertJsonToData(t.json,t.keys)),t):t.rows?e.load(e.convertDataToTargets(e.convertRowsToData(t.rows)),t):t.columns?e.load(e.convertDataToTargets(e.convertColumnsToData(t.columns)),t):e.load(null,t)},D.unload=function(t,e){var i=this;e||(e=function(){}),(t=t.filter(function(t){return i.hasTarget(i.data.targets,t)}))&&0!==t.length?(i.svg.selectAll(t.map(function(t){return i.selectorTarget(t)})).transition().style("opacity",0).remove().call(i.endall,e),t.forEach(function(t){i.withoutFadeIn[t]=!1,i.legend&&i.legend.selectAll("."+a.legendItem+i.getTargetSelectorSuffix(t)).remove(),i.data.targets=i.data.targets.filter(function(e){return e.id!==t})})):e()},D.getYDomainMin=function(t){var e,i,n,r,o,a,s=this,l=s.config,c=s.mapToIds(t),h=s.getValuesAsIdKeyed(t);if(l.data_groups.length>0)for(a=s.hasNegativeValueInTargets(t),e=0;e<l.data_groups.length;e++)if(0!==(r=l.data_groups[e].filter(function(t){return c.indexOf(t)>=0})).length)for(n=r[0],a&&h[n]&&h[n].forEach(function(t,e){h[n][e]=t<0?t:0}),i=1;i<r.length;i++)o=r[i],h[o]&&h[o].forEach(function(t,e){s.axis.getId(o)!==s.axis.getId(n)||!h[n]||a&&+t>0||(h[n][e]+=+t)});return s.d3.min(Object.keys(h).map(function(t){return s.d3.min(h[t])}))},D.getYDomainMax=function(t){var e,i,n,r,o,a,s=this,l=s.config,c=s.mapToIds(t),h=s.getValuesAsIdKeyed(t);if(l.data_groups.length>0)for(a=s.hasPositiveValueInTargets(t),e=0;e<l.data_groups.length;e++)if(0!==(r=l.data_groups[e].filter(function(t){return c.indexOf(t)>=0})).length)for(n=r[0],a&&h[n]&&h[n].forEach(function(t,e){h[n][e]=t>0?t:0}),i=1;i<r.length;i++)o=r[i],h[o]&&h[o].forEach(function(t,e){s.axis.getId(o)!==s.axis.getId(n)||!h[n]||a&&+t<0||(h[n][e]+=+t)});return s.d3.max(Object.keys(h).map(function(t){return s.d3.max(h[t])}))},D.getYDomain=function(t,e,i){var n,r,o,a,s,l,c,h,d,f,p=this,g=p.config,m=t.filter(function(t){return p.axis.getId(t.id)===e}),v=i?p.filterByXDomain(m,i):m,y="y2"===e?g.axis_y2_min:g.axis_y_min,x="y2"===e?g.axis_y2_max:g.axis_y_max,w=p.getYDomainMin(v),S=p.getYDomainMax(v),C="y2"===e?g.axis_y2_center:g.axis_y_center,k=p.hasType("bar",v)&&g.bar_zerobased||p.hasType("area",v)&&g.area_zerobased,T="y2"===e?g.axis_y2_inverted:g.axis_y_inverted,A=p.hasDataLabel()&&g.axis_rotated,D=p.hasDataLabel()&&!g.axis_rotated;return w=u(y)?y:u(x)?w<x?w:x-10:w,S=u(x)?x:u(y)?y<S?S:y+10:S,0===v.length?"y2"===e?p.y2.domain():p.y.domain():(isNaN(w)&&(w=0),isNaN(S)&&(S=w),w===S&&(w<0?S=0:w=0),d=w>=0&&S>=0,f=w<=0&&S<=0,(u(y)&&d||u(x)&&f)&&(k=!1),k&&(d&&(w=0),f&&(S=0)),r=Math.abs(S-w),o=a=.1*r,void 0!==C&&(S=C+(s=Math.max(Math.abs(w),Math.abs(S))),w=C-s),A?(l=p.getDataLabelLength(w,S,"width"),c=b(p.y.range()),o+=r*((h=[l[0]/c,l[1]/c])[1]/(1-h[0]-h[1])),a+=r*(h[0]/(1-h[0]-h[1]))):D&&(l=p.getDataLabelLength(w,S,"height"),o+=p.axis.convertPixelsToAxisPadding(l[1],r),a+=p.axis.convertPixelsToAxisPadding(l[0],r)),"y"===e&&_(g.axis_y_padding)&&(o=p.axis.getPadding(g.axis_y_padding,"top",o,r),a=p.axis.getPadding(g.axis_y_padding,"bottom",a,r)),"y2"===e&&_(g.axis_y2_padding)&&(o=p.axis.getPadding(g.axis_y2_padding,"top",o,r),a=p.axis.getPadding(g.axis_y2_padding,"bottom",a,r)),k&&(d&&(a=w),f&&(o=-S)),n=[w-a,S+o],T?n.reverse():n)},D.getXDomainMin=function(t){var e=this,i=e.config;return m(i.axis_x_min)?e.isTimeSeries()?this.parseDate(i.axis_x_min):i.axis_x_min:e.d3.min(t,function(t){return e.d3.min(t.values,function(t){return t.x})})},D.getXDomainMax=function(t){var e=this,i=e.config;return m(i.axis_x_max)?e.isTimeSeries()?this.parseDate(i.axis_x_max):i.axis_x_max:e.d3.max(t,function(t){return e.d3.max(t.values,function(t){return t.x})})},D.getXDomainPadding=function(t){var e,i,n,r,o=this,a=o.config,l=t[1]-t[0];return i=o.isCategorized()?0:o.hasType("bar")?(e=o.getMaxDataCount())>1?l/(e-1)/2:.5:.01*l,"object"===s(a.axis_x_padding)&&_(a.axis_x_padding)?(n=u(a.axis_x_padding.left)?a.axis_x_padding.left:i,r=u(a.axis_x_padding.right)?a.axis_x_padding.right:i):n=r="number"==typeof a.axis_x_padding?a.axis_x_padding:i,{left:n,right:r}},D.getXDomain=function(t){var e=this,i=[e.getXDomainMin(t),e.getXDomainMax(t)],n=i[0],r=i[1],o=e.getXDomainPadding(i),a=0,s=0;return n-r!=0||e.isCategorized()||(e.isTimeSeries()?(n=new Date(.5*n.getTime()),r=new Date(1.5*r.getTime())):(n=0===n?1:.5*n,r=0===r?-1:1.5*r)),(n||0===n)&&(a=e.isTimeSeries()?new Date(n.getTime()-o.left):n-o.left),(r||0===r)&&(s=e.isTimeSeries()?new Date(r.getTime()+o.right):r+o.right),[a,s]},D.updateXDomain=function(t,e,i,n,r){var o=this,a=o.config;return i&&(o.x.domain(r||o.d3.extent(o.getXDomain(t))),o.orgXDomain=o.x.domain(),a.zoom_enabled&&o.zoom.scale(o.x).updateScaleExtent(),o.subX.domain(o.x.domain()),o.brush&&o.brush.scale(o.subX)),e&&(o.x.domain(r||(!o.brush||o.brush.empty()?o.orgXDomain:o.brush.extent())),a.zoom_enabled&&o.zoom.scale(o.x).updateScaleExtent()),n&&o.x.domain(o.trimXDomain(o.x.orgDomain())),o.x.domain()},D.trimXDomain=function(t){var e=this.getZoomDomain(),i=e[0],n=e[1];return t[0]<=i&&(t[1]=+t[1]+(i-t[0]),t[0]=i),n<=t[1]&&(t[0]=+t[0]-(t[1]-n),t[1]=n),t},D.drag=function(t){var e,i,n,r,o,s,l,c,h=this,u=h.config,d=h.main,f=h.d3;h.hasArcType()||u.data_selection_enabled&&(u.zoom_enabled&&!h.zoom.altDomain||u.data_selection_multiple&&(e=h.dragStart[0],i=h.dragStart[1],n=t[0],r=t[1],o=Math.min(e,n),s=Math.max(e,n),l=u.data_selection_grouped?h.margin.top:Math.min(i,r),c=u.data_selection_grouped?h.height:Math.max(i,r),d.select("."+a.dragarea).attr("x",o).attr("y",l).attr("width",s-o).attr("height",c-l),d.selectAll("."+a.shapes).selectAll("."+a.shape).filter(function(t){return u.data_selection_isselectable(t)}).each(function(t,e){var i,n,r,u,d,p,g=f.select(this),m=g.classed(a.SELECTED),v=g.classed(a.INCLUDED),y=!1;if(g.classed(a.circle))i=1*g.attr("cx"),n=1*g.attr("cy"),d=h.togglePoint,y=o<i&&i<s&&l<n&&n<c;else{if(!g.classed(a.bar))return;i=(p=k(this)).x,n=p.y,r=p.width,u=p.height,d=h.togglePath,y=!(s<i||i+r<o||c<n||n+u<l)}y^v&&(g.classed(a.INCLUDED,!v),g.classed(a.SELECTED,!m),d.call(h,!m,g,t,e))})))},D.dragstart=function(t){var e=this,i=e.config;e.hasArcType()||i.data_selection_enabled&&(e.dragStart=t,e.main.select("."+a.chart).append("rect").attr("class",a.dragarea).style("opacity",.1),e.dragging=!0)},D.dragend=function(){var t=this,e=t.config;t.hasArcType()||e.data_selection_enabled&&(t.main.select("."+a.dragarea).transition().duration(100).style("opacity",0).remove(),t.main.selectAll("."+a.shape).classed(a.INCLUDED,!1),t.dragging=!1)},D.getYFormat=function(t){var e=this,i=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.yFormat,n=t&&!e.hasType("gauge")?e.defaultArcValueFormat:e.y2Format;return function(t,r,o){return("y2"===e.axis.getId(o)?n:i).call(e,t,r)}},D.yFormat=function(t){var e=this,i=e.config;return(i.axis_y_tick_format?i.axis_y_tick_format:e.defaultValueFormat)(t)},D.y2Format=function(t){var e=this,i=e.config;return(i.axis_y2_tick_format?i.axis_y2_tick_format:e.defaultValueFormat)(t)},D.defaultValueFormat=function(t){return u(t)?+t:""},D.defaultArcValueFormat=function(t,e){return(100*e).toFixed(1)+"%"},D.dataLabelFormat=function(t){var e=this.config.data_labels,i=function(t){return u(t)?+t:""};return"function"==typeof e.format?e.format:"object"===s(e.format)?e.format[t]?!0===e.format[t]?i:e.format[t]:function(){return""}:i},D.initGrid=function(){var t=this,e=t.config,i=t.d3;t.grid=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",a.grid),e.grid_x_show&&t.grid.append("g").attr("class",a.xgrids),e.grid_y_show&&t.grid.append("g").attr("class",a.ygrids),e.grid_focus_show&&t.grid.append("g").attr("class",a.xgridFocus).append("line").attr("class",a.xgridFocus),t.xgrid=i.selectAll([]),e.grid_lines_front||t.initGridLines()},D.initGridLines=function(){var t=this,e=t.d3;t.gridLines=t.main.append("g").attr("clip-path",t.clipPathForGrid).attr("class",a.grid+" "+a.gridLines),t.gridLines.append("g").attr("class",a.xgridLines),t.gridLines.append("g").attr("class",a.ygridLines),t.xgridLines=e.selectAll([])},D.updateXGrid=function(t){var e=this,i=e.config,n=e.d3,r=e.generateGridData(i.grid_x_type,e.x),o=e.isCategorized()?e.xAxis.tickOffset():0;e.xgridAttr=i.axis_rotated?{x1:0,x2:e.width,y1:function(t){return e.x(t)-o},y2:function(t){return e.x(t)-o}}:{x1:function(t){return e.x(t)+o},x2:function(t){return e.x(t)+o},y1:0,y2:e.height},e.xgrid=e.main.select("."+a.xgrids).selectAll("."+a.xgrid).data(r),e.xgrid.enter().append("line").attr("class",a.xgrid),t||e.xgrid.attr(e.xgridAttr).style("opacity",function(){return+n.select(this).attr(i.axis_rotated?"y1":"x1")===(i.axis_rotated?e.height:0)?0:1}),e.xgrid.exit().remove()},D.updateYGrid=function(){var t=this,e=t.config,i=t.yAxis.tickValues()||t.y.ticks(e.grid_y_ticks);t.ygrid=t.main.select("."+a.ygrids).selectAll("."+a.ygrid).data(i),t.ygrid.enter().append("line").attr("class",a.ygrid),t.ygrid.attr("x1",e.axis_rotated?t.y:0).attr("x2",e.axis_rotated?t.y:t.width).attr("y1",e.axis_rotated?0:t.y).attr("y2",e.axis_rotated?t.height:t.y),t.ygrid.exit().remove(),t.smoothLines(t.ygrid,"grid")},D.gridTextAnchor=function(t){return t.position?t.position:"end"},D.gridTextDx=function(t){return"start"===t.position?4:"middle"===t.position?0:-4},D.xGridTextX=function(t){return"start"===t.position?-this.height:"middle"===t.position?-this.height/2:0},D.yGridTextX=function(t){return"start"===t.position?0:"middle"===t.position?this.width/2:this.width},D.updateGrid=function(t){var e,i,n,r=this,o=r.main,s=r.config;r.grid.style("visibility",r.hasArcType()?"hidden":"visible"),o.select("line."+a.xgridFocus).style("visibility","hidden"),s.grid_x_show&&r.updateXGrid(),r.xgridLines=o.select("."+a.xgridLines).selectAll("."+a.xgridLine).data(s.grid_x_lines),(e=r.xgridLines.enter().append("g").attr("class",function(t){return a.xgridLine+(t.class?" "+t.class:"")})).append("line").style("opacity",0),e.append("text").attr("text-anchor",r.gridTextAnchor).attr("transform",s.axis_rotated?"":"rotate(-90)").attr("dx",r.gridTextDx).attr("dy",-5).style("opacity",0),r.xgridLines.exit().transition().duration(t).style("opacity",0).remove(),s.grid_y_show&&r.updateYGrid(),r.ygridLines=o.select("."+a.ygridLines).selectAll("."+a.ygridLine).data(s.grid_y_lines),(i=r.ygridLines.enter().append("g").attr("class",function(t){return a.ygridLine+(t.class?" "+t.class:"")})).append("line").style("opacity",0),i.append("text").attr("text-anchor",r.gridTextAnchor).attr("transform",s.axis_rotated?"rotate(-90)":"").attr("dx",r.gridTextDx).attr("dy",-5).style("opacity",0),n=r.yv.bind(r),r.ygridLines.select("line").transition().duration(t).attr("x1",s.axis_rotated?n:0).attr("x2",s.axis_rotated?n:r.width).attr("y1",s.axis_rotated?0:n).attr("y2",s.axis_rotated?r.height:n).style("opacity",1),r.ygridLines.select("text").transition().duration(t).attr("x",s.axis_rotated?r.xGridTextX.bind(r):r.yGridTextX.bind(r)).attr("y",n).text(function(t){return t.text}).style("opacity",1),r.ygridLines.exit().transition().duration(t).style("opacity",0).remove()},D.redrawGrid=function(t){var e=this,i=e.config,n=e.xv.bind(e),r=e.xgridLines.select("line"),o=e.xgridLines.select("text");return[(t?r.transition():r).attr("x1",i.axis_rotated?0:n).attr("x2",i.axis_rotated?e.width:n).attr("y1",i.axis_rotated?n:0).attr("y2",i.axis_rotated?n:e.height).style("opacity",1),(t?o.transition():o).attr("x",i.axis_rotated?e.yGridTextX.bind(e):e.xGridTextX.bind(e)).attr("y",n).text(function(t){return t.text}).style("opacity",1)]},D.showXGridFocus=function(t){var e=this,i=e.config,n=t.filter(function(t){return t&&u(t.value)}),r=e.main.selectAll("line."+a.xgridFocus),o=e.xx.bind(e);i.tooltip_show&&(e.hasType("scatter")||e.hasArcType()||(r.style("visibility","visible").data([n[0]]).attr(i.axis_rotated?"y1":"x1",o).attr(i.axis_rotated?"y2":"x2",o),e.smoothLines(r,"grid")))},D.hideXGridFocus=function(){this.main.select("line."+a.xgridFocus).style("visibility","hidden")},D.updateXgridFocus=function(){var t=this,e=t.config;t.main.select("line."+a.xgridFocus).attr("x1",e.axis_rotated?0:-10).attr("x2",e.axis_rotated?t.width:-10).attr("y1",e.axis_rotated?-10:0).attr("y2",e.axis_rotated?-10:t.height)},D.generateGridData=function(t,e){var i,n,r,o,s=this,l=[],c=s.main.select("."+a.axisX).selectAll(".tick").size();if("year"===t)for(n=(i=s.getXDomain())[0].getFullYear(),r=i[1].getFullYear(),o=n;o<=r;o++)l.push(new Date(o+"-01-01 00:00:00"));else(l=e.ticks(10)).length>c&&(l=l.filter(function(t){return(""+t).indexOf(".")<0}));return l},D.getGridFilterToRemove=function(t){return t?function(e){var i=!1;return[].concat(t).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(i=!0)}),i}:function(){return!0}},D.removeGridLines=function(t,e){var i=this,n=i.config,r=i.getGridFilterToRemove(t),o=function(t){return!r(t)},s=e?a.xgridLines:a.ygridLines,l=e?a.xgridLine:a.ygridLine;i.main.select("."+s).selectAll("."+l).filter(r).transition().duration(n.transition_duration).style("opacity",0).remove(),e?n.grid_x_lines=n.grid_x_lines.filter(o):n.grid_y_lines=n.grid_y_lines.filter(o)},D.initEventRect=function(){this.main.select("."+a.chart).append("g").attr("class",a.eventRects).style("fill-opacity",0)},D.redrawEventRect=function(){var t,e,i=this,n=i.config,r=i.isMultipleX(),o=i.main.select("."+a.eventRects).style("cursor",n.zoom_enabled?n.axis_rotated?"ns-resize":"ew-resize":null).classed(a.eventRectsMultiple,r).classed(a.eventRectsSingle,!r);o.selectAll("."+a.eventRect).remove(),i.eventRect=o.selectAll("."+a.eventRect),r?(t=i.eventRect.data([0]),i.generateEventRectsForMultipleXs(t.enter()),i.updateEventRect(t)):(e=i.getMaxDataCountTarget(i.data.targets),o.datum(e?e.values:[]),i.eventRect=o.selectAll("."+a.eventRect),t=i.eventRect.data(function(t){return t}),i.generateEventRectsForSingleX(t.enter()),i.updateEventRect(t),t.exit().remove())},D.updateEventRect=function(t){var e,i,n,r,o,a,s=this,l=s.config;t=t||s.eventRect.data(function(t){return t}),s.isMultipleX()?(e=0,i=0,n=s.width,r=s.height):(!s.isCustomX()&&!s.isTimeSeries()||s.isCategorized()?(o=s.getEventRectWidth(),a=function(t){return s.x(t.x)-o/2}):(s.updateXs(),o=function(t){var e=s.getPrevX(t.index),i=s.getNextX(t.index);return null===e&&null===i?l.axis_rotated?s.height:s.width:(null===e&&(e=s.x.domain()[0]),null===i&&(i=s.x.domain()[1]),Math.max(0,(s.x(i)-s.x(e))/2))},a=function(t){var e=s.getPrevX(t.index),i=s.getNextX(t.index),n=s.data.xs[t.id][t.index];return null===e&&null===i?0:(null===e&&(e=s.x.domain()[0]),(s.x(n)+s.x(e))/2)}),e=l.axis_rotated?0:a,i=l.axis_rotated?a:0,n=l.axis_rotated?s.width:o,r=l.axis_rotated?o:s.height),t.attr("class",s.classEvent.bind(s)).attr("x",e).attr("y",i).attr("width",n).attr("height",r)},D.generateEventRectsForSingleX=function(t){var e=this,i=e.d3,n=e.config;t.append("rect").attr("class",e.classEvent.bind(e)).style("cursor",n.data_selection_enabled&&n.data_selection_grouped?"pointer":null).on("mouseover",function(t){var i=t.index;e.dragging||e.flowing||e.hasArcType()||(n.point_focus_expand_enabled&&e.expandCircles(i,null,!0),e.expandBars(i,null,!0),e.main.selectAll("."+a.shape+"-"+i).each(function(t){n.data_onmouseover.call(e.api,t)}))}).on("mouseout",function(t){var i=t.index;e.config&&(e.hasArcType()||(e.hideXGridFocus(),e.hideTooltip(),e.unexpandCircles(),e.unexpandBars(),e.main.selectAll("."+a.shape+"-"+i).each(function(t){n.data_onmouseout.call(e.api,t)})))}).on("mousemove",function(t){var r,o=t.index,s=e.svg.select("."+a.eventRect+"-"+o);e.dragging||e.flowing||e.hasArcType()||(e.isStepType(t)&&"step-after"===e.config.line_step_type&&i.mouse(this)[0]<e.x(e.getXValue(t.id,o))&&(o-=1),r=e.filterTargetsToShow(e.data.targets).map(function(t){return e.addName(e.getValueOnIndex(t.values,o))}),n.tooltip_grouped&&(e.showTooltip(r,this),e.showXGridFocus(r)),(!n.tooltip_grouped||n.data_selection_enabled&&!n.data_selection_grouped)&&e.main.selectAll("."+a.shape+"-"+o).each(function(){i.select(this).classed(a.EXPANDED,!0),n.data_selection_enabled&&s.style("cursor",n.data_selection_grouped?"pointer":null),n.tooltip_grouped||(e.hideXGridFocus(),e.hideTooltip(),n.data_selection_grouped||(e.unexpandCircles(o),e.unexpandBars(o)))}).filter(function(t){return e.isWithinShape(this,t)}).each(function(t){n.data_selection_enabled&&(n.data_selection_grouped||n.data_selection_isselectable(t))&&s.style("cursor","pointer"),n.tooltip_grouped||(e.showTooltip([t],this),e.showXGridFocus([t]),n.point_focus_expand_enabled&&e.expandCircles(o,t.id,!0),e.expandBars(o,t.id,!0))}))}).on("click",function(t){var r=t.index;!e.hasArcType()&&e.toggleShape&&(e.cancelClick?e.cancelClick=!1:(e.isStepType(t)&&"step-after"===n.line_step_type&&i.mouse(this)[0]<e.x(e.getXValue(t.id,r))&&(r-=1),e.main.selectAll("."+a.shape+"-"+r).each(function(t){(n.data_selection_grouped||e.isWithinShape(this,t))&&(e.toggleShape(this,t,r),e.config.data_onclick.call(e.api,t,this))})))}).call(n.data_selection_draggable&&e.drag?i.behavior.drag().origin(Object).on("drag",function(){e.drag(i.mouse(this))}).on("dragstart",function(){e.dragstart(i.mouse(this))}).on("dragend",function(){e.dragend()}):function(){})},D.generateEventRectsForMultipleXs=function(t){function e(){i.svg.select("."+a.eventRect).style("cursor",null),i.hideXGridFocus(),i.hideTooltip(),i.unexpandCircles(),i.unexpandBars()}var i=this,n=i.d3,r=i.config;t.append("rect").attr("x",0).attr("y",0).attr("width",i.width).attr("height",i.height).attr("class",a.eventRect).on("mouseout",function(){i.config&&(i.hasArcType()||e())}).on("mousemove",function(){var t,o,s,l=i.filterTargetsToShow(i.data.targets);i.dragging||i.hasArcType(l)||(t=n.mouse(this),o=i.findClosestFromTargets(l,t),!i.mouseover||o&&o.id===i.mouseover.id||(r.data_onmouseout.call(i.api,i.mouseover),i.mouseover=void 0),o?(s=(i.isScatterType(o)||!r.tooltip_grouped?[o]:i.filterByX(l,o.x)).map(function(t){return i.addName(t)}),i.showTooltip(s,this),r.point_focus_expand_enabled&&i.expandCircles(o.index,o.id,!0),i.expandBars(o.index,o.id,!0),i.showXGridFocus(s),(i.isBarType(o.id)||i.dist(o,t)<r.point_sensitivity)&&(i.svg.select("."+a.eventRect).style("cursor","pointer"),i.mouseover||(r.data_onmouseover.call(i.api,o),i.mouseover=o))):e())}).on("click",function(){var t,e,o=i.filterTargetsToShow(i.data.targets);i.hasArcType(o)||(t=n.mouse(this),(e=i.findClosestFromTargets(o,t))&&(i.isBarType(e.id)||i.dist(e,t)<r.point_sensitivity)&&i.main.selectAll("."+a.shapes+i.getTargetSelectorSuffix(e.id)).selectAll("."+a.shape+"-"+e.index).each(function(){(r.data_selection_grouped||i.isWithinShape(this,e))&&(i.toggleShape(this,e,e.index),i.config.data_onclick.call(i.api,e,this))}))}).call(r.data_selection_draggable&&i.drag?n.behavior.drag().origin(Object).on("drag",function(){i.drag(n.mouse(this))}).on("dragstart",function(){i.dragstart(n.mouse(this))}).on("dragend",function(){i.dragend()}):function(){})},D.dispatchEvent=function(t,e,i){var n=this,r="."+a.eventRect+(n.isMultipleX()?"":"-"+e),o=n.main.select(r).node(),s=o.getBoundingClientRect(),l=s.left+(i?i[0]:0),c=s.top+(i?i[1]:0),h=document.createEvent("MouseEvents");h.initMouseEvent(t,!0,!0,window,0,l,c,l,c,!1,!1,!1,!1,0,null),o.dispatchEvent(h)},D.initLegend=function(){var t=this;if(t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g").attr("transform",t.getTranslate("legend")),!t.config.legend_show)return t.legend.style("visibility","hidden"),void(t.hiddenLegendIds=t.mapToIds(t.data.targets));t.updateLegendWithDefaults()},D.updateLegendWithDefaults=function(){var t=this;t.updateLegend(t.mapToIds(t.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},D.updateSizeForLegend=function(t,e){var i=this,n=i.config,r={top:i.isLegendTop?i.getCurrentPaddingTop()+n.legend_inset_y+5.5:i.currentHeight-t-i.getCurrentPaddingBottom()-n.legend_inset_y,left:i.isLegendLeft?i.getCurrentPaddingLeft()+n.legend_inset_x+.5:i.currentWidth-e-i.getCurrentPaddingRight()-n.legend_inset_x+.5};i.margin3={top:i.isLegendRight?0:i.isLegendInset?r.top:i.currentHeight-t,right:NaN,bottom:0,left:i.isLegendRight?i.currentWidth-e:i.isLegendInset?r.left:0}},D.transformLegend=function(t){var e=this;(t?e.legend.transition():e.legend).attr("transform",e.getTranslate("legend"))},D.updateLegendStep=function(t){this.legendStep=t},D.updateLegendItemWidth=function(t){this.legendItemWidth=t},D.updateLegendItemHeight=function(t){this.legendItemHeight=t},D.getLegendWidth=function(){var t=this;return t.config.legend_show?t.isLegendRight||t.isLegendInset?t.legendItemWidth*(t.legendStep+1):t.currentWidth:0},D.getLegendHeight=function(){var t=this,e=0;return t.config.legend_show&&(e=t.isLegendRight?t.currentHeight:Math.max(20,t.legendItemHeight)*(t.legendStep+1)),e},D.opacityForLegend=function(t){return t.classed(a.legendItemHidden)?null:1},D.opacityForUnfocusedLegend=function(t){return t.classed(a.legendItemHidden)?null:.3},D.toggleFocusLegend=function(t,e){var i=this;t=i.mapToTargetIds(t),i.legend.selectAll("."+a.legendItem).filter(function(e){return t.indexOf(e)>=0}).classed(a.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?i.opacityForLegend:i.opacityForUnfocusedLegend).call(i,i.d3.select(this))})},D.revertLegend=function(){var t=this,e=t.d3;t.legend.selectAll("."+a.legendItem).classed(a.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(e.select(this))})},D.showLegend=function(t){var e=this,i=e.config;i.legend_show||(i.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegendWithDefaults()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(e.d3.select(this))})},D.hideLegend=function(t){var e=this,i=e.config;i.legend_show&&x(t)&&(i.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity",0).style("visibility","hidden")},D.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},D.updateLegend=function(t,e,i){function n(t,e){return C.legendItemTextBox[e]||(C.legendItemTextBox[e]=C.getTextRect(t.textContent,a.legendItem,t)),C.legendItemTextBox[e]}function r(e,i,r){function o(t,e){e||(a=(p-L-f)/2)<E&&(a=(p-f)/2,L=0,z++),F[t]=z,N[z]=C.isLegendInset?10:a,I[t]=L,L+=f}var a,s,l=0===r,c=r===t.length-1,h=n(e,i),u=h.width+P+(!c||C.isLegendRight||C.isLegendInset?A:0)+k.legend_padding,d=h.height+T,f=C.isLegendRight||C.isLegendInset?d:u,p=C.isLegendRight||C.isLegendInset?C.getLegendHeight():C.getLegendWidth();l&&(L=0,z=0,D=0,M=0),!k.legend_show||C.isLegendToShow(i)?(O[i]=u,R[i]=d,(!D||u>=D)&&(D=u),(!M||d>=M)&&(M=d),s=C.isLegendRight||C.isLegendInset?M:D,k.legend_equally?(Object.keys(O).forEach(function(t){O[t]=D}),Object.keys(R).forEach(function(t){R[t]=M}),(a=(p-s*t.length)/2)<E?(L=0,z=0,t.forEach(function(t){o(t)})):o(i,!0)):o(i)):O[i]=R[i]=F[i]=I[i]=0}var o,s,l,c,h,u,d,f,p,g,v,y,b,x,_,S,C=this,k=C.config,T=4,A=10,D=0,M=0,E=10,P=k.legend_item_tile_width+5,L=0,I={},O={},R={},N=[0],F={},z=0;t=t.filter(function(t){return!m(k.data_names[t])||null!==k.data_names[t]}),v=w(e=e||{},"withTransition",!0),y=w(e,"withTransitionForTransform",!0),C.isLegendInset&&(z=k.legend_inset_step?k.legend_inset_step:t.length,C.updateLegendStep(z)),C.isLegendRight?(o=function(t){return D*F[t]},c=function(t){return N[F[t]]+I[t]}):C.isLegendInset?(o=function(t){return D*F[t]+10},c=function(t){return N[F[t]]+I[t]}):(o=function(t){return N[F[t]]+I[t]},c=function(t){return M*F[t]}),s=function(t,e){return o(t,e)+4+k.legend_item_tile_width},h=function(t,e){return c(t,e)+9},l=function(t,e){return o(t,e)},u=function(t,e){return c(t,e)-5},d=function(t,e){return o(t,e)-2},f=function(t,e){return o(t,e)-2+k.legend_item_tile_width},p=function(t,e){return c(t,e)+4},(g=C.legend.selectAll("."+a.legendItem).data(t).enter().append("g").attr("class",function(t){return C.generateClass(a.legendItem,t)}).style("visibility",function(t){return C.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){k.legend_item_onclick?k.legend_item_onclick.call(C,t):C.d3.event.altKey?(C.api.hide(),C.api.show(t)):(C.api.toggle(t),C.isTargetToShow(t)?C.api.focus(t):C.api.revert())}).on("mouseover",function(t){k.legend_item_onmouseover?k.legend_item_onmouseover.call(C,t):(C.d3.select(this).classed(a.legendItemFocused,!0),!C.transiting&&C.isTargetToShow(t)&&C.api.focus(t))}).on("mouseout",function(t){k.legend_item_onmouseout?k.legend_item_onmouseout.call(C,t):(C.d3.select(this).classed(a.legendItemFocused,!1),C.api.revert())})).append("text").text(function(t){return m(k.data_names[t])?k.data_names[t]:t}).each(function(t,e){r(this,t,e)}).style("pointer-events","none").attr("x",C.isLegendRight||C.isLegendInset?s:-200).attr("y",C.isLegendRight||C.isLegendInset?-200:h),g.append("rect").attr("class",a.legendItemEvent).style("fill-opacity",0).attr("x",C.isLegendRight||C.isLegendInset?l:-200).attr("y",C.isLegendRight||C.isLegendInset?-200:u),g.append("line").attr("class",a.legendItemTile).style("stroke",C.color).style("pointer-events","none").attr("x1",C.isLegendRight||C.isLegendInset?d:-200).attr("y1",C.isLegendRight||C.isLegendInset?-200:p).attr("x2",C.isLegendRight||C.isLegendInset?f:-200).attr("y2",C.isLegendRight||C.isLegendInset?-200:p).attr("stroke-width",k.legend_item_tile_height),S=C.legend.select("."+a.legendBackground+" rect"),C.isLegendInset&&D>0&&0===S.size()&&(S=C.legend.insert("g","."+a.legendItem).attr("class",a.legendBackground).append("rect")),b=C.legend.selectAll("text").data(t).text(function(t){return m(k.data_names[t])?k.data_names[t]:t}).each(function(t,e){r(this,t,e)}),(v?b.transition():b).attr("x",s).attr("y",h),x=C.legend.selectAll("rect."+a.legendItemEvent).data(t),(v?x.transition():x).attr("width",function(t){return O[t]}).attr("height",function(t){return R[t]}).attr("x",l).attr("y",u),_=C.legend.selectAll("line."+a.legendItemTile).data(t),(v?_.transition():_).style("stroke",C.color).attr("x1",d).attr("y1",p).attr("x2",f).attr("y2",p),S&&(v?S.transition():S).attr("height",C.getLegendHeight()-12).attr("width",D*(z+1)+10),C.legend.selectAll("."+a.legendItem).classed(a.legendItemHidden,function(t){return!C.isTargetToShow(t)}),C.updateLegendItemWidth(D),C.updateLegendItemHeight(M),C.updateLegendStep(z),C.updateSizes(),C.updateScales(),C.updateSvgSize(),C.transformAll(y,i),C.legendHasRendered=!0},D.initRegion=function(){var t=this;t.region=t.main.append("g").attr("clip-path",t.clipPath).attr("class",a.regions)},D.updateRegion=function(t){var e=this,i=e.config;e.region.style("visibility",e.hasArcType()?"hidden":"visible"),e.mainRegion=e.main.select("."+a.regions).selectAll("."+a.region).data(i.regions),e.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),e.mainRegion.attr("class",e.classRegion.bind(e)),e.mainRegion.exit().transition().duration(t).style("opacity",0).remove()},D.redrawRegion=function(t){var e=this,i=e.mainRegion.selectAll("rect").each(function(){var t=e.d3.select(this.parentNode).datum();e.d3.select(this).datum(t)}),n=e.regionX.bind(e),r=e.regionY.bind(e),o=e.regionWidth.bind(e),a=e.regionHeight.bind(e);return[(t?i.transition():i).attr("x",n).attr("y",r).attr("width",o).attr("height",a).style("fill-opacity",function(t){return u(t.opacity)?t.opacity:.1})]},D.regionX=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated&&"start"in t?n(t.start):0:i.axis_rotated?0:"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},D.regionY=function(t){var e=this,i=e.config,n="y"===t.axis?e.y:e.y2;return"y"===t.axis||"y2"===t.axis?i.axis_rotated?0:"end"in t?n(t.end):0:i.axis_rotated&&"start"in t?e.x(e.isTimeSeries()?e.parseDate(t.start):t.start):0},D.regionWidth=function(t){var e,i=this,n=i.config,r=i.regionX(t),o="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated&&"end"in t?o(t.end):i.width:n.axis_rotated?i.width:"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.width)<r?0:e-r},D.regionHeight=function(t){var e,i=this,n=i.config,r=this.regionY(t),o="y"===t.axis?i.y:i.y2;return(e="y"===t.axis||"y2"===t.axis?n.axis_rotated?i.height:"start"in t?o(t.start):i.height:n.axis_rotated&&"end"in t?i.x(i.isTimeSeries()?i.parseDate(t.end):t.end):i.height)<r?0:e-r},D.isRegionOnX=function(t){return!t.axis||"x"===t.axis},D.getScale=function(t,e,i){return(i?this.d3.time.scale():this.d3.scale.linear()).range([t,e])},D.getX=function(t,e,i,n){var r,o=this,a=o.getScale(t,e,o.isTimeSeries()),s=i?a.domain(i):a;o.isCategorized()?(n=n||function(){return 0},a=function(t,e){var i=s(t)+n(t);return e?i:Math.ceil(i)}):a=function(t,e){var i=s(t);return e?i:Math.ceil(i)};for(r in s)a[r]=s[r];return a.orgDomain=function(){return s.domain()},o.isCategorized()&&(a.domain=function(t){return arguments.length?(s.domain(t),a):(t=this.orgDomain(),[t[0],t[1]+1])}),a},D.getY=function(t,e,i){var n=this.getScale(t,e,this.isTimeSeriesY());return i&&n.domain(i),n},D.getYScale=function(t){return"y2"===this.axis.getId(t)?this.y2:this.y},D.getSubYScale=function(t){return"y2"===this.axis.getId(t)?this.subY2:this.subY},D.updateScales=function(){var t=this,e=t.config,i=!t.x;t.xMin=e.axis_rotated?1:0,t.xMax=e.axis_rotated?t.height:t.width,t.yMin=e.axis_rotated?0:t.height,t.yMax=e.axis_rotated?t.width:1,t.subXMin=t.xMin,t.subXMax=t.xMax,t.subYMin=e.axis_rotated?0:t.height2,t.subYMax=e.axis_rotated?t.width2:1,t.x=t.getX(t.xMin,t.xMax,i?void 0:t.x.orgDomain(),function(){return t.xAxis.tickOffset()}),t.y=t.getY(t.yMin,t.yMax,i?e.axis_y_default:t.y.domain()),t.y2=t.getY(t.yMin,t.yMax,i?e.axis_y2_default:t.y2.domain()),t.subX=t.getX(t.xMin,t.xMax,t.orgXDomain,function(e){return e%1?0:t.subXAxis.tickOffset()}),t.subY=t.getY(t.subYMin,t.subYMax,i?e.axis_y_default:t.subY.domain()),t.subY2=t.getY(t.subYMin,t.subYMax,i?e.axis_y2_default:t.subY2.domain()),t.xAxisTickFormat=t.axis.getXAxisTickFormat(),t.xAxisTickValues=t.axis.getXAxisTickValues(),t.yAxisTickValues=t.axis.getYAxisTickValues(),t.y2AxisTickValues=t.axis.getY2AxisTickValues(),t.xAxis=t.axis.getXAxis(t.x,t.xOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.subXAxis=t.axis.getXAxis(t.subX,t.subXOrient,t.xAxisTickFormat,t.xAxisTickValues,e.axis_x_tick_outer),t.yAxis=t.axis.getYAxis(t.y,t.yOrient,e.axis_y_tick_format,t.yAxisTickValues,e.axis_y_tick_outer),t.y2Axis=t.axis.getYAxis(t.y2,t.y2Orient,e.axis_y2_tick_format,t.y2AxisTickValues,e.axis_y2_tick_outer),i||(t.brush&&t.brush.scale(t.subX),e.zoom_enabled&&t.zoom.scale(t.x)),t.updateArc&&t.updateArc()},D.selectPoint=function(t,e,i){var n=this,r=n.config,o=(r.axis_rotated?n.circleY:n.circleX).bind(n),s=(r.axis_rotated?n.circleX:n.circleY).bind(n),l=n.pointSelectR.bind(n);r.data_onselected.call(n.api,e,t.node()),n.main.select("."+a.selectedCircles+n.getTargetSelectorSuffix(e.id)).selectAll("."+a.selectedCircle+"-"+i).data([e]).enter().append("circle").attr("class",function(){return n.generateClass(a.selectedCircle,i)}).attr("cx",o).attr("cy",s).attr("stroke",function(){return n.color(e)}).attr("r",function(t){return 1.4*n.pointSelectR(t)}).transition().duration(100).attr("r",l)},D.unselectPoint=function(t,e,i){var n=this;n.config.data_onunselected.call(n.api,e,t.node()),n.main.select("."+a.selectedCircles+n.getTargetSelectorSuffix(e.id)).selectAll("."+a.selectedCircle+"-"+i).transition().duration(100).attr("r",0).remove()},D.togglePoint=function(t,e,i,n){t?this.selectPoint(e,i,n):this.unselectPoint(e,i,n)},D.selectPath=function(t,e){var i=this;i.config.data_onselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return i.d3.rgb(i.color(e)).brighter(.75)})},D.unselectPath=function(t,e){var i=this;i.config.data_onunselected.call(i,e,t.node()),i.config.interaction_brighten&&t.transition().duration(100).style("fill",function(){return i.color(e)})},D.togglePath=function(t,e,i,n){t?this.selectPath(e,i,n):this.unselectPath(e,i,n)},D.getToggle=function(t,e){var i,n=this;return"circle"===t.nodeName?i=n.isStepType(e)?function(){}:n.togglePoint:"path"===t.nodeName&&(i=n.togglePath),i},D.toggleShape=function(t,e,i){var n=this,r=n.d3,o=n.config,s=r.select(t),l=s.classed(a.SELECTED),c=n.getToggle(t,e).bind(n);o.data_selection_enabled&&o.data_selection_isselectable(e)&&(o.data_selection_multiple||n.main.selectAll("."+a.shapes+(o.data_selection_grouped?n.getTargetSelectorSuffix(e.id):"")).selectAll("."+a.shape).each(function(t,e){var i=r.select(this);i.classed(a.SELECTED)&&c(!1,i.classed(a.SELECTED,!1),t,e)}),s.classed(a.SELECTED,!l),c(!l,s,e,i))},D.initBar=function(){this.main.select("."+a.chart).append("g").attr("class",a.chartBars)},D.updateTargetsForBar=function(t){var e=this,i=e.config,n=e.classChartBar.bind(e),r=e.classBars.bind(e),o=e.classFocus.bind(e);e.main.select("."+a.chartBars).selectAll("."+a.chartBar).data(t).attr("class",function(t){return n(t)+o(t)}).enter().append("g").attr("class",n).style("pointer-events","none").append("g").attr("class",r).style("cursor",function(t){return i.data_selection_isselectable(t)?"pointer":null})},D.updateBar=function(t){var e=this,i=e.barData.bind(e),n=e.classBar.bind(e),r=e.initialOpacity.bind(e),o=function(t){return e.color(t.id)};e.mainBar=e.main.selectAll("."+a.bars).selectAll("."+a.bar).data(i),e.mainBar.enter().append("path").attr("class",n).style("stroke",o).style("fill",o),e.mainBar.style("opacity",r),e.mainBar.exit().transition().duration(t).remove()},D.redrawBar=function(t,e){return[(e?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",t).style("stroke",this.color).style("fill",this.color).style("opacity",1)]},D.getBarW=function(t,e){var i=this.config,n="number"==typeof i.bar_width?i.bar_width:e?t.tickInterval()*i.bar_width_ratio/e:0;return i.bar_width_max&&n>i.bar_width_max?i.bar_width_max:n},D.getBars=function(t,e){var i=this;return(e?i.main.selectAll("."+a.bars+i.getTargetSelectorSuffix(e)):i.main).selectAll("."+a.bar+(u(t)?"-"+t:""))},D.expandBars=function(t,e,i){var n=this;i&&n.unexpandBars(),n.getBars(t,e).classed(a.EXPANDED,!0)},D.unexpandBars=function(t){this.getBars(t).classed(a.EXPANDED,!1)},D.generateDrawBar=function(t,e){var i=this,n=i.config,r=i.generateGetBarPoints(t,e);return function(t,e){var i=r(t,e),o=n.axis_rotated?1:0,a=n.axis_rotated?0:1;return"M "+i[0][o]+","+i[0][a]+" L"+i[1][o]+","+i[1][a]+" L"+i[2][o]+","+i[2][a]+" L"+i[3][o]+","+i[3][a]+" z"}},D.generateGetBarPoints=function(t,e){var i=this,n=e?i.subXAxis:i.xAxis,r=t.__max__+1,o=i.getBarW(n,r),a=i.getShapeX(o,r,t,!!e),s=i.getShapeY(!!e),l=i.getShapeOffset(i.isBarType,t,!!e),c=o*(i.config.bar_space/2),h=e?i.getSubYScale:i.getYScale;return function(t,e){var n=h.call(i,t.id)(0),r=l(t,e)||n,u=a(t),d=s(t);return i.config.axis_rotated&&(0<t.value&&d<n||t.value<0&&n<d)&&(d=n),[[u+c,r],[u+c,d-(n-r)],[u+o-c,d-(n-r)],[u+o-c,r]]}},D.isWithinBar=function(t){var e=this.d3.mouse(t),i=t.getBoundingClientRect(),n=t.pathSegList.getItem(0),r=t.pathSegList.getItem(1),o=Math.min(n.x,r.x),a=Math.min(n.y,r.y),s=o+i.width+2,l=a+i.height+2,c=a-2;return o-2<e[0]&&e[0]<s&&c<e[1]&&e[1]<l},D.getShapeIndices=function(t){var e,i,n=this,r=n.config,o={},a=0;return n.filterTargetsToShow(n.data.targets.filter(t,n)).forEach(function(t){for(e=0;e<r.data_groups.length;e++)if(!(r.data_groups[e].indexOf(t.id)<0))for(i=0;i<r.data_groups[e].length;i++)if(r.data_groups[e][i]in o){o[t.id]=o[r.data_groups[e][i]];break}g(o[t.id])&&(o[t.id]=a++)}),o.__max__=a-1,o},D.getShapeX=function(t,e,i,n){var r=this,o=n?r.subX:r.x;return function(n){var r=n.id in i?i[n.id]:0;return n.x||0===n.x?o(n.x)-t*(e/2-r):0}},D.getShapeY=function(t){var e=this;return function(i){return(t?e.getSubYScale(i.id):e.getYScale(i.id))(i.value)}},D.getShapeOffset=function(t,e,i){var n=this,r=n.orderTargets(n.filterTargetsToShow(n.data.targets.filter(t,n))),o=r.map(function(t){return t.id});return function(t,a){var s=i?n.getSubYScale(t.id):n.getYScale(t.id),l=s(0),c=l;return r.forEach(function(i){var r=n.isStepType(t)?n.convertValuesToStep(i.values):i.values;i.id!==t.id&&e[i.id]===e[t.id]&&o.indexOf(i.id)<o.indexOf(t.id)&&(void 0!==r[a]&&+r[a].x==+t.x||(a=-1,r.forEach(function(e,i){e.x===t.x&&(a=i)})),a in r&&r[a].value*t.value>=0&&(c+=s(r[a].value)-l))}),c}},D.isWithinShape=function(t,e){var i,n=this,r=n.d3.select(t);return n.isTargetToShow(e.id)?"circle"===t.nodeName?i=n.isStepType(e)?n.isWithinStep(t,n.getYScale(e.id)(e.value)):n.isWithinCircle(t,1.5*n.pointSelectR(e)):"path"===t.nodeName&&(i=!r.classed(a.bar)||n.isWithinBar(t)):i=!1,i},D.getInterpolate=function(t){var e=this,i=e.isInterpolationType(e.config.spline_interpolation_type)?e.config.spline_interpolation_type:"cardinal";return e.isSplineType(t)?i:e.isStepType(t)?e.config.line_step_type:"linear"},D.initLine=function(){this.main.select("."+a.chart).append("g").attr("class",a.chartLines)},D.updateTargetsForLine=function(t){var e,i=this,n=i.config,r=i.classChartLine.bind(i),o=i.classLines.bind(i),s=i.classAreas.bind(i),l=i.classCircles.bind(i),c=i.classFocus.bind(i);(e=i.main.select("."+a.chartLines).selectAll("."+a.chartLine).data(t).attr("class",function(t){return r(t)+c(t)}).enter().append("g").attr("class",r).style("opacity",0).style("pointer-events","none")).append("g").attr("class",o),e.append("g").attr("class",s),e.append("g").attr("class",function(t){return i.generateClass(a.selectedCircles,t.id)}),e.append("g").attr("class",l).style("cursor",function(t){return n.data_selection_isselectable(t)?"pointer":null}),t.forEach(function(t){i.main.selectAll("."+a.selectedCircles+i.getTargetSelectorSuffix(t.id)).selectAll("."+a.selectedCircle).each(function(e){e.value=t.values[e.index].value})})},D.updateLine=function(t){var e=this;e.mainLine=e.main.selectAll("."+a.lines).selectAll("."+a.line).data(e.lineData.bind(e)),e.mainLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color),e.mainLine.style("opacity",e.initialOpacity.bind(e)).style("shape-rendering",function(t){return e.isStepType(t)?"crispEdges":""}).attr("transform",null),e.mainLine.exit().transition().duration(t).style("opacity",0).remove()},D.redrawLine=function(t,e){return[(e?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",t).style("stroke",this.color).style("opacity",1)]},D.generateDrawLine=function(t,e){var i=this,n=i.config,r=i.d3.svg.line(),o=i.generateGetLinePoints(t,e),a=e?i.getSubYScale:i.getYScale,s=function(t){return(e?i.subxx:i.xx).call(i,t)},l=function(t,e){return n.data_groups.length>0?o(t,e)[0][1]:a.call(i,t.id)(t.value)};return r=n.axis_rotated?r.x(l).y(s):r.x(s).y(l),n.line_connectNull||(r=r.defined(function(t){return null!=t.value})),function(t){var o,s=n.line_connectNull?i.filterRemoveNull(t.values):t.values,l=e?i.x:i.subX,c=a.call(i,t.id),h=0,u=0;return i.isLineType(t)?n.data_regions[t.id]?o=i.lineWithRegions(s,l,c,n.data_regions[t.id]):(i.isStepType(t)&&(s=i.convertValuesToStep(s)),o=r.interpolate(i.getInterpolate(t))(s)):(s[0]&&(h=l(s[0].x),u=c(s[0].value)),o=n.axis_rotated?"M "+u+" "+h:"M "+h+" "+u),o||"M 0 0"}},D.generateGetLinePoints=function(t,e){var i=this,n=i.config,r=t.__max__+1,o=i.getShapeX(0,r,t,!!e),a=i.getShapeY(!!e),s=i.getShapeOffset(i.isLineType,t,!!e),l=e?i.getSubYScale:i.getYScale;return function(t,e){var r=l.call(i,t.id)(0),c=s(t,e)||r,h=o(t),u=a(t);return n.axis_rotated&&(0<t.value&&u<r||t.value<0&&r<u)&&(u=r),[[h,u-(r-c)],[h,u-(r-c)],[h,u-(r-c)],[h,u-(r-c)]]}},D.lineWithRegions=function(t,e,i,n){function r(t){return"M"+t[0][0]+" "+t[0][1]+" "+t[1][0]+" "+t[1][1]}var o,a,s,l,c,h,u,d,f,p,v,y=this,b=y.config,x="M",_=y.isCategorized()?.5:0,w=[];if(m(n))for(o=0;o<n.length;o++)w[o]={},g(n[o].start)?w[o].start=t[0].x:w[o].start=y.isTimeSeries()?y.parseDate(n[o].start):n[o].start,g(n[o].end)?w[o].end=t[t.length-1].x:w[o].end=y.isTimeSeries()?y.parseDate(n[o].end):n[o].end;for(p=b.axis_rotated?function(t){return i(t.value)}:function(t){return e(t.x)},v=b.axis_rotated?function(t){return e(t.x)}:function(t){return i(t.value)},s=y.isTimeSeries()?function(t,n,o,a){var s,l=t.x.getTime(),h=n.x-t.x,u=new Date(l+h*o),d=new Date(l+h*(o+a));return s=b.axis_rotated?[[i(c(o)),e(u)],[i(c(o+a)),e(d)]]:[[e(u),i(c(o))],[e(d),i(c(o+a))]],r(s)}:function(t,n,o,a){var s;return s=b.axis_rotated?[[i(c(o),!0),e(l(o))],[i(c(o+a),!0),e(l(o+a))]]:[[e(l(o),!0),i(c(o))],[e(l(o+a),!0),i(c(o+a))]],r(s)},o=0;o<t.length;o++){if(g(w)||!function(t,e){var i;for(i=0;i<e.length;i++)if(e[i].start<t&&t<=e[i].end)return!0;return!1}(t[o].x,w))x+=" "+p(t[o])+" "+v(t[o]);else for(l=y.getScale(t[o-1].x+_,t[o].x+_,y.isTimeSeries()),c=y.getScale(t[o-1].value,t[o].value),h=e(t[o].x)-e(t[o-1].x),u=i(t[o].value)-i(t[o-1].value),f=2*(d=2/Math.sqrt(Math.pow(h,2)+Math.pow(u,2))),a=d;a<=1;a+=f)x+=s(t[o-1],t[o],a,d);t[o].x}return x},D.updateArea=function(t){var e=this,i=e.d3;e.mainArea=e.main.selectAll("."+a.areas).selectAll("."+a.area).data(e.lineData.bind(e)),e.mainArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+i.select(this).style("opacity"),0}),e.mainArea.style("opacity",e.orgAreaOpacity),e.mainArea.exit().transition().duration(t).style("opacity",0).remove()},D.redrawArea=function(t,e){return[(e?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},D.generateDrawArea=function(t,e){var i=this,n=i.config,r=i.d3.svg.area(),o=i.generateGetAreaPoints(t,e),a=e?i.getSubYScale:i.getYScale,s=function(t){return(e?i.subxx:i.xx).call(i,t)},l=function(t,e){return n.data_groups.length>0?o(t,e)[0][1]:a.call(i,t.id)(i.getAreaBaseValue(t.id))},c=function(t,e){return n.data_groups.length>0?o(t,e)[1][1]:a.call(i,t.id)(t.value)};return r=n.axis_rotated?r.x0(l).x1(c).y(s):r.x(s).y0(n.area_above?0:l).y1(c),n.line_connectNull||(r=r.defined(function(t){return null!==t.value})),function(t){var e,o=n.line_connectNull?i.filterRemoveNull(t.values):t.values,a=0,s=0;return i.isAreaType(t)?(i.isStepType(t)&&(o=i.convertValuesToStep(o)),e=r.interpolate(i.getInterpolate(t))(o)):(o[0]&&(a=i.x(o[0].x),s=i.getYScale(t.id)(o[0].value)),e=n.axis_rotated?"M "+s+" "+a:"M "+a+" "+s),e||"M 0 0"}},D.getAreaBaseValue=function(){return 0},D.generateGetAreaPoints=function(t,e){var i=this,n=i.config,r=t.__max__+1,o=i.getShapeX(0,r,t,!!e),a=i.getShapeY(!!e),s=i.getShapeOffset(i.isAreaType,t,!!e),l=e?i.getSubYScale:i.getYScale;return function(t,e){var r=l.call(i,t.id)(0),c=s(t,e)||r,h=o(t),u=a(t);return n.axis_rotated&&(0<t.value&&u<r||t.value<0&&r<u)&&(u=r),[[h,c],[h,u-(r-c)],[h,u-(r-c)],[h,c]]}},D.updateCircle=function(){var t=this;t.mainCircle=t.main.selectAll("."+a.circles).selectAll("."+a.circle).data(t.lineOrScatterData.bind(t)),t.mainCircle.enter().append("circle").attr("class",t.classCircle.bind(t)).attr("r",t.pointR.bind(t)).style("fill",t.color),t.mainCircle.style("opacity",t.initialOpacityForCircle.bind(t)),t.mainCircle.exit().remove()},D.redrawCircle=function(t,e,i){var n=this.main.selectAll("."+a.selectedCircle);return[(i?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",t).attr("cy",e),(i?n.transition(Math.random().toString()):n).attr("cx",t).attr("cy",e)]},D.circleX=function(t){return t.x||0===t.x?this.x(t.x):null},D.updateCircleY=function(){var t,e,i=this;i.config.data_groups.length>0?(t=i.getShapeIndices(i.isLineType),e=i.generateGetLinePoints(t),i.circleY=function(t,i){return e(t,i)[0][1]}):i.circleY=function(t){return i.getYScale(t.id)(t.value)}},D.getCircles=function(t,e){var i=this;return(e?i.main.selectAll("."+a.circles+i.getTargetSelectorSuffix(e)):i.main).selectAll("."+a.circle+(u(t)?"-"+t:""))},D.expandCircles=function(t,e,i){var n=this,r=n.pointExpandedR.bind(n);i&&n.unexpandCircles(),n.getCircles(t,e).classed(a.EXPANDED,!0).attr("r",r)},D.unexpandCircles=function(t){var e=this,i=e.pointR.bind(e);e.getCircles(t).filter(function(){return e.d3.select(this).classed(a.EXPANDED)}).classed(a.EXPANDED,!1).attr("r",i)},D.pointR=function(t){var e=this,i=e.config;return e.isStepType(t)?0:d(i.point_r)?i.point_r(t):i.point_r},D.pointExpandedR=function(t){var e=this,i=e.config;return i.point_focus_expand_enabled?d(i.point_focus_expand_r)?i.point_focus_expand_r(t):i.point_focus_expand_r?i.point_focus_expand_r:1.75*e.pointR(t):e.pointR(t)},D.pointSelectR=function(t){var e=this,i=e.config;return d(i.point_select_r)?i.point_select_r(t):i.point_select_r?i.point_select_r:4*e.pointR(t)},D.isWithinCircle=function(t,e){var i=this.d3,n=i.mouse(t),r=i.select(t),o=+r.attr("cx"),a=+r.attr("cy");return Math.sqrt(Math.pow(o-n[0],2)+Math.pow(a-n[1],2))<e},D.isWithinStep=function(t,e){return Math.abs(e-this.d3.mouse(t)[1])<30},D.getCurrentWidth=function(){var t=this,e=t.config;return e.size_width?e.size_width:t.getParentWidth()},D.getCurrentHeight=function(){var t=this,e=t.config,i=e.size_height?e.size_height:t.getParentHeight();return i>0?i:320/(t.hasType("gauge")&&!e.gauge_fullCircle?2:1)},D.getCurrentPaddingTop=function(){var t=this,e=t.config,i=u(e.padding_top)?e.padding_top:0;return t.title&&t.title.node()&&(i+=t.getTitlePadding()),i},D.getCurrentPaddingBottom=function(){var t=this.config;return u(t.padding_bottom)?t.padding_bottom:0},D.getCurrentPaddingLeft=function(t){var e=this,i=e.config;return u(i.padding_left)?i.padding_left:i.axis_rotated?i.axis_x_show?Math.max(v(e.getAxisWidthByAxisId("x",t)),40):1:!i.axis_y_show||i.axis_y_inner?e.axis.getYAxisLabelPosition().isOuter?30:1:v(e.getAxisWidthByAxisId("y",t))},D.getCurrentPaddingRight=function(){var t=this,e=t.config,i=t.isLegendRight?t.getLegendWidth()+20:0;return u(e.padding_right)?e.padding_right+1:e.axis_rotated?10+i:!e.axis_y2_show||e.axis_y2_inner?2+i+(t.axis.getY2AxisLabelPosition().isOuter?20:0):v(t.getAxisWidthByAxisId("y2"))+i},D.getParentRectValue=function(t){for(var e,i=this.selectChart.node();i&&"BODY"!==i.tagName;){try{e=i.getBoundingClientRect()[t]}catch(n){"width"===t&&(e=i.offsetWidth)}if(e)break;i=i.parentNode}return e},D.getParentWidth=function(){return this.getParentRectValue("width")},D.getParentHeight=function(){var t=this.selectChart.style("height");return t.indexOf("px")>0?+t.replace("px",""):0},D.getSvgLeft=function(t){var e=this,i=e.config,n=i.axis_rotated||!i.axis_rotated&&!i.axis_y_inner,r=i.axis_rotated?a.axisX:a.axisY,o=e.main.select("."+r).node(),s=o&&n?o.getBoundingClientRect():{right:0},l=e.selectChart.node().getBoundingClientRect(),c=e.hasArcType(),h=s.right-l.left-(c?0:e.getCurrentPaddingLeft(t));return h>0?h:0},D.getAxisWidthByAxisId=function(t,e){var i=this,n=i.axis.getLabelPositionById(t);return i.axis.getMaxTickWidth(t,e)+(n.isInner?20:40)},D.getHorizontalAxisHeight=function(t){var e=this,i=e.config,n=30;return"x"!==t||i.axis_x_show?"x"===t&&i.axis_x_height?i.axis_x_height:"y"!==t||i.axis_y_show?"y2"!==t||i.axis_y2_show?("x"===t&&!i.axis_rotated&&i.axis_x_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-i.axis_x_tick_rotate)/180)),"y"===t&&i.axis_rotated&&i.axis_y_tick_rotate&&(n=30+e.axis.getMaxTickWidth(t)*Math.cos(Math.PI*(90-i.axis_y_tick_rotate)/180)),n+(e.axis.getLabelPositionById(t).isInner?0:10)+("y2"===t?-10:0)):e.rotated_padding_top:!i.legend_show||e.isLegendRight||e.isLegendInset?1:10:8},D.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},D.initBrush=function(){var t=this,e=t.d3;t.brush=e.svg.brush().on("brush",function(){t.redrawForBrush()}),t.brush.update=function(){return t.context&&t.context.select("."+a.brush).call(this),this},t.brush.scale=function(e){return t.config.axis_rotated?this.y(e):this.x(e)}},D.initSubchart=function(){var t=this,e=t.config,i=t.context=t.svg.append("g").attr("transform",t.getTranslate("context")),n=e.subchart_show?"visible":"hidden";i.style("visibility",n),i.append("g").attr("clip-path",t.clipPathForSubchart).attr("class",a.chart),i.select("."+a.chart).append("g").attr("class",a.chartBars),i.select("."+a.chart).append("g").attr("class",a.chartLines),i.append("g").attr("clip-path",t.clipPath).attr("class",a.brush).call(t.brush),t.axes.subx=i.append("g").attr("class",a.axisX).attr("transform",t.getTranslate("subx")).attr("clip-path",e.axis_rotated?"":t.clipPathForXAxis).style("visibility",e.subchart_axis_x_show?n:"hidden")},D.updateTargetsForSubchart=function(t){var e,i=this,n=i.context,r=i.config,o=i.classChartBar.bind(i),s=i.classBars.bind(i),l=i.classChartLine.bind(i),c=i.classLines.bind(i),h=i.classAreas.bind(i);r.subchart_show&&(n.select("."+a.chartBars).selectAll("."+a.chartBar).data(t).attr("class",o).enter().append("g").style("opacity",0).attr("class",o).append("g").attr("class",s),(e=n.select("."+a.chartLines).selectAll("."+a.chartLine).data(t).attr("class",l).enter().append("g").style("opacity",0).attr("class",l)).append("g").attr("class",c),e.append("g").attr("class",h),n.selectAll("."+a.brush+" rect").attr(r.axis_rotated?"width":"height",r.axis_rotated?i.width2:i.height2))},D.updateBarForSubchart=function(t){var e=this;e.contextBar=e.context.selectAll("."+a.bars).selectAll("."+a.bar).data(e.barData.bind(e)),e.contextBar.enter().append("path").attr("class",e.classBar.bind(e)).style("stroke","none").style("fill",e.color),e.contextBar.style("opacity",e.initialOpacity.bind(e)),e.contextBar.exit().transition().duration(t).style("opacity",0).remove()},D.redrawBarForSubchart=function(t,e,i){(e?this.contextBar.transition(Math.random().toString()).duration(i):this.contextBar).attr("d",t).style("opacity",1)},D.updateLineForSubchart=function(t){var e=this;e.contextLine=e.context.selectAll("."+a.lines).selectAll("."+a.line).data(e.lineData.bind(e)),e.contextLine.enter().append("path").attr("class",e.classLine.bind(e)).style("stroke",e.color),e.contextLine.style("opacity",e.initialOpacity.bind(e)),e.contextLine.exit().transition().duration(t).style("opacity",0).remove()},D.redrawLineForSubchart=function(t,e,i){(e?this.contextLine.transition(Math.random().toString()).duration(i):this.contextLine).attr("d",t).style("opacity",1)},D.updateAreaForSubchart=function(t){var e=this,i=e.d3;e.contextArea=e.context.selectAll("."+a.areas).selectAll("."+a.area).data(e.lineData.bind(e)),e.contextArea.enter().append("path").attr("class",e.classArea.bind(e)).style("fill",e.color).style("opacity",function(){return e.orgAreaOpacity=+i.select(this).style("opacity"),0}),e.contextArea.style("opacity",0),e.contextArea.exit().transition().duration(t).style("opacity",0).remove()},D.redrawAreaForSubchart=function(t,e,i){(e?this.contextArea.transition(Math.random().toString()).duration(i):this.contextArea).attr("d",t).style("fill",this.color).style("opacity",this.orgAreaOpacity)},D.redrawSubchart=function(t,e,i,n,r,o,a){var s,l,c,h=this,u=h.d3,d=h.config;h.context.style("visibility",d.subchart_show?"visible":"hidden"),d.subchart_show&&(u.event&&"zoom"===u.event.type&&h.brush.extent(h.x.orgDomain()).update(),t&&(h.brush.empty()||h.brush.extent(h.x.orgDomain()).update(),s=h.generateDrawArea(r,!0),l=h.generateDrawBar(o,!0),c=h.generateDrawLine(a,!0),h.updateBarForSubchart(i),h.updateLineForSubchart(i),h.updateAreaForSubchart(i),h.redrawBarForSubchart(l,i,i),h.redrawLineForSubchart(c,i,i),h.redrawAreaForSubchart(s,i,i)))},D.redrawForBrush=function(){var t=this,e=t.x;t.redraw({withTransition:!1,withY:t.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),t.config.subchart_onbrush.call(t.api,e.orgDomain())},D.transformContext=function(t,e){var i,n=this;e&&e.axisSubX?i=e.axisSubX:(i=n.context.select("."+a.axisX),t&&(i=i.transition())),n.context.attr("transform",n.getTranslate("context")),i.attr("transform",n.getTranslate("subx"))},D.getDefaultExtent=function(){var t=this,e=t.config,i=d(e.axis_x_extent)?e.axis_x_extent(t.getXDomain(t.data.targets)):e.axis_x_extent;return t.isTimeSeries()&&(i=[t.parseDate(i[0]),t.parseDate(i[1])]),i},D.initText=function(){var t=this;t.main.select("."+a.chart).append("g").attr("class",a.chartTexts),t.mainText=t.d3.selectAll([])},D.updateTargetsForText=function(t){var e=this,i=e.classChartText.bind(e),n=e.classTexts.bind(e),r=e.classFocus.bind(e);e.main.select("."+a.chartTexts).selectAll("."+a.chartText).data(t).attr("class",function(t){return i(t)+r(t)}).enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none").append("g").attr("class",n)},D.updateText=function(t){var e=this,i=e.config,n=e.barOrLineData.bind(e),r=e.classText.bind(e);e.mainText=e.main.selectAll("."+a.texts).selectAll("."+a.text).data(n),e.mainText.enter().append("text").attr("class",r).attr("text-anchor",function(t){return i.axis_rotated?t.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(t){return e.color(t)}).style("fill-opacity",0),e.mainText.text(function(t,i,n){return e.dataLabelFormat(t.id)(t.value,t.id,i,n)}),e.mainText.exit().transition().duration(t).style("fill-opacity",0).remove()},D.redrawText=function(t,e,i,n){return[(n?this.mainText.transition():this.mainText).attr("x",t).attr("y",e).style("fill",this.color).style("fill-opacity",i?0:this.opacityForText.bind(this))]},D.getTextRect=function(t,e,i){var n,r=this.d3.select("body").append("div").classed("c3",!0),o=r.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),a=this.d3.select(i).style("font");return o.selectAll(".dummy").data([t]).enter().append("text").classed(e||"",!0).style("font",a).text(t).each(function(){n=this.getBoundingClientRect()}),r.remove(),n},D.generateXYForText=function(t,e,i,n){var r=this,o=r.generateGetAreaPoints(t,!1),a=r.generateGetBarPoints(e,!1),s=r.generateGetLinePoints(i,!1),l=n?r.getXForText:r.getYForText;return function(t,e){var i=r.isAreaType(t)?o:r.isBarType(t)?a:s;return l.call(r,i(t,e),t,this)}},D.getXForText=function(t,e,i){var n,r,o=this,a=i.getBoundingClientRect();return o.config.axis_rotated?(r=o.isBarType(e)?4:6,n=t[2][1]+r*(e.value<0?-1:1)):n=o.hasType("bar")?(t[2][0]+t[0][0])/2:t[0][0],null===e.value&&(n>o.width?n=o.width-a.width:n<0&&(n=4)),n},D.getYForText=function(t,e,i){var n,r=this,o=i.getBoundingClientRect();return r.config.axis_rotated?n=(t[0][0]+t[2][0]+.6*o.height)/2:(n=t[2][1],e.value<0||0===e.value&&!r.hasPositiveValue?(n+=o.height,r.isBarType(e)&&r.isSafari()?n-=3:!r.isBarType(e)&&r.isChrome()&&(n+=3)):n+=r.isBarType(e)?-3:-6),null!==e.value||r.config.axis_rotated||(n<o.height?n=o.height:n>this.height&&(n=this.height-4)),n},D.initTitle=function(){var t=this;t.title=t.svg.append("text").text(t.config.title_text).attr("class",t.CLASS.title)},D.redrawTitle=function(){var t=this;t.title.attr("x",t.xForTitle.bind(t)).attr("y",t.yForTitle.bind(t))},D.xForTitle=function(){var t=this,e=t.config,i=e.title_position||"left";return i.indexOf("right")>=0?t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width-e.title_padding.right:i.indexOf("center")>=0?(t.currentWidth-t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).width)/2:e.title_padding.left},D.yForTitle=function(){var t=this;return t.config.title_padding.top+t.getTextRect(t.title.node().textContent,t.CLASS.title,t.title.node()).height},D.getTitlePadding=function(){var t=this;return t.yForTitle()+t.config.title_padding.bottom},D.initTooltip=function(){var t,e=this,i=e.config;if(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",a.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),i.tooltip_init_show){if(e.isTimeSeries()&&p(i.tooltip_init_x)){for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),t=0;t<e.data.targets[0].values.length&&e.data.targets[0].values[t].x-i.tooltip_init_x!=0;t++);i.tooltip_init_x=t}e.tooltip.html(i.tooltip_contents.call(e,e.data.targets.map(function(t){return e.addName(t.values[i.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",i.tooltip_init_position.top).style("left",i.tooltip_init_position.left).style("display","block")}},D.getTooltipSortFunction=function(){var t=this,e=t.config;if(0!==e.data_groups.length&&void 0===e.tooltip_order){var i=t.orderTargets(t.data.targets).map(function(t){return t.id});return(t.isOrderAsc()||t.isOrderDesc())&&(i=i.reverse()),function(t,e){return i.indexOf(t.id)-i.indexOf(e.id)}}var n=e.tooltip_order;void 0===n&&(n=e.data_order);var r=function(t){return t?t.value:null};if(p(n)&&"asc"===n.toLowerCase())return function(t,e){return r(t)-r(e)};if(p(n)&&"desc"===n.toLowerCase())return function(t,e){return r(e)-r(t)};if(d(n)){var o=n;return void 0===e.tooltip_order&&(o=function(t,e){return n(t?{id:t.id,values:[t]}:null,e?{id:e.id,values:[e]}:null)}),o}return f(n)?function(t,e){return n.indexOf(t.id)-n.indexOf(e.id)}:void 0},D.getTooltipContent=function(t,e,i,n){var r,o,a,s,l,c,h=this,u=h.config,d=u.tooltip_format_title||e,f=u.tooltip_format_name||function(t){return t},p=u.tooltip_format_value||i,g=this.getTooltipSortFunction();for(g&&t.sort(g),o=0;o<t.length;o++)if(t[o]&&(t[o].value||0===t[o].value)&&(r||(a=C(d?d(t[o].x):t[o].x),r="<table class='"+h.CLASS.tooltip+"'>"+(a||0===a?"<tr><th colspan='2'>"+a+"</th></tr>":"")),void 0!==(s=C(p(t[o].value,t[o].ratio,t[o].id,t[o].index,t))))){if(null===t[o].name)continue;l=C(f(t[o].name,t[o].ratio,t[o].id,t[o].index)),c=h.levelColor?h.levelColor(t[o].value):n(t[o].id),r+="<tr class='"+h.CLASS.tooltipName+"-"+h.getTargetSelectorSuffix(t[o].id)+"'>",r+="<td class='name'><span style='background-color:"+c+"'></span>"+l+"</td>",r+="<td class='value'>"+s+"</td>",r+="</tr>"}return r+"</table>"},D.tooltipPosition=function(t,e,i,n){var r,o,a,s,l,c=this,h=c.config,u=c.d3,d=c.hasArcType(),f=u.mouse(n);return d?(o=(c.width-(c.isLegendRight?c.getLegendWidth():0))/2+f[0],s=c.height/2+f[1]+20):(r=c.getSvgLeft(!0),h.axis_rotated?(a=(o=r+f[0]+100)+e,l=c.currentWidth-c.getCurrentPaddingRight(),s=c.x(t[0].x)+20):(a=(o=r+c.getCurrentPaddingLeft(!0)+c.x(t[0].x)+20)+e,l=r+c.currentWidth-c.getCurrentPaddingRight(),s=f[1]+15),a>l&&(o-=a-l+20),s+i>c.currentHeight&&(s-=i+30)),s<0&&(s=0),{top:s,left:o}},D.showTooltip=function(t,e){var i,n,r,o=this,a=o.config,s=o.hasArcType(),l=t.filter(function(t){return t&&u(t.value)}),c=a.tooltip_position||D.tooltipPosition;0!==l.length&&a.tooltip_show&&(o.tooltip.html(a.tooltip_contents.call(o,t,o.axis.getXAxisTickFormat(),o.getYFormat(s),o.color)).style("display","block"),i=o.tooltip.property("offsetWidth"),n=o.tooltip.property("offsetHeight"),r=c.call(this,l,i,n,e),o.tooltip.style("top",r.top+"px").style("left",r.left+"px"))},D.hideTooltip=function(){this.tooltip.style("display","none")},D.setTargetType=function(t,e){var i=this,n=i.config;i.mapToTargetIds(t).forEach(function(t){i.withoutFadeIn[t]=e===n.data_types[t],n.data_types[t]=e}),t||(n.data_type=e)},D.hasType=function(t,e){var i=this,n=i.config.data_types,r=!1;return(e=e||i.data.targets)&&e.length?e.forEach(function(e){var i=n[e.id];(i&&i.indexOf(t)>=0||!i&&"line"===t)&&(r=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(e){n[e]===t&&(r=!0)}):r=i.config.data_type===t,r},D.hasArcType=function(t){return this.hasType("pie",t)||this.hasType("donut",t)||this.hasType("gauge",t)},D.isLineType=function(t){var e=this.config,i=p(t)?t:t.id;return!e.data_types[i]||["line","spline","area","area-spline","step","area-step"].indexOf(e.data_types[i])>=0},D.isStepType=function(t){var e=p(t)?t:t.id;return["step","area-step"].indexOf(this.config.data_types[e])>=0},D.isSplineType=function(t){var e=p(t)?t:t.id;return["spline","area-spline"].indexOf(this.config.data_types[e])>=0},D.isAreaType=function(t){var e=p(t)?t:t.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[e])>=0},D.isBarType=function(t){var e=p(t)?t:t.id;return"bar"===this.config.data_types[e]},D.isScatterType=function(t){var e=p(t)?t:t.id;return"scatter"===this.config.data_types[e]},D.isPieType=function(t){var e=p(t)?t:t.id;return"pie"===this.config.data_types[e]},D.isGaugeType=function(t){var e=p(t)?t:t.id;return"gauge"===this.config.data_types[e]},D.isDonutType=function(t){var e=p(t)?t:t.id;return"donut"===this.config.data_types[e]},D.isArcType=function(t){return this.isPieType(t)||this.isDonutType(t)||this.isGaugeType(t)},D.lineData=function(t){return this.isLineType(t)?[t]:[]},D.arcData=function(t){return this.isArcType(t.data)?[t]:[]},D.barData=function(t){return this.isBarType(t)?t.values:[]},D.lineOrScatterData=function(t){return this.isLineType(t)||this.isScatterType(t)?t.values:[]},D.barOrLineData=function(t){return this.isBarType(t)||this.isLineType(t)?t.values:[]},D.isInterpolationType=function(t){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(t)>=0},D.isSafari=function(){var t=window.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},D.isChrome=function(){return window.navigator.userAgent.indexOf("Chrome")>=0},D.initZoom=function(){var t,e=this,i=e.d3,n=e.config;e.zoom=i.behavior.zoom().on("zoomstart",function(){t=i.event.sourceEvent,e.zoom.altDomain=i.event.sourceEvent.altKey?e.x.orgDomain():null,n.zoom_onzoomstart.call(e.api,i.event.sourceEvent)}).on("zoom",function(){e.redrawForZoom.call(e)}).on("zoomend",function(){var r=i.event.sourceEvent;r&&t.clientX===r.clientX&&t.clientY===r.clientY||(e.redrawEventRect(),e.updateZoom(),n.zoom_onzoomend.call(e.api,e.x.orgDomain()))}),e.zoom.scale=function(t){return n.axis_rotated?this.y(t):this.x(t)},e.zoom.orgScaleExtent=function(){var t=n.zoom_extent?n.zoom_extent:[1,10];return[t[0],Math.max(e.getMaxDataCount()/t[1],t[1])]},e.zoom.updateScaleExtent=function(){var t=b(e.x.orgDomain())/b(e.getZoomDomain()),i=this.orgScaleExtent();return this.scaleExtent([i[0]*t,i[1]*t]),this}},D.getZoomDomain=function(){var t=this,e=t.config,i=t.d3;return[i.min([t.orgXDomain[0],e.zoom_x_min]),i.max([t.orgXDomain[1],e.zoom_x_max])]},D.updateZoom=function(){var t=this,e=t.config.zoom_enabled?t.zoom:function(){};t.main.select("."+a.zoomRect).call(e).on("dblclick.zoom",null),t.main.selectAll("."+a.eventRect).call(e).on("dblclick.zoom",null)},D.redrawForZoom=function(){var t=this,e=t.d3,i=t.config,n=t.zoom,r=t.x;if(i.zoom_enabled&&0!==t.filterTargetsToShow(t.data.targets).length){if("mousemove"===e.event.sourceEvent.type&&n.altDomain)return r.domain(n.altDomain),void n.scale(r).updateScaleExtent();t.isCategorized()&&r.orgDomain()[0]===t.orgXDomain[0]&&r.domain([t.orgXDomain[0]-1e-10,r.orgDomain()[1]]),t.redraw({withTransition:!1,withY:i.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===e.event.sourceEvent.type&&(t.cancelClick=!0),i.zoom_onzoom.call(t.api,r.orgDomain())}},M}),function(t,e,i){!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):jQuery&&!jQuery.fn.sparkline&&t(jQuery)}(function(i){"use strict";var n,r,o,a,s,l,c,h,u,d,f,p,g,m,v,y,b,x,_,w,S,C,k,T,A,D,M,E,P,L,I={},O=0;n=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:void 0,normalRangeMax:void 0,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:void 0,chartRangeMax:void 0,chartRangeMinX:void 0,chartRangeMaxX:void 0,tooltipFormat:new o('<span style="color: {{color}}">●</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:void 0,nullColor:void 0,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1,colorMap:void 0,tooltipFormat:new o('<span style="color: {{color}}">●</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new o('<span style="color: {{color}}">●</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:void 0,thresholdValue:0,chartRangeMax:void 0,chartRangeMin:void 0,chartRangeClip:!1,tooltipFormat:new o("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:void 0,tooltipFormat:new o("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new o('<span style="color: {{color}}">●</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:void 0,targetColor:"#4a2",chartRangeMax:void 0,chartRangeMin:void 0,tooltipFormat:new o("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},A='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;box-sizing: content-box;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',r=function(){var t,e;return t=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(t.prototype=i.extend(new arguments[0],arguments[arguments.length-1]),t._super=arguments[0].prototype):t.prototype=arguments[arguments.length-1],arguments.length>2&&((e=Array.prototype.slice.call(arguments,1,-1)).unshift(t.prototype),i.extend.apply(i,e))):t.prototype=arguments[0],t.prototype.cls=t,t},i.SPFormatClass=o=r({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(t,e){this.format=t,this.fclass=e},render:function(t,e,i){var n,r,o,a,s,l=this,c=t;return this.format.replace(this.fre,function(){return r=arguments[1],o=arguments[3],(n=l.precre.exec(r))?(s=n[2],r=n[1]):s=!1,void 0===(a=c[r])?"":o&&e&&e[o]?e[o].get?e[o].get(a)||a:e[o][a]||a:(u(a)&&(a=i.get("numberFormatter")?i.get("numberFormatter")(a):g(a,s,i.get("numberDigitGroupCount"),i.get("numberDigitGroupSep"),i.get("numberDecimalMark"))),a)})}}),i.spformat=function(t,e){return new o(t,e)},a=function(t,e,i){return t<e?e:t>i?i:t},s=function(t,i){var n;return 2===i?(n=e.floor(t.length/2),t.length%2?t[n]:(t[n-1]+t[n])/2):t.length%2?(n=(t.length*i+i)/4)%1?(t[e.floor(n)]+t[e.floor(n)-1])/2:t[n-1]:(n=(t.length*i+2)/4)%1?(t[e.floor(n)]+t[e.floor(n)-1])/2:t[n-1]},l=function(t){var e;switch(t){case"undefined":t=void 0;break;case"null":t=null;break;case"true":t=!0;break;case"false":t=!1;break;default:t==(e=parseFloat(t))&&(t=e)}return t},c=function(t){var e,i=[];for(e=t.length;e--;)i[e]=l(t[e]);return i},h=function(t,e){var i,n,r=[];for(i=0,n=t.length;i<n;i++)t[i]!==e&&r.push(t[i]);return r},u=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=function(t,e,n,r,o){var a,s;for(t=(!1===e?parseFloat(t).toString():t.toFixed(e)).split(""),(a=(a=i.inArray(".",t))<0?t.length:a)<t.length&&(t[a]=o),s=a-n;s>0;s-=n)t.splice(s,0,r);return t.join("")},d=function(t,e,i){var n;for(n=e.length;n--;)if((!i||null!==e[n])&&e[n]!==t)return!1;return!0},p=function(t){return i.isArray(t)?t:[t]},f=function(e){var i,n;if(t.createStyleSheet)try{return void(t.createStyleSheet().cssText=e)}catch(t){n=!0}(i=t.createElement("style")).type="text/css",t.getElementsByTagName("head")[0].appendChild(i),n?t.styleSheets[t.styleSheets.length-1].cssText=e:i["string"==typeof t.body.style.WebkitAppearance?"innerText":"innerHTML"]=e},i.fn.simpledraw=function(e,n,r,o){var a,s;if(r&&(a=this.data("_jqs_vcanvas")))return a;if(!1===i.fn.sparkline.canvas)return!1;if(void 0===i.fn.sparkline.canvas){var l=t.createElement("canvas");if(l.getContext&&l.getContext("2d"))i.fn.sparkline.canvas=function(t,e,i,n){return new E(t,e,i,n)};else{if(!t.namespaces||t.namespaces.v)return i.fn.sparkline.canvas=!1,!1;t.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),i.fn.sparkline.canvas=function(t,e,i,n){return new P(t,e,i)}}}return void 0===e&&(e=i(this).innerWidth()),void 0===n&&(n=i(this).innerHeight()),a=i.fn.sparkline.canvas(e,n,this,o),(s=i(this).data("_jqs_mhandler"))&&s.registerCanvas(a),a},i.fn.cleardraw=function(){var t=this.data("_jqs_vcanvas");t&&t.reset()},i.RangeMapClass=m=r({init:function(t){var e,i,n=[];for(e in t)t.hasOwnProperty(e)&&"string"==typeof e&&e.indexOf(":")>-1&&((i=e.split(":"))[0]=0===i[0].length?-1/0:parseFloat(i[0]),i[1]=0===i[1].length?1/0:parseFloat(i[1]),i[2]=t[e],n.push(i));this.map=t,this.rangelist=n||!1},get:function(t){var e,i,n,r=this.rangelist;if(void 0!==(n=this.map[t]))return n;if(r)for(e=r.length;e--;)if((i=r[e])[0]<=t&&i[1]>=t)return i[2]}}),i.range_map=function(t){return new m(t)},v=r({init:function(t,e){var n=i(t);this.$el=n,this.options=e,this.currentPageX=0,this.currentPageY=0,this.el=t,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!e.get("disableTooltips"),this.highlightEnabled=!e.get("disableHighlight")},registerSparkline:function(t){this.splist.push(t),this.over&&this.updateDisplay()},registerCanvas:function(t){var e=i(t.canvas);this.canvas=t,this.$canvas=e,e.mouseenter(i.proxy(this.mouseenter,this)),e.mouseleave(i.proxy(this.mouseleave,this)),e.click(i.proxy(this.mouseclick,this))},reset:function(t){this.splist=[],this.tooltip&&t&&(this.tooltip.remove(),this.tooltip=void 0)},mouseclick:function(t){var e=i.Event("sparklineClick");e.originalEvent=t,e.sparklines=this.splist,this.$el.trigger(e)},mouseenter:function(e){i(t.body).unbind("mousemove.jqs"),i(t.body).bind("mousemove.jqs",i.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=e.pageX,this.currentPageY=e.pageY,this.currentEl=e.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new y(this.options),this.tooltip.updatePosition(e.pageX,e.pageY)),this.updateDisplay()},mouseleave:function(){i(t.body).unbind("mousemove.jqs");var e,n=this.splist,r=n.length,o=!1;for(this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null),e=0;e<r;e++)n[e].clearRegionHighlight()&&(o=!0);o&&this.canvas.render()},mousemove:function(t){this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,this.tooltip&&this.tooltip.updatePosition(t.pageX,t.pageY),this.updateDisplay()},updateDisplay:function(){var t,e,n,r,o=this.splist,a=o.length,s=!1,l=this.$canvas.offset(),c=this.currentPageX-l.left,h=this.currentPageY-l.top;if(this.over){for(e=0;e<a;e++)(n=o[e].setRegionHighlight(this.currentEl,c,h))&&(s=!0);if(s){if(r=i.Event("sparklineRegionChange"),r.sparklines=this.splist,this.$el.trigger(r),this.tooltip){for(t="",e=0;e<a;e++)t+=o[e].getCurrentRegionTooltip();this.tooltip.setContent(t)}this.disableHighlight||this.canvas.render()}null===n&&this.mouseleave()}}}),y=r({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(e){var n,r=e.get("tooltipClassname","jqstooltip"),o=this.sizeStyle;this.container=e.get("tooltipContainer")||t.body,this.tooltipOffsetX=e.get("tooltipOffsetX",10),this.tooltipOffsetY=e.get("tooltipOffsetY",12),i("#jqssizetip").remove(),i("#jqstooltip").remove(),this.sizetip=i("<div/>",{id:"jqssizetip",style:o,class:r}),this.tooltip=i("<div/>",{id:"jqstooltip",class:r}).appendTo(this.container),n=this.tooltip.offset(),this.offsetLeft=n.left,this.offsetTop=n.top,this.hidden=!0,i(window).unbind("resize.jqs scroll.jqs"),i(window).bind("resize.jqs scroll.jqs",i.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=i(window).scrollTop(),this.scrollLeft=i(window).scrollLeft(),this.scrollRight=this.scrollLeft+i(window).width(),this.updatePosition()},getSize:function(t){this.sizetip.html(t).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(t){if(!t)return this.tooltip.css("visibility","hidden"),void(this.hidden=!0);this.getSize(t),this.tooltip.html(t).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition())},updatePosition:function(t,e){if(void 0===t){if(void 0===this.mousex)return;t=this.mousex-this.offsetLeft,e=this.mousey-this.offsetTop}else this.mousex=t-=this.offsetLeft,this.mousey=e-=this.offsetTop;this.height&&this.width&&!this.hidden&&(e-=this.height+this.tooltipOffsetY,t+=this.tooltipOffsetX,e<this.scrollTop&&(e=this.scrollTop),t<this.scrollLeft?t=this.scrollLeft:t+this.width>this.scrollRight&&(t=this.scrollRight-this.width),this.tooltip.css({left:t,top:e}))},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=void 0,i(window).unbind("resize.jqs scroll.jqs")}}),i(function(){f(A)}),L=[],i.fn.sparkline=function(e,n){return this.each(function(){var r,o,a=new i.fn.sparkline.options(this,n),s=i(this);if(r=function(){var n,r,o,l,c,h,u;"html"===e||void 0===e?(void 0!==(u=this.getAttribute(a.get("tagValuesAttribute")))&&null!==u||(u=s.html()),n=u.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")):n=e,r="auto"===a.get("width")?n.length*a.get("defaultPixelsPerValue"):a.get("width"),"auto"===a.get("height")?a.get("composite")&&i.data(this,"_jqs_vcanvas")||((l=t.createElement("span")).innerHTML="a",s.html(l),o=i(l).innerHeight()||i(l).height(),i(l).remove(),l=null):o=a.get("height"),a.get("disableInteraction")?c=!1:(c=i.data(this,"_jqs_mhandler"))?a.get("composite")||c.reset():(c=new v(this,a),i.data(this,"_jqs_mhandler",c)),!a.get("composite")||i.data(this,"_jqs_vcanvas")?((h=new(i.fn.sparkline[a.get("type")])(this,n,a,r,o)).render(),c&&c.registerSparkline(h)):i.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),i.data(this,"_jqs_errnotify",!0))},i(this).html()&&!a.get("disableHiddenCheck")&&i(this).is(":hidden")||!i(this).parents("body").length){if(!a.get("composite")&&i.data(this,"_jqs_pending"))for(o=L.length;o;o--)L[o-1][0]==this&&L.splice(o-1,1);L.push([this,r]),i.data(this,"_jqs_pending",!0)}else r.call(this)})},i.fn.sparkline.defaults=n(),i.sparkline_display_visible=function(){var t,e,n,r=[];for(e=0,n=L.length;e<n;e++)t=L[e][0],i(t).is(":visible")&&!i(t).parents().is(":hidden")?(L[e][1].call(t),i.data(L[e][0],"_jqs_pending",!1),r.push(e)):i(t).closest("html").length||i.data(t,"_jqs_pending")||(i.data(L[e][0],"_jqs_pending",!1),r.push(e));for(e=r.length;e;e--)L.splice(r[e-1],1)},i.fn.sparkline.options=r({init:function(t,e){var n,r,o,a;this.userOptions=e=e||{},this.tag=t,this.tagValCache={},o=(r=i.fn.sparkline.defaults).common,this.tagOptionsPrefix=e.enableTagOptions&&(e.tagOptionsPrefix||o.tagOptionsPrefix),n=(a=this.getTagSetting("type"))===I?r[e.type||o.type]:r[a],this.mergedOptions=i.extend({},o,n,e)},getTagSetting:function(t){var e,i,n,r,o=this.tagOptionsPrefix;if(!1===o||void 0===o)return I;if(this.tagValCache.hasOwnProperty(t))e=this.tagValCache.key;else{if(void 0===(e=this.tag.getAttribute(o+t))||null===e)e=I;else if("["===e.substr(0,1))for(i=(e=e.substr(1,e.length-2).split(",")).length;i--;)e[i]=l(e[i].replace(/(^\s*)|(\s*$)/g,""));else if("{"===e.substr(0,1))for(n=e.substr(1,e.length-2).split(","),e={},i=n.length;i--;)e[(r=n[i].split(":",2))[0].replace(/(^\s*)|(\s*$)/g,"")]=l(r[1].replace(/(^\s*)|(\s*$)/g,""));else e=l(e);this.tagValCache.key=e}return e},get:function(t,e){var i,n=this.getTagSetting(t);return n!==I?n:void 0===(i=this.mergedOptions[t])?e:i}}),i.fn.sparkline._base=r({disabled:!1,init:function(t,e,n,r,o){this.el=t,this.$el=i(t),this.values=e,this.options=n,this.width=r,this.height=o,this.currentRegion=void 0},initTarget:function(){var t=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),t))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return!this.disabled||(this.el.innerHTML="",!1)},getRegion:function(t,e){},setRegionHighlight:function(t,e,i){var n,r=this.currentRegion,o=!this.options.get("disableHighlight");return e>this.canvasWidth||i>this.canvasHeight||e<0||i<0?null:(n=this.getRegion(t,e,i),r!==n&&(void 0!==r&&o&&this.removeHighlight(),this.currentRegion=n,void 0!==n&&o&&this.renderHighlight(),!0))},clearRegionHighlight:function(){return void 0!==this.currentRegion&&(this.removeHighlight(),this.currentRegion=void 0,!0)},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(t){},getCurrentRegionTooltip:function(){var t,e,n,r,a,s,l,c,h,u,d,f,p,g,m=this.options,v="",y=[];if(void 0===this.currentRegion)return"";if(t=this.getCurrentRegionFields(),d=m.get("tooltipFormatter"))return d(this,m,t);if(m.get("tooltipChartTitle")&&(v+='<div class="jqs jqstitle">'+m.get("tooltipChartTitle")+"</div>\n"),!(e=this.options.get("tooltipFormat")))return"";if(i.isArray(e)||(e=[e]),i.isArray(t)||(t=[t]),l=this.options.get("tooltipFormatFieldlist"),c=this.options.get("tooltipFormatFieldlistKey"),l&&c){for(h=[],s=t.length;s--;)u=t[s][c],-1!=(g=i.inArray(u,l))&&(h[g]=t[s]);t=h}for(n=e.length,p=t.length,s=0;s<n;s++)for("string"==typeof(f=e[s])&&(f=new o(f)),r=f.fclass||"jqsfield",g=0;g<p;g++)t[g].isNull&&m.get("tooltipSkipNull")||(i.extend(t[g],{prefix:m.get("tooltipPrefix"),suffix:m.get("tooltipSuffix")}),a=f.render(t[g],m.get("tooltipValueLookups"),m),y.push('<div class="'+r+'">'+a+"</div>"));return y.length?v+y.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(t,i){var n,r,o,s,l=i.get("highlightColor"),c=i.get("highlightLighten");if(l)return l;if(c&&(n=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(t))){for(o=[],r=4===t.length?16:1,s=0;s<3;s++)o[s]=a(e.round(parseInt(n[s+1],16)*r*c),0,255);return"rgb("+o.join(",")+")"}return t}}),b={changeHighlight:function(t){var e,n=this.currentRegion,r=this.target,o=this.regionShapes[n];o&&(e=this.renderRegion(n,t),i.isArray(e)||i.isArray(o)?(r.replaceWithShapes(o,e),this.regionShapes[n]=i.map(e,function(t){return t.id})):(r.replaceWithShape(o,e),this.regionShapes[n]=e.id))},render:function(){var t,e,n,r,o=this.values,a=this.target,s=this.regionShapes;if(this.cls._super.render.call(this)){for(n=o.length;n--;)if(t=this.renderRegion(n))if(i.isArray(t)){for(e=[],r=t.length;r--;)t[r].append(),e.push(t[r].id);s[n]=e}else t.append(),s[n]=t.id;else s[n]=null;a.render()}}},i.fn.sparkline.line=x=r(i.fn.sparkline._base,{type:"line",init:function(t,e,i,n,r){x._super.init.call(this,t,e,i,n,r),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(t,e,i){var n,r=this.regionMap;for(n=r.length;n--;)if(null!==r[n]&&e>=r[n][0]&&e<=r[n][1])return r[n][2]},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:null===this.yvalues[t],x:this.xvalues[t],y:this.yvalues[t],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:t}},renderHighlight:function(){var t,e,i=this.currentRegion,n=this.target,r=this.vertices[i],o=this.options,a=o.get("spotRadius"),s=o.get("highlightSpotColor"),l=o.get("highlightLineColor");r&&(a&&s&&(t=n.drawCircle(r[0],r[1],a,void 0,s),this.highlightSpotId=t.id,n.insertAfterShape(this.lastShapeId,t)),l&&(e=n.drawLine(r[0],this.canvasTop,r[0],this.canvasTop+this.canvasHeight,l),this.highlightLineId=e.id,n.insertAfterShape(this.lastShapeId,e)))},removeHighlight:function(){var t=this.target;this.highlightSpotId&&(t.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(t.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var t,i,n,r,o,a=this.values,s=a.length,l=this.xvalues,c=this.yvalues,h=this.yminmax;for(t=0;t<s;t++)i=a[t],n="string"==typeof a[t],r="object"==typeof a[t]&&a[t]instanceof Array,o=n&&a[t].split(":"),n&&2===o.length?(l.push(Number(o[0])),c.push(Number(o[1])),h.push(Number(o[1]))):r?(l.push(i[0]),c.push(i[1]),h.push(i[1])):(l.push(t),null===a[t]||"null"===a[t]?c.push(null):(c.push(Number(i)),h.push(Number(i))));this.options.get("xvalues")&&(l=this.options.get("xvalues")),this.maxy=this.maxyorg=e.max.apply(e,h),this.miny=this.minyorg=e.min.apply(e,h),this.maxx=e.max.apply(e,l),this.minx=e.min.apply(e,l),this.xvalues=l,this.yvalues=c,this.yminmax=h},processRangeOptions:function(){var t=this.options,e=t.get("normalRangeMin"),i=t.get("normalRangeMax");void 0!==e&&(e<this.miny&&(this.miny=e),i>this.maxy&&(this.maxy=i)),void 0!==t.get("chartRangeMin")&&(t.get("chartRangeClip")||t.get("chartRangeMin")<this.miny)&&(this.miny=t.get("chartRangeMin")),void 0!==t.get("chartRangeMax")&&(t.get("chartRangeClip")||t.get("chartRangeMax")>this.maxy)&&(this.maxy=t.get("chartRangeMax")),void 0!==t.get("chartRangeMinX")&&(t.get("chartRangeClipX")||t.get("chartRangeMinX")<this.minx)&&(this.minx=t.get("chartRangeMinX")),void 0!==t.get("chartRangeMaxX")&&(t.get("chartRangeClipX")||t.get("chartRangeMaxX")>this.maxx)&&(this.maxx=t.get("chartRangeMaxX"))},drawNormalRange:function(t,i,n,r,o){var a=this.options.get("normalRangeMin"),s=this.options.get("normalRangeMax"),l=i+e.round(n-n*((s-this.miny)/o)),c=e.round(n*(s-a)/o);this.target.drawRect(t,l,r,c,void 0,this.options.get("normalRangeColor")).append()},render:function(){var t,n,r,o,a,s,l,c,h,u,d,f,p,g,v,y,b,_,w,S,C,k,T,A,D=this.options,M=this.target,E=this.canvasWidth,P=this.canvasHeight,L=this.vertices,I=D.get("spotRadius"),O=this.regionMap;if(x._super.render.call(this)&&(this.scanValues(),this.processRangeOptions(),k=this.xvalues,T=this.yvalues,this.yminmax.length&&!(this.yvalues.length<2))){for(o=a=0,t=this.maxx-this.minx==0?1:this.maxx-this.minx,n=this.maxy-this.miny==0?1:this.maxy-this.miny,r=this.yvalues.length-1,I&&(E<4*I||P<4*I)&&(I=0),I&&(((S=D.get("highlightSpotColor")&&!D.get("disableInteraction"))||D.get("minSpotColor")||D.get("spotColor")&&T[r]===this.miny)&&(P-=e.ceil(I)),(S||D.get("maxSpotColor")||D.get("spotColor")&&T[r]===this.maxy)&&(P-=e.ceil(I),o+=e.ceil(I)),(S||(D.get("minSpotColor")||D.get("maxSpotColor"))&&(T[0]===this.miny||T[0]===this.maxy))&&(a+=e.ceil(I),E-=e.ceil(I)),(S||D.get("spotColor")||D.get("minSpotColor")||D.get("maxSpotColor")&&(T[r]===this.miny||T[r]===this.maxy))&&(E-=e.ceil(I))),P--,void 0===D.get("normalRangeMin")||D.get("drawNormalOnTop")||this.drawNormalRange(a,o,P,E,n),c=[l=[]],p=g=null,v=T.length,A=0;A<v;A++)h=k[A],d=k[A+1],u=T[A],g=(f=a+e.round((h-this.minx)*(E/t)))+((A<v-1?a+e.round((d-this.minx)*(E/t)):E)-f)/2,O[A]=[p||0,g,A],p=g,null===u?A&&(null!==T[A-1]&&(l=[],c.push(l)),L.push(null)):(u<this.miny&&(u=this.miny),u>this.maxy&&(u=this.maxy),l.length||l.push([f,o+P]),s=[f,o+e.round(P-P*((u-this.miny)/n))],l.push(s),L.push(s));for(y=[],b=[],_=c.length,A=0;A<_;A++)(l=c[A]).length&&(D.get("fillColor")&&(l.push([l[l.length-1][0],o+P]),b.push(l.slice(0)),l.pop()),l.length>2&&(l[0]=[l[0][0],l[1][1]]),y.push(l));for(_=b.length,A=0;A<_;A++)M.drawShape(b[A],D.get("fillColor"),D.get("fillColor")).append();for(void 0!==D.get("normalRangeMin")&&D.get("drawNormalOnTop")&&this.drawNormalRange(a,o,P,E,n),_=y.length,A=0;A<_;A++)M.drawShape(y[A],D.get("lineColor"),void 0,D.get("lineWidth")).append();if(I&&D.get("valueSpots"))for(void 0===(w=D.get("valueSpots")).get&&(w=new m(w)),A=0;A<v;A++)(C=w.get(T[A]))&&M.drawCircle(a+e.round((k[A]-this.minx)*(E/t)),o+e.round(P-P*((T[A]-this.miny)/n)),I,void 0,C).append();I&&D.get("spotColor")&&null!==T[r]&&M.drawCircle(a+e.round((k[k.length-1]-this.minx)*(E/t)),o+e.round(P-P*((T[r]-this.miny)/n)),I,void 0,D.get("spotColor")).append(),this.maxy!==this.minyorg&&(I&&D.get("minSpotColor")&&(h=k[i.inArray(this.minyorg,T)],M.drawCircle(a+e.round((h-this.minx)*(E/t)),o+e.round(P-P*((this.minyorg-this.miny)/n)),I,void 0,D.get("minSpotColor")).append()),I&&D.get("maxSpotColor")&&(h=k[i.inArray(this.maxyorg,T)],M.drawCircle(a+e.round((h-this.minx)*(E/t)),o+e.round(P-P*((this.maxyorg-this.miny)/n)),I,void 0,D.get("maxSpotColor")).append())),this.lastShapeId=M.getLastShapeId(),this.canvasTop=o,M.render()}}}),i.fn.sparkline.bar=_=r(i.fn.sparkline._base,b,{type:"bar",init:function(t,n,r,o,s){var u,d,f,p,g,v,y,b,x,w,S,C,k,T,A,D,M,E,P,L,I,O=parseInt(r.get("barWidth"),10),R=parseInt(r.get("barSpacing"),10),N=r.get("chartRangeMin"),F=r.get("chartRangeMax"),z=r.get("chartRangeClip"),H=1/0,$=-1/0;for(_._super.init.call(this,t,n,r,o,s),v=0,y=n.length;v<y;v++)((u="string"==typeof(L=n[v])&&L.indexOf(":")>-1)||i.isArray(L))&&(A=!0,u&&(L=n[v]=c(L.split(":"))),L=h(L,null),d=e.min.apply(e,L),f=e.max.apply(e,L),d<H&&(H=d),f>$&&($=f));this.stacked=A,this.regionShapes={},this.barWidth=O,this.barSpacing=R,this.totalBarWidth=O+R,this.width=o=n.length*O+(n.length-1)*R,this.initTarget(),z&&(k=void 0===N?-1/0:N,T=void 0===F?1/0:F),g=[],p=A?[]:g;var V=[],B=[];for(v=0,y=n.length;v<y;v++)if(A)for(D=n[v],n[v]=P=[],V[v]=0,p[v]=B[v]=0,M=0,E=D.length;M<E;M++)null!==(L=P[M]=z?a(D[M],k,T):D[M])&&(L>0&&(V[v]+=L),H<0&&$>0?L<0?B[v]+=e.abs(L):p[v]+=L:p[v]+=e.abs(L-(L<0?$:H)),g.push(L));else L=z?a(n[v],k,T):n[v],null!==(L=n[v]=l(L))&&g.push(L);this.max=C=e.max.apply(e,g),this.min=S=e.min.apply(e,g),this.stackMax=$=A?e.max.apply(e,V):C,this.stackMin=H=A?e.min.apply(e,g):S,void 0!==r.get("chartRangeMin")&&(r.get("chartRangeClip")||r.get("chartRangeMin")<S)&&(S=r.get("chartRangeMin")),void 0!==r.get("chartRangeMax")&&(r.get("chartRangeClip")||r.get("chartRangeMax")>C)&&(C=r.get("chartRangeMax")),this.zeroAxis=x=r.get("zeroAxis",!0),w=S<=0&&C>=0&&x?0:0==x?S:S>0?S:C,this.xaxisOffset=w,b=A?e.max.apply(e,p)+e.max.apply(e,B):C-S,this.canvasHeightEf=x&&S<0?this.canvasHeight-2:this.canvasHeight-1,S<w?(I=((A&&C>=0?$:C)-w)/b*this.canvasHeight)!==e.ceil(I)&&(this.canvasHeightEf-=2,I=e.ceil(I)):I=this.canvasHeight,this.yoffset=I,i.isArray(r.get("colorMap"))?(this.colorMapByIndex=r.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=r.get("colorMap"),this.colorMapByValue&&void 0===this.colorMapByValue.get&&(this.colorMapByValue=new m(this.colorMapByValue))),this.range=b},getRegion:function(t,i,n){var r=e.floor(i/this.totalBarWidth);return r<0||r>=this.values.length?void 0:r},getCurrentRegionFields:function(){var t,e,i=this.currentRegion,n=p(this.values[i]),r=[];for(e=n.length;e--;)t=n[e],r.push({isNull:null===t,value:t,color:this.calcColor(e,t,i),offset:i});return r},calcColor:function(t,e,n){var r,o,a=this.colorMapByIndex,s=this.colorMapByValue,l=this.options;return r=this.stacked?l.get("stackedBarColor"):e<0?l.get("negBarColor"):l.get("barColor"),0===e&&void 0!==l.get("zeroColor")&&(r=l.get("zeroColor")),s&&(o=s.get(e))?r=o:a&&a.length>n&&(r=a[n]),i.isArray(r)?r[t%r.length]:r},renderRegion:function(t,n){var r,o,a,s,l,c,h,u,f,p,g=this.values[t],m=this.options,v=this.xaxisOffset,y=[],b=this.range,x=this.stacked,_=this.target,w=t*this.totalBarWidth,S=this.canvasHeightEf,C=this.yoffset;if(g=i.isArray(g)?g:[g],h=g.length,u=g[0],s=d(null,g),p=d(v,g,!0),s)return m.get("nullColor")?(a=n?m.get("nullColor"):this.calcHighlightColor(m.get("nullColor"),m),r=C>0?C-1:C,_.drawRect(w,r,this.barWidth-1,0,a,a)):void 0;for(l=C,c=0;c<h;c++){if(u=g[c],x&&u===v){if(!p||f)continue;f=!0}o=b>0?e.floor(S*(e.abs(u-v)/b))+1:1,u<v||u===v&&0===C?(r=l,l+=o):(r=C-o,C-=o),a=this.calcColor(c,u,t),n&&(a=this.calcHighlightColor(a,m)),y.push(_.drawRect(w,r,this.barWidth-1,o-1,a,a))}return 1===y.length?y[0]:y}}),i.fn.sparkline.tristate=w=r(i.fn.sparkline._base,b,{type:"tristate",init:function(t,e,n,r,o){var a=parseInt(n.get("barWidth"),10),s=parseInt(n.get("barSpacing"),10);w._super.init.call(this,t,e,n,r,o),this.regionShapes={},this.barWidth=a,this.barSpacing=s,this.totalBarWidth=a+s,this.values=i.map(e,Number),this.width=r=e.length*a+(e.length-1)*s,i.isArray(n.get("colorMap"))?(this.colorMapByIndex=n.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=n.get("colorMap"),this.colorMapByValue&&void 0===this.colorMapByValue.get&&(this.colorMapByValue=new m(this.colorMapByValue))),this.initTarget()},getRegion:function(t,i,n){return e.floor(i/this.totalBarWidth)},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:void 0===this.values[t],value:this.values[t],color:this.calcColor(this.values[t],t),offset:t}},calcColor:function(t,e){var i,n=this.values,r=this.options,o=this.colorMapByIndex,a=this.colorMapByValue;return a&&(i=a.get(t))?i:o&&o.length>e?o[e]:n[e]<0?r.get("negBarColor"):n[e]>0?r.get("posBarColor"):r.get("zeroBarColor")},renderRegion:function(t,i){var n,r,o,a,s,l,c=this.values,h=this.options,u=this.target;if(n=u.pixelHeight,o=e.round(n/2),a=t*this.totalBarWidth,c[t]<0?(s=o,r=o-1):c[t]>0?(s=0,r=o-1):(s=o-1,r=2),null!==(l=this.calcColor(c[t],t)))return i&&(l=this.calcHighlightColor(l,h)),u.drawRect(a,s,this.barWidth-1,r-1,l,l)}}),i.fn.sparkline.discrete=S=r(i.fn.sparkline._base,b,{type:"discrete",init:function(t,n,r,o,a){S._super.init.call(this,t,n,r,o,a),this.regionShapes={},this.values=n=i.map(n,Number),this.min=e.min.apply(e,n),this.max=e.max.apply(e,n),this.range=this.max-this.min,this.width=o="auto"===r.get("width")?2*n.length:this.width,this.interval=e.floor(o/n.length),this.itemWidth=o/n.length,void 0!==r.get("chartRangeMin")&&(r.get("chartRangeClip")||r.get("chartRangeMin")<this.min)&&(this.min=r.get("chartRangeMin")),void 0!==r.get("chartRangeMax")&&(r.get("chartRangeClip")||r.get("chartRangeMax")>this.max)&&(this.max=r.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight="auto"===r.get("lineHeight")?e.round(.3*this.canvasHeight):r.get("lineHeight"))},getRegion:function(t,i,n){return e.floor(i/this.itemWidth)},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:void 0===this.values[t],value:this.values[t],offset:t}},renderRegion:function(t,i){var n,r,o,s,l=this.values,c=this.options,h=this.min,u=this.max,d=this.range,f=this.interval,p=this.target,g=this.canvasHeight,m=this.lineHeight,v=g-m;return r=a(l[t],h,u),s=t*f,n=e.round(v-v*((r-h)/d)),o=c.get("thresholdColor")&&r<c.get("thresholdValue")?c.get("thresholdColor"):c.get("lineColor"),i&&(o=this.calcHighlightColor(o,c)),p.drawLine(s,n,s,n+m,o)}}),i.fn.sparkline.bullet=C=r(i.fn.sparkline._base,{type:"bullet",init:function(t,i,n,r,o){var a,s,l;C._super.init.call(this,t,i,n,r,o),this.values=i=c(i),(l=i.slice())[0]=null===l[0]?l[2]:l[0],l[1]=null===i[1]?l[2]:l[1],a=e.min.apply(e,i),s=e.max.apply(e,i),a=void 0===n.get("base")?a<0?a:0:n.get("base"),this.min=a,this.max=s,this.range=s-a,this.shapes={},this.valueShapes={},this.regiondata={},this.width=r="auto"===n.get("width")?"4.0em":r,this.target=this.$el.simpledraw(r,o,n.get("composite")),i.length||(this.disabled=!0),this.initTarget()},getRegion:function(t,e,i){var n=this.target.getShapeAt(t,e,i);return void 0!==n&&void 0!==this.shapes[n]?this.shapes[n]:void 0},getCurrentRegionFields:function(){var t=this.currentRegion;return{fieldkey:t.substr(0,1),value:this.values[t.substr(1)],region:t}},changeHighlight:function(t){var e,i=this.currentRegion,n=this.valueShapes[i];switch(delete this.shapes[n],i.substr(0,1)){case"r":e=this.renderRange(i.substr(1),t);break;case"p":e=this.renderPerformance(t);break;case"t":e=this.renderTarget(t)}this.valueShapes[i]=e.id,this.shapes[e.id]=i,this.target.replaceWithShape(n,e)},renderRange:function(t,i){var n=this.values[t],r=e.round(this.canvasWidth*((n-this.min)/this.range)),o=this.options.get("rangeColors")[t-2];return i&&(o=this.calcHighlightColor(o,this.options)),this.target.drawRect(0,0,r-1,this.canvasHeight-1,o,o)},renderPerformance:function(t){var i=this.values[1],n=e.round(this.canvasWidth*((i-this.min)/this.range)),r=this.options.get("performanceColor");return t&&(r=this.calcHighlightColor(r,this.options)),this.target.drawRect(0,e.round(.3*this.canvasHeight),n-1,e.round(.4*this.canvasHeight)-1,r,r)},renderTarget:function(t){var i=this.values[0],n=e.round(this.canvasWidth*((i-this.min)/this.range)-this.options.get("targetWidth")/2),r=e.round(.1*this.canvasHeight),o=this.canvasHeight-2*r,a=this.options.get("targetColor");return t&&(a=this.calcHighlightColor(a,this.options)),this.target.drawRect(n,r,this.options.get("targetWidth")-1,o-1,a,a)},render:function(){var t,e,i=this.values.length,n=this.target;if(C._super.render.call(this)){for(t=2;t<i;t++)e=this.renderRange(t).append(),this.shapes[e.id]="r"+t,this.valueShapes["r"+t]=e.id;null!==this.values[1]&&(e=this.renderPerformance().append(),this.shapes[e.id]="p1",this.valueShapes.p1=e.id),null!==this.values[0]&&(e=this.renderTarget().append(),this.shapes[e.id]="t0",this.valueShapes.t0=e.id),n.render()}}}),i.fn.sparkline.pie=k=r(i.fn.sparkline._base,{type:"pie",init:function(t,n,r,o,a){var s,l=0;if(k._super.init.call(this,t,n,r,o,a),this.shapes={},this.valueShapes={},this.values=n=i.map(n,Number),"auto"===r.get("width")&&(this.width=this.height),n.length>0)for(s=n.length;s--;)l+=n[s];this.total=l,this.initTarget(),this.radius=e.floor(e.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(t,e,i){var n=this.target.getShapeAt(t,e,i);return void 0!==n&&void 0!==this.shapes[n]?this.shapes[n]:void 0},getCurrentRegionFields:function(){var t=this.currentRegion;return{isNull:void 0===this.values[t],value:this.values[t],percent:this.values[t]/this.total*100,color:this.options.get("sliceColors")[t%this.options.get("sliceColors").length],offset:t}},changeHighlight:function(t){var e=this.currentRegion,i=this.renderSlice(e,t),n=this.valueShapes[e];delete this.shapes[n],this.target.replaceWithShape(n,i),this.valueShapes[e]=i.id,this.shapes[i.id]=e},renderSlice:function(t,i){var n,r,o,a,s,l=this.target,c=this.options,h=this.radius,u=c.get("borderWidth"),d=c.get("offset"),f=2*e.PI,p=this.values,g=this.total,m=d?2*e.PI*(d/360):0;for(a=p.length,o=0;o<a;o++){if(n=m,r=m,g>0&&(r=m+f*(p[o]/g)),t===o)return s=c.get("sliceColors")[o%c.get("sliceColors").length],i&&(s=this.calcHighlightColor(s,c)),l.drawPieSlice(h,h,h-u,n,r,void 0,s);m=r}},render:function(){var t,i,n=this.target,r=this.values,o=this.options,a=this.radius,s=o.get("borderWidth");if(k._super.render.call(this)){for(s&&n.drawCircle(a,a,e.floor(a-s/2),o.get("borderColor"),void 0,s).append(),i=r.length;i--;)r[i]&&(t=this.renderSlice(i).append(),this.valueShapes[i]=t.id,this.shapes[t.id]=i);n.render()}}}),i.fn.sparkline.box=T=r(i.fn.sparkline._base,{type:"box",init:function(t,e,n,r,o){T._super.init.call(this,t,e,n,r,o),this.values=i.map(e,Number),this.width="auto"===n.get("width")?"4.0em":r,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var t=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return void 0!==this.loutlier&&t.push({field:"lo",value:this.loutlier}),void 0!==this.routlier&&t.push({field:"ro",value:this.routlier}),void 0!==this.lwhisker&&t.push({field:"lw",value:this.lwhisker}),void 0!==this.rwhisker&&t.push({field:"rw",value:this.rwhisker}),t},render:function(){var t,i,n,r,o,a,l,c,h,u,d,f=this.target,p=this.values,g=p.length,m=this.options,v=this.canvasWidth,y=this.canvasHeight,b=void 0===m.get("chartRangeMin")?e.min.apply(e,p):m.get("chartRangeMin"),x=void 0===m.get("chartRangeMax")?e.max.apply(e,p):m.get("chartRangeMax"),_=0;if(T._super.render.call(this)){if(m.get("raw"))m.get("showOutliers")&&p.length>5?(i=p[0],t=p[1],r=p[2],o=p[3],a=p[4],l=p[5],c=p[6]):(t=p[0],r=p[1],o=p[2],a=p[3],l=p[4]);else if(p.sort(function(t,e){return t-e}),r=s(p,1),o=s(p,2),a=s(p,3),n=a-r,m.get("showOutliers")){for(t=l=void 0,h=0;h<g;h++)void 0===t&&p[h]>r-n*m.get("outlierIQR")&&(t=p[h]),p[h]<a+n*m.get("outlierIQR")&&(l=p[h]);i=p[0],c=p[g-1]}else t=p[0],l=p[g-1];this.quartiles=[r,o,a],this.lwhisker=t,this.rwhisker=l,this.loutlier=i,this.routlier=c,d=v/(x-b+1),m.get("showOutliers")&&(_=e.ceil(m.get("spotRadius")),d=(v-=2*e.ceil(m.get("spotRadius")))/(x-b+1),i<t&&f.drawCircle((i-b)*d+_,y/2,m.get("spotRadius"),m.get("outlierLineColor"),m.get("outlierFillColor")).append(),c>l&&f.drawCircle((c-b)*d+_,y/2,m.get("spotRadius"),m.get("outlierLineColor"),m.get("outlierFillColor")).append()),f.drawRect(e.round((r-b)*d+_),e.round(.1*y),e.round((a-r)*d),e.round(.8*y),m.get("boxLineColor"),m.get("boxFillColor")).append(),f.drawLine(e.round((t-b)*d+_),e.round(y/2),e.round((r-b)*d+_),e.round(y/2),m.get("lineColor")).append(),f.drawLine(e.round((t-b)*d+_),e.round(y/4),e.round((t-b)*d+_),e.round(y-y/4),m.get("whiskerColor")).append(),f.drawLine(e.round((l-b)*d+_),e.round(y/2),e.round((a-b)*d+_),e.round(y/2),m.get("lineColor")).append(),f.drawLine(e.round((l-b)*d+_),e.round(y/4),e.round((l-b)*d+_),e.round(y-y/4),m.get("whiskerColor")).append(),f.drawLine(e.round((o-b)*d+_),e.round(.1*y),e.round((o-b)*d+_),e.round(.9*y),m.get("medianColor")).append(),m.get("target")&&(u=e.ceil(m.get("spotRadius")),f.drawLine(e.round((m.get("target")-b)*d+_),e.round(y/2-u),e.round((m.get("target")-b)*d+_),e.round(y/2+u),m.get("targetColor")).append(),f.drawLine(e.round((m.get("target")-b)*d+_-u),e.round(y/2),e.round((m.get("target")-b)*d+_+u),e.round(y/2),m.get("targetColor")).append()),f.render()}}}),D=r({init:function(t,e,i,n){this.target=t,this.id=e,this.type=i,this.args=n},append:function(){return this.target.appendShape(this),this}}),M=r({_pxregex:/(\d+)(px)?\s*$/i,init:function(t,e,n){t&&(this.width=t,this.height=e,this.target=n,this.lastShapeId=null,n[0]&&(n=n[0]),i.data(n,"_jqs_vcanvas",this))},drawLine:function(t,e,i,n,r,o){return this.drawShape([[t,e],[i,n]],r,o)},drawShape:function(t,e,i,n){return this._genShape("Shape",[t,e,i,n])},drawCircle:function(t,e,i,n,r,o){return this._genShape("Circle",[t,e,i,n,r,o])},drawPieSlice:function(t,e,i,n,r,o,a){return this._genShape("PieSlice",[t,e,i,n,r,o,a])},drawRect:function(t,e,i,n,r,o){return this._genShape("Rect",[t,e,i,n,r,o])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(t,e){i(e).html(t)},_calculatePixelDims:function(t,e,n){var r;r=this._pxregex.exec(e),this.pixelHeight=r?r[1]:i(n).height(),r=this._pxregex.exec(t),this.pixelWidth=r?r[1]:i(n).width()},_genShape:function(t,e){var i=O++;return e.unshift(i),new D(this,i,t,e)},appendShape:function(t){alert("appendShape not implemented")},replaceWithShape:function(t,e){alert("replaceWithShape not implemented")},insertAfterShape:function(t,e){alert("insertAfterShape not implemented")},removeShapeId:function(t){alert("removeShapeId not implemented")},getShapeAt:function(t,e,i){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),E=r(M,{init:function(e,n,r,o){E._super.init.call(this,e,n,r),this.canvas=t.createElement("canvas"),r[0]&&(r=r[0]),i.data(r,"_jqs_vcanvas",this),i(this.canvas).css({display:"inline-block",width:e,height:n,verticalAlign:"top"}),this._insert(this.canvas,r),this._calculatePixelDims(e,n,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=o,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=void 0,i(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(t,e,i){var n=this.canvas.getContext("2d");return void 0!==t&&(n.strokeStyle=t),n.lineWidth=void 0===i?1:i,void 0!==e&&(n.fillStyle=e),n},reset:function(){this._getContext().clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=void 0},_drawShape:function(t,e,i,n,r){var o,a,s=this._getContext(i,n,r);for(s.beginPath(),s.moveTo(e[0][0]+.5,e[0][1]+.5),o=1,a=e.length;o<a;o++)s.lineTo(e[o][0]+.5,e[o][1]+.5);void 0!==i&&s.stroke(),void 0!==n&&s.fill(),void 0!==this.targetX&&void 0!==this.targetY&&s.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t)},_drawCircle:function(t,i,n,r,o,a,s){var l=this._getContext(o,a,s);l.beginPath(),l.arc(i,n,r,0,2*e.PI,!1),void 0!==this.targetX&&void 0!==this.targetY&&l.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t),void 0!==o&&l.stroke(),void 0!==a&&l.fill()},_drawPieSlice:function(t,e,i,n,r,o,a,s){var l=this._getContext(a,s);l.beginPath(),l.moveTo(e,i),l.arc(e,i,n,r,o,!1),l.lineTo(e,i),l.closePath(),void 0!==a&&l.stroke(),s&&l.fill(),void 0!==this.targetX&&void 0!==this.targetY&&l.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=t)},_drawRect:function(t,e,i,n,r,o,a){return this._drawShape(t,[[e,i],[e+n,i],[e+n,i+r],[e,i+r],[e,i]],o,a)},appendShape:function(t){return this.shapes[t.id]=t,this.shapeseq.push(t.id),this.lastShapeId=t.id,t.id},replaceWithShape:function(t,e){var i,n=this.shapeseq;for(this.shapes[e.id]=e,i=n.length;i--;)n[i]==t&&(n[i]=e.id);delete this.shapes[t]},replaceWithShapes:function(t,e){var i,n,r,o=this.shapeseq,a={};for(n=t.length;n--;)a[t[n]]=!0;for(n=o.length;n--;)a[i=o[n]]&&(o.splice(n,1),delete this.shapes[i],r=n);for(n=e.length;n--;)o.splice(r,0,e[n].id),this.shapes[e[n].id]=e[n]},insertAfterShape:function(t,e){var i,n=this.shapeseq;for(i=n.length;i--;)if(n[i]===t)return n.splice(i+1,0,e.id),void(this.shapes[e.id]=e)},removeShapeId:function(t){var e,i=this.shapeseq;for(e=i.length;e--;)if(i[e]===t){i.splice(e,1);break}delete this.shapes[t]},getShapeAt:function(t,e,i){return this.targetX=e,this.targetY=i,this.render(),this.currentTargetShapeId},render:function(){var t,e,i=this.shapeseq,n=this.shapes,r=i.length;for(this._getContext().clearRect(0,0,this.pixelWidth,this.pixelHeight),e=0;e<r;e++)this["_draw"+(t=n[i[e]]).type].apply(this,t.args);this.interact||(this.shapes={},this.shapeseq=[])}}),P=r(M,{init:function(e,n,r){var o;P._super.init.call(this,e,n,r),r[0]&&(r=r[0]),i.data(r,"_jqs_vcanvas",this),this.canvas=t.createElement("span"),i(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:e,height:n,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,r),this._calculatePixelDims(e,n,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,o='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",o),this.group=i(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(t,e,i,n,r){var o,a,s,l,c,h,u=[];for(h=0,c=e.length;h<c;h++)u[h]=e[h][0]+","+e[h][1];return o=u.splice(0,1),r=void 0===r?1:r,a=void 0===i?' stroked="false" ':' strokeWeight="'+r+'px" strokeColor="'+i+'" ',s=void 0===n?' filled="false"':' fillColor="'+n+'" filled="true" ',l=u[0]===u[u.length-1]?"x ":"",'<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" id="jqsshape'+t+'" '+a+s+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" path="m '+o+" l "+u.join(", ")+" "+l+'e"> </v:shape>'},_drawCircle:function(t,e,i,n,r,o,a){var s,l;return e-=n,i-=n,s=void 0===r?' stroked="false" ':' strokeWeight="'+a+'px" strokeColor="'+r+'" ',l=void 0===o?' filled="false"':' fillColor="'+o+'" filled="true" ','<v:oval id="jqsshape'+t+'" '+s+l+' style="position:absolute;top:'+i+"px; left:"+e+"px; width:"+2*n+"px; height:"+2*n+'px"></v:oval>'},_drawPieSlice:function(t,i,n,r,o,a,s,l){var c,h,u,d,f,p,g;if(o===a)return"";if(a-o==2*e.PI&&(o=0,a=2*e.PI),h=i+e.round(e.cos(o)*r),u=n+e.round(e.sin(o)*r),d=i+e.round(e.cos(a)*r),f=n+e.round(e.sin(a)*r),h===d&&u===f){if(a-o<e.PI)return"";h=d=i+r,u=f=n}return h===d&&u===f&&a-o<e.PI?"":(c=[i-r,n-r,i+r,n+r,h,u,d,f],p=void 0===s?' stroked="false" ':' strokeWeight="1px" strokeColor="'+s+'" ',g=void 0===l?' filled="false"':' fillColor="'+l+'" filled="true" ','<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" id="jqsshape'+t+'" '+p+g+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" path="m '+i+","+n+" wa "+c.join(", ")+' x e"> </v:shape>')},_drawRect:function(t,e,i,n,r,o,a){return this._drawShape(t,[[e,i],[e,i+r],[e+n,i+r],[e+n,i],[e,i]],o,a)},reset:function(){this.group.innerHTML=""},appendShape:function(t){var e=this["_draw"+t.type].apply(this,t.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",e):this.prerender+=e,this.lastShapeId=t.id,t.id},replaceWithShape:function(t,e){var n=i("#jqsshape"+t),r=this["_draw"+e.type].apply(this,e.args);n[0].outerHTML=r},replaceWithShapes:function(t,e){var n,r=i("#jqsshape"+t[0]),o="",a=e.length;for(n=0;n<a;n++)o+=this["_draw"+e[n].type].apply(this,e[n].args);for(r[0].outerHTML=o,n=1;n<t.length;n++)i("#jqsshape"+t[n]).remove()},insertAfterShape:function(t,e){var n=i("#jqsshape"+t),r=this["_draw"+e.type].apply(this,e.args);n[0].insertAdjacentHTML("afterEnd",r)},removeShapeId:function(t){var e=i("#jqsshape"+t);this.group.removeChild(e[0])},getShapeAt:function(t,e,i){return t.id.substr(8)},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})})}(document,Math);var _createClass=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),PxSparkline=function(t){"use strict";if(!t.fn.sparkline)throw new Error("jquery.sparkline.js required.");var e="pxSparkline",i="px.sparkline",n=t.fn[e],r={RESIZE:"resize.px.sparkline"},o=function(){function n(e,i,r){_classCallCheck(this,n),this.uniqueId=pxUtil.generateUniqueId(),this.element=e,this.$parent=t(e.parentNode),this.update(i,r),this._setListeners()}return _createClass(n,[{key:"update",value:function(e,i){null!==e&&(this._values=e),null!==i&&("100%"!==i.width||"bar"!==i.type&&"tristate"!==i.type||void 0!==i.barSpacing||(i.barSpacing="2px"),this.config=i);var n=t.extend(!0,{},this.config);"100%"===n.width&&("bar"===n.type||"tristate"===n.type?n.barWidth=this._getBarWidth(this.$parent,this._values.length,n.barSpacing):n.width=Math.floor(this.$parent.width())),t(this.element).sparkline(this._values,n)}},{key:"destroy",value:function(){this._unsetListeners(),t(this.element).removeData(i).removeData("_jqs_mhandler").removeData("_jqs_vcanvas").off().find("canvas").remove()}},{key:"_getBarWidth",value:function(t,e,i){var n=t.width(),r=parseInt(i,10)*(e-1);return Math.floor((n-r)/e)}},{key:"_setListeners",value:function(){var e=this;t(window).on(this.constructor.Event.RESIZE+"."+this.uniqueId,function(){if("100%"===e.config.width){var i=t.extend(!0,{},e.config);"bar"===i.type||"tristate"===i.type?i.barWidth=e._getBarWidth(e.$parent,e._values.length,i.barSpacing):i.width=Math.floor(e.$parent.width()),t(e.element).sparkline(e._values,i)}})}},{key:"_unsetListeners",value:function(){t(window).off(this.constructor.Event.RESIZE+"."+this.uniqueId)}}],[{key:"_parseArgs",value:function(e,i){var n=void 0,r=void 0;return"[object Array]"===Object.prototype.toString.call(i[0])||"html"===i[0]||null===i[0]?(n=i[0],r=i[1]||null):r=i[0]||null,"html"!==n&&void 0!==n||null===n||(void 0!==(n=e.getAttribute("values"))&&null!==n||(n=t(e).html()),n=n.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")),n&&"[object Array]"===Object.prototype.toString.call(n)&&0!==n.length||(n=null),{values:n,config:r}}},{key:"_jQueryInterface",value:function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];return this.each(function(){var e=t(this).data(i),o="update"===r[0]||"destroy"===r[0]?r[0]:null,a=n._parseArgs(this,o?r.slice(1):r),s=a.values,l=a.config;e?s&&e.update(s,l):(e=new n(this,s||[],l||{}),t(this).data(i,e)),"update"===o?e.update(s,l):"destroy"===o&&e.destroy()})}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return i}},{key:"Event",get:function(){return r}},{key:"EVENT_KEY",get:function(){return".px.sparkline"}}]),n}();return t.fn[e]=o._jQueryInterface,t.fn[e].Constructor=o,t.fn[e].noConflict=function(){return t.fn[e]=n,o._jQueryInterface},o}(jQuery);!function(t,e){"object"==typeof exports?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],e):e(t.jQuery)}(this,function(t){var e=function(t,e){var i,n=document.createElement("canvas");t.appendChild(n),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(n);var r=n.getContext("2d");n.width=n.height=e.size;var o=1;window.devicePixelRatio>1&&(o=window.devicePixelRatio,n.style.width=n.style.height=[e.size,"px"].join(""),n.width=n.height=e.size*o,r.scale(o,o)),r.translate(e.size/2,e.size/2),r.rotate((e.rotate/180-.5)*Math.PI);var a=(e.size-e.lineWidth)/2;e.scaleColor&&e.scaleLength&&(a-=e.scaleLength+2),Date.now=Date.now||function(){return+new Date};var s=function(t,e,i){var n=(i=Math.min(Math.max(-1,i||0),1))<=0;r.beginPath(),r.arc(0,0,a,0,2*Math.PI*i,n),r.strokeStyle=t,r.lineWidth=e,r.stroke()},l=function(){var t,i;r.lineWidth=1,r.fillStyle=e.scaleColor,r.save();for(var n=24;n>0;--n)n%6==0?(i=e.scaleLength,t=0):(i=.6*e.scaleLength,t=e.scaleLength-i),r.fillRect(-e.size/2+t,0,i,1),r.rotate(Math.PI/12);r.restore()},c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},h=function(){e.scaleColor&&l(),e.trackColor&&s(e.trackColor,e.trackWidth||e.lineWidth,1)};this.getCanvas=function(){return n},this.getCtx=function(){return r},this.clear=function(){r.clearRect(e.size/-2,e.size/-2,e.size,e.size)},this.draw=function(t){e.scaleColor||e.trackColor?r.getImageData&&r.putImageData?i?r.putImageData(i,0,0):(h(),i=r.getImageData(0,0,e.size*o,e.size*o)):(this.clear(),h()):this.clear(),r.lineCap=e.lineCap;var n;n="function"==typeof e.barColor?e.barColor(t):e.barColor,s(n,e.lineWidth,t/100)}.bind(this),this.animate=function(t,i){var n=Date.now();e.onStart(t,i);var r=function(){var o=Math.min(Date.now()-n,e.animate.duration),a=e.easing(this,o,t,i-t,e.animate.duration);this.draw(a),e.onStep(t,i,a),o>=e.animate.duration?e.onStop(t,i):c(r)}.bind(this);c(r)}.bind(this)},i=function(t,i){var n={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(t,e,i,n,r){return(e/=r/2)<1?n/2*e*e+i:-n/2*(--e*(e-2)-1)+i},onStart:function(t,e){},onStep:function(t,e,i){},onStop:function(t,e){}};if(void 0!==e)n.renderer=e;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");n.renderer=SVGRenderer}var r={},o=0,a=function(){this.el=t,this.options=r;for(var e in n)n.hasOwnProperty(e)&&(r[e]=i&&void 0!==i[e]?i[e]:n[e],"function"==typeof r[e]&&(r[e]=r[e].bind(this)));"string"==typeof r.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[r.easing])?r.easing=jQuery.easing[r.easing]:r.easing=n.easing,"number"==typeof r.animate&&(r.animate={duration:r.animate,enabled:!0}),"boolean"!=typeof r.animate||r.animate||(r.animate={duration:1e3,enabled:r.animate}),this.renderer=new r.renderer(t,r),this.renderer.draw(o),t.dataset&&t.dataset.percent?this.update(parseFloat(t.dataset.percent)):t.getAttribute&&t.getAttribute("data-percent")&&this.update(parseFloat(t.getAttribute("data-percent")))}.bind(this);this.update=function(t){return t=parseFloat(t),r.animate.enabled?this.renderer.animate(o,t):this.renderer.draw(t),o=t,this}.bind(this),this.disableAnimation=function(){return r.animate.enabled=!1,this},this.enableAnimation=function(){return r.animate.enabled=!0,this},a()};t.fn.easyPieChart=function(e){return this.each(function(){var n;t.data(this,"easyPieChart")||(n=t.extend({},e,t(this).data()),t.data(this,"easyPieChart",new i(this,n)))})}});