WP ULike - Version 4.4.6

Version Description

  • Added: Social share buttons generator. (+ auto display functionality) [PRO]
  • Added: New customizer options for social share, profile, login & register forms. [PRO]
  • Added: Compatibility with WPML plugin. [PRO]
  • Updated: myCred functionalities.
  • Fixed: Some major issues.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 4.4.6
Comparing to
See all releases

Code changes from version 4.4.5 to 4.4.6

admin/assets/js/plugins.js CHANGED
@@ -1,181 +1,11 @@
1
- /*! WP ULike - v4.4.5
2
  * https://wpulike.com
3
  * TechnoWich 2021;
4
  */
5
-
6
-
7
- /* ================== admin/assets/js/src/plugins/Chart.min.js =================== */
8
-
9
-
10
  /*!
11
  * Chart.js v2.9.4
12
  * https://www.chartjs.org
13
  * (c) 2020 Chart.js Contributors
14
  * Released under the MIT License
15
  */
16
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],(function(t){return e(function(){try{return t("moment")}catch(t){}}())})):(t=t||self).Chart=e(t.moment)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={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]},n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=n[t];if(i)return i;var a,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=e[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d<s&&(s=d,a=l)}return a},a.keyword.rgb=function(t){return e[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,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-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.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:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));n.rgb,n.hsl,n.hsv,n.hwb,n.cmyk,n.xyz,n.lab,n.lch,n.hex,n.keyword,n.ansi16,n.ansi256,n.hcg,n.apple,n.gray;function i(t){var e=function(){for(var t={},e=Object.keys(n),i=e.length,a=0;a<i;a++)t[e[a]]={distance:-1,parent:null};return t}(),i=[t];for(e[t].distance=0;i.length;)for(var a=i.pop(),r=Object.keys(n[a]),o=r.length,s=0;s<o;s++){var l=r[s],u=e[l];-1===u.distance&&(u.distance=e[a].distance+1,u.parent=a,i.unshift(l))}return e}function a(t,e){return function(n){return e(t(n))}}function r(t,e){for(var i=[e[t].parent,t],r=n[e[t].parent][t],o=e[t].parent;e[o].parent;)i.unshift(e[o].parent),r=a(n[e[o].parent][o],r),o=e[o].parent;return r.conversion=i,r}var o={};Object.keys(n).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:n[t].channels}),Object.defineProperty(o[t],"labels",{value:n[t].labels});var e=function(t){for(var e=i(t),n={},a=Object.keys(e),o=a.length,s=0;s<o;s++){var l=a[s];null!==e[l].parent&&(n[l]=r(l,e))}return n}(t);Object.keys(e).forEach((function(n){var i=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),o[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var s=o,l={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]},u={getRgba:d,getHsla:h,getRgb:function(t){var e=d(t);return e&&e.slice(0,3)},getHsl:function(t){var e=h(t);return e&&e.slice(0,3)},getHwb:c,getAlpha:function(t){var e=d(t);if(e)return e[3];if(e=h(t))return e[3];if(e=c(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+v(t[0])+v(t[1])+v(t[2])+(e>=0&&e<1?v(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return f(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:f,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:g,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,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 b[t.slice(0,3)]}};function d(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;r<e.length;r++)e[r]=parseInt(i[r]+i[r],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(i=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){a=i[2],i=i[1];for(r=0;r<e.length;r++)e[r]=parseInt(i.slice(2*r,2*r+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(i=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(i[r+1]);n=parseFloat(i[4])}else if(i=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(i[r+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=l[i[1]]))return}for(r=0;r<e.length;r++)e[r]=m(e[r],0,255);return n=n||0==n?m(n,0,1):1,e[3]=n,e}}function h(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function c(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function f(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function g(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 p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function m(t,e,n){return Math.min(Math.max(e,t),n)}function v(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var b={};for(var x in l)b[l[x]]=x;var y=function(t){return t instanceof y?t:this instanceof y?(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=u.getRgba(t))?this.setValues("rgb",e):(e=u.getHsla(t))?this.setValues("hsl",e):(e=u.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 y(t);var e};y.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 u.hexString(this.values.rgb)},rgbString:function(){return u.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return u.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return u.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return u.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return u.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return u.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return u.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=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.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,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},y.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,o=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)a[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];l=e.a}else if(void 0!==e[r[t][0]]){var u=r[t];for(n=0;n<t.length;n++)a[t][n]=e[u[n]];l=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(i);for(var d in r)d!==t&&(a[d]=s[t][d](a[t]));return!0},y.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},y.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.Color=y);var _=y;function k(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}var w,M={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return M.valueOrDefault(M.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(M.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(M.isObject(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],r=e[n],a instanceof Array&&r instanceof Array){if(!M.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(M.isArray(t))return t.map(M.clone);if(M.isObject(t)){for(var e=Object.create(t),n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=M.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){if(k(t)){var a=e[t],r=n[t];M.isObject(a)&&M.isObject(r)?M.merge(a,r,i):e[t]=M.clone(r)}},_mergerIf:function(t,e,n){if(k(t)){var i=e[t],a=n[t];M.isObject(i)&&M.isObject(a)?M.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=M.clone(a))}},merge:function(t,e,n){var i,a,r,o,s,l=M.isArray(e)?e:[e],u=l.length;if(!M.isObject(t))return t;for(i=(n=n||{}).merger||M._merger,a=0;a<u;++a)if(e=l[a],M.isObject(e))for(s=0,o=(r=Object.keys(e)).length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return M.merge(t,e,{merger:M._mergerIf})},extend:Object.assign||function(t){return M.merge(t,[].slice.call(arguments,1),{merger:function(t,e,n){e[t]=n[t]}})},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=M.inherits,t&&M.extend(n.prototype,t),n.__super__=e.prototype,n},_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},S=M;M.callCallback=M.callback,M.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},M.getValueOrDefault=M.valueOrDefault,M.getValueAtIndexOrDefault=M.valueAtIndexOrDefault;var C={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,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-C.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*C.easeInBounce(2*t):.5*C.easeOutBounce(2*t-1)+.5}},P={effects:C};S.easingEffects=C;var A=Math.PI,D=A/180,T=2*A,I=A/2,F=A/4,O=2*A/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),s<u&&l<d?(t.arc(s,l,o,-A,-I),t.arc(u,l,o,-I,0),t.arc(u,d,o,0,I),t.arc(s,d,o,I,A)):s<u?(t.moveTo(s,n),t.arc(u,l,o,-I,I),t.arc(s,l,o,I,A+I)):l<d?(t.arc(s,l,o,-A,0),t.arc(s,d,o,0,A)):t.arc(s,l,o,-A,A),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,d,h=(r||0)*D;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,a),t.rotate(h),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(n)||n<=0)){switch(t.beginPath(),e){default:t.arc(i,a,n,0,T),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=O,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=O,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),t.closePath();break;case"rectRounded":u=n-(d=.516*n),s=Math.cos(h+F)*u,l=Math.sin(h+F)*u,t.arc(i-s,a-l,d,h-A,h-I),t.arc(i+l,a-s,d,h-I,h),t.arc(i+s,a+l,d,h,h+I),t.arc(i-l,a+s,d,h+I,h+A),t.closePath();break;case"rect":if(!r){u=Math.SQRT1_2*n,t.rect(i-u,a-u,2*u,2*u);break}h+=F;case"rectRot":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+l,a-s),t.lineTo(i+s,a+l),t.lineTo(i-l,a+s),t.closePath();break;case"crossRot":h+=F;case"cross":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"star":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s),h+=F,s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"line":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(h)*n,a+Math.sin(h)*n)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},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,n,i){var a=n.steppedLine;if(a){if("middle"===a){var r=(e.x+n.x)/2;t.lineTo(r,i?n.y:e.y),t.lineTo(r,i?e.y:n.y)}else"after"===a&&!i||"after"!==a&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}else n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},R=L;S.clear=L.clear,S.drawRoundedRectangle=function(t){t.beginPath(),L.roundedRect.apply(L,arguments)};var z={_set:function(t,e){return S.merge(this[t]||(this[t]={}),e)}};z._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var N=z,B=S.valueOrDefault;var E={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,i,a;return S.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},_parseFont:function(t){var e=N.global,n=B(t.fontSize,e.defaultFontSize),i={family:B(t.fontFamily,e.defaultFontFamily),lineHeight:S.options.toLineHeight(B(t.lineHeight,e.defaultLineHeight),n),size:n,style:B(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return i.string=function(t){return!t||S.isNullOrUndef(t.size)||S.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(i),i},resolve:function(t,e,n,i){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==n&&S.isArray(o)&&(o=o[n],s=!1),void 0!==o))return i&&!s&&(i.cacheable=!1),o}},W={_factorize:function(t){var e,n=[],i=Math.sqrt(t);for(e=1;e<i;e++)t%e==0&&(n.push(e),n.push(t/e));return i===(0|i)&&n.push(i),n.sort((function(t,e){return t-e})).pop(),n},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e}},V=W;S.log10=W.log10;var H=S,j=P,q=R,U=E,Y=V,G={getRtlAdapter:function(t,e,n){return t?function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,n):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},overrideTextDirection:function(t,e){var n,i;"ltr"!==e&&"rtl"!==e||(i=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},restoreTextDirection:function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}};H.easing=j,H.canvas=q,H.options=U,H.math=Y,H.rtl=G;var X=function(t){H.extend(this,t),this.initialize.apply(this,arguments)};H.extend(X.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=H.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(u=n[o=f[a]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(d=typeof u)===typeof(l=t[o]))if("string"===d){if((h=_(l)).valid&&(c=_(u)).valid){e[o]=c.mix(h,i).rgbString();continue}}else if(H.isFinite(l)&&H.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}(i,a,n,t),e):(e._view=H.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return H.isNumber(this._model.x)&&H.isNumber(this._model.y)}}),X.extend=H.inherits;var K=X,Z=K.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),$=Z;Object.defineProperty(Z.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(Z.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),N._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:H.noop,onComplete:H.noop}});var J={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(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=H.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=H.requestAnimFrame.call(window,(function(){t.request=null,t.startDigest()})))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r<a.length;)e=(t=a[r]).chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),H.callback(t.render,[e,t],e),H.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(H.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},Q=H.options.resolve,tt=["push","pop","shift","splice","unshift"];function et(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(tt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var nt=function(t,e){this.initialize(t,e)};H.extend(nt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.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]},_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())},reset:function(){this._update(!0)},destroy:function(){this._data&&et(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,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);n.dataset=n.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,e,n=this,i=n.getDataset(),a=i.data||(i.data=[]);n._data!==a&&(n._data&&et(n._data,n),a&&Object.isExtensible(a)&&(e=n,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),tt.forEach((function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return H.each(t._chartjs.listeners,(function(t){"function"==typeof t[n]&&t[n].apply(t,e)})),a}})})))),n._data=a),n.resyncElements()},_configure:function(){this._config=H.merge(Object.create(null),[this.chart.options.datasets[this._type],this.getDataset()],{merger:function(t,e,n){"_meta"!==t&&"data"!==t&&H._merger(t,e,n)}})},_update:function(t){this._configure(),this._cachedDataOpts=null,this.update(t)},update:H.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},getStyle:function(t){var e,n=this.getMeta(),i=n.dataset;return this._configure(),i&&void 0===t?e=this._resolveDatasetElementOptions(i||{}):(t=t||0,e=this._resolveDataElementOptions(n.data[t]||{},t)),!1!==e.fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var n,i,a,r,o=this,s=o.chart,l=o._config,u=t.custom||{},d=s.options.elements[o.datasetElementType.prototype._type]||{},h=o._datasetElementOptions,c={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(n=0,i=h.length;n<i;++n)a=h[n],r=e?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,c[a]=Q([u[r],l[r],d[r]],f);return c},_resolveDataElementOptions:function(t,e){var n=this,i=t&&t.custom,a=n._cachedDataOpts;if(a&&!i)return a;var r,o,s,l,u=n.chart,d=n._config,h=u.options.elements[n.dataElementType.prototype._type]||{},c=n._dataElementOptions,f={},g={chart:u,dataIndex:e,dataset:n.getDataset(),datasetIndex:n.index},p={cacheable:!i};if(i=i||{},H.isArray(c))for(o=0,s=c.length;o<s;++o)f[l=c[o]]=Q([i[l],d[l],h[l]],g,e,p);else for(o=0,s=(r=Object.keys(c)).length;o<s;++o)f[l=r[o]]=Q([i[l],d[c[l]],d[l],h[l]],g,e,p);return p.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){H.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=H.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=Q([i.hoverBackgroundColor,e.hoverBackgroundColor,r(a.backgroundColor)],void 0,n),a.borderColor=Q([i.hoverBorderColor,e.hoverBorderColor,r(a.borderColor)],void 0,n),a.borderWidth=Q([i.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,n,i,a,r,o=this.getMeta().dataset,s={};if(o){for(r=o._model,a=this._resolveDatasetElementOptions(o,!0),t=0,e=(i=Object.keys(a)).length;t<e;++t)s[n=i[t]]=r[n],r[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,n=t.data.length,i=e.length;i<n?t.data.splice(i,n-i):i>n&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},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)}}),nt.extend=H.inherits;var it=nt,at=2*Math.PI;function rt(t,e){var n=e.startAngle,i=e.endAngle,a=e.pixelMargin,r=a/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,n-r,i+r),e.innerRadius>a?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function ot(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+at,rt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=at,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+at,n.startAngle,!0),a=0;a<n.fullCircles;++a)t.stroke();for(t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.startAngle+at),a=0;a<n.fullCircles;++a)t.stroke()}(t,e,n,i),i&&rt(t,n),t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),t.stroke()}N._set("global",{elements:{arc:{backgroundColor:N.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var st=K.extend({_type:"arc",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 n=this._view;if(n){for(var i=H.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=at;for(;a>s;)a-=at;for(;a<o;)a+=at;var l=a>=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},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,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/at)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+at,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;t<a.fullCircles;++t)e.fill();a.endAngle=a.startAngle+n.circumference%at}e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),e.fill(),n.borderWidth&&ot(e,n,a),e.restore()}}),lt=H.valueOrDefault,ut=N.global.defaultColor;N._set("global",{elements:{line:{tension:.4,backgroundColor:ut,borderWidth:3,borderColor:ut,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var dt=K.extend({_type:"line",draw:function(){var t,e,n,i=this,a=i._view,r=i._chart.ctx,o=a.spanGaps,s=i._children.slice(),l=N.global,u=l.elements.line,d=-1,h=i._loop;if(s.length){if(i._loop){for(t=0;t<s.length;++t)if(e=H.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),h=o;break}h&&s.push(s[0])}for(r.save(),r.lineCap=a.borderCapStyle||u.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||u.borderDash),r.lineDashOffset=lt(a.borderDashOffset,u.borderDashOffset),r.lineJoin=a.borderJoinStyle||u.borderJoinStyle,r.lineWidth=lt(a.borderWidth,u.borderWidth),r.strokeStyle=a.borderColor||l.defaultColor,r.beginPath(),(n=s[0]._view).skip||(r.moveTo(n.x,n.y),d=0),t=1;t<s.length;++t)n=s[t]._view,e=-1===d?H.previousItem(s,t):s[d],n.skip||(d!==t-1&&!o||-1===d?r.moveTo(n.x,n.y):H.canvas.lineTo(r,e._view,n),d=t);h&&r.closePath(),r.stroke(),r.restore()}}}),ht=H.valueOrDefault,ct=N.global.defaultColor;function ft(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:ct,borderColor:ct,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var gt=K.extend({_type:"point",inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ft,inXRange:ft,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,n=this._chart.ctx,i=e.pointStyle,a=e.rotation,r=e.radius,o=e.x,s=e.y,l=N.global,u=l.defaultColor;e.skip||(void 0===t||H.canvas._isPointInArea(e,t))&&(n.strokeStyle=e.borderColor||u,n.lineWidth=ht(e.borderWidth,l.elements.point.borderWidth),n.fillStyle=e.backgroundColor||u,H.canvas.drawPoint(n,i,r,o,s,a))}}),pt=N.global.defaultColor;function mt(t){return t&&void 0!==t.width}function vt(t){var e,n,i,a,r;return mt(t)?(r=t.width/2,e=t.x-r,n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function bt(t,e,n){return t===e?n:t===n?e:t}function xt(t,e,n){var i,a,r,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=bt(e,"left","right")):t.base<t.y&&(e=bt(e,"bottom","top")),n[e]=!0,n):n}(t);return H.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function yt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&vt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}N._set("global",{elements:{rectangle:{backgroundColor:pt,borderColor:pt,borderSkipped:"bottom",borderWidth:0}}});var _t=K.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=vt(t),n=e.right-e.left,i=e.bottom-e.top,a=xt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return yt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return mt(n)?yt(n,t,null):yt(n,null,e)},inXRange:function(t){return yt(this._view,t,null)},inYRange:function(t){return yt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return mt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return mt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),kt={},wt=st,Mt=dt,St=gt,Ct=_t;kt.Arc=wt,kt.Line=Mt,kt.Point=St,kt.Rectangle=Ct;var Pt=H._deprecated,At=H.valueOrDefault;function Dt(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=H.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=t.getTicks().length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return H.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}N._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),N._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Tt=it.extend({dataElementType:kt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;it.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Pt("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Pt("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Pt("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Pt("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Pt("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e<n;++e)this.updateElement(i[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=i.getDataset(),o=i._resolveDataElementOptions(t,e);t._xScale=i.getScaleForId(a.xAxisID),t._yScale=i.getScaleForId(a.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:r.label,label:i.chart.data.labels[e]},H.isArray(r.data[e])&&(t._model.borderSkipped=null),i._updateElementGeometry(t,e,n,o),t.pivot()},_updateElementGeometry:function(t,e,n,i){var a=this,r=t._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),d=a.calculateBarValuePixels(a.index,e,i),h=a.calculateBarIndexPixels(a.index,e,u,i);r.horizontal=l,r.base=n?s:d.base,r.x=l?n?s:d.head:h.center,r.y=l?h.center:n?s:d.head,r.height=l?h.size:void 0,r.width=l?void 0:h.size},_getStacks:function(t){var e,n,i=this._getIndexScale(),a=i._getMatchingVisibleMetas(this._type),r=i.options.stacked,o=a.length,s=[];for(e=0;e<o&&(n=a[e],(!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index!==t);++e);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this._getIndexScale(),i=[];for(t=0,e=this.getMeta().data.length;t<e;++t)i.push(n.getPixelForValue(null,t,this.index));return{pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this.getStackCount(),scale:n}},calculateBarValuePixels:function(t,e,n){var i,a,r,o,s,l,u,d=this.chart,h=this._getValueScale(),c=h.isHorizontal(),f=d.data.datasets,g=h._getMatchingVisibleMetas(this._type),p=h._parseValue(f[t].data[e]),m=n.minBarLength,v=h.options.stacked,b=this.getMeta().stack,x=void 0===p.start?0:p.max>=0&&p.min>=0?p.min:p.max,y=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+y))-o,void 0!==m&&Math.abs(l)<m&&(l=m,s=y>=0&&!c||y<0&&c?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=n.categoryPercentage;return null===o&&(o=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-o),i=r-(r-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/e.stackCount,ratio:n.barPercentage,start:i}}(e,n,i):Dt(e,n,i),r=this.getStackIndex(t,this.getMeta().stack),o=a.start+a.chunk*r+a.chunk/2,s=Math.min(At(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var t=this.chart,e=this._getValueScale(),n=this.getMeta().data,i=this.getDataset(),a=n.length,r=0;for(H.canvas.clipArea(t.ctx,t.chartArea);r<a;++r){var o=e._parseValue(i.data[r]);isNaN(o.min)||isNaN(o.max)||n[r].draw()}H.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var t=this,e=H.extend({},it.prototype._resolveDataElementOptions.apply(t,arguments)),n=t._getIndexScale().options,i=t._getValueScale().options;return e.barPercentage=At(n.barPercentage,e.barPercentage),e.barThickness=At(n.barThickness,e.barThickness),e.categoryPercentage=At(n.categoryPercentage,e.categoryPercentage),e.maxBarThickness=At(n.maxBarThickness,e.maxBarThickness),e.minBarLength=At(i.minBarLength,e.minBarLength),e}}),It=H.valueOrDefault,Ft=H.options.resolve;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 n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}});var Ot=it.extend({dataElementType:kt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,n=e.getMeta().data;H.each(n,(function(n,i){e.updateElement(n,i,t)}))},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveDataElementOptions(t,e),u=i.getDataset().data[e],d=i.index,h=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=n?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,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=It(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=It(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=It(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(t,e){var n=this,i=n.chart,a=n.getDataset(),r=t.custom||{},o=a.data[e]||{},s=it.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:e,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=H.extend({},s)),s.radius=Ft([r.radius,o.r,n._config.radius,i.options.elements.point.radius],l,e),s}}),Lt=H.valueOrDefault,Rt=Math.PI,zt=2*Rt,Nt=Rt/2;N._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-Nt,circumference:zt,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return H.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var Bt=it.extend({dataElementType:kt.Arc,linkScales:H.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e,n,i,a,r=this,o=r.chart,s=o.chartArea,l=o.options,u=1,d=1,h=0,c=0,f=r.getMeta(),g=f.data,p=l.cutoutPercentage/100||0,m=l.circumference,v=r._getRingWeight(r.index);if(m<zt){var b=l.rotation%zt,x=(b+=b>=Rt?-zt:b<-Rt?zt:0)+m,y=Math.cos(b),_=Math.sin(b),k=Math.cos(x),w=Math.sin(x),M=b<=0&&x>=0||x>=zt,S=b<=Nt&&x>=Nt||x>=zt+Nt,C=b<=-Nt&&x>=-Nt||x>=Rt+Nt,P=b===-Rt||x>=Rt?-1:Math.min(y,y*p,k,k*p),A=C?-1:Math.min(_,_*p,w,w*p),D=M?1:Math.max(y,y*p,k,k*p),T=S?1:Math.max(_,_*p,w,w*p);u=(D-P)/2,d=(T-A)/2,h=-(D+P)/2,c=-(T+A)/2}for(i=0,a=g.length;i<a;++i)g[i]._options=r._resolveDataElementOptions(g[i],i);for(o.borderWidth=r.getMaxBorderWidth(),e=(s.right-s.left-o.borderWidth)/u,n=(s.bottom-s.top-o.borderWidth)/d,o.outerRadius=Math.max(Math.min(e,n)/2,0),o.innerRadius=Math.max(o.outerRadius*p,0),o.radiusLength=(o.outerRadius-o.innerRadius)/(r._getVisibleDatasetWeightTotal()||1),o.offsetX=h*o.outerRadius,o.offsetY=c*o.outerRadius,f.total=r.calculateTotal(),r.outerRadius=o.outerRadius-o.radiusLength*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-o.radiusLength*v,0),i=0,a=g.length;i<a;++i)r.updateElement(g[i],i,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,d=o.rotation,h=o.rotation,c=i.getDataset(),f=n&&s.animateRotate?0:t.hidden?0:i.calculateCircumference(c.data[e])*(o.circumference/zt),g=n&&s.animateScale?0:i.innerRadius,p=n&&s.animateScale?0:i.outerRadius,m=t._options||{};H.extend(t,{_datasetIndex:i.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:d,endAngle:h,circumference:f,outerRadius:p,innerRadius:g,label:H.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var v=t._model;n&&s.animateRotate||(v.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return H.each(n.data,(function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))})),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?zt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e<n;++e)if(d.isDatasetVisible(e)){t=(i=d.getDatasetMeta(e)).data,e!==this.index&&(r=i.controller);break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)a=t[e],r?(r._configure(),o=r._resolveDataElementOptions(a,e)):o=a._options,"inner"!==o.borderAlign&&(s=o.borderWidth,u=(l=o.hoverBorderWidth)>(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e},_getRingWeight:function(t){return Math.max(Lt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});N._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),N._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Et=Tt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Wt=H.valueOrDefault,Vt=H.options.resolve,Ht=H.canvas._isPointInArea;function jt(t,e){var n=t&&t.options.ticks||{},i=n.reverse,a=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:a,end:i?a:r}}function qt(t,e,n){var i=n/2,a=jt(t,i),r=jt(e,i);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Ut(t){var e,n,i,a;return H.isObject(t)?(e=t.top,n=t.right,i=t.bottom,a=t.left):e=n=i=a=t,{top:e,right:n,bottom:i,left:a}}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"}]}});var Yt=it.extend({datasetElementType:kt.Line,dataElementType:kt.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.options,l=i._config,u=i._showLine=Wt(l.showLine,s.showLines);for(i._xScale=i.getScaleForId(a.xAxisID),i._yScale=i.getScaleForId(a.yAxisID),u&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=i._yScale,r._datasetIndex=i.index,r._children=o,r._model=i._resolveDatasetElementOptions(r),r.pivot()),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(u&&0!==r._model.tension&&i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,d=l.data[e],h=r._xScale,c=r._yScale,f=o.dataset._model,g=r._resolveDataElementOptions(t,e);i=h.getPixelForValue("object"==typeof d?d:NaN,e,u),a=n?c.getBasePixel():r.calculatePointY(d,e,u),t._xScale=h,t._yScale=c,t._options=g,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:Wt(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,n=e._config,i=t.custom||{},a=e.chart.options,r=a.elements.line,o=it.prototype._resolveDatasetElementOptions.apply(e,arguments);return o.spanGaps=Wt(n.spanGaps,a.spanGaps),o.tension=Wt(n.lineTension,r.tension),o.steppedLine=Vt([i.steppedLine,n.steppedLine,r.stepped]),o.clip=Ut(Wt(n.clip,qt(e._xScale,e._yScale,o.borderWidth))),o},calculatePointY:function(t,e,n){var i,a,r,o,s,l,u,d=this.chart,h=this._yScale,c=0,f=0;if(h.options.stacked){for(s=+h.getRightValue(t),u=(l=d._getSortedVisibleDatasetMetas()).length,i=0;i<u&&(r=l[i]).index!==n;++i)a=d.data.datasets[r.index],"line"===r.type&&r.yAxisID===h.id&&((o=+h.getRightValue(a.data[e]))<0?f+=o||0:c+=o||0);return s<0?h.getPixelForValue(f+s):h.getPixelForValue(c+s)}return h.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this.chart,r=this.getMeta(),o=r.dataset._model,s=a.chartArea,l=r.data||[];function u(t,e,n){return Math.max(Math.min(t,n),e)}if(o.spanGaps&&(l=l.filter((function(t){return!t._model.skip}))),"monotone"===o.cubicInterpolationMode)H.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)n=l[t]._model,i=H.splineCurve(H.previousItem(l,t)._model,n,H.nextItem(l,t)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)n=l[t]._model,Ht(n,s)&&(t>0&&Ht(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&Ht(l[t+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this.chart,n=this.getMeta(),i=n.data||[],a=e.chartArea,r=e.canvas,o=0,s=i.length;for(this._showLine&&(t=n.dataset._model.clip,H.canvas.clipArea(e.ctx,{left:!1===t.left?0:a.left-t.left,right:!1===t.right?r.width:a.right+t.right,top:!1===t.top?0:a.top-t.top,bottom:!1===t.bottom?r.height:a.bottom+t.bottom}),n.dataset.draw(),H.canvas.unclipArea(e.ctx));o<s;++o)i[o].draw(a)},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Wt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Wt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Wt(n.hoverBorderWidth,n.borderWidth),e.radius=Wt(n.hoverRadius,n.radius)}}),Gt=H.options.resolve;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,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).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}}}});var Xt=it.extend({dataElementType:kt.Arc,linkScales:H.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],d=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),e=0,n=r.data.length;e<n;e++)l[e]=s,i=a._computeAngle(e),u[e]=i,s+=i;for(e=0,n=d.length;e<n;++e)d[e]._options=a._resolveDataElementOptions(d[e],e),a.updateElement(d[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,d=l.xCenter,h=l.yCenter,c=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],p=g+(t.hidden?0:i._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};H.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:h,innerRadius:0,outerRadius:n?m:f,startAngle:n&&s.animateRotate?c:g,endAngle:n&&s.animateRotate?c:p,label:H.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return H.each(e.data,(function(e,i){isNaN(t.data[i])||e.hidden||n++})),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor,a=H.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();if(isNaN(i.data[t])||a.data[t].hidden)return 0;var r={chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index};return Gt([e.chart.options.elements.arc.angle,2*Math.PI/n],r,t)}});N._set("pie",H.clone(N.doughnut)),N._set("pie",{cutoutPercentage:0});var Kt=Bt,Zt=H.valueOrDefault;N._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var $t=it.extend({datasetElementType:kt.Line,dataElementType:kt.Point,linkScales:H.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=s,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=o.getPointPositionForValue(e,r.data[e]),l=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,d=n?o.xCenter:s.x,h=n?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=i.index,t._index=e,t._model={x:d,y:h,skip:a.skip||isNaN(d)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Zt(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,n=t.chart.options,i=it.prototype._resolveDatasetElementOptions.apply(t,arguments);return i.spanGaps=Zt(e.spanGaps,n.spanGaps),i.tension=Zt(e.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var t,e,n,i,a=this.getMeta(),r=this.chart.chartArea,o=a.data||[];function s(t,e,n){return Math.max(Math.min(t,n),e)}for(a.dataset._model.spanGaps&&(o=o.filter((function(t){return!t._model.skip}))),t=0,e=o.length;t<e;++t)n=o[t]._model,i=H.splineCurve(H.previousItem(o,t,!0)._model,n,H.nextItem(o,t,!0)._model,n.tension),n.controlPointPreviousX=s(i.previous.x,r.left,r.right),n.controlPointPreviousY=s(i.previous.y,r.top,r.bottom),n.controlPointNextX=s(i.next.x,r.left,r.right),n.controlPointNextY=s(i.next.y,r.top,r.bottom)},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Zt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Zt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Zt(n.hoverBorderWidth,n.borderWidth),e.radius=Zt(n.hoverRadius,n.radius)}});N._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),N._set("global",{datasets:{scatter:{showLine:!1}}});var Jt={bar:Tt,bubble:Ot,doughnut:Bt,horizontalBar:Et,line:Yt,polarArea:Xt,pie:Kt,radar:$t,scatter:Yt};function Qt(t,e){return t.native?{x:t.x,y:t.y}:H.getRelativePosition(t,e)}function te(t,e){var n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas();for(i=0,r=l.length;i<r;++i)for(a=0,o=(n=l[i].data).length;a<o;++a)(s=n[a])._view.skip||e(s)}function ee(t,e){var n=[];return te(t,(function(t){t.inRange(e.x,e.y)&&n.push(t)})),n}function ne(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return te(t,(function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}})),r}function ie(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function ae(t,e,n){var i=Qt(e,t);n.axis=n.axis||"x";var a=ie(n.axis),r=n.intersect?ee(t,i):ne(t,i,!1,a),o=[];return r.length?(t._getSortedVisibleDatasetMetas().forEach((function(t){var e=t.data[r[0]._index];e&&!e._view.skip&&o.push(e)})),o):[]}var re={modes:{single:function(t,e){var n=Qt(e,t),i=[];return te(t,(function(t){if(t.inRange(n.x,n.y))return i.push(t),i})),i.slice(0,1)},label:ae,index:ae,dataset:function(t,e,n){var i=Qt(e,t);n.axis=n.axis||"xy";var a=ie(n.axis),r=n.intersect?ee(t,i):ne(t,i,!1,a);return r.length>0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ae(t,e,{intersect:!1})},point:function(t,e){return ee(t,Qt(e,t))},nearest:function(t,e,n){var i=Qt(e,t);n.axis=n.axis||"xy";var a=ie(n.axis);return ne(t,i,n.intersect,a)},x:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},oe=H.extend;function se(t,e){return H.where(t,(function(t){return t.pos===e}))}function le(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function ue(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function de(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-ue(o,t,"left","right"),a=e.outerHeight-ue(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function he(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function ce(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;i<a;++i)(o=(r=t[i]).box).update(r.width||e.w,r.height||e.h,he(r.horizontal,e)),de(e,n,r)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(r);return s&&ce(u,e,n)||l}function fe(t,e,n){var i,a,r,o,s=n.padding,l=e.x,u=e.y;for(i=0,a=t.length;i<a;++i)o=(r=t[i]).box,r.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?n.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}N._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ge,pe={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,e,n){if(t){var i=t.options.layout||{},a=H.options.toPadding(i.padding),r=e-a.width,o=n-a.height,s=function(t){var e=function(t){var e,n,i,a=[];for(e=0,n=(t||[]).length;e<n;++e)i=t[e],a.push({index:e,box:i,pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return a}(t),n=le(se(e,"left"),!0),i=le(se(e,"right")),a=le(se(e,"top"),!0),r=le(se(e,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:i.concat(r),chartArea:se(e,"chartArea"),vertical:n.concat(i),horizontal:a.concat(r)}}(t.boxes),l=s.vertical,u=s.horizontal,d=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:r,vBoxMaxWidth:r/2/l.length,hBoxMaxHeight:o/2}),h=oe({maxPadding:oe({},a),w:r,h:o,x:a.left,y:a.top},a);!function(t,e){var n,i,a;for(n=0,i=t.length;n<i;++n)(a=t[n]).width=a.horizontal?a.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,a.height=a.horizontal&&e.hBoxMaxHeight}(l.concat(u),d),ce(l,h,d),ce(u,h,d)&&ce(l,h,d),function(t){var e=t.maxPadding;function n(n){var i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(h),fe(s.leftAndTop,h,d),h.x+=h.w,h.y+=h.h,fe(s.rightAndBottom,h,d),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h},H.each(s.chartArea,(function(e){var n=e.box;oe(n,t.chartArea),n.update(h.w,h.h)}))}}},me=(ge=Object.freeze({__proto__:null,default:"@keyframes chartjs-render-animation{from{opacity:.99}to{opacity:1}}.chartjs-render-monitor{animation:chartjs-render-animation 1ms}.chartjs-size-monitor,.chartjs-size-monitor-expand,.chartjs-size-monitor-shrink{position:absolute;direction:ltr;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1}.chartjs-size-monitor-expand>div{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&ge.default||ge,ve="$chartjs",be="chartjs-size-monitor",xe="chartjs-render-monitor",ye="chartjs-render-animation",_e=["animationstart","webkitAnimationStart"],ke={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function we(t,e){var n=H.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var Me=!!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 Se(t,e,n){t.addEventListener(e,n,Me)}function Ce(t,e,n){t.removeEventListener(e,n,Me)}function Pe(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Ae(t){var e=document.createElement("div");return e.className=t||"",e}function De(t,e,n){var i,a,r,o,s=t[ve]||(t[ve]={}),l=s.resizer=function(t){var e=Ae(be),n=Ae(be+"-expand"),i=Ae(be+"-shrink");n.appendChild(Ae()),i.appendChild(Ae()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return Se(n,"scroll",a.bind(n,"expand")),Se(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(Pe("resize",n)),i&&i.clientWidth<a&&n.canvas&&e(Pe("resize",n))}},r=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,r||(r=!0,H.requestAnimFrame.call(window,(function(){r=!1,i.apply(a,o)})))}));!function(t,e){var n=t[ve]||(t[ve]={}),i=n.renderProxy=function(t){t.animationName===ye&&e()};H.each(_e,(function(e){Se(t,e,i)})),n.reflow=!!t.offsetParent,t.classList.add(xe)}(t,(function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}}))}function Te(t){var e=t[ve]||{},n=e.resizer;delete e.resizer,function(t){var e=t[ve]||{},n=e.renderProxy;n&&(H.each(_e,(function(e){Ce(t,e,n)})),delete e.renderProxy),t.classList.remove(xe)}(t),n&&n.parentNode&&n.parentNode.removeChild(n)}var Ie={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;!function(t,e){var n=t[ve]||(t[ve]={});if(!n.containsStyles){n.containsStyles=!0,e="/* Chart.js */\n"+e;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(e.host?e:document.head,me)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(this._ensureLoaded(t),function(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t[ve]={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=we(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=we(t,"height");void 0!==r&&(t.height=o)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e[ve]){var n=e[ve].initial;["height","width"].forEach((function(t){var i=n[t];H.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)})),H.each(n.style||{},(function(t,n){e.style[n]=t})),e.width=e.width,delete e[ve]}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n[ve]||(n[ve]={});Se(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=ke[t.type]||t.type,i=H.getRelativePosition(t,e);return Pe(n,e,i.x,i.y,t)}(e,t))})}else De(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n[ve]||{}).proxies||{})[t.id+"_"+e];a&&Ce(i,e,a)}else Te(i)}};H.addEvent=Se,H.removeEvent=Ce;var Fe=Ie._enabled?Ie:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},Oe=H.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Fe);N._set("global",{plugins:{}});var Le={_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 n=e.indexOf(t);-1!==n&&e.splice(n,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if("function"==typeof(s=(r=(a=l[i]).plugin)[e])&&((o=[t].concat(n||[])).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 n=[],i=[],a=t&&t.config||{},r=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach((function(t){if(-1===n.indexOf(t)){var e=t.id,a=r[e];!1!==a&&(!0===a&&(a=H.clone(N.global.plugins[e])),n.push(t),i.push({plugin:t,options:a||{}}))}})),e.descriptors=i,e.id=this._cacheId,i},_invalidate:function(t){delete t.$plugins}},Re={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=H.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?H.merge(Object.create(null),[N.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=H.extend(this.defaults[t],e))},addScalesToLayout:function(t){H.each(t.scales,(function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,pe.addBox(t,e)}))}},ze=H.valueOrDefault,Ne=H.rtl.getRtlAdapter;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:H.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:H.noop,beforeBody:H.noop,beforeLabel:H.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),H.isNullOrUndef(t.value)?n+=t.yLabel:n+=t.value,n},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:H.noop,afterBody:H.noop,beforeFooter:H.noop,footer:H.noop,afterFooter:H.noop}}});var Be={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:i/r,y:a/r}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=H.distanceBetweenPoints(e,u);d<s&&(s=d,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function Ee(t,e){return e&&(H.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function We(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ve(t){var e=N.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:ze(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:ze(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:ze(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:ze(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:ze(t.titleFontStyle,e.defaultFontStyle),titleFontSize:ze(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:ze(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:ze(t.footerFontStyle,e.defaultFontStyle),footerFontSize:ze(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function He(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function je(t){return Ee([],We(t))}var qe=K.extend({initialize:function(){this._model=Ve(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Ee(o,We(i)),o=Ee(o,We(a)),o=Ee(o,We(r))},getBeforeBody:function(){return je(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return H.each(t,(function(t){var r={before:[],lines:[],after:[]};Ee(r.before,We(i.beforeLabel.call(n,t,e))),Ee(r.lines,i.label.call(n,t,e)),Ee(r.after,We(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return je(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Ee(r,We(n)),r=Ee(r,We(i)),r=Ee(r,We(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Ve(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var _=[],k=[];y=Be[c.position].call(h,p,h._eventPosition);var w=[];for(e=0,n=p.length;e<n;++e)w.push((i=p[e],a=void 0,r=void 0,o=void 0,s=void 0,l=void 0,u=void 0,d=void 0,a=i._xScale,r=i._yScale||i._scale,o=i._index,s=i._datasetIndex,l=i._chart.getDatasetMeta(s).controller,u=l._getIndexScale(),d=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:r?r.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:d?""+d.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:i._model.x,y:i._model.y}));c.filter&&(w=w.filter((function(t){return c.filter(t,m)}))),c.itemSort&&(w=w.sort((function(t,e){return c.itemSort(t,e,m)}))),H.each(w,(function(t){_.push(c.callbacks.labelColor.call(h,t,h._chart)),k.push(c.callbacks.labelTextColor.call(h,t,h._chart))})),g.title=h.getTitle(w,m),g.beforeBody=h.getBeforeBody(w,m),g.body=h.getBody(w,m),g.afterBody=h.getAfterBody(w,m),g.footer=h.getFooter(w,m),g.x=y.x,g.y=y.y,g.caretPadding=c.caretPadding,g.labelColors=_,g.labelTextColors=k,g.dataPoints=w,x=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=H.fontString(u,e._titleFontStyle,e._titleFontFamily),H.each(e.title,f),n.font=H.fontString(d,e._bodyFontStyle,e._bodyFontFamily),H.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,H.each(r,(function(t){H.each(t.before,f),H.each(t.lines,f),H.each(t.after,f)})),c=0,n.font=H.fontString(h,e._footerFontStyle,e._footerFontFamily),H.each(e.footer,f),{width:a+=2*e.xPadding,height:i}}(this,g),b=function(t,e,n,i){var a=t.x,r=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=n.xAlign,d=n.yAlign,h=o+s,c=l+s;return"right"===u?a-=e.width:"center"===u&&((a-=e.width/2)+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,x,v=function(t,e){var n,i,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?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=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"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(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,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+p)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+p-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+m)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Ne(e.rtl,e.x,e.width);for(t.x=He(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=H.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r<s;++r)n.fillText(o[r],l.x(t.x),t.y+i/2),t.y+=i+a,r+1===s&&(t.y+=e.titleMarginBottom-a)}},drawBody:function(t,e,n){var i,a,r,o,s,l,u,d,h=e.bodyFontSize,c=e.bodySpacing,f=e._bodyAlign,g=e.body,p=e.displayColors,m=0,v=p?He(e,"left"):0,b=Ne(e.rtl,e.x,e.width),x=function(e){n.fillText(e,b.x(t.x+m),t.y+h/2),t.y+=h+c},y=b.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=H.fontString(h,e._bodyFontStyle,e._bodyFontFamily),t.x=He(e,y),n.fillStyle=e.bodyFontColor,H.each(e.beforeBody,x),m=p&&"right"!==y?"center"===f?h/2+1:h+2:0,s=0,u=g.length;s<u;++s){for(i=g[s],a=e.labelTextColors[s],r=e.labelColors[s],n.fillStyle=a,H.each(i.before,x),l=0,d=(o=i.lines).length;l<d;++l){if(p){var _=b.x(v);n.fillStyle=e.legendColorBackground,n.fillRect(b.leftForLtr(_,h),t.y,h,h),n.lineWidth=1,n.strokeStyle=r.borderColor,n.strokeRect(b.leftForLtr(_,h),t.y,h,h),n.fillStyle=r.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(_,1),h-2),t.y+1,h-2,h-2),n.fillStyle=a}x(o[l])}H.each(i.after,x)}m=0,H.each(e.afterBody,x),t.y-=c},drawFooter:function(t,e,n){var i,a,r=e.footer,o=r.length;if(o){var s=Ne(e.rtl,e.x,e.width);for(t.x=He(e,e._footerAlign),t.y+=e.footerMarginTop,n.textAlign=s.textAlign(e._footerAlign),n.textBaseline="middle",i=e.footerFontSize,n.fillStyle=e.footerFontColor,n.font=H.fontString(i,e._footerFontStyle,e._footerFontFamily),a=0;a<o;++a)n.fillText(r[a],s.x(t.x),t.y+i/2),t.y+=i+e.footerSpacing}},drawBackground:function(t,e,n,i){n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,n.lineWidth=e.borderWidth;var a=e.xAlign,r=e.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,d=e.cornerRadius;n.beginPath(),n.moveTo(o+d,s),"top"===r&&this.drawCaret(t,i),n.lineTo(o+l-d,s),n.quadraticCurveTo(o+l,s,o+l,s+d),"center"===r&&"right"===a&&this.drawCaret(t,i),n.lineTo(o+l,s+u-d),n.quadraticCurveTo(o+l,s+u,o+l-d,s+u),"bottom"===r&&this.drawCaret(t,i),n.lineTo(o+d,s+u),n.quadraticCurveTo(o,s+u,o,s+u-d),"center"===r&&"left"===a&&this.drawCaret(t,i),n.lineTo(o,s+d),n.quadraticCurveTo(o,s,o+d,s),n.closePath(),n.fill(),e.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={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&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,H.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),H.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!H.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),Ue=Be,Ye=qe;Ye.positioners=Ue;var Ge=H.valueOrDefault;function Xe(){return H.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)o=n[t][a],r=Ge(o.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?H.merge(e[t][a],[Re.getScaleDefaults(r),o]):H.merge(e[t][a],o)}else H._merger(t,e,n,i)}})}function Ke(){return H.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=Xe(a,r):"scale"===t?e[t]=H.merge(a,[Re.getScaleDefaults(r.type),r]):H._merger(t,e,n,i)}})}function Ze(t){var e=t.options;H.each(t.scales,(function(e){pe.removeBox(t,e)})),e=Ke(N.global,N[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function $e(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(H.findIndex(t,a)>=0);return i}function Je(t){return"top"===t||"bottom"===t}function Qe(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}N._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var tn=function(t,e){return this.construct(t,e),this};H.extend(tn.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Ke(N.global,N[t.type],t.options||{}),t}(e);var i=Oe.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=H.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,tn.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Le.notify(t,"beforeInit"),H.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Le.notify(t,"afterInit"),t},clear:function(){return H.canvas.clear(this),this},stop:function(){return J.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(H.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:H.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",H.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Le.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;H.each(e.xAxes,(function(t,n){t.id||(t.id=$e(e.xAxes,"x-axis-",n))})),H.each(e.yAxes,(function(t,n){t.id||(t.id=$e(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),H.each(i,(function(e){var i=e.options,r=i.id,o=Ge(i.type,e.dtype);Je(i.position)!==Je(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Re.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),H.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Re.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t<e;t++){var r=a[t],o=n.getDatasetMeta(t),s=r.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(t),o=n.getDatasetMeta(t)),o.type=s,o.order=r.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Jt[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,t),i.push(o.controller)}}return i},resetElements:function(){var t=this;H.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),Ze(i),Le._invalidate(i),!1!==Le.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var a=i.buildOrUpdateControllers();for(e=0,n=i.data.datasets.length;e<n;e++)i.getDatasetMeta(e).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&H.each(a,(function(t){t.reset()})),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],Le.notify(i,"afterUpdate"),i._layers.sort(Qe("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){var t=this;!1!==Le.notify(t,"beforeLayout")&&(pe.update(this,this.width,this.height),t._layers=[],H.each(t.boxes,(function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())}),t),t._layers.forEach((function(t,e){t._idx=e})),Le.notify(t,"afterScaleUpdate"),Le.notify(t,"afterLayout"))},updateDatasets:function(){if(!1!==Le.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);Le.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),n={meta:e,index:t};!1!==Le.notify(this,"beforeDatasetUpdate",[n])&&(e.controller._update(),Le.notify(this,"afterDatasetUpdate",[n]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var n=e.options.animation,i=Ge(t.duration,n&&n.duration),a=t.lazy;if(!1!==Le.notify(e,"beforeRender")){var r=function(t){Le.notify(e,"afterRender"),H.callback(n&&n.onComplete,[t],e)};if(n&&i){var o=new $({numSteps:i/16.66,easing:t.easing||n.easing,render:function(t,e){var n=H.easing.effects[e.easing],i=e.currentStep,a=i/e.numSteps;t.draw(n(a),a,i)},onAnimationProgress:n.onProgress,onAnimationComplete:r});J.addAnimation(e,o,i,a)}else e.draw(),r(new $({numSteps:0,chart:e}));return e}},draw:function(t){var e,n,i=this;if(i.clear(),H.isNullOrUndef(t)&&(t=1),i.transition(t),!(i.width<=0||i.height<=0)&&!1!==Le.notify(i,"beforeDraw",[t])){for(n=i._layers,e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(i.chartArea);for(i.drawDatasets(t);e<n.length;++e)n[e].draw(i.chartArea);i._drawTooltip(t),Le.notify(i,"afterDraw",[t])}},transition:function(t){for(var e=0,n=(this.data.datasets||[]).length;e<n;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,n,i=[];for(e=0,n=(this.data.datasets||[]).length;e<n;++e)t&&!this.isDatasetVisible(e)||i.push(this.getDatasetMeta(e));return i.sort(Qe("order","index")),i},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,n;if(!1!==Le.notify(this,"beforeDatasetsDraw",[t])){for(n=(e=this._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)this.drawDataset(e[n],t);Le.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Le.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Le.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Le.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Le.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return re.modes.single(this,t)},getElementsAtEvent:function(t){return re.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return re.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=re.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return re.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++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,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),H.canvas.clear(n),Oe.releaseContext(n.ctx),n.canvas=null,n.ctx=null),Le.notify(n,"destroy"),delete tn.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Ye({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};H.each(t.options.events,(function(i){Oe.addEventListener(t,i,n),e[i]=n})),t.options.responsive&&(n=function(){t.resize()},Oe.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,H.each(e,(function(e,n){Oe.removeEventListener(t,n,e)})))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"set":"remove";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==Le.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),Le.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,n=this,i=n.options||{},a=i.hover;return n.lastActive=n.lastActive||[],"mouseout"===t.type?n.active=[]:n.active=n.getElementsAtEventForMode(t,a.mode,a),H.callback(i.onHover||i.hover.onHover,[t.native,n.active],n),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(n,t.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),e=!H.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,e}}),tn.instances={};var en=tn;tn.Controller=tn,tn.types={},H.configMerge=Ke,H.scaleMerge=Xe;function nn(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function an(t){this.options=t||{}}H.extend(an.prototype,{formats:nn,parse:nn,format:nn,add:nn,diff:nn,startOf:nn,endOf:nn,_create:function(t){return t}}),an.override=function(t){H.extend(an.prototype,t)};var rn={_date:an},on={formatters:{values:function(t){return H.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=H.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=H.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(H.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},sn=H.isArray,ln=H.isNullOrUndef,un=H.valueOrDefault,dn=H.valueAtIndexOrDefault;function hn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=r<e?i:-i)<s-1e-6||o>l+1e-6)))return o}function cn(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,p,m,v=n.length,b=[],x=[],y=[],_=0,k=0;for(a=0;a<v;++a){if(s=n[a].label,l=n[a].major?e.major:e.minor,t.font=u=l.string,d=i[u]=i[u]||{data:{},gc:[]},h=l.lineHeight,c=f=0,ln(s)||sn(s)){if(sn(s))for(r=0,o=s.length;r<o;++r)g=s[r],ln(g)||sn(g)||(c=H.measureText(t,d.data,d.gc,c,g),f+=h)}else c=H.measureText(t,d.data,d.gc,c,s),f=h;b.push(c),x.push(f),y.push(h/2),_=Math.max(c,_),k=Math.max(f,k)}function w(t){return{width:b[t]||0,height:x[t]||0,offset:y[t]||0}}return function(t,e){H.each(t,(function(t){var n,i=t.gc,a=i.length/2;if(a>e){for(n=0;n<a;++n)delete t.data[i[n]];i.splice(0,a)}}))}(i,v),p=b.indexOf(_),m=x.indexOf(k),{first:w(0),last:w(v-1),widest:w(p),highest:w(m)}}function fn(t){return t.drawTicks?t.tickMarkLength:0}function gn(t){var e,n;return t.display?(e=H.options._parseFont(t),n=H.options.toPadding(t.padding),e.lineHeight+n.height):0}function pn(t,e){return H.extend(H.options._parseFont({fontFamily:un(e.fontFamily,t.fontFamily),fontSize:un(e.fontSize,t.fontSize),fontStyle:un(e.fontStyle,t.fontStyle),lineHeight:un(e.lineHeight,t.lineHeight)}),{color:H.options.resolve([e.fontColor,t.fontColor,N.global.defaultFontColor])})}function mn(t){var e=pn(t,t.minor);return{minor:e,major:t.major.enabled?pn(t,t.major):e}}function vn(t){var e,n,i,a=[];for(n=0,i=t.length;n<i;++n)void 0!==(e=t[n])._index&&a.push(e);return a}function bn(t,e,n,i){var a,r,o,s,l=un(n,0),u=Math.min(un(i,t.length),t.length),d=0;for(e=Math.ceil(e),i&&(e=(a=i-n)/Math.floor(a/e)),s=l;s<0;)d++,s=Math.round(l+d*e);for(r=Math.max(l,0);r<u;r++)o=t[r],r===s?(o._index=r,d++,s=Math.round(l+d*e)):delete o.label}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:"",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:on.formatters.values,minor:{},major:{}}});var xn=K.extend({zeroLineIndex:0,getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){H.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l=this,u=l.options.ticks,d=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=H.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],i=0,a=l.ticks.length;i<a;++i)o.push({value:l.ticks[i],major:!1});return l._ticks=o,s=d<o.length,r=l._convertTicksToLabels(s?function(t,e){for(var n=[],i=t.length/e,a=0,r=t.length;a<r;a+=i)n.push(t[Math.floor(a)]);return n}(o,d):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(r=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=r,l.afterUpdate(),l.minSize},_configure:function(){var t,e,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,i=!i),n._startPixel=t,n._endPixel=e,n._reversePixels=i,n._length=e-t},afterUpdate:function(){H.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){H.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(){H.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){H.callback(this.options.beforeDataLimits,[this])},determineDataLimits:H.noop,afterDataLimits:function(){H.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){H.callback(this.options.beforeBuildTicks,[this])},buildTicks:H.noop,afterBuildTicks:function(t){var e=this;return sn(t)&&t.length?H.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=H.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){H.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){H.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){H.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,n,i,a,r,o,s=this,l=s.options,u=l.ticks,d=s.getTicks().length,h=u.minRotation||0,c=u.maxRotation,f=h;!s._isVisible()||!u.display||h>=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-fn(l.gridLines)-u.padding-gn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=H.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){H.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){H.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=fn(o)+gn(r)),u?s&&(e.height=fn(o)+gn(r)):e.height=t.maxHeight,a.display&&s){var d=mn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,p=h.highest,m=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,x=H.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var w,M,S=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?y*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):y*f.width+_*f.offset):(w=c.width/2,M=f.width/2),t.paddingLeft=Math.max((w-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-C)*t.width/(t.width-C),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){H.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(ln(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!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},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;n<i;++n)t[n].label=e[n];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=cn(t.ctx,mn(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,n,i,a;return sn(t)?(e=+this.getRightValue(t[0]),n=+this.getRightValue(t[1]),i=Math.min(e,n),a=Math.max(e,n)):(e=void 0,n=t=+this.getRightValue(t),i=t,a=t),{min:i,max:a,start:e,end:n}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:H.noop,getPixelForValue:H.noop,getValueForPixel:H.noop,getPixelForTick:function(t){var e=this.options.offset,n=this._ticks.length,i=1/Math.max(n-(e?0:1),1);return t<0||t>n-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},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,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;e<n;e++)t[e].major&&i.push(e);return i}(t):[],u=l.length,d=l[0],h=l[u-1];if(u>s)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;i<t.length;i++)a=t[i],i===o?(a._index=i,o=e[++r*n]):delete a.label}(t,l,u/s),vn(t);if(i=function(t,e,n,i){var a,r,o,s,l=function(t){var e,n,i=t.length;if(i<2)return!1;for(n=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==n)return!1;return n}(t),u=(e.length-1)/i;if(!l)return Math.max(u,1);for(o=0,s=(a=H.math._factorize(l)).length-1;o<s;o++)if((r=a[o])>u)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e<n;e++)bn(t,i,l[e],l[e+1]);return a=u>1?(h-d)/(u-1):null,bn(t,i,H.isNullOrUndef(a)?0:d-a,d),bn(t,i,h,H.isNullOrUndef(a)?t.length:h+a),vn(t)}return bn(t,i),vn(t)},_tickSize:function(){var t=this.options.ticks,e=H.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i<o*n?s/n:o/i},_isVisible:function(){var t,e,n,i=this.chart,a=this.options.display;if("auto"!==a)return!!a;for(t=0,e=i.data.datasets.length;t<e;++t)if(i.isDatasetVisible(t)&&((n=i.getDatasetMeta(t)).xAxisID===this.id||n.yAxisID===this.id))return!0;return!1},_computeGridLineItems:function(t){var e,n,i,a,r,o,s,l,u,d,h,c,f,g,p,m,v,b=this,x=b.chart,y=b.options,_=y.gridLines,k=y.position,w=_.offsetGridLines,M=b.isHorizontal(),S=b._ticksToDraw,C=S.length+(w?1:0),P=fn(_),A=[],D=_.drawBorder?dn(_.lineWidth,0,0):0,T=D/2,I=H._alignPixel,F=function(t){return I(x,t,D)};for("top"===k?(e=F(b.bottom),s=b.bottom-P,u=e-T,h=F(t.top)+T,f=t.bottom):"bottom"===k?(e=F(b.top),h=t.top,f=F(t.bottom)-T,s=e+T,u=b.top+P):"left"===k?(e=F(b.right),o=b.right-P,l=e-T,d=F(t.left)+T,c=t.right):(e=F(b.left),d=t.left,c=F(t.right)-T,o=e+T,l=b.left+P),n=0;n<C;++n)i=S[n]||{},ln(i.label)&&n<S.length||(n===b.zeroLineIndex&&y.offset===w?(g=_.zeroLineWidth,p=_.zeroLineColor,m=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(g=dn(_.lineWidth,n,1),p=dn(_.color,n,"rgba(0,0,0,0.1)"),m=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=hn(b,i._index||n,w))&&(r=I(x,a,g),M?o=l=d=c=r:s=u=h=f=r,A.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:d,y1:h,x2:c,y2:f,width:g,color:p,borderDash:m,borderDashOffset:v})));return A.ticksLength=C,A.borderValue=e,A},_computeLabelItems:function(){var t,e,n,i,a,r,o,s,l,u,d,h,c=this,f=c.options,g=f.ticks,p=f.position,m=g.mirror,v=c.isHorizontal(),b=c._ticksToDraw,x=mn(g),y=g.padding,_=fn(f.gridLines),k=-H.toRadians(c.labelRotation),w=[];for("top"===p?(r=c.bottom-_-y,o=k?"left":"center"):"bottom"===p?(r=c.top+_+y,o=k?"right":"center"):"left"===p?(a=c.right-(m?0:_)-y,o=m?"left":"right"):(a=c.left+(m?0:_)+y,o=m?"right":"left"),t=0,e=b.length;t<e;++t)i=(n=b[t]).label,ln(i)||(s=c.getPixelForTick(n._index||t)+g.labelOffset,u=(l=n.major?x.major:x.minor).lineHeight,d=sn(i)?i.length:1,v?(a=s,h="top"===p?((k?1:.5)-d)*u:(k?0:.5)*u):(r=s,h=(1-d)*u/2),w.push({x:a,y:r,rotation:k,label:i,font:l,textOffset:h,textAlign:o}));return w},_drawGrid:function(t){var e=this,n=e.options.gridLines;if(n.display){var i,a,r,o,s,l=e.ctx,u=e.chart,d=H._alignPixel,h=n.drawBorder?dn(n.lineWidth,0,0):0,c=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(r=0,o=c.length;r<o;++r)i=(s=c[r]).width,a=s.color,i&&a&&(l.save(),l.lineWidth=i,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(h){var f,g,p,m,v=h,b=dn(n.lineWidth,c.ticksLength-1,1),x=c.borderValue;e.isHorizontal()?(f=d(u,e.left,v)-v/2,g=d(u,e.right,b)+b/2,p=m=x):(p=d(u,e.top,v)-v/2,m=d(u,e.bottom,b)+b/2,f=g=x),l.lineWidth=h,l.strokeStyle=dn(n.color,0),l.beginPath(),l.moveTo(f,p),l.lineTo(g,m),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,n,i,a,r,o,s,l,u=t.ctx,d=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,i=d.length;e<i;++e){if(o=(r=d[e]).font,u.save(),u.translate(r.x,r.y),u.rotate(r.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=r.textAlign,s=r.label,l=r.textOffset,sn(s))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,n=t.options,i=n.scaleLabel;if(i.display){var a,r,o=un(i.fontColor,N.global.defaultFontColor),s=H.options._parseFont(i),l=H.options.toPadding(i.padding),u=s.lineHeight/2,d=n.position,h=0;if(t.isHorizontal())a=t.left+t.width/2,r="bottom"===d?t.bottom-u-l.bottom:t.top+u+l.top;else{var c="left"===d;a=c?t.left+u+l.top:t.right-u-l.top,r=t.top+t.height/2,h=c?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(a,r),e.rotate(h),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(i.labelString,0,0),e.restore()}},draw:function(t){this._isVisible()&&(this._drawGrid(t),this._drawTitle(),this._drawLabels())},_layers:function(){var t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&n!==i&&t.draw===t._draw?[{z:i,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:n,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:n,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,n=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter((function(i){return(!t||i.type===t)&&(n?i.xAxisID===e.id:i.yAxisID===e.id)}))}});xn.prototype._draw=xn.prototype.draw;var yn=xn,_n=H.isNullOrUndef,kn=yn.extend({determineDataLimits:function(){var t,e=this,n=e._getLabels(),i=e.options.ticks,a=i.min,r=i.max,o=0,s=n.length-1;void 0!==a&&(t=n.indexOf(a))>=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;yn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return _n(e)||_n(n)||(t=o.chart.data.datasets[n].data[e]),_n(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=H.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),wn={position:"bottom"};kn._defaults=wn;var Mn=H.noop,Sn=H.isNullOrUndef;var Cn=yn.extend({getRightValue:function(t){return"string"==typeof t?+t:yn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=H.sign(t.min),i=H.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=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)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:Mn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:H.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=H.niceNum((g-f)/u/l)*l;if(p<1e-14&&Sn(d)&&Sn(h))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>u&&(p=H.niceNum(r*p/u/l)*l),s||Sn(c)?n=Math.pow(10,H._decimalPlaces(p)):(n=Math.pow(10,c),p=Math.ceil(p*n)/n),i=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!Sn(d)&&H.almostWhole(d/p,p/1e3)&&(i=d),!Sn(h)&&H.almostWhole(h/p,p/1e3)&&(a=h)),r=(a-i)/p,r=H.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(Sn(d)?i:d);for(var m=1;m<r;++m)o.push(Math.round((i+m*p)*n)/n);return o.push(Sn(h)?a:h),o}(i,t);t.handleDirectionalChanges(),t.max=H.max(a),t.min=H.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),yn.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,a=e.max;yn.prototype._configure.call(e),e.options.offset&&n.length&&(i-=t=(a-i)/Math.max(n.length-1,1)/2,a+=t),e._startValue=i,e._endValue=a,e._valueRange=a-i}}),Pn={position:"left",ticks:{callback:on.formatters.linear}};function An(t,e,n,i){var a,r,o=t.options,s=function(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}(e,o.stacked,n),l=s.pos,u=s.neg,d=i.length;for(a=0;a<d;++a)r=t._parseValue(i[a]),isNaN(r.min)||isNaN(r.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:r.min<0||r.max<0?u[a]+=r.min:l[a]+=r.max)}function Dn(t,e,n){var i,a,r=n.length;for(i=0;i<r;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||e.data[i].hidden||(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}var Tn=Cn.extend({determineDataLimits:function(){var t,e,n,i,a=this,r=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=r.stacked,u={},d=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(t=0;!l&&t<d;++t)l=void 0!==(e=s[t]).stack;for(t=0;t<d;++t)n=o[(e=s[t]).index].data,l?An(a,u,e,n):Dn(a,e,n);H.each(u,(function(t){i=t.pos.concat(t.neg),a.min=Math.min(a.min,H.min(i)),a.max=Math.max(a.max,H.max(i))})),a.min=H.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=H.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=H.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){return this.getPixelForDecimal((+this.getRightValue(t)-this._startValue)/this._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}}),In=Pn;Tn._defaults=In;var Fn=H.valueOrDefault,On=H.math.log10;var Ln={position:"left",ticks:{callback:on.formatters.logarithmic}};function Rn(t,e){return H.isFinite(t)&&t>=0?t:e}var zn=yn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e)&&void 0!==e.stack){c=!0;break}if(s.stacked||c){var f={};for(t=0;t<u.length;t++){var g=[(e=l.getDatasetMeta(t)).type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&h(e))for(void 0===f[g]&&(f[g]=[]),a=0,r=(i=u[t].data).length;a<r;a++){var p=f[g];n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(p[a]=p[a]||0,p[a]+=n.max)}}H.each(f,(function(t){if(t.length>0){var e=H.min(t),n=H.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e))for(a=0,r=(i=u[t].data).length;a<r;a++)n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=H.isFinite(o.min)?o.min:null,o.max=H.isFinite(o.max)?o.max:null,o.minNotZero=H.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=Rn(e.min,t.min),t.max=Rn(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(On(t.min))-1),t.max=Math.pow(10,Math.floor(On(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(On(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(On(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(On(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:Rn(e.min),max:Rn(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=Fn(t.min,Math.pow(10,Math.floor(On(e.min)))),o=Math.floor(On(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(On(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(On(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(n<o||n===o&&i<s);var u=Fn(t.max,r);return a.push(u),a}(i,t);t.max=H.max(a),t.min=H.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),yn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(On(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;yn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=Fn(t.options.ticks.fontSize,N.global.defaultFontSize)/t._length),t._startValue=On(e),t._valueOffset=n,t._valueRange=(On(t.max)-On(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(On(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),Nn=Ln;zn._defaults=Nn;var Bn=H.valueOrDefault,En=H.valueAtIndexOrDefault,Wn=H.options.resolve,Vn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:on.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Hn(t){var e=t.ticks;return e.display&&t.display?Bn(e.fontSize,N.global.defaultFontSize)+2*e.backdropPaddingY:0}function jn(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function qn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Un(t,e,n,i){var a,r,o=n.y+i/2;if(H.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function Yn(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function Gn(t){return H.isNumber(t)?t:0}var Xn=Cn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Hn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;H.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);H.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Hn(this.options))},convertTicksToLabels:function(){var t=this;Cn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=H.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=H.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;e<d;e++){i=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,u=t.pointLabels[e],n=H.isArray(u)?{w:H.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},t._pointLabelSizes[e]=n;var h=t.getIndexAngle(e),c=H.toDegrees(h)%360,f=jn(c,i.x,n.w,0,180),g=jn(c,i.y,n.h,90,270);f.start<r.l&&(r.l=f.start,o.l=h),f.end>r.r&&(r.r=f.end,o.r=h),g.start<r.t&&(r.t=g.start,o.t=h),g.end>r.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=Gn(a),r=Gn(r),o=Gn(o),s=Gn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(H.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Bn(s.lineWidth,o.lineWidth),u=Bn(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Hn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=H.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=En(i.fontColor,s,N.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=H.toDegrees(h);e.textAlign=qn(c),Yn(c,t._pointLabelSizes[s],u),Un(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&H.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=En(e.color,i-1),u=En(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d<s;d++)a=t.getPointPosition(d,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}(i,o,e,n))})),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(Wn([s.borderDash,o.borderDash,[]])),a.lineDashOffset=Wn([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=H.options._parseFont(n),s=Bn(n.fontColor,N.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",H.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:H.noop}),Kn=Vn;Xn._defaults=Kn;var Zn=H._deprecated,$n=H.options.resolve,Jn=H.valueOrDefault,Qn=Number.MIN_SAFE_INTEGER||-9007199254740991,ti=Number.MAX_SAFE_INTEGER||9007199254740991,ei={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ni=Object.keys(ei);function ii(t,e){return t-e}function ai(t){return H.valueOrDefault(t.time.min,t.ticks.min)}function ri(t){return H.valueOrDefault(t.time.max,t.ticks.max)}function oi(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),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?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function si(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),H.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),H.isFinite(o)||(o=n.parse(o))),o)}function li(t,e){if(H.isNullOrUndef(e))return null;var n=t.options.time,i=si(t,t.getRightValue(e));return null===i?i:(n.round&&(i=+t._adapter.startOf(i,n.round)),i)}function ui(t,e,n,i){var a,r,o,s=ni.length;for(a=ni.indexOf(t);a<s-1;++a)if(o=(r=ei[ni[a]]).steps?r.steps:ti,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return ni[a];return ni[s-1]}function di(t,e,n){var i,a,r=[],o={},s=e.length;for(i=0;i<s;++i)o[a=e[i]]=i,r.push({value:a,major:!1});return 0!==s&&n?function(t,e,n,i){var a,r,o=t._adapter,s=+o.startOf(e[0].value,i),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,i))(r=n[a])>=0&&(e[r].major=!0);return e}(t,r,o,n):r}var hi=yn.extend({initialize:function(){this.mergeTicksOptions(),yn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new rn._date(e.adapters.date);return Zn("time scale",n.format,"time.format","time.parser"),Zn("time scale",n.min,"time.min","ticks.min"),Zn("time scale",n.max,"time.max","ticks.max"),H.mergeIf(n.displayFormats,i.formats()),yn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),yn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=ti,f=Qn,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t<n;++t)m.push(li(s,v[t]));for(t=0,n=(l.data.datasets||[]).length;t<n;++t)if(l.isDatasetVisible(t))if(a=l.data.datasets[t].data,H.isObject(a[0]))for(p[t]=[],e=0,i=a.length;e<i;++e)r=li(s,a[e]),g.push(r),p[t][e]=r;else p[t]=m.slice(0),o||(g=g.concat(m),o=!0);else p[t]=[];m.length&&(c=Math.min(c,m[0]),f=Math.max(f,m[m.length-1])),g.length&&(g=n>1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}(g).sort(ii):g.sort(ii),c=Math.min(c,g[0]),f=Math.max(f,g[g.length-1])),c=li(s,ai(d))||c,f=li(s,ri(d))||f,c=c===ti?+u.startOf(Date.now(),h):c,f=f===Qn?+u.endOf(Date.now(),h)+1:f,s.min=Math.min(c,f),s.max=Math.max(c+1,f),s._table=[],s._timestamps={data:g,datasets:p,labels:m}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,d=[],h=i.getLabelCapacity(a),c=s.source,f=o.distribution;for(u="data"===c||"auto"===c&&"series"===f?u.data:"labels"===c?u.labels:function(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||ui(s.minUnit,e,n,i),u=$n([s.stepSize,s.unitStepSize,1]),d="week"===l&&s.isoWeekday,h=e,c=[];if(d&&(h=+r.startOf(h,"isoWeek",d)),h=+r.startOf(h,d?"day":l),r.diff(n,e,l)>1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a<n;a=+r.add(a,u,l))c.push(a);return a!==n&&"ticks"!==o.bounds||c.push(a),c}(i,a,r,h),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=li(i,ai(o))||a,r=li(i,ri(o))||r,t=0,e=u.length;t<e;++t)(n=u[t])>=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?ui(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=ni.length-1;r>=ni.indexOf(n);r--)if(o=ni[r],ei[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return ni[n?ni.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=ni.indexOf(t)+1,n=ni.length;e<n;++e)if(ei[ni[e]].common)return ni[e]}(i._unit):void 0,i._table=function(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,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<n&&d.push(s);for(d.push(n),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}(i._timestamps.data,a,r,f),i._offsets=function(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(r=oi(t,"time",e[0],"pos"),s=1===e.length?1-r:(oi(t,"time",e[1],"pos")-r)/2,o=oi(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-oi(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(i._table,d,0,0,o),s.reverse&&d.reverse(),di(i,d,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return H.isObject(s)&&(o=n.getRightValue(s)),r.tooltipFormat?i.format(si(n,o),r.tooltipFormat):"string"==typeof o?o:i.format(si(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this._adapter,r=this.options,o=r.time.displayFormats,s=o[this._unit],l=this._majorUnit,u=o[l],d=n[e],h=r.ticks,c=l&&u&&d&&d.major,f=a.format(t,i||(c?u:s)),g=c?h.major:h.minor,p=$n([g.callback,g.userCallback,h.callback,h.userCallback]);return p?p(f,e,n):f},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this._offsets,n=oi(this._table,"time",t,"pos");return this.getPixelForDecimal((e.start+n)*e.factor)},getPixelForValue:function(t,e,n){var i=null;if(void 0!==e&&void 0!==n&&(i=this._timestamps.datasets[n][e]),null===i&&(i=li(this,t)),null!==i)return this.getPixelForOffset(i)},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._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end,i=oi(this._table,"pos",n,"time");return this._adapter._create(i)},_getLabelSize:function(t){var e=this.options.ticks,n=this.ctx.measureText(t).width,i=H.toRadians(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(i),r=Math.sin(i),o=Jn(e.fontSize,N.global.defaultFontSize);return{w:n*a+o*r,h:n*r+o*a}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,di(e,[t],e._majorUnit),a),o=e._getLabelSize(r),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}}),ci={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};hi._defaults=ci;var fi={category:kn,linear:Tn,logarithmic:zn,radialLinear:Xn,time:hi},gi={datetime:"MMM D, YYYY, h:mm:ss a",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"};rn._date.override("function"==typeof t?{_id:"moment",formats:function(){return gi},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),N._set("global",{plugins:{filler:{propagate:!0}}});var pi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.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,n=e?e.x:null,i=e?e.y:null;return H.isArray(e)?function(t,n){return e[n]}:function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function mi(t,e,n){var i,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(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;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 vi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a<l;++a)r="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?e:n):o.getBasePosition(a),s.gridLines.circular&&(r.cx=i.x,r.cy=i.y,r.angle=o.getIndexAngle(a)-Math.PI/2),d.push(r);return d}(t):function(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePixel&&(r=i.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if(H.isFinite(r))return{x:(e=i.isHorizontal())?r:null,y:e?null:r}}return null}(t)}function bi(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function xi(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),pi[n](t))}function yi(t){return t&&!t.skip}function _i(t,e,n,i,a){var r,o,s,l;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)H.canvas.lineTo(t,e[r-1],e[r]);if(void 0===n[0].angle)for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)H.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function ki(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,p=i.spanGaps,m=[],v=[],b=0,x=0;for(t.beginPath(),o=0,s=g;o<s;++o)d=n(u=e[l=o%g]._view,l,i),h=yi(u),c=yi(d),r&&void 0===f&&h&&(s=g+(f=o+1)),h&&c?(b=m.push(u),x=v.push(d)):b&&x&&(p?(h&&m.push(u),c&&v.push(d)):(_i(t,m,v,b,x),b=x=0,m=[],v=[]));_i(t,m,v,b,x),t.closePath(),t.fillStyle=a,t.fill()}var wi={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;i<o;++i)r=null,(a=(n=t.getDatasetMeta(i)).dataset)&&a._model&&a instanceof kt.Line&&(r={visible:t.isDatasetVisible(i),fill:mi(a,i,o),chart:t,el:a}),n.$filler=r,l.push(r);for(i=0;i<o;++i)(r=l[i])&&(r.fill=bi(l,i,s),r.boundary=vi(r),r.mapper=xi(r))},beforeDatasetsDraw:function(t){var e,n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(n=l.length-1;n>=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||N.global.defaultColor,o&&s&&r.length&&(H.canvas.clipArea(u,t.chartArea),ki(u,r,o,a,s,i._loop),H.canvas.unclipArea(u)))}},Mi=H.rtl.getRtlAdapter,Si=H.noop,Ci=H.valueOrDefault;function Pi(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}N._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;e<n;e++)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[e].backgroundColor,r[e].label&&i.appendChild(document.createTextNode(r[e].label));return a.outerHTML}});var Ai=K.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:Si,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Si,beforeSetDimensions:Si,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:Si,beforeBuildLabels:Si,buildLabels:function(){var t=this,e=t.options.labels||{},n=H.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:Si,beforeFit:Si,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,a=t.ctx,r=H.options._parseFont(n),o=r.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i){if(a.font=r.string,u){var d=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="middle",H.each(t.legendItems,(function(t,e){var i=Pi(n,o)+o/2+a.measureText(t.text).width;(0===e||d[d.length-1]+i+2*n.padding>l.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;H.each(t.legendItems,(function(t,e){var i=Pi(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:Si,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=N.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=Mi(e.rtl,t.left,t.minSize.width),c=t.ctx,f=Ci(n.fontColor,i.defaultFontColor),g=H.options._parseFont(n),p=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var m=Pi(n,p),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},x=t.isHorizontal();d=x?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},H.rtl.overrideTextDirection(t.ctx,e.textDirection);var y=p+n.padding;H.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=m+p/2+f,_=d.x,k=d.y;h.setWidth(t.minSize.width),x?i>0&&_+g+n.padding>t.left+t.minSize.width&&(k=d.y+=y,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&k+y>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,k=d.y=t.top+b(o,s[d.line]));var w=h.x(_);!function(t,e,i){if(!(isNaN(m)||m<=0)){c.save();var o=Ci(i.lineWidth,r.borderWidth);if(c.fillStyle=Ci(i.fillStyle,a),c.lineCap=Ci(i.lineCap,r.borderCapStyle),c.lineDashOffset=Ci(i.lineDashOffset,r.borderDashOffset),c.lineJoin=Ci(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=Ci(i.strokeStyle,a),c.setLineDash&&c.setLineDash(Ci(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=h.xPlus(t,m/2),u=e+p/2;H.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,m),e,m,p),0!==o&&c.strokeRect(h.leftForLtr(t,m),e,m,p);c.restore()}}(w,k,e),v[i].left=h.leftForLtr(w,v[i].width),v[i].top=k,function(t,e,n,i){var a=p/2,r=h.xPlus(t,m+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(w,k,e,f),x?d.x+=g+n.padding:d.y+=y})),H.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n<a.length;++n)if(t>=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Di(t,e){var n=new Ai({ctx:t.ctx,options:e,chart:t});pe.configure(t,n,e),pe.addBox(t,n),t.legend=n}var Ti={id:"legend",_element:Ai,beforeInit:function(t){var e=t.options.legend;e&&Di(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(H.mergeIf(e,N.global.legend),n?(pe.configure(t,n,e),n.options=e):Di(t,e)):n&&(pe.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Ii=H.noop;N._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Fi=K.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Ii,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Ii,beforeSetDimensions:Ii,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:Ii,beforeBuildLabels:Ii,buildLabels:Ii,afterBuildLabels:Ii,beforeFit:Ii,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(H.isArray(n.text)?n.text.length:1)*H.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Ii,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=H.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=H.valueOrDefault(n.fontColor,N.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(H.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,i),p+=s;else e.fillText(g,0,0,i);e.restore()}}});function Oi(t,e){var n=new Fi({ctx:t.ctx,options:e,chart:t});pe.configure(t,n,e),pe.addBox(t,n),t.titleBlock=n}var Li={},Ri=wi,zi=Ti,Ni={id:"title",_element:Fi,beforeInit:function(t){var e=t.options.title;e&&Oi(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(H.mergeIf(e,N.global.title),n?(pe.configure(t,n,e),n.options=e):Oi(t,e)):n&&(pe.removeBox(t,n),delete t.titleBlock)}};for(var Bi in Li.filler=Ri,Li.legend=zi,Li.title=Ni,en.helpers=H,function(){function t(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function e(t){return null!=t&&"none"!==t}function n(n,i,a){var r=document.defaultView,o=H._getParentNode(n),s=r.getComputedStyle(n)[i],l=r.getComputedStyle(o)[i],u=e(s),d=e(l),h=Number.POSITIVE_INFINITY;return u||d?Math.min(u?t(s,n,a):h,d?t(l,o,a):h):"none"}H.where=function(t,e){if(H.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return H.each(t,(function(t){e(t)&&n.push(t)})),n},H.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},H.findNextWhere=function(t,e,n){H.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},H.findPreviousWhere=function(t,e,n){H.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},H.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},H.almostEquals=function(t,e,n){return Math.abs(t-e)<n},H.almostWhole=function(t,e){var n=Math.round(t);return n-e<=t&&n+e>=t},H.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},H.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},H.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},H.toRadians=function(t){return t*(Math.PI/180)},H.toDegrees=function(t){return t*(180/Math.PI)},H._decimalPlaces=function(t){if(H.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},H.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},H.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},H.aliasPixel=function(t){return t%2==0?0:.5},H._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},H.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,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=i*(u=isNaN(u)?0:u),c=i*(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)}}},H.EPSILON=Number.EPSILON||1e-14,H.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e<h;++e)if(!(i=d[e]).model.skip){if(n=e>0?d[e-1]:null,(a=e<h-1?d[e+1]:null)&&!a.model.skip){var c=a.model.x-i.model.x;i.deltaK=0!==c?(a.model.y-i.model.y)/c:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}for(e=0;e<h-1;++e)i=d[e],a=d[e+1],i.model.skip||a.model.skip||(H.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,(l=Math.pow(r,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<h;++e)(i=d[e]).model.skip||(n=e>0?d[e-1]:null,a=e<h-1?d[e+1]:null,n&&!n.model.skip&&(u=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-u,i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(u=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+u,i.model.controlPointNextY=i.model.y+u*i.mK))},H.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},H.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},H.niceNum=function(t,e){var n=Math.floor(H.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},H.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)},H.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(H.getStyle(r,"padding-left")),u=parseFloat(H.getStyle(r,"padding-top")),d=parseFloat(H.getStyle(r,"padding-right")),h=parseFloat(H.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},H.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},H.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},H._calculatePadding=function(t,e,n){return(e=H.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},H._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},H.getMaximumWidth=function(t){var e=H._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-H._calculatePadding(e,"padding-left",n)-H._calculatePadding(e,"padding-right",n),a=H.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},H.getMaximumHeight=function(t){var e=H._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-H._calculatePadding(e,"padding-top",n)-H._calculatePadding(e,"padding-bottom",n),a=H.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},H.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},H.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},H.fontString=function(t,e,n){return e+" "+t+"px "+n},H.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;o<c;o++)if(null!=(u=n[o])&&!0!==H.isArray(u))h=H.measureText(t,a,r,h,u);else if(H.isArray(u))for(s=0,l=u.length;s<l;s++)null==(d=u[s])||H.isArray(d)||(h=H.measureText(t,a,r,h,d));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return h},H.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},H.numberOfLabelLines=function(t){var e=1;return H.each(t,(function(t){H.isArray(t)&&t.length>e&&(e=t.length)})),e},H.color=_?function(t){return t instanceof CanvasGradient&&(t=N.global.defaultColor),_(t)}:function(t){return console.error("Color.js not found!"),t},H.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:H.color(t).saturate(.5).darken(.1).rgbString()}}(),en._adapters=rn,en.Animation=$,en.animationService=J,en.controllers=Jt,en.DatasetController=it,en.defaults=N,en.Element=K,en.elements=kt,en.Interaction=re,en.layouts=pe,en.platform=Oe,en.plugins=Le,en.Scale=yn,en.scaleService=Re,en.Ticks=on,en.Tooltip=Ye,en.helpers.each(fi,(function(t,e){en.scaleService.registerScaleType(e,t,t._defaults)})),Li)Li.hasOwnProperty(Bi)&&en.plugins.register(Li[Bi]);en.platform.initialize();var Ei=en;return"undefined"!=typeof window&&(window.Chart=en),en.Chart=en,en.Legend=Li.legend._element,en.Title=Li.title._element,en.pluginService=en.plugins,en.PluginBase=en.Element.extend({}),en.canvasHelpers=en.helpers.canvas,en.layoutService=en.layouts,en.LinearScaleBase=Cn,en.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){en[t]=function(e,n){return new en(e,en.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Ei}));
17
-
18
-
19
- /* ================== admin/assets/js/src/plugins/dist/jquery.matchHeight-min.dev.js =================== */
20
-
21
-
22
- "use strict";
23
-
24
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
25
-
26
- /*
27
- * jquery-match-height 0.7.2 by @liabru
28
- * http://brm.io/jquery-match-height/
29
- * License MIT
30
- */
31
- !function (t) {
32
- "use strict";
33
-
34
- "function" == typeof define && define.amd ? define(["jquery"], t) : "undefined" != typeof module && module.exports ? module.exports = t(require("jquery")) : t(jQuery);
35
- }(function (t) {
36
- var e = -1,
37
- o = -1,
38
- n = function n(t) {
39
- return parseFloat(t) || 0;
40
- },
41
- a = function a(e) {
42
- var o = 1,
43
- a = t(e),
44
- i = null,
45
- r = [];
46
- return a.each(function () {
47
- var e = t(this),
48
- a = e.offset().top - n(e.css("margin-top")),
49
- s = r.length > 0 ? r[r.length - 1] : null;
50
- null === s ? r.push(e) : Math.floor(Math.abs(i - a)) <= o ? r[r.length - 1] = s.add(e) : r.push(e), i = a;
51
- }), r;
52
- },
53
- i = function i(e) {
54
- var o = {
55
- byRow: !0,
56
- property: "height",
57
- target: null,
58
- remove: !1
59
- };
60
- return "object" == _typeof(e) ? t.extend(o, e) : ("boolean" == typeof e ? o.byRow = e : "remove" === e && (o.remove = !0), o);
61
- },
62
- r = t.fn.matchHeight = function (e) {
63
- var o = i(e);
64
-
65
- if (o.remove) {
66
- var n = this;
67
- return this.css(o.property, ""), t.each(r._groups, function (t, e) {
68
- e.elements = e.elements.not(n);
69
- }), this;
70
- }
71
-
72
- return this.length <= 1 && !o.target ? this : (r._groups.push({
73
- elements: this,
74
- options: o
75
- }), r._apply(this, o), this);
76
- };
77
-
78
- r.version = "0.7.2", r._groups = [], r._throttle = 80, r._maintainScroll = !1, r._beforeUpdate = null, r._afterUpdate = null, r._rows = a, r._parse = n, r._parseOptions = i, r._apply = function (e, o) {
79
- var s = i(o),
80
- h = t(e),
81
- l = [h],
82
- c = t(window).scrollTop(),
83
- p = t("html").outerHeight(!0),
84
- u = h.parents().filter(":hidden");
85
- return u.each(function () {
86
- var e = t(this);
87
- e.data("style-cache", e.attr("style"));
88
- }), u.css("display", "block"), s.byRow && !s.target && (h.each(function () {
89
- var e = t(this),
90
- o = e.css("display");
91
- "inline-block" !== o && "flex" !== o && "inline-flex" !== o && (o = "block"), e.data("style-cache", e.attr("style")), e.css({
92
- display: o,
93
- "padding-top": "0",
94
- "padding-bottom": "0",
95
- "margin-top": "0",
96
- "margin-bottom": "0",
97
- "border-top-width": "0",
98
- "border-bottom-width": "0",
99
- height: "100px",
100
- overflow: "hidden"
101
- });
102
- }), l = a(h), h.each(function () {
103
- var e = t(this);
104
- e.attr("style", e.data("style-cache") || "");
105
- })), t.each(l, function (e, o) {
106
- var a = t(o),
107
- i = 0;
108
- if (s.target) i = s.target.outerHeight(!1);else {
109
- if (s.byRow && a.length <= 1) return void a.css(s.property, "");
110
- a.each(function () {
111
- var e = t(this),
112
- o = e.attr("style"),
113
- n = e.css("display");
114
- "inline-block" !== n && "flex" !== n && "inline-flex" !== n && (n = "block");
115
- var a = {
116
- display: n
117
- };
118
- a[s.property] = "", e.css(a), e.outerHeight(!1) > i && (i = e.outerHeight(!1)), o ? e.attr("style", o) : e.css("display", "");
119
- });
120
- }
121
- a.each(function () {
122
- var e = t(this),
123
- o = 0;
124
- s.target && e.is(s.target) || ("border-box" !== e.css("box-sizing") && (o += n(e.css("border-top-width")) + n(e.css("border-bottom-width")), o += n(e.css("padding-top")) + n(e.css("padding-bottom"))), e.css(s.property, i - o + "px"));
125
- });
126
- }), u.each(function () {
127
- var e = t(this);
128
- e.attr("style", e.data("style-cache") || null);
129
- }), r._maintainScroll && t(window).scrollTop(c / p * t("html").outerHeight(!0)), this;
130
- }, r._applyDataApi = function () {
131
- var e = {};
132
- t("[data-match-height], [data-mh]").each(function () {
133
- var o = t(this),
134
- n = o.attr("data-mh") || o.attr("data-match-height");
135
- n in e ? e[n] = e[n].add(o) : e[n] = o;
136
- }), t.each(e, function () {
137
- this.matchHeight(!0);
138
- });
139
- };
140
-
141
- var s = function s(e) {
142
- r._beforeUpdate && r._beforeUpdate(e, r._groups), t.each(r._groups, function () {
143
- r._apply(this.elements, this.options);
144
- }), r._afterUpdate && r._afterUpdate(e, r._groups);
145
- };
146
-
147
- r._update = function (n, a) {
148
- if (a && "resize" === a.type) {
149
- var i = t(window).width();
150
- if (i === e) return;
151
- e = i;
152
- }
153
-
154
- n ? o === -1 && (o = setTimeout(function () {
155
- s(a), o = -1;
156
- }, r._throttle)) : s(a);
157
- }, t(r._applyDataApi);
158
- var h = t.fn.on ? "on" : "bind";
159
- t(window)[h]("load", function (t) {
160
- r._update(!1, t);
161
- }), t(window)[h]("resize orientationchange", function (t) {
162
- r._update(!0, t);
163
- });
164
- });
165
-
166
-
167
- /* ================== admin/assets/js/src/plugins/jquery.matchHeight-min.js =================== */
168
-
169
-
170
- /*
171
- * jquery-match-height 0.7.2 by @liabru
172
- * http://brm.io/jquery-match-height/
173
- * License MIT
174
- */
175
- !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){var e=-1,o=-1,n=function(t){return parseFloat(t)||0},a=function(e){var o=1,a=t(e),i=null,r=[];return a.each(function(){var e=t(this),a=e.offset().top-n(e.css("margin-top")),s=r.length>0?r[r.length-1]:null;null===s?r.push(e):Math.floor(Math.abs(i-a))<=o?r[r.length-1]=s.add(e):r.push(e),i=a}),r},i=function(e){var o={
176
- byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(o,e):("boolean"==typeof e?o.byRow=e:"remove"===e&&(o.remove=!0),o)},r=t.fn.matchHeight=function(e){var o=i(e);if(o.remove){var n=this;return this.css(o.property,""),t.each(r._groups,function(t,e){e.elements=e.elements.not(n)}),this}return this.length<=1&&!o.target?this:(r._groups.push({elements:this,options:o}),r._apply(this,o),this)};r.version="0.7.2",r._groups=[],r._throttle=80,r._maintainScroll=!1,r._beforeUpdate=null,
177
- r._afterUpdate=null,r._rows=a,r._parse=n,r._parseOptions=i,r._apply=function(e,o){var s=i(o),h=t(e),l=[h],c=t(window).scrollTop(),p=t("html").outerHeight(!0),u=h.parents().filter(":hidden");return u.each(function(){var e=t(this);e.data("style-cache",e.attr("style"))}),u.css("display","block"),s.byRow&&!s.target&&(h.each(function(){var e=t(this),o=e.css("display");"inline-block"!==o&&"flex"!==o&&"inline-flex"!==o&&(o="block"),e.data("style-cache",e.attr("style")),e.css({display:o,"padding-top":"0",
178
- "padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),l=a(h),h.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||"")})),t.each(l,function(e,o){var a=t(o),i=0;if(s.target)i=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each(function(){var e=t(this),o=e.attr("style"),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block");var a={
179
- display:n};a[s.property]="",e.css(a),e.outerHeight(!1)>i&&(i=e.outerHeight(!1)),o?e.attr("style",o):e.css("display","")})}a.each(function(){var e=t(this),o=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(o+=n(e.css("border-top-width"))+n(e.css("border-bottom-width")),o+=n(e.css("padding-top"))+n(e.css("padding-bottom"))),e.css(s.property,i-o+"px"))})}),u.each(function(){var e=t(this);e.attr("style",e.data("style-cache")||null)}),r._maintainScroll&&t(window).scrollTop(c/p*t("html").outerHeight(!0)),
180
- this},r._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each(function(){var o=t(this),n=o.attr("data-mh")||o.attr("data-match-height");n in e?e[n]=e[n].add(o):e[n]=o}),t.each(e,function(){this.matchHeight(!0)})};var s=function(e){r._beforeUpdate&&r._beforeUpdate(e,r._groups),t.each(r._groups,function(){r._apply(this.elements,this.options)}),r._afterUpdate&&r._afterUpdate(e,r._groups)};r._update=function(n,a){if(a&&"resize"===a.type){var i=t(window).width();if(i===e)return;e=i;
181
- }n?o===-1&&(o=setTimeout(function(){s(a),o=-1},r._throttle)):s(a)},t(r._applyDataApi);var h=t.fn.on?"on":"bind";t(window)[h]("load",function(t){r._update(!1,t)}),t(window)[h]("resize orientationchange",function(t){r._update(!0,t)})});
1
+ /*! WP ULike - v4.4.6
2
  * https://wpulike.com
3
  * TechnoWich 2021;
4
  */
 
 
 
 
 
5
  /*!
6
  * Chart.js v2.9.4
7
  * https://www.chartjs.org
8
  * (c) 2020 Chart.js Contributors
9
  * Released under the MIT License
10
  */
11
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],(function(t){return e(function(){try{return t("moment")}catch(t){}}())})):(t=t||self).Chart=e(t.moment)}(this,(function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={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]},n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[e[i]]=i);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var r in a)if(a.hasOwnProperty(r)){if(!("channels"in a[r]))throw new Error("missing channels property: "+r);if(!("labels"in a[r]))throw new Error("missing channel labels property: "+r);if(a[r].labels.length!==a[r].channels)throw new Error("channel and label counts mismatch: "+r);var o=a[r].channels,s=a[r].labels;delete a[r].channels,delete a[r].labels,Object.defineProperty(a[r],"channels",{value:o}),Object.defineProperty(a[r],"labels",{value:s})}a.rgb.hsl=function(t){var e,n,i=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(i,a,r),s=Math.max(i,a,r),l=s-o;return s===o?e=0:i===s?e=(a-r)/l:a===s?e=2+(r-i)/l:r===s&&(e=4+(i-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(o+s)/2,[e,100*(s===o?0:n<=.5?l/(s+o):l/(2-s-o)),100*n]},a.rgb.hsv=function(t){var e,n,i,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,u=Math.max(o,s,l),d=u-Math.min(o,s,l),h=function(t){return(u-t)/6/d+.5};return 0===d?a=r=0:(r=d/u,e=h(o),n=h(s),i=h(l),o===u?a=i-n:s===u?a=1/3+e-i:l===u&&(a=2/3+n-e),a<0?a+=1:a>1&&(a-=1)),[360*a,100*r,100*u]},a.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},a.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-a)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-a-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var i=n[t];if(i)return i;var a,r,o,s=1/0;for(var l in e)if(e.hasOwnProperty(l)){var u=e[l],d=(r=t,o=u,Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2)+Math.pow(r[2]-o[2],2));d<s&&(s=d,a=l)}return a},a.keyword.rgb=function(t){return e[t]},a.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},a.hsl.rgb=function(t){var e,n,i,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-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a},a.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,a=n,r=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,a*=r<=1?r:2-r,[e,100*(0===i?2*a/(r+a):2*n/(i+n)),100*((i+n)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r));switch(i*=255,a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},a.hsv.hsl=function(t){var e,n,i,a=t[0],r=t[1]/100,o=t[2]/100,s=Math.max(o,.01);return i=(2-r)*o,n=r*s,[a,100*(n=(n/=(e=(2-r)*s)<=1?e:2-e)||0),100*(i/=2)]},a.hwb.rgb=function(t){var e,n,i,a,r,o,s,l=t[0]/360,u=t[1]/100,d=t[2]/100,h=u+d;switch(h>1&&(u/=h,d/=h),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),a=u+i*((n=1-d)-u),e){default:case 6:case 0:r=n,o=a,s=u;break;case 1:r=a,o=n,s=u;break;case 2:r=u,o=n,s=a;break;case 3:r=u,o=a,s=n;break;case 4:r=a,o=u,s=n;break;case 5:r=n,o=u,s=a}return[255*r,255*o,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,a=t[3]/100;return[255*(1-Math.min(1,e*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a)),255*(1-Math.min(1,i*(1-a)+a))]},a.xyz.rgb=function(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return n=-.9689*a+1.8758*r+.0415*o,i=.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:12.92*e,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},a.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.lab.xyz=function(t){var e,n,i,a=t[0];e=t[1]/500+(n=(a+16)/116),i=n-t[2]/200;var r=Math.pow(n,3),o=Math.pow(e,3),s=Math.pow(i,3);return n=r>.008856?r:(n-16/116)/7.787,e=o>.008856?o:(e-16/116)/7.787,i=s>.008856?s:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},a.lab.lch=function(t){var e,n=t[0],i=t[1],a=t[2];return(e=360*Math.atan2(a,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+a*a),e]},a.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},a.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,a=t[2]/255,r=Math.max(Math.max(n,i),a),o=Math.min(Math.min(n,i),a),s=r-o;return e=s<=0?0:r===n?(i-a)/s%6:r===i?2+(a-n)/s:4+(n-i)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},a.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,a=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(a=(n-.5*i)/(1-i)),[t[0],100*i,100*a]},a.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-n)*i,[255*(n*r[0]+a),255*(n*r[1]+a),255*(n*r[2]+a)]},a.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},a.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},a.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},a.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,a=0;return i<1&&(a=(n-i)/(1-i)),[t[0],100*i,100*a]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}));n.rgb,n.hsl,n.hsv,n.hwb,n.cmyk,n.xyz,n.lab,n.lch,n.hex,n.keyword,n.ansi16,n.ansi256,n.hcg,n.apple,n.gray;function i(t){var e=function(){for(var t={},e=Object.keys(n),i=e.length,a=0;a<i;a++)t[e[a]]={distance:-1,parent:null};return t}(),i=[t];for(e[t].distance=0;i.length;)for(var a=i.pop(),r=Object.keys(n[a]),o=r.length,s=0;s<o;s++){var l=r[s],u=e[l];-1===u.distance&&(u.distance=e[a].distance+1,u.parent=a,i.unshift(l))}return e}function a(t,e){return function(n){return e(t(n))}}function r(t,e){for(var i=[e[t].parent,t],r=n[e[t].parent][t],o=e[t].parent;e[o].parent;)i.unshift(e[o].parent),r=a(n[e[o].parent][o],r),o=e[o].parent;return r.conversion=i,r}var o={};Object.keys(n).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:n[t].channels}),Object.defineProperty(o[t],"labels",{value:n[t].labels});var e=function(t){for(var e=i(t),n={},a=Object.keys(e),o=a.length,s=0;s<o;s++){var l=a[s];null!==e[l].parent&&(n[l]=r(l,e))}return n}(t);Object.keys(e).forEach((function(n){var i=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,a=0;a<i;a++)n[a]=Math.round(n[a]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),o[t][n].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)}))}));var s=o,l={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]},u={getRgba:d,getHsla:h,getRgb:function(t){var e=d(t);return e&&e.slice(0,3)},getHsl:function(t){var e=h(t);return e&&e.slice(0,3)},getHwb:c,getAlpha:function(t){var e=d(t);if(e)return e[3];if(e=h(t))return e[3];if(e=c(t))return e[3]},hexString:function(t,e){e=void 0!==e&&3===t.length?e:t[3];return"#"+v(t[0])+v(t[1])+v(t[2])+(e>=0&&e<1?v(Math.round(255*e)):"")},rgbString:function(t,e){if(e<1||t[3]&&t[3]<1)return f(t,e);return"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:f,percentString:function(t,e){if(e<1||t[3]&&t[3]<1)return g(t,e);var n=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),a=Math.round(t[2]/255*100);return"rgb("+n+"%, "+i+"%, "+a+"%)"},percentaString:g,hslString:function(t,e){if(e<1||t[3]&&t[3]<1)return p(t,e);return"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:p,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 b[t.slice(0,3)]}};function d(t){if(t){var e=[0,0,0],n=1,i=t.match(/^#([a-fA-F0-9]{3,4})$/i),a="";if(i){a=(i=i[1])[3];for(var r=0;r<e.length;r++)e[r]=parseInt(i[r]+i[r],16);a&&(n=Math.round(parseInt(a+a,16)/255*100)/100)}else if(i=t.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){a=i[2],i=i[1];for(r=0;r<e.length;r++)e[r]=parseInt(i.slice(2*r,2*r+2),16);a&&(n=Math.round(parseInt(a,16)/255*100)/100)}else if(i=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(i[r+1]);n=parseFloat(i[4])}else if(i=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(i[r+1]));n=parseFloat(i[4])}else if(i=t.match(/(\w+)/)){if("transparent"==i[1])return[0,0,0,0];if(!(e=l[i[1]]))return}for(r=0;r<e.length;r++)e[r]=m(e[r],0,255);return n=n||0==n?m(n,0,1):1,e[3]=n,e}}function h(t){if(t){var e=t.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function c(t){if(t){var e=t.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(e){var n=parseFloat(e[4]);return[m(parseInt(e[1]),0,360),m(parseFloat(e[2]),0,100),m(parseFloat(e[3]),0,100),m(isNaN(n)?1:n,0,1)]}}}function f(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function g(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 p(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function m(t,e,n){return Math.min(Math.max(e,t),n)}function v(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var b={};for(var x in l)b[l[x]]=x;var y=function(t){return t instanceof y?t:this instanceof y?(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=u.getRgba(t))?this.setValues("rgb",e):(e=u.getHsla(t))?this.setValues("hsl",e):(e=u.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 y(t);var e};y.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 u.hexString(this.values.rgb)},rgbString:function(){return u.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return u.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return u.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return u.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return u.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return u.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return u.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=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.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,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=t,i=void 0===e?.5:e,a=2*i-1,r=this.alpha()-n.alpha(),o=((a*r==-1?a:(a+r)/(1+a*r))+1)/2,s=1-o;return this.rgb(o*this.red()+s*n.red(),o*this.green()+s*n.green(),o*this.blue()+s*n.blue()).alpha(this.alpha()*i+n.alpha()*(1-i))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new y,i=this.values,a=n.values;for(var r in i)i.hasOwnProperty(r)&&(t=i[r],"[object Array]"===(e={}.toString.call(t))?a[r]=t.slice(0):"[object Number]"===e?a[r]=t:console.error("unexpected color value:",t));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},y.prototype.setValues=function(t,e){var n,i,a=this.values,r=this.spaces,o=this.maxes,l=1;if(this.valid=!0,"alpha"===t)l=e;else if(e.length)a[t]=e.slice(0,t.length),l=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];l=e.a}else if(void 0!==e[r[t][0]]){var u=r[t];for(n=0;n<t.length;n++)a[t][n]=e[u[n]];l=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===l?a.alpha:l)),"alpha"===t)return!1;for(n=0;n<t.length;n++)i=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(i);for(var d in r)d!==t&&(a[d]=s[t][d](a[t]));return!0},y.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},y.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:(n===i[e]||(i[e]=n,this.setValues(t,i)),this)},"undefined"!=typeof window&&(window.Color=y);var _=y;function k(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}var w,M={noop:function(){},uid:(w=0,function(){return w++}),isNullOrUndef:function(t){return null==t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,n){return M.valueOrDefault(M.isArray(t)?t[e]:t,n)},callback:function(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)},each:function(t,e,n,i){var a,r,o;if(M.isArray(t))if(r=t.length,i)for(a=r-1;a>=0;a--)e.call(n,t[a],a);else for(a=0;a<r;a++)e.call(n,t[a],a);else if(M.isObject(t))for(r=(o=Object.keys(t)).length,a=0;a<r;a++)e.call(n,t[o[a]],o[a])},arrayEquals:function(t,e){var n,i,a,r;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(a=t[n],r=e[n],a instanceof Array&&r instanceof Array){if(!M.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},clone:function(t){if(M.isArray(t))return t.map(M.clone);if(M.isObject(t)){for(var e=Object.create(t),n=Object.keys(t),i=n.length,a=0;a<i;++a)e[n[a]]=M.clone(t[n[a]]);return e}return t},_merger:function(t,e,n,i){if(k(t)){var a=e[t],r=n[t];M.isObject(a)&&M.isObject(r)?M.merge(a,r,i):e[t]=M.clone(r)}},_mergerIf:function(t,e,n){if(k(t)){var i=e[t],a=n[t];M.isObject(i)&&M.isObject(a)?M.mergeIf(i,a):e.hasOwnProperty(t)||(e[t]=M.clone(a))}},merge:function(t,e,n){var i,a,r,o,s,l=M.isArray(e)?e:[e],u=l.length;if(!M.isObject(t))return t;for(i=(n=n||{}).merger||M._merger,a=0;a<u;++a)if(e=l[a],M.isObject(e))for(s=0,o=(r=Object.keys(e)).length;s<o;++s)i(r[s],t,e,n);return t},mergeIf:function(t,e){return M.merge(t,e,{merger:M._mergerIf})},extend:Object.assign||function(t){return M.merge(t,[].slice.call(arguments,1),{merger:function(t,e,n){e[t]=n[t]}})},inherits:function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=M.inherits,t&&M.extend(n.prototype,t),n.__super__=e.prototype,n},_deprecated:function(t,e,n,i){void 0!==e&&console.warn(t+': "'+n+'" is deprecated. Please use "'+i+'" instead')}},S=M;M.callCallback=M.callback,M.indexOf=function(t,e,n){return Array.prototype.indexOf.call(t,e,n)},M.getValueOrDefault=M.valueOrDefault,M.getValueAtIndexOrDefault=M.valueAtIndexOrDefault;var C={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,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n))},easeOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1===t?1:(n||(n=.3),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},easeInOutElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:2==(t/=.5)?1:(n||(n=.45),i<1?(i=1,e=n/4):e=n/(2*Math.PI)*Math.asin(1/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-C.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*C.easeInBounce(2*t):.5*C.easeOutBounce(2*t-1)+.5}},P={effects:C};S.easingEffects=C;var A=Math.PI,D=A/180,T=2*A,I=A/2,F=A/4,O=2*A/3,L={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,n,i,a,r){if(r){var o=Math.min(r,a/2,i/2),s=e+o,l=n+o,u=e+i-o,d=n+a-o;t.moveTo(e,l),s<u&&l<d?(t.arc(s,l,o,-A,-I),t.arc(u,l,o,-I,0),t.arc(u,d,o,0,I),t.arc(s,d,o,I,A)):s<u?(t.moveTo(s,n),t.arc(u,l,o,-I,I),t.arc(s,l,o,I,A+I)):l<d?(t.arc(s,l,o,-A,0),t.arc(s,d,o,0,A)):t.arc(s,l,o,-A,A),t.closePath(),t.moveTo(e,n)}else t.rect(e,n,i,a)},drawPoint:function(t,e,n,i,a,r){var o,s,l,u,d,h=(r||0)*D;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return t.save(),t.translate(i,a),t.rotate(h),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(n)||n<=0)){switch(t.beginPath(),e){default:t.arc(i,a,n,0,T),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=O,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),h+=O,t.lineTo(i+Math.sin(h)*n,a-Math.cos(h)*n),t.closePath();break;case"rectRounded":u=n-(d=.516*n),s=Math.cos(h+F)*u,l=Math.sin(h+F)*u,t.arc(i-s,a-l,d,h-A,h-I),t.arc(i+l,a-s,d,h-I,h),t.arc(i+s,a+l,d,h,h+I),t.arc(i-l,a+s,d,h+I,h+A),t.closePath();break;case"rect":if(!r){u=Math.SQRT1_2*n,t.rect(i-u,a-u,2*u,2*u);break}h+=F;case"rectRot":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+l,a-s),t.lineTo(i+s,a+l),t.lineTo(i-l,a+s),t.closePath();break;case"crossRot":h+=F;case"cross":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"star":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s),h+=F,s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l),t.moveTo(i+l,a-s),t.lineTo(i-l,a+s);break;case"line":s=Math.cos(h)*n,l=Math.sin(h)*n,t.moveTo(i-s,a-l),t.lineTo(i+s,a+l);break;case"dash":t.moveTo(i,a),t.lineTo(i+Math.cos(h)*n,a+Math.sin(h)*n)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},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,n,i){var a=n.steppedLine;if(a){if("middle"===a){var r=(e.x+n.x)/2;t.lineTo(r,i?n.y:e.y),t.lineTo(r,i?e.y:n.y)}else"after"===a&&!i||"after"!==a&&i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}else n.tension?t.bezierCurveTo(i?e.controlPointPreviousX:e.controlPointNextX,i?e.controlPointPreviousY:e.controlPointNextY,i?n.controlPointNextX:n.controlPointPreviousX,i?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):t.lineTo(n.x,n.y)}},R=L;S.clear=L.clear,S.drawRoundedRectangle=function(t){t.beginPath(),L.roundedRect.apply(L,arguments)};var z={_set:function(t,e){return S.merge(this[t]||(this[t]={}),e)}};z._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var N=z,B=S.valueOrDefault;var E={toLineHeight:function(t,e){var n=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,n,i,a;return S.isObject(t)?(e=+t.top||0,n=+t.right||0,i=+t.bottom||0,a=+t.left||0):e=n=i=a=+t||0,{top:e,right:n,bottom:i,left:a,height:e+i,width:a+n}},_parseFont:function(t){var e=N.global,n=B(t.fontSize,e.defaultFontSize),i={family:B(t.fontFamily,e.defaultFontFamily),lineHeight:S.options.toLineHeight(B(t.lineHeight,e.defaultLineHeight),n),size:n,style:B(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return i.string=function(t){return!t||S.isNullOrUndef(t.size)||S.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(i),i},resolve:function(t,e,n,i){var a,r,o,s=!0;for(a=0,r=t.length;a<r;++a)if(void 0!==(o=t[a])&&(void 0!==e&&"function"==typeof o&&(o=o(e),s=!1),void 0!==n&&S.isArray(o)&&(o=o[n],s=!1),void 0!==o))return i&&!s&&(i.cacheable=!1),o}},W={_factorize:function(t){var e,n=[],i=Math.sqrt(t);for(e=1;e<i;e++)t%e==0&&(n.push(e),n.push(t/e));return i===(0|i)&&n.push(i),n.sort((function(t,e){return t-e})).pop(),n},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,n=Math.round(e);return t===Math.pow(10,n)?n:e}},V=W;S.log10=W.log10;var H=S,j=P,q=R,U=E,Y=V,$={getRtlAdapter:function(t,e,n){return t?function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,n):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},overrideTextDirection:function(t,e){var n,i;"ltr"!==e&&"rtl"!==e||(i=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)},restoreTextDirection:function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}};H.easing=j,H.canvas=q,H.options=U,H.math=Y,H.rtl=$;var G=function(t){H.extend(this,t),this.initialize.apply(this,arguments)};H.extend(G.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=H.extend({},t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,i=e._start,a=e._view;return n&&1!==t?(a||(a=e._view={}),i||(i=e._start={}),function(t,e,n,i){var a,r,o,s,l,u,d,h,c,f=Object.keys(n);for(a=0,r=f.length;a<r;++a)if(u=n[o=f[a]],e.hasOwnProperty(o)||(e[o]=u),(s=e[o])!==u&&"_"!==o[0]){if(t.hasOwnProperty(o)||(t[o]=s),(d=typeof u)===typeof(l=t[o]))if("string"===d){if((h=_(l)).valid&&(c=_(u)).valid){e[o]=c.mix(h,i).rgbString();continue}}else if(H.isFinite(l)&&H.isFinite(u)){e[o]=l+(u-l)*i;continue}e[o]=u}}(i,a,n,t),e):(e._view=H.extend({},n),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return H.isNumber(this._model.x)&&H.isNumber(this._model.y)}}),G.extend=H.inherits;var X=G,K=X.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),Z=K;Object.defineProperty(K.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(K.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),N._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:H.noop,onComplete:H.noop}});var J={animations:[],request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=n,i||(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=H.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=H.requestAnimFrame.call(window,(function(){t.request=null,t.startDigest()})))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var t,e,n,i,a=this.animations,r=0;r<a.length;)e=(t=a[r]).chart,n=t.numSteps,i=Math.floor((Date.now()-t.startTime)/t.duration*n)+1,t.currentStep=Math.min(i,n),H.callback(t.render,[e,t],e),H.callback(t.onAnimationProgress,[t],e),t.currentStep>=n?(H.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},Q=H.options.resolve,tt=["push","pop","shift","splice","unshift"];function et(t,e){var n=t._chartjs;if(n){var i=n.listeners,a=i.indexOf(e);-1!==a&&i.splice(a,1),i.length>0||(tt.forEach((function(e){delete t[e]})),delete t._chartjs)}}var nt=function(t,e){this.initialize(t,e)};H.extend(nt.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this.getMeta(),e=this.chart,n=e.scales,i=this.getDataset(),a=e.options.scales;null!==t.xAxisID&&t.xAxisID in n&&!i.xAxisID||(t.xAxisID=i.xAxisID||a.xAxes[0].id),null!==t.yAxisID&&t.yAxisID in n&&!i.yAxisID||(t.yAxisID=i.yAxisID||a.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]},_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())},reset:function(){this._update(!0)},destroy:function(){this._data&&et(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,n=this.getMeta(),i=this.getDataset().data||[],a=n.data;for(t=0,e=i.length;t<e;++t)a[t]=a[t]||this.createMetaData(t);n.dataset=n.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,e,n=this,i=n.getDataset(),a=i.data||(i.data=[]);n._data!==a&&(n._data&&et(n._data,n),a&&Object.isExtensible(a)&&(e=n,(t=a)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),tt.forEach((function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),i=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),a=i.apply(this,e);return H.each(t._chartjs.listeners,(function(t){"function"==typeof t[n]&&t[n].apply(t,e)})),a}})})))),n._data=a),n.resyncElements()},_configure:function(){this._config=H.merge(Object.create(null),[this.chart.options.datasets[this._type],this.getDataset()],{merger:function(t,e,n){"_meta"!==t&&"data"!==t&&H._merger(t,e,n)}})},_update:function(t){this._configure(),this._cachedDataOpts=null,this.update(t)},update:H.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},getStyle:function(t){var e,n=this.getMeta(),i=n.dataset;return this._configure(),i&&void 0===t?e=this._resolveDatasetElementOptions(i||{}):(t=t||0,e=this._resolveDataElementOptions(n.data[t]||{},t)),!1!==e.fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var n,i,a,r,o=this,s=o.chart,l=o._config,u=t.custom||{},d=s.options.elements[o.datasetElementType.prototype._type]||{},h=o._datasetElementOptions,c={},f={chart:s,dataset:o.getDataset(),datasetIndex:o.index,hover:e};for(n=0,i=h.length;n<i;++n)a=h[n],r=e?"hover"+a.charAt(0).toUpperCase()+a.slice(1):a,c[a]=Q([u[r],l[r],d[r]],f);return c},_resolveDataElementOptions:function(t,e){var n=this,i=t&&t.custom,a=n._cachedDataOpts;if(a&&!i)return a;var r,o,s,l,u=n.chart,d=n._config,h=u.options.elements[n.dataElementType.prototype._type]||{},c=n._dataElementOptions,f={},g={chart:u,dataIndex:e,dataset:n.getDataset(),datasetIndex:n.index},p={cacheable:!i};if(i=i||{},H.isArray(c))for(o=0,s=c.length;o<s;++o)f[l=c[o]]=Q([i[l],d[l],h[l]],g,e,p);else for(o=0,s=(r=Object.keys(c)).length;o<s;++o)f[l=r[o]]=Q([i[l],d[c[l]],d[l],h[l]],g,e,p);return p.cacheable&&(n._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){H.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,r=H.getHoverColor;t.$previousStyle={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderWidth:a.borderWidth},a.backgroundColor=Q([i.hoverBackgroundColor,e.hoverBackgroundColor,r(a.backgroundColor)],void 0,n),a.borderColor=Q([i.hoverBorderColor,e.hoverBorderColor,r(a.borderColor)],void 0,n),a.borderWidth=Q([i.hoverBorderWidth,e.hoverBorderWidth,a.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,n,i,a,r,o=this.getMeta().dataset,s={};if(o){for(r=o._model,a=this._resolveDatasetElementOptions(o,!0),t=0,e=(i=Object.keys(a)).length;t<e;++t)s[n=i[t]]=r[n],r[n]=a[n];o.$previousStyle=s}},resyncElements:function(){var t=this.getMeta(),e=this.getDataset().data,n=t.data.length,i=e.length;i<n?t.data.splice(i,n-i):i>n&&this.insertElements(n,i-n)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},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)}}),nt.extend=H.inherits;var it=nt,at=2*Math.PI;function rt(t,e){var n=e.startAngle,i=e.endAngle,a=e.pixelMargin,r=a/e.outerRadius,o=e.x,s=e.y;t.beginPath(),t.arc(o,s,e.outerRadius,n-r,i+r),e.innerRadius>a?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,i+r,n-r,!0)):t.arc(o,s,a,i+Math.PI/2,n-Math.PI/2),t.closePath(),t.clip()}function ot(t,e,n){var i="inner"===e.borderAlign;i?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),n.fullCircles&&function(t,e,n,i){var a,r=n.endAngle;for(i&&(n.endAngle=n.startAngle+at,rt(t,n),n.endAngle=r,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=at,n.fullCircles--)),t.beginPath(),t.arc(n.x,n.y,n.innerRadius,n.startAngle+at,n.startAngle,!0),a=0;a<n.fullCircles;++a)t.stroke();for(t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.startAngle+at),a=0;a<n.fullCircles;++a)t.stroke()}(t,e,n,i),i&&rt(t,n),t.beginPath(),t.arc(n.x,n.y,e.outerRadius,n.startAngle,n.endAngle),t.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),t.closePath(),t.stroke()}N._set("global",{elements:{arc:{backgroundColor:N.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var st=X.extend({_type:"arc",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 n=this._view;if(n){for(var i=H.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,r=i.distance,o=n.startAngle,s=n.endAngle;s<o;)s+=at;for(;a>s;)a-=at;for(;a<o;)a+=at;var l=a>=o&&a<=s,u=r>=n.innerRadius&&r<=n.outerRadius;return l&&u}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},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,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t,e=this._chart.ctx,n=this._view,i="inner"===n.borderAlign?.33:0,a={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-i,0),pixelMargin:i,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/at)};if(e.save(),e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,a.fullCircles){for(a.endAngle=a.startAngle+at,e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),t=0;t<a.fullCircles;++t)e.fill();a.endAngle=a.startAngle+n.circumference%at}e.beginPath(),e.arc(a.x,a.y,a.outerRadius,a.startAngle,a.endAngle),e.arc(a.x,a.y,a.innerRadius,a.endAngle,a.startAngle,!0),e.closePath(),e.fill(),n.borderWidth&&ot(e,n,a),e.restore()}}),lt=H.valueOrDefault,ut=N.global.defaultColor;N._set("global",{elements:{line:{tension:.4,backgroundColor:ut,borderWidth:3,borderColor:ut,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var dt=X.extend({_type:"line",draw:function(){var t,e,n,i=this,a=i._view,r=i._chart.ctx,o=a.spanGaps,s=i._children.slice(),l=N.global,u=l.elements.line,d=-1,h=i._loop;if(s.length){if(i._loop){for(t=0;t<s.length;++t)if(e=H.previousItem(s,t),!s[t]._view.skip&&e._view.skip){s=s.slice(t).concat(s.slice(0,t)),h=o;break}h&&s.push(s[0])}for(r.save(),r.lineCap=a.borderCapStyle||u.borderCapStyle,r.setLineDash&&r.setLineDash(a.borderDash||u.borderDash),r.lineDashOffset=lt(a.borderDashOffset,u.borderDashOffset),r.lineJoin=a.borderJoinStyle||u.borderJoinStyle,r.lineWidth=lt(a.borderWidth,u.borderWidth),r.strokeStyle=a.borderColor||l.defaultColor,r.beginPath(),(n=s[0]._view).skip||(r.moveTo(n.x,n.y),d=0),t=1;t<s.length;++t)n=s[t]._view,e=-1===d?H.previousItem(s,t):s[d],n.skip||(d!==t-1&&!o||-1===d?r.moveTo(n.x,n.y):H.canvas.lineTo(r,e._view,n),d=t);h&&r.closePath(),r.stroke(),r.restore()}}}),ht=H.valueOrDefault,ct=N.global.defaultColor;function ft(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:ct,borderColor:ct,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var gt=X.extend({_type:"point",inRange:function(t,e){var n=this._view;return!!n&&Math.pow(t-n.x,2)+Math.pow(e-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:ft,inXRange:ft,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,n=this._chart.ctx,i=e.pointStyle,a=e.rotation,r=e.radius,o=e.x,s=e.y,l=N.global,u=l.defaultColor;e.skip||(void 0===t||H.canvas._isPointInArea(e,t))&&(n.strokeStyle=e.borderColor||u,n.lineWidth=ht(e.borderWidth,l.elements.point.borderWidth),n.fillStyle=e.backgroundColor||u,H.canvas.drawPoint(n,i,r,o,s,a))}}),pt=N.global.defaultColor;function mt(t){return t&&void 0!==t.width}function vt(t){var e,n,i,a,r;return mt(t)?(r=t.width/2,e=t.x-r,n=t.x+r,i=Math.min(t.y,t.base),a=Math.max(t.y,t.base)):(r=t.height/2,e=Math.min(t.x,t.base),n=Math.max(t.x,t.base),i=t.y-r,a=t.y+r),{left:e,top:i,right:n,bottom:a}}function bt(t,e,n){return t===e?n:t===n?e:t}function xt(t,e,n){var i,a,r,o,s=t.borderWidth,l=function(t){var e=t.borderSkipped,n={};return e?(t.horizontal?t.base>t.x&&(e=bt(e,"left","right")):t.base<t.y&&(e=bt(e,"bottom","top")),n[e]=!0,n):n}(t);return H.isObject(s)?(i=+s.top||0,a=+s.right||0,r=+s.bottom||0,o=+s.left||0):i=a=r=o=+s||0,{t:l.top||i<0?0:i>n?n:i,r:l.right||a<0?0:a>e?e:a,b:l.bottom||r<0?0:r>n?n:r,l:l.left||o<0?0:o>e?e:o}}function yt(t,e,n){var i=null===e,a=null===n,r=!(!t||i&&a)&&vt(t);return r&&(i||e>=r.left&&e<=r.right)&&(a||n>=r.top&&n<=r.bottom)}N._set("global",{elements:{rectangle:{backgroundColor:pt,borderColor:pt,borderSkipped:"bottom",borderWidth:0}}});var _t=X.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,n=function(t){var e=vt(t),n=e.right-e.left,i=e.bottom-e.top,a=xt(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:i-a.t-a.b}}}(e),i=n.outer,a=n.inner;t.fillStyle=e.backgroundColor,t.fillRect(i.x,i.y,i.w,i.h),i.w===a.w&&i.h===a.h||(t.save(),t.beginPath(),t.rect(i.x,i.y,i.w,i.h),t.clip(),t.fillStyle=e.borderColor,t.rect(a.x,a.y,a.w,a.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return yt(this._view,t,e)},inLabelRange:function(t,e){var n=this._view;return mt(n)?yt(n,t,null):yt(n,null,e)},inXRange:function(t){return yt(this._view,t,null)},inYRange:function(t){return yt(this._view,null,t)},getCenterPoint:function(){var t,e,n=this._view;return mt(n)?(t=n.x,e=(n.y+n.base)/2):(t=(n.x+n.base)/2,e=n.y),{x:t,y:e}},getArea:function(){var t=this._view;return mt(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),kt={},wt=st,Mt=dt,St=gt,Ct=_t;kt.Arc=wt,kt.Line=Mt,kt.Point=St,kt.Rectangle=Ct;var Pt=H._deprecated,At=H.valueOrDefault;function Dt(t,e,n){var i,a,r=n.barThickness,o=e.stackCount,s=e.pixels[t],l=H.isNullOrUndef(r)?function(t,e){var n,i,a,r,o=t._length;for(a=1,r=e.length;a<r;++a)o=Math.min(o,Math.abs(e[a]-e[a-1]));for(a=0,r=t.getTicks().length;a<r;++a)i=t.getPixelForTick(a),o=a>0?Math.min(o,Math.abs(i-n)):o,n=i;return o}(e.scale,e.pixels):-1;return H.isNullOrUndef(r)?(i=l*n.categoryPercentage,a=n.barPercentage):(i=r*o,a=1),{chunk:i/o,ratio:a,start:s-i/2}}N._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),N._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var Tt=it.extend({dataElementType:kt.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,n=this;it.prototype.initialize.apply(n,arguments),(t=n.getMeta()).stack=n.getDataset().stack,t.bar=!0,e=n._getIndexScale().options,Pt("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),Pt("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),Pt("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),Pt("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),Pt("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,n,i=this.getMeta().data;for(this._ruler=this.getRuler(),e=0,n=i.length;e<n;++e)this.updateElement(i[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=i.getDataset(),o=i._resolveDataElementOptions(t,e);t._xScale=i.getScaleForId(a.xAxisID),t._yScale=i.getScaleForId(a.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={backgroundColor:o.backgroundColor,borderColor:o.borderColor,borderSkipped:o.borderSkipped,borderWidth:o.borderWidth,datasetLabel:r.label,label:i.chart.data.labels[e]},H.isArray(r.data[e])&&(t._model.borderSkipped=null),i._updateElementGeometry(t,e,n,o),t.pivot()},_updateElementGeometry:function(t,e,n,i){var a=this,r=t._model,o=a._getValueScale(),s=o.getBasePixel(),l=o.isHorizontal(),u=a._ruler||a.getRuler(),d=a.calculateBarValuePixels(a.index,e,i),h=a.calculateBarIndexPixels(a.index,e,u,i);r.horizontal=l,r.base=n?s:d.base,r.x=l?n?s:d.head:h.center,r.y=l?h.center:n?s:d.head,r.height=l?h.size:void 0,r.width=l?void 0:h.size},_getStacks:function(t){var e,n,i=this._getIndexScale(),a=i._getMatchingVisibleMetas(this._type),r=i.options.stacked,o=a.length,s=[];for(e=0;e<o&&(n=a[e],(!1===r||-1===s.indexOf(n.stack)||void 0===r&&void 0===n.stack)&&s.push(n.stack),n.index!==t);++e);return s},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var n=this._getStacks(t),i=void 0!==e?n.indexOf(e):-1;return-1===i?n.length-1:i},getRuler:function(){var t,e,n=this._getIndexScale(),i=[];for(t=0,e=this.getMeta().data.length;t<e;++t)i.push(n.getPixelForValue(null,t,this.index));return{pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this.getStackCount(),scale:n}},calculateBarValuePixels:function(t,e,n){var i,a,r,o,s,l,u,d=this.chart,h=this._getValueScale(),c=h.isHorizontal(),f=d.data.datasets,g=h._getMatchingVisibleMetas(this._type),p=h._parseValue(f[t].data[e]),m=n.minBarLength,v=h.options.stacked,b=this.getMeta().stack,x=void 0===p.start?0:p.max>=0&&p.min>=0?p.min:p.max,y=void 0===p.start?p.end:p.max>=0&&p.min>=0?p.max-p.min:p.min-p.max,_=g.length;if(v||void 0===v&&void 0!==b)for(i=0;i<_&&(a=g[i]).index!==t;++i)a.stack===b&&(r=void 0===(u=h._parseValue(f[a.index].data[e])).start?u.end:u.min>=0&&u.max>=0?u.max:u.min,(p.min<0&&r<0||p.max>=0&&r>0)&&(x+=r));return o=h.getPixelForValue(x),l=(s=h.getPixelForValue(x+y))-o,void 0!==m&&Math.abs(l)<m&&(l=m,s=y>=0&&!c||y<0&&c?o-m:o+m),{size:l,base:o,head:s,center:s+l/2}},calculateBarIndexPixels:function(t,e,n,i){var a="flex"===i.barThickness?function(t,e,n){var i,a=e.pixels,r=a[t],o=t>0?a[t-1]:null,s=t<a.length-1?a[t+1]:null,l=n.categoryPercentage;return null===o&&(o=r-(null===s?e.end-e.start:s-r)),null===s&&(s=r+r-o),i=r-(r-Math.min(o,s))/2*l,{chunk:Math.abs(s-o)/2*l/e.stackCount,ratio:n.barPercentage,start:i}}(e,n,i):Dt(e,n,i),r=this.getStackIndex(t,this.getMeta().stack),o=a.start+a.chunk*r+a.chunk/2,s=Math.min(At(i.maxBarThickness,1/0),a.chunk*a.ratio);return{base:o-s/2,head:o+s/2,center:o,size:s}},draw:function(){var t=this.chart,e=this._getValueScale(),n=this.getMeta().data,i=this.getDataset(),a=n.length,r=0;for(H.canvas.clipArea(t.ctx,t.chartArea);r<a;++r){var o=e._parseValue(i.data[r]);isNaN(o.min)||isNaN(o.max)||n[r].draw()}H.canvas.unclipArea(t.ctx)},_resolveDataElementOptions:function(){var t=this,e=H.extend({},it.prototype._resolveDataElementOptions.apply(t,arguments)),n=t._getIndexScale().options,i=t._getValueScale().options;return e.barPercentage=At(n.barPercentage,e.barPercentage),e.barThickness=At(n.barThickness,e.barThickness),e.categoryPercentage=At(n.categoryPercentage,e.categoryPercentage),e.maxBarThickness=At(n.maxBarThickness,e.maxBarThickness),e.minBarLength=At(i.minBarLength,e.minBarLength),e}}),It=H.valueOrDefault,Ft=H.options.resolve;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 n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}});var Ot=it.extend({dataElementType:kt.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,n=e.getMeta().data;H.each(n,(function(n,i){e.updateElement(n,i,t)}))},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveDataElementOptions(t,e),u=i.getDataset().data[e],d=i.index,h=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),c=n?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,rotation:l.rotation,radius:n?0:l.radius,skip:r.skip||isNaN(h)||isNaN(c),x:h,y:c},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=It(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=It(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=It(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(t,e){var n=this,i=n.chart,a=n.getDataset(),r=t.custom||{},o=a.data[e]||{},s=it.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:i,dataIndex:e,dataset:a,datasetIndex:n.index};return n._cachedDataOpts===s&&(s=H.extend({},s)),s.radius=Ft([r.radius,o.r,n._config.radius,i.options.elements.point.radius],l,e),s}}),Lt=H.valueOrDefault,Rt=Math.PI,zt=2*Rt,Nt=Rt/2;N._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-Nt,circumference:zt,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return H.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}});var Bt=it.extend({dataElementType:kt.Arc,linkScales:H.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e,n,i,a,r=this,o=r.chart,s=o.chartArea,l=o.options,u=1,d=1,h=0,c=0,f=r.getMeta(),g=f.data,p=l.cutoutPercentage/100||0,m=l.circumference,v=r._getRingWeight(r.index);if(m<zt){var b=l.rotation%zt,x=(b+=b>=Rt?-zt:b<-Rt?zt:0)+m,y=Math.cos(b),_=Math.sin(b),k=Math.cos(x),w=Math.sin(x),M=b<=0&&x>=0||x>=zt,S=b<=Nt&&x>=Nt||x>=zt+Nt,C=b<=-Nt&&x>=-Nt||x>=Rt+Nt,P=b===-Rt||x>=Rt?-1:Math.min(y,y*p,k,k*p),A=C?-1:Math.min(_,_*p,w,w*p),D=M?1:Math.max(y,y*p,k,k*p),T=S?1:Math.max(_,_*p,w,w*p);u=(D-P)/2,d=(T-A)/2,h=-(D+P)/2,c=-(T+A)/2}for(i=0,a=g.length;i<a;++i)g[i]._options=r._resolveDataElementOptions(g[i],i);for(o.borderWidth=r.getMaxBorderWidth(),e=(s.right-s.left-o.borderWidth)/u,n=(s.bottom-s.top-o.borderWidth)/d,o.outerRadius=Math.max(Math.min(e,n)/2,0),o.innerRadius=Math.max(o.outerRadius*p,0),o.radiusLength=(o.outerRadius-o.innerRadius)/(r._getVisibleDatasetWeightTotal()||1),o.offsetX=h*o.outerRadius,o.offsetY=c*o.outerRadius,f.total=r.calculateTotal(),r.outerRadius=o.outerRadius-o.radiusLength*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-o.radiusLength*v,0),i=0,a=g.length;i<a;++i)r.updateElement(g[i],i,t)},updateElement:function(t,e,n){var i=this,a=i.chart,r=a.chartArea,o=a.options,s=o.animation,l=(r.left+r.right)/2,u=(r.top+r.bottom)/2,d=o.rotation,h=o.rotation,c=i.getDataset(),f=n&&s.animateRotate||t.hidden?0:i.calculateCircumference(c.data[e])*(o.circumference/zt),g=n&&s.animateScale?0:i.innerRadius,p=n&&s.animateScale?0:i.outerRadius,m=t._options||{};H.extend(t,{_datasetIndex:i.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+a.offsetX,y:u+a.offsetY,startAngle:d,endAngle:h,circumference:f,outerRadius:p,innerRadius:g,label:H.valueAtIndexOrDefault(c.label,e,a.data.labels[e])}});var v=t._model;n&&s.animateRotate||(v.startAngle=0===e?o.rotation:i.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return H.each(n.data,(function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))})),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?zt*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,n,i,a,r,o,s,l,u=0,d=this.chart;if(!t)for(e=0,n=d.data.datasets.length;e<n;++e)if(d.isDatasetVisible(e)){t=(i=d.getDatasetMeta(e)).data,e!==this.index&&(r=i.controller);break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)a=t[e],r?(r._configure(),o=r._resolveDataElementOptions(a,e)):o=a._options,"inner"!==o.borderAlign&&(s=o.borderWidth,u=(l=o.hoverBorderWidth)>(u=s>u?s:u)?l:u);return u},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=Lt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Lt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Lt(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e},_getRingWeight:function(t){return Math.max(Lt(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});N._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),N._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Et=Tt.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),Wt=H.valueOrDefault,Vt=H.options.resolve,Ht=H.canvas._isPointInArea;function jt(t,e){var n=t&&t.options.ticks||{},i=n.reverse,a=void 0===n.min?e:0,r=void 0===n.max?e:0;return{start:i?r:a,end:i?a:r}}function qt(t,e,n){var i=n/2,a=jt(t,i),r=jt(e,i);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Ut(t){var e,n,i,a;return H.isObject(t)?(e=t.top,n=t.right,i=t.bottom,a=t.left):e=n=i=a=t,{top:e,right:n,bottom:i,left:a}}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"}]}});var Yt=it.extend({datasetElementType:kt.Line,dataElementType:kt.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.options,l=i._config,u=i._showLine=Wt(l.showLine,s.showLines);for(i._xScale=i.getScaleForId(a.xAxisID),i._yScale=i.getScaleForId(a.yAxisID),u&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=i._yScale,r._datasetIndex=i.index,r._children=o,r._model=i._resolveDatasetElementOptions(r),r.pivot()),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(u&&0!==r._model.tension&&i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i,a,r=this,o=r.getMeta(),s=t.custom||{},l=r.getDataset(),u=r.index,d=l.data[e],h=r._xScale,c=r._yScale,f=o.dataset._model,g=r._resolveDataElementOptions(t,e);i=h.getPixelForValue("object"==typeof d?d:NaN,e,u),a=n?c.getBasePixel():r.calculatePointY(d,e,u),t._xScale=h,t._yScale=c,t._options=g,t._datasetIndex=u,t._index=e,t._model={x:i,y:a,skip:s.skip||isNaN(i)||isNaN(a),radius:g.radius,pointStyle:g.pointStyle,rotation:g.rotation,backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,tension:Wt(s.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:g.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,n=e._config,i=t.custom||{},a=e.chart.options,r=a.elements.line,o=it.prototype._resolveDatasetElementOptions.apply(e,arguments);return o.spanGaps=Wt(n.spanGaps,a.spanGaps),o.tension=Wt(n.lineTension,r.tension),o.steppedLine=Vt([i.steppedLine,n.steppedLine,r.stepped]),o.clip=Ut(Wt(n.clip,qt(e._xScale,e._yScale,o.borderWidth))),o},calculatePointY:function(t,e,n){var i,a,r,o,s,l,u,d=this.chart,h=this._yScale,c=0,f=0;if(h.options.stacked){for(s=+h.getRightValue(t),u=(l=d._getSortedVisibleDatasetMetas()).length,i=0;i<u&&(r=l[i]).index!==n;++i)a=d.data.datasets[r.index],"line"===r.type&&r.yAxisID===h.id&&((o=+h.getRightValue(a.data[e]))<0?f+=o||0:c+=o||0);return s<0?h.getPixelForValue(f+s):h.getPixelForValue(c+s)}return h.getPixelForValue(t)},updateBezierControlPoints:function(){var t,e,n,i,a=this.chart,r=this.getMeta(),o=r.dataset._model,s=a.chartArea,l=r.data||[];function u(t,e,n){return Math.max(Math.min(t,n),e)}if(o.spanGaps&&(l=l.filter((function(t){return!t._model.skip}))),"monotone"===o.cubicInterpolationMode)H.splineCurveMonotone(l);else for(t=0,e=l.length;t<e;++t)n=l[t]._model,i=H.splineCurve(H.previousItem(l,t)._model,n,H.nextItem(l,t)._model,o.tension),n.controlPointPreviousX=i.previous.x,n.controlPointPreviousY=i.previous.y,n.controlPointNextX=i.next.x,n.controlPointNextY=i.next.y;if(a.options.elements.line.capBezierPoints)for(t=0,e=l.length;t<e;++t)n=l[t]._model,Ht(n,s)&&(t>0&&Ht(l[t-1]._model,s)&&(n.controlPointPreviousX=u(n.controlPointPreviousX,s.left,s.right),n.controlPointPreviousY=u(n.controlPointPreviousY,s.top,s.bottom)),t<l.length-1&&Ht(l[t+1]._model,s)&&(n.controlPointNextX=u(n.controlPointNextX,s.left,s.right),n.controlPointNextY=u(n.controlPointNextY,s.top,s.bottom)))},draw:function(){var t,e=this.chart,n=this.getMeta(),i=n.data||[],a=e.chartArea,r=e.canvas,o=0,s=i.length;for(this._showLine&&(t=n.dataset._model.clip,H.canvas.clipArea(e.ctx,{left:!1===t.left?0:a.left-t.left,right:!1===t.right?r.width:a.right+t.right,top:!1===t.top?0:a.top-t.top,bottom:!1===t.bottom?r.height:a.bottom+t.bottom}),n.dataset.draw(),H.canvas.unclipArea(e.ctx));o<s;++o)i[o].draw(a)},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Wt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Wt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Wt(n.hoverBorderWidth,n.borderWidth),e.radius=Wt(n.hoverRadius,n.radius)}}),$t=H.options.resolve;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,n,i,a=document.createElement("ul"),r=t.data,o=r.datasets,s=r.labels;if(a.setAttribute("class",t.id+"-legend"),o.length)for(e=0,n=o[0].data.length;e<n;++e)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=o[0].backgroundColor[e],s[e]&&i.appendChild(document.createTextNode(s[e]));return a.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map((function(n,i){var a=t.getDatasetMeta(0),r=a.controller.getStyle(i);return{text:n,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,hidden:isNaN(e.datasets[0].data[i])||a.data[i].hidden,index:i}})):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).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}}}});var Gt=it.extend({dataElementType:kt.Arc,linkScales:H.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i,a=this,r=a.getDataset(),o=a.getMeta(),s=a.chart.options.startAngle||0,l=a._starts=[],u=a._angles=[],d=o.data;for(a._updateRadius(),o.count=a.countVisibleElements(),e=0,n=r.data.length;e<n;e++)l[e]=s,i=a._computeAngle(e),u[e]=i,s+=i;for(e=0,n=d.length;e<n;++e)d[e]._options=a._resolveDataElementOptions(d[e],e),a.updateElement(d[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,n=e.chartArea,i=e.options,a=Math.min(n.right-n.left,n.bottom-n.top);e.outerRadius=Math.max(a/2,0),e.innerRadius=Math.max(i.cutoutPercentage?e.outerRadius/100*i.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,n){var i=this,a=i.chart,r=i.getDataset(),o=a.options,s=o.animation,l=a.scale,u=a.data.labels,d=l.xCenter,h=l.yCenter,c=o.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(r.data[e]),g=i._starts[e],p=g+(t.hidden?0:i._angles[e]),m=s.animateScale?0:l.getDistanceFromCenterForValue(r.data[e]),v=t._options||{};H.extend(t,{_datasetIndex:i.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:d,y:h,innerRadius:0,outerRadius:n?m:f,startAngle:n&&s.animateRotate?c:g,endAngle:n&&s.animateRotate?c:p,label:H.valueAtIndexOrDefault(u,e,u[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return H.each(e.data,(function(e,i){isNaN(t.data[i])||e.hidden||n++})),n},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor,a=H.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=a(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=a(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=a(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(t){var e=this,n=this.getMeta().count,i=e.getDataset(),a=e.getMeta();if(isNaN(i.data[t])||a.data[t].hidden)return 0;var r={chart:e.chart,dataIndex:t,dataset:i,datasetIndex:e.index};return $t([e.chart.options.elements.arc.angle,2*Math.PI/n],r,t)}});N._set("pie",H.clone(N.doughnut)),N._set("pie",{cutoutPercentage:0});var Xt=Bt,Kt=H.valueOrDefault;N._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Zt=it.extend({datasetElementType:kt.Line,dataElementType:kt.Point,linkScales:H.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,n,i=this,a=i.getMeta(),r=a.dataset,o=a.data||[],s=i.chart.scale,l=i._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),r._scale=s,r._datasetIndex=i.index,r._children=o,r._loop=!0,r._model=i._resolveDatasetElementOptions(r),r.pivot(),e=0,n=o.length;e<n;++e)i.updateElement(o[e],e,t);for(i.updateBezierControlPoints(),e=0,n=o.length;e<n;++e)o[e].pivot()},updateElement:function(t,e,n){var i=this,a=t.custom||{},r=i.getDataset(),o=i.chart.scale,s=o.getPointPositionForValue(e,r.data[e]),l=i._resolveDataElementOptions(t,e),u=i.getMeta().dataset._model,d=n?o.xCenter:s.x,h=n?o.yCenter:s.y;t._scale=o,t._options=l,t._datasetIndex=i.index,t._index=e,t._model={x:d,y:h,skip:a.skip||isNaN(d)||isNaN(h),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Kt(a.tension,u?u.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,n=t.chart.options,i=it.prototype._resolveDatasetElementOptions.apply(t,arguments);return i.spanGaps=Kt(e.spanGaps,n.spanGaps),i.tension=Kt(e.lineTension,n.elements.line.tension),i},updateBezierControlPoints:function(){var t,e,n,i,a=this.getMeta(),r=this.chart.chartArea,o=a.data||[];function s(t,e,n){return Math.max(Math.min(t,n),e)}for(a.dataset._model.spanGaps&&(o=o.filter((function(t){return!t._model.skip}))),t=0,e=o.length;t<e;++t)n=o[t]._model,i=H.splineCurve(H.previousItem(o,t,!0)._model,n,H.nextItem(o,t,!0)._model,n.tension),n.controlPointPreviousX=s(i.previous.x,r.left,r.right),n.controlPointPreviousY=s(i.previous.y,r.top,r.bottom),n.controlPointNextX=s(i.next.x,r.left,r.right),n.controlPointNextY=s(i.next.y,r.top,r.bottom)},setHoverStyle:function(t){var e=t._model,n=t._options,i=H.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=Kt(n.hoverBackgroundColor,i(n.backgroundColor)),e.borderColor=Kt(n.hoverBorderColor,i(n.borderColor)),e.borderWidth=Kt(n.hoverBorderWidth,n.borderWidth),e.radius=Kt(n.hoverRadius,n.radius)}});N._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),N._set("global",{datasets:{scatter:{showLine:!1}}});var Jt={bar:Tt,bubble:Ot,doughnut:Bt,horizontalBar:Et,line:Yt,polarArea:Gt,pie:Xt,radar:Zt,scatter:Yt};function Qt(t,e){return t.native?{x:t.x,y:t.y}:H.getRelativePosition(t,e)}function te(t,e){var n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas();for(i=0,r=l.length;i<r;++i)for(a=0,o=(n=l[i].data).length;a<o;++a)(s=n[a])._view.skip||e(s)}function ee(t,e){var n=[];return te(t,(function(t){t.inRange(e.x,e.y)&&n.push(t)})),n}function ne(t,e,n,i){var a=Number.POSITIVE_INFINITY,r=[];return te(t,(function(t){if(!n||t.inRange(e.x,e.y)){var o=t.getCenterPoint(),s=i(e,o);s<a?(r=[t],a=s):s===a&&r.push(t)}})),r}function ie(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function ae(t,e,n){var i=Qt(e,t);n.axis=n.axis||"x";var a=ie(n.axis),r=n.intersect?ee(t,i):ne(t,i,!1,a),o=[];return r.length?(t._getSortedVisibleDatasetMetas().forEach((function(t){var e=t.data[r[0]._index];e&&!e._view.skip&&o.push(e)})),o):[]}var re={modes:{single:function(t,e){var n=Qt(e,t),i=[];return te(t,(function(t){if(t.inRange(n.x,n.y))return i.push(t),i})),i.slice(0,1)},label:ae,index:ae,dataset:function(t,e,n){var i=Qt(e,t);n.axis=n.axis||"xy";var a=ie(n.axis),r=n.intersect?ee(t,i):ne(t,i,!1,a);return r.length>0&&(r=t.getDatasetMeta(r[0]._datasetIndex).data),r},"x-axis":function(t,e){return ae(t,e,{intersect:!1})},point:function(t,e){return ee(t,Qt(e,t))},nearest:function(t,e,n){var i=Qt(e,t);n.axis=n.axis||"xy";var a=ie(n.axis);return ne(t,i,n.intersect,a)},x:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inXRange(i.x)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a},y:function(t,e,n){var i=Qt(e,t),a=[],r=!1;return te(t,(function(t){t.inYRange(i.y)&&a.push(t),t.inRange(i.x,i.y)&&(r=!0)})),n.intersect&&!r&&(a=[]),a}}},oe=H.extend;function se(t,e){return H.where(t,(function(t){return t.pos===e}))}function le(t,e){return t.sort((function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i.index-a.index:i.weight-a.weight}))}function ue(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function de(t,e,n){var i,a,r=n.box,o=t.maxPadding;if(n.size&&(t[n.pos]-=n.size),n.size=n.horizontal?r.height:r.width,t[n.pos]+=n.size,r.getPadding){var s=r.getPadding();o.top=Math.max(o.top,s.top),o.left=Math.max(o.left,s.left),o.bottom=Math.max(o.bottom,s.bottom),o.right=Math.max(o.right,s.right)}if(i=e.outerWidth-ue(o,t,"left","right"),a=e.outerHeight-ue(o,t,"top","bottom"),i!==t.w||a!==t.h){t.w=i,t.h=a;var l=n.horizontal?[i,t.w]:[a,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function he(t,e){var n=e.maxPadding;function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function ce(t,e,n){var i,a,r,o,s,l,u=[];for(i=0,a=t.length;i<a;++i)(o=(r=t[i]).box).update(r.width||e.w,r.height||e.h,he(r.horizontal,e)),de(e,n,r)&&(l=!0,u.length&&(s=!0)),o.fullWidth||u.push(r);return s&&ce(u,e,n)||l}function fe(t,e,n){var i,a,r,o,s=n.padding,l=e.x,u=e.y;for(i=0,a=t.length;i<a;++i)o=(r=t[i]).box,r.horizontal?(o.left=o.fullWidth?s.left:e.left,o.right=o.fullWidth?n.outerWidth-s.right:e.left+e.w,o.top=u,o.bottom=u+o.height,o.width=o.right-o.left,u=o.bottom):(o.left=l,o.right=l+o.width,o.top=e.top,o.bottom=e.top+e.h,o.height=o.bottom-o.top,l=o.right);e.x=l,e.y=u}N._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ge,pe={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,e,n){if(t){var i=t.options.layout||{},a=H.options.toPadding(i.padding),r=e-a.width,o=n-a.height,s=function(t){var e=function(t){var e,n,i,a=[];for(e=0,n=(t||[]).length;e<n;++e)i=t[e],a.push({index:e,box:i,pos:i.position,horizontal:i.isHorizontal(),weight:i.weight});return a}(t),n=le(se(e,"left"),!0),i=le(se(e,"right")),a=le(se(e,"top"),!0),r=le(se(e,"bottom"));return{leftAndTop:n.concat(a),rightAndBottom:i.concat(r),chartArea:se(e,"chartArea"),vertical:n.concat(i),horizontal:a.concat(r)}}(t.boxes),l=s.vertical,u=s.horizontal,d=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:r,vBoxMaxWidth:r/2/l.length,hBoxMaxHeight:o/2}),h=oe({maxPadding:oe({},a),w:r,h:o,x:a.left,y:a.top},a);!function(t,e){var n,i,a;for(n=0,i=t.length;n<i;++n)(a=t[n]).width=a.horizontal?a.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,a.height=a.horizontal&&e.hBoxMaxHeight}(l.concat(u),d),ce(l,h,d),ce(u,h,d)&&ce(l,h,d),function(t){var e=t.maxPadding;function n(n){var i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(h),fe(s.leftAndTop,h,d),h.x+=h.w,h.y+=h.h,fe(s.rightAndBottom,h,d),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h},H.each(s.chartArea,(function(e){var n=e.box;oe(n,t.chartArea),n.update(h.w,h.h)}))}}},me=(ge=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&ge.default||ge,ve=["animationstart","webkitAnimationStart"],be={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function xe(t,e){var n=H.getStyle(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?Number(i[1]):void 0}var ye=!!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 _e(t,e,n){t.addEventListener(e,n,ye)}function ke(t,e,n){t.removeEventListener(e,n,ye)}function we(t,e,n,i,a){return{type:t,chart:e,native:a||null,x:void 0!==n?n:null,y:void 0!==i?i:null}}function Me(t){var e=document.createElement("div");return e.className=t||"",e}function Se(t,e,n){var i,a,r,o,s=t.$chartjs||(t.$chartjs={}),l=s.resizer=function(t){var e=Me("chartjs-size-monitor"),n=Me("chartjs-size-monitor-expand"),i=Me("chartjs-size-monitor-shrink");n.appendChild(Me()),i.appendChild(Me()),e.appendChild(n),e.appendChild(i),e._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,i.scrollLeft=1e6,i.scrollTop=1e6};var a=function(){e._reset(),t()};return _e(n,"scroll",a.bind(n,"expand")),_e(i,"scroll",a.bind(i,"shrink")),e}((i=function(){if(s.resizer){var i=n.options.maintainAspectRatio&&t.parentNode,a=i?i.clientWidth:0;e(we("resize",n)),i&&i.clientWidth<a&&n.canvas&&e(we("resize",n))}},r=!1,o=[],function(){o=Array.prototype.slice.call(arguments),a=a||this,r||(r=!0,H.requestAnimFrame.call(window,(function(){r=!1,i.apply(a,o)})))}));!function(t,e){var n=t.$chartjs||(t.$chartjs={}),i=n.renderProxy=function(t){"chartjs-render-animation"===t.animationName&&e()};H.each(ve,(function(e){_e(t,e,i)})),n.reflow=!!t.offsetParent,t.classList.add("chartjs-render-monitor")}(t,(function(){if(s.resizer){var e=t.parentNode;e&&e!==l.parentNode&&e.insertBefore(l,e.firstChild),l._reset()}}))}function Ce(t){var e=t.$chartjs||{},n=e.resizer;delete e.resizer,function(t){var e=t.$chartjs||{},n=e.renderProxy;n&&(H.each(ve,(function(e){ke(t,e,n)})),delete e.renderProxy),t.classList.remove("chartjs-render-monitor")}(t),n&&n.parentNode&&n.parentNode.removeChild(n)}var Pe={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;!function(t,e){var n=t.$chartjs||(t.$chartjs={});if(!n.containsStyles){n.containsStyles=!0,e="/* Chart.js */\n"+e;var i=document.createElement("style");i.setAttribute("type","text/css"),i.appendChild(document.createTextNode(e)),t.appendChild(i)}}(e.host?e:document.head,me)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(this._ensureLoaded(t),function(t,e){var n=t.style,i=t.getAttribute("height"),a=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===a||""===a){var r=xe(t,"width");void 0!==r&&(t.width=r)}if(null===i||""===i)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var o=xe(t,"height");void 0!==r&&(t.height=o)}}(t,e),n):null},releaseContext:function(t){var e=t.canvas;if(e.$chartjs){var n=e.$chartjs.initial;["height","width"].forEach((function(t){var i=n[t];H.isNullOrUndef(i)?e.removeAttribute(t):e.setAttribute(t,i)})),H.each(n.style||{},(function(t,n){e.style[n]=t})),e.width=e.width,delete e.$chartjs}},addEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=n.$chartjs||(n.$chartjs={});_e(i,e,(a.proxies||(a.proxies={}))[t.id+"_"+e]=function(e){n(function(t,e){var n=be[t.type]||t.type,i=H.getRelativePosition(t,e);return we(n,e,i.x,i.y,t)}(e,t))})}else Se(i,n,t)},removeEventListener:function(t,e,n){var i=t.canvas;if("resize"!==e){var a=((n.$chartjs||{}).proxies||{})[t.id+"_"+e];a&&ke(i,e,a)}else Ce(i)}};H.addEvent=_e,H.removeEvent=ke;var Ae=Pe._enabled?Pe:{acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},De=H.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Ae);N._set("global",{plugins:{}});var Te={_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 n=e.indexOf(t);-1!==n&&e.splice(n,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if("function"==typeof(s=(r=(a=l[i]).plugin)[e])&&((o=[t].concat(n||[])).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 n=[],i=[],a=t&&t.config||{},r=a.options&&a.options.plugins||{};return this._plugins.concat(a.plugins||[]).forEach((function(t){if(-1===n.indexOf(t)){var e=t.id,a=r[e];!1!==a&&(!0===a&&(a=H.clone(N.global.plugins[e])),n.push(t),i.push({plugin:t,options:a||{}}))}})),e.descriptors=i,e.id=this._cacheId,i},_invalidate:function(t){delete t.$plugins}},Ie={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=H.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?H.merge(Object.create(null),[N.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){this.defaults.hasOwnProperty(t)&&(this.defaults[t]=H.extend(this.defaults[t],e))},addScalesToLayout:function(t){H.each(t.scales,(function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,pe.addBox(t,e)}))}},Fe=H.valueOrDefault,Oe=H.rtl.getRtlAdapter;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:H.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.label?n=r.label:r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:H.noop,beforeBody:H.noop,beforeLabel:H.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),H.isNullOrUndef(t.value)?n+=t.yLabel:n+=t.value,n},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:H.noop,afterBody:H.noop,beforeFooter:H.noop,footer:H.noop,afterFooter:H.noop}}});var Le={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:i/r,y:a/r}},nearest:function(t,e){var n,i,a,r=e.x,o=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var l=t[n];if(l&&l.hasValue()){var u=l.getCenterPoint(),d=H.distanceBetweenPoints(e,u);d<s&&(s=d,a=l)}}if(a){var h=a.tooltipPosition();r=h.x,o=h.y}return{x:r,y:o}}};function Re(t,e){return e&&(H.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ze(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ne(t){var e=N.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:Fe(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:Fe(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:Fe(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:Fe(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:Fe(t.titleFontStyle,e.defaultFontStyle),titleFontSize:Fe(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:Fe(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:Fe(t.footerFontStyle,e.defaultFontStyle),footerFontSize:Fe(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Be(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ee(t){return Re([],ze(t))}var We=X.extend({initialize:function(){this._model=Ne(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,n=e.callbacks,i=n.beforeTitle.apply(t,arguments),a=n.title.apply(t,arguments),r=n.afterTitle.apply(t,arguments),o=[];return o=Re(o,ze(i)),o=Re(o,ze(a)),o=Re(o,ze(r))},getBeforeBody:function(){return Ee(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var n=this,i=n._options.callbacks,a=[];return H.each(t,(function(t){var r={before:[],lines:[],after:[]};Re(r.before,ze(i.beforeLabel.call(n,t,e))),Re(r.lines,i.label.call(n,t,e)),Re(r.after,ze(i.afterLabel.call(n,t,e))),a.push(r)})),a},getAfterBody:function(){return Ee(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,n=e.beforeFooter.apply(t,arguments),i=e.footer.apply(t,arguments),a=e.afterFooter.apply(t,arguments),r=[];return r=Re(r,ze(n)),r=Re(r,ze(i)),r=Re(r,ze(a))},update:function(t){var e,n,i,a,r,o,s,l,u,d,h=this,c=h._options,f=h._model,g=h._model=Ne(c),p=h._active,m=h._data,v={xAlign:f.xAlign,yAlign:f.yAlign},b={x:f.x,y:f.y},x={width:f.width,height:f.height},y={x:f.caretX,y:f.caretY};if(p.length){g.opacity=1;var _=[],k=[];y=Le[c.position].call(h,p,h._eventPosition);var w=[];for(e=0,n=p.length;e<n;++e)w.push((i=p[e],a=void 0,r=void 0,o=void 0,s=void 0,l=void 0,u=void 0,d=void 0,a=i._xScale,r=i._yScale||i._scale,o=i._index,s=i._datasetIndex,l=i._chart.getDatasetMeta(s).controller,u=l._getIndexScale(),d=l._getValueScale(),{xLabel:a?a.getLabelForIndex(o,s):"",yLabel:r?r.getLabelForIndex(o,s):"",label:u?""+u.getLabelForIndex(o,s):"",value:d?""+d.getLabelForIndex(o,s):"",index:o,datasetIndex:s,x:i._model.x,y:i._model.y}));c.filter&&(w=w.filter((function(t){return c.filter(t,m)}))),c.itemSort&&(w=w.sort((function(t,e){return c.itemSort(t,e,m)}))),H.each(w,(function(t){_.push(c.callbacks.labelColor.call(h,t,h._chart)),k.push(c.callbacks.labelTextColor.call(h,t,h._chart))})),g.title=h.getTitle(w,m),g.beforeBody=h.getBeforeBody(w,m),g.body=h.getBody(w,m),g.afterBody=h.getAfterBody(w,m),g.footer=h.getFooter(w,m),g.x=y.x,g.y=y.y,g.caretPadding=c.caretPadding,g.labelColors=_,g.labelTextColors=k,g.dataPoints=w,x=function(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,r=e.body,o=r.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);o+=e.beforeBody.length+e.afterBody.length;var s=e.title.length,l=e.footer.length,u=e.titleFontSize,d=e.bodyFontSize,h=e.footerFontSize;i+=s*u,i+=s?(s-1)*e.titleSpacing:0,i+=s?e.titleMarginBottom:0,i+=o*d,i+=o?(o-1)*e.bodySpacing:0,i+=l?e.footerMarginTop:0,i+=l*h,i+=l?(l-1)*e.footerSpacing:0;var c=0,f=function(t){a=Math.max(a,n.measureText(t).width+c)};return n.font=H.fontString(u,e._titleFontStyle,e._titleFontFamily),H.each(e.title,f),n.font=H.fontString(d,e._bodyFontStyle,e._bodyFontFamily),H.each(e.beforeBody.concat(e.afterBody),f),c=e.displayColors?d+2:0,H.each(r,(function(t){H.each(t.before,f),H.each(t.lines,f),H.each(t.after,f)})),c=0,n.font=H.fontString(h,e._footerFontStyle,e._footerFontFamily),H.each(e.footer,f),{width:a+=2*e.xPadding,height:i}}(this,g),b=function(t,e,n,i){var a=t.x,r=t.y,o=t.caretSize,s=t.caretPadding,l=t.cornerRadius,u=n.xAlign,d=n.yAlign,h=o+s,c=l+s;return"right"===u?a-=e.width:"center"===u&&((a-=e.width/2)+e.width>i.width&&(a=i.width-e.width),a<0&&(a=0)),"top"===d?r+=h:r-="bottom"===d?e.height+h:e.height/2,"center"===d?"left"===u?a+=h:"right"===u&&(a-=h):"left"===u?a-=c:"right"===u&&(a+=c),{x:a,y:r}}(g,x,v=function(t,e){var n,i,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?(n=function(t){return t<=c},i=function(t){return t>c}):(n=function(t){return t<=e.width/2},i=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"},n(s.x)?(d="left",a(s.x)&&(d="center",h=o(s.y))):i(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,x),h._chart)}else g.opacity=0;return g.xAlign=v.xAlign,g.yAlign=v.yAlign,g.x=b.x,g.y=b.y,g.width=x.width,g.height=x.height,g.caretX=y.x,g.caretY=y.y,h._model=g,t&&c.custom&&c.custom.call(h,g),h},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,h=n.xAlign,c=n.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,"left"===h?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+p)+u,r=i,o=s-u,l=s+u);else if("left"===h?(i=(a=f+d+u)-u,r=a+u):"right"===h?(i=(a=f+p-d-u)-u,r=a+u):(i=(a=n.caretX)-u,r=a+u),"top"===c)s=(o=g)-u,l=o;else{s=(o=g+m)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,n){var i,a,r,o=e.title,s=o.length;if(s){var l=Oe(e.rtl,e.x,e.width);for(t.x=Be(e,e._titleAlign),n.textAlign=l.textAlign(e._titleAlign),n.textBaseline="middle",i=e.titleFontSize,a=e.titleSpacing,n.fillStyle=e.titleFontColor,n.font=H.fontString(i,e._titleFontStyle,e._titleFontFamily),r=0;r<s;++r)n.fillText(o[r],l.x(t.x),t.y+i/2),t.y+=i+a,r+1===s&&(t.y+=e.titleMarginBottom-a)}},drawBody:function(t,e,n){var i,a,r,o,s,l,u,d,h=e.bodyFontSize,c=e.bodySpacing,f=e._bodyAlign,g=e.body,p=e.displayColors,m=0,v=p?Be(e,"left"):0,b=Oe(e.rtl,e.x,e.width),x=function(e){n.fillText(e,b.x(t.x+m),t.y+h/2),t.y+=h+c},y=b.textAlign(f);for(n.textAlign=f,n.textBaseline="middle",n.font=H.fontString(h,e._bodyFontStyle,e._bodyFontFamily),t.x=Be(e,y),n.fillStyle=e.bodyFontColor,H.each(e.beforeBody,x),m=p&&"right"!==y?"center"===f?h/2+1:h+2:0,s=0,u=g.length;s<u;++s){for(i=g[s],a=e.labelTextColors[s],r=e.labelColors[s],n.fillStyle=a,H.each(i.before,x),l=0,d=(o=i.lines).length;l<d;++l){if(p){var _=b.x(v);n.fillStyle=e.legendColorBackground,n.fillRect(b.leftForLtr(_,h),t.y,h,h),n.lineWidth=1,n.strokeStyle=r.borderColor,n.strokeRect(b.leftForLtr(_,h),t.y,h,h),n.fillStyle=r.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(_,1),h-2),t.y+1,h-2,h-2),n.fillStyle=a}x(o[l])}H.each(i.after,x)}m=0,H.each(e.afterBody,x),t.y-=c},drawFooter:function(t,e,n){var i,a,r=e.footer,o=r.length;if(o){var s=Oe(e.rtl,e.x,e.width);for(t.x=Be(e,e._footerAlign),t.y+=e.footerMarginTop,n.textAlign=s.textAlign(e._footerAlign),n.textBaseline="middle",i=e.footerFontSize,n.fillStyle=e.footerFontColor,n.font=H.fontString(i,e._footerFontStyle,e._footerFontFamily),a=0;a<o;++a)n.fillText(r[a],s.x(t.x),t.y+i/2),t.y+=i+e.footerSpacing}},drawBackground:function(t,e,n,i){n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor,n.lineWidth=e.borderWidth;var a=e.xAlign,r=e.yAlign,o=t.x,s=t.y,l=i.width,u=i.height,d=e.cornerRadius;n.beginPath(),n.moveTo(o+d,s),"top"===r&&this.drawCaret(t,i),n.lineTo(o+l-d,s),n.quadraticCurveTo(o+l,s,o+l,s+d),"center"===r&&"right"===a&&this.drawCaret(t,i),n.lineTo(o+l,s+u-d),n.quadraticCurveTo(o+l,s+u,o+l-d,s+u),"bottom"===r&&this.drawCaret(t,i),n.lineTo(o+d,s+u),n.quadraticCurveTo(o,s+u,o,s+u-d),"center"===r&&"left"===a&&this.drawCaret(t,i),n.lineTo(o,s+d),n.quadraticCurveTo(o,s,o+d,s),n.closePath(),n.fill(),e.borderWidth>0&&n.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={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&&(t.save(),t.globalAlpha=a,this.drawBackground(i,e,t,n),i.y+=e.yPadding,H.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),H.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e,n=this,i=n._options;return n._lastActive=n._lastActive||[],"mouseout"===t.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&n._active.reverse()),(e=!H.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(i.enabled||i.custom)&&(n._eventPosition={x:t.x,y:t.y},n.update(!0),n.pivot())),e}}),Ve=Le,He=We;He.positioners=Ve;var je=H.valueOrDefault;function qe(){return H.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){if("xAxes"===t||"yAxes"===t){var a,r,o,s=n[t].length;for(e[t]||(e[t]=[]),a=0;a<s;++a)o=n[t][a],r=je(o.type,"xAxes"===t?"category":"linear"),a>=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?H.merge(e[t][a],[Ie.getScaleDefaults(r),o]):H.merge(e[t][a],o)}else H._merger(t,e,n,i)}})}function Ue(){return H.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,n,i){var a=e[t]||Object.create(null),r=n[t];"scales"===t?e[t]=qe(a,r):"scale"===t?e[t]=H.merge(a,[Ie.getScaleDefaults(r.type),r]):H._merger(t,e,n,i)}})}function Ye(t){var e=t.options;H.each(t.scales,(function(e){pe.removeBox(t,e)})),e=Ue(N.global,N[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function $e(t,e,n){var i,a=function(t){return t.id===i};do{i=e+n++}while(H.findIndex(t,a)>=0);return i}function Ge(t){return"top"===t||"bottom"===t}function Xe(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}N._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Ke=function(t,e){return this.construct(t,e),this};H.extend(Ke.prototype,{construct:function(t,e){var n=this;e=function(t){var e=(t=t||Object.create(null)).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Ue(N.global,N[t.type],t.options||{}),t}(e);var i=De.acquireContext(t,e),a=i&&i.canvas,r=a&&a.height,o=a&&a.width;n.id=H.uid(),n.ctx=i,n.canvas=a,n.config=e,n.width=o,n.height=r,n.aspectRatio=r?o/r:null,n.options=e.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Ke.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(t){n.config.data=t}}),i&&a?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Te.notify(t,"beforeInit"),H.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Te.notify(t,"afterInit"),t},clear:function(){return H.canvas.clear(this),this},stop:function(){return J.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,a=n.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(H.getMaximumWidth(i))),o=Math.max(0,Math.floor(a?r/a:H.getMaximumHeight(i)));if((e.width!==r||e.height!==o)&&(i.width=e.width=r,i.height=e.height=o,i.style.width=r+"px",i.style.height=o+"px",H.retinaScale(e,n.devicePixelRatio),!t)){var s={width:r,height:o};Te.notify(e,"resize",[s]),n.onResize&&n.onResize(e,s),e.stop(),e.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;H.each(e.xAxes,(function(t,n){t.id||(t.id=$e(e.xAxes,"x-axis-",n))})),H.each(e.yAxes,(function(t,n){t.id||(t.id=$e(e.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,n=t.scales||{},i=[],a=Object.keys(n).reduce((function(t,e){return t[e]=!1,t}),{});e.scales&&(i=i.concat((e.scales.xAxes||[]).map((function(t){return{options:t,dtype:"category",dposition:"bottom"}})),(e.scales.yAxes||[]).map((function(t){return{options:t,dtype:"linear",dposition:"left"}})))),e.scale&&i.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),H.each(i,(function(e){var i=e.options,r=i.id,o=je(i.type,e.dtype);Ge(i.position)!==Ge(e.dposition)&&(i.position=e.dposition),a[r]=!0;var s=null;if(r in n&&n[r].type===o)(s=n[r]).options=i,s.ctx=t.ctx,s.chart=t;else{var l=Ie.getScaleConstructor(o);if(!l)return;s=new l({id:r,type:o,options:i,ctx:t.ctx,chart:t}),n[s.id]=s}s.mergeTicksOptions(),e.isDefault&&(t.scale=s)})),H.each(a,(function(t,e){t||delete n[e]})),t.scales=n,Ie.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,n=this,i=[],a=n.data.datasets;for(t=0,e=a.length;t<e;t++){var r=a[t],o=n.getDatasetMeta(t),s=r.type||n.config.type;if(o.type&&o.type!==s&&(n.destroyDatasetMeta(t),o=n.getDatasetMeta(t)),o.type=s,o.order=r.order||0,o.index=t,o.controller)o.controller.updateIndex(t),o.controller.linkScales();else{var l=Jt[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(n,t),i.push(o.controller)}}return i},resetElements:function(){var t=this;H.each(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,n,i=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),Ye(i),Te._invalidate(i),!1!==Te.notify(i,"beforeUpdate")){i.tooltip._data=i.data;var a=i.buildOrUpdateControllers();for(e=0,n=i.data.datasets.length;e<n;e++)i.getDatasetMeta(e).controller.buildOrUpdateElements();i.updateLayout(),i.options.animation&&i.options.animation.duration&&H.each(a,(function(t){t.reset()})),i.updateDatasets(),i.tooltip.initialize(),i.lastActive=[],Te.notify(i,"afterUpdate"),i._layers.sort(Xe("z","_idx")),i._bufferedRender?i._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:i.render(t)}},updateLayout:function(){var t=this;!1!==Te.notify(t,"beforeLayout")&&(pe.update(this,this.width,this.height),t._layers=[],H.each(t.boxes,(function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())}),t),t._layers.forEach((function(t,e){t._idx=e})),Te.notify(t,"afterScaleUpdate"),Te.notify(t,"afterLayout"))},updateDatasets:function(){if(!1!==Te.notify(this,"beforeDatasetsUpdate")){for(var t=0,e=this.data.datasets.length;t<e;++t)this.updateDataset(t);Te.notify(this,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this.getDatasetMeta(t),n={meta:e,index:t};!1!==Te.notify(this,"beforeDatasetUpdate",[n])&&(e.controller._update(),Te.notify(this,"afterDatasetUpdate",[n]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var n=e.options.animation,i=je(t.duration,n&&n.duration),a=t.lazy;if(!1!==Te.notify(e,"beforeRender")){var r=function(t){Te.notify(e,"afterRender"),H.callback(n&&n.onComplete,[t],e)};if(n&&i){var o=new Z({numSteps:i/16.66,easing:t.easing||n.easing,render:function(t,e){var n=H.easing.effects[e.easing],i=e.currentStep,a=i/e.numSteps;t.draw(n(a),a,i)},onAnimationProgress:n.onProgress,onAnimationComplete:r});J.addAnimation(e,o,i,a)}else e.draw(),r(new Z({numSteps:0,chart:e}));return e}},draw:function(t){var e,n,i=this;if(i.clear(),H.isNullOrUndef(t)&&(t=1),i.transition(t),!(i.width<=0||i.height<=0)&&!1!==Te.notify(i,"beforeDraw",[t])){for(n=i._layers,e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(i.chartArea);for(i.drawDatasets(t);e<n.length;++e)n[e].draw(i.chartArea);i._drawTooltip(t),Te.notify(i,"afterDraw",[t])}},transition:function(t){for(var e=0,n=(this.data.datasets||[]).length;e<n;++e)this.isDatasetVisible(e)&&this.getDatasetMeta(e).controller.transition(t);this.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,n,i=[];for(e=0,n=(this.data.datasets||[]).length;e<n;++e)t&&!this.isDatasetVisible(e)||i.push(this.getDatasetMeta(e));return i.sort(Xe("order","index")),i},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,n;if(!1!==Te.notify(this,"beforeDatasetsDraw",[t])){for(n=(e=this._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)this.drawDataset(e[n],t);Te.notify(this,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n={meta:t,index:t.index,easingValue:e};!1!==Te.notify(this,"beforeDatasetDraw",[n])&&(t.controller.draw(e),Te.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this.tooltip,n={tooltip:e,easingValue:t};!1!==Te.notify(this,"beforeTooltipDraw",[n])&&(e.draw(),Te.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return re.modes.single(this,t)},getElementsAtEvent:function(t){return re.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return re.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=re.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return re.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this.data.datasets[t];e._meta||(e._meta={});var n=e._meta[this.id];return n||(n=e._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++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,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var t,e,n=this,i=n.canvas;for(n.stop(),t=0,e=n.data.datasets.length;t<e;++t)n.destroyDatasetMeta(t);i&&(n.unbindEvents(),H.canvas.clear(n),De.releaseContext(n.ctx),n.canvas=null,n.ctx=null),Te.notify(n,"destroy"),delete Ke.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new He({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};H.each(t.options.events,(function(i){De.addEventListener(t,i,n),e[i]=n})),t.options.responsive&&(n=function(){t.resize()},De.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,H.each(e,(function(e,n){De.removeEventListener(t,n,e)})))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"set":"remove";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o+"HoverStyle"](i);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+o+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==Te.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);n&&(i=n._start?n.handleEvent(t):i|n.handleEvent(t)),Te.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e,n=this,i=n.options||{},a=i.hover;return n.lastActive=n.lastActive||[],"mouseout"===t.type?n.active=[]:n.active=n.getElementsAtEventForMode(t,a.mode,a),H.callback(i.onHover||i.hover.onHover,[t.native,n.active],n),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(n,t.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,a.mode,!1),n.active.length&&a.mode&&n.updateHoverStyle(n.active,a.mode,!0),e=!H.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,e}}),Ke.instances={};var Ze=Ke;Ke.Controller=Ke,Ke.types={},H.configMerge=Ue,H.scaleMerge=qe;function Je(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Qe(t){this.options=t||{}}H.extend(Qe.prototype,{formats:Je,parse:Je,format:Je,add:Je,diff:Je,startOf:Je,endOf:Je,_create:function(t){return t}}),Qe.override=function(t){H.extend(Qe.prototype,t)};var tn={_date:Qe},en={formatters:{values:function(t){return H.isArray(t)?t:""+t},linear:function(t,e,n){var i=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(i)>1&&t!==Math.floor(t)&&(i=t-Math.floor(t));var a=H.log10(Math.abs(i)),r="";if(0!==t)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var o=H.log10(Math.abs(t)),s=Math.floor(o)-Math.floor(a);s=Math.max(Math.min(s,20),0),r=t.toExponential(s)}else{var l=-1*Math.floor(a);l=Math.max(Math.min(l,20),0),r=t.toFixed(l)}else r="0";return r},logarithmic:function(t,e,n){var i=t/Math.pow(10,Math.floor(H.log10(t)));return 0===t?"0":1===i||2===i||5===i||0===e||e===n.length-1?t.toExponential():""}}},nn=H.isArray,an=H.isNullOrUndef,rn=H.valueOrDefault,on=H.valueAtIndexOrDefault;function sn(t,e,n){var i,a=t.getTicks().length,r=Math.min(e,a-1),o=t.getPixelForTick(r),s=t._startPixel,l=t._endPixel;if(!(n&&(i=1===a?Math.max(o-s,l-o):0===e?(t.getPixelForTick(1)-o)/2:(o-t.getPixelForTick(r-1))/2,(o+=r<e?i:-i)<s-1e-6||o>l+1e-6)))return o}function ln(t,e,n,i){var a,r,o,s,l,u,d,h,c,f,g,p,m,v=n.length,b=[],x=[],y=[],_=0,k=0;for(a=0;a<v;++a){if(s=n[a].label,l=n[a].major?e.major:e.minor,t.font=u=l.string,d=i[u]=i[u]||{data:{},gc:[]},h=l.lineHeight,c=f=0,an(s)||nn(s)){if(nn(s))for(r=0,o=s.length;r<o;++r)g=s[r],an(g)||nn(g)||(c=H.measureText(t,d.data,d.gc,c,g),f+=h)}else c=H.measureText(t,d.data,d.gc,c,s),f=h;b.push(c),x.push(f),y.push(h/2),_=Math.max(c,_),k=Math.max(f,k)}function w(t){return{width:b[t]||0,height:x[t]||0,offset:y[t]||0}}return function(t,e){H.each(t,(function(t){var n,i=t.gc,a=i.length/2;if(a>e){for(n=0;n<a;++n)delete t.data[i[n]];i.splice(0,a)}}))}(i,v),p=b.indexOf(_),m=x.indexOf(k),{first:w(0),last:w(v-1),widest:w(p),highest:w(m)}}function un(t){return t.drawTicks?t.tickMarkLength:0}function dn(t){var e,n;return t.display?(e=H.options._parseFont(t),n=H.options.toPadding(t.padding),e.lineHeight+n.height):0}function hn(t,e){return H.extend(H.options._parseFont({fontFamily:rn(e.fontFamily,t.fontFamily),fontSize:rn(e.fontSize,t.fontSize),fontStyle:rn(e.fontStyle,t.fontStyle),lineHeight:rn(e.lineHeight,t.lineHeight)}),{color:H.options.resolve([e.fontColor,t.fontColor,N.global.defaultFontColor])})}function cn(t){var e=hn(t,t.minor);return{minor:e,major:t.major.enabled?hn(t,t.major):e}}function fn(t){var e,n,i,a=[];for(n=0,i=t.length;n<i;++n)void 0!==(e=t[n])._index&&a.push(e);return a}function gn(t,e,n,i){var a,r,o,s,l=rn(n,0),u=Math.min(rn(i,t.length),t.length),d=0;for(e=Math.ceil(e),i&&(e=(a=i-n)/Math.floor(a/e)),s=l;s<0;)d++,s=Math.round(l+d*e);for(r=Math.max(l,0);r<u;r++)o=t[r],r===s?(o._index=r,d++,s=Math.round(l+d*e)):delete o.label}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:"",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:en.formatters.values,minor:{},major:{}}});var pn=X.extend({zeroLineIndex:0,getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){H.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,s,l=this,u=l.options.ticks,d=u.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=H.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),o=l.buildTicks()||[],(!(o=l.afterBuildTicks(o)||o)||!o.length)&&l.ticks)for(o=[],i=0,a=l.ticks.length;i<a;++i)o.push({value:l.ticks[i],major:!1});return l._ticks=o,s=d<o.length,r=l._convertTicksToLabels(s?function(t,e){for(var n=[],i=t.length/e,a=0,r=t.length;a<r;a+=i)n.push(t[Math.floor(a)]);return n}(o,d):o),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=u.display&&(u.autoSkip||"auto"===u.source)?l._autoSkip(o):o,s&&(r=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=r,l.afterUpdate(),l.minSize},_configure:function(){var t,e,n=this,i=n.options.ticks.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,i=!i),n._startPixel=t,n._endPixel=e,n._reversePixels=i,n._length=e-t},afterUpdate:function(){H.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){H.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(){H.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){H.callback(this.options.beforeDataLimits,[this])},determineDataLimits:H.noop,afterDataLimits:function(){H.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){H.callback(this.options.beforeBuildTicks,[this])},buildTicks:H.noop,afterBuildTicks:function(t){var e=this;return nn(t)&&t.length?H.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=H.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){H.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this.options.ticks;this.ticks=this.ticks.map(t.userCallback||t.callback,this)},afterTickToLabelConversion:function(){H.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){H.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,n,i,a,r,o,s=this,l=s.options,u=l.ticks,d=s.getTicks().length,h=u.minRotation||0,c=u.maxRotation,f=h;!s._isVisible()||!u.display||h>=c||d<=1||!s.isHorizontal()?s.labelRotation=h:(e=(t=s._getLabelSizes()).widest.width,n=t.highest.height-t.highest.offset,i=Math.min(s.maxWidth,s.chart.width-e),e+6>(a=l.offset?s.maxWidth/d:i/(d-1))&&(a=i/(d-(l.offset?.5:1)),r=s.maxHeight-un(l.gridLines)-u.padding-dn(l.scaleLabel),o=Math.sqrt(e*e+n*n),f=H.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(n/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){H.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){H.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},n=t.chart,i=t.options,a=i.ticks,r=i.scaleLabel,o=i.gridLines,s=t._isVisible(),l="bottom"===i.position,u=t.isHorizontal();if(u?e.width=t.maxWidth:s&&(e.width=un(o)+dn(r)),u?s&&(e.height=un(o)+dn(r)):e.height=t.maxHeight,a.display&&s){var d=cn(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,p=h.highest,m=.4*d.minor.lineHeight,v=a.padding;if(u){var b=0!==t.labelRotation,x=H.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var w,M,S=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);b?(w=l?y*c.width+_*c.offset:_*(c.height-c.offset),M=l?_*(f.height-f.offset):y*f.width+_*f.offset):(w=c.width/2,M=f.width/2),t.paddingLeft=Math.max((w-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-C)*t.width/(t.width-C),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),u?(t.width=t._length=n.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){H.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(an(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!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},_convertTicksToLabels:function(t){var e,n,i,a=this;for(a.ticks=t.map((function(t){return t.value})),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),n=0,i=t.length;n<i;++n)t[n].label=e[n];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=ln(t.ctx,cn(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,n,i,a;return nn(t)?(e=+this.getRightValue(t[0]),n=+this.getRightValue(t[1]),i=Math.min(e,n),a=Math.max(e,n)):(e=void 0,n=t=+this.getRightValue(t),i=t,a=t),{min:i,max:a,start:e,end:n}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:H.noop,getPixelForValue:H.noop,getValueForPixel:H.noop,getPixelForTick:function(t){var e=this.options.offset,n=this._ticks.length,i=1/Math.max(n-(e?0:1),1);return t<0||t>n-1?null:this.getPixelForDecimal(t*i+(e?i/2:0))},getPixelForDecimal:function(t){return this._reversePixels&&(t=1-t),this._startPixel+t*this._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},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,n,i,a,r=this.options.ticks,o=this._length,s=r.maxTicksLimit||o/this._tickSize()+1,l=r.major.enabled?function(t){var e,n,i=[];for(e=0,n=t.length;e<n;e++)t[e].major&&i.push(e);return i}(t):[],u=l.length,d=l[0],h=l[u-1];if(u>s)return function(t,e,n){var i,a,r=0,o=e[0];for(n=Math.ceil(n),i=0;i<t.length;i++)a=t[i],i===o?(a._index=i,o=e[++r*n]):delete a.label}(t,l,u/s),fn(t);if(i=function(t,e,n,i){var a,r,o,s,l=function(t){var e,n,i=t.length;if(i<2)return!1;for(n=t[0],e=1;e<i;++e)if(t[e]-t[e-1]!==n)return!1;return n}(t),u=(e.length-1)/i;if(!l)return Math.max(u,1);for(o=0,s=(a=H.math._factorize(l)).length-1;o<s;o++)if((r=a[o])>u)return r;return Math.max(u,1)}(l,t,0,s),u>0){for(e=0,n=u-1;e<n;e++)gn(t,i,l[e],l[e+1]);return a=u>1?(h-d)/(u-1):null,gn(t,i,H.isNullOrUndef(a)?0:d-a,d),gn(t,i,h,H.isNullOrUndef(a)?t.length:h+a),fn(t)}return gn(t,i),fn(t)},_tickSize:function(){var t=this.options.ticks,e=H.toRadians(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),a=this._getLabelSizes(),r=t.autoSkipPadding||0,o=a?a.widest.width+r:0,s=a?a.highest.height+r:0;return this.isHorizontal()?s*n>o*i?o/n:s/i:s*i<o*n?s/n:o/i},_isVisible:function(){var t,e,n,i=this.chart,a=this.options.display;if("auto"!==a)return!!a;for(t=0,e=i.data.datasets.length;t<e;++t)if(i.isDatasetVisible(t)&&((n=i.getDatasetMeta(t)).xAxisID===this.id||n.yAxisID===this.id))return!0;return!1},_computeGridLineItems:function(t){var e,n,i,a,r,o,s,l,u,d,h,c,f,g,p,m,v,b=this,x=b.chart,y=b.options,_=y.gridLines,k=y.position,w=_.offsetGridLines,M=b.isHorizontal(),S=b._ticksToDraw,C=S.length+(w?1:0),P=un(_),A=[],D=_.drawBorder?on(_.lineWidth,0,0):0,T=D/2,I=H._alignPixel,F=function(t){return I(x,t,D)};for("top"===k?(e=F(b.bottom),s=b.bottom-P,u=e-T,h=F(t.top)+T,f=t.bottom):"bottom"===k?(e=F(b.top),h=t.top,f=F(t.bottom)-T,s=e+T,u=b.top+P):"left"===k?(e=F(b.right),o=b.right-P,l=e-T,d=F(t.left)+T,c=t.right):(e=F(b.left),d=t.left,c=F(t.right)-T,o=e+T,l=b.left+P),n=0;n<C;++n)i=S[n]||{},an(i.label)&&n<S.length||(n===b.zeroLineIndex&&y.offset===w?(g=_.zeroLineWidth,p=_.zeroLineColor,m=_.zeroLineBorderDash||[],v=_.zeroLineBorderDashOffset||0):(g=on(_.lineWidth,n,1),p=on(_.color,n,"rgba(0,0,0,0.1)"),m=_.borderDash||[],v=_.borderDashOffset||0),void 0!==(a=sn(b,i._index||n,w))&&(r=I(x,a,g),M?o=l=d=c=r:s=u=h=f=r,A.push({tx1:o,ty1:s,tx2:l,ty2:u,x1:d,y1:h,x2:c,y2:f,width:g,color:p,borderDash:m,borderDashOffset:v})));return A.ticksLength=C,A.borderValue=e,A},_computeLabelItems:function(){var t,e,n,i,a,r,o,s,l,u,d,h,c=this,f=c.options,g=f.ticks,p=f.position,m=g.mirror,v=c.isHorizontal(),b=c._ticksToDraw,x=cn(g),y=g.padding,_=un(f.gridLines),k=-H.toRadians(c.labelRotation),w=[];for("top"===p?(r=c.bottom-_-y,o=k?"left":"center"):"bottom"===p?(r=c.top+_+y,o=k?"right":"center"):"left"===p?(a=c.right-(m?0:_)-y,o=m?"left":"right"):(a=c.left+(m?0:_)+y,o=m?"right":"left"),t=0,e=b.length;t<e;++t)i=(n=b[t]).label,an(i)||(s=c.getPixelForTick(n._index||t)+g.labelOffset,u=(l=n.major?x.major:x.minor).lineHeight,d=nn(i)?i.length:1,v?(a=s,h="top"===p?((k?1:.5)-d)*u:(k?0:.5)*u):(r=s,h=(1-d)*u/2),w.push({x:a,y:r,rotation:k,label:i,font:l,textOffset:h,textAlign:o}));return w},_drawGrid:function(t){var e=this,n=e.options.gridLines;if(n.display){var i,a,r,o,s,l=e.ctx,u=e.chart,d=H._alignPixel,h=n.drawBorder?on(n.lineWidth,0,0):0,c=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(r=0,o=c.length;r<o;++r)i=(s=c[r]).width,a=s.color,i&&a&&(l.save(),l.lineWidth=i,l.strokeStyle=a,l.setLineDash&&(l.setLineDash(s.borderDash),l.lineDashOffset=s.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(s.tx1,s.ty1),l.lineTo(s.tx2,s.ty2)),n.drawOnChartArea&&(l.moveTo(s.x1,s.y1),l.lineTo(s.x2,s.y2)),l.stroke(),l.restore());if(h){var f,g,p,m,v=h,b=on(n.lineWidth,c.ticksLength-1,1),x=c.borderValue;e.isHorizontal()?(f=d(u,e.left,v)-v/2,g=d(u,e.right,b)+b/2,p=m=x):(p=d(u,e.top,v)-v/2,m=d(u,e.bottom,b)+b/2,f=g=x),l.lineWidth=h,l.strokeStyle=on(n.color,0),l.beginPath(),l.moveTo(f,p),l.lineTo(g,m),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,n,i,a,r,o,s,l,u=t.ctx,d=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,i=d.length;e<i;++e){if(o=(r=d[e]).font,u.save(),u.translate(r.x,r.y),u.rotate(r.rotation),u.font=o.string,u.fillStyle=o.color,u.textBaseline="middle",u.textAlign=r.textAlign,s=r.label,l=r.textOffset,nn(s))for(n=0,a=s.length;n<a;++n)u.fillText(""+s[n],0,l),l+=o.lineHeight;else u.fillText(s,0,l);u.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,n=t.options,i=n.scaleLabel;if(i.display){var a,r,o=rn(i.fontColor,N.global.defaultFontColor),s=H.options._parseFont(i),l=H.options.toPadding(i.padding),u=s.lineHeight/2,d=n.position,h=0;if(t.isHorizontal())a=t.left+t.width/2,r="bottom"===d?t.bottom-u-l.bottom:t.top+u+l.top;else{var c="left"===d;a=c?t.left+u+l.top:t.right-u-l.top,r=t.top+t.height/2,h=c?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(a,r),e.rotate(h),e.textAlign="center",e.textBaseline="middle",e.fillStyle=o,e.font=s.string,e.fillText(i.labelString,0,0),e.restore()}},draw:function(t){this._isVisible()&&(this._drawGrid(t),this._drawTitle(),this._drawLabels())},_layers:function(){var t=this,e=t.options,n=e.ticks&&e.ticks.z||0,i=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&n!==i&&t.draw===t._draw?[{z:i,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:n,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:n,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,n=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter((function(i){return(!t||i.type===t)&&(n?i.xAxisID===e.id:i.yAxisID===e.id)}))}});pn.prototype._draw=pn.prototype.draw;var mn=pn,vn=H.isNullOrUndef,bn=mn.extend({determineDataLimits:function(){var t,e=this,n=e._getLabels(),i=e.options.ticks,a=i.min,r=i.max,o=0,s=n.length-1;void 0!==a&&(t=n.indexOf(a))>=0&&(o=t),void 0!==r&&(t=n.indexOf(r))>=0&&(s=t),e.minIndex=o,e.maxIndex=s,e.min=n[o],e.max=n[s]},buildTicks:function(){var t=this._getLabels(),e=this.minIndex,n=this.maxIndex;this.ticks=0===e&&n===t.length-1?t:t.slice(e,n+1)},getLabelForIndex:function(t,e){var n=this.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[e].data[t]):this._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,n=t.ticks;mn.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),n&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(n.length-(e?0:1),1))},getPixelForValue:function(t,e,n){var i,a,r,o=this;return vn(e)||vn(n)||(t=o.chart.data.datasets[n].data[e]),vn(t)||(i=o.isHorizontal()?t.x:t.y),(void 0!==i||void 0!==t&&isNaN(e))&&(a=o._getLabels(),t=H.valueOrDefault(i,t),e=-1!==(r=a.indexOf(t))?r:e,isNaN(e)&&(e=t)),o.getPixelForDecimal((e-o._startValue)/o._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}}),xn={position:"bottom"};bn._defaults=xn;var yn=H.noop,_n=H.isNullOrUndef;var kn=mn.extend({getRightValue:function(t){return"string"==typeof t?+t:mn.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var n=H.sign(t.min),i=H.sign(t.max);n<0&&i<0?t.max=0:n>0&&i>0&&(t.min=0)}var a=void 0!==e.min||void 0!==e.suggestedMin,r=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)),a!==r&&t.min>=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,n=e.stepSize,i=e.maxTicksLimit;return n?t=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(t=this._computeTickLimit(),i=i||11),i&&(t=Math.min(i,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:yn,buildTicks:function(){var t=this,e=t.options.ticks,n=t.getTickLimit(),i={maxTicks:n=Math.max(2,n),min:e.min,max:e.max,precision:e.precision,stepSize:H.valueOrDefault(e.fixedStepSize,e.stepSize)},a=t.ticks=function(t,e){var n,i,a,r,o=[],s=t.stepSize,l=s||1,u=t.maxTicks-1,d=t.min,h=t.max,c=t.precision,f=e.min,g=e.max,p=H.niceNum((g-f)/u/l)*l;if(p<1e-14&&_n(d)&&_n(h))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>u&&(p=H.niceNum(r*p/u/l)*l),s||_n(c)?n=Math.pow(10,H._decimalPlaces(p)):(n=Math.pow(10,c),p=Math.ceil(p*n)/n),i=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!_n(d)&&H.almostWhole(d/p,p/1e3)&&(i=d),!_n(h)&&H.almostWhole(h/p,p/1e3)&&(a=h)),r=(a-i)/p,r=H.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),i=Math.round(i*n)/n,a=Math.round(a*n)/n,o.push(_n(d)?i:d);for(var m=1;m<r;++m)o.push(Math.round((i+m*p)*n)/n);return o.push(_n(h)?a:h),o}(i,t);t.handleDirectionalChanges(),t.max=H.max(a),t.min=H.min(a),e.reverse?(a.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),mn.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,n=e.getTicks(),i=e.min,a=e.max;mn.prototype._configure.call(e),e.options.offset&&n.length&&(i-=t=(a-i)/Math.max(n.length-1,1)/2,a+=t),e._startValue=i,e._endValue=a,e._valueRange=a-i}}),wn={position:"left",ticks:{callback:en.formatters.linear}};function Mn(t,e,n,i){var a,r,o=t.options,s=function(t,e,n){var i=[n.type,void 0===e&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===t[i]&&(t[i]={pos:[],neg:[]}),t[i]}(e,o.stacked,n),l=s.pos,u=s.neg,d=i.length;for(a=0;a<d;++a)r=t._parseValue(i[a]),isNaN(r.min)||isNaN(r.max)||n.data[a].hidden||(l[a]=l[a]||0,u[a]=u[a]||0,o.relativePoints?l[a]=100:r.min<0||r.max<0?u[a]+=r.min:l[a]+=r.max)}function Sn(t,e,n){var i,a,r=n.length;for(i=0;i<r;++i)a=t._parseValue(n[i]),isNaN(a.min)||isNaN(a.max)||e.data[i].hidden||(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}var Cn=kn.extend({determineDataLimits:function(){var t,e,n,i,a=this,r=a.options,o=a.chart.data.datasets,s=a._getMatchingVisibleMetas(),l=r.stacked,u={},d=s.length;if(a.min=Number.POSITIVE_INFINITY,a.max=Number.NEGATIVE_INFINITY,void 0===l)for(t=0;!l&&t<d;++t)l=void 0!==(e=s[t]).stack;for(t=0;t<d;++t)n=o[(e=s[t]).index].data,l?Mn(a,u,e,n):Sn(a,e,n);H.each(u,(function(t){i=t.pos.concat(t.neg),a.min=Math.min(a.min,H.min(i)),a.max=Math.max(a.max,H.max(i))})),a.min=H.isFinite(a.min)&&!isNaN(a.min)?a.min:0,a.max=H.isFinite(a.max)&&!isNaN(a.max)?a.max:1,a.handleTickRangeOptions()},_computeTickLimit:function(){var t;return this.isHorizontal()?Math.ceil(this.width/40):(t=H.options._parseFont(this.options.ticks),Math.ceil(this.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){return this.getPixelForDecimal((+this.getRightValue(t)-this._startValue)/this._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}}),Pn=wn;Cn._defaults=Pn;var An=H.valueOrDefault,Dn=H.math.log10;var Tn={position:"left",ticks:{callback:en.formatters.logarithmic}};function In(t,e){return H.isFinite(t)&&t>=0?t:e}var Fn=mn.extend({determineDataLimits:function(){var t,e,n,i,a,r,o=this,s=o.options,l=o.chart,u=l.data.datasets,d=o.isHorizontal();function h(t){return d?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e)&&void 0!==e.stack){c=!0;break}if(s.stacked||c){var f={};for(t=0;t<u.length;t++){var g=[(e=l.getDatasetMeta(t)).type,void 0===s.stacked&&void 0===e.stack?t:"",e.stack].join(".");if(l.isDatasetVisible(t)&&h(e))for(void 0===f[g]&&(f[g]=[]),a=0,r=(i=u[t].data).length;a<r;a++){var p=f[g];n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(p[a]=p[a]||0,p[a]+=n.max)}}H.each(f,(function(t){if(t.length>0){var e=H.min(t),n=H.max(t);o.min=Math.min(o.min,e),o.max=Math.max(o.max,n)}}))}else for(t=0;t<u.length;t++)if(e=l.getDatasetMeta(t),l.isDatasetVisible(t)&&h(e))for(a=0,r=(i=u[t].data).length;a<r;a++)n=o._parseValue(i[a]),isNaN(n.min)||isNaN(n.max)||e.data[a].hidden||n.min<0||n.max<0||(o.min=Math.min(n.min,o.min),o.max=Math.max(n.max,o.max),0!==n.min&&(o.minNotZero=Math.min(n.min,o.minNotZero)));o.min=H.isFinite(o.min)?o.min:null,o.max=H.isFinite(o.max)?o.max:null,o.minNotZero=H.isFinite(o.minNotZero)?o.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=In(e.min,t.min),t.max=In(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(Dn(t.min))-1),t.max=Math.pow(10,Math.floor(Dn(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(Dn(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(Dn(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(Dn(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,n=!t.isHorizontal(),i={min:In(e.min),max:In(e.max)},a=t.ticks=function(t,e){var n,i,a=[],r=An(t.min,Math.pow(10,Math.floor(Dn(e.min)))),o=Math.floor(Dn(e.max)),s=Math.ceil(e.max/Math.pow(10,o));0===r?(n=Math.floor(Dn(e.minNotZero)),i=Math.floor(e.minNotZero/Math.pow(10,n)),a.push(r),r=i*Math.pow(10,n)):(n=Math.floor(Dn(r)),i=Math.floor(r/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{a.push(r),10===++i&&(i=1,l=++n>=0?1:l),r=Math.round(i*Math.pow(10,n)*l)/l}while(n<o||n===o&&i<s);var u=An(t.max,r);return a.push(u),a}(i,t);t.max=H.max(a),t.min=H.min(a),e.reverse?(n=!n,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n&&a.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),mn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(Dn(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,n=0;mn.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),n=An(t.options.ticks.fontSize,N.global.defaultFontSize)/t._length),t._startValue=Dn(e),t._valueOffset=n,t._valueRange=(Dn(t.max)-Dn(e))/(1-n)},getPixelForValue:function(t){var e=this,n=0;return(t=+e.getRightValue(t))>e.min&&t>0&&(n=(Dn(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(n)},getValueForPixel:function(t){var e=this,n=e.getDecimalForPixel(t);return 0===n&&0===e.min?0:Math.pow(10,e._startValue+(n-e._valueOffset)*e._valueRange)}}),On=Tn;Fn._defaults=On;var Ln=H.valueOrDefault,Rn=H.valueAtIndexOrDefault,zn=H.options.resolve,Nn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:en.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}};function Bn(t){var e=t.ticks;return e.display&&t.display?Ln(e.fontSize,N.global.defaultFontSize)+2*e.backdropPaddingY:0}function En(t,e,n,i,a){return t===i||t===a?{start:e-n/2,end:e+n/2}:t<i||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function Wn(t){return 0===t||180===t?"center":t<180?"left":"right"}function Vn(t,e,n,i){var a,r,o=n.y+i/2;if(H.isArray(e))for(a=0,r=e.length;a<r;++a)t.fillText(e[a],n.x,o),o+=i;else t.fillText(e,n.x,o)}function Hn(t,e,n){90===t||270===t?n.y-=e.h/2:(t>270||t<90)&&(n.y-=e.h)}function jn(t){return H.isNumber(t)?t:0}var qn=kn.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Bn(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;H.each(e.data.datasets,(function(a,r){if(e.isDatasetVisible(r)){var o=e.getDatasetMeta(r);H.each(a.data,(function(e,a){var r=+t.getRightValue(e);isNaN(r)||o.data[a].hidden||(n=Math.min(r,n),i=Math.max(r,i))}))}})),t.min=n===Number.POSITIVE_INFINITY?0:n,t.max=i===Number.NEGATIVE_INFINITY?0:i,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/Bn(this.options))},convertTicksToLabels:function(){var t=this;kn.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map((function(){var e=H.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""}))},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this.options;t.display&&t.pointLabels.display?function(t){var e,n,i,a=H.options._parseFont(t.options.pointLabels),r={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={};t.ctx.font=a.string,t._pointLabelSizes=[];var s,l,u,d=t.chart.data.labels.length;for(e=0;e<d;e++){i=t.getPointPosition(e,t.drawingArea+5),s=t.ctx,l=a.lineHeight,u=t.pointLabels[e],n=H.isArray(u)?{w:H.longestText(s,s.font,u),h:u.length*l}:{w:s.measureText(u).width,h:l},t._pointLabelSizes[e]=n;var h=t.getIndexAngle(e),c=H.toDegrees(h)%360,f=En(c,i.x,n.w,0,180),g=En(c,i.y,n.h,90,270);f.start<r.l&&(r.l=f.start,o.l=h),f.end>r.r&&(r.r=f.end,o.r=h),g.start<r.t&&(r.t=g.start,o.t=h),g.end>r.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,n){var i=this,a=e.l/Math.sin(n.l),r=Math.max(e.r-i.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),s=-Math.max(e.b-(i.height-i.paddingTop),0)/Math.cos(n.b);a=jn(a),r=jn(r),o=jn(o),s=jn(s),i.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),i.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,n,i){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=n+a.drawingArea,l=a.height-a.paddingTop-i-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,n=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(H.isNullOrUndef(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*n:(t-e.min)*n},getPointPosition:function(t,e){var n=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,n=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0)},_drawGrid:function(){var t,e,n,i=this,a=i.ctx,r=i.options,o=r.gridLines,s=r.angleLines,l=Ln(s.lineWidth,o.lineWidth),u=Ln(s.color,o.color);if(r.pointLabels.display&&function(t){var e=t.ctx,n=t.options,i=n.pointLabels,a=Bn(n),r=t.getDistanceFromCenterForValue(n.ticks.reverse?t.min:t.max),o=H.options._parseFont(i);e.save(),e.font=o.string,e.textBaseline="middle";for(var s=t.chart.data.labels.length-1;s>=0;s--){var l=0===s?a/2:0,u=t.getPointPosition(s,r+l+5),d=Rn(i.fontColor,s,N.global.defaultFontColor);e.fillStyle=d;var h=t.getIndexAngle(s),c=H.toDegrees(h);e.textAlign=Wn(c),Hn(c,t._pointLabelSizes[s],u),Vn(e,t.pointLabels[s],u,o.lineHeight)}e.restore()}(i),o.display&&H.each(i.ticks,(function(t,n){0!==n&&(e=i.getDistanceFromCenterForValue(i.ticksAsNumbers[n]),function(t,e,n,i){var a,r=t.ctx,o=e.circular,s=t.chart.data.labels.length,l=Rn(e.color,i-1),u=Rn(e.lineWidth,i-1);if((o||s)&&l&&u){if(r.save(),r.strokeStyle=l,r.lineWidth=u,r.setLineDash&&(r.setLineDash(e.borderDash||[]),r.lineDashOffset=e.borderDashOffset||0),r.beginPath(),o)r.arc(t.xCenter,t.yCenter,n,0,2*Math.PI);else{a=t.getPointPosition(0,n),r.moveTo(a.x,a.y);for(var d=1;d<s;d++)a=t.getPointPosition(d,n),r.lineTo(a.x,a.y)}r.closePath(),r.stroke(),r.restore()}}(i,o,e,n))})),s.display&&l&&u){for(a.save(),a.lineWidth=l,a.strokeStyle=u,a.setLineDash&&(a.setLineDash(zn([s.borderDash,o.borderDash,[]])),a.lineDashOffset=zn([s.borderDashOffset,o.borderDashOffset,0])),t=i.chart.data.labels.length-1;t>=0;t--)e=i.getDistanceFromCenterForValue(r.ticks.reverse?i.min:i.max),n=i.getPointPosition(t,e),a.beginPath(),a.moveTo(i.xCenter,i.yCenter),a.lineTo(n.x,n.y),a.stroke();a.restore()}},_drawLabels:function(){var t=this,e=t.ctx,n=t.options.ticks;if(n.display){var i,a,r=t.getIndexAngle(0),o=H.options._parseFont(n),s=Ln(n.fontColor,N.global.defaultFontColor);e.save(),e.font=o.string,e.translate(t.xCenter,t.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",H.each(t.ticks,(function(r,l){(0!==l||n.reverse)&&(i=t.getDistanceFromCenterForValue(t.ticksAsNumbers[l]),n.showLabelBackdrop&&(a=e.measureText(r).width,e.fillStyle=n.backdropColor,e.fillRect(-a/2-n.backdropPaddingX,-i-o.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,o.size+2*n.backdropPaddingY)),e.fillStyle=s,e.fillText(r,0,-i))})),e.restore()}},_drawTitle:H.noop}),Un=Nn;qn._defaults=Un;var Yn=H._deprecated,$n=H.options.resolve,Gn=H.valueOrDefault,Xn=Number.MIN_SAFE_INTEGER||-9007199254740991,Kn=Number.MAX_SAFE_INTEGER||9007199254740991,Zn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Jn=Object.keys(Zn);function Qn(t,e){return t-e}function ti(t){return H.valueOrDefault(t.time.min,t.ticks.min)}function ei(t){return H.valueOrDefault(t.time.max,t.ticks.max)}function ni(t,e,n,i){var a=function(t,e,n){for(var i,a,r,o=0,s=t.length-1;o>=0&&o<=s;){if(a=t[(i=o+s>>1)-1]||null,r=t[i],!a)return{lo:null,hi:r};if(r[e]<n)o=i+1;else{if(!(a[e]>n))return{lo:a,hi:r};s=i-1}}return{lo:r,hi:null}}(t,e,n),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?(n-r[e])/s:0,u=(o[i]-r[i])*l;return r[i]+u}function ii(t,e){var n=t._adapter,i=t.options.time,a=i.parser,r=a||i.format,o=e;return"function"==typeof a&&(o=a(o)),H.isFinite(o)||(o="string"==typeof r?n.parse(o,r):n.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),H.isFinite(o)||(o=n.parse(o))),o)}function ai(t,e){if(H.isNullOrUndef(e))return null;var n=t.options.time,i=ii(t,t.getRightValue(e));return null===i||n.round&&(i=+t._adapter.startOf(i,n.round)),i}function ri(t,e,n,i){var a,r,o,s=Jn.length;for(a=Jn.indexOf(t);a<s-1;++a)if(o=(r=Zn[Jn[a]]).steps?r.steps:Kn,r.common&&Math.ceil((n-e)/(o*r.size))<=i)return Jn[a];return Jn[s-1]}function oi(t,e,n){var i,a,r=[],o={},s=e.length;for(i=0;i<s;++i)o[a=e[i]]=i,r.push({value:a,major:!1});return 0!==s&&n?function(t,e,n,i){var a,r,o=t._adapter,s=+o.startOf(e[0].value,i),l=e[e.length-1].value;for(a=s;a<=l;a=+o.add(a,1,i))(r=n[a])>=0&&(e[r].major=!0);return e}(t,r,o,n):r}var si=mn.extend({initialize:function(){this.mergeTicksOptions(),mn.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,n=e.time||(e.time={}),i=t._adapter=new tn._date(e.adapters.date);return Yn("time scale",n.format,"time.format","time.parser"),Yn("time scale",n.min,"time.min","ticks.min"),Yn("time scale",n.max,"time.max","ticks.max"),H.mergeIf(n.displayFormats,i.formats()),mn.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),mn.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,n,i,a,r,o,s=this,l=s.chart,u=s._adapter,d=s.options,h=d.time.unit||"day",c=Kn,f=Xn,g=[],p=[],m=[],v=s._getLabels();for(t=0,n=v.length;t<n;++t)m.push(ai(s,v[t]));for(t=0,n=(l.data.datasets||[]).length;t<n;++t)if(l.isDatasetVisible(t))if(a=l.data.datasets[t].data,H.isObject(a[0]))for(p[t]=[],e=0,i=a.length;e<i;++e)r=ai(s,a[e]),g.push(r),p[t][e]=r;else p[t]=m.slice(0),o||(g=g.concat(m),o=!0);else p[t]=[];m.length&&(c=Math.min(c,m[0]),f=Math.max(f,m[m.length-1])),g.length&&(g=n>1?function(t){var e,n,i,a={},r=[];for(e=0,n=t.length;e<n;++e)a[i=t[e]]||(a[i]=!0,r.push(i));return r}(g).sort(Qn):g.sort(Qn),c=Math.min(c,g[0]),f=Math.max(f,g[g.length-1])),c=ai(s,ti(d))||c,f=ai(s,ei(d))||f,c=c===Kn?+u.startOf(Date.now(),h):c,f=f===Xn?+u.endOf(Date.now(),h)+1:f,s.min=Math.min(c,f),s.max=Math.max(c+1,f),s._table=[],s._timestamps={data:g,datasets:p,labels:m}},buildTicks:function(){var t,e,n,i=this,a=i.min,r=i.max,o=i.options,s=o.ticks,l=o.time,u=i._timestamps,d=[],h=i.getLabelCapacity(a),c=s.source,f=o.distribution;for(u="data"===c||"auto"===c&&"series"===f?u.data:"labels"===c?u.labels:function(t,e,n,i){var a,r=t._adapter,o=t.options,s=o.time,l=s.unit||ri(s.minUnit,e,n,i),u=$n([s.stepSize,s.unitStepSize,1]),d="week"===l&&s.isoWeekday,h=e,c=[];if(d&&(h=+r.startOf(h,"isoWeek",d)),h=+r.startOf(h,d?"day":l),r.diff(n,e,l)>1e5*u)throw e+" and "+n+" are too far apart with stepSize of "+u+" "+l;for(a=h;a<n;a=+r.add(a,u,l))c.push(a);return a!==n&&"ticks"!==o.bounds||c.push(a),c}(i,a,r,h),"ticks"===o.bounds&&u.length&&(a=u[0],r=u[u.length-1]),a=ai(i,ti(o))||a,r=ai(i,ei(o))||r,t=0,e=u.length;t<e;++t)(n=u[t])>=a&&n<=r&&d.push(n);return i.min=a,i.max=r,i._unit=l.unit||(s.autoSkip?ri(l.minUnit,i.min,i.max,h):function(t,e,n,i,a){var r,o;for(r=Jn.length-1;r>=Jn.indexOf(n);r--)if(o=Jn[r],Zn[o].common&&t._adapter.diff(a,i,o)>=e-1)return o;return Jn[n?Jn.indexOf(n):0]}(i,d.length,l.minUnit,i.min,i.max)),i._majorUnit=s.major.enabled&&"year"!==i._unit?function(t){for(var e=Jn.indexOf(t)+1,n=Jn.length;e<n;++e)if(Zn[Jn[e]].common)return Jn[e]}(i._unit):void 0,i._table=function(t,e,n,i){if("linear"===i||!t.length)return[{time:e,pos:0},{time:n,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<n&&d.push(s);for(d.push(n),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}(i._timestamps.data,a,r,f),i._offsets=function(t,e,n,i,a){var r,o,s=0,l=0;return a.offset&&e.length&&(r=ni(t,"time",e[0],"pos"),s=1===e.length?1-r:(ni(t,"time",e[1],"pos")-r)/2,o=ni(t,"time",e[e.length-1],"pos"),l=1===e.length?o:(o-ni(t,"time",e[e.length-2],"pos"))/2),{start:s,end:l,factor:1/(s+1+l)}}(i._table,d,0,0,o),s.reverse&&d.reverse(),oi(i,d,i._majorUnit)},getLabelForIndex:function(t,e){var n=this,i=n._adapter,a=n.chart.data,r=n.options.time,o=a.labels&&t<a.labels.length?a.labels[t]:"",s=a.datasets[e].data[t];return H.isObject(s)&&(o=n.getRightValue(s)),r.tooltipFormat?i.format(ii(n,o),r.tooltipFormat):"string"==typeof o?o:i.format(ii(n,o),r.displayFormats.datetime)},tickFormatFunction:function(t,e,n,i){var a=this._adapter,r=this.options,o=r.time.displayFormats,s=o[this._unit],l=this._majorUnit,u=o[l],d=n[e],h=r.ticks,c=l&&u&&d&&d.major,f=a.format(t,i||(c?u:s)),g=c?h.major:h.minor,p=$n([g.callback,g.userCallback,h.callback,h.userCallback]);return p?p(f,e,n):f},convertTicksToLabels:function(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(this.tickFormatFunction(t[e].value,e,t));return i},getPixelForOffset:function(t){var e=this._offsets,n=ni(this._table,"time",t,"pos");return this.getPixelForDecimal((e.start+n)*e.factor)},getPixelForValue:function(t,e,n){var i=null;if(void 0!==e&&void 0!==n&&(i=this._timestamps.datasets[n][e]),null===i&&(i=ai(this,t)),null!==i)return this.getPixelForOffset(i)},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._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end,i=ni(this._table,"pos",n,"time");return this._adapter._create(i)},_getLabelSize:function(t){var e=this.options.ticks,n=this.ctx.measureText(t).width,i=H.toRadians(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(i),r=Math.sin(i),o=Gn(e.fontSize,N.global.defaultFontSize);return{w:n*a+o*r,h:n*r+o*a}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,n=e.options.time,i=n.displayFormats,a=i[n.unit]||i.millisecond,r=e.tickFormatFunction(t,0,oi(e,[t],e._majorUnit),a),o=e._getLabelSize(r),s=Math.floor(e.isHorizontal()?e.width/o.w:e.height/o.h);return e.options.offset&&s--,s>0?s:1}}),li={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};si._defaults=li;var ui={category:bn,linear:Cn,logarithmic:Fn,radialLinear:qn,time:si},di={datetime:"MMM D, YYYY, h:mm:ss a",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"};tn._date.override("function"==typeof t?{_id:"moment",formats:function(){return di},parse:function(e,n){return"string"==typeof e&&"string"==typeof n?e=t(e,n):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,n){return t(e).format(n)},add:function(e,n,i){return t(e).add(n,i).valueOf()},diff:function(e,n,i){return t(e).diff(t(n),i)},startOf:function(e,n,i){return e=t(e),"isoWeek"===n?e.isoWeekday(i).valueOf():e.startOf(n).valueOf()},endOf:function(e,n){return t(e).endOf(n).valueOf()},_create:function(e){return t(e)}}:{}),N._set("global",{plugins:{filler:{propagate:!0}}});var hi={dataset:function(t){var e=t.fill,n=t.chart,i=n.getDatasetMeta(e),a=i&&n.isDatasetVisible(e)&&i.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,n=e?e.x:null,i=e?e.y:null;return H.isArray(e)?function(t,n){return e[n]}:function(t){return{x:null===n?t.x:n,y:null===i?t.y:i}}}};function ci(t,e,n){var i,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(i=parseFloat(r,10),isFinite(i)&&Math.floor(i)===i)return"-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i;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 fi(t){return(t.el._scale||{}).getPointPositionForValue?function(t){var e,n,i,a,r,o=t.el._scale,s=o.options,l=o.chart.data.labels.length,u=t.fill,d=[];if(!l)return null;for(e=s.ticks.reverse?o.max:o.min,n=s.ticks.reverse?o.min:o.max,i=o.getPointPositionForValue(0,e),a=0;a<l;++a)r="start"===u||"end"===u?o.getPointPositionForValue(a,"start"===u?e:n):o.getBasePosition(a),s.gridLines.circular&&(r.cx=i.x,r.cy=i.y,r.angle=o.getIndexAngle(a)-Math.PI/2),d.push(r);return d}(t):function(t){var e,n=t.el._model||{},i=t.el._scale||{},a=t.fill,r=null;if(isFinite(a))return null;if("start"===a?r=void 0===n.scaleBottom?i.bottom:n.scaleBottom:"end"===a?r=void 0===n.scaleTop?i.top:n.scaleTop:void 0!==n.scaleZero?r=n.scaleZero:i.getBasePixel&&(r=i.getBasePixel()),null!=r){if(void 0!==r.x&&void 0!==r.y)return r;if(H.isFinite(r))return{x:(e=i.isHorizontal())?r:null,y:e?null:r}}return null}(t)}function gi(t,e,n){var i,a=t[e].fill,r=[e];if(!n)return a;for(;!1!==a&&-1===r.indexOf(a);){if(!isFinite(a))return a;if(!(i=t[a]))return!1;if(i.visible)return a;r.push(a),a=i.fill}return!1}function pi(t){var e=t.fill,n="dataset";return!1===e?null:(isFinite(e)||(n="boundary"),hi[n](t))}function mi(t){return t&&!t.skip}function vi(t,e,n,i,a){var r,o,s,l;if(i&&a){for(t.moveTo(e[0].x,e[0].y),r=1;r<i;++r)H.canvas.lineTo(t,e[r-1],e[r]);if(void 0===n[0].angle)for(t.lineTo(n[a-1].x,n[a-1].y),r=a-1;r>0;--r)H.canvas.lineTo(t,n[r],n[r-1],!0);else for(o=n[0].cx,s=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-o,2)+Math.pow(n[0].y-s,2)),r=a-1;r>0;--r)t.arc(o,s,l,n[r].angle,n[r-1].angle,!0)}}function bi(t,e,n,i,a,r){var o,s,l,u,d,h,c,f,g=e.length,p=i.spanGaps,m=[],v=[],b=0,x=0;for(t.beginPath(),o=0,s=g;o<s;++o)d=n(u=e[l=o%g]._view,l,i),h=mi(u),c=mi(d),r&&void 0===f&&h&&(s=g+(f=o+1)),h&&c?(b=m.push(u),x=v.push(d)):b&&x&&(p?(h&&m.push(u),c&&v.push(d)):(vi(t,m,v,b,x),b=x=0,m=[],v=[]));vi(t,m,v,b,x),t.closePath(),t.fillStyle=a,t.fill()}var xi={id:"filler",afterDatasetsUpdate:function(t,e){var n,i,a,r,o=(t.data.datasets||[]).length,s=e.propagate,l=[];for(i=0;i<o;++i)r=null,(a=(n=t.getDatasetMeta(i)).dataset)&&a._model&&a instanceof kt.Line&&(r={visible:t.isDatasetVisible(i),fill:ci(a,i,o),chart:t,el:a}),n.$filler=r,l.push(r);for(i=0;i<o;++i)(r=l[i])&&(r.fill=gi(l,i,s),r.boundary=fi(r),r.mapper=pi(r))},beforeDatasetsDraw:function(t){var e,n,i,a,r,o,s,l=t._getSortedVisibleDatasetMetas(),u=t.ctx;for(n=l.length-1;n>=0;--n)(e=l[n].$filler)&&e.visible&&(a=(i=e.el)._view,r=i._children||[],o=e.mapper,s=a.backgroundColor||N.global.defaultColor,o&&s&&r.length&&(H.canvas.clipArea(u,t.chartArea),bi(u,r,o,a,s,i._loop),H.canvas.unclipArea(u)))}},yi=H.rtl.getRtlAdapter,_i=H.noop,ki=H.valueOrDefault;function wi(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}N._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var n=e.datasetIndex,i=this.chart,a=i.getDatasetMeta(n);a.hidden=null===a.hidden?!i.data.datasets[n].hidden:null,i.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.options.legend||{},i=n.labels&&n.labels.usePointStyle;return t._getSortedDatasetMetas().map((function(n){var a=n.controller.getStyle(i?0:void 0);return{text:e[n.index].label,fillStyle:a.backgroundColor,hidden:!t.isDatasetVisible(n.index),lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:a.borderWidth,strokeStyle:a.borderColor,pointStyle:a.pointStyle,rotation:a.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(t){var e,n,i,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,n=r.length;e<n;e++)(i=a.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=r[e].backgroundColor,r[e].label&&i.appendChild(document.createTextNode(r[e].label));return a.outerHTML}});var Mi=X.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:_i,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:_i,beforeSetDimensions:_i,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:_i,beforeBuildLabels:_i,buildLabels:function(){var t=this,e=t.options.labels||{},n=H.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n},afterBuildLabels:_i,beforeFit:_i,fit:function(){var t=this,e=t.options,n=e.labels,i=e.display,a=t.ctx,r=H.options._parseFont(n),o=r.size,s=t.legendHitBoxes=[],l=t.minSize,u=t.isHorizontal();if(u?(l.width=t.maxWidth,l.height=i?10:0):(l.width=i?10:0,l.height=t.maxHeight),i){if(a.font=r.string,u){var d=t.lineWidths=[0],h=0;a.textAlign="left",a.textBaseline="middle",H.each(t.legendItems,(function(t,e){var i=wi(n,o)+o/2+a.measureText(t.text).width;(0===e||d[d.length-1]+i+2*n.padding>l.width)&&(h+=o+n.padding,d[d.length-(e>0?0:1)]=0),s[e]={left:0,top:0,width:i,height:o},d[d.length-1]+=i+n.padding})),l.height+=h}else{var c=n.padding,f=t.columnWidths=[],g=t.columnHeights=[],p=n.padding,m=0,v=0;H.each(t.legendItems,(function(t,e){var i=wi(n,o)+o/2+a.measureText(t.text).width;e>0&&v+o+2*c>l.height&&(p+=m+n.padding,f.push(m),g.push(v),m=0,v=0),m=Math.max(m,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}})),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:_i,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,n=e.labels,i=N.global,a=i.defaultColor,r=i.elements.line,o=t.height,s=t.columnHeights,l=t.width,u=t.lineWidths;if(e.display){var d,h=yi(e.rtl,t.left,t.minSize.width),c=t.ctx,f=ki(n.fontColor,i.defaultFontColor),g=H.options._parseFont(n),p=g.size;c.textAlign=h.textAlign("left"),c.textBaseline="middle",c.lineWidth=.5,c.strokeStyle=f,c.fillStyle=f,c.font=g.string;var m=wi(n,p),v=t.legendHitBoxes,b=function(t,i){switch(e.align){case"start":return n.padding;case"end":return t-i;default:return(t-i+n.padding)/2}},x=t.isHorizontal();d=x?{x:t.left+b(l,u[0]),y:t.top+n.padding,line:0}:{x:t.left+n.padding,y:t.top+b(o,s[0]),line:0},H.rtl.overrideTextDirection(t.ctx,e.textDirection);var y=p+n.padding;H.each(t.legendItems,(function(e,i){var f=c.measureText(e.text).width,g=m+p/2+f,_=d.x,k=d.y;h.setWidth(t.minSize.width),x?i>0&&_+g+n.padding>t.left+t.minSize.width&&(k=d.y+=y,d.line++,_=d.x=t.left+b(l,u[d.line])):i>0&&k+y>t.top+t.minSize.height&&(_=d.x=_+t.columnWidths[d.line]+n.padding,d.line++,k=d.y=t.top+b(o,s[d.line]));var w=h.x(_);!function(t,e,i){if(!(isNaN(m)||m<=0)){c.save();var o=ki(i.lineWidth,r.borderWidth);if(c.fillStyle=ki(i.fillStyle,a),c.lineCap=ki(i.lineCap,r.borderCapStyle),c.lineDashOffset=ki(i.lineDashOffset,r.borderDashOffset),c.lineJoin=ki(i.lineJoin,r.borderJoinStyle),c.lineWidth=o,c.strokeStyle=ki(i.strokeStyle,a),c.setLineDash&&c.setLineDash(ki(i.lineDash,r.borderDash)),n&&n.usePointStyle){var s=m*Math.SQRT2/2,l=h.xPlus(t,m/2),u=e+p/2;H.canvas.drawPoint(c,i.pointStyle,s,l,u,i.rotation)}else c.fillRect(h.leftForLtr(t,m),e,m,p),0!==o&&c.strokeRect(h.leftForLtr(t,m),e,m,p);c.restore()}}(w,k,e),v[i].left=h.leftForLtr(w,v[i].width),v[i].top=k,function(t,e,n,i){var a=p/2,r=h.xPlus(t,m+a),o=e+a;c.fillText(n.text,r,o),n.hidden&&(c.beginPath(),c.lineWidth=2,c.moveTo(r,o),c.lineTo(h.xPlus(r,i),o),c.stroke())}(w,k,e,f),x?d.x+=g+n.padding:d.y+=y})),H.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var n,i,a,r=this;if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)for(a=r.legendHitBoxes,n=0;n<a.length;++n)if(t>=(i=a[n]).left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height)return r.legendItems[n];return null},handleEvent:function(t){var e,n=this,i=n.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!i.onHover&&!i.onLeave)return}else{if("click"!==a)return;if(!i.onClick)return}e=n._getLegendItemAt(t.x,t.y),"click"===a?e&&i.onClick&&i.onClick.call(n,t.native,e):(i.onLeave&&e!==n._hoveredItem&&(n._hoveredItem&&i.onLeave.call(n,t.native,n._hoveredItem),n._hoveredItem=e),i.onHover&&e&&i.onHover.call(n,t.native,e))}});function Si(t,e){var n=new Mi({ctx:t.ctx,options:e,chart:t});pe.configure(t,n,e),pe.addBox(t,n),t.legend=n}var Ci={id:"legend",_element:Mi,beforeInit:function(t){var e=t.options.legend;e&&Si(t,e)},beforeUpdate:function(t){var e=t.options.legend,n=t.legend;e?(H.mergeIf(e,N.global.legend),n?(pe.configure(t,n,e),n.options=e):Si(t,e)):n&&(pe.removeBox(t,n),delete t.legend)},afterEvent:function(t,e){var n=t.legend;n&&n.handleEvent(e)}},Pi=H.noop;N._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Ai=X.extend({initialize:function(t){H.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:Pi,update:function(t,e,n){var i=this;return i.beforeUpdate(),i.maxWidth=t,i.maxHeight=e,i.margins=n,i.beforeSetDimensions(),i.setDimensions(),i.afterSetDimensions(),i.beforeBuildLabels(),i.buildLabels(),i.afterBuildLabels(),i.beforeFit(),i.fit(),i.afterFit(),i.afterUpdate(),i.minSize},afterUpdate:Pi,beforeSetDimensions:Pi,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:Pi,beforeBuildLabels:Pi,buildLabels:Pi,afterBuildLabels:Pi,beforeFit:Pi,fit:function(){var t,e=this,n=e.options,i=e.minSize={},a=e.isHorizontal();n.display?(t=(H.isArray(n.text)?n.text.length:1)*H.options._parseFont(n).lineHeight+2*n.padding,e.width=i.width=a?e.maxWidth:t,e.height=i.height=a?t:e.maxHeight):e.width=i.width=e.height=i.height=0},afterFit:Pi,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var i,a,r,o=H.options._parseFont(n),s=o.lineHeight,l=s/2+n.padding,u=0,d=t.top,h=t.left,c=t.bottom,f=t.right;e.fillStyle=H.valueOrDefault(n.fontColor,N.global.defaultFontColor),e.font=o.string,t.isHorizontal()?(a=h+(f-h)/2,r=d+l,i=f-h):(a="left"===n.position?h+l:f-l,r=d+(c-d)/2,i=c-d,u=Math.PI*("left"===n.position?-.5:.5)),e.save(),e.translate(a,r),e.rotate(u),e.textAlign="center",e.textBaseline="middle";var g=n.text;if(H.isArray(g))for(var p=0,m=0;m<g.length;++m)e.fillText(g[m],0,p,i),p+=s;else e.fillText(g,0,0,i);e.restore()}}});function Di(t,e){var n=new Ai({ctx:t.ctx,options:e,chart:t});pe.configure(t,n,e),pe.addBox(t,n),t.titleBlock=n}var Ti={},Ii=xi,Fi=Ci,Oi={id:"title",_element:Ai,beforeInit:function(t){var e=t.options.title;e&&Di(t,e)},beforeUpdate:function(t){var e=t.options.title,n=t.titleBlock;e?(H.mergeIf(e,N.global.title),n?(pe.configure(t,n,e),n.options=e):Di(t,e)):n&&(pe.removeBox(t,n),delete t.titleBlock)}};for(var Li in Ti.filler=Ii,Ti.legend=Fi,Ti.title=Oi,Ze.helpers=H,function(){function t(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function e(t){return null!=t&&"none"!==t}function n(n,i,a){var r=document.defaultView,o=H._getParentNode(n),s=r.getComputedStyle(n)[i],l=r.getComputedStyle(o)[i],u=e(s),d=e(l),h=Number.POSITIVE_INFINITY;return u||d?Math.min(u?t(s,n,a):h,d?t(l,o,a):h):"none"}H.where=function(t,e){if(H.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return H.each(t,(function(t){e(t)&&n.push(t)})),n},H.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},H.findNextWhere=function(t,e,n){H.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},H.findPreviousWhere=function(t,e,n){H.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},H.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},H.almostEquals=function(t,e,n){return Math.abs(t-e)<n},H.almostWhole=function(t,e){var n=Math.round(t);return n-e<=t&&n+e>=t},H.max=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.max(t,e)}),Number.NEGATIVE_INFINITY)},H.min=function(t){return t.reduce((function(t,e){return isNaN(e)?t:Math.min(t,e)}),Number.POSITIVE_INFINITY)},H.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0===(t=+t)||isNaN(t)?t:t>0?1:-1},H.toRadians=function(t){return t*(Math.PI/180)},H.toDegrees=function(t){return t*(180/Math.PI)},H._decimalPlaces=function(t){if(H.isFinite(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}},H.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},H.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},H.aliasPixel=function(t){return t%2==0?0:.5},H._alignPixel=function(t,e,n){var i=t.currentDevicePixelRatio,a=n/2;return Math.round((e-a)*i)/i+a},H.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,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=i*(u=isNaN(u)?0:u),c=i*(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)}}},H.EPSILON=Number.EPSILON||1e-14,H.splineCurveMonotone=function(t){var e,n,i,a,r,o,s,l,u,d=(t||[]).map((function(t){return{model:t._model,deltaK:0,mK:0}})),h=d.length;for(e=0;e<h;++e)if(!(i=d[e]).model.skip){if(n=e>0?d[e-1]:null,(a=e<h-1?d[e+1]:null)&&!a.model.skip){var c=a.model.x-i.model.x;i.deltaK=0!==c?(a.model.y-i.model.y)/c:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}for(e=0;e<h-1;++e)i=d[e],a=d[e+1],i.model.skip||a.model.skip||(H.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(r=i.mK/i.deltaK,o=a.mK/i.deltaK,(l=Math.pow(r,2)+Math.pow(o,2))<=9||(s=3/Math.sqrt(l),i.mK=r*s*i.deltaK,a.mK=o*s*i.deltaK)));for(e=0;e<h;++e)(i=d[e]).model.skip||(n=e>0?d[e-1]:null,a=e<h-1?d[e+1]:null,n&&!n.model.skip&&(u=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-u,i.model.controlPointPreviousY=i.model.y-u*i.mK),a&&!a.model.skip&&(u=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+u,i.model.controlPointNextY=i.model.y+u*i.mK))},H.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},H.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},H.niceNum=function(t,e){var n=Math.floor(H.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},H.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)},H.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;s&&s.length>0?(n=s[0].clientX,i=s[0].clientY):(n=a.clientX,i=a.clientY);var l=parseFloat(H.getStyle(r,"padding-left")),u=parseFloat(H.getStyle(r,"padding-top")),d=parseFloat(H.getStyle(r,"padding-right")),h=parseFloat(H.getStyle(r,"padding-bottom")),c=o.right-o.left-l-d,f=o.bottom-o.top-u-h;return{x:n=Math.round((n-o.left-l)/c*r.width/e.currentDevicePixelRatio),y:i=Math.round((i-o.top-u)/f*r.height/e.currentDevicePixelRatio)}},H.getConstraintWidth=function(t){return n(t,"max-width","clientWidth")},H.getConstraintHeight=function(t){return n(t,"max-height","clientHeight")},H._calculatePadding=function(t,e,n){return(e=H.getStyle(t,e)).indexOf("%")>-1?n*parseInt(e,10)/100:parseInt(e,10)},H._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},H.getMaximumWidth=function(t){var e=H._getParentNode(t);if(!e)return t.clientWidth;var n=e.clientWidth,i=n-H._calculatePadding(e,"padding-left",n)-H._calculatePadding(e,"padding-right",n),a=H.getConstraintWidth(t);return isNaN(a)?i:Math.min(i,a)},H.getMaximumHeight=function(t){var e=H._getParentNode(t);if(!e)return t.clientHeight;var n=e.clientHeight,i=n-H._calculatePadding(e,"padding-top",n)-H._calculatePadding(e,"padding-bottom",n),a=H.getConstraintHeight(t);return isNaN(a)?i:Math.min(i,a)},H.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},H.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height||i.style.width||(i.style.height=a+"px",i.style.width=r+"px")}},H.fontString=function(t,e,n){return e+" "+t+"px "+n},H.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},r=i.garbageCollect=[],i.font=e),t.font=e;var o,s,l,u,d,h=0,c=n.length;for(o=0;o<c;o++)if(null!=(u=n[o])&&!0!==H.isArray(u))h=H.measureText(t,a,r,h,u);else if(H.isArray(u))for(s=0,l=u.length;s<l;s++)null==(d=u[s])||H.isArray(d)||(h=H.measureText(t,a,r,h,d));var f=r.length/2;if(f>n.length){for(o=0;o<f;o++)delete a[r[o]];r.splice(0,f)}return h},H.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},H.numberOfLabelLines=function(t){var e=1;return H.each(t,(function(t){H.isArray(t)&&t.length>e&&(e=t.length)})),e},H.color=_?function(t){return t instanceof CanvasGradient&&(t=N.global.defaultColor),_(t)}:function(t){return console.error("Color.js not found!"),t},H.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:H.color(t).saturate(.5).darken(.1).rgbString()}}(),Ze._adapters=tn,Ze.Animation=Z,Ze.animationService=J,Ze.controllers=Jt,Ze.DatasetController=it,Ze.defaults=N,Ze.Element=X,Ze.elements=kt,Ze.Interaction=re,Ze.layouts=pe,Ze.platform=De,Ze.plugins=Te,Ze.Scale=mn,Ze.scaleService=Ie,Ze.Ticks=en,Ze.Tooltip=He,Ze.helpers.each(ui,(function(t,e){Ze.scaleService.registerScaleType(e,t,t._defaults)})),Ti)Ti.hasOwnProperty(Li)&&Ze.plugins.register(Ti[Li]);Ze.platform.initialize();var Ri=Ze;return"undefined"!=typeof window&&(window.Chart=Ze),Ze.Chart=Ze,Ze.Legend=Ti.legend._element,Ze.Title=Ti.title._element,Ze.pluginService=Ze.plugins,Ze.PluginBase=Ze.Element.extend({}),Ze.canvasHelpers=Ze.helpers.canvas,Ze.layoutService=Ze.layouts,Ze.LinearScaleBase=kn,Ze.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(t){Ze[t]=function(e,n){return new Ze(e,Ze.helpers.merge(n||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}})),Ri})),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}((function(t){var e=-1,n=-1,i=function(t){return parseFloat(t)||0},a=function(e){var n=t(e),a=null,r=[];return n.each((function(){var e=t(this),n=e.offset().top-i(e.css("margin-top")),o=r.length>0?r[r.length-1]:null;null===o?r.push(e):Math.floor(Math.abs(a-n))<=1?r[r.length-1]=o.add(e):r.push(e),a=n})),r},r=function(e){var n={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof e?t.extend(n,e):("boolean"==typeof e?n.byRow=e:"remove"===e&&(n.remove=!0),n)},o=t.fn.matchHeight=function(e){var n=r(e);if(n.remove){var i=this;return this.css(n.property,""),t.each(o._groups,(function(t,e){e.elements=e.elements.not(i)})),this}return this.length<=1&&!n.target||(o._groups.push({elements:this,options:n}),o._apply(this,n)),this};o.version="0.7.2",o._groups=[],o._throttle=80,o._maintainScroll=!1,o._beforeUpdate=null,o._afterUpdate=null,o._rows=a,o._parse=i,o._parseOptions=r,o._apply=function(e,n){var s=r(n),l=t(e),u=[l],d=t(window).scrollTop(),h=t("html").outerHeight(!0),c=l.parents().filter(":hidden");return c.each((function(){var e=t(this);e.data("style-cache",e.attr("style"))})),c.css("display","block"),s.byRow&&!s.target&&(l.each((function(){var e=t(this),n=e.css("display");"inline-block"!==n&&"flex"!==n&&"inline-flex"!==n&&(n="block"),e.data("style-cache",e.attr("style")),e.css({display:n,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})})),u=a(l),l.each((function(){var e=t(this);e.attr("style",e.data("style-cache")||"")}))),t.each(u,(function(e,n){var a=t(n),r=0;if(s.target)r=s.target.outerHeight(!1);else{if(s.byRow&&a.length<=1)return void a.css(s.property,"");a.each((function(){var e=t(this),n=e.attr("style"),i=e.css("display");"inline-block"!==i&&"flex"!==i&&"inline-flex"!==i&&(i="block");var a={display:i};a[s.property]="",e.css(a),e.outerHeight(!1)>r&&(r=e.outerHeight(!1)),n?e.attr("style",n):e.css("display","")}))}a.each((function(){var e=t(this),n=0;s.target&&e.is(s.target)||("border-box"!==e.css("box-sizing")&&(n+=i(e.css("border-top-width"))+i(e.css("border-bottom-width")),n+=i(e.css("padding-top"))+i(e.css("padding-bottom"))),e.css(s.property,r-n+"px"))}))})),c.each((function(){var e=t(this);e.attr("style",e.data("style-cache")||null)})),o._maintainScroll&&t(window).scrollTop(d/h*t("html").outerHeight(!0)),this},o._applyDataApi=function(){var e={};t("[data-match-height], [data-mh]").each((function(){var n=t(this),i=n.attr("data-mh")||n.attr("data-match-height");e[i]=i in e?e[i].add(n):n})),t.each(e,(function(){this.matchHeight(!0)}))};var s=function(e){o._beforeUpdate&&o._beforeUpdate(e,o._groups),t.each(o._groups,(function(){o._apply(this.elements,this.options)})),o._afterUpdate&&o._afterUpdate(e,o._groups)};o._update=function(i,a){if(a&&"resize"===a.type){var r=t(window).width();if(r===e)return;e=r}i?-1===n&&(n=setTimeout((function(){s(a),n=-1}),o._throttle)):s(a)},t(o._applyDataApi);var l=t.fn.on?"on":"bind";t(window)[l]("load",(function(t){o._update(!1,t)})),t(window)[l]("resize orientationchange",(function(t){o._update(!0,t)}))}));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/assets/js/solo/vue/dist/vue.dev.js ADDED
@@ -0,0 +1,11830 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+
3
+ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ /*!
6
+ * Vue.js v2.6.12
7
+ * (c) 2014-2020 Evan You
8
+ * Released under the MIT License.
9
+ */
10
+ (function (global, factory) {
11
+ (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = global || self, global.Vue = factory());
12
+ })(void 0, function () {
13
+ 'use strict';
14
+ /* */
15
+
16
+ var emptyObject = Object.freeze({}); // These helpers produce better VM code in JS engines due to their
17
+ // explicitness and function inlining.
18
+
19
+ function isUndef(v) {
20
+ return v === undefined || v === null;
21
+ }
22
+
23
+ function isDef(v) {
24
+ return v !== undefined && v !== null;
25
+ }
26
+
27
+ function isTrue(v) {
28
+ return v === true;
29
+ }
30
+
31
+ function isFalse(v) {
32
+ return v === false;
33
+ }
34
+ /**
35
+ * Check if value is primitive.
36
+ */
37
+
38
+
39
+ function isPrimitive(value) {
40
+ return typeof value === 'string' || typeof value === 'number' || // $flow-disable-line
41
+ _typeof(value) === 'symbol' || typeof value === 'boolean';
42
+ }
43
+ /**
44
+ * Quick object check - this is primarily used to tell
45
+ * Objects from primitive values when we know the value
46
+ * is a JSON-compliant type.
47
+ */
48
+
49
+
50
+ function isObject(obj) {
51
+ return obj !== null && _typeof(obj) === 'object';
52
+ }
53
+ /**
54
+ * Get the raw type string of a value, e.g., [object Object].
55
+ */
56
+
57
+
58
+ var _toString = Object.prototype.toString;
59
+
60
+ function toRawType(value) {
61
+ return _toString.call(value).slice(8, -1);
62
+ }
63
+ /**
64
+ * Strict object type check. Only returns true
65
+ * for plain JavaScript objects.
66
+ */
67
+
68
+
69
+ function isPlainObject(obj) {
70
+ return _toString.call(obj) === '[object Object]';
71
+ }
72
+
73
+ function isRegExp(v) {
74
+ return _toString.call(v) === '[object RegExp]';
75
+ }
76
+ /**
77
+ * Check if val is a valid array index.
78
+ */
79
+
80
+
81
+ function isValidArrayIndex(val) {
82
+ var n = parseFloat(String(val));
83
+ return n >= 0 && Math.floor(n) === n && isFinite(val);
84
+ }
85
+
86
+ function isPromise(val) {
87
+ return isDef(val) && typeof val.then === 'function' && typeof val["catch"] === 'function';
88
+ }
89
+ /**
90
+ * Convert a value to a string that is actually rendered.
91
+ */
92
+
93
+
94
+ function toString(val) {
95
+ return val == null ? '' : Array.isArray(val) || isPlainObject(val) && val.toString === _toString ? JSON.stringify(val, null, 2) : String(val);
96
+ }
97
+ /**
98
+ * Convert an input value to a number for persistence.
99
+ * If the conversion fails, return original string.
100
+ */
101
+
102
+
103
+ function toNumber(val) {
104
+ var n = parseFloat(val);
105
+ return isNaN(n) ? val : n;
106
+ }
107
+ /**
108
+ * Make a map and return a function for checking if a key
109
+ * is in that map.
110
+ */
111
+
112
+
113
+ function makeMap(str, expectsLowerCase) {
114
+ var map = Object.create(null);
115
+ var list = str.split(',');
116
+
117
+ for (var i = 0; i < list.length; i++) {
118
+ map[list[i]] = true;
119
+ }
120
+
121
+ return expectsLowerCase ? function (val) {
122
+ return map[val.toLowerCase()];
123
+ } : function (val) {
124
+ return map[val];
125
+ };
126
+ }
127
+ /**
128
+ * Check if a tag is a built-in tag.
129
+ */
130
+
131
+
132
+ var isBuiltInTag = makeMap('slot,component', true);
133
+ /**
134
+ * Check if an attribute is a reserved attribute.
135
+ */
136
+
137
+ var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
138
+ /**
139
+ * Remove an item from an array.
140
+ */
141
+
142
+ function remove(arr, item) {
143
+ if (arr.length) {
144
+ var index = arr.indexOf(item);
145
+
146
+ if (index > -1) {
147
+ return arr.splice(index, 1);
148
+ }
149
+ }
150
+ }
151
+ /**
152
+ * Check whether an object has the property.
153
+ */
154
+
155
+
156
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
157
+
158
+ function hasOwn(obj, key) {
159
+ return hasOwnProperty.call(obj, key);
160
+ }
161
+ /**
162
+ * Create a cached version of a pure function.
163
+ */
164
+
165
+
166
+ function cached(fn) {
167
+ var cache = Object.create(null);
168
+ return function cachedFn(str) {
169
+ var hit = cache[str];
170
+ return hit || (cache[str] = fn(str));
171
+ };
172
+ }
173
+ /**
174
+ * Camelize a hyphen-delimited string.
175
+ */
176
+
177
+
178
+ var camelizeRE = /-(\w)/g;
179
+ var camelize = cached(function (str) {
180
+ return str.replace(camelizeRE, function (_, c) {
181
+ return c ? c.toUpperCase() : '';
182
+ });
183
+ });
184
+ /**
185
+ * Capitalize a string.
186
+ */
187
+
188
+ var capitalize = cached(function (str) {
189
+ return str.charAt(0).toUpperCase() + str.slice(1);
190
+ });
191
+ /**
192
+ * Hyphenate a camelCase string.
193
+ */
194
+
195
+ var hyphenateRE = /\B([A-Z])/g;
196
+ var hyphenate = cached(function (str) {
197
+ return str.replace(hyphenateRE, '-$1').toLowerCase();
198
+ });
199
+ /**
200
+ * Simple bind polyfill for environments that do not support it,
201
+ * e.g., PhantomJS 1.x. Technically, we don't need this anymore
202
+ * since native bind is now performant enough in most browsers.
203
+ * But removing it would mean breaking code that was able to run in
204
+ * PhantomJS 1.x, so this must be kept for backward compatibility.
205
+ */
206
+
207
+ /* istanbul ignore next */
208
+
209
+ function polyfillBind(fn, ctx) {
210
+ function boundFn(a) {
211
+ var l = arguments.length;
212
+ return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
213
+ }
214
+
215
+ boundFn._length = fn.length;
216
+ return boundFn;
217
+ }
218
+
219
+ function nativeBind(fn, ctx) {
220
+ return fn.bind(ctx);
221
+ }
222
+
223
+ var bind = Function.prototype.bind ? nativeBind : polyfillBind;
224
+ /**
225
+ * Convert an Array-like object to a real Array.
226
+ */
227
+
228
+ function toArray(list, start) {
229
+ start = start || 0;
230
+ var i = list.length - start;
231
+ var ret = new Array(i);
232
+
233
+ while (i--) {
234
+ ret[i] = list[i + start];
235
+ }
236
+
237
+ return ret;
238
+ }
239
+ /**
240
+ * Mix properties into target object.
241
+ */
242
+
243
+
244
+ function extend(to, _from) {
245
+ for (var key in _from) {
246
+ to[key] = _from[key];
247
+ }
248
+
249
+ return to;
250
+ }
251
+ /**
252
+ * Merge an Array of Objects into a single Object.
253
+ */
254
+
255
+
256
+ function toObject(arr) {
257
+ var res = {};
258
+
259
+ for (var i = 0; i < arr.length; i++) {
260
+ if (arr[i]) {
261
+ extend(res, arr[i]);
262
+ }
263
+ }
264
+
265
+ return res;
266
+ }
267
+ /* eslint-disable no-unused-vars */
268
+
269
+ /**
270
+ * Perform no operation.
271
+ * Stubbing args to make Flow happy without leaving useless transpiled code
272
+ * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
273
+ */
274
+
275
+
276
+ function noop(a, b, c) {}
277
+ /**
278
+ * Always return false.
279
+ */
280
+
281
+
282
+ var no = function no(a, b, c) {
283
+ return false;
284
+ };
285
+ /* eslint-enable no-unused-vars */
286
+
287
+ /**
288
+ * Return the same value.
289
+ */
290
+
291
+
292
+ var identity = function identity(_) {
293
+ return _;
294
+ };
295
+ /**
296
+ * Generate a string containing static keys from compiler modules.
297
+ */
298
+
299
+
300
+ function genStaticKeys(modules) {
301
+ return modules.reduce(function (keys, m) {
302
+ return keys.concat(m.staticKeys || []);
303
+ }, []).join(',');
304
+ }
305
+ /**
306
+ * Check if two values are loosely equal - that is,
307
+ * if they are plain objects, do they have the same shape?
308
+ */
309
+
310
+
311
+ function looseEqual(a, b) {
312
+ if (a === b) {
313
+ return true;
314
+ }
315
+
316
+ var isObjectA = isObject(a);
317
+ var isObjectB = isObject(b);
318
+
319
+ if (isObjectA && isObjectB) {
320
+ try {
321
+ var isArrayA = Array.isArray(a);
322
+ var isArrayB = Array.isArray(b);
323
+
324
+ if (isArrayA && isArrayB) {
325
+ return a.length === b.length && a.every(function (e, i) {
326
+ return looseEqual(e, b[i]);
327
+ });
328
+ } else if (a instanceof Date && b instanceof Date) {
329
+ return a.getTime() === b.getTime();
330
+ } else if (!isArrayA && !isArrayB) {
331
+ var keysA = Object.keys(a);
332
+ var keysB = Object.keys(b);
333
+ return keysA.length === keysB.length && keysA.every(function (key) {
334
+ return looseEqual(a[key], b[key]);
335
+ });
336
+ } else {
337
+ /* istanbul ignore next */
338
+ return false;
339
+ }
340
+ } catch (e) {
341
+ /* istanbul ignore next */
342
+ return false;
343
+ }
344
+ } else if (!isObjectA && !isObjectB) {
345
+ return String(a) === String(b);
346
+ } else {
347
+ return false;
348
+ }
349
+ }
350
+ /**
351
+ * Return the first index at which a loosely equal value can be
352
+ * found in the array (if value is a plain object, the array must
353
+ * contain an object of the same shape), or -1 if it is not present.
354
+ */
355
+
356
+
357
+ function looseIndexOf(arr, val) {
358
+ for (var i = 0; i < arr.length; i++) {
359
+ if (looseEqual(arr[i], val)) {
360
+ return i;
361
+ }
362
+ }
363
+
364
+ return -1;
365
+ }
366
+ /**
367
+ * Ensure a function is called only once.
368
+ */
369
+
370
+
371
+ function once(fn) {
372
+ var called = false;
373
+ return function () {
374
+ if (!called) {
375
+ called = true;
376
+ fn.apply(this, arguments);
377
+ }
378
+ };
379
+ }
380
+
381
+ var SSR_ATTR = 'data-server-rendered';
382
+ var ASSET_TYPES = ['component', 'directive', 'filter'];
383
+ var LIFECYCLE_HOOKS = ['beforeCreate', 'created', 'beforeMount', 'mounted', 'beforeUpdate', 'updated', 'beforeDestroy', 'destroyed', 'activated', 'deactivated', 'errorCaptured', 'serverPrefetch'];
384
+ /* */
385
+
386
+ var config = {
387
+ /**
388
+ * Option merge strategies (used in core/util/options)
389
+ */
390
+ // $flow-disable-line
391
+ optionMergeStrategies: Object.create(null),
392
+
393
+ /**
394
+ * Whether to suppress warnings.
395
+ */
396
+ silent: false,
397
+
398
+ /**
399
+ * Show production mode tip message on boot?
400
+ */
401
+ productionTip: "development" !== 'production',
402
+
403
+ /**
404
+ * Whether to enable devtools
405
+ */
406
+ devtools: "development" !== 'production',
407
+
408
+ /**
409
+ * Whether to record perf
410
+ */
411
+ performance: false,
412
+
413
+ /**
414
+ * Error handler for watcher errors
415
+ */
416
+ errorHandler: null,
417
+
418
+ /**
419
+ * Warn handler for watcher warns
420
+ */
421
+ warnHandler: null,
422
+
423
+ /**
424
+ * Ignore certain custom elements
425
+ */
426
+ ignoredElements: [],
427
+
428
+ /**
429
+ * Custom user key aliases for v-on
430
+ */
431
+ // $flow-disable-line
432
+ keyCodes: Object.create(null),
433
+
434
+ /**
435
+ * Check if a tag is reserved so that it cannot be registered as a
436
+ * component. This is platform-dependent and may be overwritten.
437
+ */
438
+ isReservedTag: no,
439
+
440
+ /**
441
+ * Check if an attribute is reserved so that it cannot be used as a component
442
+ * prop. This is platform-dependent and may be overwritten.
443
+ */
444
+ isReservedAttr: no,
445
+
446
+ /**
447
+ * Check if a tag is an unknown element.
448
+ * Platform-dependent.
449
+ */
450
+ isUnknownElement: no,
451
+
452
+ /**
453
+ * Get the namespace of an element
454
+ */
455
+ getTagNamespace: noop,
456
+
457
+ /**
458
+ * Parse the real tag name for the specific platform.
459
+ */
460
+ parsePlatformTagName: identity,
461
+
462
+ /**
463
+ * Check if an attribute must be bound using property, e.g. value
464
+ * Platform-dependent.
465
+ */
466
+ mustUseProp: no,
467
+
468
+ /**
469
+ * Perform updates asynchronously. Intended to be used by Vue Test Utils
470
+ * This will significantly reduce performance if set to false.
471
+ */
472
+ async: true,
473
+
474
+ /**
475
+ * Exposed for legacy reasons
476
+ */
477
+ _lifecycleHooks: LIFECYCLE_HOOKS
478
+ };
479
+ /* */
480
+
481
+ /**
482
+ * unicode letters used for parsing html tags, component names and property paths.
483
+ * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
484
+ * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
485
+ */
486
+
487
+ var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
488
+ /**
489
+ * Check if a string starts with $ or _
490
+ */
491
+
492
+ function isReserved(str) {
493
+ var c = (str + '').charCodeAt(0);
494
+ return c === 0x24 || c === 0x5F;
495
+ }
496
+ /**
497
+ * Define a property.
498
+ */
499
+
500
+
501
+ function def(obj, key, val, enumerable) {
502
+ Object.defineProperty(obj, key, {
503
+ value: val,
504
+ enumerable: !!enumerable,
505
+ writable: true,
506
+ configurable: true
507
+ });
508
+ }
509
+ /**
510
+ * Parse simple path.
511
+ */
512
+
513
+
514
+ var bailRE = new RegExp("[^" + unicodeRegExp.source + ".$_\\d]");
515
+
516
+ function parsePath(path) {
517
+ if (bailRE.test(path)) {
518
+ return;
519
+ }
520
+
521
+ var segments = path.split('.');
522
+ return function (obj) {
523
+ for (var i = 0; i < segments.length; i++) {
524
+ if (!obj) {
525
+ return;
526
+ }
527
+
528
+ obj = obj[segments[i]];
529
+ }
530
+
531
+ return obj;
532
+ };
533
+ }
534
+ /* */
535
+ // can we use __proto__?
536
+
537
+
538
+ var hasProto = '__proto__' in {}; // Browser environment sniffing
539
+
540
+ var inBrowser = typeof window !== 'undefined';
541
+ var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
542
+ var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
543
+ var UA = inBrowser && window.navigator.userAgent.toLowerCase();
544
+ var isIE = UA && /msie|trident/.test(UA);
545
+ var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
546
+ var isEdge = UA && UA.indexOf('edge/') > 0;
547
+ var isAndroid = UA && UA.indexOf('android') > 0 || weexPlatform === 'android';
548
+ var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA) || weexPlatform === 'ios';
549
+ var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
550
+ var isPhantomJS = UA && /phantomjs/.test(UA);
551
+ var isFF = UA && UA.match(/firefox\/(\d+)/); // Firefox has a "watch" function on Object.prototype...
552
+
553
+ var nativeWatch = {}.watch;
554
+ var supportsPassive = false;
555
+
556
+ if (inBrowser) {
557
+ try {
558
+ var opts = {};
559
+ Object.defineProperty(opts, 'passive', {
560
+ get: function get() {
561
+ /* istanbul ignore next */
562
+ supportsPassive = true;
563
+ }
564
+ }); // https://github.com/facebook/flow/issues/285
565
+
566
+ window.addEventListener('test-passive', null, opts);
567
+ } catch (e) {}
568
+ } // this needs to be lazy-evaled because vue may be required before
569
+ // vue-server-renderer can set VUE_ENV
570
+
571
+
572
+ var _isServer;
573
+
574
+ var isServerRendering = function isServerRendering() {
575
+ if (_isServer === undefined) {
576
+ /* istanbul ignore if */
577
+ if (!inBrowser && !inWeex && typeof global !== 'undefined') {
578
+ // detect presence of vue-server-renderer and avoid
579
+ // Webpack shimming the process
580
+ _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
581
+ } else {
582
+ _isServer = false;
583
+ }
584
+ }
585
+
586
+ return _isServer;
587
+ }; // detect devtools
588
+
589
+
590
+ var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
591
+ /* istanbul ignore next */
592
+
593
+ function isNative(Ctor) {
594
+ return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
595
+ }
596
+
597
+ var hasSymbol = typeof Symbol !== 'undefined' && isNative(Symbol) && typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
598
+
599
+ var _Set;
600
+ /* istanbul ignore if */
601
+ // $flow-disable-line
602
+
603
+
604
+ if (typeof Set !== 'undefined' && isNative(Set)) {
605
+ // use native Set when available.
606
+ _Set = Set;
607
+ } else {
608
+ // a non-standard Set polyfill that only works with primitive keys.
609
+ _Set =
610
+ /*@__PURE__*/
611
+ function () {
612
+ function Set() {
613
+ this.set = Object.create(null);
614
+ }
615
+
616
+ Set.prototype.has = function has(key) {
617
+ return this.set[key] === true;
618
+ };
619
+
620
+ Set.prototype.add = function add(key) {
621
+ this.set[key] = true;
622
+ };
623
+
624
+ Set.prototype.clear = function clear() {
625
+ this.set = Object.create(null);
626
+ };
627
+
628
+ return Set;
629
+ }();
630
+ }
631
+ /* */
632
+
633
+
634
+ var warn = noop;
635
+ var tip = noop;
636
+ var generateComponentTrace = noop; // work around flow check
637
+
638
+ var formatComponentName = noop;
639
+ {
640
+ var hasConsole = typeof console !== 'undefined';
641
+ var classifyRE = /(?:^|[-_])(\w)/g;
642
+
643
+ var classify = function classify(str) {
644
+ return str.replace(classifyRE, function (c) {
645
+ return c.toUpperCase();
646
+ }).replace(/[-_]/g, '');
647
+ };
648
+
649
+ warn = function warn(msg, vm) {
650
+ var trace = vm ? generateComponentTrace(vm) : '';
651
+
652
+ if (config.warnHandler) {
653
+ config.warnHandler.call(null, msg, vm, trace);
654
+ } else if (hasConsole && !config.silent) {
655
+ console.error("[Vue warn]: " + msg + trace);
656
+ }
657
+ };
658
+
659
+ tip = function tip(msg, vm) {
660
+ if (hasConsole && !config.silent) {
661
+ console.warn("[Vue tip]: " + msg + (vm ? generateComponentTrace(vm) : ''));
662
+ }
663
+ };
664
+
665
+ formatComponentName = function formatComponentName(vm, includeFile) {
666
+ if (vm.$root === vm) {
667
+ return '<Root>';
668
+ }
669
+
670
+ var options = typeof vm === 'function' && vm.cid != null ? vm.options : vm._isVue ? vm.$options || vm.constructor.options : vm;
671
+ var name = options.name || options._componentTag;
672
+ var file = options.__file;
673
+
674
+ if (!name && file) {
675
+ var match = file.match(/([^/\\]+)\.vue$/);
676
+ name = match && match[1];
677
+ }
678
+
679
+ return (name ? "<" + classify(name) + ">" : "<Anonymous>") + (file && includeFile !== false ? " at " + file : '');
680
+ };
681
+
682
+ var repeat = function repeat(str, n) {
683
+ var res = '';
684
+
685
+ while (n) {
686
+ if (n % 2 === 1) {
687
+ res += str;
688
+ }
689
+
690
+ if (n > 1) {
691
+ str += str;
692
+ }
693
+
694
+ n >>= 1;
695
+ }
696
+
697
+ return res;
698
+ };
699
+
700
+ generateComponentTrace = function generateComponentTrace(vm) {
701
+ if (vm._isVue && vm.$parent) {
702
+ var tree = [];
703
+ var currentRecursiveSequence = 0;
704
+
705
+ while (vm) {
706
+ if (tree.length > 0) {
707
+ var last = tree[tree.length - 1];
708
+
709
+ if (last.constructor === vm.constructor) {
710
+ currentRecursiveSequence++;
711
+ vm = vm.$parent;
712
+ continue;
713
+ } else if (currentRecursiveSequence > 0) {
714
+ tree[tree.length - 1] = [last, currentRecursiveSequence];
715
+ currentRecursiveSequence = 0;
716
+ }
717
+ }
718
+
719
+ tree.push(vm);
720
+ vm = vm.$parent;
721
+ }
722
+
723
+ return '\n\nfound in\n\n' + tree.map(function (vm, i) {
724
+ return "" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) ? formatComponentName(vm[0]) + "... (" + vm[1] + " recursive calls)" : formatComponentName(vm));
725
+ }).join('\n');
726
+ } else {
727
+ return "\n\n(found in " + formatComponentName(vm) + ")";
728
+ }
729
+ };
730
+ }
731
+ /* */
732
+
733
+ var uid = 0;
734
+ /**
735
+ * A dep is an observable that can have multiple
736
+ * directives subscribing to it.
737
+ */
738
+
739
+ var Dep = function Dep() {
740
+ this.id = uid++;
741
+ this.subs = [];
742
+ };
743
+
744
+ Dep.prototype.addSub = function addSub(sub) {
745
+ this.subs.push(sub);
746
+ };
747
+
748
+ Dep.prototype.removeSub = function removeSub(sub) {
749
+ remove(this.subs, sub);
750
+ };
751
+
752
+ Dep.prototype.depend = function depend() {
753
+ if (Dep.target) {
754
+ Dep.target.addDep(this);
755
+ }
756
+ };
757
+
758
+ Dep.prototype.notify = function notify() {
759
+ // stabilize the subscriber list first
760
+ var subs = this.subs.slice();
761
+
762
+ if (!config.async) {
763
+ // subs aren't sorted in scheduler if not running async
764
+ // we need to sort them now to make sure they fire in correct
765
+ // order
766
+ subs.sort(function (a, b) {
767
+ return a.id - b.id;
768
+ });
769
+ }
770
+
771
+ for (var i = 0, l = subs.length; i < l; i++) {
772
+ subs[i].update();
773
+ }
774
+ }; // The current target watcher being evaluated.
775
+ // This is globally unique because only one watcher
776
+ // can be evaluated at a time.
777
+
778
+
779
+ Dep.target = null;
780
+ var targetStack = [];
781
+
782
+ function pushTarget(target) {
783
+ targetStack.push(target);
784
+ Dep.target = target;
785
+ }
786
+
787
+ function popTarget() {
788
+ targetStack.pop();
789
+ Dep.target = targetStack[targetStack.length - 1];
790
+ }
791
+ /* */
792
+
793
+
794
+ var VNode = function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
795
+ this.tag = tag;
796
+ this.data = data;
797
+ this.children = children;
798
+ this.text = text;
799
+ this.elm = elm;
800
+ this.ns = undefined;
801
+ this.context = context;
802
+ this.fnContext = undefined;
803
+ this.fnOptions = undefined;
804
+ this.fnScopeId = undefined;
805
+ this.key = data && data.key;
806
+ this.componentOptions = componentOptions;
807
+ this.componentInstance = undefined;
808
+ this.parent = undefined;
809
+ this.raw = false;
810
+ this.isStatic = false;
811
+ this.isRootInsert = true;
812
+ this.isComment = false;
813
+ this.isCloned = false;
814
+ this.isOnce = false;
815
+ this.asyncFactory = asyncFactory;
816
+ this.asyncMeta = undefined;
817
+ this.isAsyncPlaceholder = false;
818
+ };
819
+
820
+ var prototypeAccessors = {
821
+ child: {
822
+ configurable: true
823
+ }
824
+ }; // DEPRECATED: alias for componentInstance for backwards compat.
825
+
826
+ /* istanbul ignore next */
827
+
828
+ prototypeAccessors.child.get = function () {
829
+ return this.componentInstance;
830
+ };
831
+
832
+ Object.defineProperties(VNode.prototype, prototypeAccessors);
833
+
834
+ var createEmptyVNode = function createEmptyVNode(text) {
835
+ if (text === void 0) text = '';
836
+ var node = new VNode();
837
+ node.text = text;
838
+ node.isComment = true;
839
+ return node;
840
+ };
841
+
842
+ function createTextVNode(val) {
843
+ return new VNode(undefined, undefined, undefined, String(val));
844
+ } // optimized shallow clone
845
+ // used for static nodes and slot nodes because they may be reused across
846
+ // multiple renders, cloning them avoids errors when DOM manipulations rely
847
+ // on their elm reference.
848
+
849
+
850
+ function cloneVNode(vnode) {
851
+ var cloned = new VNode(vnode.tag, vnode.data, // #7975
852
+ // clone children array to avoid mutating original in case of cloning
853
+ // a child.
854
+ vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
855
+ cloned.ns = vnode.ns;
856
+ cloned.isStatic = vnode.isStatic;
857
+ cloned.key = vnode.key;
858
+ cloned.isComment = vnode.isComment;
859
+ cloned.fnContext = vnode.fnContext;
860
+ cloned.fnOptions = vnode.fnOptions;
861
+ cloned.fnScopeId = vnode.fnScopeId;
862
+ cloned.asyncMeta = vnode.asyncMeta;
863
+ cloned.isCloned = true;
864
+ return cloned;
865
+ }
866
+ /*
867
+ * not type checking this file because flow doesn't play well with
868
+ * dynamically accessing methods on Array prototype
869
+ */
870
+
871
+
872
+ var arrayProto = Array.prototype;
873
+ var arrayMethods = Object.create(arrayProto);
874
+ var methodsToPatch = ['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'];
875
+ /**
876
+ * Intercept mutating methods and emit events
877
+ */
878
+
879
+ methodsToPatch.forEach(function (method) {
880
+ // cache original method
881
+ var original = arrayProto[method];
882
+ def(arrayMethods, method, function mutator() {
883
+ var args = [],
884
+ len = arguments.length;
885
+
886
+ while (len--) {
887
+ args[len] = arguments[len];
888
+ }
889
+
890
+ var result = original.apply(this, args);
891
+ var ob = this.__ob__;
892
+ var inserted;
893
+
894
+ switch (method) {
895
+ case 'push':
896
+ case 'unshift':
897
+ inserted = args;
898
+ break;
899
+
900
+ case 'splice':
901
+ inserted = args.slice(2);
902
+ break;
903
+ }
904
+
905
+ if (inserted) {
906
+ ob.observeArray(inserted);
907
+ } // notify change
908
+
909
+
910
+ ob.dep.notify();
911
+ return result;
912
+ });
913
+ });
914
+ /* */
915
+
916
+ var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
917
+ /**
918
+ * In some cases we may want to disable observation inside a component's
919
+ * update computation.
920
+ */
921
+
922
+ var shouldObserve = true;
923
+
924
+ function toggleObserving(value) {
925
+ shouldObserve = value;
926
+ }
927
+ /**
928
+ * Observer class that is attached to each observed
929
+ * object. Once attached, the observer converts the target
930
+ * object's property keys into getter/setters that
931
+ * collect dependencies and dispatch updates.
932
+ */
933
+
934
+
935
+ var Observer = function Observer(value) {
936
+ this.value = value;
937
+ this.dep = new Dep();
938
+ this.vmCount = 0;
939
+ def(value, '__ob__', this);
940
+
941
+ if (Array.isArray(value)) {
942
+ if (hasProto) {
943
+ protoAugment(value, arrayMethods);
944
+ } else {
945
+ copyAugment(value, arrayMethods, arrayKeys);
946
+ }
947
+
948
+ this.observeArray(value);
949
+ } else {
950
+ this.walk(value);
951
+ }
952
+ };
953
+ /**
954
+ * Walk through all properties and convert them into
955
+ * getter/setters. This method should only be called when
956
+ * value type is Object.
957
+ */
958
+
959
+
960
+ Observer.prototype.walk = function walk(obj) {
961
+ var keys = Object.keys(obj);
962
+
963
+ for (var i = 0; i < keys.length; i++) {
964
+ defineReactive$$1(obj, keys[i]);
965
+ }
966
+ };
967
+ /**
968
+ * Observe a list of Array items.
969
+ */
970
+
971
+
972
+ Observer.prototype.observeArray = function observeArray(items) {
973
+ for (var i = 0, l = items.length; i < l; i++) {
974
+ observe(items[i]);
975
+ }
976
+ }; // helpers
977
+
978
+ /**
979
+ * Augment a target Object or Array by intercepting
980
+ * the prototype chain using __proto__
981
+ */
982
+
983
+
984
+ function protoAugment(target, src) {
985
+ /* eslint-disable no-proto */
986
+ target.__proto__ = src;
987
+ /* eslint-enable no-proto */
988
+ }
989
+ /**
990
+ * Augment a target Object or Array by defining
991
+ * hidden properties.
992
+ */
993
+
994
+ /* istanbul ignore next */
995
+
996
+
997
+ function copyAugment(target, src, keys) {
998
+ for (var i = 0, l = keys.length; i < l; i++) {
999
+ var key = keys[i];
1000
+ def(target, key, src[key]);
1001
+ }
1002
+ }
1003
+ /**
1004
+ * Attempt to create an observer instance for a value,
1005
+ * returns the new observer if successfully observed,
1006
+ * or the existing observer if the value already has one.
1007
+ */
1008
+
1009
+
1010
+ function observe(value, asRootData) {
1011
+ if (!isObject(value) || value instanceof VNode) {
1012
+ return;
1013
+ }
1014
+
1015
+ var ob;
1016
+
1017
+ if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
1018
+ ob = value.__ob__;
1019
+ } else if (shouldObserve && !isServerRendering() && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {
1020
+ ob = new Observer(value);
1021
+ }
1022
+
1023
+ if (asRootData && ob) {
1024
+ ob.vmCount++;
1025
+ }
1026
+
1027
+ return ob;
1028
+ }
1029
+ /**
1030
+ * Define a reactive property on an Object.
1031
+ */
1032
+
1033
+
1034
+ function defineReactive$$1(obj, key, val, customSetter, shallow) {
1035
+ var dep = new Dep();
1036
+ var property = Object.getOwnPropertyDescriptor(obj, key);
1037
+
1038
+ if (property && property.configurable === false) {
1039
+ return;
1040
+ } // cater for pre-defined getter/setters
1041
+
1042
+
1043
+ var getter = property && property.get;
1044
+ var setter = property && property.set;
1045
+
1046
+ if ((!getter || setter) && arguments.length === 2) {
1047
+ val = obj[key];
1048
+ }
1049
+
1050
+ var childOb = !shallow && observe(val);
1051
+ Object.defineProperty(obj, key, {
1052
+ enumerable: true,
1053
+ configurable: true,
1054
+ get: function reactiveGetter() {
1055
+ var value = getter ? getter.call(obj) : val;
1056
+
1057
+ if (Dep.target) {
1058
+ dep.depend();
1059
+
1060
+ if (childOb) {
1061
+ childOb.dep.depend();
1062
+
1063
+ if (Array.isArray(value)) {
1064
+ dependArray(value);
1065
+ }
1066
+ }
1067
+ }
1068
+
1069
+ return value;
1070
+ },
1071
+ set: function reactiveSetter(newVal) {
1072
+ var value = getter ? getter.call(obj) : val;
1073
+ /* eslint-disable no-self-compare */
1074
+
1075
+ if (newVal === value || newVal !== newVal && value !== value) {
1076
+ return;
1077
+ }
1078
+ /* eslint-enable no-self-compare */
1079
+
1080
+
1081
+ if (customSetter) {
1082
+ customSetter();
1083
+ } // #7981: for accessor properties without setter
1084
+
1085
+
1086
+ if (getter && !setter) {
1087
+ return;
1088
+ }
1089
+
1090
+ if (setter) {
1091
+ setter.call(obj, newVal);
1092
+ } else {
1093
+ val = newVal;
1094
+ }
1095
+
1096
+ childOb = !shallow && observe(newVal);
1097
+ dep.notify();
1098
+ }
1099
+ });
1100
+ }
1101
+ /**
1102
+ * Set a property on an object. Adds the new property and
1103
+ * triggers change notification if the property doesn't
1104
+ * already exist.
1105
+ */
1106
+
1107
+
1108
+ function set(target, key, val) {
1109
+ if (isUndef(target) || isPrimitive(target)) {
1110
+ warn("Cannot set reactive property on undefined, null, or primitive value: " + target);
1111
+ }
1112
+
1113
+ if (Array.isArray(target) && isValidArrayIndex(key)) {
1114
+ target.length = Math.max(target.length, key);
1115
+ target.splice(key, 1, val);
1116
+ return val;
1117
+ }
1118
+
1119
+ if (key in target && !(key in Object.prototype)) {
1120
+ target[key] = val;
1121
+ return val;
1122
+ }
1123
+
1124
+ var ob = target.__ob__;
1125
+
1126
+ if (target._isVue || ob && ob.vmCount) {
1127
+ warn('Avoid adding reactive properties to a Vue instance or its root $data ' + 'at runtime - declare it upfront in the data option.');
1128
+ return val;
1129
+ }
1130
+
1131
+ if (!ob) {
1132
+ target[key] = val;
1133
+ return val;
1134
+ }
1135
+
1136
+ defineReactive$$1(ob.value, key, val);
1137
+ ob.dep.notify();
1138
+ return val;
1139
+ }
1140
+ /**
1141
+ * Delete a property and trigger change if necessary.
1142
+ */
1143
+
1144
+
1145
+ function del(target, key) {
1146
+ if (isUndef(target) || isPrimitive(target)) {
1147
+ warn("Cannot delete reactive property on undefined, null, or primitive value: " + target);
1148
+ }
1149
+
1150
+ if (Array.isArray(target) && isValidArrayIndex(key)) {
1151
+ target.splice(key, 1);
1152
+ return;
1153
+ }
1154
+
1155
+ var ob = target.__ob__;
1156
+
1157
+ if (target._isVue || ob && ob.vmCount) {
1158
+ warn('Avoid deleting properties on a Vue instance or its root $data ' + '- just set it to null.');
1159
+ return;
1160
+ }
1161
+
1162
+ if (!hasOwn(target, key)) {
1163
+ return;
1164
+ }
1165
+
1166
+ delete target[key];
1167
+
1168
+ if (!ob) {
1169
+ return;
1170
+ }
1171
+
1172
+ ob.dep.notify();
1173
+ }
1174
+ /**
1175
+ * Collect dependencies on array elements when the array is touched, since
1176
+ * we cannot intercept array element access like property getters.
1177
+ */
1178
+
1179
+
1180
+ function dependArray(value) {
1181
+ for (var e = void 0, i = 0, l = value.length; i < l; i++) {
1182
+ e = value[i];
1183
+ e && e.__ob__ && e.__ob__.dep.depend();
1184
+
1185
+ if (Array.isArray(e)) {
1186
+ dependArray(e);
1187
+ }
1188
+ }
1189
+ }
1190
+ /* */
1191
+
1192
+ /**
1193
+ * Option overwriting strategies are functions that handle
1194
+ * how to merge a parent option value and a child option
1195
+ * value into the final value.
1196
+ */
1197
+
1198
+
1199
+ var strats = config.optionMergeStrategies;
1200
+ /**
1201
+ * Options with restrictions
1202
+ */
1203
+
1204
+ {
1205
+ strats.el = strats.propsData = function (parent, child, vm, key) {
1206
+ if (!vm) {
1207
+ warn("option \"" + key + "\" can only be used during instance " + 'creation with the `new` keyword.');
1208
+ }
1209
+
1210
+ return defaultStrat(parent, child);
1211
+ };
1212
+ }
1213
+ /**
1214
+ * Helper that recursively merges two data objects together.
1215
+ */
1216
+
1217
+ function mergeData(to, from) {
1218
+ if (!from) {
1219
+ return to;
1220
+ }
1221
+
1222
+ var key, toVal, fromVal;
1223
+ var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from);
1224
+
1225
+ for (var i = 0; i < keys.length; i++) {
1226
+ key = keys[i]; // in case the object is already observed...
1227
+
1228
+ if (key === '__ob__') {
1229
+ continue;
1230
+ }
1231
+
1232
+ toVal = to[key];
1233
+ fromVal = from[key];
1234
+
1235
+ if (!hasOwn(to, key)) {
1236
+ set(to, key, fromVal);
1237
+ } else if (toVal !== fromVal && isPlainObject(toVal) && isPlainObject(fromVal)) {
1238
+ mergeData(toVal, fromVal);
1239
+ }
1240
+ }
1241
+
1242
+ return to;
1243
+ }
1244
+ /**
1245
+ * Data
1246
+ */
1247
+
1248
+
1249
+ function mergeDataOrFn(parentVal, childVal, vm) {
1250
+ if (!vm) {
1251
+ // in a Vue.extend merge, both should be functions
1252
+ if (!childVal) {
1253
+ return parentVal;
1254
+ }
1255
+
1256
+ if (!parentVal) {
1257
+ return childVal;
1258
+ } // when parentVal & childVal are both present,
1259
+ // we need to return a function that returns the
1260
+ // merged result of both functions... no need to
1261
+ // check if parentVal is a function here because
1262
+ // it has to be a function to pass previous merges.
1263
+
1264
+
1265
+ return function mergedDataFn() {
1266
+ return mergeData(typeof childVal === 'function' ? childVal.call(this, this) : childVal, typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal);
1267
+ };
1268
+ } else {
1269
+ return function mergedInstanceDataFn() {
1270
+ // instance merge
1271
+ var instanceData = typeof childVal === 'function' ? childVal.call(vm, vm) : childVal;
1272
+ var defaultData = typeof parentVal === 'function' ? parentVal.call(vm, vm) : parentVal;
1273
+
1274
+ if (instanceData) {
1275
+ return mergeData(instanceData, defaultData);
1276
+ } else {
1277
+ return defaultData;
1278
+ }
1279
+ };
1280
+ }
1281
+ }
1282
+
1283
+ strats.data = function (parentVal, childVal, vm) {
1284
+ if (!vm) {
1285
+ if (childVal && typeof childVal !== 'function') {
1286
+ warn('The "data" option should be a function ' + 'that returns a per-instance value in component ' + 'definitions.', vm);
1287
+ return parentVal;
1288
+ }
1289
+
1290
+ return mergeDataOrFn(parentVal, childVal);
1291
+ }
1292
+
1293
+ return mergeDataOrFn(parentVal, childVal, vm);
1294
+ };
1295
+ /**
1296
+ * Hooks and props are merged as arrays.
1297
+ */
1298
+
1299
+
1300
+ function mergeHook(parentVal, childVal) {
1301
+ var res = childVal ? parentVal ? parentVal.concat(childVal) : Array.isArray(childVal) ? childVal : [childVal] : parentVal;
1302
+ return res ? dedupeHooks(res) : res;
1303
+ }
1304
+
1305
+ function dedupeHooks(hooks) {
1306
+ var res = [];
1307
+
1308
+ for (var i = 0; i < hooks.length; i++) {
1309
+ if (res.indexOf(hooks[i]) === -1) {
1310
+ res.push(hooks[i]);
1311
+ }
1312
+ }
1313
+
1314
+ return res;
1315
+ }
1316
+
1317
+ LIFECYCLE_HOOKS.forEach(function (hook) {
1318
+ strats[hook] = mergeHook;
1319
+ });
1320
+ /**
1321
+ * Assets
1322
+ *
1323
+ * When a vm is present (instance creation), we need to do
1324
+ * a three-way merge between constructor options, instance
1325
+ * options and parent options.
1326
+ */
1327
+
1328
+ function mergeAssets(parentVal, childVal, vm, key) {
1329
+ var res = Object.create(parentVal || null);
1330
+
1331
+ if (childVal) {
1332
+ assertObjectType(key, childVal, vm);
1333
+ return extend(res, childVal);
1334
+ } else {
1335
+ return res;
1336
+ }
1337
+ }
1338
+
1339
+ ASSET_TYPES.forEach(function (type) {
1340
+ strats[type + 's'] = mergeAssets;
1341
+ });
1342
+ /**
1343
+ * Watchers.
1344
+ *
1345
+ * Watchers hashes should not overwrite one
1346
+ * another, so we merge them as arrays.
1347
+ */
1348
+
1349
+ strats.watch = function (parentVal, childVal, vm, key) {
1350
+ // work around Firefox's Object.prototype.watch...
1351
+ if (parentVal === nativeWatch) {
1352
+ parentVal = undefined;
1353
+ }
1354
+
1355
+ if (childVal === nativeWatch) {
1356
+ childVal = undefined;
1357
+ }
1358
+ /* istanbul ignore if */
1359
+
1360
+
1361
+ if (!childVal) {
1362
+ return Object.create(parentVal || null);
1363
+ }
1364
+
1365
+ {
1366
+ assertObjectType(key, childVal, vm);
1367
+ }
1368
+
1369
+ if (!parentVal) {
1370
+ return childVal;
1371
+ }
1372
+
1373
+ var ret = {};
1374
+ extend(ret, parentVal);
1375
+
1376
+ for (var key$1 in childVal) {
1377
+ var parent = ret[key$1];
1378
+ var child = childVal[key$1];
1379
+
1380
+ if (parent && !Array.isArray(parent)) {
1381
+ parent = [parent];
1382
+ }
1383
+
1384
+ ret[key$1] = parent ? parent.concat(child) : Array.isArray(child) ? child : [child];
1385
+ }
1386
+
1387
+ return ret;
1388
+ };
1389
+ /**
1390
+ * Other object hashes.
1391
+ */
1392
+
1393
+
1394
+ strats.props = strats.methods = strats.inject = strats.computed = function (parentVal, childVal, vm, key) {
1395
+ if (childVal && "development" !== 'production') {
1396
+ assertObjectType(key, childVal, vm);
1397
+ }
1398
+
1399
+ if (!parentVal) {
1400
+ return childVal;
1401
+ }
1402
+
1403
+ var ret = Object.create(null);
1404
+ extend(ret, parentVal);
1405
+
1406
+ if (childVal) {
1407
+ extend(ret, childVal);
1408
+ }
1409
+
1410
+ return ret;
1411
+ };
1412
+
1413
+ strats.provide = mergeDataOrFn;
1414
+ /**
1415
+ * Default strategy.
1416
+ */
1417
+
1418
+ var defaultStrat = function defaultStrat(parentVal, childVal) {
1419
+ return childVal === undefined ? parentVal : childVal;
1420
+ };
1421
+ /**
1422
+ * Validate component names
1423
+ */
1424
+
1425
+
1426
+ function checkComponents(options) {
1427
+ for (var key in options.components) {
1428
+ validateComponentName(key);
1429
+ }
1430
+ }
1431
+
1432
+ function validateComponentName(name) {
1433
+ if (!new RegExp("^[a-zA-Z][\\-\\.0-9_" + unicodeRegExp.source + "]*$").test(name)) {
1434
+ warn('Invalid component name: "' + name + '". Component names ' + 'should conform to valid custom element name in html5 specification.');
1435
+ }
1436
+
1437
+ if (isBuiltInTag(name) || config.isReservedTag(name)) {
1438
+ warn('Do not use built-in or reserved HTML elements as component ' + 'id: ' + name);
1439
+ }
1440
+ }
1441
+ /**
1442
+ * Ensure all props option syntax are normalized into the
1443
+ * Object-based format.
1444
+ */
1445
+
1446
+
1447
+ function normalizeProps(options, vm) {
1448
+ var props = options.props;
1449
+
1450
+ if (!props) {
1451
+ return;
1452
+ }
1453
+
1454
+ var res = {};
1455
+ var i, val, name;
1456
+
1457
+ if (Array.isArray(props)) {
1458
+ i = props.length;
1459
+
1460
+ while (i--) {
1461
+ val = props[i];
1462
+
1463
+ if (typeof val === 'string') {
1464
+ name = camelize(val);
1465
+ res[name] = {
1466
+ type: null
1467
+ };
1468
+ } else {
1469
+ warn('props must be strings when using array syntax.');
1470
+ }
1471
+ }
1472
+ } else if (isPlainObject(props)) {
1473
+ for (var key in props) {
1474
+ val = props[key];
1475
+ name = camelize(key);
1476
+ res[name] = isPlainObject(val) ? val : {
1477
+ type: val
1478
+ };
1479
+ }
1480
+ } else {
1481
+ warn("Invalid value for option \"props\": expected an Array or an Object, " + "but got " + toRawType(props) + ".", vm);
1482
+ }
1483
+
1484
+ options.props = res;
1485
+ }
1486
+ /**
1487
+ * Normalize all injections into Object-based format
1488
+ */
1489
+
1490
+
1491
+ function normalizeInject(options, vm) {
1492
+ var inject = options.inject;
1493
+
1494
+ if (!inject) {
1495
+ return;
1496
+ }
1497
+
1498
+ var normalized = options.inject = {};
1499
+
1500
+ if (Array.isArray(inject)) {
1501
+ for (var i = 0; i < inject.length; i++) {
1502
+ normalized[inject[i]] = {
1503
+ from: inject[i]
1504
+ };
1505
+ }
1506
+ } else if (isPlainObject(inject)) {
1507
+ for (var key in inject) {
1508
+ var val = inject[key];
1509
+ normalized[key] = isPlainObject(val) ? extend({
1510
+ from: key
1511
+ }, val) : {
1512
+ from: val
1513
+ };
1514
+ }
1515
+ } else {
1516
+ warn("Invalid value for option \"inject\": expected an Array or an Object, " + "but got " + toRawType(inject) + ".", vm);
1517
+ }
1518
+ }
1519
+ /**
1520
+ * Normalize raw function directives into object format.
1521
+ */
1522
+
1523
+
1524
+ function normalizeDirectives(options) {
1525
+ var dirs = options.directives;
1526
+
1527
+ if (dirs) {
1528
+ for (var key in dirs) {
1529
+ var def$$1 = dirs[key];
1530
+
1531
+ if (typeof def$$1 === 'function') {
1532
+ dirs[key] = {
1533
+ bind: def$$1,
1534
+ update: def$$1
1535
+ };
1536
+ }
1537
+ }
1538
+ }
1539
+ }
1540
+
1541
+ function assertObjectType(name, value, vm) {
1542
+ if (!isPlainObject(value)) {
1543
+ warn("Invalid value for option \"" + name + "\": expected an Object, " + "but got " + toRawType(value) + ".", vm);
1544
+ }
1545
+ }
1546
+ /**
1547
+ * Merge two option objects into a new one.
1548
+ * Core utility used in both instantiation and inheritance.
1549
+ */
1550
+
1551
+
1552
+ function mergeOptions(parent, child, vm) {
1553
+ {
1554
+ checkComponents(child);
1555
+ }
1556
+
1557
+ if (typeof child === 'function') {
1558
+ child = child.options;
1559
+ }
1560
+
1561
+ normalizeProps(child, vm);
1562
+ normalizeInject(child, vm);
1563
+ normalizeDirectives(child); // Apply extends and mixins on the child options,
1564
+ // but only if it is a raw options object that isn't
1565
+ // the result of another mergeOptions call.
1566
+ // Only merged options has the _base property.
1567
+
1568
+ if (!child._base) {
1569
+ if (child["extends"]) {
1570
+ parent = mergeOptions(parent, child["extends"], vm);
1571
+ }
1572
+
1573
+ if (child.mixins) {
1574
+ for (var i = 0, l = child.mixins.length; i < l; i++) {
1575
+ parent = mergeOptions(parent, child.mixins[i], vm);
1576
+ }
1577
+ }
1578
+ }
1579
+
1580
+ var options = {};
1581
+ var key;
1582
+
1583
+ for (key in parent) {
1584
+ mergeField(key);
1585
+ }
1586
+
1587
+ for (key in child) {
1588
+ if (!hasOwn(parent, key)) {
1589
+ mergeField(key);
1590
+ }
1591
+ }
1592
+
1593
+ function mergeField(key) {
1594
+ var strat = strats[key] || defaultStrat;
1595
+ options[key] = strat(parent[key], child[key], vm, key);
1596
+ }
1597
+
1598
+ return options;
1599
+ }
1600
+ /**
1601
+ * Resolve an asset.
1602
+ * This function is used because child instances need access
1603
+ * to assets defined in its ancestor chain.
1604
+ */
1605
+
1606
+
1607
+ function resolveAsset(options, type, id, warnMissing) {
1608
+ /* istanbul ignore if */
1609
+ if (typeof id !== 'string') {
1610
+ return;
1611
+ }
1612
+
1613
+ var assets = options[type]; // check local registration variations first
1614
+
1615
+ if (hasOwn(assets, id)) {
1616
+ return assets[id];
1617
+ }
1618
+
1619
+ var camelizedId = camelize(id);
1620
+
1621
+ if (hasOwn(assets, camelizedId)) {
1622
+ return assets[camelizedId];
1623
+ }
1624
+
1625
+ var PascalCaseId = capitalize(camelizedId);
1626
+
1627
+ if (hasOwn(assets, PascalCaseId)) {
1628
+ return assets[PascalCaseId];
1629
+ } // fallback to prototype chain
1630
+
1631
+
1632
+ var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
1633
+
1634
+ if (warnMissing && !res) {
1635
+ warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id, options);
1636
+ }
1637
+
1638
+ return res;
1639
+ }
1640
+ /* */
1641
+
1642
+
1643
+ function validateProp(key, propOptions, propsData, vm) {
1644
+ var prop = propOptions[key];
1645
+ var absent = !hasOwn(propsData, key);
1646
+ var value = propsData[key]; // boolean casting
1647
+
1648
+ var booleanIndex = getTypeIndex(Boolean, prop.type);
1649
+
1650
+ if (booleanIndex > -1) {
1651
+ if (absent && !hasOwn(prop, 'default')) {
1652
+ value = false;
1653
+ } else if (value === '' || value === hyphenate(key)) {
1654
+ // only cast empty string / same name to boolean if
1655
+ // boolean has higher priority
1656
+ var stringIndex = getTypeIndex(String, prop.type);
1657
+
1658
+ if (stringIndex < 0 || booleanIndex < stringIndex) {
1659
+ value = true;
1660
+ }
1661
+ }
1662
+ } // check default value
1663
+
1664
+
1665
+ if (value === undefined) {
1666
+ value = getPropDefaultValue(vm, prop, key); // since the default value is a fresh copy,
1667
+ // make sure to observe it.
1668
+
1669
+ var prevShouldObserve = shouldObserve;
1670
+ toggleObserving(true);
1671
+ observe(value);
1672
+ toggleObserving(prevShouldObserve);
1673
+ }
1674
+
1675
+ {
1676
+ assertProp(prop, key, value, vm, absent);
1677
+ }
1678
+ return value;
1679
+ }
1680
+ /**
1681
+ * Get the default value of a prop.
1682
+ */
1683
+
1684
+
1685
+ function getPropDefaultValue(vm, prop, key) {
1686
+ // no default, return undefined
1687
+ if (!hasOwn(prop, 'default')) {
1688
+ return undefined;
1689
+ }
1690
+
1691
+ var def = prop["default"]; // warn against non-factory defaults for Object & Array
1692
+
1693
+ if (isObject(def)) {
1694
+ warn('Invalid default value for prop "' + key + '": ' + 'Props with type Object/Array must use a factory function ' + 'to return the default value.', vm);
1695
+ } // the raw prop value was also undefined from previous render,
1696
+ // return previous default value to avoid unnecessary watcher trigger
1697
+
1698
+
1699
+ if (vm && vm.$options.propsData && vm.$options.propsData[key] === undefined && vm._props[key] !== undefined) {
1700
+ return vm._props[key];
1701
+ } // call factory function for non-Function types
1702
+ // a value is Function if its prototype is function even across different execution context
1703
+
1704
+
1705
+ return typeof def === 'function' && getType(prop.type) !== 'Function' ? def.call(vm) : def;
1706
+ }
1707
+ /**
1708
+ * Assert whether a prop is valid.
1709
+ */
1710
+
1711
+
1712
+ function assertProp(prop, name, value, vm, absent) {
1713
+ if (prop.required && absent) {
1714
+ warn('Missing required prop: "' + name + '"', vm);
1715
+ return;
1716
+ }
1717
+
1718
+ if (value == null && !prop.required) {
1719
+ return;
1720
+ }
1721
+
1722
+ var type = prop.type;
1723
+ var valid = !type || type === true;
1724
+ var expectedTypes = [];
1725
+
1726
+ if (type) {
1727
+ if (!Array.isArray(type)) {
1728
+ type = [type];
1729
+ }
1730
+
1731
+ for (var i = 0; i < type.length && !valid; i++) {
1732
+ var assertedType = assertType(value, type[i]);
1733
+ expectedTypes.push(assertedType.expectedType || '');
1734
+ valid = assertedType.valid;
1735
+ }
1736
+ }
1737
+
1738
+ if (!valid) {
1739
+ warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
1740
+ return;
1741
+ }
1742
+
1743
+ var validator = prop.validator;
1744
+
1745
+ if (validator) {
1746
+ if (!validator(value)) {
1747
+ warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
1748
+ }
1749
+ }
1750
+ }
1751
+
1752
+ var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1753
+
1754
+ function assertType(value, type) {
1755
+ var valid;
1756
+ var expectedType = getType(type);
1757
+
1758
+ if (simpleCheckRE.test(expectedType)) {
1759
+ var t = _typeof(value);
1760
+
1761
+ valid = t === expectedType.toLowerCase(); // for primitive wrapper objects
1762
+
1763
+ if (!valid && t === 'object') {
1764
+ valid = value instanceof type;
1765
+ }
1766
+ } else if (expectedType === 'Object') {
1767
+ valid = isPlainObject(value);
1768
+ } else if (expectedType === 'Array') {
1769
+ valid = Array.isArray(value);
1770
+ } else {
1771
+ valid = value instanceof type;
1772
+ }
1773
+
1774
+ return {
1775
+ valid: valid,
1776
+ expectedType: expectedType
1777
+ };
1778
+ }
1779
+ /**
1780
+ * Use function string name to check built-in types,
1781
+ * because a simple equality check will fail when running
1782
+ * across different vms / iframes.
1783
+ */
1784
+
1785
+
1786
+ function getType(fn) {
1787
+ var match = fn && fn.toString().match(/^\s*function (\w+)/);
1788
+ return match ? match[1] : '';
1789
+ }
1790
+
1791
+ function isSameType(a, b) {
1792
+ return getType(a) === getType(b);
1793
+ }
1794
+
1795
+ function getTypeIndex(type, expectedTypes) {
1796
+ if (!Array.isArray(expectedTypes)) {
1797
+ return isSameType(expectedTypes, type) ? 0 : -1;
1798
+ }
1799
+
1800
+ for (var i = 0, len = expectedTypes.length; i < len; i++) {
1801
+ if (isSameType(expectedTypes[i], type)) {
1802
+ return i;
1803
+ }
1804
+ }
1805
+
1806
+ return -1;
1807
+ }
1808
+
1809
+ function getInvalidTypeMessage(name, value, expectedTypes) {
1810
+ var message = "Invalid prop: type check failed for prop \"" + name + "\"." + " Expected " + expectedTypes.map(capitalize).join(', ');
1811
+ var expectedType = expectedTypes[0];
1812
+ var receivedType = toRawType(value);
1813
+ var expectedValue = styleValue(value, expectedType);
1814
+ var receivedValue = styleValue(value, receivedType); // check if we need to specify expected value
1815
+
1816
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
1817
+ message += " with value " + expectedValue;
1818
+ }
1819
+
1820
+ message += ", got " + receivedType + " "; // check if we need to specify received value
1821
+
1822
+ if (isExplicable(receivedType)) {
1823
+ message += "with value " + receivedValue + ".";
1824
+ }
1825
+
1826
+ return message;
1827
+ }
1828
+
1829
+ function styleValue(value, type) {
1830
+ if (type === 'String') {
1831
+ return "\"" + value + "\"";
1832
+ } else if (type === 'Number') {
1833
+ return "" + Number(value);
1834
+ } else {
1835
+ return "" + value;
1836
+ }
1837
+ }
1838
+
1839
+ function isExplicable(value) {
1840
+ var explicitTypes = ['string', 'number', 'boolean'];
1841
+ return explicitTypes.some(function (elem) {
1842
+ return value.toLowerCase() === elem;
1843
+ });
1844
+ }
1845
+
1846
+ function isBoolean() {
1847
+ var args = [],
1848
+ len = arguments.length;
1849
+
1850
+ while (len--) {
1851
+ args[len] = arguments[len];
1852
+ }
1853
+
1854
+ return args.some(function (elem) {
1855
+ return elem.toLowerCase() === 'boolean';
1856
+ });
1857
+ }
1858
+ /* */
1859
+
1860
+
1861
+ function handleError(err, vm, info) {
1862
+ // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
1863
+ // See: https://github.com/vuejs/vuex/issues/1505
1864
+ pushTarget();
1865
+
1866
+ try {
1867
+ if (vm) {
1868
+ var cur = vm;
1869
+
1870
+ while (cur = cur.$parent) {
1871
+ var hooks = cur.$options.errorCaptured;
1872
+
1873
+ if (hooks) {
1874
+ for (var i = 0; i < hooks.length; i++) {
1875
+ try {
1876
+ var capture = hooks[i].call(cur, err, vm, info) === false;
1877
+
1878
+ if (capture) {
1879
+ return;
1880
+ }
1881
+ } catch (e) {
1882
+ globalHandleError(e, cur, 'errorCaptured hook');
1883
+ }
1884
+ }
1885
+ }
1886
+ }
1887
+ }
1888
+
1889
+ globalHandleError(err, vm, info);
1890
+ } finally {
1891
+ popTarget();
1892
+ }
1893
+ }
1894
+
1895
+ function invokeWithErrorHandling(handler, context, args, vm, info) {
1896
+ var res;
1897
+
1898
+ try {
1899
+ res = args ? handler.apply(context, args) : handler.call(context);
1900
+
1901
+ if (res && !res._isVue && isPromise(res) && !res._handled) {
1902
+ res["catch"](function (e) {
1903
+ return handleError(e, vm, info + " (Promise/async)");
1904
+ }); // issue #9511
1905
+ // avoid catch triggering multiple times when nested calls
1906
+
1907
+ res._handled = true;
1908
+ }
1909
+ } catch (e) {
1910
+ handleError(e, vm, info);
1911
+ }
1912
+
1913
+ return res;
1914
+ }
1915
+
1916
+ function globalHandleError(err, vm, info) {
1917
+ if (config.errorHandler) {
1918
+ try {
1919
+ return config.errorHandler.call(null, err, vm, info);
1920
+ } catch (e) {
1921
+ // if the user intentionally throws the original error in the handler,
1922
+ // do not log it twice
1923
+ if (e !== err) {
1924
+ logError(e, null, 'config.errorHandler');
1925
+ }
1926
+ }
1927
+ }
1928
+
1929
+ logError(err, vm, info);
1930
+ }
1931
+
1932
+ function logError(err, vm, info) {
1933
+ {
1934
+ warn("Error in " + info + ": \"" + err.toString() + "\"", vm);
1935
+ }
1936
+ /* istanbul ignore else */
1937
+
1938
+ if ((inBrowser || inWeex) && typeof console !== 'undefined') {
1939
+ console.error(err);
1940
+ } else {
1941
+ throw err;
1942
+ }
1943
+ }
1944
+ /* */
1945
+
1946
+
1947
+ var isUsingMicroTask = false;
1948
+ var callbacks = [];
1949
+ var pending = false;
1950
+
1951
+ function flushCallbacks() {
1952
+ pending = false;
1953
+ var copies = callbacks.slice(0);
1954
+ callbacks.length = 0;
1955
+
1956
+ for (var i = 0; i < copies.length; i++) {
1957
+ copies[i]();
1958
+ }
1959
+ } // Here we have async deferring wrappers using microtasks.
1960
+ // In 2.5 we used (macro) tasks (in combination with microtasks).
1961
+ // However, it has subtle problems when state is changed right before repaint
1962
+ // (e.g. #6813, out-in transitions).
1963
+ // Also, using (macro) tasks in event handler would cause some weird behaviors
1964
+ // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
1965
+ // So we now use microtasks everywhere, again.
1966
+ // A major drawback of this tradeoff is that there are some scenarios
1967
+ // where microtasks have too high a priority and fire in between supposedly
1968
+ // sequential events (e.g. #4521, #6690, which have workarounds)
1969
+ // or even between bubbling of the same event (#6566).
1970
+
1971
+
1972
+ var timerFunc; // The nextTick behavior leverages the microtask queue, which can be accessed
1973
+ // via either native Promise.then or MutationObserver.
1974
+ // MutationObserver has wider support, however it is seriously bugged in
1975
+ // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
1976
+ // completely stops working after triggering a few times... so, if native
1977
+ // Promise is available, we will use it:
1978
+
1979
+ /* istanbul ignore next, $flow-disable-line */
1980
+
1981
+ if (typeof Promise !== 'undefined' && isNative(Promise)) {
1982
+ var p = Promise.resolve();
1983
+
1984
+ timerFunc = function timerFunc() {
1985
+ p.then(flushCallbacks); // In problematic UIWebViews, Promise.then doesn't completely break, but
1986
+ // it can get stuck in a weird state where callbacks are pushed into the
1987
+ // microtask queue but the queue isn't being flushed, until the browser
1988
+ // needs to do some other work, e.g. handle a timer. Therefore we can
1989
+ // "force" the microtask queue to be flushed by adding an empty timer.
1990
+
1991
+ if (isIOS) {
1992
+ setTimeout(noop);
1993
+ }
1994
+ };
1995
+
1996
+ isUsingMicroTask = true;
1997
+ } else if (!isIE && typeof MutationObserver !== 'undefined' && (isNative(MutationObserver) || // PhantomJS and iOS 7.x
1998
+ MutationObserver.toString() === '[object MutationObserverConstructor]')) {
1999
+ // Use MutationObserver where native Promise is not available,
2000
+ // e.g. PhantomJS, iOS7, Android 4.4
2001
+ // (#6466 MutationObserver is unreliable in IE11)
2002
+ var counter = 1;
2003
+ var observer = new MutationObserver(flushCallbacks);
2004
+ var textNode = document.createTextNode(String(counter));
2005
+ observer.observe(textNode, {
2006
+ characterData: true
2007
+ });
2008
+
2009
+ timerFunc = function timerFunc() {
2010
+ counter = (counter + 1) % 2;
2011
+ textNode.data = String(counter);
2012
+ };
2013
+
2014
+ isUsingMicroTask = true;
2015
+ } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
2016
+ // Fallback to setImmediate.
2017
+ // Technically it leverages the (macro) task queue,
2018
+ // but it is still a better choice than setTimeout.
2019
+ timerFunc = function timerFunc() {
2020
+ setImmediate(flushCallbacks);
2021
+ };
2022
+ } else {
2023
+ // Fallback to setTimeout.
2024
+ timerFunc = function timerFunc() {
2025
+ setTimeout(flushCallbacks, 0);
2026
+ };
2027
+ }
2028
+
2029
+ function nextTick(cb, ctx) {
2030
+ var _resolve;
2031
+
2032
+ callbacks.push(function () {
2033
+ if (cb) {
2034
+ try {
2035
+ cb.call(ctx);
2036
+ } catch (e) {
2037
+ handleError(e, ctx, 'nextTick');
2038
+ }
2039
+ } else if (_resolve) {
2040
+ _resolve(ctx);
2041
+ }
2042
+ });
2043
+
2044
+ if (!pending) {
2045
+ pending = true;
2046
+ timerFunc();
2047
+ } // $flow-disable-line
2048
+
2049
+
2050
+ if (!cb && typeof Promise !== 'undefined') {
2051
+ return new Promise(function (resolve) {
2052
+ _resolve = resolve;
2053
+ });
2054
+ }
2055
+ }
2056
+ /* */
2057
+
2058
+
2059
+ var mark;
2060
+ var measure;
2061
+ {
2062
+ var perf = inBrowser && window.performance;
2063
+ /* istanbul ignore if */
2064
+
2065
+ if (perf && perf.mark && perf.measure && perf.clearMarks && perf.clearMeasures) {
2066
+ mark = function mark(tag) {
2067
+ return perf.mark(tag);
2068
+ };
2069
+
2070
+ measure = function measure(name, startTag, endTag) {
2071
+ perf.measure(name, startTag, endTag);
2072
+ perf.clearMarks(startTag);
2073
+ perf.clearMarks(endTag); // perf.clearMeasures(name)
2074
+ };
2075
+ }
2076
+ }
2077
+ /* not type checking this file because flow doesn't play well with Proxy */
2078
+
2079
+ var initProxy;
2080
+ {
2081
+ var allowedGlobals = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' + 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + 'require' // for Webpack/Browserify
2082
+ );
2083
+
2084
+ var warnNonPresent = function warnNonPresent(target, key) {
2085
+ warn("Property or method \"" + key + "\" is not defined on the instance but " + 'referenced during render. Make sure that this property is reactive, ' + 'either in the data option, or for class-based components, by ' + 'initializing the property. ' + 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
2086
+ };
2087
+
2088
+ var warnReservedPrefix = function warnReservedPrefix(target, key) {
2089
+ warn("Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 'prevent conflicts with Vue internals. ' + 'See: https://vuejs.org/v2/api/#data', target);
2090
+ };
2091
+
2092
+ var hasProxy = typeof Proxy !== 'undefined' && isNative(Proxy);
2093
+
2094
+ if (hasProxy) {
2095
+ var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
2096
+ config.keyCodes = new Proxy(config.keyCodes, {
2097
+ set: function set(target, key, value) {
2098
+ if (isBuiltInModifier(key)) {
2099
+ warn("Avoid overwriting built-in modifier in config.keyCodes: ." + key);
2100
+ return false;
2101
+ } else {
2102
+ target[key] = value;
2103
+ return true;
2104
+ }
2105
+ }
2106
+ });
2107
+ }
2108
+
2109
+ var hasHandler = {
2110
+ has: function has(target, key) {
2111
+ var has = key in target;
2112
+ var isAllowed = allowedGlobals(key) || typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data);
2113
+
2114
+ if (!has && !isAllowed) {
2115
+ if (key in target.$data) {
2116
+ warnReservedPrefix(target, key);
2117
+ } else {
2118
+ warnNonPresent(target, key);
2119
+ }
2120
+ }
2121
+
2122
+ return has || !isAllowed;
2123
+ }
2124
+ };
2125
+ var getHandler = {
2126
+ get: function get(target, key) {
2127
+ if (typeof key === 'string' && !(key in target)) {
2128
+ if (key in target.$data) {
2129
+ warnReservedPrefix(target, key);
2130
+ } else {
2131
+ warnNonPresent(target, key);
2132
+ }
2133
+ }
2134
+
2135
+ return target[key];
2136
+ }
2137
+ };
2138
+
2139
+ initProxy = function initProxy(vm) {
2140
+ if (hasProxy) {
2141
+ // determine which proxy handler to use
2142
+ var options = vm.$options;
2143
+ var handlers = options.render && options.render._withStripped ? getHandler : hasHandler;
2144
+ vm._renderProxy = new Proxy(vm, handlers);
2145
+ } else {
2146
+ vm._renderProxy = vm;
2147
+ }
2148
+ };
2149
+ }
2150
+ /* */
2151
+
2152
+ var seenObjects = new _Set();
2153
+ /**
2154
+ * Recursively traverse an object to evoke all converted
2155
+ * getters, so that every nested property inside the object
2156
+ * is collected as a "deep" dependency.
2157
+ */
2158
+
2159
+ function traverse(val) {
2160
+ _traverse(val, seenObjects);
2161
+
2162
+ seenObjects.clear();
2163
+ }
2164
+
2165
+ function _traverse(val, seen) {
2166
+ var i, keys;
2167
+ var isA = Array.isArray(val);
2168
+
2169
+ if (!isA && !isObject(val) || Object.isFrozen(val) || val instanceof VNode) {
2170
+ return;
2171
+ }
2172
+
2173
+ if (val.__ob__) {
2174
+ var depId = val.__ob__.dep.id;
2175
+
2176
+ if (seen.has(depId)) {
2177
+ return;
2178
+ }
2179
+
2180
+ seen.add(depId);
2181
+ }
2182
+
2183
+ if (isA) {
2184
+ i = val.length;
2185
+
2186
+ while (i--) {
2187
+ _traverse(val[i], seen);
2188
+ }
2189
+ } else {
2190
+ keys = Object.keys(val);
2191
+ i = keys.length;
2192
+
2193
+ while (i--) {
2194
+ _traverse(val[keys[i]], seen);
2195
+ }
2196
+ }
2197
+ }
2198
+ /* */
2199
+
2200
+
2201
+ var normalizeEvent = cached(function (name) {
2202
+ var passive = name.charAt(0) === '&';
2203
+ name = passive ? name.slice(1) : name;
2204
+ var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
2205
+
2206
+ name = once$$1 ? name.slice(1) : name;
2207
+ var capture = name.charAt(0) === '!';
2208
+ name = capture ? name.slice(1) : name;
2209
+ return {
2210
+ name: name,
2211
+ once: once$$1,
2212
+ capture: capture,
2213
+ passive: passive
2214
+ };
2215
+ });
2216
+
2217
+ function createFnInvoker(fns, vm) {
2218
+ function invoker() {
2219
+ var arguments$1 = arguments;
2220
+ var fns = invoker.fns;
2221
+
2222
+ if (Array.isArray(fns)) {
2223
+ var cloned = fns.slice();
2224
+
2225
+ for (var i = 0; i < cloned.length; i++) {
2226
+ invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
2227
+ }
2228
+ } else {
2229
+ // return handler return value for single handlers
2230
+ return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
2231
+ }
2232
+ }
2233
+
2234
+ invoker.fns = fns;
2235
+ return invoker;
2236
+ }
2237
+
2238
+ function updateListeners(on, oldOn, add, remove$$1, createOnceHandler, vm) {
2239
+ var name, def$$1, cur, old, event;
2240
+
2241
+ for (name in on) {
2242
+ def$$1 = cur = on[name];
2243
+ old = oldOn[name];
2244
+ event = normalizeEvent(name);
2245
+
2246
+ if (isUndef(cur)) {
2247
+ warn("Invalid handler for event \"" + event.name + "\": got " + String(cur), vm);
2248
+ } else if (isUndef(old)) {
2249
+ if (isUndef(cur.fns)) {
2250
+ cur = on[name] = createFnInvoker(cur, vm);
2251
+ }
2252
+
2253
+ if (isTrue(event.once)) {
2254
+ cur = on[name] = createOnceHandler(event.name, cur, event.capture);
2255
+ }
2256
+
2257
+ add(event.name, cur, event.capture, event.passive, event.params);
2258
+ } else if (cur !== old) {
2259
+ old.fns = cur;
2260
+ on[name] = old;
2261
+ }
2262
+ }
2263
+
2264
+ for (name in oldOn) {
2265
+ if (isUndef(on[name])) {
2266
+ event = normalizeEvent(name);
2267
+ remove$$1(event.name, oldOn[name], event.capture);
2268
+ }
2269
+ }
2270
+ }
2271
+ /* */
2272
+
2273
+
2274
+ function mergeVNodeHook(def, hookKey, hook) {
2275
+ if (def instanceof VNode) {
2276
+ def = def.data.hook || (def.data.hook = {});
2277
+ }
2278
+
2279
+ var invoker;
2280
+ var oldHook = def[hookKey];
2281
+
2282
+ function wrappedHook() {
2283
+ hook.apply(this, arguments); // important: remove merged hook to ensure it's called only once
2284
+ // and prevent memory leak
2285
+
2286
+ remove(invoker.fns, wrappedHook);
2287
+ }
2288
+
2289
+ if (isUndef(oldHook)) {
2290
+ // no existing hook
2291
+ invoker = createFnInvoker([wrappedHook]);
2292
+ } else {
2293
+ /* istanbul ignore if */
2294
+ if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
2295
+ // already a merged invoker
2296
+ invoker = oldHook;
2297
+ invoker.fns.push(wrappedHook);
2298
+ } else {
2299
+ // existing plain hook
2300
+ invoker = createFnInvoker([oldHook, wrappedHook]);
2301
+ }
2302
+ }
2303
+
2304
+ invoker.merged = true;
2305
+ def[hookKey] = invoker;
2306
+ }
2307
+ /* */
2308
+
2309
+
2310
+ function extractPropsFromVNodeData(data, Ctor, tag) {
2311
+ // we are only extracting raw values here.
2312
+ // validation and default values are handled in the child
2313
+ // component itself.
2314
+ var propOptions = Ctor.options.props;
2315
+
2316
+ if (isUndef(propOptions)) {
2317
+ return;
2318
+ }
2319
+
2320
+ var res = {};
2321
+ var attrs = data.attrs;
2322
+ var props = data.props;
2323
+
2324
+ if (isDef(attrs) || isDef(props)) {
2325
+ for (var key in propOptions) {
2326
+ var altKey = hyphenate(key);
2327
+ {
2328
+ var keyInLowerCase = key.toLowerCase();
2329
+
2330
+ if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
2331
+ tip("Prop \"" + keyInLowerCase + "\" is passed to component " + formatComponentName(tag || Ctor) + ", but the declared prop name is" + " \"" + key + "\". " + "Note that HTML attributes are case-insensitive and camelCased " + "props need to use their kebab-case equivalents when using in-DOM " + "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\".");
2332
+ }
2333
+ }
2334
+ checkProp(res, props, key, altKey, true) || checkProp(res, attrs, key, altKey, false);
2335
+ }
2336
+ }
2337
+
2338
+ return res;
2339
+ }
2340
+
2341
+ function checkProp(res, hash, key, altKey, preserve) {
2342
+ if (isDef(hash)) {
2343
+ if (hasOwn(hash, key)) {
2344
+ res[key] = hash[key];
2345
+
2346
+ if (!preserve) {
2347
+ delete hash[key];
2348
+ }
2349
+
2350
+ return true;
2351
+ } else if (hasOwn(hash, altKey)) {
2352
+ res[key] = hash[altKey];
2353
+
2354
+ if (!preserve) {
2355
+ delete hash[altKey];
2356
+ }
2357
+
2358
+ return true;
2359
+ }
2360
+ }
2361
+
2362
+ return false;
2363
+ }
2364
+ /* */
2365
+ // The template compiler attempts to minimize the need for normalization by
2366
+ // statically analyzing the template at compile time.
2367
+ //
2368
+ // For plain HTML markup, normalization can be completely skipped because the
2369
+ // generated render function is guaranteed to return Array<VNode>. There are
2370
+ // two cases where extra normalization is needed:
2371
+ // 1. When the children contains components - because a functional component
2372
+ // may return an Array instead of a single root. In this case, just a simple
2373
+ // normalization is needed - if any child is an Array, we flatten the whole
2374
+ // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
2375
+ // because functional components already normalize their own children.
2376
+
2377
+
2378
+ function simpleNormalizeChildren(children) {
2379
+ for (var i = 0; i < children.length; i++) {
2380
+ if (Array.isArray(children[i])) {
2381
+ return Array.prototype.concat.apply([], children);
2382
+ }
2383
+ }
2384
+
2385
+ return children;
2386
+ } // 2. When the children contains constructs that always generated nested Arrays,
2387
+ // e.g. <template>, <slot>, v-for, or when the children is provided by user
2388
+ // with hand-written render functions / JSX. In such cases a full normalization
2389
+ // is needed to cater to all possible types of children values.
2390
+
2391
+
2392
+ function normalizeChildren(children) {
2393
+ return isPrimitive(children) ? [createTextVNode(children)] : Array.isArray(children) ? normalizeArrayChildren(children) : undefined;
2394
+ }
2395
+
2396
+ function isTextNode(node) {
2397
+ return isDef(node) && isDef(node.text) && isFalse(node.isComment);
2398
+ }
2399
+
2400
+ function normalizeArrayChildren(children, nestedIndex) {
2401
+ var res = [];
2402
+ var i, c, lastIndex, last;
2403
+
2404
+ for (i = 0; i < children.length; i++) {
2405
+ c = children[i];
2406
+
2407
+ if (isUndef(c) || typeof c === 'boolean') {
2408
+ continue;
2409
+ }
2410
+
2411
+ lastIndex = res.length - 1;
2412
+ last = res[lastIndex]; // nested
2413
+
2414
+ if (Array.isArray(c)) {
2415
+ if (c.length > 0) {
2416
+ c = normalizeArrayChildren(c, (nestedIndex || '') + "_" + i); // merge adjacent text nodes
2417
+
2418
+ if (isTextNode(c[0]) && isTextNode(last)) {
2419
+ res[lastIndex] = createTextVNode(last.text + c[0].text);
2420
+ c.shift();
2421
+ }
2422
+
2423
+ res.push.apply(res, c);
2424
+ }
2425
+ } else if (isPrimitive(c)) {
2426
+ if (isTextNode(last)) {
2427
+ // merge adjacent text nodes
2428
+ // this is necessary for SSR hydration because text nodes are
2429
+ // essentially merged when rendered to HTML strings
2430
+ res[lastIndex] = createTextVNode(last.text + c);
2431
+ } else if (c !== '') {
2432
+ // convert primitive to vnode
2433
+ res.push(createTextVNode(c));
2434
+ }
2435
+ } else {
2436
+ if (isTextNode(c) && isTextNode(last)) {
2437
+ // merge adjacent text nodes
2438
+ res[lastIndex] = createTextVNode(last.text + c.text);
2439
+ } else {
2440
+ // default key for nested array children (likely generated by v-for)
2441
+ if (isTrue(children._isVList) && isDef(c.tag) && isUndef(c.key) && isDef(nestedIndex)) {
2442
+ c.key = "__vlist" + nestedIndex + "_" + i + "__";
2443
+ }
2444
+
2445
+ res.push(c);
2446
+ }
2447
+ }
2448
+ }
2449
+
2450
+ return res;
2451
+ }
2452
+ /* */
2453
+
2454
+
2455
+ function initProvide(vm) {
2456
+ var provide = vm.$options.provide;
2457
+
2458
+ if (provide) {
2459
+ vm._provided = typeof provide === 'function' ? provide.call(vm) : provide;
2460
+ }
2461
+ }
2462
+
2463
+ function initInjections(vm) {
2464
+ var result = resolveInject(vm.$options.inject, vm);
2465
+
2466
+ if (result) {
2467
+ toggleObserving(false);
2468
+ Object.keys(result).forEach(function (key) {
2469
+ /* istanbul ignore else */
2470
+ {
2471
+ defineReactive$$1(vm, key, result[key], function () {
2472
+ warn("Avoid mutating an injected value directly since the changes will be " + "overwritten whenever the provided component re-renders. " + "injection being mutated: \"" + key + "\"", vm);
2473
+ });
2474
+ }
2475
+ });
2476
+ toggleObserving(true);
2477
+ }
2478
+ }
2479
+
2480
+ function resolveInject(inject, vm) {
2481
+ if (inject) {
2482
+ // inject is :any because flow is not smart enough to figure out cached
2483
+ var result = Object.create(null);
2484
+ var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
2485
+
2486
+ for (var i = 0; i < keys.length; i++) {
2487
+ var key = keys[i]; // #6574 in case the inject object is observed...
2488
+
2489
+ if (key === '__ob__') {
2490
+ continue;
2491
+ }
2492
+
2493
+ var provideKey = inject[key].from;
2494
+ var source = vm;
2495
+
2496
+ while (source) {
2497
+ if (source._provided && hasOwn(source._provided, provideKey)) {
2498
+ result[key] = source._provided[provideKey];
2499
+ break;
2500
+ }
2501
+
2502
+ source = source.$parent;
2503
+ }
2504
+
2505
+ if (!source) {
2506
+ if ('default' in inject[key]) {
2507
+ var provideDefault = inject[key]["default"];
2508
+ result[key] = typeof provideDefault === 'function' ? provideDefault.call(vm) : provideDefault;
2509
+ } else {
2510
+ warn("Injection \"" + key + "\" not found", vm);
2511
+ }
2512
+ }
2513
+ }
2514
+
2515
+ return result;
2516
+ }
2517
+ }
2518
+ /* */
2519
+
2520
+ /**
2521
+ * Runtime helper for resolving raw children VNodes into a slot object.
2522
+ */
2523
+
2524
+
2525
+ function resolveSlots(children, context) {
2526
+ if (!children || !children.length) {
2527
+ return {};
2528
+ }
2529
+
2530
+ var slots = {};
2531
+
2532
+ for (var i = 0, l = children.length; i < l; i++) {
2533
+ var child = children[i];
2534
+ var data = child.data; // remove slot attribute if the node is resolved as a Vue slot node
2535
+
2536
+ if (data && data.attrs && data.attrs.slot) {
2537
+ delete data.attrs.slot;
2538
+ } // named slots should only be respected if the vnode was rendered in the
2539
+ // same context.
2540
+
2541
+
2542
+ if ((child.context === context || child.fnContext === context) && data && data.slot != null) {
2543
+ var name = data.slot;
2544
+ var slot = slots[name] || (slots[name] = []);
2545
+
2546
+ if (child.tag === 'template') {
2547
+ slot.push.apply(slot, child.children || []);
2548
+ } else {
2549
+ slot.push(child);
2550
+ }
2551
+ } else {
2552
+ (slots["default"] || (slots["default"] = [])).push(child);
2553
+ }
2554
+ } // ignore slots that contains only whitespace
2555
+
2556
+
2557
+ for (var name$1 in slots) {
2558
+ if (slots[name$1].every(isWhitespace)) {
2559
+ delete slots[name$1];
2560
+ }
2561
+ }
2562
+
2563
+ return slots;
2564
+ }
2565
+
2566
+ function isWhitespace(node) {
2567
+ return node.isComment && !node.asyncFactory || node.text === ' ';
2568
+ }
2569
+ /* */
2570
+
2571
+
2572
+ function normalizeScopedSlots(slots, normalSlots, prevSlots) {
2573
+ var res;
2574
+ var hasNormalSlots = Object.keys(normalSlots).length > 0;
2575
+ var isStable = slots ? !!slots.$stable : !hasNormalSlots;
2576
+ var key = slots && slots.$key;
2577
+
2578
+ if (!slots) {
2579
+ res = {};
2580
+ } else if (slots._normalized) {
2581
+ // fast path 1: child component re-render only, parent did not change
2582
+ return slots._normalized;
2583
+ } else if (isStable && prevSlots && prevSlots !== emptyObject && key === prevSlots.$key && !hasNormalSlots && !prevSlots.$hasNormal) {
2584
+ // fast path 2: stable scoped slots w/ no normal slots to proxy,
2585
+ // only need to normalize once
2586
+ return prevSlots;
2587
+ } else {
2588
+ res = {};
2589
+
2590
+ for (var key$1 in slots) {
2591
+ if (slots[key$1] && key$1[0] !== '$') {
2592
+ res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
2593
+ }
2594
+ }
2595
+ } // expose normal slots on scopedSlots
2596
+
2597
+
2598
+ for (var key$2 in normalSlots) {
2599
+ if (!(key$2 in res)) {
2600
+ res[key$2] = proxyNormalSlot(normalSlots, key$2);
2601
+ }
2602
+ } // avoriaz seems to mock a non-extensible $scopedSlots object
2603
+ // and when that is passed down this would cause an error
2604
+
2605
+
2606
+ if (slots && Object.isExtensible(slots)) {
2607
+ slots._normalized = res;
2608
+ }
2609
+
2610
+ def(res, '$stable', isStable);
2611
+ def(res, '$key', key);
2612
+ def(res, '$hasNormal', hasNormalSlots);
2613
+ return res;
2614
+ }
2615
+
2616
+ function normalizeScopedSlot(normalSlots, key, fn) {
2617
+ var normalized = function normalized() {
2618
+ var res = arguments.length ? fn.apply(null, arguments) : fn({});
2619
+ res = res && _typeof(res) === 'object' && !Array.isArray(res) ? [res] // single vnode
2620
+ : normalizeChildren(res);
2621
+ return res && (res.length === 0 || res.length === 1 && res[0].isComment // #9658
2622
+ ) ? undefined : res;
2623
+ }; // this is a slot using the new v-slot syntax without scope. although it is
2624
+ // compiled as a scoped slot, render fn users would expect it to be present
2625
+ // on this.$slots because the usage is semantically a normal slot.
2626
+
2627
+
2628
+ if (fn.proxy) {
2629
+ Object.defineProperty(normalSlots, key, {
2630
+ get: normalized,
2631
+ enumerable: true,
2632
+ configurable: true
2633
+ });
2634
+ }
2635
+
2636
+ return normalized;
2637
+ }
2638
+
2639
+ function proxyNormalSlot(slots, key) {
2640
+ return function () {
2641
+ return slots[key];
2642
+ };
2643
+ }
2644
+ /* */
2645
+
2646
+ /**
2647
+ * Runtime helper for rendering v-for lists.
2648
+ */
2649
+
2650
+
2651
+ function renderList(val, render) {
2652
+ var ret, i, l, keys, key;
2653
+
2654
+ if (Array.isArray(val) || typeof val === 'string') {
2655
+ ret = new Array(val.length);
2656
+
2657
+ for (i = 0, l = val.length; i < l; i++) {
2658
+ ret[i] = render(val[i], i);
2659
+ }
2660
+ } else if (typeof val === 'number') {
2661
+ ret = new Array(val);
2662
+
2663
+ for (i = 0; i < val; i++) {
2664
+ ret[i] = render(i + 1, i);
2665
+ }
2666
+ } else if (isObject(val)) {
2667
+ if (hasSymbol && val[Symbol.iterator]) {
2668
+ ret = [];
2669
+ var iterator = val[Symbol.iterator]();
2670
+ var result = iterator.next();
2671
+
2672
+ while (!result.done) {
2673
+ ret.push(render(result.value, ret.length));
2674
+ result = iterator.next();
2675
+ }
2676
+ } else {
2677
+ keys = Object.keys(val);
2678
+ ret = new Array(keys.length);
2679
+
2680
+ for (i = 0, l = keys.length; i < l; i++) {
2681
+ key = keys[i];
2682
+ ret[i] = render(val[key], key, i);
2683
+ }
2684
+ }
2685
+ }
2686
+
2687
+ if (!isDef(ret)) {
2688
+ ret = [];
2689
+ }
2690
+
2691
+ ret._isVList = true;
2692
+ return ret;
2693
+ }
2694
+ /* */
2695
+
2696
+ /**
2697
+ * Runtime helper for rendering <slot>
2698
+ */
2699
+
2700
+
2701
+ function renderSlot(name, fallback, props, bindObject) {
2702
+ var scopedSlotFn = this.$scopedSlots[name];
2703
+ var nodes;
2704
+
2705
+ if (scopedSlotFn) {
2706
+ // scoped slot
2707
+ props = props || {};
2708
+
2709
+ if (bindObject) {
2710
+ if (!isObject(bindObject)) {
2711
+ warn('slot v-bind without argument expects an Object', this);
2712
+ }
2713
+
2714
+ props = extend(extend({}, bindObject), props);
2715
+ }
2716
+
2717
+ nodes = scopedSlotFn(props) || fallback;
2718
+ } else {
2719
+ nodes = this.$slots[name] || fallback;
2720
+ }
2721
+
2722
+ var target = props && props.slot;
2723
+
2724
+ if (target) {
2725
+ return this.$createElement('template', {
2726
+ slot: target
2727
+ }, nodes);
2728
+ } else {
2729
+ return nodes;
2730
+ }
2731
+ }
2732
+ /* */
2733
+
2734
+ /**
2735
+ * Runtime helper for resolving filters
2736
+ */
2737
+
2738
+
2739
+ function resolveFilter(id) {
2740
+ return resolveAsset(this.$options, 'filters', id, true) || identity;
2741
+ }
2742
+ /* */
2743
+
2744
+
2745
+ function isKeyNotMatch(expect, actual) {
2746
+ if (Array.isArray(expect)) {
2747
+ return expect.indexOf(actual) === -1;
2748
+ } else {
2749
+ return expect !== actual;
2750
+ }
2751
+ }
2752
+ /**
2753
+ * Runtime helper for checking keyCodes from config.
2754
+ * exposed as Vue.prototype._k
2755
+ * passing in eventKeyName as last argument separately for backwards compat
2756
+ */
2757
+
2758
+
2759
+ function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
2760
+ var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
2761
+
2762
+ if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
2763
+ return isKeyNotMatch(builtInKeyName, eventKeyName);
2764
+ } else if (mappedKeyCode) {
2765
+ return isKeyNotMatch(mappedKeyCode, eventKeyCode);
2766
+ } else if (eventKeyName) {
2767
+ return hyphenate(eventKeyName) !== key;
2768
+ }
2769
+ }
2770
+ /* */
2771
+
2772
+ /**
2773
+ * Runtime helper for merging v-bind="object" into a VNode's data.
2774
+ */
2775
+
2776
+
2777
+ function bindObjectProps(data, tag, value, asProp, isSync) {
2778
+ if (value) {
2779
+ if (!isObject(value)) {
2780
+ warn('v-bind without argument expects an Object or Array value', this);
2781
+ } else {
2782
+ if (Array.isArray(value)) {
2783
+ value = toObject(value);
2784
+ }
2785
+
2786
+ var hash;
2787
+
2788
+ var loop = function loop(key) {
2789
+ if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
2790
+ hash = data;
2791
+ } else {
2792
+ var type = data.attrs && data.attrs.type;
2793
+ hash = asProp || config.mustUseProp(tag, type, key) ? data.domProps || (data.domProps = {}) : data.attrs || (data.attrs = {});
2794
+ }
2795
+
2796
+ var camelizedKey = camelize(key);
2797
+ var hyphenatedKey = hyphenate(key);
2798
+
2799
+ if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
2800
+ hash[key] = value[key];
2801
+
2802
+ if (isSync) {
2803
+ var on = data.on || (data.on = {});
2804
+
2805
+ on["update:" + key] = function ($event) {
2806
+ value[key] = $event;
2807
+ };
2808
+ }
2809
+ }
2810
+ };
2811
+
2812
+ for (var key in value) {
2813
+ loop(key);
2814
+ }
2815
+ }
2816
+ }
2817
+
2818
+ return data;
2819
+ }
2820
+ /* */
2821
+
2822
+ /**
2823
+ * Runtime helper for rendering static trees.
2824
+ */
2825
+
2826
+
2827
+ function renderStatic(index, isInFor) {
2828
+ var cached = this._staticTrees || (this._staticTrees = []);
2829
+ var tree = cached[index]; // if has already-rendered static tree and not inside v-for,
2830
+ // we can reuse the same tree.
2831
+
2832
+ if (tree && !isInFor) {
2833
+ return tree;
2834
+ } // otherwise, render a fresh tree.
2835
+
2836
+
2837
+ tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, null, this // for render fns generated for functional component templates
2838
+ );
2839
+ markStatic(tree, "__static__" + index, false);
2840
+ return tree;
2841
+ }
2842
+ /**
2843
+ * Runtime helper for v-once.
2844
+ * Effectively it means marking the node as static with a unique key.
2845
+ */
2846
+
2847
+
2848
+ function markOnce(tree, index, key) {
2849
+ markStatic(tree, "__once__" + index + (key ? "_" + key : ""), true);
2850
+ return tree;
2851
+ }
2852
+
2853
+ function markStatic(tree, key, isOnce) {
2854
+ if (Array.isArray(tree)) {
2855
+ for (var i = 0; i < tree.length; i++) {
2856
+ if (tree[i] && typeof tree[i] !== 'string') {
2857
+ markStaticNode(tree[i], key + "_" + i, isOnce);
2858
+ }
2859
+ }
2860
+ } else {
2861
+ markStaticNode(tree, key, isOnce);
2862
+ }
2863
+ }
2864
+
2865
+ function markStaticNode(node, key, isOnce) {
2866
+ node.isStatic = true;
2867
+ node.key = key;
2868
+ node.isOnce = isOnce;
2869
+ }
2870
+ /* */
2871
+
2872
+
2873
+ function bindObjectListeners(data, value) {
2874
+ if (value) {
2875
+ if (!isPlainObject(value)) {
2876
+ warn('v-on without argument expects an Object value', this);
2877
+ } else {
2878
+ var on = data.on = data.on ? extend({}, data.on) : {};
2879
+
2880
+ for (var key in value) {
2881
+ var existing = on[key];
2882
+ var ours = value[key];
2883
+ on[key] = existing ? [].concat(existing, ours) : ours;
2884
+ }
2885
+ }
2886
+ }
2887
+
2888
+ return data;
2889
+ }
2890
+ /* */
2891
+
2892
+
2893
+ function resolveScopedSlots(fns, // see flow/vnode
2894
+ res, // the following are added in 2.6
2895
+ hasDynamicKeys, contentHashKey) {
2896
+ res = res || {
2897
+ $stable: !hasDynamicKeys
2898
+ };
2899
+
2900
+ for (var i = 0; i < fns.length; i++) {
2901
+ var slot = fns[i];
2902
+
2903
+ if (Array.isArray(slot)) {
2904
+ resolveScopedSlots(slot, res, hasDynamicKeys);
2905
+ } else if (slot) {
2906
+ // marker for reverse proxying v-slot without scope on this.$slots
2907
+ if (slot.proxy) {
2908
+ slot.fn.proxy = true;
2909
+ }
2910
+
2911
+ res[slot.key] = slot.fn;
2912
+ }
2913
+ }
2914
+
2915
+ if (contentHashKey) {
2916
+ res.$key = contentHashKey;
2917
+ }
2918
+
2919
+ return res;
2920
+ }
2921
+ /* */
2922
+
2923
+
2924
+ function bindDynamicKeys(baseObj, values) {
2925
+ for (var i = 0; i < values.length; i += 2) {
2926
+ var key = values[i];
2927
+
2928
+ if (typeof key === 'string' && key) {
2929
+ baseObj[values[i]] = values[i + 1];
2930
+ } else if (key !== '' && key !== null) {
2931
+ // null is a special value for explicitly removing a binding
2932
+ warn("Invalid value for dynamic directive argument (expected string or null): " + key, this);
2933
+ }
2934
+ }
2935
+
2936
+ return baseObj;
2937
+ } // helper to dynamically append modifier runtime markers to event names.
2938
+ // ensure only append when value is already string, otherwise it will be cast
2939
+ // to string and cause the type check to miss.
2940
+
2941
+
2942
+ function prependModifier(value, symbol) {
2943
+ return typeof value === 'string' ? symbol + value : value;
2944
+ }
2945
+ /* */
2946
+
2947
+
2948
+ function installRenderHelpers(target) {
2949
+ target._o = markOnce;
2950
+ target._n = toNumber;
2951
+ target._s = toString;
2952
+ target._l = renderList;
2953
+ target._t = renderSlot;
2954
+ target._q = looseEqual;
2955
+ target._i = looseIndexOf;
2956
+ target._m = renderStatic;
2957
+ target._f = resolveFilter;
2958
+ target._k = checkKeyCodes;
2959
+ target._b = bindObjectProps;
2960
+ target._v = createTextVNode;
2961
+ target._e = createEmptyVNode;
2962
+ target._u = resolveScopedSlots;
2963
+ target._g = bindObjectListeners;
2964
+ target._d = bindDynamicKeys;
2965
+ target._p = prependModifier;
2966
+ }
2967
+ /* */
2968
+
2969
+
2970
+ function FunctionalRenderContext(data, props, children, parent, Ctor) {
2971
+ var this$1 = this;
2972
+ var options = Ctor.options; // ensure the createElement function in functional components
2973
+ // gets a unique context - this is necessary for correct named slot check
2974
+
2975
+ var contextVm;
2976
+
2977
+ if (hasOwn(parent, '_uid')) {
2978
+ contextVm = Object.create(parent); // $flow-disable-line
2979
+
2980
+ contextVm._original = parent;
2981
+ } else {
2982
+ // the context vm passed in is a functional context as well.
2983
+ // in this case we want to make sure we are able to get a hold to the
2984
+ // real context instance.
2985
+ contextVm = parent; // $flow-disable-line
2986
+
2987
+ parent = parent._original;
2988
+ }
2989
+
2990
+ var isCompiled = isTrue(options._compiled);
2991
+ var needNormalization = !isCompiled;
2992
+ this.data = data;
2993
+ this.props = props;
2994
+ this.children = children;
2995
+ this.parent = parent;
2996
+ this.listeners = data.on || emptyObject;
2997
+ this.injections = resolveInject(options.inject, parent);
2998
+
2999
+ this.slots = function () {
3000
+ if (!this$1.$slots) {
3001
+ normalizeScopedSlots(data.scopedSlots, this$1.$slots = resolveSlots(children, parent));
3002
+ }
3003
+
3004
+ return this$1.$slots;
3005
+ };
3006
+
3007
+ Object.defineProperty(this, 'scopedSlots', {
3008
+ enumerable: true,
3009
+ get: function get() {
3010
+ return normalizeScopedSlots(data.scopedSlots, this.slots());
3011
+ }
3012
+ }); // support for compiled functional template
3013
+
3014
+ if (isCompiled) {
3015
+ // exposing $options for renderStatic()
3016
+ this.$options = options; // pre-resolve slots for renderSlot()
3017
+
3018
+ this.$slots = this.slots();
3019
+ this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
3020
+ }
3021
+
3022
+ if (options._scopeId) {
3023
+ this._c = function (a, b, c, d) {
3024
+ var vnode = createElement(contextVm, a, b, c, d, needNormalization);
3025
+
3026
+ if (vnode && !Array.isArray(vnode)) {
3027
+ vnode.fnScopeId = options._scopeId;
3028
+ vnode.fnContext = parent;
3029
+ }
3030
+
3031
+ return vnode;
3032
+ };
3033
+ } else {
3034
+ this._c = function (a, b, c, d) {
3035
+ return createElement(contextVm, a, b, c, d, needNormalization);
3036
+ };
3037
+ }
3038
+ }
3039
+
3040
+ installRenderHelpers(FunctionalRenderContext.prototype);
3041
+
3042
+ function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
3043
+ var options = Ctor.options;
3044
+ var props = {};
3045
+ var propOptions = options.props;
3046
+
3047
+ if (isDef(propOptions)) {
3048
+ for (var key in propOptions) {
3049
+ props[key] = validateProp(key, propOptions, propsData || emptyObject);
3050
+ }
3051
+ } else {
3052
+ if (isDef(data.attrs)) {
3053
+ mergeProps(props, data.attrs);
3054
+ }
3055
+
3056
+ if (isDef(data.props)) {
3057
+ mergeProps(props, data.props);
3058
+ }
3059
+ }
3060
+
3061
+ var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
3062
+ var vnode = options.render.call(null, renderContext._c, renderContext);
3063
+
3064
+ if (vnode instanceof VNode) {
3065
+ return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
3066
+ } else if (Array.isArray(vnode)) {
3067
+ var vnodes = normalizeChildren(vnode) || [];
3068
+ var res = new Array(vnodes.length);
3069
+
3070
+ for (var i = 0; i < vnodes.length; i++) {
3071
+ res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
3072
+ }
3073
+
3074
+ return res;
3075
+ }
3076
+ }
3077
+
3078
+ function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
3079
+ // #7817 clone node before setting fnContext, otherwise if the node is reused
3080
+ // (e.g. it was from a cached normal slot) the fnContext causes named slots
3081
+ // that should not be matched to match.
3082
+ var clone = cloneVNode(vnode);
3083
+ clone.fnContext = contextVm;
3084
+ clone.fnOptions = options;
3085
+ {
3086
+ (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
3087
+ }
3088
+
3089
+ if (data.slot) {
3090
+ (clone.data || (clone.data = {})).slot = data.slot;
3091
+ }
3092
+
3093
+ return clone;
3094
+ }
3095
+
3096
+ function mergeProps(to, from) {
3097
+ for (var key in from) {
3098
+ to[camelize(key)] = from[key];
3099
+ }
3100
+ }
3101
+ /* */
3102
+
3103
+ /* */
3104
+
3105
+ /* */
3106
+
3107
+ /* */
3108
+ // inline hooks to be invoked on component VNodes during patch
3109
+
3110
+
3111
+ var componentVNodeHooks = {
3112
+ init: function init(vnode, hydrating) {
3113
+ if (vnode.componentInstance && !vnode.componentInstance._isDestroyed && vnode.data.keepAlive) {
3114
+ // kept-alive components, treat as a patch
3115
+ var mountedNode = vnode; // work around flow
3116
+
3117
+ componentVNodeHooks.prepatch(mountedNode, mountedNode);
3118
+ } else {
3119
+ var child = vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance);
3120
+ child.$mount(hydrating ? vnode.elm : undefined, hydrating);
3121
+ }
3122
+ },
3123
+ prepatch: function prepatch(oldVnode, vnode) {
3124
+ var options = vnode.componentOptions;
3125
+ var child = vnode.componentInstance = oldVnode.componentInstance;
3126
+ updateChildComponent(child, options.propsData, // updated props
3127
+ options.listeners, // updated listeners
3128
+ vnode, // new parent vnode
3129
+ options.children // new children
3130
+ );
3131
+ },
3132
+ insert: function insert(vnode) {
3133
+ var context = vnode.context;
3134
+ var componentInstance = vnode.componentInstance;
3135
+
3136
+ if (!componentInstance._isMounted) {
3137
+ componentInstance._isMounted = true;
3138
+ callHook(componentInstance, 'mounted');
3139
+ }
3140
+
3141
+ if (vnode.data.keepAlive) {
3142
+ if (context._isMounted) {
3143
+ // vue-router#1212
3144
+ // During updates, a kept-alive component's child components may
3145
+ // change, so directly walking the tree here may call activated hooks
3146
+ // on incorrect children. Instead we push them into a queue which will
3147
+ // be processed after the whole patch process ended.
3148
+ queueActivatedComponent(componentInstance);
3149
+ } else {
3150
+ activateChildComponent(componentInstance, true
3151
+ /* direct */
3152
+ );
3153
+ }
3154
+ }
3155
+ },
3156
+ destroy: function destroy(vnode) {
3157
+ var componentInstance = vnode.componentInstance;
3158
+
3159
+ if (!componentInstance._isDestroyed) {
3160
+ if (!vnode.data.keepAlive) {
3161
+ componentInstance.$destroy();
3162
+ } else {
3163
+ deactivateChildComponent(componentInstance, true
3164
+ /* direct */
3165
+ );
3166
+ }
3167
+ }
3168
+ }
3169
+ };
3170
+ var hooksToMerge = Object.keys(componentVNodeHooks);
3171
+
3172
+ function createComponent(Ctor, data, context, children, tag) {
3173
+ if (isUndef(Ctor)) {
3174
+ return;
3175
+ }
3176
+
3177
+ var baseCtor = context.$options._base; // plain options object: turn it into a constructor
3178
+
3179
+ if (isObject(Ctor)) {
3180
+ Ctor = baseCtor.extend(Ctor);
3181
+ } // if at this stage it's not a constructor or an async component factory,
3182
+ // reject.
3183
+
3184
+
3185
+ if (typeof Ctor !== 'function') {
3186
+ {
3187
+ warn("Invalid Component definition: " + String(Ctor), context);
3188
+ }
3189
+ return;
3190
+ } // async component
3191
+
3192
+
3193
+ var asyncFactory;
3194
+
3195
+ if (isUndef(Ctor.cid)) {
3196
+ asyncFactory = Ctor;
3197
+ Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
3198
+
3199
+ if (Ctor === undefined) {
3200
+ // return a placeholder node for async component, which is rendered
3201
+ // as a comment node but preserves all the raw information for the node.
3202
+ // the information will be used for async server-rendering and hydration.
3203
+ return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
3204
+ }
3205
+ }
3206
+
3207
+ data = data || {}; // resolve constructor options in case global mixins are applied after
3208
+ // component constructor creation
3209
+
3210
+ resolveConstructorOptions(Ctor); // transform component v-model data into props & events
3211
+
3212
+ if (isDef(data.model)) {
3213
+ transformModel(Ctor.options, data);
3214
+ } // extract props
3215
+
3216
+
3217
+ var propsData = extractPropsFromVNodeData(data, Ctor, tag); // functional component
3218
+
3219
+ if (isTrue(Ctor.options.functional)) {
3220
+ return createFunctionalComponent(Ctor, propsData, data, context, children);
3221
+ } // extract listeners, since these needs to be treated as
3222
+ // child component listeners instead of DOM listeners
3223
+
3224
+
3225
+ var listeners = data.on; // replace with listeners with .native modifier
3226
+ // so it gets processed during parent component patch.
3227
+
3228
+ data.on = data.nativeOn;
3229
+
3230
+ if (isTrue(Ctor.options["abstract"])) {
3231
+ // abstract components do not keep anything
3232
+ // other than props & listeners & slot
3233
+ // work around flow
3234
+ var slot = data.slot;
3235
+ data = {};
3236
+
3237
+ if (slot) {
3238
+ data.slot = slot;
3239
+ }
3240
+ } // install component management hooks onto the placeholder node
3241
+
3242
+
3243
+ installComponentHooks(data); // return a placeholder vnode
3244
+
3245
+ var name = Ctor.options.name || tag;
3246
+ var vnode = new VNode("vue-component-" + Ctor.cid + (name ? "-" + name : ''), data, undefined, undefined, undefined, context, {
3247
+ Ctor: Ctor,
3248
+ propsData: propsData,
3249
+ listeners: listeners,
3250
+ tag: tag,
3251
+ children: children
3252
+ }, asyncFactory);
3253
+ return vnode;
3254
+ }
3255
+
3256
+ function createComponentInstanceForVnode(vnode, // we know it's MountedComponentVNode but flow doesn't
3257
+ parent // activeInstance in lifecycle state
3258
+ ) {
3259
+ var options = {
3260
+ _isComponent: true,
3261
+ _parentVnode: vnode,
3262
+ parent: parent
3263
+ }; // check inline-template render functions
3264
+
3265
+ var inlineTemplate = vnode.data.inlineTemplate;
3266
+
3267
+ if (isDef(inlineTemplate)) {
3268
+ options.render = inlineTemplate.render;
3269
+ options.staticRenderFns = inlineTemplate.staticRenderFns;
3270
+ }
3271
+
3272
+ return new vnode.componentOptions.Ctor(options);
3273
+ }
3274
+
3275
+ function installComponentHooks(data) {
3276
+ var hooks = data.hook || (data.hook = {});
3277
+
3278
+ for (var i = 0; i < hooksToMerge.length; i++) {
3279
+ var key = hooksToMerge[i];
3280
+ var existing = hooks[key];
3281
+ var toMerge = componentVNodeHooks[key];
3282
+
3283
+ if (existing !== toMerge && !(existing && existing._merged)) {
3284
+ hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
3285
+ }
3286
+ }
3287
+ }
3288
+
3289
+ function mergeHook$1(f1, f2) {
3290
+ var merged = function merged(a, b) {
3291
+ // flow complains about extra args which is why we use any
3292
+ f1(a, b);
3293
+ f2(a, b);
3294
+ };
3295
+
3296
+ merged._merged = true;
3297
+ return merged;
3298
+ } // transform component v-model info (value and callback) into
3299
+ // prop and event handler respectively.
3300
+
3301
+
3302
+ function transformModel(options, data) {
3303
+ var prop = options.model && options.model.prop || 'value';
3304
+ var event = options.model && options.model.event || 'input';
3305
+ (data.attrs || (data.attrs = {}))[prop] = data.model.value;
3306
+ var on = data.on || (data.on = {});
3307
+ var existing = on[event];
3308
+ var callback = data.model.callback;
3309
+
3310
+ if (isDef(existing)) {
3311
+ if (Array.isArray(existing) ? existing.indexOf(callback) === -1 : existing !== callback) {
3312
+ on[event] = [callback].concat(existing);
3313
+ }
3314
+ } else {
3315
+ on[event] = callback;
3316
+ }
3317
+ }
3318
+ /* */
3319
+
3320
+
3321
+ var SIMPLE_NORMALIZE = 1;
3322
+ var ALWAYS_NORMALIZE = 2; // wrapper function for providing a more flexible interface
3323
+ // without getting yelled at by flow
3324
+
3325
+ function createElement(context, tag, data, children, normalizationType, alwaysNormalize) {
3326
+ if (Array.isArray(data) || isPrimitive(data)) {
3327
+ normalizationType = children;
3328
+ children = data;
3329
+ data = undefined;
3330
+ }
3331
+
3332
+ if (isTrue(alwaysNormalize)) {
3333
+ normalizationType = ALWAYS_NORMALIZE;
3334
+ }
3335
+
3336
+ return _createElement(context, tag, data, children, normalizationType);
3337
+ }
3338
+
3339
+ function _createElement(context, tag, data, children, normalizationType) {
3340
+ if (isDef(data) && isDef(data.__ob__)) {
3341
+ warn("Avoid using observed data object as vnode data: " + JSON.stringify(data) + "\n" + 'Always create fresh vnode data objects in each render!', context);
3342
+ return createEmptyVNode();
3343
+ } // object syntax in v-bind
3344
+
3345
+
3346
+ if (isDef(data) && isDef(data.is)) {
3347
+ tag = data.is;
3348
+ }
3349
+
3350
+ if (!tag) {
3351
+ // in case of component :is set to falsy value
3352
+ return createEmptyVNode();
3353
+ } // warn against non-primitive key
3354
+
3355
+
3356
+ if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
3357
+ {
3358
+ warn('Avoid using non-primitive value as key, ' + 'use string/number value instead.', context);
3359
+ }
3360
+ } // support single function children as default scoped slot
3361
+
3362
+
3363
+ if (Array.isArray(children) && typeof children[0] === 'function') {
3364
+ data = data || {};
3365
+ data.scopedSlots = {
3366
+ "default": children[0]
3367
+ };
3368
+ children.length = 0;
3369
+ }
3370
+
3371
+ if (normalizationType === ALWAYS_NORMALIZE) {
3372
+ children = normalizeChildren(children);
3373
+ } else if (normalizationType === SIMPLE_NORMALIZE) {
3374
+ children = simpleNormalizeChildren(children);
3375
+ }
3376
+
3377
+ var vnode, ns;
3378
+
3379
+ if (typeof tag === 'string') {
3380
+ var Ctor;
3381
+ ns = context.$vnode && context.$vnode.ns || config.getTagNamespace(tag);
3382
+
3383
+ if (config.isReservedTag(tag)) {
3384
+ // platform built-in elements
3385
+ if (isDef(data) && isDef(data.nativeOn)) {
3386
+ warn("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">.", context);
3387
+ }
3388
+
3389
+ vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
3390
+ } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
3391
+ // component
3392
+ vnode = createComponent(Ctor, data, context, children, tag);
3393
+ } else {
3394
+ // unknown or unlisted namespaced elements
3395
+ // check at runtime because it may get assigned a namespace when its
3396
+ // parent normalizes children
3397
+ vnode = new VNode(tag, data, children, undefined, undefined, context);
3398
+ }
3399
+ } else {
3400
+ // direct component options / constructor
3401
+ vnode = createComponent(tag, data, context, children);
3402
+ }
3403
+
3404
+ if (Array.isArray(vnode)) {
3405
+ return vnode;
3406
+ } else if (isDef(vnode)) {
3407
+ if (isDef(ns)) {
3408
+ applyNS(vnode, ns);
3409
+ }
3410
+
3411
+ if (isDef(data)) {
3412
+ registerDeepBindings(data);
3413
+ }
3414
+
3415
+ return vnode;
3416
+ } else {
3417
+ return createEmptyVNode();
3418
+ }
3419
+ }
3420
+
3421
+ function applyNS(vnode, ns, force) {
3422
+ vnode.ns = ns;
3423
+
3424
+ if (vnode.tag === 'foreignObject') {
3425
+ // use default namespace inside foreignObject
3426
+ ns = undefined;
3427
+ force = true;
3428
+ }
3429
+
3430
+ if (isDef(vnode.children)) {
3431
+ for (var i = 0, l = vnode.children.length; i < l; i++) {
3432
+ var child = vnode.children[i];
3433
+
3434
+ if (isDef(child.tag) && (isUndef(child.ns) || isTrue(force) && child.tag !== 'svg')) {
3435
+ applyNS(child, ns, force);
3436
+ }
3437
+ }
3438
+ }
3439
+ } // ref #5318
3440
+ // necessary to ensure parent re-render when deep bindings like :style and
3441
+ // :class are used on slot nodes
3442
+
3443
+
3444
+ function registerDeepBindings(data) {
3445
+ if (isObject(data.style)) {
3446
+ traverse(data.style);
3447
+ }
3448
+
3449
+ if (isObject(data["class"])) {
3450
+ traverse(data["class"]);
3451
+ }
3452
+ }
3453
+ /* */
3454
+
3455
+
3456
+ function initRender(vm) {
3457
+ vm._vnode = null; // the root of the child tree
3458
+
3459
+ vm._staticTrees = null; // v-once cached trees
3460
+
3461
+ var options = vm.$options;
3462
+ var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
3463
+
3464
+ var renderContext = parentVnode && parentVnode.context;
3465
+ vm.$slots = resolveSlots(options._renderChildren, renderContext);
3466
+ vm.$scopedSlots = emptyObject; // bind the createElement fn to this instance
3467
+ // so that we get proper render context inside it.
3468
+ // args order: tag, data, children, normalizationType, alwaysNormalize
3469
+ // internal version is used by render functions compiled from templates
3470
+
3471
+ vm._c = function (a, b, c, d) {
3472
+ return createElement(vm, a, b, c, d, false);
3473
+ }; // normalization is always applied for the public version, used in
3474
+ // user-written render functions.
3475
+
3476
+
3477
+ vm.$createElement = function (a, b, c, d) {
3478
+ return createElement(vm, a, b, c, d, true);
3479
+ }; // $attrs & $listeners are exposed for easier HOC creation.
3480
+ // they need to be reactive so that HOCs using them are always updated
3481
+
3482
+
3483
+ var parentData = parentVnode && parentVnode.data;
3484
+ /* istanbul ignore else */
3485
+
3486
+ {
3487
+ defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
3488
+ !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
3489
+ }, true);
3490
+ defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
3491
+ !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
3492
+ }, true);
3493
+ }
3494
+ }
3495
+
3496
+ var currentRenderingInstance = null;
3497
+
3498
+ function renderMixin(Vue) {
3499
+ // install runtime convenience helpers
3500
+ installRenderHelpers(Vue.prototype);
3501
+
3502
+ Vue.prototype.$nextTick = function (fn) {
3503
+ return nextTick(fn, this);
3504
+ };
3505
+
3506
+ Vue.prototype._render = function () {
3507
+ var vm = this;
3508
+ var ref = vm.$options;
3509
+ var render = ref.render;
3510
+ var _parentVnode = ref._parentVnode;
3511
+
3512
+ if (_parentVnode) {
3513
+ vm.$scopedSlots = normalizeScopedSlots(_parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
3514
+ } // set parent vnode. this allows render functions to have access
3515
+ // to the data on the placeholder node.
3516
+
3517
+
3518
+ vm.$vnode = _parentVnode; // render self
3519
+
3520
+ var vnode;
3521
+
3522
+ try {
3523
+ // There's no need to maintain a stack because all render fns are called
3524
+ // separately from one another. Nested component's render fns are called
3525
+ // when parent component is patched.
3526
+ currentRenderingInstance = vm;
3527
+ vnode = render.call(vm._renderProxy, vm.$createElement);
3528
+ } catch (e) {
3529
+ handleError(e, vm, "render"); // return error render result,
3530
+ // or previous vnode to prevent render error causing blank component
3531
+
3532
+ /* istanbul ignore else */
3533
+
3534
+ if (vm.$options.renderError) {
3535
+ try {
3536
+ vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
3537
+ } catch (e) {
3538
+ handleError(e, vm, "renderError");
3539
+ vnode = vm._vnode;
3540
+ }
3541
+ } else {
3542
+ vnode = vm._vnode;
3543
+ }
3544
+ } finally {
3545
+ currentRenderingInstance = null;
3546
+ } // if the returned array contains only a single node, allow it
3547
+
3548
+
3549
+ if (Array.isArray(vnode) && vnode.length === 1) {
3550
+ vnode = vnode[0];
3551
+ } // return empty vnode in case the render function errored out
3552
+
3553
+
3554
+ if (!(vnode instanceof VNode)) {
3555
+ if (Array.isArray(vnode)) {
3556
+ warn('Multiple root nodes returned from render function. Render function ' + 'should return a single root node.', vm);
3557
+ }
3558
+
3559
+ vnode = createEmptyVNode();
3560
+ } // set parent
3561
+
3562
+
3563
+ vnode.parent = _parentVnode;
3564
+ return vnode;
3565
+ };
3566
+ }
3567
+ /* */
3568
+
3569
+
3570
+ function ensureCtor(comp, base) {
3571
+ if (comp.__esModule || hasSymbol && comp[Symbol.toStringTag] === 'Module') {
3572
+ comp = comp["default"];
3573
+ }
3574
+
3575
+ return isObject(comp) ? base.extend(comp) : comp;
3576
+ }
3577
+
3578
+ function createAsyncPlaceholder(factory, data, context, children, tag) {
3579
+ var node = createEmptyVNode();
3580
+ node.asyncFactory = factory;
3581
+ node.asyncMeta = {
3582
+ data: data,
3583
+ context: context,
3584
+ children: children,
3585
+ tag: tag
3586
+ };
3587
+ return node;
3588
+ }
3589
+
3590
+ function resolveAsyncComponent(factory, baseCtor) {
3591
+ if (isTrue(factory.error) && isDef(factory.errorComp)) {
3592
+ return factory.errorComp;
3593
+ }
3594
+
3595
+ if (isDef(factory.resolved)) {
3596
+ return factory.resolved;
3597
+ }
3598
+
3599
+ var owner = currentRenderingInstance;
3600
+
3601
+ if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
3602
+ // already pending
3603
+ factory.owners.push(owner);
3604
+ }
3605
+
3606
+ if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
3607
+ return factory.loadingComp;
3608
+ }
3609
+
3610
+ if (owner && !isDef(factory.owners)) {
3611
+ var owners = factory.owners = [owner];
3612
+ var sync = true;
3613
+ var timerLoading = null;
3614
+ var timerTimeout = null;
3615
+ owner.$on('hook:destroyed', function () {
3616
+ return remove(owners, owner);
3617
+ });
3618
+
3619
+ var forceRender = function forceRender(renderCompleted) {
3620
+ for (var i = 0, l = owners.length; i < l; i++) {
3621
+ owners[i].$forceUpdate();
3622
+ }
3623
+
3624
+ if (renderCompleted) {
3625
+ owners.length = 0;
3626
+
3627
+ if (timerLoading !== null) {
3628
+ clearTimeout(timerLoading);
3629
+ timerLoading = null;
3630
+ }
3631
+
3632
+ if (timerTimeout !== null) {
3633
+ clearTimeout(timerTimeout);
3634
+ timerTimeout = null;
3635
+ }
3636
+ }
3637
+ };
3638
+
3639
+ var resolve = once(function (res) {
3640
+ // cache resolved
3641
+ factory.resolved = ensureCtor(res, baseCtor); // invoke callbacks only if this is not a synchronous resolve
3642
+ // (async resolves are shimmed as synchronous during SSR)
3643
+
3644
+ if (!sync) {
3645
+ forceRender(true);
3646
+ } else {
3647
+ owners.length = 0;
3648
+ }
3649
+ });
3650
+ var reject = once(function (reason) {
3651
+ warn("Failed to resolve async component: " + String(factory) + (reason ? "\nReason: " + reason : ''));
3652
+
3653
+ if (isDef(factory.errorComp)) {
3654
+ factory.error = true;
3655
+ forceRender(true);
3656
+ }
3657
+ });
3658
+ var res = factory(resolve, reject);
3659
+
3660
+ if (isObject(res)) {
3661
+ if (isPromise(res)) {
3662
+ // () => Promise
3663
+ if (isUndef(factory.resolved)) {
3664
+ res.then(resolve, reject);
3665
+ }
3666
+ } else if (isPromise(res.component)) {
3667
+ res.component.then(resolve, reject);
3668
+
3669
+ if (isDef(res.error)) {
3670
+ factory.errorComp = ensureCtor(res.error, baseCtor);
3671
+ }
3672
+
3673
+ if (isDef(res.loading)) {
3674
+ factory.loadingComp = ensureCtor(res.loading, baseCtor);
3675
+
3676
+ if (res.delay === 0) {
3677
+ factory.loading = true;
3678
+ } else {
3679
+ timerLoading = setTimeout(function () {
3680
+ timerLoading = null;
3681
+
3682
+ if (isUndef(factory.resolved) && isUndef(factory.error)) {
3683
+ factory.loading = true;
3684
+ forceRender(false);
3685
+ }
3686
+ }, res.delay || 200);
3687
+ }
3688
+ }
3689
+
3690
+ if (isDef(res.timeout)) {
3691
+ timerTimeout = setTimeout(function () {
3692
+ timerTimeout = null;
3693
+
3694
+ if (isUndef(factory.resolved)) {
3695
+ reject("timeout (" + res.timeout + "ms)");
3696
+ }
3697
+ }, res.timeout);
3698
+ }
3699
+ }
3700
+ }
3701
+
3702
+ sync = false; // return in case resolved synchronously
3703
+
3704
+ return factory.loading ? factory.loadingComp : factory.resolved;
3705
+ }
3706
+ }
3707
+ /* */
3708
+
3709
+
3710
+ function isAsyncPlaceholder(node) {
3711
+ return node.isComment && node.asyncFactory;
3712
+ }
3713
+ /* */
3714
+
3715
+
3716
+ function getFirstComponentChild(children) {
3717
+ if (Array.isArray(children)) {
3718
+ for (var i = 0; i < children.length; i++) {
3719
+ var c = children[i];
3720
+
3721
+ if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
3722
+ return c;
3723
+ }
3724
+ }
3725
+ }
3726
+ }
3727
+ /* */
3728
+
3729
+ /* */
3730
+
3731
+
3732
+ function initEvents(vm) {
3733
+ vm._events = Object.create(null);
3734
+ vm._hasHookEvent = false; // init parent attached events
3735
+
3736
+ var listeners = vm.$options._parentListeners;
3737
+
3738
+ if (listeners) {
3739
+ updateComponentListeners(vm, listeners);
3740
+ }
3741
+ }
3742
+
3743
+ var target;
3744
+
3745
+ function add(event, fn) {
3746
+ target.$on(event, fn);
3747
+ }
3748
+
3749
+ function remove$1(event, fn) {
3750
+ target.$off(event, fn);
3751
+ }
3752
+
3753
+ function createOnceHandler(event, fn) {
3754
+ var _target = target;
3755
+ return function onceHandler() {
3756
+ var res = fn.apply(null, arguments);
3757
+
3758
+ if (res !== null) {
3759
+ _target.$off(event, onceHandler);
3760
+ }
3761
+ };
3762
+ }
3763
+
3764
+ function updateComponentListeners(vm, listeners, oldListeners) {
3765
+ target = vm;
3766
+ updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
3767
+ target = undefined;
3768
+ }
3769
+
3770
+ function eventsMixin(Vue) {
3771
+ var hookRE = /^hook:/;
3772
+
3773
+ Vue.prototype.$on = function (event, fn) {
3774
+ var vm = this;
3775
+
3776
+ if (Array.isArray(event)) {
3777
+ for (var i = 0, l = event.length; i < l; i++) {
3778
+ vm.$on(event[i], fn);
3779
+ }
3780
+ } else {
3781
+ (vm._events[event] || (vm._events[event] = [])).push(fn); // optimize hook:event cost by using a boolean flag marked at registration
3782
+ // instead of a hash lookup
3783
+
3784
+ if (hookRE.test(event)) {
3785
+ vm._hasHookEvent = true;
3786
+ }
3787
+ }
3788
+
3789
+ return vm;
3790
+ };
3791
+
3792
+ Vue.prototype.$once = function (event, fn) {
3793
+ var vm = this;
3794
+
3795
+ function on() {
3796
+ vm.$off(event, on);
3797
+ fn.apply(vm, arguments);
3798
+ }
3799
+
3800
+ on.fn = fn;
3801
+ vm.$on(event, on);
3802
+ return vm;
3803
+ };
3804
+
3805
+ Vue.prototype.$off = function (event, fn) {
3806
+ var vm = this; // all
3807
+
3808
+ if (!arguments.length) {
3809
+ vm._events = Object.create(null);
3810
+ return vm;
3811
+ } // array of events
3812
+
3813
+
3814
+ if (Array.isArray(event)) {
3815
+ for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
3816
+ vm.$off(event[i$1], fn);
3817
+ }
3818
+
3819
+ return vm;
3820
+ } // specific event
3821
+
3822
+
3823
+ var cbs = vm._events[event];
3824
+
3825
+ if (!cbs) {
3826
+ return vm;
3827
+ }
3828
+
3829
+ if (!fn) {
3830
+ vm._events[event] = null;
3831
+ return vm;
3832
+ } // specific handler
3833
+
3834
+
3835
+ var cb;
3836
+ var i = cbs.length;
3837
+
3838
+ while (i--) {
3839
+ cb = cbs[i];
3840
+
3841
+ if (cb === fn || cb.fn === fn) {
3842
+ cbs.splice(i, 1);
3843
+ break;
3844
+ }
3845
+ }
3846
+
3847
+ return vm;
3848
+ };
3849
+
3850
+ Vue.prototype.$emit = function (event) {
3851
+ var vm = this;
3852
+ {
3853
+ var lowerCaseEvent = event.toLowerCase();
3854
+
3855
+ if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
3856
+ tip("Event \"" + lowerCaseEvent + "\" is emitted in component " + formatComponentName(vm) + " but the handler is registered for \"" + event + "\". " + "Note that HTML attributes are case-insensitive and you cannot use " + "v-on to listen to camelCase events when using in-DOM templates. " + "You should probably use \"" + hyphenate(event) + "\" instead of \"" + event + "\".");
3857
+ }
3858
+ }
3859
+ var cbs = vm._events[event];
3860
+
3861
+ if (cbs) {
3862
+ cbs = cbs.length > 1 ? toArray(cbs) : cbs;
3863
+ var args = toArray(arguments, 1);
3864
+ var info = "event handler for \"" + event + "\"";
3865
+
3866
+ for (var i = 0, l = cbs.length; i < l; i++) {
3867
+ invokeWithErrorHandling(cbs[i], vm, args, vm, info);
3868
+ }
3869
+ }
3870
+
3871
+ return vm;
3872
+ };
3873
+ }
3874
+ /* */
3875
+
3876
+
3877
+ var activeInstance = null;
3878
+ var isUpdatingChildComponent = false;
3879
+
3880
+ function setActiveInstance(vm) {
3881
+ var prevActiveInstance = activeInstance;
3882
+ activeInstance = vm;
3883
+ return function () {
3884
+ activeInstance = prevActiveInstance;
3885
+ };
3886
+ }
3887
+
3888
+ function initLifecycle(vm) {
3889
+ var options = vm.$options; // locate first non-abstract parent
3890
+
3891
+ var parent = options.parent;
3892
+
3893
+ if (parent && !options["abstract"]) {
3894
+ while (parent.$options["abstract"] && parent.$parent) {
3895
+ parent = parent.$parent;
3896
+ }
3897
+
3898
+ parent.$children.push(vm);
3899
+ }
3900
+
3901
+ vm.$parent = parent;
3902
+ vm.$root = parent ? parent.$root : vm;
3903
+ vm.$children = [];
3904
+ vm.$refs = {};
3905
+ vm._watcher = null;
3906
+ vm._inactive = null;
3907
+ vm._directInactive = false;
3908
+ vm._isMounted = false;
3909
+ vm._isDestroyed = false;
3910
+ vm._isBeingDestroyed = false;
3911
+ }
3912
+
3913
+ function lifecycleMixin(Vue) {
3914
+ Vue.prototype._update = function (vnode, hydrating) {
3915
+ var vm = this;
3916
+ var prevEl = vm.$el;
3917
+ var prevVnode = vm._vnode;
3918
+ var restoreActiveInstance = setActiveInstance(vm);
3919
+ vm._vnode = vnode; // Vue.prototype.__patch__ is injected in entry points
3920
+ // based on the rendering backend used.
3921
+
3922
+ if (!prevVnode) {
3923
+ // initial render
3924
+ vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false
3925
+ /* removeOnly */
3926
+ );
3927
+ } else {
3928
+ // updates
3929
+ vm.$el = vm.__patch__(prevVnode, vnode);
3930
+ }
3931
+
3932
+ restoreActiveInstance(); // update __vue__ reference
3933
+
3934
+ if (prevEl) {
3935
+ prevEl.__vue__ = null;
3936
+ }
3937
+
3938
+ if (vm.$el) {
3939
+ vm.$el.__vue__ = vm;
3940
+ } // if parent is an HOC, update its $el as well
3941
+
3942
+
3943
+ if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
3944
+ vm.$parent.$el = vm.$el;
3945
+ } // updated hook is called by the scheduler to ensure that children are
3946
+ // updated in a parent's updated hook.
3947
+
3948
+ };
3949
+
3950
+ Vue.prototype.$forceUpdate = function () {
3951
+ var vm = this;
3952
+
3953
+ if (vm._watcher) {
3954
+ vm._watcher.update();
3955
+ }
3956
+ };
3957
+
3958
+ Vue.prototype.$destroy = function () {
3959
+ var vm = this;
3960
+
3961
+ if (vm._isBeingDestroyed) {
3962
+ return;
3963
+ }
3964
+
3965
+ callHook(vm, 'beforeDestroy');
3966
+ vm._isBeingDestroyed = true; // remove self from parent
3967
+
3968
+ var parent = vm.$parent;
3969
+
3970
+ if (parent && !parent._isBeingDestroyed && !vm.$options["abstract"]) {
3971
+ remove(parent.$children, vm);
3972
+ } // teardown watchers
3973
+
3974
+
3975
+ if (vm._watcher) {
3976
+ vm._watcher.teardown();
3977
+ }
3978
+
3979
+ var i = vm._watchers.length;
3980
+
3981
+ while (i--) {
3982
+ vm._watchers[i].teardown();
3983
+ } // remove reference from data ob
3984
+ // frozen object may not have observer.
3985
+
3986
+
3987
+ if (vm._data.__ob__) {
3988
+ vm._data.__ob__.vmCount--;
3989
+ } // call the last hook...
3990
+
3991
+
3992
+ vm._isDestroyed = true; // invoke destroy hooks on current rendered tree
3993
+
3994
+ vm.__patch__(vm._vnode, null); // fire destroyed hook
3995
+
3996
+
3997
+ callHook(vm, 'destroyed'); // turn off all instance listeners.
3998
+
3999
+ vm.$off(); // remove __vue__ reference
4000
+
4001
+ if (vm.$el) {
4002
+ vm.$el.__vue__ = null;
4003
+ } // release circular reference (#6759)
4004
+
4005
+
4006
+ if (vm.$vnode) {
4007
+ vm.$vnode.parent = null;
4008
+ }
4009
+ };
4010
+ }
4011
+
4012
+ function mountComponent(vm, el, hydrating) {
4013
+ vm.$el = el;
4014
+
4015
+ if (!vm.$options.render) {
4016
+ vm.$options.render = createEmptyVNode;
4017
+ {
4018
+ /* istanbul ignore if */
4019
+ if (vm.$options.template && vm.$options.template.charAt(0) !== '#' || vm.$options.el || el) {
4020
+ warn('You are using the runtime-only build of Vue where the template ' + 'compiler is not available. Either pre-compile the templates into ' + 'render functions, or use the compiler-included build.', vm);
4021
+ } else {
4022
+ warn('Failed to mount component: template or render function not defined.', vm);
4023
+ }
4024
+ }
4025
+ }
4026
+
4027
+ callHook(vm, 'beforeMount');
4028
+ var updateComponent;
4029
+ /* istanbul ignore if */
4030
+
4031
+ if (config.performance && mark) {
4032
+ updateComponent = function updateComponent() {
4033
+ var name = vm._name;
4034
+ var id = vm._uid;
4035
+ var startTag = "vue-perf-start:" + id;
4036
+ var endTag = "vue-perf-end:" + id;
4037
+ mark(startTag);
4038
+
4039
+ var vnode = vm._render();
4040
+
4041
+ mark(endTag);
4042
+ measure("vue " + name + " render", startTag, endTag);
4043
+ mark(startTag);
4044
+
4045
+ vm._update(vnode, hydrating);
4046
+
4047
+ mark(endTag);
4048
+ measure("vue " + name + " patch", startTag, endTag);
4049
+ };
4050
+ } else {
4051
+ updateComponent = function updateComponent() {
4052
+ vm._update(vm._render(), hydrating);
4053
+ };
4054
+ } // we set this to vm._watcher inside the watcher's constructor
4055
+ // since the watcher's initial patch may call $forceUpdate (e.g. inside child
4056
+ // component's mounted hook), which relies on vm._watcher being already defined
4057
+
4058
+
4059
+ new Watcher(vm, updateComponent, noop, {
4060
+ before: function before() {
4061
+ if (vm._isMounted && !vm._isDestroyed) {
4062
+ callHook(vm, 'beforeUpdate');
4063
+ }
4064
+ }
4065
+ }, true
4066
+ /* isRenderWatcher */
4067
+ );
4068
+ hydrating = false; // manually mounted instance, call mounted on self
4069
+ // mounted is called for render-created child components in its inserted hook
4070
+
4071
+ if (vm.$vnode == null) {
4072
+ vm._isMounted = true;
4073
+ callHook(vm, 'mounted');
4074
+ }
4075
+
4076
+ return vm;
4077
+ }
4078
+
4079
+ function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
4080
+ {
4081
+ isUpdatingChildComponent = true;
4082
+ } // determine whether component has slot children
4083
+ // we need to do this before overwriting $options._renderChildren.
4084
+ // check if there are dynamic scopedSlots (hand-written or compiled but with
4085
+ // dynamic slot names). Static scoped slots compiled from template has the
4086
+ // "$stable" marker.
4087
+
4088
+ var newScopedSlots = parentVnode.data.scopedSlots;
4089
+ var oldScopedSlots = vm.$scopedSlots;
4090
+ var hasDynamicScopedSlot = !!(newScopedSlots && !newScopedSlots.$stable || oldScopedSlots !== emptyObject && !oldScopedSlots.$stable || newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key); // Any static slot children from the parent may have changed during parent's
4091
+ // update. Dynamic scoped slots may also have changed. In such cases, a forced
4092
+ // update is necessary to ensure correctness.
4093
+
4094
+ var needsForceUpdate = !!(renderChildren || // has new static slots
4095
+ vm.$options._renderChildren || // has old static slots
4096
+ hasDynamicScopedSlot);
4097
+ vm.$options._parentVnode = parentVnode;
4098
+ vm.$vnode = parentVnode; // update vm's placeholder node without re-render
4099
+
4100
+ if (vm._vnode) {
4101
+ // update child tree's parent
4102
+ vm._vnode.parent = parentVnode;
4103
+ }
4104
+
4105
+ vm.$options._renderChildren = renderChildren; // update $attrs and $listeners hash
4106
+ // these are also reactive so they may trigger child update if the child
4107
+ // used them during render
4108
+
4109
+ vm.$attrs = parentVnode.data.attrs || emptyObject;
4110
+ vm.$listeners = listeners || emptyObject; // update props
4111
+
4112
+ if (propsData && vm.$options.props) {
4113
+ toggleObserving(false);
4114
+ var props = vm._props;
4115
+ var propKeys = vm.$options._propKeys || [];
4116
+
4117
+ for (var i = 0; i < propKeys.length; i++) {
4118
+ var key = propKeys[i];
4119
+ var propOptions = vm.$options.props; // wtf flow?
4120
+
4121
+ props[key] = validateProp(key, propOptions, propsData, vm);
4122
+ }
4123
+
4124
+ toggleObserving(true); // keep a copy of raw propsData
4125
+
4126
+ vm.$options.propsData = propsData;
4127
+ } // update listeners
4128
+
4129
+
4130
+ listeners = listeners || emptyObject;
4131
+ var oldListeners = vm.$options._parentListeners;
4132
+ vm.$options._parentListeners = listeners;
4133
+ updateComponentListeners(vm, listeners, oldListeners); // resolve slots + force update if has children
4134
+
4135
+ if (needsForceUpdate) {
4136
+ vm.$slots = resolveSlots(renderChildren, parentVnode.context);
4137
+ vm.$forceUpdate();
4138
+ }
4139
+
4140
+ {
4141
+ isUpdatingChildComponent = false;
4142
+ }
4143
+ }
4144
+
4145
+ function isInInactiveTree(vm) {
4146
+ while (vm && (vm = vm.$parent)) {
4147
+ if (vm._inactive) {
4148
+ return true;
4149
+ }
4150
+ }
4151
+
4152
+ return false;
4153
+ }
4154
+
4155
+ function activateChildComponent(vm, direct) {
4156
+ if (direct) {
4157
+ vm._directInactive = false;
4158
+
4159
+ if (isInInactiveTree(vm)) {
4160
+ return;
4161
+ }
4162
+ } else if (vm._directInactive) {
4163
+ return;
4164
+ }
4165
+
4166
+ if (vm._inactive || vm._inactive === null) {
4167
+ vm._inactive = false;
4168
+
4169
+ for (var i = 0; i < vm.$children.length; i++) {
4170
+ activateChildComponent(vm.$children[i]);
4171
+ }
4172
+
4173
+ callHook(vm, 'activated');
4174
+ }
4175
+ }
4176
+
4177
+ function deactivateChildComponent(vm, direct) {
4178
+ if (direct) {
4179
+ vm._directInactive = true;
4180
+
4181
+ if (isInInactiveTree(vm)) {
4182
+ return;
4183
+ }
4184
+ }
4185
+
4186
+ if (!vm._inactive) {
4187
+ vm._inactive = true;
4188
+
4189
+ for (var i = 0; i < vm.$children.length; i++) {
4190
+ deactivateChildComponent(vm.$children[i]);
4191
+ }
4192
+
4193
+ callHook(vm, 'deactivated');
4194
+ }
4195
+ }
4196
+
4197
+ function callHook(vm, hook) {
4198
+ // #7573 disable dep collection when invoking lifecycle hooks
4199
+ pushTarget();
4200
+ var handlers = vm.$options[hook];
4201
+ var info = hook + " hook";
4202
+
4203
+ if (handlers) {
4204
+ for (var i = 0, j = handlers.length; i < j; i++) {
4205
+ invokeWithErrorHandling(handlers[i], vm, null, vm, info);
4206
+ }
4207
+ }
4208
+
4209
+ if (vm._hasHookEvent) {
4210
+ vm.$emit('hook:' + hook);
4211
+ }
4212
+
4213
+ popTarget();
4214
+ }
4215
+ /* */
4216
+
4217
+
4218
+ var MAX_UPDATE_COUNT = 100;
4219
+ var queue = [];
4220
+ var activatedChildren = [];
4221
+ var has = {};
4222
+ var circular = {};
4223
+ var waiting = false;
4224
+ var flushing = false;
4225
+ var index = 0;
4226
+ /**
4227
+ * Reset the scheduler's state.
4228
+ */
4229
+
4230
+ function resetSchedulerState() {
4231
+ index = queue.length = activatedChildren.length = 0;
4232
+ has = {};
4233
+ {
4234
+ circular = {};
4235
+ }
4236
+ waiting = flushing = false;
4237
+ } // Async edge case #6566 requires saving the timestamp when event listeners are
4238
+ // attached. However, calling performance.now() has a perf overhead especially
4239
+ // if the page has thousands of event listeners. Instead, we take a timestamp
4240
+ // every time the scheduler flushes and use that for all event listeners
4241
+ // attached during that flush.
4242
+
4243
+
4244
+ var currentFlushTimestamp = 0; // Async edge case fix requires storing an event listener's attach timestamp.
4245
+
4246
+ var getNow = Date.now; // Determine what event timestamp the browser is using. Annoyingly, the
4247
+ // timestamp can either be hi-res (relative to page load) or low-res
4248
+ // (relative to UNIX epoch), so in order to compare time we have to use the
4249
+ // same timestamp type when saving the flush timestamp.
4250
+ // All IE versions use low-res event timestamps, and have problematic clock
4251
+ // implementations (#9632)
4252
+
4253
+ if (inBrowser && !isIE) {
4254
+ var performance = window.performance;
4255
+
4256
+ if (performance && typeof performance.now === 'function' && getNow() > document.createEvent('Event').timeStamp) {
4257
+ // if the event timestamp, although evaluated AFTER the Date.now(), is
4258
+ // smaller than it, it means the event is using a hi-res timestamp,
4259
+ // and we need to use the hi-res version for event listener timestamps as
4260
+ // well.
4261
+ getNow = function getNow() {
4262
+ return performance.now();
4263
+ };
4264
+ }
4265
+ }
4266
+ /**
4267
+ * Flush both queues and run the watchers.
4268
+ */
4269
+
4270
+
4271
+ function flushSchedulerQueue() {
4272
+ currentFlushTimestamp = getNow();
4273
+ flushing = true;
4274
+ var watcher, id; // Sort queue before flush.
4275
+ // This ensures that:
4276
+ // 1. Components are updated from parent to child. (because parent is always
4277
+ // created before the child)
4278
+ // 2. A component's user watchers are run before its render watcher (because
4279
+ // user watchers are created before the render watcher)
4280
+ // 3. If a component is destroyed during a parent component's watcher run,
4281
+ // its watchers can be skipped.
4282
+
4283
+ queue.sort(function (a, b) {
4284
+ return a.id - b.id;
4285
+ }); // do not cache length because more watchers might be pushed
4286
+ // as we run existing watchers
4287
+
4288
+ for (index = 0; index < queue.length; index++) {
4289
+ watcher = queue[index];
4290
+
4291
+ if (watcher.before) {
4292
+ watcher.before();
4293
+ }
4294
+
4295
+ id = watcher.id;
4296
+ has[id] = null;
4297
+ watcher.run(); // in dev build, check and stop circular updates.
4298
+
4299
+ if (has[id] != null) {
4300
+ circular[id] = (circular[id] || 0) + 1;
4301
+
4302
+ if (circular[id] > MAX_UPDATE_COUNT) {
4303
+ warn('You may have an infinite update loop ' + (watcher.user ? "in watcher with expression \"" + watcher.expression + "\"" : "in a component render function."), watcher.vm);
4304
+ break;
4305
+ }
4306
+ }
4307
+ } // keep copies of post queues before resetting state
4308
+
4309
+
4310
+ var activatedQueue = activatedChildren.slice();
4311
+ var updatedQueue = queue.slice();
4312
+ resetSchedulerState(); // call component updated and activated hooks
4313
+
4314
+ callActivatedHooks(activatedQueue);
4315
+ callUpdatedHooks(updatedQueue); // devtool hook
4316
+
4317
+ /* istanbul ignore if */
4318
+
4319
+ if (devtools && config.devtools) {
4320
+ devtools.emit('flush');
4321
+ }
4322
+ }
4323
+
4324
+ function callUpdatedHooks(queue) {
4325
+ var i = queue.length;
4326
+
4327
+ while (i--) {
4328
+ var watcher = queue[i];
4329
+ var vm = watcher.vm;
4330
+
4331
+ if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
4332
+ callHook(vm, 'updated');
4333
+ }
4334
+ }
4335
+ }
4336
+ /**
4337
+ * Queue a kept-alive component that was activated during patch.
4338
+ * The queue will be processed after the entire tree has been patched.
4339
+ */
4340
+
4341
+
4342
+ function queueActivatedComponent(vm) {
4343
+ // setting _inactive to false here so that a render function can
4344
+ // rely on checking whether it's in an inactive tree (e.g. router-view)
4345
+ vm._inactive = false;
4346
+ activatedChildren.push(vm);
4347
+ }
4348
+
4349
+ function callActivatedHooks(queue) {
4350
+ for (var i = 0; i < queue.length; i++) {
4351
+ queue[i]._inactive = true;
4352
+ activateChildComponent(queue[i], true
4353
+ /* true */
4354
+ );
4355
+ }
4356
+ }
4357
+ /**
4358
+ * Push a watcher into the watcher queue.
4359
+ * Jobs with duplicate IDs will be skipped unless it's
4360
+ * pushed when the queue is being flushed.
4361
+ */
4362
+
4363
+
4364
+ function queueWatcher(watcher) {
4365
+ var id = watcher.id;
4366
+
4367
+ if (has[id] == null) {
4368
+ has[id] = true;
4369
+
4370
+ if (!flushing) {
4371
+ queue.push(watcher);
4372
+ } else {
4373
+ // if already flushing, splice the watcher based on its id
4374
+ // if already past its id, it will be run next immediately.
4375
+ var i = queue.length - 1;
4376
+
4377
+ while (i > index && queue[i].id > watcher.id) {
4378
+ i--;
4379
+ }
4380
+
4381
+ queue.splice(i + 1, 0, watcher);
4382
+ } // queue the flush
4383
+
4384
+
4385
+ if (!waiting) {
4386
+ waiting = true;
4387
+
4388
+ if (!config.async) {
4389
+ flushSchedulerQueue();
4390
+ return;
4391
+ }
4392
+
4393
+ nextTick(flushSchedulerQueue);
4394
+ }
4395
+ }
4396
+ }
4397
+ /* */
4398
+
4399
+
4400
+ var uid$2 = 0;
4401
+ /**
4402
+ * A watcher parses an expression, collects dependencies,
4403
+ * and fires callback when the expression value changes.
4404
+ * This is used for both the $watch() api and directives.
4405
+ */
4406
+
4407
+ var Watcher = function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
4408
+ this.vm = vm;
4409
+
4410
+ if (isRenderWatcher) {
4411
+ vm._watcher = this;
4412
+ }
4413
+
4414
+ vm._watchers.push(this); // options
4415
+
4416
+
4417
+ if (options) {
4418
+ this.deep = !!options.deep;
4419
+ this.user = !!options.user;
4420
+ this.lazy = !!options.lazy;
4421
+ this.sync = !!options.sync;
4422
+ this.before = options.before;
4423
+ } else {
4424
+ this.deep = this.user = this.lazy = this.sync = false;
4425
+ }
4426
+
4427
+ this.cb = cb;
4428
+ this.id = ++uid$2; // uid for batching
4429
+
4430
+ this.active = true;
4431
+ this.dirty = this.lazy; // for lazy watchers
4432
+
4433
+ this.deps = [];
4434
+ this.newDeps = [];
4435
+ this.depIds = new _Set();
4436
+ this.newDepIds = new _Set();
4437
+ this.expression = expOrFn.toString(); // parse expression for getter
4438
+
4439
+ if (typeof expOrFn === 'function') {
4440
+ this.getter = expOrFn;
4441
+ } else {
4442
+ this.getter = parsePath(expOrFn);
4443
+
4444
+ if (!this.getter) {
4445
+ this.getter = noop;
4446
+ warn("Failed watching path: \"" + expOrFn + "\" " + 'Watcher only accepts simple dot-delimited paths. ' + 'For full control, use a function instead.', vm);
4447
+ }
4448
+ }
4449
+
4450
+ this.value = this.lazy ? undefined : this.get();
4451
+ };
4452
+ /**
4453
+ * Evaluate the getter, and re-collect dependencies.
4454
+ */
4455
+
4456
+
4457
+ Watcher.prototype.get = function get() {
4458
+ pushTarget(this);
4459
+ var value;
4460
+ var vm = this.vm;
4461
+
4462
+ try {
4463
+ value = this.getter.call(vm, vm);
4464
+ } catch (e) {
4465
+ if (this.user) {
4466
+ handleError(e, vm, "getter for watcher \"" + this.expression + "\"");
4467
+ } else {
4468
+ throw e;
4469
+ }
4470
+ } finally {
4471
+ // "touch" every property so they are all tracked as
4472
+ // dependencies for deep watching
4473
+ if (this.deep) {
4474
+ traverse(value);
4475
+ }
4476
+
4477
+ popTarget();
4478
+ this.cleanupDeps();
4479
+ }
4480
+
4481
+ return value;
4482
+ };
4483
+ /**
4484
+ * Add a dependency to this directive.
4485
+ */
4486
+
4487
+
4488
+ Watcher.prototype.addDep = function addDep(dep) {
4489
+ var id = dep.id;
4490
+
4491
+ if (!this.newDepIds.has(id)) {
4492
+ this.newDepIds.add(id);
4493
+ this.newDeps.push(dep);
4494
+
4495
+ if (!this.depIds.has(id)) {
4496
+ dep.addSub(this);
4497
+ }
4498
+ }
4499
+ };
4500
+ /**
4501
+ * Clean up for dependency collection.
4502
+ */
4503
+
4504
+
4505
+ Watcher.prototype.cleanupDeps = function cleanupDeps() {
4506
+ var i = this.deps.length;
4507
+
4508
+ while (i--) {
4509
+ var dep = this.deps[i];
4510
+
4511
+ if (!this.newDepIds.has(dep.id)) {
4512
+ dep.removeSub(this);
4513
+ }
4514
+ }
4515
+
4516
+ var tmp = this.depIds;
4517
+ this.depIds = this.newDepIds;
4518
+ this.newDepIds = tmp;
4519
+ this.newDepIds.clear();
4520
+ tmp = this.deps;
4521
+ this.deps = this.newDeps;
4522
+ this.newDeps = tmp;
4523
+ this.newDeps.length = 0;
4524
+ };
4525
+ /**
4526
+ * Subscriber interface.
4527
+ * Will be called when a dependency changes.
4528
+ */
4529
+
4530
+
4531
+ Watcher.prototype.update = function update() {
4532
+ /* istanbul ignore else */
4533
+ if (this.lazy) {
4534
+ this.dirty = true;
4535
+ } else if (this.sync) {
4536
+ this.run();
4537
+ } else {
4538
+ queueWatcher(this);
4539
+ }
4540
+ };
4541
+ /**
4542
+ * Scheduler job interface.
4543
+ * Will be called by the scheduler.
4544
+ */
4545
+
4546
+
4547
+ Watcher.prototype.run = function run() {
4548
+ if (this.active) {
4549
+ var value = this.get();
4550
+
4551
+ if (value !== this.value || // Deep watchers and watchers on Object/Arrays should fire even
4552
+ // when the value is the same, because the value may
4553
+ // have mutated.
4554
+ isObject(value) || this.deep) {
4555
+ // set new value
4556
+ var oldValue = this.value;
4557
+ this.value = value;
4558
+
4559
+ if (this.user) {
4560
+ try {
4561
+ this.cb.call(this.vm, value, oldValue);
4562
+ } catch (e) {
4563
+ handleError(e, this.vm, "callback for watcher \"" + this.expression + "\"");
4564
+ }
4565
+ } else {
4566
+ this.cb.call(this.vm, value, oldValue);
4567
+ }
4568
+ }
4569
+ }
4570
+ };
4571
+ /**
4572
+ * Evaluate the value of the watcher.
4573
+ * This only gets called for lazy watchers.
4574
+ */
4575
+
4576
+
4577
+ Watcher.prototype.evaluate = function evaluate() {
4578
+ this.value = this.get();
4579
+ this.dirty = false;
4580
+ };
4581
+ /**
4582
+ * Depend on all deps collected by this watcher.
4583
+ */
4584
+
4585
+
4586
+ Watcher.prototype.depend = function depend() {
4587
+ var i = this.deps.length;
4588
+
4589
+ while (i--) {
4590
+ this.deps[i].depend();
4591
+ }
4592
+ };
4593
+ /**
4594
+ * Remove self from all dependencies' subscriber list.
4595
+ */
4596
+
4597
+
4598
+ Watcher.prototype.teardown = function teardown() {
4599
+ if (this.active) {
4600
+ // remove self from vm's watcher list
4601
+ // this is a somewhat expensive operation so we skip it
4602
+ // if the vm is being destroyed.
4603
+ if (!this.vm._isBeingDestroyed) {
4604
+ remove(this.vm._watchers, this);
4605
+ }
4606
+
4607
+ var i = this.deps.length;
4608
+
4609
+ while (i--) {
4610
+ this.deps[i].removeSub(this);
4611
+ }
4612
+
4613
+ this.active = false;
4614
+ }
4615
+ };
4616
+ /* */
4617
+
4618
+
4619
+ var sharedPropertyDefinition = {
4620
+ enumerable: true,
4621
+ configurable: true,
4622
+ get: noop,
4623
+ set: noop
4624
+ };
4625
+
4626
+ function proxy(target, sourceKey, key) {
4627
+ sharedPropertyDefinition.get = function proxyGetter() {
4628
+ return this[sourceKey][key];
4629
+ };
4630
+
4631
+ sharedPropertyDefinition.set = function proxySetter(val) {
4632
+ this[sourceKey][key] = val;
4633
+ };
4634
+
4635
+ Object.defineProperty(target, key, sharedPropertyDefinition);
4636
+ }
4637
+
4638
+ function initState(vm) {
4639
+ vm._watchers = [];
4640
+ var opts = vm.$options;
4641
+
4642
+ if (opts.props) {
4643
+ initProps(vm, opts.props);
4644
+ }
4645
+
4646
+ if (opts.methods) {
4647
+ initMethods(vm, opts.methods);
4648
+ }
4649
+
4650
+ if (opts.data) {
4651
+ initData(vm);
4652
+ } else {
4653
+ observe(vm._data = {}, true
4654
+ /* asRootData */
4655
+ );
4656
+ }
4657
+
4658
+ if (opts.computed) {
4659
+ initComputed(vm, opts.computed);
4660
+ }
4661
+
4662
+ if (opts.watch && opts.watch !== nativeWatch) {
4663
+ initWatch(vm, opts.watch);
4664
+ }
4665
+ }
4666
+
4667
+ function initProps(vm, propsOptions) {
4668
+ var propsData = vm.$options.propsData || {};
4669
+ var props = vm._props = {}; // cache prop keys so that future props updates can iterate using Array
4670
+ // instead of dynamic object key enumeration.
4671
+
4672
+ var keys = vm.$options._propKeys = [];
4673
+ var isRoot = !vm.$parent; // root instance props should be converted
4674
+
4675
+ if (!isRoot) {
4676
+ toggleObserving(false);
4677
+ }
4678
+
4679
+ var loop = function loop(key) {
4680
+ keys.push(key);
4681
+ var value = validateProp(key, propsOptions, propsData, vm);
4682
+ /* istanbul ignore else */
4683
+
4684
+ {
4685
+ var hyphenatedKey = hyphenate(key);
4686
+
4687
+ if (isReservedAttribute(hyphenatedKey) || config.isReservedAttr(hyphenatedKey)) {
4688
+ warn("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop.", vm);
4689
+ }
4690
+
4691
+ defineReactive$$1(props, key, value, function () {
4692
+ if (!isRoot && !isUpdatingChildComponent) {
4693
+ warn("Avoid mutating a prop directly since the value will be " + "overwritten whenever the parent component re-renders. " + "Instead, use a data or computed property based on the prop's " + "value. Prop being mutated: \"" + key + "\"", vm);
4694
+ }
4695
+ });
4696
+ } // static props are already proxied on the component's prototype
4697
+ // during Vue.extend(). We only need to proxy props defined at
4698
+ // instantiation here.
4699
+
4700
+ if (!(key in vm)) {
4701
+ proxy(vm, "_props", key);
4702
+ }
4703
+ };
4704
+
4705
+ for (var key in propsOptions) {
4706
+ loop(key);
4707
+ }
4708
+
4709
+ toggleObserving(true);
4710
+ }
4711
+
4712
+ function initData(vm) {
4713
+ var data = vm.$options.data;
4714
+ data = vm._data = typeof data === 'function' ? getData(data, vm) : data || {};
4715
+
4716
+ if (!isPlainObject(data)) {
4717
+ data = {};
4718
+ warn('data functions should return an object:\n' + 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
4719
+ } // proxy data on instance
4720
+
4721
+
4722
+ var keys = Object.keys(data);
4723
+ var props = vm.$options.props;
4724
+ var methods = vm.$options.methods;
4725
+ var i = keys.length;
4726
+
4727
+ while (i--) {
4728
+ var key = keys[i];
4729
+ {
4730
+ if (methods && hasOwn(methods, key)) {
4731
+ warn("Method \"" + key + "\" has already been defined as a data property.", vm);
4732
+ }
4733
+ }
4734
+
4735
+ if (props && hasOwn(props, key)) {
4736
+ warn("The data property \"" + key + "\" is already declared as a prop. " + "Use prop default value instead.", vm);
4737
+ } else if (!isReserved(key)) {
4738
+ proxy(vm, "_data", key);
4739
+ }
4740
+ } // observe data
4741
+
4742
+
4743
+ observe(data, true
4744
+ /* asRootData */
4745
+ );
4746
+ }
4747
+
4748
+ function getData(data, vm) {
4749
+ // #7573 disable dep collection when invoking data getters
4750
+ pushTarget();
4751
+
4752
+ try {
4753
+ return data.call(vm, vm);
4754
+ } catch (e) {
4755
+ handleError(e, vm, "data()");
4756
+ return {};
4757
+ } finally {
4758
+ popTarget();
4759
+ }
4760
+ }
4761
+
4762
+ var computedWatcherOptions = {
4763
+ lazy: true
4764
+ };
4765
+
4766
+ function initComputed(vm, computed) {
4767
+ // $flow-disable-line
4768
+ var watchers = vm._computedWatchers = Object.create(null); // computed properties are just getters during SSR
4769
+
4770
+ var isSSR = isServerRendering();
4771
+
4772
+ for (var key in computed) {
4773
+ var userDef = computed[key];
4774
+ var getter = typeof userDef === 'function' ? userDef : userDef.get;
4775
+
4776
+ if (getter == null) {
4777
+ warn("Getter is missing for computed property \"" + key + "\".", vm);
4778
+ }
4779
+
4780
+ if (!isSSR) {
4781
+ // create internal watcher for the computed property.
4782
+ watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
4783
+ } // component-defined computed properties are already defined on the
4784
+ // component prototype. We only need to define computed properties defined
4785
+ // at instantiation here.
4786
+
4787
+
4788
+ if (!(key in vm)) {
4789
+ defineComputed(vm, key, userDef);
4790
+ } else {
4791
+ if (key in vm.$data) {
4792
+ warn("The computed property \"" + key + "\" is already defined in data.", vm);
4793
+ } else if (vm.$options.props && key in vm.$options.props) {
4794
+ warn("The computed property \"" + key + "\" is already defined as a prop.", vm);
4795
+ }
4796
+ }
4797
+ }
4798
+ }
4799
+
4800
+ function defineComputed(target, key, userDef) {
4801
+ var shouldCache = !isServerRendering();
4802
+
4803
+ if (typeof userDef === 'function') {
4804
+ sharedPropertyDefinition.get = shouldCache ? createComputedGetter(key) : createGetterInvoker(userDef);
4805
+ sharedPropertyDefinition.set = noop;
4806
+ } else {
4807
+ sharedPropertyDefinition.get = userDef.get ? shouldCache && userDef.cache !== false ? createComputedGetter(key) : createGetterInvoker(userDef.get) : noop;
4808
+ sharedPropertyDefinition.set = userDef.set || noop;
4809
+ }
4810
+
4811
+ if (sharedPropertyDefinition.set === noop) {
4812
+ sharedPropertyDefinition.set = function () {
4813
+ warn("Computed property \"" + key + "\" was assigned to but it has no setter.", this);
4814
+ };
4815
+ }
4816
+
4817
+ Object.defineProperty(target, key, sharedPropertyDefinition);
4818
+ }
4819
+
4820
+ function createComputedGetter(key) {
4821
+ return function computedGetter() {
4822
+ var watcher = this._computedWatchers && this._computedWatchers[key];
4823
+
4824
+ if (watcher) {
4825
+ if (watcher.dirty) {
4826
+ watcher.evaluate();
4827
+ }
4828
+
4829
+ if (Dep.target) {
4830
+ watcher.depend();
4831
+ }
4832
+
4833
+ return watcher.value;
4834
+ }
4835
+ };
4836
+ }
4837
+
4838
+ function createGetterInvoker(fn) {
4839
+ return function computedGetter() {
4840
+ return fn.call(this, this);
4841
+ };
4842
+ }
4843
+
4844
+ function initMethods(vm, methods) {
4845
+ var props = vm.$options.props;
4846
+
4847
+ for (var key in methods) {
4848
+ {
4849
+ if (typeof methods[key] !== 'function') {
4850
+ warn("Method \"" + key + "\" has type \"" + _typeof(methods[key]) + "\" in the component definition. " + "Did you reference the function correctly?", vm);
4851
+ }
4852
+
4853
+ if (props && hasOwn(props, key)) {
4854
+ warn("Method \"" + key + "\" has already been defined as a prop.", vm);
4855
+ }
4856
+
4857
+ if (key in vm && isReserved(key)) {
4858
+ warn("Method \"" + key + "\" conflicts with an existing Vue instance method. " + "Avoid defining component methods that start with _ or $.");
4859
+ }
4860
+ }
4861
+ vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
4862
+ }
4863
+ }
4864
+
4865
+ function initWatch(vm, watch) {
4866
+ for (var key in watch) {
4867
+ var handler = watch[key];
4868
+
4869
+ if (Array.isArray(handler)) {
4870
+ for (var i = 0; i < handler.length; i++) {
4871
+ createWatcher(vm, key, handler[i]);
4872
+ }
4873
+ } else {
4874
+ createWatcher(vm, key, handler);
4875
+ }
4876
+ }
4877
+ }
4878
+
4879
+ function createWatcher(vm, expOrFn, handler, options) {
4880
+ if (isPlainObject(handler)) {
4881
+ options = handler;
4882
+ handler = handler.handler;
4883
+ }
4884
+
4885
+ if (typeof handler === 'string') {
4886
+ handler = vm[handler];
4887
+ }
4888
+
4889
+ return vm.$watch(expOrFn, handler, options);
4890
+ }
4891
+
4892
+ function stateMixin(Vue) {
4893
+ // flow somehow has problems with directly declared definition object
4894
+ // when using Object.defineProperty, so we have to procedurally build up
4895
+ // the object here.
4896
+ var dataDef = {};
4897
+
4898
+ dataDef.get = function () {
4899
+ return this._data;
4900
+ };
4901
+
4902
+ var propsDef = {};
4903
+
4904
+ propsDef.get = function () {
4905
+ return this._props;
4906
+ };
4907
+
4908
+ {
4909
+ dataDef.set = function () {
4910
+ warn('Avoid replacing instance root $data. ' + 'Use nested data properties instead.', this);
4911
+ };
4912
+
4913
+ propsDef.set = function () {
4914
+ warn("$props is readonly.", this);
4915
+ };
4916
+ }
4917
+ Object.defineProperty(Vue.prototype, '$data', dataDef);
4918
+ Object.defineProperty(Vue.prototype, '$props', propsDef);
4919
+ Vue.prototype.$set = set;
4920
+ Vue.prototype.$delete = del;
4921
+
4922
+ Vue.prototype.$watch = function (expOrFn, cb, options) {
4923
+ var vm = this;
4924
+
4925
+ if (isPlainObject(cb)) {
4926
+ return createWatcher(vm, expOrFn, cb, options);
4927
+ }
4928
+
4929
+ options = options || {};
4930
+ options.user = true;
4931
+ var watcher = new Watcher(vm, expOrFn, cb, options);
4932
+
4933
+ if (options.immediate) {
4934
+ try {
4935
+ cb.call(vm, watcher.value);
4936
+ } catch (error) {
4937
+ handleError(error, vm, "callback for immediate watcher \"" + watcher.expression + "\"");
4938
+ }
4939
+ }
4940
+
4941
+ return function unwatchFn() {
4942
+ watcher.teardown();
4943
+ };
4944
+ };
4945
+ }
4946
+ /* */
4947
+
4948
+
4949
+ var uid$3 = 0;
4950
+
4951
+ function initMixin(Vue) {
4952
+ Vue.prototype._init = function (options) {
4953
+ var vm = this; // a uid
4954
+
4955
+ vm._uid = uid$3++;
4956
+ var startTag, endTag;
4957
+ /* istanbul ignore if */
4958
+
4959
+ if (config.performance && mark) {
4960
+ startTag = "vue-perf-start:" + vm._uid;
4961
+ endTag = "vue-perf-end:" + vm._uid;
4962
+ mark(startTag);
4963
+ } // a flag to avoid this being observed
4964
+
4965
+
4966
+ vm._isVue = true; // merge options
4967
+
4968
+ if (options && options._isComponent) {
4969
+ // optimize internal component instantiation
4970
+ // since dynamic options merging is pretty slow, and none of the
4971
+ // internal component options needs special treatment.
4972
+ initInternalComponent(vm, options);
4973
+ } else {
4974
+ vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
4975
+ }
4976
+ /* istanbul ignore else */
4977
+
4978
+
4979
+ {
4980
+ initProxy(vm);
4981
+ } // expose real self
4982
+
4983
+ vm._self = vm;
4984
+ initLifecycle(vm);
4985
+ initEvents(vm);
4986
+ initRender(vm);
4987
+ callHook(vm, 'beforeCreate');
4988
+ initInjections(vm); // resolve injections before data/props
4989
+
4990
+ initState(vm);
4991
+ initProvide(vm); // resolve provide after data/props
4992
+
4993
+ callHook(vm, 'created');
4994
+ /* istanbul ignore if */
4995
+
4996
+ if (config.performance && mark) {
4997
+ vm._name = formatComponentName(vm, false);
4998
+ mark(endTag);
4999
+ measure("vue " + vm._name + " init", startTag, endTag);
5000
+ }
5001
+
5002
+ if (vm.$options.el) {
5003
+ vm.$mount(vm.$options.el);
5004
+ }
5005
+ };
5006
+ }
5007
+
5008
+ function initInternalComponent(vm, options) {
5009
+ var opts = vm.$options = Object.create(vm.constructor.options); // doing this because it's faster than dynamic enumeration.
5010
+
5011
+ var parentVnode = options._parentVnode;
5012
+ opts.parent = options.parent;
5013
+ opts._parentVnode = parentVnode;
5014
+ var vnodeComponentOptions = parentVnode.componentOptions;
5015
+ opts.propsData = vnodeComponentOptions.propsData;
5016
+ opts._parentListeners = vnodeComponentOptions.listeners;
5017
+ opts._renderChildren = vnodeComponentOptions.children;
5018
+ opts._componentTag = vnodeComponentOptions.tag;
5019
+
5020
+ if (options.render) {
5021
+ opts.render = options.render;
5022
+ opts.staticRenderFns = options.staticRenderFns;
5023
+ }
5024
+ }
5025
+
5026
+ function resolveConstructorOptions(Ctor) {
5027
+ var options = Ctor.options;
5028
+
5029
+ if (Ctor["super"]) {
5030
+ var superOptions = resolveConstructorOptions(Ctor["super"]);
5031
+ var cachedSuperOptions = Ctor.superOptions;
5032
+
5033
+ if (superOptions !== cachedSuperOptions) {
5034
+ // super option changed,
5035
+ // need to resolve new options.
5036
+ Ctor.superOptions = superOptions; // check if there are any late-modified/attached options (#4976)
5037
+
5038
+ var modifiedOptions = resolveModifiedOptions(Ctor); // update base extend options
5039
+
5040
+ if (modifiedOptions) {
5041
+ extend(Ctor.extendOptions, modifiedOptions);
5042
+ }
5043
+
5044
+ options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
5045
+
5046
+ if (options.name) {
5047
+ options.components[options.name] = Ctor;
5048
+ }
5049
+ }
5050
+ }
5051
+
5052
+ return options;
5053
+ }
5054
+
5055
+ function resolveModifiedOptions(Ctor) {
5056
+ var modified;
5057
+ var latest = Ctor.options;
5058
+ var sealed = Ctor.sealedOptions;
5059
+
5060
+ for (var key in latest) {
5061
+ if (latest[key] !== sealed[key]) {
5062
+ if (!modified) {
5063
+ modified = {};
5064
+ }
5065
+
5066
+ modified[key] = latest[key];
5067
+ }
5068
+ }
5069
+
5070
+ return modified;
5071
+ }
5072
+
5073
+ function Vue(options) {
5074
+ if (!(this instanceof Vue)) {
5075
+ warn('Vue is a constructor and should be called with the `new` keyword');
5076
+ }
5077
+
5078
+ this._init(options);
5079
+ }
5080
+
5081
+ initMixin(Vue);
5082
+ stateMixin(Vue);
5083
+ eventsMixin(Vue);
5084
+ lifecycleMixin(Vue);
5085
+ renderMixin(Vue);
5086
+ /* */
5087
+
5088
+ function initUse(Vue) {
5089
+ Vue.use = function (plugin) {
5090
+ var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
5091
+
5092
+ if (installedPlugins.indexOf(plugin) > -1) {
5093
+ return this;
5094
+ } // additional parameters
5095
+
5096
+
5097
+ var args = toArray(arguments, 1);
5098
+ args.unshift(this);
5099
+
5100
+ if (typeof plugin.install === 'function') {
5101
+ plugin.install.apply(plugin, args);
5102
+ } else if (typeof plugin === 'function') {
5103
+ plugin.apply(null, args);
5104
+ }
5105
+
5106
+ installedPlugins.push(plugin);
5107
+ return this;
5108
+ };
5109
+ }
5110
+ /* */
5111
+
5112
+
5113
+ function initMixin$1(Vue) {
5114
+ Vue.mixin = function (mixin) {
5115
+ this.options = mergeOptions(this.options, mixin);
5116
+ return this;
5117
+ };
5118
+ }
5119
+ /* */
5120
+
5121
+
5122
+ function initExtend(Vue) {
5123
+ /**
5124
+ * Each instance constructor, including Vue, has a unique
5125
+ * cid. This enables us to create wrapped "child
5126
+ * constructors" for prototypal inheritance and cache them.
5127
+ */
5128
+ Vue.cid = 0;
5129
+ var cid = 1;
5130
+ /**
5131
+ * Class inheritance
5132
+ */
5133
+
5134
+ Vue.extend = function (extendOptions) {
5135
+ extendOptions = extendOptions || {};
5136
+ var Super = this;
5137
+ var SuperId = Super.cid;
5138
+ var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
5139
+
5140
+ if (cachedCtors[SuperId]) {
5141
+ return cachedCtors[SuperId];
5142
+ }
5143
+
5144
+ var name = extendOptions.name || Super.options.name;
5145
+
5146
+ if (name) {
5147
+ validateComponentName(name);
5148
+ }
5149
+
5150
+ var Sub = function VueComponent(options) {
5151
+ this._init(options);
5152
+ };
5153
+
5154
+ Sub.prototype = Object.create(Super.prototype);
5155
+ Sub.prototype.constructor = Sub;
5156
+ Sub.cid = cid++;
5157
+ Sub.options = mergeOptions(Super.options, extendOptions);
5158
+ Sub['super'] = Super; // For props and computed properties, we define the proxy getters on
5159
+ // the Vue instances at extension time, on the extended prototype. This
5160
+ // avoids Object.defineProperty calls for each instance created.
5161
+
5162
+ if (Sub.options.props) {
5163
+ initProps$1(Sub);
5164
+ }
5165
+
5166
+ if (Sub.options.computed) {
5167
+ initComputed$1(Sub);
5168
+ } // allow further extension/mixin/plugin usage
5169
+
5170
+
5171
+ Sub.extend = Super.extend;
5172
+ Sub.mixin = Super.mixin;
5173
+ Sub.use = Super.use; // create asset registers, so extended classes
5174
+ // can have their private assets too.
5175
+
5176
+ ASSET_TYPES.forEach(function (type) {
5177
+ Sub[type] = Super[type];
5178
+ }); // enable recursive self-lookup
5179
+
5180
+ if (name) {
5181
+ Sub.options.components[name] = Sub;
5182
+ } // keep a reference to the super options at extension time.
5183
+ // later at instantiation we can check if Super's options have
5184
+ // been updated.
5185
+
5186
+
5187
+ Sub.superOptions = Super.options;
5188
+ Sub.extendOptions = extendOptions;
5189
+ Sub.sealedOptions = extend({}, Sub.options); // cache constructor
5190
+
5191
+ cachedCtors[SuperId] = Sub;
5192
+ return Sub;
5193
+ };
5194
+ }
5195
+
5196
+ function initProps$1(Comp) {
5197
+ var props = Comp.options.props;
5198
+
5199
+ for (var key in props) {
5200
+ proxy(Comp.prototype, "_props", key);
5201
+ }
5202
+ }
5203
+
5204
+ function initComputed$1(Comp) {
5205
+ var computed = Comp.options.computed;
5206
+
5207
+ for (var key in computed) {
5208
+ defineComputed(Comp.prototype, key, computed[key]);
5209
+ }
5210
+ }
5211
+ /* */
5212
+
5213
+
5214
+ function initAssetRegisters(Vue) {
5215
+ /**
5216
+ * Create asset registration methods.
5217
+ */
5218
+ ASSET_TYPES.forEach(function (type) {
5219
+ Vue[type] = function (id, definition) {
5220
+ if (!definition) {
5221
+ return this.options[type + 's'][id];
5222
+ } else {
5223
+ /* istanbul ignore if */
5224
+ if (type === 'component') {
5225
+ validateComponentName(id);
5226
+ }
5227
+
5228
+ if (type === 'component' && isPlainObject(definition)) {
5229
+ definition.name = definition.name || id;
5230
+ definition = this.options._base.extend(definition);
5231
+ }
5232
+
5233
+ if (type === 'directive' && typeof definition === 'function') {
5234
+ definition = {
5235
+ bind: definition,
5236
+ update: definition
5237
+ };
5238
+ }
5239
+
5240
+ this.options[type + 's'][id] = definition;
5241
+ return definition;
5242
+ }
5243
+ };
5244
+ });
5245
+ }
5246
+ /* */
5247
+
5248
+
5249
+ function getComponentName(opts) {
5250
+ return opts && (opts.Ctor.options.name || opts.tag);
5251
+ }
5252
+
5253
+ function matches(pattern, name) {
5254
+ if (Array.isArray(pattern)) {
5255
+ return pattern.indexOf(name) > -1;
5256
+ } else if (typeof pattern === 'string') {
5257
+ return pattern.split(',').indexOf(name) > -1;
5258
+ } else if (isRegExp(pattern)) {
5259
+ return pattern.test(name);
5260
+ }
5261
+ /* istanbul ignore next */
5262
+
5263
+
5264
+ return false;
5265
+ }
5266
+
5267
+ function pruneCache(keepAliveInstance, filter) {
5268
+ var cache = keepAliveInstance.cache;
5269
+ var keys = keepAliveInstance.keys;
5270
+ var _vnode = keepAliveInstance._vnode;
5271
+
5272
+ for (var key in cache) {
5273
+ var cachedNode = cache[key];
5274
+
5275
+ if (cachedNode) {
5276
+ var name = getComponentName(cachedNode.componentOptions);
5277
+
5278
+ if (name && !filter(name)) {
5279
+ pruneCacheEntry(cache, key, keys, _vnode);
5280
+ }
5281
+ }
5282
+ }
5283
+ }
5284
+
5285
+ function pruneCacheEntry(cache, key, keys, current) {
5286
+ var cached$$1 = cache[key];
5287
+
5288
+ if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
5289
+ cached$$1.componentInstance.$destroy();
5290
+ }
5291
+
5292
+ cache[key] = null;
5293
+ remove(keys, key);
5294
+ }
5295
+
5296
+ var patternTypes = [String, RegExp, Array];
5297
+ var KeepAlive = {
5298
+ name: 'keep-alive',
5299
+ "abstract": true,
5300
+ props: {
5301
+ include: patternTypes,
5302
+ exclude: patternTypes,
5303
+ max: [String, Number]
5304
+ },
5305
+ created: function created() {
5306
+ this.cache = Object.create(null);
5307
+ this.keys = [];
5308
+ },
5309
+ destroyed: function destroyed() {
5310
+ for (var key in this.cache) {
5311
+ pruneCacheEntry(this.cache, key, this.keys);
5312
+ }
5313
+ },
5314
+ mounted: function mounted() {
5315
+ var this$1 = this;
5316
+ this.$watch('include', function (val) {
5317
+ pruneCache(this$1, function (name) {
5318
+ return matches(val, name);
5319
+ });
5320
+ });
5321
+ this.$watch('exclude', function (val) {
5322
+ pruneCache(this$1, function (name) {
5323
+ return !matches(val, name);
5324
+ });
5325
+ });
5326
+ },
5327
+ render: function render() {
5328
+ var slot = this.$slots["default"];
5329
+ var vnode = getFirstComponentChild(slot);
5330
+ var componentOptions = vnode && vnode.componentOptions;
5331
+
5332
+ if (componentOptions) {
5333
+ // check pattern
5334
+ var name = getComponentName(componentOptions);
5335
+ var ref = this;
5336
+ var include = ref.include;
5337
+ var exclude = ref.exclude;
5338
+
5339
+ if ( // not included
5340
+ include && (!name || !matches(include, name)) || // excluded
5341
+ exclude && name && matches(exclude, name)) {
5342
+ return vnode;
5343
+ }
5344
+
5345
+ var ref$1 = this;
5346
+ var cache = ref$1.cache;
5347
+ var keys = ref$1.keys;
5348
+ var key = vnode.key == null // same constructor may get registered as different local components
5349
+ // so cid alone is not enough (#3269)
5350
+ ? componentOptions.Ctor.cid + (componentOptions.tag ? "::" + componentOptions.tag : '') : vnode.key;
5351
+
5352
+ if (cache[key]) {
5353
+ vnode.componentInstance = cache[key].componentInstance; // make current key freshest
5354
+
5355
+ remove(keys, key);
5356
+ keys.push(key);
5357
+ } else {
5358
+ cache[key] = vnode;
5359
+ keys.push(key); // prune oldest entry
5360
+
5361
+ if (this.max && keys.length > parseInt(this.max)) {
5362
+ pruneCacheEntry(cache, keys[0], keys, this._vnode);
5363
+ }
5364
+ }
5365
+
5366
+ vnode.data.keepAlive = true;
5367
+ }
5368
+
5369
+ return vnode || slot && slot[0];
5370
+ }
5371
+ };
5372
+ var builtInComponents = {
5373
+ KeepAlive: KeepAlive
5374
+ };
5375
+ /* */
5376
+
5377
+ function initGlobalAPI(Vue) {
5378
+ // config
5379
+ var configDef = {};
5380
+
5381
+ configDef.get = function () {
5382
+ return config;
5383
+ };
5384
+
5385
+ {
5386
+ configDef.set = function () {
5387
+ warn('Do not replace the Vue.config object, set individual fields instead.');
5388
+ };
5389
+ }
5390
+ Object.defineProperty(Vue, 'config', configDef); // exposed util methods.
5391
+ // NOTE: these are not considered part of the public API - avoid relying on
5392
+ // them unless you are aware of the risk.
5393
+
5394
+ Vue.util = {
5395
+ warn: warn,
5396
+ extend: extend,
5397
+ mergeOptions: mergeOptions,
5398
+ defineReactive: defineReactive$$1
5399
+ };
5400
+ Vue.set = set;
5401
+ Vue["delete"] = del;
5402
+ Vue.nextTick = nextTick; // 2.6 explicit observable API
5403
+
5404
+ Vue.observable = function (obj) {
5405
+ observe(obj);
5406
+ return obj;
5407
+ };
5408
+
5409
+ Vue.options = Object.create(null);
5410
+ ASSET_TYPES.forEach(function (type) {
5411
+ Vue.options[type + 's'] = Object.create(null);
5412
+ }); // this is used to identify the "base" constructor to extend all plain-object
5413
+ // components with in Weex's multi-instance scenarios.
5414
+
5415
+ Vue.options._base = Vue;
5416
+ extend(Vue.options.components, builtInComponents);
5417
+ initUse(Vue);
5418
+ initMixin$1(Vue);
5419
+ initExtend(Vue);
5420
+ initAssetRegisters(Vue);
5421
+ }
5422
+
5423
+ initGlobalAPI(Vue);
5424
+ Object.defineProperty(Vue.prototype, '$isServer', {
5425
+ get: isServerRendering
5426
+ });
5427
+ Object.defineProperty(Vue.prototype, '$ssrContext', {
5428
+ get: function get() {
5429
+ /* istanbul ignore next */
5430
+ return this.$vnode && this.$vnode.ssrContext;
5431
+ }
5432
+ }); // expose FunctionalRenderContext for ssr runtime helper installation
5433
+
5434
+ Object.defineProperty(Vue, 'FunctionalRenderContext', {
5435
+ value: FunctionalRenderContext
5436
+ });
5437
+ Vue.version = '2.6.12';
5438
+ /* */
5439
+ // these are reserved for web because they are directly compiled away
5440
+ // during template compilation
5441
+
5442
+ var isReservedAttr = makeMap('style,class'); // attributes that should be using props for binding
5443
+
5444
+ var acceptValue = makeMap('input,textarea,option,select,progress');
5445
+
5446
+ var mustUseProp = function mustUseProp(tag, type, attr) {
5447
+ return attr === 'value' && acceptValue(tag) && type !== 'button' || attr === 'selected' && tag === 'option' || attr === 'checked' && tag === 'input' || attr === 'muted' && tag === 'video';
5448
+ };
5449
+
5450
+ var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
5451
+ var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
5452
+
5453
+ var convertEnumeratedValue = function convertEnumeratedValue(key, value) {
5454
+ return isFalsyAttrValue(value) || value === 'false' ? 'false' // allow arbitrary string value for contenteditable
5455
+ : key === 'contenteditable' && isValidContentEditableValue(value) ? value : 'true';
5456
+ };
5457
+
5458
+ var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 'required,reversed,scoped,seamless,selected,sortable,translate,' + 'truespeed,typemustmatch,visible');
5459
+ var xlinkNS = 'http://www.w3.org/1999/xlink';
5460
+
5461
+ var isXlink = function isXlink(name) {
5462
+ return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
5463
+ };
5464
+
5465
+ var getXlinkProp = function getXlinkProp(name) {
5466
+ return isXlink(name) ? name.slice(6, name.length) : '';
5467
+ };
5468
+
5469
+ var isFalsyAttrValue = function isFalsyAttrValue(val) {
5470
+ return val == null || val === false;
5471
+ };
5472
+ /* */
5473
+
5474
+
5475
+ function genClassForVnode(vnode) {
5476
+ var data = vnode.data;
5477
+ var parentNode = vnode;
5478
+ var childNode = vnode;
5479
+
5480
+ while (isDef(childNode.componentInstance)) {
5481
+ childNode = childNode.componentInstance._vnode;
5482
+
5483
+ if (childNode && childNode.data) {
5484
+ data = mergeClassData(childNode.data, data);
5485
+ }
5486
+ }
5487
+
5488
+ while (isDef(parentNode = parentNode.parent)) {
5489
+ if (parentNode && parentNode.data) {
5490
+ data = mergeClassData(data, parentNode.data);
5491
+ }
5492
+ }
5493
+
5494
+ return renderClass(data.staticClass, data["class"]);
5495
+ }
5496
+
5497
+ function mergeClassData(child, parent) {
5498
+ return {
5499
+ staticClass: concat(child.staticClass, parent.staticClass),
5500
+ "class": isDef(child["class"]) ? [child["class"], parent["class"]] : parent["class"]
5501
+ };
5502
+ }
5503
+
5504
+ function renderClass(staticClass, dynamicClass) {
5505
+ if (isDef(staticClass) || isDef(dynamicClass)) {
5506
+ return concat(staticClass, stringifyClass(dynamicClass));
5507
+ }
5508
+ /* istanbul ignore next */
5509
+
5510
+
5511
+ return '';
5512
+ }
5513
+
5514
+ function concat(a, b) {
5515
+ return a ? b ? a + ' ' + b : a : b || '';
5516
+ }
5517
+
5518
+ function stringifyClass(value) {
5519
+ if (Array.isArray(value)) {
5520
+ return stringifyArray(value);
5521
+ }
5522
+
5523
+ if (isObject(value)) {
5524
+ return stringifyObject(value);
5525
+ }
5526
+
5527
+ if (typeof value === 'string') {
5528
+ return value;
5529
+ }
5530
+ /* istanbul ignore next */
5531
+
5532
+
5533
+ return '';
5534
+ }
5535
+
5536
+ function stringifyArray(value) {
5537
+ var res = '';
5538
+ var stringified;
5539
+
5540
+ for (var i = 0, l = value.length; i < l; i++) {
5541
+ if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
5542
+ if (res) {
5543
+ res += ' ';
5544
+ }
5545
+
5546
+ res += stringified;
5547
+ }
5548
+ }
5549
+
5550
+ return res;
5551
+ }
5552
+
5553
+ function stringifyObject(value) {
5554
+ var res = '';
5555
+
5556
+ for (var key in value) {
5557
+ if (value[key]) {
5558
+ if (res) {
5559
+ res += ' ';
5560
+ }
5561
+
5562
+ res += key;
5563
+ }
5564
+ }
5565
+
5566
+ return res;
5567
+ }
5568
+ /* */
5569
+
5570
+
5571
+ var namespaceMap = {
5572
+ svg: 'http://www.w3.org/2000/svg',
5573
+ math: 'http://www.w3.org/1998/Math/MathML'
5574
+ };
5575
+ var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' + 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 'embed,object,param,source,canvas,script,noscript,del,ins,' + 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 'output,progress,select,textarea,' + 'details,dialog,menu,menuitem,summary,' + 'content,element,shadow,template,blockquote,iframe,tfoot'); // this map is intentionally selective, only covering SVG elements that may
5576
+ // contain child elements.
5577
+
5578
+ var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
5579
+
5580
+ var isPreTag = function isPreTag(tag) {
5581
+ return tag === 'pre';
5582
+ };
5583
+
5584
+ var isReservedTag = function isReservedTag(tag) {
5585
+ return isHTMLTag(tag) || isSVG(tag);
5586
+ };
5587
+
5588
+ function getTagNamespace(tag) {
5589
+ if (isSVG(tag)) {
5590
+ return 'svg';
5591
+ } // basic support for MathML
5592
+ // note it doesn't support other MathML elements being component roots
5593
+
5594
+
5595
+ if (tag === 'math') {
5596
+ return 'math';
5597
+ }
5598
+ }
5599
+
5600
+ var unknownElementCache = Object.create(null);
5601
+
5602
+ function isUnknownElement(tag) {
5603
+ /* istanbul ignore if */
5604
+ if (!inBrowser) {
5605
+ return true;
5606
+ }
5607
+
5608
+ if (isReservedTag(tag)) {
5609
+ return false;
5610
+ }
5611
+
5612
+ tag = tag.toLowerCase();
5613
+ /* istanbul ignore if */
5614
+
5615
+ if (unknownElementCache[tag] != null) {
5616
+ return unknownElementCache[tag];
5617
+ }
5618
+
5619
+ var el = document.createElement(tag);
5620
+
5621
+ if (tag.indexOf('-') > -1) {
5622
+ // http://stackoverflow.com/a/28210364/1070244
5623
+ return unknownElementCache[tag] = el.constructor === window.HTMLUnknownElement || el.constructor === window.HTMLElement;
5624
+ } else {
5625
+ return unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString());
5626
+ }
5627
+ }
5628
+
5629
+ var isTextInputType = makeMap('text,number,password,search,email,tel,url');
5630
+ /* */
5631
+
5632
+ /**
5633
+ * Query an element selector if it's not an element already.
5634
+ */
5635
+
5636
+ function query(el) {
5637
+ if (typeof el === 'string') {
5638
+ var selected = document.querySelector(el);
5639
+
5640
+ if (!selected) {
5641
+ warn('Cannot find element: ' + el);
5642
+ return document.createElement('div');
5643
+ }
5644
+
5645
+ return selected;
5646
+ } else {
5647
+ return el;
5648
+ }
5649
+ }
5650
+ /* */
5651
+
5652
+
5653
+ function createElement$1(tagName, vnode) {
5654
+ var elm = document.createElement(tagName);
5655
+
5656
+ if (tagName !== 'select') {
5657
+ return elm;
5658
+ } // false or null will remove the attribute but undefined will not
5659
+
5660
+
5661
+ if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
5662
+ elm.setAttribute('multiple', 'multiple');
5663
+ }
5664
+
5665
+ return elm;
5666
+ }
5667
+
5668
+ function createElementNS(namespace, tagName) {
5669
+ return document.createElementNS(namespaceMap[namespace], tagName);
5670
+ }
5671
+
5672
+ function createTextNode(text) {
5673
+ return document.createTextNode(text);
5674
+ }
5675
+
5676
+ function createComment(text) {
5677
+ return document.createComment(text);
5678
+ }
5679
+
5680
+ function insertBefore(parentNode, newNode, referenceNode) {
5681
+ parentNode.insertBefore(newNode, referenceNode);
5682
+ }
5683
+
5684
+ function removeChild(node, child) {
5685
+ node.removeChild(child);
5686
+ }
5687
+
5688
+ function appendChild(node, child) {
5689
+ node.appendChild(child);
5690
+ }
5691
+
5692
+ function parentNode(node) {
5693
+ return node.parentNode;
5694
+ }
5695
+
5696
+ function nextSibling(node) {
5697
+ return node.nextSibling;
5698
+ }
5699
+
5700
+ function tagName(node) {
5701
+ return node.tagName;
5702
+ }
5703
+
5704
+ function setTextContent(node, text) {
5705
+ node.textContent = text;
5706
+ }
5707
+
5708
+ function setStyleScope(node, scopeId) {
5709
+ node.setAttribute(scopeId, '');
5710
+ }
5711
+
5712
+ var nodeOps =
5713
+ /*#__PURE__*/
5714
+ Object.freeze({
5715
+ createElement: createElement$1,
5716
+ createElementNS: createElementNS,
5717
+ createTextNode: createTextNode,
5718
+ createComment: createComment,
5719
+ insertBefore: insertBefore,
5720
+ removeChild: removeChild,
5721
+ appendChild: appendChild,
5722
+ parentNode: parentNode,
5723
+ nextSibling: nextSibling,
5724
+ tagName: tagName,
5725
+ setTextContent: setTextContent,
5726
+ setStyleScope: setStyleScope
5727
+ });
5728
+ /* */
5729
+
5730
+ var ref = {
5731
+ create: function create(_, vnode) {
5732
+ registerRef(vnode);
5733
+ },
5734
+ update: function update(oldVnode, vnode) {
5735
+ if (oldVnode.data.ref !== vnode.data.ref) {
5736
+ registerRef(oldVnode, true);
5737
+ registerRef(vnode);
5738
+ }
5739
+ },
5740
+ destroy: function destroy(vnode) {
5741
+ registerRef(vnode, true);
5742
+ }
5743
+ };
5744
+
5745
+ function registerRef(vnode, isRemoval) {
5746
+ var key = vnode.data.ref;
5747
+
5748
+ if (!isDef(key)) {
5749
+ return;
5750
+ }
5751
+
5752
+ var vm = vnode.context;
5753
+ var ref = vnode.componentInstance || vnode.elm;
5754
+ var refs = vm.$refs;
5755
+
5756
+ if (isRemoval) {
5757
+ if (Array.isArray(refs[key])) {
5758
+ remove(refs[key], ref);
5759
+ } else if (refs[key] === ref) {
5760
+ refs[key] = undefined;
5761
+ }
5762
+ } else {
5763
+ if (vnode.data.refInFor) {
5764
+ if (!Array.isArray(refs[key])) {
5765
+ refs[key] = [ref];
5766
+ } else if (refs[key].indexOf(ref) < 0) {
5767
+ // $flow-disable-line
5768
+ refs[key].push(ref);
5769
+ }
5770
+ } else {
5771
+ refs[key] = ref;
5772
+ }
5773
+ }
5774
+ }
5775
+ /**
5776
+ * Virtual DOM patching algorithm based on Snabbdom by
5777
+ * Simon Friis Vindum (@paldepind)
5778
+ * Licensed under the MIT License
5779
+ * https://github.com/paldepind/snabbdom/blob/master/LICENSE
5780
+ *
5781
+ * modified by Evan You (@yyx990803)
5782
+ *
5783
+ * Not type-checking this because this file is perf-critical and the cost
5784
+ * of making flow understand it is not worth it.
5785
+ */
5786
+
5787
+
5788
+ var emptyNode = new VNode('', {}, []);
5789
+ var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
5790
+
5791
+ function sameVnode(a, b) {
5792
+ return a.key === b.key && (a.tag === b.tag && a.isComment === b.isComment && isDef(a.data) === isDef(b.data) && sameInputType(a, b) || isTrue(a.isAsyncPlaceholder) && a.asyncFactory === b.asyncFactory && isUndef(b.asyncFactory.error));
5793
+ }
5794
+
5795
+ function sameInputType(a, b) {
5796
+ if (a.tag !== 'input') {
5797
+ return true;
5798
+ }
5799
+
5800
+ var i;
5801
+ var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
5802
+ var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
5803
+ return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB);
5804
+ }
5805
+
5806
+ function createKeyToOldIdx(children, beginIdx, endIdx) {
5807
+ var i, key;
5808
+ var map = {};
5809
+
5810
+ for (i = beginIdx; i <= endIdx; ++i) {
5811
+ key = children[i].key;
5812
+
5813
+ if (isDef(key)) {
5814
+ map[key] = i;
5815
+ }
5816
+ }
5817
+
5818
+ return map;
5819
+ }
5820
+
5821
+ function createPatchFunction(backend) {
5822
+ var i, j;
5823
+ var cbs = {};
5824
+ var modules = backend.modules;
5825
+ var nodeOps = backend.nodeOps;
5826
+
5827
+ for (i = 0; i < hooks.length; ++i) {
5828
+ cbs[hooks[i]] = [];
5829
+
5830
+ for (j = 0; j < modules.length; ++j) {
5831
+ if (isDef(modules[j][hooks[i]])) {
5832
+ cbs[hooks[i]].push(modules[j][hooks[i]]);
5833
+ }
5834
+ }
5835
+ }
5836
+
5837
+ function emptyNodeAt(elm) {
5838
+ return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
5839
+ }
5840
+
5841
+ function createRmCb(childElm, listeners) {
5842
+ function remove$$1() {
5843
+ if (--remove$$1.listeners === 0) {
5844
+ removeNode(childElm);
5845
+ }
5846
+ }
5847
+
5848
+ remove$$1.listeners = listeners;
5849
+ return remove$$1;
5850
+ }
5851
+
5852
+ function removeNode(el) {
5853
+ var parent = nodeOps.parentNode(el); // element may have already been removed due to v-html / v-text
5854
+
5855
+ if (isDef(parent)) {
5856
+ nodeOps.removeChild(parent, el);
5857
+ }
5858
+ }
5859
+
5860
+ function isUnknownElement$$1(vnode, inVPre) {
5861
+ return !inVPre && !vnode.ns && !(config.ignoredElements.length && config.ignoredElements.some(function (ignore) {
5862
+ return isRegExp(ignore) ? ignore.test(vnode.tag) : ignore === vnode.tag;
5863
+ })) && config.isUnknownElement(vnode.tag);
5864
+ }
5865
+
5866
+ var creatingElmInVPre = 0;
5867
+
5868
+ function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
5869
+ if (isDef(vnode.elm) && isDef(ownerArray)) {
5870
+ // This vnode was used in a previous render!
5871
+ // now it's used as a new node, overwriting its elm would cause
5872
+ // potential patch errors down the road when it's used as an insertion
5873
+ // reference node. Instead, we clone the node on-demand before creating
5874
+ // associated DOM element for it.
5875
+ vnode = ownerArray[index] = cloneVNode(vnode);
5876
+ }
5877
+
5878
+ vnode.isRootInsert = !nested; // for transition enter check
5879
+
5880
+ if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
5881
+ return;
5882
+ }
5883
+
5884
+ var data = vnode.data;
5885
+ var children = vnode.children;
5886
+ var tag = vnode.tag;
5887
+
5888
+ if (isDef(tag)) {
5889
+ {
5890
+ if (data && data.pre) {
5891
+ creatingElmInVPre++;
5892
+ }
5893
+
5894
+ if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
5895
+ warn('Unknown custom element: <' + tag + '> - did you ' + 'register the component correctly? For recursive components, ' + 'make sure to provide the "name" option.', vnode.context);
5896
+ }
5897
+ }
5898
+ vnode.elm = vnode.ns ? nodeOps.createElementNS(vnode.ns, tag) : nodeOps.createElement(tag, vnode);
5899
+ setScope(vnode);
5900
+ /* istanbul ignore if */
5901
+
5902
+ {
5903
+ createChildren(vnode, children, insertedVnodeQueue);
5904
+
5905
+ if (isDef(data)) {
5906
+ invokeCreateHooks(vnode, insertedVnodeQueue);
5907
+ }
5908
+
5909
+ insert(parentElm, vnode.elm, refElm);
5910
+ }
5911
+
5912
+ if (data && data.pre) {
5913
+ creatingElmInVPre--;
5914
+ }
5915
+ } else if (isTrue(vnode.isComment)) {
5916
+ vnode.elm = nodeOps.createComment(vnode.text);
5917
+ insert(parentElm, vnode.elm, refElm);
5918
+ } else {
5919
+ vnode.elm = nodeOps.createTextNode(vnode.text);
5920
+ insert(parentElm, vnode.elm, refElm);
5921
+ }
5922
+ }
5923
+
5924
+ function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
5925
+ var i = vnode.data;
5926
+
5927
+ if (isDef(i)) {
5928
+ var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
5929
+
5930
+ if (isDef(i = i.hook) && isDef(i = i.init)) {
5931
+ i(vnode, false
5932
+ /* hydrating */
5933
+ );
5934
+ } // after calling the init hook, if the vnode is a child component
5935
+ // it should've created a child instance and mounted it. the child
5936
+ // component also has set the placeholder vnode's elm.
5937
+ // in that case we can just return the element and be done.
5938
+
5939
+
5940
+ if (isDef(vnode.componentInstance)) {
5941
+ initComponent(vnode, insertedVnodeQueue);
5942
+ insert(parentElm, vnode.elm, refElm);
5943
+
5944
+ if (isTrue(isReactivated)) {
5945
+ reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
5946
+ }
5947
+
5948
+ return true;
5949
+ }
5950
+ }
5951
+ }
5952
+
5953
+ function initComponent(vnode, insertedVnodeQueue) {
5954
+ if (isDef(vnode.data.pendingInsert)) {
5955
+ insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
5956
+ vnode.data.pendingInsert = null;
5957
+ }
5958
+
5959
+ vnode.elm = vnode.componentInstance.$el;
5960
+
5961
+ if (isPatchable(vnode)) {
5962
+ invokeCreateHooks(vnode, insertedVnodeQueue);
5963
+ setScope(vnode);
5964
+ } else {
5965
+ // empty component root.
5966
+ // skip all element-related modules except for ref (#3455)
5967
+ registerRef(vnode); // make sure to invoke the insert hook
5968
+
5969
+ insertedVnodeQueue.push(vnode);
5970
+ }
5971
+ }
5972
+
5973
+ function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
5974
+ var i; // hack for #4339: a reactivated component with inner transition
5975
+ // does not trigger because the inner node's created hooks are not called
5976
+ // again. It's not ideal to involve module-specific logic in here but
5977
+ // there doesn't seem to be a better way to do it.
5978
+
5979
+ var innerNode = vnode;
5980
+
5981
+ while (innerNode.componentInstance) {
5982
+ innerNode = innerNode.componentInstance._vnode;
5983
+
5984
+ if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
5985
+ for (i = 0; i < cbs.activate.length; ++i) {
5986
+ cbs.activate[i](emptyNode, innerNode);
5987
+ }
5988
+
5989
+ insertedVnodeQueue.push(innerNode);
5990
+ break;
5991
+ }
5992
+ } // unlike a newly created component,
5993
+ // a reactivated keep-alive component doesn't insert itself
5994
+
5995
+
5996
+ insert(parentElm, vnode.elm, refElm);
5997
+ }
5998
+
5999
+ function insert(parent, elm, ref$$1) {
6000
+ if (isDef(parent)) {
6001
+ if (isDef(ref$$1)) {
6002
+ if (nodeOps.parentNode(ref$$1) === parent) {
6003
+ nodeOps.insertBefore(parent, elm, ref$$1);
6004
+ }
6005
+ } else {
6006
+ nodeOps.appendChild(parent, elm);
6007
+ }
6008
+ }
6009
+ }
6010
+
6011
+ function createChildren(vnode, children, insertedVnodeQueue) {
6012
+ if (Array.isArray(children)) {
6013
+ {
6014
+ checkDuplicateKeys(children);
6015
+ }
6016
+
6017
+ for (var i = 0; i < children.length; ++i) {
6018
+ createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
6019
+ }
6020
+ } else if (isPrimitive(vnode.text)) {
6021
+ nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
6022
+ }
6023
+ }
6024
+
6025
+ function isPatchable(vnode) {
6026
+ while (vnode.componentInstance) {
6027
+ vnode = vnode.componentInstance._vnode;
6028
+ }
6029
+
6030
+ return isDef(vnode.tag);
6031
+ }
6032
+
6033
+ function invokeCreateHooks(vnode, insertedVnodeQueue) {
6034
+ for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6035
+ cbs.create[i$1](emptyNode, vnode);
6036
+ }
6037
+
6038
+ i = vnode.data.hook; // Reuse variable
6039
+
6040
+ if (isDef(i)) {
6041
+ if (isDef(i.create)) {
6042
+ i.create(emptyNode, vnode);
6043
+ }
6044
+
6045
+ if (isDef(i.insert)) {
6046
+ insertedVnodeQueue.push(vnode);
6047
+ }
6048
+ }
6049
+ } // set scope id attribute for scoped CSS.
6050
+ // this is implemented as a special case to avoid the overhead
6051
+ // of going through the normal attribute patching process.
6052
+
6053
+
6054
+ function setScope(vnode) {
6055
+ var i;
6056
+
6057
+ if (isDef(i = vnode.fnScopeId)) {
6058
+ nodeOps.setStyleScope(vnode.elm, i);
6059
+ } else {
6060
+ var ancestor = vnode;
6061
+
6062
+ while (ancestor) {
6063
+ if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
6064
+ nodeOps.setStyleScope(vnode.elm, i);
6065
+ }
6066
+
6067
+ ancestor = ancestor.parent;
6068
+ }
6069
+ } // for slot content they should also get the scopeId from the host instance.
6070
+
6071
+
6072
+ if (isDef(i = activeInstance) && i !== vnode.context && i !== vnode.fnContext && isDef(i = i.$options._scopeId)) {
6073
+ nodeOps.setStyleScope(vnode.elm, i);
6074
+ }
6075
+ }
6076
+
6077
+ function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
6078
+ for (; startIdx <= endIdx; ++startIdx) {
6079
+ createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
6080
+ }
6081
+ }
6082
+
6083
+ function invokeDestroyHook(vnode) {
6084
+ var i, j;
6085
+ var data = vnode.data;
6086
+
6087
+ if (isDef(data)) {
6088
+ if (isDef(i = data.hook) && isDef(i = i.destroy)) {
6089
+ i(vnode);
6090
+ }
6091
+
6092
+ for (i = 0; i < cbs.destroy.length; ++i) {
6093
+ cbs.destroy[i](vnode);
6094
+ }
6095
+ }
6096
+
6097
+ if (isDef(i = vnode.children)) {
6098
+ for (j = 0; j < vnode.children.length; ++j) {
6099
+ invokeDestroyHook(vnode.children[j]);
6100
+ }
6101
+ }
6102
+ }
6103
+
6104
+ function removeVnodes(vnodes, startIdx, endIdx) {
6105
+ for (; startIdx <= endIdx; ++startIdx) {
6106
+ var ch = vnodes[startIdx];
6107
+
6108
+ if (isDef(ch)) {
6109
+ if (isDef(ch.tag)) {
6110
+ removeAndInvokeRemoveHook(ch);
6111
+ invokeDestroyHook(ch);
6112
+ } else {
6113
+ // Text node
6114
+ removeNode(ch.elm);
6115
+ }
6116
+ }
6117
+ }
6118
+ }
6119
+
6120
+ function removeAndInvokeRemoveHook(vnode, rm) {
6121
+ if (isDef(rm) || isDef(vnode.data)) {
6122
+ var i;
6123
+ var listeners = cbs.remove.length + 1;
6124
+
6125
+ if (isDef(rm)) {
6126
+ // we have a recursively passed down rm callback
6127
+ // increase the listeners count
6128
+ rm.listeners += listeners;
6129
+ } else {
6130
+ // directly removing
6131
+ rm = createRmCb(vnode.elm, listeners);
6132
+ } // recursively invoke hooks on child component root node
6133
+
6134
+
6135
+ if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
6136
+ removeAndInvokeRemoveHook(i, rm);
6137
+ }
6138
+
6139
+ for (i = 0; i < cbs.remove.length; ++i) {
6140
+ cbs.remove[i](vnode, rm);
6141
+ }
6142
+
6143
+ if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
6144
+ i(vnode, rm);
6145
+ } else {
6146
+ rm();
6147
+ }
6148
+ } else {
6149
+ removeNode(vnode.elm);
6150
+ }
6151
+ }
6152
+
6153
+ function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
6154
+ var oldStartIdx = 0;
6155
+ var newStartIdx = 0;
6156
+ var oldEndIdx = oldCh.length - 1;
6157
+ var oldStartVnode = oldCh[0];
6158
+ var oldEndVnode = oldCh[oldEndIdx];
6159
+ var newEndIdx = newCh.length - 1;
6160
+ var newStartVnode = newCh[0];
6161
+ var newEndVnode = newCh[newEndIdx];
6162
+ var oldKeyToIdx, idxInOld, vnodeToMove, refElm; // removeOnly is a special flag used only by <transition-group>
6163
+ // to ensure removed elements stay in correct relative positions
6164
+ // during leaving transitions
6165
+
6166
+ var canMove = !removeOnly;
6167
+ {
6168
+ checkDuplicateKeys(newCh);
6169
+ }
6170
+
6171
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
6172
+ if (isUndef(oldStartVnode)) {
6173
+ oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
6174
+ } else if (isUndef(oldEndVnode)) {
6175
+ oldEndVnode = oldCh[--oldEndIdx];
6176
+ } else if (sameVnode(oldStartVnode, newStartVnode)) {
6177
+ patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6178
+ oldStartVnode = oldCh[++oldStartIdx];
6179
+ newStartVnode = newCh[++newStartIdx];
6180
+ } else if (sameVnode(oldEndVnode, newEndVnode)) {
6181
+ patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6182
+ oldEndVnode = oldCh[--oldEndIdx];
6183
+ newEndVnode = newCh[--newEndIdx];
6184
+ } else if (sameVnode(oldStartVnode, newEndVnode)) {
6185
+ // Vnode moved right
6186
+ patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6187
+ canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
6188
+ oldStartVnode = oldCh[++oldStartIdx];
6189
+ newEndVnode = newCh[--newEndIdx];
6190
+ } else if (sameVnode(oldEndVnode, newStartVnode)) {
6191
+ // Vnode moved left
6192
+ patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6193
+ canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
6194
+ oldEndVnode = oldCh[--oldEndIdx];
6195
+ newStartVnode = newCh[++newStartIdx];
6196
+ } else {
6197
+ if (isUndef(oldKeyToIdx)) {
6198
+ oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
6199
+ }
6200
+
6201
+ idxInOld = isDef(newStartVnode.key) ? oldKeyToIdx[newStartVnode.key] : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
6202
+
6203
+ if (isUndef(idxInOld)) {
6204
+ // New element
6205
+ createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6206
+ } else {
6207
+ vnodeToMove = oldCh[idxInOld];
6208
+
6209
+ if (sameVnode(vnodeToMove, newStartVnode)) {
6210
+ patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6211
+ oldCh[idxInOld] = undefined;
6212
+ canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
6213
+ } else {
6214
+ // same key but different element. treat as new element
6215
+ createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6216
+ }
6217
+ }
6218
+
6219
+ newStartVnode = newCh[++newStartIdx];
6220
+ }
6221
+ }
6222
+
6223
+ if (oldStartIdx > oldEndIdx) {
6224
+ refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
6225
+ addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
6226
+ } else if (newStartIdx > newEndIdx) {
6227
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
6228
+ }
6229
+ }
6230
+
6231
+ function checkDuplicateKeys(children) {
6232
+ var seenKeys = {};
6233
+
6234
+ for (var i = 0; i < children.length; i++) {
6235
+ var vnode = children[i];
6236
+ var key = vnode.key;
6237
+
6238
+ if (isDef(key)) {
6239
+ if (seenKeys[key]) {
6240
+ warn("Duplicate keys detected: '" + key + "'. This may cause an update error.", vnode.context);
6241
+ } else {
6242
+ seenKeys[key] = true;
6243
+ }
6244
+ }
6245
+ }
6246
+ }
6247
+
6248
+ function findIdxInOld(node, oldCh, start, end) {
6249
+ for (var i = start; i < end; i++) {
6250
+ var c = oldCh[i];
6251
+
6252
+ if (isDef(c) && sameVnode(node, c)) {
6253
+ return i;
6254
+ }
6255
+ }
6256
+ }
6257
+
6258
+ function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
6259
+ if (oldVnode === vnode) {
6260
+ return;
6261
+ }
6262
+
6263
+ if (isDef(vnode.elm) && isDef(ownerArray)) {
6264
+ // clone reused vnode
6265
+ vnode = ownerArray[index] = cloneVNode(vnode);
6266
+ }
6267
+
6268
+ var elm = vnode.elm = oldVnode.elm;
6269
+
6270
+ if (isTrue(oldVnode.isAsyncPlaceholder)) {
6271
+ if (isDef(vnode.asyncFactory.resolved)) {
6272
+ hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
6273
+ } else {
6274
+ vnode.isAsyncPlaceholder = true;
6275
+ }
6276
+
6277
+ return;
6278
+ } // reuse element for static trees.
6279
+ // note we only do this if the vnode is cloned -
6280
+ // if the new node is not cloned it means the render functions have been
6281
+ // reset by the hot-reload-api and we need to do a proper re-render.
6282
+
6283
+
6284
+ if (isTrue(vnode.isStatic) && isTrue(oldVnode.isStatic) && vnode.key === oldVnode.key && (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
6285
+ vnode.componentInstance = oldVnode.componentInstance;
6286
+ return;
6287
+ }
6288
+
6289
+ var i;
6290
+ var data = vnode.data;
6291
+
6292
+ if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
6293
+ i(oldVnode, vnode);
6294
+ }
6295
+
6296
+ var oldCh = oldVnode.children;
6297
+ var ch = vnode.children;
6298
+
6299
+ if (isDef(data) && isPatchable(vnode)) {
6300
+ for (i = 0; i < cbs.update.length; ++i) {
6301
+ cbs.update[i](oldVnode, vnode);
6302
+ }
6303
+
6304
+ if (isDef(i = data.hook) && isDef(i = i.update)) {
6305
+ i(oldVnode, vnode);
6306
+ }
6307
+ }
6308
+
6309
+ if (isUndef(vnode.text)) {
6310
+ if (isDef(oldCh) && isDef(ch)) {
6311
+ if (oldCh !== ch) {
6312
+ updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
6313
+ }
6314
+ } else if (isDef(ch)) {
6315
+ {
6316
+ checkDuplicateKeys(ch);
6317
+ }
6318
+
6319
+ if (isDef(oldVnode.text)) {
6320
+ nodeOps.setTextContent(elm, '');
6321
+ }
6322
+
6323
+ addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
6324
+ } else if (isDef(oldCh)) {
6325
+ removeVnodes(oldCh, 0, oldCh.length - 1);
6326
+ } else if (isDef(oldVnode.text)) {
6327
+ nodeOps.setTextContent(elm, '');
6328
+ }
6329
+ } else if (oldVnode.text !== vnode.text) {
6330
+ nodeOps.setTextContent(elm, vnode.text);
6331
+ }
6332
+
6333
+ if (isDef(data)) {
6334
+ if (isDef(i = data.hook) && isDef(i = i.postpatch)) {
6335
+ i(oldVnode, vnode);
6336
+ }
6337
+ }
6338
+ }
6339
+
6340
+ function invokeInsertHook(vnode, queue, initial) {
6341
+ // delay insert hooks for component root nodes, invoke them after the
6342
+ // element is really inserted
6343
+ if (isTrue(initial) && isDef(vnode.parent)) {
6344
+ vnode.parent.data.pendingInsert = queue;
6345
+ } else {
6346
+ for (var i = 0; i < queue.length; ++i) {
6347
+ queue[i].data.hook.insert(queue[i]);
6348
+ }
6349
+ }
6350
+ }
6351
+
6352
+ var hydrationBailed = false; // list of modules that can skip create hook during hydration because they
6353
+ // are already rendered on the client or has no need for initialization
6354
+ // Note: style is excluded because it relies on initial clone for future
6355
+ // deep updates (#7063).
6356
+
6357
+ var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); // Note: this is a browser-only function so we can assume elms are DOM nodes.
6358
+
6359
+ function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
6360
+ var i;
6361
+ var tag = vnode.tag;
6362
+ var data = vnode.data;
6363
+ var children = vnode.children;
6364
+ inVPre = inVPre || data && data.pre;
6365
+ vnode.elm = elm;
6366
+
6367
+ if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
6368
+ vnode.isAsyncPlaceholder = true;
6369
+ return true;
6370
+ } // assert node match
6371
+
6372
+
6373
+ {
6374
+ if (!assertNodeMatch(elm, vnode, inVPre)) {
6375
+ return false;
6376
+ }
6377
+ }
6378
+
6379
+ if (isDef(data)) {
6380
+ if (isDef(i = data.hook) && isDef(i = i.init)) {
6381
+ i(vnode, true
6382
+ /* hydrating */
6383
+ );
6384
+ }
6385
+
6386
+ if (isDef(i = vnode.componentInstance)) {
6387
+ // child component. it should have hydrated its own tree.
6388
+ initComponent(vnode, insertedVnodeQueue);
6389
+ return true;
6390
+ }
6391
+ }
6392
+
6393
+ if (isDef(tag)) {
6394
+ if (isDef(children)) {
6395
+ // empty element, allow client to pick up and populate children
6396
+ if (!elm.hasChildNodes()) {
6397
+ createChildren(vnode, children, insertedVnodeQueue);
6398
+ } else {
6399
+ // v-html and domProps: innerHTML
6400
+ if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
6401
+ if (i !== elm.innerHTML) {
6402
+ /* istanbul ignore if */
6403
+ if (typeof console !== 'undefined' && !hydrationBailed) {
6404
+ hydrationBailed = true;
6405
+ console.warn('Parent: ', elm);
6406
+ console.warn('server innerHTML: ', i);
6407
+ console.warn('client innerHTML: ', elm.innerHTML);
6408
+ }
6409
+
6410
+ return false;
6411
+ }
6412
+ } else {
6413
+ // iterate and compare children lists
6414
+ var childrenMatch = true;
6415
+ var childNode = elm.firstChild;
6416
+
6417
+ for (var i$1 = 0; i$1 < children.length; i$1++) {
6418
+ if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
6419
+ childrenMatch = false;
6420
+ break;
6421
+ }
6422
+
6423
+ childNode = childNode.nextSibling;
6424
+ } // if childNode is not null, it means the actual childNodes list is
6425
+ // longer than the virtual children list.
6426
+
6427
+
6428
+ if (!childrenMatch || childNode) {
6429
+ /* istanbul ignore if */
6430
+ if (typeof console !== 'undefined' && !hydrationBailed) {
6431
+ hydrationBailed = true;
6432
+ console.warn('Parent: ', elm);
6433
+ console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
6434
+ }
6435
+
6436
+ return false;
6437
+ }
6438
+ }
6439
+ }
6440
+ }
6441
+
6442
+ if (isDef(data)) {
6443
+ var fullInvoke = false;
6444
+
6445
+ for (var key in data) {
6446
+ if (!isRenderedModule(key)) {
6447
+ fullInvoke = true;
6448
+ invokeCreateHooks(vnode, insertedVnodeQueue);
6449
+ break;
6450
+ }
6451
+ }
6452
+
6453
+ if (!fullInvoke && data['class']) {
6454
+ // ensure collecting deps for deep class bindings for future updates
6455
+ traverse(data['class']);
6456
+ }
6457
+ }
6458
+ } else if (elm.data !== vnode.text) {
6459
+ elm.data = vnode.text;
6460
+ }
6461
+
6462
+ return true;
6463
+ }
6464
+
6465
+ function assertNodeMatch(node, vnode, inVPre) {
6466
+ if (isDef(vnode.tag)) {
6467
+ return vnode.tag.indexOf('vue-component') === 0 || !isUnknownElement$$1(vnode, inVPre) && vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase());
6468
+ } else {
6469
+ return node.nodeType === (vnode.isComment ? 8 : 3);
6470
+ }
6471
+ }
6472
+
6473
+ return function patch(oldVnode, vnode, hydrating, removeOnly) {
6474
+ if (isUndef(vnode)) {
6475
+ if (isDef(oldVnode)) {
6476
+ invokeDestroyHook(oldVnode);
6477
+ }
6478
+
6479
+ return;
6480
+ }
6481
+
6482
+ var isInitialPatch = false;
6483
+ var insertedVnodeQueue = [];
6484
+
6485
+ if (isUndef(oldVnode)) {
6486
+ // empty mount (likely as component), create new root element
6487
+ isInitialPatch = true;
6488
+ createElm(vnode, insertedVnodeQueue);
6489
+ } else {
6490
+ var isRealElement = isDef(oldVnode.nodeType);
6491
+
6492
+ if (!isRealElement && sameVnode(oldVnode, vnode)) {
6493
+ // patch existing root node
6494
+ patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
6495
+ } else {
6496
+ if (isRealElement) {
6497
+ // mounting to a real element
6498
+ // check if this is server-rendered content and if we can perform
6499
+ // a successful hydration.
6500
+ if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
6501
+ oldVnode.removeAttribute(SSR_ATTR);
6502
+ hydrating = true;
6503
+ }
6504
+
6505
+ if (isTrue(hydrating)) {
6506
+ if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
6507
+ invokeInsertHook(vnode, insertedVnodeQueue, true);
6508
+ return oldVnode;
6509
+ } else {
6510
+ warn('The client-side rendered virtual DOM tree is not matching ' + 'server-rendered content. This is likely caused by incorrect ' + 'HTML markup, for example nesting block-level elements inside ' + '<p>, or missing <tbody>. Bailing hydration and performing ' + 'full client-side render.');
6511
+ }
6512
+ } // either not server-rendered, or hydration failed.
6513
+ // create an empty node and replace it
6514
+
6515
+
6516
+ oldVnode = emptyNodeAt(oldVnode);
6517
+ } // replacing existing element
6518
+
6519
+
6520
+ var oldElm = oldVnode.elm;
6521
+ var parentElm = nodeOps.parentNode(oldElm); // create new node
6522
+
6523
+ createElm(vnode, insertedVnodeQueue, // extremely rare edge case: do not insert if old element is in a
6524
+ // leaving transition. Only happens when combining transition +
6525
+ // keep-alive + HOCs. (#4590)
6526
+ oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm)); // update parent placeholder node element, recursively
6527
+
6528
+ if (isDef(vnode.parent)) {
6529
+ var ancestor = vnode.parent;
6530
+ var patchable = isPatchable(vnode);
6531
+
6532
+ while (ancestor) {
6533
+ for (var i = 0; i < cbs.destroy.length; ++i) {
6534
+ cbs.destroy[i](ancestor);
6535
+ }
6536
+
6537
+ ancestor.elm = vnode.elm;
6538
+
6539
+ if (patchable) {
6540
+ for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6541
+ cbs.create[i$1](emptyNode, ancestor);
6542
+ } // #6513
6543
+ // invoke insert hooks that may have been merged by create hooks.
6544
+ // e.g. for directives that uses the "inserted" hook.
6545
+
6546
+
6547
+ var insert = ancestor.data.hook.insert;
6548
+
6549
+ if (insert.merged) {
6550
+ // start at index 1 to avoid re-invoking component mounted hook
6551
+ for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
6552
+ insert.fns[i$2]();
6553
+ }
6554
+ }
6555
+ } else {
6556
+ registerRef(ancestor);
6557
+ }
6558
+
6559
+ ancestor = ancestor.parent;
6560
+ }
6561
+ } // destroy old node
6562
+
6563
+
6564
+ if (isDef(parentElm)) {
6565
+ removeVnodes([oldVnode], 0, 0);
6566
+ } else if (isDef(oldVnode.tag)) {
6567
+ invokeDestroyHook(oldVnode);
6568
+ }
6569
+ }
6570
+ }
6571
+
6572
+ invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
6573
+ return vnode.elm;
6574
+ };
6575
+ }
6576
+ /* */
6577
+
6578
+
6579
+ var directives = {
6580
+ create: updateDirectives,
6581
+ update: updateDirectives,
6582
+ destroy: function unbindDirectives(vnode) {
6583
+ updateDirectives(vnode, emptyNode);
6584
+ }
6585
+ };
6586
+
6587
+ function updateDirectives(oldVnode, vnode) {
6588
+ if (oldVnode.data.directives || vnode.data.directives) {
6589
+ _update(oldVnode, vnode);
6590
+ }
6591
+ }
6592
+
6593
+ function _update(oldVnode, vnode) {
6594
+ var isCreate = oldVnode === emptyNode;
6595
+ var isDestroy = vnode === emptyNode;
6596
+ var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
6597
+ var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
6598
+ var dirsWithInsert = [];
6599
+ var dirsWithPostpatch = [];
6600
+ var key, oldDir, dir;
6601
+
6602
+ for (key in newDirs) {
6603
+ oldDir = oldDirs[key];
6604
+ dir = newDirs[key];
6605
+
6606
+ if (!oldDir) {
6607
+ // new directive, bind
6608
+ callHook$1(dir, 'bind', vnode, oldVnode);
6609
+
6610
+ if (dir.def && dir.def.inserted) {
6611
+ dirsWithInsert.push(dir);
6612
+ }
6613
+ } else {
6614
+ // existing directive, update
6615
+ dir.oldValue = oldDir.value;
6616
+ dir.oldArg = oldDir.arg;
6617
+ callHook$1(dir, 'update', vnode, oldVnode);
6618
+
6619
+ if (dir.def && dir.def.componentUpdated) {
6620
+ dirsWithPostpatch.push(dir);
6621
+ }
6622
+ }
6623
+ }
6624
+
6625
+ if (dirsWithInsert.length) {
6626
+ var callInsert = function callInsert() {
6627
+ for (var i = 0; i < dirsWithInsert.length; i++) {
6628
+ callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
6629
+ }
6630
+ };
6631
+
6632
+ if (isCreate) {
6633
+ mergeVNodeHook(vnode, 'insert', callInsert);
6634
+ } else {
6635
+ callInsert();
6636
+ }
6637
+ }
6638
+
6639
+ if (dirsWithPostpatch.length) {
6640
+ mergeVNodeHook(vnode, 'postpatch', function () {
6641
+ for (var i = 0; i < dirsWithPostpatch.length; i++) {
6642
+ callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
6643
+ }
6644
+ });
6645
+ }
6646
+
6647
+ if (!isCreate) {
6648
+ for (key in oldDirs) {
6649
+ if (!newDirs[key]) {
6650
+ // no longer present, unbind
6651
+ callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
6652
+ }
6653
+ }
6654
+ }
6655
+ }
6656
+
6657
+ var emptyModifiers = Object.create(null);
6658
+
6659
+ function normalizeDirectives$1(dirs, vm) {
6660
+ var res = Object.create(null);
6661
+
6662
+ if (!dirs) {
6663
+ // $flow-disable-line
6664
+ return res;
6665
+ }
6666
+
6667
+ var i, dir;
6668
+
6669
+ for (i = 0; i < dirs.length; i++) {
6670
+ dir = dirs[i];
6671
+
6672
+ if (!dir.modifiers) {
6673
+ // $flow-disable-line
6674
+ dir.modifiers = emptyModifiers;
6675
+ }
6676
+
6677
+ res[getRawDirName(dir)] = dir;
6678
+ dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
6679
+ } // $flow-disable-line
6680
+
6681
+
6682
+ return res;
6683
+ }
6684
+
6685
+ function getRawDirName(dir) {
6686
+ return dir.rawName || dir.name + "." + Object.keys(dir.modifiers || {}).join('.');
6687
+ }
6688
+
6689
+ function callHook$1(dir, hook, vnode, oldVnode, isDestroy) {
6690
+ var fn = dir.def && dir.def[hook];
6691
+
6692
+ if (fn) {
6693
+ try {
6694
+ fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
6695
+ } catch (e) {
6696
+ handleError(e, vnode.context, "directive " + dir.name + " " + hook + " hook");
6697
+ }
6698
+ }
6699
+ }
6700
+
6701
+ var baseModules = [ref, directives];
6702
+ /* */
6703
+
6704
+ function updateAttrs(oldVnode, vnode) {
6705
+ var opts = vnode.componentOptions;
6706
+
6707
+ if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
6708
+ return;
6709
+ }
6710
+
6711
+ if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
6712
+ return;
6713
+ }
6714
+
6715
+ var key, cur, old;
6716
+ var elm = vnode.elm;
6717
+ var oldAttrs = oldVnode.data.attrs || {};
6718
+ var attrs = vnode.data.attrs || {}; // clone observed objects, as the user probably wants to mutate it
6719
+
6720
+ if (isDef(attrs.__ob__)) {
6721
+ attrs = vnode.data.attrs = extend({}, attrs);
6722
+ }
6723
+
6724
+ for (key in attrs) {
6725
+ cur = attrs[key];
6726
+ old = oldAttrs[key];
6727
+
6728
+ if (old !== cur) {
6729
+ setAttr(elm, key, cur);
6730
+ }
6731
+ } // #4391: in IE9, setting type can reset value for input[type=radio]
6732
+ // #6666: IE/Edge forces progress value down to 1 before setting a max
6733
+
6734
+ /* istanbul ignore if */
6735
+
6736
+
6737
+ if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
6738
+ setAttr(elm, 'value', attrs.value);
6739
+ }
6740
+
6741
+ for (key in oldAttrs) {
6742
+ if (isUndef(attrs[key])) {
6743
+ if (isXlink(key)) {
6744
+ elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
6745
+ } else if (!isEnumeratedAttr(key)) {
6746
+ elm.removeAttribute(key);
6747
+ }
6748
+ }
6749
+ }
6750
+ }
6751
+
6752
+ function setAttr(el, key, value) {
6753
+ if (el.tagName.indexOf('-') > -1) {
6754
+ baseSetAttr(el, key, value);
6755
+ } else if (isBooleanAttr(key)) {
6756
+ // set attribute for blank value
6757
+ // e.g. <option disabled>Select one</option>
6758
+ if (isFalsyAttrValue(value)) {
6759
+ el.removeAttribute(key);
6760
+ } else {
6761
+ // technically allowfullscreen is a boolean attribute for <iframe>,
6762
+ // but Flash expects a value of "true" when used on <embed> tag
6763
+ value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
6764
+ el.setAttribute(key, value);
6765
+ }
6766
+ } else if (isEnumeratedAttr(key)) {
6767
+ el.setAttribute(key, convertEnumeratedValue(key, value));
6768
+ } else if (isXlink(key)) {
6769
+ if (isFalsyAttrValue(value)) {
6770
+ el.removeAttributeNS(xlinkNS, getXlinkProp(key));
6771
+ } else {
6772
+ el.setAttributeNS(xlinkNS, key, value);
6773
+ }
6774
+ } else {
6775
+ baseSetAttr(el, key, value);
6776
+ }
6777
+ }
6778
+
6779
+ function baseSetAttr(el, key, value) {
6780
+ if (isFalsyAttrValue(value)) {
6781
+ el.removeAttribute(key);
6782
+ } else {
6783
+ // #7138: IE10 & 11 fires input event when setting placeholder on
6784
+ // <textarea>... block the first input event and remove the blocker
6785
+ // immediately.
6786
+
6787
+ /* istanbul ignore if */
6788
+ if (isIE && !isIE9 && el.tagName === 'TEXTAREA' && key === 'placeholder' && value !== '' && !el.__ieph) {
6789
+ var blocker = function blocker(e) {
6790
+ e.stopImmediatePropagation();
6791
+ el.removeEventListener('input', blocker);
6792
+ };
6793
+
6794
+ el.addEventListener('input', blocker); // $flow-disable-line
6795
+
6796
+ el.__ieph = true;
6797
+ /* IE placeholder patched */
6798
+ }
6799
+
6800
+ el.setAttribute(key, value);
6801
+ }
6802
+ }
6803
+
6804
+ var attrs = {
6805
+ create: updateAttrs,
6806
+ update: updateAttrs
6807
+ };
6808
+ /* */
6809
+
6810
+ function updateClass(oldVnode, vnode) {
6811
+ var el = vnode.elm;
6812
+ var data = vnode.data;
6813
+ var oldData = oldVnode.data;
6814
+
6815
+ if (isUndef(data.staticClass) && isUndef(data["class"]) && (isUndef(oldData) || isUndef(oldData.staticClass) && isUndef(oldData["class"]))) {
6816
+ return;
6817
+ }
6818
+
6819
+ var cls = genClassForVnode(vnode); // handle transition classes
6820
+
6821
+ var transitionClass = el._transitionClasses;
6822
+
6823
+ if (isDef(transitionClass)) {
6824
+ cls = concat(cls, stringifyClass(transitionClass));
6825
+ } // set the class
6826
+
6827
+
6828
+ if (cls !== el._prevClass) {
6829
+ el.setAttribute('class', cls);
6830
+ el._prevClass = cls;
6831
+ }
6832
+ }
6833
+
6834
+ var klass = {
6835
+ create: updateClass,
6836
+ update: updateClass
6837
+ };
6838
+ /* */
6839
+
6840
+ var validDivisionCharRE = /[\w).+\-_$\]]/;
6841
+
6842
+ function parseFilters(exp) {
6843
+ var inSingle = false;
6844
+ var inDouble = false;
6845
+ var inTemplateString = false;
6846
+ var inRegex = false;
6847
+ var curly = 0;
6848
+ var square = 0;
6849
+ var paren = 0;
6850
+ var lastFilterIndex = 0;
6851
+ var c, prev, i, expression, filters;
6852
+
6853
+ for (i = 0; i < exp.length; i++) {
6854
+ prev = c;
6855
+ c = exp.charCodeAt(i);
6856
+
6857
+ if (inSingle) {
6858
+ if (c === 0x27 && prev !== 0x5C) {
6859
+ inSingle = false;
6860
+ }
6861
+ } else if (inDouble) {
6862
+ if (c === 0x22 && prev !== 0x5C) {
6863
+ inDouble = false;
6864
+ }
6865
+ } else if (inTemplateString) {
6866
+ if (c === 0x60 && prev !== 0x5C) {
6867
+ inTemplateString = false;
6868
+ }
6869
+ } else if (inRegex) {
6870
+ if (c === 0x2f && prev !== 0x5C) {
6871
+ inRegex = false;
6872
+ }
6873
+ } else if (c === 0x7C && // pipe
6874
+ exp.charCodeAt(i + 1) !== 0x7C && exp.charCodeAt(i - 1) !== 0x7C && !curly && !square && !paren) {
6875
+ if (expression === undefined) {
6876
+ // first filter, end of expression
6877
+ lastFilterIndex = i + 1;
6878
+ expression = exp.slice(0, i).trim();
6879
+ } else {
6880
+ pushFilter();
6881
+ }
6882
+ } else {
6883
+ switch (c) {
6884
+ case 0x22:
6885
+ inDouble = true;
6886
+ break;
6887
+ // "
6888
+
6889
+ case 0x27:
6890
+ inSingle = true;
6891
+ break;
6892
+ // '
6893
+
6894
+ case 0x60:
6895
+ inTemplateString = true;
6896
+ break;
6897
+ // `
6898
+
6899
+ case 0x28:
6900
+ paren++;
6901
+ break;
6902
+ // (
6903
+
6904
+ case 0x29:
6905
+ paren--;
6906
+ break;
6907
+ // )
6908
+
6909
+ case 0x5B:
6910
+ square++;
6911
+ break;
6912
+ // [
6913
+
6914
+ case 0x5D:
6915
+ square--;
6916
+ break;
6917
+ // ]
6918
+
6919
+ case 0x7B:
6920
+ curly++;
6921
+ break;
6922
+ // {
6923
+
6924
+ case 0x7D:
6925
+ curly--;
6926
+ break;
6927
+ // }
6928
+ }
6929
+
6930
+ if (c === 0x2f) {
6931
+ // /
6932
+ var j = i - 1;
6933
+ var p = void 0; // find first non-whitespace prev char
6934
+
6935
+ for (; j >= 0; j--) {
6936
+ p = exp.charAt(j);
6937
+
6938
+ if (p !== ' ') {
6939
+ break;
6940
+ }
6941
+ }
6942
+
6943
+ if (!p || !validDivisionCharRE.test(p)) {
6944
+ inRegex = true;
6945
+ }
6946
+ }
6947
+ }
6948
+ }
6949
+
6950
+ if (expression === undefined) {
6951
+ expression = exp.slice(0, i).trim();
6952
+ } else if (lastFilterIndex !== 0) {
6953
+ pushFilter();
6954
+ }
6955
+
6956
+ function pushFilter() {
6957
+ (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
6958
+ lastFilterIndex = i + 1;
6959
+ }
6960
+
6961
+ if (filters) {
6962
+ for (i = 0; i < filters.length; i++) {
6963
+ expression = wrapFilter(expression, filters[i]);
6964
+ }
6965
+ }
6966
+
6967
+ return expression;
6968
+ }
6969
+
6970
+ function wrapFilter(exp, filter) {
6971
+ var i = filter.indexOf('(');
6972
+
6973
+ if (i < 0) {
6974
+ // _f: resolveFilter
6975
+ return "_f(\"" + filter + "\")(" + exp + ")";
6976
+ } else {
6977
+ var name = filter.slice(0, i);
6978
+ var args = filter.slice(i + 1);
6979
+ return "_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args);
6980
+ }
6981
+ }
6982
+ /* */
6983
+
6984
+ /* eslint-disable no-unused-vars */
6985
+
6986
+
6987
+ function baseWarn(msg, range) {
6988
+ console.error("[Vue compiler]: " + msg);
6989
+ }
6990
+ /* eslint-enable no-unused-vars */
6991
+
6992
+
6993
+ function pluckModuleFunction(modules, key) {
6994
+ return modules ? modules.map(function (m) {
6995
+ return m[key];
6996
+ }).filter(function (_) {
6997
+ return _;
6998
+ }) : [];
6999
+ }
7000
+
7001
+ function addProp(el, name, value, range, dynamic) {
7002
+ (el.props || (el.props = [])).push(rangeSetItem({
7003
+ name: name,
7004
+ value: value,
7005
+ dynamic: dynamic
7006
+ }, range));
7007
+ el.plain = false;
7008
+ }
7009
+
7010
+ function addAttr(el, name, value, range, dynamic) {
7011
+ var attrs = dynamic ? el.dynamicAttrs || (el.dynamicAttrs = []) : el.attrs || (el.attrs = []);
7012
+ attrs.push(rangeSetItem({
7013
+ name: name,
7014
+ value: value,
7015
+ dynamic: dynamic
7016
+ }, range));
7017
+ el.plain = false;
7018
+ } // add a raw attr (use this in preTransforms)
7019
+
7020
+
7021
+ function addRawAttr(el, name, value, range) {
7022
+ el.attrsMap[name] = value;
7023
+ el.attrsList.push(rangeSetItem({
7024
+ name: name,
7025
+ value: value
7026
+ }, range));
7027
+ }
7028
+
7029
+ function addDirective(el, name, rawName, value, arg, isDynamicArg, modifiers, range) {
7030
+ (el.directives || (el.directives = [])).push(rangeSetItem({
7031
+ name: name,
7032
+ rawName: rawName,
7033
+ value: value,
7034
+ arg: arg,
7035
+ isDynamicArg: isDynamicArg,
7036
+ modifiers: modifiers
7037
+ }, range));
7038
+ el.plain = false;
7039
+ }
7040
+
7041
+ function prependModifierMarker(symbol, name, dynamic) {
7042
+ return dynamic ? "_p(" + name + ",\"" + symbol + "\")" : symbol + name; // mark the event as captured
7043
+ }
7044
+
7045
+ function addHandler(el, name, value, modifiers, important, warn, range, dynamic) {
7046
+ modifiers = modifiers || emptyObject; // warn prevent and passive modifier
7047
+
7048
+ /* istanbul ignore if */
7049
+
7050
+ if (warn && modifiers.prevent && modifiers.passive) {
7051
+ warn('passive and prevent can\'t be used together. ' + 'Passive handler can\'t prevent default event.', range);
7052
+ } // normalize click.right and click.middle since they don't actually fire
7053
+ // this is technically browser-specific, but at least for now browsers are
7054
+ // the only target envs that have right/middle clicks.
7055
+
7056
+
7057
+ if (modifiers.right) {
7058
+ if (dynamic) {
7059
+ name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
7060
+ } else if (name === 'click') {
7061
+ name = 'contextmenu';
7062
+ delete modifiers.right;
7063
+ }
7064
+ } else if (modifiers.middle) {
7065
+ if (dynamic) {
7066
+ name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
7067
+ } else if (name === 'click') {
7068
+ name = 'mouseup';
7069
+ }
7070
+ } // check capture modifier
7071
+
7072
+
7073
+ if (modifiers.capture) {
7074
+ delete modifiers.capture;
7075
+ name = prependModifierMarker('!', name, dynamic);
7076
+ }
7077
+
7078
+ if (modifiers.once) {
7079
+ delete modifiers.once;
7080
+ name = prependModifierMarker('~', name, dynamic);
7081
+ }
7082
+ /* istanbul ignore if */
7083
+
7084
+
7085
+ if (modifiers.passive) {
7086
+ delete modifiers.passive;
7087
+ name = prependModifierMarker('&', name, dynamic);
7088
+ }
7089
+
7090
+ var events;
7091
+
7092
+ if (modifiers["native"]) {
7093
+ delete modifiers["native"];
7094
+ events = el.nativeEvents || (el.nativeEvents = {});
7095
+ } else {
7096
+ events = el.events || (el.events = {});
7097
+ }
7098
+
7099
+ var newHandler = rangeSetItem({
7100
+ value: value.trim(),
7101
+ dynamic: dynamic
7102
+ }, range);
7103
+
7104
+ if (modifiers !== emptyObject) {
7105
+ newHandler.modifiers = modifiers;
7106
+ }
7107
+
7108
+ var handlers = events[name];
7109
+ /* istanbul ignore if */
7110
+
7111
+ if (Array.isArray(handlers)) {
7112
+ important ? handlers.unshift(newHandler) : handlers.push(newHandler);
7113
+ } else if (handlers) {
7114
+ events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
7115
+ } else {
7116
+ events[name] = newHandler;
7117
+ }
7118
+
7119
+ el.plain = false;
7120
+ }
7121
+
7122
+ function getRawBindingAttr(el, name) {
7123
+ return el.rawAttrsMap[':' + name] || el.rawAttrsMap['v-bind:' + name] || el.rawAttrsMap[name];
7124
+ }
7125
+
7126
+ function getBindingAttr(el, name, getStatic) {
7127
+ var dynamicValue = getAndRemoveAttr(el, ':' + name) || getAndRemoveAttr(el, 'v-bind:' + name);
7128
+
7129
+ if (dynamicValue != null) {
7130
+ return parseFilters(dynamicValue);
7131
+ } else if (getStatic !== false) {
7132
+ var staticValue = getAndRemoveAttr(el, name);
7133
+
7134
+ if (staticValue != null) {
7135
+ return JSON.stringify(staticValue);
7136
+ }
7137
+ }
7138
+ } // note: this only removes the attr from the Array (attrsList) so that it
7139
+ // doesn't get processed by processAttrs.
7140
+ // By default it does NOT remove it from the map (attrsMap) because the map is
7141
+ // needed during codegen.
7142
+
7143
+
7144
+ function getAndRemoveAttr(el, name, removeFromMap) {
7145
+ var val;
7146
+
7147
+ if ((val = el.attrsMap[name]) != null) {
7148
+ var list = el.attrsList;
7149
+
7150
+ for (var i = 0, l = list.length; i < l; i++) {
7151
+ if (list[i].name === name) {
7152
+ list.splice(i, 1);
7153
+ break;
7154
+ }
7155
+ }
7156
+ }
7157
+
7158
+ if (removeFromMap) {
7159
+ delete el.attrsMap[name];
7160
+ }
7161
+
7162
+ return val;
7163
+ }
7164
+
7165
+ function getAndRemoveAttrByRegex(el, name) {
7166
+ var list = el.attrsList;
7167
+
7168
+ for (var i = 0, l = list.length; i < l; i++) {
7169
+ var attr = list[i];
7170
+
7171
+ if (name.test(attr.name)) {
7172
+ list.splice(i, 1);
7173
+ return attr;
7174
+ }
7175
+ }
7176
+ }
7177
+
7178
+ function rangeSetItem(item, range) {
7179
+ if (range) {
7180
+ if (range.start != null) {
7181
+ item.start = range.start;
7182
+ }
7183
+
7184
+ if (range.end != null) {
7185
+ item.end = range.end;
7186
+ }
7187
+ }
7188
+
7189
+ return item;
7190
+ }
7191
+ /* */
7192
+
7193
+ /**
7194
+ * Cross-platform code generation for component v-model
7195
+ */
7196
+
7197
+
7198
+ function genComponentModel(el, value, modifiers) {
7199
+ var ref = modifiers || {};
7200
+ var number = ref.number;
7201
+ var trim = ref.trim;
7202
+ var baseValueExpression = '$$v';
7203
+ var valueExpression = baseValueExpression;
7204
+
7205
+ if (trim) {
7206
+ valueExpression = "(typeof " + baseValueExpression + " === 'string'" + "? " + baseValueExpression + ".trim()" + ": " + baseValueExpression + ")";
7207
+ }
7208
+
7209
+ if (number) {
7210
+ valueExpression = "_n(" + valueExpression + ")";
7211
+ }
7212
+
7213
+ var assignment = genAssignmentCode(value, valueExpression);
7214
+ el.model = {
7215
+ value: "(" + value + ")",
7216
+ expression: JSON.stringify(value),
7217
+ callback: "function (" + baseValueExpression + ") {" + assignment + "}"
7218
+ };
7219
+ }
7220
+ /**
7221
+ * Cross-platform codegen helper for generating v-model value assignment code.
7222
+ */
7223
+
7224
+
7225
+ function genAssignmentCode(value, assignment) {
7226
+ var res = parseModel(value);
7227
+
7228
+ if (res.key === null) {
7229
+ return value + "=" + assignment;
7230
+ } else {
7231
+ return "$set(" + res.exp + ", " + res.key + ", " + assignment + ")";
7232
+ }
7233
+ }
7234
+ /**
7235
+ * Parse a v-model expression into a base path and a final key segment.
7236
+ * Handles both dot-path and possible square brackets.
7237
+ *
7238
+ * Possible cases:
7239
+ *
7240
+ * - test
7241
+ * - test[key]
7242
+ * - test[test1[key]]
7243
+ * - test["a"][key]
7244
+ * - xxx.test[a[a].test1[key]]
7245
+ * - test.xxx.a["asa"][test1[key]]
7246
+ *
7247
+ */
7248
+
7249
+
7250
+ var len, str, chr, index$1, expressionPos, expressionEndPos;
7251
+
7252
+ function parseModel(val) {
7253
+ // Fix https://github.com/vuejs/vue/pull/7730
7254
+ // allow v-model="obj.val " (trailing whitespace)
7255
+ val = val.trim();
7256
+ len = val.length;
7257
+
7258
+ if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
7259
+ index$1 = val.lastIndexOf('.');
7260
+
7261
+ if (index$1 > -1) {
7262
+ return {
7263
+ exp: val.slice(0, index$1),
7264
+ key: '"' + val.slice(index$1 + 1) + '"'
7265
+ };
7266
+ } else {
7267
+ return {
7268
+ exp: val,
7269
+ key: null
7270
+ };
7271
+ }
7272
+ }
7273
+
7274
+ str = val;
7275
+ index$1 = expressionPos = expressionEndPos = 0;
7276
+
7277
+ while (!eof()) {
7278
+ chr = next();
7279
+ /* istanbul ignore if */
7280
+
7281
+ if (isStringStart(chr)) {
7282
+ parseString(chr);
7283
+ } else if (chr === 0x5B) {
7284
+ parseBracket(chr);
7285
+ }
7286
+ }
7287
+
7288
+ return {
7289
+ exp: val.slice(0, expressionPos),
7290
+ key: val.slice(expressionPos + 1, expressionEndPos)
7291
+ };
7292
+ }
7293
+
7294
+ function next() {
7295
+ return str.charCodeAt(++index$1);
7296
+ }
7297
+
7298
+ function eof() {
7299
+ return index$1 >= len;
7300
+ }
7301
+
7302
+ function isStringStart(chr) {
7303
+ return chr === 0x22 || chr === 0x27;
7304
+ }
7305
+
7306
+ function parseBracket(chr) {
7307
+ var inBracket = 1;
7308
+ expressionPos = index$1;
7309
+
7310
+ while (!eof()) {
7311
+ chr = next();
7312
+
7313
+ if (isStringStart(chr)) {
7314
+ parseString(chr);
7315
+ continue;
7316
+ }
7317
+
7318
+ if (chr === 0x5B) {
7319
+ inBracket++;
7320
+ }
7321
+
7322
+ if (chr === 0x5D) {
7323
+ inBracket--;
7324
+ }
7325
+
7326
+ if (inBracket === 0) {
7327
+ expressionEndPos = index$1;
7328
+ break;
7329
+ }
7330
+ }
7331
+ }
7332
+
7333
+ function parseString(chr) {
7334
+ var stringQuote = chr;
7335
+
7336
+ while (!eof()) {
7337
+ chr = next();
7338
+
7339
+ if (chr === stringQuote) {
7340
+ break;
7341
+ }
7342
+ }
7343
+ }
7344
+ /* */
7345
+
7346
+
7347
+ var warn$1; // in some cases, the event used has to be determined at runtime
7348
+ // so we used some reserved tokens during compile.
7349
+
7350
+ var RANGE_TOKEN = '__r';
7351
+ var CHECKBOX_RADIO_TOKEN = '__c';
7352
+
7353
+ function model(el, dir, _warn) {
7354
+ warn$1 = _warn;
7355
+ var value = dir.value;
7356
+ var modifiers = dir.modifiers;
7357
+ var tag = el.tag;
7358
+ var type = el.attrsMap.type;
7359
+ {
7360
+ // inputs with type="file" are read only and setting the input's
7361
+ // value will throw an error.
7362
+ if (tag === 'input' && type === 'file') {
7363
+ warn$1("<" + el.tag + " v-model=\"" + value + "\" type=\"file\">:\n" + "File inputs are read only. Use a v-on:change listener instead.", el.rawAttrsMap['v-model']);
7364
+ }
7365
+ }
7366
+
7367
+ if (el.component) {
7368
+ genComponentModel(el, value, modifiers); // component v-model doesn't need extra runtime
7369
+
7370
+ return false;
7371
+ } else if (tag === 'select') {
7372
+ genSelect(el, value, modifiers);
7373
+ } else if (tag === 'input' && type === 'checkbox') {
7374
+ genCheckboxModel(el, value, modifiers);
7375
+ } else if (tag === 'input' && type === 'radio') {
7376
+ genRadioModel(el, value, modifiers);
7377
+ } else if (tag === 'input' || tag === 'textarea') {
7378
+ genDefaultModel(el, value, modifiers);
7379
+ } else if (!config.isReservedTag(tag)) {
7380
+ genComponentModel(el, value, modifiers); // component v-model doesn't need extra runtime
7381
+
7382
+ return false;
7383
+ } else {
7384
+ warn$1("<" + el.tag + " v-model=\"" + value + "\">: " + "v-model is not supported on this element type. " + 'If you are working with contenteditable, it\'s recommended to ' + 'wrap a library dedicated for that purpose inside a custom component.', el.rawAttrsMap['v-model']);
7385
+ } // ensure runtime directive metadata
7386
+
7387
+
7388
+ return true;
7389
+ }
7390
+
7391
+ function genCheckboxModel(el, value, modifiers) {
7392
+ var number = modifiers && modifiers.number;
7393
+ var valueBinding = getBindingAttr(el, 'value') || 'null';
7394
+ var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
7395
+ var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
7396
+ addProp(el, 'checked', "Array.isArray(" + value + ")" + "?_i(" + value + "," + valueBinding + ")>-1" + (trueValueBinding === 'true' ? ":(" + value + ")" : ":_q(" + value + "," + trueValueBinding + ")"));
7397
+ addHandler(el, 'change', "var $$a=" + value + "," + '$$el=$event.target,' + "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + 'if(Array.isArray($$a)){' + "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + '$$i=_i($$a,$$v);' + "if($$el.checked){$$i<0&&(" + genAssignmentCode(value, '$$a.concat([$$v])') + ")}" + "else{$$i>-1&&(" + genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))') + ")}" + "}else{" + genAssignmentCode(value, '$$c') + "}", null, true);
7398
+ }
7399
+
7400
+ function genRadioModel(el, value, modifiers) {
7401
+ var number = modifiers && modifiers.number;
7402
+ var valueBinding = getBindingAttr(el, 'value') || 'null';
7403
+ valueBinding = number ? "_n(" + valueBinding + ")" : valueBinding;
7404
+ addProp(el, 'checked', "_q(" + value + "," + valueBinding + ")");
7405
+ addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
7406
+ }
7407
+
7408
+ function genSelect(el, value, modifiers) {
7409
+ var number = modifiers && modifiers.number;
7410
+ var selectedVal = "Array.prototype.filter" + ".call($event.target.options,function(o){return o.selected})" + ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + "return " + (number ? '_n(val)' : 'val') + "})";
7411
+ var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
7412
+ var code = "var $$selectedVal = " + selectedVal + ";";
7413
+ code = code + " " + genAssignmentCode(value, assignment);
7414
+ addHandler(el, 'change', code, null, true);
7415
+ }
7416
+
7417
+ function genDefaultModel(el, value, modifiers) {
7418
+ var type = el.attrsMap.type; // warn if v-bind:value conflicts with v-model
7419
+ // except for inputs with v-bind:type
7420
+
7421
+ {
7422
+ var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
7423
+ var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
7424
+
7425
+ if (value$1 && !typeBinding) {
7426
+ var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
7427
+ warn$1(binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + 'because the latter already expands to a value binding internally', el.rawAttrsMap[binding]);
7428
+ }
7429
+ }
7430
+ var ref = modifiers || {};
7431
+ var lazy = ref.lazy;
7432
+ var number = ref.number;
7433
+ var trim = ref.trim;
7434
+ var needCompositionGuard = !lazy && type !== 'range';
7435
+ var event = lazy ? 'change' : type === 'range' ? RANGE_TOKEN : 'input';
7436
+ var valueExpression = '$event.target.value';
7437
+
7438
+ if (trim) {
7439
+ valueExpression = "$event.target.value.trim()";
7440
+ }
7441
+
7442
+ if (number) {
7443
+ valueExpression = "_n(" + valueExpression + ")";
7444
+ }
7445
+
7446
+ var code = genAssignmentCode(value, valueExpression);
7447
+
7448
+ if (needCompositionGuard) {
7449
+ code = "if($event.target.composing)return;" + code;
7450
+ }
7451
+
7452
+ addProp(el, 'value', "(" + value + ")");
7453
+ addHandler(el, event, code, null, true);
7454
+
7455
+ if (trim || number) {
7456
+ addHandler(el, 'blur', '$forceUpdate()');
7457
+ }
7458
+ }
7459
+ /* */
7460
+ // normalize v-model event tokens that can only be determined at runtime.
7461
+ // it's important to place the event as the first in the array because
7462
+ // the whole point is ensuring the v-model callback gets called before
7463
+ // user-attached handlers.
7464
+
7465
+
7466
+ function normalizeEvents(on) {
7467
+ /* istanbul ignore if */
7468
+ if (isDef(on[RANGE_TOKEN])) {
7469
+ // IE input[type=range] only supports `change` event
7470
+ var event = isIE ? 'change' : 'input';
7471
+ on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
7472
+ delete on[RANGE_TOKEN];
7473
+ } // This was originally intended to fix #4521 but no longer necessary
7474
+ // after 2.5. Keeping it for backwards compat with generated code from < 2.4
7475
+
7476
+ /* istanbul ignore if */
7477
+
7478
+
7479
+ if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
7480
+ on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
7481
+ delete on[CHECKBOX_RADIO_TOKEN];
7482
+ }
7483
+ }
7484
+
7485
+ var target$1;
7486
+
7487
+ function createOnceHandler$1(event, handler, capture) {
7488
+ var _target = target$1; // save current target element in closure
7489
+
7490
+ return function onceHandler() {
7491
+ var res = handler.apply(null, arguments);
7492
+
7493
+ if (res !== null) {
7494
+ remove$2(event, onceHandler, capture, _target);
7495
+ }
7496
+ };
7497
+ } // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
7498
+ // implementation and does not fire microtasks in between event propagation, so
7499
+ // safe to exclude.
7500
+
7501
+
7502
+ var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
7503
+
7504
+ function add$1(name, handler, capture, passive) {
7505
+ // async edge case #6566: inner click event triggers patch, event handler
7506
+ // attached to outer element during patch, and triggered again. This
7507
+ // happens because browsers fire microtask ticks between event propagation.
7508
+ // the solution is simple: we save the timestamp when a handler is attached,
7509
+ // and the handler would only fire if the event passed to it was fired
7510
+ // AFTER it was attached.
7511
+ if (useMicrotaskFix) {
7512
+ var attachedTimestamp = currentFlushTimestamp;
7513
+ var original = handler;
7514
+
7515
+ handler = original._wrapper = function (e) {
7516
+ if ( // no bubbling, should always fire.
7517
+ // this is just a safety net in case event.timeStamp is unreliable in
7518
+ // certain weird environments...
7519
+ e.target === e.currentTarget || // event is fired after handler attachment
7520
+ e.timeStamp >= attachedTimestamp || // bail for environments that have buggy event.timeStamp implementations
7521
+ // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
7522
+ // #9681 QtWebEngine event.timeStamp is negative value
7523
+ e.timeStamp <= 0 || // #9448 bail if event is fired in another document in a multi-page
7524
+ // electron/nw.js app, since event.timeStamp will be using a different
7525
+ // starting reference
7526
+ e.target.ownerDocument !== document) {
7527
+ return original.apply(this, arguments);
7528
+ }
7529
+ };
7530
+ }
7531
+
7532
+ target$1.addEventListener(name, handler, supportsPassive ? {
7533
+ capture: capture,
7534
+ passive: passive
7535
+ } : capture);
7536
+ }
7537
+
7538
+ function remove$2(name, handler, capture, _target) {
7539
+ (_target || target$1).removeEventListener(name, handler._wrapper || handler, capture);
7540
+ }
7541
+
7542
+ function updateDOMListeners(oldVnode, vnode) {
7543
+ if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
7544
+ return;
7545
+ }
7546
+
7547
+ var on = vnode.data.on || {};
7548
+ var oldOn = oldVnode.data.on || {};
7549
+ target$1 = vnode.elm;
7550
+ normalizeEvents(on);
7551
+ updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
7552
+ target$1 = undefined;
7553
+ }
7554
+
7555
+ var events = {
7556
+ create: updateDOMListeners,
7557
+ update: updateDOMListeners
7558
+ };
7559
+ /* */
7560
+
7561
+ var svgContainer;
7562
+
7563
+ function updateDOMProps(oldVnode, vnode) {
7564
+ if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
7565
+ return;
7566
+ }
7567
+
7568
+ var key, cur;
7569
+ var elm = vnode.elm;
7570
+ var oldProps = oldVnode.data.domProps || {};
7571
+ var props = vnode.data.domProps || {}; // clone observed objects, as the user probably wants to mutate it
7572
+
7573
+ if (isDef(props.__ob__)) {
7574
+ props = vnode.data.domProps = extend({}, props);
7575
+ }
7576
+
7577
+ for (key in oldProps) {
7578
+ if (!(key in props)) {
7579
+ elm[key] = '';
7580
+ }
7581
+ }
7582
+
7583
+ for (key in props) {
7584
+ cur = props[key]; // ignore children if the node has textContent or innerHTML,
7585
+ // as these will throw away existing DOM nodes and cause removal errors
7586
+ // on subsequent patches (#3360)
7587
+
7588
+ if (key === 'textContent' || key === 'innerHTML') {
7589
+ if (vnode.children) {
7590
+ vnode.children.length = 0;
7591
+ }
7592
+
7593
+ if (cur === oldProps[key]) {
7594
+ continue;
7595
+ } // #6601 work around Chrome version <= 55 bug where single textNode
7596
+ // replaced by innerHTML/textContent retains its parentNode property
7597
+
7598
+
7599
+ if (elm.childNodes.length === 1) {
7600
+ elm.removeChild(elm.childNodes[0]);
7601
+ }
7602
+ }
7603
+
7604
+ if (key === 'value' && elm.tagName !== 'PROGRESS') {
7605
+ // store value as _value as well since
7606
+ // non-string values will be stringified
7607
+ elm._value = cur; // avoid resetting cursor position when value is the same
7608
+
7609
+ var strCur = isUndef(cur) ? '' : String(cur);
7610
+
7611
+ if (shouldUpdateValue(elm, strCur)) {
7612
+ elm.value = strCur;
7613
+ }
7614
+ } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
7615
+ // IE doesn't support innerHTML for SVG elements
7616
+ svgContainer = svgContainer || document.createElement('div');
7617
+ svgContainer.innerHTML = "<svg>" + cur + "</svg>";
7618
+ var svg = svgContainer.firstChild;
7619
+
7620
+ while (elm.firstChild) {
7621
+ elm.removeChild(elm.firstChild);
7622
+ }
7623
+
7624
+ while (svg.firstChild) {
7625
+ elm.appendChild(svg.firstChild);
7626
+ }
7627
+ } else if ( // skip the update if old and new VDOM state is the same.
7628
+ // `value` is handled separately because the DOM value may be temporarily
7629
+ // out of sync with VDOM state due to focus, composition and modifiers.
7630
+ // This #4521 by skipping the unnecessary `checked` update.
7631
+ cur !== oldProps[key]) {
7632
+ // some property updates can throw
7633
+ // e.g. `value` on <progress> w/ non-finite value
7634
+ try {
7635
+ elm[key] = cur;
7636
+ } catch (e) {}
7637
+ }
7638
+ }
7639
+ } // check platforms/web/util/attrs.js acceptValue
7640
+
7641
+
7642
+ function shouldUpdateValue(elm, checkVal) {
7643
+ return !elm.composing && (elm.tagName === 'OPTION' || isNotInFocusAndDirty(elm, checkVal) || isDirtyWithModifiers(elm, checkVal));
7644
+ }
7645
+
7646
+ function isNotInFocusAndDirty(elm, checkVal) {
7647
+ // return true when textbox (.number and .trim) loses focus and its value is
7648
+ // not equal to the updated value
7649
+ var notInFocus = true; // #6157
7650
+ // work around IE bug when accessing document.activeElement in an iframe
7651
+
7652
+ try {
7653
+ notInFocus = document.activeElement !== elm;
7654
+ } catch (e) {}
7655
+
7656
+ return notInFocus && elm.value !== checkVal;
7657
+ }
7658
+
7659
+ function isDirtyWithModifiers(elm, newVal) {
7660
+ var value = elm.value;
7661
+ var modifiers = elm._vModifiers; // injected by v-model runtime
7662
+
7663
+ if (isDef(modifiers)) {
7664
+ if (modifiers.number) {
7665
+ return toNumber(value) !== toNumber(newVal);
7666
+ }
7667
+
7668
+ if (modifiers.trim) {
7669
+ return value.trim() !== newVal.trim();
7670
+ }
7671
+ }
7672
+
7673
+ return value !== newVal;
7674
+ }
7675
+
7676
+ var domProps = {
7677
+ create: updateDOMProps,
7678
+ update: updateDOMProps
7679
+ };
7680
+ /* */
7681
+
7682
+ var parseStyleText = cached(function (cssText) {
7683
+ var res = {};
7684
+ var listDelimiter = /;(?![^(]*\))/g;
7685
+ var propertyDelimiter = /:(.+)/;
7686
+ cssText.split(listDelimiter).forEach(function (item) {
7687
+ if (item) {
7688
+ var tmp = item.split(propertyDelimiter);
7689
+ tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
7690
+ }
7691
+ });
7692
+ return res;
7693
+ }); // merge static and dynamic style data on the same vnode
7694
+
7695
+ function normalizeStyleData(data) {
7696
+ var style = normalizeStyleBinding(data.style); // static style is pre-processed into an object during compilation
7697
+ // and is always a fresh object, so it's safe to merge into it
7698
+
7699
+ return data.staticStyle ? extend(data.staticStyle, style) : style;
7700
+ } // normalize possible array / string values into Object
7701
+
7702
+
7703
+ function normalizeStyleBinding(bindingStyle) {
7704
+ if (Array.isArray(bindingStyle)) {
7705
+ return toObject(bindingStyle);
7706
+ }
7707
+
7708
+ if (typeof bindingStyle === 'string') {
7709
+ return parseStyleText(bindingStyle);
7710
+ }
7711
+
7712
+ return bindingStyle;
7713
+ }
7714
+ /**
7715
+ * parent component style should be after child's
7716
+ * so that parent component's style could override it
7717
+ */
7718
+
7719
+
7720
+ function getStyle(vnode, checkChild) {
7721
+ var res = {};
7722
+ var styleData;
7723
+
7724
+ if (checkChild) {
7725
+ var childNode = vnode;
7726
+
7727
+ while (childNode.componentInstance) {
7728
+ childNode = childNode.componentInstance._vnode;
7729
+
7730
+ if (childNode && childNode.data && (styleData = normalizeStyleData(childNode.data))) {
7731
+ extend(res, styleData);
7732
+ }
7733
+ }
7734
+ }
7735
+
7736
+ if (styleData = normalizeStyleData(vnode.data)) {
7737
+ extend(res, styleData);
7738
+ }
7739
+
7740
+ var parentNode = vnode;
7741
+
7742
+ while (parentNode = parentNode.parent) {
7743
+ if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
7744
+ extend(res, styleData);
7745
+ }
7746
+ }
7747
+
7748
+ return res;
7749
+ }
7750
+ /* */
7751
+
7752
+
7753
+ var cssVarRE = /^--/;
7754
+ var importantRE = /\s*!important$/;
7755
+
7756
+ var setProp = function setProp(el, name, val) {
7757
+ /* istanbul ignore if */
7758
+ if (cssVarRE.test(name)) {
7759
+ el.style.setProperty(name, val);
7760
+ } else if (importantRE.test(val)) {
7761
+ el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
7762
+ } else {
7763
+ var normalizedName = normalize(name);
7764
+
7765
+ if (Array.isArray(val)) {
7766
+ // Support values array created by autoprefixer, e.g.
7767
+ // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
7768
+ // Set them one by one, and the browser will only set those it can recognize
7769
+ for (var i = 0, len = val.length; i < len; i++) {
7770
+ el.style[normalizedName] = val[i];
7771
+ }
7772
+ } else {
7773
+ el.style[normalizedName] = val;
7774
+ }
7775
+ }
7776
+ };
7777
+
7778
+ var vendorNames = ['Webkit', 'Moz', 'ms'];
7779
+ var emptyStyle;
7780
+ var normalize = cached(function (prop) {
7781
+ emptyStyle = emptyStyle || document.createElement('div').style;
7782
+ prop = camelize(prop);
7783
+
7784
+ if (prop !== 'filter' && prop in emptyStyle) {
7785
+ return prop;
7786
+ }
7787
+
7788
+ var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
7789
+
7790
+ for (var i = 0; i < vendorNames.length; i++) {
7791
+ var name = vendorNames[i] + capName;
7792
+
7793
+ if (name in emptyStyle) {
7794
+ return name;
7795
+ }
7796
+ }
7797
+ });
7798
+
7799
+ function updateStyle(oldVnode, vnode) {
7800
+ var data = vnode.data;
7801
+ var oldData = oldVnode.data;
7802
+
7803
+ if (isUndef(data.staticStyle) && isUndef(data.style) && isUndef(oldData.staticStyle) && isUndef(oldData.style)) {
7804
+ return;
7805
+ }
7806
+
7807
+ var cur, name;
7808
+ var el = vnode.elm;
7809
+ var oldStaticStyle = oldData.staticStyle;
7810
+ var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; // if static style exists, stylebinding already merged into it when doing normalizeStyleData
7811
+
7812
+ var oldStyle = oldStaticStyle || oldStyleBinding;
7813
+ var style = normalizeStyleBinding(vnode.data.style) || {}; // store normalized style under a different key for next diff
7814
+ // make sure to clone it if it's reactive, since the user likely wants
7815
+ // to mutate it.
7816
+
7817
+ vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
7818
+ var newStyle = getStyle(vnode, true);
7819
+
7820
+ for (name in oldStyle) {
7821
+ if (isUndef(newStyle[name])) {
7822
+ setProp(el, name, '');
7823
+ }
7824
+ }
7825
+
7826
+ for (name in newStyle) {
7827
+ cur = newStyle[name];
7828
+
7829
+ if (cur !== oldStyle[name]) {
7830
+ // ie9 setting to null has no effect, must use empty string
7831
+ setProp(el, name, cur == null ? '' : cur);
7832
+ }
7833
+ }
7834
+ }
7835
+
7836
+ var style = {
7837
+ create: updateStyle,
7838
+ update: updateStyle
7839
+ };
7840
+ /* */
7841
+
7842
+ var whitespaceRE = /\s+/;
7843
+ /**
7844
+ * Add class with compatibility for SVG since classList is not supported on
7845
+ * SVG elements in IE
7846
+ */
7847
+
7848
+ function addClass(el, cls) {
7849
+ /* istanbul ignore if */
7850
+ if (!cls || !(cls = cls.trim())) {
7851
+ return;
7852
+ }
7853
+ /* istanbul ignore else */
7854
+
7855
+
7856
+ if (el.classList) {
7857
+ if (cls.indexOf(' ') > -1) {
7858
+ cls.split(whitespaceRE).forEach(function (c) {
7859
+ return el.classList.add(c);
7860
+ });
7861
+ } else {
7862
+ el.classList.add(cls);
7863
+ }
7864
+ } else {
7865
+ var cur = " " + (el.getAttribute('class') || '') + " ";
7866
+
7867
+ if (cur.indexOf(' ' + cls + ' ') < 0) {
7868
+ el.setAttribute('class', (cur + cls).trim());
7869
+ }
7870
+ }
7871
+ }
7872
+ /**
7873
+ * Remove class with compatibility for SVG since classList is not supported on
7874
+ * SVG elements in IE
7875
+ */
7876
+
7877
+
7878
+ function removeClass(el, cls) {
7879
+ /* istanbul ignore if */
7880
+ if (!cls || !(cls = cls.trim())) {
7881
+ return;
7882
+ }
7883
+ /* istanbul ignore else */
7884
+
7885
+
7886
+ if (el.classList) {
7887
+ if (cls.indexOf(' ') > -1) {
7888
+ cls.split(whitespaceRE).forEach(function (c) {
7889
+ return el.classList.remove(c);
7890
+ });
7891
+ } else {
7892
+ el.classList.remove(cls);
7893
+ }
7894
+
7895
+ if (!el.classList.length) {
7896
+ el.removeAttribute('class');
7897
+ }
7898
+ } else {
7899
+ var cur = " " + (el.getAttribute('class') || '') + " ";
7900
+ var tar = ' ' + cls + ' ';
7901
+
7902
+ while (cur.indexOf(tar) >= 0) {
7903
+ cur = cur.replace(tar, ' ');
7904
+ }
7905
+
7906
+ cur = cur.trim();
7907
+
7908
+ if (cur) {
7909
+ el.setAttribute('class', cur);
7910
+ } else {
7911
+ el.removeAttribute('class');
7912
+ }
7913
+ }
7914
+ }
7915
+ /* */
7916
+
7917
+
7918
+ function resolveTransition(def$$1) {
7919
+ if (!def$$1) {
7920
+ return;
7921
+ }
7922
+ /* istanbul ignore else */
7923
+
7924
+
7925
+ if (_typeof(def$$1) === 'object') {
7926
+ var res = {};
7927
+
7928
+ if (def$$1.css !== false) {
7929
+ extend(res, autoCssTransition(def$$1.name || 'v'));
7930
+ }
7931
+
7932
+ extend(res, def$$1);
7933
+ return res;
7934
+ } else if (typeof def$$1 === 'string') {
7935
+ return autoCssTransition(def$$1);
7936
+ }
7937
+ }
7938
+
7939
+ var autoCssTransition = cached(function (name) {
7940
+ return {
7941
+ enterClass: name + "-enter",
7942
+ enterToClass: name + "-enter-to",
7943
+ enterActiveClass: name + "-enter-active",
7944
+ leaveClass: name + "-leave",
7945
+ leaveToClass: name + "-leave-to",
7946
+ leaveActiveClass: name + "-leave-active"
7947
+ };
7948
+ });
7949
+ var hasTransition = inBrowser && !isIE9;
7950
+ var TRANSITION = 'transition';
7951
+ var ANIMATION = 'animation'; // Transition property/event sniffing
7952
+
7953
+ var transitionProp = 'transition';
7954
+ var transitionEndEvent = 'transitionend';
7955
+ var animationProp = 'animation';
7956
+ var animationEndEvent = 'animationend';
7957
+
7958
+ if (hasTransition) {
7959
+ /* istanbul ignore if */
7960
+ if (window.ontransitionend === undefined && window.onwebkittransitionend !== undefined) {
7961
+ transitionProp = 'WebkitTransition';
7962
+ transitionEndEvent = 'webkitTransitionEnd';
7963
+ }
7964
+
7965
+ if (window.onanimationend === undefined && window.onwebkitanimationend !== undefined) {
7966
+ animationProp = 'WebkitAnimation';
7967
+ animationEndEvent = 'webkitAnimationEnd';
7968
+ }
7969
+ } // binding to window is necessary to make hot reload work in IE in strict mode
7970
+
7971
+
7972
+ var raf = inBrowser ? window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout :
7973
+ /* istanbul ignore next */
7974
+ function (fn) {
7975
+ return fn();
7976
+ };
7977
+
7978
+ function nextFrame(fn) {
7979
+ raf(function () {
7980
+ raf(fn);
7981
+ });
7982
+ }
7983
+
7984
+ function addTransitionClass(el, cls) {
7985
+ var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
7986
+
7987
+ if (transitionClasses.indexOf(cls) < 0) {
7988
+ transitionClasses.push(cls);
7989
+ addClass(el, cls);
7990
+ }
7991
+ }
7992
+
7993
+ function removeTransitionClass(el, cls) {
7994
+ if (el._transitionClasses) {
7995
+ remove(el._transitionClasses, cls);
7996
+ }
7997
+
7998
+ removeClass(el, cls);
7999
+ }
8000
+
8001
+ function whenTransitionEnds(el, expectedType, cb) {
8002
+ var ref = getTransitionInfo(el, expectedType);
8003
+ var type = ref.type;
8004
+ var timeout = ref.timeout;
8005
+ var propCount = ref.propCount;
8006
+
8007
+ if (!type) {
8008
+ return cb();
8009
+ }
8010
+
8011
+ var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
8012
+ var ended = 0;
8013
+
8014
+ var end = function end() {
8015
+ el.removeEventListener(event, onEnd);
8016
+ cb();
8017
+ };
8018
+
8019
+ var onEnd = function onEnd(e) {
8020
+ if (e.target === el) {
8021
+ if (++ended >= propCount) {
8022
+ end();
8023
+ }
8024
+ }
8025
+ };
8026
+
8027
+ setTimeout(function () {
8028
+ if (ended < propCount) {
8029
+ end();
8030
+ }
8031
+ }, timeout + 1);
8032
+ el.addEventListener(event, onEnd);
8033
+ }
8034
+
8035
+ var transformRE = /\b(transform|all)(,|$)/;
8036
+
8037
+ function getTransitionInfo(el, expectedType) {
8038
+ var styles = window.getComputedStyle(el); // JSDOM may return undefined for transition properties
8039
+
8040
+ var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
8041
+ var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
8042
+ var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
8043
+ var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
8044
+ var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
8045
+ var animationTimeout = getTimeout(animationDelays, animationDurations);
8046
+ var type;
8047
+ var timeout = 0;
8048
+ var propCount = 0;
8049
+ /* istanbul ignore if */
8050
+
8051
+ if (expectedType === TRANSITION) {
8052
+ if (transitionTimeout > 0) {
8053
+ type = TRANSITION;
8054
+ timeout = transitionTimeout;
8055
+ propCount = transitionDurations.length;
8056
+ }
8057
+ } else if (expectedType === ANIMATION) {
8058
+ if (animationTimeout > 0) {
8059
+ type = ANIMATION;
8060
+ timeout = animationTimeout;
8061
+ propCount = animationDurations.length;
8062
+ }
8063
+ } else {
8064
+ timeout = Math.max(transitionTimeout, animationTimeout);
8065
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
8066
+ propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
8067
+ }
8068
+
8069
+ var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
8070
+ return {
8071
+ type: type,
8072
+ timeout: timeout,
8073
+ propCount: propCount,
8074
+ hasTransform: hasTransform
8075
+ };
8076
+ }
8077
+
8078
+ function getTimeout(delays, durations) {
8079
+ /* istanbul ignore next */
8080
+ while (delays.length < durations.length) {
8081
+ delays = delays.concat(delays);
8082
+ }
8083
+
8084
+ return Math.max.apply(null, durations.map(function (d, i) {
8085
+ return toMs(d) + toMs(delays[i]);
8086
+ }));
8087
+ } // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
8088
+ // in a locale-dependent way, using a comma instead of a dot.
8089
+ // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
8090
+ // as a floor function) causing unexpected behaviors
8091
+
8092
+
8093
+ function toMs(s) {
8094
+ return Number(s.slice(0, -1).replace(',', '.')) * 1000;
8095
+ }
8096
+ /* */
8097
+
8098
+
8099
+ function enter(vnode, toggleDisplay) {
8100
+ var el = vnode.elm; // call leave callback now
8101
+
8102
+ if (isDef(el._leaveCb)) {
8103
+ el._leaveCb.cancelled = true;
8104
+
8105
+ el._leaveCb();
8106
+ }
8107
+
8108
+ var data = resolveTransition(vnode.data.transition);
8109
+
8110
+ if (isUndef(data)) {
8111
+ return;
8112
+ }
8113
+ /* istanbul ignore if */
8114
+
8115
+
8116
+ if (isDef(el._enterCb) || el.nodeType !== 1) {
8117
+ return;
8118
+ }
8119
+
8120
+ var css = data.css;
8121
+ var type = data.type;
8122
+ var enterClass = data.enterClass;
8123
+ var enterToClass = data.enterToClass;
8124
+ var enterActiveClass = data.enterActiveClass;
8125
+ var appearClass = data.appearClass;
8126
+ var appearToClass = data.appearToClass;
8127
+ var appearActiveClass = data.appearActiveClass;
8128
+ var beforeEnter = data.beforeEnter;
8129
+ var enter = data.enter;
8130
+ var afterEnter = data.afterEnter;
8131
+ var enterCancelled = data.enterCancelled;
8132
+ var beforeAppear = data.beforeAppear;
8133
+ var appear = data.appear;
8134
+ var afterAppear = data.afterAppear;
8135
+ var appearCancelled = data.appearCancelled;
8136
+ var duration = data.duration; // activeInstance will always be the <transition> component managing this
8137
+ // transition. One edge case to check is when the <transition> is placed
8138
+ // as the root node of a child component. In that case we need to check
8139
+ // <transition>'s parent for appear check.
8140
+
8141
+ var context = activeInstance;
8142
+ var transitionNode = activeInstance.$vnode;
8143
+
8144
+ while (transitionNode && transitionNode.parent) {
8145
+ context = transitionNode.context;
8146
+ transitionNode = transitionNode.parent;
8147
+ }
8148
+
8149
+ var isAppear = !context._isMounted || !vnode.isRootInsert;
8150
+
8151
+ if (isAppear && !appear && appear !== '') {
8152
+ return;
8153
+ }
8154
+
8155
+ var startClass = isAppear && appearClass ? appearClass : enterClass;
8156
+ var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
8157
+ var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
8158
+ var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
8159
+ var enterHook = isAppear ? typeof appear === 'function' ? appear : enter : enter;
8160
+ var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
8161
+ var enterCancelledHook = isAppear ? appearCancelled || enterCancelled : enterCancelled;
8162
+ var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
8163
+
8164
+ if (explicitEnterDuration != null) {
8165
+ checkDuration(explicitEnterDuration, 'enter', vnode);
8166
+ }
8167
+
8168
+ var expectsCSS = css !== false && !isIE9;
8169
+ var userWantsControl = getHookArgumentsLength(enterHook);
8170
+ var cb = el._enterCb = once(function () {
8171
+ if (expectsCSS) {
8172
+ removeTransitionClass(el, toClass);
8173
+ removeTransitionClass(el, activeClass);
8174
+ }
8175
+
8176
+ if (cb.cancelled) {
8177
+ if (expectsCSS) {
8178
+ removeTransitionClass(el, startClass);
8179
+ }
8180
+
8181
+ enterCancelledHook && enterCancelledHook(el);
8182
+ } else {
8183
+ afterEnterHook && afterEnterHook(el);
8184
+ }
8185
+
8186
+ el._enterCb = null;
8187
+ });
8188
+
8189
+ if (!vnode.data.show) {
8190
+ // remove pending leave element on enter by injecting an insert hook
8191
+ mergeVNodeHook(vnode, 'insert', function () {
8192
+ var parent = el.parentNode;
8193
+ var pendingNode = parent && parent._pending && parent._pending[vnode.key];
8194
+
8195
+ if (pendingNode && pendingNode.tag === vnode.tag && pendingNode.elm._leaveCb) {
8196
+ pendingNode.elm._leaveCb();
8197
+ }
8198
+
8199
+ enterHook && enterHook(el, cb);
8200
+ });
8201
+ } // start enter transition
8202
+
8203
+
8204
+ beforeEnterHook && beforeEnterHook(el);
8205
+
8206
+ if (expectsCSS) {
8207
+ addTransitionClass(el, startClass);
8208
+ addTransitionClass(el, activeClass);
8209
+ nextFrame(function () {
8210
+ removeTransitionClass(el, startClass);
8211
+
8212
+ if (!cb.cancelled) {
8213
+ addTransitionClass(el, toClass);
8214
+
8215
+ if (!userWantsControl) {
8216
+ if (isValidDuration(explicitEnterDuration)) {
8217
+ setTimeout(cb, explicitEnterDuration);
8218
+ } else {
8219
+ whenTransitionEnds(el, type, cb);
8220
+ }
8221
+ }
8222
+ }
8223
+ });
8224
+ }
8225
+
8226
+ if (vnode.data.show) {
8227
+ toggleDisplay && toggleDisplay();
8228
+ enterHook && enterHook(el, cb);
8229
+ }
8230
+
8231
+ if (!expectsCSS && !userWantsControl) {
8232
+ cb();
8233
+ }
8234
+ }
8235
+
8236
+ function leave(vnode, rm) {
8237
+ var el = vnode.elm; // call enter callback now
8238
+
8239
+ if (isDef(el._enterCb)) {
8240
+ el._enterCb.cancelled = true;
8241
+
8242
+ el._enterCb();
8243
+ }
8244
+
8245
+ var data = resolveTransition(vnode.data.transition);
8246
+
8247
+ if (isUndef(data) || el.nodeType !== 1) {
8248
+ return rm();
8249
+ }
8250
+ /* istanbul ignore if */
8251
+
8252
+
8253
+ if (isDef(el._leaveCb)) {
8254
+ return;
8255
+ }
8256
+
8257
+ var css = data.css;
8258
+ var type = data.type;
8259
+ var leaveClass = data.leaveClass;
8260
+ var leaveToClass = data.leaveToClass;
8261
+ var leaveActiveClass = data.leaveActiveClass;
8262
+ var beforeLeave = data.beforeLeave;
8263
+ var leave = data.leave;
8264
+ var afterLeave = data.afterLeave;
8265
+ var leaveCancelled = data.leaveCancelled;
8266
+ var delayLeave = data.delayLeave;
8267
+ var duration = data.duration;
8268
+ var expectsCSS = css !== false && !isIE9;
8269
+ var userWantsControl = getHookArgumentsLength(leave);
8270
+ var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
8271
+
8272
+ if (isDef(explicitLeaveDuration)) {
8273
+ checkDuration(explicitLeaveDuration, 'leave', vnode);
8274
+ }
8275
+
8276
+ var cb = el._leaveCb = once(function () {
8277
+ if (el.parentNode && el.parentNode._pending) {
8278
+ el.parentNode._pending[vnode.key] = null;
8279
+ }
8280
+
8281
+ if (expectsCSS) {
8282
+ removeTransitionClass(el, leaveToClass);
8283
+ removeTransitionClass(el, leaveActiveClass);
8284
+ }
8285
+
8286
+ if (cb.cancelled) {
8287
+ if (expectsCSS) {
8288
+ removeTransitionClass(el, leaveClass);
8289
+ }
8290
+
8291
+ leaveCancelled && leaveCancelled(el);
8292
+ } else {
8293
+ rm();
8294
+ afterLeave && afterLeave(el);
8295
+ }
8296
+
8297
+ el._leaveCb = null;
8298
+ });
8299
+
8300
+ if (delayLeave) {
8301
+ delayLeave(performLeave);
8302
+ } else {
8303
+ performLeave();
8304
+ }
8305
+
8306
+ function performLeave() {
8307
+ // the delayed leave may have already been cancelled
8308
+ if (cb.cancelled) {
8309
+ return;
8310
+ } // record leaving element
8311
+
8312
+
8313
+ if (!vnode.data.show && el.parentNode) {
8314
+ (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] = vnode;
8315
+ }
8316
+
8317
+ beforeLeave && beforeLeave(el);
8318
+
8319
+ if (expectsCSS) {
8320
+ addTransitionClass(el, leaveClass);
8321
+ addTransitionClass(el, leaveActiveClass);
8322
+ nextFrame(function () {
8323
+ removeTransitionClass(el, leaveClass);
8324
+
8325
+ if (!cb.cancelled) {
8326
+ addTransitionClass(el, leaveToClass);
8327
+
8328
+ if (!userWantsControl) {
8329
+ if (isValidDuration(explicitLeaveDuration)) {
8330
+ setTimeout(cb, explicitLeaveDuration);
8331
+ } else {
8332
+ whenTransitionEnds(el, type, cb);
8333
+ }
8334
+ }
8335
+ }
8336
+ });
8337
+ }
8338
+
8339
+ leave && leave(el, cb);
8340
+
8341
+ if (!expectsCSS && !userWantsControl) {
8342
+ cb();
8343
+ }
8344
+ }
8345
+ } // only used in dev mode
8346
+
8347
+
8348
+ function checkDuration(val, name, vnode) {
8349
+ if (typeof val !== 'number') {
8350
+ warn("<transition> explicit " + name + " duration is not a valid number - " + "got " + JSON.stringify(val) + ".", vnode.context);
8351
+ } else if (isNaN(val)) {
8352
+ warn("<transition> explicit " + name + " duration is NaN - " + 'the duration expression might be incorrect.', vnode.context);
8353
+ }
8354
+ }
8355
+
8356
+ function isValidDuration(val) {
8357
+ return typeof val === 'number' && !isNaN(val);
8358
+ }
8359
+ /**
8360
+ * Normalize a transition hook's argument length. The hook may be:
8361
+ * - a merged hook (invoker) with the original in .fns
8362
+ * - a wrapped component method (check ._length)
8363
+ * - a plain function (.length)
8364
+ */
8365
+
8366
+
8367
+ function getHookArgumentsLength(fn) {
8368
+ if (isUndef(fn)) {
8369
+ return false;
8370
+ }
8371
+
8372
+ var invokerFns = fn.fns;
8373
+
8374
+ if (isDef(invokerFns)) {
8375
+ // invoker
8376
+ return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
8377
+ } else {
8378
+ return (fn._length || fn.length) > 1;
8379
+ }
8380
+ }
8381
+
8382
+ function _enter(_, vnode) {
8383
+ if (vnode.data.show !== true) {
8384
+ enter(vnode);
8385
+ }
8386
+ }
8387
+
8388
+ var transition = inBrowser ? {
8389
+ create: _enter,
8390
+ activate: _enter,
8391
+ remove: function remove$$1(vnode, rm) {
8392
+ /* istanbul ignore else */
8393
+ if (vnode.data.show !== true) {
8394
+ leave(vnode, rm);
8395
+ } else {
8396
+ rm();
8397
+ }
8398
+ }
8399
+ } : {};
8400
+ var platformModules = [attrs, klass, events, domProps, style, transition];
8401
+ /* */
8402
+ // the directive module should be applied last, after all
8403
+ // built-in modules have been applied.
8404
+
8405
+ var modules = platformModules.concat(baseModules);
8406
+ var patch = createPatchFunction({
8407
+ nodeOps: nodeOps,
8408
+ modules: modules
8409
+ });
8410
+ /**
8411
+ * Not type checking this file because flow doesn't like attaching
8412
+ * properties to Elements.
8413
+ */
8414
+
8415
+ /* istanbul ignore if */
8416
+
8417
+ if (isIE9) {
8418
+ // http://www.matts411.com/post/internet-explorer-9-oninput/
8419
+ document.addEventListener('selectionchange', function () {
8420
+ var el = document.activeElement;
8421
+
8422
+ if (el && el.vmodel) {
8423
+ trigger(el, 'input');
8424
+ }
8425
+ });
8426
+ }
8427
+
8428
+ var directive = {
8429
+ inserted: function inserted(el, binding, vnode, oldVnode) {
8430
+ if (vnode.tag === 'select') {
8431
+ // #6903
8432
+ if (oldVnode.elm && !oldVnode.elm._vOptions) {
8433
+ mergeVNodeHook(vnode, 'postpatch', function () {
8434
+ directive.componentUpdated(el, binding, vnode);
8435
+ });
8436
+ } else {
8437
+ setSelected(el, binding, vnode.context);
8438
+ }
8439
+
8440
+ el._vOptions = [].map.call(el.options, getValue);
8441
+ } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
8442
+ el._vModifiers = binding.modifiers;
8443
+
8444
+ if (!binding.modifiers.lazy) {
8445
+ el.addEventListener('compositionstart', onCompositionStart);
8446
+ el.addEventListener('compositionend', onCompositionEnd); // Safari < 10.2 & UIWebView doesn't fire compositionend when
8447
+ // switching focus before confirming composition choice
8448
+ // this also fixes the issue where some browsers e.g. iOS Chrome
8449
+ // fires "change" instead of "input" on autocomplete.
8450
+
8451
+ el.addEventListener('change', onCompositionEnd);
8452
+ /* istanbul ignore if */
8453
+
8454
+ if (isIE9) {
8455
+ el.vmodel = true;
8456
+ }
8457
+ }
8458
+ }
8459
+ },
8460
+ componentUpdated: function componentUpdated(el, binding, vnode) {
8461
+ if (vnode.tag === 'select') {
8462
+ setSelected(el, binding, vnode.context); // in case the options rendered by v-for have changed,
8463
+ // it's possible that the value is out-of-sync with the rendered options.
8464
+ // detect such cases and filter out values that no longer has a matching
8465
+ // option in the DOM.
8466
+
8467
+ var prevOptions = el._vOptions;
8468
+ var curOptions = el._vOptions = [].map.call(el.options, getValue);
8469
+
8470
+ if (curOptions.some(function (o, i) {
8471
+ return !looseEqual(o, prevOptions[i]);
8472
+ })) {
8473
+ // trigger change event if
8474
+ // no matching option found for at least one value
8475
+ var needReset = el.multiple ? binding.value.some(function (v) {
8476
+ return hasNoMatchingOption(v, curOptions);
8477
+ }) : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
8478
+
8479
+ if (needReset) {
8480
+ trigger(el, 'change');
8481
+ }
8482
+ }
8483
+ }
8484
+ }
8485
+ };
8486
+
8487
+ function setSelected(el, binding, vm) {
8488
+ actuallySetSelected(el, binding, vm);
8489
+ /* istanbul ignore if */
8490
+
8491
+ if (isIE || isEdge) {
8492
+ setTimeout(function () {
8493
+ actuallySetSelected(el, binding, vm);
8494
+ }, 0);
8495
+ }
8496
+ }
8497
+
8498
+ function actuallySetSelected(el, binding, vm) {
8499
+ var value = binding.value;
8500
+ var isMultiple = el.multiple;
8501
+
8502
+ if (isMultiple && !Array.isArray(value)) {
8503
+ warn("<select multiple v-model=\"" + binding.expression + "\"> " + "expects an Array value for its binding, but got " + Object.prototype.toString.call(value).slice(8, -1), vm);
8504
+ return;
8505
+ }
8506
+
8507
+ var selected, option;
8508
+
8509
+ for (var i = 0, l = el.options.length; i < l; i++) {
8510
+ option = el.options[i];
8511
+
8512
+ if (isMultiple) {
8513
+ selected = looseIndexOf(value, getValue(option)) > -1;
8514
+
8515
+ if (option.selected !== selected) {
8516
+ option.selected = selected;
8517
+ }
8518
+ } else {
8519
+ if (looseEqual(getValue(option), value)) {
8520
+ if (el.selectedIndex !== i) {
8521
+ el.selectedIndex = i;
8522
+ }
8523
+
8524
+ return;
8525
+ }
8526
+ }
8527
+ }
8528
+
8529
+ if (!isMultiple) {
8530
+ el.selectedIndex = -1;
8531
+ }
8532
+ }
8533
+
8534
+ function hasNoMatchingOption(value, options) {
8535
+ return options.every(function (o) {
8536
+ return !looseEqual(o, value);
8537
+ });
8538
+ }
8539
+
8540
+ function getValue(option) {
8541
+ return '_value' in option ? option._value : option.value;
8542
+ }
8543
+
8544
+ function onCompositionStart(e) {
8545
+ e.target.composing = true;
8546
+ }
8547
+
8548
+ function onCompositionEnd(e) {
8549
+ // prevent triggering an input event for no reason
8550
+ if (!e.target.composing) {
8551
+ return;
8552
+ }
8553
+
8554
+ e.target.composing = false;
8555
+ trigger(e.target, 'input');
8556
+ }
8557
+
8558
+ function trigger(el, type) {
8559
+ var e = document.createEvent('HTMLEvents');
8560
+ e.initEvent(type, true, true);
8561
+ el.dispatchEvent(e);
8562
+ }
8563
+ /* */
8564
+ // recursively search for possible transition defined inside the component root
8565
+
8566
+
8567
+ function locateNode(vnode) {
8568
+ return vnode.componentInstance && (!vnode.data || !vnode.data.transition) ? locateNode(vnode.componentInstance._vnode) : vnode;
8569
+ }
8570
+
8571
+ var show = {
8572
+ bind: function bind(el, ref, vnode) {
8573
+ var value = ref.value;
8574
+ vnode = locateNode(vnode);
8575
+ var transition$$1 = vnode.data && vnode.data.transition;
8576
+ var originalDisplay = el.__vOriginalDisplay = el.style.display === 'none' ? '' : el.style.display;
8577
+
8578
+ if (value && transition$$1) {
8579
+ vnode.data.show = true;
8580
+ enter(vnode, function () {
8581
+ el.style.display = originalDisplay;
8582
+ });
8583
+ } else {
8584
+ el.style.display = value ? originalDisplay : 'none';
8585
+ }
8586
+ },
8587
+ update: function update(el, ref, vnode) {
8588
+ var value = ref.value;
8589
+ var oldValue = ref.oldValue;
8590
+ /* istanbul ignore if */
8591
+
8592
+ if (!value === !oldValue) {
8593
+ return;
8594
+ }
8595
+
8596
+ vnode = locateNode(vnode);
8597
+ var transition$$1 = vnode.data && vnode.data.transition;
8598
+
8599
+ if (transition$$1) {
8600
+ vnode.data.show = true;
8601
+
8602
+ if (value) {
8603
+ enter(vnode, function () {
8604
+ el.style.display = el.__vOriginalDisplay;
8605
+ });
8606
+ } else {
8607
+ leave(vnode, function () {
8608
+ el.style.display = 'none';
8609
+ });
8610
+ }
8611
+ } else {
8612
+ el.style.display = value ? el.__vOriginalDisplay : 'none';
8613
+ }
8614
+ },
8615
+ unbind: function unbind(el, binding, vnode, oldVnode, isDestroy) {
8616
+ if (!isDestroy) {
8617
+ el.style.display = el.__vOriginalDisplay;
8618
+ }
8619
+ }
8620
+ };
8621
+ var platformDirectives = {
8622
+ model: directive,
8623
+ show: show
8624
+ };
8625
+ /* */
8626
+
8627
+ var transitionProps = {
8628
+ name: String,
8629
+ appear: Boolean,
8630
+ css: Boolean,
8631
+ mode: String,
8632
+ type: String,
8633
+ enterClass: String,
8634
+ leaveClass: String,
8635
+ enterToClass: String,
8636
+ leaveToClass: String,
8637
+ enterActiveClass: String,
8638
+ leaveActiveClass: String,
8639
+ appearClass: String,
8640
+ appearActiveClass: String,
8641
+ appearToClass: String,
8642
+ duration: [Number, String, Object]
8643
+ }; // in case the child is also an abstract component, e.g. <keep-alive>
8644
+ // we want to recursively retrieve the real component to be rendered
8645
+
8646
+ function getRealChild(vnode) {
8647
+ var compOptions = vnode && vnode.componentOptions;
8648
+
8649
+ if (compOptions && compOptions.Ctor.options["abstract"]) {
8650
+ return getRealChild(getFirstComponentChild(compOptions.children));
8651
+ } else {
8652
+ return vnode;
8653
+ }
8654
+ }
8655
+
8656
+ function extractTransitionData(comp) {
8657
+ var data = {};
8658
+ var options = comp.$options; // props
8659
+
8660
+ for (var key in options.propsData) {
8661
+ data[key] = comp[key];
8662
+ } // events.
8663
+ // extract listeners and pass them directly to the transition methods
8664
+
8665
+
8666
+ var listeners = options._parentListeners;
8667
+
8668
+ for (var key$1 in listeners) {
8669
+ data[camelize(key$1)] = listeners[key$1];
8670
+ }
8671
+
8672
+ return data;
8673
+ }
8674
+
8675
+ function placeholder(h, rawChild) {
8676
+ if (/\d-keep-alive$/.test(rawChild.tag)) {
8677
+ return h('keep-alive', {
8678
+ props: rawChild.componentOptions.propsData
8679
+ });
8680
+ }
8681
+ }
8682
+
8683
+ function hasParentTransition(vnode) {
8684
+ while (vnode = vnode.parent) {
8685
+ if (vnode.data.transition) {
8686
+ return true;
8687
+ }
8688
+ }
8689
+ }
8690
+
8691
+ function isSameChild(child, oldChild) {
8692
+ return oldChild.key === child.key && oldChild.tag === child.tag;
8693
+ }
8694
+
8695
+ var isNotTextNode = function isNotTextNode(c) {
8696
+ return c.tag || isAsyncPlaceholder(c);
8697
+ };
8698
+
8699
+ var isVShowDirective = function isVShowDirective(d) {
8700
+ return d.name === 'show';
8701
+ };
8702
+
8703
+ var Transition = {
8704
+ name: 'transition',
8705
+ props: transitionProps,
8706
+ "abstract": true,
8707
+ render: function render(h) {
8708
+ var this$1 = this;
8709
+ var children = this.$slots["default"];
8710
+
8711
+ if (!children) {
8712
+ return;
8713
+ } // filter out text nodes (possible whitespaces)
8714
+
8715
+
8716
+ children = children.filter(isNotTextNode);
8717
+ /* istanbul ignore if */
8718
+
8719
+ if (!children.length) {
8720
+ return;
8721
+ } // warn multiple elements
8722
+
8723
+
8724
+ if (children.length > 1) {
8725
+ warn('<transition> can only be used on a single element. Use ' + '<transition-group> for lists.', this.$parent);
8726
+ }
8727
+
8728
+ var mode = this.mode; // warn invalid mode
8729
+
8730
+ if (mode && mode !== 'in-out' && mode !== 'out-in') {
8731
+ warn('invalid <transition> mode: ' + mode, this.$parent);
8732
+ }
8733
+
8734
+ var rawChild = children[0]; // if this is a component root node and the component's
8735
+ // parent container node also has transition, skip.
8736
+
8737
+ if (hasParentTransition(this.$vnode)) {
8738
+ return rawChild;
8739
+ } // apply transition data to child
8740
+ // use getRealChild() to ignore abstract components e.g. keep-alive
8741
+
8742
+
8743
+ var child = getRealChild(rawChild);
8744
+ /* istanbul ignore if */
8745
+
8746
+ if (!child) {
8747
+ return rawChild;
8748
+ }
8749
+
8750
+ if (this._leaving) {
8751
+ return placeholder(h, rawChild);
8752
+ } // ensure a key that is unique to the vnode type and to this transition
8753
+ // component instance. This key will be used to remove pending leaving nodes
8754
+ // during entering.
8755
+
8756
+
8757
+ var id = "__transition-" + this._uid + "-";
8758
+ child.key = child.key == null ? child.isComment ? id + 'comment' : id + child.tag : isPrimitive(child.key) ? String(child.key).indexOf(id) === 0 ? child.key : id + child.key : child.key;
8759
+ var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
8760
+ var oldRawChild = this._vnode;
8761
+ var oldChild = getRealChild(oldRawChild); // mark v-show
8762
+ // so that the transition module can hand over the control to the directive
8763
+
8764
+ if (child.data.directives && child.data.directives.some(isVShowDirective)) {
8765
+ child.data.show = true;
8766
+ }
8767
+
8768
+ if (oldChild && oldChild.data && !isSameChild(child, oldChild) && !isAsyncPlaceholder(oldChild) && // #6687 component root is a comment node
8769
+ !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)) {
8770
+ // replace old child transition data with fresh one
8771
+ // important for dynamic transitions!
8772
+ var oldData = oldChild.data.transition = extend({}, data); // handle transition mode
8773
+
8774
+ if (mode === 'out-in') {
8775
+ // return placeholder node and queue update when leave finishes
8776
+ this._leaving = true;
8777
+ mergeVNodeHook(oldData, 'afterLeave', function () {
8778
+ this$1._leaving = false;
8779
+ this$1.$forceUpdate();
8780
+ });
8781
+ return placeholder(h, rawChild);
8782
+ } else if (mode === 'in-out') {
8783
+ if (isAsyncPlaceholder(child)) {
8784
+ return oldRawChild;
8785
+ }
8786
+
8787
+ var delayedLeave;
8788
+
8789
+ var performLeave = function performLeave() {
8790
+ delayedLeave();
8791
+ };
8792
+
8793
+ mergeVNodeHook(data, 'afterEnter', performLeave);
8794
+ mergeVNodeHook(data, 'enterCancelled', performLeave);
8795
+ mergeVNodeHook(oldData, 'delayLeave', function (leave) {
8796
+ delayedLeave = leave;
8797
+ });
8798
+ }
8799
+ }
8800
+
8801
+ return rawChild;
8802
+ }
8803
+ };
8804
+ /* */
8805
+
8806
+ var props = extend({
8807
+ tag: String,
8808
+ moveClass: String
8809
+ }, transitionProps);
8810
+ delete props.mode;
8811
+ var TransitionGroup = {
8812
+ props: props,
8813
+ beforeMount: function beforeMount() {
8814
+ var this$1 = this;
8815
+ var update = this._update;
8816
+
8817
+ this._update = function (vnode, hydrating) {
8818
+ var restoreActiveInstance = setActiveInstance(this$1); // force removing pass
8819
+
8820
+ this$1.__patch__(this$1._vnode, this$1.kept, false, // hydrating
8821
+ true // removeOnly (!important, avoids unnecessary moves)
8822
+ );
8823
+
8824
+ this$1._vnode = this$1.kept;
8825
+ restoreActiveInstance();
8826
+ update.call(this$1, vnode, hydrating);
8827
+ };
8828
+ },
8829
+ render: function render(h) {
8830
+ var tag = this.tag || this.$vnode.data.tag || 'span';
8831
+ var map = Object.create(null);
8832
+ var prevChildren = this.prevChildren = this.children;
8833
+ var rawChildren = this.$slots["default"] || [];
8834
+ var children = this.children = [];
8835
+ var transitionData = extractTransitionData(this);
8836
+
8837
+ for (var i = 0; i < rawChildren.length; i++) {
8838
+ var c = rawChildren[i];
8839
+
8840
+ if (c.tag) {
8841
+ if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
8842
+ children.push(c);
8843
+ map[c.key] = c;
8844
+ (c.data || (c.data = {})).transition = transitionData;
8845
+ } else {
8846
+ var opts = c.componentOptions;
8847
+ var name = opts ? opts.Ctor.options.name || opts.tag || '' : c.tag;
8848
+ warn("<transition-group> children must be keyed: <" + name + ">");
8849
+ }
8850
+ }
8851
+ }
8852
+
8853
+ if (prevChildren) {
8854
+ var kept = [];
8855
+ var removed = [];
8856
+
8857
+ for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
8858
+ var c$1 = prevChildren[i$1];
8859
+ c$1.data.transition = transitionData;
8860
+ c$1.data.pos = c$1.elm.getBoundingClientRect();
8861
+
8862
+ if (map[c$1.key]) {
8863
+ kept.push(c$1);
8864
+ } else {
8865
+ removed.push(c$1);
8866
+ }
8867
+ }
8868
+
8869
+ this.kept = h(tag, null, kept);
8870
+ this.removed = removed;
8871
+ }
8872
+
8873
+ return h(tag, null, children);
8874
+ },
8875
+ updated: function updated() {
8876
+ var children = this.prevChildren;
8877
+ var moveClass = this.moveClass || (this.name || 'v') + '-move';
8878
+
8879
+ if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
8880
+ return;
8881
+ } // we divide the work into three loops to avoid mixing DOM reads and writes
8882
+ // in each iteration - which helps prevent layout thrashing.
8883
+
8884
+
8885
+ children.forEach(callPendingCbs);
8886
+ children.forEach(recordPosition);
8887
+ children.forEach(applyTranslation); // force reflow to put everything in position
8888
+ // assign to this to avoid being removed in tree-shaking
8889
+ // $flow-disable-line
8890
+
8891
+ this._reflow = document.body.offsetHeight;
8892
+ children.forEach(function (c) {
8893
+ if (c.data.moved) {
8894
+ var el = c.elm;
8895
+ var s = el.style;
8896
+ addTransitionClass(el, moveClass);
8897
+ s.transform = s.WebkitTransform = s.transitionDuration = '';
8898
+ el.addEventListener(transitionEndEvent, el._moveCb = function cb(e) {
8899
+ if (e && e.target !== el) {
8900
+ return;
8901
+ }
8902
+
8903
+ if (!e || /transform$/.test(e.propertyName)) {
8904
+ el.removeEventListener(transitionEndEvent, cb);
8905
+ el._moveCb = null;
8906
+ removeTransitionClass(el, moveClass);
8907
+ }
8908
+ });
8909
+ }
8910
+ });
8911
+ },
8912
+ methods: {
8913
+ hasMove: function hasMove(el, moveClass) {
8914
+ /* istanbul ignore if */
8915
+ if (!hasTransition) {
8916
+ return false;
8917
+ }
8918
+ /* istanbul ignore if */
8919
+
8920
+
8921
+ if (this._hasMove) {
8922
+ return this._hasMove;
8923
+ } // Detect whether an element with the move class applied has
8924
+ // CSS transitions. Since the element may be inside an entering
8925
+ // transition at this very moment, we make a clone of it and remove
8926
+ // all other transition classes applied to ensure only the move class
8927
+ // is applied.
8928
+
8929
+
8930
+ var clone = el.cloneNode();
8931
+
8932
+ if (el._transitionClasses) {
8933
+ el._transitionClasses.forEach(function (cls) {
8934
+ removeClass(clone, cls);
8935
+ });
8936
+ }
8937
+
8938
+ addClass(clone, moveClass);
8939
+ clone.style.display = 'none';
8940
+ this.$el.appendChild(clone);
8941
+ var info = getTransitionInfo(clone);
8942
+ this.$el.removeChild(clone);
8943
+ return this._hasMove = info.hasTransform;
8944
+ }
8945
+ }
8946
+ };
8947
+
8948
+ function callPendingCbs(c) {
8949
+ /* istanbul ignore if */
8950
+ if (c.elm._moveCb) {
8951
+ c.elm._moveCb();
8952
+ }
8953
+ /* istanbul ignore if */
8954
+
8955
+
8956
+ if (c.elm._enterCb) {
8957
+ c.elm._enterCb();
8958
+ }
8959
+ }
8960
+
8961
+ function recordPosition(c) {
8962
+ c.data.newPos = c.elm.getBoundingClientRect();
8963
+ }
8964
+
8965
+ function applyTranslation(c) {
8966
+ var oldPos = c.data.pos;
8967
+ var newPos = c.data.newPos;
8968
+ var dx = oldPos.left - newPos.left;
8969
+ var dy = oldPos.top - newPos.top;
8970
+
8971
+ if (dx || dy) {
8972
+ c.data.moved = true;
8973
+ var s = c.elm.style;
8974
+ s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
8975
+ s.transitionDuration = '0s';
8976
+ }
8977
+ }
8978
+
8979
+ var platformComponents = {
8980
+ Transition: Transition,
8981
+ TransitionGroup: TransitionGroup
8982
+ };
8983
+ /* */
8984
+ // install platform specific utils
8985
+
8986
+ Vue.config.mustUseProp = mustUseProp;
8987
+ Vue.config.isReservedTag = isReservedTag;
8988
+ Vue.config.isReservedAttr = isReservedAttr;
8989
+ Vue.config.getTagNamespace = getTagNamespace;
8990
+ Vue.config.isUnknownElement = isUnknownElement; // install platform runtime directives & components
8991
+
8992
+ extend(Vue.options.directives, platformDirectives);
8993
+ extend(Vue.options.components, platformComponents); // install platform patch function
8994
+
8995
+ Vue.prototype.__patch__ = inBrowser ? patch : noop; // public mount method
8996
+
8997
+ Vue.prototype.$mount = function (el, hydrating) {
8998
+ el = el && inBrowser ? query(el) : undefined;
8999
+ return mountComponent(this, el, hydrating);
9000
+ }; // devtools global hook
9001
+
9002
+ /* istanbul ignore next */
9003
+
9004
+
9005
+ if (inBrowser) {
9006
+ setTimeout(function () {
9007
+ if (config.devtools) {
9008
+ if (devtools) {
9009
+ devtools.emit('init', Vue);
9010
+ } else {
9011
+ console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' + 'https://github.com/vuejs/vue-devtools');
9012
+ }
9013
+ }
9014
+
9015
+ if (config.productionTip !== false && typeof console !== 'undefined') {
9016
+ console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" + "Make sure to turn on production mode when deploying for production.\n" + "See more tips at https://vuejs.org/guide/deployment.html");
9017
+ }
9018
+ }, 0);
9019
+ }
9020
+ /* */
9021
+
9022
+
9023
+ var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
9024
+ var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
9025
+ var buildRegex = cached(function (delimiters) {
9026
+ var open = delimiters[0].replace(regexEscapeRE, '\\$&');
9027
+ var close = delimiters[1].replace(regexEscapeRE, '\\$&');
9028
+ return new RegExp(open + '((?:.|\\n)+?)' + close, 'g');
9029
+ });
9030
+
9031
+ function parseText(text, delimiters) {
9032
+ var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
9033
+
9034
+ if (!tagRE.test(text)) {
9035
+ return;
9036
+ }
9037
+
9038
+ var tokens = [];
9039
+ var rawTokens = [];
9040
+ var lastIndex = tagRE.lastIndex = 0;
9041
+ var match, index, tokenValue;
9042
+
9043
+ while (match = tagRE.exec(text)) {
9044
+ index = match.index; // push text token
9045
+
9046
+ if (index > lastIndex) {
9047
+ rawTokens.push(tokenValue = text.slice(lastIndex, index));
9048
+ tokens.push(JSON.stringify(tokenValue));
9049
+ } // tag token
9050
+
9051
+
9052
+ var exp = parseFilters(match[1].trim());
9053
+ tokens.push("_s(" + exp + ")");
9054
+ rawTokens.push({
9055
+ '@binding': exp
9056
+ });
9057
+ lastIndex = index + match[0].length;
9058
+ }
9059
+
9060
+ if (lastIndex < text.length) {
9061
+ rawTokens.push(tokenValue = text.slice(lastIndex));
9062
+ tokens.push(JSON.stringify(tokenValue));
9063
+ }
9064
+
9065
+ return {
9066
+ expression: tokens.join('+'),
9067
+ tokens: rawTokens
9068
+ };
9069
+ }
9070
+ /* */
9071
+
9072
+
9073
+ function transformNode(el, options) {
9074
+ var warn = options.warn || baseWarn;
9075
+ var staticClass = getAndRemoveAttr(el, 'class');
9076
+
9077
+ if (staticClass) {
9078
+ var res = parseText(staticClass, options.delimiters);
9079
+
9080
+ if (res) {
9081
+ warn("class=\"" + staticClass + "\": " + 'Interpolation inside attributes has been removed. ' + 'Use v-bind or the colon shorthand instead. For example, ' + 'instead of <div class="{{ val }}">, use <div :class="val">.', el.rawAttrsMap['class']);
9082
+ }
9083
+ }
9084
+
9085
+ if (staticClass) {
9086
+ el.staticClass = JSON.stringify(staticClass);
9087
+ }
9088
+
9089
+ var classBinding = getBindingAttr(el, 'class', false
9090
+ /* getStatic */
9091
+ );
9092
+
9093
+ if (classBinding) {
9094
+ el.classBinding = classBinding;
9095
+ }
9096
+ }
9097
+
9098
+ function genData(el) {
9099
+ var data = '';
9100
+
9101
+ if (el.staticClass) {
9102
+ data += "staticClass:" + el.staticClass + ",";
9103
+ }
9104
+
9105
+ if (el.classBinding) {
9106
+ data += "class:" + el.classBinding + ",";
9107
+ }
9108
+
9109
+ return data;
9110
+ }
9111
+
9112
+ var klass$1 = {
9113
+ staticKeys: ['staticClass'],
9114
+ transformNode: transformNode,
9115
+ genData: genData
9116
+ };
9117
+ /* */
9118
+
9119
+ function transformNode$1(el, options) {
9120
+ var warn = options.warn || baseWarn;
9121
+ var staticStyle = getAndRemoveAttr(el, 'style');
9122
+
9123
+ if (staticStyle) {
9124
+ /* istanbul ignore if */
9125
+ {
9126
+ var res = parseText(staticStyle, options.delimiters);
9127
+
9128
+ if (res) {
9129
+ warn("style=\"" + staticStyle + "\": " + 'Interpolation inside attributes has been removed. ' + 'Use v-bind or the colon shorthand instead. For example, ' + 'instead of <div style="{{ val }}">, use <div :style="val">.', el.rawAttrsMap['style']);
9130
+ }
9131
+ }
9132
+ el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
9133
+ }
9134
+
9135
+ var styleBinding = getBindingAttr(el, 'style', false
9136
+ /* getStatic */
9137
+ );
9138
+
9139
+ if (styleBinding) {
9140
+ el.styleBinding = styleBinding;
9141
+ }
9142
+ }
9143
+
9144
+ function genData$1(el) {
9145
+ var data = '';
9146
+
9147
+ if (el.staticStyle) {
9148
+ data += "staticStyle:" + el.staticStyle + ",";
9149
+ }
9150
+
9151
+ if (el.styleBinding) {
9152
+ data += "style:(" + el.styleBinding + "),";
9153
+ }
9154
+
9155
+ return data;
9156
+ }
9157
+
9158
+ var style$1 = {
9159
+ staticKeys: ['staticStyle'],
9160
+ transformNode: transformNode$1,
9161
+ genData: genData$1
9162
+ };
9163
+ /* */
9164
+
9165
+ var decoder;
9166
+ var he = {
9167
+ decode: function decode(html) {
9168
+ decoder = decoder || document.createElement('div');
9169
+ decoder.innerHTML = html;
9170
+ return decoder.textContent;
9171
+ }
9172
+ };
9173
+ /* */
9174
+
9175
+ var isUnaryTag = makeMap('area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + 'link,meta,param,source,track,wbr'); // Elements that you can, intentionally, leave open
9176
+ // (and which close themselves)
9177
+
9178
+ var canBeLeftOpenTag = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'); // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
9179
+ // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
9180
+
9181
+ var isNonPhrasingTag = makeMap('address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + 'title,tr,track');
9182
+ /**
9183
+ * Not type-checking this file because it's mostly vendor code.
9184
+ */
9185
+ // Regular Expressions for parsing tags and attributes
9186
+
9187
+ var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9188
+ var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9189
+ var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + unicodeRegExp.source + "]*";
9190
+ var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
9191
+ var startTagOpen = new RegExp("^<" + qnameCapture);
9192
+ var startTagClose = /^\s*(\/?)>/;
9193
+ var endTag = new RegExp("^<\\/" + qnameCapture + "[^>]*>");
9194
+ var doctype = /^<!DOCTYPE [^>]+>/i; // #7298: escape - to avoid being passed as HTML comment when inlined in page
9195
+
9196
+ var comment = /^<!\--/;
9197
+ var conditionalComment = /^<!\[/; // Special Elements (can contain anything)
9198
+
9199
+ var isPlainTextElement = makeMap('script,style,textarea', true);
9200
+ var reCache = {};
9201
+ var decodingMap = {
9202
+ '&lt;': '<',
9203
+ '&gt;': '>',
9204
+ '&quot;': '"',
9205
+ '&amp;': '&',
9206
+ '&#10;': '\n',
9207
+ '&#9;': '\t',
9208
+ '&#39;': "'"
9209
+ };
9210
+ var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
9211
+ var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g; // #5992
9212
+
9213
+ var isIgnoreNewlineTag = makeMap('pre,textarea', true);
9214
+
9215
+ var shouldIgnoreFirstNewline = function shouldIgnoreFirstNewline(tag, html) {
9216
+ return tag && isIgnoreNewlineTag(tag) && html[0] === '\n';
9217
+ };
9218
+
9219
+ function decodeAttr(value, shouldDecodeNewlines) {
9220
+ var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
9221
+ return value.replace(re, function (match) {
9222
+ return decodingMap[match];
9223
+ });
9224
+ }
9225
+
9226
+ function parseHTML(html, options) {
9227
+ var stack = [];
9228
+ var expectHTML = options.expectHTML;
9229
+ var isUnaryTag$$1 = options.isUnaryTag || no;
9230
+ var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
9231
+ var index = 0;
9232
+ var last, lastTag;
9233
+
9234
+ while (html) {
9235
+ last = html; // Make sure we're not in a plaintext content element like script/style
9236
+
9237
+ if (!lastTag || !isPlainTextElement(lastTag)) {
9238
+ var textEnd = html.indexOf('<');
9239
+
9240
+ if (textEnd === 0) {
9241
+ // Comment:
9242
+ if (comment.test(html)) {
9243
+ var commentEnd = html.indexOf('-->');
9244
+
9245
+ if (commentEnd >= 0) {
9246
+ if (options.shouldKeepComment) {
9247
+ options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
9248
+ }
9249
+
9250
+ advance(commentEnd + 3);
9251
+ continue;
9252
+ }
9253
+ } // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
9254
+
9255
+
9256
+ if (conditionalComment.test(html)) {
9257
+ var conditionalEnd = html.indexOf(']>');
9258
+
9259
+ if (conditionalEnd >= 0) {
9260
+ advance(conditionalEnd + 2);
9261
+ continue;
9262
+ }
9263
+ } // Doctype:
9264
+
9265
+
9266
+ var doctypeMatch = html.match(doctype);
9267
+
9268
+ if (doctypeMatch) {
9269
+ advance(doctypeMatch[0].length);
9270
+ continue;
9271
+ } // End tag:
9272
+
9273
+
9274
+ var endTagMatch = html.match(endTag);
9275
+
9276
+ if (endTagMatch) {
9277
+ var curIndex = index;
9278
+ advance(endTagMatch[0].length);
9279
+ parseEndTag(endTagMatch[1], curIndex, index);
9280
+ continue;
9281
+ } // Start tag:
9282
+
9283
+
9284
+ var startTagMatch = parseStartTag();
9285
+
9286
+ if (startTagMatch) {
9287
+ handleStartTag(startTagMatch);
9288
+
9289
+ if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
9290
+ advance(1);
9291
+ }
9292
+
9293
+ continue;
9294
+ }
9295
+ }
9296
+
9297
+ var text = void 0,
9298
+ rest = void 0,
9299
+ next = void 0;
9300
+
9301
+ if (textEnd >= 0) {
9302
+ rest = html.slice(textEnd);
9303
+
9304
+ while (!endTag.test(rest) && !startTagOpen.test(rest) && !comment.test(rest) && !conditionalComment.test(rest)) {
9305
+ // < in plain text, be forgiving and treat it as text
9306
+ next = rest.indexOf('<', 1);
9307
+
9308
+ if (next < 0) {
9309
+ break;
9310
+ }
9311
+
9312
+ textEnd += next;
9313
+ rest = html.slice(textEnd);
9314
+ }
9315
+
9316
+ text = html.substring(0, textEnd);
9317
+ }
9318
+
9319
+ if (textEnd < 0) {
9320
+ text = html;
9321
+ }
9322
+
9323
+ if (text) {
9324
+ advance(text.length);
9325
+ }
9326
+
9327
+ if (options.chars && text) {
9328
+ options.chars(text, index - text.length, index);
9329
+ }
9330
+ } else {
9331
+ var endTagLength = 0;
9332
+ var stackedTag = lastTag.toLowerCase();
9333
+ var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
9334
+ var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
9335
+ endTagLength = endTag.length;
9336
+
9337
+ if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
9338
+ text = text.replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
9339
+ .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
9340
+ }
9341
+
9342
+ if (shouldIgnoreFirstNewline(stackedTag, text)) {
9343
+ text = text.slice(1);
9344
+ }
9345
+
9346
+ if (options.chars) {
9347
+ options.chars(text);
9348
+ }
9349
+
9350
+ return '';
9351
+ });
9352
+ index += html.length - rest$1.length;
9353
+ html = rest$1;
9354
+ parseEndTag(stackedTag, index - endTagLength, index);
9355
+ }
9356
+
9357
+ if (html === last) {
9358
+ options.chars && options.chars(html);
9359
+
9360
+ if (!stack.length && options.warn) {
9361
+ options.warn("Mal-formatted tag at end of template: \"" + html + "\"", {
9362
+ start: index + html.length
9363
+ });
9364
+ }
9365
+
9366
+ break;
9367
+ }
9368
+ } // Clean up any remaining tags
9369
+
9370
+
9371
+ parseEndTag();
9372
+
9373
+ function advance(n) {
9374
+ index += n;
9375
+ html = html.substring(n);
9376
+ }
9377
+
9378
+ function parseStartTag() {
9379
+ var start = html.match(startTagOpen);
9380
+
9381
+ if (start) {
9382
+ var match = {
9383
+ tagName: start[1],
9384
+ attrs: [],
9385
+ start: index
9386
+ };
9387
+ advance(start[0].length);
9388
+ var end, attr;
9389
+
9390
+ while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
9391
+ attr.start = index;
9392
+ advance(attr[0].length);
9393
+ attr.end = index;
9394
+ match.attrs.push(attr);
9395
+ }
9396
+
9397
+ if (end) {
9398
+ match.unarySlash = end[1];
9399
+ advance(end[0].length);
9400
+ match.end = index;
9401
+ return match;
9402
+ }
9403
+ }
9404
+ }
9405
+
9406
+ function handleStartTag(match) {
9407
+ var tagName = match.tagName;
9408
+ var unarySlash = match.unarySlash;
9409
+
9410
+ if (expectHTML) {
9411
+ if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
9412
+ parseEndTag(lastTag);
9413
+ }
9414
+
9415
+ if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
9416
+ parseEndTag(tagName);
9417
+ }
9418
+ }
9419
+
9420
+ var unary = isUnaryTag$$1(tagName) || !!unarySlash;
9421
+ var l = match.attrs.length;
9422
+ var attrs = new Array(l);
9423
+
9424
+ for (var i = 0; i < l; i++) {
9425
+ var args = match.attrs[i];
9426
+ var value = args[3] || args[4] || args[5] || '';
9427
+ var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' ? options.shouldDecodeNewlinesForHref : options.shouldDecodeNewlines;
9428
+ attrs[i] = {
9429
+ name: args[1],
9430
+ value: decodeAttr(value, shouldDecodeNewlines)
9431
+ };
9432
+
9433
+ if (options.outputSourceRange) {
9434
+ attrs[i].start = args.start + args[0].match(/^\s*/).length;
9435
+ attrs[i].end = args.end;
9436
+ }
9437
+ }
9438
+
9439
+ if (!unary) {
9440
+ stack.push({
9441
+ tag: tagName,
9442
+ lowerCasedTag: tagName.toLowerCase(),
9443
+ attrs: attrs,
9444
+ start: match.start,
9445
+ end: match.end
9446
+ });
9447
+ lastTag = tagName;
9448
+ }
9449
+
9450
+ if (options.start) {
9451
+ options.start(tagName, attrs, unary, match.start, match.end);
9452
+ }
9453
+ }
9454
+
9455
+ function parseEndTag(tagName, start, end) {
9456
+ var pos, lowerCasedTagName;
9457
+
9458
+ if (start == null) {
9459
+ start = index;
9460
+ }
9461
+
9462
+ if (end == null) {
9463
+ end = index;
9464
+ } // Find the closest opened tag of the same type
9465
+
9466
+
9467
+ if (tagName) {
9468
+ lowerCasedTagName = tagName.toLowerCase();
9469
+
9470
+ for (pos = stack.length - 1; pos >= 0; pos--) {
9471
+ if (stack[pos].lowerCasedTag === lowerCasedTagName) {
9472
+ break;
9473
+ }
9474
+ }
9475
+ } else {
9476
+ // If no tag name is provided, clean shop
9477
+ pos = 0;
9478
+ }
9479
+
9480
+ if (pos >= 0) {
9481
+ // Close all the open elements, up the stack
9482
+ for (var i = stack.length - 1; i >= pos; i--) {
9483
+ if (i > pos || !tagName && options.warn) {
9484
+ options.warn("tag <" + stack[i].tag + "> has no matching end tag.", {
9485
+ start: stack[i].start,
9486
+ end: stack[i].end
9487
+ });
9488
+ }
9489
+
9490
+ if (options.end) {
9491
+ options.end(stack[i].tag, start, end);
9492
+ }
9493
+ } // Remove the open elements from the stack
9494
+
9495
+
9496
+ stack.length = pos;
9497
+ lastTag = pos && stack[pos - 1].tag;
9498
+ } else if (lowerCasedTagName === 'br') {
9499
+ if (options.start) {
9500
+ options.start(tagName, [], true, start, end);
9501
+ }
9502
+ } else if (lowerCasedTagName === 'p') {
9503
+ if (options.start) {
9504
+ options.start(tagName, [], false, start, end);
9505
+ }
9506
+
9507
+ if (options.end) {
9508
+ options.end(tagName, start, end);
9509
+ }
9510
+ }
9511
+ }
9512
+ }
9513
+ /* */
9514
+
9515
+
9516
+ var onRE = /^@|^v-on:/;
9517
+ var dirRE = /^v-|^@|^:|^#/;
9518
+ var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
9519
+ var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
9520
+ var stripParensRE = /^\(|\)$/g;
9521
+ var dynamicArgRE = /^\[.*\]$/;
9522
+ var argRE = /:(.*)$/;
9523
+ var bindRE = /^:|^\.|^v-bind:/;
9524
+ var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
9525
+ var slotRE = /^v-slot(:|$)|^#/;
9526
+ var lineBreakRE = /[\r\n]/;
9527
+ var whitespaceRE$1 = /\s+/g;
9528
+ var invalidAttributeRE = /[\s"'<>\/=]/;
9529
+ var decodeHTMLCached = cached(he.decode);
9530
+ var emptySlotScopeToken = "_empty_"; // configurable state
9531
+
9532
+ var warn$2;
9533
+ var delimiters;
9534
+ var transforms;
9535
+ var preTransforms;
9536
+ var postTransforms;
9537
+ var platformIsPreTag;
9538
+ var platformMustUseProp;
9539
+ var platformGetTagNamespace;
9540
+ var maybeComponent;
9541
+
9542
+ function createASTElement(tag, attrs, parent) {
9543
+ return {
9544
+ type: 1,
9545
+ tag: tag,
9546
+ attrsList: attrs,
9547
+ attrsMap: makeAttrsMap(attrs),
9548
+ rawAttrsMap: {},
9549
+ parent: parent,
9550
+ children: []
9551
+ };
9552
+ }
9553
+ /**
9554
+ * Convert HTML string to AST.
9555
+ */
9556
+
9557
+
9558
+ function parse(template, options) {
9559
+ warn$2 = options.warn || baseWarn;
9560
+ platformIsPreTag = options.isPreTag || no;
9561
+ platformMustUseProp = options.mustUseProp || no;
9562
+ platformGetTagNamespace = options.getTagNamespace || no;
9563
+ var isReservedTag = options.isReservedTag || no;
9564
+
9565
+ maybeComponent = function maybeComponent(el) {
9566
+ return !!el.component || !isReservedTag(el.tag);
9567
+ };
9568
+
9569
+ transforms = pluckModuleFunction(options.modules, 'transformNode');
9570
+ preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
9571
+ postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
9572
+ delimiters = options.delimiters;
9573
+ var stack = [];
9574
+ var preserveWhitespace = options.preserveWhitespace !== false;
9575
+ var whitespaceOption = options.whitespace;
9576
+ var root;
9577
+ var currentParent;
9578
+ var inVPre = false;
9579
+ var inPre = false;
9580
+ var warned = false;
9581
+
9582
+ function warnOnce(msg, range) {
9583
+ if (!warned) {
9584
+ warned = true;
9585
+ warn$2(msg, range);
9586
+ }
9587
+ }
9588
+
9589
+ function closeElement(element) {
9590
+ trimEndingWhitespace(element);
9591
+
9592
+ if (!inVPre && !element.processed) {
9593
+ element = processElement(element, options);
9594
+ } // tree management
9595
+
9596
+
9597
+ if (!stack.length && element !== root) {
9598
+ // allow root elements with v-if, v-else-if and v-else
9599
+ if (root["if"] && (element.elseif || element["else"])) {
9600
+ {
9601
+ checkRootConstraints(element);
9602
+ }
9603
+ addIfCondition(root, {
9604
+ exp: element.elseif,
9605
+ block: element
9606
+ });
9607
+ } else {
9608
+ warnOnce("Component template should contain exactly one root element. " + "If you are using v-if on multiple elements, " + "use v-else-if to chain them instead.", {
9609
+ start: element.start
9610
+ });
9611
+ }
9612
+ }
9613
+
9614
+ if (currentParent && !element.forbidden) {
9615
+ if (element.elseif || element["else"]) {
9616
+ processIfConditions(element, currentParent);
9617
+ } else {
9618
+ if (element.slotScope) {
9619
+ // scoped slot
9620
+ // keep it in the children list so that v-else(-if) conditions can
9621
+ // find it as the prev node.
9622
+ var name = element.slotTarget || '"default"';
9623
+ (currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
9624
+ }
9625
+
9626
+ currentParent.children.push(element);
9627
+ element.parent = currentParent;
9628
+ }
9629
+ } // final children cleanup
9630
+ // filter out scoped slots
9631
+
9632
+
9633
+ element.children = element.children.filter(function (c) {
9634
+ return !c.slotScope;
9635
+ }); // remove trailing whitespace node again
9636
+
9637
+ trimEndingWhitespace(element); // check pre state
9638
+
9639
+ if (element.pre) {
9640
+ inVPre = false;
9641
+ }
9642
+
9643
+ if (platformIsPreTag(element.tag)) {
9644
+ inPre = false;
9645
+ } // apply post-transforms
9646
+
9647
+
9648
+ for (var i = 0; i < postTransforms.length; i++) {
9649
+ postTransforms[i](element, options);
9650
+ }
9651
+ }
9652
+
9653
+ function trimEndingWhitespace(el) {
9654
+ // remove trailing whitespace node
9655
+ if (!inPre) {
9656
+ var lastNode;
9657
+
9658
+ while ((lastNode = el.children[el.children.length - 1]) && lastNode.type === 3 && lastNode.text === ' ') {
9659
+ el.children.pop();
9660
+ }
9661
+ }
9662
+ }
9663
+
9664
+ function checkRootConstraints(el) {
9665
+ if (el.tag === 'slot' || el.tag === 'template') {
9666
+ warnOnce("Cannot use <" + el.tag + "> as component root element because it may " + 'contain multiple nodes.', {
9667
+ start: el.start
9668
+ });
9669
+ }
9670
+
9671
+ if (el.attrsMap.hasOwnProperty('v-for')) {
9672
+ warnOnce('Cannot use v-for on stateful component root element because ' + 'it renders multiple elements.', el.rawAttrsMap['v-for']);
9673
+ }
9674
+ }
9675
+
9676
+ parseHTML(template, {
9677
+ warn: warn$2,
9678
+ expectHTML: options.expectHTML,
9679
+ isUnaryTag: options.isUnaryTag,
9680
+ canBeLeftOpenTag: options.canBeLeftOpenTag,
9681
+ shouldDecodeNewlines: options.shouldDecodeNewlines,
9682
+ shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
9683
+ shouldKeepComment: options.comments,
9684
+ outputSourceRange: options.outputSourceRange,
9685
+ start: function start(tag, attrs, unary, start$1, end) {
9686
+ // check namespace.
9687
+ // inherit parent ns if there is one
9688
+ var ns = currentParent && currentParent.ns || platformGetTagNamespace(tag); // handle IE svg bug
9689
+
9690
+ /* istanbul ignore if */
9691
+
9692
+ if (isIE && ns === 'svg') {
9693
+ attrs = guardIESVGBug(attrs);
9694
+ }
9695
+
9696
+ var element = createASTElement(tag, attrs, currentParent);
9697
+
9698
+ if (ns) {
9699
+ element.ns = ns;
9700
+ }
9701
+
9702
+ {
9703
+ if (options.outputSourceRange) {
9704
+ element.start = start$1;
9705
+ element.end = end;
9706
+ element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
9707
+ cumulated[attr.name] = attr;
9708
+ return cumulated;
9709
+ }, {});
9710
+ }
9711
+
9712
+ attrs.forEach(function (attr) {
9713
+ if (invalidAttributeRE.test(attr.name)) {
9714
+ warn$2("Invalid dynamic argument expression: attribute names cannot contain " + "spaces, quotes, <, >, / or =.", {
9715
+ start: attr.start + attr.name.indexOf("["),
9716
+ end: attr.start + attr.name.length
9717
+ });
9718
+ }
9719
+ });
9720
+ }
9721
+
9722
+ if (isForbiddenTag(element) && !isServerRendering()) {
9723
+ element.forbidden = true;
9724
+ warn$2('Templates should only be responsible for mapping the state to the ' + 'UI. Avoid placing tags with side-effects in your templates, such as ' + "<" + tag + ">" + ', as they will not be parsed.', {
9725
+ start: element.start
9726
+ });
9727
+ } // apply pre-transforms
9728
+
9729
+
9730
+ for (var i = 0; i < preTransforms.length; i++) {
9731
+ element = preTransforms[i](element, options) || element;
9732
+ }
9733
+
9734
+ if (!inVPre) {
9735
+ processPre(element);
9736
+
9737
+ if (element.pre) {
9738
+ inVPre = true;
9739
+ }
9740
+ }
9741
+
9742
+ if (platformIsPreTag(element.tag)) {
9743
+ inPre = true;
9744
+ }
9745
+
9746
+ if (inVPre) {
9747
+ processRawAttrs(element);
9748
+ } else if (!element.processed) {
9749
+ // structural directives
9750
+ processFor(element);
9751
+ processIf(element);
9752
+ processOnce(element);
9753
+ }
9754
+
9755
+ if (!root) {
9756
+ root = element;
9757
+ {
9758
+ checkRootConstraints(root);
9759
+ }
9760
+ }
9761
+
9762
+ if (!unary) {
9763
+ currentParent = element;
9764
+ stack.push(element);
9765
+ } else {
9766
+ closeElement(element);
9767
+ }
9768
+ },
9769
+ end: function end(tag, start, end$1) {
9770
+ var element = stack[stack.length - 1]; // pop stack
9771
+
9772
+ stack.length -= 1;
9773
+ currentParent = stack[stack.length - 1];
9774
+
9775
+ if (options.outputSourceRange) {
9776
+ element.end = end$1;
9777
+ }
9778
+
9779
+ closeElement(element);
9780
+ },
9781
+ chars: function chars(text, start, end) {
9782
+ if (!currentParent) {
9783
+ {
9784
+ if (text === template) {
9785
+ warnOnce('Component template requires a root element, rather than just text.', {
9786
+ start: start
9787
+ });
9788
+ } else if (text = text.trim()) {
9789
+ warnOnce("text \"" + text + "\" outside root element will be ignored.", {
9790
+ start: start
9791
+ });
9792
+ }
9793
+ }
9794
+ return;
9795
+ } // IE textarea placeholder bug
9796
+
9797
+ /* istanbul ignore if */
9798
+
9799
+
9800
+ if (isIE && currentParent.tag === 'textarea' && currentParent.attrsMap.placeholder === text) {
9801
+ return;
9802
+ }
9803
+
9804
+ var children = currentParent.children;
9805
+
9806
+ if (inPre || text.trim()) {
9807
+ text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
9808
+ } else if (!children.length) {
9809
+ // remove the whitespace-only node right after an opening tag
9810
+ text = '';
9811
+ } else if (whitespaceOption) {
9812
+ if (whitespaceOption === 'condense') {
9813
+ // in condense mode, remove the whitespace node if it contains
9814
+ // line break, otherwise condense to a single space
9815
+ text = lineBreakRE.test(text) ? '' : ' ';
9816
+ } else {
9817
+ text = ' ';
9818
+ }
9819
+ } else {
9820
+ text = preserveWhitespace ? ' ' : '';
9821
+ }
9822
+
9823
+ if (text) {
9824
+ if (!inPre && whitespaceOption === 'condense') {
9825
+ // condense consecutive whitespaces into single space
9826
+ text = text.replace(whitespaceRE$1, ' ');
9827
+ }
9828
+
9829
+ var res;
9830
+ var child;
9831
+
9832
+ if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
9833
+ child = {
9834
+ type: 2,
9835
+ expression: res.expression,
9836
+ tokens: res.tokens,
9837
+ text: text
9838
+ };
9839
+ } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
9840
+ child = {
9841
+ type: 3,
9842
+ text: text
9843
+ };
9844
+ }
9845
+
9846
+ if (child) {
9847
+ if (options.outputSourceRange) {
9848
+ child.start = start;
9849
+ child.end = end;
9850
+ }
9851
+
9852
+ children.push(child);
9853
+ }
9854
+ }
9855
+ },
9856
+ comment: function comment(text, start, end) {
9857
+ // adding anything as a sibling to the root node is forbidden
9858
+ // comments should still be allowed, but ignored
9859
+ if (currentParent) {
9860
+ var child = {
9861
+ type: 3,
9862
+ text: text,
9863
+ isComment: true
9864
+ };
9865
+
9866
+ if (options.outputSourceRange) {
9867
+ child.start = start;
9868
+ child.end = end;
9869
+ }
9870
+
9871
+ currentParent.children.push(child);
9872
+ }
9873
+ }
9874
+ });
9875
+ return root;
9876
+ }
9877
+
9878
+ function processPre(el) {
9879
+ if (getAndRemoveAttr(el, 'v-pre') != null) {
9880
+ el.pre = true;
9881
+ }
9882
+ }
9883
+
9884
+ function processRawAttrs(el) {
9885
+ var list = el.attrsList;
9886
+ var len = list.length;
9887
+
9888
+ if (len) {
9889
+ var attrs = el.attrs = new Array(len);
9890
+
9891
+ for (var i = 0; i < len; i++) {
9892
+ attrs[i] = {
9893
+ name: list[i].name,
9894
+ value: JSON.stringify(list[i].value)
9895
+ };
9896
+
9897
+ if (list[i].start != null) {
9898
+ attrs[i].start = list[i].start;
9899
+ attrs[i].end = list[i].end;
9900
+ }
9901
+ }
9902
+ } else if (!el.pre) {
9903
+ // non root node in pre blocks with no attributes
9904
+ el.plain = true;
9905
+ }
9906
+ }
9907
+
9908
+ function processElement(element, options) {
9909
+ processKey(element); // determine whether this is a plain element after
9910
+ // removing structural attributes
9911
+
9912
+ element.plain = !element.key && !element.scopedSlots && !element.attrsList.length;
9913
+ processRef(element);
9914
+ processSlotContent(element);
9915
+ processSlotOutlet(element);
9916
+ processComponent(element);
9917
+
9918
+ for (var i = 0; i < transforms.length; i++) {
9919
+ element = transforms[i](element, options) || element;
9920
+ }
9921
+
9922
+ processAttrs(element);
9923
+ return element;
9924
+ }
9925
+
9926
+ function processKey(el) {
9927
+ var exp = getBindingAttr(el, 'key');
9928
+
9929
+ if (exp) {
9930
+ {
9931
+ if (el.tag === 'template') {
9932
+ warn$2("<template> cannot be keyed. Place the key on real elements instead.", getRawBindingAttr(el, 'key'));
9933
+ }
9934
+
9935
+ if (el["for"]) {
9936
+ var iterator = el.iterator2 || el.iterator1;
9937
+ var parent = el.parent;
9938
+
9939
+ if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
9940
+ warn$2("Do not use v-for index as key on <transition-group> children, " + "this is the same as not using keys.", getRawBindingAttr(el, 'key'), true
9941
+ /* tip */
9942
+ );
9943
+ }
9944
+ }
9945
+ }
9946
+ el.key = exp;
9947
+ }
9948
+ }
9949
+
9950
+ function processRef(el) {
9951
+ var ref = getBindingAttr(el, 'ref');
9952
+
9953
+ if (ref) {
9954
+ el.ref = ref;
9955
+ el.refInFor = checkInFor(el);
9956
+ }
9957
+ }
9958
+
9959
+ function processFor(el) {
9960
+ var exp;
9961
+
9962
+ if (exp = getAndRemoveAttr(el, 'v-for')) {
9963
+ var res = parseFor(exp);
9964
+
9965
+ if (res) {
9966
+ extend(el, res);
9967
+ } else {
9968
+ warn$2("Invalid v-for expression: " + exp, el.rawAttrsMap['v-for']);
9969
+ }
9970
+ }
9971
+ }
9972
+
9973
+ function parseFor(exp) {
9974
+ var inMatch = exp.match(forAliasRE);
9975
+
9976
+ if (!inMatch) {
9977
+ return;
9978
+ }
9979
+
9980
+ var res = {};
9981
+ res["for"] = inMatch[2].trim();
9982
+ var alias = inMatch[1].trim().replace(stripParensRE, '');
9983
+ var iteratorMatch = alias.match(forIteratorRE);
9984
+
9985
+ if (iteratorMatch) {
9986
+ res.alias = alias.replace(forIteratorRE, '').trim();
9987
+ res.iterator1 = iteratorMatch[1].trim();
9988
+
9989
+ if (iteratorMatch[2]) {
9990
+ res.iterator2 = iteratorMatch[2].trim();
9991
+ }
9992
+ } else {
9993
+ res.alias = alias;
9994
+ }
9995
+
9996
+ return res;
9997
+ }
9998
+
9999
+ function processIf(el) {
10000
+ var exp = getAndRemoveAttr(el, 'v-if');
10001
+
10002
+ if (exp) {
10003
+ el["if"] = exp;
10004
+ addIfCondition(el, {
10005
+ exp: exp,
10006
+ block: el
10007
+ });
10008
+ } else {
10009
+ if (getAndRemoveAttr(el, 'v-else') != null) {
10010
+ el["else"] = true;
10011
+ }
10012
+
10013
+ var elseif = getAndRemoveAttr(el, 'v-else-if');
10014
+
10015
+ if (elseif) {
10016
+ el.elseif = elseif;
10017
+ }
10018
+ }
10019
+ }
10020
+
10021
+ function processIfConditions(el, parent) {
10022
+ var prev = findPrevElement(parent.children);
10023
+
10024
+ if (prev && prev["if"]) {
10025
+ addIfCondition(prev, {
10026
+ exp: el.elseif,
10027
+ block: el
10028
+ });
10029
+ } else {
10030
+ warn$2("v-" + (el.elseif ? 'else-if="' + el.elseif + '"' : 'else') + " " + "used on element <" + el.tag + "> without corresponding v-if.", el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']);
10031
+ }
10032
+ }
10033
+
10034
+ function findPrevElement(children) {
10035
+ var i = children.length;
10036
+
10037
+ while (i--) {
10038
+ if (children[i].type === 1) {
10039
+ return children[i];
10040
+ } else {
10041
+ if (children[i].text !== ' ') {
10042
+ warn$2("text \"" + children[i].text.trim() + "\" between v-if and v-else(-if) " + "will be ignored.", children[i]);
10043
+ }
10044
+
10045
+ children.pop();
10046
+ }
10047
+ }
10048
+ }
10049
+
10050
+ function addIfCondition(el, condition) {
10051
+ if (!el.ifConditions) {
10052
+ el.ifConditions = [];
10053
+ }
10054
+
10055
+ el.ifConditions.push(condition);
10056
+ }
10057
+
10058
+ function processOnce(el) {
10059
+ var once$$1 = getAndRemoveAttr(el, 'v-once');
10060
+
10061
+ if (once$$1 != null) {
10062
+ el.once = true;
10063
+ }
10064
+ } // handle content being passed to a component as slot,
10065
+ // e.g. <template slot="xxx">, <div slot-scope="xxx">
10066
+
10067
+
10068
+ function processSlotContent(el) {
10069
+ var slotScope;
10070
+
10071
+ if (el.tag === 'template') {
10072
+ slotScope = getAndRemoveAttr(el, 'scope');
10073
+ /* istanbul ignore if */
10074
+
10075
+ if (slotScope) {
10076
+ warn$2("the \"scope\" attribute for scoped slots have been deprecated and " + "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + "can also be used on plain elements in addition to <template> to " + "denote scoped slots.", el.rawAttrsMap['scope'], true);
10077
+ }
10078
+
10079
+ el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
10080
+ } else if (slotScope = getAndRemoveAttr(el, 'slot-scope')) {
10081
+ /* istanbul ignore if */
10082
+ if (el.attrsMap['v-for']) {
10083
+ warn$2("Ambiguous combined usage of slot-scope and v-for on <" + el.tag + "> " + "(v-for takes higher priority). Use a wrapper <template> for the " + "scoped slot to make it clearer.", el.rawAttrsMap['slot-scope'], true);
10084
+ }
10085
+
10086
+ el.slotScope = slotScope;
10087
+ } // slot="xxx"
10088
+
10089
+
10090
+ var slotTarget = getBindingAttr(el, 'slot');
10091
+
10092
+ if (slotTarget) {
10093
+ el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
10094
+ el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']); // preserve slot as an attribute for native shadow DOM compat
10095
+ // only for non-scoped slots.
10096
+
10097
+ if (el.tag !== 'template' && !el.slotScope) {
10098
+ addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
10099
+ }
10100
+ } // 2.6 v-slot syntax
10101
+
10102
+
10103
+ {
10104
+ if (el.tag === 'template') {
10105
+ // v-slot on <template>
10106
+ var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
10107
+
10108
+ if (slotBinding) {
10109
+ {
10110
+ if (el.slotTarget || el.slotScope) {
10111
+ warn$2("Unexpected mixed usage of different slot syntaxes.", el);
10112
+ }
10113
+
10114
+ if (el.parent && !maybeComponent(el.parent)) {
10115
+ warn$2("<template v-slot> can only appear at the root level inside " + "the receiving component", el);
10116
+ }
10117
+ }
10118
+ var ref = getSlotName(slotBinding);
10119
+ var name = ref.name;
10120
+ var dynamic = ref.dynamic;
10121
+ el.slotTarget = name;
10122
+ el.slotTargetDynamic = dynamic;
10123
+ el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
10124
+ }
10125
+ } else {
10126
+ // v-slot on component, denotes default slot
10127
+ var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
10128
+
10129
+ if (slotBinding$1) {
10130
+ {
10131
+ if (!maybeComponent(el)) {
10132
+ warn$2("v-slot can only be used on components or <template>.", slotBinding$1);
10133
+ }
10134
+
10135
+ if (el.slotScope || el.slotTarget) {
10136
+ warn$2("Unexpected mixed usage of different slot syntaxes.", el);
10137
+ }
10138
+
10139
+ if (el.scopedSlots) {
10140
+ warn$2("To avoid scope ambiguity, the default slot should also use " + "<template> syntax when there are other named slots.", slotBinding$1);
10141
+ }
10142
+ } // add the component's children to its default slot
10143
+
10144
+ var slots = el.scopedSlots || (el.scopedSlots = {});
10145
+ var ref$1 = getSlotName(slotBinding$1);
10146
+ var name$1 = ref$1.name;
10147
+ var dynamic$1 = ref$1.dynamic;
10148
+ var slotContainer = slots[name$1] = createASTElement('template', [], el);
10149
+ slotContainer.slotTarget = name$1;
10150
+ slotContainer.slotTargetDynamic = dynamic$1;
10151
+ slotContainer.children = el.children.filter(function (c) {
10152
+ if (!c.slotScope) {
10153
+ c.parent = slotContainer;
10154
+ return true;
10155
+ }
10156
+ });
10157
+ slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken; // remove children as they are returned from scopedSlots now
10158
+
10159
+ el.children = []; // mark el non-plain so data gets generated
10160
+
10161
+ el.plain = false;
10162
+ }
10163
+ }
10164
+ }
10165
+ }
10166
+
10167
+ function getSlotName(binding) {
10168
+ var name = binding.name.replace(slotRE, '');
10169
+
10170
+ if (!name) {
10171
+ if (binding.name[0] !== '#') {
10172
+ name = 'default';
10173
+ } else {
10174
+ warn$2("v-slot shorthand syntax requires a slot name.", binding);
10175
+ }
10176
+ }
10177
+
10178
+ return dynamicArgRE.test(name) // dynamic [name]
10179
+ ? {
10180
+ name: name.slice(1, -1),
10181
+ dynamic: true
10182
+ } // static name
10183
+ : {
10184
+ name: "\"" + name + "\"",
10185
+ dynamic: false
10186
+ };
10187
+ } // handle <slot/> outlets
10188
+
10189
+
10190
+ function processSlotOutlet(el) {
10191
+ if (el.tag === 'slot') {
10192
+ el.slotName = getBindingAttr(el, 'name');
10193
+
10194
+ if (el.key) {
10195
+ warn$2("`key` does not work on <slot> because slots are abstract outlets " + "and can possibly expand into multiple elements. " + "Use the key on a wrapping element instead.", getRawBindingAttr(el, 'key'));
10196
+ }
10197
+ }
10198
+ }
10199
+
10200
+ function processComponent(el) {
10201
+ var binding;
10202
+
10203
+ if (binding = getBindingAttr(el, 'is')) {
10204
+ el.component = binding;
10205
+ }
10206
+
10207
+ if (getAndRemoveAttr(el, 'inline-template') != null) {
10208
+ el.inlineTemplate = true;
10209
+ }
10210
+ }
10211
+
10212
+ function processAttrs(el) {
10213
+ var list = el.attrsList;
10214
+ var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
10215
+
10216
+ for (i = 0, l = list.length; i < l; i++) {
10217
+ name = rawName = list[i].name;
10218
+ value = list[i].value;
10219
+
10220
+ if (dirRE.test(name)) {
10221
+ // mark element as dynamic
10222
+ el.hasBindings = true; // modifiers
10223
+
10224
+ modifiers = parseModifiers(name.replace(dirRE, '')); // support .foo shorthand syntax for the .prop modifier
10225
+
10226
+ if (modifiers) {
10227
+ name = name.replace(modifierRE, '');
10228
+ }
10229
+
10230
+ if (bindRE.test(name)) {
10231
+ // v-bind
10232
+ name = name.replace(bindRE, '');
10233
+ value = parseFilters(value);
10234
+ isDynamic = dynamicArgRE.test(name);
10235
+
10236
+ if (isDynamic) {
10237
+ name = name.slice(1, -1);
10238
+ }
10239
+
10240
+ if (value.trim().length === 0) {
10241
+ warn$2("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"");
10242
+ }
10243
+
10244
+ if (modifiers) {
10245
+ if (modifiers.prop && !isDynamic) {
10246
+ name = camelize(name);
10247
+
10248
+ if (name === 'innerHtml') {
10249
+ name = 'innerHTML';
10250
+ }
10251
+ }
10252
+
10253
+ if (modifiers.camel && !isDynamic) {
10254
+ name = camelize(name);
10255
+ }
10256
+
10257
+ if (modifiers.sync) {
10258
+ syncGen = genAssignmentCode(value, "$event");
10259
+
10260
+ if (!isDynamic) {
10261
+ addHandler(el, "update:" + camelize(name), syncGen, null, false, warn$2, list[i]);
10262
+
10263
+ if (hyphenate(name) !== camelize(name)) {
10264
+ addHandler(el, "update:" + hyphenate(name), syncGen, null, false, warn$2, list[i]);
10265
+ }
10266
+ } else {
10267
+ // handler w/ dynamic event name
10268
+ addHandler(el, "\"update:\"+(" + name + ")", syncGen, null, false, warn$2, list[i], true // dynamic
10269
+ );
10270
+ }
10271
+ }
10272
+ }
10273
+
10274
+ if (modifiers && modifiers.prop || !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)) {
10275
+ addProp(el, name, value, list[i], isDynamic);
10276
+ } else {
10277
+ addAttr(el, name, value, list[i], isDynamic);
10278
+ }
10279
+ } else if (onRE.test(name)) {
10280
+ // v-on
10281
+ name = name.replace(onRE, '');
10282
+ isDynamic = dynamicArgRE.test(name);
10283
+
10284
+ if (isDynamic) {
10285
+ name = name.slice(1, -1);
10286
+ }
10287
+
10288
+ addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
10289
+ } else {
10290
+ // normal directives
10291
+ name = name.replace(dirRE, ''); // parse arg
10292
+
10293
+ var argMatch = name.match(argRE);
10294
+ var arg = argMatch && argMatch[1];
10295
+ isDynamic = false;
10296
+
10297
+ if (arg) {
10298
+ name = name.slice(0, -(arg.length + 1));
10299
+
10300
+ if (dynamicArgRE.test(arg)) {
10301
+ arg = arg.slice(1, -1);
10302
+ isDynamic = true;
10303
+ }
10304
+ }
10305
+
10306
+ addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
10307
+
10308
+ if (name === 'model') {
10309
+ checkForAliasModel(el, value);
10310
+ }
10311
+ }
10312
+ } else {
10313
+ // literal attribute
10314
+ {
10315
+ var res = parseText(value, delimiters);
10316
+
10317
+ if (res) {
10318
+ warn$2(name + "=\"" + value + "\": " + 'Interpolation inside attributes has been removed. ' + 'Use v-bind or the colon shorthand instead. For example, ' + 'instead of <div id="{{ val }}">, use <div :id="val">.', list[i]);
10319
+ }
10320
+ }
10321
+ addAttr(el, name, JSON.stringify(value), list[i]); // #6887 firefox doesn't update muted state if set via attribute
10322
+ // even immediately after element creation
10323
+
10324
+ if (!el.component && name === 'muted' && platformMustUseProp(el.tag, el.attrsMap.type, name)) {
10325
+ addProp(el, name, 'true', list[i]);
10326
+ }
10327
+ }
10328
+ }
10329
+ }
10330
+
10331
+ function checkInFor(el) {
10332
+ var parent = el;
10333
+
10334
+ while (parent) {
10335
+ if (parent["for"] !== undefined) {
10336
+ return true;
10337
+ }
10338
+
10339
+ parent = parent.parent;
10340
+ }
10341
+
10342
+ return false;
10343
+ }
10344
+
10345
+ function parseModifiers(name) {
10346
+ var match = name.match(modifierRE);
10347
+
10348
+ if (match) {
10349
+ var ret = {};
10350
+ match.forEach(function (m) {
10351
+ ret[m.slice(1)] = true;
10352
+ });
10353
+ return ret;
10354
+ }
10355
+ }
10356
+
10357
+ function makeAttrsMap(attrs) {
10358
+ var map = {};
10359
+
10360
+ for (var i = 0, l = attrs.length; i < l; i++) {
10361
+ if (map[attrs[i].name] && !isIE && !isEdge) {
10362
+ warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
10363
+ }
10364
+
10365
+ map[attrs[i].name] = attrs[i].value;
10366
+ }
10367
+
10368
+ return map;
10369
+ } // for script (e.g. type="x/template") or style, do not decode content
10370
+
10371
+
10372
+ function isTextTag(el) {
10373
+ return el.tag === 'script' || el.tag === 'style';
10374
+ }
10375
+
10376
+ function isForbiddenTag(el) {
10377
+ return el.tag === 'style' || el.tag === 'script' && (!el.attrsMap.type || el.attrsMap.type === 'text/javascript');
10378
+ }
10379
+
10380
+ var ieNSBug = /^xmlns:NS\d+/;
10381
+ var ieNSPrefix = /^NS\d+:/;
10382
+ /* istanbul ignore next */
10383
+
10384
+ function guardIESVGBug(attrs) {
10385
+ var res = [];
10386
+
10387
+ for (var i = 0; i < attrs.length; i++) {
10388
+ var attr = attrs[i];
10389
+
10390
+ if (!ieNSBug.test(attr.name)) {
10391
+ attr.name = attr.name.replace(ieNSPrefix, '');
10392
+ res.push(attr);
10393
+ }
10394
+ }
10395
+
10396
+ return res;
10397
+ }
10398
+
10399
+ function checkForAliasModel(el, value) {
10400
+ var _el = el;
10401
+
10402
+ while (_el) {
10403
+ if (_el["for"] && _el.alias === value) {
10404
+ warn$2("<" + el.tag + " v-model=\"" + value + "\">: " + "You are binding v-model directly to a v-for iteration alias. " + "This will not be able to modify the v-for source array because " + "writing to the alias is like modifying a function local variable. " + "Consider using an array of objects and use v-model on an object property instead.", el.rawAttrsMap['v-model']);
10405
+ }
10406
+
10407
+ _el = _el.parent;
10408
+ }
10409
+ }
10410
+ /* */
10411
+
10412
+
10413
+ function preTransformNode(el, options) {
10414
+ if (el.tag === 'input') {
10415
+ var map = el.attrsMap;
10416
+
10417
+ if (!map['v-model']) {
10418
+ return;
10419
+ }
10420
+
10421
+ var typeBinding;
10422
+
10423
+ if (map[':type'] || map['v-bind:type']) {
10424
+ typeBinding = getBindingAttr(el, 'type');
10425
+ }
10426
+
10427
+ if (!map.type && !typeBinding && map['v-bind']) {
10428
+ typeBinding = "(" + map['v-bind'] + ").type";
10429
+ }
10430
+
10431
+ if (typeBinding) {
10432
+ var ifCondition = getAndRemoveAttr(el, 'v-if', true);
10433
+ var ifConditionExtra = ifCondition ? "&&(" + ifCondition + ")" : "";
10434
+ var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
10435
+ var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); // 1. checkbox
10436
+
10437
+ var branch0 = cloneASTElement(el); // process for on the main node
10438
+
10439
+ processFor(branch0);
10440
+ addRawAttr(branch0, 'type', 'checkbox');
10441
+ processElement(branch0, options);
10442
+ branch0.processed = true; // prevent it from double-processed
10443
+
10444
+ branch0["if"] = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
10445
+ addIfCondition(branch0, {
10446
+ exp: branch0["if"],
10447
+ block: branch0
10448
+ }); // 2. add radio else-if condition
10449
+
10450
+ var branch1 = cloneASTElement(el);
10451
+ getAndRemoveAttr(branch1, 'v-for', true);
10452
+ addRawAttr(branch1, 'type', 'radio');
10453
+ processElement(branch1, options);
10454
+ addIfCondition(branch0, {
10455
+ exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
10456
+ block: branch1
10457
+ }); // 3. other
10458
+
10459
+ var branch2 = cloneASTElement(el);
10460
+ getAndRemoveAttr(branch2, 'v-for', true);
10461
+ addRawAttr(branch2, ':type', typeBinding);
10462
+ processElement(branch2, options);
10463
+ addIfCondition(branch0, {
10464
+ exp: ifCondition,
10465
+ block: branch2
10466
+ });
10467
+
10468
+ if (hasElse) {
10469
+ branch0["else"] = true;
10470
+ } else if (elseIfCondition) {
10471
+ branch0.elseif = elseIfCondition;
10472
+ }
10473
+
10474
+ return branch0;
10475
+ }
10476
+ }
10477
+ }
10478
+
10479
+ function cloneASTElement(el) {
10480
+ return createASTElement(el.tag, el.attrsList.slice(), el.parent);
10481
+ }
10482
+
10483
+ var model$1 = {
10484
+ preTransformNode: preTransformNode
10485
+ };
10486
+ var modules$1 = [klass$1, style$1, model$1];
10487
+ /* */
10488
+
10489
+ function text(el, dir) {
10490
+ if (dir.value) {
10491
+ addProp(el, 'textContent', "_s(" + dir.value + ")", dir);
10492
+ }
10493
+ }
10494
+ /* */
10495
+
10496
+
10497
+ function html(el, dir) {
10498
+ if (dir.value) {
10499
+ addProp(el, 'innerHTML', "_s(" + dir.value + ")", dir);
10500
+ }
10501
+ }
10502
+
10503
+ var directives$1 = {
10504
+ model: model,
10505
+ text: text,
10506
+ html: html
10507
+ };
10508
+ /* */
10509
+
10510
+ var baseOptions = {
10511
+ expectHTML: true,
10512
+ modules: modules$1,
10513
+ directives: directives$1,
10514
+ isPreTag: isPreTag,
10515
+ isUnaryTag: isUnaryTag,
10516
+ mustUseProp: mustUseProp,
10517
+ canBeLeftOpenTag: canBeLeftOpenTag,
10518
+ isReservedTag: isReservedTag,
10519
+ getTagNamespace: getTagNamespace,
10520
+ staticKeys: genStaticKeys(modules$1)
10521
+ };
10522
+ /* */
10523
+
10524
+ var isStaticKey;
10525
+ var isPlatformReservedTag;
10526
+ var genStaticKeysCached = cached(genStaticKeys$1);
10527
+ /**
10528
+ * Goal of the optimizer: walk the generated template AST tree
10529
+ * and detect sub-trees that are purely static, i.e. parts of
10530
+ * the DOM that never needs to change.
10531
+ *
10532
+ * Once we detect these sub-trees, we can:
10533
+ *
10534
+ * 1. Hoist them into constants, so that we no longer need to
10535
+ * create fresh nodes for them on each re-render;
10536
+ * 2. Completely skip them in the patching process.
10537
+ */
10538
+
10539
+ function optimize(root, options) {
10540
+ if (!root) {
10541
+ return;
10542
+ }
10543
+
10544
+ isStaticKey = genStaticKeysCached(options.staticKeys || '');
10545
+ isPlatformReservedTag = options.isReservedTag || no; // first pass: mark all non-static nodes.
10546
+
10547
+ markStatic$1(root); // second pass: mark static roots.
10548
+
10549
+ markStaticRoots(root, false);
10550
+ }
10551
+
10552
+ function genStaticKeys$1(keys) {
10553
+ return makeMap('type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' + (keys ? ',' + keys : ''));
10554
+ }
10555
+
10556
+ function markStatic$1(node) {
10557
+ node["static"] = isStatic(node);
10558
+
10559
+ if (node.type === 1) {
10560
+ // do not make component slot content static. this avoids
10561
+ // 1. components not able to mutate slot nodes
10562
+ // 2. static slot content fails for hot-reloading
10563
+ if (!isPlatformReservedTag(node.tag) && node.tag !== 'slot' && node.attrsMap['inline-template'] == null) {
10564
+ return;
10565
+ }
10566
+
10567
+ for (var i = 0, l = node.children.length; i < l; i++) {
10568
+ var child = node.children[i];
10569
+ markStatic$1(child);
10570
+
10571
+ if (!child["static"]) {
10572
+ node["static"] = false;
10573
+ }
10574
+ }
10575
+
10576
+ if (node.ifConditions) {
10577
+ for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
10578
+ var block = node.ifConditions[i$1].block;
10579
+ markStatic$1(block);
10580
+
10581
+ if (!block["static"]) {
10582
+ node["static"] = false;
10583
+ }
10584
+ }
10585
+ }
10586
+ }
10587
+ }
10588
+
10589
+ function markStaticRoots(node, isInFor) {
10590
+ if (node.type === 1) {
10591
+ if (node["static"] || node.once) {
10592
+ node.staticInFor = isInFor;
10593
+ } // For a node to qualify as a static root, it should have children that
10594
+ // are not just static text. Otherwise the cost of hoisting out will
10595
+ // outweigh the benefits and it's better off to just always render it fresh.
10596
+
10597
+
10598
+ if (node["static"] && node.children.length && !(node.children.length === 1 && node.children[0].type === 3)) {
10599
+ node.staticRoot = true;
10600
+ return;
10601
+ } else {
10602
+ node.staticRoot = false;
10603
+ }
10604
+
10605
+ if (node.children) {
10606
+ for (var i = 0, l = node.children.length; i < l; i++) {
10607
+ markStaticRoots(node.children[i], isInFor || !!node["for"]);
10608
+ }
10609
+ }
10610
+
10611
+ if (node.ifConditions) {
10612
+ for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
10613
+ markStaticRoots(node.ifConditions[i$1].block, isInFor);
10614
+ }
10615
+ }
10616
+ }
10617
+ }
10618
+
10619
+ function isStatic(node) {
10620
+ if (node.type === 2) {
10621
+ // expression
10622
+ return false;
10623
+ }
10624
+
10625
+ if (node.type === 3) {
10626
+ // text
10627
+ return true;
10628
+ }
10629
+
10630
+ return !!(node.pre || !node.hasBindings && // no dynamic bindings
10631
+ !node["if"] && !node["for"] && // not v-if or v-for or v-else
10632
+ !isBuiltInTag(node.tag) && // not a built-in
10633
+ isPlatformReservedTag(node.tag) && // not a component
10634
+ !isDirectChildOfTemplateFor(node) && Object.keys(node).every(isStaticKey));
10635
+ }
10636
+
10637
+ function isDirectChildOfTemplateFor(node) {
10638
+ while (node.parent) {
10639
+ node = node.parent;
10640
+
10641
+ if (node.tag !== 'template') {
10642
+ return false;
10643
+ }
10644
+
10645
+ if (node["for"]) {
10646
+ return true;
10647
+ }
10648
+ }
10649
+
10650
+ return false;
10651
+ }
10652
+ /* */
10653
+
10654
+
10655
+ var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
10656
+ var fnInvokeRE = /\([^)]*?\);*$/;
10657
+ var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; // KeyboardEvent.keyCode aliases
10658
+
10659
+ var keyCodes = {
10660
+ esc: 27,
10661
+ tab: 9,
10662
+ enter: 13,
10663
+ space: 32,
10664
+ up: 38,
10665
+ left: 37,
10666
+ right: 39,
10667
+ down: 40,
10668
+ 'delete': [8, 46]
10669
+ }; // KeyboardEvent.key aliases
10670
+
10671
+ var keyNames = {
10672
+ // #7880: IE11 and Edge use `Esc` for Escape key name.
10673
+ esc: ['Esc', 'Escape'],
10674
+ tab: 'Tab',
10675
+ enter: 'Enter',
10676
+ // #9112: IE11 uses `Spacebar` for Space key name.
10677
+ space: [' ', 'Spacebar'],
10678
+ // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
10679
+ up: ['Up', 'ArrowUp'],
10680
+ left: ['Left', 'ArrowLeft'],
10681
+ right: ['Right', 'ArrowRight'],
10682
+ down: ['Down', 'ArrowDown'],
10683
+ // #9112: IE11 uses `Del` for Delete key name.
10684
+ 'delete': ['Backspace', 'Delete', 'Del']
10685
+ }; // #4868: modifiers that prevent the execution of the listener
10686
+ // need to explicitly return null so that we can determine whether to remove
10687
+ // the listener for .once
10688
+
10689
+ var genGuard = function genGuard(condition) {
10690
+ return "if(" + condition + ")return null;";
10691
+ };
10692
+
10693
+ var modifierCode = {
10694
+ stop: '$event.stopPropagation();',
10695
+ prevent: '$event.preventDefault();',
10696
+ self: genGuard("$event.target !== $event.currentTarget"),
10697
+ ctrl: genGuard("!$event.ctrlKey"),
10698
+ shift: genGuard("!$event.shiftKey"),
10699
+ alt: genGuard("!$event.altKey"),
10700
+ meta: genGuard("!$event.metaKey"),
10701
+ left: genGuard("'button' in $event && $event.button !== 0"),
10702
+ middle: genGuard("'button' in $event && $event.button !== 1"),
10703
+ right: genGuard("'button' in $event && $event.button !== 2")
10704
+ };
10705
+
10706
+ function genHandlers(events, isNative) {
10707
+ var prefix = isNative ? 'nativeOn:' : 'on:';
10708
+ var staticHandlers = "";
10709
+ var dynamicHandlers = "";
10710
+
10711
+ for (var name in events) {
10712
+ var handlerCode = genHandler(events[name]);
10713
+
10714
+ if (events[name] && events[name].dynamic) {
10715
+ dynamicHandlers += name + "," + handlerCode + ",";
10716
+ } else {
10717
+ staticHandlers += "\"" + name + "\":" + handlerCode + ",";
10718
+ }
10719
+ }
10720
+
10721
+ staticHandlers = "{" + staticHandlers.slice(0, -1) + "}";
10722
+
10723
+ if (dynamicHandlers) {
10724
+ return prefix + "_d(" + staticHandlers + ",[" + dynamicHandlers.slice(0, -1) + "])";
10725
+ } else {
10726
+ return prefix + staticHandlers;
10727
+ }
10728
+ }
10729
+
10730
+ function genHandler(handler) {
10731
+ if (!handler) {
10732
+ return 'function(){}';
10733
+ }
10734
+
10735
+ if (Array.isArray(handler)) {
10736
+ return "[" + handler.map(function (handler) {
10737
+ return genHandler(handler);
10738
+ }).join(',') + "]";
10739
+ }
10740
+
10741
+ var isMethodPath = simplePathRE.test(handler.value);
10742
+ var isFunctionExpression = fnExpRE.test(handler.value);
10743
+ var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
10744
+
10745
+ if (!handler.modifiers) {
10746
+ if (isMethodPath || isFunctionExpression) {
10747
+ return handler.value;
10748
+ }
10749
+
10750
+ return "function($event){" + (isFunctionInvocation ? "return " + handler.value : handler.value) + "}"; // inline statement
10751
+ } else {
10752
+ var code = '';
10753
+ var genModifierCode = '';
10754
+ var keys = [];
10755
+
10756
+ for (var key in handler.modifiers) {
10757
+ if (modifierCode[key]) {
10758
+ genModifierCode += modifierCode[key]; // left/right
10759
+
10760
+ if (keyCodes[key]) {
10761
+ keys.push(key);
10762
+ }
10763
+ } else if (key === 'exact') {
10764
+ var modifiers = handler.modifiers;
10765
+ genModifierCode += genGuard(['ctrl', 'shift', 'alt', 'meta'].filter(function (keyModifier) {
10766
+ return !modifiers[keyModifier];
10767
+ }).map(function (keyModifier) {
10768
+ return "$event." + keyModifier + "Key";
10769
+ }).join('||'));
10770
+ } else {
10771
+ keys.push(key);
10772
+ }
10773
+ }
10774
+
10775
+ if (keys.length) {
10776
+ code += genKeyFilter(keys);
10777
+ } // Make sure modifiers like prevent and stop get executed after key filtering
10778
+
10779
+
10780
+ if (genModifierCode) {
10781
+ code += genModifierCode;
10782
+ }
10783
+
10784
+ var handlerCode = isMethodPath ? "return " + handler.value + "($event)" : isFunctionExpression ? "return (" + handler.value + ")($event)" : isFunctionInvocation ? "return " + handler.value : handler.value;
10785
+ return "function($event){" + code + handlerCode + "}";
10786
+ }
10787
+ }
10788
+
10789
+ function genKeyFilter(keys) {
10790
+ return (// make sure the key filters only apply to KeyboardEvents
10791
+ // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
10792
+ // key events that do not have keyCode property...
10793
+ "if(!$event.type.indexOf('key')&&" + keys.map(genFilterCode).join('&&') + ")return null;"
10794
+ );
10795
+ }
10796
+
10797
+ function genFilterCode(key) {
10798
+ var keyVal = parseInt(key, 10);
10799
+
10800
+ if (keyVal) {
10801
+ return "$event.keyCode!==" + keyVal;
10802
+ }
10803
+
10804
+ var keyCode = keyCodes[key];
10805
+ var keyName = keyNames[key];
10806
+ return "_k($event.keyCode," + JSON.stringify(key) + "," + JSON.stringify(keyCode) + "," + "$event.key," + "" + JSON.stringify(keyName) + ")";
10807
+ }
10808
+ /* */
10809
+
10810
+
10811
+ function on(el, dir) {
10812
+ if (dir.modifiers) {
10813
+ warn("v-on without argument does not support modifiers.");
10814
+ }
10815
+
10816
+ el.wrapListeners = function (code) {
10817
+ return "_g(" + code + "," + dir.value + ")";
10818
+ };
10819
+ }
10820
+ /* */
10821
+
10822
+
10823
+ function bind$1(el, dir) {
10824
+ el.wrapData = function (code) {
10825
+ return "_b(" + code + ",'" + el.tag + "'," + dir.value + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")";
10826
+ };
10827
+ }
10828
+ /* */
10829
+
10830
+
10831
+ var baseDirectives = {
10832
+ on: on,
10833
+ bind: bind$1,
10834
+ cloak: noop
10835
+ };
10836
+ /* */
10837
+
10838
+ var CodegenState = function CodegenState(options) {
10839
+ this.options = options;
10840
+ this.warn = options.warn || baseWarn;
10841
+ this.transforms = pluckModuleFunction(options.modules, 'transformCode');
10842
+ this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
10843
+ this.directives = extend(extend({}, baseDirectives), options.directives);
10844
+ var isReservedTag = options.isReservedTag || no;
10845
+
10846
+ this.maybeComponent = function (el) {
10847
+ return !!el.component || !isReservedTag(el.tag);
10848
+ };
10849
+
10850
+ this.onceId = 0;
10851
+ this.staticRenderFns = [];
10852
+ this.pre = false;
10853
+ };
10854
+
10855
+ function generate(ast, options) {
10856
+ var state = new CodegenState(options);
10857
+ var code = ast ? genElement(ast, state) : '_c("div")';
10858
+ return {
10859
+ render: "with(this){return " + code + "}",
10860
+ staticRenderFns: state.staticRenderFns
10861
+ };
10862
+ }
10863
+
10864
+ function genElement(el, state) {
10865
+ if (el.parent) {
10866
+ el.pre = el.pre || el.parent.pre;
10867
+ }
10868
+
10869
+ if (el.staticRoot && !el.staticProcessed) {
10870
+ return genStatic(el, state);
10871
+ } else if (el.once && !el.onceProcessed) {
10872
+ return genOnce(el, state);
10873
+ } else if (el["for"] && !el.forProcessed) {
10874
+ return genFor(el, state);
10875
+ } else if (el["if"] && !el.ifProcessed) {
10876
+ return genIf(el, state);
10877
+ } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
10878
+ return genChildren(el, state) || 'void 0';
10879
+ } else if (el.tag === 'slot') {
10880
+ return genSlot(el, state);
10881
+ } else {
10882
+ // component or element
10883
+ var code;
10884
+
10885
+ if (el.component) {
10886
+ code = genComponent(el.component, el, state);
10887
+ } else {
10888
+ var data;
10889
+
10890
+ if (!el.plain || el.pre && state.maybeComponent(el)) {
10891
+ data = genData$2(el, state);
10892
+ }
10893
+
10894
+ var children = el.inlineTemplate ? null : genChildren(el, state, true);
10895
+ code = "_c('" + el.tag + "'" + (data ? "," + data : '') + (children ? "," + children : '') + ")";
10896
+ } // module transforms
10897
+
10898
+
10899
+ for (var i = 0; i < state.transforms.length; i++) {
10900
+ code = state.transforms[i](el, code);
10901
+ }
10902
+
10903
+ return code;
10904
+ }
10905
+ } // hoist static sub-trees out
10906
+
10907
+
10908
+ function genStatic(el, state) {
10909
+ el.staticProcessed = true; // Some elements (templates) need to behave differently inside of a v-pre
10910
+ // node. All pre nodes are static roots, so we can use this as a location to
10911
+ // wrap a state change and reset it upon exiting the pre node.
10912
+
10913
+ var originalPreState = state.pre;
10914
+
10915
+ if (el.pre) {
10916
+ state.pre = el.pre;
10917
+ }
10918
+
10919
+ state.staticRenderFns.push("with(this){return " + genElement(el, state) + "}");
10920
+ state.pre = originalPreState;
10921
+ return "_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")";
10922
+ } // v-once
10923
+
10924
+
10925
+ function genOnce(el, state) {
10926
+ el.onceProcessed = true;
10927
+
10928
+ if (el["if"] && !el.ifProcessed) {
10929
+ return genIf(el, state);
10930
+ } else if (el.staticInFor) {
10931
+ var key = '';
10932
+ var parent = el.parent;
10933
+
10934
+ while (parent) {
10935
+ if (parent["for"]) {
10936
+ key = parent.key;
10937
+ break;
10938
+ }
10939
+
10940
+ parent = parent.parent;
10941
+ }
10942
+
10943
+ if (!key) {
10944
+ state.warn("v-once can only be used inside v-for that is keyed. ", el.rawAttrsMap['v-once']);
10945
+ return genElement(el, state);
10946
+ }
10947
+
10948
+ return "_o(" + genElement(el, state) + "," + state.onceId++ + "," + key + ")";
10949
+ } else {
10950
+ return genStatic(el, state);
10951
+ }
10952
+ }
10953
+
10954
+ function genIf(el, state, altGen, altEmpty) {
10955
+ el.ifProcessed = true; // avoid recursion
10956
+
10957
+ return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty);
10958
+ }
10959
+
10960
+ function genIfConditions(conditions, state, altGen, altEmpty) {
10961
+ if (!conditions.length) {
10962
+ return altEmpty || '_e()';
10963
+ }
10964
+
10965
+ var condition = conditions.shift();
10966
+
10967
+ if (condition.exp) {
10968
+ return "(" + condition.exp + ")?" + genTernaryExp(condition.block) + ":" + genIfConditions(conditions, state, altGen, altEmpty);
10969
+ } else {
10970
+ return "" + genTernaryExp(condition.block);
10971
+ } // v-if with v-once should generate code like (a)?_m(0):_m(1)
10972
+
10973
+
10974
+ function genTernaryExp(el) {
10975
+ return altGen ? altGen(el, state) : el.once ? genOnce(el, state) : genElement(el, state);
10976
+ }
10977
+ }
10978
+
10979
+ function genFor(el, state, altGen, altHelper) {
10980
+ var exp = el["for"];
10981
+ var alias = el.alias;
10982
+ var iterator1 = el.iterator1 ? "," + el.iterator1 : '';
10983
+ var iterator2 = el.iterator2 ? "," + el.iterator2 : '';
10984
+
10985
+ if (state.maybeComponent(el) && el.tag !== 'slot' && el.tag !== 'template' && !el.key) {
10986
+ state.warn("<" + el.tag + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + "v-for should have explicit keys. " + "See https://vuejs.org/guide/list.html#key for more info.", el.rawAttrsMap['v-for'], true
10987
+ /* tip */
10988
+ );
10989
+ }
10990
+
10991
+ el.forProcessed = true; // avoid recursion
10992
+
10993
+ return (altHelper || '_l') + "((" + exp + ")," + "function(" + alias + iterator1 + iterator2 + "){" + "return " + (altGen || genElement)(el, state) + '})';
10994
+ }
10995
+
10996
+ function genData$2(el, state) {
10997
+ var data = '{'; // directives first.
10998
+ // directives may mutate the el's other properties before they are generated.
10999
+
11000
+ var dirs = genDirectives(el, state);
11001
+
11002
+ if (dirs) {
11003
+ data += dirs + ',';
11004
+ } // key
11005
+
11006
+
11007
+ if (el.key) {
11008
+ data += "key:" + el.key + ",";
11009
+ } // ref
11010
+
11011
+
11012
+ if (el.ref) {
11013
+ data += "ref:" + el.ref + ",";
11014
+ }
11015
+
11016
+ if (el.refInFor) {
11017
+ data += "refInFor:true,";
11018
+ } // pre
11019
+
11020
+
11021
+ if (el.pre) {
11022
+ data += "pre:true,";
11023
+ } // record original tag name for components using "is" attribute
11024
+
11025
+
11026
+ if (el.component) {
11027
+ data += "tag:\"" + el.tag + "\",";
11028
+ } // module data generation functions
11029
+
11030
+
11031
+ for (var i = 0; i < state.dataGenFns.length; i++) {
11032
+ data += state.dataGenFns[i](el);
11033
+ } // attributes
11034
+
11035
+
11036
+ if (el.attrs) {
11037
+ data += "attrs:" + genProps(el.attrs) + ",";
11038
+ } // DOM props
11039
+
11040
+
11041
+ if (el.props) {
11042
+ data += "domProps:" + genProps(el.props) + ",";
11043
+ } // event handlers
11044
+
11045
+
11046
+ if (el.events) {
11047
+ data += genHandlers(el.events, false) + ",";
11048
+ }
11049
+
11050
+ if (el.nativeEvents) {
11051
+ data += genHandlers(el.nativeEvents, true) + ",";
11052
+ } // slot target
11053
+ // only for non-scoped slots
11054
+
11055
+
11056
+ if (el.slotTarget && !el.slotScope) {
11057
+ data += "slot:" + el.slotTarget + ",";
11058
+ } // scoped slots
11059
+
11060
+
11061
+ if (el.scopedSlots) {
11062
+ data += genScopedSlots(el, el.scopedSlots, state) + ",";
11063
+ } // component v-model
11064
+
11065
+
11066
+ if (el.model) {
11067
+ data += "model:{value:" + el.model.value + ",callback:" + el.model.callback + ",expression:" + el.model.expression + "},";
11068
+ } // inline-template
11069
+
11070
+
11071
+ if (el.inlineTemplate) {
11072
+ var inlineTemplate = genInlineTemplate(el, state);
11073
+
11074
+ if (inlineTemplate) {
11075
+ data += inlineTemplate + ",";
11076
+ }
11077
+ }
11078
+
11079
+ data = data.replace(/,$/, '') + '}'; // v-bind dynamic argument wrap
11080
+ // v-bind with dynamic arguments must be applied using the same v-bind object
11081
+ // merge helper so that class/style/mustUseProp attrs are handled correctly.
11082
+
11083
+ if (el.dynamicAttrs) {
11084
+ data = "_b(" + data + ",\"" + el.tag + "\"," + genProps(el.dynamicAttrs) + ")";
11085
+ } // v-bind data wrap
11086
+
11087
+
11088
+ if (el.wrapData) {
11089
+ data = el.wrapData(data);
11090
+ } // v-on data wrap
11091
+
11092
+
11093
+ if (el.wrapListeners) {
11094
+ data = el.wrapListeners(data);
11095
+ }
11096
+
11097
+ return data;
11098
+ }
11099
+
11100
+ function genDirectives(el, state) {
11101
+ var dirs = el.directives;
11102
+
11103
+ if (!dirs) {
11104
+ return;
11105
+ }
11106
+
11107
+ var res = 'directives:[';
11108
+ var hasRuntime = false;
11109
+ var i, l, dir, needRuntime;
11110
+
11111
+ for (i = 0, l = dirs.length; i < l; i++) {
11112
+ dir = dirs[i];
11113
+ needRuntime = true;
11114
+ var gen = state.directives[dir.name];
11115
+
11116
+ if (gen) {
11117
+ // compile-time directive that manipulates AST.
11118
+ // returns true if it also needs a runtime counterpart.
11119
+ needRuntime = !!gen(el, dir, state.warn);
11120
+ }
11121
+
11122
+ if (needRuntime) {
11123
+ hasRuntime = true;
11124
+ res += "{name:\"" + dir.name + "\",rawName:\"" + dir.rawName + "\"" + (dir.value ? ",value:(" + dir.value + "),expression:" + JSON.stringify(dir.value) : '') + (dir.arg ? ",arg:" + (dir.isDynamicArg ? dir.arg : "\"" + dir.arg + "\"") : '') + (dir.modifiers ? ",modifiers:" + JSON.stringify(dir.modifiers) : '') + "},";
11125
+ }
11126
+ }
11127
+
11128
+ if (hasRuntime) {
11129
+ return res.slice(0, -1) + ']';
11130
+ }
11131
+ }
11132
+
11133
+ function genInlineTemplate(el, state) {
11134
+ var ast = el.children[0];
11135
+
11136
+ if (el.children.length !== 1 || ast.type !== 1) {
11137
+ state.warn('Inline-template components must have exactly one child element.', {
11138
+ start: el.start
11139
+ });
11140
+ }
11141
+
11142
+ if (ast && ast.type === 1) {
11143
+ var inlineRenderFns = generate(ast, state.options);
11144
+ return "inlineTemplate:{render:function(){" + inlineRenderFns.render + "},staticRenderFns:[" + inlineRenderFns.staticRenderFns.map(function (code) {
11145
+ return "function(){" + code + "}";
11146
+ }).join(',') + "]}";
11147
+ }
11148
+ }
11149
+
11150
+ function genScopedSlots(el, slots, state) {
11151
+ // by default scoped slots are considered "stable", this allows child
11152
+ // components with only scoped slots to skip forced updates from parent.
11153
+ // but in some cases we have to bail-out of this optimization
11154
+ // for example if the slot contains dynamic names, has v-if or v-for on them...
11155
+ var needsForceUpdate = el["for"] || Object.keys(slots).some(function (key) {
11156
+ var slot = slots[key];
11157
+ return slot.slotTargetDynamic || slot["if"] || slot["for"] || containsSlotChild(slot) // is passing down slot from parent which may be dynamic
11158
+ ;
11159
+ }); // #9534: if a component with scoped slots is inside a conditional branch,
11160
+ // it's possible for the same component to be reused but with different
11161
+ // compiled slot content. To avoid that, we generate a unique key based on
11162
+ // the generated code of all the slot contents.
11163
+
11164
+ var needsKey = !!el["if"]; // OR when it is inside another scoped slot or v-for (the reactivity may be
11165
+ // disconnected due to the intermediate scope variable)
11166
+ // #9438, #9506
11167
+ // TODO: this can be further optimized by properly analyzing in-scope bindings
11168
+ // and skip force updating ones that do not actually use scope variables.
11169
+
11170
+ if (!needsForceUpdate) {
11171
+ var parent = el.parent;
11172
+
11173
+ while (parent) {
11174
+ if (parent.slotScope && parent.slotScope !== emptySlotScopeToken || parent["for"]) {
11175
+ needsForceUpdate = true;
11176
+ break;
11177
+ }
11178
+
11179
+ if (parent["if"]) {
11180
+ needsKey = true;
11181
+ }
11182
+
11183
+ parent = parent.parent;
11184
+ }
11185
+ }
11186
+
11187
+ var generatedSlots = Object.keys(slots).map(function (key) {
11188
+ return genScopedSlot(slots[key], state);
11189
+ }).join(',');
11190
+ return "scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? ",null,false," + hash(generatedSlots) : "") + ")";
11191
+ }
11192
+
11193
+ function hash(str) {
11194
+ var hash = 5381;
11195
+ var i = str.length;
11196
+
11197
+ while (i) {
11198
+ hash = hash * 33 ^ str.charCodeAt(--i);
11199
+ }
11200
+
11201
+ return hash >>> 0;
11202
+ }
11203
+
11204
+ function containsSlotChild(el) {
11205
+ if (el.type === 1) {
11206
+ if (el.tag === 'slot') {
11207
+ return true;
11208
+ }
11209
+
11210
+ return el.children.some(containsSlotChild);
11211
+ }
11212
+
11213
+ return false;
11214
+ }
11215
+
11216
+ function genScopedSlot(el, state) {
11217
+ var isLegacySyntax = el.attrsMap['slot-scope'];
11218
+
11219
+ if (el["if"] && !el.ifProcessed && !isLegacySyntax) {
11220
+ return genIf(el, state, genScopedSlot, "null");
11221
+ }
11222
+
11223
+ if (el["for"] && !el.forProcessed) {
11224
+ return genFor(el, state, genScopedSlot);
11225
+ }
11226
+
11227
+ var slotScope = el.slotScope === emptySlotScopeToken ? "" : String(el.slotScope);
11228
+ var fn = "function(" + slotScope + "){" + "return " + (el.tag === 'template' ? el["if"] && isLegacySyntax ? "(" + el["if"] + ")?" + (genChildren(el, state) || 'undefined') + ":undefined" : genChildren(el, state) || 'undefined' : genElement(el, state)) + "}"; // reverse proxy v-slot without scope on this.$slots
11229
+
11230
+ var reverseProxy = slotScope ? "" : ",proxy:true";
11231
+ return "{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}";
11232
+ }
11233
+
11234
+ function genChildren(el, state, checkSkip, altGenElement, altGenNode) {
11235
+ var children = el.children;
11236
+
11237
+ if (children.length) {
11238
+ var el$1 = children[0]; // optimize single v-for
11239
+
11240
+ if (children.length === 1 && el$1["for"] && el$1.tag !== 'template' && el$1.tag !== 'slot') {
11241
+ var normalizationType = checkSkip ? state.maybeComponent(el$1) ? ",1" : ",0" : "";
11242
+ return "" + (altGenElement || genElement)(el$1, state) + normalizationType;
11243
+ }
11244
+
11245
+ var normalizationType$1 = checkSkip ? getNormalizationType(children, state.maybeComponent) : 0;
11246
+ var gen = altGenNode || genNode;
11247
+ return "[" + children.map(function (c) {
11248
+ return gen(c, state);
11249
+ }).join(',') + "]" + (normalizationType$1 ? "," + normalizationType$1 : '');
11250
+ }
11251
+ } // determine the normalization needed for the children array.
11252
+ // 0: no normalization needed
11253
+ // 1: simple normalization needed (possible 1-level deep nested array)
11254
+ // 2: full normalization needed
11255
+
11256
+
11257
+ function getNormalizationType(children, maybeComponent) {
11258
+ var res = 0;
11259
+
11260
+ for (var i = 0; i < children.length; i++) {
11261
+ var el = children[i];
11262
+
11263
+ if (el.type !== 1) {
11264
+ continue;
11265
+ }
11266
+
11267
+ if (needsNormalization(el) || el.ifConditions && el.ifConditions.some(function (c) {
11268
+ return needsNormalization(c.block);
11269
+ })) {
11270
+ res = 2;
11271
+ break;
11272
+ }
11273
+
11274
+ if (maybeComponent(el) || el.ifConditions && el.ifConditions.some(function (c) {
11275
+ return maybeComponent(c.block);
11276
+ })) {
11277
+ res = 1;
11278
+ }
11279
+ }
11280
+
11281
+ return res;
11282
+ }
11283
+
11284
+ function needsNormalization(el) {
11285
+ return el["for"] !== undefined || el.tag === 'template' || el.tag === 'slot';
11286
+ }
11287
+
11288
+ function genNode(node, state) {
11289
+ if (node.type === 1) {
11290
+ return genElement(node, state);
11291
+ } else if (node.type === 3 && node.isComment) {
11292
+ return genComment(node);
11293
+ } else {
11294
+ return genText(node);
11295
+ }
11296
+ }
11297
+
11298
+ function genText(text) {
11299
+ return "_v(" + (text.type === 2 ? text.expression // no need for () because already wrapped in _s()
11300
+ : transformSpecialNewlines(JSON.stringify(text.text))) + ")";
11301
+ }
11302
+
11303
+ function genComment(comment) {
11304
+ return "_e(" + JSON.stringify(comment.text) + ")";
11305
+ }
11306
+
11307
+ function genSlot(el, state) {
11308
+ var slotName = el.slotName || '"default"';
11309
+ var children = genChildren(el, state);
11310
+ var res = "_t(" + slotName + (children ? "," + children : '');
11311
+ var attrs = el.attrs || el.dynamicAttrs ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) {
11312
+ return {
11313
+ // slot props are camelized
11314
+ name: camelize(attr.name),
11315
+ value: attr.value,
11316
+ dynamic: attr.dynamic
11317
+ };
11318
+ })) : null;
11319
+ var bind$$1 = el.attrsMap['v-bind'];
11320
+
11321
+ if ((attrs || bind$$1) && !children) {
11322
+ res += ",null";
11323
+ }
11324
+
11325
+ if (attrs) {
11326
+ res += "," + attrs;
11327
+ }
11328
+
11329
+ if (bind$$1) {
11330
+ res += (attrs ? '' : ',null') + "," + bind$$1;
11331
+ }
11332
+
11333
+ return res + ')';
11334
+ } // componentName is el.component, take it as argument to shun flow's pessimistic refinement
11335
+
11336
+
11337
+ function genComponent(componentName, el, state) {
11338
+ var children = el.inlineTemplate ? null : genChildren(el, state, true);
11339
+ return "_c(" + componentName + "," + genData$2(el, state) + (children ? "," + children : '') + ")";
11340
+ }
11341
+
11342
+ function genProps(props) {
11343
+ var staticProps = "";
11344
+ var dynamicProps = "";
11345
+
11346
+ for (var i = 0; i < props.length; i++) {
11347
+ var prop = props[i];
11348
+ var value = transformSpecialNewlines(prop.value);
11349
+
11350
+ if (prop.dynamic) {
11351
+ dynamicProps += prop.name + "," + value + ",";
11352
+ } else {
11353
+ staticProps += "\"" + prop.name + "\":" + value + ",";
11354
+ }
11355
+ }
11356
+
11357
+ staticProps = "{" + staticProps.slice(0, -1) + "}";
11358
+
11359
+ if (dynamicProps) {
11360
+ return "_d(" + staticProps + ",[" + dynamicProps.slice(0, -1) + "])";
11361
+ } else {
11362
+ return staticProps;
11363
+ }
11364
+ } // #3895, #4268
11365
+
11366
+
11367
+ function transformSpecialNewlines(text) {
11368
+ return text.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
11369
+ }
11370
+ /* */
11371
+ // these keywords should not appear inside expressions, but operators like
11372
+ // typeof, instanceof and in are allowed
11373
+
11374
+
11375
+ var prohibitedKeywordRE = new RegExp('\\b' + ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + 'super,throw,while,yield,delete,export,import,return,switch,default,' + 'extends,finally,continue,debugger,function,arguments').split(',').join('\\b|\\b') + '\\b'); // these unary operators should not be used as property/method names
11376
+
11377
+ var unaryOperatorsRE = new RegExp('\\b' + 'delete,typeof,void'.split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); // strip strings in expressions
11378
+
11379
+ var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; // detect problematic expressions in a template
11380
+
11381
+ function detectErrors(ast, warn) {
11382
+ if (ast) {
11383
+ checkNode(ast, warn);
11384
+ }
11385
+ }
11386
+
11387
+ function checkNode(node, warn) {
11388
+ if (node.type === 1) {
11389
+ for (var name in node.attrsMap) {
11390
+ if (dirRE.test(name)) {
11391
+ var value = node.attrsMap[name];
11392
+
11393
+ if (value) {
11394
+ var range = node.rawAttrsMap[name];
11395
+
11396
+ if (name === 'v-for') {
11397
+ checkFor(node, "v-for=\"" + value + "\"", warn, range);
11398
+ } else if (name === 'v-slot' || name[0] === '#') {
11399
+ checkFunctionParameterExpression(value, name + "=\"" + value + "\"", warn, range);
11400
+ } else if (onRE.test(name)) {
11401
+ checkEvent(value, name + "=\"" + value + "\"", warn, range);
11402
+ } else {
11403
+ checkExpression(value, name + "=\"" + value + "\"", warn, range);
11404
+ }
11405
+ }
11406
+ }
11407
+ }
11408
+
11409
+ if (node.children) {
11410
+ for (var i = 0; i < node.children.length; i++) {
11411
+ checkNode(node.children[i], warn);
11412
+ }
11413
+ }
11414
+ } else if (node.type === 2) {
11415
+ checkExpression(node.expression, node.text, warn, node);
11416
+ }
11417
+ }
11418
+
11419
+ function checkEvent(exp, text, warn, range) {
11420
+ var stripped = exp.replace(stripStringRE, '');
11421
+ var keywordMatch = stripped.match(unaryOperatorsRE);
11422
+
11423
+ if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
11424
+ warn("avoid using JavaScript unary operator as property name: " + "\"" + keywordMatch[0] + "\" in expression " + text.trim(), range);
11425
+ }
11426
+
11427
+ checkExpression(exp, text, warn, range);
11428
+ }
11429
+
11430
+ function checkFor(node, text, warn, range) {
11431
+ checkExpression(node["for"] || '', text, warn, range);
11432
+ checkIdentifier(node.alias, 'v-for alias', text, warn, range);
11433
+ checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
11434
+ checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
11435
+ }
11436
+
11437
+ function checkIdentifier(ident, type, text, warn, range) {
11438
+ if (typeof ident === 'string') {
11439
+ try {
11440
+ new Function("var " + ident + "=_");
11441
+ } catch (e) {
11442
+ warn("invalid " + type + " \"" + ident + "\" in expression: " + text.trim(), range);
11443
+ }
11444
+ }
11445
+ }
11446
+
11447
+ function checkExpression(exp, text, warn, range) {
11448
+ try {
11449
+ new Function("return " + exp);
11450
+ } catch (e) {
11451
+ var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
11452
+
11453
+ if (keywordMatch) {
11454
+ warn("avoid using JavaScript keyword as property name: " + "\"" + keywordMatch[0] + "\"\n Raw expression: " + text.trim(), range);
11455
+ } else {
11456
+ warn("invalid expression: " + e.message + " in\n\n" + " " + exp + "\n\n" + " Raw expression: " + text.trim() + "\n", range);
11457
+ }
11458
+ }
11459
+ }
11460
+
11461
+ function checkFunctionParameterExpression(exp, text, warn, range) {
11462
+ try {
11463
+ new Function(exp, '');
11464
+ } catch (e) {
11465
+ warn("invalid function parameter expression: " + e.message + " in\n\n" + " " + exp + "\n\n" + " Raw expression: " + text.trim() + "\n", range);
11466
+ }
11467
+ }
11468
+ /* */
11469
+
11470
+
11471
+ var range = 2;
11472
+
11473
+ function generateCodeFrame(source, start, end) {
11474
+ if (start === void 0) start = 0;
11475
+ if (end === void 0) end = source.length;
11476
+ var lines = source.split(/\r?\n/);
11477
+ var count = 0;
11478
+ var res = [];
11479
+
11480
+ for (var i = 0; i < lines.length; i++) {
11481
+ count += lines[i].length + 1;
11482
+
11483
+ if (count >= start) {
11484
+ for (var j = i - range; j <= i + range || end > count; j++) {
11485
+ if (j < 0 || j >= lines.length) {
11486
+ continue;
11487
+ }
11488
+
11489
+ res.push("" + (j + 1) + repeat$1(" ", 3 - String(j + 1).length) + "| " + lines[j]);
11490
+ var lineLength = lines[j].length;
11491
+
11492
+ if (j === i) {
11493
+ // push underline
11494
+ var pad = start - (count - lineLength) + 1;
11495
+ var length = end > count ? lineLength - pad : end - start;
11496
+ res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
11497
+ } else if (j > i) {
11498
+ if (end > count) {
11499
+ var length$1 = Math.min(end - count, lineLength);
11500
+ res.push(" | " + repeat$1("^", length$1));
11501
+ }
11502
+
11503
+ count += lineLength + 1;
11504
+ }
11505
+ }
11506
+
11507
+ break;
11508
+ }
11509
+ }
11510
+
11511
+ return res.join('\n');
11512
+ }
11513
+
11514
+ function repeat$1(str, n) {
11515
+ var result = '';
11516
+
11517
+ if (n > 0) {
11518
+ while (true) {
11519
+ // eslint-disable-line
11520
+ if (n & 1) {
11521
+ result += str;
11522
+ }
11523
+
11524
+ n >>>= 1;
11525
+
11526
+ if (n <= 0) {
11527
+ break;
11528
+ }
11529
+
11530
+ str += str;
11531
+ }
11532
+ }
11533
+
11534
+ return result;
11535
+ }
11536
+ /* */
11537
+
11538
+
11539
+ function createFunction(code, errors) {
11540
+ try {
11541
+ return new Function(code);
11542
+ } catch (err) {
11543
+ errors.push({
11544
+ err: err,
11545
+ code: code
11546
+ });
11547
+ return noop;
11548
+ }
11549
+ }
11550
+
11551
+ function createCompileToFunctionFn(compile) {
11552
+ var cache = Object.create(null);
11553
+ return function compileToFunctions(template, options, vm) {
11554
+ options = extend({}, options);
11555
+ var warn$$1 = options.warn || warn;
11556
+ delete options.warn;
11557
+ /* istanbul ignore if */
11558
+
11559
+ {
11560
+ // detect possible CSP restriction
11561
+ try {
11562
+ new Function('return 1');
11563
+ } catch (e) {
11564
+ if (e.toString().match(/unsafe-eval|CSP/)) {
11565
+ warn$$1('It seems you are using the standalone build of Vue.js in an ' + 'environment with Content Security Policy that prohibits unsafe-eval. ' + 'The template compiler cannot work in this environment. Consider ' + 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + 'templates into render functions.');
11566
+ }
11567
+ }
11568
+ } // check cache
11569
+
11570
+ var key = options.delimiters ? String(options.delimiters) + template : template;
11571
+
11572
+ if (cache[key]) {
11573
+ return cache[key];
11574
+ } // compile
11575
+
11576
+
11577
+ var compiled = compile(template, options); // check compilation errors/tips
11578
+
11579
+ {
11580
+ if (compiled.errors && compiled.errors.length) {
11581
+ if (options.outputSourceRange) {
11582
+ compiled.errors.forEach(function (e) {
11583
+ warn$$1("Error compiling template:\n\n" + e.msg + "\n\n" + generateCodeFrame(template, e.start, e.end), vm);
11584
+ });
11585
+ } else {
11586
+ warn$$1("Error compiling template:\n\n" + template + "\n\n" + compiled.errors.map(function (e) {
11587
+ return "- " + e;
11588
+ }).join('\n') + '\n', vm);
11589
+ }
11590
+ }
11591
+
11592
+ if (compiled.tips && compiled.tips.length) {
11593
+ if (options.outputSourceRange) {
11594
+ compiled.tips.forEach(function (e) {
11595
+ return tip(e.msg, vm);
11596
+ });
11597
+ } else {
11598
+ compiled.tips.forEach(function (msg) {
11599
+ return tip(msg, vm);
11600
+ });
11601
+ }
11602
+ }
11603
+ } // turn code into functions
11604
+
11605
+ var res = {};
11606
+ var fnGenErrors = [];
11607
+ res.render = createFunction(compiled.render, fnGenErrors);
11608
+ res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
11609
+ return createFunction(code, fnGenErrors);
11610
+ }); // check function generation errors.
11611
+ // this should only happen if there is a bug in the compiler itself.
11612
+ // mostly for codegen development use
11613
+
11614
+ /* istanbul ignore if */
11615
+
11616
+ {
11617
+ if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
11618
+ warn$$1("Failed to generate render function:\n\n" + fnGenErrors.map(function (ref) {
11619
+ var err = ref.err;
11620
+ var code = ref.code;
11621
+ return err.toString() + " in\n\n" + code + "\n";
11622
+ }).join('\n'), vm);
11623
+ }
11624
+ }
11625
+ return cache[key] = res;
11626
+ };
11627
+ }
11628
+ /* */
11629
+
11630
+
11631
+ function createCompilerCreator(baseCompile) {
11632
+ return function createCompiler(baseOptions) {
11633
+ function compile(template, options) {
11634
+ var finalOptions = Object.create(baseOptions);
11635
+ var errors = [];
11636
+ var tips = [];
11637
+
11638
+ var warn = function warn(msg, range, tip) {
11639
+ (tip ? tips : errors).push(msg);
11640
+ };
11641
+
11642
+ if (options) {
11643
+ if (options.outputSourceRange) {
11644
+ // $flow-disable-line
11645
+ var leadingSpaceLength = template.match(/^\s*/)[0].length;
11646
+
11647
+ warn = function warn(msg, range, tip) {
11648
+ var data = {
11649
+ msg: msg
11650
+ };
11651
+
11652
+ if (range) {
11653
+ if (range.start != null) {
11654
+ data.start = range.start + leadingSpaceLength;
11655
+ }
11656
+
11657
+ if (range.end != null) {
11658
+ data.end = range.end + leadingSpaceLength;
11659
+ }
11660
+ }
11661
+
11662
+ (tip ? tips : errors).push(data);
11663
+ };
11664
+ } // merge custom modules
11665
+
11666
+
11667
+ if (options.modules) {
11668
+ finalOptions.modules = (baseOptions.modules || []).concat(options.modules);
11669
+ } // merge custom directives
11670
+
11671
+
11672
+ if (options.directives) {
11673
+ finalOptions.directives = extend(Object.create(baseOptions.directives || null), options.directives);
11674
+ } // copy other options
11675
+
11676
+
11677
+ for (var key in options) {
11678
+ if (key !== 'modules' && key !== 'directives') {
11679
+ finalOptions[key] = options[key];
11680
+ }
11681
+ }
11682
+ }
11683
+
11684
+ finalOptions.warn = warn;
11685
+ var compiled = baseCompile(template.trim(), finalOptions);
11686
+ {
11687
+ detectErrors(compiled.ast, warn);
11688
+ }
11689
+ compiled.errors = errors;
11690
+ compiled.tips = tips;
11691
+ return compiled;
11692
+ }
11693
+
11694
+ return {
11695
+ compile: compile,
11696
+ compileToFunctions: createCompileToFunctionFn(compile)
11697
+ };
11698
+ };
11699
+ }
11700
+ /* */
11701
+ // `createCompilerCreator` allows creating compilers that use alternative
11702
+ // parser/optimizer/codegen, e.g the SSR optimizing compiler.
11703
+ // Here we just export a default compiler using the default parts.
11704
+
11705
+
11706
+ var createCompiler = createCompilerCreator(function baseCompile(template, options) {
11707
+ var ast = parse(template.trim(), options);
11708
+
11709
+ if (options.optimize !== false) {
11710
+ optimize(ast, options);
11711
+ }
11712
+
11713
+ var code = generate(ast, options);
11714
+ return {
11715
+ ast: ast,
11716
+ render: code.render,
11717
+ staticRenderFns: code.staticRenderFns
11718
+ };
11719
+ });
11720
+ /* */
11721
+
11722
+ var ref$1 = createCompiler(baseOptions);
11723
+ var compile = ref$1.compile;
11724
+ var compileToFunctions = ref$1.compileToFunctions;
11725
+ /* */
11726
+ // check whether current browser encodes a char inside attribute values
11727
+
11728
+ var div;
11729
+
11730
+ function getShouldDecode(href) {
11731
+ div = div || document.createElement('div');
11732
+ div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
11733
+ return div.innerHTML.indexOf('&#10;') > 0;
11734
+ } // #3663: IE encodes newlines inside attribute values while other browsers don't
11735
+
11736
+
11737
+ var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false; // #6828: chrome encodes content in a[href]
11738
+
11739
+ var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
11740
+ /* */
11741
+
11742
+ var idToTemplate = cached(function (id) {
11743
+ var el = query(id);
11744
+ return el && el.innerHTML;
11745
+ });
11746
+ var mount = Vue.prototype.$mount;
11747
+
11748
+ Vue.prototype.$mount = function (el, hydrating) {
11749
+ el = el && query(el);
11750
+ /* istanbul ignore if */
11751
+
11752
+ if (el === document.body || el === document.documentElement) {
11753
+ warn("Do not mount Vue to <html> or <body> - mount to normal elements instead.");
11754
+ return this;
11755
+ }
11756
+
11757
+ var options = this.$options; // resolve template/el and convert to render function
11758
+
11759
+ if (!options.render) {
11760
+ var template = options.template;
11761
+
11762
+ if (template) {
11763
+ if (typeof template === 'string') {
11764
+ if (template.charAt(0) === '#') {
11765
+ template = idToTemplate(template);
11766
+ /* istanbul ignore if */
11767
+
11768
+ if (!template) {
11769
+ warn("Template element not found or is empty: " + options.template, this);
11770
+ }
11771
+ }
11772
+ } else if (template.nodeType) {
11773
+ template = template.innerHTML;
11774
+ } else {
11775
+ {
11776
+ warn('invalid template option:' + template, this);
11777
+ }
11778
+ return this;
11779
+ }
11780
+ } else if (el) {
11781
+ template = getOuterHTML(el);
11782
+ }
11783
+
11784
+ if (template) {
11785
+ /* istanbul ignore if */
11786
+ if (config.performance && mark) {
11787
+ mark('compile');
11788
+ }
11789
+
11790
+ var ref = compileToFunctions(template, {
11791
+ outputSourceRange: "development" !== 'production',
11792
+ shouldDecodeNewlines: shouldDecodeNewlines,
11793
+ shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
11794
+ delimiters: options.delimiters,
11795
+ comments: options.comments
11796
+ }, this);
11797
+ var render = ref.render;
11798
+ var staticRenderFns = ref.staticRenderFns;
11799
+ options.render = render;
11800
+ options.staticRenderFns = staticRenderFns;
11801
+ /* istanbul ignore if */
11802
+
11803
+ if (config.performance && mark) {
11804
+ mark('compile end');
11805
+ measure("vue " + this._name + " compile", 'compile', 'compile end');
11806
+ }
11807
+ }
11808
+ }
11809
+
11810
+ return mount.call(this, el, hydrating);
11811
+ };
11812
+ /**
11813
+ * Get outerHTML of elements, taking care
11814
+ * of SVG elements in IE as well.
11815
+ */
11816
+
11817
+
11818
+ function getOuterHTML(el) {
11819
+ if (el.outerHTML) {
11820
+ return el.outerHTML;
11821
+ } else {
11822
+ var container = document.createElement('div');
11823
+ container.appendChild(el.cloneNode(true));
11824
+ return container.innerHTML;
11825
+ }
11826
+ }
11827
+
11828
+ Vue.compile = compileToFunctions;
11829
+ return Vue;
11830
+ });
admin/classes/class-wp-ulike-admin-assets.php CHANGED
@@ -72,13 +72,15 @@ if ( ! class_exists( 'wp_ulike_admin_assets' ) ) {
72
  // remove_all_actions( 'admin_notices' );
73
 
74
  // Enqueue vueJS
75
- wp_enqueue_script(
76
- 'wp_ulike_vuejs',
77
- WP_ULIKE_ADMIN_URL . '/assets/js/solo/vue/vue.min.js',
78
- array(),
79
- null,
80
- false
81
- );
 
 
82
 
83
  // Enqueue admin plugins
84
  wp_enqueue_script(
72
  // remove_all_actions( 'admin_notices' );
73
 
74
  // Enqueue vueJS
75
+ if ( preg_match("/(logs|statistics)/i", $this->hook ) ) {
76
+ wp_enqueue_script(
77
+ 'wp_ulike_vuejs',
78
+ WP_ULIKE_ADMIN_URL . '/assets/js/solo/vue/vue.min.js',
79
+ array(),
80
+ null,
81
+ false
82
+ );
83
+ }
84
 
85
  // Enqueue admin plugins
86
  wp_enqueue_script(
admin/classes/class-wp-ulike-admin-panel.php CHANGED
@@ -376,20 +376,20 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
376
  'type' => 'callback',
377
  'function' => 'wp_ulike_get_notice_render',
378
  'args' => array(
379
- 'id' => 'wp_ulike_pro_user_profiles_banner',
380
  'title' => __( 'How to Create Ultimate User Profiles with WP ULike?', WP_ULIKE_SLUG ),
381
  'description' => __( "The simplest way to create your own WordPress user profile page is by using the WP ULike Profile builder. This way, you can create professional profiles and display it on the front-end of your website without the need for coding knowledge or the use of advanced functions." , WP_ULIKE_SLUG ),
382
- 'skin' => 'info',
383
  'has_close' => false,
384
  'buttons' => array(
385
  array(
386
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
387
- 'color_name' => 'info',
388
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/wordpress-ultimate-profile-builder/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
389
  )
390
  ),
391
  'image' => array(
392
- 'width' => '200',
393
  'src' => WP_ULIKE_ASSETS_URL . '/img/svg/profiles.svg'
394
  )
395
  )
@@ -397,7 +397,7 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
397
  ) )
398
  ) );
399
 
400
- // Profiles
401
  ULF::createSection( $this->option_domain, array(
402
  'parent' => 'configuration',
403
  'title' => __( 'Login & Signup',WP_ULIKE_SLUG),
@@ -409,17 +409,17 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
409
  'id' => 'wp_ulike_pro_user_login_register_banner',
410
  'title' => __( 'How to make AJAX Based Login/Registration system?', WP_ULIKE_SLUG ),
411
  'description' => __( "Transform your default WordPress login, registration, and reset password forms with the new WP ULike Pro features. In this section, we provide you with tools that you can use to make modern & ajax based forms on your pages with just a few simple clicks." , WP_ULIKE_SLUG ),
412
- 'skin' => 'info',
413
  'has_close' => false,
414
  'buttons' => array(
415
  array(
416
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
417
- 'color_name' => 'info',
418
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/wordpress-ajax-login-registration-plugin/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
419
  )
420
  ),
421
  'image' => array(
422
- 'width' => '200',
423
  'src' => WP_ULIKE_ASSETS_URL . '/img/svg/login.svg'
424
  )
425
  )
@@ -427,6 +427,35 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
427
  ) )
428
  ) );
429
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
430
 
431
  /**
432
  * Customization Section
@@ -527,12 +556,12 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
527
  'id' => 'wp_ulike_pro_rest_api_banner',
528
  'title' => __( 'How to Get Started with WP ULike REST API?', WP_ULIKE_SLUG ),
529
  'description' => __( "Have you ever tried to get data from online sources like WP ULike logs and use them in your Application or website? the solution is Rest API!" , WP_ULIKE_SLUG ),
530
- 'skin' => 'info',
531
  'has_close' => false,
532
  'buttons' => array(
533
  array(
534
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
535
- 'color_name' => 'info',
536
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/how-to-get-started-with-wp-ulike-rest-api/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
537
  )
538
  ),
@@ -556,12 +585,12 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
556
  'id' => 'wp_ulike_pro_optimization_banner',
557
  'title' => __( 'How to Optimize or Repair WP ULike Database Tables?', WP_ULIKE_SLUG ),
558
  'description' => __( "Have you ever optimized your WP ULike database? Optimizing your database cleans up unwanted data which reduces database size and improves performance." , WP_ULIKE_SLUG ),
559
- 'skin' => 'info',
560
  'has_close' => false,
561
  'buttons' => array(
562
  array(
563
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
564
- 'color_name' => 'info',
565
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/database-optimization/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
566
  )
567
  ),
376
  'type' => 'callback',
377
  'function' => 'wp_ulike_get_notice_render',
378
  'args' => array(
379
+ 'id' => 'wp_ulike_pro_ultimate_user_profiles_banner',
380
  'title' => __( 'How to Create Ultimate User Profiles with WP ULike?', WP_ULIKE_SLUG ),
381
  'description' => __( "The simplest way to create your own WordPress user profile page is by using the WP ULike Profile builder. This way, you can create professional profiles and display it on the front-end of your website without the need for coding knowledge or the use of advanced functions." , WP_ULIKE_SLUG ),
382
+ 'skin' => 'default',
383
  'has_close' => false,
384
  'buttons' => array(
385
  array(
386
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
387
+ 'color_name' => 'default',
388
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/wordpress-ultimate-profile-builder/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
389
  )
390
  ),
391
  'image' => array(
392
+ 'width' => '180',
393
  'src' => WP_ULIKE_ASSETS_URL . '/img/svg/profiles.svg'
394
  )
395
  )
397
  ) )
398
  ) );
399
 
400
+ // Login & Signup
401
  ULF::createSection( $this->option_domain, array(
402
  'parent' => 'configuration',
403
  'title' => __( 'Login & Signup',WP_ULIKE_SLUG),
409
  'id' => 'wp_ulike_pro_user_login_register_banner',
410
  'title' => __( 'How to make AJAX Based Login/Registration system?', WP_ULIKE_SLUG ),
411
  'description' => __( "Transform your default WordPress login, registration, and reset password forms with the new WP ULike Pro features. In this section, we provide you with tools that you can use to make modern & ajax based forms on your pages with just a few simple clicks." , WP_ULIKE_SLUG ),
412
+ 'skin' => 'default',
413
  'has_close' => false,
414
  'buttons' => array(
415
  array(
416
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
417
+ 'color_name' => 'default',
418
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/wordpress-ajax-login-registration-plugin/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
419
  )
420
  ),
421
  'image' => array(
422
+ 'width' => '180',
423
  'src' => WP_ULIKE_ASSETS_URL . '/img/svg/login.svg'
424
  )
425
  )
427
  ) )
428
  ) );
429
 
430
+ // Share buttons
431
+ ULF::createSection( $this->option_domain, array(
432
+ 'parent' => 'configuration',
433
+ 'title' => __( 'Share Buttons',WP_ULIKE_SLUG),
434
+ 'fields' => apply_filters( 'wp_ulike_panel_share_buttons', array(
435
+ array(
436
+ 'type' => 'callback',
437
+ 'function' => 'wp_ulike_get_notice_render',
438
+ 'args' => array(
439
+ 'id' => 'wp_ulike_pro_share_buttons_banner',
440
+ 'title' => __( 'Easy Social Share Buttons for WordPress', WP_ULIKE_SLUG ),
441
+ 'description' => __( "WP ULike Share buttons enables your website users to share the content over Facebook, Twitter, Google, Linkedin, Whatsapp, Tumblr, Pinterest, Reddit and over 23 more social sharing services. This is the Simplest and Smoothest Social Sharing service with optimized and great looking vector icons." , WP_ULIKE_SLUG ),
442
+ 'skin' => 'default',
443
+ 'has_close' => false,
444
+ 'buttons' => array(
445
+ array(
446
+ 'label' => __( "Get More Information", WP_ULIKE_SLUG ),
447
+ 'color_name' => 'default',
448
+ 'link' => WP_ULIKE_PLUGIN_URI . 'blog/wordpress-ultimate-social-share-buttons/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
449
+ )
450
+ ),
451
+ 'image' => array(
452
+ 'width' => '200',
453
+ 'src' => WP_ULIKE_ASSETS_URL . '/img/svg/share.svg'
454
+ )
455
+ )
456
+ )
457
+ ) )
458
+ ) );
459
 
460
  /**
461
  * Customization Section
556
  'id' => 'wp_ulike_pro_rest_api_banner',
557
  'title' => __( 'How to Get Started with WP ULike REST API?', WP_ULIKE_SLUG ),
558
  'description' => __( "Have you ever tried to get data from online sources like WP ULike logs and use them in your Application or website? the solution is Rest API!" , WP_ULIKE_SLUG ),
559
+ 'skin' => 'default',
560
  'has_close' => false,
561
  'buttons' => array(
562
  array(
563
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
564
+ 'color_name' => 'default',
565
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/how-to-get-started-with-wp-ulike-rest-api/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
566
  )
567
  ),
585
  'id' => 'wp_ulike_pro_optimization_banner',
586
  'title' => __( 'How to Optimize or Repair WP ULike Database Tables?', WP_ULIKE_SLUG ),
587
  'description' => __( "Have you ever optimized your WP ULike database? Optimizing your database cleans up unwanted data which reduces database size and improves performance." , WP_ULIKE_SLUG ),
588
+ 'skin' => 'default',
589
  'has_close' => false,
590
  'buttons' => array(
591
  array(
592
  'label' => __( "Get More Information", WP_ULIKE_SLUG ),
593
+ 'color_name' => 'default',
594
  'link' => WP_ULIKE_PLUGIN_URI . 'blog/database-optimization/?utm_source=settings-page-banner&utm_campaign=gopro&utm_medium=wp-dash'
595
  )
596
  ),
admin/includes/templates/go-pro.php CHANGED
@@ -65,7 +65,12 @@
65
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
66
  </tr>
67
  <tr>
68
- <td>AJAX Based Login, Registration and Reset Password forms.</td>
 
 
 
 
 
69
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
70
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
71
  </tr>
65
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
66
  </tr>
67
  <tr>
68
+ <td>AJAX Based Login, Registration, Reset Password and edit account forms.</td>
69
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
70
+ <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
71
+ </tr>
72
+ <tr>
73
+ <td>Easy Social Share Buttons for WordPress</td>
74
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/cross-remove.svg" alt="Cross Remove" /></td>
75
  <td><img class="wp-ulike-table-icon" src="<?php echo WP_ULIKE_ASSETS_URL; ?>/img/svg/checkmark.svg" alt="Checkmark" /></td>
76
  </tr>
admin/index.php CHANGED
@@ -12,7 +12,7 @@ if ( ! defined( 'WPINC' ) ) {
12
  die('No Naughty Business Please !');
13
  }
14
 
15
- // Register admin menus
16
  new wp_ulike_admin_panel();
17
 
18
  // include about menu functions
12
  die('No Naughty Business Please !');
13
  }
14
 
15
+ // Register admin panel
16
  new wp_ulike_admin_panel();
17
 
18
  // include about menu functions
assets/img/svg/share.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4173.31 4204.56"><defs><style>.cls-1{fill:#f0f0f0;}.cls-2{fill:#d6deff;}.cls-2,.cls-3,.cls-5,.cls-6,.cls-7,.cls-8,.cls-9{fill-rule:evenodd;}.cls-3{fill:#3c3744;}.cls-4{fill:none;stroke:#1b3c87;stroke-linecap:round;stroke-linejoin:round;stroke-width:17.9px;}.cls-5{fill:#fb5d64;}.cls-6{fill:#eaf0ff;}.cls-7{fill:#fff;}.cls-8{fill:#46dbc9;}.cls-9{fill:#1b3c87;}</style></defs><title>drawkit-grape-pack-illustration-9</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M3371.16,461.77c291.09,297.7,404.5,755.12,497.11,1223.87s164.45,949.81-35,1256c-198.47,306.21-668.17,437.58-1115.2,576.5C2271.09,3658,1846.75,3806.4,1515,3689.21,1184.25,3572,946.09,3191.15,632.32,2785.72,319.5,2381.22-68.92,1953.1,10.46,1625.16c80.33-327,627.54-552.87,1060.38-826.94C1503.69,525.09,1822.18,204.71,2215.33,114,2609.43,24.2,3079.13,163.12,3371.16,461.77Z"/><path class="cls-2" d="M1412.57,3925l-727.71-3608L4173.31,1490.83Z"/><path class="cls-3" d="M2136.21,2822.15,2393.51,3863h212.23l-143.91-2001.7-292.19,36.35Z"/><path class="cls-4" d="M2438.18,2061.33l-17.5-243.5-292.19,36.35-33.43,924.53,78.34,316.93"/><path class="cls-4" d="M2232,3332.8l120.32,486.73h212.24l-81.19-1129.3"/><path class="cls-3" d="M1795.62,1850.93c1.35,54.11-14.88,2042.75-14.88,2042.75H2008c17.59-96,289.5-2018.4,289.5-2018.4S1794.27,1796.81,1795.62,1850.93Z"/><path class="cls-5" d="M2340.92,464.94c-11.55,80.84,57.65,209.1-7.27,323.31-86.59,152.34-449,55.7-485.23,38-23.84-11.69-47.91-26.82-45.91-115.68s143-214.63,151.15-315c5-61,36.06-216.62,100.66-243.72C2314.34,5.57,2352.46,384.09,2340.92,464.94Z"/><path class="cls-4" d="M1826.24,593c42.78-68.72,102.41-143.37,107.65-207.64,5-60.95,34.35-222.28,100.65-243.72"/><path class="cls-4" d="M1828.65,816.13c-14.51-15.22-36.09-23.15-43.44-69.93"/><path class="cls-6" d="M2903.87,449.79h628.59V795.88H2903.87Z"/><path class="cls-4" d="M2246,1951.55l17.44-123.09s-503.24-78.47-501.89-24.36c.47,18.74-1.17,269.31-3.52,589"/><path class="cls-4" d="M2041.55,3387.26c47.08-327.35,109.26-764.42,155.82-1092.45"/><path class="cls-4" d="M1754,2932c-3.67,472.9-7.28,914.87-7.28,914.87H1974c2.4-13.12,9.56-60.36,20.12-132.14"/><path class="cls-7" d="M2665.68,1211.67c18.33,31.15,71.53,118.11,71.53,118.11s256.17-367,271.57-389.17,12.9-87,29.75-86.22,323.25-5.86,323.25,23.46-178.11,70.37-213.3,93.82-332.78,635.51-448.59,635.51-225.76-148.07-235.29-186.91S2514.92,955.44,2665.68,1211.67Z"/><path class="cls-4" d="M3123.63,816.65c94.58.72,218.69,4.83,218.69,23.49,0,29.32-178.12,70.36-213.3,93.82-16.66,11.11-92.16,154.19-179.33,301.77"/><path class="cls-4" d="M2771.61,1501.63c-35.54,41.69-67.25,67.84-91.18,67.84-115.82,0-225.77-148.07-235.29-186.92s50.32-464.82,201.08-208.59c18.32,31.15,71.53,118.11,71.53,118.11s256.16-367,271.56-389.18c8.52-12.23,11.56-37.52,15.43-57.56"/><path class="cls-8" d="M2365.78,813.18c156.77-69.55,324.55,298.45,328.61,377.75-46.18,33.93-259.53,123.93-310.07,118.9C2342,1243.92,2179.11,896,2365.78,813.18Z"/><path class="cls-4" d="M2335.46,785.74C2492.23,716.2,2660,1084.2,2664.07,1163.5c-46.18,33.93-259.53,123.93-310.07,118.9C2311.72,1216.49,2148.79,868.55,2335.46,785.74Z"/><path class="cls-4" d="M3102,422.31h396.4V768.4H2869.84V535.53"/><path class="cls-4" d="M3294.07,537.87l133.7,149.63"/><path class="cls-4" d="M2975.8,478.6l207,114.09"/><path class="cls-4" d="M3187.62,596l302.7-164.91"/><path class="cls-4" d="M2872.18,767.87,3078.92,536.6"/><path class="cls-4" d="M1675.43,3847.29h385.46"/><path class="cls-4" d="M1669.52,3917.61H2055"/><path class="cls-4" d="M2315.93,3820.47h296.88"/><path class="cls-4" d="M2322.87,3885.6h296.88"/><path class="cls-8" d="M2159.91,709.1c346.14,3.22,413.85,601.67,310.11,1157.48-54.59,39.31-578.73,68.79-669.37,7.64S1690.37,704.74,2159.91,709.1Z"/><path class="cls-4" d="M1941.05,1880.71c-78.58-4.37-142.64-14.51-169.27-32.48C1681.15,1787.08,1661.49,678.75,2131,683.11c186.16,1.74,291.79,175.64,333.52,422.48"/><path class="cls-4" d="M2484.59,1446.57c-3.89,128.07-18.85,262.24-43.44,394-21.56,15.52-116.34,29.51-228.73,37"/><path class="cls-8" d="M1881.25,807.71c178.09,33,79.77,468.2,31.42,542.34-61.24,2.42-300.58-46.74-340.07-82.2C1579.86,1182.43,1669.18,768.37,1881.25,807.71Z"/><path class="cls-4" d="M1558.74,1238.14c7.25-85.42,96.58-499.49,308.64-460.14"/><path class="cls-4" d="M1966.59,1051.65c-10.49,116.49-44.79,233.42-67.79,268.68-32.13,1.27-113.3-11.66-188.9-29.36"/><path class="cls-7" d="M1615.43,1277.4c-17.9,55.18-80.75,289.92-74,357.77s306.43,531.59,352.65,567.38c19.39-33.55,66.36-117.06,66.36-117.06-25.35-37.28-177.45-469.71-176-516.68s59.4-204.08,75.8-230.92"/><path class="cls-4" d="M1771.89,1607c-8.36-29.82-13.27-51.46-13-60.1,1.49-47,59.39-204.08,75.79-230.92"/><path class="cls-4" d="M1557.41,1372.73c-22.38,88.63-45.8,197.76-41.57,240.54,6.71,67.85,306.43,531.59,352.65,567.38,19.39-33.55,66.36-117.06,66.36-117.06-13.84-20.35-65.46-158.49-109.24-287.37"/><path class="cls-7" d="M1773.08,3951.54l-6.57,147.4-28.17,103.27,361.94,2.35-108.91-176,1.41-78.39"/><path class="cls-4" d="M1856.33,4172.23l217.44,1.41-108.9-176,1.4-78.39"/><path class="cls-4" d="M1746.58,3920.61,1740,4068l-28.17,103.27"/><path class="cls-7" d="M2397.77,3906.39l17.75,73.63-29.59,211,487.16-3.94-272.83-182.77-5.26-99.27"/><path class="cls-4" d="M2573.75,3986.68l-5.26-99.27"/><path class="cls-4" d="M2371.26,3888.72l17.75,73.63-29.58,211,487.16-3.94L2660.52,4044.8"/><path class="cls-5" d="M3415.54,436.18a107.11,107.11,0,1,1,107.1,107.1A107.1,107.1,0,0,1,3415.54,436.18Z"/><path class="cls-4" d="M3608.57,449.57a107.12,107.12,0,1,1-102.78-137.34"/><path class="cls-7" d="M1979.39,371.91c-6.8-141.23,74.34-259.9,181.24-265S2359.71,212,2366.51,353.27s-74.35,259.91-181.24,265.05S1986.19,513.15,1979.39,371.91Z"/><path class="cls-7" d="M2004.58,464.42c6.76,33.61,33.68,219,31.68,327,32.22,28.27,155.94,24.37,177.23-3.39-4.69-44-8.78-152.41,1.66-181.19"/><path class="cls-4" d="M2195.45,765.35c-4.69-44-12.93-137.18-2.49-166"/><path class="cls-4" d="M2007.45,593.28c6.52,60,11.69,125.87,10.78,175.46,17.35,15.23,61.27,21.13,101.42,19"/><path class="cls-4" d="M1986.54,441.72c1.69,8.41,4.64,26.33,8.09,50.16"/><path class="cls-4" d="M2339.85,439.32c-25.64,91.44-90.7,157.55-169.89,161.36-31.62,1.53-61.95-7-89.16-23.54"/><path class="cls-4" d="M2331,236.36a322,322,0,0,1,17.3,68.52"/><path class="cls-9" d="M2134.09,335c-.74-15.48,5.88-28.38,14.79-28.81s16.75,11.78,17.49,27.25-5.87,28.38-14.79,28.81S2134.84,350.47,2134.09,335Z"/><path class="cls-9" d="M2419.75,290.67c0-.1.16-.19.37-.2s.39.06.39.17-.16.19-.37.2S2419.76,290.78,2419.75,290.67Z"/><path class="cls-4" d="M2227,343.37c2.29,23.78,16,64.83,51.1,76.79"/><path class="cls-4" d="M2144.34,469.07c-.08,14,11.53,34.71,30.59,36.82"/><path class="cls-4" d="M2328.79,471.37c-8.95,43.9,18.93,155.73,14.3,207.33s-33.19,74.47-33.19,74.47"/><path class="cls-5" d="M1952.14,87.81a66.4,66.4,0,1,1,69.51,63.12A66.39,66.39,0,0,1,1952.14,87.81Z"/><path class="cls-4" d="M1954.39,116.9A66.39,66.39,0,1,1,2066.09,104"/><path class="cls-5" d="M2162,101.45c-106.9,5.15-188,123.82-181.24,265.06a334.78,334.78,0,0,0,7,53.94c34.72-52.16,80.78-106.81,111.58-137.43C2169,280.16,2266,258.37,2342,235.14,2306.26,152.55,2237.94,97.8,2162,101.45Z"/><path class="cls-4" d="M1970.91,267.37a335.18,335.18,0,0,0,.7,137.06c34.73-52.17,80.79-106.82,111.58-137.43,40.07-1.65,89.24-9.57,138.26-20.43"/><path class="cls-4" d="M1976,246.18q-3.74,12.48-6.46,25.59"/><path class="cls-4" d="M2324.45,223.52c-35.75-82.59-104.07-137.34-180-133.69-77.74,3.75-141.86,67.52-168.44,156.35"/><path class="cls-7" d="M2021.94,431.91a48.36,48.36,0,1,1,1.46-75.23"/><path class="cls-4" d="M2010,422.7a48.36,48.36,0,1,1,1.46-75.23"/></g></g></svg>
assets/js/wp-ulike.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.4.5
2
  * https://wpulike.com
3
  * TechnoWich 2021;
4
  */
@@ -624,7 +624,6 @@
624
  $.ajax({
625
  url: wp_ulike_params.ajax_url,
626
  type: "POST",
627
- cache: false,
628
  dataType: "json",
629
  data: args
630
  }).done(callback);
1
+ /*! WP ULike - v4.4.6
2
  * https://wpulike.com
3
  * TechnoWich 2021;
4
  */
624
  $.ajax({
625
  url: wp_ulike_params.ajax_url,
626
  type: "POST",
 
627
  dataType: "json",
628
  data: args
629
  }).done(callback);
assets/js/wp-ulike.min.js CHANGED
@@ -1,5 +1,5 @@
1
- /*! WP ULike - v4.4.5
2
  * https://wpulike.com
3
  * TechnoWich 2021;
4
  */
5
- !function(t){t.fn.WordpressUlikeTooltip=function(e){if(this.length>1)return this.each((function(){t(this).WordpressUlikeTooltip(e)})),this;if(void 0===this||1!==this.length)return!1;const i=t(this);e=t.extend({},t.WordpressUlikeTooltip.defaults,e,i.data());let s=i.attr("title");void 0!==s&&s.length&&(e.title=s),e.class+=" ulf-"+e.theme+"-theme",e.class+=" ulf-"+e.size,e.trigger=e.trigger.toLowerCase().trim();let n={dom:this,dom_wrapped:i,position_debug:e.position_debug,trigger:e.trigger,id:e.id,title:e.title,content:e.title,child_class:e.child,theme:e.theme,class:e.class,position:e.position,close_on_outside_click:e.close_on_outside_click,singleton:e.singleton,dataAttr:"ulike-tooltip",createTooltipHTML:function(){return`<div class='ulf-tooltip ${n.class}' role='tooltip'><div class='ulf-arrow'></div><div class='ulf-content'>${n.content}</div></div>`},destroy:function(){const e=n.dom_wrapped.data(n.dataAttr);null!=e&&(e.dom_wrapped.off("touchstart mouseenter",e.show),e.dom_wrapped.off("click",e.preventDefaultHandler),t(window).off("resize",e.onResize),e.isVisible()&&e.hide(),e.dom_wrapped.data(e.dataAttr,null))},initialize:function(){return n.dom_wrapped.on("touchstart mouseenter",n.show),n.dom_wrapped.on("click",n.preventDefaultHandler),t.WordpressUlikeTooltip.body_click_initialized||(t(document).on("touchstart mousedown",n.onClickOutside),t.WordpressUlikeTooltip.bodyClickInitialized=!0),n.dom_wrapped.data(n.dataAttr,n),t(document).on("WordpressUlikeLikersMarkupUpdated",(function(t,e,i,s){if("popover"==i)if(s.length)n.show();else{let t=e.data(n.dataAttr);null!=t&&t.destroy()}})),n.dom},preventDefaultHandler:function(t){return t.preventDefault(),!1},show:function(e){if(n.isVisible())return!1;n.singleton&&n.hideAllVisible();const i=t("body");(void 0===e||e)&&"function"==typeof n.title&&(n.content=n.title(n.dom_wrapped,n)),i.append(n.createTooltipHTML()),n.tooltip=t(".ulf-tooltip:last"),n.positionTooltip(),t(window).on("resize",n.onResize);const s="ulp-dom-"+n.id;n.tooltip.attr("id",s),n.dom.attr("aria-describedby",s),t.WordpressUlikeTooltip.visible.push(n),(void 0===e||e)&&n.dom.trigger("ulf-show",[n.tooltip,n.hide]),t("body").on("DOMSubtreeModified",n.positionTooltip)},isVisible:function(){return t.inArray(n,t.WordpressUlikeTooltip.visible)>-1},hideAllVisible:function(){return t.each(t.WordpressUlikeTooltip.visible,(function(t,e){e.dom_wrapped.hasClass("ulf-focused")||e.hide()})),this},hide:function(e){t("body").off("DOMSubtreeModified",n.positionTooltip),t(window).off("resize",n.onResize),n.dom.attr("aria-describedby",null),n.tooltip&&n.tooltip.length&&n.tooltip.remove(),(void 0===e||e)&&n.dom.trigger("ulf-hide"),"click"!==n.trigger&&n.dom_wrapped.off("touchstart mousedown",n.hide);var i=t.inArray(n,t.WordpressUlikeTooltip.visible);return t.WordpressUlikeTooltip.visible.splice(i,1),n.dom},onResize:function(){n.hide(!1),n.show(!1)},onClickOutside:function(e){const i=t(e.target);i.hasClass("ulf-tooltip")||i.parents(".ulf-tooltip:first").length||t.each(t.WordpressUlikeTooltip.visible,(function(t,e){void 0!==e&&e.close_on_outside_click&&(i!==e.dom_wrapped||"focus"!==e.trigger&&"hoverfocus"!==e.trigger)&&e.hide()}))},positionTooltip:function(){n.positionDebug("-- Start positioning --"),n.dom_wrapped.length&&n.dom_wrapped.is(":visible")||(n.positionDebug("Elem no longer exists. Removing tooltip"),n.hide(!0));let t=n.tooltip.find(".ulf-arrow"),[e,i,s,o,l,a]=n.calculateSafePosition(n.position);return void 0===l&&"auto"!==n.position&&(n.positionDebug("Couldn't fit preferred position"),[e,i,s,o,l,a]=n.calculateSafePosition("auto")),void 0===l?(n.positionDebug("Doesn't appear to fit. Displaying centered"),n.tooltip.addClass("ulf-centered").css({top:"50%",left:"50%","margin-left":-s/2,"margin-top":-o/2}),t&&t.length&&t.remove(),void n.positionDebug("-- Done positioning --")):(n.positionDebug({"Setting Position":{Left:l,Top:a}}),n.tooltip.css("left",l),n.tooltip.css("top",a),i<60&&(n.positionDebug("Element is less than "+i+"px. Setting arrow to hug the side tighter"),e+=" ulf-arrow-super-hug"),t.addClass("ulf-arrow-"+e),n.positionDebug("-- Done positioning --"),n)},calculateSafePosition:function(t){let e,i,s,o=n.tooltip.find(".ulf-arrow"),l=n.dom_wrapped.offset(),a=n.dom_wrapped.outerHeight(),r=n.dom_wrapped.outerWidth(),d=n.tooltip.outerWidth(),p=n.tooltip.outerHeight(),u=document.querySelector("body").offsetWidth,h=document.querySelector("body").offsetHeight,g=o.is(":visible")?o.outerHeight():0,m=o.is(":visible")?o.outerWidth():0,c={};if(c.below=h-(p+a+l.top)>5,c.above=l.top-p>5,c.vertical_half=l.top+r/2-p/2>5,c.right=u-(d+r+l.left)>5,c.right_half=u-l.left-r/2-d/2>5,c.right_full=u-l.left-d>5,c.left=l.left-d>5,c.left_half=l.left+r/2-d/2>5,c.left_full=l.left-d>5,n.positionDebug({"Clicked Element":{Left:l.left,Top:l.top}}),n.positionDebug({"Element Dimensions":{Height:a,Width:r},"Tooltip Dimensions":{Height:p,Width:d},"Window Dimensions":{Height:h,Width:u},"Arrow Dimensions":{Height:g,Width:m}}),n.positionDebug(c),("auto"===t||"bottom"===t)&&c.below&&c.left_half&&c.right_half)n.positionDebug("Displaying below, centered"),e="top",i=l.left-d/2+r/2,s=l.top+a+g/2;else if(("auto"===t||"top"===t)&&c.above&&c.left_half&&c.right_half){if(n.positionDebug("Displaying above, centered"),e="bottom",n.child_class){let t=n.dom_wrapped.find(n.child_class).first();i=t.offset().left-d/2+t.width()/2}else i=l.left-d/2+r/2;s=l.top-p-g/2}else("auto"===t||"left"===t)&&c.left&&c.vertical_half?(n.positionDebug("Displaying left, centered"),e="right",i=l.left-d-m/2,s=l.top+a/2-p/2):("auto"===t||"right"===t)&&c.right&&c.vertical_half?(n.positionDebug("Displaying right, centered"),e="left",i=l.left+r+m/2,s=l.top+a/2-p/2):("auto"===t||"bottom"===t)&&c.below&&c.right_full?(n.positionDebug("Displaying below, to the right"),e="top ulf-arrow-hug-left",i=l.left,s=l.top+a+g/2):("auto"===t||"bottom"===t)&&c.below&&c.left_full?(n.positionDebug("Displaying below, to the left"),e="top ulf-arrow-hug-right",i=l.left+r-d,s=l.top+a+g/2):("auto"===t||"top"===t)&&c.above&&c.right_full?(n.positionDebug("Displaying above, to the right"),e="bottom ulf-arrow-hug-left",i=l.left,s=l.top-p-g/2):("auto"===t||"top"===t)&&c.above&&c.left_full&&(n.positionDebug("Displaying above, to the left"),e="bottom ulf-arrow-hug-right",i=l.left+r-d,s=l.top-p-g/2);return[e,r,d,p,i,s]},positionDebug:function(t){return!!n.position_debug&&("object"==typeof t?console.table(t):console.log("Position: "+t))}};return n.destroy(),n.initialize()},t.WordpressUlikeTooltip={},t.WordpressUlikeTooltip.visible=[],t.WordpressUlikeTooltip.body_click_initialized=!1,t.WordpressUlikeTooltip.defaults={id:Date.now(),title:"",trigger:"hoverfocus",position:"auto",class:"",theme:"black",size:"small",singleton:!0,close_on_outside_click:!0}}(jQuery),function(t,e,i,s){"use strict";var n={messageType:"success",messageText:"Hello World!",timeout:8e3,messageElement:"wpulike-message",notifContainer:"wpulike-notification"};function o(e,i){this.element=e,this.$element=t(e),this.settings=t.extend({},n,i),this._defaults=n,this._name="WordpressUlikeNotifications",this.init()}t.extend(o.prototype,{init:function(){this._message(),this._container(),this._append(),this._remove()},_message:function(){this.$messageElement=t("<div/>").addClass(this.settings.messageElement+" wpulike-"+this.settings.messageType).text(this.settings.messageText)},_container:function(){t("."+this.settings.notifContainer).length||this.$element.append(t("<div/>").addClass(this.settings.notifContainer)),this.$notifContainer=this.$element.find("."+this.settings.notifContainer)},_append:function(){this.$notifContainer.append(this.$messageElement).trigger("WordpressUlikeNotificationAppend")},_remove:function(){var e=this;this.$messageElement.click((function(){t(this).fadeOut(300,(function(){t(this).remove(),t("."+e.settings.messageElement).length||e.$notifContainer.remove()})).trigger("WordpressUlikeRemoveNotification")})),e.settings.timeout&&setTimeout((function(){e.$messageElement.fadeOut(300,(function(){t(this).remove(),t("."+e.settings.messageElement).length||e.$notifContainer.remove()})).trigger("WordpressUlikeRemoveNotification")}),e.settings.timeout)}}),t.fn.WordpressUlikeNotifications=function(t){return this.each((function(){new o(this,t)}))}}(jQuery,window,document),function(t,e,i,s){"use strict";t(e);var n=t(i),o={ID:0,nonce:0,type:"",append:"",appendTimeout:2e3,displayLikers:!1,likersTemplate:"default",disablePophover:!0,isTotal:!1,factor:"",template:"",counterSelector:".count-box",generalSelector:".wp_ulike_general_class",buttonSelector:".wp_ulike_btn",likersSelector:".wp_ulike_likers_wrapper"},l={"ulike-id":"ID","ulike-nonce":"nonce","ulike-type":"type","ulike-append":"append","ulike-is-total":"isTotal","ulike-display-likers":"displayLikers","ulike-likers-style":"likersTemplate","ulike-disable-pophover":"disablePophover","ulike-append-timeout":"appendTimeout","ulike-factor":"factor","ulike-template":"template"};function a(e,i){for(var s in this.element=e,this.$element=t(e),this.settings=t.extend({},o,i),this._defaults=o,this._name="WordpressUlike",this.buttonElement=this.$element.find(this.settings.buttonSelector),this.generalElement=this.$element.find(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector),this.likersElement=this.$element.find(this.settings.likersSelector),l){var n=this.buttonElement.data(s);void 0!==n&&(this.settings[l[s]]=n)}this.init()}t.extend(a.prototype,{init:function(){this.buttonElement.click(this._initLike.bind(this)),this.generalElement.one("mouseenter",this._updateLikers.bind(this))},_ajax:function(e,i){t.ajax({url:wp_ulike_params.ajax_url,type:"POST",cache:!1,dataType:"json",data:e}).done(i)},_initLike:function(t){t.stopPropagation(),this._maybeUpdateElements(t),this._updateSameButtons(),this._updateSameLikers(),this.buttonElement.prop("disabled",!0),n.trigger("WordpressUlikeLoading",this.element),this.generalElement.addClass("wp_ulike_is_loading"),this._ajax({action:"wp_ulike_process",id:this.settings.ID,nonce:this.settings.nonce,factor:this.settings.factor,type:this.settings.type,template:this.settings.template,displayLikers:this.settings.displayLikers,likersTemplate:this.settings.likersTemplate},function(t){this.generalElement.removeClass("wp_ulike_is_loading"),t.success?(this._updateMarkup(t),this._appendChild()):t.data.hasToast&&this._sendNotification("error",t.data.message),this.buttonElement.prop("disabled",!1),n.trigger("WordpressUlikeUpdated",this.element)}.bind(this))},_maybeUpdateElements:function(e){this.buttonElement=t(e.currentTarget),this.generalElement=this.buttonElement.closest(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector),this.settings.factor=this.buttonElement.data("ulike-factor")},_appendChild:function(){if(""!==this.settings.append){var e=t(this.settings.append);this.buttonElement.append(e),this.settings.appendTimeout&&setTimeout((function(){e.detach()}),this.settings.appendTimeout)}},_updateMarkup:function(t){this._setSbilingElement(),this._setSbilingButtons(),this._updateGeneralClassNames(t.data.status),null!==t.data.data&&(t.data.status<5&&(this.__updateCounter(t.data.data),this.settings.displayLikers&&void 0!==t.data.likers&&this._updateLikersMarkup(t.data.likers)),this._updateButton(t.data.btnText,t.data.status)),t.data.hasToast&&this._sendNotification(t.data.messageType,t.data.message)},_updateGeneralClassNames:function(t){var e="wp_ulike_is_not_liked",i="wp_ulike_is_liked",s="wp_ulike_is_unliked",n="wp_ulike_click_is_disabled";switch(this.siblingElement.length&&this.siblingElement.removeClass(this._arrayToString([i,s])),t){case 1:this.generalElement.addClass(i).removeClass(e),this.generalElement.children().first().addClass(n);break;case 2:this.generalElement.addClass(s).removeClass(i);break;case 3:this.generalElement.addClass(i).removeClass(s);break;default:this.generalElement.addClass(n),this.siblingElement.length&&this.siblingElement.addClass(n)}},_arrayToString:function(t){return t.join(" ")},_setSbilingElement:function(){this.siblingElement=this.generalElement.siblings()},_setSbilingButtons:function(){this.siblingButton=this.buttonElement.siblings(this.settings.buttonSelector)},__updateCounter:function(t){"object"!=typeof t?this.counterElement.html(t):this.settings.isTotal&&void 0!==t.sub?this.counterElement.html(t.sub):"down"===this.settings.factor?(this.counterElement.html(t.down),this.siblingElement.length&&this.siblingElement.find(this.settings.counterSelector).html(t.up)):(this.counterElement.html(t.up),this.siblingElement.length&&this.siblingElement.find(this.settings.counterSelector).html(t.down)),n.trigger("WordpressUlikeCounterUpdated",[this.buttonElement])},_updateLikers:function(){if(this.settings.displayLikers){if("popover"==this.settings.likersTemplate&&this.$element.data("ulike-tooltip"))return;if("default"==this.settings.likersTemplate&&this.likersElement.length)return;this.generalElement.addClass("wp_ulike_is_getting_likers_list"),this._ajax({action:"wp_ulike_get_likers",id:this.settings.ID,nonce:this.settings.nonce,type:this.settings.type,displayLikers:this.settings.displayLikers,likersTemplate:this.settings.likersTemplate},function(t){this.generalElement.removeClass("wp_ulike_is_getting_likers_list"),t.success&&this._updateLikersMarkup(t.data)}.bind(this))}},_updateLikersMarkup:function(e){"popover"==this.settings.likersTemplate?(this.likersElement=this.$element,e.template&&this.likersElement.WordpressUlikeTooltip({id:this.settings.type.toLowerCase()+"-"+this.settings.ID,title:e.template,position:"top",child:this.settings.generalSelector,theme:"white",size:"tiny",trigger:"hover"})):(this.likersElement.length||(this.likersElement=t(e.template).appendTo(this.$element)),e.template?this.likersElement.show().html(e.template):this.likersElement.hide()),n.trigger("WordpressUlikeLikersMarkupUpdated",[this.likersElement,this.settings.likersTemplate,e.template])},_updateSameButtons:function(){var t=void 0!==this.settings.factor?"_"+this.settings.factor:"";this.sameButtons=n.find(".wp_"+this.settings.type.toLowerCase()+t+"_btn_"+this.settings.ID),this.sameButtons.length>1&&(this.buttonElement=this.sameButtons,this.generalElement=this.buttonElement.closest(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector))},_updateSameLikers:function(){this.sameLikers=n.find(".wp_"+this.settings.type.toLowerCase()+"_likers_"+this.settings.ID),this.sameLikers.length>1&&(this.likersElement=this.sameLikers)},_getLikersElement:function(){return this.likersElement},_updateButton:function(t,e){this.buttonElement.hasClass("wp_ulike_put_image")?(this.buttonElement.toggleClass("image-unlike wp_ulike_btn_is_active"),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).removeClass("image-unlike wp_ulike_btn_is_active"),this.siblingButton.length&&this.siblingButton.removeClass("image-unlike wp_ulike_btn_is_active")):this.buttonElement.hasClass("wp_ulike_put_text")&&null!==t&&("object"!=typeof t?this.buttonElement.find("span").html(t):"down"===this.settings.factor?(this.buttonElement.find("span").html(t.down),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).find("span").html(t.up)):(this.buttonElement.find("span").html(t.up),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).find("span").html(t.down)))},_sendNotification:function(e,s){t(i.body).WordpressUlikeNotifications({messageType:e,messageText:s})}}),t.fn.WordpressUlike=function(e){return this.each((function(){t.data(this,"plugin_WordpressUlike")||t.data(this,"plugin_WordpressUlike",new a(this,e))}))}}(jQuery,window,document),function(t){t((function(){t(this).bind("DOMNodeInserted",(function(e){t(".wpulike").WordpressUlike()}))})),t(".wpulike").WordpressUlike()}(jQuery);
1
+ /*! WP ULike - v4.4.6
2
  * https://wpulike.com
3
  * TechnoWich 2021;
4
  */
5
+ !function(t){t.fn.WordpressUlikeTooltip=function(e){if(this.length>1)return this.each((function(){t(this).WordpressUlikeTooltip(e)})),this;if(void 0===this||1!==this.length)return!1;const i=t(this);e=t.extend({},t.WordpressUlikeTooltip.defaults,e,i.data());let s=i.attr("title");void 0!==s&&s.length&&(e.title=s),e.class+=" ulf-"+e.theme+"-theme",e.class+=" ulf-"+e.size,e.trigger=e.trigger.toLowerCase().trim();let n={dom:this,dom_wrapped:i,position_debug:e.position_debug,trigger:e.trigger,id:e.id,title:e.title,content:e.title,child_class:e.child,theme:e.theme,class:e.class,position:e.position,close_on_outside_click:e.close_on_outside_click,singleton:e.singleton,dataAttr:"ulike-tooltip",createTooltipHTML:function(){return`<div class='ulf-tooltip ${n.class}' role='tooltip'><div class='ulf-arrow'></div><div class='ulf-content'>${n.content}</div></div>`},destroy:function(){const e=n.dom_wrapped.data(n.dataAttr);null!=e&&(e.dom_wrapped.off("touchstart mouseenter",e.show),e.dom_wrapped.off("click",e.preventDefaultHandler),t(window).off("resize",e.onResize),e.isVisible()&&e.hide(),e.dom_wrapped.data(e.dataAttr,null))},initialize:function(){return n.dom_wrapped.on("touchstart mouseenter",n.show),n.dom_wrapped.on("click",n.preventDefaultHandler),t.WordpressUlikeTooltip.body_click_initialized||(t(document).on("touchstart mousedown",n.onClickOutside),t.WordpressUlikeTooltip.bodyClickInitialized=!0),n.dom_wrapped.data(n.dataAttr,n),t(document).on("WordpressUlikeLikersMarkupUpdated",(function(t,e,i,s){if("popover"==i)if(s.length)n.show();else{let t=e.data(n.dataAttr);null!=t&&t.destroy()}})),n.dom},preventDefaultHandler:function(t){return t.preventDefault(),!1},show:function(e){if(n.isVisible())return!1;n.singleton&&n.hideAllVisible();const i=t("body");(void 0===e||e)&&"function"==typeof n.title&&(n.content=n.title(n.dom_wrapped,n)),i.append(n.createTooltipHTML()),n.tooltip=t(".ulf-tooltip:last"),n.positionTooltip(),t(window).on("resize",n.onResize);const s="ulp-dom-"+n.id;n.tooltip.attr("id",s),n.dom.attr("aria-describedby",s),t.WordpressUlikeTooltip.visible.push(n),(void 0===e||e)&&n.dom.trigger("ulf-show",[n.tooltip,n.hide]),t("body").on("DOMSubtreeModified",n.positionTooltip)},isVisible:function(){return t.inArray(n,t.WordpressUlikeTooltip.visible)>-1},hideAllVisible:function(){return t.each(t.WordpressUlikeTooltip.visible,(function(t,e){e.dom_wrapped.hasClass("ulf-focused")||e.hide()})),this},hide:function(e){t("body").off("DOMSubtreeModified",n.positionTooltip),t(window).off("resize",n.onResize),n.dom.attr("aria-describedby",null),n.tooltip&&n.tooltip.length&&n.tooltip.remove(),(void 0===e||e)&&n.dom.trigger("ulf-hide"),"click"!==n.trigger&&n.dom_wrapped.off("touchstart mousedown",n.hide);var i=t.inArray(n,t.WordpressUlikeTooltip.visible);return t.WordpressUlikeTooltip.visible.splice(i,1),n.dom},onResize:function(){n.hide(!1),n.show(!1)},onClickOutside:function(e){const i=t(e.target);i.hasClass("ulf-tooltip")||i.parents(".ulf-tooltip:first").length||t.each(t.WordpressUlikeTooltip.visible,(function(t,e){void 0!==e&&e.close_on_outside_click&&(i!==e.dom_wrapped||"focus"!==e.trigger&&"hoverfocus"!==e.trigger)&&e.hide()}))},positionTooltip:function(){n.positionDebug("-- Start positioning --"),n.dom_wrapped.length&&n.dom_wrapped.is(":visible")||(n.positionDebug("Elem no longer exists. Removing tooltip"),n.hide(!0));let t=n.tooltip.find(".ulf-arrow"),[e,i,s,o,l,a]=n.calculateSafePosition(n.position);return void 0===l&&"auto"!==n.position&&(n.positionDebug("Couldn't fit preferred position"),[e,i,s,o,l,a]=n.calculateSafePosition("auto")),void 0===l?(n.positionDebug("Doesn't appear to fit. Displaying centered"),n.tooltip.addClass("ulf-centered").css({top:"50%",left:"50%","margin-left":-s/2,"margin-top":-o/2}),t&&t.length&&t.remove(),void n.positionDebug("-- Done positioning --")):(n.positionDebug({"Setting Position":{Left:l,Top:a}}),n.tooltip.css("left",l),n.tooltip.css("top",a),i<60&&(n.positionDebug("Element is less than "+i+"px. Setting arrow to hug the side tighter"),e+=" ulf-arrow-super-hug"),t.addClass("ulf-arrow-"+e),n.positionDebug("-- Done positioning --"),n)},calculateSafePosition:function(t){let e,i,s,o=n.tooltip.find(".ulf-arrow"),l=n.dom_wrapped.offset(),a=n.dom_wrapped.outerHeight(),r=n.dom_wrapped.outerWidth(),d=n.tooltip.outerWidth(),p=n.tooltip.outerHeight(),u=document.querySelector("body").offsetWidth,h=document.querySelector("body").offsetHeight,g=o.is(":visible")?o.outerHeight():0,m=o.is(":visible")?o.outerWidth():0,c={};if(c.below=h-(p+a+l.top)>5,c.above=l.top-p>5,c.vertical_half=l.top+r/2-p/2>5,c.right=u-(d+r+l.left)>5,c.right_half=u-l.left-r/2-d/2>5,c.right_full=u-l.left-d>5,c.left=l.left-d>5,c.left_half=l.left+r/2-d/2>5,c.left_full=l.left-d>5,n.positionDebug({"Clicked Element":{Left:l.left,Top:l.top}}),n.positionDebug({"Element Dimensions":{Height:a,Width:r},"Tooltip Dimensions":{Height:p,Width:d},"Window Dimensions":{Height:h,Width:u},"Arrow Dimensions":{Height:g,Width:m}}),n.positionDebug(c),("auto"===t||"bottom"===t)&&c.below&&c.left_half&&c.right_half)n.positionDebug("Displaying below, centered"),e="top",i=l.left-d/2+r/2,s=l.top+a+g/2;else if(("auto"===t||"top"===t)&&c.above&&c.left_half&&c.right_half){if(n.positionDebug("Displaying above, centered"),e="bottom",n.child_class){let t=n.dom_wrapped.find(n.child_class).first();i=t.offset().left-d/2+t.width()/2}else i=l.left-d/2+r/2;s=l.top-p-g/2}else("auto"===t||"left"===t)&&c.left&&c.vertical_half?(n.positionDebug("Displaying left, centered"),e="right",i=l.left-d-m/2,s=l.top+a/2-p/2):("auto"===t||"right"===t)&&c.right&&c.vertical_half?(n.positionDebug("Displaying right, centered"),e="left",i=l.left+r+m/2,s=l.top+a/2-p/2):("auto"===t||"bottom"===t)&&c.below&&c.right_full?(n.positionDebug("Displaying below, to the right"),e="top ulf-arrow-hug-left",i=l.left,s=l.top+a+g/2):("auto"===t||"bottom"===t)&&c.below&&c.left_full?(n.positionDebug("Displaying below, to the left"),e="top ulf-arrow-hug-right",i=l.left+r-d,s=l.top+a+g/2):("auto"===t||"top"===t)&&c.above&&c.right_full?(n.positionDebug("Displaying above, to the right"),e="bottom ulf-arrow-hug-left",i=l.left,s=l.top-p-g/2):("auto"===t||"top"===t)&&c.above&&c.left_full&&(n.positionDebug("Displaying above, to the left"),e="bottom ulf-arrow-hug-right",i=l.left+r-d,s=l.top-p-g/2);return[e,r,d,p,i,s]},positionDebug:function(t){return!!n.position_debug&&("object"==typeof t?console.table(t):console.log("Position: "+t))}};return n.destroy(),n.initialize()},t.WordpressUlikeTooltip={},t.WordpressUlikeTooltip.visible=[],t.WordpressUlikeTooltip.body_click_initialized=!1,t.WordpressUlikeTooltip.defaults={id:Date.now(),title:"",trigger:"hoverfocus",position:"auto",class:"",theme:"black",size:"small",singleton:!0,close_on_outside_click:!0}}(jQuery),function(t,e,i,s){"use strict";var n={messageType:"success",messageText:"Hello World!",timeout:8e3,messageElement:"wpulike-message",notifContainer:"wpulike-notification"};function o(e,i){this.element=e,this.$element=t(e),this.settings=t.extend({},n,i),this._defaults=n,this._name="WordpressUlikeNotifications",this.init()}t.extend(o.prototype,{init:function(){this._message(),this._container(),this._append(),this._remove()},_message:function(){this.$messageElement=t("<div/>").addClass(this.settings.messageElement+" wpulike-"+this.settings.messageType).text(this.settings.messageText)},_container:function(){t("."+this.settings.notifContainer).length||this.$element.append(t("<div/>").addClass(this.settings.notifContainer)),this.$notifContainer=this.$element.find("."+this.settings.notifContainer)},_append:function(){this.$notifContainer.append(this.$messageElement).trigger("WordpressUlikeNotificationAppend")},_remove:function(){var e=this;this.$messageElement.click((function(){t(this).fadeOut(300,(function(){t(this).remove(),t("."+e.settings.messageElement).length||e.$notifContainer.remove()})).trigger("WordpressUlikeRemoveNotification")})),e.settings.timeout&&setTimeout((function(){e.$messageElement.fadeOut(300,(function(){t(this).remove(),t("."+e.settings.messageElement).length||e.$notifContainer.remove()})).trigger("WordpressUlikeRemoveNotification")}),e.settings.timeout)}}),t.fn.WordpressUlikeNotifications=function(t){return this.each((function(){new o(this,t)}))}}(jQuery,window,document),function(t,e,i,s){"use strict";t(e);var n=t(i),o={ID:0,nonce:0,type:"",append:"",appendTimeout:2e3,displayLikers:!1,likersTemplate:"default",disablePophover:!0,isTotal:!1,factor:"",template:"",counterSelector:".count-box",generalSelector:".wp_ulike_general_class",buttonSelector:".wp_ulike_btn",likersSelector:".wp_ulike_likers_wrapper"},l={"ulike-id":"ID","ulike-nonce":"nonce","ulike-type":"type","ulike-append":"append","ulike-is-total":"isTotal","ulike-display-likers":"displayLikers","ulike-likers-style":"likersTemplate","ulike-disable-pophover":"disablePophover","ulike-append-timeout":"appendTimeout","ulike-factor":"factor","ulike-template":"template"};function a(e,i){for(var s in this.element=e,this.$element=t(e),this.settings=t.extend({},o,i),this._defaults=o,this._name="WordpressUlike",this.buttonElement=this.$element.find(this.settings.buttonSelector),this.generalElement=this.$element.find(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector),this.likersElement=this.$element.find(this.settings.likersSelector),l){var n=this.buttonElement.data(s);void 0!==n&&(this.settings[l[s]]=n)}this.init()}t.extend(a.prototype,{init:function(){this.buttonElement.click(this._initLike.bind(this)),this.generalElement.one("mouseenter",this._updateLikers.bind(this))},_ajax:function(e,i){t.ajax({url:wp_ulike_params.ajax_url,type:"POST",dataType:"json",data:e}).done(i)},_initLike:function(t){t.stopPropagation(),this._maybeUpdateElements(t),this._updateSameButtons(),this._updateSameLikers(),this.buttonElement.prop("disabled",!0),n.trigger("WordpressUlikeLoading",this.element),this.generalElement.addClass("wp_ulike_is_loading"),this._ajax({action:"wp_ulike_process",id:this.settings.ID,nonce:this.settings.nonce,factor:this.settings.factor,type:this.settings.type,template:this.settings.template,displayLikers:this.settings.displayLikers,likersTemplate:this.settings.likersTemplate},function(t){this.generalElement.removeClass("wp_ulike_is_loading"),t.success?(this._updateMarkup(t),this._appendChild()):t.data.hasToast&&this._sendNotification("error",t.data.message),this.buttonElement.prop("disabled",!1),n.trigger("WordpressUlikeUpdated",this.element)}.bind(this))},_maybeUpdateElements:function(e){this.buttonElement=t(e.currentTarget),this.generalElement=this.buttonElement.closest(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector),this.settings.factor=this.buttonElement.data("ulike-factor")},_appendChild:function(){if(""!==this.settings.append){var e=t(this.settings.append);this.buttonElement.append(e),this.settings.appendTimeout&&setTimeout((function(){e.detach()}),this.settings.appendTimeout)}},_updateMarkup:function(t){this._setSbilingElement(),this._setSbilingButtons(),this._updateGeneralClassNames(t.data.status),null!==t.data.data&&(t.data.status<5&&(this.__updateCounter(t.data.data),this.settings.displayLikers&&void 0!==t.data.likers&&this._updateLikersMarkup(t.data.likers)),this._updateButton(t.data.btnText,t.data.status)),t.data.hasToast&&this._sendNotification(t.data.messageType,t.data.message)},_updateGeneralClassNames:function(t){var e="wp_ulike_is_not_liked",i="wp_ulike_is_liked",s="wp_ulike_is_unliked",n="wp_ulike_click_is_disabled";switch(this.siblingElement.length&&this.siblingElement.removeClass(this._arrayToString([i,s])),t){case 1:this.generalElement.addClass(i).removeClass(e),this.generalElement.children().first().addClass(n);break;case 2:this.generalElement.addClass(s).removeClass(i);break;case 3:this.generalElement.addClass(i).removeClass(s);break;default:this.generalElement.addClass(n),this.siblingElement.length&&this.siblingElement.addClass(n)}},_arrayToString:function(t){return t.join(" ")},_setSbilingElement:function(){this.siblingElement=this.generalElement.siblings()},_setSbilingButtons:function(){this.siblingButton=this.buttonElement.siblings(this.settings.buttonSelector)},__updateCounter:function(t){"object"!=typeof t?this.counterElement.html(t):this.settings.isTotal&&void 0!==t.sub?this.counterElement.html(t.sub):"down"===this.settings.factor?(this.counterElement.html(t.down),this.siblingElement.length&&this.siblingElement.find(this.settings.counterSelector).html(t.up)):(this.counterElement.html(t.up),this.siblingElement.length&&this.siblingElement.find(this.settings.counterSelector).html(t.down)),n.trigger("WordpressUlikeCounterUpdated",[this.buttonElement])},_updateLikers:function(){if(this.settings.displayLikers){if("popover"==this.settings.likersTemplate&&this.$element.data("ulike-tooltip"))return;if("default"==this.settings.likersTemplate&&this.likersElement.length)return;this.generalElement.addClass("wp_ulike_is_getting_likers_list"),this._ajax({action:"wp_ulike_get_likers",id:this.settings.ID,nonce:this.settings.nonce,type:this.settings.type,displayLikers:this.settings.displayLikers,likersTemplate:this.settings.likersTemplate},function(t){this.generalElement.removeClass("wp_ulike_is_getting_likers_list"),t.success&&this._updateLikersMarkup(t.data)}.bind(this))}},_updateLikersMarkup:function(e){"popover"==this.settings.likersTemplate?(this.likersElement=this.$element,e.template&&this.likersElement.WordpressUlikeTooltip({id:this.settings.type.toLowerCase()+"-"+this.settings.ID,title:e.template,position:"top",child:this.settings.generalSelector,theme:"white",size:"tiny",trigger:"hover"})):(this.likersElement.length||(this.likersElement=t(e.template).appendTo(this.$element)),e.template?this.likersElement.show().html(e.template):this.likersElement.hide()),n.trigger("WordpressUlikeLikersMarkupUpdated",[this.likersElement,this.settings.likersTemplate,e.template])},_updateSameButtons:function(){var t=void 0!==this.settings.factor?"_"+this.settings.factor:"";this.sameButtons=n.find(".wp_"+this.settings.type.toLowerCase()+t+"_btn_"+this.settings.ID),this.sameButtons.length>1&&(this.buttonElement=this.sameButtons,this.generalElement=this.buttonElement.closest(this.settings.generalSelector),this.counterElement=this.generalElement.find(this.settings.counterSelector))},_updateSameLikers:function(){this.sameLikers=n.find(".wp_"+this.settings.type.toLowerCase()+"_likers_"+this.settings.ID),this.sameLikers.length>1&&(this.likersElement=this.sameLikers)},_getLikersElement:function(){return this.likersElement},_updateButton:function(t,e){this.buttonElement.hasClass("wp_ulike_put_image")?(this.buttonElement.toggleClass("image-unlike wp_ulike_btn_is_active"),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).removeClass("image-unlike wp_ulike_btn_is_active"),this.siblingButton.length&&this.siblingButton.removeClass("image-unlike wp_ulike_btn_is_active")):this.buttonElement.hasClass("wp_ulike_put_text")&&null!==t&&("object"!=typeof t?this.buttonElement.find("span").html(t):"down"===this.settings.factor?(this.buttonElement.find("span").html(t.down),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).find("span").html(t.up)):(this.buttonElement.find("span").html(t.up),this.siblingElement.length&&this.siblingElement.find(this.settings.buttonSelector).find("span").html(t.down)))},_sendNotification:function(e,s){t(i.body).WordpressUlikeNotifications({messageType:e,messageText:s})}}),t.fn.WordpressUlike=function(e){return this.each((function(){t.data(this,"plugin_WordpressUlike")||t.data(this,"plugin_WordpressUlike",new a(this,e))}))}}(jQuery,window,document),function(t){t((function(){t(this).bind("DOMNodeInserted",(function(e){t(".wpulike").WordpressUlike()}))})),t(".wpulike").WordpressUlike()}(jQuery);
dist/Gruntfile.dev.js CHANGED
@@ -206,7 +206,7 @@ module.exports = function (grunt) {
206
  return (separator + src).replace(/;\s*$/, "") + ";"; // make sure always a semicolon is at the end
207
  }
208
  },
209
- src: ['admin/assets/js/src/plugins/**/*.js'],
210
  dest: 'admin/assets/js/plugins.js'
211
  } // adminJsScripts: {
212
  // options: {
@@ -257,7 +257,8 @@ module.exports = function (grunt) {
257
  options: {},
258
  main: {
259
  files: {
260
- 'assets/js/wp-ulike.min.js': ['<%= concat.frontJsScripts.dest %>']
 
261
  }
262
  }
263
  },
206
  return (separator + src).replace(/;\s*$/, "") + ";"; // make sure always a semicolon is at the end
207
  }
208
  },
209
+ src: ['node_modules/chart.js/dist/Chart.js', 'node_modules/jquery-match-height/dist/jquery.matchHeight.js'],
210
  dest: 'admin/assets/js/plugins.js'
211
  } // adminJsScripts: {
212
  // options: {
257
  options: {},
258
  main: {
259
  files: {
260
+ 'assets/js/wp-ulike.min.js': ['<%= concat.frontJsScripts.dest %>'],
261
+ 'admin/assets/js/plugins.js': ['<%= concat.adminJsPlugins.dest %>']
262
  }
263
  }
264
  },
inc/classes/class-wp-ulike-cta-process.php CHANGED
@@ -126,6 +126,7 @@ if ( ! class_exists( 'wp_ulike_cta_process' ) ) {
126
  "logging_method" => wp_ulike_setting_repo::getMethod( $this->parsedArgs['item_type'] ),
127
  "only_logged_in_users" => wp_ulike_setting_repo::requireLogin( $this->parsedArgs['item_type'] ),
128
  "logged_out_action" => wp_ulike_setting_repo::anonymousDisplay( $this->parsedArgs['item_type'] ),
 
129
  ), $this->parsedArgs['item_id']
130
  );
131
  }
126
  "logging_method" => wp_ulike_setting_repo::getMethod( $this->parsedArgs['item_type'] ),
127
  "only_logged_in_users" => wp_ulike_setting_repo::requireLogin( $this->parsedArgs['item_type'] ),
128
  "logged_out_action" => wp_ulike_setting_repo::anonymousDisplay( $this->parsedArgs['item_type'] ),
129
+ "status" => $this->getCurrentStatus()
130
  ), $this->parsedArgs['item_id']
131
  );
132
  }
inc/classes/class-wp-ulike-entities-process.php CHANGED
@@ -326,6 +326,19 @@ if ( ! class_exists( 'wp_ulike_entities_process' ) ) {
326
  );
327
  }
328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  /**
330
  * Update and return counter value
331
  *
326
  );
327
  }
328
 
329
+ /**
330
+ * Delete log data
331
+ *
332
+ * @param integer $item_id
333
+ * @return integer|false
334
+ */
335
+ public function deleteData( $item_id ){
336
+ return $this->wpdb->delete(
337
+ $this->wpdb->prefix . $this->typeSettings->getTableName(),
338
+ array( $this->typeSettings->getColumnName() => $item_id, 'user_id' => $this->currentUser )
339
+ );
340
+ }
341
+
342
  /**
343
  * Update and return counter value
344
  *
inc/classes/class-wp-ulike-mycred.php CHANGED
@@ -35,11 +35,13 @@ if ( class_exists( 'myCRED_Hook' ) ) :
35
  ),
36
  'add_unlike' => array(
37
  'creds' => -1,
38
- 'log' => '%plural% deduction for unliking a content'
 
39
  ),
40
  'get_unlike' => array(
41
  'creds' => -1,
42
- 'log' => '%plural% for getting Unliked from a content'
 
43
  ),
44
  'limits' => array(
45
  'self_reply' => 0
@@ -81,9 +83,9 @@ if ( class_exists( 'myCRED_Hook' ) ) :
81
  */
82
  public function like( $id , $key, $user_id, $author_id = 0 ) {
83
  // Check for exclusion
84
- if ( wp_ulike_is_true( $this->core->exclude_user( $user_id ) ) || ! is_user_logged_in() ) return;
85
 
86
- if ( $user_id != $author_id || wp_ulike_is_true( $this->prefs['limits']['self_reply'] ) ){
87
 
88
  // Award the user liking
89
  if ( $this->prefs['add_like']['creds'] ) {
@@ -109,16 +111,19 @@ if ( class_exists( 'myCRED_Hook' ) ) :
109
  if ( $this->prefs['get_like']['creds'] && $author_id ) {
110
  // If not over limit
111
  if ( ! $this->over_hook_limit( 'get_like', 'wp_get_like', $author_id ) ) {
112
- // Execute
113
- $this->core->add_creds(
114
- 'wp_get_like',
115
- $author_id,
116
- $this->prefs['get_like']['creds'],
117
- $this->prefs['get_like']['log'],
118
- $id,
119
- array( 'ref_type' => $key, 'by' => $user_id ),
120
- $this->mycred_type
121
- );
 
 
 
122
  }
123
  }
124
 
@@ -134,41 +139,47 @@ if ( class_exists( 'myCRED_Hook' ) ) :
134
  public function unlike( $id , $key, $user_id, $author_id = 0 ) {
135
 
136
  // Check for exclusion
137
- if ( wp_ulike_is_true( $this->core->exclude_user( $user_id ) ) || ! is_user_logged_in() ) return;
138
 
139
- if ( $user_id != $author_id || wp_ulike_is_true( $this->prefs['limits']['self_reply'] ) ){
140
 
141
  // Award the user liking
142
  if ( $this->prefs['add_unlike']['creds'] ) {
143
- // Make sure this is unique event
144
- if ( ! $this->core->has_entry( 'wp_add_unlike', $id, $user_id ) ) {
145
- // Execute
146
- $this->core->add_creds(
147
- 'wp_add_unlike',
148
- $user_id,
149
- $this->prefs['add_unlike']['creds'],
150
- $this->prefs['add_unlike']['log'],
151
- $id,
152
- array( 'ref_type' => $key ),
153
- $this->mycred_type
154
- );
 
 
 
155
  }
156
  }
157
 
158
  // Award post author for being liked
159
  if ( $this->prefs['get_unlike']['creds'] && $author_id ) {
160
- // Make sure this is unique event
161
- if ( ! $this->core->has_entry( 'wp_get_unlike', $id, $author_id ) ) {
162
- // Execute
163
- $this->core->add_creds(
164
- 'wp_get_unlike',
165
- $author_id,
166
- $this->prefs['get_unlike']['creds'],
167
- $this->prefs['get_unlike']['log'],
168
- $id,
169
- array( 'ref_type' => $key, 'by' => $user_id ),
170
- $this->mycred_type
171
- );
 
 
 
172
  }
173
  }
174
 
@@ -286,7 +297,13 @@ if ( class_exists( 'myCRED_Hook' ) ) :
286
  <span class="description"><?php _e( 'Use zero to disable.', WP_ULIKE_SLUG ); ?></span>
287
  </div>
288
  </div>
289
- <div class="col-lg-10 col-md-6 col-sm-12 col-xs-12">
 
 
 
 
 
 
290
  <div class="form-group">
291
  <label for="<?php echo $this->field_id( array( 'add_unlike' => 'log' ) ); ?>"><?php _e( 'Log template', WP_ULIKE_SLUG ); ?></label>
292
  <input type="text" name="<?php echo $this->field_name( array( 'add_unlike' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'add_unlike' => 'log' ) ); ?>" placeholder="<?php _e( 'required', WP_ULIKE_SLUG ); ?>" value="<?php echo esc_attr( $prefs['add_unlike']['log'] ); ?>" class="form-control" />
@@ -305,7 +322,13 @@ if ( class_exists( 'myCRED_Hook' ) ) :
305
  <span class="description"><?php _e( 'Use zero to disable.', WP_ULIKE_SLUG ); ?></span>
306
  </div>
307
  </div>
308
- <div class="col-lg-10 col-md-6 col-sm-12 col-xs-12">
 
 
 
 
 
 
309
  <div class="form-group">
310
  <label for="<?php echo $this->field_id( array( 'get_unlike' => 'log' ) ); ?>"><?php _e( 'Log template', WP_ULIKE_SLUG ); ?></label>
311
  <input type="text" name="<?php echo $this->field_name( array( 'get_unlike' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'get_unlike' => 'log' ) ); ?>" placeholder="<?php _e( 'required', WP_ULIKE_SLUG ); ?>" value="<?php echo esc_attr( $prefs['get_unlike']['log'] ); ?>" class="form-control" />
@@ -350,6 +373,20 @@ if ( class_exists( 'myCRED_Hook' ) ) :
350
  unset( $data['get_like']['limit_by'] );
351
  }
352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  return $data;
354
 
355
  }
35
  ),
36
  'add_unlike' => array(
37
  'creds' => -1,
38
+ 'log' => '%plural% deduction for unliking a content',
39
+ 'limit' => '0/x'
40
  ),
41
  'get_unlike' => array(
42
  'creds' => -1,
43
+ 'log' => '%plural% for getting Unliked from a content',
44
+ 'limit' => '0/x'
45
  ),
46
  'limits' => array(
47
  'self_reply' => 0
83
  */
84
  public function like( $id , $key, $user_id, $author_id = 0 ) {
85
  // Check for exclusion
86
+ if ( $this->core->exclude_user( $user_id ) || ! is_user_logged_in() ) return;
87
 
88
+ if ( $user_id != $author_id || $this->prefs['limits']['self_reply'] ){
89
 
90
  // Award the user liking
91
  if ( $this->prefs['add_like']['creds'] ) {
111
  if ( $this->prefs['get_like']['creds'] && $author_id ) {
112
  // If not over limit
113
  if ( ! $this->over_hook_limit( 'get_like', 'wp_get_like', $author_id ) ) {
114
+ // Make sure this is unique event
115
+ if ( ! $this->core->has_entry( 'wp_get_like', $id, $author_id ) ) {
116
+ // Execute
117
+ $this->core->add_creds(
118
+ 'wp_get_like',
119
+ $author_id,
120
+ $this->prefs['get_like']['creds'],
121
+ $this->prefs['get_like']['log'],
122
+ $id,
123
+ array( 'ref_type' => $key, 'by' => $user_id ),
124
+ $this->mycred_type
125
+ );
126
+ }
127
  }
128
  }
129
 
139
  public function unlike( $id , $key, $user_id, $author_id = 0 ) {
140
 
141
  // Check for exclusion
142
+ if ( $this->core->exclude_user( $user_id ) || ! is_user_logged_in() ) return;
143
 
144
+ if ( $user_id != $author_id || $this->prefs['limits']['self_reply'] ){
145
 
146
  // Award the user liking
147
  if ( $this->prefs['add_unlike']['creds'] ) {
148
+ // If not over limit
149
+ if ( ! $this->over_hook_limit( 'add_unlike', 'wp_add_unlike', $user_id ) ) {
150
+ // Make sure this is unique event
151
+ if ( ! $this->core->has_entry( 'wp_add_unlike', $id, $user_id ) ) {
152
+ // Execute
153
+ $this->core->add_creds(
154
+ 'wp_add_unlike',
155
+ $user_id,
156
+ $this->prefs['add_unlike']['creds'],
157
+ $this->prefs['add_unlike']['log'],
158
+ $id,
159
+ array( 'ref_type' => $key ),
160
+ $this->mycred_type
161
+ );
162
+ }
163
  }
164
  }
165
 
166
  // Award post author for being liked
167
  if ( $this->prefs['get_unlike']['creds'] && $author_id ) {
168
+ // If not over limit
169
+ if ( ! $this->over_hook_limit( 'get_unlike', 'wp_get_unlike', $author_id ) ) {
170
+ // Make sure this is unique event
171
+ if ( ! $this->core->has_entry( 'wp_get_unlike', $id, $author_id ) ) {
172
+ // Execute
173
+ $this->core->add_creds(
174
+ 'wp_get_unlike',
175
+ $author_id,
176
+ $this->prefs['get_unlike']['creds'],
177
+ $this->prefs['get_unlike']['log'],
178
+ $id,
179
+ array( 'ref_type' => $key, 'by' => $user_id ),
180
+ $this->mycred_type
181
+ );
182
+ }
183
  }
184
  }
185
 
297
  <span class="description"><?php _e( 'Use zero to disable.', WP_ULIKE_SLUG ); ?></span>
298
  </div>
299
  </div>
300
+ <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
301
+ <div class="form-group">
302
+ <label for="<?php echo $this->field_id( array( 'add_unlike', 'limit' ) ); ?>"><?php _e( 'Limit', WP_ULIKE_SLUG ); ?></label>
303
+ <?php echo $this->hook_limit_setting( $this->field_name( array( 'add_unlike', 'limit' ) ), $this->field_id( array( 'add_unlike', 'limit' ) ), $prefs['add_unlike']['limit'] ); ?>
304
+ </div>
305
+ </div>
306
+ <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
307
  <div class="form-group">
308
  <label for="<?php echo $this->field_id( array( 'add_unlike' => 'log' ) ); ?>"><?php _e( 'Log template', WP_ULIKE_SLUG ); ?></label>
309
  <input type="text" name="<?php echo $this->field_name( array( 'add_unlike' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'add_unlike' => 'log' ) ); ?>" placeholder="<?php _e( 'required', WP_ULIKE_SLUG ); ?>" value="<?php echo esc_attr( $prefs['add_unlike']['log'] ); ?>" class="form-control" />
322
  <span class="description"><?php _e( 'Use zero to disable.', WP_ULIKE_SLUG ); ?></span>
323
  </div>
324
  </div>
325
+ <div class="col-lg-2 col-md-6 col-sm-12 col-xs-12">
326
+ <div class="form-group">
327
+ <label for="<?php echo $this->field_id( array( 'get_unlike', 'limit' ) ); ?>"><?php _e( 'Limit', WP_ULIKE_SLUG ); ?></label>
328
+ <?php echo $this->hook_limit_setting( $this->field_name( array( 'get_unlike', 'limit' ) ), $this->field_id( array( 'get_unlike', 'limit' ) ), $prefs['get_unlike']['limit'] ); ?>
329
+ </div>
330
+ </div>
331
+ <div class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
332
  <div class="form-group">
333
  <label for="<?php echo $this->field_id( array( 'get_unlike' => 'log' ) ); ?>"><?php _e( 'Log template', WP_ULIKE_SLUG ); ?></label>
334
  <input type="text" name="<?php echo $this->field_name( array( 'get_unlike' => 'log' ) ); ?>" id="<?php echo $this->field_id( array( 'get_unlike' => 'log' ) ); ?>" placeholder="<?php _e( 'required', WP_ULIKE_SLUG ); ?>" value="<?php echo esc_attr( $prefs['get_unlike']['log'] ); ?>" class="form-control" />
373
  unset( $data['get_like']['limit_by'] );
374
  }
375
 
376
+ if ( isset( $data['add_unlike']['limit'] ) && isset( $data['add_unlike']['limit_by'] ) ) {
377
+ $limit = sanitize_text_field( $data['add_unlike']['limit'] );
378
+ if ( $limit == '' ) $limit = 0;
379
+ $data['add_unlike']['limit'] = $limit . '/' . $data['add_unlike']['limit_by'];
380
+ unset( $data['add_unlike']['limit_by'] );
381
+ }
382
+
383
+ if ( isset( $data['get_unlike']['limit'] ) && isset( $data['get_unlike']['limit_by'] ) ) {
384
+ $limit = sanitize_text_field( $data['get_unlike']['limit'] );
385
+ if ( $limit == '' ) $limit = 0;
386
+ $data['get_unlike']['limit'] = $limit . '/' . $data['get_unlike']['limit_by'];
387
+ unset( $data['get_unlike']['limit_by'] );
388
+ }
389
+
390
  return $data;
391
 
392
  }
inc/functions/templates.php CHANGED
@@ -63,7 +63,7 @@ if( ! function_exists( 'wp_ulike_set_default_template' ) ){
63
  function wp_ulike_set_default_template( array $wp_ulike_template ){
64
  //This function will turn output buffering on
65
  ob_start();
66
- do_action( 'wp_ulike_before_template' );
67
  // Extract input array
68
  extract( $wp_ulike_template );
69
  ?>
@@ -99,7 +99,7 @@ if( ! function_exists( 'wp_ulike_set_default_template' ) ){
99
  ?>
100
  </div>
101
  <?php
102
- do_action( 'wp_ulike_after_template' );
103
  return ob_get_clean(); // data is now in here
104
  }
105
  }
@@ -115,7 +115,7 @@ if( ! function_exists( 'wp_ulike_set_simple_heart_template' ) ){
115
  function wp_ulike_set_simple_heart_template( array $wp_ulike_template ){
116
  //This function will turn output buffering on
117
  ob_start();
118
- do_action( 'wp_ulike_before_template' );
119
  // Extract input array
120
  extract( $wp_ulike_template );
121
  ?>
@@ -151,7 +151,7 @@ if( ! function_exists( 'wp_ulike_set_simple_heart_template' ) ){
151
  ?>
152
  </div>
153
  <?php
154
- do_action( 'wp_ulike_after_template' );
155
  return ob_get_clean(); // data is now in here
156
  }
157
  }
@@ -167,7 +167,7 @@ if( ! function_exists( 'wp_ulike_set_robeen_template' ) ){
167
  function wp_ulike_set_robeen_template( array $wp_ulike_template ){
168
  //This function will turn output buffering on
169
  ob_start();
170
- do_action( 'wp_ulike_before_template' );
171
  // Extract input array
172
  extract( $wp_ulike_template );
173
  ?>
@@ -200,7 +200,7 @@ if( ! function_exists( 'wp_ulike_set_robeen_template' ) ){
200
  ?>
201
  </div>
202
  <?php
203
- do_action( 'wp_ulike_after_template' );
204
  return ob_get_clean(); // data is now in here
205
  }
206
  }
@@ -217,7 +217,7 @@ if( ! function_exists( 'wp_ulike_set_animated_heart_template' ) ){
217
  function wp_ulike_set_animated_heart_template( array $wp_ulike_template ){
218
  //This function will turn output buffering on
219
  ob_start();
220
- do_action( 'wp_ulike_before_template' );
221
  // Extract input array
222
  extract( $wp_ulike_template );
223
  ?>
@@ -255,7 +255,7 @@ if( ! function_exists( 'wp_ulike_set_animated_heart_template' ) ){
255
  ?>
256
  </div>
257
  <?php
258
- do_action( 'wp_ulike_after_template' );
259
  return ob_get_clean(); // data is now in here
260
  }
261
  }
63
  function wp_ulike_set_default_template( array $wp_ulike_template ){
64
  //This function will turn output buffering on
65
  ob_start();
66
+ do_action( 'wp_ulike_before_template', $wp_ulike_template );
67
  // Extract input array
68
  extract( $wp_ulike_template );
69
  ?>
99
  ?>
100
  </div>
101
  <?php
102
+ do_action( 'wp_ulike_after_template', $wp_ulike_template );
103
  return ob_get_clean(); // data is now in here
104
  }
105
  }
115
  function wp_ulike_set_simple_heart_template( array $wp_ulike_template ){
116
  //This function will turn output buffering on
117
  ob_start();
118
+ do_action( 'wp_ulike_before_template', $wp_ulike_template );
119
  // Extract input array
120
  extract( $wp_ulike_template );
121
  ?>
151
  ?>
152
  </div>
153
  <?php
154
+ do_action( 'wp_ulike_after_template', $wp_ulike_template );
155
  return ob_get_clean(); // data is now in here
156
  }
157
  }
167
  function wp_ulike_set_robeen_template( array $wp_ulike_template ){
168
  //This function will turn output buffering on
169
  ob_start();
170
+ do_action( 'wp_ulike_before_template', $wp_ulike_template );
171
  // Extract input array
172
  extract( $wp_ulike_template );
173
  ?>
200
  ?>
201
  </div>
202
  <?php
203
+ do_action( 'wp_ulike_after_template', $wp_ulike_template );
204
  return ob_get_clean(); // data is now in here
205
  }
206
  }
217
  function wp_ulike_set_animated_heart_template( array $wp_ulike_template ){
218
  //This function will turn output buffering on
219
  ob_start();
220
+ do_action( 'wp_ulike_before_template', $wp_ulike_template );
221
  // Extract input array
222
  extract( $wp_ulike_template );
223
  ?>
255
  ?>
256
  </div>
257
  <?php
258
+ do_action( 'wp_ulike_after_template', $wp_ulike_template );
259
  return ob_get_clean(); // data is now in here
260
  }
261
  }
inc/hooks/third-party.php CHANGED
@@ -387,7 +387,7 @@ if( ! function_exists( 'wp_ulike_format_buddypress_notifications' ) ){
387
 
388
  // WordPress Toolbar
389
  if ( 'string' === $format ) {
390
- $content = apply_filters( 'wp_ulike_bp_notifications_template', '<a href="' . esc_url( $custom_link ) . '" title="' . esc_attr( $custom_text ) . '">' . esc_html( $custom_text ) . '</a>', $custom_link, (int) $total_items, $item_id, $user_ID );
391
  // Deprecated BuddyBar
392
  } else {
393
  $content = apply_filters( 'wp_ulike_bp_notifications_template', array(
@@ -796,7 +796,7 @@ if( ! function_exists( 'wp_ulike_register_myCRED_hook' ) ){
796
  */
797
  function wp_ulike_register_myCRED_hook( $installed ) {
798
  $installed['wp_ulike'] = array(
799
- 'title' => WP_ULIKE_NAME,
800
  'description' => __( 'This hook award / deducts points from users who Like/Unlike any content of WordPress, bbPress, BuddyPress & ...', WP_ULIKE_SLUG ),
801
  'callback' => array( 'wp_ulike_myCRED' )
802
  );
387
 
388
  // WordPress Toolbar
389
  if ( 'string' === $format ) {
390
+ $content = apply_filters( 'wp_ulike_bp_notifications_template', '<a href="' . esc_url( $custom_link ) . '" title="' . wp_strip_all_tags( $custom_text ) . '">' . esc_html( $custom_text ) . '</a>', $custom_link, (int) $total_items, $item_id, $user_ID );
391
  // Deprecated BuddyBar
392
  } else {
393
  $content = apply_filters( 'wp_ulike_bp_notifications_template', array(
796
  */
797
  function wp_ulike_register_myCRED_hook( $installed ) {
798
  $installed['wp_ulike'] = array(
799
+ 'title' => WP_ULIKE_NAME . ' : ' . __( 'Points for liking content', WP_ULIKE_SLUG ),
800
  'description' => __( 'This hook award / deducts points from users who Like/Unlike any content of WordPress, bbPress, BuddyPress & ...', WP_ULIKE_SLUG ),
801
  'callback' => array( 'wp_ulike_myCRED' )
802
  );
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author: TechnoWich
5
  Tags: like, marketing, elementor, user profile, statistics, favorite, rating, button, dislike, gamification, bookmark, member
6
  Requires PHP: 5.6
7
  Requires at least: 5.0
8
- Tested up to: 5.6
9
- Stable tag: 4.4.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -44,6 +44,9 @@ Not happy with the default WordPress login and registration pages? In WP ULike P
44
  = Boost Your SEO by Using Our Schema Markup Generator [PRO] =
45
  Schema markup is a form of data structure and helps Search Engine to have a better understanding of content. The Process for adding these schemas to your webpage is quite messy and confusing. Because of that, WP ULike Pro adds a Metabox to your posts so you can easily generate your custom rich snippets.
46
 
 
 
 
47
  = Try WP ULike Pro - The Best Marketing Tool For WordPress =
48
  So let's talk [PROfessional](https://wpulike.com/pricing/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme)! WP ULike Pro has support DisLike button alongside Like button, both of them are completely customizable in our redesigned settings menu with tones of features and more beautiful and stylish templates. the PRO version of the plugin is now compatible with Elementor Page builder and you can easily choose from +7 widgets by simply drag and drop them to your content. as you build your page and content with Elementor, you can add and customize Like and Dislike button in every part such as Posts, Comments, activities, etc.
49
 
@@ -137,6 +140,13 @@ Yes, WP ULike is compatible with Apache, Nginx, Microsoft IIS et LiteSpeed web s
137
 
138
  == Changelog ==
139
 
 
 
 
 
 
 
 
140
  = 4.4.5 =
141
  * Added: New popover template for likers box.
142
  * Added: New customizer options for popover.
5
  Tags: like, marketing, elementor, user profile, statistics, favorite, rating, button, dislike, gamification, bookmark, member
6
  Requires PHP: 5.6
7
  Requires at least: 5.0
8
+ Tested up to: 5.6.2
9
+ Stable tag: 4.4.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
44
  = Boost Your SEO by Using Our Schema Markup Generator [PRO] =
45
  Schema markup is a form of data structure and helps Search Engine to have a better understanding of content. The Process for adding these schemas to your webpage is quite messy and confusing. Because of that, WP ULike Pro adds a Metabox to your posts so you can easily generate your custom rich snippets.
46
 
47
+ = Easy Social Share Buttons for WordPress [PRO] =
48
+ WP ULike Share buttons enables your website users to share the content over Facebook, Twitter, Google, Linkedin, Whatsapp, Tumblr, Pinterest, Reddit and over 23 more social sharing services. This is the Simplest and Smoothest Social Sharing service with optimized and great looking vector icons.
49
+
50
  = Try WP ULike Pro - The Best Marketing Tool For WordPress =
51
  So let's talk [PROfessional](https://wpulike.com/pricing/?utm_source=wp-repo&utm_medium=link&utm_campaign=readme)! WP ULike Pro has support DisLike button alongside Like button, both of them are completely customizable in our redesigned settings menu with tones of features and more beautiful and stylish templates. the PRO version of the plugin is now compatible with Elementor Page builder and you can easily choose from +7 widgets by simply drag and drop them to your content. as you build your page and content with Elementor, you can add and customize Like and Dislike button in every part such as Posts, Comments, activities, etc.
52
 
140
 
141
  == Changelog ==
142
 
143
+ = 4.4.6 =
144
+ * Added: Social share buttons generator. (+ auto display functionality) [PRO]
145
+ * Added: New customizer options for social share, profile, login & register forms. [PRO]
146
+ * Added: Compatibility with WPML plugin. [PRO]
147
+ * Updated: myCred functionalities.
148
+ * Fixed: Some major issues.
149
+
150
  = 4.4.5 =
151
  * Added: New popover template for likers box.
152
  * Added: New customizer options for popover.
wp-ulike.php CHANGED
@@ -10,14 +10,14 @@
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
- * Version: 4.4.5
14
  * Author: TechnoWich
15
  * Author URI: https://technowich.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
17
  * License: GPL2
18
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
19
  * Domain Path: /languages/
20
- * Tested up to: 5.5.1
21
 
22
  /------------------------------------------\
23
  _ __ _ _____ _ _ _ _
@@ -46,7 +46,7 @@ if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
- define( 'WP_ULIKE_VERSION' , '4.4.5' );
50
  define( 'WP_ULIKE_DB_VERSION' , '2.1' );
51
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
52
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
@@ -144,12 +144,22 @@ if ( ! class_exists( 'WpUlikeInit' ) ) :
144
  do_action( 'wp_ulike_loaded' );
145
  }
146
 
 
 
 
 
 
147
  private function define_constants(){
148
  // a custom directory in uploads directory for storing custom files. Default uploads/{TWT_DOMAIN}
149
  $uploads = wp_get_upload_dir();
150
  define( 'WP_ULIKE_CUSTOM_DIR' , $uploads['basedir'] . '/' . WP_ULIKE_SLUG );
151
  }
152
 
 
 
 
 
 
153
  public function plugins_loaded(){
154
  // Load plugin text domain
155
  $this->load_plugin_textdomain();
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
+ * Version: 4.4.6
14
  * Author: TechnoWich
15
  * Author URI: https://technowich.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
17
  * License: GPL2
18
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
19
  * Domain Path: /languages/
20
+ * Tested up to: 5.6.2
21
 
22
  /------------------------------------------\
23
  _ __ _ _____ _ _ _ _
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
+ define( 'WP_ULIKE_VERSION' , '4.4.6' );
50
  define( 'WP_ULIKE_DB_VERSION' , '2.1' );
51
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
52
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
144
  do_action( 'wp_ulike_loaded' );
145
  }
146
 
147
+ /**
148
+ * Define constants
149
+ *
150
+ * @return void
151
+ */
152
  private function define_constants(){
153
  // a custom directory in uploads directory for storing custom files. Default uploads/{TWT_DOMAIN}
154
  $uploads = wp_get_upload_dir();
155
  define( 'WP_ULIKE_CUSTOM_DIR' , $uploads['basedir'] . '/' . WP_ULIKE_SLUG );
156
  }
157
 
158
+ /**
159
+ * Plugins loaded hook
160
+ *
161
+ * @return void
162
+ */
163
  public function plugins_loaded(){
164
  // Load plugin text domain
165
  $this->load_plugin_textdomain();