/*!
 * Chart.js
 * http://chartjs.org/
 * Version: 2.7.2
 *
 * Copyright 2018 Chart.js Contributors
 * Released under the MIT license
 * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
 */
!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 a(o,s){if(!i[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=i[o]={exports:{}};e[o][0].call(d.exports,(function(t){var i=e[o][1][t];return a(i||t)}),d,d.exports,t,e,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,i){var n=t(5);function a(t){if(t){var e=[0,0,0],i=1,a=t.match(/^#([a-fA-F0-9]{3})$/i);if(a){a=a[1];for(var r=0;r<e.length;r++)e[r]=parseInt(a[r]+a[r],16)}else if(a=t.match(/^#([a-fA-F0-9]{6})$/i)){a=a[1];for(r=0;r<e.length;r++)e[r]=parseInt(a.slice(2*r,2*r+2),16)}else if(a=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(a[r+1]);i=parseFloat(a[4])}else if(a=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(a[r+1]));i=parseFloat(a[4])}else if(a=t.match(/(\w+)/)){if("transparent"==a[1])return[0,0,0,0];if(!(e=n[a[1]]))return}for(r=0;r<e.length;r++)e[r]=d(e[r],0,255);return i=i||0==i?d(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[d(parseInt(e[1]),0,360),d(parseFloat(e[2]),0,100),d(parseFloat(e[3]),0,100),d(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[d(parseInt(e[1]),0,360),d(parseFloat(e[2]),0,100),d(parseFloat(e[3]),0,100),d(isNaN(i)?1:i,0,1)]}}}function s(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function l(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 u(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function d(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}e.exports={getRgba:a,getHsla:r,getRgb:function(t){var e=a(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=a(t);{if(e)return e[3];if(e=r(t))return e[3];if(e=o(t))return e[3]}},hexString:function(t){return"#"+h(t[0])+h(t[1])+h(t[2])},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return s(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:s,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return l(t,e);var i=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+i+"%, "+n+"%, "+a+"%)"},percentaString:l,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return u(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:u,hwbString:function(t,e){void 0===e&&(e=void 0!==t[3]?t[3]:1);return"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return c[t.slice(0,3)]}};var c={};for(var f in n)c[n[f]]=f},{5:5}],2:[function(t,e,i){var n=t(4),a=t(1),r=function(t){return t instanceof r?t:this instanceof r?(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},void("string"==typeof t?(e=a.getRgba(t))?this.setValues("rgb",e):(e=a.getHsla(t))?this.setValues("hsl",e):(e=a.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)))):new r(t);var e};r.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 a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.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,a=void 0===e?.5:e,r=2*a-1,o=i.alpha()-n.alpha(),s=((r*o==-1?r:(r+o)/(1+r*o))+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()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new r,n=this.values,a=i.values;for(var o in n)n.hasOwnProperty(o)&&(t=n[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return i}},r.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},r.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},r.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},r.prototype.setValues=function(t,e){var i,a,r=this.values,o=this.spaces,s=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)r[t]=e.slice(0,t.length),l=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)];l=e.a}else if(void 0!==e[o[t][0]]){var u=o[t];for(i=0;i<t.length;i++)r[t][i]=e[u[i]];l=e.alpha}if(r.alpha=Math.max(0,Math.min(1,void 0===l?r.alpha:l)),"alpha"===t)return!1;for(i=0;i<t.length;i++)a=Math.max(0,Math.min(s[t][i],r[t][i])),r[t][i]=Math.round(a);for(var d in o)d!==t&&(r[d]=n[t][d](r[t]));return!0},r.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)},r.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=r),e.exports=r},{1:1,4:4}],3:[function(t,e,i){function n(t){var e,i,n=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(n,a,r),s=Math.max(n,a,r),l=s-o;return s==o?e=0:n==s?e=(a-r)/l:a==s?e=2+(r-n)/l:r==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(o+s)/2,[e,100*(s==o?0:i<=.5?l/(s+o):l/(2-s-o)),100*i]}function a(t){var e,i,n=t[0],a=t[1],r=t[2],o=Math.min(n,a,r),s=Math.max(n,a,r),l=s-o;return i=0==s?0:l/s*1e3/10,s==o?e=0:n==s?e=(a-r)/l:a==s?e=2+(r-n)/l:r==s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),[e,i,s/255*1e3/10]}function o(t){var e=t[0],i=t[1],a=t[2];return[n(t)[0],100*(1/255*Math.min(e,Math.min(i,a))),100*(a=1-1/255*Math.max(e,Math.max(i,a)))]}function s(t){var e,i=t[0]/255,n=t[1]/255,a=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-a)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]}function l(t){return S[JSON.stringify(t)]}function u(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 d(t){var e=u(t),i=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]}function h(t){var e,i,n,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return[r=255*l,r,r];e=2*l-(i=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(n=o+1/3*-(u-1))<0&&n++,n>1&&n--,r=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,a[u]=255*r;return a}function c(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*n*(1-i),s=255*n*(1-i*r),l=255*n*(1-i*(1-r));n*=255;switch(a){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}}function f(t){var e,i,n,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),n=6*o-(e=Math.floor(6*o)),0!=(1&e)&&(n=1-n),a=s+n*((i=1-l)-s),e){default:case 6:case 0:r=i,g=a,b=s;break;case 1:r=a,g=i,b=s;break;case 2:r=s,g=i,b=a;break;case 3:r=s,g=a,b=i;break;case 4:r=a,g=s,b=i;break;case 5:r=i,g=s,b=a}return[255*r,255*g,255*b]}function m(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]}function p(t){var e,i,n,a=t[0]/100,r=t[1]/100,o=t[2]/100;return i=-.9689*a+1.8758*r+.0415*o,n=.0557*a+-.204*r+1.057*o,e=(e=3.2406*a+-1.5372*r+-.4986*o)>.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,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]}function v(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]}function y(t){var e,i,n,a,r=t[0],o=t[1],s=t[2];return r<=8?a=(i=100*r/903.3)/100*7.787+16/116:(i=100*Math.pow((r+16)/116,3),a=Math.pow(i/100,1/3)),[e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),i,n=n/108.883<=.008859?n=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3)]}function x(t){var e,i=t[0],n=t[1],a=t[2];return(e=360*Math.atan2(a,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+a*a),e]}function _(t){return p(y(t))}function k(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]}function w(t){return M[t]}e.exports={rgb2hsl:n,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:h,hsl2hsv:function(t){var e=t[0],i=t[1]/100,n=t[2]/100;if(0===n)return[0,0,0];return[e,100*(2*(i*=(n*=2)<=1?n:2-n)/(n+i)),100*((n+i)/2)]},hsl2hwb:function(t){return o(h(t))},hsl2cmyk:function(t){return s(h(t))},hsl2keyword:function(t){return l(h(t))},hsv2rgb:c,hsv2hsl:function(t){var e,i,n=t[0],a=t[1]/100,r=t[2]/100;return e=a*r,[n,100*(e=(e/=(i=(2-a)*r)<=1?i:2-i)||0),100*(i/=2)]},hsv2hwb:function(t){return o(c(t))},hsv2cmyk:function(t){return s(c(t))},hsv2keyword:function(t){return l(c(t))},hwb2rgb:f,hwb2hsl:function(t){return n(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:m,cmyk2hsl:function(t){return n(m(t))},cmyk2hsv:function(t){return a(m(t))},cmyk2hwb:function(t){return o(m(t))},cmyk2keyword:function(t){return l(m(t))},keyword2rgb:w,keyword2hsl:function(t){return n(w(t))},keyword2hsv:function(t){return a(w(t))},keyword2hwb:function(t){return o(w(t))},keyword2cmyk:function(t){return s(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return u(w(t))},xyz2rgb:p,xyz2lab:v,xyz2lch:function(t){return x(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:x,lch2lab:k,lch2xyz:function(t){return y(k(t))},lch2rgb:function(t){return _(k(t))}};var M={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]},S={};for(var D in M)S[JSON.stringify(M[D])]=D},{}],4:[function(t,e,i){var n=t(3),a=function(){return new u};for(var r in n){a[r+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),n[t](e)}}(r);var o=/(\w+)2(\w+)/.exec(r),s=o[1],l=o[2];(a[s]=a[s]||{})[l]=a[r]=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 a=0;a<i.length;a++)i[a]=Math.round(i[a]);return i}}(r)}var u=function(){this.convs={}};u.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))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var i=this.space,n=this.convs[i];e=a[i][t](n),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach((function(t){u.prototype[t]=function(e){return this.routeSpace(t,arguments)}})),e.exports=a},{3:3}],5:[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]}},{}],6:[function(t,e,i){var n,a;n=this,a=function(){"use strict";var i,n;function a(){return i.apply(null,arguments)}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function o(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function u(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var i,n=[];for(i=0;i<t.length;++i)n.push(e(t[i],i));return n}function h(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){for(var i in e)h(e,i)&&(t[i]=e[i]);return h(e,"toString")&&(t.toString=e.toString),h(e,"valueOf")&&(t.valueOf=e.valueOf),t}function f(t,e,i,n){return Pe(t,e,i,n,!0).utc()}function g(t){return null==t._pf&&(t._pf={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}),t._pf}function m(t){if(null==t._isValid){var e=g(t),i=n.call(e.parsedDateParts,(function(t){return null!=t})),a=!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&&(a=a&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return a;t._isValid=a}return t._isValid}function p(t){var e=f(NaN);return null!=t?c(g(e),t):g(e).userInvalidated=!0,e}n=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 v=a.momentProperties=[];function y(t,e){var i,n,a;if(s(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),s(e._i)||(t._i=e._i),s(e._f)||(t._f=e._f),s(e._l)||(t._l=e._l),s(e._strict)||(t._strict=e._strict),s(e._tzm)||(t._tzm=e._tzm),s(e._isUTC)||(t._isUTC=e._isUTC),s(e._offset)||(t._offset=e._offset),s(e._pf)||(t._pf=g(e)),s(e._locale)||(t._locale=e._locale),v.length>0)for(i=0;i<v.length;i++)s(a=e[n=v[i]])||(t[n]=a);return t}var b=!1;function x(t){y(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,a.updateOffset(this),b=!1)}function _(t){return t instanceof x||null!=t&&null!=t._isAMomentObject}function k(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function w(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=k(e)),i}function M(t,e,i){var n,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(n=0;n<a;n++)(i&&t[n]!==e[n]||!i&&w(t[n])!==w(e[n]))&&o++;return o+r}function S(t){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function D(t,e){var i=!0;return c((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,t),i){for(var n,r=[],o=0;o<arguments.length;o++){if(n="","object"==typeof arguments[o]){for(var s in n+="\n["+o+"] ",arguments[0])n+=s+": "+arguments[0][s]+", ";n=n.slice(0,-2)}else n=arguments[o];r.push(n)}S(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return e.apply(this,arguments)}),e)}var C,P={};function T(t,e){null!=a.deprecationHandler&&a.deprecationHandler(t,e),P[t]||(S(e),P[t]=!0)}function O(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function I(t,e){var i,n=c({},t);for(i in e)h(e,i)&&(o(t[i])&&o(e[i])?(n[i]={},c(n[i],t[i]),c(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);for(i in t)h(t,i)&&!h(e,i)&&o(t[i])&&(n[i]=c({},n[i]));return n}function A(t){null!=t&&this.set(t)}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,C=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)h(t,e)&&i.push(e);return i};var F={};function R(t,e){var i=t.toLowerCase();F[i]=F[i+"s"]=F[e]=t}function L(t){return"string"==typeof t?F[t]||F[t.toLowerCase()]:void 0}function W(t){var e,i,n={};for(i in t)h(t,i)&&(e=L(i))&&(n[e]=t[i]);return n}var Y={};function N(t,e){Y[t]=e}function z(t,e,i){var n=""+Math.abs(t),a=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+n}var H=/(\[[^\[]*\])|(\\)?([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,V=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,B={},E={};function j(t,e,i,n){var a=n;"string"==typeof n&&(a=function(){return this[n]()}),t&&(E[t]=a),e&&(E[e[0]]=function(){return z(a.apply(this,arguments),e[1],e[2])}),i&&(E[i]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function U(t,e){return t.isValid()?(e=q(e,t.localeData()),B[e]=B[e]||function(t){var e,i,n,a=t.match(H);for(e=0,i=a.length;e<i;e++)E[a[e]]?a[e]=E[a[e]]:a[e]=(n=a[e]).match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"");return function(e){var n,r="";for(n=0;n<i;n++)r+=O(a[n])?a[n].call(e,t):a[n];return r}}(e),B[e](t)):t.localeData().invalidDate()}function q(t,e){var i=5;function n(t){return e.longDateFormat(t)||t}for(V.lastIndex=0;i>=0&&V.test(t);)t=t.replace(V,n),V.lastIndex=0,i-=1;return t}var G=/\d/,Z=/\d\d/,X=/\d{3}/,J=/\d{4}/,K=/[+-]?\d{6}/,$=/\d\d?/,Q=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,it=/\d{1,4}/,nt=/[+-]?\d{1,6}/,at=/\d+/,rt=/[+-]?\d+/,ot=/Z|[+-]\d\d:?\d\d/gi,st=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ut={};function dt(t,e,i){ut[t]=O(e)?e:function(t,n){return t&&i?i:e}}function ht(t,e){return h(ut,t)?ut[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,a){return e||i||n||a}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function gt(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),l(e)&&(n=function(t,i){i[e]=w(t)}),i=0;i<t.length;i++)ft[t[i]]=n}function mt(t,e){gt(t,(function(t,i,n,a){n._w=n._w||{},e(t,n._w,n,a)}))}var pt=0,vt=1,yt=2,bt=3,xt=4,_t=5,kt=6,wt=7,Mt=8;function St(t){return Dt(t)?366:365}function Dt(t){return t%4==0&&t%100!=0||t%400==0}j("Y",0,0,(function(){var t=this.year();return t<=9999?""+t:"+"+t})),j(0,["YY",2],0,(function(){return this.year()%100})),j(0,["YYYY",4],0,"year"),j(0,["YYYYY",5],0,"year"),j(0,["YYYYYY",6,!0],0,"year"),R("year","y"),N("year",1),dt("Y",rt),dt("YY",$,Z),dt("YYYY",it,J),dt("YYYYY",nt,K),dt("YYYYYY",nt,K),gt(["YYYYY","YYYYYY"],pt),gt("YYYY",(function(t,e){e[pt]=2===t.length?a.parseTwoDigitYear(t):w(t)})),gt("YY",(function(t,e){e[pt]=a.parseTwoDigitYear(t)})),gt("Y",(function(t,e){e[pt]=parseInt(t,10)})),a.parseTwoDigitYear=function(t){return w(t)+(w(t)>68?1900:2e3)};var Ct,Pt=Tt("FullYear",!0);function Tt(t,e){return function(i){return null!=i?(It(this,t,i),a.updateOffset(this,e),this):Ot(this,t)}}function Ot(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function It(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&Dt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),At(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function At(t,e){if(isNaN(t)||isNaN(e))return NaN;var i,n=(e%(i=12)+i)%i;return t+=(e-n)/12,1===n?Dt(t)?29:28:31-n%7%2}Ct=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},j("M",["MM",2],"Mo",(function(){return this.month()+1})),j("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),j("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),R("month","M"),N("month",8),dt("M",$),dt("MM",$,Z),dt("MMM",(function(t,e){return e.monthsShortRegex(t)})),dt("MMMM",(function(t,e){return e.monthsRegex(t)})),gt(["M","MM"],(function(t,e){e[vt]=w(t)-1})),gt(["MMM","MMMM"],(function(t,e,i,n){var a=i._locale.monthsParse(t,n,i._strict);null!=a?e[vt]=a:g(i).invalidMonth=t}));var Ft=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Rt="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Lt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Wt(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=w(e);else if(!l(e=t.localeData().monthsParse(e)))return t;return i=Math.min(t.date(),At(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function Yt(t){return null!=t?(Wt(this,t),a.updateOffset(this,!0),this):Ot(this,"Month")}var Nt=lt;var zt=lt;function Ht(){function t(t,e){return e.length-t.length}var e,i,n=[],a=[],r=[];for(e=0;e<12;e++)i=f([2e3,e]),n.push(this.monthsShort(i,"")),a.push(this.months(i,"")),r.push(this.months(i,"")),r.push(this.monthsShort(i,""));for(n.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)n[e]=ct(n[e]),a[e]=ct(a[e]);for(e=0;e<24;e++)r[e]=ct(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Vt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function Bt(t,e,i){var n=7+e-i;return-((7+Vt(t,0,n).getUTCDay()-e)%7)+n-1}function Et(t,e,i,n,a){var r,o,s=1+7*(e-1)+(7+i-n)%7+Bt(t,n,a);return s<=0?o=St(r=t-1)+s:s>St(t)?(r=t+1,o=s-St(t)):(r=t,o=s),{year:r,dayOfYear:o}}function jt(t,e,i){var n,a,r=Bt(t.year(),e,i),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?n=o+Ut(a=t.year()-1,e,i):o>Ut(t.year(),e,i)?(n=o-Ut(t.year(),e,i),a=t.year()+1):(a=t.year(),n=o),{week:n,year:a}}function Ut(t,e,i){var n=Bt(t,e,i),a=Bt(t+1,e,i);return(St(t)-n+a)/7}j("w",["ww",2],"wo","week"),j("W",["WW",2],"Wo","isoWeek"),R("week","w"),R("isoWeek","W"),N("week",5),N("isoWeek",5),dt("w",$),dt("ww",$,Z),dt("W",$),dt("WW",$,Z),mt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=w(t)}));j("d",0,"do","day"),j("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),j("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),j("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),j("e",0,0,"weekday"),j("E",0,0,"isoWeekday"),R("day","d"),R("weekday","e"),R("isoWeekday","E"),N("day",11),N("weekday",11),N("isoWeekday",11),dt("d",$),dt("e",$),dt("E",$),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),mt(["dd","ddd","dddd"],(function(t,e,i,n){var a=i._locale.weekdaysParse(t,n,i._strict);null!=a?e.d=a:g(i).invalidWeekday=t})),mt(["d","e","E"],(function(t,e,i,n){e[n]=w(t)}));var qt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Gt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var Zt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");var Xt=lt;var Jt=lt;var Kt=lt;function $t(){function t(t,e){return e.length-t.length}var e,i,n,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)i=f([2e3,1]).day(e),n=this.weekdaysMin(i,""),a=this.weekdaysShort(i,""),r=this.weekdays(i,""),o.push(n),s.push(a),l.push(r),u.push(n),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=ct(s[e]),l[e]=ct(l[e]),u[e]=ct(u[e]);this._weekdaysRegex=new RegExp("^("+u.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("^("+o.join("|")+")","i")}function Qt(){return this.hours()%12||12}function te(t,e){j(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function ee(t,e){return e._meridiemParse}j("H",["HH",2],0,"hour"),j("h",["hh",2],0,Qt),j("k",["kk",2],0,(function(){return this.hours()||24})),j("hmm",0,0,(function(){return""+Qt.apply(this)+z(this.minutes(),2)})),j("hmmss",0,0,(function(){return""+Qt.apply(this)+z(this.minutes(),2)+z(this.seconds(),2)})),j("Hmm",0,0,(function(){return""+this.hours()+z(this.minutes(),2)})),j("Hmmss",0,0,(function(){return""+this.hours()+z(this.minutes(),2)+z(this.seconds(),2)})),te("a",!0),te("A",!1),R("hour","h"),N("hour",13),dt("a",ee),dt("A",ee),dt("H",$),dt("h",$),dt("k",$),dt("HH",$,Z),dt("hh",$,Z),dt("kk",$,Z),dt("hmm",Q),dt("hmmss",tt),dt("Hmm",Q),dt("Hmmss",tt),gt(["H","HH"],bt),gt(["k","kk"],(function(t,e,i){var n=w(t);e[bt]=24===n?0:n})),gt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),gt(["h","hh"],(function(t,e,i){e[bt]=w(t),g(i).bigHour=!0})),gt("hmm",(function(t,e,i){var n=t.length-2;e[bt]=w(t.substr(0,n)),e[xt]=w(t.substr(n)),g(i).bigHour=!0})),gt("hmmss",(function(t,e,i){var n=t.length-4,a=t.length-2;e[bt]=w(t.substr(0,n)),e[xt]=w(t.substr(n,2)),e[_t]=w(t.substr(a)),g(i).bigHour=!0})),gt("Hmm",(function(t,e,i){var n=t.length-2;e[bt]=w(t.substr(0,n)),e[xt]=w(t.substr(n))})),gt("Hmmss",(function(t,e,i){var n=t.length-4,a=t.length-2;e[bt]=w(t.substr(0,n)),e[xt]=w(t.substr(n,2)),e[_t]=w(t.substr(a))}));var ie,ne=Tt("Hours",!0),ae={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:Rt,monthsShort:Lt,week:{dow:0,doy:6},weekdays:qt,weekdaysMin:Zt,weekdaysShort:Gt,meridiemParse:/[ap]\.?m?\.?/i},re={},oe={};function se(t){return t?t.toLowerCase().replace("_","-"):t}function le(i){var n=null;if(!re[i]&&void 0!==e&&e&&e.exports)try{n=ie._abbr,t("./locale/"+i),ue(n)}catch(t){}return re[i]}function ue(t,e){var i;return t&&(i=s(e)?he(t):de(t,e))&&(ie=i),ie._abbr}function de(t,e){if(null!==e){var i=ae;if(e.abbr=t,null!=re[t])T("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=re[t]._config;else if(null!=e.parentLocale){if(null==re[e.parentLocale])return oe[e.parentLocale]||(oe[e.parentLocale]=[]),oe[e.parentLocale].push({name:t,config:e}),null;i=re[e.parentLocale]._config}return re[t]=new A(I(i,e)),oe[t]&&oe[t].forEach((function(t){de(t.name,t.config)})),ue(t),re[t]}return delete re[t],null}function he(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ie;if(!r(t)){if(e=le(t))return e;t=[t]}return function(t){for(var e,i,n,a,r=0;r<t.length;){for(e=(a=se(t[r]).split("-")).length,i=(i=se(t[r+1]))?i.split("-"):null;e>0;){if(n=le(a.slice(0,e).join("-")))return n;if(i&&i.length>=e&&M(a,i,!0)>=e-1)break;e--}r++}return null}(t)}function ce(t){var e,i=t._a;return i&&-2===g(t).overflow&&(e=i[vt]<0||i[vt]>11?vt:i[yt]<1||i[yt]>At(i[pt],i[vt])?yt:i[bt]<0||i[bt]>24||24===i[bt]&&(0!==i[xt]||0!==i[_t]||0!==i[kt])?bt:i[xt]<0||i[xt]>59?xt:i[_t]<0||i[_t]>59?_t:i[kt]<0||i[kt]>999?kt:-1,g(t)._overflowDayOfYear&&(e<pt||e>yt)&&(e=yt),g(t)._overflowWeeks&&-1===e&&(e=wt),g(t)._overflowWeekday&&-1===e&&(e=Mt),g(t).overflow=e),t}function fe(t,e,i){return null!=t?t:null!=e?e:i}function ge(t){var e,i,n,r,o,s=[];if(!t._d){var l,u;for(l=t,u=new Date(a.now()),n=l._useUTC?[u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()]:[u.getFullYear(),u.getMonth(),u.getDate()],t._w&&null==t._a[yt]&&null==t._a[vt]&&function(t){var e,i,n,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,i=fe(e.GG,t._a[pt],jt(Te(),1,4).year),n=fe(e.W,1),((a=fe(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=jt(Te(),r,o);i=fe(e.gg,t._a[pt],u.year),n=fe(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}n<1||n>Ut(i,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=Et(i,n,a,r,o),t._a[pt]=s.year,t._dayOfYear=s.dayOfYear)}(t),null!=t._dayOfYear&&(o=fe(t._a[pt],n[pt]),(t._dayOfYear>St(o)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),i=Vt(o,0,t._dayOfYear),t._a[vt]=i.getUTCMonth(),t._a[yt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=s[e]=n[e];for(;e<7;e++)t._a[e]=s[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[bt]&&0===t._a[xt]&&0===t._a[_t]&&0===t._a[kt]&&(t._nextDay=!0,t._a[bt]=0),t._d=(t._useUTC?Vt:function(t,e,i,n,a,r,o){var s=new Date(t,e,i,n,a,r,o);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}).apply(null,s),r=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[bt]=24),t._w&&void 0!==t._w.d&&t._w.d!==r&&(g(t).weekdayMismatch=!0)}}var me=/^\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)?)?$/,pe=/^\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)?)?$/,ve=/Z|[+-]\d\d(?::?\d\d)?/,ye=[["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}/]],be=[["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/]],xe=/^\/?Date\((\-?\d+)/i;function _e(t){var e,i,n,a,r,o,s=t._i,l=me.exec(s)||pe.exec(s);if(l){for(g(t).iso=!0,e=0,i=ye.length;e<i;e++)if(ye[e][1].exec(l[1])){a=ye[e][0],n=!1!==ye[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,i=be.length;e<i;e++)if(be[e][1].exec(l[3])){r=(l[2]||" ")+be[e][0];break}if(null==r)return void(t._isValid=!1)}if(!n&&null!=r)return void(t._isValid=!1);if(l[4]){if(!ve.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),De(t)}else t._isValid=!1}var ke=/^(?:(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}))$/;function we(t,e,i,n,a,r){var o=[function(t){var e=parseInt(t,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(t),Lt.indexOf(e),parseInt(i,10),parseInt(n,10),parseInt(a,10)];return r&&o.push(parseInt(r,10)),o}var Me={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Se(t){var e,i,n,a=ke.exec(t._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim());if(a){var r=we(a[4],a[3],a[2],a[5],a[6],a[7]);if(e=a[1],i=r,n=t,e&&Gt.indexOf(e)!==new Date(i[0],i[1],i[2]).getDay()&&(g(n).weekdayMismatch=!0,n._isValid=!1,1))return;t._a=r,t._tzm=function(t,e,i){if(t)return Me[t];if(e)return 0;var n=parseInt(i,10),a=n%100;return(n-a)/100*60+a}(a[8],a[9],a[10]),t._d=Vt.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),g(t).rfc2822=!0}else t._isValid=!1}function De(t){if(t._f!==a.ISO_8601)if(t._f!==a.RFC_2822){t._a=[],g(t).empty=!0;var e,i,n,r,o,s,l,u,d=""+t._i,c=d.length,f=0;for(n=q(t._f,t._locale).match(H)||[],e=0;e<n.length;e++)r=n[e],(i=(d.match(ht(r,t))||[])[0])&&((o=d.substr(0,d.indexOf(i))).length>0&&g(t).unusedInput.push(o),d=d.slice(d.indexOf(i)+i.length),f+=i.length),E[r]?(i?g(t).empty=!1:g(t).unusedTokens.push(r),s=r,u=t,null!=(l=i)&&h(ft,s)&&ft[s](l,u._a,u,s)):t._strict&&!i&&g(t).unusedTokens.push(r);g(t).charsLeftOver=c-f,d.length>0&&g(t).unusedInput.push(d),t._a[bt]<=12&&!0===g(t).bigHour&&t._a[bt]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[bt]=function(t,e,i){var n;if(null==i)return e;return 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}(t._locale,t._a[bt],t._meridiem),ge(t),ce(t)}else Se(t);else _e(t)}function Ce(t){var e,i,n,h,f=t._i,v=t._f;return t._locale=t._locale||he(t._l),null===f||void 0===v&&""===f?p({nullInput:!0}):("string"==typeof f&&(t._i=f=t._locale.preparse(f)),_(f)?new x(ce(f)):(u(f)?t._d=f:r(v)?function(t){var e,i,n,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)r=0,e=y({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],De(e),m(e)&&(r+=g(e).charsLeftOver,r+=10*g(e).unusedTokens.length,g(e).score=r,(null==n||r<n)&&(n=r,i=e));c(t,i||e)}(t):v?De(t):s(i=(e=t)._i)?e._d=new Date(a.now()):u(i)?e._d=new Date(i.valueOf()):"string"==typeof i?(n=e,null===(h=xe.exec(n._i))?(_e(n),!1===n._isValid&&(delete n._isValid,Se(n),!1===n._isValid&&(delete n._isValid,a.createFromInputFallback(n)))):n._d=new Date(+h[1])):r(i)?(e._a=d(i.slice(0),(function(t){return parseInt(t,10)})),ge(e)):o(i)?function(t){if(!t._d){var e=W(t._i);t._a=d([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),ge(t)}}(e):l(i)?e._d=new Date(i):a.createFromInputFallback(e),m(t)||(t._d=null),t))}function Pe(t,e,i,n,a){var s,l={};return!0!==i&&!1!==i||(n=i,i=void 0),(o(t)&&function(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0}(t)||r(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=a,l._l=i,l._i=t,l._f=e,l._strict=n,(s=new x(ce(Ce(l))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Te(t,e,i,n){return Pe(t,e,i,n,!1)}a.createFromInputFallback=D("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":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var Oe=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Te.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:p()})),Ie=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=Te.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:p()}));function Ae(t,e){var i,n;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return Te();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}var Fe=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Re(t){var e=W(t),i=e.year||0,n=e.quarter||0,a=e.month||0,r=e.week||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=function(t){for(var e in t)if(-1===Ct.call(Fe,e)||null!=t[e]&&isNaN(t[e]))return!1;for(var i=!1,n=0;n<Fe.length;++n)if(t[Fe[n]]){if(i)return!1;parseFloat(t[Fe[n]])!==w(t[Fe[n]])&&(i=!0)}return!0}(e),this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*n+12*i,this._data={},this._locale=he(),this._bubble()}function Le(t){return t instanceof Re}function We(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function Ye(t,e){j(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+z(~~(t/60),2)+e+z(~~t%60,2)}))}Ye("Z",":"),Ye("ZZ",""),dt("Z",st),dt("ZZ",st),gt(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=ze(st,t)}));var Ne=/([\+\-]|\d\d)/gi;function ze(t,e){var i=(e||"").match(t);if(null===i)return null;var n=((i[i.length-1]||[])+"").match(Ne)||["-",0,0],a=60*n[1]+w(n[2]);return 0===a?0:"+"===n[0]?a:-a}function He(t,e){var i,n;return e._isUTC?(i=e.clone(),n=(_(t)||u(t)?t.valueOf():Te(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+n),a.updateOffset(i,!1),i):Te(t).local()}function Ve(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Be(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}a.updateOffset=function(){};var Ee=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,je=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ue(t,e){var i,n,a,r=t,o=null;return Le(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:l(t)?(r={},e?r[e]=t:r.milliseconds=t):(o=Ee.exec(t))?(i="-"===o[1]?-1:1,r={y:0,d:w(o[yt])*i,h:w(o[bt])*i,m:w(o[xt])*i,s:w(o[_t])*i,ms:w(We(1e3*o[kt]))*i}):(o=je.exec(t))?(i="-"===o[1]?-1:(o[1],1),r={y:qe(o[2],i),M:qe(o[3],i),w:qe(o[4],i),d:qe(o[5],i),h:qe(o[6],i),m:qe(o[7],i),s:qe(o[8],i)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(a=function(t,e){var i;if(!t.isValid()||!e.isValid())return{milliseconds:0,months:0};e=He(e,t),t.isBefore(e)?i=Ge(t,e):((i=Ge(e,t)).milliseconds=-i.milliseconds,i.months=-i.months);return i}(Te(r.from),Te(r.to)),(r={}).ms=a.milliseconds,r.M=a.months),n=new Re(r),Le(t)&&h(t,"_locale")&&(n._locale=t._locale),n}function qe(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function Ge(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 Ze(t,e){return function(i,n){var a;return null===n||isNaN(+n)||(T(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."),a=i,i=n,n=a),Xe(this,Ue(i="string"==typeof i?+i:i,n),t),this}}function Xe(t,e,i,n){var r=e._milliseconds,o=We(e._days),s=We(e._months);t.isValid()&&(n=null==n||n,s&&Wt(t,Ot(t,"Month")+s*i),o&&It(t,"Date",Ot(t,"Date")+o*i),r&&t._d.setTime(t._d.valueOf()+r*i),n&&a.updateOffset(t,o||s))}Ue.fn=Re.prototype,Ue.invalid=function(){return Ue(NaN)};var Je=Ze(1,"add"),Ke=Ze(-1,"subtract");function $e(t,e){var i=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(i,"months");return-(i+(e-n<0?(e-n)/(n-t.clone().add(i-1,"months")):(e-n)/(t.clone().add(i+1,"months")-n)))||0}function Qe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=he(t))&&(this._locale=e),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ti=D("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)}));function ei(){return this._locale}function ii(t,e){j(0,[t,t.length],0,e)}function ni(t,e,i,n,a){var r;return null==t?jt(this,n,a).year:(e>(r=Ut(t,n,a))&&(e=r),function(t,e,i,n,a){var r=Et(t,e,i,n,a),o=Vt(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}.call(this,t,e,i,n,a))}j(0,["gg",2],0,(function(){return this.weekYear()%100})),j(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ii("gggg","weekYear"),ii("ggggg","weekYear"),ii("GGGG","isoWeekYear"),ii("GGGGG","isoWeekYear"),R("weekYear","gg"),R("isoWeekYear","GG"),N("weekYear",1),N("isoWeekYear",1),dt("G",rt),dt("g",rt),dt("GG",$,Z),dt("gg",$,Z),dt("GGGG",it,J),dt("gggg",it,J),dt("GGGGG",nt,K),dt("ggggg",nt,K),mt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=w(t)})),mt(["gg","GG"],(function(t,e,i,n){e[n]=a.parseTwoDigitYear(t)})),j("Q",0,"Qo","quarter"),R("quarter","Q"),N("quarter",7),dt("Q",G),gt("Q",(function(t,e){e[vt]=3*(w(t)-1)})),j("D",["DD",2],"Do","date"),R("date","D"),N("date",9),dt("D",$),dt("DD",$,Z),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),gt(["D","DD"],yt),gt("Do",(function(t,e){e[yt]=w(t.match($)[0])}));var ai=Tt("Date",!0);j("DDD",["DDDD",3],"DDDo","dayOfYear"),R("dayOfYear","DDD"),N("dayOfYear",4),dt("DDD",et),dt("DDDD",X),gt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=w(t)})),j("m",["mm",2],0,"minute"),R("minute","m"),N("minute",14),dt("m",$),dt("mm",$,Z),gt(["m","mm"],xt);var ri=Tt("Minutes",!1);j("s",["ss",2],0,"second"),R("second","s"),N("second",15),dt("s",$),dt("ss",$,Z),gt(["s","ss"],_t);var oi,si=Tt("Seconds",!1);for(j("S",0,0,(function(){return~~(this.millisecond()/100)})),j(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),j(0,["SSS",3],0,"millisecond"),j(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),j(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),j(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),j(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),j(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),j(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),R("millisecond","ms"),N("millisecond",16),dt("S",et,G),dt("SS",et,Z),dt("SSS",et,X),oi="SSSS";oi.length<=9;oi+="S")dt(oi,at);function li(t,e){e[kt]=w(1e3*("0."+t))}for(oi="S";oi.length<=9;oi+="S")gt(oi,li);var ui=Tt("Milliseconds",!1);j("z",0,0,"zoneAbbr"),j("zz",0,0,"zoneName");var di=x.prototype;function hi(t){return t}di.add=Je,di.calendar=function(t,e){var i=t||Te(),n=He(i,this).startOf("day"),r=a.calendarFormat(this,n)||"sameElse",o=e&&(O(e[r])?e[r].call(this,i):e[r]);return this.format(o||this.localeData().calendar(r,this,Te(i)))},di.clone=function(){return new x(this)},di.diff=function(t,e,i){var n,a,r;if(!this.isValid())return NaN;if(!(n=He(t,this)).isValid())return NaN;switch(a=6e4*(n.utcOffset()-this.utcOffset()),e=L(e)){case"year":r=$e(this,n)/12;break;case"month":r=$e(this,n);break;case"quarter":r=$e(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-a)/864e5;break;case"week":r=(this-n-a)/6048e5;break;default:r=this-n}return i?r:k(r)},di.endOf=function(t){return void 0===(t=L(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},di.format=function(t){t||(t=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var e=U(this,t);return this.localeData().postformat(e)},di.from=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Te(t).isValid())?Ue({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},di.fromNow=function(t){return this.from(Te(),t)},di.to=function(t,e){return this.isValid()&&(_(t)&&t.isValid()||Te(t).isValid())?Ue({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},di.toNow=function(t){return this.to(Te(),t)},di.get=function(t){return O(this[t=L(t)])?this[t]():this},di.invalidAt=function(){return g(this).overflow},di.isAfter=function(t,e){var i=_(t)?t:Te(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=L(s(e)?"millisecond":e))?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())},di.isBefore=function(t,e){var i=_(t)?t:Te(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=L(s(e)?"millisecond":e))?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())},di.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))},di.isSame=function(t,e){var i,n=_(t)?t:Te(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=L(e||"millisecond"))?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))},di.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},di.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},di.isValid=function(){return m(this)},di.lang=ti,di.locale=Qe,di.localeData=ei,di.max=Ie,di.min=Oe,di.parsingFlags=function(){return c({},g(this))},di.set=function(t,e){if("object"==typeof t)for(var i=function(t){var e=[];for(var i in t)e.push({unit:i,priority:Y[i]});return e.sort((function(t,e){return t.priority-e.priority})),e}(t=W(t)),n=0;n<i.length;n++)this[i[n].unit](t[i[n].unit]);else if(O(this[t=L(t)]))return this[t](e);return this},di.startOf=function(t){switch(t=L(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},di.subtract=Ke,di.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},di.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()}},di.toDate=function(){return new Date(this.valueOf())},di.toISOString=function(t){if(!this.isValid())return null;var e=!0!==t,i=e?this.clone().utc():this;return i.year()<0||i.year()>9999?U(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this._d.valueOf()).toISOString().replace("Z",U(i,"Z")):U(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},di.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",a=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+a)},di.toJSON=function(){return this.isValid()?this.toISOString():null},di.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},di.unix=function(){return Math.floor(this.valueOf()/1e3)},di.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},di.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},di.year=Pt,di.isLeapYear=function(){return Dt(this.year())},di.weekYear=function(t){return ni.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},di.isoWeekYear=function(t){return ni.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},di.quarter=di.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},di.month=Yt,di.daysInMonth=function(){return At(this.year(),this.month())},di.week=di.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},di.isoWeek=di.isoWeeks=function(t){var e=jt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},di.weeksInYear=function(){var t=this.localeData()._week;return Ut(this.year(),t.dow,t.doy)},di.isoWeeksInYear=function(){return Ut(this.year(),1,4)},di.date=ai,di.day=di.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e,i,n=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(e=t,i=this.localeData(),t="string"!=typeof e?e:isNaN(e)?"number"==typeof(e=i.weekdaysParse(e))?e:null:parseInt(e,10),this.add(t-n,"d")):n},di.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")},di.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=(i=t,n=this.localeData(),"string"==typeof i?n.weekdaysParse(i)%7||7:isNaN(i)?null:i);return this.day(this.day()%7?e:e-7)}return this.day()||7;var i,n},di.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")},di.hour=di.hours=ne,di.minute=di.minutes=ri,di.second=di.seconds=si,di.millisecond=di.milliseconds=ui,di.utcOffset=function(t,e,i){var n,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=ze(st,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(n=Ve(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),r!==t&&(!e||this._changeInProgress?Xe(this,Ue(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Ve(this)},di.utc=function(t){return this.utcOffset(0,t)},di.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ve(this),"m")),this},di.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=ze(ot,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},di.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Te(t).utcOffset():0,(this.utcOffset()-t)%60==0)},di.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},di.isLocal=function(){return!!this.isValid()&&!this._isUTC},di.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},di.isUtc=Be,di.isUTC=Be,di.zoneAbbr=function(){return this._isUTC?"UTC":""},di.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},di.dates=D("dates accessor is deprecated. Use date instead.",ai),di.months=D("months accessor is deprecated. Use month instead",Yt),di.years=D("years accessor is deprecated. Use year instead",Pt),di.zone=D("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()})),di.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(y(t,this),(t=Ce(t))._a){var e=t._isUTC?f(t._a):Te(t._a);this._isDSTShifted=this.isValid()&&M(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var ci=A.prototype;function fi(t,e,i,n){var a=he(),r=f().set(n,e);return a[i](r,t)}function gi(t,e,i){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return fi(t,e,i,"month");var n,a=[];for(n=0;n<12;n++)a[n]=fi(t,n,i,"month");return a}function mi(t,e,i,n){"boolean"==typeof t?(l(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,l(e)&&(i=e,e=void 0),e=e||"");var a,r=he(),o=t?r._week.dow:0;if(null!=i)return fi(e,(i+o)%7,n,"day");var s=[];for(a=0;a<7;a++)s[a]=fi(e,(a+o)%7,n,"day");return s}ci.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return O(n)?n.call(e,i):n},ci.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])},ci.invalidDate=function(){return this._invalidDate},ci.ordinal=function(t){return this._ordinal.replace("%d",t)},ci.preparse=hi,ci.postformat=hi,ci.relativeTime=function(t,e,i,n){var a=this._relativeTime[i];return O(a)?a(t,e,i,n):a.replace(/%d/i,t)},ci.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return O(i)?i(e):i.replace(/%s/i,e)},ci.set=function(t){var e,i;for(i in t)O(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)},ci.months=function(t,e){return t?r(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Ft).test(e)?"format":"standalone"][t.month()]:r(this._months)?this._months:this._months.standalone},ci.monthsShort=function(t,e){return t?r(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Ft.test(e)?"format":"standalone"][t.month()]:r(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},ci.monthsParse=function(t,e,i){var n,a,r;if(this._monthsParseExact)return function(t,e,i){var n,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=f([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(a=Ct.call(this._shortMonthsParse,o))?a:null:-1!==(a=Ct.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=Ct.call(this._shortMonthsParse,o))?a:-1!==(a=Ct.call(this._longMonthsParse,o))?a:null:-1!==(a=Ct.call(this._longMonthsParse,o))?a:-1!==(a=Ct.call(this._shortMonthsParse,o))?a:null}.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(a=f([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[n]=new RegExp(r.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}},ci.monthsRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsStrictRegex:this._monthsRegex):(h(this,"_monthsRegex")||(this._monthsRegex=zt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},ci.monthsShortRegex=function(t){return this._monthsParseExact?(h(this,"_monthsRegex")||Ht.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(h(this,"_monthsShortRegex")||(this._monthsShortRegex=Nt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},ci.week=function(t){return jt(t,this._week.dow,this._week.doy).week},ci.firstDayOfYear=function(){return this._week.doy},ci.firstDayOfWeek=function(){return this._week.dow},ci.weekdays=function(t,e){return t?r(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:r(this._weekdays)?this._weekdays:this._weekdays.standalone},ci.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},ci.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},ci.weekdaysParse=function(t,e,i){var n,a,r;if(this._weekdaysParseExact)return function(t,e,i){var n,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=f([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(a=Ct.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Ct.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Ct.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=Ct.call(this._weekdaysParse,o))?a:-1!==(a=Ct.call(this._shortWeekdaysParse,o))?a:-1!==(a=Ct.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=Ct.call(this._shortWeekdaysParse,o))?a:-1!==(a=Ct.call(this._weekdaysParse,o))?a:-1!==(a=Ct.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Ct.call(this._minWeekdaysParse,o))?a:-1!==(a=Ct.call(this._weekdaysParse,o))?a:-1!==(a=Ct.call(this._shortWeekdaysParse,o))?a:null}.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(a=f([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[n]=new RegExp(r.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}},ci.weekdaysRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||$t.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(h(this,"_weekdaysRegex")||(this._weekdaysRegex=Xt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},ci.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||$t.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(h(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Jt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},ci.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(h(this,"_weekdaysRegex")||$t.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(h(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Kt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},ci.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},ci.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},ue("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===w(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),a.lang=D("moment.lang is deprecated. Use moment.locale instead.",ue),a.langData=D("moment.langData is deprecated. Use moment.localeData instead.",he);var pi=Math.abs;function vi(t,e,i,n){var a=Ue(e,i);return t._milliseconds+=n*a._milliseconds,t._days+=n*a._days,t._months+=n*a._months,t._bubble()}function yi(t){return t<0?Math.floor(t):Math.ceil(t)}function bi(t){return 4800*t/146097}function xi(t){return 146097*t/4800}function _i(t){return function(){return this.as(t)}}var ki=_i("ms"),wi=_i("s"),Mi=_i("m"),Si=_i("h"),Di=_i("d"),Ci=_i("w"),Pi=_i("M"),Ti=_i("y");function Oi(t){return function(){return this.isValid()?this._data[t]:NaN}}var Ii=Oi("milliseconds"),Ai=Oi("seconds"),Fi=Oi("minutes"),Ri=Oi("hours"),Li=Oi("days"),Wi=Oi("months"),Yi=Oi("years");var Ni=Math.round,zi={ss:44,s:45,m:45,h:22,d:26,M:11};var Hi=Math.abs;function Vi(t){return(t>0)-(t<0)||+t}function Bi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=Hi(this._milliseconds)/1e3,n=Hi(this._days),a=Hi(this._months);e=k((t=k(i/60))/60),i%=60,t%=60;var r=k(a/12),o=a%=12,s=n,l=e,u=t,d=i?i.toFixed(3).replace(/\.?0+$/,""):"",h=this.asSeconds();if(!h)return"P0D";var c=h<0?"-":"",f=Vi(this._months)!==Vi(h)?"-":"",g=Vi(this._days)!==Vi(h)?"-":"",m=Vi(this._milliseconds)!==Vi(h)?"-":"";return c+"P"+(r?f+r+"Y":"")+(o?f+o+"M":"")+(s?g+s+"D":"")+(l||u||d?"T":"")+(l?m+l+"H":"")+(u?m+u+"M":"")+(d?m+d+"S":"")}var Ei=Re.prototype;return Ei.isValid=function(){return this._isValid},Ei.abs=function(){var t=this._data;return this._milliseconds=pi(this._milliseconds),this._days=pi(this._days),this._months=pi(this._months),t.milliseconds=pi(t.milliseconds),t.seconds=pi(t.seconds),t.minutes=pi(t.minutes),t.hours=pi(t.hours),t.months=pi(t.months),t.years=pi(t.years),this},Ei.add=function(t,e){return vi(this,t,e,1)},Ei.subtract=function(t,e){return vi(this,t,e,-1)},Ei.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=L(t))||"year"===t)return e=this._days+n/864e5,i=this._months+bi(e),"month"===t?i:i/12;switch(e=this._days+Math.round(xi(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)}},Ei.asMilliseconds=ki,Ei.asSeconds=wi,Ei.asMinutes=Mi,Ei.asHours=Si,Ei.asDays=Di,Ei.asWeeks=Ci,Ei.asMonths=Pi,Ei.asYears=Ti,Ei.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*w(this._months/12):NaN},Ei._bubble=function(){var t,e,i,n,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*yi(xi(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=k(r/1e3),l.seconds=t%60,e=k(t/60),l.minutes=e%60,i=k(e/60),l.hours=i%24,s+=a=k(bi(o+=k(i/24))),o-=yi(xi(a)),n=k(s/12),s%=12,l.days=o,l.months=s,l.years=n,this},Ei.clone=function(){return Ue(this)},Ei.get=function(t){return t=L(t),this.isValid()?this[t+"s"]():NaN},Ei.milliseconds=Ii,Ei.seconds=Ai,Ei.minutes=Fi,Ei.hours=Ri,Ei.days=Li,Ei.weeks=function(){return k(this.days()/7)},Ei.months=Wi,Ei.years=Yi,Ei.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e,i,n,a,r,o,s,l,u,d,h,c=this.localeData(),f=(i=!t,n=c,a=Ue(e=this).abs(),r=Ni(a.as("s")),o=Ni(a.as("m")),s=Ni(a.as("h")),l=Ni(a.as("d")),u=Ni(a.as("M")),d=Ni(a.as("y")),(h=r<=zi.ss&&["s",r]||r<zi.s&&["ss",r]||o<=1&&["m"]||o<zi.m&&["mm",o]||s<=1&&["h"]||s<zi.h&&["hh",s]||l<=1&&["d"]||l<zi.d&&["dd",l]||u<=1&&["M"]||u<zi.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=i,h[3]=+e>0,h[4]=n,function(t,e,i,n,a){return a.relativeTime(e||1,!!i,t,n)}.apply(null,h));return t&&(f=c.pastFuture(+this,f)),c.postformat(f)},Ei.toISOString=Bi,Ei.toString=Bi,Ei.toJSON=Bi,Ei.locale=Qe,Ei.localeData=ei,Ei.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Bi),Ei.lang=ti,j("X",0,0,"unix"),j("x",0,0,"valueOf"),dt("x",rt),dt("X",/[+-]?\d+(\.\d{1,3})?/),gt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),gt("x",(function(t,e,i){i._d=new Date(w(t))})),a.version="2.20.1",i=Te,a.fn=di,a.min=function(){return Ae("isBefore",[].slice.call(arguments,0))},a.max=function(){return Ae("isAfter",[].slice.call(arguments,0))},a.now=function(){return Date.now?Date.now():+new Date},a.utc=f,a.unix=function(t){return Te(1e3*t)},a.months=function(t,e){return gi(t,e,"months")},a.isDate=u,a.locale=ue,a.invalid=p,a.duration=Ue,a.isMoment=_,a.weekdays=function(t,e,i){return mi(t,e,i,"weekdays")},a.parseZone=function(){return Te.apply(null,arguments).parseZone()},a.localeData=he,a.isDuration=Le,a.monthsShort=function(t,e){return gi(t,e,"monthsShort")},a.weekdaysMin=function(t,e,i){return mi(t,e,i,"weekdaysMin")},a.defineLocale=de,a.updateLocale=function(t,e){if(null!=e){var i,n,a=ae;null!=(n=le(t))&&(a=n._config),(i=new A(e=I(a,e))).parentLocale=re[t],re[t]=i,ue(t)}else null!=re[t]&&(null!=re[t].parentLocale?re[t]=re[t].parentLocale:null!=re[t]&&delete re[t]);return re[t]},a.locales=function(){return C(re)},a.weekdaysShort=function(t,e,i){return mi(t,e,i,"weekdaysShort")},a.normalizeUnits=L,a.relativeTimeRounding=function(t){return void 0===t?Ni:"function"==typeof t&&(Ni=t,!0)},a.relativeTimeThreshold=function(t,e){return void 0!==zi[t]&&(void 0===e?zi[t]:(zi[t]=e,"s"===t&&(zi.ss=e-1),!0))},a.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"},a.prototype=di,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},a},"object"==typeof i&&void 0!==e?e.exports=a():n.moment=a()},{}],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.layouts=t(30),n.platform=t(48),n.plugins=t(31),n.Ticks=t(34),t(22)(n),t(23)(n),t(24)(n),t(33)(n),t(32)(n),t(35)(n),t(55)(n),t(53)(n),t(54)(n),t(56)(n),t(57)(n),t(58)(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 a=t(49);for(var r in a)a.hasOwnProperty(r)&&n.plugins.register(a[r]);n.platform.initialize(),e.exports=n,"undefined"!=typeof window&&(window.Chart=n),n.Legend=a.legend._element,n.Title=a.title._element,n.pluginService=n.plugins,n.PluginBase=n.Element.extend({}),n.canvasHelpers=n.helpers.canvas,n.layoutService=n.layouts},{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,34:34,35:35,40:40,45:45,48:48,49:49,53:53,54:54,55:55,56:56,57:57,58:58,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),a=t(40),r=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:a.Rectangle,initialize:function(){var e;t.DatasetController.prototype.initialize.apply(this,arguments),(e=this.getMeta()).stack=this.getDataset().stack,e.bar=!0},update:function(t){var e,i,n=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,i=n.length;e<i;++e)this.updateElement(n[e],e,t)},updateElement:function(t,e,i){var n=this,a=n.chart,o=n.getMeta(),s=n.getDataset(),l=t.custom||{},u=a.options.elements.rectangle;t._xScale=n.getScaleForId(o.xAxisID),t._yScale=n.getScaleForId(o.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={datasetLabel:s.label,label:a.data.labels[e],borderSkipped:l.borderSkipped?l.borderSkipped:u.borderSkipped,backgroundColor:l.backgroundColor?l.backgroundColor:r.valueAtIndexOrDefault(s.backgroundColor,e,u.backgroundColor),borderColor:l.borderColor?l.borderColor:r.valueAtIndexOrDefault(s.borderColor,e,u.borderColor),borderWidth:l.borderWidth?l.borderWidth:r.valueAtIndexOrDefault(s.borderWidth,e,u.borderWidth)},n.updateElementGeometry(t,e,i),t.pivot()},updateElementGeometry:function(t,e,i){var n=this,a=t._model,r=n.getValueScale(),o=r.getBasePixel(),s=r.isHorizontal(),l=n._ruler||n.getRuler(),u=n.calculateBarValuePixels(n.index,e),d=n.calculateBarIndexPixels(n.index,e,l);a.horizontal=s,a.base=i?o:u.base,a.x=s?i?o:u.head:d.center,a.y=s?d.center:i?o:u.head,a.height=s?d.size:void 0,a.width=s?void 0:d.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())},_getStacks:function(t){var e,i,n=this.chart,a=this.getIndexScale().options.stacked,r=void 0===t?n.data.datasets.length:t+1,o=[];for(e=0;e<r;++e)(i=n.getDatasetMeta(e)).bar&&n.isDatasetVisible(e)&&(!1===a||!0===a&&-1===o.indexOf(i.stack)||void 0===a&&(void 0===i.stack||-1===o.indexOf(i.stack)))&&o.push(i.stack);return o},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var i=this._getStacks(t),n=void 0!==e?i.indexOf(e):-1;return-1===n?i.length-1:n},getRuler:function(){var t,e,i=this.getIndexScale(),n=this.getStackCount(),a=this.index,o=i.isHorizontal(),s=o?i.left:i.top,l=s+(o?i.width:i.height),u=[];for(t=0,e=this.getMeta().data.length;t<e;++t)u.push(i.getPixelForValue(null,t,a));return{min:r.isNullOrUndef(i.options.barThickness)?function(t,e){var i,n,a,r,o=t.isHorizontal()?t.width:t.height,s=t.getTicks();for(a=1,r=e.length;a<r;++a)o=Math.min(o,e[a]-e[a-1]);for(a=0,r=s.length;a<r;++a)n=t.getPixelForTick(a),o=a>0?Math.min(o,n-i):o,i=n;return o}(i,u):-1,pixels:u,start:s,end:l,stackCount:n,scale:i}},calculateBarValuePixels:function(t,e){var i,n,a,r,o,s,l=this.chart,u=this.getMeta(),d=this.getValueScale(),h=l.data.datasets,c=d.getRightValue(h[t].data[e]),f=d.options.stacked,g=u.stack,m=0;if(f||void 0===f&&void 0!==g)for(i=0;i<t;++i)(n=l.getDatasetMeta(i)).bar&&n.stack===g&&n.controller.getValueScaleId()===d.id&&l.isDatasetVisible(i)&&(a=d.getRightValue(h[i].data[e]),(c<0&&a<0||c>=0&&a>0)&&(m+=a));return r=d.getPixelForValue(m),{size:s=((o=d.getPixelForValue(m+c))-r)/2,base:r,head:o,center:o+s/2}},calculateBarIndexPixels:function(t,e,i){var n,a,o,s,l,u,d,h,c,f,g,m,p,v,y,b,x,_=i.scale.options,k="flex"===_.barThickness?(c=e,g=_,p=(f=i).pixels,v=p[c],y=c>0?p[c-1]:null,b=c<p.length-1?p[c+1]:null,x=g.categoryPercentage,null===y&&(y=v-(null===b?f.end-v:b-v)),null===b&&(b=v+v-y),m=v-(v-y)/2*x,{chunk:(b-y)/2*x/f.stackCount,ratio:g.barPercentage,start:m}):(n=e,a=i,u=(o=_).barThickness,d=a.stackCount,h=a.pixels[n],r.isNullOrUndef(u)?(s=a.min*o.categoryPercentage,l=o.barPercentage):(s=u*d,l=1),{chunk:s/d,ratio:l,start:h-s/2}),w=this.getStackIndex(t,this.getMeta().stack),M=k.start+k.chunk*w+k.chunk/2,S=Math.min(r.valueOrDefault(_.maxBarThickness,1/0),k.chunk*k.ratio);return{base:M-S/2,head:M+S/2,center:M,size:S}},draw:function(){var t=this.chart,e=this.getValueScale(),i=this.getMeta().data,n=this.getDataset(),a=i.length,o=0;for(r.canvas.clipArea(t.ctx,t.chartArea);o<a;++o)isNaN(e.getRightValue(n.data[o]))||i[o].draw();r.canvas.unclipArea(t.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model;a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:r.valueAtIndexOrDefault(e.hoverBackgroundColor,i,r.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:r.valueAtIndexOrDefault(e.hoverBorderColor,i,r.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:r.valueAtIndexOrDefault(e.hoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model,o=this.chart.options.elements.rectangle;a.backgroundColor=n.backgroundColor?n.backgroundColor:r.valueAtIndexOrDefault(e.backgroundColor,i,o.backgroundColor),a.borderColor=n.borderColor?n.borderColor:r.valueAtIndexOrDefault(e.borderColor,i,o.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:r.valueAtIndexOrDefault(e.borderWidth,i,o.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),a=t(40),r=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:a.Point,update:function(t){var e=this,i=e.getMeta().data;r.each(i,(function(i,n){e.updateElement(i,n,t)}))},updateElement:function(t,e,i){var n=this,a=n.getMeta(),r=t.custom||{},o=n.getScaleForId(a.xAxisID),s=n.getScaleForId(a.yAxisID),l=n._resolveElementOptions(t,e),u=n.getDataset().data[e],d=n.index,h=i?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=i?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,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:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options;e.backgroundColor=r.valueOrDefault(i.hoverBackgroundColor,r.getHoverColor(i.backgroundColor)),e.borderColor=r.valueOrDefault(i.hoverBorderColor,r.getHoverColor(i.borderColor)),e.borderWidth=r.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,a,o=this.chart,s=o.data.datasets[this.index],l=t.custom||{},u=o.options.elements.point,d=r.options.resolve,h=s.data[e],c={},f={chart:o,dataIndex:e,dataset:s,datasetIndex:this.index},g=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(i=0,n=g.length;i<n;++i)c[a=g[i]]=d([l[a],s[a],u[a]],f,e);return c.radius=d([l.radius,h?h.r:void 0,s.radius,u.radius],f,e),c}})}},{25:25,40:40,45:45}],17:[function(t,e,i){"use strict";var n=t(25),a=t(40),r=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,a=i.labels;if(n.length)for(var r=0;r<n[0].data.length;++r)e.push('<li><span style="background-color:'+n[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),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 a=t.getDatasetMeta(0),o=e.datasets[0],s=a.data[n],l=s&&s.custom||{},u=r.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:i,fillStyle:l.backgroundColor?l.backgroundColor:u(o.backgroundColor,n,d.backgroundColor),strokeStyle:l.borderColor?l.borderColor:u(o.borderColor,n,d.borderColor),lineWidth:l.borderWidth?l.borderWidth:u(o.borderWidth,n,d.borderWidth),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}})):[]}},onClick:function(t,e){var i,n,a,r=e.index,o=this.chart;for(i=0,n=(o.data.datasets||[]).length;i<n;++i)(a=o.getDatasetMeta(i)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.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 r.isArray(i)?(i=i.slice())[0]+=n:i+=n,i}}}}),n._set("pie",r.clone(n.doughnut)),n._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:r.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,a=i.options,o=a.elements.arc,s=n.right-n.left-o.borderWidth,l=n.bottom-n.top-o.borderWidth,u=Math.min(s,l),d={x:0,y:0},h=e.getMeta(),c=a.cutoutPercentage,f=a.circumference;if(f<2*Math.PI){var g=a.rotation%(2*Math.PI),m=(g+=2*Math.PI*(g>=Math.PI?-1:g<-Math.PI?1:0))+f,p=Math.cos(g),v=Math.sin(g),y=Math.cos(m),b=Math.sin(m),x=g<=0&&m>=0||g<=2*Math.PI&&2*Math.PI<=m,_=g<=.5*Math.PI&&.5*Math.PI<=m||g<=2.5*Math.PI&&2.5*Math.PI<=m,k=g<=-Math.PI&&-Math.PI<=m||g<=Math.PI&&Math.PI<=m,w=g<=.5*-Math.PI&&.5*-Math.PI<=m||g<=1.5*Math.PI&&1.5*Math.PI<=m,M=c/100,S=k?-1:Math.min(p*(p<0?1:M),y*(y<0?1:M)),D=w?-1:Math.min(v*(v<0?1:M),b*(b<0?1:M)),C=x?1:Math.max(p*(p>0?1:M),y*(y>0?1:M)),P=_?1:Math.max(v*(v>0?1:M),b*(b>0?1:M)),T=.5*(C-S),O=.5*(P-D);u=Math.min(s/T,l/O),d={x:-.5*(C+S),y:-.5*(P+D)}}i.borderWidth=e.getMaxBorderWidth(h.data),i.outerRadius=Math.max((u-i.borderWidth)/2,0),i.innerRadius=Math.max(c?i.outerRadius/100*c:0,0),i.radiusLength=(i.outerRadius-i.innerRadius)/i.getVisibleDatasetCount(),i.offsetX=d.x*i.outerRadius,i.offsetY=d.y*i.outerRadius,h.total=e.calculateTotal(),e.outerRadius=i.outerRadius-i.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-i.radiusLength,0),r.each(h.data,(function(i,n){e.updateElement(i,n,t)}))},updateElement:function(t,e,i){var n=this,a=n.chart,o=a.chartArea,s=a.options,l=s.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,h=s.rotation,c=s.rotation,f=n.getDataset(),g=i&&l.animateRotate?0:t.hidden?0:n.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),m=i&&l.animateScale?0:n.innerRadius,p=i&&l.animateScale?0:n.outerRadius,v=r.valueAtIndexOrDefault;r.extend(t,{_datasetIndex:n.index,_index:e,_model:{x:u+a.offsetX,y:d+a.offsetY,startAngle:h,endAngle:c,circumference:g,outerRadius:p,innerRadius:m,label:v(f.label,e,a.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 r.each(i.data,(function(i,a){t=e.data[a],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*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){for(var e,i,n=0,a=this.index,r=t.length,o=0;o<r;o++)e=t[o]._model?t[o]._model.borderWidth:0,n=(i=t[o]._chart?t[o]._chart.config.data.datasets[a].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),a=t(40),r=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 r.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var i,n,a,o=this,s=o.getMeta(),l=s.dataset,u=s.data||[],d=o.chart.options,h=d.elements.line,c=o.getScaleForId(s.yAxisID),f=o.getDataset(),g=e(f,d);for(g&&(a=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=c,l._datasetIndex=o.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:a.tension?a.tension:r.valueOrDefault(f.lineTension,h.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||h.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||h.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||h.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||h.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||h.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||h.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||h.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:h.fill,steppedLine:a.steppedLine?a.steppedLine:r.valueOrDefault(f.steppedLine,h.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:r.valueOrDefault(f.cubicInterpolationMode,h.cubicInterpolationMode)},l.pivot()),i=0,n=u.length;i<n;++i)o.updateElement(u[i],i,t);for(g&&0!==l._model.tension&&o.updateBezierControlPoints(),i=0,n=u.length;i<n;++i)u[i].pivot()},getPointBackgroundColor:function(t,e){var i=this.chart.options.elements.point.backgroundColor,n=this.getDataset(),a=t.custom||{};return a.backgroundColor?i=a.backgroundColor:n.pointBackgroundColor?i=r.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(),a=t.custom||{};return a.borderColor?i=a.borderColor:n.pointBorderColor?i=r.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(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(n.pointBorderWidth)||r.isArray(n.pointBorderWidth)?i=r.valueAtIndexOrDefault(n.pointBorderWidth,e,i):isNaN(n.borderWidth)||(i=n.borderWidth):i=a.borderWidth,i},updateElement:function(t,e,i){var n,a,o=this,s=o.getMeta(),l=t.custom||{},u=o.getDataset(),d=o.index,h=u.data[e],c=o.getScaleForId(s.yAxisID),f=o.getScaleForId(s.xAxisID),g=o.chart.options.elements.point;void 0!==u.radius&&void 0===u.pointRadius&&(u.pointRadius=u.radius),void 0!==u.hitRadius&&void 0===u.pointHitRadius&&(u.pointHitRadius=u.hitRadius),n=f.getPixelForValue("object"==typeof h?h:NaN,e,d),a=i?c.getBasePixel():o.calculatePointY(h,e,d),t._xScale=f,t._yScale=c,t._datasetIndex=d,t._index=e,t._model={x:n,y:a,skip:l.skip||isNaN(n)||isNaN(a),radius:l.radius||r.valueAtIndexOrDefault(u.pointRadius,e,g.radius),pointStyle:l.pointStyle||r.valueAtIndexOrDefault(u.pointStyle,e,g.pointStyle),backgroundColor:o.getPointBackgroundColor(t,e),borderColor:o.getPointBorderColor(t,e),borderWidth:o.getPointBorderWidth(t,e),tension:s.dataset._model?s.dataset._model.tension:0,steppedLine:!!s.dataset._model&&s.dataset._model.steppedLine,hitRadius:l.hitRadius||r.valueAtIndexOrDefault(u.pointHitRadius,e,g.hitRadius)}},calculatePointY:function(t,e,i){var n,a,r,o=this.chart,s=this.getMeta(),l=this.getScaleForId(s.yAxisID),u=0,d=0;if(l.options.stacked){for(n=0;n<i;n++)if(a=o.data.datasets[n],"line"===(r=o.getDatasetMeta(n)).type&&r.yAxisID===l.id&&o.isDatasetVisible(n)){var h=Number(l.getRightValue(a.data[e]));h<0?d+=h||0:u+=h||0}var c=Number(l.getRightValue(t));return c<0?l.getPixelForValue(d+c):l.getPixelForValue(u+c)}return l.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,i,n,a=this.getMeta(),o=this.chart.chartArea,s=a.data||[];function l(t,e,i){return Math.max(Math.min(t,i),e)}if(a.dataset._model.spanGaps&&(s=s.filter((function(t){return!t._model.skip}))),"monotone"===a.dataset._model.cubicInterpolationMode)r.splineCurveMonotone(s);else for(t=0,e=s.length;t<e;++t)i=s[t]._model,n=r.splineCurve(r.previousItem(s,t)._model,i,r.nextItem(s,t)._model,a.dataset._model.tension),i.controlPointPreviousX=n.previous.x,i.controlPointPreviousY=n.previous.y,i.controlPointNextX=n.next.x,i.controlPointNextY=n.next.y;if(this.chart.options.elements.line.capBezierPoints)for(t=0,e=s.length;t<e;++t)(i=s[t]._model).controlPointPreviousX=l(i.controlPointPreviousX,o.left,o.right),i.controlPointPreviousY=l(i.controlPointPreviousY,o.top,o.bottom),i.controlPointNextX=l(i.controlPointNextX,o.left,o.right),i.controlPointNextY=l(i.controlPointNextY,o.top,o.bottom)},draw:function(){var t=this.chart,i=this.getMeta(),n=i.data||[],a=t.chartArea,o=n.length,s=0;for(r.canvas.clipArea(t.ctx,a),e(this.getDataset(),t.options)&&i.dataset.draw(),r.canvas.unclipArea(t.ctx);s<o;++s)n[s].draw(a)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},a=t._model;a.radius=n.hoverRadius||r.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor||r.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,r.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor||r.valueAtIndexOrDefault(e.pointHoverBorderColor,i,r.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth||r.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this,i=e.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},o=t._model;void 0!==i.radius&&void 0===i.pointRadius&&(i.pointRadius=i.radius),o.radius=a.radius||r.valueAtIndexOrDefault(i.pointRadius,n,e.chart.options.elements.point.radius),o.backgroundColor=e.getPointBackgroundColor(t,n),o.borderColor=e.getPointBorderColor(t,n),o.borderWidth=e.getPointBorderWidth(t,n)}})}},{25:25,40:40,45:45}],19:[function(t,e,i){"use strict";var n=t(25),a=t(40),r=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,a=i.labels;if(n.length)for(var r=0;r<n[0].data.length;++r)e.push('<li><span style="background-color:'+n[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),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 a=t.getDatasetMeta(0),o=e.datasets[0],s=a.data[n].custom||{},l=r.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:i,fillStyle:s.backgroundColor?s.backgroundColor:l(o.backgroundColor,n,u.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(o.borderColor,n,u.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(o.borderWidth,n,u.borderWidth),hidden:isNaN(o.data[n])||a.data[n].hidden,index:n}})):[]}},onClick:function(t,e){var i,n,a,r=e.index,o=this.chart;for(i=0,n=(o.data.datasets||[]).length;i<n;++i)(a=o.getDatasetMeta(i)).data[r].hidden=!a.data[r].hidden;o.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:a.Arc,linkScales:r.noop,update:function(t){var e=this,i=e.chart,n=i.chartArea,a=e.getMeta(),o=i.options,s=o.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(o.cutoutPercentage?i.outerRadius/100*o.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,a.count=e.countVisibleElements(),r.each(a.data,(function(i,n){e.updateElement(i,n,t)}))},updateElement:function(t,e,i){for(var n=this,a=n.chart,o=n.getDataset(),s=a.options,l=s.animation,u=a.scale,d=a.data.labels,h=n.calculateCircumference(o.data[e]),c=u.xCenter,f=u.yCenter,g=0,m=n.getMeta(),p=0;p<e;++p)isNaN(o.data[p])||m.data[p].hidden||++g;var v=s.startAngle,y=t.hidden?0:u.getDistanceFromCenterForValue(o.data[e]),b=v+h*g,x=b+(t.hidden?0:h),_=l.animateScale?0:u.getDistanceFromCenterForValue(o.data[e]);r.extend(t,{_datasetIndex:n.index,_index:e,_scale:u,_model:{x:c,y:f,innerRadius:0,outerRadius:i?_:y,startAngle:i&&l.animateRotate?v:b,endAngle:i&&l.animateRotate?v:x,label:r.valueAtIndexOrDefault(d,e,d[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 r.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),a=t(40),r=t(45);n._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:r.noop,update:function(t){var e=this,i=e.getMeta(),n=i.dataset,a=i.data,o=n.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,u=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),r.extend(i.dataset,{_datasetIndex:e.index,_scale:u,_children:a,_loop:!0,_model:{tension:o.tension?o.tension:r.valueOrDefault(s.lineTension,l.tension),backgroundColor:o.backgroundColor?o.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:s.borderWidth||l.borderWidth,borderColor:o.borderColor?o.borderColor:s.borderColor||l.borderColor,fill:o.fill?o.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:o.borderCapStyle?o.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:o.borderDash?o.borderDash:s.borderDash||l.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),i.dataset.pivot(),r.each(a,(function(i,n){e.updateElement(i,n,t)}),e),e.updateBezierControlPoints()},updateElement:function(t,e,i){var n=this,a=t.custom||{},o=n.getDataset(),s=n.chart.scale,l=n.chart.options.elements.point,u=s.getPointPositionForValue(e,o.data[e]);void 0!==o.radius&&void 0===o.pointRadius&&(o.pointRadius=o.radius),void 0!==o.hitRadius&&void 0===o.pointHitRadius&&(o.pointHitRadius=o.hitRadius),r.extend(t,{_datasetIndex:n.index,_index:e,_scale:s,_model:{x:i?s.xCenter:u.x,y:i?s.yCenter:u.y,tension:a.tension?a.tension:r.valueOrDefault(o.lineTension,n.chart.options.elements.line.tension),radius:a.radius?a.radius:r.valueAtIndexOrDefault(o.pointRadius,e,l.radius),backgroundColor:a.backgroundColor?a.backgroundColor:r.valueAtIndexOrDefault(o.pointBackgroundColor,e,l.backgroundColor),borderColor:a.borderColor?a.borderColor:r.valueAtIndexOrDefault(o.pointBorderColor,e,l.borderColor),borderWidth:a.borderWidth?a.borderWidth:r.valueAtIndexOrDefault(o.pointBorderWidth,e,l.borderWidth),pointStyle:a.pointStyle?a.pointStyle:r.valueAtIndexOrDefault(o.pointStyle,e,l.pointStyle),hitRadius:a.hitRadius?a.hitRadius:r.valueAtIndexOrDefault(o.pointHitRadius,e,l.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();r.each(e.data,(function(i,n){var a=i._model,o=r.splineCurve(r.previousItem(e.data,n,!0)._model,a,r.nextItem(e.data,n,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(o.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(o.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(o.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(o.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,a=t._model;a.radius=i.hoverRadius?i.hoverRadius:r.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),a.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:r.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,r.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor?i.hoverBorderColor:r.valueAtIndexOrDefault(e.pointHoverBorderColor,n,r.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:r.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t.custom||{},n=t._index,a=t._model,o=this.chart.options.elements.point;a.radius=i.radius?i.radius:r.valueAtIndexOrDefault(e.pointRadius,n,o.radius),a.backgroundColor=i.backgroundColor?i.backgroundColor:r.valueAtIndexOrDefault(e.pointBackgroundColor,n,o.backgroundColor),a.borderColor=i.borderColor?i.borderColor:r.valueAtIndexOrDefault(e.pointBorderColor,n,o.borderColor),a.borderWidth=i.borderWidth?i.borderWidth:r.valueAtIndexOrDefault(e.pointBorderWidth,n,o.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),a=t(26),r=t(45);n._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:r.noop,onComplete:r.noop}}),e.exports=function(t){t.Animation=a.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 a,r,o=this.animations;for(e.chart=t,n||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=r.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=r.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,a=0;a<n.length;)i=(e=n[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),r.callback(e.render,[i,e],i),r.callback(e.onAnimationProgress,[e],i),e.currentStep>=e.numSteps?(r.callback(e.onAnimationComplete,[e],i),i.animating=!1,n.splice(a,1)):++a}},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),a=t(45),r=t(28),o=t(30),s=t(48),l=t(31);e.exports=function(t){function e(t){return"top"===t||"bottom"===t}t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(e,i){var r,o,l=this;(o=(r=(r=i)||{}).data=r.data||{}).datasets=o.datasets||[],o.labels=o.labels||[],r.options=a.configMerge(n.global,n[r.type],r.options||{}),i=r;var u=s.acquireContext(e,i),d=u&&u.canvas,h=d&&d.height,c=d&&d.width;l.id=a.uid(),l.ctx=u,l.canvas=d,l.config=i,l.width=c,l.height=h,l.aspectRatio=h?c/h:null,l.options=i.options,l._bufferedRender=!1,l.chart=l,l.controller=l,t.instances[l.id]=l,Object.defineProperty(l,"data",{get:function(){return l.config.data},set:function(t){l.config.data=t}}),u&&d?(l.initialize(),l.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"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.initToolTip(),l.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,r=i.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(a.getMaximumWidth(n))),s=Math.max(0,Math.floor(r?o/r:a.getMaximumHeight(n)));if((e.width!==o||e.height!==s)&&(n.width=e.width=o,n.height=e.height=s,n.style.width=o+"px",n.style.height=s+"px",a.retinaScale(e,i.devicePixelRatio),!t)){var u={width:o,height:s};l.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;a.each(e.xAxes,(function(t,e){t.id=t.id||"x-axis-"+e})),a.each(e.yAxes,(function(t,e){t.id=t.id||"y-axis-"+e})),i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var i=this,n=i.options,r=i.scales||{},o=[],s=Object.keys(r).reduce((function(t,e){return t[e]=!1,t}),{});n.scales&&(o=o.concat((n.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(n.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),n.scale&&o.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(o,(function(n){var o=n.options,l=o.id,u=a.valueOrDefault(o.type,n.dtype);e(o.position)!==e(n.dposition)&&(o.position=n.dposition),s[l]=!0;var d=null;if(l in r&&r[l].type===u)(d=r[l]).options=o,d.ctx=i.ctx,d.chart=i;else{var h=t.scaleService.getScaleConstructor(u);if(!h)return;d=new h({id:l,type:u,options:o,ctx:i.ctx,chart:i}),r[d.id]=d}d.mergeTicksOptions(),n.isDefault&&(i.scale=d)})),a.each(s,(function(t,e){t||delete r[e]})),i.scales=r,t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,i=[],n=[];return a.each(e.data.datasets,(function(a,r){var o=e.getDatasetMeta(r),s=a.type||e.config.type;if(o.type&&o.type!==s&&(e.destroyDatasetMeta(r),o=e.getDatasetMeta(r)),o.type=s,i.push(o.type),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{var l=t.controllers[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(e,r),n.push(o.controller)}}),e),n},resetElements:function(){var t=this;a.each(t.data.datasets,(function(e,i){t.getDatasetMeta(i).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var i,n,r=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),n=(i=r).options,a.each(i.scales,(function(t){o.removeBox(i,t)})),n=a.configMerge(t.defaults.global,t.defaults[i.config.type],n),i.options=i.config.options=n,i.ensureScalesHaveIDs(),i.buildOrUpdateScales(),i.tooltip._options=n.tooltips,i.tooltip.initialize(),l._invalidate(r),!1!==l.notify(r,"beforeUpdate")){r.tooltip._data=r.data;var s=r.buildOrUpdateControllers();a.each(r.data.datasets,(function(t,e){r.getDatasetMeta(e).controller.buildOrUpdateElements()}),r),r.updateLayout(),r.options.animation&&r.options.animation.duration&&a.each(s,(function(t){t.reset()})),r.updateDatasets(),r.tooltip.initialize(),r.lastActive=[],l.notify(r,"afterUpdate"),r._bufferedRender?r._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:r.render(e)}},updateLayout:function(){!1!==l.notify(this,"beforeLayout")&&(o.update(this,this.width,this.height),l.notify(this,"afterScaleUpdate"),l.notify(this,"afterLayout"))},updateDatasets:function(){if(!1!==l.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);l.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),i={meta:e,index:t};!1!==l.notify(this,"beforeDatasetUpdate",[i])&&(e.controller.update(),l.notify(this,"afterDatasetUpdate",[i]))},render:function(e){var i=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=e.duration,r=e.lazy;if(!1!==l.notify(i,"beforeRender")){var o=i.options.animation,s=function(t){l.notify(i,"afterRender"),a.callback(o&&o.onComplete,[t],i)};if(o&&(void 0!==n&&0!==n||void 0===n&&0!==o.duration)){var u=new t.Animation({numSteps:(n||o.duration)/16.66,easing:e.easing||o.easing,render:function(t,e){var i=a.easing.effects[e.easing],n=e.currentStep,r=n/e.numSteps;t.draw(i(r),r,n)},onAnimationProgress:o.onProgress,onAnimationComplete:s});t.animationService.addAnimation(i,u,n,r)}else i.draw(),s(new t.Animation({numSteps:0,chart:i}));return i}},draw:function(t){var e=this;e.clear(),a.isNullOrUndef(t)&&(t=1),e.transition(t),!1!==l.notify(e,"beforeDraw",[t])&&(a.each(e.boxes,(function(t){t.draw(e.chartArea)}),e),e.scale&&e.scale.draw(),e.drawDatasets(t),e._drawTooltip(t),l.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=0,i=(this.data.datasets||[]).length;e<i;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.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.getDatasetMeta(t),n={meta:i,index:t,easingValue:e};!1!==l.notify(this,"beforeDatasetDraw",[n])&&(i.controller.draw(e),l.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,i={tooltip:e,easingValue:t};!1!==l.notify(this,"beforeTooltipDraw",[i])&&(e.draw(),l.notify(this,"afterTooltipDraw",[i]))},getElementAtEvent:function(t){return r.modes.single(this,t)},getElementsAtEvent:function(t){return r.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return r.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=r.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return r.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var i=e._meta[this.id];return i||(i=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},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,r=n.canvas;for(n.stop(),e=0,i=n.data.datasets.length;e<i;++e)n.destroyDatasetMeta(e);r&&(n.unbindEvents(),a.canvas.clear(n),s.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)};a.each(t.options.events,(function(n){s.addEventListener(t,n,i),e[n]=i})),t.options.responsive&&(i=function(){t.resize()},s.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,a.each(e,(function(e,i){s.removeEventListener(t,i,e)})))},updateHoverStyle:function(t,e,i){var n,a,r,o=i?"setHoverStyle":"removeHoverStyle";for(a=0,r=t.length;a<r;++a)(n=t[a])&&this.getDatasetMeta(n._datasetIndex).controller[o](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);i&&(n=i._start?i.handleEvent(t):n|i.handleEvent(t)),l.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):n&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,i=this,n=i.options||{},r=n.hover;return i.lastActive=i.lastActive||[],"mouseout"===t.type?i.active=[]:i.active=i.getElementsAtEventForMode(t,r.mode,r),a.callback(n.onHover||n.hover.onHover,[t.native,i.active],i),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(i,t.native,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,r.mode,!1),i.active.length&&r.mode&&i.updateHoverStyle(i.active,r.mode,!0),e=!a.arrayEquals(i.active,i.lastActive),i.lastActive=i.active,e}}),t.Controller=t}},{25:25,28:28,30:30,31:31,45:45,48:48}],24:[function(t,e,i){"use strict";var n=t(45);e.exports=function(t){var e=["push","pop","shift","splice","unshift"];function i(t,i){var n=t._chartjs;if(n){var a=n.listeners,r=a.indexOf(i);-1!==r&&a.splice(r,1),a.length>0||(e.forEach((function(e){delete t[e]})),delete t._chartjs)}}t.DatasetController=function(t,e){this.initialize(t,e)},n.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){this.chart=t,this.index=e,this.linkScales(),this.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null!==e.xAxisID&&e.xAxisID in t.chart.scales||(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in t.chart.scales||(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&i(this._data,this)},createMetaDataset:function(){var t=this.datasetElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(t){var e=this.dataElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index,_index:t})},addElements:function(){var t,e,i=this.getMeta(),n=this.getDataset().data||[],a=i.data;for(t=0,e=n.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);i.dataset=i.dataset||this.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,a,r=this,o=r.getDataset(),s=o.data||(o.data=[]);r._data!==s&&(r._data&&i(r._data,r),a=r,(t=s)._chartjs?t._chartjs.listeners.push(a):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[a]}}),e.forEach((function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),r=a.apply(this,e);return n.each(t._chartjs.listeners,(function(t){"function"==typeof t[i]&&t[i].apply(t,e)})),r}})}))),r._data=s),r.resyncElements()},update:n.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,a=0;a<n;++a)i[a].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],a=t._index,r=t.custom||{},o=n.valueAtIndexOrDefault,s=t._model;s.backgroundColor=r.backgroundColor?r.backgroundColor:o(i.backgroundColor,a,e.backgroundColor),s.borderColor=r.borderColor?r.borderColor:o(i.borderColor,a,e.borderColor),s.borderWidth=r.borderWidth?r.borderWidth:o(i.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},r=n.valueAtIndexOrDefault,o=n.getHoverColor,s=t._model;s.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:r(e.hoverBackgroundColor,i,o(s.backgroundColor)),s.borderColor=a.hoverBorderColor?a.hoverBorderColor:r(e.hoverBorderColor,i,o(s.borderColor)),s.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:r(e.hoverBorderWidth,i,s.borderWidth)},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,i=t.data.length,n=e.length;n<i?t.data.splice(n,i-n):n>i&&this.insertElements(i,n-i)},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";var n=t(2),a=t(45);var r=function(t){a.extend(this,t),this.initialize.apply(this,arguments)};a.extend(r.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=a.clone(t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,a=e._start,r=e._view;return i&&1!==t?(r||(r=e._view={}),a||(a=e._start={}),function(t,e,i,a){var r,o,s,l,u,d,h,c,f,g=Object.keys(i);for(r=0,o=g.length;r<o;++r)if(d=i[s=g[r]],e.hasOwnProperty(s)||(e[s]=d),(l=e[s])!==d&&"_"!==s[0]){if(t.hasOwnProperty(s)||(t[s]=l),(h=typeof d)==typeof(u=t[s]))if("string"===h){if((c=n(u)).valid&&(f=n(d)).valid){e[s]=f.mix(c,a).rgbString();continue}}else if("number"===h&&isFinite(u)&&isFinite(d)){e[s]=u+(d-u)*a;continue}e[s]=d}}(a,r,i,t),e):(e._view=i,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return a.isNumber(this._model.x)&&a.isNumber(this._model.y)}}),r.extend=a.inherits,e.exports=r},{2:2,45:45}],27:[function(t,e,i){"use strict";var n=t(2),a=t(25),r=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 null!=t&&"none"!==t}function o(t,n,a){var r=document.defaultView,o=t.parentNode,s=r.getComputedStyle(t)[n],l=r.getComputedStyle(o)[n],u=i(s),d=i(l),h=Number.POSITIVE_INFINITY;return u||d?Math.min(u?e(s,t,a):h,d?e(l,o,a):h):"none"}r.configMerge=function(){return r.merge(r.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,i,n,a){var o=i[e]||{},s=n[e];"scales"===e?i[e]=r.scaleMerge(o,s):"scale"===e?i[e]=r.merge(o,[t.scaleService.getScaleDefaults(s.type),s]):r._merger(e,i,n,a)}})},r.scaleMerge=function(){return r.merge(r.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,i,n,a){if("xAxes"===e||"yAxes"===e){var o,s,l,u=n[e].length;for(i[e]||(i[e]=[]),o=0;o<u;++o)l=n[e][o],s=r.valueOrDefault(l.type,"xAxes"===e?"category":"linear"),o>=i[e].length&&i[e].push({}),!i[e][o].type||l.type&&l.type!==i[e][o].type?r.merge(i[e][o],[t.scaleService.getScaleDefaults(s),l]):r.merge(i[e][o],l)}else r._merger(e,i,n,a)}})},r.where=function(t,e){if(r.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return r.each(t,(function(t){e(t)&&i.push(t)})),i},r.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,a=t.length;n<a;++n)if(e.call(i,t[n],n,t))return n;return-1},r.findNextWhere=function(t,e,i){r.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var a=t[n];if(e(a))return a}},r.findPreviousWhere=function(t,e,i){r.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var a=t[n];if(e(a))return a}},r.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},r.almostEquals=function(t,e,i){return Math.abs(t-e)<i},r.almostWhole=function(t,e){var i=Math.round(t);return i-e<t&&i+e>t},r.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},r.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},r.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},r.log10=Math.log10?function(t){return Math.log10(t)}:function(t){var e=Math.log(t)*Math.LOG10E,i=Math.round(e);return t===Math.pow(10,i)?i:e},r.toRadians=function(t){return t*(Math.PI/180)},r.toDegrees=function(t){return t*(180/Math.PI)},r.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),r=Math.atan2(n,i);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},r.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},r.aliasPixel=function(t){return t%2==0?0:.5},r.splineCurve=function(t,e,i,n){var a=t.skip?e:t,r=e,o=i.skip?e:i,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),h=n*(u=isNaN(u)?0:u),c=n*(d=isNaN(d)?0:d);return{previous:{x:r.x-h*(o.x-a.x),y:r.y-h*(o.y-a.y)},next:{x:r.x+c*(o.x-a.x),y:r.y+c*(o.y-a.y)}}},r.EPSILON=Number.EPSILON||1e-14,r.splineCurveMonotone=function(t){var e,i,n,a,o,s,l,u,d,h=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),c=h.length;for(e=0;e<c;++e)if(!(n=h[e]).model.skip){if(i=e>0?h[e-1]:null,(a=e<c-1?h[e+1]:null)&&!a.model.skip){var f=a.model.x-n.model.x;n.deltaK=0!==f?(a.model.y-n.model.y)/f:0}!i||i.model.skip?n.mK=n.deltaK:!a||a.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}for(e=0;e<c-1;++e)n=h[e],a=h[e+1],n.model.skip||a.model.skip||(r.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(o=n.mK/n.deltaK,s=a.mK/n.deltaK,(u=Math.pow(o,2)+Math.pow(s,2))<=9||(l=3/Math.sqrt(u),n.mK=o*l*n.deltaK,a.mK=s*l*n.deltaK)));for(e=0;e<c;++e)(n=h[e]).model.skip||(i=e>0?h[e-1]:null,a=e<c-1?h[e+1]:null,i&&!i.model.skip&&(d=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-d,n.model.controlPointPreviousY=n.model.y-d*n.mK),a&&!a.model.skip&&(d=(a.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+d,n.model.controlPointNextY=n.model.y+d*n.mK))},r.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]},r.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},r.niceNum=function(t,e){var i=Math.floor(r.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)},r.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)},r.getRelativePosition=function(t,e){var i,n,a=t.originalEvent||t,o=t.currentTarget||t.srcElement,s=o.getBoundingClientRect(),l=a.touches;l&&l.length>0?(i=l[0].clientX,n=l[0].clientY):(i=a.clientX,n=a.clientY);var u=parseFloat(r.getStyle(o,"padding-left")),d=parseFloat(r.getStyle(o,"padding-top")),h=parseFloat(r.getStyle(o,"padding-right")),c=parseFloat(r.getStyle(o,"padding-bottom")),f=s.right-s.left-u-h,g=s.bottom-s.top-d-c;return{x:i=Math.round((i-s.left-u)/f*o.width/e.currentDevicePixelRatio),y:n=Math.round((n-s.top-d)/g*o.height/e.currentDevicePixelRatio)}},r.getConstraintWidth=function(t){return o(t,"max-width","clientWidth")},r.getConstraintHeight=function(t){return o(t,"max-height","clientHeight")},r.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var i=parseInt(r.getStyle(e,"padding-left"),10),n=parseInt(r.getStyle(e,"padding-right"),10),a=e.clientWidth-i-n,o=r.getConstraintWidth(t);return isNaN(o)?a:Math.min(a,o)},r.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var i=parseInt(r.getStyle(e,"padding-top"),10),n=parseInt(r.getStyle(e,"padding-bottom"),10),a=e.clientHeight-i-n,o=r.getConstraintHeight(t);return isNaN(o)?a:Math.min(a,o)},r.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},r.retinaScale=function(t,e){var i=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==i){var n=t.canvas,a=t.height,r=t.width;n.height=a*i,n.width=r*i,t.ctx.scale(i,i),n.style.height||n.style.width||(n.style.height=a+"px",n.style.width=r+"px")}},r.fontString=function(t,e,i){return e+" "+t+"px "+i},r.longestText=function(t,e,i,n){var a=(n=n||{}).data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},o=n.garbageCollect=[],n.font=e),t.font=e;var s=0;r.each(i,(function(e){null!=e&&!0!==r.isArray(e)?s=r.measureText(t,a,o,s,e):r.isArray(e)&&r.each(e,(function(e){null==e||r.isArray(e)||(s=r.measureText(t,a,o,s,e))}))}));var l=o.length/2;if(l>i.length){for(var u=0;u<l;u++)delete a[o[u]];o.splice(0,l)}return s},r.measureText=function(t,e,i,n,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,i.push(a)),r>n&&(n=r),n},r.numberOfLabelLines=function(t){var e=1;return r.each(t,(function(t){r.isArray(t)&&t.length>e&&(e=t.length)})),e},r.color=n?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),n(t)}:function(t){return console.error("Color.js not found!"),t},r.getHoverColor=function(t){return t instanceof CanvasPattern?t:r.color(t).saturate(.5).darken(.1).rgbString()}}},{2:2,25:25,45:45}],28:[function(t,e,i){"use strict";var n=t(45);function a(t,e){return t.native?{x:t.x,y:t.y}:n.getRelativePosition(t,e)}function r(t,e){var i,n,a,r,o;for(n=0,r=t.data.datasets.length;n<r;++n)if(t.isDatasetVisible(n))for(a=0,o=(i=t.getDatasetMeta(n)).data.length;a<o;++a){var s=i.data[a];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 s(t,e,i,n){var a=Number.POSITIVE_INFINITY,o=[];return r(t,(function(t){if(!i||t.inRange(e.x,e.y)){var r=t.getCenterPoint(),s=n(e,r);s<a?(o=[t],a=s):s===a&&o.push(t)}})),o}function l(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var a=e?Math.abs(t.x-n.x):0,r=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function u(t,e,i){var n=a(e,t);i.axis=i.axis||"x";var r=l(i.axis),u=i.intersect?o(t,n):s(t,n,!1,r),d=[];return u.length?(t.data.datasets.forEach((function(e,i){if(t.isDatasetVisible(i)){var n=t.getDatasetMeta(i).data[u[0]._index];n&&!n._view.skip&&d.push(n)}})),d):[]}e.exports={modes:{single:function(t,e){var i=a(e,t),n=[];return r(t,(function(t){if(t.inRange(i.x,i.y))return n.push(t),n})),n.slice(0,1)},label:u,index:u,dataset:function(t,e,i){var n=a(e,t);i.axis=i.axis||"xy";var r=l(i.axis),u=i.intersect?o(t,n):s(t,n,!1,r);return u.length>0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return u(t,e,{intersect:!1})},point:function(t,e){return o(t,a(e,t))},nearest:function(t,e,i){var n=a(e,t);i.axis=i.axis||"xy";var r=l(i.axis),o=s(t,n,i.intersect,r);return o.length>1&&o.sort((function(t,e){var i=t.getArea()-e.getArea();return 0===i&&(i=t._datasetIndex-e._datasetIndex),i})),o.slice(0,1)},x:function(t,e,i){var n=a(e,t),o=[],s=!1;return r(t,(function(t){t.inXRange(n.x)&&o.push(t),t.inRange(n.x,n.y)&&(s=!0)})),i.intersect&&!s&&(o=[]),o},y:function(t,e,i){var n=a(e,t),o=[],s=!1;return r(t,(function(t){t.inYRange(n.y)&&o.push(t),t.inRange(n.x,n.y)&&(s=!0)})),i.intersect&&!s&&(o=[]),o}}}},{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);function a(t,e){return n.where(t,(function(t){return t.position===e}))}function r(t,e){t.forEach((function(t,e){return t._tmpIndex_=e,t})),t.sort((function(t,i){var n=e?i:t,a=e?t:i;return n.weight===a.weight?n._tmpIndex_-a._tmpIndex_:n.weight-a.weight})),t.forEach((function(t){delete t._tmpIndex_}))}e.exports={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var n,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)n=a[o],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,e,i){if(t){var o=t.options.layout||{},s=n.options.toPadding(o.padding),l=s.left,u=s.right,d=s.top,h=s.bottom,c=a(t.boxes,"left"),f=a(t.boxes,"right"),g=a(t.boxes,"top"),m=a(t.boxes,"bottom"),p=a(t.boxes,"chartArea");r(c,!0),r(f,!1),r(g,!0),r(m,!1);var v=e-l-u,y=i-d-h,b=y/2,x=(e-v/2)/(c.length+f.length),_=(i-b)/(g.length+m.length),k=v,w=y,M=[];n.each(c.concat(f,g,m),(function(t){var e,i=t.isHorizontal();i?(e=t.update(t.fullWidth?v:k,_),w-=e.height):(e=t.update(x,w),k-=e.width),M.push({horizontal:i,minSize:e,box:t})}));var S=0,D=0,C=0,P=0;n.each(g.concat(m),(function(t){if(t.getPadding){var e=t.getPadding();S=Math.max(S,e.left),D=Math.max(D,e.right)}})),n.each(c.concat(f),(function(t){if(t.getPadding){var e=t.getPadding();C=Math.max(C,e.top),P=Math.max(P,e.bottom)}}));var T=l,O=u,I=d,A=h;n.each(c.concat(f),z),n.each(c,(function(t){T+=t.width})),n.each(f,(function(t){O+=t.width})),n.each(g.concat(m),z),n.each(g,(function(t){I+=t.height})),n.each(m,(function(t){A+=t.height})),n.each(c.concat(f),(function(t){var e=n.findNextWhere(M,(function(e){return e.box===t})),i={left:0,right:0,top:I,bottom:A};e&&t.update(e.minSize.width,w,i)})),T=l,O=u,I=d,A=h,n.each(c,(function(t){T+=t.width})),n.each(f,(function(t){O+=t.width})),n.each(g,(function(t){I+=t.height})),n.each(m,(function(t){A+=t.height}));var F=Math.max(S-T,0);T+=F,O+=Math.max(D-O,0);var R=Math.max(C-I,0);I+=R,A+=Math.max(P-A,0);var L=i-I-A,W=e-T-O;W===k&&L===w||(n.each(c,(function(t){t.height=L})),n.each(f,(function(t){t.height=L})),n.each(g,(function(t){t.fullWidth||(t.width=W)})),n.each(m,(function(t){t.fullWidth||(t.width=W)})),w=L,k=W);var Y=l+F,N=d+R;n.each(c.concat(g),H),Y+=k,N+=w,n.each(f,H),n.each(m,H),t.chartArea={left:T,top:I,right:T+k,bottom:I+w},n.each(p,(function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(k,w)}))}function z(t){var e=n.findNextWhere(M,(function(e){return e.box===t}));if(e)if(t.isHorizontal()){var i={left:Math.max(T,S),right:Math.max(O,D),top:0,bottom:0};t.update(t.fullWidth?v:k,y/2,i)}else t.update(e.minSize.width,w)}function H(t){t.isHorizontal()?(t.left=t.fullWidth?l:T,t.right=t.fullWidth?e-u:T+k,t.top=N,t.bottom=N+t.height,N=t.bottom):(t.left=Y,t.right=Y+t.width,t.top=I,t.bottom=I+w,Y=t.right)}}}},{45:45}],31:[function(t,e,i){"use strict";var n=t(25),a=t(45);n._set("global",{plugins:{}}),e.exports={_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,a,r,o,s,l=this.descriptors(t),u=l.length;for(n=0;n<u;++n)if("function"==typeof(s=(r=(a=l[n]).plugin)[e])&&((o=[t].concat(i||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],r=[],o=t&&t.config||{},s=o.options&&o.options.plugins||{};return this._plugins.concat(o.plugins||[]).forEach((function(t){if(-1===i.indexOf(t)){var e=t.id,o=s[e];!1!==o&&(!0===o&&(o=a.clone(n.global.plugins[e])),i.push(t),r.push({plugin:t,options:o||{}}))}})),e.descriptors=r,e.id=this._cacheId,r},_invalidate:function(t){delete t.$plugins}}},{25:25,45:45}],32:[function(t,e,i){"use strict";var n=t(25),a=t(26),r=t(45),o=t(34);function s(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(t[e].label);return n}function l(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}n._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:o.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,i){return r.isArray(e)?r.longestText(t,i,e):t.measureText(e).width}function i(t){var e=r.valueOrDefault,i=n.global,a=e(t.fontSize,i.defaultFontSize),o=e(t.fontStyle,i.defaultFontStyle),s=e(t.fontFamily,i.defaultFontFamily);return{size:a,style:o,family:s,font:r.fontString(a,o,s)}}function o(t){return r.options.toLineHeight(r.valueOrDefault(t.lineHeight,1.2),r.valueOrDefault(t.fontSize,n.global.defaultFontSize))}t.Scale=a.extend({getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;for(var e in!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1}),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(){r.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,a,o,s,l,u,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=r.extend({left:0,right:0,top:0,bottom:0},i),d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),l=d.buildTicks()||[],d.afterBuildTicks(),d.beforeTickToLabelConversion(),o=d.convertTicksToLabels(l)||d.ticks,d.afterTickToLabelConversion(),d.ticks=o,n=0,a=o.length;n<a;++n)s=o[n],(u=l[n])?u.label=s:l.push(u={label:s,major:!1});return d._ticks=l,d.beforeCalculateTickRotation(),d.calculateTickRotation(),d.afterCalculateTickRotation(),d.beforeFit(),d.fit(),d.afterFit(),d.afterUpdate(),d.minSize},afterUpdate:function(){r.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){r.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(){r.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){r.callback(this.options.beforeDataLimits,[this])},determineDataLimits:r.noop,afterDataLimits:function(){r.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){r.callback(this.options.beforeBuildTicks,[this])},buildTicks:r.noop,afterBuildTicks:function(){r.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){r.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){r.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){r.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,n=t.options.ticks,a=s(t._ticks),o=i(n);e.font=o.font;var l=n.minRotation||0;if(a.length&&t.options.display&&t.isHorizontal())for(var u,d=r.longestText(e,o.font,a,t.longestTextCache),h=d,c=t.getPixelForTick(1)-t.getPixelForTick(0)-6;h>c&&l<n.maxRotation;){var f=r.toRadians(l);if(u=Math.cos(f),Math.sin(f)*d>t.maxHeight){l--;break}l++,h=u*d}t.labelRotation=l},afterCalculateTickRotation:function(){r.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){r.callback(this.options.beforeFit,[this])},fit:function(){var t=this,n=t.minSize={width:0,height:0},a=s(t._ticks),l=t.options,u=l.ticks,d=l.scaleLabel,h=l.gridLines,c=l.display,f=t.isHorizontal(),g=i(u),m=l.gridLines.tickMarkLength;if(n.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:c&&h.drawTicks?m:0,n.height=f?c&&h.drawTicks?m:0:t.maxHeight,d.display&&c){var p=o(d)+r.options.toPadding(d.padding).height;f?n.height+=p:n.width+=p}if(u.display&&c){var v=r.longestText(t.ctx,g.font,a,t.longestTextCache),y=r.numberOfLabelLines(a),b=.5*g.size,x=t.options.ticks.padding;if(f){t.longestLabelWidth=v;var _=r.toRadians(t.labelRotation),k=Math.cos(_),w=Math.sin(_)*v+g.size*y+b*(y-1)+b;n.height=Math.min(t.maxHeight,n.height+w+x),t.ctx.font=g.font;var M=e(t.ctx,a[0],g.font),S=e(t.ctx,a[a.length-1],g.font);0!==t.labelRotation?(t.paddingLeft="bottom"===l.position?k*M+3:k*b+3,t.paddingRight="bottom"===l.position?k*b+3:k*S+3):(t.paddingLeft=M/2+3,t.paddingRight=S/2+3)}else u.mirror?v=0:v+=x+b,n.width=Math.min(t.maxWidth,n.width+v),t.paddingTop=g.size/2,t.paddingBottom=g.size/2}t.handleMargins(),t.width=n.width,t.height=n.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(){r.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(r.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:r.noop,getPixelForValue:r.noop,getValueForPixel:r.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),a=n*t+e.paddingLeft;i&&(a+=n/2);var r=e.left+Math.round(a);return r+=e.isFullWidth()?e.margins.left:0}var o=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(o/(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.min,e=this.max;return this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0},_autoSkip:function(t){var e,i,n,a,o=this,s=o.isHorizontal(),l=o.options.ticks.minor,u=t.length,d=r.toRadians(o.labelRotation),h=Math.cos(d),c=o.longestLabelWidth*h,f=[];for(l.maxTicksLimit&&(a=l.maxTicksLimit),s&&(e=!1,(c+l.autoSkipPadding)*u>o.width-(o.paddingLeft+o.paddingRight)&&(e=1+Math.floor((c+l.autoSkipPadding)*u/(o.width-(o.paddingLeft+o.paddingRight)))),a&&u>a&&(e=Math.max(e,Math.floor(u/a)))),i=0;i<u;i++)n=t[i],(e>1&&i%e>0||i%e==0&&i+e>=u)&&i!==u-1&&delete n.label,f.push(n);return f},draw:function(t){var e=this,a=e.options;if(a.display){var s=e.ctx,u=n.global,d=a.ticks.minor,h=a.ticks.major||d,c=a.gridLines,f=a.scaleLabel,g=0!==e.labelRotation,m=e.isHorizontal(),p=d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),v=r.valueOrDefault(d.fontColor,u.defaultFontColor),y=i(d),b=r.valueOrDefault(h.fontColor,u.defaultFontColor),x=i(h),_=c.drawTicks?c.tickMarkLength:0,k=r.valueOrDefault(f.fontColor,u.defaultFontColor),w=i(f),M=r.options.toPadding(f.padding),S=r.toRadians(e.labelRotation),D=[],C=e.options.gridLines.lineWidth,P="right"===a.position?e.right:e.right-C-_,T="right"===a.position?e.right+_:e.right,O="bottom"===a.position?e.top+C:e.bottom-_-C,I="bottom"===a.position?e.top+C+_:e.bottom+C;if(r.each(p,(function(i,n){if(!r.isNullOrUndef(i.label)){var o,s,h,f,v,y,b,x,k,w,M,A,F,R,L=i.label;n===e.zeroLineIndex&&a.offset===c.offsetGridLines?(o=c.zeroLineWidth,s=c.zeroLineColor,h=c.zeroLineBorderDash,f=c.zeroLineBorderDashOffset):(o=r.valueAtIndexOrDefault(c.lineWidth,n),s=r.valueAtIndexOrDefault(c.color,n),h=r.valueOrDefault(c.borderDash,u.borderDash),f=r.valueOrDefault(c.borderDashOffset,u.borderDashOffset));var W="middle",Y="middle",N=d.padding;if(m){var z=_+N;"bottom"===a.position?(Y=g?"middle":"top",W=g?"right":"center",R=e.top+z):(Y=g?"middle":"bottom",W=g?"left":"center",R=e.bottom-z);var H=l(e,n,c.offsetGridLines&&p.length>1);H<e.left&&(s="rgba(0,0,0,0)"),H+=r.aliasPixel(o),F=e.getPixelForTick(n)+d.labelOffset,v=b=k=M=H,y=O,x=I,w=t.top,A=t.bottom+C}else{var V,B="left"===a.position;d.mirror?(W=B?"left":"right",V=N):(W=B?"right":"left",V=_+N),F=B?e.right-V:e.left+V;var E=l(e,n,c.offsetGridLines&&p.length>1);E<e.top&&(s="rgba(0,0,0,0)"),E+=r.aliasPixel(o),R=e.getPixelForTick(n)+d.labelOffset,v=P,b=T,k=t.left,M=t.right+C,y=x=w=A=E}D.push({tx1:v,ty1:y,tx2:b,ty2:x,x1:k,y1:w,x2:M,y2:A,labelX:F,labelY:R,glWidth:o,glColor:s,glBorderDash:h,glBorderDashOffset:f,rotation:-1*S,label:L,major:i.major,textBaseline:Y,textAlign:W})}})),r.each(D,(function(t){if(c.display&&(s.save(),s.lineWidth=t.glWidth,s.strokeStyle=t.glColor,s.setLineDash&&(s.setLineDash(t.glBorderDash),s.lineDashOffset=t.glBorderDashOffset),s.beginPath(),c.drawTicks&&(s.moveTo(t.tx1,t.ty1),s.lineTo(t.tx2,t.ty2)),c.drawOnChartArea&&(s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2)),s.stroke(),s.restore()),d.display){s.save(),s.translate(t.labelX,t.labelY),s.rotate(t.rotation),s.font=t.major?x.font:y.font,s.fillStyle=t.major?b:v,s.textBaseline=t.textBaseline,s.textAlign=t.textAlign;var i=t.label;if(r.isArray(i))for(var n=i.length,a=1.5*y.size,o=e.isHorizontal()?0:-a*(n-1)/2,l=0;l<n;++l)s.fillText(""+i[l],0,o),o+=a;else s.fillText(i,0,0);s.restore()}})),f.display){var A,F,R=0,L=o(f)/2;if(m)A=e.left+(e.right-e.left)/2,F="bottom"===a.position?e.bottom-L-M.bottom:e.top+L+M.top;else{var W="left"===a.position;A=W?e.left+L+M.top:e.right-L-M.top,F=e.top+(e.bottom-e.top)/2,R=W?-.5*Math.PI:.5*Math.PI}s.save(),s.translate(A,F),s.rotate(R),s.textAlign="center",s.textBaseline="middle",s.fillStyle=k,s.font=w.font,s.fillText(f.labelString,0,0),s.restore()}if(c.drawBorder){s.lineWidth=r.valueAtIndexOrDefault(c.lineWidth,0),s.strokeStyle=r.valueAtIndexOrDefault(c.color,0);var Y=e.left,N=e.right+C,z=e.top,H=e.bottom+C,V=r.aliasPixel(s.lineWidth);m?(z=H="top"===a.position?e.bottom:e.top,z+=V,H+=V):(Y=N="left"===a.position?e.right:e.left,Y+=V,N+=V),s.beginPath(),s.moveTo(Y,z),s.lineTo(N,H),s.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,i){"use strict";var n=t(25),a=t(45),r=t(30);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=a.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[n.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=a.extend(this.defaults[t],e))},addScalesToLayout:function(t){a.each(t.scales,(function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,r.addBox(t,e)}))}}}},{25:25,30:30,45:45}],34:[function(t,e,i){"use strict";var n=t(45);e.exports={formatters:{values:function(t){return n.isArray(t)?t:""+t},linear:function(t,e,i){var a=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var r=n.log10(Math.abs(a)),o="";if(0!==t){var s=-1*Math.floor(r);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,i){var a=t/Math.pow(10,Math.floor(n.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===i.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,i){"use strict";var n=t(25),a=t(26),r=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:r.noop,title:function(t,e){var i="",n=e.labels,a=n?n.length:0;if(t.length>0){var r=t[0];r.xLabel?i=r.xLabel:a>0&&r.index<a&&(i=n[r.index])}return i},afterTitle:r.noop,beforeBody:r.noop,beforeLabel:r.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:r.noop,afterBody:r.noop,beforeFooter:r.noop,footer:r.noop,afterFooter:r.noop}}}),e.exports=function(t){function e(t,e){var i=r.color(t);return i.alpha(e*i.alpha()).rgbaString()}function i(t,e){return e&&(r.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function o(t){var e=n.global,i=r.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}}t.Tooltip=a.extend({initialize:function(){this._model=o(this._options),this._lastActive=[]},getTitle:function(){var t=this._options.callbacks,e=t.beforeTitle.apply(this,arguments),n=t.title.apply(this,arguments),a=t.afterTitle.apply(this,arguments),r=[];return r=i(r=i(r=i(r,e),n),a)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return r.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var n=this,a=n._options.callbacks,o=[];return r.each(t,(function(t){var r={before:[],lines:[],after:[]};i(r.before,a.beforeLabel.call(n,t,e)),i(r.lines,a.label.call(n,t,e)),i(r.after,a.afterLabel.call(n,t,e)),o.push(r)})),o},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return r.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this._options.callbacks,e=t.beforeFooter.apply(this,arguments),n=t.footer.apply(this,arguments),a=t.afterFooter.apply(this,arguments),r=[];return r=i(r=i(r=i(r,e),n),a)},update:function(e){var i,n,a,s,l,u,d,h,c,f,g,m,p,v,y,b,x,_,k,w,M=this,S=M._options,D=M._model,C=M._model=o(S),P=M._active,T=M._data,O={xAlign:D.xAlign,yAlign:D.yAlign},I={x:D.x,y:D.y},A={width:D.width,height:D.height},F={x:D.caretX,y:D.caretY};if(P.length){C.opacity=1;var R=[],L=[];F=t.Tooltip.positioners[S.position].call(M,P,M._eventPosition);var W=[];for(i=0,n=P.length;i<n;++i)W.push((b=P[i],x=void 0,_=void 0,void 0,void 0,x=b._xScale,_=b._yScale||b._scale,k=b._index,w=b._datasetIndex,{xLabel:x?x.getLabelForIndex(k,w):"",yLabel:_?_.getLabelForIndex(k,w):"",index:k,datasetIndex:w,x:b._model.x,y:b._model.y}));S.filter&&(W=W.filter((function(t){return S.filter(t,T)}))),S.itemSort&&(W=W.sort((function(t,e){return S.itemSort(t,e,T)}))),r.each(W,(function(t){R.push(S.callbacks.labelColor.call(M,t,M._chart)),L.push(S.callbacks.labelTextColor.call(M,t,M._chart))})),C.title=M.getTitle(W,T),C.beforeBody=M.getBeforeBody(W,T),C.body=M.getBody(W,T),C.afterBody=M.getAfterBody(W,T),C.footer=M.getFooter(W,T),C.x=Math.round(F.x),C.y=Math.round(F.y),C.caretPadding=S.caretPadding,C.labelColors=R,C.labelTextColors=L,C.dataPoints=W,O=function(t,e){var i,n,a,r,o,s=t._model,l=t._chart,u=t._chart.chartArea,d="center",h="center";s.y<e.height?h="top":s.y>l.height-e.height&&(h="bottom");var c=(u.left+u.right)/2,f=(u.top+u.bottom)/2;"center"===h?(i=function(t){return t<=c},n=function(t){return t>c}):(i=function(t){return t<=e.width/2},n=function(t){return t>=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},i(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):n(s.x)&&(d="right",r(s.x)&&(d="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:d,yAlign:g.yAlign?g.yAlign:h}}(this,A=function(t,e){var i=t._chart.ctx,n=2*e.yPadding,a=0,o=e.body,s=o.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,u=e.footer.length,d=e.titleFontSize,h=e.bodyFontSize,c=e.footerFontSize;n+=l*d,n+=l?(l-1)*e.titleSpacing:0,n+=l?e.titleMarginBottom:0,n+=s*h,n+=s?(s-1)*e.bodySpacing:0,n+=u?e.footerMarginTop:0,n+=u*c,n+=u?(u-1)*e.footerSpacing:0;var f=0,g=function(t){a=Math.max(a,i.measureText(t).width+f)};return i.font=r.fontString(d,e._titleFontStyle,e._titleFontFamily),r.each(e.title,g),i.font=r.fontString(h,e._bodyFontStyle,e._bodyFontFamily),r.each(e.beforeBody.concat(e.afterBody),g),f=e.displayColors?h+2:0,r.each(o,(function(t){r.each(t.before,g),r.each(t.lines,g),r.each(t.after,g)})),f=0,i.font=r.fontString(c,e._footerFontStyle,e._footerFontFamily),r.each(e.footer,g),{width:a+=2*e.xPadding,height:n}}(this,C)),a=C,s=A,l=O,u=M._chart,d=a.x,h=a.y,c=a.caretSize,f=a.caretPadding,g=a.cornerRadius,m=l.xAlign,p=l.yAlign,v=c+f,y=g+f,"right"===m?d-=s.width:"center"===m&&((d-=s.width/2)+s.width>u.width&&(d=u.width-s.width),d<0&&(d=0)),"top"===p?h+=v:h-="bottom"===p?s.height+v:s.height/2,"center"===p?"left"===m?d+=v:"right"===m&&(d-=v):"left"===m?d-=y:"right"===m&&(d+=y),I={x:d,y:h}}else C.opacity=0;return C.xAlign=O.xAlign,C.yAlign=O.yAlign,C.x=I.x,C.y=I.y,C.width=A.width,C.height=A.height,C.caretX=F.x,C.caretY=F.y,M._model=C,e&&S.custom&&S.custom.call(M,C),M},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,a=this.getCaretPosition(t,e,n);i.lineTo(a.x1,a.y1),i.lineTo(a.x2,a.y2),i.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,i){var n,a,r,o,s,l,u=i.caretSize,d=i.cornerRadius,h=i.xAlign,c=i.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===c)s=g+p/2,"left"===h?(a=(n=f)-u,r=n,o=s+u,l=s-u):(a=(n=f+m)+u,r=n,o=s-u,l=s+u);else if("left"===h?(n=(a=f+d+u)-u,r=a+u):"right"===h?(n=(a=f+m-d-u)-u,r=a+u):(n=(a=i.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=n,n=v}return{x1:n,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,i,n,a){var o=i.title;if(o.length){n.textAlign=i._titleAlign,n.textBaseline="top";var s,l,u=i.titleFontSize,d=i.titleSpacing;for(n.fillStyle=e(i.titleFontColor,a),n.font=r.fontString(u,i._titleFontStyle,i._titleFontFamily),s=0,l=o.length;s<l;++s)n.fillText(o[s],t.x,t.y),t.y+=u+d,s+1===o.length&&(t.y+=i.titleMarginBottom-d)}},drawBody:function(t,i,n,a){var o=i.bodyFontSize,s=i.bodySpacing,l=i.body;n.textAlign=i._bodyAlign,n.textBaseline="top",n.font=r.fontString(o,i._bodyFontStyle,i._bodyFontFamily);var u=0,d=function(e){n.fillText(e,t.x+u,t.y),t.y+=o+s};n.fillStyle=e(i.bodyFontColor,a),r.each(i.beforeBody,d);var h=i.displayColors;u=h?o+2:0,r.each(l,(function(s,l){var u=e(i.labelTextColors[l],a);n.fillStyle=u,r.each(s.before,d),r.each(s.lines,(function(r){h&&(n.fillStyle=e(i.legendColorBackground,a),n.fillRect(t.x,t.y,o,o),n.lineWidth=1,n.strokeStyle=e(i.labelColors[l].borderColor,a),n.strokeRect(t.x,t.y,o,o),n.fillStyle=e(i.labelColors[l].backgroundColor,a),n.fillRect(t.x+1,t.y+1,o-2,o-2),n.fillStyle=u),d(r)})),r.each(s.after,d)})),u=0,r.each(i.afterBody,d),t.y-=s},drawFooter:function(t,i,n,a){var o=i.footer;o.length&&(t.y+=i.footerMarginTop,n.textAlign=i._footerAlign,n.textBaseline="top",n.fillStyle=e(i.footerFontColor,a),n.font=r.fontString(i.footerFontSize,i._footerFontStyle,i._footerFontFamily),r.each(o,(function(e){n.fillText(e,t.x,t.y),t.y+=i.footerFontSize+i.footerSpacing})))},drawBackground:function(t,i,n,a,r){n.fillStyle=e(i.backgroundColor,r),n.strokeStyle=e(i.borderColor,r),n.lineWidth=i.borderWidth;var o=i.xAlign,s=i.yAlign,l=t.x,u=t.y,d=a.width,h=a.height,c=i.cornerRadius;n.beginPath(),n.moveTo(l+c,u),"top"===s&&this.drawCaret(t,a),n.lineTo(l+d-c,u),n.quadraticCurveTo(l+d,u,l+d,u+c),"center"===s&&"right"===o&&this.drawCaret(t,a),n.lineTo(l+d,u+h-c),n.quadraticCurveTo(l+d,u+h,l+d-c,u+h),"bottom"===s&&this.drawCaret(t,a),n.lineTo(l+c,u+h),n.quadraticCurveTo(l,u+h,l,u+h-c),"center"===s&&"left"===o&&this.drawCaret(t,a),n.lineTo(l,u+c),n.quadraticCurveTo(l,u,l+c,u),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},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(this.drawBackground(n,e,t,i,a),n.x+=e.xPadding,n.y+=e.yPadding,this.drawTitle(n,e,t,a),this.drawBody(n,e,t,a),this.drawFooter(n,e,t,a))}},handleEvent:function(t){var e,i=this,n=i._options;return i._lastActive=i._lastActive||[],"mouseout"===t.type?i._active=[]:i._active=i._chart.getElementsAtEventForMode(t,n.mode,n),(e=!r.arrayEquals(i._active,i._lastActive))&&(i._lastActive=i._active,(n.enabled||n.custom)&&(i._eventPosition={x:t.x,y:t.y},i.update(!0),i.pivot())),e}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,i,n=0,a=0,r=0;for(e=0,i=t.length;e<i;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();n+=s.x,a+=s.y,++r}}return{x:Math.round(n/r),y:Math.round(a/r)}},nearest:function(t,e){var i,n,a,o=e.x,s=e.y,l=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var u=t[i];if(u&&u.hasValue()){var d=u.getCenterPoint(),h=r.distanceBetweenPoints(e,d);h<l&&(l=h,a=u)}}if(a){var c=a.tooltipPosition();o=c.x,s=c.y}return{x:o,y:s}}}}},{25:25,26:26,45:45}],36:[function(t,e,i){"use strict";var n=t(25),a=t(26),r=t(45);n._set("global",{elements:{arc:{backgroundColor:n.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.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=r.getAngleFromPoint(i,{x:t,y:e}),a=n.angle,o=n.distance,s=i.startAngle,l=i.endAngle;l<s;)l+=2*Math.PI;for(;a>l;)a-=2*Math.PI;for(;a<s;)a+=2*Math.PI;var u=a>=s&&a<=l,d=o>=i.innerRadius&&o<=i.outerRadius;return u&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view,i=e.startAngle,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),a=t(26),r=t(45),o=n.global;n._set("global",{elements:{line:{tension:.4,backgroundColor:o.defaultColor,borderWidth:3,borderColor:o.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}}),e.exports=a.extend({draw:function(){var t,e,i,n,a=this._view,s=this._chart.ctx,l=a.spanGaps,u=this._children.slice(),d=o.elements.line,h=-1;for(this._loop&&u.length&&u.push(u[0]),s.save(),s.lineCap=a.borderCapStyle||d.borderCapStyle,s.setLineDash&&s.setLineDash(a.borderDash||d.borderDash),s.lineDashOffset=a.borderDashOffset||d.borderDashOffset,s.lineJoin=a.borderJoinStyle||d.borderJoinStyle,s.lineWidth=a.borderWidth||d.borderWidth,s.strokeStyle=a.borderColor||o.defaultColor,s.beginPath(),h=-1,t=0;t<u.length;++t)e=u[t],i=r.previousItem(u,t),n=e._view,0===t?n.skip||(s.moveTo(n.x,n.y),h=t):(i=-1===h?i:u[h],n.skip||(h!==t-1&&!l||-1===h?s.moveTo(n.x,n.y):r.canvas.lineTo(s,i._view,e._view),h=t));s.stroke(),s.restore()}})},{25:25,26:26,45:45}],38:[function(t,e,i){"use strict";var n=t(25),a=t(26),r=t(45),o=n.global.defaultColor;function s(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}n._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:o,borderColor:o,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}}),e.exports=a.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:s,inXRange:s,inYRange:function(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius},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,a=this._chart.ctx,s=e.pointStyle,l=e.radius,u=e.x,d=e.y,h=r.color,c=0;e.skip||(a.strokeStyle=e.borderColor||o,a.lineWidth=r.valueOrDefault(e.borderWidth,n.global.elements.point.borderWidth),a.fillStyle=e.backgroundColor||o,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?c=(u-i.x)/(t.left-i.x):1.01*t.right<i.x?c=(i.x-u)/(i.x-t.right):i.y<t.top?c=(d-i.y)/(t.top-i.y):1.01*t.bottom<i.y&&(c=(i.y-d)/(i.y-t.bottom)),c=Math.round(100*c)/100,a.strokeStyle=h(a.strokeStyle).alpha(c).rgbString(),a.fillStyle=h(a.fillStyle).alpha(c).rgbString()),r.canvas.drawPoint(a,s,l,u,d))}})},{25:25,26:26,45:45}],39:[function(t,e,i){"use strict";var n=t(25),a=t(26);function r(t){return void 0!==t._view.width}function o(t){var e,i,n,a,o=t._view;if(r(t)){var s=o.width/2;e=o.x-s,i=o.x+s,n=Math.min(o.y,o.base),a=Math.max(o.y,o.base)}else{var l=o.height/2;e=Math.min(o.x,o.base),i=Math.max(o.x,o.base),n=o.y-l,a=o.y+l}return{left:e,top:n,right:i,bottom:a}}n._set("global",{elements:{rectangle:{backgroundColor:n.global.defaultColor,borderColor:n.global.defaultColor,borderSkipped:"bottom",borderWidth:0}}}),e.exports=a.extend({draw:function(){var t,e,i,n,a,r,o,s=this._chart.ctx,l=this._view,u=l.borderWidth;if(l.horizontal?(t=l.base,e=l.x,i=l.y-l.height/2,n=l.y+l.height/2,a=e>t?1:-1,r=1,o=l.borderSkipped||"left"):(t=l.x-l.width/2,e=l.x+l.width/2,i=l.y,a=1,r=(n=l.base)>i?1:-1,o=l.borderSkipped||"bottom"),u){var d=Math.min(Math.abs(t-e),Math.abs(i-n)),h=(u=u>d?d:u)/2,c=t+("left"!==o?h*a:0),f=e+("right"!==o?-h*a:0),g=i+("top"!==o?h*r:0),m=n+("bottom"!==o?-h*r:0);c!==f&&(i=g,n=m),g!==m&&(t=c,e=f)}s.beginPath(),s.fillStyle=l.backgroundColor,s.strokeStyle=l.borderColor,s.lineWidth=u;var p=[[t,n],[t,i],[e,i],[e,n]],v=["bottom","left","top","right"].indexOf(o,0);function y(t){return p[(v+t)%4]}-1===v&&(v=0);var b=y(0);s.moveTo(b[0],b[1]);for(var x=1;x<4;x++)b=y(x),s.lineTo(b[0],b[1]);s.fill(),u&&s.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=!1;if(this._view){var n=o(this);i=t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}return i},inLabelRange:function(t,e){if(!this._view)return!1;var i=o(this);return r(this)?t>=i.left&&t<=i.right:e>=i.top&&e<=i.bottom},inXRange:function(t){var e=o(this);return t>=e.left&&t<=e.right},inYRange:function(t){var e=o(this);return t>=e.top&&t<=e.bottom},getCenterPoint:function(){var t,e,i=this._view;return r(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,a,r){if(r){var o=Math.min(r,n/2),s=Math.min(r,a/2);t.moveTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+s),t.lineTo(e+n,i+a-s),t.quadraticCurveTo(e+n,i+a,e+n-o,i+a),t.lineTo(e+o,i+a),t.quadraticCurveTo(e,i+a,e,i+a-s),t.lineTo(e,i+s),t.quadraticCurveTo(e,i,e+o,i)}else t.rect(e,i,n,a)},drawPoint:function(t,e,i,n,a){var r,o,s,l,u,d;if(!e||"object"!=typeof e||"[object HTMLImageElement]"!==(r=e.toString())&&"[object HTMLCanvasElement]"!==r){if(!(isNaN(i)||i<=0)){switch(e){default:t.beginPath(),t.arc(n,a,i,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),u=(o=3*i/Math.sqrt(3))*Math.sqrt(3)/2,t.moveTo(n-o/2,a+u/3),t.lineTo(n+o/2,a+u/3),t.lineTo(n,a-2*u/3),t.closePath(),t.fill();break;case"rect":d=1/Math.SQRT2*i,t.beginPath(),t.fillRect(n-d,a-d,2*d,2*d),t.strokeRect(n-d,a-d,2*d,2*d);break;case"rectRounded":var h=i/Math.SQRT2,c=n-h,f=a-h,g=Math.SQRT2*i;t.beginPath(),this.roundedRect(t,c,f,g,g,i/2),t.closePath(),t.fill();break;case"rectRot":d=1/Math.SQRT2*i,t.beginPath(),t.moveTo(n-d,a),t.lineTo(n,a+d),t.lineTo(n+d,a),t.lineTo(n,a-d),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(n,a+i),t.lineTo(n,a-i),t.moveTo(n-i,a),t.lineTo(n+i,a),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,a-l),t.lineTo(n+s,a+l),t.moveTo(n-s,a+l),t.lineTo(n+s,a-l),t.closePath();break;case"star":t.beginPath(),t.moveTo(n,a+i),t.lineTo(n,a-i),t.moveTo(n-i,a),t.lineTo(n+i,a),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n-s,a+l),t.lineTo(n+s,a-l),t.closePath();break;case"line":t.beginPath(),t.moveTo(n-i,a),t.lineTo(n+i,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(n,a),t.lineTo(n+i,a),t.closePath()}t.stroke()}}else t.drawImage(e,n-e.width/2,a-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,a={noop:function(){},uid:(n=0,function(){return n++}),isNullOrUndef:function(t){return null==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 a.valueOrDefault(a.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var r,o,s;if(a.isArray(t))if(o=t.length,n)for(r=o-1;r>=0;r--)e.call(i,t[r],r);else for(r=0;r<o;r++)e.call(i,t[r],r);else if(a.isObject(t))for(o=(s=Object.keys(t)).length,r=0;r<o;r++)e.call(i,t[s[r]],s[r])},arrayEquals:function(t,e){var i,n,r,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(r=t[i],o=e[i],r instanceof Array&&o instanceof Array){if(!a.arrayEquals(r,o))return!1}else if(r!==o)return!1;return!0},clone:function(t){if(a.isArray(t))return t.map(a.clone);if(a.isObject(t)){for(var e={},i=Object.keys(t),n=i.length,r=0;r<n;++r)e[i[r]]=a.clone(t[i[r]]);return e}return t},_merger:function(t,e,i,n){var r=e[t],o=i[t];a.isObject(r)&&a.isObject(o)?a.merge(r,o,n):e[t]=a.clone(o)},_mergerIf:function(t,e,i){var n=e[t],r=i[t];a.isObject(n)&&a.isObject(r)?a.mergeIf(n,r):e.hasOwnProperty(t)||(e[t]=a.clone(r))},merge:function(t,e,i){var n,r,o,s,l,u=a.isArray(e)?e:[e],d=u.length;if(!a.isObject(t))return t;for(n=(i=i||{}).merger||a._merger,r=0;r<d;++r)if(e=u[r],a.isObject(e))for(l=0,s=(o=Object.keys(e)).length;l<s;++l)n(o[l],t,e,i);return t},mergeIf:function(t,e){return a.merge(t,e,{merger:a._mergerIf})},extend:function(t){for(var e=function(e,i){t[i]=e},i=1,n=arguments.length;i<n;++i)a.each(arguments[i],e);return t},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=a.inherits,t&&a.extend(i.prototype,t),i.__super__=e.prototype,i}};e.exports=a,a.callCallback=a.callback,a.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},a.getValueOrDefault=a.valueOrDefault,a.getValueAtIndexOrDefault=a.valueAtIndexOrDefault},{}],43:[function(t,e,i){"use strict";var n=t(42),a={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){return t*t*(2.70158*t-1.70158)},easeOutBack:function(t){return(t-=1)*t*(2.70158*t+1.70158)+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-a.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*a.easeInBounce(2*t):.5*a.easeOutBounce(2*t-1)+.5}};e.exports={effects:a},n.easingEffects=a},{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,a,r;return n.isObject(t)?(e=+t.top||0,i=+t.right||0,a=+t.bottom||0,r=+t.left||0):e=i=a=r=+t||0,{top:e,right:i,bottom:a,left:r,height:e+a,width:r+i}},resolve:function(t,e,i){var a,r,o;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e)),void 0!==i&&n.isArray(o)&&(o=o[i]),void 0!==o))return o}}},{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";var n=t(45),a="$chartjs",r="chartjs-",o=r+"render-monitor",s=r+"render-animation",l=["animationstart","webkitAnimationStart"],u={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function d(t,e){var i=n.getStyle(t,e),a=i&&i.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}var h=!!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};function c(t,e,i){t.addEventListener(e,i,h)}function f(t,e,i){t.removeEventListener(e,i,h)}function g(t,e,i,n,a){return{type:t,chart:e,native:a||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function m(t,e,i){var u,d,h,f,m,p,v,y,b=t[a]||(t[a]={}),x=b.resizer=function(t){var e=document.createElement("div"),i=r+"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 a=e.childNodes[0],o=e.childNodes[1];e._reset=function(){a.scrollLeft=1e6,a.scrollTop=1e6,o.scrollLeft=1e6,o.scrollTop=1e6};var s=function(){e._reset(),t()};return c(a,"scroll",s.bind(a,"expand")),c(o,"scroll",s.bind(o,"shrink")),e}((u=function(){if(b.resizer)return e(g("resize",i))},h=!1,f=[],function(){f=Array.prototype.slice.call(arguments),d=d||this,h||(h=!0,n.requestAnimFrame.call(window,(function(){h=!1,u.apply(d,f)})))}));p=function(){if(b.resizer){var e=t.parentNode;e&&e!==x.parentNode&&e.insertBefore(x,e.firstChild),x._reset()}},v=(m=t)[a]||(m[a]={}),y=v.renderProxy=function(t){t.animationName===s&&p()},n.each(l,(function(t){c(m,t,y)})),v.reflow=!!m.offsetParent,m.classList.add(o)}function p(t){var e,i,r,s=t[a]||{},u=s.resizer;delete s.resizer,i=(e=t)[a]||{},(r=i.renderProxy)&&(n.each(l,(function(t){f(e,t,r)})),delete i.renderProxy),e.classList.remove(o),u&&u.parentNode&&u.parentNode.removeChild(u)}e.exports={_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,initialize:function(){var t,e,i,n="from{opacity:0.99}to{opacity:1}";e="@-webkit-keyframes "+s+"{"+n+"}@keyframes "+s+"{"+n+"}."+o+"{-webkit-animation:"+s+" 0.001s;animation:"+s+" 0.001s;}",i=(t=this)._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))},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?(function(t,e){var i=t.style,n=t.getAttribute("height"),r=t.getAttribute("width");if(t[a]={initial:{height:n,width:r,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===r||""===r){var o=d(t,"width");void 0!==o&&(t.width=o)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var s=d(t,"height");void 0!==o&&(t.height=s)}}(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[a]){var i=e[a].initial;["height","width"].forEach((function(t){var a=i[t];n.isNullOrUndef(a)?e.removeAttribute(t):e.setAttribute(t,a)})),n.each(i.style||{},(function(t,i){e.style[i]=t})),e.width=e.width,delete e[a]}},addEventListener:function(t,e,i){var r=t.canvas;if("resize"!==e){var o=i[a]||(i[a]={});c(r,e,(o.proxies||(o.proxies={}))[t.id+"_"+e]=function(e){var a,r,o,s;i((r=t,o=u[(a=e).type]||a.type,s=n.getRelativePosition(a,r),g(o,r,s.x,s.y,a)))})}else m(r,i,t)},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"!==e){var r=((i[a]||{}).proxies||{})[t.id+"_"+e];r&&f(n,e,r)}else p(n)}},n.addEvent=c,n.removeEvent=f},{45:45}],48:[function(t,e,i){"use strict";var n=t(45),a=t(46),r=t(47),o=r._enabled?r:a;e.exports=n.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},o)},{45:45,46:46,47:47}],49:[function(t,e,i){"use strict";e.exports={},e.exports.filler=t(50),e.exports.legend=t(51),e.exports.title=t(52)},{50:50,51:51,52:52}],50:[function(t,e,i){"use strict";var n=t(25),a=t(40),r=t(45);n._set("global",{plugins:{filler:{propagate:!0}}});var o={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),a=n&&i.isDatasetVisible(e)&&n.dataset._children||[],r=a.length||0;return r?function(t,e){return e<r&&a[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}}}};function s(t,e,i){var n,a=t._model||{},r=a.fill;if(void 0===r&&(r=!!a.backgroundColor),!1===r||null===r)return!1;if(!0===r)return"origin";if(n=parseFloat(r,10),isFinite(n)&&Math.floor(n)===n)return"-"!==r[0]&&"+"!==r[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;switch(r){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return r;default:return!1}}function l(t){var e,i=t.el._model||{},n=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===a?r=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?r=i.scaleZero:n.getBasePosition?r=n.getBasePosition():n.getBasePixel&&(r=n.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if("number"==typeof r&&isFinite(r))return{x:(e=n.isHorizontal())?r:null,y:e?null:r}}return null}function u(t,e,i){var n,a=t[e].fill,r=[e];if(!i)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(n=t[a]))return!1;if(n.visible)return a;r.push(a),a=n.fill}return!1}function d(t){return t&&!t.skip}function h(t,e,i,n,a){var o;if(n&&a){for(t.moveTo(e[0].x,e[0].y),o=1;o<n;++o)r.canvas.lineTo(t,e[o-1],e[o]);for(t.lineTo(i[a-1].x,i[a-1].y),o=a-1;o>0;--o)r.canvas.lineTo(t,i[o],i[o-1],!0)}}e.exports={id:"filler",afterDatasetsUpdate:function(t,e){var i,n,r,d,h,c,f,g=(t.data.datasets||[]).length,m=e.propagate,p=[];for(n=0;n<g;++n)d=null,(r=(i=t.getDatasetMeta(n)).dataset)&&r._model&&r instanceof a.Line&&(d={visible:t.isDatasetVisible(n),fill:s(r,n,g),chart:t,el:r}),i.$filler=d,p.push(d);for(n=0;n<g;++n)(d=p[n])&&(d.fill=u(p,n,m),d.boundary=l(d),d.mapper=(void 0,f=void 0,c=(h=d).fill,f="dataset",!1===c?null:(isFinite(c)||(f="boundary"),o[f](h))))},beforeDatasetDraw:function(t,e){var i=e.meta.$filler;if(i){var a=t.ctx,o=i.el,s=o._view,l=o._children||[],u=i.mapper,c=s.backgroundColor||n.global.defaultColor;u&&c&&l.length&&(r.canvas.clipArea(a,t.chartArea),function(t,e,i,n,a,r){var o,s,l,u,c,f,g,m=e.length,p=n.spanGaps,v=[],y=[],b=0,x=0;for(t.beginPath(),o=0,s=m+!!r;o<s;++o)c=i(u=e[l=o%m]._view,l,n),f=d(u),g=d(c),f&&g?(b=v.push(u),x=y.push(c)):b&&x&&(p?(f&&v.push(u),g&&y.push(c)):(h(t,v,y,b,x),b=x=0,v=[],y=[]));h(t,v,y,b,x),t.closePath(),t.fillStyle=a,t.fill()}(a,l,u,s,c,o._loop),r.canvas.unclipArea(a))}}}},{25:25,40:40,45:45}],51:[function(t,e,i){"use strict";var n=t(25),a=t(26),r=t(45),o=t(30),s=r.noop;function l(t,e){return t.usePointStyle?e*Math.SQRT2:t.boxWidth}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,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data;return r.isArray(e.datasets)?e.datasets.map((function(e,i){return{text:e.label,fillStyle:r.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("")}});var u=a.extend({initialize:function(t){r.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=r.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,e=t.options,i=e.labels,a=e.display,o=t.ctx,s=n.global,u=r.valueOrDefault,d=u(i.fontSize,s.defaultFontSize),h=u(i.fontStyle,s.defaultFontStyle),c=u(i.fontFamily,s.defaultFontFamily),f=r.fontString(d,h,c),g=t.legendHitBoxes=[],m=t.minSize,p=t.isHorizontal();if(p?(m.width=t.maxWidth,m.height=a?10:0):(m.width=a?10:0,m.height=t.maxHeight),a)if(o.font=f,p){var v=t.lineWidths=[0],y=t.legendItems.length?d+i.padding:0;o.textAlign="left",o.textBaseline="top",r.each(t.legendItems,(function(e,n){var a=l(i,d)+d/2+o.measureText(e.text).width;v[v.length-1]+a+i.padding>=t.width&&(y+=d+i.padding,v[v.length]=t.left),g[n]={left:0,top:0,width:a,height:d},v[v.length-1]+=a+i.padding})),m.height+=y}else{var b=i.padding,x=t.columnWidths=[],_=i.padding,k=0,w=0,M=d+b;r.each(t.legendItems,(function(t,e){var n=l(i,d)+d/2+o.measureText(t.text).width;w+M>m.height&&(_+=k+i.padding,x.push(k),k=0,w=0),k=Math.max(k,n),w+=M,g[e]={left:0,top:0,width:n,height:d}})),_+=k,x.push(k),m.width+=_}t.width=m.width,t.height=m.height},afterFit:s,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,a=n.global,o=a.elements.line,s=t.width,u=t.lineWidths;if(e.display){var d,h=t.ctx,c=r.valueOrDefault,f=c(i.fontColor,a.defaultFontColor),g=c(i.fontSize,a.defaultFontSize),m=c(i.fontStyle,a.defaultFontStyle),p=c(i.fontFamily,a.defaultFontFamily),v=r.fontString(g,m,p);h.textAlign="left",h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=f,h.fillStyle=f,h.font=v;var y=l(i,g),b=t.legendHitBoxes,x=t.isHorizontal();d=x?{x:t.left+(s-u[0])/2,y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+i.padding,line:0};var _=g+i.padding;r.each(t.legendItems,(function(n,l){var f,m,p,v,k,w=h.measureText(n.text).width,M=y+g/2+w,S=d.x,D=d.y;x?S+M>=s&&(D=d.y+=_,d.line++,S=d.x=t.left+(s-u[d.line])/2):D+_>t.bottom&&(S=d.x=S+t.columnWidths[d.line]+i.padding,D=d.y=t.top+i.padding,d.line++),function(t,i,n){if(!(isNaN(y)||y<=0)){h.save(),h.fillStyle=c(n.fillStyle,a.defaultColor),h.lineCap=c(n.lineCap,o.borderCapStyle),h.lineDashOffset=c(n.lineDashOffset,o.borderDashOffset),h.lineJoin=c(n.lineJoin,o.borderJoinStyle),h.lineWidth=c(n.lineWidth,o.borderWidth),h.strokeStyle=c(n.strokeStyle,a.defaultColor);var s=0===c(n.lineWidth,o.borderWidth);if(h.setLineDash&&h.setLineDash(c(n.lineDash,o.borderDash)),e.labels&&e.labels.usePointStyle){var l=g*Math.SQRT2/2,u=l/Math.SQRT2,d=t+u,f=i+u;r.canvas.drawPoint(h,n.pointStyle,l,d,f)}else s||h.strokeRect(t,i,y,g),h.fillRect(t,i,y,g);h.restore()}}(S,D,n),b[l].left=S,b[l].top=D,f=n,m=w,v=y+(p=g/2)+S,k=D+p,h.fillText(f.text,v,k),f.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(v,k),h.lineTo(v+m,k),h.stroke()),x?d.x+=M+i.padding:d.y+=_}))}},handleEvent:function(t){var e=this,i=e.options,n="mouseup"===t.type?"click":t.type,a=!1;if("mousemove"===n){if(!i.onHover)return}else{if("click"!==n)return;if(!i.onClick)return}var r=t.x,o=t.y;if(r>=e.left&&r<=e.right&&o>=e.top&&o<=e.bottom)for(var s=e.legendHitBoxes,l=0;l<s.length;++l){var u=s[l];if(r>=u.left&&r<=u.left+u.width&&o>=u.top&&o<=u.top+u.height){if("click"===n){i.onClick.call(e,t.native,e.legendItems[l]),a=!0;break}if("mousemove"===n){i.onHover.call(e,t.native,e.legendItems[l]),a=!0;break}}}return a}});function d(t,e){var i=new u({ctx:t.ctx,options:e,chart:t});o.configure(t,i,e),o.addBox(t,i),t.legend=i}e.exports={id:"legend",_element:u,beforeInit:function(t){var e=t.options.legend;e&&d(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(r.mergeIf(e,n.global.legend),i?(o.configure(t,i,e),i.options=e):d(t,e)):i&&(o.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}}},{25:25,26:26,30:30,45:45}],52:[function(t,e,i){"use strict";var n=t(25),a=t(26),r=t(45),o=t(30),s=r.noop;n._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,lineHeight:1.2,padding:10,position:"top",text:"",weight:2e3}});var l=a.extend({initialize:function(t){r.extend(this,t),this.legendHitBoxes=[]},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:s,afterBuildLabels:s,beforeFit:s,fit:function(){var t=r.valueOrDefault,e=this.options,i=e.display,a=t(e.fontSize,n.global.defaultFontSize),o=this.minSize,s=r.isArray(e.text)?e.text.length:1,l=r.options.toLineHeight(e.lineHeight,a),u=i?s*l+2*e.padding:0;this.isHorizontal()?(o.width=this.maxWidth,o.height=u):(o.width=u,o.height=this.maxHeight),this.width=o.width,this.height=o.height},afterFit:s,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this.ctx,e=r.valueOrDefault,i=this.options,a=n.global;if(i.display){var o,s,l,u=e(i.fontSize,a.defaultFontSize),d=e(i.fontStyle,a.defaultFontStyle),h=e(i.fontFamily,a.defaultFontFamily),c=r.fontString(u,d,h),f=r.options.toLineHeight(i.lineHeight,u),g=f/2+i.padding,m=0,p=this.top,v=this.left,y=this.bottom,b=this.right;t.fillStyle=e(i.fontColor,a.defaultFontColor),t.font=c,this.isHorizontal()?(s=v+(b-v)/2,l=p+g,o=b-v):(s="left"===i.position?v+g:b-g,l=p+(y-p)/2,o=y-p,m=Math.PI*("left"===i.position?-.5:.5)),t.save(),t.translate(s,l),t.rotate(m),t.textAlign="center",t.textBaseline="middle";var x=i.text;if(r.isArray(x))for(var _=0,k=0;k<x.length;++k)t.fillText(x[k],0,_,o),_+=f;else t.fillText(x,0,0,o);t.restore()}}});function u(t,e){var i=new l({ctx:t.ctx,options:e,chart:t});o.configure(t,i,e),o.addBox(t,i),t.titleBlock=i}e.exports={id:"title",_element:l,beforeInit:function(t){var e=t.options.title;e&&u(t,e)},beforeUpdate:function(t){var e=t.options.title,i=t.titleBlock;e?(r.mergeIf(e,n.global.title),i?(o.configure(t,i,e),i.options=e):u(t,e)):i&&(o.removeBox(t,i),delete t.titleBlock)}}},{25:25,26:26,30:30,45:45}],53:[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,e=this,i=e.getLabels();e.minIndex=0,e.maxIndex=i.length-1,void 0!==e.options.ticks.min&&(t=i.indexOf(e.options.ticks.min),e.minIndex=-1!==t?t:e.minIndex),void 0!==e.options.ticks.max&&(t=i.indexOf(e.options.ticks.max),e.maxIndex=-1!==t?t:e.maxIndex),e.min=i[e.minIndex],e.max=i[e.maxIndex]},buildTicks:function(){var t=this.getLabels();this.ticks=0===this.minIndex&&this.maxIndex===t.length-1?t:t.slice(this.minIndex,this.maxIndex+1)},getLabelForIndex:function(t,e){var i=this.chart.data,n=this.isHorizontal();return i.yLabels&&!n?this.getRightValue(i.datasets[e].data[t]):this.ticks[t-this.minIndex]},getPixelForValue:function(t,e){var i,n=this,a=n.options.offset,r=Math.max(n.maxIndex+1-n.minIndex-(a?0:1),1);if(null!=t&&(i=n.isHorizontal()?t.x:t.y),void 0!==i||void 0!==t&&isNaN(e)){t=i||t;var o=n.getLabels().indexOf(t);e=-1!==o?o:e}if(n.isHorizontal()){var s=n.width/r,l=s*(e-n.minIndex);return a&&(l+=s/2),n.left+Math.round(l)}var u=n.height/r,d=u*(e-n.minIndex);return a&&(d+=u/2),n.top+Math.round(d)},getPixelForTick:function(t){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null)},getValueForPixel:function(t){var e=this.options.offset,i=Math.max(this._ticks.length-(e?0:1),1),n=this.isHorizontal(),a=(n?this.width:this.height)/i;return t-=n?this.left:this.top,e&&(t-=a/2),(t<=0?0:Math.round(t/a))+this.minIndex},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",e,{position:"bottom"})}},{}],54:[function(t,e,i){"use strict";var n=t(25),a=t(45),r=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:r.formatters.linear}},i=t.LinearScaleBase.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,n=i.data.datasets,r=t.isHorizontal();function o(e){return r?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null;var s=e.stacked;if(void 0===s&&a.each(n,(function(t,e){if(!s){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(s=!0)}})),e.stacked||s){var l={};a.each(n,(function(n,r){var s=i.getDatasetMeta(r),u=[s.type,void 0===e.stacked&&void 0===s.stack?r:"",s.stack].join(".");void 0===l[u]&&(l[u]={positiveValues:[],negativeValues:[]});var d=l[u].positiveValues,h=l[u].negativeValues;i.isDatasetVisible(r)&&o(s)&&a.each(n.data,(function(i,n){var a=+t.getRightValue(i);isNaN(a)||s.data[n].hidden||(d[n]=d[n]||0,h[n]=h[n]||0,e.relativePoints?d[n]=100:a<0?h[n]+=a:d[n]+=a)}))})),a.each(l,(function(e){var i=e.positiveValues.concat(e.negativeValues),n=a.min(i),r=a.max(i);t.min=null===t.min?n:Math.min(t.min,n),t.max=null===t.max?r:Math.max(t.max,r)}))}else a.each(n,(function(e,n){var r=i.getDatasetMeta(n);i.isDatasetVisible(n)&&o(r)&&a.each(e.data,(function(e,i){var n=+t.getRightValue(e);isNaN(n)||r.data[i].hidden||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n))}))}));t.min=isFinite(t.min)&&!isNaN(t.min)?t.min:0,t.max=isFinite(t.max)&&!isNaN(t.max)?t.max:1,this.handleTickRangeOptions()},getTickLimit:function(){var t,e=this.options.ticks;if(this.isHorizontal())t=Math.min(e.maxTicksLimit?e.maxTicksLimit:11,Math.ceil(this.width/50));else{var i=a.valueOrDefault(e.fontSize,n.global.defaultFontSize);t=Math.min(e.maxTicksLimit?e.maxTicksLimit:11,Math.ceil(this.height/(2*i)))}return t},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this.start,i=+this.getRightValue(t),n=this.end-e;return this.isHorizontal()?this.left+this.width/n*(i-e):this.bottom-this.height/n*(i-e)},getValueForPixel:function(t){var e=this.isHorizontal(),i=e?this.width:this.height,n=(e?t-this.left:this.bottom-t)/i;return this.start+(this.end-this.start)*n},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",i,e)}},{25:25,34:34,45:45}],55:[function(t,e,i){"use strict";var n=t(45);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),a=n.sign(t.max);i<0&&a<0?t.max=0:i>0&&a>0&&(t.min=0)}var r=void 0!==e.min||void 0!==e.suggestedMin,o=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)),r!==o&&t.min>=t.max&&(r?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(),a={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,stepSize:n.valueOrDefault(e.fixedStepSize,e.stepSize)},r=t.ticks=function(t,e){var i,a=[];if(t.stepSize&&t.stepSize>0)i=t.stepSize;else{var r=n.niceNum(e.max-e.min,!1);i=n.niceNum(r/(t.maxTicks-1),!0)}var o=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)&&(o=t.min,s=t.max);var l=(s-o)/i;l=n.almostEquals(l,Math.round(l),i/1e3)?Math.round(l):Math.ceil(l);var u=1;i<1&&(u=Math.pow(10,i.toString().length-2),o=Math.round(o*u)/u,s=Math.round(s*u)/u),a.push(void 0!==t.min?t.min:o);for(var d=1;d<l;++d)a.push(Math.round((o+d*i)*u)/u);return a.push(void 0!==t.max?t.max:s),a}(a,t);t.handleDirectionalChanges(),t.max=n.max(r),t.min=n.min(r),e.reverse?(r.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){this.ticksAsNumbers=this.ticks.slice(),this.zeroLineIndex=this.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(this)}})}},{45:45}],56:[function(t,e,i){"use strict";var n=t(45),a=t(34);e.exports=function(t){var e={position:"left",ticks:{callback:a.formatters.logarithmic}},i=t.Scale.extend({determineDataLimits:function(){var t=this,e=t.options,i=t.chart,a=i.data.datasets,r=t.isHorizontal();function o(e){return r?e.xAxisID===t.id:e.yAxisID===t.id}t.min=null,t.max=null,t.minNotZero=null;var s=e.stacked;if(void 0===s&&n.each(a,(function(t,e){if(!s){var n=i.getDatasetMeta(e);i.isDatasetVisible(e)&&o(n)&&void 0!==n.stack&&(s=!0)}})),e.stacked||s){var l={};n.each(a,(function(a,r){var s=i.getDatasetMeta(r),u=[s.type,void 0===e.stacked&&void 0===s.stack?r:"",s.stack].join(".");i.isDatasetVisible(r)&&o(s)&&(void 0===l[u]&&(l[u]=[]),n.each(a.data,(function(e,i){var n=l[u],a=+t.getRightValue(e);isNaN(a)||s.data[i].hidden||a<0||(n[i]=n[i]||0,n[i]+=a)})))})),n.each(l,(function(e){if(e.length>0){var i=n.min(e),a=n.max(e);t.min=null===t.min?i:Math.min(t.min,i),t.max=null===t.max?a:Math.max(t.max,a)}}))}else n.each(a,(function(e,a){var r=i.getDatasetMeta(a);i.isDatasetVisible(a)&&o(r)&&n.each(e.data,(function(e,i){var n=+t.getRightValue(e);isNaN(n)||r.data[i].hidden||n<0||(null===t.min?t.min=n:n<t.min&&(t.min=n),null===t.max?t.max=n:n>t.max&&(t.max=n),0!==n&&(null===t.minNotZero||n<t.minNotZero)&&(t.minNotZero=n))}))}));this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks,i=n.valueOrDefault;t.min=i(e.min,t.min),t.max=i(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(n.log10(t.min))-1),t.max=Math.pow(10,Math.floor(n.log10(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(n.log10(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(n.log10(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(n.log10(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,i=!t.isHorizontal(),a={min:e.min,max:e.max},r=t.ticks=function(t,e){var i,a,r=[],o=n.valueOrDefault,s=o(t.min,Math.pow(10,Math.floor(n.log10(e.min)))),l=Math.floor(n.log10(e.max)),u=Math.ceil(e.max/Math.pow(10,l));0===s?(i=Math.floor(n.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,i)),r.push(s),s=a*Math.pow(10,i)):(i=Math.floor(n.log10(s)),a=Math.floor(s/Math.pow(10,i)));for(var d=i<0?Math.pow(10,Math.abs(i)):1;r.push(s),10==++a&&(a=1,d=++i>=0?1:d),s=Math.round(a*Math.pow(10,i)*d)/d,i<l||i===l&&a<u;);var h=o(t.max,s);return r.push(h),r}(a,t);t.max=n.max(r),t.min=n.min(r),e.reverse?(i=!i,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i&&r.reverse()},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])},_getFirstTickValue:function(t){var e=Math.floor(n.log10(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},getPixelForValue:function(e){var i,a,r,o,s,l=this,u=l.options.ticks.reverse,d=n.log10,h=l._getFirstTickValue(l.minNotZero),c=0;return e=+l.getRightValue(e),u?(r=l.end,o=l.start,s=-1):(r=l.start,o=l.end,s=1),l.isHorizontal()?(i=l.width,a=u?l.right:l.left):(i=l.height,s*=-1,a=u?l.top:l.bottom),e!==r&&(0===r&&(i-=c=n.getValueOrDefault(l.options.ticks.fontSize,t.defaults.global.defaultFontSize),r=h),0!==e&&(c+=i/(d(o)-d(r))*(d(e)-d(r))),a+=s*c),a},getValueForPixel:function(e){var i,a,r,o,s=this,l=s.options.ticks.reverse,u=n.log10,d=s._getFirstTickValue(s.minNotZero);if(l?(a=s.end,r=s.start):(a=s.start,r=s.end),s.isHorizontal()?(i=s.width,o=l?s.right-e:e-s.left):(i=s.height,o=l?e-s.top:s.bottom-e),o!==a){if(0===a){var h=n.getValueOrDefault(s.options.ticks.fontSize,t.defaults.global.defaultFontSize);o-=h,i-=h,a=d}o*=u(r)-u(a),o/=i,o=Math.pow(10,u(a)+o)}return o}});t.scaleService.registerScaleType("logarithmic",i,e)}},{34:34,45:45}],57:[function(t,e,i){"use strict";var n=t(25),a=t(45),r=t(34);e.exports=function(t){var e=n.global,i={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:r.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function o(t){var e=t.options;return e.angleLines.display||e.pointLabels.display?t.chart.data.labels.length:0}function s(t){var i=t.options.pointLabels,n=a.valueOrDefault(i.fontSize,e.defaultFontSize),r=a.valueOrDefault(i.fontStyle,e.defaultFontStyle),o=a.valueOrDefault(i.fontFamily,e.defaultFontFamily);return{size:n,style:r,family:o,font:a.fontString(n,r,o)}}function l(t,e,i,n,a){return t===n||t===a?{start:e-i/2,end:e+i/2}:t<n||t>a?{start:e-i-5,end:e}:{start:e,end:e+i+5}}function u(t,e,i,n){if(a.isArray(e))for(var r=i.y,o=1.5*n,s=0;s<e.length;++s)t.fillText(e[s],i.x,r),r+=o;else t.fillText(e,i.x,i.y)}function d(t){return a.isNumber(t)?t:0}var h=t.LinearScaleBase.extend({setDimensions:function(){var t=this,i=t.options,n=i.ticks;t.width=t.maxWidth,t.height=t.maxHeight,t.xCenter=Math.round(t.width/2),t.yCenter=Math.round(t.height/2);var r=a.min([t.height,t.width]),o=a.valueOrDefault(n.fontSize,e.defaultFontSize);t.drawingArea=i.display?r/2-(o/2+n.backdropPaddingY):r/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;a.each(e.data.datasets,(function(r,o){if(e.isDatasetVisible(o)){var s=e.getDatasetMeta(o);a.each(r.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||s.data[a].hidden||(i=Math.min(r,i),n=Math.max(r,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,i=a.valueOrDefault(t.fontSize,e.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*i)))},convertTicksToLabels:function(){t.LinearScaleBase.prototype.convertTicksToLabels.call(this),this.pointLabels=this.chart.data.labels.map(this.options.pointLabels.callback,this)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t,e;this.options.pointLabels.display?function(t){var e,i,n,r=s(t),u=Math.min(t.height/2,t.width/2),d={r:t.width,l:0,t:t.height,b:0},h={};t.ctx.font=r.font,t._pointLabelSizes=[];var c,f,g,m=o(t);for(e=0;e<m;e++){n=t.getPointPosition(e,u),c=t.ctx,f=r.size,g=t.pointLabels[e]||"",i=a.isArray(g)?{w:a.longestText(c,c.font,g),h:g.length*f+1.5*(g.length-1)*f}:{w:c.measureText(g).width,h:f},t._pointLabelSizes[e]=i;var p=t.getIndexAngle(e),v=a.toDegrees(p)%360,y=l(v,n.x,i.w,0,180),b=l(v,n.y,i.h,90,270);y.start<d.l&&(d.l=y.start,h.l=p),y.end>d.r&&(d.r=y.end,h.r=p),b.start<d.t&&(d.t=b.start,h.t=p),b.end>d.b&&(d.b=b.end,h.b=p)}t.setReductions(u,d,h)}(this):(t=this,e=Math.min(t.height/2,t.width/2),t.drawingArea=Math.round(e),t.setCenterPoint(0,0,0,0))},setReductions:function(t,e,i){var n=e.l/Math.sin(i.l),a=Math.max(e.r-this.width,0)/Math.sin(i.r),r=-e.t/Math.cos(i.t),o=-Math.max(e.b-this.height,0)/Math.cos(i.b);n=d(n),a=d(a),r=d(r),o=d(o),this.drawingArea=Math.min(Math.round(t-(n+a)/2),Math.round(t-(r+o)/2)),this.setCenterPoint(n,a,r,o)},setCenterPoint:function(t,e,i,n){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=i+a.drawingArea,l=a.height-n-a.drawingArea;a.xCenter=Math.round((o+r)/2+a.left),a.yCenter=Math.round((s+l)/2+a.top)},getIndexAngle:function(t){return t*(2*Math.PI/o(this))+(this.chart.options&&this.chart.options.startAngle?this.chart.options.startAngle:0)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){if(null===t)return 0;var e=this.drawingArea/(this.max-this.min);return this.options.ticks.reverse?(this.max-t)*e:(t-this.min)*e},getPointPosition:function(t,e){var i=this.getIndexAngle(t)-Math.PI/2;return{x:Math.round(Math.cos(i)*e)+this.xCenter,y:Math.round(Math.sin(i)*e)+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(){var t=this.min,e=this.max;return this.getPointPositionForValue(0,this.beginAtZero?0:t<0&&e<0?e:t>0&&e>0?t:0)},draw:function(){var t=this,i=t.options,n=i.gridLines,r=i.ticks,l=a.valueOrDefault;if(i.display){var d=t.ctx,h=this.getIndexAngle(0),c=l(r.fontSize,e.defaultFontSize),f=l(r.fontStyle,e.defaultFontStyle),g=l(r.fontFamily,e.defaultFontFamily),m=a.fontString(c,f,g);a.each(t.ticks,(function(i,s){if(s>0||r.reverse){var u=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]);if(n.display&&0!==s&&function(t,e,i,n){var r=t.ctx;if(r.strokeStyle=a.valueAtIndexOrDefault(e.color,n-1),r.lineWidth=a.valueAtIndexOrDefault(e.lineWidth,n-1),t.options.gridLines.circular)r.beginPath(),r.arc(t.xCenter,t.yCenter,i,0,2*Math.PI),r.closePath(),r.stroke();else{var s=o(t);if(0===s)return;r.beginPath();var l=t.getPointPosition(0,i);r.moveTo(l.x,l.y);for(var u=1;u<s;u++)l=t.getPointPosition(u,i),r.lineTo(l.x,l.y);r.closePath(),r.stroke()}}(t,n,u,s),r.display){var f=l(r.fontColor,e.defaultFontColor);if(d.font=m,d.save(),d.translate(t.xCenter,t.yCenter),d.rotate(h),r.showLabelBackdrop){var g=d.measureText(i).width;d.fillStyle=r.backdropColor,d.fillRect(-g/2-r.backdropPaddingX,-u-c/2-r.backdropPaddingY,g+2*r.backdropPaddingX,c+2*r.backdropPaddingY)}d.textAlign="center",d.textBaseline="middle",d.fillStyle=f,d.fillText(i,0,-u),d.restore()}}})),(i.angleLines.display||i.pointLabels.display)&&function(t){var i=t.ctx,n=t.options,r=n.angleLines,l=n.pointLabels;i.lineWidth=r.lineWidth,i.strokeStyle=r.color;var d,h,c,f,g=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),m=s(t);i.textBaseline="top";for(var p=o(t)-1;p>=0;p--){if(r.display){var v=t.getPointPosition(p,g);i.beginPath(),i.moveTo(t.xCenter,t.yCenter),i.lineTo(v.x,v.y),i.stroke(),i.closePath()}if(l.display){var y=t.getPointPosition(p,g+5),b=a.valueAtIndexOrDefault(l.fontColor,p,e.defaultFontColor);i.font=m.font,i.fillStyle=b;var x=t.getIndexAngle(p),_=a.toDegrees(x);i.textAlign=0===(f=_)||180===f?"center":f<180?"left":"right",d=_,h=t._pointLabelSizes[p],c=y,90===d||270===d?c.y-=h.h/2:(d>270||d<90)&&(c.y-=h.h),u(i,t.pointLabels[p]||"",y,m.size)}}}(t)}}});t.scaleService.registerScaleType("radialLinear",h,i)}},{25:25,34:34,45:45}],58:[function(t,e,i){"use strict";var n=t(6);n="function"==typeof n?n:window.moment;var a=t(25),r=t(45),o=Number.MIN_SAFE_INTEGER||-9007199254740991,s=Number.MAX_SAFE_INTEGER||9007199254740991,l={millisecond:{common:!0,size:1,steps:[1,2,5,10,20,50,100,250,500]},second:{common:!0,size:1e3,steps:[1,2,5,10,30]},minute:{common:!0,size:6e4,steps:[1,2,5,10,30]},hour:{common:!0,size:36e5,steps:[1,2,3,6,12]},day:{common:!0,size:864e5,steps:[1,2,5]},week:{common:!1,size:6048e5,steps:[1,2,3,4]},month:{common:!0,size:2628e6,steps:[1,2,3]},quarter:{common:!1,size:7884e6,steps:[1,2,3,4]},year:{common:!0,size:3154e7}},u=Object.keys(l);function d(t,e){return t-e}function h(t){var e,i,n,a={},r=[];for(e=0,i=t.length;e<i;++e)a[n=t[e]]||(a[n]=!0,r.push(n));return r}function c(t,e,i,n){var a=function(t,e,i){for(var n,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(n=o+s>>1)-1]||null,r=t[n],!a)return{lo:null,hi:r};if(r[e]<i)o=n+1;else{if(!(a[e]>i))return{lo:a,hi:r};s=n-1}}return{lo:r,hi:null}}(t,e,i),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(i-r[e])/s:0,u=(o[n]-r[n])*l;return r[n]+u}function f(t,e){var i=e.parser,a=e.parser||e.format;return"function"==typeof i?i(t):"string"==typeof t&&"string"==typeof a?n(t,a):(t instanceof n||(t=n(t)),t.isValid()?t:"function"==typeof a?a(t):t)}function g(t,e){if(r.isNullOrUndef(t))return null;var i=e.options.time,n=f(e.getRightValue(t),i);return n.isValid()?(i.round&&n.startOf(i.round),n.valueOf()):null}function m(t){for(var e=u.indexOf(t)+1,i=u.length;e<i;++e)if(l[u[e]].common)return u[e]}function p(t,e,i,a){var o,d=a.time,h=d.unit||function(t,e,i,n){var a,r,o,d=u.length;for(a=u.indexOf(t);a<d-1;++a)if(o=(r=l[u[a]]).steps?r.steps[r.steps.length-1]:s,r.common&&Math.ceil((i-e)/(o*r.size))<=n)return u[a];return u[d-1]}(d.minUnit,t,e,i),c=m(h),f=r.valueOrDefault(d.stepSize,d.unitStepSize),g="week"===h&&d.isoWeekday,p=a.ticks.major.enabled,v=l[h],y=n(t),b=n(e),x=[];for(f||(f=function(t,e,i,n){var a,r,o,s=e-t,u=l[i],d=u.size,h=u.steps;if(!h)return Math.ceil(s/(n*d));for(a=0,r=h.length;a<r&&(o=h[a],!(Math.ceil(s/(d*o))<=n));++a);return o}(t,e,h,i)),g&&(y=y.isoWeekday(g),b=b.isoWeekday(g)),y=y.startOf(g?"day":h),(b=b.startOf(g?"day":h))<e&&b.add(1,h),o=n(y),p&&c&&!g&&!d.round&&(o.startOf(c),o.add(~~((y-o)/(v.size*f))*f,h));o<b;o.add(f,h))x.push(+o);return x.push(+o),x}e.exports=function(t){var e=t.Scale.extend({initialize:function(){if(!n)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.options;return e.time&&e.time.format&&console.warn("options.time.format is deprecated and replaced by options.time.parser."),t.Scale.prototype.update.apply(this,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,a,l,u,c=this,f=c.chart,m=c.options.time,p=m.unit||"day",v=s,y=o,b=[],x=[],_=[];for(t=0,i=f.data.labels.length;t<i;++t)_.push(g(f.data.labels[t],c));for(t=0,i=(f.data.datasets||[]).length;t<i;++t)if(f.isDatasetVisible(t))if(l=f.data.datasets[t].data,r.isObject(l[0]))for(x[t]=[],e=0,a=l.length;e<a;++e)u=g(l[e],c),b.push(u),x[t][e]=u;else b.push.apply(b,_),x[t]=_.slice(0);else x[t]=[];_.length&&(_=h(_).sort(d),v=Math.min(v,_[0]),y=Math.max(y,_[_.length-1])),b.length&&(b=h(b).sort(d),v=Math.min(v,b[0]),y=Math.max(y,b[b.length-1])),v=g(m.min,c)||v,y=g(m.max,c)||y,v=v===s?+n().startOf(p):v,y=y===o?+n().endOf(p)+1:y,c.min=Math.min(v,y),c.max=Math.max(v+1,y),c._horizontal=c.isHorizontal(),c._table=[],c._timestamps={data:b,datasets:x,labels:_}},buildTicks:function(){var t,e,i,a,r,o,s,d,h,v,y,b,x=this,_=x.min,k=x.max,w=x.options,M=w.time,S=[],D=[];switch(w.ticks.source){case"data":S=x._timestamps.data;break;case"labels":S=x._timestamps.labels;break;case"auto":default:S=p(_,k,x.getLabelCapacity(_),w)}for("ticks"===w.bounds&&S.length&&(_=S[0],k=S[S.length-1]),_=g(M.min,x)||_,k=g(M.max,x)||k,t=0,e=S.length;t<e;++t)(i=S[t])>=_&&i<=k&&D.push(i);return x.min=_,x.max=k,x._unit=M.unit||function(t,e,i,a){var r,o,s=n.duration(n(a).diff(n(i)));for(r=u.length-1;r>=u.indexOf(e);r--)if(o=u[r],l[o].common&&s.as(o)>=t.length)return o;return u[e?u.indexOf(e):0]}(D,M.minUnit,x.min,x.max),x._majorUnit=m(x._unit),x._table=function(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var a,r,o,s,l,u=[],d=[e];for(a=0,r=t.length;a<r;++a)(s=t[a])>e&&s<i&&d.push(s);for(d.push(i),a=0,r=d.length;a<r;++a)l=d[a+1],o=d[a-1],s=d[a],void 0!==o&&void 0!==l&&Math.round((l+o)/2)===s||u.push({time:s,pos:a/(r-1)});return u}(x._timestamps.data,_,k,w.distribution),x._offsets=(a=x._table,r=D,o=_,s=k,y=0,b=0,(d=w).offset&&r.length&&(d.time.min||(h=r.length>1?r[1]:s,v=r[0],y=(c(a,"time",h,"pos")-c(a,"time",v,"pos"))/2),d.time.max||(h=r[r.length-1],v=r.length>1?r[r.length-2]:o,b=(c(a,"time",h,"pos")-c(a,"time",v,"pos"))/2)),{left:y,right:b}),x._labelFormat=function(t,e){var i,n,a,r=t.length;for(i=0;i<r;i++){if(0!==(n=f(t[i],e)).millisecond())return"MMM D, YYYY h:mm:ss.SSS a";0===n.second()&&0===n.minute()&&0===n.hour()||(a=!0)}return a?"MMM D, YYYY h:mm:ss a":"MMM D, YYYY"}(x._timestamps.data,M),function(t,e){var i,a,r,o,s=[];for(i=0,a=t.length;i<a;++i)r=t[i],o=!!e&&r===+n(r).startOf(e),s.push({value:r,major:o});return s}(D,x._majorUnit)},getLabelForIndex:function(t,e){var i=this.chart.data,n=this.options.time,a=i.labels&&t<i.labels.length?i.labels[t]:"",o=i.datasets[e].data[t];return r.isObject(o)&&(a=this.getRightValue(o)),n.tooltipFormat?f(a,n).format(n.tooltipFormat):"string"==typeof a?a:f(a,n).format(this._labelFormat)},tickFormatFunction:function(t,e,i,n){var a=this.options,o=t.valueOf(),s=a.time.displayFormats,l=s[this._unit],u=this._majorUnit,d=s[u],h=t.clone().startOf(u).valueOf(),c=a.ticks.major,f=c.enabled&&u&&d&&o===h,g=t.format(n||(f?d:l)),m=f?c:a.ticks.minor,p=r.valueOrDefault(m.callback,m.userCallback);return p?p(g,e,i):g},convertTicksToLabels:function(t){var e,i,a=[];for(e=0,i=t.length;e<i;++e)a.push(this.tickFormatFunction(n(t[e].value),e,t));return a},getPixelForOffset:function(t){var e=this,i=e._horizontal?e.width:e.height,n=e._horizontal?e.left:e.top,a=c(e._table,"time",t,"pos");return n+i*(e._offsets.left+a)/(e._offsets.left+1+e._offsets.right)},getPixelForValue:function(t,e,i){var n=null;if(void 0!==e&&void 0!==i&&(n=this._timestamps.datasets[i][e]),null===n&&(n=g(t,this)),null!==n)return this.getPixelForOffset(n)},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,a=e._horizontal?e.left:e.top,r=(i?(t-a)/i:0)*(e._offsets.left+1+e._offsets.left)-e._offsets.right,o=c(e._table,"pos",r,"time");return n(o)},getLabelWidth:function(t){var e=this.options.ticks,i=this.ctx.measureText(t).width,n=r.toRadians(e.maxRotation),o=Math.cos(n),s=Math.sin(n);return i*o+r.valueOrDefault(e.fontSize,a.global.defaultFontSize)*s},getLabelCapacity:function(t){var e=this.options.time.displayFormats.millisecond,i=this.tickFormatFunction(n(t),0,[],e),a=this.getLabelWidth(i),r=this.isHorizontal()?this.width:this.height,o=Math.floor(r/a);return o>0?o:1}});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}}})}},{25:25,45:45,6:6}]},{},[7])(7)}));"use strict";function isIterable(obj){if(obj==null){return false}return obj[Symbol.iterator]!==undefined}function FastBitSet(iterable){this.words=[];if(isIterable(iterable)){for(var key of iterable){this.add(key)}}}FastBitSet.prototype.add=function(index){this.resize(index);this.words[index>>>5]|=1<<index};FastBitSet.prototype.flip=function(index){this.resize(index);this.words[index>>>5]^=1<<index};FastBitSet.prototype.clear=function(){this.words=[]};FastBitSet.prototype.remove=function(index){this.resize(index);this.words[index>>>5]&=~(1<<index)};FastBitSet.prototype.isEmpty=function(index){var c=this.words.length;for(var i=0;i<c;i++){if(this.words[i]!==0)return false}return true};FastBitSet.prototype.has=function(index){return(this.words[index>>>5]&1<<index)!==0};FastBitSet.prototype.checkedAdd=function(index){this.resize(index);var word=this.words[index>>>5];var newword=word|1<<index;this.words[index>>>5]=newword;return(newword^word)>>>index};FastBitSet.prototype.trim=function(index){var nl=this.words.length;while(nl>0&&this.words[nl-1]===0){nl--}this.words=this.words.slice(0,nl)};FastBitSet.prototype.resize=function(index){var count=index+32>>>5;for(var i=this.words.length;i<count;i++)this.words[i]=0};FastBitSet.prototype.hammingWeight=function(v){v-=v>>>1&1431655765;v=(v&858993459)+(v>>>2&858993459);return(v+(v>>>4)&252645135)*16843009>>>24};FastBitSet.prototype.hammingWeight4=function(v1,v2,v3,v4){v1-=v1>>>1&1431655765;v2-=v2>>>1&1431655765;v3-=v3>>>1&1431655765;v4-=v4>>>1&1431655765;v1=(v1&858993459)+(v1>>>2&858993459);v2=(v2&858993459)+(v2>>>2&858993459);v3=(v3&858993459)+(v3>>>2&858993459);v4=(v4&858993459)+(v4>>>2&858993459);v1=v1+(v1>>>4)&252645135;v2=v2+(v2>>>4)&252645135;v3=v3+(v3>>>4)&252645135;v4=v4+(v4>>>4)&252645135;return(v1+v2+v3+v4)*16843009>>>24};FastBitSet.prototype.size=function(){var answer=0;var c=this.words.length;var w=this.words;var i=0;for(;i<c;i++){answer+=this.hammingWeight(w[i])}return answer};FastBitSet.prototype.array=function(){var answer=new Array(this.size());var pos=0|0;var c=this.words.length;for(var k=0;k<c;++k){var w=this.words[k];while(w!=0){var t=w&-w;answer[pos++]=(k<<5)+this.hammingWeight(t-1|0);w^=t}}return answer};FastBitSet.prototype.forEach=function(fnc){var c=this.words.length;for(var k=0;k<c;++k){var w=this.words[k];while(w!=0){var t=w&-w;fnc((k<<5)+this.hammingWeight(t-1|0));w^=t}}};FastBitSet.prototype.clone=function(){var clone=Object.create(FastBitSet.prototype);clone.words=this.words.slice();return clone};FastBitSet.prototype.intersects=function(otherbitmap){var newcount=Math.min(this.words.length,otherbitmap.words.length);for(var k=0|0;k<newcount;++k){if((this.words[k]&otherbitmap.words[k])!==0)return true}return false};FastBitSet.prototype.intersection=function(otherbitmap){var newcount=Math.min(this.words.length,otherbitmap.words.length);var k=0|0;for(;k+7<newcount;k+=8){this.words[k]&=otherbitmap.words[k];this.words[k+1]&=otherbitmap.words[k+1];this.words[k+2]&=otherbitmap.words[k+2];this.words[k+3]&=otherbitmap.words[k+3];this.words[k+4]&=otherbitmap.words[k+4];this.words[k+5]&=otherbitmap.words[k+5];this.words[k+6]&=otherbitmap.words[k+6];this.words[k+7]&=otherbitmap.words[k+7]}for(;k<newcount;++k){this.words[k]&=otherbitmap.words[k]}var c=this.words.length;for(var k=newcount;k<c;++k){this.words[k]=0}return this};FastBitSet.prototype.intersection_size=function(otherbitmap){var newcount=Math.min(this.words.length,otherbitmap.words.length);var answer=0|0;for(var k=0|0;k<newcount;++k){answer+=this.hammingWeight(this.words[k]&otherbitmap.words[k])}return answer};FastBitSet.prototype.new_intersection=function(otherbitmap){var answer=Object.create(FastBitSet.prototype);var count=Math.min(this.words.length,otherbitmap.words.length);answer.words=new Array(count);var c=count;var k=0|0;for(;k+7<c;k+=8){answer.words[k]=this.words[k]&otherbitmap.words[k];answer.words[k+1]=this.words[k+1]&otherbitmap.words[k+1];answer.words[k+2]=this.words[k+2]&otherbitmap.words[k+2];answer.words[k+3]=this.words[k+3]&otherbitmap.words[k+3];answer.words[k+4]=this.words[k+4]&otherbitmap.words[k+4];answer.words[k+5]=this.words[k+5]&otherbitmap.words[k+5];answer.words[k+6]=this.words[k+6]&otherbitmap.words[k+6];answer.words[k+7]=this.words[k+7]&otherbitmap.words[k+7]}for(;k<c;++k){answer.words[k]=this.words[k]&otherbitmap.words[k]}return answer};FastBitSet.prototype.equals=function(otherbitmap){var mcount=Math.min(this.words.length,otherbitmap.words.length);for(var k=0|0;k<mcount;++k){if(this.words[k]!=otherbitmap.words[k])return false}if(this.words.length<otherbitmap.words.length){var c=otherbitmap.words.length;for(var k=this.words.length;k<c;++k){if(otherbitmap.words[k]!=0)return false}}else if(otherbitmap.words.length<this.words.length){var c=this.words.length;for(var k=otherbitmap.words.length;k<c;++k){if(this.words[k]!=0)return false}}return true};FastBitSet.prototype.difference=function(otherbitmap){var newcount=Math.min(this.words.length,otherbitmap.words.length);var k=0|0;for(;k+7<newcount;k+=8){this.words[k]&=~otherbitmap.words[k];this.words[k+1]&=~otherbitmap.words[k+1];this.words[k+2]&=~otherbitmap.words[k+2];this.words[k+3]&=~otherbitmap.words[k+3];this.words[k+4]&=~otherbitmap.words[k+4];this.words[k+5]&=~otherbitmap.words[k+5];this.words[k+6]&=~otherbitmap.words[k+6];this.words[k+7]&=~otherbitmap.words[k+7]}for(;k<newcount;++k){this.words[k]&=~otherbitmap.words[k]}return this};FastBitSet.prototype.difference_size=function(otherbitmap){var newcount=Math.min(this.words.length,otherbitmap.words.length);var answer=0|0;var k=0|0;for(;k<newcount;++k){answer+=this.hammingWeight(this.words[k]&~otherbitmap.words[k])}var c=this.words.length;for(;k<c;++k){answer+=this.hammingWeight(this.words[k])}return answer};FastBitSet.prototype.toString=function(){return"{"+this.array().join(",")+"}"};FastBitSet.prototype.union=function(otherbitmap){var mcount=Math.min(this.words.length,otherbitmap.words.length);var k=0|0;for(;k+7<mcount;k+=8){this.words[k]|=otherbitmap.words[k];this.words[k+1]|=otherbitmap.words[k+1];this.words[k+2]|=otherbitmap.words[k+2];this.words[k+3]|=otherbitmap.words[k+3];this.words[k+4]|=otherbitmap.words[k+4];this.words[k+5]|=otherbitmap.words[k+5];this.words[k+6]|=otherbitmap.words[k+6];this.words[k+7]|=otherbitmap.words[k+7]}for(;k<mcount;++k){this.words[k]|=otherbitmap.words[k]}if(this.words.length<otherbitmap.words.length){this.resize((otherbitmap.words.length<<5)-1);var c=otherbitmap.words.length;for(var k=mcount;k<c;++k){this.words[k]=otherbitmap.words[k]}}return this};FastBitSet.prototype.new_union=function(otherbitmap){var answer=Object.create(FastBitSet.prototype);var count=Math.max(this.words.length,otherbitmap.words.length);answer.words=new Array(count);var mcount=Math.min(this.words.length,otherbitmap.words.length);var k=0;for(;k+7<mcount;k+=8){answer.words[k]=this.words[k]|otherbitmap.words[k];answer.words[k+1]=this.words[k+1]|otherbitmap.words[k+1];answer.words[k+2]=this.words[k+2]|otherbitmap.words[k+2];answer.words[k+3]=this.words[k+3]|otherbitmap.words[k+3];answer.words[k+4]=this.words[k+4]|otherbitmap.words[k+4];answer.words[k+5]=this.words[k+5]|otherbitmap.words[k+5];answer.words[k+6]=this.words[k+6]|otherbitmap.words[k+6];answer.words[k+7]=this.words[k+7]|otherbitmap.words[k+7]}for(;k<mcount;++k){answer.words[k]=this.words[k]|otherbitmap.words[k]}var c=this.words.length;for(var k=mcount;k<c;++k){answer.words[k]=this.words[k]}var c2=otherbitmap.words.length;for(var k=mcount;k<c2;++k){answer.words[k]=otherbitmap.words[k]}return answer};FastBitSet.prototype.new_difference=function(otherbitmap){return this.clone().difference(otherbitmap)};FastBitSet.prototype.union_size=function(otherbitmap){var mcount=Math.min(this.words.length,otherbitmap.words.length);var answer=0|0;for(var k=0|0;k<mcount;++k){answer+=this.hammingWeight(this.words[k]|otherbitmap.words[k])}if(this.words.length<otherbitmap.words.length){var c=otherbitmap.words.length;for(var k=this.words.length;k<c;++k){answer+=this.hammingWeight(otherbitmap.words[k]|0)}}else{var c=this.words.length;for(var k=otherbitmap.words.length;k<c;++k){answer+=this.hammingWeight(this.words[k]|0)}}return answer};/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(e){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var t=e.document,n=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in r,o=function(e){var t=new MouseEvent("click");e.dispatchEvent(t)},a=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),f=e.webkitRequestFileSystem,u=e.requestFileSystem||f||e.mozRequestFileSystem,s=function(t){(e.setImmediate||e.setTimeout)((function(){throw t}),0)},c="application/octet-stream",d=0,l=500,w=function(t){var r=function(){if(typeof t==="string"){n().revokeObjectURL(t)}else{t.remove()}};if(e.chrome){r()}else{setTimeout(r,l)}},p=function(e,t,n){t=[].concat(t);var r=t.length;while(r--){var i=e["on"+t[r]];if(typeof i==="function"){try{i.call(e,n||e)}catch(o){s(o)}}}},v=function(e){if(/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)){return new Blob(["\ufeff",e],{type:e.type})}return e},y=function(t,s,l){if(!l){t=v(t)}var y=this,m=t.type,S=false,h,R,O=function(){p(y,"writestart progress write writeend".split(" "))},g=function(){if(R&&a&&typeof FileReader!=="undefined"){var r=new FileReader;r.onloadend=function(){var e=r.result;R.location.href="data:attachment/file"+e.slice(e.search(/[,;]/));y.readyState=y.DONE;O()};r.readAsDataURL(t);y.readyState=y.INIT;return}if(S||!h){h=n().createObjectURL(t)}if(R){R.location.href=h}else{var i=e.open(h,"_blank");if(i==undefined&&a){e.location.href=h}}y.readyState=y.DONE;O();w(h)},b=function(e){return function(){if(y.readyState!==y.DONE){return e.apply(this,arguments)}}},E={create:true,exclusive:false},N;y.readyState=y.INIT;if(!s){s="download"}if(i){h=n().createObjectURL(t);r.href=h;r.download=s;setTimeout((function(){o(r);O();w(h);y.readyState=y.DONE}));return}if(e.chrome&&m&&m!==c){N=t.slice||t.webkitSlice;t=N.call(t,0,t.size,c);S=true}if(f&&s!=="download"){s+=".download"}if(m===c||f){R=e}if(!u){g();return}d+=t.size;u(e.TEMPORARY,d,b((function(e){e.root.getDirectory("saved",E,b((function(e){var n=function(){e.getFile(s,E,b((function(e){e.createWriter(b((function(n){n.onwriteend=function(t){R.location.href=e.toURL();y.readyState=y.DONE;p(y,"writeend",t);w(e)};n.onerror=function(){var e=n.error;if(e.code!==e.ABORT_ERR){g()}};"writestart progress write abort".split(" ").forEach((function(e){n["on"+e]=y["on"+e]}));n.write(t);y.abort=function(){n.abort();y.readyState=y.DONE};y.readyState=y.WRITING})),g)})),g)};e.getFile(s,{create:false},b((function(e){e.remove();n()})),b((function(e){if(e.code===e.NOT_FOUND_ERR){n()}else{g()}})))})),g)})),g)},m=y.prototype,S=function(e,t,n){return new y(e,t,n)};if(typeof navigator!=="undefined"&&navigator.msSaveOrOpenBlob){return function(e,t,n){if(!n){e=v(e)}return navigator.msSaveOrOpenBlob(e,t||"download")}}m.abort=function(){var e=this;e.readyState=e.DONE;p(e,"abort")};m.readyState=m.INIT=0;m.WRITING=1;m.DONE=2;m.error=m.onwritestart=m.onprogress=m.onwrite=m.onabort=m.onerror=m.onwriteend=null;return S}(typeof self!=="undefined"&&self||typeof window!=="undefined"&&window||this.content);if(typeof module!=="undefined"&&module.exports){module.exports.saveAs=saveAs}else if(typeof define!=="undefined"&&define!==null&&define.amd!=null){define([],(function(){return saveAs}))}
/*!
 * Bootstrap-submenu v2.0.4 (https://vsn4ik.github.io/bootstrap-submenu/)
 * Copyright 2014-2018 Vasilii A. (https://github.com/vsn4ik)
 * Licensed under the MIT license
 */
"use strict";(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})((function($){function Item(element){this.$element=$(element);this.$menu=this.$element.closest(".dropdown-menu");this.$main=this.$menu.parent();this.$items=this.$menu.children(".dropdown-submenu");this.init()}Item.prototype={init:function(){this.$element.on("keydown",$.proxy(this,"keydown"))},close:function(){this.$main.removeClass("open");this.$items.trigger("hide.bs.submenu")},keydown:function(event){if(event.keyCode==27){event.stopPropagation();this.close();this.$main.children("a, button").trigger("focus")}}};function SubmenuItem(element){this.$element=$(element);this.$main=this.$element.parent();this.$menu=this.$main.children(".dropdown-menu");this.$subs=this.$main.siblings(".dropdown-submenu");this.$items=this.$menu.children(".dropdown-submenu");this.init()}$.extend(SubmenuItem.prototype,Item.prototype,{init:function(){this.$element.on({click:$.proxy(this,"click"),keydown:$.proxy(this,"keydown")});this.$main.on("hide.bs.submenu",$.proxy(this,"hide"))},click:function(event){event.preventDefault();event.stopPropagation();this.toggle()},hide:function(event){event.stopPropagation();this.close()},open:function(){this.$main.addClass("open");this.$subs.trigger("hide.bs.submenu")},toggle:function(){if(this.$main.hasClass("open")){this.close()}else{this.open()}},keydown:function(event){if(event.keyCode==32){event.preventDefault()}if($.inArray(event.keyCode,[13,32])!=-1){this.toggle()}}});function Submenupicker(element){this.$element=$(element);this.$main=this.$element.parent();this.$menu=this.$main.children(".dropdown-menu");this.$items=this.$menu.children(".dropdown-submenu");this.init()}Submenupicker.prototype={init:function(){this.$menu.off("keydown.bs.dropdown.data-api");this.$menu.on("keydown",$.proxy(this,"itemKeydown"));this.$menu.find("li > a").each((function(){new Item(this)}));this.$menu.find(".dropdown-submenu > a").each((function(){new SubmenuItem(this)}));this.$main.on("hidden.bs.dropdown",$.proxy(this,"hidden"))},hidden:function(){this.$items.trigger("hide.bs.submenu")},itemKeydown:function(event){if($.inArray(event.keyCode,[38,40])!=-1){event.preventDefault();event.stopPropagation();var $items=this.$menu.find("li:not(.disabled):visible > a");var index=$items.index(event.target);if(event.keyCode==38&&index!==0){index--}else if(event.keyCode==40&&index!==$items.length-1){index++}else{return}$items.eq(index).trigger("focus")}}};var old=$.fn.submenupicker;$.fn.submenupicker=function(elements){var $elements=this instanceof $?this:$(elements);return $elements.each((function(){var data=$.data(this,"bs.submenu");if(!data){data=new Submenupicker(this);$.data(this,"bs.submenu",data)}}))};$.fn.submenupicker.Constructor=Submenupicker;$.fn.submenupicker.noConflict=function(){$.fn.submenupicker=old;return this};return $.fn.submenupicker}));
/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under the MIT license
 */
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",(function(){c=!0}));var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a((function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})}))}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)}))}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)}))}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy((function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))}),this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))}))}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()}))}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){b.to(a)})):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",(function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout((function(){i.$element.trigger(m)}),0)})).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",(function(){a('[data-ride="carousel"]').each((function(){var c=a(this);b.call(c,c.data())}))}))}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each((function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()}))}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy((function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)}),this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)}))}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each((function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))})))}function d(b){return this.each((function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)}))}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",(function(a){a.stopPropagation()})).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each((function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)}))}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy((function(){this.$element.trigger("loaded.bs.modal")}),this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",(function(){d.$element.one("mouseup.dismiss.bs.modal",(function(b){a(b.target).is(d.$element)&&(d.ignoreBackdropClick=!0)}))})),this.backdrop((function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in"),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$dialog.one("bsTransitionEnd",(function(){d.$element.trigger("focus").trigger(f)})).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)})))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy((function(a){document===a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")}),this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy((function(a){27==a.which&&this.hide()}),this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop((function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")}))},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+e).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy((function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))}),this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth<a,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",(function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",(function(){d.is(":visible")&&d.trigger("focus")}))})),b.call(f,g,this)}))}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())}))}var c=function(a,b){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",a,b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,(function(a,d){c[a]!=d&&(b[a]=d)})),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout((function(){"in"==c.hoverState&&c.show()}),c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout((function(){"out"==c.hoverState&&c.hide()}),c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-m<o.top?"bottom":"right"==h&&k.right+l>o.width?"left":"left"==h&&k.left-l<o.left?"right":h,f.removeClass(n).addClass(h)}var p=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(p,h);var q=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",q).emulateTransitionEnd(c.TRANSITION_DURATION):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top+=g,b.left+=h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=a(this.$tip),g=a.Event("hide.bs."+this.type);if(this.$element.trigger(g),!g.isDefaultPrevented())return f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=window.SVGElement&&c instanceof window.SVGElement,g=d?{top:0,left:0}:f?null:b.offset(),h={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},i=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,h,i,g)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do{a+=~~(1e6*Math.random())}while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide((function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null}))};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())}))}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each((function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()}))}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null})).sort((function(a,b){return a[0]-b[0]})).each((function(){b.offsets.push(this[0]),b.targets.push(this[1])}))},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(void 0===e[a+1]||b<e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",(function(){a('[data-spy="scroll"]').each((function(){var b=a(this);c.call(b,b.data())}))}))}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()}))}var c=function(b){this.element=a(b)};c.VERSION="3.3.7",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),(function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})}))}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each((function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()}))}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e<c&&"top";if("bottom"==this.affixed)return null!=c?!(e+this.unpin<=f.top)&&"bottom":!(e+g<=a-d)&&"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&e<=c?"top":null!=d&&i+j>=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",(function(){a('[data-spy="affix"]').each((function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)}))}))}(jQuery);(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("chart.js")):typeof define==="function"&&define.amd?define(["exports","chart.js"],factory):factory(global.ChartBoxPlot=global.ChartBoxPlot||{},global.Chart)})(this,(function(exports,Chart){"use strict";var ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN};var bisector=function(compare){if(compare.length===1)compare=ascendingComparator(compare);return{left:function left(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(compare(a[mid],x)<0)lo=mid+1;else hi=mid}return lo},right:function right(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;while(lo<hi){var mid=lo+hi>>>1;if(compare(a[mid],x)>0)hi=mid;else lo=mid+1}return lo}}};function ascendingComparator(f){return function(d,x){return ascending(f(d),x)}}var ascendingBisect=bisector(ascending);var bisectRight=ascendingBisect.right;function pair(a,b){return[a,b]}var number=function(x){return x===null?NaN:+x};var extent=function(values,valueof){var n=values.length,i=-1,value,min,max;if(valueof==null){while(++i<n){if((value=values[i])!=null&&value>=value){min=max=value;while(++i<n){if((value=values[i])!=null){if(min>value)min=value;if(max<value)max=value}}}}}else{while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>=value){min=max=value;while(++i<n){if((value=valueof(values[i],i,values))!=null){if(min>value)min=value;if(max<value)max=value}}}}}return[min,max]};var identity=function(x){return x};var d3range=function(start,stop,step){start=+start,stop=+stop,step=(n=arguments.length)<2?(stop=start,start=0,1):n<3?1:+step;var i=-1,n=Math.max(0,Math.ceil((stop-start)/step))|0,range=new Array(n);while(++i<n){range[i]=start+i*step}return range};var e10=Math.sqrt(50);var e5=Math.sqrt(10);var e2=Math.sqrt(2);function tickIncrement(start,stop,count){var step=(stop-start)/Math.max(0,count),power=Math.floor(Math.log(step)/Math.LN10),error=step/Math.pow(10,power);return power>=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1)}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;if(error>=e10)step1*=10;else if(error>=e5)step1*=5;else if(error>=e2)step1*=2;return stop<start?-step1:step1}var sturges=function(values){return Math.ceil(Math.log(values.length)/Math.LN2)+1};var quantile=function(values,p,valueof){if(valueof==null)valueof=number;if(!(n=values.length))return;if((p=+p)<=0||n<2)return+valueof(values[0],0,values);if(p>=1)return+valueof(values[n-1],n-1,values);var n,i=(n-1)*p,i0=Math.floor(i),value0=+valueof(values[i0],i0,values),value1=+valueof(values[i0+1],i0+1,values);return value0+(value1-value0)*(i-i0)};var d3max=function(values,valueof){var n=values.length,i=-1,value,max;if(valueof==null){while(++i<n){if((value=values[i])!=null&&value>=value){max=value;while(++i<n){if((value=values[i])!=null&&value>max){max=value}}}}}else{while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>=value){max=value;while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>max){max=value}}}}}return max};var min=function(values,valueof){var n=values.length,i=-1,value,min;if(valueof==null){while(++i<n){if((value=values[i])!=null&&value>=value){min=value;while(++i<n){if((value=values[i])!=null&&min>value){min=value}}}}}else{while(++i<n){if((value=valueof(values[i],i,values))!=null&&value>=value){min=value;while(++i<n){if((value=valueof(values[i],i,values))!=null&&min>value){min=value}}}}}return min};function length(d){return d.length}function gaussian(u){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*u*u)}function mean$1(x){var n=x.length;if(n===0)return NaN;var m=0,i=-1;while(++i<n){m+=(x[i]-m)/(i+1)}return m}function variance$1(x){var n=x.length;if(n<1)return NaN;if(n===1)return 0;var mean=mean$1(x),i=-1,s=0;while(++i<n){var v=x[i]-mean;s+=v*v}return s/(n-1)}function ascending$1(a,b){return a-b}function quantiles(d,quantiles){d=d.slice().sort(ascending$1);var n_1=d.length-1;return quantiles.map((function(q){if(q===0)return d[0];else if(q===1)return d[n_1];var index=1+q*n_1,lo=Math.floor(index),h=index-lo,a=d[lo-1];return h===0?a:a+h*(d[lo]-a)}))}function iqr(x){var quartiles=quantiles(x,[.25,.75]);return quartiles[1]-quartiles[0]}function nrd(x){var h=iqr(x)/1.34;return 1.06*Math.min(Math.sqrt(variance$1(x)),h)*Math.pow(x.length,-1/5)}function functor(v){return typeof v==="function"?v:function(){return v}}function kde(){var kernel=gaussian,sample=[],bandwidth=nrd;function kde(points,i){var bw=bandwidth.call(this,sample);return points.map((function(x){var i=-1,y=0,n=sample.length;while(++i<n){y+=kernel((x-sample[i])/bw)}return[x,y/bw/n]}))}kde.kernel=function(x){if(!arguments.length)return kernel;kernel=x;return kde};kde.sample=function(x){if(!arguments.length)return sample;sample=x;return kde};kde.bandwidth=function(x){if(!arguments.length)return bandwidth;bandwidth=functor(x);return kde};return kde}function whiskers(boxplot){var iqr=boxplot.q3-boxplot.q1;var whiskerMin=Math.max(boxplot.min,boxplot.q1-iqr);var whiskerMax=Math.min(boxplot.max,boxplot.q3+iqr);return{whiskerMin:whiskerMin,whiskerMax:whiskerMax}}function boxplotStats(arr){if(arr.length===0){return{min:NaN,max:NaN,median:NaN,q1:NaN,q3:NaN,whiskerMin:NaN,whiskerMax:NaN,outliers:[]}}arr=arr.filter((function(v){return typeof v==="number"&&!isNaN(v)}));arr.sort((function(a,b){return a-b}));var minmax=extent(arr);var base={min:minmax[0],max:minmax[1],median:quantile(arr,.5),q1:quantile(arr,.25),q3:quantile(arr,.75),outliers:[]};var _whiskers=whiskers(base),whiskerMin=_whiskers.whiskerMin,whiskerMax=_whiskers.whiskerMax;base.outliers=arr.filter((function(v){return v<whiskerMin||v>whiskerMax}));base.whiskerMin=whiskerMin;base.whiskerMax=whiskerMax;return base}function violinStats(arr){if(arr.length===0){return{outliers:[]}}arr=arr.filter((function(v){return typeof v==="number"&&!isNaN(v)}));arr.sort((function(a,b){return a-b}));var minmax=extent(arr);return{min:minmax[0],max:minmax[1],median:quantile(arr,.5),kde:kde().sample(arr)}}function asBoxPlotStats(value){if(!value){return null}if(typeof value.median==="number"&&typeof value.q1==="number"&&typeof value.q3==="number"){if(typeof value.whiskerMin==="undefined"){var _whiskers2=whiskers(value),whiskerMin=_whiskers2.whiskerMin,whiskerMax=_whiskers2.whiskerMax;value.whiskerMin=whiskerMin;value.whiskerMax=whiskerMax}return value}if(!Array.isArray(value)){return undefined}if(value.__stats===undefined){value.__stats=boxplotStats(value)}return value.__stats}function asViolinStats(value){if(!value){return null}if(typeof value.median==="number"&&(typeof value.kde==="function"||Array.isArray(value.coords))){return value}if(!Array.isArray(value)){return undefined}if(value.__kde===undefined){value.__kde=violinStats(value)}return value.__kde}function asValueStats(value,minStats,maxStats){if(typeof value[minStats]==="number"&&typeof value[maxStats]==="number"){return value}if(!Array.isArray(value)){return undefined}return asBoxPlotStats(value)}function getRightValue(rawValue){if(!rawValue){return rawValue}if(typeof rawValue==="number"||typeof rawValue==="string"){return Number(rawValue)}var b=asBoxPlotStats(rawValue);return b?b.median:rawValue}var commonScaleOptions={ticks:{minStats:"min",maxStats:"max"}};function commonDataLimits(extraCallback){var _this=this;var chart=this.chart;var isHorizontal=this.isHorizontal();var tickOpts=this.options.ticks;var minStats=tickOpts.minStats;var maxStats=tickOpts.maxStats;var matchID=function matchID(meta){return isHorizontal?meta.xAxisID===_this.id:meta.yAxisID===_this.id};this.min=null;this.max=null;chart.data.datasets.forEach((function(d,i){var meta=chart.getDatasetMeta(i);if(!chart.isDatasetVisible(i)||!matchID(meta)){return}d.data.forEach((function(value,j){if(!value||meta.data[j].hidden){return}var stats=asValueStats(value,minStats,maxStats);if(!stats){return}if(_this.min===null||stats[minStats]<_this.min){_this.min=stats[minStats]}if(_this.max===null||stats[maxStats]>_this.max){_this.max=stats[maxStats]}if(extraCallback){extraCallback(stats)}}))}))}function rnd(seed){if(seed===undefined){seed=Date.now()}return function(){seed=(seed*9301+49297)%233280;return seed/233280}}var defaults$1=Object.assign({},Chart.defaults.global.elements.rectangle,{borderWidth:1,outlierRadius:2,outlierColor:Chart.defaults.global.elements.rectangle.backgroundColor,itemRadius:2,itemStyle:"circle",itemBackgroundColor:Chart.defaults.global.elements.rectangle.backgroundColor,itemBorderColor:Chart.defaults.global.elements.rectangle.borderColor});var ArrayElementBase=Chart.Element.extend({isVertical:function isVertical(){return this._view.width!==undefined},draw:function draw(){},_drawItems:function _drawItems(vm,container,ctx,vert){if(vm.itemRadius<=0||!container.items||container.items.length<=0){return}ctx.save();ctx.strokeStle=vm.itemBorderColor;ctx.fillStyle=vm.itemBackgroundColor;var random=rnd(container.median);if(vert){container.items.forEach((function(v){Chart.canvasHelpers.drawPoint(ctx,vm.itemStyle,vm.itemRadius,vm.x-vm.width/2+random()*vm.width,v)}))}else{container.items.forEach((function(v){Chart.canvasHelpers.drawPoint(ctx,vm.itemStyle,vm.itemRadius,v,vm.y-vm.height/2+random()*vm.height)}))}ctx.restore()},_drawOutliers:function _drawOutliers(vm,container,ctx,vert){if(!container.outliers){return}ctx.fillStyle=vm.outlierColor;ctx.beginPath();if(vert){container.outliers.forEach((function(v){ctx.arc(vm.x,v,vm.outlierRadius,0,Math.PI*2)}))}else{container.outliers.forEach((function(v){ctx.arc(v,vm.y,vm.outlierRadius,0,Math.PI*2)}))}ctx.fill();ctx.closePath()},_getBounds:function _getBounds(){return{left:0,top:0,right:0,bottom:0}},height:function height(){return 0},inRange:function inRange(mouseX,mouseY){if(!this._view){return false}var bounds=this._getBounds();return mouseX>=bounds.left&&mouseX<=bounds.right&&mouseY>=bounds.top&&mouseY<=bounds.bottom},inLabelRange:function inLabelRange(mouseX,mouseY){if(!this._view){return false}var bounds=this._getBounds();if(this.isVertical()){return mouseX>=bounds.left&&mouseX<=bounds.right}return mouseY>=bounds.top&&mouseY<=bounds.bottom},inXRange:function inXRange(mouseX){var bounds=this._getBounds();return mouseX>=bounds.left&&mouseX<=bounds.right},inYRange:function inYRange(mouseY){var bounds=this._getBounds();return mouseY>=bounds.top&&mouseY<=bounds.bottom},getCenterPoint:function getCenterPoint(){var _view=this._view,x=_view.x,y=_view.y;return{x:x,y:y}},getArea:function getArea(){return 0},tooltipPosition_:function tooltipPosition_(){return this.getCenterPoint()}});Chart.defaults.global.elements.boxandwhiskers=Object.assign({},defaults$1);var BoxAndWiskers=Chart.elements.BoxAndWhiskers=ArrayElementBase.extend({draw:function draw(){var ctx=this._chart.ctx;var vm=this._view;var boxplot=vm.boxplot;var vert=this.isVertical();this._drawItems(vm,boxplot,ctx,vert);ctx.save();ctx.fillStyle=vm.backgroundColor;ctx.strokeStyle=vm.borderColor;ctx.lineWidth=vm.borderWidth;this._drawBoxPlot(vm,boxplot,ctx,vert);this._drawOutliers(vm,boxplot,ctx,vert);ctx.restore()},_drawBoxPlot:function _drawBoxPlot(vm,boxplot,ctx,vert){ctx.beginPath();if(vert){var x=vm.x;var width=vm.width;var x0=x-width/2;ctx.fillRect(x0,boxplot.q1,width,boxplot.q3-boxplot.q1);ctx.strokeRect(x0,boxplot.q1,width,boxplot.q3-boxplot.q1);ctx.moveTo(x0,boxplot.whiskerMin);ctx.lineTo(x0+width,boxplot.whiskerMin);ctx.moveTo(x,boxplot.whiskerMin);ctx.lineTo(x,boxplot.q1);ctx.moveTo(x0,boxplot.whiskerMax);ctx.lineTo(x0+width,boxplot.whiskerMax);ctx.moveTo(x,boxplot.whiskerMax);ctx.lineTo(x,boxplot.q3);ctx.moveTo(x0,boxplot.median);ctx.lineTo(x0+width,boxplot.median)}else{var y=vm.y;var height=vm.height;var y0=y-height/2;ctx.fillRect(boxplot.q1,y0,boxplot.q3-boxplot.q1,height);ctx.strokeRect(boxplot.q1,y0,boxplot.q3-boxplot.q1,height);ctx.moveTo(boxplot.whiskerMin,y0);ctx.lineTo(boxplot.whiskerMin,y0+height);ctx.moveTo(boxplot.whiskerMin,y);ctx.lineTo(boxplot.q1,y);ctx.moveTo(boxplot.whiskerMax,y0);ctx.lineTo(boxplot.whiskerMax,y0+height);ctx.moveTo(boxplot.whiskerMax,y);ctx.lineTo(boxplot.q3,y);ctx.moveTo(boxplot.median,y0);ctx.lineTo(boxplot.median,y0+height)}ctx.stroke();ctx.closePath()},_getBounds:function _getBounds(){var vm=this._view;var vert=this.isVertical();var boxplot=vm.boxplot;if(!boxplot){return{left:0,top:0,right:0,bottom:0}}if(vert){var x=vm.x,width=vm.width;var x0=x-width/2;return{left:x0,top:boxplot.whiskerMax,right:x0+width,bottom:boxplot.whiskerMin}}var y=vm.y,height=vm.height;var y0=y-height/2;return{left:boxplot.whiskerMin,top:y0,right:boxplot.whiskerMax,bottom:y0+height}},height:function height(){var vm=this._view;return vm.base-Math.min(vm.boxplot.q1,vm.boxplot.q3)},getArea:function getArea(){var vm=this._view;var iqr=Math.abs(vm.boxplot.q3-vm.boxplot.q1);if(this.isVertical()){return iqr*vm.width}return iqr*vm.height}});Chart.defaults.global.elements.violin=Object.assign({points:100},defaults$1);var Violin=Chart.elements.Violin=ArrayElementBase.extend({draw:function draw(){var ctx=this._chart.ctx;var vm=this._view;var violin=vm.violin;var vert=this.isVertical();this._drawItems(vm,violin,ctx,vert);ctx.save();ctx.fillStyle=vm.backgroundColor;ctx.strokeStyle=vm.borderColor;ctx.lineWidth=vm.borderWidth;var coords=violin.coords;Chart.canvasHelpers.drawPoint(ctx,"rectRot",5,vm.x,vm.y);ctx.stroke();ctx.beginPath();if(vert){var x=vm.x;var width=vm.width;var factor=width/2/violin.maxEstimate;ctx.moveTo(x,violin.min);coords.forEach((function(_ref){var v=_ref.v,estimate=_ref.estimate;ctx.lineTo(x-estimate*factor,v)}));ctx.lineTo(x,violin.max);ctx.moveTo(x,violin.min);coords.forEach((function(_ref2){var v=_ref2.v,estimate=_ref2.estimate;ctx.lineTo(x+estimate*factor,v)}));ctx.lineTo(x,violin.max)}else{var y=vm.y;var height=vm.height;var _factor=height/2/violin.maxEstimate;ctx.moveTo(violin.min,y);coords.forEach((function(_ref3){var v=_ref3.v,estimate=_ref3.estimate;ctx.lineTo(v,y-estimate*_factor)}));ctx.lineTo(violin.max,y);ctx.moveTo(violin.min,y);coords.forEach((function(_ref4){var v=_ref4.v,estimate=_ref4.estimate;ctx.lineTo(v,y+estimate*_factor)}));ctx.lineTo(violin.max,y)}ctx.stroke();ctx.fill();ctx.closePath();this._drawOutliers(vm,violin,ctx,vert);ctx.restore()},_getBounds:function _getBounds(){var vm=this._view;var vert=this.isVertical();var violin=vm.violin;if(vert){var x=vm.x,width=vm.width;var x0=x-width/2;return{left:x0,top:violin.max,right:x0+width,bottom:violin.min}}var y=vm.y,height=vm.height;var y0=y-height/2;return{left:violin.min,top:y0,right:violin.max,bottom:y0+height}},height:function height(){var vm=this._view;return vm.base-Math.min(vm.violin.min,vm.violin.max)},getArea:function getArea(){var vm=this._view;var iqr=Math.abs(vm.violin.max-vm.violin.min);if(this.isVertical()){return iqr*vm.width}return iqr*vm.height}});var verticalDefaults={scales:{yAxes:[{type:"arrayLinear"}]}};var horizontalDefaults={scales:{xAxes:[{type:"arrayLinear"}]}};var array$1={_elementOptions:function _elementOptions(){return{}},updateElement:function updateElement(elem,index,reset){var dataset=this.getDataset();var custom=elem.custom||{};var options=this._elementOptions();Chart.controllers.bar.prototype.updateElement.call(this,elem,index,reset);["outlierRadius","itemRadius","itemStyle","itemBackgroundColor","itemBorderColor","outlierColor"].forEach((function(item){elem._model[item]=custom[item]!==undefined?custom[item]:Chart.helpers.valueAtIndexOrDefault(dataset[item],index,options[item])}))},_calculateCommonModel:function _calculateCommonModel(r,data,container,scale){if(container.outliers){r.outliers=container.outliers.map((function(d){return scale.getPixelForValue(Number(d))}))}if(Array.isArray(data)){r.items=data.map((function(d){return scale.getPixelForValue(Number(d))}))}}};var defaults$2={tooltips:{callbacks:{label:function label(item,data){var datasetLabel=data.datasets[item.datasetIndex].label||"";var value=data.datasets[item.datasetIndex].data[item.index];var b=asBoxPlotStats(value);var label=datasetLabel+" "+(typeof item.xLabel==="string"?item.xLabel:item.yLabel);if(!b){return label+"NaN"}return label+" (min: "+b.min+", q1: "+b.q1+", median: "+b.median+", q3: "+b.q3+", max: "+b.max+")"}}}};Chart.defaults.boxplot=Chart.helpers.merge({},[Chart.defaults.bar,verticalDefaults,defaults$2]);Chart.defaults.horizontalBoxplot=Chart.helpers.merge({},[Chart.defaults.horizontalBar,horizontalDefaults,defaults$2]);var boxplot=Object.assign({},array$1,{dataElementType:Chart.elements.BoxAndWhiskers,_elementOptions:function _elementOptions(){return this.chart.options.elements.boxandwhiskers},updateElementGeometry:function updateElementGeometry(elem,index,reset){Chart.controllers.bar.prototype.updateElementGeometry.call(this,elem,index,reset);elem._model.boxplot=this._calculateBoxPlotValuesPixels(this.index,index)},_calculateBoxPlotValuesPixels:function _calculateBoxPlotValuesPixels(datasetIndex,index){var scale=this.getValueScale();var data=this.chart.data.datasets[datasetIndex].data[index];if(!data){return null}var v=asBoxPlotStats(data);var r={};Object.keys(v).forEach((function(key){if(key!=="outliers"){r[key]=scale.getPixelForValue(Number(v[key]))}}));this._calculateCommonModel(r,data,v,scale);return r}});var BoxPlot=Chart.controllers.boxplot=Chart.controllers.bar.extend(boxplot);var HorizontalBoxPlot=Chart.controllers.horizontalBoxplot=Chart.controllers.horizontalBar.extend(boxplot);var defaults$3={};Chart.defaults.violin=Chart.helpers.merge({},[Chart.defaults.bar,verticalDefaults,defaults$3]);Chart.defaults.horizontalViolin=Chart.helpers.merge({},[Chart.defaults.horizontalBar,horizontalDefaults,defaults$3]);var controller=Object.assign({},array$1,{dataElementType:Chart.elements.Violin,_elementOptions:function _elementOptions(){return this.chart.options.elements.violin},updateElementGeometry:function updateElementGeometry(elem,index,reset){Chart.controllers.bar.prototype.updateElementGeometry.call(this,elem,index,reset);var custom=elem.custom||{};var options=this._elementOptions();elem._model.violin=this._calculateViolinValuesPixels(this.index,index,custom.points!==undefined?custom.points:options.points)},_calculateViolinValuesPixels:function _calculateViolinValuesPixels(datasetIndex,index,points){var scale=this.getValueScale();var data=this.chart.data.datasets[datasetIndex].data[index];var violin=asViolinStats(data);var range$$1=violin.max-violin.min;var samples=d3range(violin.min,violin.max,range$$1/points);if(samples[samples.length-1]!==violin.max){samples.push(violin.max)}var coords=violin.coords||violin.kde(samples).map((function(v){return{v:v[0],estimate:v[1]}}));var r={min:scale.getPixelForValue(violin.min),max:scale.getPixelForValue(violin.max),median:scale.getPixelForValue(violin.median),coords:coords.map((function(_ref){var v=_ref.v,estimate=_ref.estimate;return{v:scale.getPixelForValue(v),estimate:estimate}})),maxEstimate:d3max(coords,(function(d){return d.estimate}))};this._calculateCommonModel(r,data,violin,scale);return r}});var Violin$2=Chart.controllers.violin=Chart.controllers.bar.extend(controller);var HorizontalViolin=Chart.controllers.horizontalViolin=Chart.controllers.horizontalBar.extend(controller);var helpers$1=Chart.helpers;var ArrayLinearScaleOptions=helpers$1.merge({},[commonScaleOptions,Chart.scaleService.getScaleDefaults("linear")]);var ArrayLinearScale=Chart.scaleService.getScaleConstructor("linear").extend({getRightValue:function getRightValue$$1(rawValue){return Chart.LinearScaleBase.prototype.getRightValue.call(this,getRightValue(rawValue))},determineDataLimits:function determineDataLimits(){commonDataLimits.call(this);this.handleTickRangeOptions()}});Chart.scaleService.registerScaleType("arrayLinear",ArrayLinearScale,ArrayLinearScaleOptions);var helpers$2=Chart.helpers;var ArrayLogarithmicScaleOptions=helpers$2.merge({},[commonScaleOptions,Chart.scaleService.getScaleDefaults("logarithmic")]);var ArrayLogarithmicScale=Chart.scaleService.getScaleConstructor("logarithmic").extend({getRightValue:function getRightValue$$1(rawValue){return Chart.LinearScaleBase.prototype.getRightValue.call(this,getRightValue(rawValue))},determineDataLimits:function determineDataLimits(){var _this=this;var tickOpts=this.options.ticks;this.minNotZero=null;commonDataLimits.call(this,(function(boxPlot){var value=boxPlot[tickOpts.minStats];if(value!==0&&(_this.minNotZero===null||value<_this.minNotZero)){_this.minNotZero=value}}));this.min=helpers$2.valueOrDefault(tickOpts.min,this.min-this.min*.05);this.max=helpers$2.valueOrDefault(tickOpts.max,this.max+this.max*.05);if(this.min===this.max){if(this.min!==0&&this.min!==null){this.min=Math.pow(10,Math.floor(helpers$2.log10(this.min))-1);this.max=Math.pow(10,Math.floor(helpers$2.log10(this.max))+1)}else{this.min=1;this.max=10}}}});Chart.scaleService.registerScaleType("arrayLogarithmic",ArrayLogarithmicScale,ArrayLogarithmicScaleOptions);exports.BoxAndWhiskers=BoxAndWiskers;exports.Violin=Violin;exports.ArrayLinearScale=ArrayLinearScale;exports.ArrayLogarithmicScale=ArrayLogarithmicScale;exports.BoxPlot=BoxPlot;exports.HorizontalBoxPlot=HorizontalBoxPlot;exports.HorizontalViolin=HorizontalViolin;Object.defineProperty(exports,"__esModule",{value:true})}));(function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){return this.click_test_action=function(t){return function(e){return t.test_active_click(e)}}(this),this.activate_action=function(t){return function(e){return t.activate_field(e)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+t.group_label+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(s=o[n],i="",""!==(i=s.group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.style.cssText=t.style,s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(){var t,e,s,i,n,r,o,h,l,c,_,a,u,d,p;for(this.no_results_clear(),c=0,t=(o=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),l=this.get_search_regex(t),s=0,i=(h=this.results_data).length;s<i;s++)(n=h[s]).search_match=!1,_=null,a=null,n.highlighted_html="",this.include_option_in_results(n)&&(n.group&&(n.group_match=!1,n.active_options=0),null!=n.group_array_index&&this.results_data[n.group_array_index]&&(0===(_=this.results_data[n.group_array_index]).active_options&&_.search_match&&(c+=1),_.active_options+=1),p=n.group?n.label:n.text,n.group&&!this.group_search||(a=this.search_string_match(p,l),n.search_match=null!=a,n.search_match&&!n.group&&(c+=1),n.search_match?(o.length&&(u=a.index,r=p.slice(0,u),e=p.slice(u,u+o.length),d=p.slice(u+o.length),n.highlighted_html=this.escape_html(r)+"<em>"+this.escape_html(e)+"</em>"+this.escape_html(d)),null!=_&&(_.group_match=!0)):null!=n.group_array_index&&this.results_data[n.group_array_index].search_match&&(n.search_match=!0)));return this.result_clear_highlight(),c<1&&o.length?(this.update_results_content(""),this.no_results(o)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n  <span>'+this.default_text+'</span>\n  <div><b></b></div>\n</a>\n<div class="chosen-drop">\n  <div class="chosen-search">\n    <input class="chosen-search-input" type="text" autocomplete="off" />\n  </div>\n  <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n  <li class="search-field">\n    <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n  </li>\n</ul>\n<div class="chosen-drop">\n  <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n  '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each((function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()})):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",(function(t){t.preventDefault()}))},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{class:"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.search_field.val(""),this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?this.winnow_results():(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);(function(window,document){"use strict";var Hamster=function(element){return new Hamster.Instance(element)};Hamster.SUPPORT="wheel";Hamster.ADD_EVENT="addEventListener";Hamster.REMOVE_EVENT="removeEventListener";Hamster.PREFIX="";Hamster.READY=false;Hamster.Instance=function(element){if(!Hamster.READY){Hamster.normalise.browser();Hamster.READY=true}this.element=element;this.handlers=[];return this};Hamster.Instance.prototype={wheel:function onEvent(handler,useCapture){Hamster.event.add(this,Hamster.SUPPORT,handler,useCapture);if(Hamster.SUPPORT==="DOMMouseScroll"){Hamster.event.add(this,"MozMousePixelScroll",handler,useCapture)}return this},unwheel:function offEvent(handler,useCapture){if(handler===undefined&&(handler=this.handlers.slice(-1)[0])){handler=handler.original}Hamster.event.remove(this,Hamster.SUPPORT,handler,useCapture);if(Hamster.SUPPORT==="DOMMouseScroll"){Hamster.event.remove(this,"MozMousePixelScroll",handler,useCapture)}return this}};Hamster.event={add:function add(hamster,eventName,handler,useCapture){var originalHandler=handler;handler=function(originalEvent){if(!originalEvent){originalEvent=window.event}var event=Hamster.normalise.event(originalEvent),delta=Hamster.normalise.delta(originalEvent);return originalHandler(event,delta[0],delta[1],delta[2])};hamster.element[Hamster.ADD_EVENT](Hamster.PREFIX+eventName,handler,useCapture||false);hamster.handlers.push({original:originalHandler,normalised:handler})},remove:function remove(hamster,eventName,handler,useCapture){var originalHandler=handler,lookup={},handlers;for(var i=0,len=hamster.handlers.length;i<len;++i){lookup[hamster.handlers[i].original]=hamster.handlers[i]}handlers=lookup[originalHandler];handler=handlers.normalised;hamster.element[Hamster.REMOVE_EVENT](Hamster.PREFIX+eventName,handler,useCapture||false);for(var h in hamster.handlers){if(hamster.handlers[h]==handlers){hamster.handlers.splice(h,1);break}}}};var lowestDelta,lowestDeltaXY;Hamster.normalise={browser:function normaliseBrowser(){if(!("onwheel"in document||document.documentMode>=9)){Hamster.SUPPORT=document.onmousewheel!==undefined?"mousewheel":"DOMMouseScroll"}if(!window.addEventListener){Hamster.ADD_EVENT="attachEvent";Hamster.REMOVE_EVENT="detachEvent";Hamster.PREFIX="on"}},event:function normaliseEvent(originalEvent){var event={originalEvent:originalEvent,target:originalEvent.target||originalEvent.srcElement,type:"wheel",deltaMode:originalEvent.type==="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){if(originalEvent.preventDefault){originalEvent.preventDefault()}else{originalEvent.returnValue=false}},stopPropagation:function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()}else{originalEvent.cancelBubble=false}}};if(originalEvent.wheelDelta){event.deltaY=-1/40*originalEvent.wheelDelta}if(originalEvent.wheelDeltaX){event.deltaX=-1/40*originalEvent.wheelDeltaX}if(originalEvent.detail){event.deltaY=originalEvent.detail}return event},delta:function normaliseDelta(originalEvent){var delta=0,deltaX=0,deltaY=0,absDelta=0,absDeltaXY=0,fn;if(originalEvent.deltaY){deltaY=originalEvent.deltaY*-1;delta=deltaY}if(originalEvent.deltaX){deltaX=originalEvent.deltaX;delta=deltaX*-1}if(originalEvent.wheelDelta){delta=originalEvent.wheelDelta}if(originalEvent.wheelDeltaY){deltaY=originalEvent.wheelDeltaY}if(originalEvent.wheelDeltaX){deltaX=originalEvent.wheelDeltaX*-1}if(originalEvent.detail){delta=originalEvent.detail*-1}if(delta===0){return[0,0,0]}absDelta=Math.abs(delta);if(!lowestDelta||absDelta<lowestDelta){lowestDelta=absDelta}absDeltaXY=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(!lowestDeltaXY||absDeltaXY<lowestDeltaXY){lowestDeltaXY=absDeltaXY}fn=delta>0?"floor":"ceil";delta=Math[fn](delta/lowestDelta);deltaX=Math[fn](deltaX/lowestDeltaXY);deltaY=Math[fn](deltaY/lowestDeltaXY);return[delta,deltaX,deltaY]}};if(typeof window.define==="function"&&window.define.amd){window.define("hamster",[],(function(){return Hamster}))}else if(typeof exports==="object"){module.exports=Hamster}else{window.Hamster=Hamster}})(window,window.document);(function(C,p){"object"===typeof exports?p(exports):"function"===typeof define&&define.amd?define(["exports"],p):p(C)})(this,(function(C){function p(a){this._targetElement=a;this._introItems=[];this._options={nextLabel:"Next &rarr;",prevLabel:"&larr; Back",skipLabel:"Close",doneLabel:"Done",hidePrev:!1,hideNext:!1,tooltipPosition:"bottom",tooltipClass:"",highlightClass:"",exitOnEsc:!0,exitOnOverlayClick:!0,showStepNumbers:!0,keyboardNavigation:!0,showButtons:!0,showBullets:!0,showProgress:!1,scrollToElement:!0,overlayOpacity:.8,scrollPadding:30,positionPrecedence:["bottom","top","right","left"],disableInteraction:!1,hintPosition:"top-middle",hintButtonLabel:"Got it",hintAnimation:!0}}function T(a){var b=[],c=this;if(this._options.steps)for(var d=0,f=this._options.steps.length;d<f;d++){var e=y(this._options.steps[d]);e.step=b.length+1;"string"===typeof e.element&&(e.element=document.querySelector(e.element));if("undefined"===typeof e.element||null==e.element){var g=document.querySelector(".introjsFloatingElement");null==g&&(g=document.createElement("div"),g.className="introjsFloatingElement",document.body.appendChild(g));e.element=g;e.position="floating"}null!=e.element&&b.push(e)}else{f=a.querySelectorAll("*[data-intro]");if(1>f.length)return!1;d=0;for(e=f.length;d<e;d++)if(g=f[d],"none"!=g.style.display){var l=parseInt(g.getAttribute("data-step"),10);0<l&&(b[l-1]={element:g,intro:g.getAttribute("data-intro"),step:parseInt(g.getAttribute("data-step"),10),tooltipClass:g.getAttribute("data-tooltipClass"),highlightClass:g.getAttribute("data-highlightClass"),position:g.getAttribute("data-position")||this._options.tooltipPosition})}d=l=0;for(e=f.length;d<e;d++)if(g=f[d],null==g.getAttribute("data-step")){for(;"undefined"!=typeof b[l];)l++;b[l]={element:g,intro:g.getAttribute("data-intro"),step:l+1,tooltipClass:g.getAttribute("data-tooltipClass"),highlightClass:g.getAttribute("data-highlightClass"),position:g.getAttribute("data-position")||this._options.tooltipPosition}}}d=[];for(f=0;f<b.length;f++)b[f]&&d.push(b[f]);b=d;b.sort((function(a,b){return a.step-b.step}));c._introItems=b;U.call(c,a)&&(z.call(c),a.querySelector(".introjs-skipbutton"),a.querySelector(".introjs-nextbutton"),c._onKeyDown=function(b){if(27===b.keyCode&&!0==c._options.exitOnEsc)void 0!=c._introExitCallback&&c._introExitCallback.call(c),A.call(c,a);else if(37===b.keyCode)E.call(c);else if(39===b.keyCode)z.call(c);else if(13===b.keyCode){var d=b.target||b.srcElement;d&&0<d.className.indexOf("introjs-prevbutton")?E.call(c):d&&0<d.className.indexOf("introjs-skipbutton")?(c._introItems.length-1==c._currentStep&&"function"===typeof c._introCompleteCallback&&c._introCompleteCallback.call(c),void 0!=c._introExitCallback&&c._introExitCallback.call(c),A.call(c,a)):z.call(c);b.preventDefault?b.preventDefault():b.returnValue=!1}},c._onResize=function(a){r.call(c,document.querySelector(".introjs-helperLayer"));r.call(c,document.querySelector(".introjs-tooltipReferenceLayer"))},window.addEventListener?(this._options.keyboardNavigation&&window.addEventListener("keydown",c._onKeyDown,!0),window.addEventListener("resize",c._onResize,!0)):document.attachEvent&&(this._options.keyboardNavigation&&document.attachEvent("onkeydown",c._onKeyDown),document.attachEvent("onresize",c._onResize)));return!1}function y(a){if(null==a||"object"!=typeof a||"undefined"!=typeof a.nodeType)return a;var b={},c;for(c in a)b[c]="undefined"!=typeof jQuery&&a[c]instanceof jQuery?a[c]:y(a[c]);return b}function z(){this._direction="forward";"undefined"===typeof this._currentStep?this._currentStep=0:++this._currentStep;if(this._introItems.length<=this._currentStep)"function"===typeof this._introCompleteCallback&&this._introCompleteCallback.call(this),A.call(this,this._targetElement);else{var a=this._introItems[this._currentStep];"undefined"!==typeof this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,a.element);N.call(this,a)}}function E(){this._direction="backward";if(0===this._currentStep)return!1;var a=this._introItems[--this._currentStep];"undefined"!==typeof this._introBeforeChangeCallback&&this._introBeforeChangeCallback.call(this,a.element);N.call(this,a)}function A(a){var b=a.querySelectorAll(".introjs-overlay");if(b&&0<b.length)for(var c=b.length-1;0<=c;c--){var d=b[c];d.style.opacity=0;setTimeout(function(){this.parentNode&&this.parentNode.removeChild(this)}.bind(d),500)}(c=a.querySelector(".introjs-helperLayer"))&&c.parentNode.removeChild(c);(c=a.querySelector(".introjs-tooltipReferenceLayer"))&&c.parentNode.removeChild(c);(a=a.querySelector(".introjs-disableInteraction"))&&a.parentNode.removeChild(a);(a=document.querySelector(".introjsFloatingElement"))&&a.parentNode.removeChild(a);if(a=document.querySelector(".introjs-showElement"))a.className=a.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,"");if((a=document.querySelectorAll(".introjs-fixParent"))&&0<a.length)for(c=a.length-1;0<=c;c--)a[c].className=a[c].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");window.removeEventListener?window.removeEventListener("keydown",this._onKeyDown,!0):document.detachEvent&&document.detachEvent("onkeydown",this._onKeyDown);this._currentStep=void 0}function G(a,b,c,d,f){var e="",g,l;f=f||!1;b.style.top=null;b.style.right=null;b.style.bottom=null;b.style.left=null;b.style.marginLeft=null;b.style.marginTop=null;c.style.display="inherit";"undefined"!=typeof d&&null!=d&&(d.style.top=null,d.style.left=null);if(this._introItems[this._currentStep]){e=this._introItems[this._currentStep];e="string"===typeof e.tooltipClass?e.tooltipClass:this._options.tooltipClass;b.className=("introjs-tooltip "+e).replace(/^\s+|\s+$/g,"");l=this._introItems[this._currentStep].position;if(("auto"==l||"auto"==this._options.tooltipPosition)&&"floating"!=l){e=l;g=this._options.positionPrecedence.slice();l=H();var x=t(b).height+10,q=t(b).width+20,k=t(a),m="floating";k.left+q>l.width||0>k.left+k.width/2-q?(s(g,"bottom"),s(g,"top")):(k.height+k.top+x>l.height&&s(g,"bottom"),0>k.top-x&&s(g,"top"));k.width+k.left+q>l.width&&s(g,"right");0>k.left-q&&s(g,"left");0<g.length&&(m=g[0]);e&&"auto"!=e&&-1<g.indexOf(e)&&(m=e);l=m}e=t(a);a=t(b);g=H();switch(l){case"top":c.className="introjs-arrow bottom";I(e,f?0:15,a,g,b);b.style.bottom=e.height+20+"px";break;case"right":b.style.left=e.width+20+"px";e.top+a.height>g.height?(c.className="introjs-arrow left-bottom",b.style.top="-"+(a.height-e.height-20)+"px"):c.className="introjs-arrow left";break;case"left":f||!0!=this._options.showStepNumbers||(b.style.top="15px");e.top+a.height>g.height?(b.style.top="-"+(a.height-e.height-20)+"px",c.className="introjs-arrow right-bottom"):c.className="introjs-arrow right";b.style.right=e.width+20+"px";break;case"floating":c.style.display="none";b.style.left="50%";b.style.top="50%";b.style.marginLeft="-"+a.width/2+"px";b.style.marginTop="-"+a.height/2+"px";"undefined"!=typeof d&&null!=d&&(d.style.left="-"+(a.width/2+18)+"px",d.style.top="-"+(a.height/2+18)+"px");break;case"bottom-right-aligned":c.className="introjs-arrow top-right";O(e,0,a,b);b.style.top=e.height+20+"px";break;case"bottom-middle-aligned":c.className="introjs-arrow top-middle";c=e.width/2-a.width/2;f&&(c+=5);O(e,c,a,b)&&(b.style.right=null,I(e,c,a,g,b));b.style.top=e.height+20+"px";break;default:c.className="introjs-arrow top",I(e,0,a,g,b),b.style.top=e.height+20+"px"}}}function I(a,b,c,d,f){if(a.left+b+c.width>d.width)return f.style.left=d.width-c.width-a.left+"px",!1;f.style.left=b+"px";return!0}function O(a,b,c,d){if(0>a.left+a.width-b-c.width)return d.style.left=-a.left+"px",!1;d.style.right=b+"px";return!0}function s(a,b){-1<a.indexOf(b)&&a.splice(a.indexOf(b),1)}function r(a){if(a&&this._introItems[this._currentStep]){var b=this._introItems[this._currentStep],c=t(b.element),d=10;J(b.element)?a.className+=" introjs-fixedTooltip":a.className=a.className.replace(" introjs-fixedTooltip","");"floating"==b.position&&(d=0);a.setAttribute("style","width: "+(c.width+d)+"px; height:"+(c.height+d)+"px; top:"+(c.top-5)+"px;left: "+(c.left-5)+"px;")}}function V(){var a=document.querySelector(".introjs-disableInteraction");null===a&&(a=document.createElement("div"),a.className="introjs-disableInteraction",this._targetElement.appendChild(a));r.call(this,a)}function D(a){a.setAttribute("role","button");a.tabIndex=0}function N(a){"undefined"!==typeof this._introChangeCallback&&this._introChangeCallback.call(this,a.element);var b=this,c=document.querySelector(".introjs-helperLayer"),d=document.querySelector(".introjs-tooltipReferenceLayer"),f="introjs-helperLayer";t(a.element);"string"===typeof a.highlightClass&&(f+=" "+a.highlightClass);"string"===typeof this._options.highlightClass&&(f+=" "+this._options.highlightClass);if(null!=c){var e=d.querySelector(".introjs-helperNumberLayer"),g=d.querySelector(".introjs-tooltiptext"),l=d.querySelector(".introjs-arrow"),x=d.querySelector(".introjs-tooltip"),q=d.querySelector(".introjs-skipbutton"),k=d.querySelector(".introjs-prevbutton"),m=d.querySelector(".introjs-nextbutton");c.className=f;x.style.opacity=0;x.style.display="none";if(null!=e){var h=this._introItems[0<=a.step-2?a.step-2:0];if(null!=h&&"forward"==this._direction&&"floating"==h.position||"backward"==this._direction&&"floating"==a.position)e.style.opacity=0}r.call(b,c);r.call(b,d);if((h=document.querySelectorAll(".introjs-fixParent"))&&0<h.length)for(f=h.length-1;0<=f;f--)h[f].className=h[f].className.replace(/introjs-fixParent/g,"").replace(/^\s+|\s+$/g,"");if(h=document.querySelector(".introjs-showElement"))h.className=h.className.replace(/introjs-[a-zA-Z]+/g,"").replace(/^\s+|\s+$/g,"");b._lastShowElementTimer&&clearTimeout(b._lastShowElementTimer);b._lastShowElementTimer=setTimeout((function(){null!=e&&(e.innerHTML=a.step);g.innerHTML=a.intro;x.style.display="block";G.call(b,a.element,x,l,e);b._options.showBullets&&(d.querySelector(".introjs-bullets li > a.active").className="",d.querySelector('.introjs-bullets li > a[data-stepnumber="'+a.step+'"]').className="active");d.querySelector(".introjs-progress .introjs-progressbar").setAttribute("style","width:"+P.call(b)+"%;");x.style.opacity=1;e&&(e.style.opacity=1);-1===m.tabIndex?q.focus():m.focus()}),350)}else{var p=document.createElement("div"),k=document.createElement("div"),c=document.createElement("div"),n=document.createElement("div"),s=document.createElement("div"),w=document.createElement("div"),F=document.createElement("div"),u=document.createElement("div");p.className=f;k.className="introjs-tooltipReferenceLayer";r.call(b,p);r.call(b,k);this._targetElement.appendChild(p);this._targetElement.appendChild(k);c.className="introjs-arrow";s.className="introjs-tooltiptext";s.innerHTML=a.intro;w.className="introjs-bullets";!1===this._options.showBullets&&(w.style.display="none");for(var p=document.createElement("ul"),f=0,C=this._introItems.length;f<C;f++){var y=document.createElement("li"),B=document.createElement("a");B.onclick=function(){b.goToStep(this.getAttribute("data-stepnumber"))};f===a.step-1&&(B.className="active");D(B);B.innerHTML="&nbsp;";B.setAttribute("data-stepnumber",this._introItems[f].step);y.appendChild(B);p.appendChild(y)}w.appendChild(p);F.className="introjs-progress";!1===this._options.showProgress&&(F.style.display="none");f=document.createElement("div");f.className="introjs-progressbar";f.setAttribute("style","width:"+P.call(this)+"%;");F.appendChild(f);u.className="introjs-tooltipbuttons";!1===this._options.showButtons&&(u.style.display="none");n.className="introjs-tooltip";n.appendChild(s);n.appendChild(w);n.appendChild(F);!0==this._options.showStepNumbers&&(h=document.createElement("span"),h.className="introjs-helperNumberLayer",h.innerHTML=a.step,k.appendChild(h));n.appendChild(c);k.appendChild(n);m=document.createElement("a");m.onclick=function(){b._introItems.length-1!=b._currentStep&&z.call(b)};D(m);m.innerHTML=this._options.nextLabel;k=document.createElement("a");k.onclick=function(){0!=b._currentStep&&E.call(b)};D(k);k.innerHTML=this._options.prevLabel;q=document.createElement("a");q.className="introjs-button introjs-skipbutton";D(q);q.innerHTML=this._options.skipLabel;q.onclick=function(){b._introItems.length-1==b._currentStep&&"function"===typeof b._introCompleteCallback&&b._introCompleteCallback.call(b);b._introItems.length-1!=b._currentStep&&"function"===typeof b._introExitCallback&&b._introExitCallback.call(b);A.call(b,b._targetElement)};u.appendChild(q);1<this._introItems.length&&(u.appendChild(k),u.appendChild(m));n.appendChild(u);G.call(b,a.element,n,c,h)}!0===this._options.disableInteraction&&V.call(b);k.removeAttribute("tabIndex");m.removeAttribute("tabIndex");0==this._currentStep&&1<this._introItems.length?(m.className="introjs-button introjs-nextbutton",!0==this._options.hidePrev?(k.className="introjs-button introjs-prevbutton introjs-hidden",m.className+=" introjs-fullbutton"):k.className="introjs-button introjs-prevbutton introjs-disabled",k.tabIndex="-1",q.innerHTML=this._options.skipLabel):this._introItems.length-1==this._currentStep||1==this._introItems.length?(q.innerHTML=this._options.doneLabel,k.className="introjs-button introjs-prevbutton",!0==this._options.hideNext?(m.className="introjs-button introjs-nextbutton introjs-hidden",k.className+=" introjs-fullbutton"):m.className="introjs-button introjs-nextbutton introjs-disabled",m.tabIndex="-1"):(k.className="introjs-button introjs-prevbutton",m.className="introjs-button introjs-nextbutton",q.innerHTML=this._options.skipLabel);m.focus();a.element.className+=" introjs-showElement";h=v(a.element,"position");"absolute"!==h&&("relative"!==h&&"fixed"!==h)&&(a.element.className+=" introjs-relativePosition");for(h=a.element.parentNode;null!=h&&h.tagName&&"body"!==h.tagName.toLowerCase();){c=v(h,"z-index");n=parseFloat(v(h,"opacity"));u=v(h,"transform")||v(h,"-webkit-transform")||v(h,"-moz-transform")||v(h,"-ms-transform")||v(h,"-o-transform");if(/[0-9]+/.test(c)||1>n||"none"!==u&&void 0!==u)h.className+=" introjs-fixParent";h=h.parentNode}W(a.element)||!0!==this._options.scrollToElement||(n=a.element.getBoundingClientRect(),h=H().height,c=n.bottom-(n.bottom-n.top),n=n.bottom-h,0>c||a.element.clientHeight>h?window.scrollBy(0,c-this._options.scrollPadding):window.scrollBy(0,n+70+this._options.scrollPadding));"undefined"!==typeof this._introAfterChangeCallback&&this._introAfterChangeCallback.call(this,a.element)}function v(a,b){var c="";a.currentStyle?c=a.currentStyle[b]:document.defaultView&&document.defaultView.getComputedStyle&&(c=document.defaultView.getComputedStyle(a,null).getPropertyValue(b));return c&&c.toLowerCase?c.toLowerCase():c}function J(a){var b=a.parentNode;return b&&"HTML"!==b.nodeName?"fixed"==v(a,"position")?!0:J(b):!1}function H(){if(void 0!=window.innerWidth)return{width:window.innerWidth,height:window.innerHeight};var a=document.documentElement;return{width:a.clientWidth,height:a.clientHeight}}function W(a){a=a.getBoundingClientRect();return 0<=a.top&&0<=a.left&&a.bottom+80<=window.innerHeight&&a.right<=window.innerWidth}function U(a){var b=document.createElement("div"),c="",d=this;b.className="introjs-overlay";if(a.tagName&&"body"!==a.tagName.toLowerCase()){var f=t(a);f&&(c+="width: "+f.width+"px; height:"+f.height+"px; top:"+f.top+"px;left: "+f.left+"px;",b.setAttribute("style",c))}else c+="top: 0;bottom: 0; left: 0;right: 0;position: fixed;",b.setAttribute("style",c);a.appendChild(b);b.onclick=function(){!0==d._options.exitOnOverlayClick&&(void 0!=d._introExitCallback&&d._introExitCallback.call(d),A.call(d,a))};setTimeout((function(){c+="opacity: "+d._options.overlayOpacity.toString()+";";b.setAttribute("style",c)}),10);return!0}function w(){var a=this._targetElement.querySelector(".introjs-hintReference");if(a){var b=a.getAttribute("data-step");a.parentNode.removeChild(a);return b}}function Q(a){this._introItems=[];if(this._options.hints){a=0;for(var b=this._options.hints.length;a<b;a++){var c=y(this._options.hints[a]);"string"===typeof c.element&&(c.element=document.querySelector(c.element));c.hintPosition=c.hintPosition||this._options.hintPosition;c.hintAnimation=c.hintAnimation||this._options.hintAnimation;null!=c.element&&this._introItems.push(c)}}else{c=a.querySelectorAll("*[data-hint]");if(1>c.length)return!1;a=0;for(b=c.length;a<b;a++){var d=c[a],f=d.getAttribute("data-hintAnimation"),f=f?"true"==f:this._options.hintAnimation;this._introItems.push({element:d,hint:d.getAttribute("data-hint"),hintPosition:d.getAttribute("data-hintPosition")||this._options.hintPosition,hintAnimation:f,tooltipClass:d.getAttribute("data-tooltipClass"),position:d.getAttribute("data-position")||this._options.tooltipPosition})}}X.call(this);document.addEventListener?(document.addEventListener("click",w.bind(this),!1),window.addEventListener("resize",K.bind(this),!0)):document.attachEvent&&(document.attachEvent("onclick",w.bind(this)),document.attachEvent("onresize",K.bind(this)))}function K(){for(var a=0,b=this._introItems.length;a<b;a++){var c=this._introItems[a];"undefined"!=typeof c.targetElement&&R.call(this,c.hintPosition,c.element,c.targetElement)}}function L(a){w.call(this);var b=this._targetElement.querySelector('.introjs-hint[data-step="'+a+'"]');b&&(b.className+=" introjs-hidehint");"undefined"!==typeof this._hintCloseCallback&&this._hintCloseCallback.call(this,a)}function S(a){if(a=this._targetElement.querySelector('.introjs-hint[data-step="'+a+'"]'))a.className=a.className.replace(/introjs\-hidehint/g,"")}function X(){var a=this,b=document.querySelector(".introjs-hints");null==b&&(b=document.createElement("div"),b.className="introjs-hints");for(var c=0,d=this._introItems.length;c<d;c++){var f=this._introItems[c];if(!document.querySelector('.introjs-hint[data-step="'+c+'"]')){var e=document.createElement("a");D(e);(function(b,c,d){b.onclick=function(e){e=e?e:window.event;e.stopPropagation&&e.stopPropagation();null!=e.cancelBubble&&(e.cancelBubble=!0);Y.call(a,b,c,d)}})(e,f,c);e.className="introjs-hint";f.hintAnimation||(e.className+=" introjs-hint-no-anim");J(f.element)&&(e.className+=" introjs-fixedhint");var g=document.createElement("div");g.className="introjs-hint-dot";var l=document.createElement("div");l.className="introjs-hint-pulse";e.appendChild(g);e.appendChild(l);e.setAttribute("data-step",c);f.targetElement=f.element;f.element=e;R.call(this,f.hintPosition,e,f.targetElement);b.appendChild(e)}}document.body.appendChild(b);"undefined"!==typeof this._hintsAddedCallback&&this._hintsAddedCallback.call(this)}function R(a,b,c){c=t.call(this,c);switch(a){default:case"top-left":b.style.left=c.left+"px";b.style.top=c.top+"px";break;case"top-right":b.style.left=c.left+c.width+"px";b.style.top=c.top+"px";break;case"bottom-left":b.style.left=c.left+"px";b.style.top=c.top+c.height+"px";break;case"bottom-right":b.style.left=c.left+c.width+"px";b.style.top=c.top+c.height+"px";break;case"bottom-middle":b.style.left=c.left+c.width/2+"px";b.style.top=c.top+c.height+"px";break;case"top-middle":b.style.left=c.left+c.width/2+"px",b.style.top=c.top+"px"}}function Y(a,b,c){"undefined"!==typeof this._hintClickCallback&&this._hintClickCallback.call(this,a,b,c);var d=w.call(this);if(parseInt(d,10)!=c){var d=document.createElement("div"),f=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div");d.className="introjs-tooltip";d.onclick=function(a){a.stopPropagation?a.stopPropagation():a.cancelBubble=!0};f.className="introjs-tooltiptext";var l=document.createElement("p");l.innerHTML=b.hint;b=document.createElement("a");b.className="introjs-button";b.innerHTML=this._options.hintButtonLabel;b.onclick=L.bind(this,c);f.appendChild(l);f.appendChild(b);e.className="introjs-arrow";d.appendChild(e);d.appendChild(f);this._currentStep=a.getAttribute("data-step");g.className="introjs-tooltipReferenceLayer introjs-hintReference";g.setAttribute("data-step",a.getAttribute("data-step"));r.call(this,g);g.appendChild(d);document.body.appendChild(g);G.call(this,a,d,e,null,!0)}}function t(a){var b={};b.width=a.offsetWidth;b.height=a.offsetHeight;for(var c=0,d=0;a&&!isNaN(a.offsetLeft)&&!isNaN(a.offsetTop);)c+=a.offsetLeft,d+=a.offsetTop,a=a.offsetParent;b.top=d;b.left=c;return b}function P(){return 100*(parseInt(this._currentStep+1,10)/this._introItems.length)}var M=function(a){if("object"===typeof a)return new p(a);if("string"===typeof a){if(a=document.querySelector(a))return new p(a);throw Error("There is no element with given selector.")}return new p(document.body)};M.version="2.4.0";M.fn=p.prototype={clone:function(){return new p(this)},setOption:function(a,b){this._options[a]=b;return this},setOptions:function(a){var b=this._options,c={},d;for(d in b)c[d]=b[d];for(d in a)c[d]=a[d];this._options=c;return this},start:function(){T.call(this,this._targetElement);return this},goToStep:function(a){this._currentStep=a-2;"undefined"!==typeof this._introItems&&z.call(this);return this},addStep:function(a){this._options.steps||(this._options.steps=[]);this._options.steps.push(a);return this},addSteps:function(a){if(a.length){for(var b=0;b<a.length;b++)this.addStep(a[b]);return this}},nextStep:function(){z.call(this);return this},previousStep:function(){E.call(this);return this},exit:function(){A.call(this,this._targetElement);return this},refresh:function(){r.call(this,document.querySelector(".introjs-helperLayer"));r.call(this,document.querySelector(".introjs-tooltipReferenceLayer"));K.call(this);return this},onbeforechange:function(a){if("function"===typeof a)this._introBeforeChangeCallback=a;else throw Error("Provided callback for onbeforechange was not a function");return this},onchange:function(a){if("function"===typeof a)this._introChangeCallback=a;else throw Error("Provided callback for onchange was not a function.");return this},onafterchange:function(a){if("function"===typeof a)this._introAfterChangeCallback=a;else throw Error("Provided callback for onafterchange was not a function");return this},oncomplete:function(a){if("function"===typeof a)this._introCompleteCallback=a;else throw Error("Provided callback for oncomplete was not a function.");return this},onhintsadded:function(a){if("function"===typeof a)this._hintsAddedCallback=a;else throw Error("Provided callback for onhintsadded was not a function.");return this},onhintclick:function(a){if("function"===typeof a)this._hintClickCallback=a;else throw Error("Provided callback for onhintclick was not a function.");return this},onhintclose:function(a){if("function"===typeof a)this._hintCloseCallback=a;else throw Error("Provided callback for onhintclose was not a function.");return this},onexit:function(a){if("function"===typeof a)this._introExitCallback=a;else throw Error("Provided callback for onexit was not a function.");return this},addHints:function(){Q.call(this,this._targetElement);return this},hideHint:function(a){L.call(this,a);return this},hideHints:function(){var a=this._targetElement.querySelectorAll(".introjs-hint");if(a&&0<a.length)for(var b=0;b<a.length;b++)L.call(this,a[b].getAttribute("data-step"));return this},showHint:function(a){S.call(this,a);return this},showHints:function(){var a=this._targetElement.querySelectorAll(".introjs-hint");if(a&&0<a.length)for(var b=0;b<a.length;b++)S.call(this,a[b].getAttribute("data-step"));else Q.call(this,this._targetElement);return this}};return C.introJs=M}));
/*! jQuery UI - v1.12.1 - 2016-09-14
* http://jqueryui.com
* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})((function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,(function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")})).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,(function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)})),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,(function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)})),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each((function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")})):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each((function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))}))),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,(function(t,i){e._removeClass(i,t)})),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,(function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))}))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,(function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)}))},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},(function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue((function(i){t(this)[e](),o&&o.call(s[0]),i()}))}})),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],(function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each((function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=l+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),I=e(k.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?D.left-=l:"center"===n.my[0]&&(D.left-=l/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=I[0],D.top+=I[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],(function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+I[0],u[1]+I[1]],my:n.my,at:n.at,within:b,elem:h})})),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-l,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:h,left:D.left,top:D.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))}))},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo((function(e){return function(i){return!!t.data(i,e)}})):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",(function(t){t.preventDefault()}))}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,(function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e})),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,(function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}})),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,(function(t,e){p[e.idx]=i(n[e.idx],e)})),this):"object"===d?(n instanceof l?f(c,(function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())})):f(c,(function(e,s){var o=s.cache;f(s.props,(function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)})),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))})),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,(function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,(function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e}))),s})),s},_space:function(){var t=[],e=this;return f(c,(function(i,s){e[s.cache]&&t.push(i)})),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,(function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))})),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,(function(t,e){return(1-s)*n[e]+s*t})))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,(function(t,e){return null==t?e>2?1:0:t}));return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),(function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t}));return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,(function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t})).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,(function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,(function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)})),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,(function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})}))})),l.hook=function(e){var i=e.split(" ");f(i,(function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}}))},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],(function(i,s){e["border"+s+"Color"]=t})),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],(function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}})),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue((function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map((function(){var i=t(this);return{el:i,start:e(this)}})),o=function(){t.each(s,(function(t,e){n[e]&&a[e+"Class"](n[e])}))},o(),l=l.map((function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this})),a.attr("class",r),l=l.map((function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()})),t.when.apply(t,l.get()).done((function(){o(),t.each(arguments,(function(){var e=this.el;t.each(this.diff,(function(t){e.css(t,"")}))})),h.complete.call(a[0])}))}))},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],(function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")})),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),float:e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,(function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])})),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each((function(){h&&h.call(this)})):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],(function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])})),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,(function(){d.remove(),t.isFunction(i)&&i()}))}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],(function(t,i){e[i]=function(e){return Math.pow(e,t+2)}})),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,(function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}}))}();var f=t.effects;t.effects.define("blind","hide",(function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})})),t.effects.define("bounce",(function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)})),t.effects.define("clip","hide",(function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})})),t.effects.define("drop","hide",(function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})})),t.effects.define("explode","hide",(function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)})),t.effects.define("fade","toggle",(function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})})),t.effects.define("fold","hide",(function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue((function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()})).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)})),t.effects.define("highlight","show",(function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})})),t.effects.define("size",(function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each((function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,(function(){u&&t.effects.restoreStyle(i)}))}))),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})})),t.effects.define("scale",(function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)})),t.effects.define("puff","hide",(function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)})),t.effects.define("pulsate","show",(function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)})),t.effects.define("shake",(function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)})),t.effects.define("slide","show",(function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}));var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",(function(e,i){t(this).transfer(e,i)}))),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout((function(){var i=e.data("ui-form-reset-instances");t.each(i,(function(){this.refresh()}))}))},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],(function(e,i){function s(e,i,s,o){return t.each(n,(function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)})),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each((function(){t(this).css(o,s(this,e)+"px")}))},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each((function(){t(this).css(o,s(this,e,!0,n)+"px")}))}})),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter((function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))})).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each((function(){this.id||(this.id="ui-id-"+ ++t)}))}}(),removeUniqueId:function(){return this.each((function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")}))}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each((function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)})).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each((function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))})),this.headers.each((function(){e-=t(this).outerHeight(!0)})),this.headers.next().each((function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))})).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each((function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()})).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),(function(t,e){i[e]="_eventHandler"})),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter((function(){return 0===parseInt(t(this).attr("tabIndex"),10)})).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay((function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)}))},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each((function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()}))},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay((function(){delete this.previousFilter}),1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each((function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))})),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each((function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")})),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay((function(){this._close()}),this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay((function(){this._close(),this._open(t)}),this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay((function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s}),this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay((function(){this.focus(t,e)})))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each((function(){return i=t(this),0>i.offset().top-s-n})),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each((function(){return i=t(this),i.offset().top-s+n>0})),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter((function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))}))}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay((function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")}))},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",(function(){t(e.target).trigger(e.originalEvent)})),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay((function(){this.previous=n,this.selectedItem=s}))),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay((function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))}),this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy((function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}),this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,(function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})}))},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,(function(t,i){s._renderItemData(e,i)}))},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,(function(t){return s.test(t.label||t.value||t)}))}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var g=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,(function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each((function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")})),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each((function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}}))),void 0):void 0})),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each((function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()}))},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,(function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(g,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")})),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],(function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)})),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each((function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML})),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter((function(){return 0===t(this).form().length})),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each((function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")}))},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var m;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1})))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),m===n&&(m=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each((function(){this.disabled=!1})).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,(function(t){return t===e?null:t})))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each((function(){this.disabled=!0})).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,(function(t){return t===e?null:t})),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each((function(){return r|="fixed"===t(this).css("position"),!r})),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))}},_updateDatepicker:function(e){this.maxRows=4,m=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout((function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null}),0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(h).match(o);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,(function(t,e){return[[e,t]]})).sort((function(t,e){return-(t[1].length-e[1].length)}));if(t.each(a,(function(t,e){var s=e[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],h+=s.length,!1):void 0})),-1!==o)return o+1;throw"Unknown name at position "+h},x=function(){if(i.charAt(h)!==e.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>h&&(a=i.substr(h),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map((function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])}))},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,L,R=new Date,B=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&Q>e?Q:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,Q,J,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,P+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(te,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X?this.maxRows>z?this.maxRows:z:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(te,Z,1-H)),N=0;O>N;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],F=A.getMonth()!==Z,L=F&&!v||!E[0]||Q&&Q>A||J&&A>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?"&#xa0;":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),T+="</tbody></table>"+(X?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=T}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each((function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)})):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var _=!1;t(document).on("mouseup",(function(){_=!1})),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,(function(t){return e._mouseDown(t)})).on("click."+this.widgetName,(function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0})),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!_){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout((function(){i.mouseDelayMet=!0}),this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),_=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,_=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map((function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]}))},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter((function(){return"fixed"===t(this).css("position")})).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),(function(){i._trigger("stop",e)!==!1&&i._clear()})):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each((function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))}))},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,(function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))}))},drag:function(e,i,s){t.each(s.sortables,(function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,(function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n}))),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,(function(){this.refreshPositions()})),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,(function(){this.refreshPositions()})))}))}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each((function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})}))},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-g>_||m>l+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(h-_),r=g>=Math.abs(l-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(h-m),r=g>=Math.abs(l-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort((function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)}));a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each((function(e){t(this).css("zIndex",n+e)})),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",(function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())})).on("mouseleave",(function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",(function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")})),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each((function(t,s){i[t]=h._num(e.css("padding"+s))})),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each((function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})}))},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each((function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,(function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)})),e.css(n)}))},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),g&&(p-=l),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,(function(){i._trigger("close",e)})))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map((function(){return+t(this).css("z-index")})).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,(function(){e._focusTabbable(),e._trigger("focus")})),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),void 0;if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay((function(){n.trigger("focus")})),e.preventDefault()):(this._delay((function(){s.trigger("focus")})),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(t.each(i,(function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",(function(){n.apply(e.element[0],arguments)}))})),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),h=a.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,(function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)})),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(s=o.is(":data(ui-draggable)"),s&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=o.is(":data(ui-resizable)"),n&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map((function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]}))},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay((function(){e=!1})),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],void 0):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each((function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&v(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0})),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var v=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,h=a+e.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=l&&u>=r&&a>=c&&d>=h;case"intersect":return o+e.helperProportions.width/2>l&&u>r-e.helperProportions.width/2&&a+e.helperProportions.height/2>c&&d>h-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,l,i.proportions().width);case"touch":return(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d)&&(o>=l&&u>=o||r>=l&&u>=r||l>o&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),(function(){this.options&&(!this.options.disabled&&this.visible&&v(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))})),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",(function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}))},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],(function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=v(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter((function(){return t(this).droppable("instance").options.scope===n})),o.length&&(s=t(o[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}}))},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),void 0)},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each((function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})}))},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each((function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))})),t(e.target).parents().addBack().each((function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0})))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each((function(){var i=t.data(this,"selectable-item"),l=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?l=!(c.left>r||o>c.right||c.top>h||a>c.bottom):"fit"===n.tolerance&&(l=c.left>o&&r>c.right&&c.top>a&&h>c.bottom),l?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))})),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each((function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})})),t(".ui-selecting",this.element[0]).each((function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})})),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",(function(){i._rendered||i._refreshMenu()}))},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,(function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)}))},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0),s.length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?(this.button.css("width",""),void 0):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each((function(e,n){s.push(i._parseOption(t(n),e))})),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each((function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)}))},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each((function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)})),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each((function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i})):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,(function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")}))},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each((function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0})),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each((function(){this===e.target&&(n=!0)})),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,(function(){s._clear(e)}))}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each((function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))})),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each((function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")})),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,(function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0}))},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each((function(){t("<td>&#160;</td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)}))},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay((function(){n===this.counter&&this.refreshPositions(!s)}))},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push((function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push((function(t){this._trigger("update",t,this._uiHash())})),this!==this.currentContainer&&(e||(n.push((function(t){this._trigger("remove",t,this._uiHash())})),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],(function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)})),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay((function(){this.spinning&&this._stop(t)}),100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay((function(){this.previous=s})))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay((function(){delete this.cancelBlur,i.call(this)})),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay((function(){this._repeat(40,e,i)}),t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r((function(t){this._super(t)})),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r((function(t){this._stepUp(t)})),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r((function(t){this._stepDown(t)})),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r((function(t){this._stepUp((t||1)*this.options.page)})),pageDown:r((function(t){this._stepDown((t||1)*this.options.page)})),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),(function(t){return e.tabs.index(t)})))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each((function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0})),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay((function(){this.option("active",s)}),this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),(function(t){return i.index(t)})),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",(function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()})).on("focus"+this.eventNamespace,".ui-tabs-anchor",(function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()})),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map((function(){return t("a",this)[0]})).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each((function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=h.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)})),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),(function(t,e){i[e]="_eventHandler"})),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each((function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))})),this.element.children().not(this.panels).each((function(){i-=t(this).outerHeight(!0)})),this.panels.each((function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))})).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each((function(){i=Math.max(i,t(this).height("").height())})).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,(function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()})):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter((function(){return 0===t(this).attr("tabIndex")})).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each((function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")})),this.tabs.each((function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")})),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,(function(t){return t!==e?t:null})):t.map(this.tabs,(function(t,i){return i!==e?i:null}))),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done((function(t,e,n){setTimeout((function(){a.html(t),s._trigger("load",i,r),h(n,e)}),1)})).fail((function(t,e){setTimeout((function(){h(t,e)}),1)}))))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,(function(t,e){s._updateContent(e.element)}))},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,(function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)})),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter((function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0})))},_enable:function(){this.disabledTitles.each((function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each((function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))})),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],(function(i){n._delay((function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))}))})),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){l.of=t,a.is(":hidden")||a.position(l)}var o,a,r,h,l=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),h=t("<div>").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval((function(){a.is(":visible")&&(n(l.of),clearInterval(r))}),t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,(function(){s._removeTooltip(t(this))})),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,(function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]})),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,(function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))})),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip}));/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,(function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,(function(b,c){return a.call(b,c,b)})))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(a,b){j["[object "+b+"]"]=b.toLowerCase()}));function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"ï¿½":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta((function(a){return a.disabled===!0&&("form"in a||"label"in a)}),{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia((function(b){return b=+b,ia((function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))}))}))}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja((function(a){return a.className="i",!a.getAttribute("className")})),c.getElementsByTagName=ja((function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length})),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja((function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length})),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja((function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")})),ja((function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")}))),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja((function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)})),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,(function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")}))},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia((function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])})):function(a){return e(a,0,c)}):e}},pseudos:{not:ia((function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia((function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))})):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}})),has:ia((function(a){return function(b){return ga(a,b).length>0}})),contains:ia((function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}})),lang:ia((function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do{if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-")}while((b=b.parentNode)&&1===b.nodeType);return!1}})),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa((function(){return[0]})),last:pa((function(a,b){return[b-1]})),eq:pa((function(a,b,c){return[c<0?c+b:c]})),even:pa((function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a})),odd:pa((function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a})),lt:pa((function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a})),gt:pa((function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a}))}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia((function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)}))}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta((function(a){return a===b}),h,!0),l=ta((function(a){return I(b,a)>-1}),h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja((function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))})),ja((function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")}))||ka("type|href|height|width",(function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)})),c.attributes&&ja((function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")}))||ka("value",(function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue})),ja((function(a){return null==a.getAttribute("disabled")}))||ka(J,(function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null})),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,(function(a,d){return!!b.call(a,d,a)!==c})):b.nodeType?r.grep(a,(function(a){return a===b!==c})):"string"!=typeof b?r.grep(a,(function(a){return i.call(b,a)>-1!==c})):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,(function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,(function(a){return 1===a.nodeType})))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter((function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0})));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter((function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0}))},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},(function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}}));var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],(function(a,c){b[c]=!0})),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,(function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)}))}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,(function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--})),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},catch:function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred((function(b){r.each(c,(function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]]((function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)}))})),a=null})).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred((function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))})).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,(function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add((function(){d=h}),c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith})),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout((function(){throw b}))};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"]((function(a){r.readyException(a)})),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:X.test(a)?JSON.parse(a):a)}function $(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=Z(c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),$(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each((function(){W.set(this,a)})):S(this,(function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=$(f,a),void 0!==c)return c}else this.each((function(){W.set(this,a,b)}))}),null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each((function(){W.remove(this,a)}))}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add((function(){V.remove(a,[b+"queue",c])}))})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each((function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)}))},dequeue:function(a){return this.each((function(){r.dequeue(this,a)}))},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var _=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,aa=new RegExp("^(?:([+-])=|)("+_+")([a-z%]*)$","i"),ba=["Top","Right","Bottom","Left"],ca=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},da=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function ea(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&aa.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do{f=f||".5",k/=f,r.style(a,b,k+j)}while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var fa={};function ga(a){var b,c=a.ownerDocument,d=a.nodeName,e=fa[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),fa[d]=e,e)}function ha(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ca(d)&&(e[f]=ga(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ha(this,!0)},hide:function(){return ha(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each((function(){ca(this)?r(this).show():r(this).hide()}))}});var ia=/^(?:checkbox|radio)$/i,ja=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var oa=/<|&#?\w+;/;function pa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(oa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ja.exec(f)||["",""])[1].toLowerCase(),i=la[h]||la._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each((function(){r.event.add(this,b,e,d,c)}))}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==wa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===wa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ua:va,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:va,isPropagationStopped:va,isImmediatePropagationStopped:va,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ua,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ua,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ua,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&ra.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&sa.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}})),r.fn.extend({on:function(a,b,c,d){return xa(this,a,b,c,d)},one:function(a,b,c,d){return xa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=va),this.each((function(){r.event.remove(this,a,c,b)}))}});var ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/<script|<style|<link/i,Aa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ba=/^true\/(.*)/,Ca=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ha(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ia.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ia(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each((function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)}));if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,ma(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Fa),l=0;l<i;l++)j=h[l],ka.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ca,""),k))}return a}function Ja(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(ma(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&na(ma(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(ya,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);if(b)if(c)for(f=f||ma(a),g=g||ma(h),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);else Ga(a,h);return g=ma(h,"script"),g.length>0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,(function(a){return void 0===a?r.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)}))}),null,a,arguments.length)},append:function(){return Ia(this,arguments,(function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}}))},prepend:function(){return Ia(this,arguments,(function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}}))},before:function(){return Ia(this,arguments,(function(a){this.parentNode&&this.parentNode.insertBefore(a,this)}))},after:function(){return Ia(this,arguments,(function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)}))},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map((function(){return r.clone(this,a,b)}))},html:function(a){return S(this,(function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(ma(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)}),null,a,arguments.length)},replaceWith:function(){var a=[];return Ia(this,arguments,(function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(ma(this)),c&&c.replaceChild(b,this))}),a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}}));var Ka=/^margin/,La=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),Ma=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",qa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,qa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Na(a,b,c){var d,e,f,g,h=a.style;return c=c||Ma(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&La.test(g)&&Ka.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Oa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Pa=/^(none|table(?!-c[ea]).+)/,Qa={position:"absolute",visibility:"hidden",display:"block"},Ra={letterSpacing:"0",fontWeight:"400"},Sa=["Webkit","Moz","ms"],Ta=d.createElement("div").style;function Ua(a){if(a in Ta)return a;var b=a[0].toUpperCase()+a.slice(1),c=Sa.length;while(c--)if(a=Sa[c]+b,a in Ta)return a}function Va(a,b,c){var d=aa.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Wa(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ba[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ba[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ba[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ba[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ba[f]+"Width",!0,e)));return g}function Xa(a,b,c){var d,e=!0,f=Ma(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Na(a,b,f),(d<0||null==d)&&(d=a.style[b]),La.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Wa(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Na(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=aa.exec(c))&&e[1]&&(c=ea(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ua(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Na(a,b,d)),"normal"===e&&b in Ra&&(e=Ra[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],(function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Pa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Xa(a,b,d):da(a,Qa,(function(){return Xa(a,b,d)}))},set:function(a,c,d){var e,f=d&&Ma(a),g=d&&Wa(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=aa.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Va(a,c,g)}}})),r.cssHooks.marginLeft=Oa(o.reliableMarginLeft,(function(a,b){if(b)return(parseFloat(Na(a,"marginLeft"))||a.getBoundingClientRect().left-da(a,{marginLeft:0},(function(){return a.getBoundingClientRect().left})))+"px"})),r.each({margin:"",padding:"",border:"Width"},(function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ba[d]+b]=f[d]||f[d-2]||f[0];return e}},Ka.test(a)||(r.cssHooks[a+b].set=Va)})),r.fn.extend({css:function(a,b){return S(this,(function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=Ma(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)}),a,b,arguments.length>1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout((function(){Za=void 0})),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function fb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ca(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always((function(){m.always((function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()}))})));for(d in b)if(e=b[d],_a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ha([a],!0),j=a.style.display||j,k=r.css(a,"display"),ha([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done((function(){o.display=j})),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always((function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}))),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ha([a],!0),m.done((function(){p||ha([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])}))),i=eb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function gb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function hb(a,b,c){var d,e,f=0,g=hb.prefilters.length,h=r.Deferred().always((function(){delete i.elem})),i=function(){if(e)return!1;for(var b=Za||cb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Za||cb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(gb(k,j.opts.specialEasing);f<g;f++)if(d=hb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,eb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(hb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return ea(c.elem,a,aa.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],hb.tweeners[c]=hb.tweeners[c]||[],hb.tweeners[c].unshift(b)},prefilters:[fb],prefilter:function(a,b){b?hb.prefilters.unshift(a):hb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:"number"!=typeof e.duration&&(e.duration in r.fx.speeds?e.duration=r.fx.speeds[e.duration]:e.duration=r.fx.speeds._default),null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ca).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=hb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each((function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&ab.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)}))},finish:function(a){return a!==!1&&(a=a||"fx"),this.each((function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish}))}}),r.each(["toggle","show","hide"],(function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(db(b,!0),a,d,e)}})),r.each({slideDown:db("show"),slideUp:db("hide"),slideToggle:db("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}})),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Za=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Za=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){$a||($a=a.requestAnimationFrame?a.requestAnimationFrame(bb):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame($a):a.clearInterval($a),$a=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,(function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}}))},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var ib,jb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each((function(){r.removeAttr(this,a)}))}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),(function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}}));var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each((function(){delete this[r.propFix[a]||a]}))}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){r.propFix[this.toLowerCase()]=this}));function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each((function(b){r(this).addClass(a.call(this,b,nb(this)))}));if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each((function(b){r(this).removeClass(a.call(this,b,nb(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each((function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)})):this.each((function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))}))},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each((function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,(function(a){return null==a?"":a+""}))),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))}));if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],(function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}));var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each((function(){r.event.trigger(a,b,this)}))},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}})),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},(function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}}));var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,(function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)}));else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,(function(){e(this.name,this.value)}));else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this})).filter((function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))})).map((function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,(function(a){return{name:b.name,value:a.replace(ub,"\r\n")}})):{name:b.name,value:c.replace(ub,"\r\n")}})).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],(function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)})),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb+++n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout((function(){y.abort("timeout")}),o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],(function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}})),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map((function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a})).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each((function(b){r(this).wrapInner(a.call(this,b))})):this.each((function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)}))},wrap:function(a){var b=r.isFunction(a);return this.each((function(c){r(this).wrapAll(b?a.call(this,c):a)}))},unwrap:function(a){return this.parent(a).not("body").each((function(){r(this).replaceWith(this.childNodes)})),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport((function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout((function(){c&&d()}))},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}})),r.ajaxPrefilter((function(a){a.crossDomain&&(a.contents.script=!1)})),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",(function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")})),r.ajaxTransport("script",(function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}}));var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",(function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always((function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0})),"script"})),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=pa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=mb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done((function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)})).always(c&&function(a,b){g.each((function(){c.apply(this,f||[a.responseText,b,a])}))}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(a,b){r.fn[b]=function(a){return this.on(b,a)}})),r.expr.pseudos.animated=function(a){return r.grep(r.timers,(function(b){return a===b.elem})).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each((function(b){r.offset.setOffset(this,a,b)}));var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||qa}))}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,(function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)}),a,d,arguments.length)}})),r.each(["top","left"],(function(a,b){r.cssHooks[b]=Oa(o.pixelPosition,(function(a,c){if(c)return c=Na(a,b),La.test(c)?r(a).position()[b]+"px":c}))})),r.each({Height:"height",Width:"width"},(function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},(function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,(function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)}),b,g?e:void 0,g)}}))})),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return r}));var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r}));(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"){factory(require("jquery"))}else{factory(jQuery)}})((function($){"use strict";$.support.htmlMenuitem="HTMLMenuItemElement"in window;$.support.htmlCommand="HTMLCommandElement"in window;$.support.eventSelectstart="onselectstart"in document.documentElement;if(!$.ui||!$.widget){$.cleanData=function(orig){return function(elems){var events,elem,i;for(i=0;elems[i]!=null;i++){elem=elems[i];try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove")}}catch(e){}}orig(elems)}}($.cleanData)}var $currentTrigger=null,initialized=false,$win=$(window),counter=0,namespaces={},menus={},types={},defaults={selector:null,appendTo:null,trigger:"right",autoHide:false,delay:200,reposition:true,hideOnSecondTrigger:false,selectableSubMenu:false,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",visible:"context-menu-visible",notSelectable:"context-menu-not-selectable",icon:"context-menu-icon",iconEdit:"context-menu-icon-edit",iconCut:"context-menu-icon-cut",iconCopy:"context-menu-icon-copy",iconPaste:"context-menu-icon-paste",iconDelete:"context-menu-icon-delete",iconAdd:"context-menu-icon-add",iconQuit:"context-menu-icon-quit",iconLoadingClass:"context-menu-icon-loading"},determinePosition:function($menu){if($.ui&&$.ui.position){$menu.css("display","block").position({my:"center top",at:"center bottom",of:this,offset:"0 5",collision:"fit"}).css("display","none")}else{var offset=this.offset();offset.top+=this.outerHeight();offset.left+=this.outerWidth()/2-$menu.outerWidth()/2;$menu.css(offset)}},position:function(opt,x,y){var offset;if(!x&&!y){opt.determinePosition.call(this,opt.$menu);return}else if(x==="maintain"&&y==="maintain"){offset=opt.$menu.position()}else{var offsetParentOffset=opt.$menu.offsetParent().offset();offset={top:y-offsetParentOffset.top,left:x-offsetParentOffset.left}}var bottom=$win.scrollTop()+$win.height(),right=$win.scrollLeft()+$win.width(),height=opt.$menu.outerHeight(),width=opt.$menu.outerWidth();if(offset.top+height>bottom){offset.top-=height}if(offset.top<0){offset.top=0}if(offset.left+width>right){offset.left-=width}if(offset.left<0){offset.left=0}opt.$menu.css(offset)},positionSubmenu:function($menu){if(typeof $menu==="undefined"){return}if($.ui&&$.ui.position){$menu.css("display","block").position({my:"left top-5",at:"right top",of:this,collision:"flipfit fit"}).css("display","")}else{var offset={top:-9,left:this.outerWidth()-5};$menu.css(offset)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{show:$.noop,hide:$.noop,activated:$.noop},callback:null,items:{}},hoveract={timer:null,pageX:null,pageY:null},zindex=function($t){var zin=0,$tt=$t;while(true){zin=Math.max(zin,parseInt($tt.css("z-index"),10)||0);$tt=$tt.parent();if(!$tt||!$tt.length||"html body".indexOf($tt.prop("nodeName").toLowerCase())>-1){break}}return zin},handle={abortevent:function(e){e.preventDefault();e.stopImmediatePropagation()},contextmenu:function(e){var $this=$(this);if(e.data.trigger==="right"){e.preventDefault();e.stopImmediatePropagation()}if(e.data.trigger!=="right"&&e.data.trigger!=="demand"&&e.originalEvent){return}if(typeof e.mouseButton!=="undefined"&&e.data){if(!(e.data.trigger==="left"&&e.mouseButton===0)&&!(e.data.trigger==="right"&&e.mouseButton===2)){return}}if($this.hasClass("context-menu-active")){return}if(!$this.hasClass("context-menu-disabled")){$currentTrigger=$this;if(e.data.build){var built=e.data.build($currentTrigger,e);if(built===false){return}e.data=$.extend(true,{},defaults,e.data,built||{});if(!e.data.items||$.isEmptyObject(e.data.items)){if(window.console){(console.error||console.log).call(console,"No items specified to show in contextMenu")}throw new Error("No Items specified")}e.data.$trigger=$currentTrigger;op.create(e.data)}var showMenu=false;for(var item in e.data.items){if(e.data.items.hasOwnProperty(item)){var visible;if($.isFunction(e.data.items[item].visible)){visible=e.data.items[item].visible.call($(e.currentTarget),item,e.data)}else if(typeof e.data.items[item]!=="undefined"&&e.data.items[item].visible){visible=e.data.items[item].visible===true}else{visible=true}if(visible){showMenu=true}}}if(showMenu){op.show.call($this,e.data,e.pageX,e.pageY)}}},click:function(e){e.preventDefault();e.stopImmediatePropagation();$(this).trigger($.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))},mousedown:function(e){var $this=$(this);if($currentTrigger&&$currentTrigger.length&&!$currentTrigger.is($this)){$currentTrigger.data("contextMenu").$menu.trigger("contextmenu:hide")}if(e.button===2){$currentTrigger=$this.data("contextMenuActive",true)}},mouseup:function(e){var $this=$(this);if($this.data("contextMenuActive")&&$currentTrigger&&$currentTrigger.length&&$currentTrigger.is($this)&&!$this.hasClass("context-menu-disabled")){e.preventDefault();e.stopImmediatePropagation();$currentTrigger=$this;$this.trigger($.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))}$this.removeData("contextMenuActive")},mouseenter:function(e){var $this=$(this),$related=$(e.relatedTarget),$document=$(document);if($related.is(".context-menu-list")||$related.closest(".context-menu-list").length){return}if($currentTrigger&&$currentTrigger.length){return}hoveract.pageX=e.pageX;hoveract.pageY=e.pageY;hoveract.data=e.data;$document.on("mousemove.contextMenuShow",handle.mousemove);hoveract.timer=setTimeout((function(){hoveract.timer=null;$document.off("mousemove.contextMenuShow");$currentTrigger=$this;$this.trigger($.Event("contextmenu",{data:hoveract.data,pageX:hoveract.pageX,pageY:hoveract.pageY}))}),e.data.delay)},mousemove:function(e){hoveract.pageX=e.pageX;hoveract.pageY=e.pageY},mouseleave:function(e){var $related=$(e.relatedTarget);if($related.is(".context-menu-list")||$related.closest(".context-menu-list").length){return}try{clearTimeout(hoveract.timer)}catch(e){}hoveract.timer=null},layerClick:function(e){var $this=$(this),root=$this.data("contextMenuRoot"),button=e.button,x=e.pageX,y=e.pageY,fakeClick=x===undefined,target,offset;e.preventDefault();setTimeout((function(){if(fakeClick){if(root!==null&&typeof root!=="undefined"&&root.$menu!==null&&typeof root.$menu!=="undefined"){root.$menu.trigger("contextmenu:hide")}return}var $window;var triggerAction=root.trigger==="left"&&button===0||root.trigger==="right"&&button===2;if(document.elementFromPoint&&root.$layer){root.$layer.hide();target=document.elementFromPoint(x-$win.scrollLeft(),y-$win.scrollTop());if(target.isContentEditable){var range=document.createRange(),sel=window.getSelection();range.selectNode(target);range.collapse(true);sel.removeAllRanges();sel.addRange(range)}$(target).trigger(e);root.$layer.show()}if(root.hideOnSecondTrigger&&triggerAction&&root.$menu!==null&&typeof root.$menu!=="undefined"){root.$menu.trigger("contextmenu:hide");return}if(root.reposition&&triggerAction){if(document.elementFromPoint){if(root.$trigger.is(target)){root.position.call(root.$trigger,root,x,y);return}}else{offset=root.$trigger.offset();$window=$(window);offset.top+=$window.scrollTop();if(offset.top<=e.pageY){offset.left+=$window.scrollLeft();if(offset.left<=e.pageX){offset.bottom=offset.top+root.$trigger.outerHeight();if(offset.bottom>=e.pageY){offset.right=offset.left+root.$trigger.outerWidth();if(offset.right>=e.pageX){root.position.call(root.$trigger,root,x,y);return}}}}}}if(target&&triggerAction){root.$trigger.one("contextmenu:hidden",(function(){$(target).contextMenu({x:x,y:y,button:button})}))}if(root!==null&&typeof root!=="undefined"&&root.$menu!==null&&typeof root.$menu!=="undefined"){root.$menu.trigger("contextmenu:hide")}}),50)},keyStop:function(e,opt){if(!opt.isInput){e.preventDefault()}e.stopPropagation()},key:function(e){var opt={};if($currentTrigger){opt=$currentTrigger.data("contextMenu")||{}}if(typeof opt.zIndex==="undefined"){opt.zIndex=0}var targetZIndex=0;var getZIndexOfTriggerTarget=function(target){if(target.style.zIndex!==""){targetZIndex=target.style.zIndex}else{if(target.offsetParent!==null&&typeof target.offsetParent!=="undefined"){getZIndexOfTriggerTarget(target.offsetParent)}else if(target.parentElement!==null&&typeof target.parentElement!=="undefined"){getZIndexOfTriggerTarget(target.parentElement)}}};getZIndexOfTriggerTarget(e.target);if(opt.$menu&&parseInt(targetZIndex,10)>parseInt(opt.$menu.css("zIndex"),10)){return}switch(e.keyCode){case 9:case 38:handle.keyStop(e,opt);if(opt.isInput){if(e.keyCode===9&&e.shiftKey){e.preventDefault();if(opt.$selected){opt.$selected.find("input, textarea, select").blur()}if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("prevcommand")}return}else if(e.keyCode===38&&opt.$selected.find("input, textarea, select").prop("type")==="checkbox"){e.preventDefault();return}}else if(e.keyCode!==9||e.shiftKey){if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("prevcommand")}return}break;case 40:handle.keyStop(e,opt);if(opt.isInput){if(e.keyCode===9){e.preventDefault();if(opt.$selected){opt.$selected.find("input, textarea, select").blur()}if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("nextcommand")}return}else if(e.keyCode===40&&opt.$selected.find("input, textarea, select").prop("type")==="checkbox"){e.preventDefault();return}}else{if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("nextcommand")}return}break;case 37:handle.keyStop(e,opt);if(opt.isInput||!opt.$selected||!opt.$selected.length){break}if(!opt.$selected.parent().hasClass("context-menu-root")){var $parent=opt.$selected.parent().parent();opt.$selected.trigger("contextmenu:blur");opt.$selected=$parent;return}break;case 39:handle.keyStop(e,opt);if(opt.isInput||!opt.$selected||!opt.$selected.length){break}var itemdata=opt.$selected.data("contextMenu")||{};if(itemdata.$menu&&opt.$selected.hasClass("context-menu-submenu")){opt.$selected=null;itemdata.$selected=null;itemdata.$menu.trigger("nextcommand");return}break;case 35:case 36:if(opt.$selected&&opt.$selected.find("input, textarea, select").length){return}else{(opt.$selected&&opt.$selected.parent()||opt.$menu).children(":not(."+opt.classNames.disabled+", ."+opt.classNames.notSelectable+")")[e.keyCode===36?"first":"last"]().trigger("contextmenu:focus");e.preventDefault();return}break;case 13:handle.keyStop(e,opt);if(opt.isInput){if(opt.$selected&&!opt.$selected.is("textarea, select")){e.preventDefault();return}break}if(typeof opt.$selected!=="undefined"&&opt.$selected!==null){opt.$selected.trigger("mouseup")}return;case 32:case 33:case 34:handle.keyStop(e,opt);return;case 27:handle.keyStop(e,opt);if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("contextmenu:hide")}return;default:var k=String.fromCharCode(e.keyCode).toUpperCase();if(opt.accesskeys&&opt.accesskeys[k]){opt.accesskeys[k].$node.trigger(opt.accesskeys[k].$menu?"contextmenu:focus":"mouseup");return}break}e.stopPropagation();if(typeof opt.$selected!=="undefined"&&opt.$selected!==null){opt.$selected.trigger(e)}},prevItem:function(e){e.stopPropagation();var opt=$(this).data("contextMenu")||{};var root=$(this).data("contextMenuRoot")||{};if(opt.$selected){var $s=opt.$selected;opt=opt.$selected.parent().data("contextMenu")||{};opt.$selected=$s}var $children=opt.$menu.children(),$prev=!opt.$selected||!opt.$selected.prev().length?$children.last():opt.$selected.prev(),$round=$prev;while($prev.hasClass(root.classNames.disabled)||$prev.hasClass(root.classNames.notSelectable)||$prev.is(":hidden")){if($prev.prev().length){$prev=$prev.prev()}else{$prev=$children.last()}if($prev.is($round)){return}}if(opt.$selected){handle.itemMouseleave.call(opt.$selected.get(0),e)}handle.itemMouseenter.call($prev.get(0),e);var $input=$prev.find("input, textarea, select");if($input.length){$input.focus()}},nextItem:function(e){e.stopPropagation();var opt=$(this).data("contextMenu")||{};var root=$(this).data("contextMenuRoot")||{};if(opt.$selected){var $s=opt.$selected;opt=opt.$selected.parent().data("contextMenu")||{};opt.$selected=$s}var $children=opt.$menu.children(),$next=!opt.$selected||!opt.$selected.next().length?$children.first():opt.$selected.next(),$round=$next;while($next.hasClass(root.classNames.disabled)||$next.hasClass(root.classNames.notSelectable)||$next.is(":hidden")){if($next.next().length){$next=$next.next()}else{$next=$children.first()}if($next.is($round)){return}}if(opt.$selected){handle.itemMouseleave.call(opt.$selected.get(0),e)}handle.itemMouseenter.call($next.get(0),e);var $input=$next.find("input, textarea, select");if($input.length){$input.focus()}},focusInput:function(){var $this=$(this).closest(".context-menu-item"),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;root.$selected=opt.$selected=$this;root.isInput=opt.isInput=true},blurInput:function(){var $this=$(this).closest(".context-menu-item"),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;root.isInput=opt.isInput=false},menuMouseenter:function(){var root=$(this).data().contextMenuRoot;root.hovering=true},menuMouseleave:function(e){var root=$(this).data().contextMenuRoot;if(root.$layer&&root.$layer.is(e.relatedTarget)){root.hovering=false}},itemMouseenter:function(e){var $this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;root.hovering=true;if(e&&root.$layer&&root.$layer.is(e.relatedTarget)){e.preventDefault();e.stopImmediatePropagation()}(opt.$menu?opt:root).$menu.children("."+root.classNames.hover).trigger("contextmenu:blur").children(".hover").trigger("contextmenu:blur");if($this.hasClass(root.classNames.disabled)||$this.hasClass(root.classNames.notSelectable)){opt.$selected=null;return}$this.trigger("contextmenu:focus")},itemMouseleave:function(e){var $this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;if(root!==opt&&root.$layer&&root.$layer.is(e.relatedTarget)){if(typeof root.$selected!=="undefined"&&root.$selected!==null){root.$selected.trigger("contextmenu:blur")}e.preventDefault();e.stopImmediatePropagation();root.$selected=opt.$selected=opt.$node;return}if(opt&&opt.$menu&&opt.$menu.hasClass("context-menu-visible")){return}$this.trigger("contextmenu:blur")},itemClick:function(e){var $this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot,key=data.contextMenuKey,callback;if(!opt.items[key]||$this.is("."+root.classNames.disabled+", .context-menu-separator, ."+root.classNames.notSelectable)||$this.is(".context-menu-submenu")&&root.selectableSubMenu===false){return}e.preventDefault();e.stopImmediatePropagation();if($.isFunction(opt.callbacks[key])&&Object.prototype.hasOwnProperty.call(opt.callbacks,key)){callback=opt.callbacks[key]}else if($.isFunction(root.callback)){callback=root.callback}else{return}if(callback.call(root.$trigger,key,root,e)!==false){root.$menu.trigger("contextmenu:hide")}else if(root.$menu.parent().length){op.update.call(root.$trigger,root)}},inputClick:function(e){e.stopImmediatePropagation()},hideMenu:function(e,data){var root=$(this).data("contextMenuRoot");op.hide.call(root.$trigger,root,data&&data.force)},focusItem:function(e){e.stopPropagation();var $this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;if($this.hasClass(root.classNames.disabled)||$this.hasClass(root.classNames.notSelectable)){return}$this.addClass([root.classNames.hover,root.classNames.visible].join(" ")).parent().find(".context-menu-item").not($this).removeClass(root.classNames.visible).filter("."+root.classNames.hover).trigger("contextmenu:blur");opt.$selected=root.$selected=$this;if(opt&&opt.$node&&opt.$node.hasClass("context-menu-submenu")){opt.$node.addClass(root.classNames.hover)}if(opt.$node){root.positionSubmenu.call(opt.$node,opt.$menu)}},blurItem:function(e){e.stopPropagation();var $this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;if(opt.autoHide){$this.removeClass(root.classNames.visible)}$this.removeClass(root.classNames.hover);opt.$selected=null}},op={show:function(opt,x,y){var $trigger=$(this),css={};$("#context-menu-layer").trigger("mousedown");opt.$trigger=$trigger;if(opt.events.show.call($trigger,opt)===false){$currentTrigger=null;return}op.update.call($trigger,opt);opt.position.call($trigger,opt,x,y);if(opt.zIndex){var additionalZValue=opt.zIndex;if(typeof opt.zIndex==="function"){additionalZValue=opt.zIndex.call($trigger,opt)}css.zIndex=zindex($trigger)+additionalZValue}op.layer.call(opt.$menu,opt,css.zIndex);opt.$menu.find("ul").css("zIndex",css.zIndex+1);opt.$menu.css(css)[opt.animation.show](opt.animation.duration,(function(){$trigger.trigger("contextmenu:visible");op.activated(opt);opt.events.activated(opt)}));$trigger.data("contextMenu",opt).addClass("context-menu-active");$(document).off("keydown.contextMenu").on("keydown.contextMenu",handle.key);if(opt.autoHide){$(document).on("mousemove.contextMenuAutoHide",(function(e){var pos=$trigger.offset();pos.right=pos.left+$trigger.outerWidth();pos.bottom=pos.top+$trigger.outerHeight();if(opt.$layer&&!opt.hovering&&(!(e.pageX>=pos.left&&e.pageX<=pos.right)||!(e.pageY>=pos.top&&e.pageY<=pos.bottom))){setTimeout((function(){if(!opt.hovering&&opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("contextmenu:hide")}}),50)}}))}},hide:function(opt,force){var $trigger=$(this);if(!opt){opt=$trigger.data("contextMenu")||{}}if(!force&&opt.events&&opt.events.hide.call($trigger,opt)===false){return}$trigger.removeData("contextMenu").removeClass("context-menu-active");if(opt.$layer){setTimeout(function($layer){return function(){$layer.remove()}}(opt.$layer),10);try{delete opt.$layer}catch(e){opt.$layer=null}}$currentTrigger=null;opt.$menu.find("."+opt.classNames.hover).trigger("contextmenu:blur");opt.$selected=null;opt.$menu.find("."+opt.classNames.visible).removeClass(opt.classNames.visible);$(document).off(".contextMenuAutoHide").off("keydown.contextMenu");if(opt.$menu){opt.$menu[opt.animation.hide](opt.animation.duration,(function(){if(opt.build){opt.$menu.remove();$.each(opt,(function(key){switch(key){case"ns":case"selector":case"build":case"trigger":return true;default:opt[key]=undefined;try{delete opt[key]}catch(e){}return true}}))}setTimeout((function(){$trigger.trigger("contextmenu:hidden")}),10)}))}},create:function(opt,root){if(typeof root==="undefined"){root=opt}opt.$menu=$('<ul class="context-menu-list"></ul>').addClass(opt.className||"").data({contextMenu:opt,contextMenuRoot:root});$.each(["callbacks","commands","inputs"],(function(i,k){opt[k]={};if(!root[k]){root[k]={}}}));if(!root.accesskeys){root.accesskeys={}}function createNameNode(item){var $name=$("<span></span>");if(item._accesskey){if(item._beforeAccesskey){$name.append(document.createTextNode(item._beforeAccesskey))}$("<span></span>").addClass("context-menu-accesskey").text(item._accesskey).appendTo($name);if(item._afterAccesskey){$name.append(document.createTextNode(item._afterAccesskey))}}else{if(item.isHtmlName){if(typeof item.accesskey!=="undefined"){throw new Error("accesskeys are not compatible with HTML names and cannot be used together in the same item")}$name.html(item.name)}else{$name.text(item.name)}}return $name}$.each(opt.items,(function(key,item){var $t=$('<li class="context-menu-item"></li>').addClass(item.className||""),$label=null,$input=null;$t.on("click",$.noop);if(typeof item==="string"||item.type==="cm_separator"){item={type:"cm_seperator"}}item.$node=$t.data({contextMenu:opt,contextMenuRoot:root,contextMenuKey:key});if(typeof item.accesskey!=="undefined"){var aks=splitAccesskey(item.accesskey);for(var i=0,ak;ak=aks[i];i++){if(!root.accesskeys[ak]){root.accesskeys[ak]=item;var matched=item.name.match(new RegExp("^(.*?)("+ak+")(.*)$","i"));if(matched){item._beforeAccesskey=matched[1];item._accesskey=matched[2];item._afterAccesskey=matched[3]}break}}}if(item.type&&types[item.type]){types[item.type].call($t,item,opt,root);$.each([opt,root],(function(i,k){k.commands[key]=item;if($.isFunction(item.callback)&&(typeof k.callbacks[key]==="undefined"||typeof opt.type==="undefined")){k.callbacks[key]=item.callback}}))}else{if(item.type==="cm_seperator"){$t.addClass("context-menu-separator "+root.classNames.notSelectable)}else if(item.type==="html"){$t.addClass("context-menu-html "+root.classNames.notSelectable)}else if(item.type==="sub"){}else if(item.type){$label=$("<label></label>").appendTo($t);createNameNode(item).appendTo($label);$t.addClass("context-menu-input");opt.hasTypes=true;$.each([opt,root],(function(i,k){k.commands[key]=item;k.inputs[key]=item}))}else if(item.items){item.type="sub"}switch(item.type){case"cm_seperator":break;case"text":$input=$('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+key).val(item.value||"").appendTo($label);break;case"textarea":$input=$('<textarea name=""></textarea>').attr("name","context-menu-input-"+key).val(item.value||"").appendTo($label);if(item.height){$input.height(item.height)}break;case"checkbox":$input=$('<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+key).val(item.value||"").prop("checked",!!item.selected).prependTo($label);break;case"radio":$input=$('<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+item.radio).val(item.value||"").prop("checked",!!item.selected).prependTo($label);break;case"select":$input=$('<select name=""></select>').attr("name","context-menu-input-"+key).appendTo($label);if(item.options){$.each(item.options,(function(value,text){$("<option></option>").val(value).text(text).appendTo($input)}));$input.val(item.selected)}break;case"sub":createNameNode(item).appendTo($t);item.appendTo=item.$node;$t.data("contextMenu",item).addClass("context-menu-submenu");item.callback=null;if("function"===typeof item.items.then){op.processPromises(item,root,item.items)}else{op.create(item,root)}break;case"html":$(item.html).appendTo($t);break;default:$.each([opt,root],(function(i,k){k.commands[key]=item;if($.isFunction(item.callback)&&(typeof k.callbacks[key]==="undefined"||typeof opt.type==="undefined")){k.callbacks[key]=item.callback}}));createNameNode(item).appendTo($t);break}if(item.type&&item.type!=="sub"&&item.type!=="html"&&item.type!=="cm_seperator"){$input.on("focus",handle.focusInput).on("blur",handle.blurInput);if(item.events){$input.on(item.events,opt)}}if(item.icon){if($.isFunction(item.icon)){item._icon=item.icon.call(this,this,$t,key,item)}else{if(typeof item.icon==="string"&&item.icon.substring(0,3)==="fa-"){item._icon=root.classNames.icon+" "+root.classNames.icon+"--fa fa "+item.icon}else{item._icon=root.classNames.icon+" "+root.classNames.icon+"-"+item.icon}}$t.addClass(item._icon)}}item.$input=$input;item.$label=$label;$t.appendTo(opt.$menu);if(!opt.hasTypes&&$.support.eventSelectstart){$t.on("selectstart.disableTextSelect",handle.abortevent)}}));if(!opt.$node){opt.$menu.css("display","none").addClass("context-menu-root")}opt.$menu.appendTo(opt.appendTo||document.body)},resize:function($menu,nested){var domMenu;$menu.css({position:"absolute",display:"block"});$menu.data("width",(domMenu=$menu.get(0)).getBoundingClientRect?Math.ceil(domMenu.getBoundingClientRect().width):$menu.outerWidth()+1);$menu.css({position:"static",minWidth:"0px",maxWidth:"100000px"});$menu.find("> li > ul").each((function(){op.resize($(this),true)}));if(!nested){$menu.find("ul").addBack().css({position:"",display:"",minWidth:"",maxWidth:""}).outerWidth((function(){return $(this).data("width")}))}},update:function(opt,root){var $trigger=this;if(typeof root==="undefined"){root=opt;op.resize(opt.$menu)}opt.$menu.children().each((function(){var $item=$(this),key=$item.data("contextMenuKey"),item=opt.items[key],disabled=$.isFunction(item.disabled)&&item.disabled.call($trigger,key,root)||item.disabled===true,visible;if($.isFunction(item.visible)){visible=item.visible.call($trigger,key,root)}else if(typeof item.visible!=="undefined"){visible=item.visible===true}else{visible=true}$item[visible?"show":"hide"]();$item[disabled?"addClass":"removeClass"](root.classNames.disabled);if($.isFunction(item.icon)){$item.removeClass(item._icon);item._icon=item.icon.call(this,$trigger,$item,key,item);$item.addClass(item._icon)}if(item.type){$item.find("input, select, textarea").prop("disabled",disabled);switch(item.type){case"text":case"textarea":item.$input.val(item.value||"");break;case"checkbox":case"radio":item.$input.val(item.value||"").prop("checked",!!item.selected);break;case"select":item.$input.val((item.selected===0?"0":item.selected)||"");break}}if(item.$menu){op.update.call($trigger,item,root)}}))},layer:function(opt,zIndex){var $layer=opt.$layer=$('<div id="context-menu-layer"></div>').css({height:$win.height(),width:$win.width(),display:"block",position:"fixed","z-index":zIndex,top:0,left:0,opacity:0,filter:"alpha(opacity=0)","background-color":"#000"}).data("contextMenuRoot",opt).insertBefore(this).on("contextmenu",handle.abortevent).on("mousedown",handle.layerClick);if(typeof document.body.style.maxWidth==="undefined"){$layer.css({position:"absolute",height:$(document).height()})}return $layer},processPromises:function(opt,root,promise){opt.$node.addClass(root.classNames.iconLoadingClass);function completedPromise(opt,root,items){if(typeof items==="undefined"){errorPromise(undefined)}finishPromiseProcess(opt,root,items)}function errorPromise(opt,root,errorItem){if(typeof errorItem==="undefined"){errorItem={error:{name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}};if(window.console){(console.error||console.log).call(console,'When you reject a promise, provide an "items" object, equal to normal sub-menu items')}}else if(typeof errorItem==="string"){errorItem={error:{name:errorItem}}}finishPromiseProcess(opt,root,errorItem)}function finishPromiseProcess(opt,root,items){if(typeof root.$menu==="undefined"||!root.$menu.is(":visible")){return}opt.$node.removeClass(root.classNames.iconLoadingClass);opt.items=items;op.create(opt,root,true);op.update(opt,root);root.positionSubmenu.call(opt.$node,opt.$menu)}promise.then(completedPromise.bind(this,opt,root),errorPromise.bind(this,opt,root))},activated:function(opt){var $menu=opt.$menu;var $menuOffset=$menu.offset();var winHeight=$(window).height();var winScrollTop=$(window).scrollTop();var menuHeight=$menu.height();if(menuHeight>winHeight){$menu.css({height:winHeight+"px","overflow-x":"hidden","overflow-y":"auto",top:winScrollTop+"px"})}else if($menuOffset.top<winScrollTop||$menuOffset.top+menuHeight>winScrollTop+winHeight){$menu.css({top:"0px"})}}};function splitAccesskey(val){var t=val.split(/\s+/);var keys=[];for(var i=0,k;k=t[i];i++){k=k.charAt(0).toUpperCase();keys.push(k)}return keys}$.fn.contextMenu=function(operation){var $t=this,$o=operation;if(this.length>0){if(typeof operation==="undefined"){this.first().trigger("contextmenu")}else if(typeof operation.x!=="undefined"&&typeof operation.y!=="undefined"){this.first().trigger($.Event("contextmenu",{pageX:operation.x,pageY:operation.y,mouseButton:operation.button}))}else if(operation==="hide"){var $menu=this.first().data("contextMenu")?this.first().data("contextMenu").$menu:null;if($menu){$menu.trigger("contextmenu:hide")}}else if(operation==="destroy"){$.contextMenu("destroy",{context:this})}else if($.isPlainObject(operation)){operation.context=this;$.contextMenu("create",operation)}else if(operation){this.removeClass("context-menu-disabled")}else if(!operation){this.addClass("context-menu-disabled")}}else{$.each(menus,(function(){if(this.selector===$t.selector){$o.data=this;$.extend($o.data,{trigger:"demand"})}}));handle.contextmenu.call($o.target,$o)}return this};$.contextMenu=function(operation,options){if(typeof operation!=="string"){options=operation;operation="create"}if(typeof options==="string"){options={selector:options}}else if(typeof options==="undefined"){options={}}var o=$.extend(true,{},defaults,options||{});var $document=$(document);var $context=$document;var _hasContext=false;if(!o.context||!o.context.length){o.context=document}else{$context=$(o.context).first();o.context=$context.get(0);_hasContext=!$(o.context).is(document)}switch(operation){case"update":if(_hasContext){op.update($context)}else{for(var menu in menus){if(menus.hasOwnProperty(menu)){op.update(menus[menu])}}}break;case"create":if(!o.selector){throw new Error("No selector specified")}if(o.selector.match(/.context-menu-(list|item|input)($|\s)/)){throw new Error('Cannot bind to selector "'+o.selector+'" as it contains a reserved className')}if(!o.build&&(!o.items||$.isEmptyObject(o.items))){throw new Error("No Items specified")}counter++;o.ns=".contextMenu"+counter;if(!_hasContext){namespaces[o.selector]=o.ns}menus[o.ns]=o;if(!o.trigger){o.trigger="right"}if(!initialized){var itemClick=o.itemClickEvent==="click"?"click.contextMenu":"mouseup.contextMenu";var contextMenuItemObj={"contextmenu:focus.contextMenu":handle.focusItem,"contextmenu:blur.contextMenu":handle.blurItem,"contextmenu.contextMenu":handle.abortevent,"mouseenter.contextMenu":handle.itemMouseenter,"mouseleave.contextMenu":handle.itemMouseleave};contextMenuItemObj[itemClick]=handle.itemClick;$document.on({"contextmenu:hide.contextMenu":handle.hideMenu,"prevcommand.contextMenu":handle.prevItem,"nextcommand.contextMenu":handle.nextItem,"contextmenu.contextMenu":handle.abortevent,"mouseenter.contextMenu":handle.menuMouseenter,"mouseleave.contextMenu":handle.menuMouseleave},".context-menu-list").on("mouseup.contextMenu",".context-menu-input",handle.inputClick).on(contextMenuItemObj,".context-menu-item");initialized=true}$context.on("contextmenu"+o.ns,o.selector,o,handle.contextmenu);if(_hasContext){$context.on("remove"+o.ns,(function(){$(this).contextMenu("destroy")}))}switch(o.trigger){case"hover":$context.on("mouseenter"+o.ns,o.selector,o,handle.mouseenter).on("mouseleave"+o.ns,o.selector,o,handle.mouseleave);break;case"left":$context.on("click"+o.ns,o.selector,o,handle.click);break;case"touchstart":$context.on("touchstart"+o.ns,o.selector,o,handle.click);break}if(!o.build){op.create(o)}break;case"destroy":var $visibleMenu;if(_hasContext){var context=o.context;$.each(menus,(function(ns,o){if(!o){return true}if(!$(context).is(o.selector)){return true}$visibleMenu=$(".context-menu-list").filter(":visible");if($visibleMenu.length&&$visibleMenu.data().contextMenuRoot.$trigger.is($(o.context).find(o.selector))){$visibleMenu.trigger("contextmenu:hide",{force:true})}try{if(menus[o.ns].$menu){menus[o.ns].$menu.remove()}delete menus[o.ns]}catch(e){menus[o.ns]=null}$(o.context).off(o.ns);return true}))}else if(!o.selector){$document.off(".contextMenu .contextMenuAutoHide");$.each(menus,(function(ns,o){$(o.context).off(o.ns)}));namespaces={};menus={};counter=0;initialized=false;$("#context-menu-layer, .context-menu-list").remove()}else if(namespaces[o.selector]){$visibleMenu=$(".context-menu-list").filter(":visible");if($visibleMenu.length&&$visibleMenu.data().contextMenuRoot.$trigger.is(o.selector)){$visibleMenu.trigger("contextmenu:hide",{force:true})}try{if(menus[namespaces[o.selector]].$menu){menus[namespaces[o.selector]].$menu.remove()}delete menus[namespaces[o.selector]]}catch(e){menus[namespaces[o.selector]]=null}$document.off(namespaces[o.selector])}break;case"html5":if(!$.support.htmlCommand&&!$.support.htmlMenuitem||typeof options==="boolean"&&options){$('menu[type="context"]').each((function(){if(this.id){$.contextMenu({selector:"[contextmenu="+this.id+"]",items:$.contextMenu.fromMenu(this)})}})).css("display","none")}break;default:throw new Error('Unknown operation "'+operation+'"')}return this};$.contextMenu.setInputValues=function(opt,data){if(typeof data==="undefined"){data={}}$.each(opt.inputs,(function(key,item){switch(item.type){case"text":case"textarea":item.value=data[key]||"";break;case"checkbox":item.selected=data[key]?true:false;break;case"radio":item.selected=(data[item.radio]||"")===item.value;break;case"select":item.selected=data[key]||"";break}}))};$.contextMenu.getInputValues=function(opt,data){if(typeof data==="undefined"){data={}}$.each(opt.inputs,(function(key,item){switch(item.type){case"text":case"textarea":case"select":data[key]=item.$input.val();break;case"checkbox":data[key]=item.$input.prop("checked");break;case"radio":if(item.$input.prop("checked")){data[item.radio]=item.value}break}}));return data};function inputLabel(node){return node.id&&$('label[for="'+node.id+'"]').val()||node.name}function menuChildren(items,$children,counter){if(!counter){counter=0}$children.each((function(){var $node=$(this),node=this,nodeName=this.nodeName.toLowerCase(),label,item;if(nodeName==="label"&&$node.find("input, textarea, select").length){label=$node.text();$node=$node.children().first();node=$node.get(0);nodeName=node.nodeName.toLowerCase()}switch(nodeName){case"menu":item={name:$node.attr("label"),items:{}};counter=menuChildren(item.items,$node.children(),counter);break;case"a":case"button":item={name:$node.text(),disabled:!!$node.attr("disabled"),callback:function(){return function(){$node.get(0).click()}}()};break;case"menuitem":case"command":switch($node.attr("type")){case undefined:case"command":case"menuitem":item={name:$node.attr("label"),disabled:!!$node.attr("disabled"),icon:$node.attr("icon"),callback:function(){return function(){$node.get(0).click()}}()};break;case"checkbox":item={type:"checkbox",disabled:!!$node.attr("disabled"),name:$node.attr("label"),selected:!!$node.attr("checked")};break;case"radio":item={type:"radio",disabled:!!$node.attr("disabled"),name:$node.attr("label"),radio:$node.attr("radiogroup"),value:$node.attr("id"),selected:!!$node.attr("checked")};break;default:item=undefined}break;case"hr":item="-------";break;case"input":switch($node.attr("type")){case"text":item={type:"text",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),value:$node.val()};break;case"checkbox":item={type:"checkbox",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),selected:!!$node.attr("checked")};break;case"radio":item={type:"radio",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),radio:!!$node.attr("name"),value:$node.val(),selected:!!$node.attr("checked")};break;default:item=undefined;break}break;case"select":item={type:"select",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),selected:$node.val(),options:{}};$node.children().each((function(){item.options[this.value]=$(this).text()}));break;case"textarea":item={type:"textarea",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),value:$node.val()};break;case"label":break;default:item={type:"html",html:$node.clone(true)};break}if(item){counter++;items["key"+counter]=item}}));return counter}$.contextMenu.fromMenu=function(element){var $this=$(element),items={};menuChildren(items,$this.children());return items};$.contextMenu.defaults=defaults;$.contextMenu.types=types;$.contextMenu.handle=handle;$.contextMenu.op=op;$.contextMenu.menus=menus}));(function($){$.fn.drag=function(str,arg,opts){var type=typeof str=="string"?str:"",fn=$.isFunction(str)?str:$.isFunction(arg)?arg:null;if(type.indexOf("drag")!==0)type="drag"+type;opts=(str==fn?arg:opts)||{};return fn?this.on(type,opts,fn):this.trigger(type)};var $event=$.event,$special=$event.special,drag=$special.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:false,drop:true,click:false},datakey:"dragdata",noBubble:true,add:function(obj){var data=$.data(this,drag.datakey),opts=obj.data||{};data.related+=1;$.each(drag.defaults,(function(key,def){if(opts[key]!==undefined)data[key]=opts[key]}))},remove:function(){$.data(this,drag.datakey).related-=1},setup:function(){if($.data(this,drag.datakey))return;var data=$.extend({related:0},drag.defaults);$.data(this,drag.datakey,data);$event.add(this,"touchstart mousedown",drag.init,data);if(this.attachEvent)this.attachEvent("ondragstart",drag.dontstart)},teardown:function(){var data=$.data(this,drag.datakey)||{};if(data.related)return;$.removeData(this,drag.datakey);$event.remove(this,"touchstart mousedown",drag.init);drag.textselect(true);if(this.detachEvent)this.detachEvent("ondragstart",drag.dontstart)},init:function(event){if(drag.touched)return;var dd=event.data,results;if(event.which!=0&&dd.which>0&&event.which!=dd.which)return;if($(event.target).is(dd.not))return;if(dd.handle&&!$(event.target).closest(dd.handle,event.currentTarget).length)return;drag.touched=event.type=="touchstart"?this:null;dd.propagates=1;dd.mousedown=this;dd.interactions=[drag.interaction(this,dd)];dd.target=event.target;dd.pageX=event.pageX;dd.pageY=event.pageY;dd.dragging=null;results=drag.hijack(event,"draginit",dd);if(!dd.propagates)return;results=drag.flatten(results);if(results&&results.length){dd.interactions=[];$.each(results,(function(){dd.interactions.push(drag.interaction(this,dd))}))}dd.propagates=dd.interactions.length;if(dd.drop!==false&&$special.drop)$special.drop.handler(event,dd);drag.textselect(false);if(drag.touched)$event.add(drag.touched,"touchmove touchend",drag.handler,dd);else $event.add(document,"mousemove mouseup",drag.handler,dd);if(!drag.touched||dd.live)return false},interaction:function(elem,dd){var offset=elem&&elem.ownerDocument?$(elem)[dd.relative?"position":"offset"]()||{top:0,left:0}:{top:0,left:0};return{drag:elem,callback:new drag.callback,droppable:[],offset:offset}},handler:function(event){var dd=event.data;switch(event.type){case!dd.dragging&&"touchmove":event.preventDefault();case!dd.dragging&&"mousemove":if(Math.pow(event.pageX-dd.pageX,2)+Math.pow(event.pageY-dd.pageY,2)<Math.pow(dd.distance,2))break;event.target=dd.target;drag.hijack(event,"dragstart",dd);if(dd.propagates)dd.dragging=true;case"touchmove":event.preventDefault();case"mousemove":if(dd.dragging){drag.hijack(event,"drag",dd);if(dd.propagates){if(dd.drop!==false&&$special.drop)$special.drop.handler(event,dd);break}event.type="mouseup"}case"touchend":case"mouseup":default:if(drag.touched)$event.remove(drag.touched,"touchmove touchend",drag.handler);else $event.remove(document,"mousemove mouseup",drag.handler);if(dd.dragging){if(dd.drop!==false&&$special.drop)$special.drop.handler(event,dd);drag.hijack(event,"dragend",dd)}drag.textselect(true);if(dd.click===false&&dd.dragging)$.data(dd.mousedown,"suppress.click",(new Date).getTime()+5);dd.dragging=drag.touched=false;break}},hijack:function(event,type,dd,x,elem){if(!dd)return;var orig={event:event.originalEvent,type:event.type},mode=type.indexOf("drop")?"drag":"drop",result,i=x||0,ia,$elems,callback,len=!isNaN(x)?x:dd.interactions.length;event.type=type;var noop=function(){};event.originalEvent=new jQuery.Event(orig.event,{preventDefault:noop,stopPropagation:noop,stopImmediatePropagation:noop});dd.results=[];do{if(ia=dd.interactions[i]){if(type!=="dragend"&&ia.cancelled)continue;callback=drag.properties(event,dd,ia);ia.results=[];$(elem||ia[mode]||dd.droppable).each((function(p,subject){callback.target=subject;event.isPropagationStopped=function(){return false};result=subject?$event.dispatch.call(subject,event,callback):null;if(result===false){if(mode=="drag"){ia.cancelled=true;dd.propagates-=1}if(type=="drop"){ia[mode][p]=null}}else if(type=="dropinit")ia.droppable.push(drag.element(result)||subject);if(type=="dragstart")ia.proxy=$(drag.element(result)||ia.drag)[0];ia.results.push(result);delete event.result;if(type!=="dropinit")return result}));dd.results[i]=drag.flatten(ia.results);if(type=="dropinit")ia.droppable=drag.flatten(ia.droppable);if(type=="dragstart"&&!ia.cancelled)callback.update()}}while(++i<len);event.type=orig.type;event.originalEvent=orig.event;return drag.flatten(dd.results)},properties:function(event,dd,ia){var obj=ia.callback;obj.drag=ia.drag;obj.proxy=ia.proxy||ia.drag;obj.startX=dd.pageX;obj.startY=dd.pageY;obj.deltaX=event.pageX-dd.pageX;obj.deltaY=event.pageY-dd.pageY;obj.originalX=ia.offset.left;obj.originalY=ia.offset.top;obj.offsetX=obj.originalX+obj.deltaX;obj.offsetY=obj.originalY+obj.deltaY;obj.drop=drag.flatten((ia.drop||[]).slice());obj.available=drag.flatten((ia.droppable||[]).slice());return obj},element:function(arg){if(arg&&(arg.jquery||arg.nodeType==1))return arg},flatten:function(arr){return $.map(arr,(function(member){return member&&member.jquery?$.makeArray(member):member&&member.length?drag.flatten(member):member}))},textselect:function(bool){$(document)[bool?"off":"on"]("selectstart",drag.dontstart).css("MozUserSelect",bool?"":"none");document.unselectable=bool?"off":"on"},dontstart:function(){return false},callback:function(){}};drag.callback.prototype={update:function(){if($special.drop&&this.available.length)$.each(this.available,(function(i){$special.drop.locate(this,i)}))}};var $dispatch=$event.dispatch;$event.dispatch=function(event){if($.data(this,"suppress."+event.type)-(new Date).getTime()>0){$.removeData(this,"suppress."+event.type);return}return $dispatch.apply(this,arguments)};$special.draginit=$special.dragstart=$special.dragend=drag})(jQuery);
/*!
 * OverlayScrollbars
 * https://github.com/KingSora/OverlayScrollbars
 *
 * Version: 1.6.2
 *
 * Copyright KingSora.
 * https://github.com/KingSora
 *
 * Released under the MIT license.
 * Date: 16.01.2019
 */
!function(t,r){"function"==typeof define&&define.amd?define(["jquery"],(function(n){return r(t,t.document,undefined,n)})):"object"==typeof module&&"object"==typeof module.exports?module.exports=r(t,t.document,undefined,require("jquery")):r(t,t.document,undefined,t.jQuery)}("undefined"!=typeof window?window:this,(function(lt,st,Ti,n){"use strict";var i,o,vt="OverlayScrollbars",dt="object",ht="function",bt="array",pt="string",mt="boolean",wt="number",d="null",yt="class",ki="style",gt="id",xt="length",St="prototype",Oi="offsetHeight",Ai="clientHeight",Li="scrollHeight",Ci="offsetWidth",Ni="clientWidth",Di="scrollWidth",Hi={wW:function(){return lt.innerWidth||st.documentElement[Ni]||st.body[Ni]},wH:function(){return lt.innerHeight||st.documentElement[Ai]||st.body[Ai]},mO:function(){return lt.MutationObserver||lt.WebKitMutationObserver||lt.WebkitMutationObserver||lt.MozMutationObserver||Ti},rO:function(){return lt.ResizeObserver||lt.WebKitResizeObserver||lt.WebkitResizeObserver||lt.MozResizeObserver||Ti},rAF:function(){return lt.requestAnimationFrame||lt.webkitRequestAnimationFrame||lt.mozRequestAnimationFrame||lt.oRequestAnimationFrame||lt.msRequestAnimationFrame||function(n){return lt.setTimeout(n,1e3/60)}},cAF:function(){return lt.cancelAnimationFrame||lt.webkitCancelAnimationFrame||lt.mozCancelAnimationFrame||lt.oCancelAnimationFrame||lt.msCancelAnimationFrame||function(n){return lt.clearTimeout(n)}},now:function(){return Date.now&&Date.now()||(new Date).getTime()},stpP:function(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},prvD:function(n){n.preventDefault&&n.cancelable?n.preventDefault():n.returnValue=!1},page:function(n){var t="page",r="client",e="X",i=((n=n.originalEvent||n).target||n.srcElement||st).ownerDocument||st,o=i.documentElement,a=i.body;if(n.touches===Ti)return!n[t+e]&&n[r+e]&&null!=n[r+e]?{x:n[r+e]+(o&&o.scrollLeft||a&&a.scrollLeft||0)-(o&&o.clientLeft||a&&a.clientLeft||0),y:n[r+"Y"]+(o&&o.scrollTop||a&&a.scrollTop||0)-(o&&o.clientTop||a&&a.clientTop||0)}:{x:n[t+e],y:n.pageY};var u=n.touches[0];return{x:u[t+e],y:u.pageY}},mBtn:function(n){var t=n.button;return n.which||t===Ti?n.which:1&t?1:2&t?3:4&t?2:0},inA:function(n,t){for(var r=0;r<t[xt];r++)try{if(t[r]===n)return r}catch(e){}return-1},isA:function(n){var t=Array.isArray;return t?t(n):this.type(n)==bt},type:function(n){return n===Ti?n+"":null===n?n+"":Object[St].toString.call(n).replace(/^\[object (.+)\]$/,"$1").toLowerCase()},bind:function(n,t){if(typeof n!=ht)throw"Can't bind function!";var r=St,e=Array[r].slice.call(arguments,2),i=function(){},o=function(){return n.apply(this instanceof i?this:t,e.concat(Array[r].slice.call(arguments)))};return n[r]&&(i[r]=n[r]),o[r]=new i,o}},Ri=Math,zt=n,Ii=(n.easing,n),Tt=(i=[],o="__overlayScrollbars__",function(n,t){var r=arguments[xt];if(r<1)return i;if(t)n[o]=t,i.push(n);else{var e=Hi.inA(n,i);if(-1<e){if(!(1<r))return i[e][o];delete n[o],i.splice(e,1)}}}),r=function(){var u,f,A,n,t,r,e,a,i,c=[],ct=(a={className:["os-theme-dark",[d,pt]],resize:["none","n:none b:both h:horizontal v:vertical"],sizeAutoCapable:n=[!0,mt],clipAlways:n,normalizeRTL:n,paddingAbsolute:t=[!(A=[mt,wt,pt,bt,dt,ht,d]),mt],autoUpdate:[null,[d,mt]],autoUpdateInterval:[33,wt],nativeScrollbarsOverlaid:{showNativeScrollbars:t,initialize:n},overflowBehavior:{x:["scroll",e="v-h:visible-hidden v-s:visible-scroll s:scroll h:hidden"],y:["scroll",e]},scrollbars:{visibility:["auto","v:visible h:hidden a:auto"],autoHide:["never","n:never s:scroll l:leave m:move"],autoHideDelay:[800,wt],dragScrolling:n,clickScrolling:t,touchSupport:n},textarea:{dynWidth:t,dynHeight:t,inheritedAttrs:[["style","class"],[pt,bt,d]]},callbacks:{onInitialized:r=[null,[d,ht]],onInitializationWithdrawn:r,onDestroyed:r,onScrollStart:r,onScroll:r,onScrollStop:r,onOverflowChanged:r,onOverflowAmountChanged:r,onDirectionChanged:r,onContentSizeChanged:r,onHostSizeChanged:r,onUpdated:r}},{d:(i=function(i){var o=function(n){var t,r,e;for(t in n)n.hasOwnProperty(t)&&(r=n[t],(e=Hi.type(r))==bt?n[t]=r[i?1:0]:e==dt&&(n[t]=o(r)));return n};return o(Ii.extend(!0,{},a))})(),t:i(!0),v:function(n,t,T,k,r){var e={},i=Ii.extend(!0,{},n),O=function(n,t,r,e){for(var i in t)if(t.hasOwnProperty(i)&&n.hasOwnProperty(i)){var o,a,u,f,c,l,s,v,d=!1,h=t[i],b=Hi.type(h),p=b==dt,m=Hi.type(h)!=bt?[h]:h,w=n[i],y=Hi.type(w),g=e?e+".":"",x='The option "'+g+i+"\" wasn't set, because",S=[],z=[];if(p&&y==dt)r[i]={},O(w,h,r[i],g+i),Ii.isEmptyObject(w)&&delete n[i];else if(!p){for(l=0;l<m.length;l++)if(c=m[l],u=(b=Hi.type(c))==pt&&-1===Ii.inArray(c,A))for(S.push(pt),o=c.split(" "),z=z.concat(o),s=0;s<o.length;s++){for(f=(a=o[s].split(":"))[0],v=0;v<a.length;v++)if(w===a[v]){d=!0;break}if(d)break}else if(S.push(c),y===c){d=!0;break}d?r[i]=u&&k?f:w:T&&console.warn(x+" it doesn't accept the type [ "+y.toUpperCase()+' ] with the value of "'+w+'".\r\nAccepted types are: [ '+S.join(", ").toUpperCase()+" ]."+(0<z.length?"\r\nValid strings are: [ "+z.join(", ").split(":").join(", ")+" ].":"")),delete n[i]}}};return O(i,t,e),r?Ii.extend(!0,e,i):!Ii.isEmptyObject(i)&&T&&console.warn("The following options are discarded due to invalidity:\r\n"+lt.JSON.stringify(i,null,2)),e}});function l(){u||(u=new o(ct.d)),f||(f=new s(u))}function o(n){var S=this,i="overflow",o="hidden",z=Ii("body"),T=Ii('<div id="os-dummy-scrollbar-size"><div></div></div>'),a=T[0],e=Ii(T.children("div").eq(0));z.append(T),T.hide().show();var t,r,u,f,c,l,s,v,d,h=k(a),b={x:0===h.x,y:0===h.y};function p(n){var t=!1,r="Webkit Moz ms O".split(" "),e=st.createElement("div"),i=null,o=0;if(n=n.toLowerCase(),e[ki][n]!==Ti&&(t=!0),!t)for(i=n.charAt(0).toUpperCase()+n.substr(1);o<r.length;o++)if(e[ki][r[o]+i]!==Ti){t=!0;break}return t}function k(n){return{x:n[Oi]-n[Ai],y:n[Ci]-n[Ni]}}Ii.extend(S,{defaultOptions:n,autoUpdateLoop:!1,autoUpdateRecommended:!Hi.mO(),nativeScrollbarSize:h,nativeScrollbarIsOverlaid:b,nativeScrollbarStyling:(T.addClass("os-viewport-native-scrollbars-invisible"),T.css(i,o).hide().css(i,"scroll").show(),a[Oi]-a[Ai]==0&&a[Ci]-a[Ni]==0),overlayScrollbarDummySize:{x:30,y:30},msie:(r=lt.navigator.userAgent,u="indexOf",f="substring",c=r[u]("MSIE "),l=r[u]("Trident/"),s=r[u]("Edge/"),v=r[u]("rv:"),d=parseInt,0<c?t=d(r[f](c+5,r[u](".",c)),10):0<l?t=d(r[f](v+3,r[u](".",v)),10):0<s&&(t=d(r[f](s+5,r[u](".",s)),10)),t),cssCalc:function(){var n,t,r=st.createElement("div"),e=["calc","-webkit-calc","-moz-calc","-o-calc"];for(n=0;n<e.length;++n)if(t=e[n],r[ki].cssText="width:"+t+"(1px);",r[ki].length)return t;return null}(),restrictedMeasuring:function(){T.css(i,o);var n=a[Di],t=a[Li];T.css(i,"visible");var r=a[Di],e=a[Li];return n-r!=0||t-e!=0}(),rtlScrollBehavior:function(){T.css({"overflow-y":o,"overflow-x":"scroll",direction:"rtl"}).scrollLeft(0);var n=T.offset(),t=e.offset();T.scrollLeft(999);var r=e.offset();return{i:n.left===t.left,n:t.left-r.left==0}}(),supportTransform:p("transform"),supportTransition:p("transition"),supportPassiveEvents:function(){var n=!1;try{lt.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){n=!0}}))}catch(t){}return n}(),supportResizeObserver:!!Hi.rO(),supportMutationObserver:!!Hi.mO()}),T.removeAttr(ki).remove(),function(){if(!b.x||!b.y){var m=Ri.abs,w=Hi.wW(),y=Hi.wH(),g=x();Ii(lt).on("resize",(function(){if(0<Tt().length){var n=Hi.wW(),t=Hi.wH(),r=n-w,e=t-y;if(0===r&&0===e)return;var i,o=Ri.round(n/(w/100)),a=Ri.round(t/(y/100)),u=m(r),f=m(e),c=m(o),l=m(a),s=x(),v=2<u&&2<f,d=!function p(n,t){var r=m(n),e=m(t);return!(r===e||r+1===e||r-1===e)}(c,l),h=v&&d&&s!==g&&0<g,b=S.nativeScrollbarSize;h&&(z.append(T),i=S.nativeScrollbarSize=k(T[0]),T.remove(),b.x===i.x&&b.y===i.y||Ii.each(Tt(),(function(){Tt(this)&&Tt(this).update("zoom")}))),w=n,y=t,g=s}}))}function x(){var n=lt.screen.deviceXDPI||0,t=lt.screen.logicalXDPI||1;return lt.devicePixelRatio||n/t}}()}function s(r){var c,l="autoUpdate",s=xt,v=[],d=[],h=!1,b=33,p=Hi.now(),m=function(){if(0<v[s]&&h){c=Hi.rAF()((function(){m()}));var n=Hi.now(),t=n-p;if(b<t){p=n-t%b;for(var r=33,e=0;e<v[s];e++){var i=v[e];if(i!==Ti){var o=i.options(),a=o[l],u=Ri.max(1,o.autoUpdateInterval),f=Hi.now();(!0===a||null===a)&&f-d[e]>u&&(i.update("auto"),d[e]=new Date(f+=u)),r=Ri.max(1,Ri.min(r,u))}}b=r}}else b=33};this.add=function(n){-1===Ii.inArray(n,v)&&(v.push(n),d.push(Hi.now()),0<v[s]&&!h&&(h=!0,r.autoUpdateLoop=h,m()))},this.remove=function(n){var t=Ii.inArray(n,v);-1<t&&(d.splice(t,1),v.splice(t,1),0===v[s]&&h&&(h=!1,r.autoUpdateLoop=h,c!==Ti&&(Hi.cAF()(c),c=-1)))}}function v(e,n,t,Wt,_t){if(rt(e)){if(Tt(e)){var r=Tt(e);return r.options(n),r}var jt,Ft,Mt,Ut,C,Et,Vt,qt,v,ln,d,N,c,Bt,Xt,Yt,Pt,$t,h,u,Gt,Jt,Kt,Qt,Zt,nr,tr,rr,er,ir,i,o,or,ar,ur,b,D,l,H,fr,cr,lr,sr,vr,dr,hr,br,pr,mr,wr,a,f,s,p,m,w,yr,gr,xr,Sr,zr,Tr,kr,Or,Ar,Lr,Cr,Nr,Dr,R,Hr,Rr,Ir,Wr,_r,jr,Fr,Mr,Ur,Er,y,g,x,S,z,T,k,O,A,Vr,qr,Br,Xr,Yr,Pr,$r,Gr,Jr,Kr,Qr,L,Zr,I,W,ne,_,te,j,F,re,ee,ie,oe,ae,ue,M,U,fe,ce,le,se,ve,de=new lt[vt],E=Ii[St],he={},sn={},vn={},be={},pe={},V="-hidden",me="margin-",we="padding-",ye="border-",ge="top",xe="right",Se="bottom",ze="left",Te="min-",ke="max-",Oe="width",Ae="height",Le="float",Ce="",Ne="auto",De="scroll",He="100%",Re="x",Ie="y",q=".",We=" ",B="scrollbar",X="-horizontal",Y="-vertical",_e=De+"Left",je=De+"Top",Fe="mousedown touchstart",P="mouseup touchend touchcancel",$="mousemove touchmove",G="mouseenter",J="mouseleave",K="keydown",Q="keyup",Z="selectstart",nn="transitionend webkitTransitionEnd oTransitionEnd",tn="__overlayScrollbarsRO__",rn="os-",en="os-html",on="os-host",an=on+"-textarea",un=on+"-"+B+X+V,fn=on+"-"+B+Y+V,cn=on+"-transition",Me=on+"-rtl",Ue=on+"-resize-disabled",Ee=on+"-scrolling",Ve=on+"-overflow",qe=Ve+"-x",Be=Ve+"-y",dn="os-textarea",hn=dn+"-cover",bn="os-padding",pn="os-viewport",mn=pn+"-native-scrollbars-invisible",wn=pn+"-native-scrollbars-overlaid",yn="os-content",Xe="os-content-arrange",Ye="os-content-glue",Pe="os-size-auto-observer",gn="os-resize-observer",xn="os-resize-observer-item",Sn=xn+"-final",zn="os-text-inherit",Tn=rn+B,kn=Tn+"-track",On=kn+"-off",An=Tn+"-handle",Ln=An+"-off",Cn=Tn+"-unusable",Nn=Tn+"-"+Ne+V,Dn=Tn+"-corner",$e=Dn+"-resize",Ge=$e+"-both",Je=$e+X,Ke=$e+Y,Hn=Tn+X,Rn=Tn+Y,In="os-dragging",Qe="os-theme-none",Wn=[],_n={},Ze={},ni=42,jn=[];if(de.sleep=function(){ir=!0},de.update=function(n){var t,r,e=ot(n)==pt;e?0===n.indexOf(Ne)?(t=function h(){if(ir||ne)return!1;var n=cr.attr(gt)||Ce,t=wi(n,y),r=cr.attr(yt)||Ce,e=wi(r,g),i=cr.attr(ki)||Ce,o=wi(i,x),a=cr.is(":visible")||Ce,u=wi(a,S),f=Pt&&fr.attr("rows")||Ce,c=wi(f,z),l=Pt&&fr.attr("cols")||Ce,s=wi(l,T),v=Pt&&fr.attr("wrap")||Ce,d=wi(v,k);return y=n,e&&(e=$n(g,r)),g=r,x=i,S=a,z=f,T=l,k=v,t||e||o||u||c||s||d}(),r=function c(){if(ir)return!1;var n,t=Pt&&Tr&&!Ur?fr.val().length:0,r=!ne&&Tr&&!Pt,e={},i={};Bt&&(e={x:hr[0][Di],y:hr[0][Li]}),r&&(n=pr.css(Le),i[Le]=er?xe:ze,i[Oe]=Ne,pr.css(i));var o={w:pi()[Di]+t,h:pi()[Li]+t};r&&(i[Le]=n,i[Oe]=He,pr.css(i));var a=oi(),u=yi(o,O),f=yi(e,L,Re,Ie);return O=o,L=e,u||a||f}(),(t||r)&&ui(!1,r,!1,"+"==n.slice(-1))):"zoom"===n&&ui(!0,!0):(n=ir||n,ui(ir=!1,!1,n,!0)),Pt||pr.find("img").each((function(n,t){-1===Hi.inA(t,jn)&&Ii(t).off("load",Pn).on("load",Pn)}))},de.options=function(n,t){if(Ii.isEmptyObject(n)||!Ii.isPlainObject(n)){if(ot(n)!=pt)return o;if(1<arguments.length){var r={};return function f(n,t,r){for(var e=t.split(q),i=e.length,o=0,a={},u=a;o<i;o++)a=a[e[o]]=o+1<i?{}:r;Ii.extend(n,u,!0)}(r,n,t),Gn(r),void ui()}return it(o,n)}Gn(n);var e=ir||!1;ir=!1,ui(),ir=e},de.destroy=function(){for(var n in Yt=!0,_t.remove(de),ei(),Un(sr),Jt&&Un(lr),_n)de.removeExt(n);ii(!0),Kn(!0),vr&&at(vr),br&&at(br),Jt&&at(lr),Qn(!0),tt(!0),Jn(!0);for(var t=0;t<jn[xt];t++)Ii(jn[t]).off("load",Pn);for(var r in jn=Ti,Tt(e,0),di("onDestroyed"),de)delete de[r];de=Ti},de.scroll=function(n,t,r,e){if(0===arguments.length||n===Ti){var i=sn,o=vn,a=Pr&&er&&Mt.i,u=Pr&&er&&Mt.n,f=i.cs,c=i.csr,l=i.ms;return f=a?l-f:f,{x:{position:f*=u?-1:1,ratio:c=a?1-c:c,max:l*=u?-1:1,handleOffset:i.ho,handleLength:i.hl,handleLengthRatio:i.hlr,trackLength:i.tl,isRTL:er,isRTLNormalized:Pr},y:{position:o.cs,ratio:o.csr,max:o.ms,handleOffset:o.ho,handleLength:o.hl,handleLengthRatio:o.hlr,trackLength:o.tl},position:{x:f,y:o.cs},ratio:{x:c,y:o.csr},max:{x:l,y:o.ms},handleOffset:{x:i.ho,y:o.ho},handleLength:{x:i.hl,y:o.hl},handleLengthRatio:{x:i.hlr,y:o.hlr},trackLength:{x:i.tl,y:o.tl},isRTL:er,isRTLNormalized:Pr}}var w,s,v,d,h,y,g,b,p,x=Pr,m=[Re,ze,"l"],S=[Ie,ge,"t"],z=["+=","-=","*=","/="],T=ot(t)==dt,k=T?t.complete:e,O={},A={},L="begin",C="nearest",N="never",D="ifneeded",H=xt,R=[Re,Ie,"xy","yx"],I=[L,"end","center",C],W=["always",N,D],_=n.hasOwnProperty("el"),j=_?n.el:n,F=!!(j instanceof Ii||zt)&&j instanceof zt,M=!F&&rt(j),U=ot(k)!=ht?Ti:function(){s&&si(!0),v&&si(!1),k()},E=function(n,t){for(w=0;w<t[H];w++)if(n===t[w])return!0;return!1},V=function(n,t){var r=n?m:S;if(ot(t=ot(t)==pt||ot(t)==wt?[t,t]:t)==bt)return n?t[0]:t[1];if(ot(t)==dt)for(x=ot(t.n)==mt?t.n:x,w=0;w<r[H];w++)if(r[w]in t)return t[r[w]]},q=function(n,t){var r,e,i=ot(t)==pt;i&&de.update(Ne+"+");var o,a=n?sn:vn,u=a.cs,f=a.ms,c=er&&n,l=c&&Mt.n&&!x,s="replace",v=eval;if(i){if(2<t[H]){var d=t.substr(0,2);for(w=0;w<z[H];w++)if(d===z[w]){r=z[w];break}}e=bi(bi(v(t=(t=(t=(t=(t=(t=(t=(t=(t=r!==Ti?t.substr(2):t)[s](/min/g,0))[s](/</g,0))[s](/max/g,(l?"-":Ce)+He))[s](/>/g,(l?"-":Ce)+He))[s](/px/g,Ce))[s](/%/g," * "+f*(c&&Mt.n?-1:1)/100))[s](/vw/g," * "+be.w))[s](/vh/g," * "+be.h)),!0).toFixed())}else e=t;if(e!==Ti&&!isNaN(e)&&ot(e)==wt){var h=x&&c,b=u*(h&&Mt.n?-1:1),p=h&&Mt.i,m=h&&Mt.n;switch(b=p?f-b:b,r){case"+=":o=b+e;break;case"-=":o=b-e;break;case"*=":o=b*e;break;case"/=":o=b/e;break;default:o=e}o=p?f-o:o,o*=m?-1:1,o=c&&Mt.n?Ri.min(0,Ri.max(f,o)):Ri.max(0,Ri.min(f,o))}return o===u?Ti:o},B=function(n,t,r,e){var i,o,a=[r,r],u=ot(n);if(u==t)n=[n,n];else if(u==bt){if(2<(i=n[H])||i<1)n=a;else for(1===i&&(n[1]=r),w=0;w<i;w++)if(ot(o=n[w])!=t||!E(o,e)){n=a;break}}else n=u==dt?[n[Re]||r,n[Ie]||r]:a;return{x:n[0],y:n[1]}},X=function(n){var t,r,e=[],i=[ge,xe,Se,ze];for(w=0;w<n[H]&&w!==i[H];w++)(r=ot(t=n[w]))==mt?e.push(t?bi(p.css(me+i[w])):0):e.push(r==wt?t:0);return e};if(F||M){var Y,P=_?n.margin:0,$=_?n.axis:0,G=_?n.scroll:0,J=_?n.block:0,K=[0,0,0,0],Q=ot(P);if(0===(p=F?j:Ii(j))[H])return;de.update(Ne+"+"),P=Q==wt||Q==mt?X([P,P,P,P]):Q==bt?2===(Y=P[H])?X([P[0],P[1],P[0],P[1]]):4<=Y?X(P):K:Q==dt?X([P[ge],P[xe],P[Se],P[ze]]):K,h=E($,R)?$:"xy",y=B(G,pt,"always",W),g=B(J,pt,L,I),b=P;var Z=sn.cs,nn=vn.cs,tn=dr.offset(),rn=p.offset(),en={x:y.x==N||h==Ie,y:y.y==N||h==Re};rn[ge]-=b[0],rn[ze]-=b[3];var on={x:Ri.round(rn[ze]-tn[ze]+Z),y:Ri.round(rn[ge]-tn[ge]+nn)};if(er&&(Mt.n||Mt.i||(on.x=Ri.round(tn[ze]-rn[ze]+Z)),Mt.n&&x&&(on.x*=-1),Mt.i&&x&&(on.x=Ri.round(tn[ze]-rn[ze]+(sn.ms-Z)))),g.x!=L||g.y!=L||y.x==D||y.y==D||er){var an=p[0],un=ln?an.getBoundingClientRect():{width:an[Ci],height:an[Oi]},fn={w:un[Oe]+b[3]+b[1],h:un[Ae]+b[0]+b[2]},cn=function(n){var t=nt(n),r=t.o,e=t.lt,i=t.xy,o=g[i]==(n&&er?L:"end"),a="center"==g[i],u=g[i]==C,f=y[i]==N,c=y[i]==D,l=be[r],s=tn[e],v=fn[r],d=rn[e],h=a?2:1,b=d+v/2,p=s+l/2,m=v<=l&&s<=d&&d+v<=s+l;f?en[i]=!0:en[i]||((u||c)&&(en[i]=!!c&&m,o=v<l?p<b:b<p),on[i]-=o||a?(l/h-v/h)*(n&&er&&x?-1:1):0)};cn(!0),cn(!1)}en.y&&delete on.y,en.x&&delete on.x,n=on}O[_e]=q(!0,V(!0,n)),O[je]=q(!1,V(!1,n)),s=O[_e]!==Ti,v=O[je]!==Ti,(s||v)&&(0<t||T)?T?(t.complete=U,hr.animate(O,t)):(d={duration:t,complete:U},ot(r)==bt||Ii.isPlainObject(r)?(A[_e]=r[0]||r.x,A[je]=r[1]||r.y,d.specialEasing=A):d.easing=r,hr.animate(O,d)):(s&&hr[_e](O[_e]),v&&hr[je](O[je]))},de.scrollStop=function(n,t,r){return hr.stop(n,t,r),de},de.getElements=function(n){var t={target:fr[0],host:cr[0],padding:dr[0],viewport:hr[0],content:pr[0],scrollbarHorizontal:{scrollbar:a[0],track:f[0],handle:s[0]},scrollbarVertical:{scrollbar:p[0],track:m[0],handle:w[0]},scrollbarCorner:wr[0]};return ot(n)==pt?it(t,n):t},de.getState=function(n){var t=function(n){if(!Ii.isPlainObject(n))return n;var r=xi(!0,{},n),t=function(n,t){r.hasOwnProperty(n)&&(r[t]=r[n],delete r[n])};return t("w",Oe),t("h",Ae),delete r.c,r},r={sleeping:t(ir)||!1,autoUpdate:t(!ne),widthAuto:t(Tr),heightAuto:t(kr),padding:t(Lr),overflowAmount:t(_r),hideOverflow:t(zr),hasOverflow:t(Sr),contentScrollSize:t(gr),viewportSize:t(be),hostSize:t(yr),documentMixed:t(h)};return ot(n)==pt?it(r,n):r},de.ext=function(n){var t,r="added removed on contract".split(" "),e=0;if(ot(n)==pt){if(_n.hasOwnProperty(n))for(t=xi(!0,{},_n[n]);e<r.length;e++)delete t[r[e]]}else for(e in t={},_n)t[e]=xi(!0,{},de.ext(e));return t},de.addExt=function(n,t){var r,e,i,o,a=lt[vt].extension(n),u=!0;if(a){if(_n.hasOwnProperty(n))return de.ext(n);if((r=a.extensionFactory.call(de,xi(!0,{},a.defaultOptions),Ii,Hi))&&(ot(i=r.contract)==ht&&(u=ot(o=i(lt))==mt?o:u),u))return ot(e=(_n[n]=r).added)==ht&&e(t),de.ext(n)}else console.warn('A extension with the name "'+n+"\" isn't registered.")},de.removeExt=function(n){var t,r=_n[n];return!!r&&(delete _n[n],ot(t=r.removed)==ht&&t(),!0)},function ft(n,t,r){return i=Wt.defaultOptions,Et=Wt.nativeScrollbarStyling,qt=xi(!0,{},Wt.nativeScrollbarSize),jt=xi(!0,{},Wt.nativeScrollbarIsOverlaid),Ft=xi(!0,{},Wt.overlayScrollbarDummySize),Mt=xi(!0,{},Wt.rtlScrollBehavior),Gn(xi(!0,{},i,ct.v(t,ct.t,!0))),jt.x&&jt.x&&!or.nativeScrollbarsOverlaid.initialize?(di("onInitializationWithdrawn"),!1):(Vt=Wt.cssCalc,C=Wt.msie,Ut=Wt.autoUpdateRecommended,v=Wt.supportTransition,ln=Wt.supportTransform,d=Wt.supportPassiveEvents,N=Wt.supportResizeObserver,c=Wt.supportMutationObserver,Bt=Wt.restrictedMeasuring,D=Ii(n.ownerDocument),b=Ii(D[0].defaultView||D[0].parentWindow),l=ut(D,"html"),H=ut(l,"body"),fr=Ii(n),Pt=fr.is("textarea"),$t=fr.is("body"),h=D[0]!==st,$t&&((e={}).l=Ri.max(fr[_e](),l[_e](),b[_e]()),e.t=Ri.max(fr[je](),l[je](),b[je]())),Jn(),Kn(),Qn(),Zn(!0),Zn(!1),tt(),function f(){var t=b.top!==b,e={},i={};function r(n){if(a(n)){var t=u(n),r={};(le||ce)&&(r[Oe]=i.w+t.x-e.x),(se||ce)&&(r[Ae]=i.h+t.y-e.y),cr.css(r),Hi.stpP(n)}else o(n)}function o(n){var t=n!==Ti;D.off(Z,Yn).off($,r).off(P,o),zi(H,In),wr.releaseCapture&&wr.releaseCapture(),t&&(U&&ri(),de.update(Ne)),U=!1}function a(n){var t=(n.originalEvent||n).touches!==Ti;return!ir&&!Yt&&(1===Hi.mBtn(n)||t)}function u(n){return C&&t?{x:n.screenX,y:n.screenY}:Hi.page(n)}ve=function(n){a(n)&&(ne&&(U=!0,ei()),e=u(n),i.w=cr[0][Ci]-(Gt?0:Kt),i.h=cr[0][Oi]-(Gt?0:Qt),D.on(Z,Yn).on($,r).on(P,o),Si(H,In),wr.setCapture&&wr.setCapture(),Hi.prvD(n),Hi.stpP(n))}}(),En(),$t&&(hr[_e](e.l)[je](e.t),st.activeElement==n&&hr[0].focus&&(hr.attr("tabindex","-1"),hr[0].focus(),hr.one(Fe,(function(){hr.removeAttr("tabindex")})))),ti(sr,Vn),Vn(),de.update(Ne),Xt=!0,di("onInitialized"),Ii.each(Wn,(function(n,t){di(t.n,t.a)})),Wn=[],ot(r)==pt&&(r=[r]),Hi.isA(r)?Ii.each(r,(function(n,t){de.addExt(t)})):Ii.isPlainObject(r)&&Ii.each(r,(function(n,t){de.addExt(n,t)})),setTimeout((function(){v&&!Yt&&Si(cr,cn)}),333),Xt);var e}(e,n,t))return Tt(e,de),de;de=Ti}function Fn(n,t,r){for(var e=t.split(We),i=0;i<e.length;i++)n[0].addEventListener(e[i],r,{passive:!0})}function Mn(n,t,r){for(var e=t.split(We),i=0;i<e.length;i++)n[0].removeEventListener(e[i],r,{passive:!0})}function ti(i,n){var o=3333333,t=Hi.rO(),r="animationstart mozAnimationStart webkitAnimationStart MSAnimationStart",e="childNodes",a=function(){i[je](o)[_e](er?Mt.n?-o:Mt.i?0:o:o),n()};if(N){var u=i.append(mi(gn+" observed")).contents()[0];(u[tn]=new t(a)).observe(u)}else if(9<C||!Ut){i.prepend(mi(gn,mi({className:xn,dir:"ltr"},mi(xn,mi(Sn))+mi(xn,mi({className:Sn,style:"width: 200%; height: 200%"})))));var f,c,l,s,v=i[0][e][0][e][0],d=Ii(v[e][1]),h=Ii(v[e][0]),b=Ii(h[0][e][0]),p=v[Ci],m=v[Oi],w=Wt.nativeScrollbarSize,y=function(){h[_e](o)[je](o),d[_e](o)[je](o)},g=function(){c=0,f&&(p=l,m=s,a())},x=function(n){return l=v[Ci],s=v[Oi],f=l!=p||s!=m,n&&f&&!c?(Hi.cAF()(c),c=Hi.rAF()(g)):n||g(),y(),n&&(Hi.prvD(n),Hi.stpP(n)),!1},S={},z={};z[ge]=-2*(w.y+1),z[xe]=-2*w.x,z[Se]=-2*w.y,z[ze]=-2*(w.x+1),Ii(v).css(z),h.on(De,x),d.on(De,x),i.on(r,(function(){x(!1)})),S[Oe]=o,S[Ae]=o,b.css(S),y()}else{var T=D[0],k=T.attachEvent,O=C!==Ti;if(k)i.prepend(mi(gn)),ut(i,q+gn)[0].attachEvent("onresize",a);else{var A=T.createElement(dt);A.setAttribute("tabindex","-1"),A.setAttribute(yt,gn),A.onload=function(){var n=this.contentDocument.defaultView;n.addEventListener("resize",a),n.document.documentElement.style.display="none"},A.type="text/html",O&&i.prepend(A),A.data="about:blank",O||i.prepend(A),i.on(r,a)}}if(i[0]===sr[0]){var L=function(){var n=cr.css("direction"),t={},r=0,e=!1;return n!==R&&(r="ltr"===n?(t[ze]=0,t[xe]=Ne,o):(t[ze]=Ne,t[xe]=0,Mt.n?-o:Mt.i?0:o),sr.children().eq(0).css(t),i[_e](r)[je](o),R=n,e=!0),e};L(),i.on(De,(function(n){return L()&&ui(),Hi.prvD(n),Hi.stpP(n),!1}))}}function Un(n){if(N){var t=n.contents()[0];t[tn].disconnect(),delete t[tn]}else at(n.children(q+gn).eq(0))}function En(){if(c){var e,i,r,o,a,u,n=Hi.mO(),f=Hi.now();I=new n((function(n){if(Xt&&!ir){var t,r=!1;Ii.each(n,(function(){if(e=(t=this).target,i=t.attributeName,r=i===yt?$n(t.oldValue,e.className):i!==ki||t.oldValue!==e[ki].cssText)return!1})),r&&de.update(Ne)}})),W=new n((function(n){if(Xt&&!ir){var t=!1;Ii.each(n,(function(){return!(t=function o(n){var t=n.attributeName,r=n.target,e=n.type,i="closest";if(r===pr[0])return null===t;if("attributes"===e&&(t===yt||t===ki)&&!Pt){if(t===yt&&Ii(r).hasClass(on))return $n(n.oldValue,r.getAttribute(yt));if(typeof r[i]!=ht)return!0;if(null!==r[i](q+gn)||null!==r[i](q+Tn)||null!==r[i](q+Dn))return!1}return!0}(this))})),t&&(o=Hi.now(),a=kr||Tr,u=function(){Yt||(f=o,Pt&&ai(),a?ui():de.update(Ne))},clearTimeout(r),11<o-f||!a?u():r=setTimeout(u,11))}}))}}function ri(){c&&!ne&&(I.observe(cr[0],{attributes:!0,attributeOldValue:!0,attributeFilter:[gt,yt,ki]}),W.observe(Pt?fr[0]:pr[0],{attributes:!0,attributeOldValue:!0,subtree:!Pt,childList:!Pt,characterData:!Pt,attributeFilter:Pt?["wrap","cols","rows"]:[gt,yt,ki]}),ne=!0)}function ei(){c&&ne&&(I.disconnect(),W.disconnect(),ne=!1)}function Vn(){if(!ir){var n=sr[0],t={w:n[Di],h:n[Li]};if(Xt){var r=yi(t,A);A=t,r&&ui(!0,!1)}else A=t}}function qn(){ae&&ci(!0)}function Bn(){ae&&!H.hasClass(In)&&ci(!1)}function Xn(){oe&&(ci(!0),clearTimeout(F),F=setTimeout((function(){oe&&!Yt&&ci(!1)}),100))}function ii(n){var e=n?Mn:Fn,i=n?"off":"on",t=function(n,t,r){d?e(n,t,r):n[i](t,r)};oe&&!n?t(cr,$,Xn):(n&&t(cr,$,Xn),t(cr,G,qn),t(cr,J,Bn)),Xt||n||cr.one("mouseover",qn)}function Yn(n){return Hi.prvD(n),!1}function Pn(){ui(!1,!0)}function oi(){var n={};return $t&&br&&(n.w=bi(br.css(Te+Oe)),n.h=bi(br.css(Te+Ae)),n.c=yi(n,Qr),n.f=!0),(Qr=n).c||!1}function $n(n,t){var r=t!==Ti&&null!==t?t.split(We):Ce,e=n!==Ti&&null!==n?n.split(We):Ce;if(r===Ce&&e===Ce)return!1;var i,o,a,u,f,c=function h(n,t){var r,e,i=[],o=[];for(r=0;r<n.length;r++)i[n[r]]=!0;for(r=0;r<t.length;r++)i[t[r]]?delete i[t[r]]:i[t[r]]=!0;for(e in i)o.push(e);return o}(e,r),l=!1,s=Gr!==Ti&&null!==Gr?Gr.split(We):[Ce],v=$r!==Ti&&null!==$r?$r.split(We):[Ce],d=Ii.inArray(Qe,c);for(-1<d&&c.splice(d,1),o=0;o<c.length;o++)if(0!==(i=c[o]).indexOf(on)){for(f=u=!0,a=0;a<s.length;a++)if(i===s[a]){u=!1;break}for(a=0;a<v.length;a++)if(i===v[a]){f=!1;break}if(u&&f){l=!0;break}}return l}function ai(){if(!ir){var n,t,r,e,i=!Ur,o=be.w,a=be.h,u={},f=Tr||i,c=fr[0];return u[Te+Oe]=Ce,u[Te+Ae]=Ce,u[Oe]=Ne,fr.css(u),n=c[Ci],t=f?Ri.max(n,c[Di]-1):1,u[Oe]=Tr?Ne:He,u[Te+Oe]=He,u[Ae]=Ne,fr.css(u),r=c[Oi],e=Ri.max(r,c[Li]-1),u[Oe]=t,u[Ae]=e,mr.css(u),u[Te+Oe]=o,u[Te+Ae]=a,fr.css(u),{ow:n,oh:r,dw:t,dh:e}}}function ui(n,t,r,e){var i=Hi.now(),o=0<ni&&Xt&&i-ar<ni&&!kr&&!Tr&&!e,a=cr.is(":hidden"),u=wi(a,Zr,r);if(Zr=a,clearTimeout(ur),o&&(Ze.h=Ze.h||n,Ze.c=Ze.c||t,Ze.f=Ze.f||r,ur=setTimeout(ui,ni)),!(Yt||o||ir||Xt&&!r&&a||"inline"===cr.css("display"))){ar=i,n=n||Ze.h,t=t||Ze.c,r=r||Ze.f,Ze={},n=n!==Ti&&n,t=t!==Ti&&t,r=r!==Ti&&r,!Et||jt.x&&jt.y?qt=xi(!0,{},Wt.nativeScrollbarSize):(qt.x=0,qt.y=0),pe={x:3*(qt.x+(jt.x?0:3)),y:3*(qt.y+(jt.y?0:3))};var f={l:hr[_e](),t:hr[je]()},c=or.scrollbars,l=or.textarea,s=c.visibility,v=wi(s,Vr,r),d=c.autoHide,h=wi(d,qr,r),b=c.clickScrolling,p=wi(b,Br,r),m=c.dragScrolling,w=wi(m,Xr,r),y=or.className,g=wi(y,$r,r),x=or.resize,S=wi(x,Yr,r)&&!$t,z=!!Pt&&"off"!==fr.attr("wrap"),T=wi(z,Ur,r),k=or.paddingAbsolute,O=wi(k,Hr,r),A=or.clipAlways,L=wi(A,Rr,r),C=or.sizeAutoCapable&&!$t,N=wi(C,Mr,r),D=or.nativeScrollbarsOverlaid.showNativeScrollbars,H=wi(D,jr),R=or.autoUpdate,I=wi(R,Fr),W=or.overflowBehavior,_=yi(W,Wr,Re,Ie,r),j=l.dynWidth,F=wi(Kr,j),M=l.dynHeight,U=wi(Jr,M);if(ee="n"===d,ie="s"===d,oe="m"===d,ae="l"===d,re=c.autoHideDelay,ue=c.touchSupport,Gr=$r,fe="n"===x,ce="b"===x,le="h"===x,se="v"===x,Pr=or.normalizeRTL,D=D&&jt.x&&jt.y,Vr=s,qr=d,Br=b,Xr=m,$r=y,Yr=x,Ur=z,Hr=k,Rr=A,Mr=C,jr=D,Fr=R,Wr=xi(!0,{},W),Kr=j,Jr=M,Sr=Sr||{x:!1,y:!1},g&&(zi(cr,Gr+We+Qe),Si(cr,y!==Ti&&null!==y&&0<y.length?y:Qe)),I&&(!0===R?(ei(),_t.add(de)):null===R&&Ut?(ei(),_t.add(de)):(_t.remove(de),ri())),N)if(C)if(vr===Ti&&(vr=Ii(mi(Ye)),dr.before(vr)),Jt)lr.show();else{lr=Ii(mi(Pe)),vr.before(lr);var E={w:-1,h:-1};ti(lr,(function(){var n={w:lr[0][Ci],h:lr[0][Oi]};yi(n,E)&&(Xt&&kr&&0<n.h||Tr&&0<n.w?ui():(Xt&&!kr&&0===n.h||!Tr&&0===n.w)&&ui()),E=n})),Jt=!0,null!==Vt&&lr.css(Ae,Vt+"(100% + 1px)")}else Jt&&lr.hide();r&&(sr.find("*").trigger(De),Jt&&lr.find("*").trigger(De));var V,q=cr.css("direction"),B=wi(q,Dr,r),X=cr.css("box-sizing"),Y=wi(X,Ar,r),P={c:r,t:bi(cr.css(we+ge)),r:bi(cr.css(we+xe)),b:bi(cr.css(we+Se)),l:bi(cr.css(we+ze))};try{V=Jt?lr[0].getBoundingClientRect():null}catch(Rt){return}Gt="border-box"===X;var $=(er="rtl"===q)?ze:xe,G=er?xe:ze,J=cr[0],K=dr[0],Q=!1,Z=!(!Jt||"none"===cr.css(Le))&&(0===Ri.round(V.right-V.left)&&(!!k||0<J[Ni]-Kt));if(C&&!Z){var nn=J[Ci],tn=vr.css(Oe);vr.css(Oe,Ne);var rn=J[Ci];vr.css(Oe,tn),(Q=nn!==rn)||(vr.css(Oe,nn+1),rn=J[Ci],vr.css(Oe,tn),Q=nn!==rn)}var en=(Z||Q)&&C&&!a,on=wi(en,Tr,r),an=!en&&Tr,un=!(!Jt||a)&&0===Ri.round(V.bottom-V.top),fn=wi(un,kr,r),cn=!un&&kr,ln="-"+Oe,sn=en&&Gt||!Gt,vn=un&&Gt||!Gt,dn={c:r,t:vn?bi(cr.css(ye+ge+ln),!0):0,r:sn?bi(cr.css(ye+xe+ln),!0):0,b:vn?bi(cr.css(ye+Se+ln),!0):0,l:sn?bi(cr.css(ye+ze+ln),!0):0},hn={c:r,t:bi(cr.css(me+ge)),r:bi(cr.css(me+xe)),b:bi(cr.css(me+Se)),l:bi(cr.css(me+ze))},bn={h:String(cr.css(ke+Ae)),w:String(cr.css(ke+Oe))},pn={},mn={},wn=function(){return{w:J[Ni],h:J[Ai]}},yn=function(){var n=K.getBoundingClientRect();return n[Oe]?{w:n[Oe],h:n[Ae]}:{w:K[Ci],h:K[Oi]}};if(Kt=P.l+P.r,Qt=P.t+P.b,P.ax=k?Kt:0,P.ay=k?Qt:0,P.c=gi(P,Lr),Zt=dn.l+dn.r,nr=dn.t+dn.b,dn.c=gi(dn,Cr),tr=hn.l+hn.r,rr=hn.t+hn.b,hn.c=gi(hn,Nr),bn.ih=bi(bn.h),bn.iw=bi(bn.w),bn.ch=-1<bn.h.indexOf("px"),bn.cw=-1<bn.w.indexOf("px"),bn.c=yi(bn,Or,r),Dr=q,Ar=X,Tr=en,kr=un,Lr=P,Cr=dn,Nr=hn,Or=bn,B&&Jt&&lr.css(Le,G),P.c||B||O||on||fn||Y||N){var gn={},xn={};hi(mn,me,[-P.t,-P.r,-P.b,-P.l]),k?(hi(gn,Ce,[P.t,P.r,P.b,P.l]),hi(Pt?xn:pn,we)):(hi(gn,Ce),hi(Pt?xn:pn,we,[P.t,P.r,P.b,P.l])),dr.css(gn),fr.css(xn)}be=yn();var Sn=!!Pt&&ai();if(un&&(fn||O||Y||bn.c||P.c||dn.c)?(bn.cw&&(pn[ke+Ae]=bn.ch?bn.ih-P.ay+(Gt?-nr:Qt):Ce),pn[Ae]=Ne):(fn||O)&&(pn[ke+Ae]=Ce,pn[Ae]=He),en&&(on||O||Y||bn.c||P.c||dn.c||B)?(bn.cw&&(pn[ke+Oe]=bn.cw?bn.iw-P.ax+(Gt?-Zt:Kt)+(jt.y?Ft.y:0):Ce),pn[Oe]=Ne,mn[ke+Oe]=He):(on||O)&&(pn[ke+Oe]=Ce,pn[Oe]=He,pn[Le]=Ce,mn[ke+Oe]=Ce),en&&(bn.cw||(pn[ke+Oe]=Ce),mn[Oe]=Pt&&j?Sn.dw:Ne,pn[Oe]=Ne,pn[Le]=G),un&&(bn.ch||(pn[ke+Ae]=Ce),mn[Ae]=Pt?M?Sn.dh:Ne:pr[0][Ai]),C&&vr.css(mn),pr.css(pn),pn={},mn={},n||t||B||Y||O||on||en||fn||un||bn.c||H||_||L||S||v||F||U||T||r){var zn="overflow",Tn=zn+"-x",kn=zn+"-y",On=Bt?jt.x||jt.y||be.w<pe.y||be.h<pe.x||un||u:un,An={},Ln=Sr.y&&zr.ys&&!D?jt.y?hr.css($):-qt.y:0,Cn=Sr.x&&zr.xs&&!D?jt.x?hr.css(Se):-qt.x:0;hi(An,Ce),hr.css(An),On&&pr.css(zn,"hidden");var Nn=pi(),Dn=Bt&&!On?hr[0]:Nn,Hn={w:Nn[Ni],h:Nn[Ai]},Rn={w:Ri.max(Nn[Di],Dn[Di]),h:Ri.max(Nn[Li],Dn[Li])},In=Pt&&Sn&&!j?Sn.ow:en?Hn.w:Rn.w,Wn=Pt&&Sn&&!M?Sn.oh:un?Hn.h:Rn.h;An[Se]=cn?Ce:Cn,An[$]=an?Ce:Ln,hr.css(An),be=yn();var _n=wn(),jn={w:Ri.max(In+P.ax,_n.w-Kt),h:Ri.max(Wn+P.ay,_n.h-Qt)};if(jn.c=yi(jn,Ir,r),Ir=jn,C){(jn.c||un||en)&&(mn[Oe]=jn.w,mn[Ae]=jn.h);var Fn=mn[Oe]+(Gt?Zt:-Kt),Mn=mn[Ae]+(Gt?nr:-Qt),Un={};(!en||!en&&dn.c)&&(mn[Oe]=_n.w-(Gt?0:Kt+Zt)-1-tr),(!un||!un&&dn.c)&&(mn[Ae]=_n.h-(Gt?0:Qt+nr)-1-rr),en&&bn.cw&&bn.iw===Fn&&(mn[Oe]=Fn+(Gt?0:Kt)+1),un&&bn.ch&&bn.ih===Mn&&(mn[Ae]=Mn+(Gt?0:Qt)+1),en&&(Hn.w<be.w||Pt&&!z)&&0===Kt&&(Pt&&(Un[Oe]=bi(mr.css(Oe))-1),mn[Oe]-=1),un&&(Hn.h<be.h||Pt)&&0===Qt&&(Pt&&(Un[Ae]=bi(mr.css(Ae))-1),mn[Ae]-=1),0<Wn&&(mn[Oe]=Ri.max(1,mn[Oe]),mn[Ae]=Ri.max(1,mn[Ae])),Pt&&mr.css(Un),vr.css(mn)}en&&(pn[Oe]=He),!en||Gt||ne||(pn[Le]="none"),pr.css(pn),pn={};var En=Nn.getBoundingClientRect(),Vn=En[Oe]||0,qn=En[Ae]||0,Bn={w:Ri.max(Nn[Di],Dn[Di])+bi(Vn)-Vn,h:Ri.max(Nn[Li],Dn[Li])+bi(qn)-qn};Bn.c=t=yi(Bn,gr,r),gr=Bn,On&&pr.css(zn,Ce),be=yn(),n=yi(_n=wn(),yr),yr=_n;var Xn={x:"v-s"===W.x,y:"v-s"===W.y},Yn="v-h"===W.x,Pn="v-h"===W.y,$n={x:"s"===W.x,y:"s"===W.y},Gn={x:Ri.max(0,Ri.round(100*(Bn.w-be.w))/100),y:Ri.max(0,Ri.round(100*(Bn.h-be.h))/100)},Jn=Pt&&(0===be.w||0===be.h),Kn=0===hr[0].scrollLeftMax&&0<Gn.x&&Gn.x<1||0===hr[0].scrollTopMax&&0<Gn.y&&Gn.y<1;(Jn||Kn)&&(Gn.x=Gn.y=0);var Qn={x:0<Gn.x,y:0<Gn.y},Zn={x:Qn.x,y:Qn.y};(Xn.x||Yn)&&(Zn.x=Qn.y&&!Xn.y&&!Pn),(Xn.y||Pn)&&(Zn.y=Qn.x&&!Xn.x&&!Yn),Zn.xs=!!Zn.x&&($n.x||Xn.x),Zn.ys=!!Zn.y&&($n.y||Xn.y);var nt={x:Qn.x&&Zn.xs,y:Qn.y&&Zn.ys},tt=_r;if(Gn.c=yi(Gn,_r,Re,Ie,r),_r=Gn,Qn.c=yi(Qn,Sr,Re,Ie,r),Sr=Qn,Zn.c=yi(Zn,zr,Re,Ie,r),zr=Zn,jt.x||jt.y){var rt="px solid transparent",et={},it={},ot=r;(Qn.x||Qn.y)&&(it.w=jt.y&&Qn.y?Bn.w+Ft.y:Ce,it.h=jt.x&&Qn.x?Bn.h+Ft.x:Ce,ot=wi(it,xr,r),xr=it),(Qn.c||Zn.c||Bn.c||B||on||fn||en||un||H)&&(pn[me+G]=pn[ye+G]=Ce,jt.x&&Qn.x&&Zn.xs?(pn[me+Se]=un?D?Ce:Ft.x:Ce,pn[ye+Se]=un||D?Ce:Ft.x+rt):(it.h=pn[me+Se]=pn[ye+Se]=Ce,ot=!0),jt.y&&Qn.y&&Zn.ys?(pn[me+$]=en?D?Ce:Ft.y:Ce,pn[ye+$]=D?Ce:Ft.y+rt):(it.w=pn[me+$]=pn[ye+$]=Ce,ot=!0)),D&&(it.w=it.h=Ce,ot=!0),ot&&(et[Oe]=Zn.y?it.w:Ce,et[Ae]=Zn.x?it.h:Ce,br||(br=Ii(mi(Xe)),hr.prepend(br)),br.css(et)),pr.css(pn)}var at={};gn={};if(n||Qn.c||Zn.c||Bn.c||_||Y||H||B||L||fn){at[G]=Ce;var ut=function(){at[Se]=Ce,he.h=0},ft=function(){at[$]=Ce,he.w=0};if(Qn.x&&Zn.xs?(at[Tn]=De,D?ut():(at[Se]=-(jt.x?Ft.x:qt.x),he.h=jt.x?Ft.y:0)):(at[Tn]=Ce,ut()),Qn.y&&Zn.ys?(at[kn]=De,D?ft():(at[$]=-(jt.y?Ft.y:qt.y),he.w=jt.y?Ft.x:0)):(at[kn]=Ce,ft()),(be.h<pe.x||be.w<pe.y)&&(Qn.x&&Zn.x&&!jt.x||Qn.y&&Zn.y&&!jt.y)?(at[we+ge]=pe.x,at[me+ge]=-pe.x,at[we+G]=pe.y,at[me+G]=-pe.y):at[we+ge]=at[me+ge]=at[we+G]=at[me+G]=Ce,at[we+$]=at[me+$]=Ce,Qn.x&&Zn.x||Qn.y&&Zn.y||Jn?Pt&&Jn&&(gn[Tn]=gn[kn]="hidden"):(!A||Yn||Xn.x||Pn||Xn.y)&&(Pt&&(gn[Tn]=gn[kn]=Ce),at[Tn]=at[kn]="visible"),dr.css(gn),hr.css(at),at={},(Qn.c||Y||on||fn)&&(!jt.x||!jt.y)){var ct=pr[0],lt=ct[ki];lt.webkitTransform="scale(1)",lt.display="run-in",ct[Oi],lt.display=Ce,lt.webkitTransform=Ce}}if(pn={},B||on||fn)if(er&&en){var st=pr.css(Le),vt=Ri.round(pr.css(Le,Ce).css(ze,Ce).position().left);pr.css(Le,st),vt!==Ri.round(pr.position().left)&&(pn[ze]=vt)}else pn[ze]=Ce;pr.css(pn);var dt,ht,bt="v"===s,pt="h"===s,mt="a"===s,wt=Hi.bind(fi,0,!0,!0,nt.x),yt=Hi.bind(fi,0,!1,!0,nt.y),gt=Hi.bind(fi,0,!0,!1,nt.x),xt=Hi.bind(fi,0,!1,!1,nt.y);if(Zn.x||Zn.y?Si(cr,Ve):zi(cr,Ve),Zn.x?Si(cr,qe):zi(cr,qe),Zn.y?Si(cr,Be):zi(cr,Be),B&&(er?Si(cr,Me):zi(cr,Me)),$t&&Si(cr,Ue),S){var St=function(){wr.off(Fe,ve)};fe?(Si(cr,Ue),zi(wr,[$e,Ge,Je,Ke].join(We)),St()):(zi(cr,Ue),Si(wr,$e),ce?Si(wr,Ge):le?Si(wr,Je):se&&Si(wr,Ke),St(),wr.on(Fe,ve))}if((v||_||Zn.c||Qn.c||H)&&(D?H&&(zi(cr,Ee),D&&(gt(),xt())):mt?(nt.x?wt():gt(),nt.y?yt():xt()):bt?(wt(),yt()):pt&&(gt(),xt())),(h||H)&&(ae||oe?(ii(!0),ii()):ii(!0),ee?ci(!0):ci(!1,!0)),(n||Gn.c||fn||on||S||Y||O||H||B)&&(li(!0),si(!0,f.l),li(!1),si(!1,f.t)),p&&vi(!0,b),w&&vi(!1,m),Pt&&t){var zt=function It(){var n=fr[0].selectionStart;if(n===Ti)return;var t,r,e="length",i=fr.val(),o=i[e],a=i.split("\n"),u=a[e],f=i.substr(0,n).split("\n"),c=0,l=0,s=f[e],v=f[f[e]-1][e];for(r=0;r<a[e];r++)t=a[r][e],l<t&&(c=r+1,l=t);return{cR:s,cC:v,r:u,c:l,w:c,p:n,m:o}}();if(zt){var Tt=Er===Ti||zt.rows!==Er.rows,kt=zt.cR,Ot=zt.cC,At=zt.w,Lt=zt.r,Ct=zt.c,Nt=zt.p,Dt=zt.m<=Nt&&te,Ht={x:z||Ot!==Ct||kt!==At?-1:_r.x,y:(z?Dt||Tt&&tt!==Ti&&f.t===tt.y:(Dt||Tt)&&kt===Lt)?_r.y:-1};dt=-1<Ht.x,(ht=-1<Ht.y)&&hr[je](Ht.y),dt&&(er&&Pr&&Mt.i?hr[_e](0):hr[_e](Ht.x))}Er=zt}er&&Mt.i&&jt.y&&Qn.x&&Pr&&(f.l+=he.w||0),dt||hr[_e](f.l),ht||hr[je](f.t),en&&cr[_e](0),un&&cr[je](0),B&&di("onDirectionChanged",{isRTL:er,dir:q}),n&&di("onHostSizeChanged",{width:yr.w,height:yr.h}),t&&di("onContentSizeChanged",{width:gr.w,height:gr.h}),(Qn.c||Zn.c)&&di("onOverflowChanged",{x:Qn.x,y:Qn.y,xScrollable:Zn.xs,yScrollable:Zn.ys,clipped:Zn.x||Zn.y}),Gn.c&&di("onOverflowAmountChanged",{x:Gn.x,y:Gn.y})}$t&&(Sr.c||Qr.c)&&(Qr.f||oi(),jt.y&&Sr.x&&pr.css(Te+Oe,Qr.w+Ft.y),jt.x&&Sr.y&&pr.css(Te+Ae,Qr.h+Ft.x),Qr.c=!1),di("onUpdated",{forced:r})}}function Gn(n){o=xi(!0,{},o,ct.v(n,ct.t,!0)),or=xi(!0,{},or,ct.v(n,ct.t,!1,!0))}function Jn(e){var n=or.textarea.inheritedAttrs,i={},t=function(){var r=e?fr:cr;Ii.each(i,(function(n,t){ot(t)==pt&&(n==yt?r.addClass(t):r.attr(n,t))}))},r=[on,an,Ue,Me,un,fn,cn,Ee,Ve,qe,Be,Qe,dn,zn,$r].join(We);if(ot(n=ot(n)==pt?n.split(" "):n)==bt&&Ii.each(n,(function(n,t){ot(t)==pt&&(i[t]=e?cr.attr(t):fr.attr(t))})),e)pr.contents().unwrap().unwrap().unwrap(),zi(cr,r),Pt?(fr.removeAttr(ki),u&&t(),zi(fr,r),at(mr),u?(fr.unwrap(),at(cr)):Si(cr,an)):zi(fr,on),$t&&zi(l,en),at(sr);else{if(Pt){var o={},a=fr.parent();u=!(a.hasClass(an)&&1===a.children()[xt]),or.sizeAutoCapable||(o[Oe]=fr.css(Oe),o[Ae]=fr.css(Ae)),u&&fr.wrap(mi(an)),(cr=fr.parent()).css(o).wrapInner(mi(yn+We+zn)).wrapInner(mi(pn+We+zn)).wrapInner(mi(bn+We+zn)),pr=ut(cr,q+yn),hr=ut(cr,q+pn),dr=ut(cr,q+bn),mr=Ii(mi(hn)),pr.prepend(mr),Si(fr,dn+We+zn),u&&t()}else(cr=fr).wrapInner(mi(yn)).wrapInner(mi(pn)).wrapInner(mi(bn)),pr=ut(cr,q+yn),hr=ut(cr,q+pn),dr=ut(cr,q+bn),Si(fr,on);Et&&Si(hr,jt.x&&jt.y?wn:mn),$t&&Si(l,en),sr=Ii(mi("os-resize-observer-host")),cr.prepend(sr)}}function Kn(n){var r,t,e,i,o=[112,113,114,115,116,117,118,119,120,121,123,33,34,37,38,39,40,16,17,18,19,20,144],a=[],u=n?"off":"on";!n&&Pt&&(e=function(n){ai(),de.update(Ne),n&&clearInterval(r)},(_={})[De]=function(n){return fr[_e](Mt.i&&Pr?9999999:0),fr[je](0),Hi.prvD(n),Hi.stpP(n),!1},_.drop=function(){setTimeout((function(){Yt||e()}),50)},_.focus=function(){te=!0},_.focusout=function(){e(!(te=!(a=[])))},9<C||!Ut?_.input=function(){e()}:(_[K]=function(n){var t=n.keyCode;-1<Ii.inArray(t,o)||(a.length||(e(),r=setInterval(e,1e3/60)),-1===Ii.inArray(t,a)&&a.push(t))},_[Q]=function(n){var t=n.keyCode,r=Ii.inArray(t,a);-1<Ii.inArray(t,o)||(-1<r&&a.splice(r,1),a.length||e(!0))})),Pt?Ii.each(_,(function(n,t){fr[u](n,t)})):pr[u](nn,(function(n){!0!==Fr&&function s(n){if(!Xt)return!0;var t="flex-grow",r="flex-shrink",e="flex-basis",i=[Oe,Te+Oe,ke+Oe,me+ze,me+xe,ze,xe,"font-weight","word-spacing",t,r,e],o=[we+ze,we+xe,ye+ze+Oe,ye+xe+Oe],a=[Ae,Te+Ae,ke+Ae,me+ge,me+Se,ge,Se,"line-height",t,r,e],u=[we+ge,we+Se,ye+ge+Oe,ye+Se+Oe],f="s"===Wr.x||"v-s"===Wr.x,c=!1,l=function(n,t){for(var r=0;r<n.length;r++)if(n[r]===t)return!0;return!1};return("s"===Wr.y||"v-s"===Wr.y)&&((c=l(a,n))||Gt||(c=l(u,n))),f&&!c&&((c=l(i,n))||Gt||(c=l(o,n))),c}((n=n.originalEvent||n).propertyName)&&ui(Ne)})),n||(i=function(n){ir||(t!==Ti?clearTimeout(t):((ie||oe)&&ci(!0),et()||Si(cr,Ee),di("onScrollStart",n)),si(!0),si(!1),di("onScroll",n),t=setTimeout((function(){Yt||(clearTimeout(t),t=Ti,(ie||oe)&&ci(!1),et()||zi(cr,Ee),di("onScrollStop",n))}),175))},d?Fn(hr,De,i):hr.on(De,i))}function Qn(n){n?(at(a),at(p)):(a=Ii(mi(Tn+We+Hn)),f=Ii(mi(kn)),s=Ii(mi(An)),p=Ii(mi(Tn+We+Rn)),m=Ii(mi(kn)),w=Ii(mi(An)),a.append(f),f.append(s),p.append(m),m.append(w),dr.after(p),dr.after(a))}function Zn(g){var i,x,S,z=nt(g),o=b.top!==b,T=z.xy,a=z.XY,k=De+z.LT,r="active",O=1,t=[16,17];function e(){O=.5}function u(){O=1}function f(n){-1<Ii.inArray(n.keyCode,t)&&e()}function c(n){-1<Ii.inArray(n.keyCode,t)&&u()}function l(n){var t=(n.originalEvent||n).touches!==Ti;return!(ir||Yt||et()||!Xr||t&&!ue)&&(1===Hi.mBtn(n)||t)}function s(n){if(l(n)){var t=z.i.tl,r=z.i.hl,e=z.i.ms*(((C&&o?n["screen"+a]:Hi.page(n)[T])-x)/(t-r));e=isFinite(e)?e:0,er&&g&&!Mt.i&&(e*=-1),hr[k](i+e),d||Hi.prvD(n)}else A(n)}function A(n){if(n=n||n.originalEvent,zi(H,In),zi(z.h,r),zi(z.t,r),zi(z.s,r),D.off($,s).off(P,A).off(K,f).off(Q,c).off(Z,Yn),u(),S!==(x=i=Ti)&&(de.scrollStop(),clearTimeout(S),S=Ti),n){var t=cr[0].getBoundingClientRect();n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom||Bn(),(ie||oe)&&ci(!1)}}function L(n){i=(i=hr[k]())===Ti?0:i,(er&&g&&!Mt.n||!er)&&(i=i<0?0:i),x=C&&o?n["screen"+a]:Hi.page(n)[T],Si(H,In),Si(z.h,r),Si(z.s,r),D.on($,s).on(P,A).on(Z,Yn),!C&&h||Hi.prvD(n),Hi.stpP(n)}z.h.on(Fe,(function(n){l(n)&&L(n)})),z.t.on(Fe,(function(s){if(l(s)){var v,d,h=be[z.o],b=z.t.offset()[z.lt],n=s.ctrlKey,p=s.shiftKey,m=p&&n,w=!0,y=function(){if(!Yt){var n=x-b,t=z.i.tl,r=z.i.ho,e=z.i.hl,i=z.i.ms,o=270*O,a=w?Ri.max(400,o):o,u=i*((n-e/2)/(t-e)),f=er&&g&&(!Mt.i&&!Mt.n||Pr),c=f?r<n:n<r,l={};p?(u=isFinite(u)?u:0,er&&g&&!Mt.i&&(u=i-u),m?(l.n=!1,l[T]=u,de.scroll(l,130,"linear",(function(){L(s)}))):(hr[k](u),L(s))):(v=w?c:v,d=f?v?n<=r+e:r<=n:v?r<=n:n<=r+e,l[T]=v?"-="+h:"+="+h,de.scrollStop(),de.scroll(l,o,"linear"),S=d?(clearTimeout(S),de.scrollStop(),Ti):setTimeout(y,a),w=!1)}};n&&e(),x=Hi.page(s)[T],Si(H,In),Si(z.t,r),Si(z.s,r),D.on(P,A).on(K,f).on(Q,c).on(Z,Yn),y(),Hi.prvD(s),Hi.stpP(s)}})).on(G,(function(){(ie||oe)&&ci(M=!0)})).on(J,(function(){(ie||oe)&&ci(M=!1)})),z.s.on(Fe,(function(n){Hi.stpP(n)})),v&&z.s.on(nn,(function(n){n.target===z.s[0]&&(li(g),si(g))}))}function fi(n,t,r){var e=n?un:fn,i=n?a:p;t?zi(cr,e):Si(cr,e),r?zi(i,Cn):Si(i,Cn)}function ci(n,t){if(clearTimeout(j),n)zi(a,Nn),zi(p,Nn);else{var r=function(){if(!M&&!Yt){var n=s.hasClass("active")||w.hasClass("active");!n&&(ie||oe||ae)&&Si(a,Nn),!n&&(ie||oe||ae)&&Si(p,Nn)}};0<re&&!0!==t?j=setTimeout(r,re):r()}}function li(n){var t={},r=nt(n),e=Ri.min(1,(yr[r.o]-(Hr?n?Kt:Qt:0))/gr[r.o]);t[r.wh]=Ri.floor(100*e*1e6)/1e6+"%",et()||r.h.css(t),r.i.hl=r.h[0]["offset"+r.WH],r.i.hlr=e}function si(n,t){t=t===Ti?n?hr[_e]():hr[je]():t;var r,e,i,o=er&&n,a={},u=nt(n),f="translate(",c="transform",l=hr[0][De+u.WH]-hr[0]["client"+u.WH],s=u.i.hl,v=u.t[0]["offset"+u.WH],d=v-s;Mt.n&&o&&(l*=-1),i=t/l,i=isNaN(i)?0:Ri.min(1,i),u.i.ms=l,u.i.cs=t,d*=u.i.csr=i,d=isNaN(d)?0:d,o&&!Mt.i&&(d=v-s-d),d=Ri.max(0,d),ln?(e=o?-(v-s-d):d,r=n?f+e+"px, 0)":f+"0, "+e+"px)",a["-webkit-"+c]=r,a["-moz-"+c]=r,a["-ms-"+c]=r,a["-o-"+c]=r,a[c]=r):a[u.lt]=d,et()||u.h.css(a),u.i.ho=d,u.i.tl=v}function vi(n,t){var r=t?"removeClass":"addClass",e=n?m:w,i=n?On:Ln;(n?f:s)[r](i),e[r](i)}function nt(n){return{wh:n?Oe:Ae,WH:n?"Width":"Height",lt:n?ze:ge,LT:n?"Left":"Top",xy:n?Re:Ie,XY:n?"X":"Y",o:n?"w":"h",u:n?"l":"t",t:n?f:m,h:n?s:w,s:n?a:p,i:n?sn:vn}}function tt(n){n?at(wr):(wr=Ii(mi(Dn)),cr.append(wr))}function di(n,t){if(Xt){var r,e=or.callbacks[n],i=n;"on"===i.substr(0,2)&&(i=i.substr(2,1).toLowerCase()+i.substr(3)),ot(e)==ht&&e.call(de,t),Ii.each(_n,(function(){ot((r=this).on)==ht&&r.on(i,t)}))}else Yt||Wn.push({n:n,a:t})}function hi(n,t,r){r===Ti&&(r=[Ce,Ce,Ce,Ce]),n[t+ge]=r[0],n[t+xe]=r[1],n[t+Se]=r[2],n[t+ze]=r[3]}function rt(n){var t="ownerDocument",r="HTMLElement",e=n&&n[t]&&n[t].parentWindow||lt;return typeof e[r]==dt?n instanceof e[r]:n&&typeof n==dt&&null!==n&&1===n.nodeType&&typeof n.nodeName==pt}function bi(n,t){var r=t?parseFloat(n):parseInt(n);return isNaN(r)?0:r}function et(){return jr&&jt.x&&jt.y}function pi(){return Pt?mr[0]:pr[0]}function mi(r,n){return"<div "+(r?ot(r)==pt?'class="'+r+'"':function(){var n,t="";if(Ii.isPlainObject(r))for(n in r)t+=("className"===n?"class":n)+'="'+r[n]+'" ';return t}():Ce)+">"+(n||Ce)+"</div>"}function it(n,t){for(var r,e=t.split(q),i=0;i<e.length;i++){if(!n.hasOwnProperty(e[i]))return;r=n[e[i]],i<e.length&&ot(r)==dt&&(n=r)}return r}function wi(n,t,r){return!0===r?r:t===Ti||n!==t}function yi(n,t,r,e,i){if(!0===i)return i;if(e===Ti&&i===Ti){if(!0===r)return r;r=Ti}return r=r===Ti?"w":r,e=e===Ti?"h":e,t===Ti||(n[r]!==t[r]||n[e]!==t[e])}function gi(n,t){return t===Ti||(n.t!==t.t||n.r!==t.r||n.b!==t.b||n.l!==t.l)}function ot(n){return Hi.type(n)}function xi(){return Ii.extend.apply(this,arguments)}function Si(n,t){return E.addClass.call(n,t)}function zi(n,t){return E.removeClass.call(n,t)}function at(n){return E.remove.call(n)}function ut(n,t){return E.find.call(n,t).eq(0)}}return lt[vt]=function(n,r,e){if(0===arguments.length)return this;var i,t,o=[],a=Ii.isPlainObject(r);return n?(n=n.length!=Ti?n:[n[0]||n],l(),0<n.length&&(a?Ii.each(n,(function(n,t){(i=t)!==Ti&&o.push(v(i,r,e,u,f))})):Ii.each(n,(function(n,t){i=Tt(t),"!"===r&&i instanceof lt[vt]||Hi.type(r)==ht&&r(t,i)?o.push(i):r===Ti&&o.push(i)})),t=1===o.length?o[0]:o),t):a||!r?t:o},lt[vt].globals=function(){l();var n=Ii.extend(!0,{},u);return delete n.msie,n},lt[vt].defaultOptions=function(n){l();var t=u.defaultOptions;if(n===Ti)return Ii.extend(!0,{},t);u.defaultOptions=Ii.extend(!0,{},t,ct.v(n,ct.t,!0))},lt[vt].extension=function(n,t,r){var e=Hi.type(n)==pt,i=arguments[xt],o=0;if(i<1||!e)return Ii.extend(!0,{length:c[xt]},c);if(e)if(Hi.type(t)==ht)c.push({name:n,extensionFactory:t,defaultOptions:r});else for(;o<c[xt];o++)if(c[o].name===n){if(!(1<i))return Ii.extend(!0,{},c[o]);c.splice(o,1)}},lt[vt]}();return zt&&zt.fn&&(zt.fn.overlayScrollbars=function(n,t){return zt.isPlainObject(n)?(zt.each(this,(function(){r(this,n,t)})),this):r(this,n)}),r}));(function(a,b,c){(function(a){typeof define=="function"&&define.amd?define(["jquery"],a):jQuery&&!jQuery.fn.sparkline&&a(jQuery)})((function(d){"use strict";var e={},f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L=0;f=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:c,normalRangeMax:c,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:c,chartRangeMax:c,chartRangeMinX:c,chartRangeMaxX:c,tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:c,nullColor:c,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,colorMap:c,tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new h('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:c,thresholdValue:0,chartRangeMax:c,chartRangeMin:c,chartRangeClip:!1,tooltipFormat:new h("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:c,tooltipFormat:new h("{{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 h('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:c,targetColor:"#4a2",chartRangeMax:c,chartRangeMin:c,tooltipFormat:new h("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},E='.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;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',g=function(){var a,b;return a=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(a.prototype=d.extend(new arguments[0],arguments[arguments.length-1]),a._super=arguments[0].prototype):a.prototype=arguments[arguments.length-1],arguments.length>2&&(b=Array.prototype.slice.call(arguments,1,-1),b.unshift(a.prototype),d.extend.apply(d,b))):a.prototype=arguments[0],a.prototype.cls=a,a},d.SPFormatClass=h=g({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(a,b){this.format=a,this.fclass=b},render:function(a,b,d){var e=this,f=a,g,h,i,j,k;return this.format.replace(this.fre,(function(){var a;return h=arguments[1],i=arguments[3],g=e.precre.exec(h),g?(k=g[2],h=g[1]):k=!1,j=f[h],j===c?"":i&&b&&b[i]?(a=b[i],a.get?b[i].get(j)||j:b[i][j]||j):(n(j)&&(d.get("numberFormatter")?j=d.get("numberFormatter")(j):j=s(j,k,d.get("numberDigitGroupCount"),d.get("numberDigitGroupSep"),d.get("numberDecimalMark"))),j)}))}}),d.spformat=function(a,b){return new h(a,b)},i=function(a,b,c){return a<b?b:a>c?c:a},j=function(a,c){var d;return c===2?(d=b.floor(a.length/2),a.length%2?a[d]:(a[d-1]+a[d])/2):a.length%2?(d=(a.length*c+c)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1]):(d=(a.length*c+2)/4,d%1?(a[b.floor(d)]+a[b.floor(d)-1])/2:a[d-1])},k=function(a){var b;switch(a){case"undefined":a=c;break;case"null":a=null;break;case"true":a=!0;break;case"false":a=!1;break;default:b=parseFloat(a),a==b&&(a=b)}return a},l=function(a){var b,c=[];for(b=a.length;b--;)c[b]=k(a[b]);return c},m=function(a,b){var c,d,e=[];for(c=0,d=a.length;c<d;c++)a[c]!==b&&e.push(a[c]);return e},n=function(a){return!isNaN(parseFloat(a))&&isFinite(a)},s=function(a,b,c,e,f){var g,h;a=(b===!1?parseFloat(a).toString():a.toFixed(b)).split(""),g=(g=d.inArray(".",a))<0?a.length:g,g<a.length&&(a[g]=f);for(h=g-c;h>0;h-=c)a.splice(h,0,e);return a.join("")},o=function(a,b,c){var d;for(d=b.length;d--;){if(c&&b[d]===null)continue;if(b[d]!==a)return!1}return!0},p=function(a){var b=0,c;for(c=a.length;c--;)b+=typeof a[c]=="number"?a[c]:0;return b},r=function(a){return d.isArray(a)?a:[a]},q=function(b){var c;a.createStyleSheet?a.createStyleSheet().cssText=b:(c=a.createElement("style"),c.type="text/css",a.getElementsByTagName("head")[0].appendChild(c),c[typeof a.body.style.WebkitAppearance=="string"?"innerText":"innerHTML"]=b)},d.fn.simpledraw=function(b,e,f,g){var h,i;if(f&&(h=this.data("_jqs_vcanvas")))return h;if(d.fn.sparkline.canvas===!1)return!1;if(d.fn.sparkline.canvas===c){var j=a.createElement("canvas");if(!j.getContext||!j.getContext("2d")){if(!a.namespaces||!!a.namespaces.v)return d.fn.sparkline.canvas=!1,!1;a.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),d.fn.sparkline.canvas=function(a,b,c,d){return new J(a,b,c)}}else d.fn.sparkline.canvas=function(a,b,c,d){return new I(a,b,c,d)}}return b===c&&(b=d(this).innerWidth()),e===c&&(e=d(this).innerHeight()),h=d.fn.sparkline.canvas(b,e,this,g),i=d(this).data("_jqs_mhandler"),i&&i.registerCanvas(h),h},d.fn.cleardraw=function(){var a=this.data("_jqs_vcanvas");a&&a.reset()},d.RangeMapClass=t=g({init:function(a){var b,c,d=[];for(b in a)a.hasOwnProperty(b)&&typeof b=="string"&&b.indexOf(":")>-1&&(c=b.split(":"),c[0]=c[0].length===0?-Infinity:parseFloat(c[0]),c[1]=c[1].length===0?Infinity:parseFloat(c[1]),c[2]=a[b],d.push(c));this.map=a,this.rangelist=d||!1},get:function(a){var b=this.rangelist,d,e,f;if((f=this.map[a])!==c)return f;if(b)for(d=b.length;d--;){e=b[d];if(e[0]<=a&&e[1]>=a)return e[2]}return c}}),d.range_map=function(a){return new t(a)},u=g({init:function(a,b){var c=d(a);this.$el=c,this.options=b,this.currentPageX=0,this.currentPageY=0,this.el=a,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!b.get("disableTooltips"),this.highlightEnabled=!b.get("disableHighlight")},registerSparkline:function(a){this.splist.push(a),this.over&&this.updateDisplay()},registerCanvas:function(a){var b=d(a.canvas);this.canvas=a,this.$canvas=b,b.mouseenter(d.proxy(this.mouseenter,this)),b.mouseleave(d.proxy(this.mouseleave,this)),b.click(d.proxy(this.mouseclick,this))},reset:function(a){this.splist=[],this.tooltip&&a&&(this.tooltip.remove(),this.tooltip=c)},mouseclick:function(a){var b=d.Event("sparklineClick");b.originalEvent=a,b.sparklines=this.splist,this.$el.trigger(b)},mouseenter:function(b){d(a.body).unbind("mousemove.jqs"),d(a.body).bind("mousemove.jqs",d.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=b.pageX,this.currentPageY=b.pageY,this.currentEl=b.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new v(this.options),this.tooltip.updatePosition(b.pageX,b.pageY)),this.updateDisplay()},mouseleave:function(){d(a.body).unbind("mousemove.jqs");var b=this.splist,c=b.length,e=!1,f,g;this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null);for(g=0;g<c;g++)f=b[g],f.clearRegionHighlight()&&(e=!0);e&&this.canvas.render()},mousemove:function(a){this.currentPageX=a.pageX,this.currentPageY=a.pageY,this.currentEl=a.target,this.tooltip&&this.tooltip.updatePosition(a.pageX,a.pageY),this.updateDisplay()},updateDisplay:function(){var a=this.splist,b=a.length,c=!1,e=this.$canvas.offset(),f=this.currentPageX-e.left,g=this.currentPageY-e.top,h,i,j,k,l;if(!this.over)return;for(j=0;j<b;j++)i=a[j],k=i.setRegionHighlight(this.currentEl,f,g),k&&(c=!0);if(c){l=d.Event("sparklineRegionChange"),l.sparklines=this.splist,this.$el.trigger(l);if(this.tooltip){h="";for(j=0;j<b;j++)i=a[j],h+=i.getCurrentRegionTooltip();this.tooltip.setContent(h)}this.disableHighlight||this.canvas.render()}k===null&&this.mouseleave()}}),v=g({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(b){var c=b.get("tooltipClassname","jqstooltip"),e=this.sizeStyle,f;this.container=b.get("tooltipContainer")||a.body,this.tooltipOffsetX=b.get("tooltipOffsetX",10),this.tooltipOffsetY=b.get("tooltipOffsetY",12),d("#jqssizetip").remove(),d("#jqstooltip").remove(),this.sizetip=d("<div/>",{id:"jqssizetip",style:e,class:c}),this.tooltip=d("<div/>",{id:"jqstooltip",class:c}).appendTo(this.container),f=this.tooltip.offset(),this.offsetLeft=f.left,this.offsetTop=f.top,this.hidden=!0,d(window).unbind("resize.jqs scroll.jqs"),d(window).bind("resize.jqs scroll.jqs",d.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=d(window).scrollTop(),this.scrollLeft=d(window).scrollLeft(),this.scrollRight=this.scrollLeft+d(window).width(),this.updatePosition()},getSize:function(a){this.sizetip.html(a).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(a){if(!a){this.tooltip.css("visibility","hidden"),this.hidden=!0;return}this.getSize(a),this.tooltip.html(a).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition())},updatePosition:function(a,b){if(a===c){if(this.mousex===c)return;a=this.mousex-this.offsetLeft,b=this.mousey-this.offsetTop}else this.mousex=a-=this.offsetLeft,this.mousey=b-=this.offsetTop;if(!this.height||!this.width||this.hidden)return;b-=this.height+this.tooltipOffsetY,a+=this.tooltipOffsetX,b<this.scrollTop&&(b=this.scrollTop),a<this.scrollLeft?a=this.scrollLeft:a+this.width>this.scrollRight&&(a=this.scrollRight-this.width),this.tooltip.css({left:a,top:b})},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=c,d(window).unbind("resize.jqs scroll.jqs")}}),F=function(){q(E)},d(F),K=[],d.fn.sparkline=function(b,e){return this.each((function(){var f=new d.fn.sparkline.options(this,e),g=d(this),h,i;h=function(){var e,h,i,j,k,l,m;if(b==="html"||b===c){m=this.getAttribute(f.get("tagValuesAttribute"));if(m===c||m===null)m=g.html();e=m.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")}else e=b;h=f.get("width")==="auto"?e.length*f.get("defaultPixelsPerValue"):f.get("width");if(f.get("height")==="auto"){if(!f.get("composite")||!d.data(this,"_jqs_vcanvas"))j=a.createElement("span"),j.innerHTML="a",g.html(j),i=d(j).innerHeight()||d(j).height(),d(j).remove(),j=null}else i=f.get("height");f.get("disableInteraction")?k=!1:(k=d.data(this,"_jqs_mhandler"),k?f.get("composite")||k.reset():(k=new u(this,f),d.data(this,"_jqs_mhandler",k)));if(f.get("composite")&&!d.data(this,"_jqs_vcanvas")){d.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),d.data(this,"_jqs_errnotify",!0));return}l=new(d.fn.sparkline[f.get("type")])(this,e,f,h,i),l.render(),k&&k.registerSparkline(l)};if(d(this).html()&&!f.get("disableHiddenCheck")&&d(this).is(":hidden")||!d(this).parents("body").length){if(!f.get("composite")&&d.data(this,"_jqs_pending"))for(i=K.length;i;i--)K[i-1][0]==this&&K.splice(i-1,1);K.push([this,h]),d.data(this,"_jqs_pending",!0)}else h.call(this)}))},d.fn.sparkline.defaults=f(),d.sparkline_display_visible=function(){var a,b,c,e=[];for(b=0,c=K.length;b<c;b++)a=K[b][0],d(a).is(":visible")&&!d(a).parents().is(":hidden")?(K[b][1].call(a),d.data(K[b][0],"_jqs_pending",!1),e.push(b)):!d(a).closest("html").length&&!d.data(a,"_jqs_pending")&&(d.data(K[b][0],"_jqs_pending",!1),e.push(b));for(b=e.length;b;b--)K.splice(e[b-1],1)},d.fn.sparkline.options=g({init:function(a,b){var c,f,g,h;this.userOptions=b=b||{},this.tag=a,this.tagValCache={},f=d.fn.sparkline.defaults,g=f.common,this.tagOptionsPrefix=b.enableTagOptions&&(b.tagOptionsPrefix||g.tagOptionsPrefix),h=this.getTagSetting("type"),h===e?c=f[b.type||g.type]:c=f[h],this.mergedOptions=d.extend({},g,c,b)},getTagSetting:function(a){var b=this.tagOptionsPrefix,d,f,g,h;if(b===!1||b===c)return e;if(this.tagValCache.hasOwnProperty(a))d=this.tagValCache.key;else{d=this.tag.getAttribute(b+a);if(d===c||d===null)d=e;else if(d.substr(0,1)==="["){d=d.substr(1,d.length-2).split(",");for(f=d.length;f--;)d[f]=k(d[f].replace(/(^\s*)|(\s*$)/g,""))}else if(d.substr(0,1)==="{"){g=d.substr(1,d.length-2).split(","),d={};for(f=g.length;f--;)h=g[f].split(":",2),d[h[0].replace(/(^\s*)|(\s*$)/g,"")]=k(h[1].replace(/(^\s*)|(\s*$)/g,""))}else d=k(d);this.tagValCache.key=d}return d},get:function(a,b){var d=this.getTagSetting(a),f;return d!==e?d:(f=this.mergedOptions[a])===c?b:f}}),d.fn.sparkline._base=g({disabled:!1,init:function(a,b,e,f,g){this.el=a,this.$el=d(a),this.values=b,this.options=e,this.width=f,this.height=g,this.currentRegion=c},initTarget:function(){var a=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),a))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return this.disabled?(this.el.innerHTML="",!1):!0},getRegion:function(a,b){},setRegionHighlight:function(a,b,d){var e=this.currentRegion,f=!this.options.get("disableHighlight"),g;return b>this.canvasWidth||d>this.canvasHeight||b<0||d<0?null:(g=this.getRegion(a,b,d),e!==g?(e!==c&&f&&this.removeHighlight(),this.currentRegion=g,g!==c&&f&&this.renderHighlight(),!0):!1)},clearRegionHighlight:function(){return this.currentRegion!==c?(this.removeHighlight(),this.currentRegion=c,!0):!1},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(a){},getCurrentRegionTooltip:function(){var a=this.options,b="",e=[],f,g,i,j,k,l,m,n,o,p,q,r,s,t;if(this.currentRegion===c)return"";f=this.getCurrentRegionFields(),q=a.get("tooltipFormatter");if(q)return q(this,a,f);a.get("tooltipChartTitle")&&(b+='<div class="jqs jqstitle">'+a.get("tooltipChartTitle")+"</div>\n"),g=this.options.get("tooltipFormat");if(!g)return"";d.isArray(g)||(g=[g]),d.isArray(f)||(f=[f]),m=this.options.get("tooltipFormatFieldlist"),n=this.options.get("tooltipFormatFieldlistKey");if(m&&n){o=[];for(l=f.length;l--;)p=f[l][n],(t=d.inArray(p,m))!=-1&&(o[t]=f[l]);f=o}i=g.length,s=f.length;for(l=0;l<i;l++){r=g[l],typeof r=="string"&&(r=new h(r)),j=r.fclass||"jqsfield";for(t=0;t<s;t++)if(!f[t].isNull||!a.get("tooltipSkipNull"))d.extend(f[t],{prefix:a.get("tooltipPrefix"),suffix:a.get("tooltipSuffix")}),k=r.render(f[t],a.get("tooltipValueLookups"),a),e.push('<div class="'+j+'">'+k+"</div>")}return e.length?b+e.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(a,c){var d=c.get("highlightColor"),e=c.get("highlightLighten"),f,g,h,j;if(d)return d;if(e){f=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(a);if(f){h=[],g=a.length===4?16:1;for(j=0;j<3;j++)h[j]=i(b.round(parseInt(f[j+1],16)*g*e),0,255);return"rgb("+h.join(",")+")"}}return a}}),w={changeHighlight:function(a){var b=this.currentRegion,c=this.target,e=this.regionShapes[b],f;e&&(f=this.renderRegion(b,a),d.isArray(f)||d.isArray(e)?(c.replaceWithShapes(e,f),this.regionShapes[b]=d.map(f,(function(a){return a.id}))):(c.replaceWithShape(e,f),this.regionShapes[b]=f.id))},render:function(){var a=this.values,b=this.target,c=this.regionShapes,e,f,g,h;if(!this.cls._super.render.call(this))return;for(g=a.length;g--;){e=this.renderRegion(g);if(e)if(d.isArray(e)){f=[];for(h=e.length;h--;)e[h].append(),f.push(e[h].id);c[g]=f}else e.append(),c[g]=e.id;else c[g]=null}b.render()}},d.fn.sparkline.line=x=g(d.fn.sparkline._base,{type:"line",init:function(a,b,c,d,e){x._super.init.call(this,a,b,c,d,e),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(a,b,d){var e,f=this.regionMap;for(e=f.length;e--;)if(f[e]!==null&&b>=f[e][0]&&b<=f[e][1])return f[e][2];return c},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.yvalues[a]===null,x:this.xvalues[a],y:this.yvalues[a],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:a}},renderHighlight:function(){var a=this.currentRegion,b=this.target,d=this.vertices[a],e=this.options,f=e.get("spotRadius"),g=e.get("highlightSpotColor"),h=e.get("highlightLineColor"),i,j;if(!d)return;f&&g&&(i=b.drawCircle(d[0],d[1],f,c,g),this.highlightSpotId=i.id,b.insertAfterShape(this.lastShapeId,i)),h&&(j=b.drawLine(d[0],this.canvasTop,d[0],this.canvasTop+this.canvasHeight,h),this.highlightLineId=j.id,b.insertAfterShape(this.lastShapeId,j))},removeHighlight:function(){var a=this.target;this.highlightSpotId&&(a.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(a.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var a=this.values,c=a.length,d=this.xvalues,e=this.yvalues,f=this.yminmax,g,h,i,j,k;for(g=0;g<c;g++)h=a[g],i=typeof a[g]=="string",j=typeof a[g]=="object"&&a[g]instanceof Array,k=i&&a[g].split(":"),i&&k.length===2?(d.push(Number(k[0])),e.push(Number(k[1])),f.push(Number(k[1]))):j?(d.push(h[0]),e.push(h[1]),f.push(h[1])):(d.push(g),a[g]===null||a[g]==="null"?e.push(null):(e.push(Number(h)),f.push(Number(h))));this.options.get("xvalues")&&(d=this.options.get("xvalues")),this.maxy=this.maxyorg=b.max.apply(b,f),this.miny=this.minyorg=b.min.apply(b,f),this.maxx=b.max.apply(b,d),this.minx=b.min.apply(b,d),this.xvalues=d,this.yvalues=e,this.yminmax=f},processRangeOptions:function(){var a=this.options,b=a.get("normalRangeMin"),d=a.get("normalRangeMax");b!==c&&(b<this.miny&&(this.miny=b),d>this.maxy&&(this.maxy=d)),a.get("chartRangeMin")!==c&&(a.get("chartRangeClip")||a.get("chartRangeMin")<this.miny)&&(this.miny=a.get("chartRangeMin")),a.get("chartRangeMax")!==c&&(a.get("chartRangeClip")||a.get("chartRangeMax")>this.maxy)&&(this.maxy=a.get("chartRangeMax")),a.get("chartRangeMinX")!==c&&(a.get("chartRangeClipX")||a.get("chartRangeMinX")<this.minx)&&(this.minx=a.get("chartRangeMinX")),a.get("chartRangeMaxX")!==c&&(a.get("chartRangeClipX")||a.get("chartRangeMaxX")>this.maxx)&&(this.maxx=a.get("chartRangeMaxX"))},drawNormalRange:function(a,d,e,f,g){var h=this.options.get("normalRangeMin"),i=this.options.get("normalRangeMax"),j=d+b.round(e-e*((i-this.miny)/g)),k=b.round(e*(i-h)/g);this.target.drawRect(a,j,f,k,c,this.options.get("normalRangeColor")).append()},render:function(){var a=this.options,e=this.target,f=this.canvasWidth,g=this.canvasHeight,h=this.vertices,i=a.get("spotRadius"),j=this.regionMap,k,l,m,n,o,p,q,r,s,u,v,w,y,z,A,B,C,D,E,F,G,H,I,J,K;if(!x._super.render.call(this))return;this.scanValues(),this.processRangeOptions(),I=this.xvalues,J=this.yvalues;if(!this.yminmax.length||this.yvalues.length<2)return;n=o=0,k=this.maxx-this.minx===0?1:this.maxx-this.minx,l=this.maxy-this.miny===0?1:this.maxy-this.miny,m=this.yvalues.length-1,i&&(f<i*4||g<i*4)&&(i=0);if(i){G=a.get("highlightSpotColor")&&!a.get("disableInteraction");if(G||a.get("minSpotColor")||a.get("spotColor")&&J[m]===this.miny)g-=b.ceil(i);if(G||a.get("maxSpotColor")||a.get("spotColor")&&J[m]===this.maxy)g-=b.ceil(i),n+=b.ceil(i);if(G||(a.get("minSpotColor")||a.get("maxSpotColor"))&&(J[0]===this.miny||J[0]===this.maxy))o+=b.ceil(i),f-=b.ceil(i);if(G||a.get("spotColor")||a.get("minSpotColor")||a.get("maxSpotColor")&&(J[m]===this.miny||J[m]===this.maxy))f-=b.ceil(i)}g--,a.get("normalRangeMin")!==c&&!a.get("drawNormalOnTop")&&this.drawNormalRange(o,n,g,f,l),q=[],r=[q],z=A=null,B=J.length;for(K=0;K<B;K++)s=I[K],v=I[K+1],u=J[K],w=o+b.round((s-this.minx)*(f/k)),y=K<B-1?o+b.round((v-this.minx)*(f/k)):f,A=w+(y-w)/2,j[K]=[z||0,A,K],z=A,u===null?K&&(J[K-1]!==null&&(q=[],r.push(q)),h.push(null)):(u<this.miny&&(u=this.miny),u>this.maxy&&(u=this.maxy),q.length||q.push([w,n+g]),p=[w,n+b.round(g-g*((u-this.miny)/l))],q.push(p),h.push(p));C=[],D=[],E=r.length;for(K=0;K<E;K++)q=r[K],q.length&&(a.get("fillColor")&&(q.push([q[q.length-1][0],n+g]),D.push(q.slice(0)),q.pop()),q.length>2&&(q[0]=[q[0][0],q[1][1]]),C.push(q));E=D.length;for(K=0;K<E;K++)e.drawShape(D[K],a.get("fillColor"),a.get("fillColor")).append();a.get("normalRangeMin")!==c&&a.get("drawNormalOnTop")&&this.drawNormalRange(o,n,g,f,l),E=C.length;for(K=0;K<E;K++)e.drawShape(C[K],a.get("lineColor"),c,a.get("lineWidth")).append();if(i&&a.get("valueSpots")){F=a.get("valueSpots"),F.get===c&&(F=new t(F));for(K=0;K<B;K++)H=F.get(J[K]),H&&e.drawCircle(o+b.round((I[K]-this.minx)*(f/k)),n+b.round(g-g*((J[K]-this.miny)/l)),i,c,H).append()}i&&a.get("spotColor")&&J[m]!==null&&e.drawCircle(o+b.round((I[I.length-1]-this.minx)*(f/k)),n+b.round(g-g*((J[m]-this.miny)/l)),i,c,a.get("spotColor")).append(),this.maxy!==this.minyorg&&(i&&a.get("minSpotColor")&&(s=I[d.inArray(this.minyorg,J)],e.drawCircle(o+b.round((s-this.minx)*(f/k)),n+b.round(g-g*((this.minyorg-this.miny)/l)),i,c,a.get("minSpotColor")).append()),i&&a.get("maxSpotColor")&&(s=I[d.inArray(this.maxyorg,J)],e.drawCircle(o+b.round((s-this.minx)*(f/k)),n+b.round(g-g*((this.maxyorg-this.miny)/l)),i,c,a.get("maxSpotColor")).append())),this.lastShapeId=e.getLastShapeId(),this.canvasTop=n,e.render()}}),d.fn.sparkline.bar=y=g(d.fn.sparkline._base,w,{type:"bar",init:function(a,e,f,g,h){var j=parseInt(f.get("barWidth"),10),n=parseInt(f.get("barSpacing"),10),o=f.get("chartRangeMin"),p=f.get("chartRangeMax"),q=f.get("chartRangeClip"),r=Infinity,s=-Infinity,u,v,w,x,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R;y._super.init.call(this,a,e,f,g,h);for(A=0,B=e.length;A<B;A++){O=e[A],u=typeof O=="string"&&O.indexOf(":")>-1;if(u||d.isArray(O))J=!0,u&&(O=e[A]=l(O.split(":"))),O=m(O,null),v=b.min.apply(b,O),w=b.max.apply(b,O),v<r&&(r=v),w>s&&(s=w)}this.stacked=J,this.regionShapes={},this.barWidth=j,this.barSpacing=n,this.totalBarWidth=j+n,this.width=g=e.length*j+(e.length-1)*n,this.initTarget(),q&&(H=o===c?-Infinity:o,I=p===c?Infinity:p),z=[],x=J?[]:z;var S=[],T=[];for(A=0,B=e.length;A<B;A++)if(J){K=e[A],e[A]=N=[],S[A]=0,x[A]=T[A]=0;for(L=0,M=K.length;L<M;L++)O=N[L]=q?i(K[L],H,I):K[L],O!==null&&(O>0&&(S[A]+=O),r<0&&s>0?O<0?T[A]+=b.abs(O):x[A]+=O:x[A]+=b.abs(O-(O<0?s:r)),z.push(O))}else O=q?i(e[A],H,I):e[A],O=e[A]=k(O),O!==null&&z.push(O);this.max=G=b.max.apply(b,z),this.min=F=b.min.apply(b,z),this.stackMax=s=J?b.max.apply(b,S):G,this.stackMin=r=J?b.min.apply(b,z):F,f.get("chartRangeMin")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMin")<F)&&(F=f.get("chartRangeMin")),f.get("chartRangeMax")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMax")>G)&&(G=f.get("chartRangeMax")),this.zeroAxis=D=f.get("zeroAxis",!0),F<=0&&G>=0&&D?E=0:D==0?E=F:F>0?E=F:E=G,this.xaxisOffset=E,C=J?b.max.apply(b,x)+b.max.apply(b,T):G-F,this.canvasHeightEf=D&&F<0?this.canvasHeight-2:this.canvasHeight-1,F<E?(Q=J&&G>=0?s:G,P=(Q-E)/C*this.canvasHeight,P!==b.ceil(P)&&(this.canvasHeightEf-=2,P=b.ceil(P))):P=this.canvasHeight,this.yoffset=P,d.isArray(f.get("colorMap"))?(this.colorMapByIndex=f.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=f.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===c&&(this.colorMapByValue=new t(this.colorMapByValue))),this.range=C},getRegion:function(a,d,e){var f=b.floor(d/this.totalBarWidth);return f<0||f>=this.values.length?c:f},getCurrentRegionFields:function(){var a=this.currentRegion,b=r(this.values[a]),c=[],d,e;for(e=b.length;e--;)d=b[e],c.push({isNull:d===null,value:d,color:this.calcColor(e,d,a),offset:a});return c},calcColor:function(a,b,e){var f=this.colorMapByIndex,g=this.colorMapByValue,h=this.options,i,j;return this.stacked?i=h.get("stackedBarColor"):i=b<0?h.get("negBarColor"):h.get("barColor"),b===0&&h.get("zeroColor")!==c&&(i=h.get("zeroColor")),g&&(j=g.get(b))?i=j:f&&f.length>e&&(i=f[e]),d.isArray(i)?i[a%i.length]:i},renderRegion:function(a,e){var f=this.values[a],g=this.options,h=this.xaxisOffset,i=[],j=this.range,k=this.stacked,l=this.target,m=a*this.totalBarWidth,n=this.canvasHeightEf,p=this.yoffset,q,r,s,t,u,v,w,x,y,z;f=d.isArray(f)?f:[f],w=f.length,x=f[0],t=o(null,f),z=o(h,f,!0);if(t)return g.get("nullColor")?(s=e?g.get("nullColor"):this.calcHighlightColor(g.get("nullColor"),g),q=p>0?p-1:p,l.drawRect(m,q,this.barWidth-1,0,s,s)):c;u=p;for(v=0;v<w;v++){x=f[v];if(k&&x===h){if(!z||y)continue;y=!0}j>0?r=b.floor(n*(b.abs(x-h)/j))+1:r=1,x<h||x===h&&p===0?(q=u,u+=r):(q=p-r,p-=r),s=this.calcColor(v,x,a),e&&(s=this.calcHighlightColor(s,g)),i.push(l.drawRect(m,q,this.barWidth-1,r-1,s,s))}return i.length===1?i[0]:i}}),d.fn.sparkline.tristate=z=g(d.fn.sparkline._base,w,{type:"tristate",init:function(a,b,e,f,g){var h=parseInt(e.get("barWidth"),10),i=parseInt(e.get("barSpacing"),10);z._super.init.call(this,a,b,e,f,g),this.regionShapes={},this.barWidth=h,this.barSpacing=i,this.totalBarWidth=h+i,this.values=d.map(b,Number),this.width=f=b.length*h+(b.length-1)*i,d.isArray(e.get("colorMap"))?(this.colorMapByIndex=e.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=e.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===c&&(this.colorMapByValue=new t(this.colorMapByValue))),this.initTarget()},getRegion:function(a,c,d){return b.floor(c/this.totalBarWidth)},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.values[a]===c,value:this.values[a],color:this.calcColor(this.values[a],a),offset:a}},calcColor:function(a,b){var c=this.values,d=this.options,e=this.colorMapByIndex,f=this.colorMapByValue,g,h;return f&&(h=f.get(a))?g=h:e&&e.length>b?g=e[b]:c[b]<0?g=d.get("negBarColor"):c[b]>0?g=d.get("posBarColor"):g=d.get("zeroBarColor"),g},renderRegion:function(a,c){var d=this.values,e=this.options,f=this.target,g,h,i,j,k,l;g=f.pixelHeight,i=b.round(g/2),j=a*this.totalBarWidth,d[a]<0?(k=i,h=i-1):d[a]>0?(k=0,h=i-1):(k=i-1,h=2),l=this.calcColor(d[a],a);if(l===null)return;return c&&(l=this.calcHighlightColor(l,e)),f.drawRect(j,k,this.barWidth-1,h-1,l,l)}}),d.fn.sparkline.discrete=A=g(d.fn.sparkline._base,w,{type:"discrete",init:function(a,e,f,g,h){A._super.init.call(this,a,e,f,g,h),this.regionShapes={},this.values=e=d.map(e,Number),this.min=b.min.apply(b,e),this.max=b.max.apply(b,e),this.range=this.max-this.min,this.width=g=f.get("width")==="auto"?e.length*2:this.width,this.interval=b.floor(g/e.length),this.itemWidth=g/e.length,f.get("chartRangeMin")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMin")<this.min)&&(this.min=f.get("chartRangeMin")),f.get("chartRangeMax")!==c&&(f.get("chartRangeClip")||f.get("chartRangeMax")>this.max)&&(this.max=f.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight=f.get("lineHeight")==="auto"?b.round(this.canvasHeight*.3):f.get("lineHeight"))},getRegion:function(a,c,d){return b.floor(c/this.itemWidth)},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.values[a]===c,value:this.values[a],offset:a}},renderRegion:function(a,c){var d=this.values,e=this.options,f=this.min,g=this.max,h=this.range,j=this.interval,k=this.target,l=this.canvasHeight,m=this.lineHeight,n=l-m,o,p,q,r;return p=i(d[a],f,g),r=a*j,o=b.round(n-n*((p-f)/h)),q=e.get("thresholdColor")&&p<e.get("thresholdValue")?e.get("thresholdColor"):e.get("lineColor"),c&&(q=this.calcHighlightColor(q,e)),k.drawLine(r,o,r,o+m,q)}}),d.fn.sparkline.bullet=B=g(d.fn.sparkline._base,{type:"bullet",init:function(a,d,e,f,g){var h,i,j;B._super.init.call(this,a,d,e,f,g),this.values=d=l(d),j=d.slice(),j[0]=j[0]===null?j[2]:j[0],j[1]=d[1]===null?j[2]:j[1],h=b.min.apply(b,d),i=b.max.apply(b,d),e.get("base")===c?h=h<0?h:0:h=e.get("base"),this.min=h,this.max=i,this.range=i-h,this.shapes={},this.valueShapes={},this.regiondata={},this.width=f=e.get("width")==="auto"?"4.0em":f,this.target=this.$el.simpledraw(f,g,e.get("composite")),d.length||(this.disabled=!0),this.initTarget()},getRegion:function(a,b,d){var e=this.target.getShapeAt(a,b,d);return e!==c&&this.shapes[e]!==c?this.shapes[e]:c},getCurrentRegionFields:function(){var a=this.currentRegion;return{fieldkey:a.substr(0,1),value:this.values[a.substr(1)],region:a}},changeHighlight:function(a){var b=this.currentRegion,c=this.valueShapes[b],d;delete this.shapes[c];switch(b.substr(0,1)){case"r":d=this.renderRange(b.substr(1),a);break;case"p":d=this.renderPerformance(a);break;case"t":d=this.renderTarget(a)}this.valueShapes[b]=d.id,this.shapes[d.id]=b,this.target.replaceWithShape(c,d)},renderRange:function(a,c){var d=this.values[a],e=b.round(this.canvasWidth*((d-this.min)/this.range)),f=this.options.get("rangeColors")[a-2];return c&&(f=this.calcHighlightColor(f,this.options)),this.target.drawRect(0,0,e-1,this.canvasHeight-1,f,f)},renderPerformance:function(a){var c=this.values[1],d=b.round(this.canvasWidth*((c-this.min)/this.range)),e=this.options.get("performanceColor");return a&&(e=this.calcHighlightColor(e,this.options)),this.target.drawRect(0,b.round(this.canvasHeight*.3),d-1,b.round(this.canvasHeight*.4)-1,e,e)},renderTarget:function(a){var c=this.values[0],d=b.round(this.canvasWidth*((c-this.min)/this.range)-this.options.get("targetWidth")/2),e=b.round(this.canvasHeight*.1),f=this.canvasHeight-e*2,g=this.options.get("targetColor");return a&&(g=this.calcHighlightColor(g,this.options)),this.target.drawRect(d,e,this.options.get("targetWidth")-1,f-1,g,g)},render:function(){var a=this.values.length,b=this.target,c,d;if(!B._super.render.call(this))return;for(c=2;c<a;c++)d=this.renderRange(c).append(),this.shapes[d.id]="r"+c,this.valueShapes["r"+c]=d.id;this.values[1]!==null&&(d=this.renderPerformance().append(),this.shapes[d.id]="p1",this.valueShapes.p1=d.id),this.values[0]!==null&&(d=this.renderTarget().append(),this.shapes[d.id]="t0",this.valueShapes.t0=d.id),b.render()}}),d.fn.sparkline.pie=C=g(d.fn.sparkline._base,{type:"pie",init:function(a,c,e,f,g){var h=0,i;C._super.init.call(this,a,c,e,f,g),this.shapes={},this.valueShapes={},this.values=c=d.map(c,Number),e.get("width")==="auto"&&(this.width=this.height);if(c.length>0)for(i=c.length;i--;)h+=c[i];this.total=h,this.initTarget(),this.radius=b.floor(b.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(a,b,d){var e=this.target.getShapeAt(a,b,d);return e!==c&&this.shapes[e]!==c?this.shapes[e]:c},getCurrentRegionFields:function(){var a=this.currentRegion;return{isNull:this.values[a]===c,value:this.values[a],percent:this.values[a]/this.total*100,color:this.options.get("sliceColors")[a%this.options.get("sliceColors").length],offset:a}},changeHighlight:function(a){var b=this.currentRegion,c=this.renderSlice(b,a),d=this.valueShapes[b];delete this.shapes[d],this.target.replaceWithShape(d,c),this.valueShapes[b]=c.id,this.shapes[c.id]=b},renderSlice:function(a,d){var e=this.target,f=this.options,g=this.radius,h=f.get("borderWidth"),i=f.get("offset"),j=2*b.PI,k=this.values,l=this.total,m=i?2*b.PI*(i/360):0,n,o,p,q,r;q=k.length;for(p=0;p<q;p++){n=m,o=m,l>0&&(o=m+j*(k[p]/l));if(a===p)return r=f.get("sliceColors")[p%f.get("sliceColors").length],d&&(r=this.calcHighlightColor(r,f)),e.drawPieSlice(g,g,g-h,n,o,c,r);m=o}},render:function(){var a=this.target,d=this.values,e=this.options,f=this.radius,g=e.get("borderWidth"),h,i;if(!C._super.render.call(this))return;g&&a.drawCircle(f,f,b.floor(f-g/2),e.get("borderColor"),c,g).append();for(i=d.length;i--;)d[i]&&(h=this.renderSlice(i).append(),this.valueShapes[i]=h.id,this.shapes[h.id]=i);a.render()}}),d.fn.sparkline.box=D=g(d.fn.sparkline._base,{type:"box",init:function(a,b,c,e,f){D._super.init.call(this,a,b,c,e,f),this.values=d.map(b,Number),this.width=c.get("width")==="auto"?"4.0em":e,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var a=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==c&&a.push({field:"lo",value:this.loutlier}),this.routlier!==c&&a.push({field:"ro",value:this.routlier}),this.lwhisker!==c&&a.push({field:"lw",value:this.lwhisker}),this.rwhisker!==c&&a.push({field:"rw",value:this.rwhisker}),a},render:function(){var a=this.target,d=this.values,e=d.length,f=this.options,g=this.canvasWidth,h=this.canvasHeight,i=f.get("chartRangeMin")===c?b.min.apply(b,d):f.get("chartRangeMin"),k=f.get("chartRangeMax")===c?b.max.apply(b,d):f.get("chartRangeMax"),l=0,m,n,o,p,q,r,s,t,u,v,w;if(!D._super.render.call(this))return;if(f.get("raw"))f.get("showOutliers")&&d.length>5?(n=d[0],m=d[1],p=d[2],q=d[3],r=d[4],s=d[5],t=d[6]):(m=d[0],p=d[1],q=d[2],r=d[3],s=d[4]);else{d.sort((function(a,b){return a-b})),p=j(d,1),q=j(d,2),r=j(d,3),o=r-p;if(f.get("showOutliers")){m=s=c;for(u=0;u<e;u++)m===c&&d[u]>p-o*f.get("outlierIQR")&&(m=d[u]),d[u]<r+o*f.get("outlierIQR")&&(s=d[u]);n=d[0],t=d[e-1]}else m=d[0],s=d[e-1]}this.quartiles=[p,q,r],this.lwhisker=m,this.rwhisker=s,this.loutlier=n,this.routlier=t,w=g/(k-i+1),f.get("showOutliers")&&(l=b.ceil(f.get("spotRadius")),g-=2*b.ceil(f.get("spotRadius")),w=g/(k-i+1),n<m&&a.drawCircle((n-i)*w+l,h/2,f.get("spotRadius"),f.get("outlierLineColor"),f.get("outlierFillColor")).append(),t>s&&a.drawCircle((t-i)*w+l,h/2,f.get("spotRadius"),f.get("outlierLineColor"),f.get("outlierFillColor")).append()),a.drawRect(b.round((p-i)*w+l),b.round(h*.1),b.round((r-p)*w),b.round(h*.8),f.get("boxLineColor"),f.get("boxFillColor")).append(),a.drawLine(b.round((m-i)*w+l),b.round(h/2),b.round((p-i)*w+l),b.round(h/2),f.get("lineColor")).append(),a.drawLine(b.round((m-i)*w+l),b.round(h/4),b.round((m-i)*w+l),b.round(h-h/4),f.get("whiskerColor")).append(),a.drawLine(b.round((s-i)*w+l),b.round(h/2),b.round((r-i)*w+l),b.round(h/2),f.get("lineColor")).append(),a.drawLine(b.round((s-i)*w+l),b.round(h/4),b.round((s-i)*w+l),b.round(h-h/4),f.get("whiskerColor")).append(),a.drawLine(b.round((q-i)*w+l),b.round(h*.1),b.round((q-i)*w+l),b.round(h*.9),f.get("medianColor")).append(),f.get("target")&&(v=b.ceil(f.get("spotRadius")),a.drawLine(b.round((f.get("target")-i)*w+l),b.round(h/2-v),b.round((f.get("target")-i)*w+l),b.round(h/2+v),f.get("targetColor")).append(),a.drawLine(b.round((f.get("target")-i)*w+l-v),b.round(h/2),b.round((f.get("target")-i)*w+l+v),b.round(h/2),f.get("targetColor")).append()),a.render()}}),G=g({init:function(a,b,c,d){this.target=a,this.id=b,this.type=c,this.args=d},append:function(){return this.target.appendShape(this),this}}),H=g({_pxregex:/(\d+)(px)?\s*$/i,init:function(a,b,c){if(!a)return;this.width=a,this.height=b,this.target=c,this.lastShapeId=null,c[0]&&(c=c[0]),d.data(c,"_jqs_vcanvas",this)},drawLine:function(a,b,c,d,e,f){return this.drawShape([[a,b],[c,d]],e,f)},drawShape:function(a,b,c,d){return this._genShape("Shape",[a,b,c,d])},drawCircle:function(a,b,c,d,e,f){return this._genShape("Circle",[a,b,c,d,e,f])},drawPieSlice:function(a,b,c,d,e,f,g){return this._genShape("PieSlice",[a,b,c,d,e,f,g])},drawRect:function(a,b,c,d,e,f){return this._genShape("Rect",[a,b,c,d,e,f])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(a,b){d(b).html(a)},_calculatePixelDims:function(a,b,c){var e;e=this._pxregex.exec(b),e?this.pixelHeight=e[1]:this.pixelHeight=d(c).height(),e=this._pxregex.exec(a),e?this.pixelWidth=e[1]:this.pixelWidth=d(c).width()},_genShape:function(a,b){var c=L++;return b.unshift(c),new G(this,c,a,b)},appendShape:function(a){alert("appendShape not implemented")},replaceWithShape:function(a,b){alert("replaceWithShape not implemented")},insertAfterShape:function(a,b){alert("insertAfterShape not implemented")},removeShapeId:function(a){alert("removeShapeId not implemented")},getShapeAt:function(a,b,c){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),I=g(H,{init:function(b,e,f,g){I._super.init.call(this,b,e,f),this.canvas=a.createElement("canvas"),f[0]&&(f=f[0]),d.data(f,"_jqs_vcanvas",this),d(this.canvas).css({display:"inline-block",width:b,height:e,verticalAlign:"top"}),this._insert(this.canvas,f),this._calculatePixelDims(b,e,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=g,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=c,d(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(a,b,d){var e=this.canvas.getContext("2d");return a!==c&&(e.strokeStyle=a),e.lineWidth=d===c?1:d,b!==c&&(e.fillStyle=b),e},reset:function(){var a=this._getContext();a.clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=c},_drawShape:function(a,b,d,e,f){var g=this._getContext(d,e,f),h,i;g.beginPath(),g.moveTo(b[0][0]+.5,b[0][1]+.5);for(h=1,i=b.length;h<i;h++)g.lineTo(b[h][0]+.5,b[h][1]+.5);d!==c&&g.stroke(),e!==c&&g.fill(),this.targetX!==c&&this.targetY!==c&&g.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a)},_drawCircle:function(a,d,e,f,g,h,i){var j=this._getContext(g,h,i);j.beginPath(),j.arc(d,e,f,0,2*b.PI,!1),this.targetX!==c&&this.targetY!==c&&j.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a),g!==c&&j.stroke(),h!==c&&j.fill()},_drawPieSlice:function(a,b,d,e,f,g,h,i){var j=this._getContext(h,i);j.beginPath(),j.moveTo(b,d),j.arc(b,d,e,f,g,!1),j.lineTo(b,d),j.closePath(),h!==c&&j.stroke(),i&&j.fill(),this.targetX!==c&&this.targetY!==c&&j.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=a)},_drawRect:function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b+d,c],[b+d,c+e],[b,c+e],[b,c]],f,g)},appendShape:function(a){return this.shapes[a.id]=a,this.shapeseq.push(a.id),this.lastShapeId=a.id,a.id},replaceWithShape:function(a,b){var c=this.shapeseq,d;this.shapes[b.id]=b;for(d=c.length;d--;)c[d]==a&&(c[d]=b.id);delete this.shapes[a]},replaceWithShapes:function(a,b){var c=this.shapeseq,d={},e,f,g;for(f=a.length;f--;)d[a[f]]=!0;for(f=c.length;f--;)e=c[f],d[e]&&(c.splice(f,1),delete this.shapes[e],g=f);for(f=b.length;f--;)c.splice(g,0,b[f].id),this.shapes[b[f].id]=b[f]},insertAfterShape:function(a,b){var c=this.shapeseq,d;for(d=c.length;d--;)if(c[d]===a){c.splice(d+1,0,b.id),this.shapes[b.id]=b;return}},removeShapeId:function(a){var b=this.shapeseq,c;for(c=b.length;c--;)if(b[c]===a){b.splice(c,1);break}delete this.shapes[a]},getShapeAt:function(a,b,c){return this.targetX=b,this.targetY=c,this.render(),this.currentTargetShapeId},render:function(){var a=this.shapeseq,b=this.shapes,c=a.length,d=this._getContext(),e,f,g;d.clearRect(0,0,this.pixelWidth,this.pixelHeight);for(g=0;g<c;g++)e=a[g],f=b[e],this["_draw"+f.type].apply(this,f.args);this.interact||(this.shapes={},this.shapeseq=[])}}),J=g(H,{init:function(b,c,e){var f;J._super.init.call(this,b,c,e),e[0]&&(e=e[0]),d.data(e,"_jqs_vcanvas",this),this.canvas=a.createElement("span"),d(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:b,height:c,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,e),this._calculatePixelDims(b,c,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,f='<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",f),this.group=d(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(a,b,d,e,f){var g=[],h,i,j,k,l,m,n;for(n=0,m=b.length;n<m;n++)g[n]=""+b[n][0]+","+b[n][1];return h=g.splice(0,1),f=f===c?1:f,i=d===c?' stroked="false" ':' strokeWeight="'+f+'px" strokeColor="'+d+'" ',j=e===c?' filled="false"':' fillColor="'+e+'" filled="true" ',k=g[0]===g[g.length-1]?"x ":"",l='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+a+'" '+i+j+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+h+" l "+g.join(", ")+" "+k+'e">'+" </v:shape>",l},_drawCircle:function(a,b,d,e,f,g,h){var i,j,k;return b-=e,d-=e,i=f===c?' stroked="false" ':' strokeWeight="'+h+'px" strokeColor="'+f+'" ',j=g===c?' filled="false"':' fillColor="'+g+'" filled="true" ',k='<v:oval  id="jqsshape'+a+'" '+i+j+' style="position:absolute;top:'+d+"px; left:"+b+"px; width:"+e*2+"px; height:"+e*2+'px"></v:oval>',k},_drawPieSlice:function(a,d,e,f,g,h,i,j){var k,l,m,n,o,p,q,r;if(g===h)return"";h-g===2*b.PI&&(g=0,h=2*b.PI),l=d+b.round(b.cos(g)*f),m=e+b.round(b.sin(g)*f),n=d+b.round(b.cos(h)*f),o=e+b.round(b.sin(h)*f);if(l===n&&m===o){if(h-g<b.PI)return"";l=n=d+f,m=o=e}return l===n&&m===o&&h-g<b.PI?"":(k=[d-f,e-f,d+f,e+f,l,m,n,o],p=i===c?' stroked="false" ':' strokeWeight="1px" strokeColor="'+i+'" ',q=j===c?' filled="false"':' fillColor="'+j+'" filled="true" ',r='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+a+'" '+p+q+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+d+","+e+" wa "+k.join(", ")+' x e">'+" </v:shape>",r)},_drawRect:function(a,b,c,d,e,f,g){return this._drawShape(a,[[b,c],[b,c+e],[b+d,c+e],[b+d,c],[b,c]],f,g)},reset:function(){this.group.innerHTML=""},appendShape:function(a){var b=this["_draw"+a.type].apply(this,a.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",b):this.prerender+=b,this.lastShapeId=a.id,a.id},replaceWithShape:function(a,b){var c=d("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);c[0].outerHTML=e},replaceWithShapes:function(a,b){var c=d("#jqsshape"+a[0]),e="",f=b.length,g;for(g=0;g<f;g++)e+=this["_draw"+b[g].type].apply(this,b[g].args);c[0].outerHTML=e;for(g=1;g<a.length;g++)d("#jqsshape"+a[g]).remove()},insertAfterShape:function(a,b){var c=d("#jqsshape"+a),e=this["_draw"+b.type].apply(this,b.args);c[0].insertAdjacentHTML("afterEnd",e)},removeShapeId:function(a){var b=d("#jqsshape"+a);this.group.removeChild(b[0])},getShapeAt:function(a,b,c){var d=a.id.substr(8);return d},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})}))})(document,Math);!function(t,e,i){function s(t,e){return"function"==typeof t?t.call(e):t}function o(t){for(;t=t.parentNode;)if(t==document)return!0;return!1}function n(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName}function l(){return"tipsyuid"+h++}function a(e,i){this.$element=t(e),this.options=i,this.enabled=!0,this.fixTitle()}var h=0;a.prototype={show:function(){if(o(this.$element[0])&&(!n(this.$element)||this.$element.is(":visible"))){var e;if(this.enabled&&(e=this.getTitle())){var i=this.tip();i.find(".tipsy-inner"+this.options.theme)[this.options.html?"html":"text"](e),i[0].className="tipsy"+this.options.theme,this.options.className&&i.addClass(s(this.options.className,this.$element[0])),i.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var a=t.extend({},this.$element.offset());a=this.$element.parents("svg").size()>0?t.extend(a,this.$element[0].getBBox()):t.extend(a,{width:this.$element[0].offsetWidth||0,height:this.$element[0].offsetHeight||0});var h,f=i[0].offsetWidth,r=i[0].offsetHeight,p=s(this.options.gravity,this.$element[0]);switch(p.charAt(0)){case"n":h={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-f/2};break;case"s":h={top:a.top-r-this.options.offset,left:a.left+a.width/2-f/2};break;case"e":h={top:a.top+a.height/2-r/2,left:a.left-f-this.options.offset};break;case"w":h={top:a.top+a.height/2-r/2,left:a.left+a.width+this.options.offset}}if(2==p.length&&("w"==p.charAt(1)?h.left=a.left+a.width/2-15:h.left=a.left+a.width/2-f+15),i.css(h).addClass("tipsy-"+p+this.options.theme),i.find(".tipsy-arrow"+this.options.theme)[0].className="tipsy-arrow"+this.options.theme+" tipsy-arrow-"+p.charAt(0)+this.options.theme,this.options.fade?(this.options.shadow&&t(".tipsy-inner").css({"box-shadow":"0px 0px "+this.options.shadowBlur+"px "+this.options.shadowSpread+"px rgba(0, 0, 0, "+this.options.shadowOpacity+")","-webkit-box-shadow":"0px 0px "+this.options.shadowBlur+"px "+this.options.shadowSpread+"px rgba(0, 0, 0, "+this.options.shadowOpacity+")"}),i.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity},this.options.fadeInTime)):i.css({visibility:"visible",opacity:this.options.opacity}),this.options.aria){var d=l();i.attr("id",d),this.$element.attr("aria-describedby",d)}}}},hide:function(){this.options.fade?this.tip().stop().fadeOut(this.options.fadeOutTime,(function(){t(this).remove()})):this.tip().remove(),this.options.aria&&this.$element.removeAttr("aria-describedby")},fixTitle:function(){var t=this.$element,e=s(this.options.id,this.$element[0]);(t.prop("title")||"string"!=typeof t.prop("original-title"))&&(t.prop("original-title",t.prop("title")||"").removeAttr("title"),t.attr("aria-describedby",e),t.attr("tabindex")===i&&t.attr("tabindex",0))},getTitle:function(){var t,e=this.$element,i=this.options;return this.fixTitle(),"string"==typeof i.title?t=e.prop("title"==i.title?"original-title":i.title):"function"==typeof i.title&&(t=i.title.call(e[0])),t=(""+t).replace(/(^\s*|\s*$)/,""),t||i.fallback},tip:function(){var e=s(this.options.id,this.$element[0]);return this.$tip||(this.$tip=t('<div class="tipsy'+this.options.theme+'" id="'+e+'" role="tooltip"></div>').html('<div class="tipsy-arrow'+this.options.theme+'"></div><div class="tipsy-inner'+this.options.theme+'"></div>').attr("role","tooltip"),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},t.fn.tipsy=function(e){function i(i){var s=t.data(i,"tipsy");return s||(s=new a(i,t.fn.tipsy.elementOptions(i,e)),t.data(i,"tipsy",s)),s}function s(){if(t.fn.tipsy.enabled===!0){var s=i(this);s.hoverState="in",0===e.delayIn?s.show():(s.fixTitle(),setTimeout((function(){"in"==s.hoverState&&o(s.$element)&&s.show()}),e.delayIn))}}function n(){var t=i(this);t.hoverState="out",0===e.delayOut?t.hide():setTimeout((function(){"out"!=t.hoverState&&t.$element&&t.$element.is(":visible")||t.hide()}),e.delayOut)}if(t.fn.tipsy.enable(),e===!0)return this.data("tipsy");if("string"==typeof e){var l=this.data("tipsy");return l&&l[e](),this}if(e=t.extend({},t.fn.tipsy.defaults,e),e.theme=e.theme&&""!==e.theme?"-"+e.theme:"",e.live||this.each((function(){i(this)})),"manual"!=e.trigger)if(e.live&&e.live!==!0)"focus"!=e.trigger&&(t(this).on("mouseenter",e.live,s),t(this).on("mouseleave",e.live,n)),"blur"!=e.trigger&&(t(this).on("focus",e.live,s),t(this).on("blur",e.live,n));else{if(e.live&&!t.live)throw"Since jQuery 1.9, pass selector as live argument. eg. $(document).tipsy({live: 'a.live'});";var h=e.live?"live":"bind";"focus"!=e.trigger&&this[h]("mouseenter",s)[h]("mouseleave",n),"blur"!=e.trigger&&this[h]("focus",s)[h]("blur",n)}return this},t.fn.tipsy.defaults={aria:!1,className:null,id:"tipsy",delayIn:0,delayOut:0,fade:!1,fadeInTime:400,fadeOutTime:400,shadow:!1,shadowBlur:8,shadowOpacity:1,shadowSpread:0,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"interactive",theme:""},t.fn.tipsy.revalidate=function(){t(".tipsy").each((function(){var e=t.data(this,"tipsy-pointee");e&&o(e)||t(this).remove()}))},t.fn.tipsy.enable=function(){t.fn.tipsy.enabled=!0},t.fn.tipsy.disable=function(){t.fn.tipsy.enabled=!1},t.fn.tipsy.elementOptions=function(e,i){return t.metadata?t.extend({},i,t(e).metadata()):i},t.fn.tipsy.autoNS=function(){return t(this).offset().top>t(document).scrollTop()+t(e).height()/2?"s":"n"},t.fn.tipsy.autoWE=function(){return t(this).offset().left>t(document).scrollLeft()+t(e).width()/2?"e":"w"},t.fn.tipsy.autoNWNE=function(){return t(this).offset().left>t(document).scrollLeft()+t(e).width()/2?"ne":"nw"},t.fn.tipsy.autoSWSE=function(){return t(this).offset().left>t(document).scrollLeft()+t(e).width()/2?"se":"sw"},t.fn.tipsy.autoBounds=function(i,s,o){return function(){var n={ns:o[0],ew:o.length>1?o[1]:!1},l=t(document).scrollTop()+i,a=t(document).scrollLeft()+s,h=t(this);return h.offset().top<l&&(n.ns="n"),h.offset().left<a&&(n.ew="w"),t(e).width()+t(document).scrollLeft()-h.offset().left<s&&(n.ew="e"),t(e).height()+t(document).scrollTop()-h.offset().top<i&&(n.ns="s"),n.ns+(n.ew?n.ew:"")}},t.fn.tipsy.autoBounds2=function(i,s){return function(){var o={},n=t(document).scrollTop()+i,l=t(document).scrollLeft()+i,a=t(this);return s.length>1?(o.ns=s[0],o.ew=s[1]):"e"==s[0]||"w"==s[0]?o.ew=s[0]:o.ns=s[0],a.offset().top<n&&(o.ns="n"),a.offset().left<l&&(o.ew="w"),t(e).width()+t(document).scrollLeft()-(a.offset().left+a.width())<i&&(o.ew="e"),t(e).height()+t(document).scrollTop()-(a.offset().top+a.height())<i&&(o.ns="s"),o.ns?o.ns+(o.ew?o.ew:""):o.ew}}}(jQuery,window);
/*! jQuery UI - v1.12.1 - 2016-09-16
 * http://jqueryui.com
 * Includes: position.js
 * Copyright jQuery Foundation and other contributors; Licensed MIT */
(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})((function(t){t.ui=t.ui||{},t.ui.version="1.12.1",function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],(function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]})),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each((function(){var s,r,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=h+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),T=e(k.my,l.outerWidth(),l.outerHeight());"right"===n.my[0]?D.left-=h:"center"===n.my[0]&&(D.left-=h/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=T[0],D.top+=T[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],(function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:l})})),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-h,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:l,left:D.left,top:D.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))}))},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position}));(function(exports){"use strict";var hasOwnProperty=(new Object).hasOwnProperty;var stringRE=/^[a-zA-Z]/;var numRE=/^[\d-]/;var TRUE="_T";var FALSE="_F";var NULL="_N";var UNDEF="_U";var NAN="_n";var INF="_I";var NINF="_J";var dict={T:true,F:false,N:null,U:undefined,n:NaN,I:Infinity,J:-Infinity};var fromEscape={"*":"*",_:"_","-":"~",S:"$",P:"+",'"':"'",C:"(",D:")",L:"<",G:">",".":"%",Q:"?",H:"#",A:"&",E:"=",B:"\\",N:"\n",R:"\r",U:"\u2028",Z:"\0"};var toEscape={"*":"*",_:"_","~":"-",$:"S","+":"P","'":'"',"(":"C",")":"D","<":"L",">":"G","%":".","?":"Q","#":"H","&":"A","=":"E","\\":"B","\n":"N","\r":"R","\0":"Z","\u2028":"U"};function origChar(s){if(s==="_"){return" "}var c=fromEscape[s.charAt(1)];if(!c){throw new Error("Illegal escape code",s)}return c}function escCode(c){if(c===" "){return"_"}return"*"+toEscape[c]}var escapeRE=/(_|\*.)/g;function unescape(s){return escapeRE.test(s)?s.replace(escapeRE,origChar):s}var replaceRE=/([*_~$+'() <>%?#&=\\\n\r\0\u2028])/g;function escape(s){return replaceRE.test(s)?s.replace(replaceRE,escCode):s}function eat(a){var j,c;for(j=a.i;j<a.l&&(c=a.s.charAt(j),c!=="~"&&c!==")");j++){}var w=a.s.slice(a.i,j);if(c==="~"){j++}a.i=j;return w}function peek(a){return a.s.charAt(a.i)}function eatOne(a){a.i++}var EOS={};function decode(a){var out,k,t;var c=peek(a);if(!c){return EOS}if(c==="("){eatOne(a);out={};while(c=peek(a),c&&c!==")"){k=unescape(eat(a));c=peek(a);if(c&&c!==")"){t=decode(a)}else{t=true}out[k]=t}if(c===")"){eatOne(a)}}else if(c==="!"){eatOne(a);out=[];while(c=peek(a),c&&c!=="~"&&c!==")"){out.push(decode(a))}if(c==="~"){eatOne(a)}}else if(c==="_"){eatOne(a);k=unescape(eat(a));if(k.charAt(0)==="D"){out=new Date(k.slice(1))}else if(k in dict){out=dict[k]}else{throw new Error("Unknown dict reference",k)}}else if(c==="*"){eatOne(a);out=unescape(eat(a))}else if(c==="~"){eatOne(a);out=true}else if(numRE.test(c)){out=Number(eat(a));if(isNaN(out)){throw new Error("Not a number",c)}}else if(stringRE.test(c)){out=unescape(eat(a))}else{throw new Error("Cannot decode part "+[t].concat(a).join("~"))}return out}function encode(v,out,rich,depth){var t,T=typeof v;if(T==="number"){out.push(isFinite(v)?v.toString():rich?isNaN(v)?NAN:v>0?INF:NINF:NULL)}else if(T==="boolean"){out.push(v?"":FALSE)}else if(T==="string"){t=escape(v);if(stringRE.test(t)){out.push(t)}else{out.push("*"+t)}}else if(T==="object"){if(!v){out.push(NULL)}else if(rich&&v instanceof Date){out.push("_D"+v.toJSON().replace("T00:00:00.000Z",""))}else if(typeof v.toJSON==="function"){encode(v.toJSON(),out,rich,depth)}else if(Array.isArray(v)){out.push("!");for(var i=0;i<v.length;i++){t=v[i];if(t===true){out.push(TRUE)}else{encode(t,out,rich,depth+1)}}out.push("")}else{out.push("(");for(var key in v){if(hasOwnProperty.call(v,key)){t=v[key];if(t!==undefined&&typeof t!=="function"){out.push(escape(key));encode(t,out,rich,depth+1)}}}while(out[out.length-1]===""){out.pop()}out.push(")")}}else{out.push(rich||depth===0?UNDEF:NULL)}}var antiJSON={true:"*true",false:"*false",null:"*null"};exports.stringify=function(v,options){var out=[],t,str="",len,sep=false,short=options&&options.short,rich=options&&options.rich;encode(v,out,rich,0);len=out.length-1;while(t=out[len],t===""||short&&t===")"){len--}for(var i=0;i<=len;i++){t=out[i];if(sep&&t!==")"){str+="~"}str+=t;sep=!(t==="!"||t==="("||t===")")}if(short){if(str.length<6){t=antiJSON[str];if(t)str=t}}else{str+="~"}return str};function clean(s){var out="";var i=0;var j=0;var c;while(i<s.length){c=s.charCodeAt(i);if(c===37){if(i>j)out+=s.slice(j,i);i++;while(c===37){c=parseInt(s.slice(i,i+2),16);i+=2}if(c>32){out+=String.fromCharCode(c)}j=i}else if(c<=32){if(i>j)out+=s.slice(j,i);i++;j=i}else{i++}}if(i>j)out+=s.slice(j,i);return out}var JSONRE=/^({|\[|"|true$|false$|null$)/;exports.parse=function(s,options){if(options&&options.deURI)s=clean(s);if(JSONRE.test(s))return JSON.parse(s);var l=s.length;var r=decode({s:s,i:0,l:l});return r===EOS?true:r};exports.tryParse=function(s,def,options){try{return exports.parse(s,options)}catch(ex){return def}}})(typeof exports!=="undefined"?exports:window.JSURL=window.JSURL||{});var LZString=function(){var f=String.fromCharCode;var keyStrBase64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var keyStrUriSafe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";var baseReverseDic={};function getBaseValue(alphabet,character){if(!baseReverseDic[alphabet]){baseReverseDic[alphabet]={};for(var i=0;i<alphabet.length;i++){baseReverseDic[alphabet][alphabet.charAt(i)]=i}}return baseReverseDic[alphabet][character]}var LZString={compressToBase64:function(input){if(input==null)return"";var res=LZString._compress(input,6,(function(a){return keyStrBase64.charAt(a)}));switch(res.length%4){default:case 0:return res;case 1:return res+"===";case 2:return res+"==";case 3:return res+"="}},decompressFromBase64:function(input){if(input==null)return"";if(input=="")return null;return LZString._decompress(input.length,32,(function(index){return getBaseValue(keyStrBase64,input.charAt(index))}))},compressToUTF16:function(input){if(input==null)return"";return LZString._compress(input,15,(function(a){return f(a+32)}))+" "},decompressFromUTF16:function(compressed){if(compressed==null)return"";if(compressed=="")return null;return LZString._decompress(compressed.length,16384,(function(index){return compressed.charCodeAt(index)-32}))},compressToUint8Array:function(uncompressed){var compressed=LZString.compress(uncompressed);var buf=new Uint8Array(compressed.length*2);for(var i=0,TotalLen=compressed.length;i<TotalLen;i++){var current_value=compressed.charCodeAt(i);buf[i*2]=current_value>>>8;buf[i*2+1]=current_value%256}return buf},decompressFromUint8Array:function(compressed){if(compressed===null||compressed===undefined){return LZString.decompress(compressed)}else{var buf=new Array(compressed.length/2);for(var i=0,TotalLen=buf.length;i<TotalLen;i++){buf[i]=compressed[i*2]*256+compressed[i*2+1]}var result=[];buf.forEach((function(c){result.push(f(c))}));return LZString.decompress(result.join(""))}},compressToEncodedURIComponent:function(input){if(input==null)return"";return LZString._compress(input,6,(function(a){return keyStrUriSafe.charAt(a)}))},decompressFromEncodedURIComponent:function(input){if(input==null)return"";if(input=="")return null;input=input.replace(/ /g,"+");return LZString._decompress(input.length,32,(function(index){return getBaseValue(keyStrUriSafe,input.charAt(index))}))},compress:function(uncompressed){return LZString._compress(uncompressed,16,(function(a){return f(a)}))},_compress:function(uncompressed,bitsPerChar,getCharFromInt){if(uncompressed==null)return"";var i,value,context_dictionary={},context_dictionaryToCreate={},context_c="",context_wc="",context_w="",context_enlargeIn=2,context_dictSize=3,context_numBits=2,context_data=[],context_data_val=0,context_data_position=0,ii;for(ii=0;ii<uncompressed.length;ii+=1){context_c=uncompressed.charAt(ii);if(!Object.prototype.hasOwnProperty.call(context_dictionary,context_c)){context_dictionary[context_c]=context_dictSize++;context_dictionaryToCreate[context_c]=true}context_wc=context_w+context_c;if(Object.prototype.hasOwnProperty.call(context_dictionary,context_wc)){context_w=context_wc}else{if(Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)){if(context_w.charCodeAt(0)<256){for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}}value=context_w.charCodeAt(0);for(i=0;i<8;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}}else{value=1;for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1|value;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=0}value=context_w.charCodeAt(0);for(i=0;i<16;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}}context_enlargeIn--;if(context_enlargeIn==0){context_enlargeIn=Math.pow(2,context_numBits);context_numBits++}delete context_dictionaryToCreate[context_w]}else{value=context_dictionary[context_w];for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}}context_enlargeIn--;if(context_enlargeIn==0){context_enlargeIn=Math.pow(2,context_numBits);context_numBits++}context_dictionary[context_wc]=context_dictSize++;context_w=String(context_c)}}if(context_w!==""){if(Object.prototype.hasOwnProperty.call(context_dictionaryToCreate,context_w)){if(context_w.charCodeAt(0)<256){for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}}value=context_w.charCodeAt(0);for(i=0;i<8;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}}else{value=1;for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1|value;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=0}value=context_w.charCodeAt(0);for(i=0;i<16;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}}context_enlargeIn--;if(context_enlargeIn==0){context_enlargeIn=Math.pow(2,context_numBits);context_numBits++}delete context_dictionaryToCreate[context_w]}else{value=context_dictionary[context_w];for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}}context_enlargeIn--;if(context_enlargeIn==0){context_enlargeIn=Math.pow(2,context_numBits);context_numBits++}}value=2;for(i=0;i<context_numBits;i++){context_data_val=context_data_val<<1|value&1;if(context_data_position==bitsPerChar-1){context_data_position=0;context_data.push(getCharFromInt(context_data_val));context_data_val=0}else{context_data_position++}value=value>>1}while(true){context_data_val=context_data_val<<1;if(context_data_position==bitsPerChar-1){context_data.push(getCharFromInt(context_data_val));break}else context_data_position++}return context_data.join("")},decompress:function(compressed){if(compressed==null)return"";if(compressed=="")return null;return LZString._decompress(compressed.length,32768,(function(index){return compressed.charCodeAt(index)}))},_decompress:function(length,resetValue,getNextValue){var dictionary=[],next,enlargeIn=4,dictSize=4,numBits=3,entry="",result=[],i,w,bits,resb,maxpower,power,c,data={val:getNextValue(0),position:resetValue,index:1};for(i=0;i<3;i+=1){dictionary[i]=i}bits=0;maxpower=Math.pow(2,2);power=1;while(power!=maxpower){resb=data.val&data.position;data.position>>=1;if(data.position==0){data.position=resetValue;data.val=getNextValue(data.index++)}bits|=(resb>0?1:0)*power;power<<=1}switch(next=bits){case 0:bits=0;maxpower=Math.pow(2,8);power=1;while(power!=maxpower){resb=data.val&data.position;data.position>>=1;if(data.position==0){data.position=resetValue;data.val=getNextValue(data.index++)}bits|=(resb>0?1:0)*power;power<<=1}c=f(bits);break;case 1:bits=0;maxpower=Math.pow(2,16);power=1;while(power!=maxpower){resb=data.val&data.position;data.position>>=1;if(data.position==0){data.position=resetValue;data.val=getNextValue(data.index++)}bits|=(resb>0?1:0)*power;power<<=1}c=f(bits);break;case 2:return""}dictionary[3]=c;w=c;result.push(c);while(true){if(data.index>length){return""}bits=0;maxpower=Math.pow(2,numBits);power=1;while(power!=maxpower){resb=data.val&data.position;data.position>>=1;if(data.position==0){data.position=resetValue;data.val=getNextValue(data.index++)}bits|=(resb>0?1:0)*power;power<<=1}switch(c=bits){case 0:bits=0;maxpower=Math.pow(2,8);power=1;while(power!=maxpower){resb=data.val&data.position;data.position>>=1;if(data.position==0){data.position=resetValue;data.val=getNextValue(data.index++)}bits|=(resb>0?1:0)*power;power<<=1}dictionary[dictSize++]=f(bits);c=dictSize-1;enlargeIn--;break;case 1:bits=0;maxpower=Math.pow(2,16);power=1;while(power!=maxpower){resb=data.val&data.position;data.position>>=1;if(data.position==0){data.position=resetValue;data.val=getNextValue(data.index++)}bits|=(resb>0?1:0)*power;power<<=1}dictionary[dictSize++]=f(bits);c=dictSize-1;enlargeIn--;break;case 2:return result.join("")}if(enlargeIn==0){enlargeIn=Math.pow(2,numBits);numBits++}if(dictionary[c]){entry=dictionary[c]}else{if(c===dictSize){entry=w+w.charAt(0)}else{return null}}result.push(entry);dictionary[dictSize++]=w+entry.charAt(0);enlargeIn--;w=entry;if(enlargeIn==0){enlargeIn=Math.pow(2,numBits);numBits++}}}};return LZString}();if(typeof define==="function"&&define.amd){define((function(){return LZString}))}else if(typeof module!=="undefined"&&module!=null){module.exports=LZString}else if(typeof angular!=="undefined"&&angular!=null){angular.module("LZString",[]).factory("LZString",(function(){return LZString}))}(function(r,v,f){function w(a,b,g){a.addEventListener?a.addEventListener(b,g,!1):a.attachEvent("on"+b,g)}function A(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return p[a.which]?p[a.which]:t[a.which]?t[a.which]:String.fromCharCode(a.which).toLowerCase()}function F(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function x(a){return"shift"==a||"ctrl"==a||"alt"==a||"meta"==a}function B(a,b){var g,c,d,f=[];g=a;"+"===g?g=["+"]:(g=g.replace(/\+{2}/g,"+plus"),g=g.split("+"));for(d=0;d<g.length;++d)c=g[d],C[c]&&(c=C[c]),b&&"keypress"!=b&&D[c]&&(c=D[c],f.push("shift")),x(c)&&f.push(c);g=c;d=b;if(!d){if(!n){n={};for(var q in p)95<q&&112>q||p.hasOwnProperty(q)&&(n[p[q]]=q)}d=n[g]?"keydown":"keypress"}"keypress"==d&&f.length&&(d="keydown");return{key:c,modifiers:f,action:d}}function E(a,b){return null===a||a===v?!1:a===b?!0:E(a.parentNode,b)}function c(a){function b(a){a=a||{};var b=!1,l;for(l in n)a[l]?b=!0:n[l]=0;b||(y=!1)}function g(a,b,u,e,c,g){var l,m,k=[],f=u.type;if(!h._callbacks[a])return[];"keyup"==f&&x(a)&&(b=[a]);for(l=0;l<h._callbacks[a].length;++l)if(m=h._callbacks[a][l],(e||!m.seq||n[m.seq]==m.level)&&f==m.action){var d;(d="keypress"==f&&!u.metaKey&&!u.ctrlKey)||(d=m.modifiers,d=b.sort().join(",")===d.sort().join(","));d&&(d=e&&m.seq==e&&m.level==g,(!e&&m.combo==c||d)&&h._callbacks[a].splice(l,1),k.push(m))}return k}function f(a,b,c,e){h.stopCallback(b,b.target||b.srcElement,c,e)||!1!==a(b,c)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0)}function d(a){"number"!==typeof a.which&&(a.which=a.keyCode);var b=A(a);b&&("keyup"==a.type&&z===b?z=!1:h.handleKey(b,F(a),a))}function p(a,c,u,e){function l(c){return function(){y=c;++n[a];clearTimeout(r);r=setTimeout(b,1e3)}}function g(c){f(u,c,a);"keyup"!==e&&(z=A(c));setTimeout(b,10)}for(var d=n[a]=0;d<c.length;++d){var m=d+1===c.length?g:l(e||B(c[d+1]).action);q(c[d],m,e,a,d)}}function q(a,b,c,e,d){h._directMap[a+":"+c]=b;a=a.replace(/\s+/g," ");var f=a.split(" ");1<f.length?p(a,f,b,c):(c=B(a,c),h._callbacks[c.key]=h._callbacks[c.key]||[],g(c.key,c.modifiers,{type:c.action},e,a,d),h._callbacks[c.key][e?"unshift":"push"]({callback:b,modifiers:c.modifiers,action:c.action,seq:e,level:d,combo:a}))}var h=this;a=a||v;if(!(h instanceof c))return new c(a);h.target=a;h._callbacks={};h._directMap={};var n={},r,z=!1,t=!1,y=!1;h._handleKey=function(a,c,d){var e=g(a,c,d),k;c={};var h=0,l=!1;for(k=0;k<e.length;++k)e[k].seq&&(h=Math.max(h,e[k].level));for(k=0;k<e.length;++k)e[k].seq?e[k].level==h&&(l=!0,c[e[k].seq]=1,f(e[k].callback,d,e[k].combo,e[k].seq)):l||f(e[k].callback,d,e[k].combo);e="keypress"==d.type&&t;d.type!=y||x(a)||e||b(c);t=l&&"keydown"==d.type};h._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)q(a[d],b,c)};w(a,"keypress",d);w(a,"keydown",d);w(a,"keyup",d)}if(r){var p={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},t={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},D={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},C={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},n;for(f=1;20>f;++f)p[111+f]="f"+f;for(f=0;9>=f;++f)p[f+96]=f.toString();c.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};c.prototype.unbind=function(a,b){return this.bind.call(this,a,(function(){}),b)};c.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};c.prototype.reset=function(){this._callbacks={};this._directMap={};return this};c.prototype.stopCallback=function(a,b){return-1<(" "+b.className+" ").indexOf(" mousetrap ")||E(b,this.target)?!1:"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};c.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};c.addKeycodes=function(a){for(var b in a)a.hasOwnProperty(b)&&(p[b]=a[b]);n=null};c.init=function(){var a=c(v),b;for(b in a)"_"!==b.charAt(0)&&(c[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};c.init();r.Mousetrap=c;"undefined"!==typeof module&&module.exports&&(module.exports=c);"function"===typeof define&&define.amd&&define((function(){return c}))}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null);function isFirefox(){return typeof InstallTrigger!=="undefined"}var isEventSupported=function(undef){var TAGNAMES={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function isEventSupported(eventName,element){element=element||document.createElement(TAGNAMES[eventName]||"div");eventName="on"+eventName;var isSupported=eventName in element;if(!isSupported){if(!element.setAttribute){element=document.createElement("div")}if(element.setAttribute&&element.removeAttribute){element.setAttribute(eventName,"");isSupported=typeof element[eventName]=="function";if(typeof element[eventName]!="undefined"){element[eventName]=undef}element.removeAttribute(eventName)}}element=null;return isSupported}return isEventSupported}();var isEventSupportedWithCache=function(undef){var TAGNAMES={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},cache={};function isEventSupported(eventName,element){var canCache=arguments.length==1;if(canCache&&cache[eventName]){return cache[eventName]}element=element||document.createElement(TAGNAMES[eventName]||"div");eventName="on"+eventName;var isSupported=eventName in element;if(!isSupported){if(!element.setAttribute){element=document.createElement("div")}if(element.setAttribute&&element.removeAttribute){element.setAttribute(eventName,"");isSupported=typeof element[eventName]=="function";if(typeof element[eventName]!="undefined"){element[eventName]=undef}element.removeAttribute(eventName)}}element=null;return canCache?cache[eventName]=isSupported:isSupported}return isEventSupported}();"use strict";var PIXEL_STEP=10;var LINE_HEIGHT=40;var PAGE_HEIGHT=800;function normalizeWheel(event){var sX=0,sY=0,pX=0,pY=0;if("detail"in event){sY=event.detail}if("wheelDelta"in event){sY=-event.wheelDelta/120}if("wheelDeltaY"in event){sY=-event.wheelDeltaY/120}if("wheelDeltaX"in event){sX=-event.wheelDeltaX/120}if("axis"in event&&event.axis===event.HORIZONTAL_AXIS){sX=sY;sY=0}pX=sX*PIXEL_STEP;pY=sY*PIXEL_STEP;if("deltaY"in event){pY=event.deltaY}if("deltaX"in event){pX=event.deltaX}if((pX||pY)&&event.deltaMode){if(event.deltaMode==1){pX*=LINE_HEIGHT;pY*=LINE_HEIGHT}else{pX*=PAGE_HEIGHT;pY*=PAGE_HEIGHT}}if(pX&&!sX){sX=pX<1?-1:1}if(pY&&!sY){sY=pY<1?-1:1}return{spinX:sX,spinY:sY,pixelX:pX,pixelY:pY}}normalizeWheel.getEventType=function(){return isFirefox()?"DOMMouseScroll":isEventSupported("wheel")?"wheel":"mousewheel"};!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).pako=e()}}((function(){return function e(t,i,n){function a(o,s){if(!i[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(r)return r(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[o]={exports:{}};t[o][0].call(d.exports,(function(e){var i=t[o][1][e];return a(i||e)}),d,d.exports,e,t,i,n)}return i[o].exports}for(var r="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(e,t,i){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var a in i)n(i,a)&&(e[a]=i[a])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,a){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),a);else for(var r=0;r<n;r++)e[a+r]=t[i+r]},flattenChunks:function(e){var t,i,n,a,r,o;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(o=new Uint8Array(n),a=0,t=0,i=e.length;t<i;t++)r=e[t],o.set(r,a),a+=r.length;return o}},o={arraySet:function(e,t,i,n,a){for(var r=0;r<n;r++)e[a+r]=t[i+r]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,r)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,o))},i.setTyped(a)},{}],2:[function(e,t,i){"use strict";function n(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&r))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var i="",n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i}var a=e("./common"),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new a.Buf8(256),f=0;f<256;f++)s[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;s[254]=s[254]=1,i.string2buf=function(e){var t,i,n,r,o,s=e.length,f=0;for(r=0;r<s;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),f+=i<128?1:i<2048?2:i<65536?3:4;for(t=new a.Buf8(f),o=0,r=0;o<f;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<s&&56320==(64512&(n=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},i.buf2binstring=function(e){return n(e,e.length)},i.binstring2buf=function(e){for(var t=new a.Buf8(e.length),i=0,n=t.length;i<n;i++)t[i]=e.charCodeAt(i);return t},i.buf2string=function(e,t){var i,a,r,o,f=t||e.length,l=new Array(2*f);for(a=0,i=0;i<f;)if((r=e[i++])<128)l[a++]=r;else if((o=s[r])>4)l[a++]=65533,i+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&i<f;)r=r<<6|63&e[i++],o--;o>1?l[a++]=65533:r<65536?l[a++]=r:(r-=65536,l[a++]=55296|r>>10&1023,l[a++]=56320|1023&r)}return n(l,a)},i.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0?t:0===i?t:i+s[e[i]]>t?i:t}},{"./common":1}],3:[function(e,t,i){"use strict";t.exports=function(e,t,i,n){for(var a=65535&e|0,r=e>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{r=r+(a=a+t[n++]|0)|0}while(--o);a%=65521,r%=65521}return a|r<<16|0}},{}],4:[function(e,t,i){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,i){"use strict";var n=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=function(e,t,i,a){var r=n,o=a+i;e^=-1;for(var s=a;s<o;s++)e=e>>>8^r[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,i){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,i){"use strict";t.exports=function(e,t){var i,n,a,r,o,s,f,l,d,u,c,h,b,w,m,k,_,g,v,p,x,y,S,E,B;i=e.state,n=e.next_in,E=e.input,a=n+(e.avail_in-5),r=e.next_out,B=e.output,o=r-(t-e.avail_out),s=r+(e.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,u=i.wnext,c=i.window,h=i.hold,b=i.bits,w=i.lencode,m=i.distcode,k=(1<<i.lenbits)-1,_=(1<<i.distbits)-1;e:do{b<15&&(h+=E[n++]<<b,b+=8,h+=E[n++]<<b,b+=8),g=w[h&k];t:for(;;){if(v=g>>>24,h>>>=v,b-=v,0===(v=g>>>16&255))B[r++]=65535&g;else{if(!(16&v)){if(0==(64&v)){g=w[(65535&g)+(h&(1<<v)-1)];continue t}if(32&v){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}p=65535&g,(v&=15)&&(b<v&&(h+=E[n++]<<b,b+=8),p+=h&(1<<v)-1,h>>>=v,b-=v),b<15&&(h+=E[n++]<<b,b+=8,h+=E[n++]<<b,b+=8),g=m[h&_];i:for(;;){if(v=g>>>24,h>>>=v,b-=v,!(16&(v=g>>>16&255))){if(0==(64&v)){g=m[(65535&g)+(h&(1<<v)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(x=65535&g,v&=15,b<v&&(h+=E[n++]<<b,(b+=8)<v&&(h+=E[n++]<<b,b+=8)),(x+=h&(1<<v)-1)>f){e.msg="invalid distance too far back",i.mode=30;break e}if(h>>>=v,b-=v,v=r-o,x>v){if((v=x-v)>d&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(y=0,S=c,0===u){if(y+=l-v,v<p){p-=v;do{B[r++]=c[y++]}while(--v);y=r-x,S=B}}else if(u<v){if(y+=l+u-v,(v-=u)<p){p-=v;do{B[r++]=c[y++]}while(--v);if(y=0,u<p){p-=v=u;do{B[r++]=c[y++]}while(--v);y=r-x,S=B}}}else if(y+=u-v,v<p){p-=v;do{B[r++]=c[y++]}while(--v);y=r-x,S=B}for(;p>2;)B[r++]=S[y++],B[r++]=S[y++],B[r++]=S[y++],p-=3;p&&(B[r++]=S[y++],p>1&&(B[r++]=S[y++]))}else{y=r-x;do{B[r++]=B[y++],B[r++]=B[y++],B[r++]=B[y++],p-=3}while(p>2);p&&(B[r++]=B[y++],p>1&&(B[r++]=B[y++]))}break}}break}}while(n<a&&r<s);n-=p=b>>3,h&=(1<<(b-=p<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n<a?a-n+5:5-(n-a),e.avail_out=r<s?s-r+257:257-(r-s),i.hold=h,i.bits=b}},{}],8:[function(e,t,i){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function a(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function r(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=O,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new h.Buf32(de),t.distcode=t.distdyn=new h.Buf32(ue),t.sane=1,t.back=-1,S):Z}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,r(e)):Z}function s(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Z:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,o(e))):Z}function f(e,t){var i,n;return e?(n=new a,e.state=n,n.window=null,(i=s(e,t))!==S&&(e.state=null),i):Z}function l(e){if(he){var t;for(u=new h.Buf32(512),c=new h.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(k(g,e.lens,0,288,u,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;k(v,e.lens,0,32,c,0,e.work,{bits:5}),he=!1}e.lencode=u,e.lenbits=9,e.distcode=c,e.distbits=5}function d(e,t,i,n){var a,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new h.Buf8(r.wsize)),n>=r.wsize?(h.arraySet(r.window,t,i-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((a=r.wsize-r.wnext)>n&&(a=n),h.arraySet(r.window,t,i-n,a,r.wnext),(n-=a)?(h.arraySet(r.window,t,i-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0}var u,c,h=e("../utils/common"),b=e("./adler32"),w=e("./crc32"),m=e("./inffast"),k=e("./inftrees"),_=0,g=1,v=2,p=4,x=5,y=6,S=0,E=1,B=2,Z=-2,A=-3,z=-4,R=-5,N=8,O=1,C=2,I=3,T=4,U=5,D=6,F=7,L=8,H=9,j=10,M=11,K=12,P=13,Y=14,q=15,G=16,X=17,W=18,J=19,Q=20,V=21,$=22,ee=23,te=24,ie=25,ne=26,ae=27,re=28,oe=29,se=30,fe=31,le=32,de=852,ue=592,ce=15,he=!0;i.inflateReset=o,i.inflateReset2=s,i.inflateResetKeep=r,i.inflateInit=function(e){return f(e,ce)},i.inflateInit2=f,i.inflate=function(e,t){var i,a,r,o,s,f,u,c,de,ue,ce,he,be,we,me,ke,_e,ge,ve,pe,xe,ye,Se,Ee,Be=0,Ze=new h.Buf8(4),Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Z;(i=e.state).mode===K&&(i.mode=P),s=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,c=i.hold,de=i.bits,ue=f,ce=u,ye=S;e:for(;;)switch(i.mode){case O:if(0===i.wrap){i.mode=P;break}for(;de<16;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(2&i.wrap&&35615===c){i.check=0,Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0),c=0,de=0,i.mode=C;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",i.mode=se;break}if((15&c)!==N){e.msg="unknown compression method",i.mode=se;break}if(c>>>=4,de-=4,xe=8+(15&c),0===i.wbits)i.wbits=xe;else if(xe>i.wbits){e.msg="invalid window size",i.mode=se;break}i.dmax=1<<xe,e.adler=i.check=1,i.mode=512&c?j:K,c=0,de=0;break;case C:for(;de<16;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(i.flags=c,(255&i.flags)!==N){e.msg="unknown compression method",i.mode=se;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=se;break}i.head&&(i.head.text=c>>8&1),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0,i.mode=I;case I:for(;de<32;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}i.head&&(i.head.time=c),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,Ze[2]=c>>>16&255,Ze[3]=c>>>24&255,i.check=w(i.check,Ze,4,0)),c=0,de=0,i.mode=T;case T:for(;de<16;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}i.head&&(i.head.xflags=255&c,i.head.os=c>>8),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0,i.mode=U;case U:if(1024&i.flags){for(;de<16;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}i.length=c,i.head&&(i.head.extra_len=c),512&i.flags&&(Ze[0]=255&c,Ze[1]=c>>>8&255,i.check=w(i.check,Ze,2,0)),c=0,de=0}else i.head&&(i.head.extra=null);i.mode=D;case D:if(1024&i.flags&&((he=i.length)>f&&(he=f),he&&(i.head&&(xe=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),h.arraySet(i.head.extra,a,o,he,xe)),512&i.flags&&(i.check=w(i.check,a,he,o)),f-=he,o+=he,i.length-=he),i.length))break e;i.length=0,i.mode=F;case F:if(2048&i.flags){if(0===f)break e;he=0;do{xe=a[o+he++],i.head&&xe&&i.length<65536&&(i.head.name+=String.fromCharCode(xe))}while(xe&&he<f);if(512&i.flags&&(i.check=w(i.check,a,he,o)),f-=he,o+=he,xe)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=L;case L:if(4096&i.flags){if(0===f)break e;he=0;do{xe=a[o+he++],i.head&&xe&&i.length<65536&&(i.head.comment+=String.fromCharCode(xe))}while(xe&&he<f);if(512&i.flags&&(i.check=w(i.check,a,he,o)),f-=he,o+=he,xe)break e}else i.head&&(i.head.comment=null);i.mode=H;case H:if(512&i.flags){for(;de<16;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(c!==(65535&i.check)){e.msg="header crc mismatch",i.mode=se;break}c=0,de=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=K;break;case j:for(;de<32;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}e.adler=i.check=n(c),c=0,de=0,i.mode=M;case M:if(0===i.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,i.hold=c,i.bits=de,B;e.adler=i.check=1,i.mode=K;case K:if(t===x||t===y)break e;case P:if(i.last){c>>>=7&de,de-=7&de,i.mode=ae;break}for(;de<3;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}switch(i.last=1&c,c>>>=1,de-=1,3&c){case 0:i.mode=Y;break;case 1:if(l(i),i.mode=Q,t===y){c>>>=2,de-=2;break e}break;case 2:i.mode=X;break;case 3:e.msg="invalid block type",i.mode=se}c>>>=2,de-=2;break;case Y:for(c>>>=7&de,de-=7&de;de<32;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",i.mode=se;break}if(i.length=65535&c,c=0,de=0,i.mode=q,t===y)break e;case q:i.mode=G;case G:if(he=i.length){if(he>f&&(he=f),he>u&&(he=u),0===he)break e;h.arraySet(r,a,o,he,s),f-=he,o+=he,u-=he,s+=he,i.length-=he;break}i.mode=K;break;case X:for(;de<14;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(i.nlen=257+(31&c),c>>>=5,de-=5,i.ndist=1+(31&c),c>>>=5,de-=5,i.ncode=4+(15&c),c>>>=4,de-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=se;break}i.have=0,i.mode=W;case W:for(;i.have<i.ncode;){for(;de<3;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}i.lens[Ae[i.have++]]=7&c,c>>>=3,de-=3}for(;i.have<19;)i.lens[Ae[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,Se={bits:i.lenbits},ye=k(_,i.lens,0,19,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid code lengths set",i.mode=se;break}i.have=0,i.mode=J;case J:for(;i.have<i.nlen+i.ndist;){for(;Be=i.lencode[c&(1<<i.lenbits)-1],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(_e<16)c>>>=me,de-=me,i.lens[i.have++]=_e;else{if(16===_e){for(Ee=me+2;de<Ee;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(c>>>=me,de-=me,0===i.have){e.msg="invalid bit length repeat",i.mode=se;break}xe=i.lens[i.have-1],he=3+(3&c),c>>>=2,de-=2}else if(17===_e){for(Ee=me+3;de<Ee;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}de-=me,xe=0,he=3+(7&(c>>>=me)),c>>>=3,de-=3}else{for(Ee=me+7;de<Ee;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}de-=me,xe=0,he=11+(127&(c>>>=me)),c>>>=7,de-=7}if(i.have+he>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=se;break}for(;he--;)i.lens[i.have++]=xe}}if(i.mode===se)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=se;break}if(i.lenbits=9,Se={bits:i.lenbits},ye=k(g,i.lens,0,i.nlen,i.lencode,0,i.work,Se),i.lenbits=Se.bits,ye){e.msg="invalid literal/lengths set",i.mode=se;break}if(i.distbits=6,i.distcode=i.distdyn,Se={bits:i.distbits},ye=k(v,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,Se),i.distbits=Se.bits,ye){e.msg="invalid distances set",i.mode=se;break}if(i.mode=Q,t===y)break e;case Q:i.mode=V;case V:if(f>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,i.hold=c,i.bits=de,m(e,ce),s=e.next_out,r=e.output,u=e.avail_out,o=e.next_in,a=e.input,f=e.avail_in,c=i.hold,de=i.bits,i.mode===K&&(i.back=-1);break}for(i.back=0;Be=i.lencode[c&(1<<i.lenbits)-1],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(ke&&0==(240&ke)){for(ge=me,ve=ke,pe=_e;Be=i.lencode[pe+((c&(1<<ge+ve)-1)>>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=de);){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}c>>>=ge,de-=ge,i.back+=ge}if(c>>>=me,de-=me,i.back+=me,i.length=_e,0===ke){i.mode=ne;break}if(32&ke){i.back=-1,i.mode=K;break}if(64&ke){e.msg="invalid literal/length code",i.mode=se;break}i.extra=15&ke,i.mode=$;case $:if(i.extra){for(Ee=i.extra;de<Ee;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,de-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=ee;case ee:for(;Be=i.distcode[c&(1<<i.distbits)-1],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(me<=de);){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(0==(240&ke)){for(ge=me,ve=ke,pe=_e;Be=i.distcode[pe+((c&(1<<ge+ve)-1)>>ge)],me=Be>>>24,ke=Be>>>16&255,_e=65535&Be,!(ge+me<=de);){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}c>>>=ge,de-=ge,i.back+=ge}if(c>>>=me,de-=me,i.back+=me,64&ke){e.msg="invalid distance code",i.mode=se;break}i.offset=_e,i.extra=15&ke,i.mode=te;case te:if(i.extra){for(Ee=i.extra;de<Ee;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,de-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=se;break}i.mode=ie;case ie:if(0===u)break e;if(he=ce-u,i.offset>he){if((he=i.offset-he)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=se;break}he>i.wnext?(he-=i.wnext,be=i.wsize-he):be=i.wnext-he,he>i.length&&(he=i.length),we=i.window}else we=r,be=s-i.offset,he=i.length;he>u&&(he=u),u-=he,i.length-=he;do{r[s++]=we[be++]}while(--he);0===i.length&&(i.mode=V);break;case ne:if(0===u)break e;r[s++]=i.length,u--,i.mode=V;break;case ae:if(i.wrap){for(;de<32;){if(0===f)break e;f--,c|=a[o++]<<de,de+=8}if(ce-=u,e.total_out+=ce,i.total+=ce,ce&&(e.adler=i.check=i.flags?w(i.check,r,ce,s-ce):b(i.check,r,ce,s-ce)),ce=u,(i.flags?c:n(c))!==i.check){e.msg="incorrect data check",i.mode=se;break}c=0,de=0}i.mode=re;case re:if(i.wrap&&i.flags){for(;de<32;){if(0===f)break e;f--,c+=a[o++]<<de,de+=8}if(c!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=se;break}c=0,de=0}i.mode=oe;case oe:ye=E;break e;case se:ye=A;break e;case fe:return z;case le:default:return Z}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,i.hold=c,i.bits=de,(i.wsize||ce!==e.avail_out&&i.mode<se&&(i.mode<ae||t!==p))&&d(e,e.output,e.next_out,ce-e.avail_out)?(i.mode=fe,z):(ue-=e.avail_in,ce-=e.avail_out,e.total_in+=ue,e.total_out+=ce,i.total+=ce,i.wrap&&ce&&(e.adler=i.check=i.flags?w(i.check,r,ce,e.next_out-ce):b(i.check,r,ce,e.next_out-ce)),e.data_type=i.bits+(i.last?64:0)+(i.mode===K?128:0)+(i.mode===Q||i.mode===q?256:0),(0===ue&&0===ce||t===p)&&ye===S&&(ye=R),ye)},i.inflateEnd=function(e){if(!e||!e.state)return Z;var t=e.state;return t.window&&(t.window=null),e.state=null,S},i.inflateGetHeader=function(e,t){var i;return e&&e.state?0==(2&(i=e.state).wrap)?Z:(i.head=t,t.done=!1,S):Z},i.inflateSetDictionary=function(e,t){var i,n,a=t.length;return e&&e.state?0!==(i=e.state).wrap&&i.mode!==M?Z:i.mode===M&&(n=1,(n=b(n,t,a,0))!==i.check)?A:d(e,t,a,a)?(i.mode=fe,z):(i.havedict=1,S):Z},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,i){"use strict";var n=e("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,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,64,64];t.exports=function(e,t,i,f,l,d,u,c){var h,b,w,m,k,_,g,v,p,x=c.bits,y=0,S=0,E=0,B=0,Z=0,A=0,z=0,R=0,N=0,O=0,C=null,I=0,T=new n.Buf16(16),U=new n.Buf16(16),D=null,F=0;for(y=0;y<=15;y++)T[y]=0;for(S=0;S<f;S++)T[t[i+S]]++;for(Z=x,B=15;B>=1&&0===T[B];B--);if(Z>B&&(Z=B),0===B)return l[d++]=20971520,l[d++]=20971520,c.bits=1,0;for(E=1;E<B&&0===T[E];E++);for(Z<E&&(Z=E),R=1,y=1;y<=15;y++)if(R<<=1,(R-=T[y])<0)return-1;if(R>0&&(0===e||1!==B))return-1;for(U[1]=0,y=1;y<15;y++)U[y+1]=U[y]+T[y];for(S=0;S<f;S++)0!==t[i+S]&&(u[U[t[i+S]]++]=S);if(0===e?(C=D=u,_=19):1===e?(C=a,I-=257,D=r,F-=257,_=256):(C=o,D=s,_=-1),O=0,S=0,y=E,k=d,A=Z,z=0,w=-1,N=1<<Z,m=N-1,1===e&&N>852||2===e&&N>592)return 1;for(;;){g=y-z,u[S]<_?(v=0,p=u[S]):u[S]>_?(v=D[F+u[S]],p=C[I+u[S]]):(v=96,p=0),h=1<<y-z,E=b=1<<A;do{l[k+(O>>z)+(b-=h)]=g<<24|v<<16|p|0}while(0!==b);for(h=1<<y-1;O&h;)h>>=1;if(0!==h?(O&=h-1,O+=h):O=0,S++,0==--T[y]){if(y===B)break;y=t[i+u[S]]}if(y>Z&&(O&m)!==w){for(0===z&&(z=Z),k+=E,R=1<<(A=y-z);A+z<B&&!((R-=T[A+z])<=0);)A++,R<<=1;if(N+=1<<A,1===e&&N>852||2===e&&N>592)return 1;l[w=O&m]=Z<<24|A<<16|k-d|0}}return 0!==O&&(l[k+O]=y-z<<24|64<<16|0),c.bits=Z,0}},{"../utils/common":1}],10:[function(e,t,i){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,i){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,i){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,t.windowBits);if(i!==f.Z_OK)throw new Error(l[i]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function a(e,t){var i=new n(t);if(i.push(e,!0),i.err)throw i.msg||l[i.err];return i.result}var r=e("./zlib/inflate"),o=e("./utils/common"),s=e("./utils/strings"),f=e("./zlib/constants"),l=e("./zlib/messages"),d=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString;n.prototype.push=function(e,t){var i,n,a,l,d,u,h=this.strm,b=this.options.chunkSize,w=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?f.Z_FINISH:f.Z_NO_FLUSH,"string"==typeof e?h.input=s.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new o.Buf8(b),h.next_out=0,h.avail_out=b),(i=r.inflate(h,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&w&&(u="string"==typeof w?s.string2buf(w):"[object ArrayBuffer]"===c.call(w)?new Uint8Array(w):w,i=r.inflateSetDictionary(this.strm,u)),i===f.Z_BUF_ERROR&&!0===m&&(i=f.Z_OK,m=!1),i!==f.Z_STREAM_END&&i!==f.Z_OK)return this.onEnd(i),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&i!==f.Z_STREAM_END&&(0!==h.avail_in||n!==f.Z_FINISH&&n!==f.Z_SYNC_FLUSH)||("string"===this.options.to?(a=s.utf8border(h.output,h.next_out),l=h.next_out-a,d=s.buf2string(h.output,a),h.next_out=l,h.avail_out=b-l,l&&o.arraySet(h.output,h.output,a,l,0),this.onData(d)):this.onData(o.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&i!==f.Z_STREAM_END);return i===f.Z_STREAM_END&&(n=f.Z_FINISH),n===f.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===f.Z_OK):n!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),h.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===f.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},i.Inflate=n,i.inflate=a,i.inflateRaw=function(e,t){return t=t||{},t.raw=!0,a(e,t)},i.ungzip=a},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}));
/** @license
 *
 *     Colour Palette Generator script.
 *     Copyright (c) 2014 Google Inc.
 *
 *     Licensed under the Apache License, Version 2.0 (the "License"); you may
 *     not use this file except in compliance with the License.  You may
 *     obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 *     implied.  See the License for the specific language governing
 *     permissions and limitations under the License.
 *
 * Furthermore, ColorBrewer colour schemes are covered by the following:
 *
 *     Copyright (c) 2002 Cynthia Brewer, Mark Harrower, and
 *                        The Pennsylvania State University.
 *
 *     Licensed under the Apache License, Version 2.0 (the "License"); you may
 *     not use this file except in compliance with the License. You may obtain
 *     a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 *     implied. See the License for the specific language governing
 *     permissions and limitations under the License.
 *
 *     Redistribution and use in source and binary forms, with or without
 *     modification, are permitted provided that the following conditions are
 *     met:
 *
 *     1. Redistributions as source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *     2. The end-user documentation included with the redistribution, if any,
 *     must include the following acknowledgment: "This product includes color
 *     specifications and designs developed by Cynthia Brewer
 *     (http://colorbrewer.org/)." Alternately, this acknowledgment may appear
 *     in the software itself, if and wherever such third-party
 *     acknowledgments normally appear.
 *
 *     4. The name "ColorBrewer" must not be used to endorse or promote products
 *     derived from this software without prior written permission. For written
 *     permission, please contact Cynthia Brewer at cbrewer@psu.edu.
 *
 *     5. Products derived from this software may not be called "ColorBrewer",
 *     nor may "ColorBrewer" appear in their name, without prior written
 *     permission of Cynthia Brewer.
 *
 * Furthermore, Solarized colour schemes are covered by the following:
 *
 *     Copyright (c) 2011 Ethan Schoonover
 *
 *     Permission is hereby granted, free of charge, to any person obtaining
 *     a copy of this software and associated documentation files (the
 *     "Software"), to deal in the Software without restriction, including
 *     without limitation the rights to use, copy, modify, merge, publish,
 *     distribute, sublicense, and/or sell copies of the Software, and to
 *     permit persons to whom the Software is furnished to do so, subject to
 *     the following conditions:
 *
 *     The above copyright notice and this permission notice shall be included
 *     in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 *     OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *     MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 *     LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 *     OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 *     WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
"use strict";var palette=function(){var proto=Array.prototype;var slice=function(arr,opt_begin,opt_end){return proto.slice.apply(arr,proto.slice.call(arguments,1))};var extend=function(arr,arr2){return proto.push.apply(arr,arr2)};var function_type=typeof function(){};var INF=1e9;var palette=function(scheme,number,opt_index,varargs){number|=0;if(number==0){return[]}if(typeof scheme!==function_type){var arr=palette.listSchemes(scheme,number);if(!arr.length){return null}scheme=arr[(opt_index||0)%arr.length]}var args=slice(arguments,2);args[0]=number;return scheme.apply(scheme,args)};palette.Scheme=function(name,opt_groups){var palettes={};var palettes_max=0;var palettes_min=INF;var makeGenerator=function(){if(arguments.length<=1){return self.color_func.bind(self)}else{var args=slice(arguments);return function(x){args[0]=x;return self.color_func.apply(self,args)}}};var self=function(number,varargs){number|=0;if(!number){return[]}var _number=number;number=Math.abs(number);if(number<=palettes_max){for(var i=Math.max(number,palettes_min);!(i in palettes);++i){}var colors=palettes[i];if(i>number){var take_head="shrinking_takes_head"in colors?colors.shrinking_takes_head:self.shrinking_takes_head;if(take_head){colors=colors.slice(0,number);i=number}else{return palette.generate((function(x){return colors[Math.round(x)]}),_number,0,colors.length-1)}}colors=colors.slice();if(_number<0){colors.reverse()}return colors}else if(self.color_func){return palette.generate(makeGenerator.apply(self,arguments),_number,0,1,self.color_func_cyclic)}else{return null}};self.scheme_name=name;self.groups=opt_groups?typeof opt_groups==="string"?[opt_groups]:opt_groups:[];self.max=0;self.cbf_max=INF;self.addPalette=function(palette,opt_is_cbf){var len=palette.length;if(len){palettes[len]=palette;palettes_min=Math.min(palettes_min,len);palettes_max=Math.max(palettes_max,len);self.max=Math.max(self.max,len);if(!opt_is_cbf&&len!=1){self.cbf_max=Math.min(self.cbf_max,len-1)}}};self.addPalettes=function(palettes,opt_max,opt_cbf_max){opt_max=opt_max||palettes.length;for(var i=0;i<opt_max;++i){if(i in palettes){self.addPalette(palettes[i],true)}}self.cbf_max=Math.min(self.cbf_max,opt_cbf_max||1)};self.shrinkByTakingHead=function(enabled,opt_idx){if(opt_idx!==void 0){if(opt_idx in palettes){palettes[opt_idx].shrinking_takes_head=!!enabled}}else{self.shrinking_takes_head=!!enabled}};self.setColorFunction=function(func,opt_is_cbf,opt_cyclic){self.color_func=func;self.color_func_cyclic=!!opt_cyclic;self.max=INF;if(!opt_is_cbf&&self.cbf_max===INF){self.cbf_max=1}};self.color=function(x,varargs){if(self.color_func){return self.color_func.apply(this,arguments)}else{return null}};return self};palette.Scheme.fromPalettes=function(name,groups,palettes,opt_max,opt_cbf_max){var scheme=palette.Scheme(name,groups);scheme.addPalettes.apply(scheme,slice(arguments,2));return scheme};palette.Scheme.withColorFunction=function(name,groups,func,opt_is_cbf,opt_cyclic){var scheme=palette.Scheme(name,groups);scheme.setColorFunction.apply(scheme,slice(arguments,2));return scheme};var registered_schemes={};palette.register=function(scheme){registered_schemes["n-"+scheme.scheme_name]=[scheme];scheme.groups.forEach((function(g){(registered_schemes["g-"+g]=registered_schemes["g-"+g]||[]).push(scheme)}));(registered_schemes["g-all"]=registered_schemes["g-all"]||[]).push(scheme)};palette.listSchemes=function(name,opt_number){if(!opt_number){opt_number=2}else if(opt_number<0){opt_number=-opt_number}var ret=[];(typeof name==="string"?[name]:name).forEach((function(n){var cbf=n.substring(n.length-4)==="-cbf";if(cbf){n=n.substring(0,n.length-4)}var schemes=registered_schemes["g-"+n]||registered_schemes["n-"+n]||[];for(var i=0,scheme;scheme=schemes[i];++i){if((cbf?scheme.cbf:scheme.max)>=opt_number){ret.push(scheme)}}}));ret.sort((function(a,b){return a.scheme_name>=b.scheme_name?a.scheme_name>b.scheme_name?1:0:-1}));return ret};palette.generate=function(color_func,number,opt_start,opt_end,opt_cyclic){if(Math.abs(number)<1){return[]}opt_start=opt_start===void 0?0:opt_start;opt_end=opt_end===void 0?1:opt_end;if(Math.abs(number)<2){return[color_func(opt_start)]}var i=Math.abs(number);var x=opt_start;var ret=[];var step=(opt_end-opt_start)/(opt_cyclic?i:i-1);for(;--i>=0;x+=step){ret.push(color_func(x))}if(number<0){ret.reverse()}return ret};var clamp=function(v){return v>0?v<1?v:1:0};palette.rgbColor=function(r,g,b){return[r,g,b].map((function(v){v=Number(Math.round(clamp(v)*255)).toString(16);return v.length==1?"0"+v:v})).join("")};palette.linearRgbColor=function(r,g,b){return[r,g,b].map((function(v){v=clamp(v);if(v<=.0031308){v=12.92*v}else{v=1.055*Math.pow(v,1/2.4)-.055}v=Number(Math.round(v*255)).toString(16);return v.length==1?"0"+v:v})).join("")};palette.hsvColor=function(h,opt_s,opt_v){h*=6;var s=opt_s===void 0?1:clamp(opt_s);var v=opt_v===void 0?1:clamp(opt_v);var x=v*(1-s*Math.abs(h%2-1));var m=v*(1-s);switch(Math.floor(h)%6){case 0:return palette.rgbColor(v,x,m);case 1:return palette.rgbColor(x,v,m);case 2:return palette.rgbColor(m,v,x);case 3:return palette.rgbColor(m,x,v);case 4:return palette.rgbColor(x,m,v);default:return palette.rgbColor(v,m,x)}};palette.register(palette.Scheme.withColorFunction("rainbow","qualitative",palette.hsvColor,false,true));return palette}();palette.ColorFunction;palette.Palette;palette.PalettesList;palette.SchemeType;(function(){var scheme=palette.Scheme.fromPalettes("mpn65","qualitative",[["ff0029","377eb8","66a61e","984ea3","00d2d5","ff7f00","af8d00","7f80cd","b3e900","c42e60","a65628","f781bf","8dd3c7","bebada","fb8072","80b1d3","fdb462","fccde5","bc80bd","ffed6f","c4eaff","cf8c00","1b9e77","d95f02","e7298a","e6ab02","a6761d","0097ff","00d067","000000","252525","525252","737373","969696","bdbdbd","f43600","4ba93b","5779bb","927acc","97ee3f","bf3947","9f5b00","f48758","8caed6","f2b94f","eff26e","e43872","d9b100","9d7a00","698cff","d9d9d9","00d27e","d06800","009f82","c49200","cbe8ff","fecddf","c27eb6","8cd2ce","c4b8d9","f883b0","a49100","f48800","27d0df","a04a9b"]]);scheme.shrinkByTakingHead(true);palette.register(scheme)})();(function(){var rgb=palette.rgbColor;var poly=function(x,varargs){var i=arguments.length-1,n=arguments[i];while(i>1){n=n*x+arguments[--i]}return n};var erf=function(x){var y=poly(Math.abs(x),1,.278393,.230389,972e-6,.078108);y*=y;y*=y;y=1-1/y;return x<0?-y:y};palette.register(palette.Scheme.fromPalettes("tol","qualitative",[["4477aa"],["4477aa","cc6677"],["4477aa","ddcc77","cc6677"],["4477aa","117733","ddcc77","cc6677"],["332288","88ccee","117733","ddcc77","cc6677"],["332288","88ccee","117733","ddcc77","cc6677","aa4499"],["332288","88ccee","44aa99","117733","ddcc77","cc6677","aa4499"],["332288","88ccee","44aa99","117733","999933","ddcc77","cc6677","aa4499"],["332288","88ccee","44aa99","117733","999933","ddcc77","cc6677","882255","aa4499"],["332288","88ccee","44aa99","117733","999933","ddcc77","661100","cc6677","882255","aa4499"],["332288","6699cc","88ccee","44aa99","117733","999933","ddcc77","661100","cc6677","882255","aa4499"],["332288","6699cc","88ccee","44aa99","117733","999933","ddcc77","661100","cc6677","aa4466","882255","aa4499"]],12,12));palette.tolSequentialColor=function(x){return rgb(1-.392*(1+erf((x-.869)/.255)),1.021-.456*(1+erf((x-.527)/.376)),1-.493*(1+erf((x-.272)/.309)))};palette.register(palette.Scheme.withColorFunction("tol-sq","sequential",palette.tolSequentialColor,true));palette.tolDivergingColor=function(x){var g=poly(x,.572,1.524,-1.811)/poly(x,1,-.291,.1574);return rgb(poly(x,.235,-2.13,26.92,-65.5,63.5,-22.36),g*g,1/poly(x,1.579,-4.03,12.92,-31.4,48.6,-23.36))};palette.register(palette.Scheme.withColorFunction("tol-dv","diverging",palette.tolDivergingColor,true));palette.tolRainbowColor=function(x){return rgb(poly(x,.472,-.567,4.05)/poly(x,1,8.72,-19.17,14.1),poly(x,.108932,-1.22635,27.284,-98.577,163.3,-131.395,40.634),1/poly(x,1.97,3.54,-68.5,243,-297,125))};palette.register(palette.Scheme.withColorFunction("tol-rainbow","qualitative",palette.tolRainbowColor,true))})();(function(){palette.register(palette.Scheme.fromPalettes("sol-base","sequential",[["002b36","073642","586e75","657b83","839496","93a1a1","eee8d5","fdf6e3"]],1,8));palette.register(palette.Scheme.fromPalettes("sol-accent","qualitative",[["b58900","cb4b16","dc322f","d33682","6c71c4","268bd2","2aa198","859900"]]))})();(function(){var schemes={YlGn:{type:"sequential",cbf:42,3:["f7fcb9","addd8e","31a354"],4:["ffffcc","c2e699","78c679","238443"],5:["ffffcc","c2e699","78c679","31a354","006837"],6:["ffffcc","d9f0a3","addd8e","78c679","31a354","006837"],7:["ffffcc","d9f0a3","addd8e","78c679","41ab5d","238443","005a32"],8:["ffffe5","f7fcb9","d9f0a3","addd8e","78c679","41ab5d","238443","005a32"],9:["ffffe5","f7fcb9","d9f0a3","addd8e","78c679","41ab5d","238443","006837","004529"]},YlGnBu:{type:"sequential",cbf:42,3:["edf8b1","7fcdbb","2c7fb8"],4:["ffffcc","a1dab4","41b6c4","225ea8"],5:["ffffcc","a1dab4","41b6c4","2c7fb8","253494"],6:["ffffcc","c7e9b4","7fcdbb","41b6c4","2c7fb8","253494"],7:["ffffcc","c7e9b4","7fcdbb","41b6c4","1d91c0","225ea8","0c2c84"],8:["ffffd9","edf8b1","c7e9b4","7fcdbb","41b6c4","1d91c0","225ea8","0c2c84"],9:["ffffd9","edf8b1","c7e9b4","7fcdbb","41b6c4","1d91c0","225ea8","253494","081d58"]},GnBu:{type:"sequential",cbf:42,3:["e0f3db","a8ddb5","43a2ca"],4:["f0f9e8","bae4bc","7bccc4","2b8cbe"],5:["f0f9e8","bae4bc","7bccc4","43a2ca","0868ac"],6:["f0f9e8","ccebc5","a8ddb5","7bccc4","43a2ca","0868ac"],7:["f0f9e8","ccebc5","a8ddb5","7bccc4","4eb3d3","2b8cbe","08589e"],8:["f7fcf0","e0f3db","ccebc5","a8ddb5","7bccc4","4eb3d3","2b8cbe","08589e"],9:["f7fcf0","e0f3db","ccebc5","a8ddb5","7bccc4","4eb3d3","2b8cbe","0868ac","084081"]},BuGn:{type:"sequential",cbf:42,3:["e5f5f9","99d8c9","2ca25f"],4:["edf8fb","b2e2e2","66c2a4","238b45"],5:["edf8fb","b2e2e2","66c2a4","2ca25f","006d2c"],6:["edf8fb","ccece6","99d8c9","66c2a4","2ca25f","006d2c"],7:["edf8fb","ccece6","99d8c9","66c2a4","41ae76","238b45","005824"],8:["f7fcfd","e5f5f9","ccece6","99d8c9","66c2a4","41ae76","238b45","005824"],9:["f7fcfd","e5f5f9","ccece6","99d8c9","66c2a4","41ae76","238b45","006d2c","00441b"]},PuBuGn:{type:"sequential",cbf:42,3:["ece2f0","a6bddb","1c9099"],4:["f6eff7","bdc9e1","67a9cf","02818a"],5:["f6eff7","bdc9e1","67a9cf","1c9099","016c59"],6:["f6eff7","d0d1e6","a6bddb","67a9cf","1c9099","016c59"],7:["f6eff7","d0d1e6","a6bddb","67a9cf","3690c0","02818a","016450"],8:["fff7fb","ece2f0","d0d1e6","a6bddb","67a9cf","3690c0","02818a","016450"],9:["fff7fb","ece2f0","d0d1e6","a6bddb","67a9cf","3690c0","02818a","016c59","014636"]},PuBu:{type:"sequential",cbf:42,3:["ece7f2","a6bddb","2b8cbe"],4:["f1eef6","bdc9e1","74a9cf","0570b0"],5:["f1eef6","bdc9e1","74a9cf","2b8cbe","045a8d"],6:["f1eef6","d0d1e6","a6bddb","74a9cf","2b8cbe","045a8d"],7:["f1eef6","d0d1e6","a6bddb","74a9cf","3690c0","0570b0","034e7b"],8:["fff7fb","ece7f2","d0d1e6","a6bddb","74a9cf","3690c0","0570b0","034e7b"],9:["fff7fb","ece7f2","d0d1e6","a6bddb","74a9cf","3690c0","0570b0","045a8d","023858"]},BuPu:{type:"sequential",cbf:42,3:["e0ecf4","9ebcda","8856a7"],4:["edf8fb","b3cde3","8c96c6","88419d"],5:["edf8fb","b3cde3","8c96c6","8856a7","810f7c"],6:["edf8fb","bfd3e6","9ebcda","8c96c6","8856a7","810f7c"],7:["edf8fb","bfd3e6","9ebcda","8c96c6","8c6bb1","88419d","6e016b"],8:["f7fcfd","e0ecf4","bfd3e6","9ebcda","8c96c6","8c6bb1","88419d","6e016b"],9:["f7fcfd","e0ecf4","bfd3e6","9ebcda","8c96c6","8c6bb1","88419d","810f7c","4d004b"]},RdPu:{type:"sequential",cbf:42,3:["fde0dd","fa9fb5","c51b8a"],4:["feebe2","fbb4b9","f768a1","ae017e"],5:["feebe2","fbb4b9","f768a1","c51b8a","7a0177"],6:["feebe2","fcc5c0","fa9fb5","f768a1","c51b8a","7a0177"],7:["feebe2","fcc5c0","fa9fb5","f768a1","dd3497","ae017e","7a0177"],8:["fff7f3","fde0dd","fcc5c0","fa9fb5","f768a1","dd3497","ae017e","7a0177"],9:["fff7f3","fde0dd","fcc5c0","fa9fb5","f768a1","dd3497","ae017e","7a0177","49006a"]},PuRd:{type:"sequential",cbf:42,3:["e7e1ef","c994c7","dd1c77"],4:["f1eef6","d7b5d8","df65b0","ce1256"],5:["f1eef6","d7b5d8","df65b0","dd1c77","980043"],6:["f1eef6","d4b9da","c994c7","df65b0","dd1c77","980043"],7:["f1eef6","d4b9da","c994c7","df65b0","e7298a","ce1256","91003f"],8:["f7f4f9","e7e1ef","d4b9da","c994c7","df65b0","e7298a","ce1256","91003f"],9:["f7f4f9","e7e1ef","d4b9da","c994c7","df65b0","e7298a","ce1256","980043","67001f"]},OrRd:{type:"sequential",cbf:42,3:["fee8c8","fdbb84","e34a33"],4:["fef0d9","fdcc8a","fc8d59","d7301f"],5:["fef0d9","fdcc8a","fc8d59","e34a33","b30000"],6:["fef0d9","fdd49e","fdbb84","fc8d59","e34a33","b30000"],7:["fef0d9","fdd49e","fdbb84","fc8d59","ef6548","d7301f","990000"],8:["fff7ec","fee8c8","fdd49e","fdbb84","fc8d59","ef6548","d7301f","990000"],9:["fff7ec","fee8c8","fdd49e","fdbb84","fc8d59","ef6548","d7301f","b30000","7f0000"]},YlOrRd:{type:"sequential",cbf:42,3:["ffeda0","feb24c","f03b20"],4:["ffffb2","fecc5c","fd8d3c","e31a1c"],5:["ffffb2","fecc5c","fd8d3c","f03b20","bd0026"],6:["ffffb2","fed976","feb24c","fd8d3c","f03b20","bd0026"],7:["ffffb2","fed976","feb24c","fd8d3c","fc4e2a","e31a1c","b10026"],8:["ffffcc","ffeda0","fed976","feb24c","fd8d3c","fc4e2a","e31a1c","b10026"],9:["ffffcc","ffeda0","fed976","feb24c","fd8d3c","fc4e2a","e31a1c","bd0026","800026"]},YlOrBr:{type:"sequential",cbf:42,3:["fff7bc","fec44f","d95f0e"],4:["ffffd4","fed98e","fe9929","cc4c02"],5:["ffffd4","fed98e","fe9929","d95f0e","993404"],6:["ffffd4","fee391","fec44f","fe9929","d95f0e","993404"],7:["ffffd4","fee391","fec44f","fe9929","ec7014","cc4c02","8c2d04"],8:["ffffe5","fff7bc","fee391","fec44f","fe9929","ec7014","cc4c02","8c2d04"],9:["ffffe5","fff7bc","fee391","fec44f","fe9929","ec7014","cc4c02","993404","662506"]},Purples:{type:"sequential",cbf:42,3:["efedf5","bcbddc","756bb1"],4:["f2f0f7","cbc9e2","9e9ac8","6a51a3"],5:["f2f0f7","cbc9e2","9e9ac8","756bb1","54278f"],6:["f2f0f7","dadaeb","bcbddc","9e9ac8","756bb1","54278f"],7:["f2f0f7","dadaeb","bcbddc","9e9ac8","807dba","6a51a3","4a1486"],8:["fcfbfd","efedf5","dadaeb","bcbddc","9e9ac8","807dba","6a51a3","4a1486"],9:["fcfbfd","efedf5","dadaeb","bcbddc","9e9ac8","807dba","6a51a3","54278f","3f007d"]},Blues:{type:"sequential",cbf:42,3:["deebf7","9ecae1","3182bd"],4:["eff3ff","bdd7e7","6baed6","2171b5"],5:["eff3ff","bdd7e7","6baed6","3182bd","08519c"],6:["eff3ff","c6dbef","9ecae1","6baed6","3182bd","08519c"],7:["eff3ff","c6dbef","9ecae1","6baed6","4292c6","2171b5","084594"],8:["f7fbff","deebf7","c6dbef","9ecae1","6baed6","4292c6","2171b5","084594"],9:["f7fbff","deebf7","c6dbef","9ecae1","6baed6","4292c6","2171b5","08519c","08306b"]},Greens:{type:"sequential",cbf:42,3:["e5f5e0","a1d99b","31a354"],4:["edf8e9","bae4b3","74c476","238b45"],5:["edf8e9","bae4b3","74c476","31a354","006d2c"],6:["edf8e9","c7e9c0","a1d99b","74c476","31a354","006d2c"],7:["edf8e9","c7e9c0","a1d99b","74c476","41ab5d","238b45","005a32"],8:["f7fcf5","e5f5e0","c7e9c0","a1d99b","74c476","41ab5d","238b45","005a32"],9:["f7fcf5","e5f5e0","c7e9c0","a1d99b","74c476","41ab5d","238b45","006d2c","00441b"]},Oranges:{type:"sequential",cbf:42,3:["fee6ce","fdae6b","e6550d"],4:["feedde","fdbe85","fd8d3c","d94701"],5:["feedde","fdbe85","fd8d3c","e6550d","a63603"],6:["feedde","fdd0a2","fdae6b","fd8d3c","e6550d","a63603"],7:["feedde","fdd0a2","fdae6b","fd8d3c","f16913","d94801","8c2d04"],8:["fff5eb","fee6ce","fdd0a2","fdae6b","fd8d3c","f16913","d94801","8c2d04"],9:["fff5eb","fee6ce","fdd0a2","fdae6b","fd8d3c","f16913","d94801","a63603","7f2704"]},Reds:{type:"sequential",cbf:42,3:["fee0d2","fc9272","de2d26"],4:["fee5d9","fcae91","fb6a4a","cb181d"],5:["fee5d9","fcae91","fb6a4a","de2d26","a50f15"],6:["fee5d9","fcbba1","fc9272","fb6a4a","de2d26","a50f15"],7:["fee5d9","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","99000d"],8:["fff5f0","fee0d2","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","99000d"],9:["fff5f0","fee0d2","fcbba1","fc9272","fb6a4a","ef3b2c","cb181d","a50f15","67000d"]},Greys:{type:"sequential",cbf:42,3:["f0f0f0","bdbdbd","636363"],4:["f7f7f7","cccccc","969696","525252"],5:["f7f7f7","cccccc","969696","636363","252525"],6:["f7f7f7","d9d9d9","bdbdbd","969696","636363","252525"],7:["f7f7f7","d9d9d9","bdbdbd","969696","737373","525252","252525"],8:["ffffff","f0f0f0","d9d9d9","bdbdbd","969696","737373","525252","252525"],9:["ffffff","f0f0f0","d9d9d9","bdbdbd","969696","737373","525252","252525","000000"]},PuOr:{type:"diverging",cbf:42,3:["f1a340","f7f7f7","998ec3"],4:["e66101","fdb863","b2abd2","5e3c99"],5:["e66101","fdb863","f7f7f7","b2abd2","5e3c99"],6:["b35806","f1a340","fee0b6","d8daeb","998ec3","542788"],7:["b35806","f1a340","fee0b6","f7f7f7","d8daeb","998ec3","542788"],8:["b35806","e08214","fdb863","fee0b6","d8daeb","b2abd2","8073ac","542788"],9:["b35806","e08214","fdb863","fee0b6","f7f7f7","d8daeb","b2abd2","8073ac","542788"],10:["7f3b08","b35806","e08214","fdb863","fee0b6","d8daeb","b2abd2","8073ac","542788","2d004b"],11:["7f3b08","b35806","e08214","fdb863","fee0b6","f7f7f7","d8daeb","b2abd2","8073ac","542788","2d004b"]},BrBG:{type:"diverging",cbf:42,3:["d8b365","f5f5f5","5ab4ac"],4:["a6611a","dfc27d","80cdc1","018571"],5:["a6611a","dfc27d","f5f5f5","80cdc1","018571"],6:["8c510a","d8b365","f6e8c3","c7eae5","5ab4ac","01665e"],7:["8c510a","d8b365","f6e8c3","f5f5f5","c7eae5","5ab4ac","01665e"],8:["8c510a","bf812d","dfc27d","f6e8c3","c7eae5","80cdc1","35978f","01665e"],9:["8c510a","bf812d","dfc27d","f6e8c3","f5f5f5","c7eae5","80cdc1","35978f","01665e"],10:["543005","8c510a","bf812d","dfc27d","f6e8c3","c7eae5","80cdc1","35978f","01665e","003c30"],11:["543005","8c510a","bf812d","dfc27d","f6e8c3","f5f5f5","c7eae5","80cdc1","35978f","01665e","003c30"]},PRGn:{type:"diverging",cbf:42,3:["af8dc3","f7f7f7","7fbf7b"],4:["7b3294","c2a5cf","a6dba0","008837"],5:["7b3294","c2a5cf","f7f7f7","a6dba0","008837"],6:["762a83","af8dc3","e7d4e8","d9f0d3","7fbf7b","1b7837"],7:["762a83","af8dc3","e7d4e8","f7f7f7","d9f0d3","7fbf7b","1b7837"],8:["762a83","9970ab","c2a5cf","e7d4e8","d9f0d3","a6dba0","5aae61","1b7837"],9:["762a83","9970ab","c2a5cf","e7d4e8","f7f7f7","d9f0d3","a6dba0","5aae61","1b7837"],10:["40004b","762a83","9970ab","c2a5cf","e7d4e8","d9f0d3","a6dba0","5aae61","1b7837","00441b"],11:["40004b","762a83","9970ab","c2a5cf","e7d4e8","f7f7f7","d9f0d3","a6dba0","5aae61","1b7837","00441b"]},PiYG:{type:"diverging",cbf:42,3:["e9a3c9","f7f7f7","a1d76a"],4:["d01c8b","f1b6da","b8e186","4dac26"],5:["d01c8b","f1b6da","f7f7f7","b8e186","4dac26"],6:["c51b7d","e9a3c9","fde0ef","e6f5d0","a1d76a","4d9221"],7:["c51b7d","e9a3c9","fde0ef","f7f7f7","e6f5d0","a1d76a","4d9221"],8:["c51b7d","de77ae","f1b6da","fde0ef","e6f5d0","b8e186","7fbc41","4d9221"],9:["c51b7d","de77ae","f1b6da","fde0ef","f7f7f7","e6f5d0","b8e186","7fbc41","4d9221"],10:["8e0152","c51b7d","de77ae","f1b6da","fde0ef","e6f5d0","b8e186","7fbc41","4d9221","276419"],11:["8e0152","c51b7d","de77ae","f1b6da","fde0ef","f7f7f7","e6f5d0","b8e186","7fbc41","4d9221","276419"]},RdBu:{type:"diverging",cbf:42,3:["ef8a62","f7f7f7","67a9cf"],4:["ca0020","f4a582","92c5de","0571b0"],5:["ca0020","f4a582","f7f7f7","92c5de","0571b0"],6:["b2182b","ef8a62","fddbc7","d1e5f0","67a9cf","2166ac"],7:["b2182b","ef8a62","fddbc7","f7f7f7","d1e5f0","67a9cf","2166ac"],8:["b2182b","d6604d","f4a582","fddbc7","d1e5f0","92c5de","4393c3","2166ac"],9:["b2182b","d6604d","f4a582","fddbc7","f7f7f7","d1e5f0","92c5de","4393c3","2166ac"],10:["67001f","b2182b","d6604d","f4a582","fddbc7","d1e5f0","92c5de","4393c3","2166ac","053061"],11:["67001f","b2182b","d6604d","f4a582","fddbc7","f7f7f7","d1e5f0","92c5de","4393c3","2166ac","053061"]},RdGy:{type:"diverging",cbf:42,3:["ef8a62","ffffff","999999"],4:["ca0020","f4a582","bababa","404040"],5:["ca0020","f4a582","ffffff","bababa","404040"],6:["b2182b","ef8a62","fddbc7","e0e0e0","999999","4d4d4d"],7:["b2182b","ef8a62","fddbc7","ffffff","e0e0e0","999999","4d4d4d"],8:["b2182b","d6604d","f4a582","fddbc7","e0e0e0","bababa","878787","4d4d4d"],9:["b2182b","d6604d","f4a582","fddbc7","ffffff","e0e0e0","bababa","878787","4d4d4d"],10:["67001f","b2182b","d6604d","f4a582","fddbc7","e0e0e0","bababa","878787","4d4d4d","1a1a1a"],11:["67001f","b2182b","d6604d","f4a582","fddbc7","ffffff","e0e0e0","bababa","878787","4d4d4d","1a1a1a"]},RdYlBu:{type:"diverging",cbf:42,3:["fc8d59","ffffbf","91bfdb"],4:["d7191c","fdae61","abd9e9","2c7bb6"],5:["d7191c","fdae61","ffffbf","abd9e9","2c7bb6"],6:["d73027","fc8d59","fee090","e0f3f8","91bfdb","4575b4"],7:["d73027","fc8d59","fee090","ffffbf","e0f3f8","91bfdb","4575b4"],8:["d73027","f46d43","fdae61","fee090","e0f3f8","abd9e9","74add1","4575b4"],9:["d73027","f46d43","fdae61","fee090","ffffbf","e0f3f8","abd9e9","74add1","4575b4"],10:["a50026","d73027","f46d43","fdae61","fee090","e0f3f8","abd9e9","74add1","4575b4","313695"],11:["a50026","d73027","f46d43","fdae61","fee090","ffffbf","e0f3f8","abd9e9","74add1","4575b4","313695"]},Spectral:{type:"diverging",cbf:0,3:["fc8d59","ffffbf","99d594"],4:["d7191c","fdae61","abdda4","2b83ba"],5:["d7191c","fdae61","ffffbf","abdda4","2b83ba"],6:["d53e4f","fc8d59","fee08b","e6f598","99d594","3288bd"],7:["d53e4f","fc8d59","fee08b","ffffbf","e6f598","99d594","3288bd"],8:["d53e4f","f46d43","fdae61","fee08b","e6f598","abdda4","66c2a5","3288bd"],9:["d53e4f","f46d43","fdae61","fee08b","ffffbf","e6f598","abdda4","66c2a5","3288bd"],10:["9e0142","d53e4f","f46d43","fdae61","fee08b","e6f598","abdda4","66c2a5","3288bd","5e4fa2"],11:["9e0142","d53e4f","f46d43","fdae61","fee08b","ffffbf","e6f598","abdda4","66c2a5","3288bd","5e4fa2"]},RdYlGn:{type:"diverging",cbf:0,3:["fc8d59","ffffbf","91cf60"],4:["d7191c","fdae61","a6d96a","1a9641"],5:["d7191c","fdae61","ffffbf","a6d96a","1a9641"],6:["d73027","fc8d59","fee08b","d9ef8b","91cf60","1a9850"],7:["d73027","fc8d59","fee08b","ffffbf","d9ef8b","91cf60","1a9850"],8:["d73027","f46d43","fdae61","fee08b","d9ef8b","a6d96a","66bd63","1a9850"],9:["d73027","f46d43","fdae61","fee08b","ffffbf","d9ef8b","a6d96a","66bd63","1a9850"],10:["a50026","d73027","f46d43","fdae61","fee08b","d9ef8b","a6d96a","66bd63","1a9850","006837"],11:["a50026","d73027","f46d43","fdae61","fee08b","ffffbf","d9ef8b","a6d96a","66bd63","1a9850","006837"]},Accent:{type:"qualitative",cbf:0,3:["7fc97f","beaed4","fdc086"],4:["7fc97f","beaed4","fdc086","ffff99"],5:["7fc97f","beaed4","fdc086","ffff99","386cb0"],6:["7fc97f","beaed4","fdc086","ffff99","386cb0","f0027f"],7:["7fc97f","beaed4","fdc086","ffff99","386cb0","f0027f","bf5b17"],8:["7fc97f","beaed4","fdc086","ffff99","386cb0","f0027f","bf5b17","666666"]},Dark2:{type:"qualitative",cbf:3,3:["1b9e77","d95f02","7570b3"],4:["1b9e77","d95f02","7570b3","e7298a"],5:["1b9e77","d95f02","7570b3","e7298a","66a61e"],6:["1b9e77","d95f02","7570b3","e7298a","66a61e","e6ab02"],7:["1b9e77","d95f02","7570b3","e7298a","66a61e","e6ab02","a6761d"],8:["1b9e77","d95f02","7570b3","e7298a","66a61e","e6ab02","a6761d","666666"]},Paired:{type:"qualitative",cbf:4,3:["a6cee3","1f78b4","b2df8a"],4:["a6cee3","1f78b4","b2df8a","33a02c"],5:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99"],6:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c"],7:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f"],8:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00"],9:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6"],10:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6","6a3d9a"],11:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6","6a3d9a","ffff99"],12:["a6cee3","1f78b4","b2df8a","33a02c","fb9a99","e31a1c","fdbf6f","ff7f00","cab2d6","6a3d9a","ffff99","b15928"]},Pastel1:{type:"qualitative",cbf:0,3:["fbb4ae","b3cde3","ccebc5"],4:["fbb4ae","b3cde3","ccebc5","decbe4"],5:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6"],6:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc"],7:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc","e5d8bd"],8:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc","e5d8bd","fddaec"],9:["fbb4ae","b3cde3","ccebc5","decbe4","fed9a6","ffffcc","e5d8bd","fddaec","f2f2f2"]},Pastel2:{type:"qualitative",cbf:0,3:["b3e2cd","fdcdac","cbd5e8"],4:["b3e2cd","fdcdac","cbd5e8","f4cae4"],5:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9"],6:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9","fff2ae"],7:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9","fff2ae","f1e2cc"],8:["b3e2cd","fdcdac","cbd5e8","f4cae4","e6f5c9","fff2ae","f1e2cc","cccccc"]},Set1:{type:"qualitative",cbf:0,3:["e41a1c","377eb8","4daf4a"],4:["e41a1c","377eb8","4daf4a","984ea3"],5:["e41a1c","377eb8","4daf4a","984ea3","ff7f00"],6:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33"],7:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33","a65628"],8:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33","a65628","f781bf"],9:["e41a1c","377eb8","4daf4a","984ea3","ff7f00","ffff33","a65628","f781bf","999999"]},Set2:{type:"qualitative",cbf:3,3:["66c2a5","fc8d62","8da0cb"],4:["66c2a5","fc8d62","8da0cb","e78ac3"],5:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854"],6:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854","ffd92f"],7:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854","ffd92f","e5c494"],8:["66c2a5","fc8d62","8da0cb","e78ac3","a6d854","ffd92f","e5c494","b3b3b3"]},Set3:{type:"qualitative",cbf:0,3:["8dd3c7","ffffb3","bebada"],4:["8dd3c7","ffffb3","bebada","fb8072"],5:["8dd3c7","ffffb3","bebada","fb8072","80b1d3"],6:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462"],7:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69"],8:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5"],9:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9"],10:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9","bc80bd"],11:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9","bc80bd","ccebc5"],12:["8dd3c7","ffffb3","bebada","fb8072","80b1d3","fdb462","b3de69","fccde5","d9d9d9","bc80bd","ccebc5","ffed6f"]}};for(var name in schemes){var scheme=schemes[name];scheme=palette.Scheme.fromPalettes("cb-"+name,[scheme.type,"cb-"+scheme.type],scheme,12,scheme.cbf);palette.register(scheme)}})();if(typeof module==="object"&&module.exports){module.exports=palette}
/*!
	Papa Parse
	v4.3.6
	https://github.com/mholt/PapaParse
	License: MIT
*/
!function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof module&&"undefined"!=typeof exports?module.exports=b():a.Papa=b()}(this,(function(){"use strict";function a(a,b){b=b||{};var c=b.dynamicTyping||!1;if(r(c)&&(b.dynamicTypingFunction=c,c={}),b.dynamicTyping=c,b.worker&&z.WORKERS_SUPPORTED){var h=k();return h.userStep=b.step,h.userChunk=b.chunk,h.userComplete=b.complete,h.userError=b.error,b.step=r(b.step),b.chunk=r(b.chunk),b.complete=r(b.complete),b.error=r(b.error),delete b.worker,void h.postMessage({input:a,config:b,workerId:h.id})}var i=null;return"string"==typeof a?i=b.download?new d(b):new f(b):a.readable===!0&&r(a.read)&&r(a.on)?i=new g(b):(t.File&&a instanceof File||a instanceof Object)&&(i=new e(b)),i.stream(a)}function b(a,b){function c(){"object"==typeof b&&("string"==typeof b.delimiter&&1===b.delimiter.length&&z.BAD_DELIMITERS.indexOf(b.delimiter)===-1&&(j=b.delimiter),("boolean"==typeof b.quotes||b.quotes instanceof Array)&&(h=b.quotes),"string"==typeof b.newline&&(k=b.newline),"string"==typeof b.quoteChar&&(l=b.quoteChar),"boolean"==typeof b.header&&(i=b.header))}function d(a){if("object"!=typeof a)return[];var b=[];for(var c in a)b.push(c);return b}function e(a,b){var c="";"string"==typeof a&&(a=JSON.parse(a)),"string"==typeof b&&(b=JSON.parse(b));var d=a instanceof Array&&a.length>0,e=!(b[0]instanceof Array);if(d&&i){for(var g=0;g<a.length;g++)g>0&&(c+=j),c+=f(a[g],g);b.length>0&&(c+=k)}for(var h=0;h<b.length;h++){for(var l=d?a.length:b[h].length,m=0;m<l;m++){m>0&&(c+=j);var n=d&&e?a[m]:m;c+=f(b[h][n],m)}h<b.length-1&&(c+=k)}return c}function f(a,b){if("undefined"==typeof a||null===a)return"";a=a.toString().replace(m,l+l);var c="boolean"==typeof h&&h||h instanceof Array&&h[b]||g(a,z.BAD_DELIMITERS)||a.indexOf(j)>-1||" "===a.charAt(0)||" "===a.charAt(a.length-1);return c?l+a+l:a}function g(a,b){for(var c=0;c<b.length;c++)if(a.indexOf(b[c])>-1)return!0;return!1}var h=!1,i=!0,j=",",k="\r\n",l='"';c();var m=new RegExp(l,"g");if("string"==typeof a&&(a=JSON.parse(a)),a instanceof Array){if(!a.length||a[0]instanceof Array)return e(null,a);if("object"==typeof a[0])return e(d(a[0]),a)}else if("object"==typeof a)return"string"==typeof a.data&&(a.data=JSON.parse(a.data)),a.data instanceof Array&&(a.fields||(a.fields=a.meta&&a.meta.fields),a.fields||(a.fields=a.data[0]instanceof Array?a.fields:d(a.data[0])),a.data[0]instanceof Array||"object"==typeof a.data[0]||(a.data=[a.data])),e(a.fields||[],a.data||[]);throw"exception: Unable to serialize unrecognized input"}function c(a){function b(a){var b=p(a);b.chunkSize=parseInt(b.chunkSize),a.step||a.chunk||(b.chunkSize=null),this._handle=new h(b),this._handle.streamer=this,this._config=b}this._handle=null,this._paused=!1,this._finished=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},b.call(this,a),this.parseChunk=function(a){if(this.isFirstChunk&&r(this._config.beforeFirstChunk)){var b=this._config.beforeFirstChunk(a);void 0!==b&&(a=b)}this.isFirstChunk=!1;var c=this._partialLine+a;this._partialLine="";var d=this._handle.parse(c,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var e=d.meta.cursor;this._finished||(this._partialLine=c.substring(e-this._baseIndex),this._baseIndex=e),d&&d.data&&(this._rowCount+=d.data.length);var f=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(v)t.postMessage({results:d,workerId:z.WORKER_ID,finished:f});else if(r(this._config.chunk)){if(this._config.chunk(d,this._handle),this._paused)return;d=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(d.data),this._completeResults.errors=this._completeResults.errors.concat(d.errors),this._completeResults.meta=d.meta),!f||!r(this._config.complete)||d&&d.meta.aborted||this._config.complete(this._completeResults,this._input),f||d&&d.meta.paused||this._nextChunk(),d}},this._sendError=function(a){r(this._config.error)?this._config.error(a):v&&this._config.error&&t.postMessage({workerId:z.WORKER_ID,error:a,finished:!1})}}function d(a){function b(a){var b=a.getResponseHeader("Content-Range");return null===b?-1:parseInt(b.substr(b.lastIndexOf("/")+1))}a=a||{},a.chunkSize||(a.chunkSize=z.RemoteChunkSize),c.call(this,a);var d;u?this._nextChunk=function(){this._readChunk(),this._chunkLoaded()}:this._nextChunk=function(){this._readChunk()},this.stream=function(a){this._input=a,this._nextChunk()},this._readChunk=function(){if(this._finished)return void this._chunkLoaded();if(d=new XMLHttpRequest,this._config.withCredentials&&(d.withCredentials=this._config.withCredentials),u||(d.onload=q(this._chunkLoaded,this),d.onerror=q(this._chunkError,this)),d.open("GET",this._input,!u),this._config.downloadRequestHeaders){var a=this._config.downloadRequestHeaders;for(var b in a)d.setRequestHeader(b,a[b])}if(this._config.chunkSize){var c=this._start+this._config.chunkSize-1;d.setRequestHeader("Range","bytes="+this._start+"-"+c),d.setRequestHeader("If-None-Match","webkit-no-cache")}try{d.send()}catch(a){this._chunkError(a.message)}u&&0===d.status?this._chunkError():this._start+=this._config.chunkSize},this._chunkLoaded=function(){if(4==d.readyState){if(d.status<200||d.status>=400)return void this._chunkError();this._finished=!this._config.chunkSize||this._start>b(d),this.parseChunk(d.responseText)}},this._chunkError=function(a){var b=d.statusText||a;this._sendError(b)}}function e(a){a=a||{},a.chunkSize||(a.chunkSize=z.LocalChunkSize),c.call(this,a);var b,d,e="undefined"!=typeof FileReader;this.stream=function(a){this._input=a,d=a.slice||a.webkitSlice||a.mozSlice,e?(b=new FileReader,b.onload=q(this._chunkLoaded,this),b.onerror=q(this._chunkError,this)):b=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var a=this._input;if(this._config.chunkSize){var c=Math.min(this._start+this._config.chunkSize,this._input.size);a=d.call(a,this._start,c)}var f=b.readAsText(a,this._config.encoding);e||this._chunkLoaded({target:{result:f}})},this._chunkLoaded=function(a){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(a.target.result)},this._chunkError=function(){this._sendError(b.error)}}function f(a){a=a||{},c.call(this,a);var b,d;this.stream=function(a){return b=a,d=a,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var a=this._config.chunkSize,b=a?d.substr(0,a):d;return d=a?d.substr(a):"",this._finished=!d,this.parseChunk(b)}}}function g(a){a=a||{},c.call(this,a);var b=[],d=!0;this.stream=function(a){this._input=a,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._nextChunk=function(){b.length?this.parseChunk(b.shift()):d=!0},this._streamData=q((function(a){try{b.push("string"==typeof a?a:a.toString(this._config.encoding)),d&&(d=!1,this.parseChunk(b.shift()))}catch(a){this._streamError(a)}}),this),this._streamError=q((function(a){this._streamCleanUp(),this._sendError(a.message)}),this),this._streamEnd=q((function(){this._streamCleanUp(),this._finished=!0,this._streamData("")}),this),this._streamCleanUp=q((function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)}),this)}function h(a){function b(){if(x&&o&&(l("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+z.DefaultDelimiter+"'"),o=!1),a.skipEmptyLines)for(var b=0;b<x.data.length;b++)1===x.data[b].length&&""===x.data[b][0]&&x.data.splice(b--,1);return c()&&d(),g()}function c(){return a.header&&0===w.length}function d(){if(x){for(var a=0;c()&&a<x.data.length;a++)for(var b=0;b<x.data[a].length;b++)w.push(x.data[a][b]);x.data.splice(0,1)}}function e(b){return a.dynamicTypingFunction&&void 0===a.dynamicTyping[b]&&(a.dynamicTyping[b]=a.dynamicTypingFunction(b)),(a.dynamicTyping[b]||a.dynamicTyping)===!0}function f(a,b){return e(a)?"true"===b||"TRUE"===b||"false"!==b&&"FALSE"!==b&&k(b):b}function g(){if(!x||!a.header&&!a.dynamicTyping)return x;for(var b=0;b<x.data.length;b++){for(var c=a.header?{}:[],d=0;d<x.data[b].length;d++){var e=d,g=x.data[b][d];a.header&&(e=d>=w.length?"__parsed_extra":w[d]),g=f(e,g),"__parsed_extra"===e?(c[e]=c[e]||[],c[e].push(g)):c[e]=g}x.data[b]=c,a.header&&(d>w.length?l("FieldMismatch","TooManyFields","Too many fields: expected "+w.length+" fields but parsed "+d,b):d<w.length&&l("FieldMismatch","TooFewFields","Too few fields: expected "+w.length+" fields but parsed "+d,b))}return a.header&&x.meta&&(x.meta.fields=w),x}function h(b,c,d){for(var e,f,g,h=[",","\t","|",";",z.RECORD_SEP,z.UNIT_SEP],j=0;j<h.length;j++){var k=h[j],l=0,m=0,n=0;g=void 0;for(var o=new i({delimiter:k,newline:c,preview:10}).parse(b),p=0;p<o.data.length;p++)if(d&&1===o.data[p].length&&0===o.data[p][0].length)n++;else{var q=o.data[p].length;m+=q,"undefined"!=typeof g?q>1&&(l+=Math.abs(q-g),g=q):g=q}o.data.length>0&&(m/=o.data.length-n),("undefined"==typeof f||l<f)&&m>1.99&&(f=l,e=k)}return a.delimiter=e,{successful:!!e,bestDelimiter:e}}function j(a){a=a.substr(0,1048576);var b=a.split("\r"),c=a.split("\n"),d=c.length>1&&c[0].length<b[0].length;if(1===b.length||d)return"\n";for(var e=0,f=0;f<b.length;f++)"\n"===b[f][0]&&e++;return e>=b.length/2?"\r\n":"\r"}function k(a){var b=q.test(a);return b?parseFloat(a):a}function l(a,b,c,d){x.errors.push({type:a,code:b,message:c,row:d})}var m,n,o,q=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,s=this,t=0,u=!1,v=!1,w=[],x={data:[],errors:[],meta:{}};if(r(a.step)){var y=a.step;a.step=function(d){if(x=d,c())b();else{if(b(),0===x.data.length)return;t+=d.data.length,a.preview&&t>a.preview?n.abort():y(x,s)}}}this.parse=function(c,d,e){if(a.newline||(a.newline=j(c)),o=!1,a.delimiter)r(a.delimiter)&&(a.delimiter=a.delimiter(c),x.meta.delimiter=a.delimiter);else{var f=h(c,a.newline,a.skipEmptyLines);f.successful?a.delimiter=f.bestDelimiter:(o=!0,a.delimiter=z.DefaultDelimiter),x.meta.delimiter=a.delimiter}var g=p(a);return a.preview&&a.header&&g.preview++,m=c,n=new i(g),x=n.parse(m,d,e),b(),u?{meta:{paused:!0}}:x||{meta:{paused:!1}}},this.paused=function(){return u},this.pause=function(){u=!0,n.abort(),m=m.substr(n.getCharIndex())},this.resume=function(){u=!1,s.streamer.parseChunk(m)},this.aborted=function(){return v},this.abort=function(){v=!0,n.abort(),x.meta.aborted=!0,r(a.complete)&&a.complete(x),m=""}}function i(a){a=a||{};var b=a.delimiter,c=a.newline,d=a.comments,e=a.step,f=a.preview,g=a.fastMode,h=a.quoteChar||'"';if(("string"!=typeof b||z.BAD_DELIMITERS.indexOf(b)>-1)&&(b=","),d===b)throw"Comment character same as delimiter";d===!0?d="#":("string"!=typeof d||z.BAD_DELIMITERS.indexOf(d)>-1)&&(d=!1),"\n"!=c&&"\r"!=c&&"\r\n"!=c&&(c="\n");var i=0,j=!1;this.parse=function(a,k,l){function m(a){x.push(a),A=i}function n(b){return l?p():("undefined"==typeof b&&(b=a.substr(i)),z.push(b),i=s,m(z),w&&q(),p())}function o(b){i=b,m(z),z=[],E=a.indexOf(c,i)}function p(a){return{data:x,errors:y,meta:{delimiter:b,linebreak:c,aborted:j,truncated:!!a,cursor:A+(k||0)}}}function q(){e(p()),x=[],y=[]}if("string"!=typeof a)throw"Input must be a string";var s=a.length,t=b.length,u=c.length,v=d.length,w=r(e);i=0;var x=[],y=[],z=[],A=0;if(!a)return p();if(g||g!==!1&&a.indexOf(h)===-1){for(var B=a.split(c),C=0;C<B.length;C++){var z=B[C];if(i+=z.length,C!==B.length-1)i+=c.length;else if(l)return p();if(!d||z.substr(0,v)!==d){if(w){if(x=[],m(z.split(b)),q(),j)return p()}else m(z.split(b));if(f&&C>=f)return x=x.slice(0,f),p(!0)}}return p()}for(var D=a.indexOf(b,i),E=a.indexOf(c,i),F=new RegExp(h+h,"g");;)if(a[i]!==h)if(d&&0===z.length&&a.substr(i,v)===d){if(E===-1)return p();i=E+u,E=a.indexOf(c,i),D=a.indexOf(b,i)}else if(D!==-1&&(D<E||E===-1))z.push(a.substring(i,D)),i=D+t,D=a.indexOf(b,i);else{if(E===-1)break;if(z.push(a.substring(i,E)),o(E+u),w&&(q(),j))return p();if(f&&x.length>=f)return p(!0)}else{var G=i;for(i++;;){var G=a.indexOf(h,G+1);if(G===-1)return l||y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:x.length,index:i}),n();if(G===s-1){var H=a.substring(i,G).replace(F,h);return n(H)}if(a[G+1]!==h){if(a[G+1]===b){z.push(a.substring(i,G).replace(F,h)),i=G+1+t,D=a.indexOf(b,i),E=a.indexOf(c,i);break}if(a.substr(G+1,u)===c){if(z.push(a.substring(i,G).replace(F,h)),o(G+1+u),D=a.indexOf(b,i),w&&(q(),j))return p();if(f&&x.length>=f)return p(!0);break}y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:x.length,index:i}),G++}else G++}}return n()},this.abort=function(){j=!0},this.getCharIndex=function(){return i}}function j(){var a=document.getElementsByTagName("script");return a.length?a[a.length-1].src:""}function k(){if(!z.WORKERS_SUPPORTED)return!1;if(!w&&null===z.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var a=z.SCRIPT_PATH||s;a+=(a.indexOf("?")!==-1?"&":"?")+"papaworker";var b=new t.Worker(a);return b.onmessage=l,b.id=y++,x[b.id]=b,b}function l(a){var b=a.data,c=x[b.workerId],d=!1;if(b.error)c.userError(b.error,b.file);else if(b.results&&b.results.data){var e=function(){d=!0,m(b.workerId,{data:[],errors:[],meta:{aborted:!0}})},f={abort:e,pause:n,resume:n};if(r(c.userStep)){for(var g=0;g<b.results.data.length&&(c.userStep({data:[b.results.data[g]],errors:b.results.errors,meta:b.results.meta},f),!d);g++);delete b.results}else r(c.userChunk)&&(c.userChunk(b.results,f,b.file),delete b.results)}b.finished&&!d&&m(b.workerId,b.results)}function m(a,b){var c=x[a];r(c.userComplete)&&c.userComplete(b),c.terminate(),delete x[a]}function n(){throw"Not implemented."}function o(a){var b=a.data;if("undefined"==typeof z.WORKER_ID&&b&&(z.WORKER_ID=b.workerId),"string"==typeof b.input)t.postMessage({workerId:z.WORKER_ID,results:z.parse(b.input,b.config),finished:!0});else if(t.File&&b.input instanceof File||b.input instanceof Object){var c=z.parse(b.input,b.config);c&&t.postMessage({workerId:z.WORKER_ID,results:c,finished:!0})}}function p(a){if("object"!=typeof a)return a;var b=a instanceof Array?[]:{};for(var c in a)b[c]=p(a[c]);return b}function q(a,b){return function(){a.apply(b,arguments)}}function r(a){return"function"==typeof a}var s,t=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof t?t:{}}(),u=!t.document&&!!t.postMessage,v=u&&/(\?|&)papaworker(=|&|$)/.test(t.location.search),w=!1,x={},y=0,z={};if(z.parse=a,z.unparse=b,z.RECORD_SEP=String.fromCharCode(30),z.UNIT_SEP=String.fromCharCode(31),z.BYTE_ORDER_MARK="\ufeff",z.BAD_DELIMITERS=["\r","\n",'"',z.BYTE_ORDER_MARK],z.WORKERS_SUPPORTED=!u&&!!t.Worker,z.SCRIPT_PATH=null,z.LocalChunkSize=10485760,z.RemoteChunkSize=5242880,z.DefaultDelimiter=",",z.Parser=i,z.ParserHandle=h,z.NetworkStreamer=d,z.FileStreamer=e,z.StringStreamer=f,z.ReadableStreamStreamer=g,t.jQuery){var A=t.jQuery;A.fn.parse=function(a){function b(){if(0===f.length)return void(r(a.complete)&&a.complete());var b=f[0];if(r(a.before)){var e=a.before(b.file,b.inputElem);if("object"==typeof e){if("abort"===e.action)return void c("AbortError",b.file,b.inputElem,e.reason);if("skip"===e.action)return void d();"object"==typeof e.config&&(b.instanceConfig=A.extend(b.instanceConfig,e.config))}else if("skip"===e)return void d()}var g=b.instanceConfig.complete;b.instanceConfig.complete=function(a){r(g)&&g(a,b.file,b.inputElem),d()},z.parse(b.file,b.instanceConfig)}function c(b,c,d,e){r(a.error)&&a.error({name:b},c,d,e)}function d(){f.splice(0,1),b()}var e=a.config||{},f=[];return this.each((function(a){var b="INPUT"===A(this).prop("tagName").toUpperCase()&&"file"===A(this).attr("type").toLowerCase()&&t.FileReader;if(!b||!this.files||0===this.files.length)return!0;for(var c=0;c<this.files.length;c++)f.push({file:this.files[c],inputElem:this,instanceConfig:A.extend({},e)})})),b(),this}}return v?t.onmessage=o:z.WORKERS_SUPPORTED&&(s=j(),document.body?document.addEventListener("DOMContentLoaded",(function(){w=!0}),!0):w=!0),d.prototype=Object.create(c.prototype),d.prototype.constructor=d,e.prototype=Object.create(c.prototype),e.prototype.constructor=e,f.prototype=Object.create(f.prototype),f.prototype.constructor=f,g.prototype=Object.create(c.prototype),g.prototype.constructor=g,z}));(function(exports){reorder={version:"1.0.2"};reorder.debug=false;reorder.cmp_number_asc=function(a,b){return a-b};reorder.cmp_number=reorder.cmp_number_asc;reorder.cmp_number_desc=function(a,b){return b-a};reorder.flatten=function(a,b){return a.concat(b)};reorder.infinities=function(n){var i=-1,a=[];if(arguments.length===1)while(++i<n)a[i]=Infinity;else while(++i<n)a[i]=reorder.infinities.apply(this,Array.prototype.slice.call(arguments,1));return a};reorder.array1d=function(n,v){var i=-1,a=Array(n);while(++i<n)a[i]=v;return a};function check_distance_matrix(mat,tol){var i,j,v1,v2,n=mat.length,row;if(!tol)tol=1e-10;if(n!=mat[0].length)return"Inconsistent dimensions";for(i=0;i<n-1;i++){row=mat[i];v1=row[i];if(v1<0)return"Negative value at diagonal "+i;if(v1>tol)return"Diagonal not zero at "+i;for(j=1;j<n;j++){v1=row[j];v2=mat[j][i];if(Math.abs(v1-v2)>tol)return"Inconsistency at "+i+","+j;if(v1<0)return"Negative value at "+i+","+j;if(v2<0)return"Negative value at "+j+","+i}}return false}function fix_distance_matrix(mat,tol){var i,j,v1,v2,n=mat.length,row;if(!tol)tol=1e-10;if(n!=mat[0].length)throw"Inconsistent dimensions "+n+" != "+mat[0].length;for(i=0;i<n-1;i++){row=mat[i];v1=row[i];if(v1<0){if(-v1>tol)throw"Negative value at diagonal"+i;v1=row[i]=0}else if(v1>tol){throw"Diagonal not zero at "+i}for(j=1;j<n;j++){v1=row[j];v2=mat[j][i];if(Math.abs(v1-v2)>tol)throw"Inconsistency at "+i+","+j;if(v1<0)v1=0;if(v2<0)v2=0;if(v1!=v2){v1+=v2;v1/=2}row[j]=v1;mat[j][i]=v1}}return mat}reorder.dot=science.lin.dot;reorder.length=science.lin.length;reorder.normalize=science.lin.normalize;reorder.zeroes=science.zeroes;reorder.displaymat=function(mat,rowperm,colperm){var i,j,row,col,str;console.log("Matrix:");for(i=0;i<mat.length;i++){row=rowperm?mat[rowperm[i]]:mat[i];str="";for(j=0;j<row.length;j++){col=colperm?row[colperm[j]]:row[j];str+=col?"*":" "}console.log(str)}};reorder.printvec=function(row,prec,colperm,line){var j;if(!line)line="";for(j=0;j<row.length;j++){if(line.length!==0)line+=", ";if(colperm)line+=row[colperm[j]].toFixed(prec);else line+=row[j].toFixed(prec)}console.log(line)};reorder.printmat=function(m,prec,rowperm,colperm){var i,j,row,line;if(!prec)prec=4;for(i=0;i<m.length;i++){row=rowperm?m[rowperm[i]]:m[i];reorder.printvec(row,prec,colperm,i+": ")}};reorder.assert=function(v,msg){if(!v){console.log(msg);throw msg||"Assertion failed"}};reorder.printhcluster=function(cluster,indent){if(cluster.left===null)return Array(indent+1).join(" ")+"id: "+cluster.id;return Array(indent+1).join(" ")+"id: "+cluster.id+", dist: "+cluster.dist+"\n"+reorder.printhcluster(cluster.left,indent+1)+"\n"+reorder.printhcluster(cluster.right,indent+1)};reorder.mean=science.stats.mean;reorder.meantranspose=function(v,j){var n=v.length;if(n===0)return NaN;var o=v[0].length,m=0,i=-1,row;while(++i<n)m+=(v[i][j]-m)/(i+1);return m};reorder.meancolumns=function(v){var n=v.length;if(n===0)return NaN;var o=v[0].length,m=v[0].slice(0),i=0,j,row;while(++i<n){row=v[i];for(j=0;j<o;j++)m[j]+=(row[j]-m[j])/(i+1)}return m};function sum(v){var i=v.length,s=0;while(i-- >0)if(!isNaN(v[i]))s+=v[i];return s}reorder.sum=sum;function isNum(a,b){return!(isNaN(a)||isNaN(b)||a==Infinity||b==Infinity)}reorder.distance={euclidean:function(a,b){var i=a.length,s=0,x;while(i-- >0){if(isNum(a[i],b[i])){x=a[i]-b[i];s+=x*x}}return Math.sqrt(s)},manhattan:function(a,b){var i=a.length,s=0;while(i-- >0){if(isNum(a[i],b[i])){s+=Math.abs(a[i]-b[i])}}return s},minkowski:function(p){return function(a,b){var i=a.length,s=0;while(i-- >0){if(isNum(a[i],b[i])){s+=Math.pow(Math.abs(a[i]-b[i]),p)}}return Math.pow(s,1/p)}},chebyshev:function(a,b){var i=a.length,max=0,x;while(i-- >0){if(isNum(a[i],b[i])){x=Math.abs(a[i]-b[i]);if(x>max)max=x}}return max},hamming:function(a,b){var i=a.length,d=0;while(i-- >0){if(isNum(a[i],b[i])){if(a[i]!==b[i])d++}}return d},jaccard:function(a,b){var n=0,i=a.length,s=0;while(i-- >0){if(isNum(a[i],b[i])){if(a[i]===b[i])s++;n++}}if(n===0)return 0;return s/n},braycurtis:function(a,b){var i=a.length,s0=0,s1=0,ai,bi;while(i-- >0){ai=a[i];bi=b[i];if(isNum(ai,bi)){s0+=Math.abs(ai-bi);s1+=Math.abs(ai+bi)}}if(s1===0)return 0;return s0/s1}};reorder.range=function(start,stop,step){if(arguments.length<3){step=1;if(arguments.length<2){stop=start;start=0}}var range=[],i=start;if(step<0)for(;i>stop;i+=step)range.push(i);else for(;i<stop;i+=step)range.push(i);return range};reorder.transpose=science.lin.transpose;reorder.transposeSlice=function(a,start,end){if(arguments.length<3){end=a[0].length;if(arguments.length<2){start=0}}var m=a.length,n=end,i=start-1,j,b=new Array(end-start);while(++i<n){b[i]=new Array(m);j=-1;while(++j<m)b[i-start][j]=a[j][i]}return b};reorder.correlation={pearson:function(a,b){var ma=science.stats.mean(a),mb=science.stats.mean(b),s1=0,s2=0,s3=0,i,dx,dy,n=Math.min(a.length,b.length);if(n===0)return NaN;for(i=0;i<n;i++){dx=a[i]-ma;dy=b[i]-mb;s1+=dx*dy;s2+=dx*dx;s3+=dy*dy}return s1/Math.sqrt(s2*s3)},pearsonMatrix:function(matrix){var a,ma,i,j,dx,cor=reorder.correlation.pearson,n=matrix.length,ret,mx,sx,sx2;if(n===0)return NaN;ret=reorder.zeroes(n,n);for(i=0;i<n-1;i++){for(j=i+1;j<n;j++){var p=cor(matrix[i],matrix[j]);ret[i][j]=ret[j][i]=p}}return ret}};reorder.bandwidth=function(graph,order){if(!order)order=reorder.range(graph.nodes().length);var inv=inverse_permutation(order),links=graph.links(),i,e,d,max=0;for(i=0;i<links.length;i++){e=links[i];d=Math.abs(inv[e.source.index]-inv[e.target.index]);max=Math.max(max,d)}return max};reorder.edgesum=function(graph,order){if(!order)order=reorder.range(graph.nodes().length);var inv=inverse_permutation(order),links=graph.links(),i,e,d,sum=0;for(i=0;i<links.length;i++){e=links[i];d=Math.abs(inv[e.source.index]-inv[e.target.index]);sum+=d}return sum};reorder.permutation=reorder.range;function inverse_permutation(perm,dense){var inv=dense?Array(perm.length):{};for(var i=0;i<perm.length;i++){inv[perm[i]]=i}return inv}reorder.inverse_permutation=inverse_permutation;reorder.graph=function(nodes,links,directed){var graph={},linkDistance=1,edges,inEdges,outEdges,components;graph.nodes=function(x){if(!arguments.length)return nodes;nodes=x;return graph};graph.nodes_indices=function(){return nodes.map((function(n){return n.index}))};graph.generate_nodes=function(n){nodes=[];for(var i=0;i<n;i++)nodes.push({id:i});return graph};graph.links=function(x){if(!arguments.length)return links;links=x;return graph};graph.links_indices=function(){return links.map((function(l){return{source:l.source.index,target:l.target.index}}))};graph.linkDistance=function(x){if(!arguments.length)return linkDistance;linkDistance=typeof x==="function"?x:+x;return graph};graph.directed=function(x){if(!arguments.length)return directed;directed=x;return graph};function init(){var i,o,n=nodes.length,m=links.length;components=undefined;for(i=0;i<n;++i){(o=nodes[i]).index=i;o.weight=0}for(i=0;i<m;++i){(o=links[i]).index=i;if(typeof o.source=="number")o.source=nodes[o.source];if(typeof o.target=="number")o.target=nodes[o.target];if(!("value"in o))o.value=1;++o.source.weight;++o.target.weight}if(typeof linkDistance==="function")for(i=0;i<m;++i)links[i].distance=+linkDistance.call(this,links[i],i);else for(i=0;i<m;++i)links[i].distance=linkDistance;edges=Array(nodes.length);for(i=0;i<nodes.length;++i){edges[i]=[]}if(directed){inEdges=Array(nodes.length);outEdges=Array(nodes.length);for(i=0;i<nodes.length;++i){inEdges[i]=[];outEdges[i]=[]}}else{inEdges=outEdges=edges}for(i=0;i<links.length;++i){o=links[i];edges[o.source.index].push(o);if(o.source.index!=o.target.index)edges[o.target.index].push(o);if(directed)inEdges[o.source.index].push(o);if(directed)outEdges[o.target.index].push(o)}return graph}graph.init=init;graph.edges=function(node){if(typeof node!="number"){node=node.index;if(reorder.debug){console.log("received node %d",node)}}return edges[node]};graph.degree=function(node){if(typeof node!="number")node=node.index;return edges[node].length};graph.inEdges=function(node){if(typeof node!="number")node=node.index;return inEdges[node]};graph.inDegree=function(node){if(typeof node!="number")node=node.index;return inEdges[node].length};graph.outEdges=function(node){if(typeof node!="number")node=node.index;return outEdges[node]};graph.outDegree=function(node){if(typeof node!="number")node=node.index;return outEdges[node].length};graph.sinks=function(){var sinks=[],i;for(i=0;i<nodes.length;i++){if(graph.outEdges(i).length===0)sinks.push(i)}return sinks};graph.sources=function(){var sources=[],i;for(i=0;i<nodes.length;i++){if(graph.inEdges(i).length===0)sources.push(i)}return sources};function distance(i){return links[i].distance}graph.distance=distance;function neighbors(node){var e=edges[node],ret=[];for(var i=0;i<e.length;++i){var o=e[i];if(o.source.index==node)ret.push(o.target);else ret.push(o.source)}return ret}graph.neighbors=neighbors;graph.other=function(o,node){if(typeof o=="number")o=links[o];if(o.source.index==node)return o.target;else return o.source};function compute_components(){var stack=[],comp=0,comps=[],ccomp,n=nodes.length,i,j,v,l,o,e;for(i=0;i<n;i++)nodes[i].comp=0;for(j=0;j<n;j++){if(nodes[j].comp!==0)continue;comp=comp+1;nodes[j].comp=comp;stack.push(j);ccomp=[j];while(stack.length){v=stack.shift();l=edges[v];for(i=0;i<l.length;i++){e=l[i];o=e.source;if(o.index==v)o=e.target;if(o.index==v)continue;if(o.comp===0){o.comp=comp;ccomp.push(o.index);stack.push(o.index)}}}if(ccomp.length){ccomp.sort(reorder.cmp_number);comps.push(ccomp)}}comps.sort((function(a,b){return b.length-a.length}));return comps}graph.components=function(){if(!components)components=compute_components();return components};return graph};reorder.graph_random_erdos_renyi=function(n,p,directed){if(p<=0)return reorder.graph_empty(n,directed);else if(p>=1)return reorder.graph_complete(n,directed);var nodes=graph_empty_nodes(n),links=[],v,w,i,lr,lp;w=-1;lp=Math.log(1-p);if(directed){for(v=0;v<n;){lr=Math.log(1-Math.random());w=w+1+Math.floor(lr/lp);if(v==w)w=w+1;while(w>=n&&v<n){w=w-n;v=v+1;if(v==w)w=w+1}if(v<n)links.push({source:v,target:w})}}else{for(v=1;v<n;){lr=Math.log(1-Math.random());w=w+1+Math.floor(lr/lp);while(w>=v&&v<n){w=w-v;v=v+1}if(v<n)links.push({source:v,target:w})}}return reorder.graph(nodes,links,directed).init()};reorder.graph_random=reorder.graph_random_erdos_renyi;function graph_empty_nodes(n){var nodes=Array(n),i;for(i=0;i<n;i++)nodes[i]={id:i};return nodes}reorder.graph_empty_nodes=graph_empty_nodes;reorder.graph_empty=function(n,directed){return graph(graph_empty_nodes(n),[],directed)};reorder.complete_graph=function(n,directed){var nodes=graph_empty_nodes(n),links=[],i,j;if(directed){for(i=0;i<n;i++){for(j=0;j<n;j++){if(i!=j)links.push({source:i,target:j})}}}else{for(i=0;i<n-1;i++){for(j=i+1;j<n;j++)links.push({source:i,target:j})}}return reorder.graph(nodes,links,directed).init()};reorder.graph_connect=function(graph,comps){var i,j,links=graph.links();if(!comps)comps=graph.components();for(i=0;i<comps.length-1;i++){for(j=i+1;j<comps.length;j++){links.push({source:comps[i][0],target:comps[j][0]})}}graph.links(links);return graph.init()};reorder.bfs=function(graph,v,fn){var q=new Queue,discovered={},i,e,v2,edges;q.push(v);discovered[v]=true;fn(v,undefined);while(q.length){v=q.shift();fn(v,v);edges=graph.edges(v);for(i=0;i<edges.length;i++){e=edges[i];v2=graph.other(e,v).index;if(!discovered[v2]){q.push(v2);discovered[v2]=true;fn(v,v2)}}fn(v,-1)}};reorder.bfs_distances=function(graph,v){var dist={};dist[v]=0;reorder.bfs(graph,v,(function(v,c){if(c>=0&&v!=c)dist[c]=dist[v]+1}));return dist};reorder.all_pairs_distance_bfs=function(graph,comps){if(!comps)comps=[graph.nodes_indices()];var nodes=comps.reduce(reorder.flatten).sort(reorder.cmp_number),mat=Array(nodes.length),i,j,dist;for(i=0;i<nodes.length;i++)mat[i]=Array(nodes.length);for(i=0;i<nodes.length;i++){dist=reorder.bfs_distances(graph,i);for(j in dist){mat[i][j]=dist[j];mat[j][i]=dist[j]}}return mat};bfs_order=function(graph,comps){if(!comps)comps=graph.components();var i,comp,order=[];for(i=0;i<comps.length;i++){comp=comps[i];reorder.bfs(graph,comp[0],(function(v,c){if(c>=0&&v!=c)order.push(v)}))}return order};reorder.mat2graph=function(mat,directed){var n=mat.length,nodes=[],links=[],max_value=Number.NEGATIVE_INFINITY,i,j,v,m;for(i=0;i<n;i++)nodes.push({id:i});for(i=0;i<n;i++){v=mat[i];m=directed?0:i;for(j=m;j<v.length;j++){if(j==nodes.length)nodes.push({id:j});if(v[j]!==0){if(v[j]>max_value)max_value=v[j];links.push({source:i,target:j,value:v[j]})}}}return reorder.graph(nodes,links,directed).linkDistance((function(l,i){return 1+max_value-l.value})).init()};reorder.graph2mat=function(graph,directed){var nodes=graph.nodes(),links=graph.links(),n=nodes.length,i,l,mat;if(!directed)directed=graph.directed();if(directed){var rows=n,cols=n;for(i=n-1;i>=0;i--){if(graph.inEdges(i).length!==0)break;else rows--}for(i=n-1;i>=0;i--){if(graph.outEdges(i).length!==0)break;else cols--}mat=reorder.zeroes(rows,cols);for(i=0;i<links.length;i++){l=links[i];mat[l.source.index][l.target.index]=l.value?l.value:1}}else{mat=reorder.zeroes(n,n);for(i=0;i<links.length;i++){l=links[i];mat[l.source.index][l.target.index]=l.value?l.value:1;mat[l.target.index][l.source.index]=l.value?l.value:1}}return mat};function count_crossings(graph,north,south){var i,j,n,firstIndex,treeSize,tree,index,weightSum,invert=false,crosscount;var comp=reorder.permutation(graph.nodes().length);if(north===undefined){north=comp.filter((function(n){return graph.outDegree(n)!==0}));south=comp.filter((function(n){return graph.inDegree(n)!==0}))}if(north.length<south.length){var tmp=north;north=south;south=tmp;invert=true}var south_inv=inverse_permutation(south),southsequence=[];for(i=0;i<north.length;i++){if(invert){n=graph.inEdges(north[i]).map((function(e){return south_inv[e.target.index]}))}else{n=graph.outEdges(north[i]).map((function(e){return south_inv[e.source.index]}))}n.sort(reorder.cmp_number);southsequence=southsequence.concat(n)}firstIndex=1;while(firstIndex<south.length)firstIndex<<=1;treeSize=2*firstIndex-1;firstIndex-=1;tree=reorder.zeroes(treeSize);crosscount=0;for(i=0;i<southsequence.length;i++){index=southsequence[i]+firstIndex;tree[index]++;while(index>0){if(index%2)crosscount+=tree[index+1];index=index-1>>1;tree[index]++}}return crosscount}reorder.count_crossings=count_crossings;function count_in_crossings(graph,v,w,inv){var v_edges=graph.inEdges(v),w_edges=graph.inEdges(w),iv,iw,p0,cross=0;for(iw=0;iw<w_edges.length;iw++){p0=inv[w_edges[iw].target.index];for(iv=0;iv<v_edges.length;iv++){if(inv[v_edges[iv].target.index]>p0)cross++}}return cross}function count_out_crossings(graph,v,w,inv){var v_edges=graph.outEdges(v),w_edges=graph.outEdges(w),iv,iw,p0,cross=0;for(iw=0;iw<w_edges.length;iw++){p0=inv[w_edges[iw].source.index];for(iv=0;iv<v_edges.length;iv++){if(inv[v_edges[iv].source.index]>p0)cross++}}return cross}function adjacent_exchange(graph,layer1,layer2){layer1=layer1.slice();layer2=layer2.slice();var i,v,w,c0,c1,inv_layer1=inverse_permutation(layer1),inv_layer2=inverse_permutation(layer2),swapped=true,improved=0;while(swapped){swapped=false;for(i=0;i<layer1.length-1;i++){v=layer1[i];w=layer1[i+1];c0=count_out_crossings(graph,v,w,inv_layer2);c1=count_out_crossings(graph,w,v,inv_layer2);if(c0>c1){layer1[i]=w;layer1[i+1]=v;inv_layer1[w]=i;inv_layer1[v]=i+1;swapped=true;improved+=c0-c1}}for(i=0;i<layer2.length-1;i++){v=layer2[i];w=layer2[i+1];c0=count_in_crossings(graph,v,w,inv_layer1);c1=count_in_crossings(graph,w,v,inv_layer1);if(c0>c1){layer2[i]=w;layer2[i+1]=v;inv_layer2[w]=i;inv_layer2[v]=i+1;swapped=true;improved+=c0-c1}}}return[layer1,layer2,improved]}reorder.adjacent_exchange=adjacent_exchange;reorder.barycenter_order=function(graph,comps,max_iter){var orders=[[],[],0];if(!comps){comps=graph.components()}for(var i=0;i<comps.length;i++){var o=reorder.barycenter(graph,comps[i],max_iter);orders=[orders[0].concat(o[0]),orders[1].concat(o[1]),orders[2]+o[2]]}return orders};function median(neighbors){if(neighbors.length===0)return-1;if(neighbors.length===1)return neighbors[0];if(neighbors.length===2)return(neighbors[0]+neighbors[1])/2;neighbors.sort(reorder.cmp_number);if(neighbors.length%2)return neighbors[(neighbors.length-1)/2];var rm=neighbors.length/2,lm=rm-1,rspan=neighbors[neighbors.length-1]-neighbors[rm],lspan=neighbors[lm]-neighbors[0];if(lspan==rspan)return(neighbors[lm]+neighbors[rm])/2;else return(neighbors[lm]*rspan+neighbors[rm]*lspan)/(lspan+rspan)}reorder.barycenter=function(graph,comp,max_iter){var nodes=graph.nodes(),layer1,layer2,crossings,iter,best_layer1,best_layer2,best_crossings,best_iter,layer,inv_layer={},i,v,neighbors,med;layer1=comp.filter((function(n){return graph.outDegree(n)!==0}));layer2=comp.filter((function(n){return graph.inDegree(n)!==0}));if(comp.length<3){return[layer1,layer2,count_crossings(graph,layer1,layer2)]}if(!max_iter)max_iter=24;else if(max_iter%2==1)max_iter++;inv_layer=inverse_permutation(layer2);best_crossings=count_crossings(graph,layer1,layer2);best_layer1=layer1.slice();best_layer2=layer2.slice();best_iter=0;var inv_neighbor=function(e){var n=e.source==v?e.target:e.source;return inv_layer[n.index]},barycenter_sort=function(a,b){var d=med[a]-med[b];if(d===0){d=graph.edges(b).length%2-graph.edges(a).length%2}if(d<0)return-1;else if(d>0)return 1;return 0};for(layer=layer1,iter=0;iter<max_iter;iter++,layer=layer==layer1?layer2:layer1){med={};for(i=0;i<layer.length;i++){v=nodes[layer[i]];if(layer==layer1)neighbors=graph.outEdges(v.index);else neighbors=graph.inEdges(v.index);neighbors=neighbors.map(inv_neighbor);med[v.index]=+median(neighbors)}layer.sort(barycenter_sort);for(i=0;i<layer.length;i++)inv_layer=inverse_permutation(layer);crossings=count_crossings(graph,layer1,layer2);if(crossings<best_crossings){best_crossings=crossings;best_layer1=layer1.slice();best_layer2=layer2.slice();best_iter=iter;max_iter=Math.max(max_iter,iter+2)}}if(reorder.debug){console.log("Best iter: "+best_iter)}return[best_layer1,best_layer2,best_crossings]};reorder.all_pairs_distance=function(graph,comps){var distances=[];if(!comps)comps=graph.components();for(var i=0;i<comps.length;i++)distances.push(all_pairs_distance_floyd_warshall(graph,comps[i]));return distances};function all_pairs_distance_floyd_warshall(graph,comp){var dist=reorder.infinities(comp.length,comp.length),i,j,k,inv;inv=inverse_permutation(comp);for(i=0;i<comp.length;i++)dist[i][i]=0;var build_dist=function(e){if(e.source==e.target)return;if(!(e.source.index in inv)||!(e.target.index in inv))return;var u=inv[e.source.index],v=inv[e.target.index];dist[v][u]=dist[u][v]=graph.distance(e.index)};for(i=0;i<comp.length;i++){graph.edges(comp[i]).forEach(build_dist)}for(k=0;k<comp.length;k++){for(i=0;i<comp.length;i++)if(dist[i][k]!=Infinity){for(j=0;j<comp.length;j++)if(dist[k][j]!=Infinity&&dist[i][j]>dist[i][k]+dist[k][j]){dist[i][j]=dist[i][k]+dist[k][j];dist[j][i]=dist[i][j]}}}return dist}reorder.all_pairs_distance_floyd_warshall=all_pairs_distance_floyd_warshall;function floyd_warshall_with_path(graph,comp){if(!comp)comp=graph.components()[0];var dist=reorder.infinities(comp.length,comp.length),next=Array(comp.length),directed=graph.directed(),i,j,k,inv;inv=inverse_permutation(comp);for(i=0;i<comp.length;i++){dist[i][i]=0;next[i]=Array(comp.length)}var build_dist=function(e){if(e.source==e.target)return;var u=inv[e.source.index],v=inv[e.target.index];dist[u][v]=graph.distance(e);next[u][v]=v;if(!directed){dist[v][u]=graph.distance(e);next[v][u]=u}};for(i=0;i<comp.length;i++){graph.edges(comp[i]).forEach(build_dist)}for(k=0;k<comp.length;k++){for(i=0;i<comp.length;i++){for(j=0;j<comp.length;j++){if(dist[i][j]>dist[i][k]+dist[k][j]){dist[i][j]=dist[i][k]+dist[k][j];next[i][j]=next[i][k];if(!directed){dist[j][i]=dist[i][j];next[j][i]=next[k][j]}}}}}return[dist,next]}reorder.floyd_warshall_with_path=floyd_warshall_with_path;function floyd_warshall_path(next,u,v){if(next[u][v]===undefined)return[];var path=[u];while(u!=v){u=next[u][v];path.push(u)}return path}reorder.floyd_warshall_path=floyd_warshall_path;function distmat2valuemat(distmat){var n=distmat.length,valuemat=reorder.zeroes(n,n),max_dist=reorder.distmax(distmat),i,j;for(i=0;i<n;i++){for(j=i;j<n;j++){valuemat[j][i]=valuemat[i][j]=1+max_dist-distmat[i][j]}}return valuemat}reorder.distmat2valuemat=distmat2valuemat;reorder.graph2valuemats=function(graph,comps){if(!comps)comps=graph.components();var dists=reorder.all_pairs_distance(graph,comps);return dists.map(distmat2valuemat)};reorder.valuemats_reorder=function(valuemats,leaforder,comps){var orders=valuemats.map(leaforder);if(comps){orders=orders.map((function(d,i){return reorder.permute(comps[i],d)}))}return orders.reduce(reorder.flatten)};reorder.dist=function(){var distance=reorder.distance.euclidean;function dist(vectors){var n=vectors.length,distMatrix=[];for(var i=0;i<n;i++){var d=[];distMatrix[i]=d;for(var j=0;j<n;j++){if(j<i){d.push(distMatrix[j][i])}else if(i===j){d.push(0)}else{d.push(distance(vectors[i],vectors[j]))}}}return distMatrix}dist.distance=function(x){if(!arguments.length)return distance;distance=x;return dist};return dist};reorder.distmax=function(distMatrix){var max=0,n=distMatrix.length,i,j,row;for(i=0;i<n;i++){row=distMatrix[i];for(j=i+1;j<n;j++)if(row[j]>max)max=row[j]}return max};reorder.distmin=function(distMatrix){var min=Infinity,n=distMatrix.length,i,j,row;for(i=0;i<n;i++){row=distMatrix[i];for(j=i+1;j<n;j++)if(row[j]<min)min=row[j]}return min};reorder.dist_remove=function(dist,n,m){if(arguments.length<3)m=n+1;var i;dist.splice(n,m-n);for(i=dist.length;i-- >0;)dist[i].splice(n,m-n);return dist};reorder.randomPermute=function(array,i,j){if(arguments.length<3){j=array.length;if(arguments.length<2){i=0}}var m=j-i,t,k;while(m>0){k=i+Math.floor(Math.random()*m--);t=array[i+m];array[i+m]=array[k];array[k]=t}return array};reorder.randomPermutation=function(n){return reorder.randomPermute(reorder.permutation(n))};reorder.random_array=function(n,min,max){var ret=Array(n);if(arguments.length==1){while(n)ret[--n]=Math.random()}else if(arguments.length==2){while(n)ret[--n]=Math.random()*min}else{while(n)ret[--n]=min+Math.random()*(max-min)}return ret};reorder.random_matrix=function(p,n,m,sym){if(!m)m=n;if(n!=m)sym=false;else if(!sym)sym=true;var mat=reorder.zeroes(n,m),i,j,cnt;if(sym){for(i=0;i<n;i++){cnt=0;for(j=0;j<i+1;j++){if(Math.random()<p){mat[i][j]=mat[j][i]=1;cnt++}}if(cnt===0){j=Math.floor(Math.random()*n/2);mat[i][j]=mat[j][i]=1}}}else{for(i=0;i<n;i++){cnt=0;for(j=0;j<m;j++){if(Math.random()<p){mat[i][j]=1;cnt++}}if(cnt===0)mat[i][Math.floor(Math.random()*m)]=1}}return mat};function permute_copy(list,perm){var m=perm.length;var copy=list.slice();while(m--)copy[m]=list[perm[m]];return copy}reorder.permute=permute_copy;function permute_inplace(list,perm){var i,j,v,tmp;for(i=0;i<list.length;i++){j=perm[i];if(j<0){perm[i]=-1-j;continue}v=i;while(j!=i){tmp=list[j];list[j]=list[v];list[v]=tmp;v=j;tmp=perm[j];perm[j]=-1-tmp;j=tmp}}return list}reorder.permute_inplace=permute_inplace;reorder.permutetranspose=function(array,indexes){var m=array.length;while(m-- >0)array[m]=reorder.permute(array[m],indexes);return array};reorder.stablepermute=function(list,indexes){var p=reorder.permute(list,indexes);if(p[0]>p[p.length-1]){p.reverse()}return p};reorder.sort_order=function(v){return reorder.permutation(0,v.length).sort((function(a,b){return v[a]-v[b]}))};reorder.sort_order_ascending=reorder.sort_order;reorder.sort_order_descending=function(v){return reorder.permutation(0,v.length).sort((function(a,b){return v[b]-v[a]}))};if(typeof science=="undefined"){science={version:"1.9.1"};science.stats={}}science.stats.hcluster=function(){var distance=reorder.distance.euclidean,linkage="single",distMatrix=null;function hcluster(vectors){var n=vectors.length,dMin=[],cSize=[],clusters=[],c1,c2,c1Cluster,c2Cluster,p,root,i,j,id=0;if(distMatrix===null){distMatrix=[];i=-1;while(++i<n){dMin[i]=0;distMatrix[i]=[];j=-1;while(++j<n){distMatrix[i][j]=i===j?Infinity:distance(vectors[i],vectors[j]);if(distMatrix[i][dMin[i]]>distMatrix[i][j])dMin[i]=j}}}else{if(distMatrix.length<n||distMatrix[0].length<n)throw{error:"Provided distance matrix length "+distMatrix.length+" instead of "+n};i=-1;while(++i<n){dMin[i]=0;j=-1;while(++j<n){if(i===j)distMatrix[i][j]=Infinity;if(distMatrix[i][dMin[i]]>distMatrix[i][j])dMin[i]=j}}}i=-1;while(++i<n){if(i!=id)console.log("i = %d, id = %d",i,id);clusters[i]=[];clusters[i][0]={left:null,right:null,dist:0,centroid:vectors[i],id:id++,size:1,depth:0};cSize[i]=1}for(p=0;p<n-1;p++){c1=0;for(i=0;i<n;i++){if(distMatrix[i][dMin[i]]<distMatrix[c1][dMin[c1]])c1=i}c2=dMin[c1];c1Cluster=clusters[c1][0];c2Cluster=clusters[c2][0];var newCluster={left:c1Cluster,right:c2Cluster,dist:distMatrix[c1][c2],centroid:calculateCentroid(c1Cluster.size,c1Cluster.centroid,c2Cluster.size,c2Cluster.centroid),id:id++,size:c1Cluster.size+c2Cluster.size,depth:1+Math.max(c1Cluster.depth,c2Cluster.depth)};clusters[c1].splice(0,0,newCluster);cSize[c1]+=cSize[c2];for(j=0;j<n;j++){switch(linkage){case"single":if(distMatrix[c1][j]>distMatrix[c2][j])distMatrix[j][c1]=distMatrix[c1][j]=distMatrix[c2][j];break;case"complete":if(distMatrix[c1][j]<distMatrix[c2][j])distMatrix[j][c1]=distMatrix[c1][j]=distMatrix[c2][j];break;case"average":distMatrix[j][c1]=distMatrix[c1][j]=(cSize[c1]*distMatrix[c1][j]+cSize[c2]*distMatrix[c2][j])/(cSize[c1]+cSize[j]);break}}distMatrix[c1][c1]=Infinity;for(i=0;i<n;i++)distMatrix[i][c2]=distMatrix[c2][i]=Infinity;for(j=0;j<n;j++){if(dMin[j]==c2)dMin[j]=c1;if(distMatrix[c1][j]<distMatrix[c1][dMin[c1]])dMin[c1]=j}root=newCluster}return root}hcluster.linkage=function(x){if(!arguments.length)return linkage;linkage=x;return hcluster};hcluster.distance=function(x){if(!arguments.length)return distance;distance=x;return hcluster};hcluster.distanceMatrix=function(x){if(!arguments.length)return distMatrix;distMatrix=x.map((function(y){return y.slice(0)}));return hcluster};return hcluster};function calculateCentroid(c1Size,c1Centroid,c2Size,c2Centroid){var newCentroid=[],newSize=c1Size+c2Size,n=c1Centroid.length,i=-1;while(++i<n){newCentroid[i]=(c1Size*c1Centroid[i]+c2Size*c2Centroid[i])/newSize}return newCentroid}reorder.optimal_leaf_order=function(){var distanceMatrix=null,distance=reorder.distance.euclidean,linkage="complete",leavesMap={},orderMap={};function isLeaf(n){return n.depth===0}function leaves(n){if(n===null)return[];if(n.id in leavesMap)return leavesMap[n.id];return leavesMap[n.id]=_leaves(n)}function _leaves(n){if(n===null)return[];if(n.depth===0)return[n.id];return leaves(n.left).concat(leaves(n.right))}function order(v,i,j){var key="k"+v.id+"-"+i+"-"+j;if(key in orderMap)return orderMap[key];return orderMap[key]=_order(v,i,j)}function _order(v,i,j){if(v.depth===0)return[0,[v.id]];var l=v.left,r=v.right;var L=leaves(l),R=leaves(r);var w,x;if(L.indexOf(i)!==-1&&R.indexOf(j)!==-1){w=l;x=r}else if(R.indexOf(i)!==-1&&L.indexOf(j)!==-1){w=r;x=l}else throw{error:"Node is not common ancestor of "+i+", "+j};var Wl=leaves(w.left),Wr=leaves(w.right);var Ks=Wr.indexOf(i)!=-1?Wl:Wr;if(Ks.length===0)Ks=[i];var Xl=leaves(x.left),Xr=leaves(x.right);var Ls=Xr.indexOf(j)!=-1?Xl:Xr;if(Ls.length===0)Ls=[j];var min=Infinity,optimal_order=[];for(var k=0;k<Ks.length;k++){var w_min=order(w,i,Ks[k]);for(var m=0;m<Ls.length;m++){var x_min=order(x,Ls[m],j);var dist=w_min[0]+distanceMatrix[Ks[k]][Ls[m]]+x_min[0];if(dist<min){min=dist;optimal_order=w_min[1].concat(x_min[1])}}}return[min,optimal_order]}function orderFull(v){leavesMap={};orderMap={};var min=Infinity,optimal_order=[],left=leaves(v.left),right=leaves(v.right);if(reorder.debug)console.log(reorder.printhcluster(v,0));for(var i=0;i<left.length;i++){for(var j=0;j<right.length;j++){var so=order(v,left[i],right[j]);if(so[0]<min){min=so[0];optimal_order=so[1]}}}distanceMatrix=null;return optimal_order}function optimal_leaf_order(matrix){if(distanceMatrix===null)distanceMatrix=reorder.dist().distance(distance)(matrix);var hcluster=science.stats.hcluster().linkage(linkage).distanceMatrix(distanceMatrix);return orderFull(hcluster(matrix))}optimal_leaf_order.order=orderFull;optimal_leaf_order.reorder=optimal_leaf_order;optimal_leaf_order.distance=function(x){if(!arguments.length)return distance;distance=x;distanceMatrix=null;return optimal_leaf_order};optimal_leaf_order.linkage=function(x){if(!arguments.length)return linkage;linkage=x;return optimal_leaf_order};optimal_leaf_order.distance_matrix=function(x){if(!arguments.length)return distanceMatrix;distanceMatrix=x.map((function(y){return y.slice(0)}));return optimal_leaf_order};optimal_leaf_order.distanceMatrix=optimal_leaf_order.distance_matrix;return optimal_leaf_order};reorder.order=function(){var distance=reorder.distance.euclidean,ordering=reorder.optimal_leaf_order,linkage="complete",distanceMatrix=null,vector,except=[],debug=0,i=0,j=Infinity;function _reset(){distance=reorder.distance.euclidean;ordering=reorder.optimal_leaf_order;linkage="complete";distanceMatrix=null;vector=null;except=[];i=0;j=Infinity}function order(v){vector=v;j=Math.min(j,v.length);var i0=i>0?i-1:0,j0=j<vector.length?j+1:j,k,low,high;for(k=except.length-1;k>0;k-=2){low=except[k-1];high=except[k];if(high>=j0){if(j0>j){j0=Math.min(j0,low+1);except.splice(k-1,2)}else{high=j0}}else if(low<=i0){if(i0<i){i0=Math.max(i0,high-1);except.splice(k-1,2)}else{low=i0}}else if(high-low<3)except.splice(k-1,2)}try{return _order_limits(i0,j0)}finally{_reset()}}function _order_limits(i0,j0){var orig=vector,perm,row,k,l;vector=vector.slice(i0,j0);if(i===0&&j==vector.length)return _order_except();if(reorder.debug)console.log("i0="+i0+" j0="+j0);if(distanceMatrix!==null){if(j0!==vector.length)reorder.dist_remove(distanceMatrix,j0,vector.length);if(i0>0)reorder.dist_remove(distanceMatrix,0,i0)}else{_compute_dist()}var max=reorder.distmax(distanceMatrix);if(i0<i){row=distanceMatrix[0];for(k=row.length;k-- >1;)row[k]+=max;for(k=distanceMatrix.length;k-- >1;)distanceMatrix[k][0]+=max;max+=max;if(i0!==0){for(k=0;k<except.length;k++)except[k]-=i0}}if(j0>j){l=distanceMatrix.length-1;row=distanceMatrix[l];for(k=l;k-- >0;){row[k]+=max;distanceMatrix[k][l]+=max}}perm=_order_except();if(i0<i){if(perm[0]!==0)perm.reverse();if(j0>j){reorder.assert(perm[0]===0&&perm[perm.length-1]==perm.length-1,"Invalid constrained permutation endpoints")}else{reorder.assert(perm[0]===0,"Invalid constrained permutation start")}}else if(j0>j){if(perm[perm.length-1]!==perm.length-1)perm=perm.reverse();reorder.assert(perm[perm.length-1]==perm.length-1,"Invalid constrained permutation end")}if(i0!==0){perm=reorder.permutation(i0).concat(perm.map((function(v){return v+i0})))}if(orig.length>j0){perm=perm.concat(reorder.range(j0,orig.length))}return perm}function _order_except(){var perm,k,l,low,high,pos;if(except.length===0)return _order_equiv();_compute_dist();for(k=except.length-1;k>0;k-=2){low=except[k-1];high=except[k];distanceMatrix=reorder.dist_remove(distanceMatrix,low+1,high-1);vector.splice(low+1,high-low-2);if(reorder.debug)console.log("Except["+low+", "+high+"]");if(distanceMatrix[low][low+1]!==0){distanceMatrix[low][low+1]=distanceMatrix[low+1][low]=-1}}perm=_order_equiv();for(k=0;k<except.length;k+=2){low=except[k];high=except[k+1];for(l=0;l<perm.length;l++){if(perm[l]>low)perm[l]+=high-low-2;else if(perm[l]==low)pos=l}if(pos>0&&perm[pos-1]==high-1){Array.prototype.splice.apply(perm,[pos,0].concat(reorder.range(high-2,low,-1)))}else if(perm[pos+1]==high-1){Array.prototype.splice.apply(perm,[pos+1,0].concat(reorder.range(low+1,high-1)))}else{throw"Range not respected"}}return perm}function _order_equiv(){var perm,row,e,j,k,l,m,n,has_1=false,equiv=[],fix_except={};_compute_dist();for(k=0;k<distanceMatrix.length-1;k++){row=distanceMatrix[k];e=[];j=row.indexOf(-1);if(j!==-1){fix_except[k]=[k,j];has_1=true}for(l=row.length;--l>k;){if(row[l]===0){j=distanceMatrix[l].indexOf(-1);if(j!==-1){fix_except[k]=[l,j];distanceMatrix[j][k]=row[j]=-1;has_1=true}e.unshift(l);distanceMatrix=reorder.dist_remove(distanceMatrix,l);vector.splice(l,1)}else if(row[l]<0)has_1=true}if(e.length!==0){e.unshift(k);equiv.push(e)}}if(has_1){for(k=0;k<distanceMatrix.length-1;k++){row=distanceMatrix[k];for(l=k+1;l<row.length-1;l++){if(distanceMatrix[l][l+1]==-1){distanceMatrix[l+1][l]=distanceMatrix[l][l+1]=0}}}}perm=_order();for(k=equiv.length;k-- >0;){e=equiv[k];l=perm.indexOf(e[0]);m=fix_except[e[0]];if(m&&m[0]==e[0]){l=_fix_exception(perm,l,m[0],m[1],0);m=undefined}for(n=1;n<e.length;n++){perm=_perm_insert(perm,l,e[n]);if(m&&m[0]==e[n]){l=_fix_exception(perm,l,m[0],m[1],n);m=undefined}}}return perm}function _fix_exception(perm,l,m,next,len){var i,j,k;if(l>0&&perm[l-1]==next){_swap(perm,l,perm.indexOf(m));return l+1}else if(perm[l+len+1]==next){_swap(perm,l+len,perm.indexOf(m));return l}else throw"Index not found"}function _swap(perm,a,b){if(a==b)return;var c=perm[a];perm[a]=perm[b];perm[b]=c}function _order(){if(reorder.debug>1)reorder.printmat(distanceMatrix);if(reorder.debug>2)reorder.printmat(vector);var perm=ordering().linkage(linkage).distanceMatrix(distanceMatrix)(vector);if(reorder.debug)console.log("Permutation: "+perm);return perm}function _perm_insert(perm,i,nv){perm=perm.map((function(v){return v<nv?v:v+1}));perm.splice(i,0,nv);return perm}function _compute_dist(){if(distanceMatrix===null)distanceMatrix=reorder.dist().distance(distance)(vector);return distanceMatrix}order.distance=function(x){if(!arguments.length)return distance;distance=x;return order};order.linkage=function(x){if(!arguments.length)return linkage;linkage=x;return order};order.limits=function(x,y){if(!arguments.length)return[i,j];i=x;j=y;return order};order.except=function(list){if(!arguments.length)return except.slice(0);except=list.sort((function(a,b){if(a>=b)throw"Invalid list, indices not sorted";return a-b}));return order};function _orderExcept(vector,i,j){var distanceMatrix=reorder.dist().distance(distance)(vector);var row,k,l,rev=false,args,pos=-1;distanceMatrix[i][i+1]=0;distanceMatrix[i+1][i]=0;var perm=ordering().distanceMatrix(distanceMatrix)(vector);pos=perm.indexOf(i);for(k=0;k<perm.length;k++){l=perm[k];if(l>i)perm[k]+=j-i-2}if(pos!==0&&perm[pos-1]===j-1)rev=true;if(rev){perm.reverse();pos=perm.length-pos-1}args=[pos+1,0].concat(reorder.range(i+1,j-1));Array.prototype.splice.apply(perm,args);return perm}order.orderrowsexcept=order.orderexcept;return order};reorder.covariance=reorder.dot;reorder.covariancetranspose=function(v,a,b){var n=v.length,cov=0,i;for(i=0;i<n;i++){cov+=v[i][a]*v[i][b]}return cov};reorder.variancecovariance=function(v){var o=v[0].length,cov=Array(o),i,j;for(i=0;i<o;i++){cov[i]=Array(o)}for(i=0;i<o;i++){for(j=i;j<o;j++)cov[i][j]=cov[j][i]=reorder.covariancetranspose(v,i,j)}return cov};reorder.laplacian=function(graph,comp){var n=comp.length,lap=reorder.zeroes(n,n),inv=inverse_permutation(comp),i,j,k,row,sum,edges,v,e,other;reorder.assert(!graph.directed(),"Laplacian only for undirected graphs");for(i=0;i<n;i++){v=comp[i];row=lap[i];sum=0;edges=graph.edges(v);for(j=0;j<edges.length;j++){e=edges[j];other=inv[graph.other(e,v).index];if(other!=i){sum+=e.value;row[other]=-e.value}}row[i]=sum}return lap};function normalize(v){var norm=reorder.length(v),i=v.length;if(norm===0||Math.abs(norm-1)<1e-9)return 1;while(i-- >0)v[i]/=norm;return norm}reorder.poweriteration=function(v,eps,init){if(!eps)eps=1e-9;var n=v.length,b,i,j,tmp=Array(n),norm,s=100,e;reorder.assert(n==v[0].length,"poweriteration needs a square matrix");if(!init){b=reorder.random_array(n)}else b=init.slice();normalize(b);while(s-- >0){for(i=0;i<n;i++){tmp[i]=0;for(j=0;j<n;j++)tmp[i]+=v[i][j]*b[j]}normalize(tmp);if(reorder.dot(tmp,b)>1-eps)break;var t=tmp;tmp=b;b=t}return tmp};reorder.poweriteration_n=function(v,p,init,eps,start){if(!eps)eps=1e-9;var n=v.length,b=Array(p),i,j,k,l,bk,dot,row,tmp=Array(n),s=100,eigenvalue=Array(p);reorder.assert(n==v[0].length,"poweriteration needs a square matrix");if(!init){for(i=0;i<p;i++){row=b[i]=reorder.random_array(n);eigenvalue[i]=normalize(row)}}else{for(i=0;i<p;i++){b[i]=init[i].slice();eigenvalue[i]=normalize(b[i])}}if(!start)start=0;for(k=start;k<p;k++){bk=b[k];while(s-- >0){for(l=0;l<k;l++){row=b[l];dot=reorder.dot(bk,row);for(i=0;i<n;i++)bk[i]-=dot*row[i]}for(i=0;i<n;i++){tmp[i]=0;for(j=0;j<n;j++)tmp[i]+=v[i][j]*bk[j]}eigenvalue[k]=normalize(tmp);if(reorder.dot(tmp,bk)>1-eps)break;bk=tmp;tmp=b[k];b[k]=bk}if(reorder.debug)console.log("eig[%d]=%j",k,bk)}return[b,eigenvalue]};function gershgorin_bound(B){var i,j,max=0,n=B.length,t,row;for(i=0;i<n;i++){row=B[i];t=row[i];for(j=0;j<n;j++)if(j!=i)t+=Math.abs(row[j]);if(t>max)max=t}if(reorder.debug){console.log("gershgorin_bound=%d",max)}return max}function fiedler_vector(B,eps){var g=gershgorin_bound(B),n=B.length,Bhat=B.map((function(row){return row.slice()})),i,j,row;for(i=0;i<n;i++){row=Bhat[i];for(j=0;j<n;j++){if(i==j)row[j]=g-row[j];else row[j]=-row[j]}}var init=[reorder.array1d(n,1),reorder.random_array(n)],eig=reorder.poweriteration_n(Bhat,2,init,eps,1);return eig[0][1]}reorder.fiedler_vector=fiedler_vector;function spectral_order(graph,comps){var i,vec,comp,perm,order=[];if(!comps)comps=graph.components();for(i=0;i<comps.length;i++){comp=comps[i];vec=reorder.fiedler_vector(reorder.laplacian(graph,comp));perm=reorder.sort_order(vec);order=order.concat(reorder.permute(comp,perm))}return order}reorder.spectral_order=spectral_order;function center(v){var n=v.length;if(n===0)return null;var mean=reorder.meancolumns(v),o=mean.length,v1=Array(n),i,j,row;for(i=0;i<n;i++){row=v[i].slice(0);for(j=0;j<o;j++){row[j]-=mean[j]}v1[i]=row}return v1}reorder.pca1d=function(v,eps){var n=v.length;if(v.length===0)return null;v=center(v);var cov=reorder.variancecovariance(v);return reorder.poweriteration(cov,eps)};reorder.pca_order=function(v,eps){return reorder.sort_order(reorder.pca1d(v,eps))};function sumrows(v){var n=v.length,o=v[0].length,sumrow=Array(n),i,j,row,s;for(i=0;i<n;i++){row=v[i];s=0;for(j=0;j<o;j++)s+=row[j];sumrow[i]=s}return sumrow}function sumcols(v){var n=v.length,o=v[0].length,sumcol=reorder.zeroes(o),i,j,row;for(i=0;i<n;i++){row=v[i];for(j=0;j<o;j++)sumcol[j]+=row[j]}return sumcol}function decorana(dat){var ZEROEIG=1e-7,x,y,aidot,adotj,mi,n,s1,nr=dat.length,nc=dat[0].length;adotj=sumcols(dat);aidot=sumrows(dat);s1=eigy(reorder.array1d(nr,1),reorder.array1d(nc,1),nr,nc,dat,aidot,adotj);if(s1.eig<ZEROEIG){s1.rows=s1.cols=[];s1.eig=0}else{x=s1.rows;y=s1.cols;yxmult(y,x,nr,nc,dat);for(var i=0;i<nr;i++)x[i]/=aidot[i]}return s1}function trans(y,yy,x,aidot,mi,n,dat,prt){var i,j,a1;if(prt)console.log("TRANS "+prt);yxmult(y,x,mi,n,dat,prt);for(i=0;i<mi;i++){x[i]=x[i]/aidot[i]}xymult(x,yy,mi,n,dat,prt)}function printvec(y){console.log("");for(var i=0;i<y.length;i++){console.log("i:"+(i+1)+" v:  "+y[i].toFixed(5))}}function xymult(x,y,mi,n,dat,prt){var i,j,ax,row;if(prt){console.log("xymult");printvec(y,5,null,"y=")}for(j=0;j<n;j++)y[j]=0;for(i=0;i<mi;i++){ax=x[i];row=dat[i];for(j=0;j<n;j++)y[j]+=ax*row[j]}if(prt){printvec(y,5,null,"y=")}}function yxmult(y,x,mi,n,dat,prt){var i,j,ax,row;if(prt){console.log("yxmult");printvec(x,5,null,"x=")}for(i=0;i<mi;i++){ax=0;row=dat[i];for(j=0;j<n;j++){ax+=y[j]*row[j]}x[i]=ax}if(prt){printvec(x,5,null,"x=")}}function eigy(x,y,mi,n,dat,aidot,adotj){var i,j,tot,icount,a,ay,ex,a11,a12,a22,a23,a33,a34,a44,res,ax1,ax2,ax3,ax4,b13,b14,b24,row,y2=reorder.zeroes(n),y3=reorder.zeroes(n),y4=reorder.zeroes(n),y5=reorder.zeroes(n),tol;tot=0;for(j=0;j<n;j++){tot+=adotj[j];y[j]=j+1}y[0]=1.1;tol=5e-6;trans(y,y,x,aidot,mi,n,dat);icount=0;while(true){a=0;for(j=0;j<n;j++)a+=y[j]*adotj[j];a/=tot;ex=0;for(j=0;j<n;j++){ay=y[j]-a;ex+=ay*ay*adotj[j];y[j]=ay}ex=Math.sqrt(ex);for(j=0;j<n;j++)y[j]/=ex;trans(y,y2,x,aidot,mi,n,dat);a=0;a11=0;a12=0;a22=0;a23=0;a33=0;a34=0;a44=0;for(j=0;j<n;j++){ay=y2[j];y2[j]=ay/adotj[j];a+=ay;a11+=ay*y[j]}a/=tot;for(j=0;j<n;j++){ay=y2[j]-(a+a11*y[j]);a12+=ay*ay*adotj[j];y2[j]=ay}a12=Math.sqrt(a12);for(j=0;j<n;j++)y2[j]/=a12;if(a12<tol||icount>999)break;icount++;trans(y2,y3,x,aidot,mi,n,dat);a=0;b13=0;for(j=0;j<n;j++){ay=y3[j];y3[j]=ay/adotj[j];a+=ay;a22+=ay*y2[j];b13+=ay*y[j]}a/=tot;for(j=0;j<n;j++){ay=y3[j]-(a+a22*y2[j]+b13*y[j]);a23+=ay*ay*adotj[j];y3[j]=ay}a23=Math.sqrt(a23);if(a23>tol){for(j=0;j<n;j++){y3[j]/=a23}trans(y3,y4,x,aidot,mi,n,dat);a=0;b14=0;b24=0;for(j=0;j<n;j++){ay=y4[j];y4[j]/=adotj[j];a+=ay;a33+=ay*y3[j];b14+=ay*y[j];b24+=ay*y2[j]}a/=tot;for(j=0;j<n;j++){ay=y4[j]-(a+a33*y3[j]+b14*y[j]+b24*y2[j]);a34+=ay*ay*adotj[j];y4[j]=ay}a34=Math.sqrt(a34);if(a34>tol){for(j=0;j<n;j++)y4[j]/=a34;trans(y4,y5,x,aidot,mi,n,dat);for(j=0;j<n;j++)a44+=y4[j]*y5[j]}else{a34=0}}else{a23=0}res=solve_tridiag(tol,a11,a12,a22,a23,a33,a34,a44);ax1=res[0];ax2=res[1];ax3=res[2];ax4=res[3];if(a12<tol)break;for(j=0;j<n;j++)y[j]=ax1*y[j]+ax2*y2[j]+ax3*y3[j]+ax4*y4[j]}if(a12>tol&&reorder.debug>0){console.log("residual bigger than tolerance on axis 1")}var aymax=y[0],aymin=y[0],sign=1;for(j=1;j<n;j++){a=y[j];if(a<aymin)aymin=a;else if(a>aymax)aymax=a}if(-aymin>aymax){for(j=0;j<n;j++)y[j]=-y[j]}yxmult(y,x,mi,n,dat);for(i=0;i<mi;i++)x[i]/=aidot[i];var axlong=0;for(i=0;i<mi;i++)axlong+=aidot[i]*sqr(x[i]);axlong=Math.sqrt(axlong);for(i=0;i<mi;i++)x[i]/=axlong;for(j=0;j<n;j++)y[j]/=axlong;var sumsq=0,ax;for(i=0;i<mi;i++){ax=x[i];row=dat[i];for(j=0;j<n;j++){sumsq+=row[j]*sqr(ax-y[j])}}var sd=Math.sqrt(sumsq/tot);if(a11>=.999){sd=aymax/axlong;var sd1=-aymin/axlong;if(sd1>sd)sd=sd1}for(j=0;j<n;j++)y[j]/=sd;return{rows:x,cols:y,eig:a11}}function sqr(x){return x*x}function solve_tridiag(tol,a11,a12,a22,a23,a33,a34,a44){var ax1=1,ax2=.1,ax3=.01,ax4=.001,itimes,axx1,axx2,axx3,axx4,ex,exx,resi;for(itimes=0;itimes<100;itimes++){axx1=a11*ax1+a12*ax2;axx2=a12*ax1+a22*ax2+a23*ax3;axx3=a23*ax2+a33*ax3+a34*ax4;axx4=a34*ax3+a44*ax4;ax1=a11*axx1+a12*axx2;ax2=a12*axx1+a22*axx2+a23*axx3;ax3=a23*axx2+a33*axx3+a34*axx4;ax4=a34*axx3+a44*axx4;ex=Math.sqrt(sqr(ax1)+sqr(ax2)+sqr(ax3)+sqr(ax4));ax1=ax1/ex;ax2=ax2/ex;ax3=ax3/ex;ax4=ax4/ex;if((itimes+1)%5===0){exx=Math.sqrt(ex);resi=Math.sqrt(sqr(ax1-axx1/exx)+sqr(ax2-axx2/exx)+sqr(ax3-axx3/exx)+sqr(ax4-axx4/exx))}if(resi<tol*.05)break}return[ax1,ax2,ax3,ax4]}reorder.ca_decorana=decorana;reorder.ca=decorana;reorder.ca_order=function(dat){var res=reorder.ca(dat);return{rows:reorder.sort_order(res.rows),cols:reorder.sort_order(res.cols),details:res}};reorder.cuthill_mckee=function(graph,comp){if(comp.length<3)return comp;var nodes=graph.nodes(),start=comp[0],min_deg=graph.degree(start),i,n,edges,e,visited={},queue=new Queue,inv=inverse_permutation(comp),perm=[];for(i=0;i<comp.length;i++){n=comp[i];if(graph.degree(n)<min_deg){min_deg=graph.degree(n);start=n;if(min_deg==1)break}}queue.push(start);while(queue.length!==0){n=queue.shift();if(visited[n])continue;visited[n]=true;perm.push(n);e=graph.edges(n).map((function(edge){return graph.other(edge,n).index})).filter((function(n){return!visited[n]&&n in inv})).sort((function(a,b){return graph.degree(a)-graph.degree(b)}));e.forEach(queue.push,queue)}return perm};reorder.reverse_cuthill_mckee=function(graph,comp){return reorder.cuthill_mckee(graph,comp).reverse()};reorder.cuthill_mckee_order=function(graph,comps){var i,comp,order=[];if(!comps){comps=graph.components()}for(i=0;i<comps.length;i++){comp=comps[i];order=order.concat(reorder.cuthill_mckee(graph,comp))}return order};reorder.reverse_cuthill_mckee_order=function(graph,comps){var i,comp,order=[];if(!comps){comps=graph.components()}for(i=0;i<comps.length;i++){comp=comps[i];order=order.concat(reorder.reverse_cuthill_mckee(graph,comp))}return order};reorder.condition=function(matrix){var i,j,min,max,v,s,row,ret=[];for(i=0;0<matrix.length;i++){row=matrix[i].slice();row.push(ret);for(j=0;j<ret.length;j++){v=row[j];if(v!==null&&b>=b){min=max=row[j];break}}for(;j<ret.length;j++){v=row[j];if(v<min)min=v;else if(v>max)max=v}s=max!=min?1/(max-min):0;for(j=1;j<ret.length;j++){v=row[j];if(v!==null&&v>=v)row[j]=row[j]*s-min;else v=NaN}}return ret};function array_to_dicts(data,axes){if(arguments.length<2)axes=reorder.range(data[0].length);var ret=[],row,dict,i,j;for(i=0;i<data.length;i++){row=data[i];dict={};for(j=0;j<row.length;j++){dict[axes[j]]=row[j]}ret.push(dict)}return ret}reorder.array_to_dicts=array_to_dicts;function dicts_to_array(dicts,keys){if(arguments.length<2)keys=Object.keys(dicts[0]);var n=keys.length,m=dicts.length,array=Array(m),i,j,row;for(i=0;i<m;i++){row=Array(n);array[i]=row;for(j=0;j<n;j++)row[j]=dicts[i][keys[j]]}return array}reorder.dicts_to_array=dicts_to_array;function abs_matrix(x){return x.map((function(y){return y.map(Math.abs)}))}function pcp_flip_axes(perm,naxes,pcor){var i,c,sign=1,signs=[1],negs=0;for(i=1;i<perm.length;i++){c=pcor[perm[i-1]][perm[i]];if(c<0)sign=-sign;if(sign<0){signs.push(-1);negs++}else signs.push(1)}if(reorder.debug)console.log(signs);sign=negs>perm.length-negs?-1:1;if(sign==-1){for(i=0;i<perm.length-1;i++)signs[i]=signs[i]*sign}return signs}function pcp(data,axes){if(!axes)axes=reorder.range(data[0].length);var tdata=reorder.transpose(data),pcor=reorder.correlation.pearsonMatrix(tdata),abs_pcor=abs_matrix(pcor),h1=science.stats.hcluster().linkage("complete").distanceMatrix(abs_pcor)(tdata),perm=reorder.optimal_leaf_order().distanceMatrix(abs_pcor)(tdata),naxes=reorder.permute(axes,perm);tdata=reorder.permute(tdata,perm);var signs=pcp_flip_axes(perm,naxes,pcor),ndata=reorder.transpose(tdata);return[ndata,perm,naxes,signs,pcor]}reorder.pcp=pcp;function parcoords(p){p.detectDimensions().autoscale();var data=p.data(),types=p.types(),dimensions=p.dimensions(),tdata=[],row,discarded=[],i,j,k,d;for(i=0;i<dimensions.length;i++){d=dimensions[i];if(types[d]=="number"){row=[];for(j=0;j<data.length;j++)row.push(data[j][d]);tdata.push(row)}else if(types[d]=="date"){row=[];for(j=0;j<data.length;j++)row.push(data[j][d].getTime()*.001);tdata.push(row)}else{dimensions.splice(i,1);discarded.push(d);i--}}var pcor=reorder.correlation.pearsonMatrix(tdata),abs_pcor=abs_matrix(pcor),h1=science.stats.hcluster().linkage("complete").distanceMatrix(abs_pcor)(tdata),perm=reorder.optimal_leaf_order().distanceMatrix(abs_pcor)(tdata),naxes=reorder.permute(dimensions,perm);tdata=reorder.permute(tdata,perm);var signs=pcp_flip_axes(perm,naxes,pcor);for(i=0;i<signs.length;i++){if(signs[i]<0)p.flip(dimensions[i])}dimensions=discarded.reverse().concat(dimensions);return p.dimensions(dimensions)}reorder.parcoords=parcoords})(this);(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g=g.scale||(g.scale={});g=g.color||(g.color={});g.perceptual=f()}})((function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,(function(r){var n=e[i][1][r];return o(n||r)}),p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r}()({1:[function(require,module,exports){"use strict";module.exports={inferno:require("./inferno"),magma:require("./magma"),plasma:require("./plasma"),viridis:require("./viridis")}},{"./inferno":6,"./magma":7,"./plasma":8,"./viridis":12}],2:[function(require,module,exports){module.exports=["#000004","#010005","#010106","#010108","#02010a","#02020c","#02020e","#030210","#040312","#040314","#050417","#060419","#07051b","#08051d","#09061f","#0a0722","#0b0724","#0c0826","#0d0829","#0e092b","#10092d","#110a30","#120a32","#140b34","#150b37","#160b39","#180c3c","#190c3e","#1b0c41","#1c0c43","#1e0c45","#1f0c48","#210c4a","#230c4c","#240c4f","#260c51","#280b53","#290b55","#2b0b57","#2d0b59","#2f0a5b","#310a5c","#320a5e","#340a5f","#360961","#380962","#390963","#3b0964","#3d0965","#3e0966","#400a67","#420a68","#440a68","#450a69","#470b6a","#490b6a","#4a0c6b","#4c0c6b","#4d0d6c","#4f0d6c","#510e6c","#520e6d","#540f6d","#550f6d","#57106e","#59106e","#5a116e","#5c126e","#5d126e","#5f136e","#61136e","#62146e","#64156e","#65156e","#67166e","#69166e","#6a176e","#6c186e","#6d186e","#6f196e","#71196e","#721a6e","#741a6e","#751b6e","#771c6d","#781c6d","#7a1d6d","#7c1d6d","#7d1e6d","#7f1e6c","#801f6c","#82206c","#84206b","#85216b","#87216b","#88226a","#8a226a","#8c2369","#8d2369","#8f2469","#902568","#922568","#932667","#952667","#972766","#982766","#9a2865","#9b2964","#9d2964","#9f2a63","#a02a63","#a22b62","#a32c61","#a52c60","#a62d60","#a82e5f","#a92e5e","#ab2f5e","#ad305d","#ae305c","#b0315b","#b1325a","#b3325a","#b43359","#b63458","#b73557","#b93556","#ba3655","#bc3754","#bd3853","#bf3952","#c03a51","#c13a50","#c33b4f","#c43c4e","#c63d4d","#c73e4c","#c83f4b","#ca404a","#cb4149","#cc4248","#ce4347","#cf4446","#d04545","#d24644","#d34743","#d44842","#d54a41","#d74b3f","#d84c3e","#d94d3d","#da4e3c","#db503b","#dd513a","#de5238","#df5337","#e05536","#e15635","#e25734","#e35933","#e45a31","#e55c30","#e65d2f","#e75e2e","#e8602d","#e9612b","#ea632a","#eb6429","#eb6628","#ec6726","#ed6925","#ee6a24","#ef6c23","#ef6e21","#f06f20","#f1711f","#f1731d","#f2741c","#f3761b","#f37819","#f47918","#f57b17","#f57d15","#f67e14","#f68013","#f78212","#f78410","#f8850f","#f8870e","#f8890c","#f98b0b","#f98c0a","#f98e09","#fa9008","#fa9207","#fa9407","#fb9606","#fb9706","#fb9906","#fb9b06","#fb9d07","#fc9f07","#fca108","#fca309","#fca50a","#fca60c","#fca80d","#fcaa0f","#fcac11","#fcae12","#fcb014","#fcb216","#fcb418","#fbb61a","#fbb81d","#fbba1f","#fbbc21","#fbbe23","#fac026","#fac228","#fac42a","#fac62d","#f9c72f","#f9c932","#f9cb35","#f8cd37","#f8cf3a","#f7d13d","#f7d340","#f6d543","#f6d746","#f5d949","#f5db4c","#f4dd4f","#f4df53","#f4e156","#f3e35a","#f3e55d","#f2e661","#f2e865","#f2ea69","#f1ec6d","#f1ed71","#f1ef75","#f1f179","#f2f27d","#f2f482","#f3f586","#f3f68a","#f4f88e","#f5f992","#f6fa96","#f8fb9a","#f9fc9d","#fafda1","#fcffa4"]},{}],3:[function(require,module,exports){module.exports=["#000004","#010005","#010106","#010108","#020109","#02020b","#02020d","#03030f","#030312","#040414","#050416","#060518","#06051a","#07061c","#08071e","#090720","#0a0822","#0b0924","#0c0926","#0d0a29","#0e0b2b","#100b2d","#110c2f","#120d31","#130d34","#140e36","#150e38","#160f3b","#180f3d","#19103f","#1a1042","#1c1044","#1d1147","#1e1149","#20114b","#21114e","#221150","#241253","#251255","#271258","#29115a","#2a115c","#2c115f","#2d1161","#2f1163","#311165","#331067","#341069","#36106b","#38106c","#390f6e","#3b0f70","#3d0f71","#3f0f72","#400f74","#420f75","#440f76","#451077","#471078","#491078","#4a1079","#4c117a","#4e117b","#4f127b","#51127c","#52137c","#54137d","#56147d","#57157e","#59157e","#5a167e","#5c167f","#5d177f","#5f187f","#601880","#621980","#641a80","#651a80","#671b80","#681c81","#6a1c81","#6b1d81","#6d1d81","#6e1e81","#701f81","#721f81","#732081","#752181","#762181","#782281","#792282","#7b2382","#7c2382","#7e2482","#802582","#812581","#832681","#842681","#862781","#882781","#892881","#8b2981","#8c2981","#8e2a81","#902a81","#912b81","#932b80","#942c80","#962c80","#982d80","#992d80","#9b2e7f","#9c2e7f","#9e2f7f","#a02f7f","#a1307e","#a3307e","#a5317e","#a6317d","#a8327d","#aa337d","#ab337c","#ad347c","#ae347b","#b0357b","#b2357b","#b3367a","#b5367a","#b73779","#b83779","#ba3878","#bc3978","#bd3977","#bf3a77","#c03a76","#c23b75","#c43c75","#c53c74","#c73d73","#c83e73","#ca3e72","#cc3f71","#cd4071","#cf4070","#d0416f","#d2426f","#d3436e","#d5446d","#d6456c","#d8456c","#d9466b","#db476a","#dc4869","#de4968","#df4a68","#e04c67","#e24d66","#e34e65","#e44f64","#e55064","#e75263","#e85362","#e95462","#ea5661","#eb5760","#ec5860","#ed5a5f","#ee5b5e","#ef5d5e","#f05f5e","#f1605d","#f2625d","#f2645c","#f3655c","#f4675c","#f4695c","#f56b5c","#f66c5c","#f66e5c","#f7705c","#f7725c","#f8745c","#f8765c","#f9785d","#f9795d","#f97b5d","#fa7d5e","#fa7f5e","#fa815f","#fb835f","#fb8560","#fb8761","#fc8961","#fc8a62","#fc8c63","#fc8e64","#fc9065","#fd9266","#fd9467","#fd9668","#fd9869","#fd9a6a","#fd9b6b","#fe9d6c","#fe9f6d","#fea16e","#fea36f","#fea571","#fea772","#fea973","#feaa74","#feac76","#feae77","#feb078","#feb27a","#feb47b","#feb67c","#feb77e","#feb97f","#febb81","#febd82","#febf84","#fec185","#fec287","#fec488","#fec68a","#fec88c","#feca8d","#fecc8f","#fecd90","#fecf92","#fed194","#fed395","#fed597","#fed799","#fed89a","#fdda9c","#fddc9e","#fddea0","#fde0a1","#fde2a3","#fde3a5","#fde5a7","#fde7a9","#fde9aa","#fdebac","#fcecae","#fceeb0","#fcf0b2","#fcf2b4","#fcf4b6","#fcf6b8","#fcf7b9","#fcf9bb","#fcfbbd","#fcfdbf"]},{}],4:[function(require,module,exports){module.exports=["#0d0887","#100788","#130789","#16078a","#19068c","#1b068d","#1d068e","#20068f","#220690","#240691","#260591","#280592","#2a0593","#2c0594","#2e0595","#2f0596","#310597","#330597","#350498","#370499","#38049a","#3a049a","#3c049b","#3e049c","#3f049c","#41049d","#43039e","#44039e","#46039f","#48039f","#4903a0","#4b03a1","#4c02a1","#4e02a2","#5002a2","#5102a3","#5302a3","#5502a4","#5601a4","#5801a4","#5901a5","#5b01a5","#5c01a6","#5e01a6","#6001a6","#6100a7","#6300a7","#6400a7","#6600a7","#6700a8","#6900a8","#6a00a8","#6c00a8","#6e00a8","#6f00a8","#7100a8","#7201a8","#7401a8","#7501a8","#7701a8","#7801a8","#7a02a8","#7b02a8","#7d03a8","#7e03a8","#8004a8","#8104a7","#8305a7","#8405a7","#8606a6","#8707a6","#8808a6","#8a09a5","#8b0aa5","#8d0ba5","#8e0ca4","#8f0da4","#910ea3","#920fa3","#9410a2","#9511a1","#9613a1","#9814a0","#99159f","#9a169f","#9c179e","#9d189d","#9e199d","#a01a9c","#a11b9b","#a21d9a","#a31e9a","#a51f99","#a62098","#a72197","#a82296","#aa2395","#ab2494","#ac2694","#ad2793","#ae2892","#b02991","#b12a90","#b22b8f","#b32c8e","#b42e8d","#b52f8c","#b6308b","#b7318a","#b83289","#ba3388","#bb3488","#bc3587","#bd3786","#be3885","#bf3984","#c03a83","#c13b82","#c23c81","#c33d80","#c43e7f","#c5407e","#c6417d","#c7427c","#c8437b","#c9447a","#ca457a","#cb4679","#cc4778","#cc4977","#cd4a76","#ce4b75","#cf4c74","#d04d73","#d14e72","#d24f71","#d35171","#d45270","#d5536f","#d5546e","#d6556d","#d7566c","#d8576b","#d9586a","#da5a6a","#da5b69","#db5c68","#dc5d67","#dd5e66","#de5f65","#de6164","#df6263","#e06363","#e16462","#e26561","#e26660","#e3685f","#e4695e","#e56a5d","#e56b5d","#e66c5c","#e76e5b","#e76f5a","#e87059","#e97158","#e97257","#ea7457","#eb7556","#eb7655","#ec7754","#ed7953","#ed7a52","#ee7b51","#ef7c51","#ef7e50","#f07f4f","#f0804e","#f1814d","#f1834c","#f2844b","#f3854b","#f3874a","#f48849","#f48948","#f58b47","#f58c46","#f68d45","#f68f44","#f79044","#f79143","#f79342","#f89441","#f89540","#f9973f","#f9983e","#f99a3e","#fa9b3d","#fa9c3c","#fa9e3b","#fb9f3a","#fba139","#fba238","#fca338","#fca537","#fca636","#fca835","#fca934","#fdab33","#fdac33","#fdae32","#fdaf31","#fdb130","#fdb22f","#fdb42f","#fdb52e","#feb72d","#feb82c","#feba2c","#febb2b","#febd2a","#febe2a","#fec029","#fdc229","#fdc328","#fdc527","#fdc627","#fdc827","#fdca26","#fdcb26","#fccd25","#fcce25","#fcd025","#fcd225","#fbd324","#fbd524","#fbd724","#fad824","#fada24","#f9dc24","#f9dd25","#f8df25","#f8e125","#f7e225","#f7e425","#f6e626","#f6e826","#f5e926","#f5eb27","#f4ed27","#f3ee27","#f3f027","#f2f227","#f1f426","#f1f525","#f0f724","#f0f921"]},{}],5:[function(require,module,exports){module.exports=["#440154","#440256","#450457","#450559","#46075a","#46085c","#460a5d","#460b5e","#470d60","#470e61","#471063","#471164","#471365","#481467","#481668","#481769","#48186a","#481a6c","#481b6d","#481c6e","#481d6f","#481f70","#482071","#482173","#482374","#482475","#482576","#482677","#482878","#482979","#472a7a","#472c7a","#472d7b","#472e7c","#472f7d","#46307e","#46327e","#46337f","#463480","#453581","#453781","#453882","#443983","#443a83","#443b84","#433d84","#433e85","#423f85","#424086","#424186","#414287","#414487","#404588","#404688","#3f4788","#3f4889","#3e4989","#3e4a89","#3e4c8a","#3d4d8a","#3d4e8a","#3c4f8a","#3c508b","#3b518b","#3b528b","#3a538b","#3a548c","#39558c","#39568c","#38588c","#38598c","#375a8c","#375b8d","#365c8d","#365d8d","#355e8d","#355f8d","#34608d","#34618d","#33628d","#33638d","#32648e","#32658e","#31668e","#31678e","#31688e","#30698e","#306a8e","#2f6b8e","#2f6c8e","#2e6d8e","#2e6e8e","#2e6f8e","#2d708e","#2d718e","#2c718e","#2c728e","#2c738e","#2b748e","#2b758e","#2a768e","#2a778e","#2a788e","#29798e","#297a8e","#297b8e","#287c8e","#287d8e","#277e8e","#277f8e","#27808e","#26818e","#26828e","#26828e","#25838e","#25848e","#25858e","#24868e","#24878e","#23888e","#23898e","#238a8d","#228b8d","#228c8d","#228d8d","#218e8d","#218f8d","#21908d","#21918c","#20928c","#20928c","#20938c","#1f948c","#1f958b","#1f968b","#1f978b","#1f988b","#1f998a","#1f9a8a","#1e9b8a","#1e9c89","#1e9d89","#1f9e89","#1f9f88","#1fa088","#1fa188","#1fa187","#1fa287","#20a386","#20a486","#21a585","#21a685","#22a785","#22a884","#23a983","#24aa83","#25ab82","#25ac82","#26ad81","#27ad81","#28ae80","#29af7f","#2ab07f","#2cb17e","#2db27d","#2eb37c","#2fb47c","#31b57b","#32b67a","#34b679","#35b779","#37b878","#38b977","#3aba76","#3bbb75","#3dbc74","#3fbc73","#40bd72","#42be71","#44bf70","#46c06f","#48c16e","#4ac16d","#4cc26c","#4ec36b","#50c46a","#52c569","#54c568","#56c667","#58c765","#5ac864","#5cc863","#5ec962","#60ca60","#63cb5f","#65cb5e","#67cc5c","#69cd5b","#6ccd5a","#6ece58","#70cf57","#73d056","#75d054","#77d153","#7ad151","#7cd250","#7fd34e","#81d34d","#84d44b","#86d549","#89d548","#8bd646","#8ed645","#90d743","#93d741","#95d840","#98d83e","#9bd93c","#9dd93b","#a0da39","#a2da37","#a5db36","#a8db34","#aadc32","#addc30","#b0dd2f","#b2dd2d","#b5de2b","#b8de29","#bade28","#bddf26","#c0df25","#c2df23","#c5e021","#c8e020","#cae11f","#cde11d","#d0e11c","#d2e21b","#d5e21a","#d8e219","#dae319","#dde318","#dfe318","#e2e418","#e5e419","#e7e419","#eae51a","#ece51b","#efe51c","#f1e51d","#f4e61e","#f6e620","#f8e621","#fbe723","#fde725"]},{}],6:[function(require,module,exports){"use strict";module.exports=require("./utils/interpolate").interpolateArray(require("./hex/inferno.json"))},{"./hex/inferno.json":2,"./utils/interpolate":10}],7:[function(require,module,exports){"use strict";module.exports=require("./utils/interpolate").interpolateArray(require("./hex/magma.json"))},{"./hex/magma.json":3,"./utils/interpolate":10}],8:[function(require,module,exports){"use strict";module.exports=require("./utils/interpolate").interpolateArray(require("./hex/plasma.json"))},{"./hex/plasma.json":4,"./utils/interpolate":10}],9:[function(require,module,exports){"use strict";module.exports=function hex2rgb(hex){return{r:parseInt(hex.slice(1,3),16)/255,g:parseInt(hex.slice(3,5),16)/255,b:parseInt(hex.slice(5,7),16)/255}}},{}],10:[function(require,module,exports){"use strict";var hex2rgb=require("./hex2rgb");var rgb2hex=require("./rgb2hex");function interpolate(a,b){a=hex2rgb(a);b=hex2rgb(b);var ar=a.r;var ag=a.g;var ab=a.b;var br=b.r-ar;var bg=b.g-ag;var bb=b.b-ab;return function(t){return rgb2hex({r:ar+br*t,g:ag+bg*t,b:ab+bb*t})}}function interpolateArray(scaleArr){var N=scaleArr.length-2;var intervalWidth=1/N;var intervals=[];for(var i=0;i<=N;i++){intervals[i]=interpolate(scaleArr[i],scaleArr[i+1])}return function(t){if(t<0||t>1)throw new Error("Outside the allowed range of [0, 1]");var i=Math.floor(t*N);var intervalOffset=i*intervalWidth;return intervals[i](t/intervalWidth-intervalOffset/intervalWidth)}}module.exports={interpolate:interpolate,interpolateArray:interpolateArray}},{"./hex2rgb":9,"./rgb2hex":11}],11:[function(require,module,exports){"use strict";function zeroPadHex(hexStr){return"00".slice(hexStr.length)+hexStr}module.exports=function rgb2hex(rgb){return"#"+[rgb.r,rgb.g,rgb.b].map((function(ch){return Math.round(ch*255).toString(16)})).map(zeroPadHex).join("")}},{}],12:[function(require,module,exports){"use strict";module.exports=require("./utils/interpolate").interpolateArray(require("./hex/viridis.json"))},{"./hex/viridis.json":5,"./utils/interpolate":10}]},{},[1])(1)}));(function(exports){(function(exports){var science=exports.science={version:"1.9.1"};science.ascending=function(a,b){return a-b};science.EULER=.5772156649015329;science.expm1=function(x){return x<1e-5&&x>-1e-5?x+.5*x*x:Math.exp(x)-1};science.functor=function(v){return typeof v==="function"?v:function(){return v}};science.hypot=function(x,y){x=Math.abs(x);y=Math.abs(y);var max,min;if(x>y){max=x;min=y}else{max=y;min=x}var r=min/max;return max*Math.sqrt(1+r*r)};science.quadratic=function(){var complex=false;function quadratic(a,b,c){var d=b*b-4*a*c;if(d>0){d=Math.sqrt(d)/(2*a);return complex?[{r:-b-d,i:0},{r:-b+d,i:0}]:[-b-d,-b+d]}else if(d===0){d=-b/(2*a);return complex?[{r:d,i:0}]:[d]}else{if(complex){d=Math.sqrt(-d)/(2*a);return[{r:-b,i:-d},{r:-b,i:d}]}return[]}}quadratic.complex=function(x){if(!arguments.length)return complex;complex=x;return quadratic};return quadratic};science.zeroes=function(n){var i=-1,a=[];if(arguments.length===1)while(++i<n)a[i]=0;else while(++i<n)a[i]=science.zeroes.apply(this,Array.prototype.slice.call(arguments,1));return a}})(this);(function(exports){science.lin={};science.lin.decompose=function(){function decompose(A){var n=A.length,V=[],d=[],e=[];for(var i=0;i<n;i++){V[i]=[];d[i]=[];e[i]=[]}var symmetric=true;for(var j=0;j<n;j++){for(var i=0;i<n;i++){if(A[i][j]!==A[j][i]){symmetric=false;break}}}if(symmetric){for(var i=0;i<n;i++)V[i]=A[i].slice();science_lin_decomposeTred2(d,e,V);science_lin_decomposeTql2(d,e,V)}else{var H=[];for(var i=0;i<n;i++)H[i]=A[i].slice();science_lin_decomposeOrthes(H,V);science_lin_decomposeHqr2(d,e,H,V)}var D=[];for(var i=0;i<n;i++){var row=D[i]=[];for(var j=0;j<n;j++)row[j]=i===j?d[i]:0;D[i][e[i]>0?i+1:i-1]=e[i]}return{D:D,V:V}}return decompose};function science_lin_decomposeTred2(d,e,V){var n=V.length;for(var j=0;j<n;j++)d[j]=V[n-1][j];for(var i=n-1;i>0;i--){var scale=0,h=0;for(var k=0;k<i;k++)scale+=Math.abs(d[k]);if(scale===0){e[i]=d[i-1];for(var j=0;j<i;j++){d[j]=V[i-1][j];V[i][j]=0;V[j][i]=0}}else{for(var k=0;k<i;k++){d[k]/=scale;h+=d[k]*d[k]}var f=d[i-1];var g=Math.sqrt(h);if(f>0)g=-g;e[i]=scale*g;h=h-f*g;d[i-1]=f-g;for(var j=0;j<i;j++)e[j]=0;for(var j=0;j<i;j++){f=d[j];V[j][i]=f;g=e[j]+V[j][j]*f;for(var k=j+1;k<=i-1;k++){g+=V[k][j]*d[k];e[k]+=V[k][j]*f}e[j]=g}f=0;for(var j=0;j<i;j++){e[j]/=h;f+=e[j]*d[j]}var hh=f/(h+h);for(var j=0;j<i;j++)e[j]-=hh*d[j];for(var j=0;j<i;j++){f=d[j];g=e[j];for(var k=j;k<=i-1;k++)V[k][j]-=f*e[k]+g*d[k];d[j]=V[i-1][j];V[i][j]=0}}d[i]=h}for(var i=0;i<n-1;i++){V[n-1][i]=V[i][i];V[i][i]=1;var h=d[i+1];if(h!=0){for(var k=0;k<=i;k++)d[k]=V[k][i+1]/h;for(var j=0;j<=i;j++){var g=0;for(var k=0;k<=i;k++)g+=V[k][i+1]*V[k][j];for(var k=0;k<=i;k++)V[k][j]-=g*d[k]}}for(var k=0;k<=i;k++)V[k][i+1]=0}for(var j=0;j<n;j++){d[j]=V[n-1][j];V[n-1][j]=0}V[n-1][n-1]=1;e[0]=0}function science_lin_decomposeTql2(d,e,V){var n=V.length;for(var i=1;i<n;i++)e[i-1]=e[i];e[n-1]=0;var f=0;var tst1=0;var eps=1e-12;for(var l=0;l<n;l++){tst1=Math.max(tst1,Math.abs(d[l])+Math.abs(e[l]));var m=l;while(m<n){if(Math.abs(e[m])<=eps*tst1){break}m++}if(m>l){var iter=0;do{iter++;var g=d[l];var p=(d[l+1]-g)/(2*e[l]);var r=science.hypot(p,1);if(p<0)r=-r;d[l]=e[l]/(p+r);d[l+1]=e[l]*(p+r);var dl1=d[l+1];var h=g-d[l];for(var i=l+2;i<n;i++)d[i]-=h;f+=h;p=d[m];var c=1;var c2=c;var c3=c;var el1=e[l+1];var s=0;var s2=0;for(var i=m-1;i>=l;i--){c3=c2;c2=c;s2=s;g=c*e[i];h=c*p;r=science.hypot(p,e[i]);e[i+1]=s*r;s=e[i]/r;c=p/r;p=c*d[i]-s*g;d[i+1]=h+s*(c*g+s*d[i]);for(var k=0;k<n;k++){h=V[k][i+1];V[k][i+1]=s*V[k][i]+c*h;V[k][i]=c*V[k][i]-s*h}}p=-s*s2*c3*el1*e[l]/dl1;e[l]=s*p;d[l]=c*p}while(Math.abs(e[l])>eps*tst1)}d[l]=d[l]+f;e[l]=0}for(var i=0;i<n-1;i++){var k=i;var p=d[i];for(var j=i+1;j<n;j++){if(d[j]<p){k=j;p=d[j]}}if(k!=i){d[k]=d[i];d[i]=p;for(var j=0;j<n;j++){p=V[j][i];V[j][i]=V[j][k];V[j][k]=p}}}}function science_lin_decomposeOrthes(H,V){var n=H.length;var ort=[];var low=0;var high=n-1;for(var m=low+1;m<high;m++){var scale=0;for(var i=m;i<=high;i++)scale+=Math.abs(H[i][m-1]);if(scale!==0){var h=0;for(var i=high;i>=m;i--){ort[i]=H[i][m-1]/scale;h+=ort[i]*ort[i]}var g=Math.sqrt(h);if(ort[m]>0)g=-g;h=h-ort[m]*g;ort[m]=ort[m]-g;for(var j=m;j<n;j++){var f=0;for(var i=high;i>=m;i--)f+=ort[i]*H[i][j];f/=h;for(var i=m;i<=high;i++)H[i][j]-=f*ort[i]}for(var i=0;i<=high;i++){var f=0;for(var j=high;j>=m;j--)f+=ort[j]*H[i][j];f/=h;for(var j=m;j<=high;j++)H[i][j]-=f*ort[j]}ort[m]=scale*ort[m];H[m][m-1]=scale*g}}for(var i=0;i<n;i++){for(var j=0;j<n;j++)V[i][j]=i===j?1:0}for(var m=high-1;m>=low+1;m--){if(H[m][m-1]!==0){for(var i=m+1;i<=high;i++)ort[i]=H[i][m-1];for(var j=m;j<=high;j++){var g=0;for(var i=m;i<=high;i++)g+=ort[i]*V[i][j];g=g/ort[m]/H[m][m-1];for(var i=m;i<=high;i++)V[i][j]+=g*ort[i]}}}}function science_lin_decomposeHqr2(d,e,H,V){var nn=H.length,n=nn-1,low=0,high=nn-1,eps=1e-12,exshift=0,p=0,q=0,r=0,s=0,z=0,t,w,x,y;var norm=0;for(var i=0;i<nn;i++){if(i<low||i>high){d[i]=H[i][i];e[i]=0}for(var j=Math.max(i-1,0);j<nn;j++)norm+=Math.abs(H[i][j])}var iter=0;while(n>=low){var l=n;while(l>low){s=Math.abs(H[l-1][l-1])+Math.abs(H[l][l]);if(s===0)s=norm;if(Math.abs(H[l][l-1])<eps*s)break;l--}if(l===n){H[n][n]=H[n][n]+exshift;d[n]=H[n][n];e[n]=0;n--;iter=0}else if(l===n-1){w=H[n][n-1]*H[n-1][n];p=(H[n-1][n-1]-H[n][n])/2;q=p*p+w;z=Math.sqrt(Math.abs(q));H[n][n]=H[n][n]+exshift;H[n-1][n-1]=H[n-1][n-1]+exshift;x=H[n][n];if(q>=0){z=p+(p>=0?z:-z);d[n-1]=x+z;d[n]=d[n-1];if(z!==0)d[n]=x-w/z;e[n-1]=0;e[n]=0;x=H[n][n-1];s=Math.abs(x)+Math.abs(z);p=x/s;q=z/s;r=Math.sqrt(p*p+q*q);p/=r;q/=r;for(var j=n-1;j<nn;j++){z=H[n-1][j];H[n-1][j]=q*z+p*H[n][j];H[n][j]=q*H[n][j]-p*z}for(var i=0;i<=n;i++){z=H[i][n-1];H[i][n-1]=q*z+p*H[i][n];H[i][n]=q*H[i][n]-p*z}for(var i=low;i<=high;i++){z=V[i][n-1];V[i][n-1]=q*z+p*V[i][n];V[i][n]=q*V[i][n]-p*z}}else{d[n-1]=x+p;d[n]=x+p;e[n-1]=z;e[n]=-z}n=n-2;iter=0}else{x=H[n][n];y=0;w=0;if(l<n){y=H[n-1][n-1];w=H[n][n-1]*H[n-1][n]}if(iter==10){exshift+=x;for(var i=low;i<=n;i++){H[i][i]-=x}s=Math.abs(H[n][n-1])+Math.abs(H[n-1][n-2]);x=y=.75*s;w=-.4375*s*s}if(iter==30){s=(y-x)/2;s=s*s+w;if(s>0){s=Math.sqrt(s);if(y<x){s=-s}s=x-w/((y-x)/2+s);for(var i=low;i<=n;i++){H[i][i]-=s}exshift+=s;x=y=w=.964}}iter++;var m=n-2;while(m>=l){z=H[m][m];r=x-z;s=y-z;p=(r*s-w)/H[m+1][m]+H[m][m+1];q=H[m+1][m+1]-z-r-s;r=H[m+2][m+1];s=Math.abs(p)+Math.abs(q)+Math.abs(r);p=p/s;q=q/s;r=r/s;if(m==l)break;if(Math.abs(H[m][m-1])*(Math.abs(q)+Math.abs(r))<eps*(Math.abs(p)*(Math.abs(H[m-1][m-1])+Math.abs(z)+Math.abs(H[m+1][m+1])))){break}m--}for(var i=m+2;i<=n;i++){H[i][i-2]=0;if(i>m+2)H[i][i-3]=0}for(var k=m;k<=n-1;k++){var notlast=k!=n-1;if(k!=m){p=H[k][k-1];q=H[k+1][k-1];r=notlast?H[k+2][k-1]:0;x=Math.abs(p)+Math.abs(q)+Math.abs(r);if(x!=0){p/=x;q/=x;r/=x}}if(x==0)break;s=Math.sqrt(p*p+q*q+r*r);if(p<0){s=-s}if(s!=0){if(k!=m)H[k][k-1]=-s*x;else if(l!=m)H[k][k-1]=-H[k][k-1];p+=s;x=p/s;y=q/s;z=r/s;q/=p;r/=p;for(var j=k;j<nn;j++){p=H[k][j]+q*H[k+1][j];if(notlast){p=p+r*H[k+2][j];H[k+2][j]=H[k+2][j]-p*z}H[k][j]=H[k][j]-p*x;H[k+1][j]=H[k+1][j]-p*y}for(var i=0;i<=Math.min(n,k+3);i++){p=x*H[i][k]+y*H[i][k+1];if(notlast){p+=z*H[i][k+2];H[i][k+2]=H[i][k+2]-p*r}H[i][k]=H[i][k]-p;H[i][k+1]=H[i][k+1]-p*q}for(var i=low;i<=high;i++){p=x*V[i][k]+y*V[i][k+1];if(notlast){p=p+z*V[i][k+2];V[i][k+2]=V[i][k+2]-p*r}V[i][k]=V[i][k]-p;V[i][k+1]=V[i][k+1]-p*q}}}}}if(norm==0){return}for(n=nn-1;n>=0;n--){p=d[n];q=e[n];if(q==0){var l=n;H[n][n]=1;for(var i=n-1;i>=0;i--){w=H[i][i]-p;r=0;for(var j=l;j<=n;j++){r=r+H[i][j]*H[j][n]}if(e[i]<0){z=w;s=r}else{l=i;if(e[i]===0){H[i][n]=-r/(w!==0?w:eps*norm)}else{x=H[i][i+1];y=H[i+1][i];q=(d[i]-p)*(d[i]-p)+e[i]*e[i];t=(x*s-z*r)/q;H[i][n]=t;if(Math.abs(x)>Math.abs(z)){H[i+1][n]=(-r-w*t)/x}else{H[i+1][n]=(-s-y*t)/z}}t=Math.abs(H[i][n]);if(eps*t*t>1){for(var j=i;j<=n;j++)H[j][n]=H[j][n]/t}}}}else if(q<0){var l=n-1;if(Math.abs(H[n][n-1])>Math.abs(H[n-1][n])){H[n-1][n-1]=q/H[n][n-1];H[n-1][n]=-(H[n][n]-p)/H[n][n-1]}else{var zz=science_lin_decomposeCdiv(0,-H[n-1][n],H[n-1][n-1]-p,q);H[n-1][n-1]=zz[0];H[n-1][n]=zz[1]}H[n][n-1]=0;H[n][n]=1;for(var i=n-2;i>=0;i--){var ra=0,sa=0,vr,vi;for(var j=l;j<=n;j++){ra=ra+H[i][j]*H[j][n-1];sa=sa+H[i][j]*H[j][n]}w=H[i][i]-p;if(e[i]<0){z=w;r=ra;s=sa}else{l=i;if(e[i]==0){var zz=science_lin_decomposeCdiv(-ra,-sa,w,q);H[i][n-1]=zz[0];H[i][n]=zz[1]}else{x=H[i][i+1];y=H[i+1][i];vr=(d[i]-p)*(d[i]-p)+e[i]*e[i]-q*q;vi=(d[i]-p)*2*q;if(vr==0&vi==0){vr=eps*norm*(Math.abs(w)+Math.abs(q)+Math.abs(x)+Math.abs(y)+Math.abs(z))}var zz=science_lin_decomposeCdiv(x*r-z*ra+q*sa,x*s-z*sa-q*ra,vr,vi);H[i][n-1]=zz[0];H[i][n]=zz[1];if(Math.abs(x)>Math.abs(z)+Math.abs(q)){H[i+1][n-1]=(-ra-w*H[i][n-1]+q*H[i][n])/x;H[i+1][n]=(-sa-w*H[i][n]-q*H[i][n-1])/x}else{var zz=science_lin_decomposeCdiv(-r-y*H[i][n-1],-s-y*H[i][n],z,q);H[i+1][n-1]=zz[0];H[i+1][n]=zz[1]}}t=Math.max(Math.abs(H[i][n-1]),Math.abs(H[i][n]));if(eps*t*t>1){for(var j=i;j<=n;j++){H[j][n-1]=H[j][n-1]/t;H[j][n]=H[j][n]/t}}}}}}for(var i=0;i<nn;i++){if(i<low||i>high){for(var j=i;j<nn;j++)V[i][j]=H[i][j]}}for(var j=nn-1;j>=low;j--){for(var i=low;i<=high;i++){z=0;for(var k=low;k<=Math.min(j,high);k++)z+=V[i][k]*H[k][j];V[i][j]=z}}}function science_lin_decomposeCdiv(xr,xi,yr,yi){if(Math.abs(yr)>Math.abs(yi)){var r=yi/yr,d=yr+r*yi;return[(xr+r*xi)/d,(xi-r*xr)/d]}else{var r=yr/yi,d=yi+r*yr;return[(r*xr+xi)/d,(r*xi-xr)/d]}}science.lin.cross=function(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]};science.lin.dot=function(a,b){var s=0,i=-1,n=Math.min(a.length,b.length);while(++i<n)s+=a[i]*b[i];return s};science.lin.length=function(p){return Math.sqrt(science.lin.dot(p,p))};science.lin.normalize=function(p){var length=science.lin.length(p);return p.map((function(d){return d/length}))};science.lin.determinant=function(matrix){var m=matrix[0].concat(matrix[1]).concat(matrix[2]).concat(matrix[3]);return m[12]*m[9]*m[6]*m[3]-m[8]*m[13]*m[6]*m[3]-m[12]*m[5]*m[10]*m[3]+m[4]*m[13]*m[10]*m[3]+m[8]*m[5]*m[14]*m[3]-m[4]*m[9]*m[14]*m[3]-m[12]*m[9]*m[2]*m[7]+m[8]*m[13]*m[2]*m[7]+m[12]*m[1]*m[10]*m[7]-m[0]*m[13]*m[10]*m[7]-m[8]*m[1]*m[14]*m[7]+m[0]*m[9]*m[14]*m[7]+m[12]*m[5]*m[2]*m[11]-m[4]*m[13]*m[2]*m[11]-m[12]*m[1]*m[6]*m[11]+m[0]*m[13]*m[6]*m[11]+m[4]*m[1]*m[14]*m[11]-m[0]*m[5]*m[14]*m[11]-m[8]*m[5]*m[2]*m[15]+m[4]*m[9]*m[2]*m[15]+m[8]*m[1]*m[6]*m[15]-m[0]*m[9]*m[6]*m[15]-m[4]*m[1]*m[10]*m[15]+m[0]*m[5]*m[10]*m[15]};science.lin.gaussjordan=function(m,eps){if(!eps)eps=1e-10;var h=m.length,w=m[0].length,y=-1,y2,x;while(++y<h){var maxrow=y;y2=y;while(++y2<h){if(Math.abs(m[y2][y])>Math.abs(m[maxrow][y]))maxrow=y2}var tmp=m[y];m[y]=m[maxrow];m[maxrow]=tmp;if(Math.abs(m[y][y])<=eps)return false;y2=y;while(++y2<h){var c=m[y2][y]/m[y][y];x=y-1;while(++x<w){m[y2][x]-=m[y][x]*c}}}y=h;while(--y>=0){var c=m[y][y];y2=-1;while(++y2<y){x=w;while(--x>=y){m[y2][x]-=m[y][x]*m[y2][y]/c}}m[y][y]/=c;x=h-1;while(++x<w){m[y][x]/=c}}return true};science.lin.inverse=function(m){var n=m.length,i=-1;if(n!==m[0].length)return;m=m.map((function(row,i){var identity=new Array(n),j=-1;while(++j<n)identity[j]=i===j?1:0;return row.concat(identity)}));science.lin.gaussjordan(m);while(++i<n){m[i]=m[i].slice(n)}return m};science.lin.multiply=function(a,b){var m=a.length,n=b[0].length,p=b.length,i=-1,j,k;if(p!==a[0].length)throw{error:"columns(a) != rows(b); "+a[0].length+" != "+p};var ab=new Array(m);while(++i<m){ab[i]=new Array(n);j=-1;while(++j<n){var s=0;k=-1;while(++k<p)s+=a[i][k]*b[k][j];ab[i][j]=s}}return ab};science.lin.transpose=function(a){var m=a.length,n=a[0].length,i=-1,j,b=new Array(n);while(++i<n){b[i]=new Array(m);j=-1;while(++j<m)b[i][j]=a[j][i]}return b};science.lin.tridag=function(a,b,c,d,x,n){var i,m;for(i=1;i<n;i++){m=a[i]/b[i-1];b[i]-=m*c[i-1];d[i]-=m*d[i-1]}x[n-1]=d[n-1]/b[n-1];for(i=n-2;i>=0;i--){x[i]=(d[i]-c[i]*x[i+1])/b[i]}}})(this);(function(exports){science.stats={};science.stats.bandwidth={nrd0:function(x){var hi=Math.sqrt(science.stats.variance(x));if(!(lo=Math.min(hi,science.stats.iqr(x)/1.34)))(lo=hi)||(lo=Math.abs(x[1]))||(lo=1);return.9*lo*Math.pow(x.length,-.2)},nrd:function(x){var h=science.stats.iqr(x)/1.34;return 1.06*Math.min(Math.sqrt(science.stats.variance(x)),h)*Math.pow(x.length,-1/5)}};science.stats.distance={euclidean:function(a,b){var n=a.length,i=-1,s=0,x;while(++i<n){x=a[i]-b[i];s+=x*x}return Math.sqrt(s)},manhattan:function(a,b){var n=a.length,i=-1,s=0;while(++i<n)s+=Math.abs(a[i]-b[i]);return s},minkowski:function(p){return function(a,b){var n=a.length,i=-1,s=0;while(++i<n)s+=Math.pow(Math.abs(a[i]-b[i]),p);return Math.pow(s,1/p)}},chebyshev:function(a,b){var n=a.length,i=-1,max=0,x;while(++i<n){x=Math.abs(a[i]-b[i]);if(x>max)max=x}return max},hamming:function(a,b){var n=a.length,i=-1,d=0;while(++i<n)if(a[i]!==b[i])d++;return d},jaccard:function(a,b){var n=a.length,i=-1,s=0;while(++i<n)if(a[i]===b[i])s++;return s/n},braycurtis:function(a,b){var n=a.length,i=-1,s0=0,s1=0,ai,bi;while(++i<n){ai=a[i];bi=b[i];s0+=Math.abs(ai-bi);s1+=Math.abs(ai+bi)}return s0/s1}};science.stats.erf=function(x){var a1=.254829592,a2=-.284496736,a3=1.421413741,a4=-1.453152027,a5=1.061405429,p=.3275911;var sign=x<0?-1:1;if(x<0){sign=-1;x=-x}var t=1/(1+p*x);return sign*(1-((((a5*t+a4)*t+a3)*t+a2)*t+a1)*t*Math.exp(-x*x))};science.stats.phi=function(x){return.5*(1+science.stats.erf(x/Math.SQRT2))};science.stats.kernel={uniform:function(u){if(u<=1&&u>=-1)return.5;return 0},triangular:function(u){if(u<=1&&u>=-1)return 1-Math.abs(u);return 0},epanechnikov:function(u){if(u<=1&&u>=-1)return.75*(1-u*u);return 0},quartic:function(u){if(u<=1&&u>=-1){var tmp=1-u*u;return 15/16*tmp*tmp}return 0},triweight:function(u){if(u<=1&&u>=-1){var tmp=1-u*u;return 35/32*tmp*tmp*tmp}return 0},gaussian:function(u){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*u*u)},cosine:function(u){if(u<=1&&u>=-1)return Math.PI/4*Math.cos(Math.PI/2*u);return 0}};science.stats.kde=function(){var kernel=science.stats.kernel.gaussian,sample=[],bandwidth=science.stats.bandwidth.nrd;function kde(points,i){var bw=bandwidth.call(this,sample);return points.map((function(x){var i=-1,y=0,n=sample.length;while(++i<n){y+=kernel((x-sample[i])/bw)}return[x,y/bw/n]}))}kde.kernel=function(x){if(!arguments.length)return kernel;kernel=x;return kde};kde.sample=function(x){if(!arguments.length)return sample;sample=x;return kde};kde.bandwidth=function(x){if(!arguments.length)return bandwidth;bandwidth=science.functor(x);return kde};return kde};science.stats.kmeans=function(){var distance=science.stats.distance.euclidean,maxIterations=1e3,k=1;function kmeans(vectors){var n=vectors.length,assignments=[],clusterSizes=[],repeat=1,iterations=0,centroids=science_stats_kmeansRandom(k,vectors),newCentroids,i,j,x,d,min,best;while(repeat&&iterations<maxIterations){j=-1;while(++j<k){clusterSizes[j]=0}i=-1;while(++i<n){x=vectors[i];min=Infinity;j=-1;while(++j<k){d=distance.call(this,centroids[j],x);if(d<min){min=d;best=j}}clusterSizes[assignments[i]=best]++}newCentroids=[];i=-1;while(++i<n){x=assignments[i];d=newCentroids[x];if(d==null)newCentroids[x]=vectors[i].slice();else{j=-1;while(++j<d.length){d[j]+=vectors[i][j]}}}j=-1;while(++j<k){x=newCentroids[j];d=1/clusterSizes[j];i=-1;while(++i<x.length)x[i]*=d}repeat=0;j=-1;while(++j<k){if(!science_stats_kmeansCompare(newCentroids[j],centroids[j])){repeat=1;break}}centroids=newCentroids;iterations++}return{assignments:assignments,centroids:centroids}}kmeans.k=function(x){if(!arguments.length)return k;k=x;return kmeans};kmeans.distance=function(x){if(!arguments.length)return distance;distance=x;return kmeans};return kmeans};function science_stats_kmeansCompare(a,b){if(!a||!b||a.length!==b.length)return false;var n=a.length,i=-1;while(++i<n)if(a[i]!==b[i])return false;return true}function science_stats_kmeansRandom(k,vectors){var n=vectors.length;if(k>n)return null;var selected_vectors=[];var selected_indices=[];var tested_indices={};var tested=0;var selected=0;var i,vector,select;while(selected<k){if(tested===n)return null;var random_index=Math.floor(Math.random()*n);if(random_index in tested_indices)continue;tested_indices[random_index]=1;tested++;vector=vectors[random_index];select=true;for(i=0;i<selected;i++){if(science_stats_kmeansCompare(vector,selected_vectors[i])){select=false;break}}if(select){selected_vectors[selected]=vector;selected_indices[selected]=random_index;selected++}}return selected_vectors}science.stats.hcluster=function(){var distance=science.stats.distance.euclidean,linkage="simple";function hcluster(vectors){var n=vectors.length,dMin=[],cSize=[],distMatrix=[],clusters=[],c1,c2,c1Cluster,c2Cluster,p,root,i,j;i=-1;while(++i<n){dMin[i]=0;distMatrix[i]=[];j=-1;while(++j<n){distMatrix[i][j]=i===j?Infinity:distance(vectors[i],vectors[j]);if(distMatrix[i][dMin[i]]>distMatrix[i][j])dMin[i]=j}}i=-1;while(++i<n){clusters[i]=[];clusters[i][0]={left:null,right:null,dist:0,centroid:vectors[i],size:1,depth:0};cSize[i]=1}for(p=0;p<n-1;p++){c1=0;for(i=0;i<n;i++){if(distMatrix[i][dMin[i]]<distMatrix[c1][dMin[c1]])c1=i}c2=dMin[c1];c1Cluster=clusters[c1][0];c2Cluster=clusters[c2][0];newCluster={left:c1Cluster,right:c2Cluster,dist:distMatrix[c1][c2],centroid:calculateCentroid(c1Cluster.size,c1Cluster.centroid,c2Cluster.size,c2Cluster.centroid),size:c1Cluster.size+c2Cluster.size,depth:1+Math.max(c1Cluster.depth,c2Cluster.depth)};clusters[c1].splice(0,0,newCluster);cSize[c1]+=cSize[c2];for(j=0;j<n;j++){switch(linkage){case"single":if(distMatrix[c1][j]>distMatrix[c2][j])distMatrix[j][c1]=distMatrix[c1][j]=distMatrix[c2][j];break;case"complete":if(distMatrix[c1][j]<distMatrix[c2][j])distMatrix[j][c1]=distMatrix[c1][j]=distMatrix[c2][j];break;case"average":distMatrix[j][c1]=distMatrix[c1][j]=(cSize[c1]*distMatrix[c1][j]+cSize[c2]*distMatrix[c2][j])/(cSize[c1]+cSize[j]);break}}distMatrix[c1][c1]=Infinity;for(i=0;i<n;i++)distMatrix[i][c2]=distMatrix[c2][i]=Infinity;for(j=0;j<n;j++){if(dMin[j]==c2)dMin[j]=c1;if(distMatrix[c1][j]<distMatrix[c1][dMin[c1]])dMin[c1]=j}root=newCluster}return root}hcluster.distance=function(x){if(!arguments.length)return distance;distance=x;return hcluster};return hcluster};function calculateCentroid(c1Size,c1Centroid,c2Size,c2Centroid){var newCentroid=[],newSize=c1Size+c2Size,n=c1Centroid.length,i=-1;while(++i<n){newCentroid[i]=(c1Size*c1Centroid[i]+c2Size*c2Centroid[i])/newSize}return newCentroid}science.stats.iqr=function(x){var quartiles=science.stats.quantiles(x,[.25,.75]);return quartiles[1]-quartiles[0]};science.stats.loess=function(){var bandwidth=.3,robustnessIters=2,accuracy=1e-12;function smooth(xval,yval,weights){var n=xval.length,i;if(n!==yval.length)throw{error:"Mismatched array lengths"};if(n==0)throw{error:"At least one point required."};if(arguments.length<3){weights=[];i=-1;while(++i<n)weights[i]=1}science_stats_loessFiniteReal(xval);science_stats_loessFiniteReal(yval);science_stats_loessFiniteReal(weights);science_stats_loessStrictlyIncreasing(xval);if(n==1)return[yval[0]];if(n==2)return[yval[0],yval[1]];var bandwidthInPoints=Math.floor(bandwidth*n);if(bandwidthInPoints<2)throw{error:"Bandwidth too small."};var res=[],residuals=[],robustnessWeights=[];i=-1;while(++i<n){res[i]=0;residuals[i]=0;robustnessWeights[i]=1}var iter=-1;while(++iter<=robustnessIters){var bandwidthInterval=[0,bandwidthInPoints-1];var x;i=-1;while(++i<n){x=xval[i];if(i>0){science_stats_loessUpdateBandwidthInterval(xval,weights,i,bandwidthInterval)}var ileft=bandwidthInterval[0],iright=bandwidthInterval[1];var edge=xval[i]-xval[ileft]>xval[iright]-xval[i]?ileft:iright;var sumWeights=0,sumX=0,sumXSquared=0,sumY=0,sumXY=0,denom=Math.abs(1/(xval[edge]-x));for(var k=ileft;k<=iright;++k){var xk=xval[k],yk=yval[k],dist=k<i?x-xk:xk-x,w=science_stats_loessTricube(dist*denom)*robustnessWeights[k]*weights[k],xkw=xk*w;sumWeights+=w;sumX+=xkw;sumXSquared+=xk*xkw;sumY+=yk*w;sumXY+=yk*xkw}var meanX=sumX/sumWeights,meanY=sumY/sumWeights,meanXY=sumXY/sumWeights,meanXSquared=sumXSquared/sumWeights;var beta=Math.sqrt(Math.abs(meanXSquared-meanX*meanX))<accuracy?0:(meanXY-meanX*meanY)/(meanXSquared-meanX*meanX);var alpha=meanY-beta*meanX;res[i]=beta*x+alpha;residuals[i]=Math.abs(yval[i]-res[i])}if(iter===robustnessIters){break}var sortedResiduals=residuals.slice();sortedResiduals.sort();var medianResidual=sortedResiduals[Math.floor(n/2)];if(Math.abs(medianResidual)<accuracy)break;var arg,w;i=-1;while(++i<n){arg=residuals[i]/(6*medianResidual);robustnessWeights[i]=arg>=1?0:(w=1-arg*arg)*w}}return res}smooth.bandwidth=function(x){if(!arguments.length)return x;bandwidth=x;return smooth};smooth.robustnessIterations=function(x){if(!arguments.length)return x;robustnessIters=x;return smooth};smooth.accuracy=function(x){if(!arguments.length)return x;accuracy=x;return smooth};return smooth};function science_stats_loessFiniteReal(values){var n=values.length,i=-1;while(++i<n)if(!isFinite(values[i]))return false;return true}function science_stats_loessStrictlyIncreasing(xval){var n=xval.length,i=0;while(++i<n)if(xval[i-1]>=xval[i])return false;return true}function science_stats_loessTricube(x){return(x=1-x*x*x)*x*x}function science_stats_loessUpdateBandwidthInterval(xval,weights,i,bandwidthInterval){var left=bandwidthInterval[0],right=bandwidthInterval[1];var nextRight=science_stats_loessNextNonzero(weights,right);if(nextRight<xval.length&&xval[nextRight]-xval[i]<xval[i]-xval[left]){var nextLeft=science_stats_loessNextNonzero(weights,left);bandwidthInterval[0]=nextLeft;bandwidthInterval[1]=nextRight}}function science_stats_loessNextNonzero(weights,i){var j=i+1;while(j<weights.length&&weights[j]===0)j++;return j}science.stats.mean=function(x){var n=x.length;if(n===0)return NaN;var m=0,i=-1;while(++i<n)m+=(x[i]-m)/(i+1);return m};science.stats.median=function(x){return science.stats.quantiles(x,[.5])[0]};science.stats.mode=function(x){x=x.slice().sort(science.ascending);var mode,n=x.length,i=-1,l=i,last=null,max=0,tmp,v;while(++i<n){if((v=x[i])!==last){if((tmp=i-l)>max){max=tmp;mode=last}last=v;l=i}}return mode};science.stats.quantiles=function(d,quantiles){d=d.slice().sort(science.ascending);var n_1=d.length-1;return quantiles.map((function(q){if(q===0)return d[0];else if(q===1)return d[n_1];var index=1+q*n_1,lo=Math.floor(index),h=index-lo,a=d[lo-1];return h===0?a:a+h*(d[lo]-a)}))};science.stats.variance=function(x){var n=x.length;if(n<1)return NaN;if(n===1)return 0;var mean=science.stats.mean(x),i=-1,s=0;while(++i<n){var v=x[i]-mean;s+=v*v}return s/(n-1)};science.stats.distribution={};science.stats.distribution.gaussian=function(){var random=Math.random,mean=0,sigma=1,variance=1;function gaussian(){var x1,x2,rad,y1;do{x1=2*random()-1;x2=2*random()-1;rad=x1*x1+x2*x2}while(rad>=1||rad===0);return mean+sigma*x1*Math.sqrt(-2*Math.log(rad)/rad)}gaussian.pdf=function(x){x=(x-mu)/sigma;return science_stats_distribution_gaussianConstant*Math.exp(-.5*x*x)/sigma};gaussian.cdf=function(x){x=(x-mu)/sigma;return.5*(1+science.stats.erf(x/Math.SQRT2))};gaussian.mean=function(x){if(!arguments.length)return mean;mean=+x;return gaussian};gaussian.variance=function(x){if(!arguments.length)return variance;sigma=Math.sqrt(variance=+x);return gaussian};gaussian.random=function(x){if(!arguments.length)return random;random=x;return gaussian};return gaussian};science_stats_distribution_gaussianConstant=1/Math.sqrt(2*Math.PI)})(this)})(this);/*! Select2 4.0.4 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}((function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout((function(){n(b,a,c,d)}),4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",(function(){})),b.define("jquery",[],(function(){var b=a||$;return null==b&&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."),b})),b.define("select2/utils",["jquery"],(function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}},k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,(function(a){return b[a]}))},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,(function(a){d=d.add(a)})),c=d}b.append(c)},c})),b.define("select2/results",["jquery","./utils"],(function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current((function(c){var d=a.map(c,(function(a){return a.id.toString()}));b.$results.find(".select2-results__option[aria-selected]").each((function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")}))}))},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",(function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())})),b.on("results:append",(function(a){d.append(a.data),b.isOpen()&&d.setClasses()})),b.on("query",(function(a){d.hideMessages(),d.showLoading(a)})),b.on("select",(function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())})),b.on("unselect",(function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())})),b.on("open",(function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()})),b.on("close",(function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")})),b.on("results:toggle",(function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")})),b.on("results:select",(function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}})),b.on("results:previous",(function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}})),b.on("results:next",(function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}})),b.on("results:focus",(function(a){a.element.addClass("select2-results__option--highlighted")})),b.on("results:message",(function(a){d.displayMessage(a)})),a.fn.mousewheel&&this.$results.on("mousewheel",(function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})}))},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c})),b.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}})),b.define("select2/selection/base",["jquery","../utils","../keys"],(function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<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")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",(function(a){d.trigger("focus",a)})),this.$selection.on("blur",(function(a){d._handleBlur(a)})),this.$selection.on("keydown",(function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()})),a.on("results:focus",(function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)})),a.on("selection:update",(function(a){d.update(a.data)})),a.on("open",(function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)})),a.on("close",(function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)})),a.on("enable",(function(){d.$selection.attr("tabindex",d._tabindex)})),a.on("disable",(function(){d.$selection.attr("tabindex","-1")}))},d.prototype._handleBlur=function(b){var c=this;window.setTimeout((function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)}),1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,(function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each((function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")}))}))},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d})),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",(function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})})),this.$selection.on("focus",(function(a){})),this.$selection.on("blur",(function(a){})),a.on("focus",(function(b){a.isOpen()||c.$selection.focus()})),a.on("selection:update",(function(a){c.update(a.data)}))},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e})),b.define("select2/selection/multiple",["jquery","./base","../utils"],(function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(a){e.trigger("toggle",{originalEvent:a})})),this.$selection.on("click",".select2-selection__choice__remove",(function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}))},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d})),b.define("select2/selection/placeholder",["../utils"],(function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b})),b.define("select2/selection/allowClear",["jquery","../keys"],(function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),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(a){d._handleClear(a)})),b.on("keypress",(function(a){d._handleKeyboardClear(a,b)}))},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c})),b.define("select2/selection/search",["jquery","../utils","../keys"],(function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<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=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",(function(){e.$search.trigger("focus")})),b.on("close",(function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")})),b.on("enable",(function(){e.$search.prop("disabled",!1),e._transferTabIndex()})),b.on("disable",(function(){e.$search.prop("disabled",!0)})),b.on("focus",(function(a){e.$search.trigger("focus")})),b.on("results:focus",(function(a){e.$search.attr("aria-activedescendant",a.id)})),this.$selection.on("focusin",".select2-search--inline",(function(a){e.trigger("focus",a)})),this.$selection.on("focusout",".select2-search--inline",(function(a){e._handleBlur(a)})),this.$selection.on("keydown",".select2-search--inline",(function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}}));var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(a){if(g)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)}))},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d})),b.define("select2/selection/eventRelay",["jquery"],(function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",(function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}}))},b})),b.define("select2/translation",["jquery","require"],(function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c})),b.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","êœ²":"AA","Ã†":"AE","Ç¼":"AE","Ç¢":"AE","êœ´":"AO","êœ¶":"AU","êœ¸":"AV","êœº":"AV","êœ¼":"AY","â’·":"B","ï¼¢":"B","á¸‚":"B","á¸„":"B","á¸†":"B","Éƒ":"B","Æ‚":"B","Æ�":"B","â’¸":"C","ï¼£":"C","Ä†":"C","Äˆ":"C","ÄŠ":"C","ÄŒ":"C","Ã‡":"C","á¸ˆ":"C","Æ‡":"C","È»":"C","êœ¾":"C","â’¹":"D","ï¼¤":"D","á¸Š":"D","ÄŽ":"D","á¸Œ":"D","á¸�":"D","á¸’":"D","á¸Ž":"D","Ä�":"D","Æ‹":"D","ÆŠ":"D","Æ‰":"D","ê�¹":"D","Ç±":"DZ","Ç„":"DZ","Ç²":"Dz","Ç…":"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","â’»":"F","ï¼¦":"F","á¸ž":"F","Æ‘":"F","ê�»":"F","â’¼":"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","â’¾":"I","ï¼©":"I","ÃŒ":"I","Ã�":"I","ÃŽ":"I","Ä¨":"I","Äª":"I","Ä¬":"I","Ä°":"I","Ã�":"I","á¸®":"I","á»ˆ":"I","Ç�":"I","Èˆ":"I","ÈŠ":"I","á»Š":"I","Ä®":"I","á¸¬":"I","Æ—":"I","â’¿":"J","ï¼ª":"J","Ä´":"J","Éˆ":"J","â“€":"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","Ç‡":"LJ","Çˆ":"Lj","â“‚":"M","ï¼­":"M","á¸¾":"M","á¹€":"M","á¹‚":"M","â±®":"M","Æœ":"M","â“ƒ":"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","Æ¢":"OI","ê�Ž":"OO","È¢":"OU","â“…":"P","ï¼°":"P","á¹”":"P","á¹–":"P","Æ¤":"P","â±£":"P","ê��":"P","ê�’":"P","ê�”":"P","â“†":"Q","ï¼±":"Q","ê�–":"Q","ê�˜":"Q","ÉŠ":"Q","â“‡":"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","â“‰":"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","â“‹":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Æ²":"V","ê�ž":"V","É…":"V","ê� ":"VY","â“Œ":"W","ï¼·":"W","áº€":"W","áº‚":"W","Å´":"W","áº†":"W","áº„":"W","áºˆ":"W","â±²":"W","â“�":"X","ï¼¸":"X","áºŠ":"X","áºŒ":"X","â“Ž":"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","â“�":"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","â“’":"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","Ç³":"dz","Ç†":"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","â“–":"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","Æ•":"hv","â“˜":"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","â“›":"l","ï½Œ":"l","Å€":"l","Äº":"l","Ä¾":"l","á¸·":"l","á¸¹":"l","Ä¼":"l","á¸½":"l","á¸»":"l","Å¿":"l","Å‚":"l","Æš":"l","É«":"l","â±¡":"l","ê�‰":"l","êž�":"l","ê�‡":"l","Ç‰":"lj","â“œ":"m","ï½�":"m","á¸¿":"m","á¹�":"m","á¹ƒ":"m","É±":"m","É¯":"m","â“�":"n","ï½Ž":"n","Ç¹":"n","Å„":"n","Ã±":"n","á¹…":"n","Åˆ":"n","á¹‡":"n","Å†":"n","á¹‹":"n","á¹‰":"n","Æž":"n","É²":"n","Å‰":"n","êž‘":"n","êž¥":"n","ÇŒ":"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","Æ£":"oi","È£":"ou","ê��":"oo","â“Ÿ":"p","ï½�":"p","á¹•":"p","á¹—":"p","Æ¥":"p","áµ½":"p","ê�‘":"p","ê�“":"p","ê�•":"p","â“ ":"q","ï½‘":"q","É‹":"q","ê�—":"q","ê�™":"q","â“¡":"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","â“¥":"v","ï½–":"v","á¹½":"v","á¹¿":"v","Ê‹":"v","ê�Ÿ":"v","ÊŒ":"v","ê�¡":"vy","â“¦":"w","ï½—":"w","áº�":"w","áºƒ":"w","Åµ":"w","áº‡":"w","áº…":"w","áº˜":"w","áº‰":"w","â±³":"w","â“§":"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","Î†":"Î‘","Îˆ":"Î•","Î‰":"Î—","ÎŠ":"Î™","Îª":"Î™","ÎŒ":"ÎŸ","ÎŽ":"Î¥","Î«":"Î¥","Î�":"Î©","Î¬":"Î±","Î­":"Îµ","Î®":"Î·","Î¯":"Î¹","ÏŠ":"Î¹","Î�":"Î¹","ÏŒ":"Î¿","Ï�":"Ï…","Ï‹":"Ï…","Î°":"Ï…","Ï‰":"Ï‰","Ï‚":"Ïƒ"}})),b.define("select2/data/base",["../utils"],(function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b})),b.define("select2/data/select",["./base","../utils","jquery"],(function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each((function(){var a=c(this),e=d.item(a);b.push(e)})),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current((function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")}));else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current((function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")}))}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",(function(a){c.select(a.data)})),a.on("unselect",(function(a){c.unselect(a.data)}))},d.prototype.destroy=function(){this.$element.find("*").each((function(){c.removeData(this,"data")}))},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each((function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}})),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d})),b.define("select2/data/array",["./select","../utils","jquery"],(function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter((function(b,c){return c.value==a.id.toString()}));0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map((function(){return e.item(c(this)).id})).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d})),b.define("select2/data/ajax",["./array","../utils","jquery"],(function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,(function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)}),(function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})}));e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d})),b.define("select2/data/tags",["jquery"],(function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each((function(){this.selected||a(this).remove()}))},b})),b.define("select2/data/tokenizer",["jquery"],(function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter((function(){return a(this).val()===c.id})).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b})),b.define("select2/data/minimumInputLength",[],(function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a})),b.define("select2/data/maximumInputLength",[],(function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a})),b.define("select2/data/maximumSelectionLength",[],(function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current((function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)}))},a})),b.define("select2/dropdown",["jquery","./utils"],(function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c})),b.define("select2/dropdown/search",["jquery","../utils"],(function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<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=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",(function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()})),this.$search.on("input",(function(b){a(this).off("keyup")})),this.$search.on("keyup input",(function(a){e.handleSearch(a)})),c.on("open",(function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout((function(){e.$search.focus()}),0)})),c.on("close",(function(){e.$search.attr("tabindex",-1),e.$search.val("")})),c.on("focus",(function(){c.isOpen()||e.$search.focus()})),c.on("results:all",(function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}))},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c})),b.define("select2/dropdown/hidePlaceholder",[],(function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a})),b.define("select2/dropdown/infiniteScroll",["jquery"],(function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",(function(a){e.lastParams=a,e.loading=!0})),c.on("query:append",(function(a){e.lastParams=a,e.loading=!0})),this.$results.on("scroll",(function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}}))},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b})),b.define("select2/dropdown/attachBody",["jquery","../utils"],(function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",(function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",(function(){d._positionDropdown(),d._resizeDropdown()})),b.on("results:append",(function(){d._positionDropdown(),d._resizeDropdown()})))})),b.on("close",(function(){d._hideDropdown(),d._detachPositioningHandler(b)})),this.$dropdownContainer.on("mousedown",(function(a){a.stopPropagation()}))},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each((function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})})),i.on(f,(function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)})),a(window).on(f+" "+g+" "+h,(function(a){e._positionDropdown(),e._resizeDropdown()}))},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c})),b.define("select2/dropdown/minimumResultsForSearch",[],(function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b})),b.define("select2/dropdown/selectOnClose",[],(function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",(function(a){d._handleSelectOnClose(a)}))},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a})),b.define("select2/dropdown/closeOnSelect",[],(function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",(function(a){d._selectTriggered(a)})),b.on("unselect",(function(a){d._selectTriggered(a)}))},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a})),b.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more resultsâ€¦"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searchingâ€¦"}}})),b.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(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D})),b.define("select2/options",["require","jquery","./defaults","./utils"],(function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.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.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.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."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e})),b.define("select2/core",["jquery","./options","./utils","./keys"],(function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(a){k.trigger("selection:update",{data:a})})),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.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)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",(function(){b.dataAdapter.current((function(a){b.trigger("selection:update",{data:a})}))})),this.$element.on("focus.select2",(function(a){b.trigger("focus",a)})),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d((function(c){a.each(c,b._syncA),a.each(c,b._syncS)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",(function(b,c){a.trigger(b,c)}))},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",(function(){b.toggleDropdown()})),this.selection.on("focus",(function(a){b.focus(a)})),this.selection.on("*",(function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)}))},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",(function(b,c){a.trigger(b,c)}))},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",(function(b,c){a.trigger(b,c)}))},e.prototype._registerEvents=function(){var a=this;this.on("open",(function(){a.$container.addClass("select2-container--open")})),this.on("close",(function(){a.$container.removeClass("select2-container--open")})),this.on("enable",(function(){a.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){a.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){a.$container.removeClass("select2-container--focus")})),this.on("query",(function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,(function(c){a.trigger("results:all",{data:c,query:b})}))})),this.on("query:append",(function(b){this.dataAdapter.query(b,(function(c){a.trigger("results:append",{data:c,query:b})}))})),this.on("keypress",(function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())}))},e.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",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current((function(a){d.trigger("selection:update",{data:a})}))}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){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!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.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 a=[];return this.dataAdapter.current((function(b){a=b})),a},e.prototype.val=function(b){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==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,(function(a){return a.toString()}))),this.$element.val(c).trigger("change")},e.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},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e})),b.define("jquery-mousewheel",["jquery"],(function(a){return a})),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],(function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each((function(){var d=a.extend(!0,{},b);new c(a(this),d)})),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each((function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)})),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c})),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c}));(function(root,factory){if(typeof define==="function"&&define.amd){define("sifter",factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.Sifter=factory()}})(this,(function(){var Sifter=function(items,settings){this.items=items;this.settings=settings||{diacritics:true}};Sifter.prototype.tokenize=function(query){query=trim(String(query||"").toLowerCase());if(!query||!query.length)return[];var i,n,regex,letter;var tokens=[];var words=query.split(/ +/);for(i=0,n=words.length;i<n;i++){regex=escape_regex(words[i]);if(this.settings.diacritics){for(letter in DIACRITICS){if(DIACRITICS.hasOwnProperty(letter)){regex=regex.replace(new RegExp(letter,"g"),DIACRITICS[letter])}}}tokens.push({string:words[i],regex:new RegExp(regex,"i")})}return tokens};Sifter.prototype.iterator=function(object,callback){var iterator;if(is_array(object)){iterator=Array.prototype.forEach||function(callback){for(var i=0,n=this.length;i<n;i++){callback(this[i],i,this)}}}else{iterator=function(callback){for(var key in this){if(this.hasOwnProperty(key)){callback(this[key],key,this)}}}}iterator.apply(object,[callback])};Sifter.prototype.getScoreFunction=function(search,options){var self,fields,tokens,token_count,nesting;self=this;search=self.prepareSearch(search,options);tokens=search.tokens;fields=search.options.fields;token_count=tokens.length;nesting=search.options.nesting;var scoreValue=function(value,token){var score,pos;if(!value)return 0;value=String(value||"");pos=value.search(token.regex);if(pos===-1)return 0;score=token.string.length/value.length;if(pos===0)score+=.5;return score};var scoreObject=function(){var field_count=fields.length;if(!field_count){return function(){return 0}}if(field_count===1){return function(token,data){return scoreValue(getattr(data,fields[0],nesting),token)}}return function(token,data){for(var i=0,sum=0;i<field_count;i++){sum+=scoreValue(getattr(data,fields[i],nesting),token)}return sum/field_count}}();if(!token_count){return function(){return 0}}if(token_count===1){return function(data){return scoreObject(tokens[0],data)}}if(search.options.conjunction==="and"){return function(data){var score;for(var i=0,sum=0;i<token_count;i++){score=scoreObject(tokens[i],data);if(score<=0)return 0;sum+=score}return sum/token_count}}else{return function(data){for(var i=0,sum=0;i<token_count;i++){sum+=scoreObject(tokens[i],data)}return sum/token_count}}};Sifter.prototype.getSortFunction=function(search,options){var i,n,self,field,fields,fields_count,multiplier,multipliers,get_field,implicit_score,sort;self=this;search=self.prepareSearch(search,options);sort=!search.query&&options.sort_empty||options.sort;get_field=function(name,result){if(name==="$score")return result.score;return getattr(self.items[result.id],name,options.nesting)};fields=[];if(sort){for(i=0,n=sort.length;i<n;i++){if(search.query||sort[i].field!=="$score"){fields.push(sort[i])}}}if(search.query){implicit_score=true;for(i=0,n=fields.length;i<n;i++){if(fields[i].field==="$score"){implicit_score=false;break}}if(implicit_score){fields.unshift({field:"$score",direction:"desc"})}}else{for(i=0,n=fields.length;i<n;i++){if(fields[i].field==="$score"){fields.splice(i,1);break}}}multipliers=[];for(i=0,n=fields.length;i<n;i++){multipliers.push(fields[i].direction==="desc"?-1:1)}fields_count=fields.length;if(!fields_count){return null}else if(fields_count===1){field=fields[0].field;multiplier=multipliers[0];return function(a,b){return multiplier*cmp(get_field(field,a),get_field(field,b))}}else{return function(a,b){var i,result,a_value,b_value,field;for(i=0;i<fields_count;i++){field=fields[i].field;result=multipliers[i]*cmp(get_field(field,a),get_field(field,b));if(result)return result}return 0}}};Sifter.prototype.prepareSearch=function(query,options){if(typeof query==="object")return query;options=extend({},options);var option_fields=options.fields;var option_sort=options.sort;var option_sort_empty=options.sort_empty;if(option_fields&&!is_array(option_fields))options.fields=[option_fields];if(option_sort&&!is_array(option_sort))options.sort=[option_sort];if(option_sort_empty&&!is_array(option_sort_empty))options.sort_empty=[option_sort_empty];return{options:options,query:String(query||"").toLowerCase(),tokens:this.tokenize(query),total:0,items:[]}};Sifter.prototype.search=function(query,options){var self=this,value,score,search,calculateScore;var fn_sort;var fn_score;search=this.prepareSearch(query,options);options=search.options;query=search.query;fn_score=options.score||self.getScoreFunction(search);if(query.length){self.iterator(self.items,(function(item,id){score=fn_score(item);if(options.filter===false||score>0){search.items.push({score:score,id:id})}}))}else{self.iterator(self.items,(function(item,id){search.items.push({score:1,id:id})}))}fn_sort=self.getSortFunction(search,options);if(fn_sort)search.items.sort(fn_sort);search.total=search.items.length;if(typeof options.limit==="number"){search.items=search.items.slice(0,options.limit)}return search};var cmp=function(a,b){if(typeof a==="number"&&typeof b==="number"){return a>b?1:a<b?-1:0}a=asciifold(String(a||""));b=asciifold(String(b||""));if(a>b)return 1;if(b>a)return-1;return 0};var extend=function(a,b){var i,n,k,object;for(i=1,n=arguments.length;i<n;i++){object=arguments[i];if(!object)continue;for(k in object){if(object.hasOwnProperty(k)){a[k]=object[k]}}}return a};var getattr=function(obj,name,nesting){if(!obj||!name)return;if(!nesting)return obj[name];var names=name.split(".");while(names.length&&(obj=obj[names.shift()]));return obj};var trim=function(str){return(str+"").replace(/^\s+|\s+$|/g,"")};var escape_regex=function(str){return(str+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")};var is_array=Array.isArray||typeof $!=="undefined"&&$.isArray||function(object){return Object.prototype.toString.call(object)==="[object Array]"};var DIACRITICS={a:"[aá¸€á¸�Ä‚ÄƒÃ‚Ã¢Ç�ÇŽÈºâ±¥È¦È§áº áº¡Ã„Ã¤Ã€Ã Ã�Ã¡Ä€Ä�ÃƒÃ£Ã…Ã¥Ä…Ä„ÃƒÄ…Ä„]",b:"[bâ�¢Î²Î’Bà¸¿ð�Œ�á›’]",c:"[cÄ†Ä‡ÄˆÄ‰ÄŒÄ�ÄŠÄ‹CÌ„cÌ„Ã‡Ã§á¸ˆá¸‰È»È¼Æ‡ÆˆÉ•á´„ï¼£ï½ƒ]",d:"[dÄŽÄ�á¸Šá¸‹á¸�á¸‘á¸Œá¸�á¸’á¸“á¸Žá¸�Ä�Ä‘DÌ¦dÌ¦Æ‰É–ÆŠÉ—Æ‹ÆŒáµ­á¶�á¶‘È¡á´…ï¼¤ï½„Ã°]",e:"[eÃ‰Ã©ÃˆÃ¨ÃŠÃªá¸˜á¸™ÄšÄ›Ä”Ä•áº¼áº½á¸šá¸›áººáº»Ä–Ä—Ã‹Ã«Ä’Ä“È¨È©Ä˜Ä™á¶’É†É‡È„È…áº¾áº¿á»€á»�á»„á»…á»‚á»ƒá¸œá¸�á¸–á¸—á¸”á¸•È†È‡áº¸áº¹á»†á»‡â±¸á´‡ï¼¥ï½…É˜Ç�Æ�Æ�Îµ]",f:"[fÆ‘Æ’á¸žá¸Ÿ]",g:"[gÉ¢â‚²Ç¤Ç¥ÄœÄ�ÄžÄŸÄ¢Ä£Æ“É Ä Ä¡]",h:"[hÄ¤Ä¥Ä¦Ä§á¸¨á¸©áº–áº–á¸¤á¸¥á¸¢á¸£É¦Ê°Ç¶Æ•]",i:"[iÃ�Ã­ÃŒÃ¬Ä¬Ä­ÃŽÃ®Ç�Ç�Ã�Ã¯á¸®á¸¯Ä¨Ä©Ä®Ä¯ÄªÄ«á»ˆá»‰ÈˆÈ‰ÈŠÈ‹á»Šá»‹á¸¬á¸­Æ—É¨É¨Ì†áµ»á¶–Ä°iIÄ±Éªï¼©ï½‰]",j:"[jÈ·Ä´ÄµÉˆÉ‰Ê�ÉŸÊ²]",k:"[kÆ˜Æ™ê�€ê��á¸°á¸±Ç¨Ç©á¸²á¸³á¸´á¸µÎºÏ°â‚­]",l:"[lÅ�Å‚Ä½Ä¾Ä»Ä¼Ä¹Äºá¸¶á¸·á¸¸á¸¹á¸¼á¸½á¸ºá¸»Ä¿Å€È½Æšâ± â±¡â±¢É«É¬á¶…É­È´ÊŸï¼¬ï½Œ]",n:"[nÅƒÅ„Ç¸Ç¹Å‡ÅˆÃ‘Ã±á¹„á¹…Å…Å†á¹†á¹‡á¹Šá¹‹á¹ˆá¹‰NÌˆnÌˆÆ�É²È Æžáµ°á¶‡É³ÈµÉ´ï¼®ï½ŽÅŠÅ‹]",o:"[oÃ˜Ã¸Ã–Ã¶Ã“Ã³Ã’Ã²Ã”Ã´Ç‘Ç’Å�Å‘ÅŽÅ�È®È¯á»Œá»�ÆŸÉµÆ Æ¡á»Žá»�ÅŒÅ�Ã•ÃµÇªÇ«ÈŒÈ�Õ•Ö…]",p:"[pá¹”á¹•á¹–á¹—â±£áµ½Æ¤Æ¥áµ±]",q:"[qê�–ê�—Ê ÉŠÉ‹ê�˜ê�™qÌƒ]",r:"[rÅ”Å•ÉŒÉ�Å˜Å™Å–Å—á¹˜á¹™È�È‘È’È“á¹šá¹›â±¤É½]",s:"[sÅšÅ›á¹ á¹¡á¹¢á¹£êž¨êž©ÅœÅ�Å Å¡ÅžÅŸÈ˜È™SÌˆsÌˆ]",t:"[tÅ¤Å¥á¹ªá¹«Å¢Å£á¹¬á¹­Æ®ÊˆÈšÈ›á¹°á¹±á¹®á¹¯Æ¬Æ­]",u:"[uÅ¬Å­É„Ê‰á»¤á»¥ÃœÃ¼ÃšÃºÃ™Ã¹Ã›Ã»Ç“Ç”Å°Å±Å¬Å­Æ¯Æ°á»¦á»§ÅªÅ«Å¨Å©Å²Å³È”È•âˆª]",v:"[vá¹¼á¹½á¹¾á¹¿Æ²Ê‹ê�žê�Ÿâ±±Ê‹]",w:"[wáº‚áºƒáº€áº�Å´Åµáº„áº…áº†áº‡áºˆáº‰]",x:"[xáºŒáº�áºŠáº‹Ï‡]",y:"[yÃ�Ã½á»²á»³Å¶Å·Å¸Ã¿á»¸á»¹áºŽáº�á»´á»µÉŽÉ�Æ³Æ´]",z:"[zÅ¹Åºáº�áº‘Å½Å¾Å»Å¼áº’áº“áº”áº•ÆµÆ¶]"};var asciifold=function(){var i,n,k,chunk;var foreignletters="";var lookup={};for(k in DIACRITICS){if(DIACRITICS.hasOwnProperty(k)){chunk=DIACRITICS[k].substring(2,DIACRITICS[k].length-1);foreignletters+=chunk;for(i=0,n=chunk.length;i<n;i++){lookup[chunk.charAt(i)]=k}}}var regexp=new RegExp("["+foreignletters+"]","g");return function(str){return str.replace(regexp,(function(foreignletter){return lookup[foreignletter]})).toLowerCase()}}();return Sifter}));(function(root,factory){if(typeof define==="function"&&define.amd){define("microplugin",factory)}else if(typeof exports==="object"){module.exports=factory()}else{root.MicroPlugin=factory()}})(this,(function(){var MicroPlugin={};MicroPlugin.mixin=function(Interface){Interface.plugins={};Interface.prototype.initializePlugins=function(plugins){var i,n,key;var self=this;var queue=[];self.plugins={names:[],settings:{},requested:{},loaded:{}};if(utils.isArray(plugins)){for(i=0,n=plugins.length;i<n;i++){if(typeof plugins[i]==="string"){queue.push(plugins[i])}else{self.plugins.settings[plugins[i].name]=plugins[i].options;queue.push(plugins[i].name)}}}else if(plugins){for(key in plugins){if(plugins.hasOwnProperty(key)){self.plugins.settings[key]=plugins[key];queue.push(key)}}}while(queue.length){self.require(queue.shift())}};Interface.prototype.loadPlugin=function(name){var self=this;var plugins=self.plugins;var plugin=Interface.plugins[name];if(!Interface.plugins.hasOwnProperty(name)){throw new Error('Unable to find "'+name+'" plugin')}plugins.requested[name]=true;plugins.loaded[name]=plugin.fn.apply(self,[self.plugins.settings[name]||{}]);plugins.names.push(name)};Interface.prototype.require=function(name){var self=this;var plugins=self.plugins;if(!self.plugins.loaded.hasOwnProperty(name)){if(plugins.requested[name]){throw new Error('Plugin has circular dependency ("'+name+'")')}self.loadPlugin(name)}return plugins.loaded[name]};Interface.define=function(name,fn){Interface.plugins[name]={name:name,fn:fn}}};var utils={isArray:Array.isArray||function(vArg){return Object.prototype.toString.call(vArg)==="[object Array]"}};return MicroPlugin}));(function(root,factory){if(typeof define==="function"&&define.amd){define("selectize",["jquery","sifter","microplugin"],factory)}else if(typeof exports==="object"){module.exports=factory(require("jquery"),require("sifter"),require("microplugin"))}else{root.Selectize=factory(root.jQuery,root.Sifter,root.MicroPlugin)}})(this,(function($,Sifter,MicroPlugin){"use strict";var highlight=function($element,pattern){if(typeof pattern==="string"&&!pattern.length)return;var regex=typeof pattern==="string"?new RegExp(pattern,"i"):pattern;var highlight=function(node){var skip=0;if(node.nodeType===3){var pos=node.data.search(regex);if(pos>=0&&node.data.length>0){var match=node.data.match(regex);var spannode=document.createElement("span");spannode.className="highlight";var middlebit=node.splitText(pos);var endbit=middlebit.splitText(match[0].length);var middleclone=middlebit.cloneNode(true);spannode.appendChild(middleclone);middlebit.parentNode.replaceChild(spannode,middlebit);skip=1}}else if(node.nodeType===1&&node.childNodes&&!/(script|style)/i.test(node.tagName)&&(node.className!=="highlight"||node.tagName!=="SPAN")){for(var i=0;i<node.childNodes.length;++i){i+=highlight(node.childNodes[i])}}return skip};return $element.each((function(){highlight(this)}))};$.fn.removeHighlight=function(){return this.find("span.highlight").each((function(){this.parentNode.firstChild.nodeName;var parent=this.parentNode;parent.replaceChild(this.firstChild,this);parent.normalize()})).end()};var MicroEvent=function(){};MicroEvent.prototype={on:function(event,fct){this._events=this._events||{};this._events[event]=this._events[event]||[];this._events[event].push(fct)},off:function(event,fct){var n=arguments.length;if(n===0)return delete this._events;if(n===1)return delete this._events[event];this._events=this._events||{};if(event in this._events===false)return;this._events[event].splice(this._events[event].indexOf(fct),1)},trigger:function(event){this._events=this._events||{};if(event in this._events===false)return;for(var i=0;i<this._events[event].length;i++){this._events[event][i].apply(this,Array.prototype.slice.call(arguments,1))}}};MicroEvent.mixin=function(destObject){var props=["on","off","trigger"];for(var i=0;i<props.length;i++){destObject.prototype[props[i]]=MicroEvent.prototype[props[i]]}};var IS_MAC=/Mac/.test(navigator.userAgent);var KEY_A=65;var KEY_COMMA=188;var KEY_RETURN=13;var KEY_ESC=27;var KEY_LEFT=37;var KEY_UP=38;var KEY_P=80;var KEY_RIGHT=39;var KEY_DOWN=40;var KEY_N=78;var KEY_BACKSPACE=8;var KEY_DELETE=46;var KEY_SHIFT=16;var KEY_CMD=IS_MAC?91:17;var KEY_CTRL=IS_MAC?18:17;var KEY_TAB=9;var TAG_SELECT=1;var TAG_INPUT=2;var SUPPORTS_VALIDITY_API=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity;var isset=function(object){return typeof object!=="undefined"};var hash_key=function(value){if(typeof value==="undefined"||value===null)return null;if(typeof value==="boolean")return value?"1":"0";return value+""};var escape_html=function(str){return(str+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")};var escape_replace=function(str){return(str+"").replace(/\$/g,"$$$$")};var hook={};hook.before=function(self,method,fn){var original=self[method];self[method]=function(){fn.apply(self,arguments);return original.apply(self,arguments)}};hook.after=function(self,method,fn){var original=self[method];self[method]=function(){var result=original.apply(self,arguments);fn.apply(self,arguments);return result}};var once=function(fn){var called=false;return function(){if(called)return;called=true;fn.apply(this,arguments)}};var debounce=function(fn,delay){var timeout;return function(){var self=this;var args=arguments;window.clearTimeout(timeout);timeout=window.setTimeout((function(){fn.apply(self,args)}),delay)}};var debounce_events=function(self,types,fn){var type;var trigger=self.trigger;var event_args={};self.trigger=function(){var type=arguments[0];if(types.indexOf(type)!==-1){event_args[type]=arguments}else{return trigger.apply(self,arguments)}};fn.apply(self,[]);self.trigger=trigger;for(type in event_args){if(event_args.hasOwnProperty(type)){trigger.apply(self,event_args[type])}}};var watchChildEvent=function($parent,event,selector,fn){$parent.on(event,selector,(function(e){var child=e.target;while(child&&child.parentNode!==$parent[0]){child=child.parentNode}e.currentTarget=child;return fn.apply(this,[e])}))};var getSelection=function(input){var result={};if("selectionStart"in input){result.start=input.selectionStart;result.length=input.selectionEnd-result.start}else if(document.selection){input.focus();var sel=document.selection.createRange();var selLen=document.selection.createRange().text.length;sel.moveStart("character",-input.value.length);result.start=sel.text.length-selLen;result.length=selLen}return result};var transferStyles=function($from,$to,properties){var i,n,styles={};if(properties){for(i=0,n=properties.length;i<n;i++){styles[properties[i]]=$from.css(properties[i])}}else{styles=$from.css()}$to.css(styles)};var measureString=function(str,$parent){if(!str){return 0}if(!Selectize.$testInput){Selectize.$testInput=$("<span />").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).appendTo("body")}Selectize.$testInput.text(str);transferStyles($parent,Selectize.$testInput,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);return Selectize.$testInput.width()};var autoGrow=function($input){var currentWidth=null;var update=function(e,options){var value,keyCode,printable,placeholder,width;var shift,character,selection;e=e||window.event||{};options=options||{};if(e.metaKey||e.altKey)return;if(!options.force&&$input.data("grow")===false)return;value=$input.val();if(e.type&&e.type.toLowerCase()==="keydown"){keyCode=e.keyCode;printable=keyCode>=48&&keyCode<=57||keyCode>=65&&keyCode<=90||keyCode>=96&&keyCode<=111||keyCode>=186&&keyCode<=222||keyCode===32;if(keyCode===KEY_DELETE||keyCode===KEY_BACKSPACE){selection=getSelection($input[0]);if(selection.length){value=value.substring(0,selection.start)+value.substring(selection.start+selection.length)}else if(keyCode===KEY_BACKSPACE&&selection.start){value=value.substring(0,selection.start-1)+value.substring(selection.start+1)}else if(keyCode===KEY_DELETE&&typeof selection.start!=="undefined"){value=value.substring(0,selection.start)+value.substring(selection.start+1)}}else if(printable){shift=e.shiftKey;character=String.fromCharCode(e.keyCode);if(shift)character=character.toUpperCase();else character=character.toLowerCase();value+=character}}placeholder=$input.attr("placeholder");if(!value&&placeholder){value=placeholder}width=measureString(value,$input)+4;if(width!==currentWidth){currentWidth=width;$input.width(width);$input.triggerHandler("resize")}};$input.on("keydown keyup update blur",update);update()};var domToString=function(d){var tmp=document.createElement("div");tmp.appendChild(d.cloneNode(true));return tmp.innerHTML};var logError=function(message,options){if(!options)options={};var component="Selectize";console.error(component+": "+message);if(options.explanation){if(console.group)console.group();console.error(options.explanation);if(console.group)console.groupEnd()}};var Selectize=function($input,settings){var key,i,n,dir,input,self=this;input=$input[0];input.selectize=self;var computedStyle=window.getComputedStyle&&window.getComputedStyle(input,null);dir=computedStyle?computedStyle.getPropertyValue("direction"):input.currentStyle&&input.currentStyle.direction;dir=dir||$input.parents("[dir]:first").attr("dir")||"";$.extend(self,{order:0,settings:settings,$input:$input,tabIndex:$input.attr("tabindex")||"",tagType:input.tagName.toLowerCase()==="select"?TAG_SELECT:TAG_INPUT,rtl:/rtl/i.test(dir),eventNS:".selectize"+ ++Selectize.count,highlightedValue:null,isBlurring:false,isOpen:false,isDisabled:false,isRequired:$input.is("[required]"),isInvalid:false,isLocked:false,isFocused:false,isInputHidden:false,isSetup:false,isShiftDown:false,isCmdDown:false,isCtrlDown:false,ignoreFocus:false,ignoreBlur:false,ignoreHover:false,hasOptions:false,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:settings.loadThrottle===null?self.onSearchChange:debounce(self.onSearchChange,settings.loadThrottle)});self.sifter=new Sifter(this.options,{diacritics:settings.diacritics});if(self.settings.options){for(i=0,n=self.settings.options.length;i<n;i++){self.registerOption(self.settings.options[i])}delete self.settings.options}if(self.settings.optgroups){for(i=0,n=self.settings.optgroups.length;i<n;i++){self.registerOptionGroup(self.settings.optgroups[i])}delete self.settings.optgroups}self.settings.mode=self.settings.mode||(self.settings.maxItems===1?"single":"multi");if(typeof self.settings.hideSelected!=="boolean"){self.settings.hideSelected=self.settings.mode==="multi"}self.initializePlugins(self.settings.plugins);self.setupCallbacks();self.setupTemplates();self.setup()};MicroEvent.mixin(Selectize);if(typeof MicroPlugin!=="undefined"){MicroPlugin.mixin(Selectize)}else{logError("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" '+"version of Selectize, or (2) require MicroPlugin before you "+"load Selectize."})}$.extend(Selectize.prototype,{setup:function(){var self=this;var settings=self.settings;var eventNS=self.eventNS;var $window=$(window);var $document=$(document);var $input=self.$input;var $wrapper;var $control;var $control_input;var $dropdown;var $dropdown_content;var $dropdown_parent;var inputMode;var timeout_blur;var timeout_focus;var classes;var classes_plugins;var inputId;inputMode=self.settings.mode;classes=$input.attr("class")||"";$wrapper=$("<div>").addClass(settings.wrapperClass).addClass(classes).addClass(inputMode);$control=$("<div>").addClass(settings.inputClass).addClass("items").appendTo($wrapper);$control_input=$('<input type="text" autocomplete="off" />').appendTo($control).attr("tabindex",$input.is(":disabled")?"-1":self.tabIndex);$dropdown_parent=$(settings.dropdownParent||$wrapper);$dropdown=$("<div>").addClass(settings.dropdownClass).addClass(inputMode).hide().appendTo($dropdown_parent);$dropdown_content=$("<div>").addClass(settings.dropdownContentClass).appendTo($dropdown);if(inputId=$input.attr("id")){$control_input.attr("id",inputId+"-selectized");$("label[for='"+inputId+"']").attr("for",inputId+"-selectized")}if(self.settings.copyClassesToDropdown){$dropdown.addClass(classes)}$wrapper.css({width:$input[0].style.width});if(self.plugins.names.length){classes_plugins="plugin-"+self.plugins.names.join(" plugin-");$wrapper.addClass(classes_plugins);$dropdown.addClass(classes_plugins)}if((settings.maxItems===null||settings.maxItems>1)&&self.tagType===TAG_SELECT){$input.attr("multiple","multiple")}if(self.settings.placeholder){$control_input.attr("placeholder",settings.placeholder)}if(!self.settings.splitOn&&self.settings.delimiter){var delimiterEscaped=self.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");self.settings.splitOn=new RegExp("\\s*"+delimiterEscaped+"+\\s*")}if($input.attr("autocorrect")){$control_input.attr("autocorrect",$input.attr("autocorrect"))}if($input.attr("autocapitalize")){$control_input.attr("autocapitalize",$input.attr("autocapitalize"))}$control_input[0].type=$input[0].type;self.$wrapper=$wrapper;self.$control=$control;self.$control_input=$control_input;self.$dropdown=$dropdown;self.$dropdown_content=$dropdown_content;$dropdown.on("mouseenter mousedown click","[data-disabled]>[data-selectable]",(function(e){e.stopImmediatePropagation()}));$dropdown.on("mouseenter","[data-selectable]",(function(){return self.onOptionHover.apply(self,arguments)}));$dropdown.on("mousedown click","[data-selectable]",(function(){return self.onOptionSelect.apply(self,arguments)}));watchChildEvent($control,"mousedown","*:not(input)",(function(){return self.onItemSelect.apply(self,arguments)}));autoGrow($control_input);$control.on({mousedown:function(){return self.onMouseDown.apply(self,arguments)},click:function(){return self.onClick.apply(self,arguments)}});$control_input.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return self.onKeyDown.apply(self,arguments)},keyup:function(){return self.onKeyUp.apply(self,arguments)},keypress:function(){return self.onKeyPress.apply(self,arguments)},resize:function(){self.positionDropdown.apply(self,[])},blur:function(){return self.onBlur.apply(self,arguments)},focus:function(){self.ignoreBlur=false;return self.onFocus.apply(self,arguments)},paste:function(){return self.onPaste.apply(self,arguments)}});$document.on("keydown"+eventNS,(function(e){self.isCmdDown=e[IS_MAC?"metaKey":"ctrlKey"];self.isCtrlDown=e[IS_MAC?"altKey":"ctrlKey"];self.isShiftDown=e.shiftKey}));$document.on("keyup"+eventNS,(function(e){if(e.keyCode===KEY_CTRL)self.isCtrlDown=false;if(e.keyCode===KEY_SHIFT)self.isShiftDown=false;if(e.keyCode===KEY_CMD)self.isCmdDown=false}));$document.on("mousedown"+eventNS,(function(e){if(self.isFocused){if(e.target===self.$dropdown[0]||e.target.parentNode===self.$dropdown[0]){return false}if(!self.$control.has(e.target).length&&e.target!==self.$control[0]){self.blur(e.target)}}}));$window.on(["scroll"+eventNS,"resize"+eventNS].join(" "),(function(){if(self.isOpen){self.positionDropdown.apply(self,arguments)}}));$window.on("mousemove"+eventNS,(function(){self.ignoreHover=false}));this.revertSettings={$children:$input.children().detach(),tabindex:$input.attr("tabindex")};$input.attr("tabindex",-1).hide().after(self.$wrapper);if($.isArray(settings.items)){self.setValue(settings.items);delete settings.items}if(SUPPORTS_VALIDITY_API){$input.on("invalid"+eventNS,(function(e){e.preventDefault();self.isInvalid=true;self.refreshState()}))}self.updateOriginalInput();self.refreshItems();self.refreshState();self.updatePlaceholder();self.isSetup=true;if($input.is(":disabled")){self.disable()}self.on("change",this.onChange);$input.data("selectize",self);$input.addClass("selectized");self.trigger("initialize");if(settings.preload===true){self.onSearchChange("")}},setupTemplates:function(){var self=this;var field_label=self.settings.labelField;var field_optgroup=self.settings.optgroupLabelField;var templates={optgroup:function(data){return'<div class="optgroup">'+data.html+"</div>"},optgroup_header:function(data,escape){return'<div class="optgroup-header">'+escape(data[field_optgroup])+"</div>"},option:function(data,escape){return'<div class="option">'+escape(data[field_label])+"</div>"},item:function(data,escape){return'<div class="item">'+escape(data[field_label])+"</div>"},option_create:function(data,escape){return'<div class="create">Add <strong>'+escape(data.input)+"</strong>&hellip;</div>"}};self.settings.render=$.extend({},templates,self.settings.render)},setupCallbacks:function(){var key,fn,callbacks={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(key in callbacks){if(callbacks.hasOwnProperty(key)){fn=this.settings[callbacks[key]];if(fn)this.on(key,fn)}}},onClick:function(e){var self=this;if(!self.isFocused||!self.isOpen){self.focus();e.preventDefault()}},onMouseDown:function(e){var self=this;var defaultPrevented=e.isDefaultPrevented();var $target=$(e.target);if(self.isFocused){if(e.target!==self.$control_input[0]){if(self.settings.mode==="single"){self.isOpen?self.close():self.open()}else if(!defaultPrevented){self.setActiveItem(null)}return false}}else{if(!defaultPrevented){window.setTimeout((function(){self.focus()}),0)}}},onChange:function(){this.$input.trigger("change")},onPaste:function(e){var self=this;if(self.isFull()||self.isInputHidden||self.isLocked){e.preventDefault();return}if(self.settings.splitOn){setTimeout((function(){var pastedText=self.$control_input.val();if(!pastedText.match(self.settings.splitOn)){return}var splitInput=$.trim(pastedText).split(self.settings.splitOn);for(var i=0,n=splitInput.length;i<n;i++){self.createItem(splitInput[i])}}),0)}},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault();var character=String.fromCharCode(e.keyCode||e.which);if(this.settings.create&&this.settings.mode==="multi"&&character===this.settings.delimiter){this.createItem();e.preventDefault();return false}},onKeyDown:function(e){var isInput=e.target===this.$control_input[0];var self=this;if(self.isLocked){if(e.keyCode!==KEY_TAB){e.preventDefault()}return}switch(e.keyCode){case KEY_A:if(self.isCmdDown){self.selectAll();return}break;case KEY_ESC:if(self.isOpen){e.preventDefault();e.stopPropagation();self.close()}return;case KEY_N:if(!e.ctrlKey||e.altKey)break;case KEY_DOWN:if(!self.isOpen&&self.hasOptions){self.open()}else if(self.$activeOption){self.ignoreHover=true;var $next=self.getAdjacentOption(self.$activeOption,1);if($next.length)self.setActiveOption($next,true,true)}e.preventDefault();return;case KEY_P:if(!e.ctrlKey||e.altKey)break;case KEY_UP:if(self.$activeOption){self.ignoreHover=true;var $prev=self.getAdjacentOption(self.$activeOption,-1);if($prev.length)self.setActiveOption($prev,true,true)}e.preventDefault();return;case KEY_RETURN:if(self.isOpen&&self.$activeOption){self.onOptionSelect({currentTarget:self.$activeOption});e.preventDefault()}return;case KEY_LEFT:self.advanceSelection(-1,e);return;case KEY_RIGHT:self.advanceSelection(1,e);return;case KEY_TAB:if(self.settings.selectOnTab&&self.isOpen&&self.$activeOption){self.onOptionSelect({currentTarget:self.$activeOption});if(!self.isFull()){e.preventDefault()}}if(self.settings.create&&self.createItem()){e.preventDefault()}return;case KEY_BACKSPACE:case KEY_DELETE:self.deleteSelection(e);return}if((self.isFull()||self.isInputHidden)&&!(IS_MAC?e.metaKey:e.ctrlKey)){e.preventDefault();return}},onKeyUp:function(e){var self=this;if(self.isLocked)return e&&e.preventDefault();var value=self.$control_input.val()||"";if(self.lastValue!==value){self.lastValue=value;self.onSearchChange(value);self.refreshOptions();self.trigger("type",value)}},onSearchChange:function(value){var self=this;var fn=self.settings.load;if(!fn)return;if(self.loadedSearches.hasOwnProperty(value))return;self.loadedSearches[value]=true;self.load((function(callback){fn.apply(self,[value,callback])}))},onFocus:function(e){var self=this;var wasFocused=self.isFocused;if(self.isDisabled){self.blur();e&&e.preventDefault();return false}if(self.ignoreFocus)return;self.isFocused=true;if(self.settings.preload==="focus")self.onSearchChange("");if(!wasFocused)self.trigger("focus");if(!self.$activeItems.length){self.showInput();self.setActiveItem(null);self.refreshOptions(!!self.settings.openOnFocus)}self.refreshState()},onBlur:function(e,dest){var self=this;if(!self.isFocused)return;self.isFocused=false;if(self.ignoreFocus){return}else if(!self.ignoreBlur&&document.activeElement===self.$dropdown_content[0]){self.ignoreBlur=true;self.onFocus(e);return}var deactivate=function(){self.close();self.setTextboxValue("");self.setActiveItem(null);self.setActiveOption(null);self.setCaret(self.items.length);self.refreshState();dest&&dest.focus&&dest.focus();self.isBlurring=false;self.ignoreFocus=false;self.trigger("blur")};self.isBlurring=true;self.ignoreFocus=true;if(self.settings.create&&self.settings.createOnBlur){self.createItem(null,false,deactivate)}else{deactivate()}},onOptionHover:function(e){if(this.ignoreHover)return;this.setActiveOption(e.currentTarget,false)},onOptionSelect:function(e){var value,$target,$option,self=this;if(e.preventDefault){e.preventDefault();e.stopPropagation()}$target=$(e.currentTarget);if($target.hasClass("create")){self.createItem(null,(function(){if(self.settings.closeAfterSelect){self.close()}}))}else{value=$target.attr("data-value");if(typeof value!=="undefined"){self.lastQuery=null;self.setTextboxValue("");self.addItem(value);if(self.settings.closeAfterSelect){self.close()}else if(!self.settings.hideSelected&&e.type&&/mouse/.test(e.type)){self.setActiveOption(self.getOption(value))}}}},onItemSelect:function(e){var self=this;if(self.isLocked)return;if(self.settings.mode==="multi"){e.preventDefault();self.setActiveItem(e.currentTarget,e)}},load:function(fn){var self=this;var $wrapper=self.$wrapper.addClass(self.settings.loadingClass);self.loading++;fn.apply(self,[function(results){self.loading=Math.max(self.loading-1,0);if(results&&results.length){self.addOption(results);self.refreshOptions(self.isFocused&&!self.isInputHidden)}if(!self.loading){$wrapper.removeClass(self.settings.loadingClass)}self.trigger("load",results)}])},setTextboxValue:function(value){var $input=this.$control_input;var changed=$input.val()!==value;if(changed){$input.val(value).triggerHandler("update");this.lastValue=value}},getValue:function(){if(this.tagType===TAG_SELECT&&this.$input.attr("multiple")){return this.items}else{return this.items.join(this.settings.delimiter)}},setValue:function(value,silent){var events=silent?[]:["change"];debounce_events(this,events,(function(){this.clear(silent);this.addItems(value,silent)}))},setActiveItem:function($item,e){var self=this;var eventName;var i,idx,begin,end,item,swap;var $last;if(self.settings.mode==="single")return;$item=$($item);if(!$item.length){$(self.$activeItems).removeClass("active");self.$activeItems=[];if(self.isFocused){self.showInput()}return}eventName=e&&e.type.toLowerCase();if(eventName==="mousedown"&&self.isShiftDown&&self.$activeItems.length){$last=self.$control.children(".active:last");begin=Array.prototype.indexOf.apply(self.$control[0].childNodes,[$last[0]]);end=Array.prototype.indexOf.apply(self.$control[0].childNodes,[$item[0]]);if(begin>end){swap=begin;begin=end;end=swap}for(i=begin;i<=end;i++){item=self.$control[0].childNodes[i];if(self.$activeItems.indexOf(item)===-1){$(item).addClass("active");self.$activeItems.push(item)}}e.preventDefault()}else if(eventName==="mousedown"&&self.isCtrlDown||eventName==="keydown"&&this.isShiftDown){if($item.hasClass("active")){idx=self.$activeItems.indexOf($item[0]);self.$activeItems.splice(idx,1);$item.removeClass("active")}else{self.$activeItems.push($item.addClass("active")[0])}}else{$(self.$activeItems).removeClass("active");self.$activeItems=[$item.addClass("active")[0]]}self.hideInput();if(!this.isFocused){self.focus()}},setActiveOption:function($option,scroll,animate){var height_menu,height_item,y;var scroll_top,scroll_bottom;var self=this;if(self.$activeOption)self.$activeOption.removeClass("active");self.$activeOption=null;$option=$($option);if(!$option.length)return;self.$activeOption=$option.addClass("active");if(scroll||!isset(scroll)){height_menu=self.$dropdown_content.height();height_item=self.$activeOption.outerHeight(true);scroll=self.$dropdown_content.scrollTop()||0;y=self.$activeOption.offset().top-self.$dropdown_content.offset().top+scroll;scroll_top=y;scroll_bottom=y-height_menu+height_item;if(y+height_item>height_menu+scroll){self.$dropdown_content.stop().animate({scrollTop:scroll_bottom},animate?self.settings.scrollDuration:0)}else if(y<scroll){self.$dropdown_content.stop().animate({scrollTop:scroll_top},animate?self.settings.scrollDuration:0)}}},selectAll:function(){var self=this;if(self.settings.mode==="single")return;self.$activeItems=Array.prototype.slice.apply(self.$control.children(":not(input)").addClass("active"));if(self.$activeItems.length){self.hideInput();self.close()}self.focus()},hideInput:function(){var self=this;self.setTextboxValue("");self.$control_input.css({opacity:0,position:"absolute",left:self.rtl?1e4:-1e4});self.isInputHidden=true},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0});this.isInputHidden=false},focus:function(){var self=this;if(self.isDisabled)return;self.ignoreFocus=true;self.$control_input[0].focus();window.setTimeout((function(){self.ignoreFocus=false;self.onFocus()}),0)},blur:function(dest){this.$control_input[0].blur();this.onBlur(null,dest)},getScoreFunction:function(query){return this.sifter.getScoreFunction(query,this.getSearchOptions())},getSearchOptions:function(){var settings=this.settings;var sort=settings.sortField;if(typeof sort==="string"){sort=[{field:sort}]}return{fields:settings.searchField,conjunction:settings.searchConjunction,sort:sort,nesting:settings.nesting}},search:function(query){var i,value,score,result,calculateScore;var self=this;var settings=self.settings;var options=this.getSearchOptions();if(settings.score){calculateScore=self.settings.score.apply(this,[query]);if(typeof calculateScore!=="function"){throw new Error('Selectize "score" setting must be a function that returns a function')}}if(query!==self.lastQuery){self.lastQuery=query;result=self.sifter.search(query,$.extend(options,{score:calculateScore}));self.currentResults=result}else{result=$.extend(true,{},self.currentResults)}if(settings.hideSelected){for(i=result.items.length-1;i>=0;i--){if(self.items.indexOf(hash_key(result.items[i].id))!==-1){result.items.splice(i,1)}}}return result},refreshOptions:function(triggerDropdown){var i,j,k,n,groups,groups_order,option,option_html,optgroup,optgroups,html,html_children,has_create_option;var $active,$active_before,$create;if(typeof triggerDropdown==="undefined"){triggerDropdown=true}var self=this;var query=$.trim(self.$control_input.val());var results=self.search(query);var $dropdown_content=self.$dropdown_content;var active_before=self.$activeOption&&hash_key(self.$activeOption.attr("data-value"));n=results.items.length;if(typeof self.settings.maxOptions==="number"){n=Math.min(n,self.settings.maxOptions)}groups={};groups_order=[];for(i=0;i<n;i++){option=self.options[results.items[i].id];option_html=self.render("option",option);optgroup=option[self.settings.optgroupField]||"";optgroups=$.isArray(optgroup)?optgroup:[optgroup];for(j=0,k=optgroups&&optgroups.length;j<k;j++){optgroup=optgroups[j];if(!self.optgroups.hasOwnProperty(optgroup)){optgroup=""}if(!groups.hasOwnProperty(optgroup)){groups[optgroup]=document.createDocumentFragment();groups_order.push(optgroup)}groups[optgroup].appendChild(option_html)}}if(this.settings.lockOptgroupOrder){groups_order.sort((function(a,b){var a_order=self.optgroups[a].$order||0;var b_order=self.optgroups[b].$order||0;return a_order-b_order}))}html=document.createDocumentFragment();for(i=0,n=groups_order.length;i<n;i++){optgroup=groups_order[i];if(self.optgroups.hasOwnProperty(optgroup)&&groups[optgroup].childNodes.length){html_children=document.createDocumentFragment();html_children.appendChild(self.render("optgroup_header",self.optgroups[optgroup]));html_children.appendChild(groups[optgroup]);html.appendChild(self.render("optgroup",$.extend({},self.optgroups[optgroup],{html:domToString(html_children),dom:html_children})))}else{html.appendChild(groups[optgroup])}}$dropdown_content.html(html);if(self.settings.highlight){$dropdown_content.removeHighlight();if(results.query.length&&results.tokens.length){for(i=0,n=results.tokens.length;i<n;i++){highlight($dropdown_content,results.tokens[i].regex)}}}if(!self.settings.hideSelected){for(i=0,n=self.items.length;i<n;i++){self.getOption(self.items[i]).addClass("selected")}}has_create_option=self.canCreate(query);if(has_create_option){$dropdown_content.prepend(self.render("option_create",{input:query}));$create=$($dropdown_content[0].childNodes[0])}self.hasOptions=results.items.length>0||has_create_option;if(self.hasOptions){if(results.items.length>0){$active_before=active_before&&self.getOption(active_before);if($active_before&&$active_before.length){$active=$active_before}else if(self.settings.mode==="single"&&self.items.length){$active=self.getOption(self.items[0])}if(!$active||!$active.length){if($create&&!self.settings.addPrecedence){$active=self.getAdjacentOption($create,1)}else{$active=$dropdown_content.find("[data-selectable]:first")}}}else{$active=$create}self.setActiveOption($active);if(triggerDropdown&&!self.isOpen){self.open()}}else{self.setActiveOption(null);if(triggerDropdown&&self.isOpen){self.close()}}},addOption:function(data){var i,n,value,self=this;if($.isArray(data)){for(i=0,n=data.length;i<n;i++){self.addOption(data[i])}return}if(value=self.registerOption(data)){self.userOptions[value]=true;self.lastQuery=null;self.trigger("option_add",value,data)}},registerOption:function(data){var key=hash_key(data[this.settings.valueField]);if(typeof key==="undefined"||key===null||this.options.hasOwnProperty(key))return false;data.$order=data.$order||++this.order;this.options[key]=data;return key},registerOptionGroup:function(data){var key=hash_key(data[this.settings.optgroupValueField]);if(!key)return false;data.$order=data.$order||++this.order;this.optgroups[key]=data;return key},addOptionGroup:function(id,data){data[this.settings.optgroupValueField]=id;if(id=this.registerOptionGroup(data)){this.trigger("optgroup_add",id,data)}},removeOptionGroup:function(id){if(this.optgroups.hasOwnProperty(id)){delete this.optgroups[id];this.renderCache={};this.trigger("optgroup_remove",id)}},clearOptionGroups:function(){this.optgroups={};this.renderCache={};this.trigger("optgroup_clear")},updateOption:function(value,data){var self=this;var $item,$item_new;var value_new,index_item,cache_items,cache_options,order_old;value=hash_key(value);value_new=hash_key(data[self.settings.valueField]);if(value===null)return;if(!self.options.hasOwnProperty(value))return;if(typeof value_new!=="string")throw new Error("Value must be set in option data");order_old=self.options[value].$order;if(value_new!==value){delete self.options[value];index_item=self.items.indexOf(value);if(index_item!==-1){self.items.splice(index_item,1,value_new)}}data.$order=data.$order||order_old;self.options[value_new]=data;cache_items=self.renderCache["item"];cache_options=self.renderCache["option"];if(cache_items){delete cache_items[value];delete cache_items[value_new]}if(cache_options){delete cache_options[value];delete cache_options[value_new]}if(self.items.indexOf(value_new)!==-1){$item=self.getItem(value);$item_new=$(self.render("item",data));if($item.hasClass("active"))$item_new.addClass("active");$item.replaceWith($item_new)}self.lastQuery=null;if(self.isOpen){self.refreshOptions(false)}},removeOption:function(value,silent){var self=this;value=hash_key(value);var cache_items=self.renderCache["item"];var cache_options=self.renderCache["option"];if(cache_items)delete cache_items[value];if(cache_options)delete cache_options[value];delete self.userOptions[value];delete self.options[value];self.lastQuery=null;self.trigger("option_remove",value);self.removeItem(value,silent)},clearOptions:function(){var self=this;self.loadedSearches={};self.userOptions={};self.renderCache={};var options=self.options;$.each(self.options,(function(key,value){if(self.items.indexOf(key)==-1){delete options[key]}}));self.options=self.sifter.items=options;self.lastQuery=null;self.trigger("option_clear")},getOption:function(value){return this.getElementWithValue(value,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function($option,direction){var $options=this.$dropdown.find("[data-selectable]");var index=$options.index($option)+direction;return index>=0&&index<$options.length?$options.eq(index):$()},getElementWithValue:function(value,$els){value=hash_key(value);if(typeof value!=="undefined"&&value!==null){for(var i=0,n=$els.length;i<n;i++){if($els[i].getAttribute("data-value")===value){return $($els[i])}}}return $()},getItem:function(value){return this.getElementWithValue(value,this.$control.children())},addItems:function(values,silent){this.buffer=document.createDocumentFragment();var childNodes=this.$control[0].childNodes;for(var i=0;i<childNodes.length;i++){this.buffer.appendChild(childNodes[i])}var items=$.isArray(values)?values:[values];for(var i=0,n=items.length;i<n;i++){this.isPending=i<n-1;this.addItem(items[i],silent)}var control=this.$control[0];control.insertBefore(this.buffer,control.firstChild);this.buffer=null},addItem:function(value,silent){var events=silent?[]:["change"];debounce_events(this,events,(function(){var $item,$option,$options;var self=this;var inputMode=self.settings.mode;var i,active,value_next,wasFull;value=hash_key(value);if(self.items.indexOf(value)!==-1){if(inputMode==="single")self.close();return}if(!self.options.hasOwnProperty(value))return;if(inputMode==="single")self.clear(silent);if(inputMode==="multi"&&self.isFull())return;$item=$(self.render("item",self.options[value]));wasFull=self.isFull();self.items.splice(self.caretPos,0,value);self.insertAtCaret($item);if(!self.isPending||!wasFull&&self.isFull()){self.refreshState()}if(self.isSetup){$options=self.$dropdown_content.find("[data-selectable]");if(!self.isPending){$option=self.getOption(value);value_next=self.getAdjacentOption($option,1).attr("data-value");self.refreshOptions(self.isFocused&&inputMode!=="single");if(value_next){self.setActiveOption(self.getOption(value_next))}}if(!$options.length||self.isFull()){self.close()}else if(!self.isPending){self.positionDropdown()}self.updatePlaceholder();self.trigger("item_add",value,$item);if(!self.isPending){self.updateOriginalInput({silent:silent})}}}))},removeItem:function(value,silent){var self=this;var $item,i,idx;$item=value instanceof $?value:self.getItem(value);value=hash_key($item.attr("data-value"));i=self.items.indexOf(value);if(i!==-1){$item.remove();if($item.hasClass("active")){idx=self.$activeItems.indexOf($item[0]);self.$activeItems.splice(idx,1)}self.items.splice(i,1);self.lastQuery=null;if(!self.settings.persist&&self.userOptions.hasOwnProperty(value)){self.removeOption(value,silent)}if(i<self.caretPos){self.setCaret(self.caretPos-1)}self.refreshState();self.updatePlaceholder();self.updateOriginalInput({silent:silent});self.positionDropdown();self.trigger("item_remove",value,$item)}},createItem:function(input,triggerDropdown){var self=this;var caret=self.caretPos;input=input||$.trim(self.$control_input.val()||"");var callback=arguments[arguments.length-1];if(typeof callback!=="function")callback=function(){};if(typeof triggerDropdown!=="boolean"){triggerDropdown=true}if(!self.canCreate(input)){callback();return false}self.lock();var setup=typeof self.settings.create==="function"?this.settings.create:function(input){var data={};data[self.settings.labelField]=input;data[self.settings.valueField]=input;return data};var create=once((function(data){self.unlock();if(!data||typeof data!=="object")return callback();var value=hash_key(data[self.settings.valueField]);if(typeof value!=="string")return callback();self.setTextboxValue("");self.addOption(data);self.setCaret(caret);self.addItem(value);self.refreshOptions(triggerDropdown&&self.settings.mode!=="single");callback(data)}));var output=setup.apply(this,[input,create]);if(typeof output!=="undefined"){create(output)}return true},refreshItems:function(){this.lastQuery=null;if(this.isSetup){this.addItem(this.items)}this.refreshState();this.updateOriginalInput()},refreshState:function(){this.refreshValidityState();this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return false;var invalid=!this.items.length;this.isInvalid=invalid;this.$control_input.prop("required",invalid);this.$input.prop("required",!invalid)},refreshClasses:function(){var self=this;var isFull=self.isFull();var isLocked=self.isLocked;self.$wrapper.toggleClass("rtl",self.rtl);self.$control.toggleClass("focus",self.isFocused).toggleClass("disabled",self.isDisabled).toggleClass("required",self.isRequired).toggleClass("invalid",self.isInvalid).toggleClass("locked",isLocked).toggleClass("full",isFull).toggleClass("not-full",!isFull).toggleClass("input-active",self.isFocused&&!self.isInputHidden).toggleClass("dropdown-active",self.isOpen).toggleClass("has-options",!$.isEmptyObject(self.options)).toggleClass("has-items",self.items.length>0);self.$control_input.data("grow",!isFull&&!isLocked)},isFull:function(){return this.settings.maxItems!==null&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(opts){var i,n,options,label,self=this;opts=opts||{};if(self.tagType===TAG_SELECT){options=[];for(i=0,n=self.items.length;i<n;i++){label=self.options[self.items[i]][self.settings.labelField]||"";options.push('<option value="'+escape_html(self.items[i])+'" selected="selected">'+escape_html(label)+"</option>")}if(!options.length&&!this.$input.attr("multiple")){options.push('<option value="" selected="selected"></option>')}self.$input.html(options.join(""))}else{self.$input.val(self.getValue());self.$input.attr("value",self.$input.val())}if(self.isSetup){if(!opts.silent){self.trigger("change",self.$input.val())}}},updatePlaceholder:function(){if(!this.settings.placeholder)return;var $input=this.$control_input;if(this.items.length){$input.removeAttr("placeholder")}else{$input.attr("placeholder",this.settings.placeholder)}$input.triggerHandler("update",{force:true})},open:function(){var self=this;if(self.isLocked||self.isOpen||self.settings.mode==="multi"&&self.isFull())return;self.focus();self.isOpen=true;self.refreshState();self.$dropdown.css({visibility:"hidden",display:"block"});self.positionDropdown();self.$dropdown.css({visibility:"visible"});self.trigger("dropdown_open",self.$dropdown)},close:function(){var self=this;var trigger=self.isOpen;if(self.settings.mode==="single"&&self.items.length){self.hideInput();if(!self.isBlurring){self.$control_input.blur()}}self.isOpen=false;self.$dropdown.hide();self.setActiveOption(null);self.refreshState();if(trigger)self.trigger("dropdown_close",self.$dropdown)},positionDropdown:function(){var $control=this.$control;var offset=this.settings.dropdownParent==="body"?$control.offset():$control.position();offset.top+=$control.outerHeight(true);this.$dropdown.css({width:$control[0].getBoundingClientRect().width,top:offset.top,left:offset.left})},clear:function(silent){var self=this;if(!self.items.length)return;self.$control.children(":not(input)").remove();self.items=[];self.lastQuery=null;self.setCaret(0);self.setActiveItem(null);self.updatePlaceholder();self.updateOriginalInput({silent:silent});self.refreshState();self.showInput();self.trigger("clear")},insertAtCaret:function($el){var caret=Math.min(this.caretPos,this.items.length);var el=$el[0];var target=this.buffer||this.$control[0];if(caret===0){target.insertBefore(el,target.firstChild)}else{target.insertBefore(el,target.childNodes[caret])}this.setCaret(caret+1)},deleteSelection:function(e){var i,n,direction,selection,values,caret,option_select,$option_select,$tail;var self=this;direction=e&&e.keyCode===KEY_BACKSPACE?-1:1;selection=getSelection(self.$control_input[0]);if(self.$activeOption&&!self.settings.hideSelected){option_select=self.getAdjacentOption(self.$activeOption,-1).attr("data-value")}values=[];if(self.$activeItems.length){$tail=self.$control.children(".active:"+(direction>0?"last":"first"));caret=self.$control.children(":not(input)").index($tail);if(direction>0){caret++}for(i=0,n=self.$activeItems.length;i<n;i++){values.push($(self.$activeItems[i]).attr("data-value"))}if(e){e.preventDefault();e.stopPropagation()}}else if((self.isFocused||self.settings.mode==="single")&&self.items.length){if(direction<0&&selection.start===0&&selection.length===0){values.push(self.items[self.caretPos-1])}else if(direction>0&&selection.start===self.$control_input.val().length){values.push(self.items[self.caretPos])}}if(!values.length||typeof self.settings.onDelete==="function"&&self.settings.onDelete.apply(self,[values])===false){return false}if(typeof caret!=="undefined"){self.setCaret(caret)}while(values.length){self.removeItem(values.pop())}self.showInput();self.positionDropdown();self.refreshOptions(true);if(option_select){$option_select=self.getOption(option_select);if($option_select.length){self.setActiveOption($option_select)}}return true},advanceSelection:function(direction,e){var tail,selection,idx,valueLength,cursorAtEdge,$tail;var self=this;if(direction===0)return;if(self.rtl)direction*=-1;tail=direction>0?"last":"first";selection=getSelection(self.$control_input[0]);if(self.isFocused&&!self.isInputHidden){valueLength=self.$control_input.val().length;cursorAtEdge=direction<0?selection.start===0&&selection.length===0:selection.start===valueLength;if(cursorAtEdge&&!valueLength){self.advanceCaret(direction,e)}}else{$tail=self.$control.children(".active:"+tail);if($tail.length){idx=self.$control.children(":not(input)").index($tail);self.setActiveItem(null);self.setCaret(direction>0?idx+1:idx)}}},advanceCaret:function(direction,e){var self=this,fn,$adj;if(direction===0)return;fn=direction>0?"next":"prev";if(self.isShiftDown){$adj=self.$control_input[fn]();if($adj.length){self.hideInput();self.setActiveItem($adj);e&&e.preventDefault()}}else{self.setCaret(self.caretPos+direction)}},setCaret:function(i){var self=this;if(self.settings.mode==="single"){i=self.items.length}else{i=Math.max(0,Math.min(self.items.length,i))}if(!self.isPending){var j,n,fn,$children,$child;$children=self.$control.children(":not(input)");for(j=0,n=$children.length;j<n;j++){$child=$($children[j]).detach();if(j<i){self.$control_input.before($child)}else{self.$control.append($child)}}}self.caretPos=i},lock:function(){this.close();this.isLocked=true;this.refreshState()},unlock:function(){this.isLocked=false;this.refreshState()},disable:function(){var self=this;self.$input.prop("disabled",true);self.$control_input.prop("disabled",true).prop("tabindex",-1);self.isDisabled=true;self.lock()},enable:function(){var self=this;self.$input.prop("disabled",false);self.$control_input.prop("disabled",false).prop("tabindex",self.tabIndex);self.isDisabled=false;self.unlock()},destroy:function(){var self=this;var eventNS=self.eventNS;var revertSettings=self.revertSettings;self.trigger("destroy");self.off();self.$wrapper.remove();self.$dropdown.remove();self.$input.html("").append(revertSettings.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:revertSettings.tabindex}).show();self.$control_input.removeData("grow");self.$input.removeData("selectize");if(--Selectize.count==0&&Selectize.$testInput){Selectize.$testInput.remove();Selectize.$testInput=undefined}$(window).off(eventNS);$(document).off(eventNS);$(document.body).off(eventNS);delete self.$input[0].selectize},render:function(templateName,data){var value,id,label;var html="";var cache=false;var self=this;var regex_tag=/^[\t \r\n]*<([a-z][a-z0-9\-_]*(?:\:[a-z][a-z0-9\-_]*)?)/i;if(templateName==="option"||templateName==="item"){value=hash_key(data[self.settings.valueField]);cache=!!value}if(cache){if(!isset(self.renderCache[templateName])){self.renderCache[templateName]={}}if(self.renderCache[templateName].hasOwnProperty(value)){return self.renderCache[templateName][value]}}html=$(self.settings.render[templateName].apply(this,[data,escape_html]));if(templateName==="option"||templateName==="option_create"){if(!data[self.settings.disabledField]){html.attr("data-selectable","")}}else if(templateName==="optgroup"){id=data[self.settings.optgroupValueField]||"";html.attr("data-group",id);if(data[self.settings.disabledField]){html.attr("data-disabled","")}}if(templateName==="option"||templateName==="item"){html.attr("data-value",value||"")}if(cache){self.renderCache[templateName][value]=html[0]}return html[0]},clearCache:function(templateName){var self=this;if(typeof templateName==="undefined"){self.renderCache={}}else{delete self.renderCache[templateName]}},canCreate:function(input){var self=this;if(!self.settings.create)return false;var filter=self.settings.createFilter;return input.length&&(typeof filter!=="function"||filter.apply(self,[input]))&&(typeof filter!=="string"||new RegExp(filter).test(input))&&(!(filter instanceof RegExp)||filter.test(input))}});Selectize.count=0;Selectize.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:true,diacritics:true,create:false,createOnBlur:false,createFilter:null,highlight:true,openOnFocus:true,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:false,selectOnTab:false,preload:false,allowEmptyOption:false,closeAfterSelect:false,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:false,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:true,render:{}};$.fn.selectize=function(settings_user){var defaults=$.fn.selectize.defaults;var settings=$.extend({},defaults,settings_user);var attr_data=settings.dataAttr;var field_label=settings.labelField;var field_value=settings.valueField;var field_disabled=settings.disabledField;var field_optgroup=settings.optgroupField;var field_optgroup_label=settings.optgroupLabelField;var field_optgroup_value=settings.optgroupValueField;var init_textbox=function($input,settings_element){var i,n,values,option;var data_raw=$input.attr(attr_data);if(!data_raw){var value=$.trim($input.val()||"");if(!settings.allowEmptyOption&&!value.length)return;values=value.split(settings.delimiter);for(i=0,n=values.length;i<n;i++){option={};option[field_label]=values[i];option[field_value]=values[i];settings_element.options.push(option)}settings_element.items=values}else{settings_element.options=JSON.parse(data_raw);for(i=0,n=settings_element.options.length;i<n;i++){settings_element.items.push(settings_element.options[i][field_value])}}};var init_select=function($input,settings_element){var i,n,tagName,$children,order=0;var options=settings_element.options;var optionsMap={};var readData=function($el){var data=attr_data&&$el.attr(attr_data);if(typeof data==="string"&&data.length){return JSON.parse(data)}return null};var addOption=function($option,group){$option=$($option);var value=hash_key($option.val());if(!value&&!settings.allowEmptyOption)return;if(optionsMap.hasOwnProperty(value)){if(group){var arr=optionsMap[value][field_optgroup];if(!arr){optionsMap[value][field_optgroup]=group}else if(!$.isArray(arr)){optionsMap[value][field_optgroup]=[arr,group]}else{arr.push(group)}}return}var option=readData($option)||{};option[field_label]=option[field_label]||$option.text();option[field_value]=option[field_value]||value;option[field_disabled]=option[field_disabled]||$option.prop("disabled");option[field_optgroup]=option[field_optgroup]||group;optionsMap[value]=option;options.push(option);if($option.is(":selected")){settings_element.items.push(value)}};var addGroup=function($optgroup){var i,n,id,optgroup,$options;$optgroup=$($optgroup);id=$optgroup.attr("label");if(id){optgroup=readData($optgroup)||{};optgroup[field_optgroup_label]=id;optgroup[field_optgroup_value]=id;optgroup[field_disabled]=$optgroup.prop("disabled");settings_element.optgroups.push(optgroup)}$options=$("option",$optgroup);for(i=0,n=$options.length;i<n;i++){addOption($options[i],id)}};settings_element.maxItems=$input.attr("multiple")?null:1;$children=$input.children();for(i=0,n=$children.length;i<n;i++){tagName=$children[i].tagName.toLowerCase();if(tagName==="optgroup"){addGroup($children[i])}else if(tagName==="option"){addOption($children[i])}}};return this.each((function(){if(this.selectize)return;var instance;var $input=$(this);var tag_name=this.tagName.toLowerCase();var placeholder=$input.attr("placeholder")||$input.attr("data-placeholder");if(!placeholder&&!settings.allowEmptyOption){placeholder=$input.children('option[value=""]').text()}var settings_element={placeholder:placeholder,options:[],optgroups:[],items:[]};if(tag_name==="select"){init_select($input,settings_element)}else{init_textbox($input,settings_element)}instance=new Selectize($input,$.extend(true,{},defaults,settings_element,settings_user))}))};$.fn.selectize.defaults=Selectize.defaults;$.fn.selectize.support={validity:SUPPORTS_VALIDITY_API};Selectize.define("drag_drop",(function(options){if(!$.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if(this.settings.mode!=="multi")return;var self=this;self.lock=function(){var original=self.lock;return function(){var sortable=self.$control.data("sortable");if(sortable)sortable.disable();return original.apply(self,arguments)}}();self.unlock=function(){var original=self.unlock;return function(){var sortable=self.$control.data("sortable");if(sortable)sortable.enable();return original.apply(self,arguments)}}();self.setup=function(){var original=self.setup;return function(){original.apply(this,arguments);var $control=self.$control.sortable({items:"[data-value]",forcePlaceholderSize:true,disabled:self.isLocked,start:function(e,ui){ui.placeholder.css("width",ui.helper.css("width"));$control.css({overflow:"visible"})},stop:function(){$control.css({overflow:"hidden"});var active=self.$activeItems?self.$activeItems.slice():null;var values=[];$control.children("[data-value]").each((function(){values.push($(this).attr("data-value"))}));self.setValue(values);self.setActiveItem(active)}})}}()}));Selectize.define("dropdown_header",(function(options){var self=this;options=$.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(data){return'<div class="'+data.headerClass+'">'+'<div class="'+data.titleRowClass+'">'+'<span class="'+data.labelClass+'">'+data.title+"</span>"+'<a href="javascript:void(0)" class="'+data.closeClass+'">&times;</a>'+"</div>"+"</div>"}},options);self.setup=function(){var original=self.setup;return function(){original.apply(self,arguments);self.$dropdown_header=$(options.html(options));self.$dropdown.prepend(self.$dropdown_header)}}()}));Selectize.define("optgroup_columns",(function(options){var self=this;options=$.extend({equalizeWidth:true,equalizeHeight:true},options);this.getAdjacentOption=function($option,direction){var $options=$option.closest("[data-group]").find("[data-selectable]");var index=$options.index($option)+direction;return index>=0&&index<$options.length?$options.eq(index):$()};this.onKeyDown=function(){var original=self.onKeyDown;return function(e){var index,$option,$options,$optgroup;if(this.isOpen&&(e.keyCode===KEY_LEFT||e.keyCode===KEY_RIGHT)){self.ignoreHover=true;$optgroup=this.$activeOption.closest("[data-group]");index=$optgroup.find("[data-selectable]").index(this.$activeOption);if(e.keyCode===KEY_LEFT){$optgroup=$optgroup.prev("[data-group]")}else{$optgroup=$optgroup.next("[data-group]")}$options=$optgroup.find("[data-selectable]");$option=$options.eq(Math.min($options.length-1,index));if($option.length){this.setActiveOption($option)}return}return original.apply(this,arguments)}}();var getScrollbarWidth=function(){var div;var width=getScrollbarWidth.width;var doc=document;if(typeof width==="undefined"){div=doc.createElement("div");div.innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>';div=div.firstChild;doc.body.appendChild(div);width=getScrollbarWidth.width=div.offsetWidth-div.clientWidth;doc.body.removeChild(div)}return width};var equalizeSizes=function(){var i,n,height_max,width,width_last,width_parent,$optgroups;$optgroups=$("[data-group]",self.$dropdown_content);n=$optgroups.length;if(!n||!self.$dropdown_content.width())return;if(options.equalizeHeight){height_max=0;for(i=0;i<n;i++){height_max=Math.max(height_max,$optgroups.eq(i).height())}$optgroups.css({height:height_max})}if(options.equalizeWidth){width_parent=self.$dropdown_content.innerWidth()-getScrollbarWidth();width=Math.round(width_parent/n);$optgroups.css({width:width});if(n>1){width_last=width_parent-width*(n-1);$optgroups.eq(n-1).css({width:width_last})}}};if(options.equalizeHeight||options.equalizeWidth){hook.after(this,"positionDropdown",equalizeSizes);hook.after(this,"refreshOptions",equalizeSizes)}}));Selectize.define("remove_button",(function(options){options=$.extend({label:"&times;",title:"Remove",className:"remove",append:true},options);var singleClose=function(thisRef,options){options.className="remove-single";var self=thisRef;var html='<a href="javascript:void(0)" class="'+options.className+'" tabindex="-1" title="'+escape_html(options.title)+'">'+options.label+"</a>";var append=function(html_container,html_element){return $("<span>").append(html_container).append(html_element)};thisRef.setup=function(){var original=self.setup;return function(){if(options.append){var id=$(self.$input.context).attr("id");var selectizer=$("#"+id);var render_item=self.settings.render.item;self.settings.render.item=function(data){return append(render_item.apply(thisRef,arguments),html)}}original.apply(thisRef,arguments);thisRef.$control.on("click","."+options.className,(function(e){e.preventDefault();if(self.isLocked)return;self.clear()}))}}()};var multiClose=function(thisRef,options){var self=thisRef;var html='<a href="javascript:void(0)" class="'+options.className+'" tabindex="-1" title="'+escape_html(options.title)+'">'+options.label+"</a>";var append=function(html_container,html_element){var pos=html_container.search(/(<\/[^>]+>\s*)$/);return html_container.substring(0,pos)+html_element+html_container.substring(pos)};thisRef.setup=function(){var original=self.setup;return function(){if(options.append){var render_item=self.settings.render.item;self.settings.render.item=function(data){return append(render_item.apply(thisRef,arguments),html)}}original.apply(thisRef,arguments);thisRef.$control.on("click","."+options.className,(function(e){e.preventDefault();if(self.isLocked)return;var $item=$(e.currentTarget).parent();self.setActiveItem($item);if(self.deleteSelection()){self.setCaret(self.items.length)}}))}}()};if(this.settings.mode==="single"){singleClose(this,options);return}else{multiClose(this,options)}}));Selectize.define("restore_on_backspace",(function(options){var self=this;options.text=options.text||function(option){return option[this.settings.labelField]};this.onKeyDown=function(){var original=self.onKeyDown;return function(e){var index,option;if(e.keyCode===KEY_BACKSPACE&&this.$control_input.val()===""&&!this.$activeItems.length){index=this.caretPos-1;if(index>=0&&index<this.items.length){option=this.options[this.items[index]];if(this.deleteSelection(e)){this.setTextboxValue(options.text.apply(this,[option]));this.refreshOptions(true)}e.preventDefault();return}}return original.apply(this,arguments)}}()}));return Selectize}));(function($){$.extend(true,window,{Slick:{CellRangeDecorator:CellRangeDecorator}});function CellRangeDecorator(grid,options){var _elem;var _defaults={selectionCssClass:"slick-range-decorator",selectionCss:{zIndex:"9999",border:"2px dashed red"},offset:{top:-1,left:-1,height:-2,width:-2}};options=$.extend(true,{},_defaults,options);function show(range){if(!_elem){_elem=$("<div></div>",{css:options.selectionCss}).addClass(options.selectionCssClass).css("position","absolute").appendTo(grid.getActiveCanvasNode())}var from=grid.getCellNodeBox(range.fromRow,range.fromCell);var to=grid.getCellNodeBox(range.toRow,range.toCell);_elem.css({top:from.top+options.offset.top,left:from.left+options.offset.left,height:to.bottom-from.top+options.offset.height,width:to.right-from.left+options.offset.width});return _elem}function hide(){if(_elem){_elem.remove();_elem=null}}$.extend(this,{pluginName:"CellRangeDecorator",show:show,hide:hide})}})(jQuery);(function($){$.extend(true,window,{Slick:{CellRangeSelector:CellRangeSelector}});function CellRangeSelector(options){var _grid;var _currentlySelectedRange;var _canvas;var _gridOptions;var _$activeCanvas;var _dragging;var _decorator;var _self=this;var _handler=new Slick.EventHandler;var _defaults={selectionCss:{border:"2px dashed blue"}};var _rowOffset;var _columnOffset;var _isRightCanvas;var _isBottomCanvas;var _scrollTop=0;var _scrollLeft=0;function init(grid){options=$.extend(true,{},_defaults,options);_decorator=options.cellDecorator||new Slick.CellRangeDecorator(grid,options);_grid=grid;_canvas=_grid.getCanvasNode();_gridOptions=_grid.getOptions();_handler.subscribe(_grid.onScroll,handleScroll).subscribe(_grid.onDragInit,handleDragInit).subscribe(_grid.onDragStart,handleDragStart).subscribe(_grid.onDrag,handleDrag).subscribe(_grid.onDragEnd,handleDragEnd)}function destroy(){_handler.unsubscribeAll()}function getCellDecorator(){return _decorator}function handleScroll(e,args){_scrollTop=args.scrollTop;_scrollLeft=args.scrollLeft}function handleDragInit(e,dd){_$activeCanvas=$(_grid.getActiveCanvasNode(e));var c=_$activeCanvas.offset();_rowOffset=0;_columnOffset=0;_isBottomCanvas=_$activeCanvas.hasClass("grid-canvas-bottom");if(_gridOptions.frozenRow>-1&&_isBottomCanvas){_rowOffset=_gridOptions.frozenBottom?$(".grid-canvas-bottom").height():$(".grid-canvas-top").height()}_isRightCanvas=_$activeCanvas.hasClass("grid-canvas-right");if(_gridOptions.frozenColumn>-1&&_isRightCanvas){_columnOffset=$(".grid-canvas-left").width()}e.stopImmediatePropagation()}function handleDragStart(e,dd){var cell=_grid.getCellFromEvent(e);if(_self.onBeforeCellRangeSelected.notify(cell)!==false){if(_grid.canCellBeSelected(cell.row,cell.cell)){_dragging=true;e.stopImmediatePropagation()}}if(!_dragging){return}_grid.focus();var startX=dd.startX-$(_canvas).offset().left;if(_gridOptions.frozenColumn>=0&&_isRightCanvas){startX+=_scrollLeft}var startY=dd.startY-$(_canvas).offset().top;if(_gridOptions.frozenRow>=0&&_isBottomCanvas){startY+=_scrollTop}var start=_grid.getCellFromPoint(startX,startY);dd.range={start:start,end:{}};_currentlySelectedRange=dd.range;return _decorator.show(new Slick.Range(start.row,start.cell))}function handleDrag(e,dd){if(!_dragging){return}e.stopImmediatePropagation();var end=_grid.getCellFromPoint(e.pageX-_$activeCanvas.offset().left+_columnOffset,e.pageY-_$activeCanvas.offset().top+_rowOffset);if(_gridOptions.frozenColumn>=0&&(!_isRightCanvas&&end.cell>_gridOptions.frozenColumn)||_isRightCanvas&&end.cell<=_gridOptions.frozenColumn){return}if(_gridOptions.frozenRow>=0&&(!_isBottomCanvas&&end.row>=_gridOptions.frozenRow)||_isBottomCanvas&&end.row<_gridOptions.frozenRow){return}if(!_grid.canCellBeSelected(end.row,end.cell)){return}dd.range.end=end;_decorator.show(new Slick.Range(dd.range.start.row,dd.range.start.cell,end.row,end.cell))}function handleDragEnd(e,dd){if(!_dragging){return}_dragging=false;e.stopImmediatePropagation();_decorator.hide();_self.onCellRangeSelected.notify({range:new Slick.Range(dd.range.start.row,dd.range.start.cell,dd.range.end.row,dd.range.end.cell)})}function getCurrentRange(){return _currentlySelectedRange}$.extend(this,{init:init,destroy:destroy,pluginName:"CellRangeSelector",getCellDecorator:getCellDecorator,getCurrentRange:getCurrentRange,onBeforeCellRangeSelected:new Slick.Event,onCellRangeSelected:new Slick.Event})}})(jQuery);(function($){$.extend(true,window,{Slick:{CellSelectionModel:CellSelectionModel}});function CellSelectionModel(options){var _grid;var _canvas;var _ranges=[];var _self=this;var _selector;if(typeof options==="undefined"||typeof options.cellRangeSelector==="undefined"){_selector=new Slick.CellRangeSelector({selectionCss:{border:"2px solid black"}})}else{_selector=options.cellRangeSelector}var _options;var _defaults={selectActiveCell:true};function init(grid){_options=$.extend(true,{},_defaults,options);_grid=grid;_canvas=_grid.getCanvasNode();_grid.onActiveCellChanged.subscribe(handleActiveCellChange);_grid.onKeyDown.subscribe(handleKeyDown);grid.registerPlugin(_selector);_selector.onCellRangeSelected.subscribe(handleCellRangeSelected);_selector.onBeforeCellRangeSelected.subscribe(handleBeforeCellRangeSelected)}function destroy(){_grid.onActiveCellChanged.unsubscribe(handleActiveCellChange);_grid.onKeyDown.unsubscribe(handleKeyDown);_selector.onCellRangeSelected.unsubscribe(handleCellRangeSelected);_selector.onBeforeCellRangeSelected.unsubscribe(handleBeforeCellRangeSelected);_grid.unregisterPlugin(_selector)}function removeInvalidRanges(ranges){var result=[];for(var i=0;i<ranges.length;i++){var r=ranges[i];if(_grid.canCellBeSelected(r.fromRow,r.fromCell)&&_grid.canCellBeSelected(r.toRow,r.toCell)){result.push(r)}}return result}function rangesAreEqual(range1,range2){var areDifferent=range1.length!==range2.length;if(!areDifferent){for(var i=0;i<range1.length;i++){if(range1[i].fromCell!==range2[i].fromCell||range1[i].fromRow!==range2[i].fromRow||range1[i].toCell!==range2[i].toCell||range1[i].toRow!==range2[i].toRow){areDifferent=true;break}}}return!areDifferent}function setSelectedRanges(ranges){if((!_ranges||_ranges.length===0)&&(!ranges||ranges.length===0)){return}var rangeHasChanged=!rangesAreEqual(_ranges,ranges);_ranges=removeInvalidRanges(ranges);if(rangeHasChanged){_self.onSelectedRangesChanged.notify(_ranges)}}function getSelectedRanges(){return _ranges}function handleBeforeCellRangeSelected(e,args){if(_grid.getEditorLock().isActive()){e.stopPropagation();return false}}function handleCellRangeSelected(e,args){_grid.setActiveCell(args.range.fromRow,args.range.fromCell,false,false,true);setSelectedRanges([args.range])}function handleActiveCellChange(e,args){if(_options.selectActiveCell&&args.row!=null&&args.cell!=null){setSelectedRanges([new Slick.Range(args.row,args.cell)])}else if(!_options.selectActiveCell){setSelectedRanges([])}}function handleKeyDown(e){var ranges,last;var active=_grid.getActiveCell();var metaKey=e.ctrlKey||e.metaKey;if(active&&e.shiftKey&&!metaKey&&!e.altKey&&(e.which==37||e.which==39||e.which==38||e.which==40)){ranges=getSelectedRanges().slice();if(!ranges.length)ranges.push(new Slick.Range(active.row,active.cell));last=ranges.pop();if(!last.contains(active.row,active.cell))last=new Slick.Range(active.row,active.cell);var dRow=last.toRow-last.fromRow,dCell=last.toCell-last.fromCell,dirRow=active.row==last.fromRow?1:-1,dirCell=active.cell==last.fromCell?1:-1;if(e.which==37){dCell-=dirCell}else if(e.which==39){dCell+=dirCell}else if(e.which==38){dRow-=dirRow}else if(e.which==40){dRow+=dirRow}var new_last=new Slick.Range(active.row,active.cell,active.row+dirRow*dRow,active.cell+dirCell*dCell);if(removeInvalidRanges([new_last]).length){ranges.push(new_last);var viewRow=dirRow>0?new_last.toRow:new_last.fromRow;var viewCell=dirCell>0?new_last.toCell:new_last.fromCell;_grid.scrollRowIntoView(viewRow);_grid.scrollCellIntoView(viewRow,viewCell)}else ranges.push(last);setSelectedRanges(ranges);e.preventDefault();e.stopPropagation()}}$.extend(this,{getSelectedRanges:getSelectedRanges,setSelectedRanges:setSelectedRanges,init:init,destroy:destroy,pluginName:"CellSelectionModel",onSelectedRangesChanged:new Slick.Event})}})(jQuery);(function($){$.extend(true,window,{Slick:{Event:Event,EventData:EventData,EventHandler:EventHandler,Range:Range,NonDataRow:NonDataItem,Group:Group,GroupTotals:GroupTotals,EditorLock:EditorLock,GlobalEditorLock:new EditorLock,TreeColumns:TreeColumns,keyCode:{SPACE:8,BACKSPACE:8,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,TAB:9,UP:38,A:65},preClickClassName:"slick-edit-preclick"}});function EventData(){var isPropagationStopped=false;var isImmediatePropagationStopped=false;this.stopPropagation=function(){isPropagationStopped=true};this.isPropagationStopped=function(){return isPropagationStopped};this.stopImmediatePropagation=function(){isImmediatePropagationStopped=true};this.isImmediatePropagationStopped=function(){return isImmediatePropagationStopped}}function Event(){var handlers=[];this.subscribe=function(fn){handlers.push(fn)};this.unsubscribe=function(fn){for(var i=handlers.length-1;i>=0;i--){if(handlers[i]===fn){handlers.splice(i,1)}}};this.notify=function(args,e,scope){e=e||new EventData;scope=scope||this;var returnValue;for(var i=0;i<handlers.length&&!(e.isPropagationStopped()||e.isImmediatePropagationStopped());i++){returnValue=handlers[i].call(scope,e,args)}return returnValue}}function EventHandler(){var handlers=[];this.subscribe=function(event,handler){handlers.push({event:event,handler:handler});event.subscribe(handler);return this};this.unsubscribe=function(event,handler){var i=handlers.length;while(i--){if(handlers[i].event===event&&handlers[i].handler===handler){handlers.splice(i,1);event.unsubscribe(handler);return}}return this};this.unsubscribeAll=function(){var i=handlers.length;while(i--){handlers[i].event.unsubscribe(handlers[i].handler)}handlers=[];return this}}function Range(fromRow,fromCell,toRow,toCell){if(toRow===undefined&&toCell===undefined){toRow=fromRow;toCell=fromCell}this.fromRow=Math.min(fromRow,toRow);this.fromCell=Math.min(fromCell,toCell);this.toRow=Math.max(fromRow,toRow);this.toCell=Math.max(fromCell,toCell);this.isSingleRow=function(){return this.fromRow==this.toRow};this.isSingleCell=function(){return this.fromRow==this.toRow&&this.fromCell==this.toCell};this.contains=function(row,cell){return row>=this.fromRow&&row<=this.toRow&&cell>=this.fromCell&&cell<=this.toCell};this.toString=function(){if(this.isSingleCell()){return"("+this.fromRow+":"+this.fromCell+")"}else{return"("+this.fromRow+":"+this.fromCell+" - "+this.toRow+":"+this.toCell+")"}}}function NonDataItem(){this.__nonDataRow=true}function Group(){this.__group=true;this.level=0;this.count=0;this.value=null;this.title=null;this.collapsed=false;this.selectChecked=false;this.totals=null;this.rows=[];this.groups=null;this.groupingKey=null}Group.prototype=new NonDataItem;Group.prototype.equals=function(group){return this.value===group.value&&this.count===group.count&&this.collapsed===group.collapsed&&this.title===group.title};function GroupTotals(){this.__groupTotals=true;this.group=null;this.initialized=false}GroupTotals.prototype=new NonDataItem;function EditorLock(){var activeEditController=null;this.isActive=function(editController){return editController?activeEditController===editController:activeEditController!==null};this.activate=function(editController){if(editController===activeEditController){return}if(activeEditController!==null){throw new Error("SlickGrid.EditorLock.activate: an editController is still active, can't activate another editController")}if(!editController.commitCurrentEdit){throw new Error("SlickGrid.EditorLock.activate: editController must implement .commitCurrentEdit()")}if(!editController.cancelCurrentEdit){throw new Error("SlickGrid.EditorLock.activate: editController must implement .cancelCurrentEdit()")}activeEditController=editController};this.deactivate=function(editController){if(activeEditController!==editController){throw new Error("SlickGrid.EditorLock.deactivate: specified editController is not the currently active one")}activeEditController=null};this.commitCurrentEdit=function(){return activeEditController?activeEditController.commitCurrentEdit():true};this.cancelCurrentEdit=function cancelCurrentEdit(){return activeEditController?activeEditController.cancelCurrentEdit():true}}function TreeColumns(treeColumns){var columnsById={};function init(){mapToId(treeColumns)}function mapToId(columns){columns.forEach((function(column){columnsById[column.id]=column;if(column.columns)mapToId(column.columns)}))}function filter(node,condition){return node.filter((function(column){var valid=condition.call(column);if(valid&&column.columns)column.columns=filter(column.columns,condition);return valid&&(!column.columns||column.columns.length)}))}function sort(columns,grid){columns.sort((function(a,b){var indexA=getOrDefault(grid.getColumnIndex(a.id)),indexB=getOrDefault(grid.getColumnIndex(b.id));return indexA-indexB})).forEach((function(column){if(column.columns)sort(column.columns,grid)}))}function getOrDefault(value){return typeof value==="undefined"?-1:value}function getDepth(node){if(node.length)for(var i in node)return getDepth(node[i]);else if(node.columns)return 1+getDepth(node.columns);else return 1}function getColumnsInDepth(node,depth,current){var columns=[];current=current||0;if(depth==current){if(node.length)node.forEach((function(n){if(n.columns)n.extractColumns=function(){return extractColumns(n)}}));return node}else for(var i in node)if(node[i].columns){columns=columns.concat(getColumnsInDepth(node[i].columns,depth,current+1))}return columns}function extractColumns(node){var result=[];if(node.hasOwnProperty("length")){for(var i=0;i<node.length;i++)result=result.concat(extractColumns(node[i]))}else{if(node.hasOwnProperty("columns"))result=result.concat(extractColumns(node.columns));else return node}return result}function cloneTreeColumns(){return $.extend(true,[],treeColumns)}init();this.hasDepth=function(){for(var i in treeColumns)if(treeColumns[i].hasOwnProperty("columns"))return true;return false};this.getTreeColumns=function(){return treeColumns};this.extractColumns=function(){return this.hasDepth()?extractColumns(treeColumns):treeColumns};this.getDepth=function(){return getDepth(treeColumns)};this.getColumnsInDepth=function(depth){return getColumnsInDepth(treeColumns,depth)};this.getColumnsInGroup=function(groups){return extractColumns(groups)};this.visibleColumns=function(){return filter(cloneTreeColumns(),(function(){return this.visible}))};this.filter=function(condition){return filter(cloneTreeColumns(),condition)};this.reOrder=function(grid){return sort(treeColumns,grid)};this.getById=function(id){return columnsById[id]};this.getInIds=function(ids){return ids.map((function(id){return columnsById[id]}))}}})(jQuery);(function($){$.extend(true,window,{Slick:{Editors:{Text:TextEditor,Integer:IntegerEditor,Float:FloatEditor,Date:DateEditor,YesNoSelect:YesNoSelectEditor,Checkbox:CheckboxEditor,PercentComplete:PercentCompleteEditor,LongText:LongTextEditor}}});function TextEditor(args){var $input;var defaultValue;var scope=this;this.init=function(){var navOnLR=args.grid.getOptions().editorCellNavOnLRKeys;$input=$("<INPUT type=text class='editor-text' />").appendTo(args.container).on("keydown.nav",navOnLR?handleKeydownLRNav:handleKeydownLRNoNav).focus().select()};this.destroy=function(){$input.remove()};this.focus=function(){$input.focus()};this.getValue=function(){return $input.val()};this.setValue=function(val){$input.val(val)};this.loadValue=function(item){defaultValue=item[args.column.field]||"";$input.val(defaultValue);$input[0].defaultValue=defaultValue;$input.select()};this.serializeValue=function(){return $input.val()};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return!($input.val()==""&&defaultValue==null)&&$input.val()!=defaultValue};this.validate=function(){if(args.column.validator){var validationResults=args.column.validator($input.val());if(!validationResults.valid){return validationResults}}return{valid:true,msg:null}};this.init()}function IntegerEditor(args){var $input;var defaultValue;var scope=this;this.init=function(){var navOnLR=args.grid.getOptions().editorCellNavOnLRKeys;$input=$("<INPUT type=text class='editor-text' />").appendTo(args.container).on("keydown.nav",navOnLR?handleKeydownLRNav:handleKeydownLRNoNav).focus().select()};this.destroy=function(){$input.remove()};this.focus=function(){$input.focus()};this.loadValue=function(item){defaultValue=item[args.column.field];$input.val(defaultValue);$input[0].defaultValue=defaultValue;$input.select()};this.serializeValue=function(){return parseInt($input.val(),10)||0};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return!($input.val()==""&&defaultValue==null)&&$input.val()!=defaultValue};this.validate=function(){if(isNaN($input.val())){return{valid:false,msg:"Please enter a valid integer"}}if(args.column.validator){var validationResults=args.column.validator($input.val());if(!validationResults.valid){return validationResults}}return{valid:true,msg:null}};this.init()}function FloatEditor(args){var $input;var defaultValue;var scope=this;this.init=function(){var navOnLR=args.grid.getOptions().editorCellNavOnLRKeys;$input=$("<INPUT type=text class='editor-text' />").appendTo(args.container).on("keydown.nav",navOnLR?handleKeydownLRNav:handleKeydownLRNoNav).focus().select()};this.destroy=function(){$input.remove()};this.focus=function(){$input.focus()};function getDecimalPlaces(){var rtn=args.column.editorFixedDecimalPlaces;if(typeof rtn=="undefined"){rtn=FloatEditor.DefaultDecimalPlaces}return!rtn&&rtn!==0?null:rtn}this.loadValue=function(item){defaultValue=item[args.column.field];var decPlaces=getDecimalPlaces();if(decPlaces!==null&&(defaultValue||defaultValue===0)&&defaultValue.toFixed){defaultValue=defaultValue.toFixed(decPlaces)}$input.val(defaultValue);$input[0].defaultValue=defaultValue;$input.select()};this.serializeValue=function(){var rtn=parseFloat($input.val());if(FloatEditor.AllowEmptyValue){if(!rtn&&rtn!==0){rtn=""}}else{rtn=rtn||0}var decPlaces=getDecimalPlaces();if(decPlaces!==null&&(rtn||rtn===0)&&rtn.toFixed){rtn=parseFloat(rtn.toFixed(decPlaces))}return rtn};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return!($input.val()==""&&defaultValue==null)&&$input.val()!=defaultValue};this.validate=function(){if(isNaN($input.val())){return{valid:false,msg:"Please enter a valid number"}}if(args.column.validator){var validationResults=args.column.validator($input.val());if(!validationResults.valid){return validationResults}}return{valid:true,msg:null}};this.init()}FloatEditor.DefaultDecimalPlaces=null;FloatEditor.AllowEmptyValue=false;function DateEditor(args){var $input;var defaultValue;var scope=this;var calendarOpen=false;this.init=function(){$input=$("<INPUT type=text class='editor-text' />");$input.appendTo(args.container);$input.focus().select();$input.datepicker({showOn:"button",buttonImageOnly:true,beforeShow:function(){calendarOpen=true},onClose:function(){calendarOpen=false}});$input.width($input.width()-18)};this.destroy=function(){$.datepicker.dpDiv.stop(true,true);$input.datepicker("hide");$input.datepicker("destroy");$input.remove()};this.show=function(){if(calendarOpen){$.datepicker.dpDiv.stop(true,true).show()}};this.hide=function(){if(calendarOpen){$.datepicker.dpDiv.stop(true,true).hide()}};this.position=function(position){if(!calendarOpen){return}$.datepicker.dpDiv.css("top",position.top+30).css("left",position.left)};this.focus=function(){$input.focus()};this.loadValue=function(item){defaultValue=item[args.column.field];$input.val(defaultValue);$input[0].defaultValue=defaultValue;$input.select()};this.serializeValue=function(){return $input.val()};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return!($input.val()==""&&defaultValue==null)&&$input.val()!=defaultValue};this.validate=function(){if(args.column.validator){var validationResults=args.column.validator($input.val());if(!validationResults.valid){return validationResults}}return{valid:true,msg:null}};this.init()}function YesNoSelectEditor(args){var $select;var defaultValue;var scope=this;this.init=function(){$select=$("<SELECT tabIndex='0' class='editor-yesno'><OPTION value='yes'>Yes</OPTION><OPTION value='no'>No</OPTION></SELECT>");$select.appendTo(args.container);$select.focus()};this.destroy=function(){$select.remove()};this.focus=function(){$select.focus()};this.loadValue=function(item){$select.val((defaultValue=item[args.column.field])?"yes":"no");$select.select()};this.serializeValue=function(){return $select.val()=="yes"};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return $select.val()!=defaultValue};this.validate=function(){return{valid:true,msg:null}};this.init()}function CheckboxEditor(args){var $select;var defaultValue;var scope=this;this.init=function(){$select=$("<INPUT type=checkbox value='true' class='editor-checkbox' hideFocus>");$select.appendTo(args.container);$select.focus()};this.destroy=function(){$select.remove()};this.focus=function(){$select.focus()};this.loadValue=function(item){defaultValue=!!item[args.column.field];if(defaultValue){$select.prop("checked",true)}else{$select.prop("checked",false)}};this.preClick=function(){$select.prop("checked",!$select.prop("checked"))};this.serializeValue=function(){return $select.prop("checked")};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return this.serializeValue()!==defaultValue};this.validate=function(){return{valid:true,msg:null}};this.init()}function PercentCompleteEditor(args){var $input,$picker;var defaultValue;var scope=this;this.init=function(){$input=$("<INPUT type=text class='editor-percentcomplete' />");$input.width($(args.container).innerWidth()-25);$input.appendTo(args.container);$picker=$("<div class='editor-percentcomplete-picker' />").appendTo(args.container);$picker.append("<div class='editor-percentcomplete-helper'><div class='editor-percentcomplete-wrapper'><div class='editor-percentcomplete-slider' /><div class='editor-percentcomplete-buttons' /></div></div>");$picker.find(".editor-percentcomplete-buttons").append("<button val=0>Not started</button><br/><button val=50>In Progress</button><br/><button val=100>Complete</button>");$input.focus().select();$picker.find(".editor-percentcomplete-slider").slider({orientation:"vertical",range:"min",value:defaultValue,slide:function(event,ui){$input.val(ui.value)}});$picker.find(".editor-percentcomplete-buttons button").on("click",(function(e){$input.val($(this).attr("val"));$picker.find(".editor-percentcomplete-slider").slider("value",$(this).attr("val"))}))};this.destroy=function(){$input.remove();$picker.remove()};this.focus=function(){$input.focus()};this.loadValue=function(item){$input.val(defaultValue=item[args.column.field]);$input.select()};this.serializeValue=function(){return parseInt($input.val(),10)||0};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return!($input.val()==""&&defaultValue==null)&&(parseInt($input.val(),10)||0)!=defaultValue};this.validate=function(){if(isNaN(parseInt($input.val(),10))){return{valid:false,msg:"Please enter a valid positive number"}}return{valid:true,msg:null}};this.init()}function LongTextEditor(args){var $input,$wrapper;var defaultValue;var scope=this;this.init=function(){var $container=$("body");var navOnLR=args.grid.getOptions().editorCellNavOnLRKeys;$wrapper=$("<DIV style='z-index:10000;position:absolute;background:white;padding:5px;border:3px solid gray; -moz-border-radius:10px; border-radius:10px;'/>").appendTo($container);$input=$("<TEXTAREA hidefocus rows=5 style='background:white;width:250px;height:80px;border:0;outline:0'>").appendTo($wrapper);$("<DIV style='text-align:right'><BUTTON>Save</BUTTON><BUTTON>Cancel</BUTTON></DIV>").appendTo($wrapper);$wrapper.find("button:first").on("click",this.save);$wrapper.find("button:last").on("click",this.cancel);$input.on("keydown",this.handleKeyDown);scope.position(args.position);$input.focus().select()};this.handleKeyDown=function(e){if(e.which==$.ui.keyCode.ENTER&&e.ctrlKey){scope.save()}else if(e.which==$.ui.keyCode.ESCAPE){e.preventDefault();scope.cancel()}else if(e.which==$.ui.keyCode.TAB&&e.shiftKey){e.preventDefault();args.grid.navigatePrev()}else if(e.which==$.ui.keyCode.TAB){e.preventDefault();args.grid.navigateNext()}else if(e.which==$.ui.keyCode.LEFT||e.which==$.ui.keyCode.RIGHT){if(args.grid.getOptions().editorCellNavOnLRKeys){var cursorPosition=this.selectionStart;var textLength=this.value.length;if(e.keyCode===$.ui.keyCode.LEFT&&cursorPosition===0){args.grid.navigatePrev()}if(e.keyCode===$.ui.keyCode.RIGHT&&cursorPosition>=textLength-1){args.grid.navigateNext()}}}};this.save=function(){args.commitChanges()};this.cancel=function(){$input.val(defaultValue);args.cancelChanges()};this.hide=function(){$wrapper.hide()};this.show=function(){$wrapper.show()};this.position=function(position){$wrapper.css("top",position.top-5).css("left",position.left-5)};this.destroy=function(){$wrapper.remove()};this.focus=function(){$input.focus()};this.loadValue=function(item){$input.val(defaultValue=item[args.column.field]);$input.select()};this.serializeValue=function(){return $input.val()};this.applyValue=function(item,state){item[args.column.field]=state};this.isValueChanged=function(){return!($input.val()==""&&defaultValue==null)&&$input.val()!=defaultValue};this.validate=function(){if(args.column.validator){var validationResults=args.column.validator($input.val());if(!validationResults.valid){return validationResults}}return{valid:true,msg:null}};this.init()}function handleKeydownLRNav(e){var cursorPosition=this.selectionStart;var textLength=this.value.length;if(e.keyCode===$.ui.keyCode.LEFT&&cursorPosition>0||e.keyCode===$.ui.keyCode.RIGHT&&cursorPosition<textLength-1){e.stopImmediatePropagation()}}function handleKeydownLRNoNav(e){if(e.keyCode===$.ui.keyCode.LEFT||e.keyCode===$.ui.keyCode.RIGHT){e.stopImmediatePropagation()}}})(jQuery);(function($){$.extend(true,window,{Slick:{Formatters:{PercentComplete:PercentCompleteFormatter,PercentCompleteBar:PercentCompleteBarFormatter,YesNo:YesNoFormatter,Checkmark:CheckmarkFormatter,Checkbox:CheckboxFormatter}}});function PercentCompleteFormatter(row,cell,value,columnDef,dataContext){if(value==null||value===""){return"-"}else if(value<50){return"<span style='color:red;font-weight:bold;'>"+value+"%</span>"}else{return"<span style='color:green'>"+value+"%</span>"}}function PercentCompleteBarFormatter(row,cell,value,columnDef,dataContext){if(value==null||value===""){return""}var color;if(value<30){color="red"}else if(value<70){color="silver"}else{color="green"}return"<span class='percent-complete-bar' style='background:"+color+";width:"+value+"%'></span>"}function YesNoFormatter(row,cell,value,columnDef,dataContext){return value?"Yes":"No"}function CheckboxFormatter(row,cell,value,columnDef,dataContext){return'<img class="slick-edit-preclick" src="../images/'+(value?"CheckboxY":"CheckboxN")+'.png">'}function CheckmarkFormatter(row,cell,value,columnDef,dataContext){return value?"<img src='../images/tick.png'>":""}})(jQuery);
/**
 * @license
 * (c) 2009-2016 Michael Leibman
 * michael{dot}leibman{at}gmail{dot}com
 * http://github.com/mleibman/slickgrid
 *
 * Distributed under MIT license.
 * All rights reserved.
 *
 * SlickGrid v2.4
 *
 * NOTES:
 *     Cell/row DOM manipulations are done directly bypassing jQuery's DOM manipulation methods.
 *     This increases the speed dramatically, but can only be done safely because there are no event handlers
 *     or data associated with any cell/row DOM nodes.  Cell editors must make sure they implement .destroy()
 *     and do proper cleanup.
 */
if(typeof jQuery==="undefined"){throw new Error("SlickGrid requires jquery module to be loaded")}if(!jQuery.fn.drag){throw new Error("SlickGrid requires jquery.event.drag module to be loaded")}if(typeof Slick==="undefined"){throw new Error("slick.core.js not loaded")}(function($){$.extend(true,window,{Slick:{Grid:SlickGrid}});var scrollbarDimensions;var maxSupportedCssHeight;function SlickGrid(container,data,columns,options){var defaults={alwaysShowVerticalScroll:false,alwaysAllowHorizontalScroll:false,explicitInitialization:false,rowHeight:25,defaultColumnWidth:80,enableAddRow:false,leaveSpaceForNewRows:false,editable:false,autoEdit:true,suppressActiveCellChangeOnEdit:false,enableCellNavigation:true,enableColumnReorder:true,asyncEditorLoading:false,asyncEditorLoadDelay:100,forceFitColumns:false,enableAsyncPostRender:false,asyncPostRenderDelay:50,enableAsyncPostRenderCleanup:false,asyncPostRenderCleanupDelay:40,autoHeight:false,editorLock:Slick.GlobalEditorLock,showHeaderRow:false,headerRowHeight:25,createFooterRow:false,showFooterRow:false,footerRowHeight:25,createPreHeaderPanel:false,showPreHeaderPanel:false,preHeaderPanelHeight:25,showTopPanel:false,topPanelHeight:25,formatterFactory:null,editorFactory:null,cellFlashingCssClass:"flashing",selectedCellCssClass:"selected",multiSelect:true,enableTextSelectionOnCells:false,dataItemColumnValueExtractor:null,frozenBottom:false,frozenColumn:-1,frozenRow:-1,fullWidthRows:false,multiColumnSort:false,numberedMultiColumnSort:false,tristateMultiColumnSort:false,sortColNumberInSeparateSpan:false,defaultFormatter:defaultFormatter,forceSyncScrolling:false,addNewRowCssClass:"new-row",preserveCopiedSelectionOnPaste:false,showCellSelection:true,viewportClass:null,minRowBuffer:3,emulatePagingWhenScrolling:true,editorCellNavOnLRKeys:false,doPaging:true};var columnDefaults={name:"",resizable:true,sortable:false,minWidth:30,rerenderOnResize:false,headerCssClass:null,defaultSortAsc:true,focusable:true,selectable:true};var th;var h;var ph;var n;var cj;var page=0;var offset=0;var vScrollDir=1;var initialized=false;var $container;var uid="slickgrid_"+Math.round(1e6*Math.random());var self=this;var $focusSink,$focusSink2;var $groupHeaders=$();var $headerScroller;var $headers;var $headerRow,$headerRowScroller,$headerRowSpacerL,$headerRowSpacerR;var $footerRow,$footerRowScroller,$footerRowSpacerL,$footerRowSpacerR;var $preHeaderPanel,$preHeaderPanelScroller,$preHeaderPanelSpacer;var $topPanelScroller;var $topPanel;var $viewport;var $canvas;var $style;var $boundAncestors;var treeColumns;var stylesheet,columnCssRulesL,columnCssRulesR;var viewportH,viewportW;var canvasWidth,canvasWidthL,canvasWidthR;var headersWidth,headersWidthL,headersWidthR;var viewportHasHScroll,viewportHasVScroll;var headerColumnWidthDiff=0,headerColumnHeightDiff=0,cellWidthDiff=0,cellHeightDiff=0,jQueryNewWidthBehaviour=false;var absoluteColumnMinWidth;var hasFrozenRows=false;var frozenRowsHeight=0;var actualFrozenRow=-1;var paneTopH=0;var paneBottomH=0;var viewportTopH=0;var viewportBottomH=0;var topPanelH=0;var headerRowH=0;var footerRowH=0;var tabbingDirection=1;var $activeCanvasNode;var $activeViewportNode;var activePosX;var activeRow,activeCell;var activeCellNode=null;var currentEditor=null;var serializedEditorValue;var editController;var rowsCache={};var renderedRows=0;var numVisibleRows=0;var prevScrollTop=0;var scrollTop=0;var lastRenderedScrollTop=0;var lastRenderedScrollLeft=0;var prevScrollLeft=0;var scrollLeft=0;var selectionModel;var selectedRows=[];var plugins=[];var cellCssClasses={};var columnsById={};var sortColumns=[];var columnPosLeft=[];var columnPosRight=[];var pagingActive=false;var pagingIsLastPage=false;var scrollThrottle=ActionThrottle(render,50);var h_editorLoader=null;var h_render=null;var h_postrender=null;var h_postrenderCleanup=null;var postProcessedRows={};var postProcessToRow=null;var postProcessFromRow=null;var postProcessedCleanupQueue=[];var postProcessgroupId=0;var counter_rows_rendered=0;var counter_rows_removed=0;var rowNodeFromLastMouseWheelEvent;var zombieRowNodeFromLastMouseWheelEvent;var zombieRowCacheFromLastMouseWheelEvent;var zombieRowPostProcessedFromLastMouseWheelEvent;var $paneHeaderL;var $paneHeaderR;var $paneTopL;var $paneTopR;var $paneBottomL;var $paneBottomR;var $headerScrollerL;var $headerScrollerR;var $headerL;var $headerR;var $groupHeadersL;var $groupHeadersR;var $headerRowScrollerL;var $headerRowScrollerR;var $footerRowScrollerL;var $footerRowScrollerR;var $headerRowL;var $headerRowR;var $footerRowL;var $footerRowR;var $topPanelScrollerL;var $topPanelScrollerR;var $topPanelL;var $topPanelR;var $viewportTopL;var $viewportTopR;var $viewportBottomL;var $viewportBottomR;var $canvasTopL;var $canvasTopR;var $canvasBottomL;var $canvasBottomR;var $viewportScrollContainerX;var $viewportScrollContainerY;var $headerScrollContainer;var $headerRowScrollContainer;var $footerRowScrollContainer;var cssShow={position:"absolute",visibility:"hidden",display:"block"};var $hiddenParents;var oldProps=[];var columnResizeDragging=false;function init(){if(container instanceof jQuery){$container=container}else{$container=$(container)}if($container.length<1){throw new Error("SlickGrid requires a valid container, "+container+" does not exist in the DOM.")}cacheCssForHiddenInit();maxSupportedCssHeight=maxSupportedCssHeight||getMaxSupportedCssHeight();options=$.extend({},defaults,options);validateAndEnforceOptions();columnDefaults.width=options.defaultColumnWidth;treeColumns=new Slick.TreeColumns(columns);columns=treeColumns.extractColumns();updateColumnProps();if(options.enableColumnReorder&&!$.fn.sortable){throw new Error("SlickGrid's 'enableColumnReorder = true' option requires jquery-ui.sortable module to be loaded")}editController={commitCurrentEdit:commitCurrentEdit,cancelCurrentEdit:cancelCurrentEdit};$container.empty().css("overflow","hidden").css("outline",0).addClass(uid).addClass("ui-widget");if(!/relative|absolute|fixed/.test($container.css("position"))){$container.css("position","relative")}$focusSink=$("<div tabIndex='0' hideFocus style='position:fixed;width:0;height:0;top:0;left:0;outline:0;'></div>").appendTo($container);$paneHeaderL=$("<div class='slick-pane slick-pane-header slick-pane-left' tabIndex='0' />").appendTo($container);$paneHeaderR=$("<div class='slick-pane slick-pane-header slick-pane-right' tabIndex='0' />").appendTo($container);$paneTopL=$("<div class='slick-pane slick-pane-top slick-pane-left' tabIndex='0' />").appendTo($container);$paneTopR=$("<div class='slick-pane slick-pane-top slick-pane-right' tabIndex='0' />").appendTo($container);$paneBottomL=$("<div class='slick-pane slick-pane-bottom slick-pane-left' tabIndex='0' />").appendTo($container);$paneBottomR=$("<div class='slick-pane slick-pane-bottom slick-pane-right' tabIndex='0' />").appendTo($container);if(options.createPreHeaderPanel){$preHeaderPanelScroller=$("<div class='slick-preheader-panel ui-state-default' style='overflow:hidden;position:relative;' />").appendTo($paneHeaderL);$preHeaderPanel=$("<div />").appendTo($preHeaderPanelScroller);$preHeaderPanelSpacer=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").appendTo($preHeaderPanelScroller);if(!options.showPreHeaderPanel){$preHeaderPanelScroller.hide()}}$headerScrollerL=$("<div class='slick-header ui-state-default slick-header-left' />").appendTo($paneHeaderL);$headerScrollerR=$("<div class='slick-header ui-state-default slick-header-right' />").appendTo($paneHeaderR);$headerScroller=$().add($headerScrollerL).add($headerScrollerR);if(treeColumns.hasDepth()){$groupHeadersL=[],$groupHeadersR=[];for(var index=0;index<treeColumns.getDepth()-1;index++){$groupHeadersL[index]=$("<div class='slick-group-header-columns slick-group-header-columns-left' style='left:-1000px' />").appendTo($headerScrollerL);$groupHeadersR[index]=$("<div class='slick-group-header-columns slick-group-header-columns-right' style='left:-1000px' />").appendTo($headerScrollerR)}$groupHeaders=$().add($groupHeadersL).add($groupHeadersR)}$headerL=$("<div class='slick-header-columns slick-header-columns-left' style='left:-1000px' />").appendTo($headerScrollerL);$headerR=$("<div class='slick-header-columns slick-header-columns-right' style='left:-1000px' />").appendTo($headerScrollerR);$headers=$().add($headerL).add($headerR);$headerRowScrollerL=$("<div class='slick-headerrow ui-state-default' />").appendTo($paneTopL);$headerRowScrollerR=$("<div class='slick-headerrow ui-state-default' />").appendTo($paneTopR);$headerRowScroller=$().add($headerRowScrollerL).add($headerRowScrollerR);$headerRowSpacerL=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").appendTo($headerRowScrollerL);$headerRowSpacerR=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").appendTo($headerRowScrollerR);$headerRowL=$("<div class='slick-headerrow-columns slick-headerrow-columns-left' />").appendTo($headerRowScrollerL);$headerRowR=$("<div class='slick-headerrow-columns slick-headerrow-columns-right' />").appendTo($headerRowScrollerR);$headerRow=$().add($headerRowL).add($headerRowR);$topPanelScrollerL=$("<div class='slick-top-panel-scroller ui-state-default' />").appendTo($paneTopL);$topPanelScrollerR=$("<div class='slick-top-panel-scroller ui-state-default' />").appendTo($paneTopR);$topPanelScroller=$().add($topPanelScrollerL).add($topPanelScrollerR);$topPanelL=$("<div class='slick-top-panel' style='width:10000px' />").appendTo($topPanelScrollerL);$topPanelR=$("<div class='slick-top-panel' style='width:10000px' />").appendTo($topPanelScrollerR);$topPanel=$().add($topPanelL).add($topPanelR);if(!options.showTopPanel){$topPanelScroller.hide()}if(!options.showHeaderRow){$headerRowScroller.hide()}$viewportTopL=$("<div class='slick-viewport slick-viewport-top slick-viewport-left' tabIndex='0' hideFocus />").appendTo($paneTopL);$viewportTopR=$("<div class='slick-viewport slick-viewport-top slick-viewport-right' tabIndex='0' hideFocus />").appendTo($paneTopR);$viewportBottomL=$("<div class='slick-viewport slick-viewport-bottom slick-viewport-left' tabIndex='0' hideFocus />").appendTo($paneBottomL);$viewportBottomR=$("<div class='slick-viewport slick-viewport-bottom slick-viewport-right' tabIndex='0' hideFocus />").appendTo($paneBottomR);$viewport=$().add($viewportTopL).add($viewportTopR).add($viewportBottomL).add($viewportBottomR);$activeViewportNode=$viewportTopL;$canvasTopL=$("<div class='grid-canvas grid-canvas-top grid-canvas-left' tabIndex='0' hideFocus />").appendTo($viewportTopL);$canvasTopR=$("<div class='grid-canvas grid-canvas-top grid-canvas-right' tabIndex='0' hideFocus />").appendTo($viewportTopR);$canvasBottomL=$("<div class='grid-canvas grid-canvas-bottom grid-canvas-left' tabIndex='0' hideFocus />").appendTo($viewportBottomL);$canvasBottomR=$("<div class='grid-canvas grid-canvas-bottom grid-canvas-right' tabIndex='0' hideFocus />").appendTo($viewportBottomR);if(options.viewportClass)$viewport.toggleClass(options.viewportClass,true);$canvas=$().add($canvasTopL).add($canvasTopR).add($canvasBottomL).add($canvasBottomR);scrollbarDimensions=scrollbarDimensions||measureScrollbar();$activeCanvasNode=$canvasTopL;if($preHeaderPanelSpacer)$preHeaderPanelSpacer.css("width",getCanvasWidth()+scrollbarDimensions.width+"px");$headers.width(getHeadersWidth());$headerRowSpacerL.css("width",getCanvasWidth()+scrollbarDimensions.width+"px");$headerRowSpacerR.css("width",getCanvasWidth()+scrollbarDimensions.width+"px");if(options.createFooterRow){$footerRowScrollerR=$("<div class='slick-footerrow ui-state-default' />").appendTo($paneTopR);$footerRowScrollerL=$("<div class='slick-footerrow ui-state-default' />").appendTo($paneTopL);$footerRowScroller=$().add($footerRowScrollerL).add($footerRowScrollerR);$footerRowSpacerL=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").css("width",getCanvasWidth()+scrollbarDimensions.width+"px").appendTo($footerRowScrollerL);$footerRowSpacerR=$("<div style='display:block;height:1px;position:absolute;top:0;left:0;'></div>").css("width",getCanvasWidth()+scrollbarDimensions.width+"px").appendTo($footerRowScrollerR);$footerRowL=$("<div class='slick-footerrow-columns slick-footerrow-columns-left' />").appendTo($footerRowScrollerL);$footerRowR=$("<div class='slick-footerrow-columns slick-footerrow-columns-right' />").appendTo($footerRowScrollerR);$footerRow=$().add($footerRowL).add($footerRowR);if(!options.showFooterRow){$footerRowScroller.hide()}}$focusSink2=$focusSink.clone().appendTo($container);if(!options.explicitInitialization){finishInitialization()}}function finishInitialization(){if(!initialized){initialized=true;getViewportWidth();getViewportHeight();measureCellPaddingAndBorder();disableSelection($headers);if(!options.enableTextSelectionOnCells){$viewport.on("selectstart.ui",(function(event){return $(event.target).is("input,textarea")}))}setFrozenOptions();setPaneVisibility();setScroller();setOverflow();updateColumnCaches();createColumnHeaders();createColumnGroupHeaders();createColumnFooter();setupColumnSort();createCssRules();resizeCanvas();bindAncestorScrollEvents();$container.on("resize.slickgrid",resizeCanvas);$viewport.on("scroll",handleScroll);if(jQuery.fn.mousewheel){$viewport.on("mousewheel",handleMouseWheel)}$headerScroller.on("contextmenu",handleHeaderContextMenu).on("click",handleHeaderClick).on("mouseenter",".slick-header-column",handleHeaderMouseEnter).on("mouseleave",".slick-header-column",handleHeaderMouseLeave);$headerRowScroller.on("scroll",handleHeaderRowScroll);if(options.createFooterRow){$footerRowScroller.on("scroll",handleFooterRowScroll)}if(options.createPreHeaderPanel){$preHeaderPanelScroller.on("scroll",handlePreHeaderPanelScroll)}$focusSink.add($focusSink2).on("keydown",handleKeyDown);$canvas.on("keydown",handleKeyDown).on("click",handleClick).on("dblclick",handleDblClick).on("contextmenu",handleContextMenu).on("draginit",handleDragInit).on("dragstart",{distance:3},handleDragStart).on("drag",handleDrag).on("dragend",handleDragEnd).on("mouseenter",".slick-cell",handleMouseEnter).on("mouseleave",".slick-cell",handleMouseLeave);restoreCssFromHiddenInit()}}function cacheCssForHiddenInit(){$hiddenParents=$container.parents().addBack().not(":visible");$hiddenParents.each((function(){var old={};for(var name in cssShow){old[name]=this.style[name];this.style[name]=cssShow[name]}oldProps.push(old)}))}function restoreCssFromHiddenInit(){$hiddenParents.each((function(i){var old=oldProps[i];for(var name in cssShow){this.style[name]=old[name]}}))}function hasFrozenColumns(){return options.frozenColumn>-1}function registerPlugin(plugin){plugins.unshift(plugin);plugin.init(self)}function unregisterPlugin(plugin){for(var i=plugins.length;i>=0;i--){if(plugins[i]===plugin){if(plugins[i].destroy){plugins[i].destroy()}plugins.splice(i,1);break}}}function getPluginByName(name){for(var i=plugins.length;i>=0;i--){if(plugins[i].pluginName===name){return plugins[i]}}return undefined}function setSelectionModel(model){if(selectionModel){selectionModel.onSelectedRangesChanged.unsubscribe(handleSelectedRangesChanged);if(selectionModel.destroy){selectionModel.destroy()}}selectionModel=model;if(selectionModel){selectionModel.init(self);selectionModel.onSelectedRangesChanged.subscribe(handleSelectedRangesChanged)}}function getSelectionModel(){return selectionModel}function getCanvasNode(columnIdOrIdx,rowIndex){if(!columnIdOrIdx){columnIdOrIdx=0}if(!rowIndex){rowIndex=0}var idx=typeof columnIdOrIdx==="number"?columnIdOrIdx:getColumnIndex(columnIdOrIdx);return hasFrozenRows&&rowIndex>=actualFrozenRow+(options.frozenBottom?0:1)?hasFrozenColumns()&&idx>options.frozenColumn?$canvasBottomR[0]:$canvasBottomL[0]:hasFrozenColumns()&&idx>options.frozenColumn?$canvasTopR[0]:$canvasTopL[0]}function getActiveCanvasNode(element){setActiveCanvasNode(element);return $activeCanvasNode[0]}function getCanvases(){return $canvas}function setActiveCanvasNode(element){if(element){$activeCanvasNode=$(element.target).closest(".grid-canvas")}}function getViewportNode(){return $viewport[0]}function getActiveViewportNode(element){setActiveViewPortNode(element);return $activeViewportNode[0]}function setActiveViewportNode(element){if(element){$activeViewportNode=$(element.target).closest(".slick-viewport")}}function measureScrollbar(){var $outerdiv=$('<div class="'+$viewport.className+'" style="position:absolute; top:-10000px; left:-10000px; overflow:auto; width:100px; height:100px;"></div>').appendTo($viewport);var $innerdiv=$('<div style="width:200px; height:200px; overflow:auto;"></div>').appendTo($outerdiv);var dim={width:$outerdiv[0].offsetWidth-$outerdiv[0].clientWidth,height:$outerdiv[0].offsetHeight-$outerdiv[0].clientHeight};$innerdiv.remove();$outerdiv.remove();return dim}function getHeadersWidth(){headersWidth=headersWidthL=headersWidthR=0;var includeScrollbar=!options.autoHeight;for(var i=0,ii=columns.length;i<ii;i++){var width=columns[i].width;if(options.frozenColumn>-1&&i>options.frozenColumn){headersWidthR+=width}else{headersWidthL+=width}}if(includeScrollbar){if(options.frozenColumn>-1&&i>options.frozenColumn){headersWidthR+=scrollbarDimensions.width}else{headersWidthL+=scrollbarDimensions.width}}if(hasFrozenColumns()){headersWidthL=headersWidthL+1e3;headersWidthR=Math.max(headersWidthR,viewportW)+headersWidthL;headersWidthR+=scrollbarDimensions.width}else{headersWidthL+=scrollbarDimensions.width;headersWidthL=Math.max(headersWidthL,viewportW)+1e3}headersWidth=headersWidthL+headersWidthR;return Math.max(headersWidth,viewportW)+1e3}function getHeadersWidthL(){headersWidthL=0;columns.forEach((function(column,i){if(!(options.frozenColumn>-1&&i>options.frozenColumn))headersWidthL+=column.width}));if(hasFrozenColumns()){headersWidthL+=1e3}else{headersWidthL+=scrollbarDimensions.width;headersWidthL=Math.max(headersWidthL,viewportW)+1e3}return headersWidthL}function getHeadersWidthR(){headersWidthR=0;columns.forEach((function(column,i){if(options.frozenColumn>-1&&i>options.frozenColumn)headersWidthR+=column.width}));if(hasFrozenColumns()){headersWidthR=Math.max(headersWidthR,viewportW)+getHeadersWidthL();headersWidthR+=scrollbarDimensions.width}return headersWidthR}function getCanvasWidth(){var availableWidth=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW;var i=columns.length;canvasWidthL=canvasWidthR=0;while(i--){if(hasFrozenColumns()&&i>options.frozenColumn){canvasWidthR+=columns[i].width}else{canvasWidthL+=columns[i].width}}var totalRowWidth=canvasWidthL+canvasWidthR;return options.fullWidthRows?Math.max(totalRowWidth,availableWidth):totalRowWidth}function updateCanvasWidth(forceColumnWidthsUpdate){var oldCanvasWidth=canvasWidth;var oldCanvasWidthL=canvasWidthL;var oldCanvasWidthR=canvasWidthR;var widthChanged;canvasWidth=getCanvasWidth();widthChanged=canvasWidth!==oldCanvasWidth||canvasWidthL!==oldCanvasWidthL||canvasWidthR!==oldCanvasWidthR;if(widthChanged||hasFrozenColumns()||hasFrozenRows){$canvasTopL.width(canvasWidthL);getHeadersWidth();$headerL.width(headersWidthL);$headerR.width(headersWidthR);if(hasFrozenColumns()){$canvasTopR.width(canvasWidthR);$paneHeaderL.width(canvasWidthL);$paneHeaderR.css("left",canvasWidthL);$paneHeaderR.css("width",viewportW-canvasWidthL);$paneTopL.width(canvasWidthL);$paneTopR.css("left",canvasWidthL);$paneTopR.css("width",viewportW-canvasWidthL);$headerRowScrollerL.width(canvasWidthL);$headerRowScrollerR.width(viewportW-canvasWidthL);$headerRowL.width(canvasWidthL);$headerRowR.width(canvasWidthR);if(options.createFooterRow){$footerRowScrollerL.width(canvasWidthL);$footerRowScrollerR.width(viewportW-canvasWidthL);$footerRowL.width(canvasWidthL);$footerRowR.width(canvasWidthR)}if(options.createPreHeaderPanel){$preHeaderPanel.width(canvasWidth)}$viewportTopL.width(canvasWidthL);$viewportTopR.width(viewportW-canvasWidthL);if(hasFrozenRows){$paneBottomL.width(canvasWidthL);$paneBottomR.css("left",canvasWidthL);$viewportBottomL.width(canvasWidthL);$viewportBottomR.width(viewportW-canvasWidthL);$canvasBottomL.width(canvasWidthL);$canvasBottomR.width(canvasWidthR)}}else{$paneHeaderL.width("100%");$paneTopL.width("100%");$headerRowScrollerL.width("100%");$headerRowL.width(canvasWidth);if(options.createFooterRow){$footerRowScrollerL.width("100%");$footerRowL.width(canvasWidth)}if(options.createPreHeaderPanel){$preHeaderPanel.width("100%");$preHeaderPanel.width(canvasWidth)}$viewportTopL.width("100%");if(hasFrozenRows){$viewportBottomL.width("100%");$canvasBottomL.width(canvasWidthL)}}viewportHasHScroll=canvasWidth>viewportW-scrollbarDimensions.width}$headerRowSpacerL.width(canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0));$headerRowSpacerR.width(canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0));if(options.createFooterRow){$footerRowSpacerL.width(canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0));$footerRowSpacerR.width(canvasWidth+(viewportHasVScroll?scrollbarDimensions.width:0))}if(widthChanged||forceColumnWidthsUpdate){applyColumnWidths()}}function disableSelection($target){if($target&&$target.jquery){$target.attr("unselectable","on").css("MozUserSelect","none").on("selectstart.ui",(function(){return false}))}}function getMaxSupportedCssHeight(){var supportedHeight=1e6;var testUpTo=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9;var div=$("<div style='display:none' />").appendTo(document.body);while(true){var test=supportedHeight*2;div.css("height",test);if(test>testUpTo||div.height()!==test){break}else{supportedHeight=test}}div.remove();return supportedHeight}function getUID(){return uid}function getHeaderColumnWidthDiff(){return headerColumnWidthDiff}function getScrollbarDimensions(){return scrollbarDimensions}function bindAncestorScrollEvents(){var elem=hasFrozenRows&&!options.frozenBottom?$canvasBottomL[0]:$canvasTopL[0];while((elem=elem.parentNode)!=document.body&&elem!=null){if(elem==$viewportTopL[0]||elem.scrollWidth!=elem.clientWidth||elem.scrollHeight!=elem.clientHeight){var $elem=$(elem);if(!$boundAncestors){$boundAncestors=$elem}else{$boundAncestors=$boundAncestors.add($elem)}$elem.on("scroll."+uid,handleActiveCellPositionChange)}}}function unbindAncestorScrollEvents(){if(!$boundAncestors){return}$boundAncestors.off("scroll."+uid);$boundAncestors=null}function updateColumnHeader(columnId,title,toolTip){if(!initialized){return}var idx=getColumnIndex(columnId);if(idx==null){return}var columnDef=columns[idx];var $header=$headers.children().eq(idx);if($header){if(title!==undefined){columns[idx].name=title}if(toolTip!==undefined){columns[idx].toolTip=toolTip}trigger(self.onBeforeHeaderCellDestroy,{node:$header[0],column:columnDef,grid:self});$header.attr("title",toolTip||"").children().eq(0).html(title);trigger(self.onHeaderCellRendered,{node:$header[0],column:columnDef,grid:self})}}function getHeader(columnDef){if(!columnDef){return hasFrozenColumns()?$headers:$headerL}var idx=getColumnIndex(columnDef.id);return hasFrozenColumns()?idx<=options.frozenColumn?$headerL:$headerR:$headerL}function getHeaderColumn(columnIdOrIdx){var idx=typeof columnIdOrIdx==="number"?columnIdOrIdx:getColumnIndex(columnIdOrIdx);var targetHeader=hasFrozenColumns()?idx<=options.frozenColumn?$headerL:$headerR:$headerL;var targetIndex=hasFrozenColumns()?idx<=options.frozenColumn?idx:idx-options.frozenColumn-1:idx;var $rtn=targetHeader.children().eq(targetIndex);return $rtn&&$rtn[0]}function getHeaderRow(){return hasFrozenColumns()?$headerRow:$headerRow[0]}function getFooterRow(){return hasFrozenColumns()?$footerRow:$footerRow[0]}function getPreHeaderPanel(){return $preHeaderPanel[0]}function getHeaderRowColumn(columnIdOrIdx){var idx=typeof columnIdOrIdx==="number"?columnIdOrIdx:getColumnIndex(columnIdOrIdx);var $headerRowTarget;if(hasFrozenColumns()){if(idx<=options.frozenColumn){$headerRowTarget=$headerRowL}else{$headerRowTarget=$headerRowR;idx-=options.frozenColumn+1}}else{$headerRowTarget=$headerRowL}var $header=$headerRowTarget.children().eq(idx);return $header&&$header[0]}function getFooterRowColumn(columnIdOrIdx){var idx=typeof columnIdOrIdx==="number"?columnIdOrIdx:getColumnIndex(columnIdOrIdx);var $footerRowTarget;if(hasFrozenColumns()){if(idx<=options.frozenColumn){$footerRowTarget=$footerRowL}else{$footerRowTarget=$footerRowR;idx-=options.frozenColumn+1}}else{$footerRowTarget=$footerRowL}var $footer=$footerRowTarget.children().eq(idx);return $footer&&$footer[0]}function createColumnFooter(){if(options.createFooterRow){$footerRow.find(".slick-footerrow-column").each((function(){var columnDef=$(this).data("column");if(columnDef){trigger(self.onBeforeFooterRowCellDestroy,{node:this,column:columnDef,grid:self})}}));$footerRowL.empty();$footerRowR.empty();for(var i=0;i<columns.length;i++){var m=columns[i];var footerRowCell=$("<div class='ui-state-default slick-footerrow-column l"+i+" r"+i+"'></div>").data("column",m).addClass(hasFrozenColumns()&&i<=options.frozenColumn?"frozen":"").appendTo(hasFrozenColumns()&&i>options.frozenColumn?$footerRowR:$footerRowL);trigger(self.onFooterRowCellRendered,{node:footerRowCell[0],column:m,grid:self})}}}function createColumnGroupHeaders(){var columnsLength=0;var frozenColumnsValid=false;if(!treeColumns.hasDepth())return;for(var index=0;index<$groupHeadersL.length;index++){$groupHeadersL[index].empty();$groupHeadersR[index].empty();var groupColumns=treeColumns.getColumnsInDepth(index);for(var indexGroup in groupColumns){var m=groupColumns[indexGroup];columnsLength+=m.extractColumns().length;if(hasFrozenColumns()&&index==0&&columnsLength-1===options.frozenColumn)frozenColumnsValid=true;$("<div class='ui-state-default slick-group-header-column' />").html("<span class='slick-column-name'>"+m.name+"</span>").attr("id",""+uid+m.id).attr("title",m.toolTip||"").data("column",m).addClass(m.headerCssClass||"").addClass(hasFrozenColumns()&&columnsLength-1>options.frozenColumn?"frozen":"").appendTo(hasFrozenColumns()&&columnsLength-1>options.frozenColumn?$groupHeadersR[index]:$groupHeadersL[index])}if(hasFrozenColumns()&&index==0&&!frozenColumnsValid){$groupHeadersL[index].empty();$groupHeadersR[index].empty();alert("All columns of group should to be grouped!");break}}applyColumnGroupHeaderWidths()}function createColumnHeaders(){function onMouseEnter(){$(this).addClass("ui-state-hover")}function onMouseLeave(){$(this).removeClass("ui-state-hover")}$headers.find(".slick-header-column").each((function(){var columnDef=$(this).data("column");if(columnDef){trigger(self.onBeforeHeaderCellDestroy,{node:this,column:columnDef,grid:self})}}));$headerL.empty();$headerR.empty();getHeadersWidth();$headerL.width(headersWidthL);$headerR.width(headersWidthR);$headerRow.find(".slick-headerrow-column").each((function(){var columnDef=$(this).data("column");if(columnDef){trigger(self.onBeforeHeaderRowCellDestroy,{node:this,column:columnDef,grid:self})}}));$headerRowL.empty();$headerRowR.empty();if(options.createFooterRow){$footerRowL.find(".slick-footerrow-column").each((function(){var columnDef=$(this).data("column");if(columnDef){trigger(self.onBeforeFooterRowCellDestroy,{node:this,column:columnDef,grid:self})}}));$footerRowL.empty();if(hasFrozenColumns()){$footerRowR.find(".slick-footerrow-column").each((function(){var columnDef=$(this).data("column");if(columnDef){trigger(self.onBeforeFooterRowCellDestroy,{node:this,column:columnDef,grid:self})}}));$footerRowR.empty()}}for(var i=0;i<columns.length;i++){var m=columns[i];var $headerTarget=hasFrozenColumns()?i<=options.frozenColumn?$headerL:$headerR:$headerL;var $headerRowTarget=hasFrozenColumns()?i<=options.frozenColumn?$headerRowL:$headerRowR:$headerRowL;var header=$("<div class='ui-state-default slick-header-column' />").html("<span class='slick-column-name'>"+m.name+"</span>").width(m.width-headerColumnWidthDiff).attr("id",""+uid+m.id).attr("title",m.toolTip||"").data("column",m).addClass(m.headerCssClass||"").addClass(hasFrozenColumns()&&i<=options.frozenColumn?"frozen":"").appendTo($headerTarget);if(options.enableColumnReorder||m.sortable){header.on("mouseenter",onMouseEnter).on("mouseleave",onMouseLeave)}if(m.sortable){header.addClass("slick-header-sortable");header.append("<span class='slick-sort-indicator"+(options.numberedMultiColumnSort&&!options.sortColNumberInSeparateSpan?" slick-sort-indicator-numbered":"")+"' />");if(options.numberedMultiColumnSort&&options.sortColNumberInSeparateSpan){header.append("<span class='slick-sort-indicator-numbered' />")}}trigger(self.onHeaderCellRendered,{node:header[0],column:m,grid:self});if(options.showHeaderRow){var headerRowCell=$("<div class='ui-state-default slick-headerrow-column l"+i+" r"+i+"'></div>").data("column",m).addClass(hasFrozenColumns()&&i<=options.frozenColumn?"frozen":"").appendTo($headerRowTarget);trigger(self.onHeaderRowCellRendered,{node:headerRowCell[0],column:m,grid:self})}if(options.createFooterRow&&options.showFooterRow){var footerRowCell=$("<div class='ui-state-default slick-footerrow-column l"+i+" r"+i+"'></div>").data("column",m).appendTo($footerRow);trigger(self.onFooterRowCellRendered,{node:footerRowCell[0],column:m,grid:self})}}setSortColumns(sortColumns);setupColumnResize();if(options.enableColumnReorder){if(typeof options.enableColumnReorder=="function"){options.enableColumnReorder(self,$headers,headerColumnWidthDiff,setColumns,setupColumnResize,columns,getColumnIndex,uid,trigger)}else{setupColumnReorder()}}}function setupColumnSort(){$headers.click((function(e){if(columnResizeDragging)return;e.metaKey=e.metaKey||e.ctrlKey;if($(e.target).hasClass("slick-resizable-handle")){return}var $col=$(e.target).closest(".slick-header-column");if(!$col.length){return}var column=$col.data("column");if(column.sortable){if(!getEditorLock().commitCurrentEdit()){return}var sortColumn=null;var i=0;for(;i<sortColumns.length;i++){if(sortColumns[i].columnId==column.id){sortColumn=sortColumns[i];sortColumn.sortAsc=!sortColumn.sortAsc;break}}var hadSortCol=!!sortColumn;if(options.tristateMultiColumnSort){if(!sortColumn){sortColumn={columnId:column.id,sortAsc:column.defaultSortAsc}}if(hadSortCol&&sortColumn.sortAsc){sortColumns.splice(i,1);sortColumn=null}if(!options.multiColumnSort){sortColumns=[]}if(sortColumn&&(!hadSortCol||!options.multiColumnSort)){sortColumns.push(sortColumn)}}else{if(e.metaKey&&options.multiColumnSort){if(sortColumn){sortColumns.splice(i,1)}}else{if(!e.shiftKey&&!e.metaKey||!options.multiColumnSort){sortColumns=[]}if(!sortColumn){sortColumn={columnId:column.id,sortAsc:column.defaultSortAsc};sortColumns.push(sortColumn)}else if(sortColumns.length==0){sortColumns.push(sortColumn)}}}setSortColumns(sortColumns);if(!options.multiColumnSort){trigger(self.onSort,{multiColumnSort:false,columnId:sortColumns.length>0?column.id:null,sortCol:sortColumns.length>0?column:null,sortAsc:sortColumns.length>0?sortColumns[0].sortAsc:true},e)}else{trigger(self.onSort,{multiColumnSort:true,sortCols:$.map(sortColumns,(function(col){return{columnId:columns[getColumnIndex(col.columnId)].id,sortCol:columns[getColumnIndex(col.columnId)],sortAsc:col.sortAsc}}))},e)}}}))}function currentPositionInHeader(id){var currentPosition=0;$headers.find(".slick-header-column").each((function(i){if(this.id==id){currentPosition=i;return false}}));return currentPosition}function limitPositionInGroup(idColumn){var groupColumnOfPreviousPosition,startLimit=0,endLimit=0;treeColumns.getColumnsInDepth($groupHeadersL.length-1).some((function(groupColumn){startLimit=endLimit;endLimit+=groupColumn.columns.length;groupColumn.columns.some((function(column){if(column.id===idColumn)groupColumnOfPreviousPosition=groupColumn;return groupColumnOfPreviousPosition}));return groupColumnOfPreviousPosition}));endLimit--;return{start:startLimit,end:endLimit,group:groupColumnOfPreviousPosition}}function remove(arr,elem){var index=arr.lastIndexOf(elem);if(index>-1){arr.splice(index,1);remove(arr,elem)}}function columnPositionValidInGroup($item){var currentPosition=currentPositionInHeader($item[0].id);var limit=limitPositionInGroup($item.data("column").id);var positionValid=limit.start<=currentPosition&&currentPosition<=limit.end;return{limit:limit,valid:positionValid,message:positionValid?"":'Column "'.concat($item.text(),'" can be reordered only within the "',limit.group.name,'" group!')}}function setupColumnReorder(){$headers.filter(":ui-sortable").sortable("destroy");var columnScrollTimer=null;function scrollColumnsRight(){$viewportScrollContainerX[0].scrollLeft=$viewportScrollContainerX[0].scrollLeft+10}function scrollColumnsLeft(){$viewportScrollContainerX[0].scrollLeft=$viewportScrollContainerX[0].scrollLeft-10}var canDragScroll;$headers.sortable({containment:"parent",distance:3,axis:"x",cursor:"default",tolerance:"intersection",helper:"clone",placeholder:"slick-sortable-placeholder ui-state-default slick-header-column",start:function(e,ui){ui.placeholder.width(ui.helper.outerWidth()-headerColumnWidthDiff);canDragScroll=!hasFrozenColumns()||ui.placeholder.offset().left+ui.placeholder.width()>$viewportScrollContainerX.offset().left;$(ui.helper).addClass("slick-header-column-active")},beforeStop:function(e,ui){$(ui.helper).removeClass("slick-header-column-active")},sort:function(e,ui){if(canDragScroll&&e.originalEvent.pageX>$container[0].clientWidth){if(!columnScrollTimer){columnScrollTimer=setInterval(scrollColumnsRight,100)}}else if(canDragScroll&&e.originalEvent.pageX<$viewportScrollContainerX.offset().left){if(!columnScrollTimer){columnScrollTimer=setInterval(scrollColumnsLeft,100)}}else{clearInterval(columnScrollTimer);columnScrollTimer=null}},stop:function(e,ui){var cancel=false;clearInterval(columnScrollTimer);columnScrollTimer=null;var limit=null;if(treeColumns.hasDepth()){var validPositionInGroup=columnPositionValidInGroup(ui.item);limit=validPositionInGroup.limit;cancel=!validPositionInGroup.valid;if(cancel)alert(validPositionInGroup.message)}if(cancel||!getEditorLock().commitCurrentEdit()){$(this).sortable("cancel");return}var reorderedIds=$headerL.sortable("toArray");reorderedIds=reorderedIds.concat($headerR.sortable("toArray"));var reorderedColumns=[];for(var i=0;i<reorderedIds.length;i++){reorderedColumns.push(columns[getColumnIndex(reorderedIds[i].replace(uid,""))])}setColumns(reorderedColumns);trigger(self.onColumnsReordered,{impactedColumns:getImpactedColumns(limit)});e.stopPropagation();setupColumnResize()}})}function getImpactedColumns(limit){var impactedColumns=[];if(limit!=undefined){for(var i=limit.start;i<=limit.end;i++){impactedColumns.push(columns[i])}}else{impactedColumns=columns}return impactedColumns}function setupColumnResize(){var $col,j,k,c,pageX,columnElements,minPageX,maxPageX,firstResizable,lastResizable;columnElements=$headers.children();columnElements.find(".slick-resizable-handle").remove();columnElements.each((function(i,e){if(i>=columns.length){return}if(columns[i].resizable){if(firstResizable===undefined){firstResizable=i}lastResizable=i}}));if(firstResizable===undefined){return}columnElements.each((function(i,e){if(i>=columns.length){return}if(i<firstResizable||options.forceFitColumns&&i>=lastResizable){return}$col=$(e);$("<div class='slick-resizable-handle' />").appendTo(e).on("dragstart",(function(e,dd){if(!getEditorLock().commitCurrentEdit()){return false}pageX=e.pageX;$(this).parent().addClass("slick-header-column-active");var shrinkLeewayOnRight=null,stretchLeewayOnRight=null;columnElements.each((function(i,e){if(i>=columns.length){return}columns[i].previousWidth=$(e).outerWidth()}));if(options.forceFitColumns){shrinkLeewayOnRight=0;stretchLeewayOnRight=0;for(j=i+1;j<columns.length;j++){c=columns[j];if(c.resizable){if(stretchLeewayOnRight!==null){if(c.maxWidth){stretchLeewayOnRight+=c.maxWidth-c.previousWidth}else{stretchLeewayOnRight=null}}shrinkLeewayOnRight+=c.previousWidth-Math.max(c.minWidth||0,absoluteColumnMinWidth)}}}var shrinkLeewayOnLeft=0,stretchLeewayOnLeft=0;for(j=0;j<=i;j++){c=columns[j];if(c.resizable){if(stretchLeewayOnLeft!==null){if(c.maxWidth){stretchLeewayOnLeft+=c.maxWidth-c.previousWidth}else{stretchLeewayOnLeft=null}}shrinkLeewayOnLeft+=c.previousWidth-Math.max(c.minWidth||0,absoluteColumnMinWidth)}}if(shrinkLeewayOnRight===null){shrinkLeewayOnRight=1e5}if(shrinkLeewayOnLeft===null){shrinkLeewayOnLeft=1e5}if(stretchLeewayOnRight===null){stretchLeewayOnRight=1e5}if(stretchLeewayOnLeft===null){stretchLeewayOnLeft=1e5}maxPageX=pageX+Math.min(shrinkLeewayOnRight,stretchLeewayOnLeft);minPageX=pageX-Math.min(shrinkLeewayOnLeft,stretchLeewayOnRight)})).on("drag",(function(e,dd){columnResizeDragging=true;var actualMinWidth,d=Math.min(maxPageX,Math.max(minPageX,e.pageX))-pageX,x;if(d<0){x=d;var newCanvasWidthL=0,newCanvasWidthR=0;for(j=i;j>=0;j--){c=columns[j];if(c.resizable){actualMinWidth=Math.max(c.minWidth||0,absoluteColumnMinWidth);if(x&&c.previousWidth+x<actualMinWidth){x+=c.previousWidth-actualMinWidth;c.width=actualMinWidth}else{c.width=c.previousWidth+x;x=0}}}for(k=0;k<=i;k++){c=columns[k];if(hasFrozenColumns()&&k>options.frozenColumn){newCanvasWidthR+=c.width}else{newCanvasWidthL+=c.width}}if(options.forceFitColumns){x=-d;for(j=i+1;j<columns.length;j++){c=columns[j];if(c.resizable){if(x&&c.maxWidth&&c.maxWidth-c.previousWidth<x){x-=c.maxWidth-c.previousWidth;c.width=c.maxWidth}else{c.width=c.previousWidth+x;x=0}if(hasFrozenColumns()&&j>options.frozenColumn){newCanvasWidthR+=c.width}else{newCanvasWidthL+=c.width}}}}else{for(j=i+1;j<columns.length;j++){c=columns[j];if(hasFrozenColumns()&&j>options.frozenColumn){newCanvasWidthR+=c.width}else{newCanvasWidthL+=c.width}}}if(options.forceFitColumns){x=-d;for(j=i+1;j<columns.length;j++){c=columns[j];if(c.resizable){if(x&&c.maxWidth&&c.maxWidth-c.previousWidth<x){x-=c.maxWidth-c.previousWidth;c.width=c.maxWidth}else{c.width=c.previousWidth+x;x=0}}}}}else{x=d;var newCanvasWidthL=0,newCanvasWidthR=0;for(j=i;j>=0;j--){c=columns[j];if(c.resizable){if(x&&c.maxWidth&&c.maxWidth-c.previousWidth<x){x-=c.maxWidth-c.previousWidth;c.width=c.maxWidth}else{c.width=c.previousWidth+x;x=0}}}for(k=0;k<=i;k++){c=columns[k];if(hasFrozenColumns()&&k>options.frozenColumn){newCanvasWidthR+=c.width}else{newCanvasWidthL+=c.width}}if(options.forceFitColumns){x=-d;for(j=i+1;j<columns.length;j++){c=columns[j];if(c.resizable){actualMinWidth=Math.max(c.minWidth||0,absoluteColumnMinWidth);if(x&&c.previousWidth+x<actualMinWidth){x+=c.previousWidth-actualMinWidth;c.width=actualMinWidth}else{c.width=c.previousWidth+x;x=0}if(hasFrozenColumns()&&j>options.frozenColumn){newCanvasWidthR+=c.width}else{newCanvasWidthL+=c.width}}}}else{for(j=i+1;j<columns.length;j++){c=columns[j];if(hasFrozenColumns()&&j>options.frozenColumn){newCanvasWidthR+=c.width}else{newCanvasWidthL+=c.width}}}}if(hasFrozenColumns()&&newCanvasWidthL!=canvasWidthL){$headerL.width(newCanvasWidthL+1e3);$paneHeaderR.css("left",newCanvasWidthL)}applyColumnHeaderWidths();applyColumnGroupHeaderWidths();if(options.syncColumnCellResize){applyColumnWidths()}})).on("dragend",(function(e,dd){var newWidth;$(this).parent().removeClass("slick-header-column-active");for(j=0;j<columns.length;j++){c=columns[j];newWidth=$(columnElements[j]).outerWidth();if(c.previousWidth!==newWidth&&c.rerenderOnResize){invalidateAllRows()}}updateCanvasWidth(true);render();trigger(self.onColumnsResized,{});setTimeout((function(){columnResizeDragging=false}),300)}))}))}function getVBoxDelta($el){var p=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var delta=0;$.each(p,(function(n,val){delta+=parseFloat($el.css(val))||0}));return delta}function setFrozenOptions(){options.frozenColumn=options.frozenColumn>=0&&options.frozenColumn<columns.length?parseInt(options.frozenColumn):-1;if(options.frozenRow>-1){hasFrozenRows=true;frozenRowsHeight=options.frozenRow*options.rowHeight;var dataLength=getDataLength();actualFrozenRow=options.frozenBottom?dataLength-options.frozenRow:options.frozenRow}else{hasFrozenRows=false}}function setPaneVisibility(){if(hasFrozenColumns()){$paneHeaderR.show();$paneTopR.show();if(hasFrozenRows){$paneBottomL.show();$paneBottomR.show()}else{$paneBottomR.hide();$paneBottomL.hide()}}else{$paneHeaderR.hide();$paneTopR.hide();$paneBottomR.hide();if(hasFrozenRows){$paneBottomL.show()}else{$paneBottomR.hide();$paneBottomL.hide()}}}function setOverflow(){$viewportTopL.css({"overflow-x":hasFrozenColumns()?hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"hidden":"scroll":hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"hidden":"auto","overflow-y":options.alwaysShowVerticalScroll?"scroll":hasFrozenColumns()?hasFrozenRows?"hidden":"hidden":hasFrozenRows?"scroll":"auto"});$viewportTopR.css({"overflow-x":hasFrozenColumns()?hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"hidden":"scroll":hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"hidden":"auto","overflow-y":options.alwaysShowVerticalScroll?"scroll":hasFrozenColumns()?hasFrozenRows?"scroll":"auto":hasFrozenRows?"scroll":"auto"});$viewportBottomL.css({"overflow-x":hasFrozenColumns()?hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"scroll":"auto":hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"auto":"auto","overflow-y":options.alwaysShowVerticalScroll?"scroll":hasFrozenColumns()?hasFrozenRows?"hidden":"hidden":hasFrozenRows?"scroll":"auto"});$viewportBottomR.css({"overflow-x":hasFrozenColumns()?hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"scroll":"auto":hasFrozenRows&&!options.alwaysAllowHorizontalScroll?"auto":"auto","overflow-y":options.alwaysShowVerticalScroll?"scroll":hasFrozenColumns()?hasFrozenRows?"auto":"auto":hasFrozenRows?"auto":"auto"});if(options.viewportClass){$viewportTopL.toggleClass(options.viewportClass,true);$viewportTopR.toggleClass(options.viewportClass,true);$viewportBottomL.toggleClass(options.viewportClass,true);$viewportBottomR.toggleClass(options.viewportClass,true)}}function setScroller(){if(hasFrozenColumns()){$headerScrollContainer=$headerScrollerR;$headerRowScrollContainer=$headerRowScrollerR;$footerRowScrollContainer=$footerRowScrollerR;if(hasFrozenRows){if(options.frozenBottom){$viewportScrollContainerX=$viewportBottomR;$viewportScrollContainerY=$viewportTopR}else{$viewportScrollContainerX=$viewportScrollContainerY=$viewportBottomR}}else{$viewportScrollContainerX=$viewportScrollContainerY=$viewportTopR}}else{$headerScrollContainer=$headerScrollerL;$headerRowScrollContainer=$headerRowScrollerL;$footerRowScrollContainer=$footerRowScrollerL;if(hasFrozenRows){if(options.frozenBottom){$viewportScrollContainerX=$viewportBottomL;$viewportScrollContainerY=$viewportTopL}else{$viewportScrollContainerX=$viewportScrollContainerY=$viewportBottomL}}else{$viewportScrollContainerX=$viewportScrollContainerY=$viewportTopL}}}function measureCellPaddingAndBorder(){var el;var h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var v=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var verArray=$.fn.jquery.split(".");jQueryNewWidthBehaviour=verArray[0]==1&&verArray[1]>=8||verArray[0]>=2;el=$("<div class='ui-state-default slick-header-column' style='visibility:hidden'>-</div>").appendTo($headers);headerColumnWidthDiff=headerColumnHeightDiff=0;if(el.css("box-sizing")!="border-box"&&el.css("-moz-box-sizing")!="border-box"&&el.css("-webkit-box-sizing")!="border-box"){$.each(h,(function(n,val){headerColumnWidthDiff+=parseFloat(el.css(val))||0}));$.each(v,(function(n,val){headerColumnHeightDiff+=parseFloat(el.css(val))||0}))}el.remove();var r=$("<div class='slick-row' />").appendTo($canvas);el=$("<div class='slick-cell' id='' style='visibility:hidden'>-</div>").appendTo(r);cellWidthDiff=cellHeightDiff=0;if(el.css("box-sizing")!="border-box"&&el.css("-moz-box-sizing")!="border-box"&&el.css("-webkit-box-sizing")!="border-box"){$.each(h,(function(n,val){cellWidthDiff+=parseFloat(el.css(val))||0}));$.each(v,(function(n,val){cellHeightDiff+=parseFloat(el.css(val))||0}))}r.remove();absoluteColumnMinWidth=Math.max(headerColumnWidthDiff,cellWidthDiff)}function createCssRules(){$style=$("<style type='text/css' rel='stylesheet' />").appendTo($("head"));var rowHeight=options.rowHeight-cellHeightDiff;var rules=["."+uid+" .slick-group-header-column { left: 1000px; }","."+uid+" .slick-header-column { left: 1000px; }","."+uid+" .slick-top-panel { height:"+options.topPanelHeight+"px; }","."+uid+" .slick-preheader-panel { height:"+options.preHeaderPanelHeight+"px; }","."+uid+" .slick-headerrow-columns { height:"+options.headerRowHeight+"px; }","."+uid+" .slick-footerrow-columns { height:"+options.footerRowHeight+"px; }","."+uid+" .slick-cell { height:"+rowHeight+"px; }","."+uid+" .slick-row { height:"+options.rowHeight+"px; }"];for(var i=0;i<columns.length;i++){rules.push("."+uid+" .l"+i+" { }");rules.push("."+uid+" .r"+i+" { }")}if($style[0].styleSheet){$style[0].styleSheet.cssText=rules.join(" ")}else{$style[0].appendChild(document.createTextNode(rules.join(" ")))}}function getColumnCssRules(idx){var i;if(!stylesheet){var sheets=document.styleSheets;for(i=0;i<sheets.length;i++){if((sheets[i].ownerNode||sheets[i].owningElement)==$style[0]){stylesheet=sheets[i];break}}if(!stylesheet){throw new Error("Cannot find stylesheet.")}columnCssRulesL=[];columnCssRulesR=[];var cssRules=stylesheet.cssRules||stylesheet.rules;var matches,columnIdx;for(i=0;i<cssRules.length;i++){var selector=cssRules[i].selectorText;if(matches=/\.l\d+/.exec(selector)){columnIdx=parseInt(matches[0].substr(2,matches[0].length-2),10);columnCssRulesL[columnIdx]=cssRules[i]}else if(matches=/\.r\d+/.exec(selector)){columnIdx=parseInt(matches[0].substr(2,matches[0].length-2),10);columnCssRulesR[columnIdx]=cssRules[i]}}}return{left:columnCssRulesL[idx],right:columnCssRulesR[idx]}}function removeCssRules(){$style.remove();stylesheet=null}function destroy(){getEditorLock().cancelCurrentEdit();trigger(self.onBeforeDestroy,{});var i=plugins.length;while(i--){unregisterPlugin(plugins[i])}if(options.enableColumnReorder){$headers.filter(":ui-sortable").sortable("destroy")}unbindAncestorScrollEvents();$container.off(".slickgrid");removeCssRules();$canvas.off("draginit dragstart dragend drag");$container.empty().removeClass(uid)}function trigger(evt,args,e){e=e||new Slick.EventData;args=args||{};args.grid=self;return evt.notify(args,e,self)}function getEditorLock(){return options.editorLock}function getEditController(){return editController}function getColumnIndex(id){return columnsById[id]}function autosizeColumns(){var i,c,widths=[],shrinkLeeway=0,total=0,prevTotal,availWidth=viewportHasVScroll?viewportW-scrollbarDimensions.width:viewportW;for(i=0;i<columns.length;i++){c=columns[i];widths.push(c.width);total+=c.width;if(c.resizable){shrinkLeeway+=c.width-Math.max(c.minWidth,absoluteColumnMinWidth)}}prevTotal=total;while(total>availWidth&&shrinkLeeway){var shrinkProportion=(total-availWidth)/shrinkLeeway;for(i=0;i<columns.length&&total>availWidth;i++){c=columns[i];var width=widths[i];if(!c.resizable||width<=c.minWidth||width<=absoluteColumnMinWidth){continue}var absMinWidth=Math.max(c.minWidth,absoluteColumnMinWidth);var shrinkSize=Math.floor(shrinkProportion*(width-absMinWidth))||1;shrinkSize=Math.min(shrinkSize,width-absMinWidth);total-=shrinkSize;shrinkLeeway-=shrinkSize;widths[i]-=shrinkSize}if(prevTotal<=total){break}prevTotal=total}prevTotal=total;while(total<availWidth){var growProportion=availWidth/total;for(i=0;i<columns.length&&total<availWidth;i++){c=columns[i];var currentWidth=widths[i];var growSize;if(!c.resizable||c.maxWidth<=currentWidth){growSize=0}else{growSize=Math.min(Math.floor(growProportion*currentWidth)-currentWidth,c.maxWidth-currentWidth||1e6)||1}total+=growSize;widths[i]+=total<=availWidth?growSize:0}if(prevTotal>=total){break}prevTotal=total}var reRender=false;for(i=0;i<columns.length;i++){if(columns[i].rerenderOnResize&&columns[i].width!=widths[i]){reRender=true}columns[i].width=widths[i]}applyColumnHeaderWidths();applyColumnGroupHeaderWidths();updateCanvasWidth(true);trigger(self.onAutosizeColumns,{columns:columns});if(reRender){invalidateAllRows();render()}}function applyColumnGroupHeaderWidths(){if(!treeColumns.hasDepth())return;for(var depth=$groupHeadersL.length-1;depth>=0;depth--){var groupColumns=treeColumns.getColumnsInDepth(depth);$().add($groupHeadersL[depth]).add($groupHeadersR[depth]).each((function(i){var $groupHeader=$(this),currentColumnIndex=0;$groupHeader.width(i==0?getHeadersWidthL():getHeadersWidthR());$groupHeader.children().each((function(){var $groupHeaderColumn=$(this);var m=$(this).data("column");m.width=0;m.columns.forEach((function(){var $headerColumn=$groupHeader.next().children(":eq("+currentColumnIndex+++")");m.width+=$headerColumn.outerWidth()}));$groupHeaderColumn.width(m.width-headerColumnWidthDiff)}))}))}}function applyColumnHeaderWidths(){if(!initialized){return}var h;for(var i=0,headers=$headers.children(),ii=columns.length;i<ii;i++){h=$(headers[i]);if(jQueryNewWidthBehaviour){if(h.outerWidth()!==columns[i].width){h.outerWidth(columns[i].width)}}else{if(h.width()!==columns[i].width-headerColumnWidthDiff){h.width(columns[i].width-headerColumnWidthDiff)}}}updateColumnCaches()}function applyColumnWidths(){var x=0,w,rule;for(var i=0;i<columns.length;i++){w=columns[i].width;rule=getColumnCssRules(i);rule.left.style.left=x+"px";rule.right.style.right=(options.frozenColumn!=-1&&i>options.frozenColumn?canvasWidthR:canvasWidthL)-x-w+"px";if(options.frozenColumn==i){x=0}else{x+=columns[i].width}}}function setSortColumn(columnId,ascending){setSortColumns([{columnId:columnId,sortAsc:ascending}])}function setSortColumns(cols){sortColumns=cols;var numberCols=options.numberedMultiColumnSort&&sortColumns.length>1;var headerColumnEls=$headers.children();headerColumnEls.removeClass("slick-header-column-sorted").find(".slick-sort-indicator").removeClass("slick-sort-indicator-asc slick-sort-indicator-desc");headerColumnEls.find(".slick-sort-indicator-numbered").text("");$.each(sortColumns,(function(i,col){if(col.sortAsc==null){col.sortAsc=true}var columnIndex=getColumnIndex(col.columnId);if(columnIndex!=null){headerColumnEls.eq(columnIndex).addClass("slick-header-column-sorted").find(".slick-sort-indicator").addClass(col.sortAsc?"slick-sort-indicator-asc":"slick-sort-indicator-desc");if(numberCols){headerColumnEls.eq(columnIndex).find(".slick-sort-indicator-numbered").text(i+1)}}}))}function getSortColumns(){return sortColumns}function handleSelectedRangesChanged(e,ranges){var previousSelectedRows=selectedRows.slice(0);selectedRows=[];var hash={};for(var i=0;i<ranges.length;i++){for(var j=ranges[i].fromRow;j<=ranges[i].toRow;j++){if(!hash[j]){selectedRows.push(j);hash[j]={}}for(var k=ranges[i].fromCell;k<=ranges[i].toCell;k++){if(canCellBeSelected(j,k)){hash[j][columns[k].id]=options.selectedCellCssClass}}}}setCellCssStyles(options.selectedCellCssClass,hash);if(simpleArrayEquals(previousSelectedRows,selectedRows)){trigger(self.onSelectedRowsChanged,{rows:getSelectedRows()},e)}}function simpleArrayEquals(arr1,arr2){return Array.isArray(arr1)&&Array.isArray(arr2)&&arr2.sort().toString()!==arr1.sort().toString()}function getColumns(){return columns}function updateColumnCaches(){columnPosLeft=[];columnPosRight=[];var x=0;for(var i=0,ii=columns.length;i<ii;i++){columnPosLeft[i]=x;columnPosRight[i]=x+columns[i].width;if(options.frozenColumn==i){x=0}else{x+=columns[i].width}}}function updateColumnProps(){columnsById={};for(var i=0;i<columns.length;i++){if(columns[i].width){columns[i].widthRequest=columns[i].width}var m=columns[i]=$.extend({},columnDefaults,columns[i]);columnsById[m.id]=i;if(m.minWidth&&m.width<m.minWidth){m.width=m.minWidth}if(m.maxWidth&&m.width>m.maxWidth){m.width=m.maxWidth}}}function setColumns(columnDefinitions){var _treeColumns=new Slick.TreeColumns(columnDefinitions);if(_treeColumns.hasDepth()){treeColumns=_treeColumns;columns=treeColumns.extractColumns()}else{columns=columnDefinitions}updateColumnProps();updateColumnCaches();if(initialized){setPaneVisibility();setOverflow();invalidateAllRows();createColumnHeaders();createColumnGroupHeaders();createColumnFooter();removeCssRules();createCssRules();resizeCanvas();updateCanvasWidth();applyColumnWidths();handleScroll()}}function getOptions(){return options}function setOptions(args,suppressRender){if(!getEditorLock().commitCurrentEdit()){return}makeActiveCellNormal();if(options.enableAddRow!==args.enableAddRow){invalidateRow(getDataLength())}options=$.extend(options,args);validateAndEnforceOptions();$viewport.css("overflow-y",options.autoHeight?"hidden":"auto");if(!suppressRender){render()}setFrozenOptions();setScroller();zombieRowNodeFromLastMouseWheelEvent=null;setColumns(treeColumns.extractColumns())}function validateAndEnforceOptions(){if(options.autoHeight){options.leaveSpaceForNewRows=false}}function setData(newData,scrollToTop){data=newData;invalidateAllRows();updateRowCount();if(scrollToTop){scrollTo(0)}}function getData(){return data}function getDataLength(){if(data.getLength){return data.getLength()}else{return data&&data.length||0}}function getDataLengthIncludingAddNew(){return getDataLength()+(!options.enableAddRow?0:!pagingActive||pagingIsLastPage?1:0)}function getDataItem(i){if(data.getItem){return data.getItem(i)}else{return data[i]}}function getTopPanel(){return $topPanel[0]}function setTopPanelVisibility(visible){if(options.showTopPanel!=visible){options.showTopPanel=visible;if(visible){$topPanelScroller.slideDown("fast",resizeCanvas)}else{$topPanelScroller.slideUp("fast",resizeCanvas)}}}function setHeaderRowVisibility(visible){if(options.showHeaderRow!=visible){options.showHeaderRow=visible;if(visible){$headerRowScroller.slideDown("fast",resizeCanvas)}else{$headerRowScroller.slideUp("fast",resizeCanvas)}}}function setFooterRowVisibility(visible){if(options.showFooterRow!=visible){options.showFooterRow=visible;if(visible){$footerRowScroller.slideDown("fast",resizeCanvas)}else{$footerRowScroller.slideUp("fast",resizeCanvas)}}}function setPreHeaderPanelVisibility(visible){if(options.showPreHeaderPanel!=visible){options.showPreHeaderPanel=visible;if(visible){$preHeaderPanelScroller.slideDown("fast",resizeCanvas)}else{$preHeaderPanelScroller.slideUp("fast",resizeCanvas)}}}function getContainerNode(){return $container.get(0)}function getRowTop(row){return options.rowHeight*row-offset}function getRowFromPosition(y){return Math.floor((y+offset)/options.rowHeight)}function scrollTo(y){y=Math.max(y,0);y=Math.min(y,th-$viewportScrollContainerY.height()+(viewportHasHScroll||hasFrozenColumns()?scrollbarDimensions.height:0));var oldOffset=offset;page=Math.min(n-1,Math.floor(y/ph));offset=Math.round(page*cj);var newScrollTop=y-offset;if(offset!=oldOffset){var range=getVisibleRange(newScrollTop);cleanupRows(range);updateRowPositions()}if(prevScrollTop!=newScrollTop){vScrollDir=prevScrollTop+oldOffset<newScrollTop+offset?1:-1;lastRenderedScrollTop=scrollTop=prevScrollTop=newScrollTop;if(hasFrozenColumns()){$viewportTopL[0].scrollTop=newScrollTop}if(hasFrozenRows){$viewportBottomL[0].scrollTop=$viewportBottomR[0].scrollTop=newScrollTop}$viewportScrollContainerY[0].scrollTop=newScrollTop;trigger(self.onViewportChanged,{})}}function defaultFormatter(row,cell,value,columnDef,dataContext,grid){if(value==null){return""}else{return(value+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}function getFormatter(row,column){var rowMetadata=data.getItemMetadata&&data.getItemMetadata(row);var columnOverrides=rowMetadata&&rowMetadata.columns&&(rowMetadata.columns[column.id]||rowMetadata.columns[getColumnIndex(column.id)]);return columnOverrides&&columnOverrides.formatter||rowMetadata&&rowMetadata.formatter||column.formatter||options.formatterFactory&&options.formatterFactory.getFormatter(column)||options.defaultFormatter}function callFormatter(row,cell,value,m,item,grid){var result;var metadata=data.getItemMetadata&&data.getItemMetadata(row);metadata=metadata&&metadata.columns;if(metadata){var columnData=metadata[m.id]||metadata[cell];result=getFormatter(row,m)(row,cell,value,m,item,columnData)}else{result=getFormatter(row,m)(row,cell,value,m,item)}return result}function getEditor(row,cell){var column=columns[cell];var rowMetadata=data.getItemMetadata&&data.getItemMetadata(row);var columnMetadata=rowMetadata&&rowMetadata.columns;if(columnMetadata&&columnMetadata[column.id]&&columnMetadata[column.id].editor!==undefined){return columnMetadata[column.id].editor}if(columnMetadata&&columnMetadata[cell]&&columnMetadata[cell].editor!==undefined){return columnMetadata[cell].editor}return column.editor||options.editorFactory&&options.editorFactory.getEditor(column)}function getDataItemValueForColumn(item,columnDef){if(options.dataItemColumnValueExtractor){return options.dataItemColumnValueExtractor(item,columnDef)}return item[columnDef.field]}function appendRowHtml(stringArrayL,stringArrayR,row,range,dataLength){var d=getDataItem(row);var dataLoading=row<dataLength&&!d;var rowCss="slick-row"+(hasFrozenRows&&row<=options.frozenRow?" frozen":"")+(dataLoading?" loading":"")+(row===activeRow&&options.showCellSelection?" active":"")+(row%2==1?" odd":" even");if(!d){rowCss+=" "+options.addNewRowCssClass}var metadata=data.getItemMetadata&&data.getItemMetadata(row);if(metadata&&metadata.cssClasses){rowCss+=" "+metadata.cssClasses}var frozenRowOffset=getFrozenRowOffset(row);var rowHtml="<div class='ui-widget-content "+rowCss+"' style='top:"+(getRowTop(row)-frozenRowOffset)+"px'>";stringArrayL.push(rowHtml);if(hasFrozenColumns()){stringArrayR.push(rowHtml)}var colspan,m;for(var i=0,ii=columns.length;i<ii;i++){m=columns[i];colspan=1;if(metadata&&metadata.columns){var columnData=metadata.columns[m.id]||metadata.columns[i];colspan=columnData&&columnData.colspan||1;if(colspan==="*"){colspan=ii-i}}if(columnPosRight[Math.min(ii-1,i+colspan-1)]>range.leftPx){if(!m.alwaysRenderColumn&&columnPosLeft[i]>range.rightPx){break}if(hasFrozenColumns()&&i>options.frozenColumn){appendCellHtml(stringArrayR,row,i,colspan,d)}else{appendCellHtml(stringArrayL,row,i,colspan,d)}}else if(m.alwaysRenderColumn||hasFrozenColumns()&&i<=options.frozenColumn){appendCellHtml(stringArrayL,row,i,colspan,d)}if(colspan>1){i+=colspan-1}}stringArrayL.push("</div>");if(hasFrozenColumns()){stringArrayR.push("</div>")}}function appendCellHtml(stringArray,row,cell,colspan,item){var m=columns[cell];var cellCss="slick-cell l"+cell+" r"+Math.min(columns.length-1,cell+colspan-1)+(m.cssClass?" "+m.cssClass:"");if(hasFrozenColumns()&&cell<=options.frozenColumn){cellCss+=" frozen"}if(row===activeRow&&cell===activeCell&&options.showCellSelection){cellCss+=" active"}for(var key in cellCssClasses){if(cellCssClasses[key][row]&&cellCssClasses[key][row][m.id]){cellCss+=" "+cellCssClasses[key][row][m.id]}}var value=null,formatterResult="";if(item){value=getDataItemValueForColumn(item,m);formatterResult=getFormatter(row,m)(row,cell,value,m,item,self);if(formatterResult===null||formatterResult===undefined){formatterResult=""}}var addlCssClasses=trigger(self.onBeforeAppendCell,{row:row,cell:cell,value:value,dataContext:item})||"";addlCssClasses+=formatterResult&&formatterResult.addClasses?(addlCssClasses?" ":"")+formatterResult.addClasses:"";var toolTip=formatterResult&&formatterResult.toolTip?"title='"+formatterResult.toolTip+"'":"";stringArray.push("<div class='"+cellCss+(addlCssClasses?" "+addlCssClasses:"")+"' "+toolTip+">");if(item){stringArray.push(Object.prototype.toString.call(formatterResult)!=="[object Object]"?formatterResult:formatterResult.text)}stringArray.push("</div>");rowsCache[row].cellRenderQueue.push(cell);rowsCache[row].cellColSpans[cell]=colspan}function cleanupRows(rangeToKeep){for(var i in rowsCache){var removeFrozenRow=true;if(hasFrozenRows&&(options.frozenBottom&&i>=actualFrozenRow||!options.frozenBottom&&i<=actualFrozenRow)){removeFrozenRow=false}if((i=parseInt(i,10))!==activeRow&&(i<rangeToKeep.top||i>rangeToKeep.bottom)&&removeFrozenRow){removeRowFromCache(i)}}if(options.enableAsyncPostRenderCleanup){startPostProcessingCleanup()}}function invalidate(){updateRowCount();invalidateAllRows();render()}function invalidateAllRows(){if(currentEditor){makeActiveCellNormal()}for(var row in rowsCache){removeRowFromCache(row)}if(options.enableAsyncPostRenderCleanup){startPostProcessingCleanup()}}function queuePostProcessedRowForCleanup(cacheEntry,postProcessedRow,rowIdx){postProcessgroupId++;for(var columnIdx in postProcessedRow){if(postProcessedRow.hasOwnProperty(columnIdx)){postProcessedCleanupQueue.push({actionType:"C",groupId:postProcessgroupId,node:cacheEntry.cellNodesByColumnIdx[columnIdx|0],columnIdx:columnIdx|0,rowIdx:rowIdx})}}postProcessedCleanupQueue.push({actionType:"R",groupId:postProcessgroupId,node:cacheEntry.rowNode});$(cacheEntry.rowNode).detach()}function queuePostProcessedCellForCleanup(cellnode,columnIdx,rowIdx){postProcessedCleanupQueue.push({actionType:"C",groupId:postProcessgroupId,node:cellnode,columnIdx:columnIdx,rowIdx:rowIdx});$(cellnode).detach()}function removeRowFromCache(row){var cacheEntry=rowsCache[row];if(!cacheEntry){return}if(rowNodeFromLastMouseWheelEvent==cacheEntry.rowNode[0]||hasFrozenColumns()&&rowNodeFromLastMouseWheelEvent==cacheEntry.rowNode[1]){cacheEntry.rowNode.hide();zombieRowNodeFromLastMouseWheelEvent=cacheEntry.rowNode}else{cacheEntry.rowNode.each((function(){this.parentElement.removeChild(this)}))}delete rowsCache[row];delete postProcessedRows[row];renderedRows--;counter_rows_removed++}function invalidateRows(rows){var i,rl;if(!rows||!rows.length){return}vScrollDir=0;rl=rows.length;for(i=0;i<rl;i++){if(currentEditor&&activeRow===rows[i]){makeActiveCellNormal()}if(rowsCache[rows[i]]){removeRowFromCache(rows[i])}}if(options.enableAsyncPostRenderCleanup){startPostProcessingCleanup()}}function invalidateRow(row){if(!row&&row!==0){return}invalidateRows([row])}function applyFormatResultToCellNode(formatterResult,cellNode,suppressRemove){if(formatterResult===null||formatterResult===undefined){formatterResult=""}if(Object.prototype.toString.call(formatterResult)!=="[object Object]"){cellNode.innerHTML=formatterResult;return}cellNode.innerHTML=formatterResult.text;if(formatterResult.removeClasses&&!suppressRemove){$(cellNode).removeClass(formatterResult.removeClasses)}if(formatterResult.addClasses){$(cellNode).addClass(formatterResult.addClasses)}if(formatterResult.toolTip){$(cellNode).attr("title",formatterResult.toolTip)}}function updateCell(row,cell){var cellNode=getCellNode(row,cell);if(!cellNode){return}var m=columns[cell],d=getDataItem(row);if(currentEditor&&activeRow===row&&activeCell===cell){currentEditor.loadValue(d)}else{var formatterResult=d?getFormatter(row,m)(row,cell,getDataItemValueForColumn(d,m),m,d,self):"";applyFormatResultToCellNode(formatterResult,cellNode);invalidatePostProcessingResults(row)}}function updateRow(row){var cacheEntry=rowsCache[row];if(!cacheEntry){return}ensureCellNodesInRowsCache(row);var formatterResult,d=getDataItem(row);for(var columnIdx in cacheEntry.cellNodesByColumnIdx){if(!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(columnIdx)){continue}columnIdx=columnIdx|0;var m=columns[columnIdx],node=cacheEntry.cellNodesByColumnIdx[columnIdx][0];if(row===activeRow&&columnIdx===activeCell&&currentEditor){currentEditor.loadValue(d)}else if(d){formatterResult=getFormatter(row,m)(row,columnIdx,getDataItemValueForColumn(d,m),m,d,self);applyFormatResultToCellNode(formatterResult,node)}else{node.innerHTML=""}}invalidatePostProcessingResults(row)}function getViewportHeight(){var fullHeight=$paneHeaderL.outerHeight();fullHeight+=options.showHeaderRow?options.headerRowHeight+getVBoxDelta($headerRowScroller):0;fullHeight+=options.showFooterRow?options.footerRowHeight+getVBoxDelta($footerRowScroller):0;if(options.autoHeight){viewportH=options.rowHeight*getDataLengthIncludingAddNew()+(options.frozenColumn==-1?fullHeight:0)}else{topPanelH=options.showTopPanel?options.topPanelHeight+getVBoxDelta($topPanelScroller):0;headerRowH=options.showHeaderRow?options.headerRowHeight+getVBoxDelta($headerRowScroller):0;footerRowH=options.showFooterRow?options.footerRowHeight+getVBoxDelta($footerRowScroller):0;preHeaderH=options.createPreHeaderPanel&&options.showPreHeaderPanel?options.preHeaderPanelHeight+getVBoxDelta($preHeaderPanelScroller):0;viewportH=parseFloat($.css($container[0],"height",true))-parseFloat($.css($container[0],"paddingTop",true))-parseFloat($.css($container[0],"paddingBottom",true))-parseFloat($.css($headerScroller[0],"height"))-getVBoxDelta($headerScroller)-topPanelH-headerRowH-footerRowH-preHeaderH}numVisibleRows=Math.ceil(viewportH/options.rowHeight);return viewportH}function getViewportWidth(){viewportW=parseFloat($container.width())}function resizeCanvas(){if(!initialized){return}paneTopH=0;paneBottomH=0;viewportTopH=0;viewportBottomH=0;getViewportWidth();getViewportHeight();if(hasFrozenRows){if(options.frozenBottom){paneTopH=viewportH-frozenRowsHeight-scrollbarDimensions.height;paneBottomH=frozenRowsHeight+scrollbarDimensions.height}else{paneTopH=frozenRowsHeight;paneBottomH=viewportH-frozenRowsHeight}}else{paneTopH=viewportH}paneTopH+=topPanelH+headerRowH+footerRowH;if(hasFrozenColumns()&&options.autoHeight){paneTopH+=scrollbarDimensions.height}viewportTopH=paneTopH-topPanelH-headerRowH-footerRowH;if(options.autoHeight){if(hasFrozenColumns()){$container.height(paneTopH+parseFloat($.css($headerScrollerL[0],"height")))}$paneTopL.css("position","relative")}$paneTopL.css({top:$paneHeaderL.height(),height:paneTopH});var paneBottomTop=$paneTopL.position().top+paneTopH;$viewportTopL.height(viewportTopH);if(hasFrozenColumns()){$paneTopR.css({top:$paneHeaderL.height(),height:paneTopH});$viewportTopR.height(viewportTopH);if(hasFrozenRows){$paneBottomL.css({top:paneBottomTop,height:paneBottomH});$paneBottomR.css({top:paneBottomTop,height:paneBottomH});$viewportBottomR.height(paneBottomH)}}else{if(hasFrozenRows){$paneBottomL.css({width:"100%",height:paneBottomH});$paneBottomL.css("top",paneBottomTop)}}if(hasFrozenRows){$viewportBottomL.height(paneBottomH);if(options.frozenBottom){$canvasBottomL.height(frozenRowsHeight);if(hasFrozenColumns()){$canvasBottomR.height(frozenRowsHeight)}}else{$canvasTopL.height(frozenRowsHeight);if(hasFrozenColumns()){$canvasTopR.height(frozenRowsHeight)}}}else{$viewportTopR.height(viewportTopH)}if(!scrollbarDimensions||!scrollbarDimensions.width){scrollbarDimensions=measureScrollbar()}if(options.forceFitColumns){autosizeColumns()}updateRowCount();handleScroll();lastRenderedScrollLeft=-1;render()}function updatePagingStatusFromView(pagingInfo){pagingActive=pagingInfo.pageSize!==0;pagingIsLastPage=pagingInfo.pageNum==pagingInfo.totalPages-1}function updateRowCount(){if(!initialized){return}var dataLength=getDataLength();var dataLengthIncludingAddNew=getDataLengthIncludingAddNew();var numberOfRows=0;var oldH=hasFrozenRows&&!options.frozenBottom?$canvasBottomL.height():$canvasTopL.height();if(hasFrozenRows){var numberOfRows=getDataLength()-options.frozenRow}else{var numberOfRows=dataLengthIncludingAddNew+(options.leaveSpaceForNewRows?numVisibleRows-1:0)}var tempViewportH=$viewportScrollContainerY.height();var oldViewportHasVScroll=viewportHasVScroll;viewportHasVScroll=options.alwaysShowVerticalScroll||!options.autoHeight&&numberOfRows*options.rowHeight>tempViewportH;makeActiveCellNormal();var r1=dataLength-1;for(var i in rowsCache){if(i>r1){removeRowFromCache(i)}}if(options.enableAsyncPostRenderCleanup){startPostProcessingCleanup()}if(activeCellNode&&activeRow>r1){resetActiveCell()}th=Math.max(options.rowHeight*numberOfRows,tempViewportH-scrollbarDimensions.height);if(th<maxSupportedCssHeight){h=ph=th;n=1;cj=0}else{h=maxSupportedCssHeight;ph=h/100;n=Math.floor(th/ph);cj=(th-h)/(n-1)}if(h!==oldH){if(hasFrozenRows&&!options.frozenBottom){$canvasBottomL.css("height",h);if(hasFrozenColumns()){$canvasBottomR.css("height",h)}}else{$canvasTopL.css("height",h);$canvasTopR.css("height",h)}scrollTop=$viewportScrollContainerY[0].scrollTop}var oldScrollTopInRange=scrollTop+offset<=th-tempViewportH;if(th==0||scrollTop==0){page=offset=0}else if(oldScrollTopInRange){scrollTo(scrollTop+offset)}else{scrollTo(th-tempViewportH)}if(h!=oldH&&options.autoHeight){resizeCanvas()}if(options.forceFitColumns&&oldViewportHasVScroll!=viewportHasVScroll){autosizeColumns()}updateCanvasWidth(false)}function getVisibleRange(viewportTop,viewportLeft){if(viewportTop==null){viewportTop=scrollTop}if(viewportLeft==null){viewportLeft=scrollLeft}return{top:getRowFromPosition(viewportTop),bottom:getRowFromPosition(viewportTop+viewportH)+1,leftPx:viewportLeft,rightPx:viewportLeft+viewportW}}function getRenderedRange(viewportTop,viewportLeft){var range=getVisibleRange(viewportTop,viewportLeft);var buffer=Math.round(viewportH/options.rowHeight);var minBuffer=options.minRowBuffer;if(vScrollDir==-1){range.top-=buffer;range.bottom+=minBuffer}else if(vScrollDir==1){range.top-=minBuffer;range.bottom+=buffer}else{range.top-=minBuffer;range.bottom+=minBuffer}range.top=Math.max(0,range.top);range.bottom=Math.min(getDataLengthIncludingAddNew()-1,range.bottom);range.leftPx-=viewportW;range.rightPx+=viewportW;range.leftPx=Math.max(0,range.leftPx);range.rightPx=Math.min(canvasWidth,range.rightPx);return range}function ensureCellNodesInRowsCache(row){var cacheEntry=rowsCache[row];if(cacheEntry){if(cacheEntry.cellRenderQueue.length){var $lastNode=cacheEntry.rowNode.children().last();while(cacheEntry.cellRenderQueue.length){var columnIdx=cacheEntry.cellRenderQueue.pop();cacheEntry.cellNodesByColumnIdx[columnIdx]=$lastNode;$lastNode=$lastNode.prev();if($lastNode.length==0){$lastNode=$(cacheEntry.rowNode[0]).children().last()}}}}}function cleanUpCells(range,row){if(hasFrozenRows&&(options.frozenBottom&&row>actualFrozenRow||row<=actualFrozenRow)){return}var totalCellsRemoved=0;var cacheEntry=rowsCache[row];var cellsToRemove=[];for(var i in cacheEntry.cellNodesByColumnIdx){if(!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(i)){continue}i=i|0;if(i<=options.frozenColumn){continue}if(Array.isArray(columns)&&columns[i]&&columns[i].alwaysRenderColumn){continue}var colspan=cacheEntry.cellColSpans[i];if(columnPosLeft[i]>range.rightPx||columnPosRight[Math.min(columns.length-1,i+colspan-1)]<range.leftPx){if(!(row==activeRow&&i==activeCell)){cellsToRemove.push(i)}}}var cellToRemove;while((cellToRemove=cellsToRemove.pop())!=null){cacheEntry.cellNodesByColumnIdx[cellToRemove][0].parentElement.removeChild(cacheEntry.cellNodesByColumnIdx[cellToRemove][0]);delete cacheEntry.cellColSpans[cellToRemove];delete cacheEntry.cellNodesByColumnIdx[cellToRemove];if(postProcessedRows[row]){delete postProcessedRows[row][cellToRemove]}totalCellsRemoved++}}function cleanUpAndRenderCells(range){var cacheEntry;var stringArray=[];var processedRows=[];var cellsAdded;var totalCellsAdded=0;var colspan;for(var row=range.top,btm=range.bottom;row<=btm;row++){cacheEntry=rowsCache[row];if(!cacheEntry){continue}ensureCellNodesInRowsCache(row);cleanUpCells(range,row);cellsAdded=0;var metadata=data.getItemMetadata&&data.getItemMetadata(row);metadata=metadata&&metadata.columns;var d=getDataItem(row);for(var i=0,ii=columns.length;i<ii;i++){if(columnPosLeft[i]>range.rightPx){break}if((colspan=cacheEntry.cellColSpans[i])!=null){i+=colspan>1?colspan-1:0;continue}colspan=1;if(metadata){var columnData=metadata[columns[i].id]||metadata[i];colspan=columnData&&columnData.colspan||1;if(colspan==="*"){colspan=ii-i}}if(columnPosRight[Math.min(ii-1,i+colspan-1)]>range.leftPx){appendCellHtml(stringArray,row,i,colspan,d);cellsAdded++}i+=colspan>1?colspan-1:0}if(cellsAdded){totalCellsAdded+=cellsAdded;processedRows.push(row)}}if(!stringArray.length){return}var x=document.createElement("div");x.innerHTML=stringArray.join("");var processedRow;var $node;while((processedRow=processedRows.pop())!=null){cacheEntry=rowsCache[processedRow];var columnIdx;while((columnIdx=cacheEntry.cellRenderQueue.pop())!=null){$node=$(x).children().last();if(hasFrozenColumns()&&columnIdx>options.frozenColumn){$(cacheEntry.rowNode[1]).append($node)}else{$(cacheEntry.rowNode[0]).append($node)}cacheEntry.cellNodesByColumnIdx[columnIdx]=$node}}}function renderRows(range){var stringArrayL=[],stringArrayR=[],rows=[],needToReselectCell=false,dataLength=getDataLength();for(var i=range.top,ii=range.bottom;i<=ii;i++){if(rowsCache[i]||hasFrozenRows&&options.frozenBottom&&i==getDataLength()){continue}renderedRows++;rows.push(i);rowsCache[i]={rowNode:null,cellColSpans:[],cellNodesByColumnIdx:[],cellRenderQueue:[]};appendRowHtml(stringArrayL,stringArrayR,i,range,dataLength);if(activeCellNode&&activeRow===i){needToReselectCell=true}counter_rows_rendered++}if(!rows.length){return}var x=document.createElement("div"),xRight=document.createElement("div");x.innerHTML=stringArrayL.join("");xRight.innerHTML=stringArrayR.join("");for(var i=0,ii=rows.length;i<ii;i++){if(hasFrozenRows&&rows[i]>=actualFrozenRow){if(hasFrozenColumns()){rowsCache[rows[i]].rowNode=$().add($(x.firstChild).appendTo($canvasBottomL)).add($(xRight.firstChild).appendTo($canvasBottomR))}else{rowsCache[rows[i]].rowNode=$().add($(x.firstChild).appendTo($canvasBottomL))}}else if(hasFrozenColumns()){rowsCache[rows[i]].rowNode=$().add($(x.firstChild).appendTo($canvasTopL)).add($(xRight.firstChild).appendTo($canvasTopR))}else{rowsCache[rows[i]].rowNode=$().add($(x.firstChild).appendTo($canvasTopL))}}if(needToReselectCell){activeCellNode=getCellNode(activeRow,activeCell)}}function startPostProcessing(){if(!options.enableAsyncPostRender){return}clearTimeout(h_postrender);h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay)}function startPostProcessingCleanup(){if(!options.enableAsyncPostRenderCleanup){return}clearTimeout(h_postrenderCleanup);h_postrenderCleanup=setTimeout(asyncPostProcessCleanupRows,options.asyncPostRenderCleanupDelay)}function invalidatePostProcessingResults(row){for(var columnIdx in postProcessedRows[row]){if(postProcessedRows[row].hasOwnProperty(columnIdx)){postProcessedRows[row][columnIdx]="C"}}postProcessFromRow=Math.min(postProcessFromRow,row);postProcessToRow=Math.max(postProcessToRow,row);startPostProcessing()}function updateRowPositions(){for(var row in rowsCache){rowsCache[row].rowNode.style.top=getRowTop(row)+"px"}}function render(){if(!initialized){return}scrollThrottle.dequeue();var visible=getVisibleRange();var rendered=getRenderedRange();cleanupRows(rendered);if(lastRenderedScrollLeft!=scrollLeft){if(hasFrozenRows){var renderedFrozenRows=jQuery.extend(true,{},rendered);if(options.frozenBottom){renderedFrozenRows.top=actualFrozenRow;renderedFrozenRows.bottom=getDataLength()}else{renderedFrozenRows.top=0;renderedFrozenRows.bottom=options.frozenRow}cleanUpAndRenderCells(renderedFrozenRows)}cleanUpAndRenderCells(rendered)}renderRows(rendered);if(hasFrozenRows){if(options.frozenBottom){renderRows({top:actualFrozenRow,bottom:getDataLength()-1,leftPx:rendered.leftPx,rightPx:rendered.rightPx})}else{renderRows({top:0,bottom:options.frozenRow-1,leftPx:rendered.leftPx,rightPx:rendered.rightPx})}}postProcessFromRow=visible.top;postProcessToRow=Math.min(getDataLengthIncludingAddNew()-1,visible.bottom);startPostProcessing();lastRenderedScrollTop=scrollTop;lastRenderedScrollLeft=scrollLeft;h_render=null;trigger(self.onRendered,{startRow:visible.top,endRow:visible.bottom,grid:self})}function handleHeaderScroll(){handleElementScroll($headerScrollContainer[0])}function handleHeaderRowScroll(){var scrollLeft=$headerRowScrollContainer[0].scrollLeft;if(scrollLeft!=$viewportScrollContainerX[0].scrollLeft){$viewportScrollContainerX[0].scrollLeft=scrollLeft}}function handleFooterRowScroll(){var scrollLeft=$footerRowScrollContainer[0].scrollLeft;if(scrollLeft!=$viewportScrollContainerX[0].scrollLeft){$viewportScrollContainerX[0].scrollLeft=scrollLeft}}function handlePreHeaderPanelScroll(){handleElementScroll($preHeaderPanelScroller[0])}function handleElementScroll(element){var scrollLeft=element.scrollLeft;if(scrollLeft!=$viewportScrollContainerX[0].scrollLeft){$viewportScrollContainerX[0].scrollLeft=scrollLeft}}function handleScroll(){scrollTop=$viewportScrollContainerY[0].scrollTop;scrollLeft=$viewportScrollContainerX[0].scrollLeft;return _handleScroll(false)}function _handleScroll(isMouseWheel){var maxScrollDistanceY=$viewportScrollContainerY[0].scrollHeight-$viewportScrollContainerY[0].clientHeight;var maxScrollDistanceX=$viewportScrollContainerY[0].scrollWidth-$viewportScrollContainerY[0].clientWidth;if(scrollTop>maxScrollDistanceY){scrollTop=maxScrollDistanceY}if(scrollLeft>maxScrollDistanceX){scrollLeft=maxScrollDistanceX}var vScrollDist=Math.abs(scrollTop-prevScrollTop);var hScrollDist=Math.abs(scrollLeft-prevScrollLeft);if(hScrollDist){prevScrollLeft=scrollLeft;$viewportScrollContainerX[0].scrollLeft=scrollLeft;$headerScrollContainer[0].scrollLeft=scrollLeft;$topPanelScroller[0].scrollLeft=scrollLeft;$headerRowScrollContainer[0].scrollLeft=scrollLeft;if(options.createFooterRow){$footerRowScrollContainer[0].scrollLeft=scrollLeft}if(options.createPreHeaderPanel){$preHeaderPanelScroller[0].scrollLeft=scrollLeft}if(hasFrozenColumns()){if(hasFrozenRows){$viewportTopR[0].scrollLeft=scrollLeft}}else{if(hasFrozenRows){$viewportTopL[0].scrollLeft=scrollLeft}}}if(vScrollDist){vScrollDir=prevScrollTop<scrollTop?1:-1;prevScrollTop=scrollTop;if(isMouseWheel){$viewportScrollContainerY[0].scrollTop=scrollTop}if(hasFrozenColumns()){if(hasFrozenRows&&!options.frozenBottom){$viewportBottomL[0].scrollTop=scrollTop}else{$viewportTopL[0].scrollTop=scrollTop}}if(vScrollDist<viewportH){scrollTo(scrollTop+offset)}else{var oldOffset=offset;if(h==viewportH){page=0}else{page=Math.min(n-1,Math.floor(scrollTop*((th-viewportH)/(h-viewportH))*(1/ph)))}offset=Math.round(page*cj);if(oldOffset!=offset){invalidateAllRows()}}}if(hScrollDist||vScrollDist){var dx=Math.abs(lastRenderedScrollLeft-scrollLeft);var dy=Math.abs(lastRenderedScrollTop-scrollTop);if(dx>20||dy>20){if(options.forceSyncScrolling||dy<viewportH&&dx<viewportW){render()}else{scrollThrottle.enqueue()}trigger(self.onViewportChanged,{})}}trigger(self.onScroll,{scrollLeft:scrollLeft,scrollTop:scrollTop});if(hScrollDist||vScrollDist)return true;return false}function ActionThrottle(action,minPeriod_ms){var blocked=false;var queued=false;function enqueue(){if(!blocked){blockAndExecute()}else{queued=true}}function dequeue(){queued=false}function blockAndExecute(){blocked=true;setTimeout(unblock,minPeriod_ms);action()}function unblock(){if(queued){dequeue();blockAndExecute()}else{blocked=false}}return{enqueue:enqueue,dequeue:dequeue}}function asyncPostProcessRows(){var dataLength=getDataLength();while(postProcessFromRow<=postProcessToRow){var row=vScrollDir>=0?postProcessFromRow++:postProcessToRow--;var cacheEntry=rowsCache[row];if(!cacheEntry||row>=dataLength){continue}if(!postProcessedRows[row]){postProcessedRows[row]={}}ensureCellNodesInRowsCache(row);for(var columnIdx in cacheEntry.cellNodesByColumnIdx){if(!cacheEntry.cellNodesByColumnIdx.hasOwnProperty(columnIdx)){continue}columnIdx=columnIdx|0;var m=columns[columnIdx];var processedStatus=postProcessedRows[row][columnIdx];if(m.asyncPostRender&&processedStatus!=="R"){var node=cacheEntry.cellNodesByColumnIdx[columnIdx];if(node){m.asyncPostRender(node,row,getDataItem(row),m,processedStatus==="C")}postProcessedRows[row][columnIdx]="R"}}h_postrender=setTimeout(asyncPostProcessRows,options.asyncPostRenderDelay);return}}function asyncPostProcessCleanupRows(){if(postProcessedCleanupQueue.length>0){var groupId=postProcessedCleanupQueue[0].groupId;while(postProcessedCleanupQueue.length>0&&postProcessedCleanupQueue[0].groupId==groupId){var entry=postProcessedCleanupQueue.shift();if(entry.actionType=="R"){$(entry.node).remove()}if(entry.actionType=="C"){var column=columns[entry.columnIdx];if(column.asyncPostRenderCleanup&&entry.node){column.asyncPostRenderCleanup(entry.node,entry.rowIdx,column)}}}h_postrenderCleanup=setTimeout(asyncPostProcessCleanupRows,options.asyncPostRenderCleanupDelay)}}function updateCellCssStylesOnRenderedRows(addedHash,removedHash){var node,columnId,addedRowHash,removedRowHash;for(var row in rowsCache){removedRowHash=removedHash&&removedHash[row];addedRowHash=addedHash&&addedHash[row];if(removedRowHash){for(columnId in removedRowHash){if(!addedRowHash||removedRowHash[columnId]!=addedRowHash[columnId]){node=getCellNode(row,getColumnIndex(columnId));if(node){$(node).removeClass(removedRowHash[columnId])}}}}if(addedRowHash){for(columnId in addedRowHash){if(!removedRowHash||removedRowHash[columnId]!=addedRowHash[columnId]){node=getCellNode(row,getColumnIndex(columnId));if(node){$(node).addClass(addedRowHash[columnId])}}}}}}function addCellCssStyles(key,hash){if(cellCssClasses[key]){throw new Error("addCellCssStyles: cell CSS hash with key '"+key+"' already exists.")}cellCssClasses[key]=hash;updateCellCssStylesOnRenderedRows(hash,null);trigger(self.onCellCssStylesChanged,{key:key,hash:hash,grid:self})}function removeCellCssStyles(key){if(!cellCssClasses[key]){return}updateCellCssStylesOnRenderedRows(null,cellCssClasses[key]);delete cellCssClasses[key];trigger(self.onCellCssStylesChanged,{key:key,hash:null,grid:self})}function setCellCssStyles(key,hash){var prevHash=cellCssClasses[key];cellCssClasses[key]=hash;updateCellCssStylesOnRenderedRows(hash,prevHash);trigger(self.onCellCssStylesChanged,{key:key,hash:hash,grid:self})}function getCellCssStyles(key){return cellCssClasses[key]}function flashCell(row,cell,speed){speed=speed||100;if(rowsCache[row]){var $cell=$(getCellNode(row,cell));function toggleCellClass(times){if(!times){return}setTimeout((function(){$cell.queue((function(){$cell.toggleClass(options.cellFlashingCssClass).dequeue();toggleCellClass(times-1)}))}),speed)}toggleCellClass(4)}}function handleMouseWheel(e,delta,deltaX,deltaY){var $rowNode=$(e.target).closest(".slick-row");var rowNode=$rowNode[0];if(rowNode!=rowNodeFromLastMouseWheelEvent){var $gridCanvas=$rowNode.parents(".grid-canvas");var left=$gridCanvas.hasClass("grid-canvas-left");if(zombieRowNodeFromLastMouseWheelEvent&&zombieRowNodeFromLastMouseWheelEvent[left?0:1]!=rowNode){var zombieRow=zombieRowNodeFromLastMouseWheelEvent[left||zombieRowNodeFromLastMouseWheelEvent.length==1?0:1];zombieRow.parentElement.removeChild(zombieRow);zombieRowNodeFromLastMouseWheelEvent=null}rowNodeFromLastMouseWheelEvent=rowNode}scrollTop=Math.max(0,$viewportScrollContainerY[0].scrollTop-deltaY*options.rowHeight);scrollLeft=$viewportScrollContainerX[0].scrollLeft+deltaX*10;var handled=_handleScroll(true);if(handled)e.preventDefault()}function handleDragInit(e,dd){var cell=getCellFromEvent(e);if(!cell||!cellExists(cell.row,cell.cell)){return false}var retval=trigger(self.onDragInit,dd,e);if(e.isImmediatePropagationStopped()){return retval}return false}function handleDragStart(e,dd){var cell=getCellFromEvent(e);if(!cell||!cellExists(cell.row,cell.cell)){return false}var retval=trigger(self.onDragStart,dd,e);if(e.isImmediatePropagationStopped()){return retval}return false}function handleDrag(e,dd){return trigger(self.onDrag,dd,e)}function handleDragEnd(e,dd){trigger(self.onDragEnd,dd,e)}function handleKeyDown(e){trigger(self.onKeyDown,{row:activeRow,cell:activeCell},e);var handled=e.isImmediatePropagationStopped();var keyCode=Slick.keyCode;if(!handled){if(!e.shiftKey&&!e.altKey){if(options.editable&&currentEditor&&currentEditor.keyCaptureList){if(currentEditor.keyCaptureList.indexOf(e.which)>-1){return}}if(e.which==keyCode.HOME){handled=e.ctrlKey?navigateTop():navigateRowStart()}else if(e.which==keyCode.END){handled=e.ctrlKey?navigateBottom():navigateRowEnd()}}}if(!handled){if(!e.shiftKey&&!e.altKey&&!e.ctrlKey){if(options.editable&&currentEditor&&currentEditor.keyCaptureList){if(currentEditor.keyCaptureList.indexOf(e.which)>-1){return}}if(e.which==keyCode.ESCAPE){if(!getEditorLock().isActive()){return}cancelEditAndSetFocus()}else if(e.which==keyCode.PAGE_DOWN){navigatePageDown();handled=true}else if(e.which==keyCode.PAGE_UP){navigatePageUp();handled=true}else if(e.which==keyCode.LEFT){handled=navigateLeft()}else if(e.which==keyCode.RIGHT){handled=navigateRight()}else if(e.which==keyCode.UP){handled=navigateUp()}else if(e.which==keyCode.DOWN){handled=navigateDown()}else if(e.which==keyCode.TAB){handled=navigateNext()}else if(e.which==keyCode.ENTER){if(options.editable){if(currentEditor){if(activeRow===getDataLength()){navigateDown()}else{commitEditAndSetFocus()}}else{if(getEditorLock().commitCurrentEdit()){makeActiveCellEditable(undefined,undefined,e)}}}handled=true}}else if(e.which==keyCode.TAB&&e.shiftKey&&!e.ctrlKey&&!e.altKey){handled=navigatePrev()}}if(handled){e.stopPropagation();e.preventDefault();try{e.originalEvent.keyCode=0}catch(error){}}}function handleClick(e){if(!currentEditor){if(e.target!=document.activeElement||$(e.target).hasClass("slick-cell")){setFocus()}}var cell=getCellFromEvent(e);if(!cell||currentEditor!==null&&activeRow==cell.row&&activeCell==cell.cell){return}trigger(self.onClick,{row:cell.row,cell:cell.cell},e);if(e.isImmediatePropagationStopped()){return}if(canCellBeActive(cell.row,cell.cell)){if(!getEditorLock().isActive()||getEditorLock().commitCurrentEdit()){scrollRowIntoView(cell.row,false);var preClickModeOn=e.target&&e.target.className===Slick.preClickClassName;var column=columns[cell.cell];var suppressActiveCellChangedEvent=options.editable&&column&&column.editor&&options.suppressActiveCellChangeOnEdit?true:false;setActiveCellInternal(getCellNode(cell.row,cell.cell),null,preClickModeOn,suppressActiveCellChangedEvent,e)}}}function handleContextMenu(e){var $cell=$(e.target).closest(".slick-cell",$canvas);if($cell.length===0){return}if(activeCellNode===$cell[0]&&currentEditor!==null){return}trigger(self.onContextMenu,{},e)}function handleDblClick(e){var cell=getCellFromEvent(e);if(!cell||currentEditor!==null&&activeRow==cell.row&&activeCell==cell.cell){return}trigger(self.onDblClick,{row:cell.row,cell:cell.cell},e);if(e.isImmediatePropagationStopped()){return}if(options.editable){gotoCell(cell.row,cell.cell,true,e)}}function handleHeaderMouseEnter(e){trigger(self.onHeaderMouseEnter,{column:$(this).data("column"),grid:self},e)}function handleHeaderMouseLeave(e){trigger(self.onHeaderMouseLeave,{column:$(this).data("column"),grid:self},e)}function handleHeaderContextMenu(e){var $header=$(e.target).closest(".slick-header-column",".slick-header-columns");var column=$header&&$header.data("column");trigger(self.onHeaderContextMenu,{column:column},e)}function handleHeaderClick(e){if(columnResizeDragging)return;var $header=$(e.target).closest(".slick-header-column",".slick-header-columns");var column=$header&&$header.data("column");if(column){trigger(self.onHeaderClick,{column:column},e)}}function handleMouseEnter(e){trigger(self.onMouseEnter,{},e)}function handleMouseLeave(e){trigger(self.onMouseLeave,{},e)}function cellExists(row,cell){return!(row<0||row>=getDataLength()||cell<0||cell>=columns.length)}function getCellFromPoint(x,y){var row=getRowFromPosition(y);var cell=0;var w=0;for(var i=0;i<columns.length&&w<x;i++){w+=columns[i].width;cell++}if(cell<0){cell=0}return{row:row,cell:cell-1}}function getCellFromNode(cellNode){var cls=/l\d+/.exec(cellNode.className);if(!cls){throw new Error("getCellFromNode: cannot get cell - "+cellNode.className)}return parseInt(cls[0].substr(1,cls[0].length-1),10)}function getRowFromNode(rowNode){for(var row in rowsCache){for(var i in rowsCache[row].rowNode){if(rowsCache[row].rowNode[i]===rowNode)return row|0}}return null}function getFrozenRowOffset(row){var offset=hasFrozenRows?options.frozenBottom?row>=actualFrozenRow?h<viewportTopH?actualFrozenRow*options.rowHeight:h:0:row>=actualFrozenRow?frozenRowsHeight:0:0;return offset}function getCellFromEvent(e){var row,cell;var $cell=$(e.target).closest(".slick-cell",$canvas);if(!$cell.length){return null}row=getRowFromNode($cell[0].parentNode);if(hasFrozenRows){var c=$cell.parents(".grid-canvas").offset();var rowOffset=0;var isBottom=$cell.parents(".grid-canvas-bottom").length;if(isBottom){rowOffset=options.frozenBottom?$canvasTopL.height():frozenRowsHeight}row=getCellFromPoint(e.clientX-c.left,e.clientY-c.top+rowOffset+$(document).scrollTop()).row}cell=getCellFromNode($cell[0]);if(row==null||cell==null){return null}else{return{row:row,cell:cell}}}function getCellNodeBox(row,cell){if(!cellExists(row,cell)){return null}var frozenRowOffset=getFrozenRowOffset(row);var y1=getRowTop(row)-frozenRowOffset;var y2=y1+options.rowHeight-1;var x1=0;for(var i=0;i<cell;i++){x1+=columns[i].width;if(options.frozenColumn==i){x1=0}}var x2=x1+columns[cell].width;return{top:y1,left:x1,bottom:y2,right:x2}}function resetActiveCell(){setActiveCellInternal(null,false)}function setFocus(){if(tabbingDirection==-1){$focusSink[0].focus()}else{$focusSink2[0].focus()}}function scrollCellIntoView(row,cell,doPaging){scrollRowIntoView(row,doPaging);if(cell<=options.frozenColumn){return}var colspan=getColspan(row,cell);internalScrollColumnIntoView(columnPosLeft[cell],columnPosRight[cell+(colspan>1?colspan-1:0)])}function internalScrollColumnIntoView(left,right){var scrollRight=scrollLeft+$viewportScrollContainerX.width();if(left<scrollLeft){$viewportScrollContainerX.scrollLeft(left);handleScroll();render()}else if(right>scrollRight){$viewportScrollContainerX.scrollLeft(Math.min(left,right-$viewportScrollContainerX[0].clientWidth));handleScroll();render()}}function scrollColumnIntoView(cell){internalScrollColumnIntoView(columnPosLeft[cell],columnPosRight[cell])}function setActiveCellInternal(newCell,opt_editMode,preClickModeOn,suppressActiveCellChangedEvent,e){if(activeCellNode!==null){makeActiveCellNormal();$(activeCellNode).removeClass("active");if(rowsCache[activeRow]){$(rowsCache[activeRow].rowNode).removeClass("active")}}var activeCellChanged=activeCellNode!==newCell;activeCellNode=newCell;if(activeCellNode!=null){var $activeCellNode=$(activeCellNode);var $activeCellOffset=$activeCellNode.offset();var rowOffset=Math.floor($activeCellNode.parents(".grid-canvas").offset().top);var isBottom=$activeCellNode.parents(".grid-canvas-bottom").length;if(hasFrozenRows&&isBottom){rowOffset-=options.frozenBottom?$canvasTopL.height():frozenRowsHeight}cell=getCellFromPoint($activeCellOffset.left,Math.ceil($activeCellOffset.top)-rowOffset);activeRow=cell.row;activeCell=activePosX=activeCell=activePosX=getCellFromNode(activeCellNode);$activeCellNode.addClass("active");if(rowsCache[activeRow]){$(rowsCache[activeRow].rowNode).addClass("active")}if(opt_editMode==null){opt_editMode=activeRow==getDataLength()||options.autoEdit}if(options.showCellSelection){$(activeCellNode).addClass("active");$(rowsCache[activeRow].rowNode).addClass("active")}if(options.editable&&opt_editMode&&isCellPotentiallyEditable(activeRow,activeCell)){clearTimeout(h_editorLoader);if(options.asyncEditorLoading){h_editorLoader=setTimeout((function(){makeActiveCellEditable(undefined,preClickModeOn,e)}),options.asyncEditorLoadDelay)}else{makeActiveCellEditable(undefined,preClickModeOn,e)}}}else{activeRow=activeCell=null}if(!suppressActiveCellChangedEvent){trigger(self.onActiveCellChanged,getActiveCell())}}function clearTextSelection(){if(document.selection&&document.selection.empty){try{document.selection.empty()}catch(e){}}else if(window.getSelection){var sel=window.getSelection();if(sel&&sel.removeAllRanges){sel.removeAllRanges()}}}function isCellPotentiallyEditable(row,cell){var dataLength=getDataLength();if(row<dataLength&&!getDataItem(row)){return false}if(columns[cell].cannotTriggerInsert&&row>=dataLength){return false}if(!getEditor(row,cell)){return false}return true}function makeActiveCellNormal(){if(!currentEditor){return}trigger(self.onBeforeCellEditorDestroy,{editor:currentEditor});currentEditor.destroy();currentEditor=null;if(activeCellNode){var d=getDataItem(activeRow);$(activeCellNode).removeClass("editable invalid");if(d){var column=columns[activeCell];var formatter=getFormatter(activeRow,column);var formatterResult=formatter(activeRow,activeCell,getDataItemValueForColumn(d,column),column,d,self);applyFormatResultToCellNode(formatterResult,activeCellNode);invalidatePostProcessingResults(activeRow)}}if(navigator.userAgent.toLowerCase().match(/msie/)){clearTextSelection()}getEditorLock().deactivate(editController)}function makeActiveCellEditable(editor,preClickModeOn,e){if(!activeCellNode){return}if(!options.editable){throw new Error("Grid : makeActiveCellEditable : should never get called when options.editable is false")}clearTimeout(h_editorLoader);if(!isCellPotentiallyEditable(activeRow,activeCell)){return}var columnDef=columns[activeCell];var item=getDataItem(activeRow);if(trigger(self.onBeforeEditCell,{row:activeRow,cell:activeCell,item:item,column:columnDef})===false){setFocus();return}getEditorLock().activate(editController);$(activeCellNode).addClass("editable");var useEditor=editor||getEditor(activeRow,activeCell);if(!editor&&!useEditor.suppressClearOnEdit){activeCellNode.innerHTML=""}var metadata=data.getItemMetadata&&data.getItemMetadata(activeRow);metadata=metadata&&metadata.columns;var columnMetaData=metadata&&(metadata[columnDef.id]||metadata[activeCell]);currentEditor=new useEditor({grid:self,gridPosition:absBox($container[0]),position:absBox(activeCellNode),container:activeCellNode,column:columnDef,columnMetaData:columnMetaData,item:item||{},event:e,commitChanges:commitEditAndSetFocus,cancelChanges:cancelEditAndSetFocus});if(item){currentEditor.loadValue(item);if(preClickModeOn&&currentEditor.preClick){currentEditor.preClick()}}serializedEditorValue=currentEditor.serializeValue();if(currentEditor.position){handleActiveCellPositionChange()}}function commitEditAndSetFocus(){if(getEditorLock().commitCurrentEdit()){setFocus();if(options.autoEdit){navigateDown()}}}function cancelEditAndSetFocus(){if(getEditorLock().cancelCurrentEdit()){setFocus()}}function absBox(elem){var box={top:elem.offsetTop,left:elem.offsetLeft,bottom:0,right:0,width:$(elem).outerWidth(),height:$(elem).outerHeight(),visible:true};box.bottom=box.top+box.height;box.right=box.left+box.width;var offsetParent=elem.offsetParent;while((elem=elem.parentNode)!=document.body){if(elem==null)break;if(box.visible&&elem.scrollHeight!=elem.offsetHeight&&$(elem).css("overflowY")!="visible"){box.visible=box.bottom>elem.scrollTop&&box.top<elem.scrollTop+elem.clientHeight}if(box.visible&&elem.scrollWidth!=elem.offsetWidth&&$(elem).css("overflowX")!="visible"){box.visible=box.right>elem.scrollLeft&&box.left<elem.scrollLeft+elem.clientWidth}box.left-=elem.scrollLeft;box.top-=elem.scrollTop;if(elem===offsetParent){box.left+=elem.offsetLeft;box.top+=elem.offsetTop;offsetParent=elem.offsetParent}box.bottom=box.top+box.height;box.right=box.left+box.width}return box}function getActiveCellPosition(){return absBox(activeCellNode)}function getGridPosition(){return absBox($container[0])}function handleActiveCellPositionChange(){if(!activeCellNode){return}trigger(self.onActiveCellPositionChanged,{});if(currentEditor){var cellBox=getActiveCellPosition();if(currentEditor.show&&currentEditor.hide){if(!cellBox.visible){currentEditor.hide()}else{currentEditor.show()}}if(currentEditor.position){currentEditor.position(cellBox)}}}function getCellEditor(){return currentEditor}function getActiveCell(){if(!activeCellNode){return null}else{return{row:activeRow,cell:activeCell}}}function getActiveCellNode(){return activeCellNode}function scrollRowIntoView(row,doPaging){if(!hasFrozenRows||!options.frozenBottom&&row>actualFrozenRow-1||options.frozenBottom&&row<actualFrozenRow-1){var viewportScrollH=$viewportScrollContainerY.height();var rowNumber=hasFrozenRows&&!options.frozenBottom?row-options.frozenRow:row;var rowAtTop=rowNumber*options.rowHeight;var rowAtBottom=(rowNumber+1)*options.rowHeight-viewportScrollH+(viewportHasHScroll?scrollbarDimensions.height:0);if((rowNumber+1)*options.rowHeight>scrollTop+viewportScrollH+offset){scrollTo(doPaging?rowAtTop:rowAtBottom);render()}else if(rowNumber*options.rowHeight<scrollTop+offset){scrollTo(doPaging?rowAtBottom:rowAtTop);render()}}}function scrollRowToTop(row){scrollTo(row*options.rowHeight);render()}function scrollPage(dir){var deltaRows=dir*numVisibleRows;var bottomOfTopmostFullyVisibleRow=scrollTop+options.rowHeight-1;scrollTo((getRowFromPosition(bottomOfTopmostFullyVisibleRow)+deltaRows)*options.rowHeight);render();if(options.enableCellNavigation&&activeRow!=null){var row=activeRow+deltaRows;var dataLengthIncludingAddNew=getDataLengthIncludingAddNew();if(row>=dataLengthIncludingAddNew){row=dataLengthIncludingAddNew-1}if(row<0){row=0}var cell=0,prevCell=null;var prevActivePosX=activePosX;while(cell<=activePosX){if(canCellBeActive(row,cell)){prevCell=cell}cell+=getColspan(row,cell)}if(prevCell!==null){setActiveCellInternal(getCellNode(row,prevCell));activePosX=prevActivePosX}else{resetActiveCell()}}}function navigatePageDown(){scrollPage(1)}function navigatePageUp(){scrollPage(-1)}function navigateTop(){navigateToRow(0)}function navigateBottom(){navigateToRow(getDataLength()-1)}function navigateToRow(row){var num_rows=getDataLength();if(!num_rows)return true;if(row<0)row=0;else if(row>=num_rows)row=num_rows-1;scrollCellIntoView(row,0,true);if(options.enableCellNavigation&&activeRow!=null){var cell=0,prevCell=null;var prevActivePosX=activePosX;while(cell<=activePosX){if(canCellBeActive(row,cell)){prevCell=cell}cell+=getColspan(row,cell)}if(prevCell!==null){setActiveCellInternal(getCellNode(row,prevCell));activePosX=prevActivePosX}else{resetActiveCell()}}return true}function getColspan(row,cell){var metadata=data.getItemMetadata&&data.getItemMetadata(row);if(!metadata||!metadata.columns){return 1}var columnData=metadata.columns[columns[cell].id]||metadata.columns[cell];var colspan=columnData&&columnData.colspan;if(colspan==="*"){colspan=columns.length-cell}else{colspan=colspan||1}return colspan}function findFirstFocusableCell(row){var cell=0;while(cell<columns.length){if(canCellBeActive(row,cell)){return cell}cell+=getColspan(row,cell)}return null}function findLastFocusableCell(row){var cell=0;var lastFocusableCell=null;while(cell<columns.length){if(canCellBeActive(row,cell)){lastFocusableCell=cell}cell+=getColspan(row,cell)}return lastFocusableCell}function gotoRight(row,cell,posX){if(cell>=columns.length){return null}do{cell+=getColspan(row,cell)}while(cell<columns.length&&!canCellBeActive(row,cell));if(cell<columns.length){return{row:row,cell:cell,posX:cell}}return null}function gotoLeft(row,cell,posX){if(cell<=0){return null}var firstFocusableCell=findFirstFocusableCell(row);if(firstFocusableCell===null||firstFocusableCell>=cell){return null}var prev={row:row,cell:firstFocusableCell,posX:firstFocusableCell};var pos;while(true){pos=gotoRight(prev.row,prev.cell,prev.posX);if(!pos){return null}if(pos.cell>=cell){return prev}prev=pos}}function gotoDown(row,cell,posX){var prevCell;var dataLengthIncludingAddNew=getDataLengthIncludingAddNew();while(true){if(++row>=dataLengthIncludingAddNew){return null}prevCell=cell=0;while(cell<=posX){prevCell=cell;cell+=getColspan(row,cell)}if(canCellBeActive(row,prevCell)){return{row:row,cell:prevCell,posX:posX}}}}function gotoUp(row,cell,posX){var prevCell;while(true){if(--row<0){return null}prevCell=cell=0;while(cell<=posX){prevCell=cell;cell+=getColspan(row,cell)}if(canCellBeActive(row,prevCell)){return{row:row,cell:prevCell,posX:posX}}}}function gotoNext(row,cell,posX){if(row==null&&cell==null){row=cell=posX=0;if(canCellBeActive(row,cell)){return{row:row,cell:cell,posX:cell}}}var pos=gotoRight(row,cell,posX);if(pos){return pos}var firstFocusableCell=null;var dataLengthIncludingAddNew=getDataLengthIncludingAddNew();if(row===dataLengthIncludingAddNew-1){row--}while(++row<dataLengthIncludingAddNew){firstFocusableCell=findFirstFocusableCell(row);if(firstFocusableCell!==null){return{row:row,cell:firstFocusableCell,posX:firstFocusableCell}}}return null}function gotoPrev(row,cell,posX){if(row==null&&cell==null){row=getDataLengthIncludingAddNew()-1;cell=posX=columns.length-1;if(canCellBeActive(row,cell)){return{row:row,cell:cell,posX:cell}}}var pos;var lastSelectableCell;while(!pos){pos=gotoLeft(row,cell,posX);if(pos){break}if(--row<0){return null}cell=0;lastSelectableCell=findLastFocusableCell(row);if(lastSelectableCell!==null){pos={row:row,cell:lastSelectableCell,posX:lastSelectableCell}}}return pos}function gotoRowStart(row,cell,posX){var newCell=findFirstFocusableCell(row);if(newCell===null)return null;return{row:row,cell:newCell,posX:newCell}}function gotoRowEnd(row,cell,posX){var newCell=findLastFocusableCell(row);if(newCell===null)return null;return{row:row,cell:newCell,posX:newCell}}function navigateRight(){return navigate("right")}function navigateLeft(){return navigate("left")}function navigateDown(){return navigate("down")}function navigateUp(){return navigate("up")}function navigateNext(){return navigate("next")}function navigatePrev(){return navigate("prev")}function navigateRowStart(){return navigate("home")}function navigateRowEnd(){return navigate("end")}function navigate(dir){if(!options.enableCellNavigation){return false}if(!activeCellNode&&dir!="prev"&&dir!="next"){return false}if(!getEditorLock().commitCurrentEdit()){return true}setFocus();var tabbingDirections={up:-1,down:1,left:-1,right:1,prev:-1,next:1,home:-1,end:1};tabbingDirection=tabbingDirections[dir];var stepFunctions={up:gotoUp,down:gotoDown,left:gotoLeft,right:gotoRight,prev:gotoPrev,next:gotoNext,home:gotoRowStart,end:gotoRowEnd};var stepFn=stepFunctions[dir];var pos=stepFn(activeRow,activeCell,activePosX);if(pos){if(hasFrozenRows&&options.frozenBottom&pos.row==getDataLength()){return}var isAddNewRow=pos.row==getDataLength();if(!options.frozenBottom&&pos.row>=actualFrozenRow||options.frozenBottom&&pos.row<actualFrozenRow){scrollCellIntoView(pos.row,pos.cell,!isAddNewRow&&options.emulatePagingWhenScrolling)}setActiveCellInternal(getCellNode(pos.row,pos.cell));activePosX=pos.posX;return true}else{setActiveCellInternal(getCellNode(activeRow,activeCell));return false}}function getCellNode(row,cell){if(rowsCache[row]){ensureCellNodesInRowsCache(row);try{return rowsCache[row].cellNodesByColumnIdx[cell][0]}catch(e){return rowsCache[row].cellNodesByColumnIdx[cell]}}return null}function setActiveCell(row,cell,opt_editMode,preClickModeOn,suppressActiveCellChangedEvent){if(!initialized){return}if(row>getDataLength()||row<0||cell>=columns.length||cell<0){return}if(!options.enableCellNavigation){return}scrollCellIntoView(row,cell,false);setActiveCellInternal(getCellNode(row,cell),opt_editMode,preClickModeOn,suppressActiveCellChangedEvent)}function canCellBeActive(row,cell){if(!options.enableCellNavigation||row>=getDataLengthIncludingAddNew()||row<0||cell>=columns.length||cell<0){return false}var rowMetadata=data.getItemMetadata&&data.getItemMetadata(row);if(rowMetadata&&typeof rowMetadata.focusable!=="undefined"){return!!rowMetadata.focusable}var columnMetadata=rowMetadata&&rowMetadata.columns;if(columnMetadata&&columnMetadata[columns[cell].id]&&typeof columnMetadata[columns[cell].id].focusable!=="undefined"){return!!columnMetadata[columns[cell].id].focusable}if(columnMetadata&&columnMetadata[cell]&&typeof columnMetadata[cell].focusable!=="undefined"){return!!columnMetadata[cell].focusable}return!!columns[cell].focusable}function canCellBeSelected(row,cell){if(row>=getDataLength()||row<0||cell>=columns.length||cell<0){return false}var rowMetadata=data.getItemMetadata&&data.getItemMetadata(row);if(rowMetadata&&typeof rowMetadata.selectable!=="undefined"){return!!rowMetadata.selectable}var columnMetadata=rowMetadata&&rowMetadata.columns&&(rowMetadata.columns[columns[cell].id]||rowMetadata.columns[cell]);if(columnMetadata&&typeof columnMetadata.selectable!=="undefined"){return!!columnMetadata.selectable}return!!columns[cell].selectable}function gotoCell(row,cell,forceEdit,e){if(!initialized){return}if(!canCellBeActive(row,cell)){return}if(!getEditorLock().commitCurrentEdit()){return}scrollCellIntoView(row,cell,false);var newCell=getCellNode(row,cell);setActiveCellInternal(newCell,forceEdit||row===getDataLength()||options.autoEdit,null,options.editable,e);if(!currentEditor){setFocus()}}function commitCurrentEdit(){var item=getDataItem(activeRow);var column=columns[activeCell];if(currentEditor){if(currentEditor.isValueChanged()){var validationResults=currentEditor.validate();if(validationResults.valid){if(activeRow<getDataLength()){var editCommand={row:activeRow,cell:activeCell,editor:currentEditor,serializedValue:currentEditor.serializeValue(),prevSerializedValue:serializedEditorValue,execute:function(){this.editor.applyValue(item,this.serializedValue);updateRow(this.row);trigger(self.onCellChange,{row:this.row,cell:this.cell,item:item})},undo:function(){this.editor.applyValue(item,this.prevSerializedValue);updateRow(this.row);trigger(self.onCellChange,{row:this.row,cell:this.cell,item:item})}};if(options.editCommandHandler){makeActiveCellNormal();options.editCommandHandler(item,column,editCommand)}else{editCommand.execute();makeActiveCellNormal()}}else{var newItem={};currentEditor.applyValue(newItem,currentEditor.serializeValue());makeActiveCellNormal();trigger(self.onAddNewRow,{item:newItem,column:column})}return!getEditorLock().isActive()}else{$(activeCellNode).removeClass("invalid");$(activeCellNode).width();$(activeCellNode).addClass("invalid");trigger(self.onValidationError,{editor:currentEditor,cellNode:activeCellNode,validationResults:validationResults,row:activeRow,cell:activeCell,column:column});currentEditor.focus();return false}}makeActiveCellNormal()}return true}function cancelCurrentEdit(){makeActiveCellNormal();return true}function rowsToRanges(rows){var ranges=[];var lastCell=columns.length-1;for(var i=0;i<rows.length;i++){ranges.push(new Slick.Range(rows[i],0,rows[i],lastCell))}return ranges}function getSelectedRows(){if(!selectionModel){throw new Error("Selection model is not set")}return selectedRows}function setSelectedRows(rows){if(!selectionModel){throw new Error("Selection model is not set")}if(self&&self.getEditorLock&&!self.getEditorLock().isActive()){selectionModel.setSelectedRanges(rowsToRanges(rows))}}this.debug=function(){var s="";s+="\n"+"counter_rows_rendered:  "+counter_rows_rendered;s+="\n"+"counter_rows_removed:  "+counter_rows_removed;s+="\n"+"renderedRows:  "+renderedRows;s+="\n"+"numVisibleRows:  "+numVisibleRows;s+="\n"+"maxSupportedCssHeight:  "+maxSupportedCssHeight;s+="\n"+"n(umber of pages):  "+n;s+="\n"+"(current) page:  "+page;s+="\n"+"page height (ph):  "+ph;s+="\n"+"vScrollDir:  "+vScrollDir;alert(s)};this.eval=function(expr){return eval(expr)};$.extend(this,{slickGridVersion:"2.4.5",onScroll:new Slick.Event,onSort:new Slick.Event,onHeaderMouseEnter:new Slick.Event,onHeaderMouseLeave:new Slick.Event,onHeaderContextMenu:new Slick.Event,onHeaderClick:new Slick.Event,onHeaderCellRendered:new Slick.Event,onBeforeHeaderCellDestroy:new Slick.Event,onHeaderRowCellRendered:new Slick.Event,onFooterRowCellRendered:new Slick.Event,onBeforeHeaderRowCellDestroy:new Slick.Event,onBeforeFooterRowCellDestroy:new Slick.Event,onMouseEnter:new Slick.Event,onMouseLeave:new Slick.Event,onClick:new Slick.Event,onDblClick:new Slick.Event,onContextMenu:new Slick.Event,onKeyDown:new Slick.Event,onAddNewRow:new Slick.Event,onBeforeAppendCell:new Slick.Event,onValidationError:new Slick.Event,onViewportChanged:new Slick.Event,onColumnsReordered:new Slick.Event,onColumnsResized:new Slick.Event,onCellChange:new Slick.Event,onBeforeEditCell:new Slick.Event,onBeforeCellEditorDestroy:new Slick.Event,onBeforeDestroy:new Slick.Event,onActiveCellChanged:new Slick.Event,onActiveCellPositionChanged:new Slick.Event,onDragInit:new Slick.Event,onDragStart:new Slick.Event,onDrag:new Slick.Event,onDragEnd:new Slick.Event,onSelectedRowsChanged:new Slick.Event,onCellCssStylesChanged:new Slick.Event,onAutosizeColumns:new Slick.Event,onRendered:new Slick.Event,registerPlugin:registerPlugin,unregisterPlugin:unregisterPlugin,getPluginByName:getPluginByName,getColumns:getColumns,setColumns:setColumns,getColumnIndex:getColumnIndex,updateColumnHeader:updateColumnHeader,setSortColumn:setSortColumn,setSortColumns:setSortColumns,getSortColumns:getSortColumns,autosizeColumns:autosizeColumns,getOptions:getOptions,setOptions:setOptions,getData:getData,getDataLength:getDataLength,getDataItem:getDataItem,setData:setData,getSelectionModel:getSelectionModel,setSelectionModel:setSelectionModel,getSelectedRows:getSelectedRows,setSelectedRows:setSelectedRows,getContainerNode:getContainerNode,updatePagingStatusFromView:updatePagingStatusFromView,applyFormatResultToCellNode:applyFormatResultToCellNode,render:render,invalidate:invalidate,invalidateRow:invalidateRow,invalidateRows:invalidateRows,invalidateAllRows:invalidateAllRows,updateCell:updateCell,updateRow:updateRow,getViewport:getVisibleRange,getRenderedRange:getRenderedRange,resizeCanvas:resizeCanvas,updateRowCount:updateRowCount,scrollRowIntoView:scrollRowIntoView,scrollRowToTop:scrollRowToTop,scrollCellIntoView:scrollCellIntoView,scrollColumnIntoView:scrollColumnIntoView,getCanvasNode:getCanvasNode,getUID:getUID,getHeaderColumnWidthDiff:getHeaderColumnWidthDiff,getScrollbarDimensions:getScrollbarDimensions,getHeadersWidth:getHeadersWidth,getCanvasWidth:getCanvasWidth,getCanvases:getCanvases,getActiveCanvasNode:getActiveCanvasNode,setActiveCanvasNode:setActiveCanvasNode,getViewportNode:getViewportNode,getActiveViewportNode:getActiveViewportNode,setActiveViewportNode:setActiveViewportNode,focus:setFocus,scrollTo:scrollTo,getCellFromPoint:getCellFromPoint,getCellFromEvent:getCellFromEvent,getActiveCell:getActiveCell,setActiveCell:setActiveCell,getActiveCellNode:getActiveCellNode,getActiveCellPosition:getActiveCellPosition,resetActiveCell:resetActiveCell,editActiveCell:makeActiveCellEditable,getCellEditor:getCellEditor,getCellNode:getCellNode,getCellNodeBox:getCellNodeBox,canCellBeSelected:canCellBeSelected,canCellBeActive:canCellBeActive,navigatePrev:navigatePrev,navigateNext:navigateNext,navigateUp:navigateUp,navigateDown:navigateDown,navigateLeft:navigateLeft,navigateRight:navigateRight,navigatePageUp:navigatePageUp,navigatePageDown:navigatePageDown,navigateTop:navigateTop,navigateBottom:navigateBottom,navigateRowStart:navigateRowStart,navigateRowEnd:navigateRowEnd,gotoCell:gotoCell,getTopPanel:getTopPanel,setTopPanelVisibility:setTopPanelVisibility,getPreHeaderPanel:getPreHeaderPanel,setPreHeaderPanelVisibility:setPreHeaderPanelVisibility,getHeader:getHeader,getHeaderColumn:getHeaderColumn,setHeaderRowVisibility:setHeaderRowVisibility,getHeaderRow:getHeaderRow,getHeaderRowColumn:getHeaderRowColumn,setFooterRowVisibility:setFooterRowVisibility,getFooterRow:getFooterRow,getFooterRowColumn:getFooterRowColumn,getGridPosition:getGridPosition,flashCell:flashCell,addCellCssStyles:addCellCssStyles,setCellCssStyles:setCellCssStyles,removeCellCssStyles:removeCellCssStyles,getCellCssStyles:getCellCssStyles,getFrozenRowOffset:getFrozenRowOffset,init:finishInitialization,destroy:destroy,getEditorLock:getEditorLock,getEditController:getEditController});init()}})(jQuery);(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports=="object"&&typeof module=="object"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})((function($,undefined){"use strict";var defaultOpts={beforeShow:noop,move:noop,change:noop,show:noop,hide:noop,color:false,flat:false,showInput:false,allowEmpty:false,showButtons:true,clickoutFiresChange:true,showInitial:false,showPalette:false,showPaletteOnly:false,hideAfterPaletteSelect:false,togglePaletteOnly:false,showSelectionPalette:true,localStorageKey:false,appendTo:"body",maxSelectionSize:7,cancelText:"cancel",chooseText:"choose",togglePaletteMoreText:"more",togglePaletteLessText:"less",clearText:"Clear Color Selection",noColorSelectedText:"No Color Selected",preferredFormat:false,className:"",containerClassName:"",replacerClassName:"",showAlpha:false,theme:"sp-light",palette:[["#ffffff","#000000","#ff0000","#ff8000","#ffff00","#008000","#0000ff","#4b0082","#9400d3"]],selectionPalette:[],disabled:false,offset:null},spectrums=[],IE=!!/msie/i.exec(window.navigator.userAgent),rgbaSupport=function(){function contains(str,substr){return!!~(""+str).indexOf(substr)}var elem=document.createElement("div");var style=elem.style;style.cssText="background-color:rgba(0,0,0,.5)";return contains(style.backgroundColor,"rgba")||contains(style.backgroundColor,"hsla")}(),replaceInput=["<div class='sp-replacer'>","<div class='sp-preview'><div class='sp-preview-inner'></div></div>","<div class='sp-dd'>&#9660;</div>","</div>"].join(""),markup=function(){var gradientFix="";if(IE){for(var i=1;i<=6;i++){gradientFix+="<div class='sp-"+i+"'></div>"}}return["<div class='sp-container sp-hidden'>","<div class='sp-palette-container'>","<div class='sp-palette sp-thumb sp-cf'></div>","<div class='sp-palette-button-container sp-cf'>","<button type='button' class='sp-palette-toggle'></button>","</div>","</div>","<div class='sp-picker-container'>","<div class='sp-top sp-cf'>","<div class='sp-fill'></div>","<div class='sp-top-inner'>","<div class='sp-color'>","<div class='sp-sat'>","<div class='sp-val'>","<div class='sp-dragger'></div>","</div>","</div>","</div>","<div class='sp-clear sp-clear-display'>","</div>","<div class='sp-hue'>","<div class='sp-slider'></div>",gradientFix,"</div>","</div>","<div class='sp-alpha'><div class='sp-alpha-inner'><div class='sp-alpha-handle'></div></div></div>","</div>","<div class='sp-input-container sp-cf'>","<input class='sp-input' type='text' spellcheck='false'  />","</div>","<div class='sp-initial sp-thumb sp-cf'></div>","<div class='sp-button-container sp-cf'>","<a class='sp-cancel' href='#'></a>","<button type='button' class='sp-choose'></button>","</div>","</div>","</div>"].join("")}();function paletteTemplate(p,color,className,opts){var html=[];for(var i=0;i<p.length;i++){var current=p[i];if(current){var tiny=tinycolor(current);var c=tiny.toHsl().l<.5?"sp-thumb-el sp-thumb-dark":"sp-thumb-el sp-thumb-light";c+=tinycolor.equals(color,current)?" sp-thumb-active":"";var formattedString=tiny.toString(opts.preferredFormat||"rgb");var swatchStyle=rgbaSupport?"background-color:"+tiny.toRgbString():"filter:"+tiny.toFilter();html.push('<span title="'+formattedString+'" data-color="'+tiny.toRgbString()+'" class="'+c+'"><span class="sp-thumb-inner" style="'+swatchStyle+';" /></span>')}else{var cls="sp-clear-display";html.push($("<div />").append($('<span data-color="" style="background-color:transparent;" class="'+cls+'"></span>').attr("title",opts.noColorSelectedText)).html())}}return"<div class='sp-cf "+className+"'>"+html.join("")+"</div>"}function hideAll(){for(var i=0;i<spectrums.length;i++){if(spectrums[i]){spectrums[i].hide()}}}function instanceOptions(o,callbackContext){var opts=$.extend({},defaultOpts,o);opts.callbacks={move:bind(opts.move,callbackContext),change:bind(opts.change,callbackContext),show:bind(opts.show,callbackContext),hide:bind(opts.hide,callbackContext),beforeShow:bind(opts.beforeShow,callbackContext)};return opts}function spectrum(element,o){var opts=instanceOptions(o,element),flat=opts.flat,showSelectionPalette=opts.showSelectionPalette,localStorageKey=opts.localStorageKey,theme=opts.theme,callbacks=opts.callbacks,resize=throttle(reflow,10),visible=false,isDragging=false,dragWidth=0,dragHeight=0,dragHelperHeight=0,slideHeight=0,slideWidth=0,alphaWidth=0,alphaSlideHelperWidth=0,slideHelperHeight=0,currentHue=0,currentSaturation=0,currentValue=0,currentAlpha=1,palette=[],paletteArray=[],paletteLookup={},selectionPalette=opts.selectionPalette.slice(0),maxSelectionSize=opts.maxSelectionSize,draggingClass="sp-dragging",shiftMovementDirection=null;var doc=element.ownerDocument,body=doc.body,boundElement=$(element),disabled=false,container=$(markup,doc).addClass(theme),pickerContainer=container.find(".sp-picker-container"),dragger=container.find(".sp-color"),dragHelper=container.find(".sp-dragger"),slider=container.find(".sp-hue"),slideHelper=container.find(".sp-slider"),alphaSliderInner=container.find(".sp-alpha-inner"),alphaSlider=container.find(".sp-alpha"),alphaSlideHelper=container.find(".sp-alpha-handle"),textInput=container.find(".sp-input"),paletteContainer=container.find(".sp-palette"),initialColorContainer=container.find(".sp-initial"),cancelButton=container.find(".sp-cancel"),clearButton=container.find(".sp-clear"),chooseButton=container.find(".sp-choose"),toggleButton=container.find(".sp-palette-toggle"),isInput=boundElement.is("input"),isInputTypeColor=isInput&&boundElement.attr("type")==="color"&&inputTypeColorSupport(),shouldReplace=isInput&&!flat,replacer=shouldReplace?$(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName):$([]),offsetElement=shouldReplace?replacer:boundElement,previewElement=replacer.find(".sp-preview-inner"),initialColor=opts.color||isInput&&boundElement.val(),colorOnShow=false,currentPreferredFormat=opts.preferredFormat,clickoutFiresChange=!opts.showButtons||opts.clickoutFiresChange,isEmpty=!initialColor,allowEmpty=opts.allowEmpty&&!isInputTypeColor;function applyOptions(){if(opts.showPaletteOnly){opts.showPalette=true}toggleButton.text(opts.showPaletteOnly?opts.togglePaletteMoreText:opts.togglePaletteLessText);if(opts.palette){palette=opts.palette.slice(0);paletteArray=$.isArray(palette[0])?palette:[palette];paletteLookup={};for(var i=0;i<paletteArray.length;i++){for(var j=0;j<paletteArray[i].length;j++){var rgb=tinycolor(paletteArray[i][j]).toRgbString();paletteLookup[rgb]=true}}}container.toggleClass("sp-flat",flat);container.toggleClass("sp-input-disabled",!opts.showInput);container.toggleClass("sp-alpha-enabled",opts.showAlpha);container.toggleClass("sp-clear-enabled",allowEmpty);container.toggleClass("sp-buttons-disabled",!opts.showButtons);container.toggleClass("sp-palette-buttons-disabled",!opts.togglePaletteOnly);container.toggleClass("sp-palette-disabled",!opts.showPalette);container.toggleClass("sp-palette-only",opts.showPaletteOnly);container.toggleClass("sp-initial-disabled",!opts.showInitial);container.addClass(opts.className).addClass(opts.containerClassName);reflow()}function initialize(){if(IE){container.find("*:not(input)").attr("unselectable","on")}applyOptions();if(shouldReplace){boundElement.after(replacer).hide()}if(!allowEmpty){clearButton.hide()}if(flat){boundElement.after(container).hide()}else{var appendTo=opts.appendTo==="parent"?boundElement.parent():$(opts.appendTo);if(appendTo.length!==1){appendTo=$("body")}appendTo.append(container)}updateSelectionPaletteFromStorage();offsetElement.bind("click.spectrum touchstart.spectrum",(function(e){if(!disabled){toggle()}e.stopPropagation();if(!$(e.target).is("input")){e.preventDefault()}}));if(boundElement.is(":disabled")||opts.disabled===true){disable()}container.click(stopPropagation);textInput.change(setFromTextInput);textInput.bind("paste",(function(){setTimeout(setFromTextInput,1)}));textInput.keydown((function(e){if(e.keyCode==13){setFromTextInput()}}));cancelButton.text(opts.cancelText);cancelButton.bind("click.spectrum",(function(e){e.stopPropagation();e.preventDefault();revert();hide()}));clearButton.attr("title",opts.clearText);clearButton.bind("click.spectrum",(function(e){e.stopPropagation();e.preventDefault();isEmpty=true;move();if(flat){updateOriginalInput(true)}}));chooseButton.text(opts.chooseText);chooseButton.bind("click.spectrum",(function(e){e.stopPropagation();e.preventDefault();if(IE&&textInput.is(":focus")){textInput.trigger("change")}if(isValid()){updateOriginalInput(true);hide()}}));toggleButton.text(opts.showPaletteOnly?opts.togglePaletteMoreText:opts.togglePaletteLessText);toggleButton.bind("click.spectrum",(function(e){e.stopPropagation();e.preventDefault();opts.showPaletteOnly=!opts.showPaletteOnly;if(!opts.showPaletteOnly&&!flat){container.css("left","-="+(pickerContainer.outerWidth(true)+5))}applyOptions()}));draggable(alphaSlider,(function(dragX,dragY,e){currentAlpha=dragX/alphaWidth;isEmpty=false;if(e.shiftKey){currentAlpha=Math.round(currentAlpha*10)/10}move()}),dragStart,dragStop);draggable(slider,(function(dragX,dragY){currentHue=parseFloat(dragY/slideHeight);isEmpty=false;if(!opts.showAlpha){currentAlpha=1}move()}),dragStart,dragStop);draggable(dragger,(function(dragX,dragY,e){if(!e.shiftKey){shiftMovementDirection=null}else if(!shiftMovementDirection){var oldDragX=currentSaturation*dragWidth;var oldDragY=dragHeight-currentValue*dragHeight;var furtherFromX=Math.abs(dragX-oldDragX)>Math.abs(dragY-oldDragY);shiftMovementDirection=furtherFromX?"x":"y"}var setSaturation=!shiftMovementDirection||shiftMovementDirection==="x";var setValue=!shiftMovementDirection||shiftMovementDirection==="y";if(setSaturation){currentSaturation=parseFloat(dragX/dragWidth)}if(setValue){currentValue=parseFloat((dragHeight-dragY)/dragHeight)}isEmpty=false;if(!opts.showAlpha){currentAlpha=1}move()}),dragStart,dragStop);if(!!initialColor){set(initialColor);updateUI();currentPreferredFormat=opts.preferredFormat||tinycolor(initialColor).format;addColorToSelectionPalette(initialColor)}else{updateUI()}if(flat){show()}function paletteElementClick(e){if(e.data&&e.data.ignore){set($(e.target).closest(".sp-thumb-el").data("color"));move()}else{set($(e.target).closest(".sp-thumb-el").data("color"));move();updateOriginalInput(true);if(opts.hideAfterPaletteSelect){hide()}}return false}var paletteEvent=IE?"mousedown.spectrum":"click.spectrum touchstart.spectrum";paletteContainer.delegate(".sp-thumb-el",paletteEvent,paletteElementClick);initialColorContainer.delegate(".sp-thumb-el:nth-child(1)",paletteEvent,{ignore:true},paletteElementClick)}function updateSelectionPaletteFromStorage(){if(localStorageKey&&window.localStorage){try{var oldPalette=window.localStorage[localStorageKey].split(",#");if(oldPalette.length>1){delete window.localStorage[localStorageKey];$.each(oldPalette,(function(i,c){addColorToSelectionPalette(c)}))}}catch(e){}try{selectionPalette=window.localStorage[localStorageKey].split(";")}catch(e){}}}function addColorToSelectionPalette(color){if(showSelectionPalette){var rgb=tinycolor(color).toRgbString();if(!paletteLookup[rgb]&&$.inArray(rgb,selectionPalette)===-1){selectionPalette.push(rgb);while(selectionPalette.length>maxSelectionSize){selectionPalette.shift()}}if(localStorageKey&&window.localStorage){try{window.localStorage[localStorageKey]=selectionPalette.join(";")}catch(e){}}}}function getUniqueSelectionPalette(){var unique=[];if(opts.showPalette){for(var i=0;i<selectionPalette.length;i++){var rgb=tinycolor(selectionPalette[i]).toRgbString();if(!paletteLookup[rgb]){unique.push(selectionPalette[i])}}}return unique.reverse().slice(0,opts.maxSelectionSize)}function drawPalette(){var currentColor=get();var html=$.map(paletteArray,(function(palette,i){return paletteTemplate(palette,currentColor,"sp-palette-row sp-palette-row-"+i,opts)}));updateSelectionPaletteFromStorage();if(selectionPalette){html.push(paletteTemplate(getUniqueSelectionPalette(),currentColor,"sp-palette-row sp-palette-row-selection",opts))}paletteContainer.html(html.join(""))}function drawInitial(){if(opts.showInitial){var initial=colorOnShow;var current=get();initialColorContainer.html(paletteTemplate([initial,current],current,"sp-palette-row-initial",opts))}}function dragStart(){if(dragHeight<=0||dragWidth<=0||slideHeight<=0){reflow()}isDragging=true;container.addClass(draggingClass);shiftMovementDirection=null;boundElement.trigger("dragstart.spectrum",[get()])}function dragStop(){isDragging=false;container.removeClass(draggingClass);boundElement.trigger("dragstop.spectrum",[get()])}function setFromTextInput(){var value=textInput.val();if((value===null||value==="")&&allowEmpty){set(null);updateOriginalInput(true)}else{var tiny=tinycolor(value);if(tiny.isValid()){set(tiny);updateOriginalInput(true)}else{textInput.addClass("sp-validation-error")}}}function toggle(){if(visible){hide()}else{show()}}function show(){var event=$.Event("beforeShow.spectrum");if(visible){reflow();return}boundElement.trigger(event,[get()]);if(callbacks.beforeShow(get())===false||event.isDefaultPrevented()){return}hideAll();visible=true;$(doc).bind("keydown.spectrum",onkeydown);$(doc).bind("click.spectrum",clickout);$(window).bind("resize.spectrum",resize);replacer.addClass("sp-active");container.removeClass("sp-hidden");reflow();updateUI();colorOnShow=get();drawInitial();callbacks.show(colorOnShow);boundElement.trigger("show.spectrum",[colorOnShow])}function onkeydown(e){if(e.keyCode===27){hide()}}function clickout(e){if(e.button==2){return}if(isDragging){return}if(clickoutFiresChange){updateOriginalInput(true)}else{revert()}hide()}function hide(){if(!visible||flat){return}visible=false;$(doc).unbind("keydown.spectrum",onkeydown);$(doc).unbind("click.spectrum",clickout);$(window).unbind("resize.spectrum",resize);replacer.removeClass("sp-active");container.addClass("sp-hidden");callbacks.hide(get());boundElement.trigger("hide.spectrum",[get()])}function revert(){set(colorOnShow,true)}function set(color,ignoreFormatChange){if(tinycolor.equals(color,get())){updateUI();return}var newColor,newHsv;if(!color&&allowEmpty){isEmpty=true}else{isEmpty=false;newColor=tinycolor(color);newHsv=newColor.toHsv();currentHue=newHsv.h%360/360;currentSaturation=newHsv.s;currentValue=newHsv.v;currentAlpha=newHsv.a}updateUI();if(newColor&&newColor.isValid()&&!ignoreFormatChange){currentPreferredFormat=opts.preferredFormat||newColor.getFormat()}}function get(opts){opts=opts||{};if(allowEmpty&&isEmpty){return null}return tinycolor.fromRatio({h:currentHue,s:currentSaturation,v:currentValue,a:Math.round(currentAlpha*100)/100},{format:opts.format||currentPreferredFormat})}function isValid(){return!textInput.hasClass("sp-validation-error")}function move(){updateUI();callbacks.move(get());boundElement.trigger("move.spectrum",[get()])}function updateUI(){textInput.removeClass("sp-validation-error");updateHelperLocations();var flatColor=tinycolor.fromRatio({h:currentHue,s:1,v:1});dragger.css("background-color",flatColor.toHexString());var format=currentPreferredFormat;if(currentAlpha<1&&!(currentAlpha===0&&format==="name")){if(format==="hex"||format==="hex3"||format==="hex6"||format==="name"){format="rgb"}}var realColor=get({format:format}),displayColor="";previewElement.removeClass("sp-clear-display");previewElement.css("background-color","transparent");if(!realColor&&allowEmpty){previewElement.addClass("sp-clear-display")}else{var realHex=realColor.toHexString(),realRgb=realColor.toRgbString();if(rgbaSupport||realColor.alpha===1){previewElement.css("background-color",realRgb)}else{previewElement.css("background-color","transparent");previewElement.css("filter",realColor.toFilter())}if(opts.showAlpha){var rgb=realColor.toRgb();rgb.a=0;var realAlpha=tinycolor(rgb).toRgbString();var gradient="linear-gradient(left, "+realAlpha+", "+realHex+")";if(IE){alphaSliderInner.css("filter",tinycolor(realAlpha).toFilter({gradientType:1},realHex))}else{alphaSliderInner.css("background","-webkit-"+gradient);alphaSliderInner.css("background","-moz-"+gradient);alphaSliderInner.css("background","-ms-"+gradient);alphaSliderInner.css("background","linear-gradient(to right, "+realAlpha+", "+realHex+")")}}displayColor=realColor.toString(format)}if(opts.showInput){textInput.val(displayColor)}if(opts.showPalette){drawPalette()}drawInitial()}function updateHelperLocations(){var s=currentSaturation;var v=currentValue;if(allowEmpty&&isEmpty){alphaSlideHelper.hide();slideHelper.hide();dragHelper.hide()}else{alphaSlideHelper.show();slideHelper.show();dragHelper.show();var dragX=s*dragWidth;var dragY=dragHeight-v*dragHeight;dragX=Math.max(-dragHelperHeight,Math.min(dragWidth-dragHelperHeight,dragX-dragHelperHeight));dragY=Math.max(-dragHelperHeight,Math.min(dragHeight-dragHelperHeight,dragY-dragHelperHeight));dragHelper.css({top:dragY+"px",left:dragX+"px"});var alphaX=currentAlpha*alphaWidth;alphaSlideHelper.css({left:alphaX-alphaSlideHelperWidth/2+"px"});var slideY=currentHue*slideHeight;slideHelper.css({top:slideY-slideHelperHeight+"px"})}}function updateOriginalInput(fireCallback){var color=get(),displayColor="",hasChanged=!tinycolor.equals(color,colorOnShow);if(color){displayColor=color.toString(currentPreferredFormat);addColorToSelectionPalette(color)}if(isInput){boundElement.val(displayColor)}if(fireCallback&&hasChanged){callbacks.change(color);boundElement.trigger("change",[color])}}function reflow(){if(!visible){return}dragWidth=dragger.width();dragHeight=dragger.height();dragHelperHeight=dragHelper.height();slideWidth=slider.width();slideHeight=slider.height();slideHelperHeight=slideHelper.height();alphaWidth=alphaSlider.width();alphaSlideHelperWidth=alphaSlideHelper.width();if(!flat){container.css("position","absolute");if(opts.offset){container.offset(opts.offset)}else{container.offset(getOffset(container,offsetElement))}}updateHelperLocations();if(opts.showPalette){drawPalette()}boundElement.trigger("reflow.spectrum")}function destroy(){boundElement.show();offsetElement.unbind("click.spectrum touchstart.spectrum");container.remove();replacer.remove();spectrums[spect.id]=null}function option(optionName,optionValue){if(optionName===undefined){return $.extend({},opts)}if(optionValue===undefined){return opts[optionName]}opts[optionName]=optionValue;if(optionName==="preferredFormat"){currentPreferredFormat=opts.preferredFormat}applyOptions()}function enable(){disabled=false;boundElement.attr("disabled",false);offsetElement.removeClass("sp-disabled")}function disable(){hide();disabled=true;boundElement.attr("disabled",true);offsetElement.addClass("sp-disabled")}function setOffset(coord){opts.offset=coord;reflow()}initialize();var spect={show:show,hide:hide,toggle:toggle,reflow:reflow,option:option,enable:enable,disable:disable,offset:setOffset,set:function(c){set(c);updateOriginalInput()},get:get,destroy:destroy,container:container};spect.id=spectrums.push(spect)-1;return spect}function getOffset(picker,input){var extraY=0;var dpWidth=picker.outerWidth();var dpHeight=picker.outerHeight();var inputHeight=input.outerHeight();var doc=picker[0].ownerDocument;var docElem=doc.documentElement;var viewWidth=docElem.clientWidth+$(doc).scrollLeft();var viewHeight=docElem.clientHeight+$(doc).scrollTop();var offset=input.offset();offset.top+=inputHeight;offset.left-=Math.min(offset.left,offset.left+dpWidth>viewWidth&&viewWidth>dpWidth?Math.abs(offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,offset.top+dpHeight>viewHeight&&viewHeight>dpHeight?Math.abs(dpHeight+inputHeight-extraY):extraY);return offset}function noop(){}function stopPropagation(e){e.stopPropagation()}function bind(func,obj){var slice=Array.prototype.slice;var args=slice.call(arguments,2);return function(){return func.apply(obj,args.concat(slice.call(arguments)))}}function draggable(element,onmove,onstart,onstop){onmove=onmove||function(){};onstart=onstart||function(){};onstop=onstop||function(){};var doc=document;var dragging=false;var offset={};var maxHeight=0;var maxWidth=0;var hasTouch="ontouchstart"in window;var duringDragEvents={};duringDragEvents["selectstart"]=prevent;duringDragEvents["dragstart"]=prevent;duringDragEvents["touchmove mousemove"]=move;duringDragEvents["touchend mouseup"]=stop;function prevent(e){if(e.stopPropagation){e.stopPropagation()}if(e.preventDefault){e.preventDefault()}e.returnValue=false}function move(e){if(dragging){if(IE&&doc.documentMode<9&&!e.button){return stop()}var t0=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0];var pageX=t0&&t0.pageX||e.pageX;var pageY=t0&&t0.pageY||e.pageY;var dragX=Math.max(0,Math.min(pageX-offset.left,maxWidth));var dragY=Math.max(0,Math.min(pageY-offset.top,maxHeight));if(hasTouch){prevent(e)}onmove.apply(element,[dragX,dragY,e])}}function start(e){var rightclick=e.which?e.which==3:e.button==2;if(!rightclick&&!dragging){if(onstart.apply(element,arguments)!==false){dragging=true;maxHeight=$(element).height();maxWidth=$(element).width();offset=$(element).offset();$(doc).bind(duringDragEvents);$(doc.body).addClass("sp-dragging");move(e);prevent(e)}}}function stop(){if(dragging){$(doc).unbind(duringDragEvents);$(doc.body).removeClass("sp-dragging");setTimeout((function(){onstop.apply(element,arguments)}),0)}dragging=false}$(element).bind("touchstart mousedown",start)}function throttle(func,wait,debounce){var timeout;return function(){var context=this,args=arguments;var throttler=function(){timeout=null;func.apply(context,args)};if(debounce)clearTimeout(timeout);if(debounce||!timeout)timeout=setTimeout(throttler,wait)}}function inputTypeColorSupport(){return $.fn.spectrum.inputTypeColorSupport()}var dataID="spectrum.id";$.fn.spectrum=function(opts,extra){if(typeof opts=="string"){var returnValue=this;var args=Array.prototype.slice.call(arguments,1);this.each((function(){var spect=spectrums[$(this).data(dataID)];if(spect){var method=spect[opts];if(!method){throw new Error("Spectrum: no such method: '"+opts+"'")}if(opts=="get"){returnValue=spect.get()}else if(opts=="container"){returnValue=spect.container}else if(opts=="option"){returnValue=spect.option.apply(spect,args)}else if(opts=="destroy"){spect.destroy();$(this).removeData(dataID)}else{method.apply(spect,args)}}}));return returnValue}return this.spectrum("destroy").each((function(){var options=$.extend({},opts,$(this).data());var spect=spectrum(this,options);$(this).data(dataID,spect.id)}))};$.fn.spectrum.load=true;$.fn.spectrum.loadOpts={};$.fn.spectrum.draggable=draggable;$.fn.spectrum.defaults=defaultOpts;$.fn.spectrum.inputTypeColorSupport=function inputTypeColorSupport(){if(typeof inputTypeColorSupport._cachedResult==="undefined"){var colorInput=$("<input type='color'/>")[0];inputTypeColorSupport._cachedResult=colorInput.type==="color"&&colorInput.value!==""}return inputTypeColorSupport._cachedResult};$.spectrum={};$.spectrum.localization={};$.spectrum.palettes={};$.fn.spectrum.processNativeColorInputs=function(){var colorInputs=$("input[type=color]");if(colorInputs.length&&!inputTypeColorSupport()){colorInputs.spectrum({preferredFormat:"hex6"})}};(function(){var trimLeft=/^[\s,#]+/,trimRight=/\s+$/,tinyCounter=0,math=Math,mathRound=math.round,mathMin=math.min,mathMax=math.max,mathRandom=math.random;var tinycolor=function(color,opts){color=color?color:"";opts=opts||{};if(color instanceof tinycolor){return color}if(!(this instanceof tinycolor)){return new tinycolor(color,opts)}var rgb=inputToRGB(color);this._originalInput=color,this._r=rgb.r,this._g=rgb.g,this._b=rgb.b,this._a=rgb.a,this._roundA=mathRound(100*this._a)/100,this._format=opts.format||rgb.format;this._gradientType=opts.gradientType;if(this._r<1){this._r=mathRound(this._r)}if(this._g<1){this._g=mathRound(this._g)}if(this._b<1){this._b=mathRound(this._b)}this._ok=rgb.ok;this._tc_id=tinyCounter++};tinycolor.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var rgb=this.toRgb();return(rgb.r*299+rgb.g*587+rgb.b*114)/1e3},setAlpha:function(value){this._a=boundAlpha(value);this._roundA=mathRound(100*this._a)/100;return this},toHsv:function(){var hsv=rgbToHsv(this._r,this._g,this._b);return{h:hsv.h*360,s:hsv.s,v:hsv.v,a:this._a}},toHsvString:function(){var hsv=rgbToHsv(this._r,this._g,this._b);var h=mathRound(hsv.h*360),s=mathRound(hsv.s*100),v=mathRound(hsv.v*100);return this._a==1?"hsv("+h+", "+s+"%, "+v+"%)":"hsva("+h+", "+s+"%, "+v+"%, "+this._roundA+")"},toHsl:function(){var hsl=rgbToHsl(this._r,this._g,this._b);return{h:hsl.h*360,s:hsl.s,l:hsl.l,a:this._a}},toHslString:function(){var hsl=rgbToHsl(this._r,this._g,this._b);var h=mathRound(hsl.h*360),s=mathRound(hsl.s*100),l=mathRound(hsl.l*100);return this._a==1?"hsl("+h+", "+s+"%, "+l+"%)":"hsla("+h+", "+s+"%, "+l+"%, "+this._roundA+")"},toHex:function(allow3Char){return rgbToHex(this._r,this._g,this._b,allow3Char)},toHexString:function(allow3Char){return"#"+this.toHex(allow3Char)},toHex8:function(){return rgbaToHex(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:mathRound(this._r),g:mathRound(this._g),b:mathRound(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+")":"rgba("+mathRound(this._r)+", "+mathRound(this._g)+", "+mathRound(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:mathRound(bound01(this._r,255)*100)+"%",g:mathRound(bound01(this._g,255)*100)+"%",b:mathRound(bound01(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%)":"rgba("+mathRound(bound01(this._r,255)*100)+"%, "+mathRound(bound01(this._g,255)*100)+"%, "+mathRound(bound01(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){if(this._a===0){return"transparent"}if(this._a<1){return false}return hexNames[rgbToHex(this._r,this._g,this._b,true)]||false},toFilter:function(secondColor){var hex8String="#"+rgbaToHex(this._r,this._g,this._b,this._a);var secondHex8String=hex8String;var gradientType=this._gradientType?"GradientType = 1, ":"";if(secondColor){var s=tinycolor(secondColor);secondHex8String=s.toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"},toString:function(format){var formatSet=!!format;format=format||this._format;var formattedString=false;var hasAlpha=this._a<1&&this._a>=0;var needsAlphaFormat=!formatSet&&hasAlpha&&(format==="hex"||format==="hex6"||format==="hex3"||format==="name");if(needsAlphaFormat){if(format==="name"&&this._a===0){return this.toName()}return this.toRgbString()}if(format==="rgb"){formattedString=this.toRgbString()}if(format==="prgb"){formattedString=this.toPercentageRgbString()}if(format==="hex"||format==="hex6"){formattedString=this.toHexString()}if(format==="hex3"){formattedString=this.toHexString(true)}if(format==="hex8"){formattedString=this.toHex8String()}if(format==="name"){formattedString=this.toName()}if(format==="hsl"){formattedString=this.toHslString()}if(format==="hsv"){formattedString=this.toHsvString()}return formattedString||this.toHexString()},_applyModification:function(fn,args){var color=fn.apply(null,[this].concat([].slice.call(args)));this._r=color._r;this._g=color._g;this._b=color._b;this.setAlpha(color._a);return this},lighten:function(){return this._applyModification(lighten,arguments)},brighten:function(){return this._applyModification(brighten,arguments)},darken:function(){return this._applyModification(darken,arguments)},desaturate:function(){return this._applyModification(desaturate,arguments)},saturate:function(){return this._applyModification(saturate,arguments)},greyscale:function(){return this._applyModification(greyscale,arguments)},spin:function(){return this._applyModification(spin,arguments)},_applyCombination:function(fn,args){return fn.apply(null,[this].concat([].slice.call(args)))},analogous:function(){return this._applyCombination(analogous,arguments)},complement:function(){return this._applyCombination(complement,arguments)},monochromatic:function(){return this._applyCombination(monochromatic,arguments)},splitcomplement:function(){return this._applyCombination(splitcomplement,arguments)},triad:function(){return this._applyCombination(triad,arguments)},tetrad:function(){return this._applyCombination(tetrad,arguments)}};tinycolor.fromRatio=function(color,opts){if(typeof color=="object"){var newColor={};for(var i in color){if(color.hasOwnProperty(i)){if(i==="a"){newColor[i]=color[i]}else{newColor[i]=convertToPercentage(color[i])}}}color=newColor}return tinycolor(color,opts)};function inputToRGB(color){var rgb={r:0,g:0,b:0};var a=1;var ok=false;var format=false;if(typeof color=="string"){color=stringInputToObject(color)}if(typeof color=="object"){if(color.hasOwnProperty("r")&&color.hasOwnProperty("g")&&color.hasOwnProperty("b")){rgb=rgbToRgb(color.r,color.g,color.b);ok=true;format=String(color.r).substr(-1)==="%"?"prgb":"rgb"}else if(color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("v")){color.s=convertToPercentage(color.s);color.v=convertToPercentage(color.v);rgb=hsvToRgb(color.h,color.s,color.v);ok=true;format="hsv"}else if(color.hasOwnProperty("h")&&color.hasOwnProperty("s")&&color.hasOwnProperty("l")){color.s=convertToPercentage(color.s);color.l=convertToPercentage(color.l);rgb=hslToRgb(color.h,color.s,color.l);ok=true;format="hsl"}if(color.hasOwnProperty("a")){a=color.a}}a=boundAlpha(a);return{ok:ok,format:color.format||format,r:mathMin(255,mathMax(rgb.r,0)),g:mathMin(255,mathMax(rgb.g,0)),b:mathMin(255,mathMax(rgb.b,0)),a:a}}function rgbToRgb(r,g,b){return{r:bound01(r,255)*255,g:bound01(g,255)*255,b:bound01(b,255)*255}}function rgbToHsl(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,l=(max+min)/2;if(max==min){h=s=0}else{var d=max-min;s=l>.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h,s:s,l:l}}function hslToRgb(h,s,l){var r,g,b;h=bound01(h,360);s=bound01(s,100);l=bound01(l,100);function hue2rgb(p,q,t){if(t<0)t+=1;if(t>1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p}if(s===0){r=g=b=l}else{var q=l<.5?l*(1+s):l+s-l*s;var p=2*l-q;r=hue2rgb(p,q,h+1/3);g=hue2rgb(p,q,h);b=hue2rgb(p,q,h-1/3)}return{r:r*255,g:g*255,b:b*255}}function rgbToHsv(r,g,b){r=bound01(r,255);g=bound01(g,255);b=bound01(b,255);var max=mathMax(r,g,b),min=mathMin(r,g,b);var h,s,v=max;var d=max-min;s=max===0?0:d/max;if(max==min){h=0}else{switch(max){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break}h/=6}return{h:h,s:s,v:v}}function hsvToRgb(h,s,v){h=bound01(h,360)*6;s=bound01(s,100);v=bound01(v,100);var i=math.floor(h),f=h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s),mod=i%6,r=[v,q,p,p,t,v][mod],g=[t,v,v,q,p,p][mod],b=[p,p,t,v,v,q][mod];return{r:r*255,g:g*255,b:b*255}}function rgbToHex(r,g,b,allow3Char){var hex=[pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];if(allow3Char&&hex[0].charAt(0)==hex[0].charAt(1)&&hex[1].charAt(0)==hex[1].charAt(1)&&hex[2].charAt(0)==hex[2].charAt(1)){return hex[0].charAt(0)+hex[1].charAt(0)+hex[2].charAt(0)}return hex.join("")}function rgbaToHex(r,g,b,a){var hex=[pad2(convertDecimalToHex(a)),pad2(mathRound(r).toString(16)),pad2(mathRound(g).toString(16)),pad2(mathRound(b).toString(16))];return hex.join("")}tinycolor.equals=function(color1,color2){if(!color1||!color2){return false}return tinycolor(color1).toRgbString()==tinycolor(color2).toRgbString()};tinycolor.random=function(){return tinycolor.fromRatio({r:mathRandom(),g:mathRandom(),b:mathRandom()})};function desaturate(color,amount){amount=amount===0?0:amount||10;var hsl=tinycolor(color).toHsl();hsl.s-=amount/100;hsl.s=clamp01(hsl.s);return tinycolor(hsl)}function saturate(color,amount){amount=amount===0?0:amount||10;var hsl=tinycolor(color).toHsl();hsl.s+=amount/100;hsl.s=clamp01(hsl.s);return tinycolor(hsl)}function greyscale(color){return tinycolor(color).desaturate(100)}function lighten(color,amount){amount=amount===0?0:amount||10;var hsl=tinycolor(color).toHsl();hsl.l+=amount/100;hsl.l=clamp01(hsl.l);return tinycolor(hsl)}function brighten(color,amount){amount=amount===0?0:amount||10;var rgb=tinycolor(color).toRgb();rgb.r=mathMax(0,mathMin(255,rgb.r-mathRound(255*-(amount/100))));rgb.g=mathMax(0,mathMin(255,rgb.g-mathRound(255*-(amount/100))));rgb.b=mathMax(0,mathMin(255,rgb.b-mathRound(255*-(amount/100))));return tinycolor(rgb)}function darken(color,amount){amount=amount===0?0:amount||10;var hsl=tinycolor(color).toHsl();hsl.l-=amount/100;hsl.l=clamp01(hsl.l);return tinycolor(hsl)}function spin(color,amount){var hsl=tinycolor(color).toHsl();var hue=(mathRound(hsl.h)+amount)%360;hsl.h=hue<0?360+hue:hue;return tinycolor(hsl)}function complement(color){var hsl=tinycolor(color).toHsl();hsl.h=(hsl.h+180)%360;return tinycolor(hsl)}function triad(color){var hsl=tinycolor(color).toHsl();var h=hsl.h;return[tinycolor(color),tinycolor({h:(h+120)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+240)%360,s:hsl.s,l:hsl.l})]}function tetrad(color){var hsl=tinycolor(color).toHsl();var h=hsl.h;return[tinycolor(color),tinycolor({h:(h+90)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+180)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+270)%360,s:hsl.s,l:hsl.l})]}function splitcomplement(color){var hsl=tinycolor(color).toHsl();var h=hsl.h;return[tinycolor(color),tinycolor({h:(h+72)%360,s:hsl.s,l:hsl.l}),tinycolor({h:(h+216)%360,s:hsl.s,l:hsl.l})]}function analogous(color,results,slices){results=results||6;slices=slices||30;var hsl=tinycolor(color).toHsl();var part=360/slices;var ret=[tinycolor(color)];for(hsl.h=(hsl.h-(part*results>>1)+720)%360;--results;){hsl.h=(hsl.h+part)%360;ret.push(tinycolor(hsl))}return ret}function monochromatic(color,results){results=results||6;var hsv=tinycolor(color).toHsv();var h=hsv.h,s=hsv.s,v=hsv.v;var ret=[];var modification=1/results;while(results--){ret.push(tinycolor({h:h,s:s,v:v}));v=(v+modification)%1}return ret}tinycolor.mix=function(color1,color2,amount){amount=amount===0?0:amount||50;var rgb1=tinycolor(color1).toRgb();var rgb2=tinycolor(color2).toRgb();var p=amount/100;var w=p*2-1;var a=rgb2.a-rgb1.a;var w1;if(w*a==-1){w1=w}else{w1=(w+a)/(1+w*a)}w1=(w1+1)/2;var w2=1-w1;var rgba={r:rgb2.r*w1+rgb1.r*w2,g:rgb2.g*w1+rgb1.g*w2,b:rgb2.b*w1+rgb1.b*w2,a:rgb2.a*p+rgb1.a*(1-p)};return tinycolor(rgba)};tinycolor.readability=function(color1,color2){var c1=tinycolor(color1);var c2=tinycolor(color2);var rgb1=c1.toRgb();var rgb2=c2.toRgb();var brightnessA=c1.getBrightness();var brightnessB=c2.getBrightness();var colorDiff=Math.max(rgb1.r,rgb2.r)-Math.min(rgb1.r,rgb2.r)+Math.max(rgb1.g,rgb2.g)-Math.min(rgb1.g,rgb2.g)+Math.max(rgb1.b,rgb2.b)-Math.min(rgb1.b,rgb2.b);return{brightness:Math.abs(brightnessA-brightnessB),color:colorDiff}};tinycolor.isReadable=function(color1,color2){var readability=tinycolor.readability(color1,color2);return readability.brightness>125&&readability.color>500};tinycolor.mostReadable=function(baseColor,colorList){var bestColor=null;var bestScore=0;var bestIsReadable=false;for(var i=0;i<colorList.length;i++){var readability=tinycolor.readability(baseColor,colorList[i]);var readable=readability.brightness>125&&readability.color>500;var score=3*(readability.brightness/125)+readability.color/500;if(readable&&!bestIsReadable||readable&&bestIsReadable&&score>bestScore||!readable&&!bestIsReadable&&score>bestScore){bestIsReadable=readable;bestScore=score;bestColor=tinycolor(colorList[i])}}return bestColor};var names=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var hexNames=tinycolor.hexNames=flip(names);function flip(o){var flipped={};for(var i in o){if(o.hasOwnProperty(i)){flipped[o[i]]=i}}return flipped}function boundAlpha(a){a=parseFloat(a);if(isNaN(a)||a<0||a>1){a=1}return a}function bound01(n,max){if(isOnePointZero(n)){n="100%"}var processPercent=isPercentage(n);n=mathMin(max,mathMax(0,parseFloat(n)));if(processPercent){n=parseInt(n*max,10)/100}if(math.abs(n-max)<1e-6){return 1}return n%max/parseFloat(max)}function clamp01(val){return mathMin(1,mathMax(0,val))}function parseIntFromHex(val){return parseInt(val,16)}function isOnePointZero(n){return typeof n=="string"&&n.indexOf(".")!=-1&&parseFloat(n)===1}function isPercentage(n){return typeof n==="string"&&n.indexOf("%")!=-1}function pad2(c){return c.length==1?"0"+c:""+c}function convertToPercentage(n){if(n<=1){n=n*100+"%"}return n}function convertDecimalToHex(d){return Math.round(parseFloat(d)*255).toString(16)}function convertHexToDecimal(h){return parseIntFromHex(h)/255}var matchers=function(){var CSS_INTEGER="[-\\+]?\\d+%?";var CSS_NUMBER="[-\\+]?\\d*\\.\\d+%?";var CSS_UNIT="(?:"+CSS_NUMBER+")|(?:"+CSS_INTEGER+")";var PERMISSIVE_MATCH3="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";var PERMISSIVE_MATCH4="[\\s|\\(]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")[,|\\s]+("+CSS_UNIT+")\\s*\\)?";return{rgb:new RegExp("rgb"+PERMISSIVE_MATCH3),rgba:new RegExp("rgba"+PERMISSIVE_MATCH4),hsl:new RegExp("hsl"+PERMISSIVE_MATCH3),hsla:new RegExp("hsla"+PERMISSIVE_MATCH4),hsv:new RegExp("hsv"+PERMISSIVE_MATCH3),hsva:new RegExp("hsva"+PERMISSIVE_MATCH4),hex3:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex8:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function stringInputToObject(color){color=color.replace(trimLeft,"").replace(trimRight,"").toLowerCase();var named=false;if(names[color]){color=names[color];named=true}else if(color=="transparent"){return{r:0,g:0,b:0,a:0,format:"name"}}var match;if(match=matchers.rgb.exec(color)){return{r:match[1],g:match[2],b:match[3]}}if(match=matchers.rgba.exec(color)){return{r:match[1],g:match[2],b:match[3],a:match[4]}}if(match=matchers.hsl.exec(color)){return{h:match[1],s:match[2],l:match[3]}}if(match=matchers.hsla.exec(color)){return{h:match[1],s:match[2],l:match[3],a:match[4]}}if(match=matchers.hsv.exec(color)){return{h:match[1],s:match[2],v:match[3]}}if(match=matchers.hsva.exec(color)){return{h:match[1],s:match[2],v:match[3],a:match[4]}}if(match=matchers.hex8.exec(color)){return{a:convertHexToDecimal(match[1]),r:parseIntFromHex(match[2]),g:parseIntFromHex(match[3]),b:parseIntFromHex(match[4]),format:named?"name":"hex8"}}if(match=matchers.hex6.exec(color)){return{r:parseIntFromHex(match[1]),g:parseIntFromHex(match[2]),b:parseIntFromHex(match[3]),format:named?"name":"hex"}}if(match=matchers.hex3.exec(color)){return{r:parseIntFromHex(match[1]+""+match[1]),g:parseIntFromHex(match[2]+""+match[2]),b:parseIntFromHex(match[3]+""+match[3]),format:named?"name":"hex"}}return false}window.tinycolor=tinycolor})();$((function(){if($.fn.spectrum.load){$.fn.spectrum.processNativeColorInputs()}}))}));/*! Split.js - v1.3.5 */
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):global.Split=factory()})(this,(function(){"use strict";var global=window;var document=global.document;var addEventListener="addEventListener";var removeEventListener="removeEventListener";var getBoundingClientRect="getBoundingClientRect";var NOOP=function(){return false};var isIE8=global.attachEvent&&!global[addEventListener];var calc=["","-webkit-","-moz-","-o-"].filter((function(prefix){var el=document.createElement("div");el.style.cssText="width:"+prefix+"calc(9px)";return!!el.style.length})).shift()+"calc";var elementOrSelector=function(el){if(typeof el==="string"||el instanceof String){return document.querySelector(el)}return el};var Split=function(ids,options){if(options===void 0)options={};var dimension;var clientDimension;var clientAxis;var position;var paddingA;var paddingB;var elements;var parent=elementOrSelector(ids[0]).parentNode;var parentFlexDirection=global.getComputedStyle(parent).flexDirection;var sizes=options.sizes||ids.map((function(){return 100/ids.length}));var minSize=options.minSize!==undefined?options.minSize:100;var minSizes=Array.isArray(minSize)?minSize:ids.map((function(){return minSize}));var gutterSize=options.gutterSize!==undefined?options.gutterSize:10;var snapOffset=options.snapOffset!==undefined?options.snapOffset:30;var direction=options.direction||"horizontal";var cursor=options.cursor||(direction==="horizontal"?"ew-resize":"ns-resize");var gutter=options.gutter||function(i,gutterDirection){var gut=document.createElement("div");gut.className="gutter gutter-"+gutterDirection;return gut};var elementStyle=options.elementStyle||function(dim,size,gutSize){var style={};if(typeof size!=="string"&&!(size instanceof String)){if(!isIE8){style[dim]=calc+"("+size+"% - "+gutSize+"px)"}else{style[dim]=size+"%"}}else{style[dim]=size}return style};var gutterStyle=options.gutterStyle||function(dim,gutSize){return obj={},obj[dim]=gutSize+"px",obj;var obj};if(direction==="horizontal"){dimension="width";clientDimension="clientWidth";clientAxis="clientX";position="left";paddingA="paddingLeft";paddingB="paddingRight"}else if(direction==="vertical"){dimension="height";clientDimension="clientHeight";clientAxis="clientY";position="top";paddingA="paddingTop";paddingB="paddingBottom"}function setElementSize(el,size,gutSize){var style=elementStyle(dimension,size,gutSize);Object.keys(style).forEach((function(prop){return el.style[prop]=style[prop]}))}function setGutterSize(gutterElement,gutSize){var style=gutterStyle(dimension,gutSize);Object.keys(style).forEach((function(prop){return gutterElement.style[prop]=style[prop]}))}function adjust(offset){var a=elements[this.a];var b=elements[this.b];var percentage=a.size+b.size;a.size=offset/this.size*percentage;b.size=percentage-offset/this.size*percentage;setElementSize(a.element,a.size,this.aGutterSize);setElementSize(b.element,b.size,this.bGutterSize)}function drag(e){var offset;if(!this.dragging){return}if("touches"in e){offset=e.touches[0][clientAxis]-this.start}else{offset=e[clientAxis]-this.start}if(offset<=elements[this.a].minSize+snapOffset+this.aGutterSize){offset=elements[this.a].minSize+this.aGutterSize}else if(offset>=this.size-(elements[this.b].minSize+snapOffset+this.bGutterSize)){offset=this.size-(elements[this.b].minSize+this.bGutterSize)}adjust.call(this,offset);if(options.onDrag){options.onDrag()}}function calculateSizes(){var a=elements[this.a].element;var b=elements[this.b].element;this.size=a[getBoundingClientRect]()[dimension]+b[getBoundingClientRect]()[dimension]+this.aGutterSize+this.bGutterSize;this.start=a[getBoundingClientRect]()[position]}function stopDragging(){var self=this;var a=elements[self.a].element;var b=elements[self.b].element;if(self.dragging&&options.onDragEnd){options.onDragEnd()}self.dragging=false;global[removeEventListener]("mouseup",self.stop);global[removeEventListener]("touchend",self.stop);global[removeEventListener]("touchcancel",self.stop);self.parent[removeEventListener]("mousemove",self.move);self.parent[removeEventListener]("touchmove",self.move);delete self.stop;delete self.move;a[removeEventListener]("selectstart",NOOP);a[removeEventListener]("dragstart",NOOP);b[removeEventListener]("selectstart",NOOP);b[removeEventListener]("dragstart",NOOP);a.style.userSelect="";a.style.webkitUserSelect="";a.style.MozUserSelect="";a.style.pointerEvents="";b.style.userSelect="";b.style.webkitUserSelect="";b.style.MozUserSelect="";b.style.pointerEvents="";self.gutter.style.cursor="";self.parent.style.cursor=""}function startDragging(e){var self=this;var a=elements[self.a].element;var b=elements[self.b].element;if(!self.dragging&&options.onDragStart){options.onDragStart()}e.preventDefault();self.dragging=true;self.move=drag.bind(self);self.stop=stopDragging.bind(self);global[addEventListener]("mouseup",self.stop);global[addEventListener]("touchend",self.stop);global[addEventListener]("touchcancel",self.stop);self.parent[addEventListener]("mousemove",self.move);self.parent[addEventListener]("touchmove",self.move);a[addEventListener]("selectstart",NOOP);a[addEventListener]("dragstart",NOOP);b[addEventListener]("selectstart",NOOP);b[addEventListener]("dragstart",NOOP);a.style.userSelect="none";a.style.webkitUserSelect="none";a.style.MozUserSelect="none";a.style.pointerEvents="none";b.style.userSelect="none";b.style.webkitUserSelect="none";b.style.MozUserSelect="none";b.style.pointerEvents="none";self.gutter.style.cursor=cursor;self.parent.style.cursor=cursor;calculateSizes.call(self)}var pairs=[];elements=ids.map((function(id,i){var element={element:elementOrSelector(id),size:sizes[i],minSize:minSizes[i]};var pair;if(i>0){pair={a:i-1,b:i,dragging:false,isFirst:i===1,isLast:i===ids.length-1,direction:direction,parent:parent};pair.aGutterSize=gutterSize;pair.bGutterSize=gutterSize;if(pair.isFirst){pair.aGutterSize=gutterSize/2}if(pair.isLast){pair.bGutterSize=gutterSize/2}if(parentFlexDirection==="row-reverse"||parentFlexDirection==="column-reverse"){var temp=pair.a;pair.a=pair.b;pair.b=temp}}if(!isIE8){if(i>0){var gutterElement=gutter(i,direction);setGutterSize(gutterElement,gutterSize);gutterElement[addEventListener]("mousedown",startDragging.bind(pair));gutterElement[addEventListener]("touchstart",startDragging.bind(pair));parent.insertBefore(gutterElement,element.element);pair.gutter=gutterElement}}if(i===0||i===ids.length-1){setElementSize(element.element,element.size,gutterSize/2)}else{setElementSize(element.element,element.size,gutterSize)}var computedSize=element.element[getBoundingClientRect]()[dimension];if(computedSize<element.minSize){element.minSize=computedSize}if(i>0){pairs.push(pair)}return element}));function setSizes(newSizes){newSizes.forEach((function(newSize,i){if(i>0){var pair=pairs[i-1];var a=elements[pair.a];var b=elements[pair.b];a.size=newSizes[i-1];b.size=newSize;setElementSize(a.element,a.size,pair.aGutterSize);setElementSize(b.element,b.size,pair.bGutterSize)}}))}function destroy(){pairs.forEach((function(pair){pair.parent.removeChild(pair.gutter);elements[pair.a].element.style[dimension]="";elements[pair.b].element.style[dimension]=""}))}if(isIE8){return{setSizes:setSizes,destroy:destroy}}return{setSizes:setSizes,getSizes:function getSizes(){return elements.map((function(element){return element.size}))},collapse:function collapse(i){if(i===pairs.length){var pair=pairs[i-1];calculateSizes.call(pair);if(!isIE8){adjust.call(pair,pair.size-pair.bGutterSize)}}else{var pair$1=pairs[i];calculateSizes.call(pair$1);if(!isIE8){adjust.call(pair$1,pair$1.aGutterSize)}}},destroy:destroy}};return Split}));(function(){function Tablesort(el,options){if(!(this instanceof Tablesort))return new Tablesort(el,options);if(!el||el.tagName!=="TABLE"){throw new Error("Element must be a table")}this.init(el,options||{})}var sortOptions=[];var createEvent=function(name){var evt;if(!window.CustomEvent||typeof window.CustomEvent!=="function"){evt=document.createEvent("CustomEvent");evt.initCustomEvent(name,false,false,undefined)}else{evt=new CustomEvent(name)}return evt};var getInnerText=function(el){return el.getAttribute("data-sort")||el.textContent||el.innerText||""};var caseInsensitiveSort=function(a,b){a=a.trim().toLowerCase();b=b.trim().toLowerCase();if(a===b)return 0;if(a<b)return 1;return-1};var stabilize=function(sort,antiStabilize){return function(a,b){var unstableResult=sort(a.td,b.td);if(unstableResult===0){if(antiStabilize)return b.index-a.index;return a.index-b.index}return unstableResult}};Tablesort.extend=function(name,pattern,sort){if(typeof pattern!=="function"||typeof sort!=="function"){throw new Error("Pattern and sort must be a function")}sortOptions.push({name:name,pattern:pattern,sort:sort})};Tablesort.prototype={init:function(el,options){var that=this,firstRow,defaultSort,i,cell;that.table=el;that.thead=false;that.options=options;if(el.rows&&el.rows.length>0){if(el.tHead&&el.tHead.rows.length>0){for(i=0;i<el.tHead.rows.length;i++){if(el.tHead.rows[i].getAttribute("data-sort-method")==="thead"){firstRow=el.tHead.rows[i];break}}if(!firstRow){firstRow=el.tHead.rows[el.tHead.rows.length-1]}that.thead=true}else{firstRow=el.rows[0]}}if(!firstRow)return;var onClick=function(){if(that.current&&that.current!==this){that.current.removeAttribute("aria-sort")}that.current=this;that.sortTable(this)};for(i=0;i<firstRow.cells.length;i++){cell=firstRow.cells[i];cell.setAttribute("role","columnheader");if(cell.getAttribute("data-sort-method")!=="none"){cell.tabindex=0;cell.addEventListener("click",onClick,false);if(cell.getAttribute("data-sort-default")!==null){defaultSort=cell}}}if(defaultSort){that.current=defaultSort;that.sortTable(defaultSort)}},sortTable:function(header,update){var that=this,column=header.cellIndex,sortFunction=caseInsensitiveSort,item="",items=[],i=that.thead?0:1,sortMethod=header.getAttribute("data-sort-method"),sortOrder=header.getAttribute("aria-sort");that.table.dispatchEvent(createEvent("beforeSort"));if(!update){if(sortOrder==="ascending"){sortOrder="descending"}else if(sortOrder==="descending"){sortOrder="ascending"}else{sortOrder=that.options.descending?"descending":"ascending"}header.setAttribute("aria-sort",sortOrder)}if(that.table.rows.length<2)return;if(!sortMethod){while(items.length<3&&i<that.table.tBodies[0].rows.length){item=getInnerText(that.table.tBodies[0].rows[i].cells[column]);item=item.trim();if(item.length>0){items.push(item)}i++}if(!items)return}for(i=0;i<sortOptions.length;i++){item=sortOptions[i];if(sortMethod){if(item.name===sortMethod){sortFunction=item.sort;break}}else if(items.every(item.pattern)){sortFunction=item.sort;break}}that.col=column;for(i=0;i<that.table.tBodies.length;i++){var newRows=[],noSorts={},j,totalRows=0,noSortsSoFar=0;if(that.table.tBodies[i].rows.length<2)continue;for(j=0;j<that.table.tBodies[i].rows.length;j++){item=that.table.tBodies[i].rows[j];if(item.getAttribute("data-sort-method")==="none"){noSorts[totalRows]=item}else{newRows.push({tr:item,td:getInnerText(item.cells[that.col]),index:totalRows})}totalRows++}if(sortOrder==="descending"){newRows.sort(stabilize(sortFunction,true))}else{newRows.sort(stabilize(sortFunction,false));newRows.reverse()}for(j=0;j<totalRows;j++){if(noSorts[j]){item=noSorts[j];noSortsSoFar++}else{item=newRows[j-noSortsSoFar].tr}that.table.tBodies[i].appendChild(item)}}that.table.dispatchEvent(createEvent("afterSort"))},refresh:function(){if(this.current!==undefined){this.sortTable(this.current,true)}}};if(typeof module!=="undefined"&&module.exports){module.exports=Tablesort}else{window.Tablesort=Tablesort}})();
/*!
 * tablesort v5.0.2 (2017-11-12)
 * http://tristen.ca/tablesort/demo/
 * Copyright (c) 2017 ; Licensed MIT
*/
!function(){var a=function(a){return a.replace(/[^\-?0-9.]/g,"")},b=function(a,b){return a=parseFloat(a),b=parseFloat(b),a=isNaN(a)?0:a,b=isNaN(b)?0:b,a-b};Tablesort.extend("number",(function(a){return a.match(/^[-+]?[Â£\x24Ã›Â¢Â´â‚¬]?\d+\s*([,\.]\d{0,2})/)||a.match(/^[-+]?\d+\s*([,\.]\d{0,2})?[Â£\x24Ã›Â¢Â´â‚¬]/)||a.match(/^[-+]?(\d)*-?([,\.]){0,1}-?(\d)+([E,e][\-+][\d]+)?%?$/)}),(function(c,d){return c=a(c),d=a(d),b(d,c)}))}();"use strict";function Queue(){this.length=0}Queue.prototype.push=function(item){var node={item:item};if(this.last){this.last=this.last.next=node}else{this.last=this.first=node}this.length++};Queue.prototype.shift=function(){var node=this.first;if(node){this.first=node.next;if(!--this.length){this.last=undefined}return node.item}};Queue.prototype.slice=function(start,end){start=typeof start==="undefined"?0:start;end=typeof end==="undefined"?Infinity:end;var output=[];var i=0;for(var node=this.first;node;node=node.next){if(--end<0){break}else if(++i>start){output.push(node.item)}}return output};