diff --git a/javascripts/mediaviews/mediaviews.js b/javascripts/mediaviews/mediaviews.js index 9cda186de..8ed02c370 100644 --- a/javascripts/mediaviews/mediaviews.js +++ b/javascripts/mediaviews/mediaviews.js @@ -608,7 +608,7 @@ class MediaViews extends mix(Pv).with(ChartHelpers, ListHelpers) { * @return {string} URL */ getMPCApiUrl(file, startDate, endDate, category = false) { - const endpoint = 'https://partnermetrics.wmflabs.org/mediaplaycounts/api/2/file_playcount/' + + const endpoint = 'https://tools.wmflabs.org/mediaviews-api/api/2/file_playcount/' + `date_range/${file}/${startDate.format(this.config.mpcDateFormat)}/${endDate.format(this.config.mpcDateFormat)}`; return `/mediaviews/api.php?endpoint=${endpoint}`; } diff --git a/public_html/mediaviews/api.php b/public_html/mediaviews/api.php index 8ce186633..512fb8966 100644 --- a/public_html/mediaviews/api.php +++ b/public_html/mediaviews/api.php @@ -4,5 +4,6 @@ $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Accept: application/json']); curl_setopt($ch, CURLOPT_URL, $_GET['endpoint']); +curl_setopt($ch, CURLOPT_USERAGENT, 'Mediaviews Analysis; https://tools.wmflabs.org/mediaviews / https://en.wikipedia.org/wiki/User_talk:MusikAnimal'); $result = curl_exec($ch); curl_close($ch); diff --git a/public_html/mediaviews/application.js b/public_html/mediaviews/application.js index 8cb3c2ca0..6fd146df7 100644 --- a/public_html/mediaviews/application.js +++ b/public_html/mediaviews/application.js @@ -13,7 +13,7 @@ mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,2 o.backgroundColor=n.backgroundColor?n.backgroundColor:e.getValueAtIndexOrDefault(i.pointBackgroundColor,a,r.backgroundColor),o.borderColor=n.borderColor?n.borderColor:e.getValueAtIndexOrDefault(i.pointBorderColor,a,r.borderColor),o.borderWidth=n.borderWidth?n.borderWidth:e.getValueAtIndexOrDefault(i.pointBorderWidth,a,r.borderWidth)}})}},{}],21:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.global.animation={duration:1e3,easing:"easeOutQuart",onProgress:e.noop,onComplete:e.noop},t.Animation=t.Element.extend({currentStep:null,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,i,n){var a=this;n||(t.animating=!0);for(var o=0;o1&&(i=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1);for(var n=0;nt.animations[n].animationObject.numSteps&&(t.animations[n].animationObject.currentStep=t.animations[n].animationObject.numSteps),t.animations[n].animationObject.render(t.animations[n].chartInstance,t.animations[n].animationObject),t.animations[n].animationObject.onAnimationProgress&&t.animations[n].animationObject.onAnimationProgress.call&&t.animations[n].animationObject.onAnimationProgress.call(t.animations[n].chartInstance,t.animations[n]),t.animations[n].animationObject.currentStep===t.animations[n].animationObject.numSteps?(t.animations[n].animationObject.onAnimationComplete&&t.animations[n].animationObject.onAnimationComplete.call&&t.animations[n].animationObject.onAnimationComplete.call(t.animations[n].chartInstance,t.animations[n]),t.animations[n].chartInstance.animating=!1,t.animations.splice(n,1)):++n;var a=Date.now(),o=(a-e)/t.frameDuration;t.dropFrames+=o,t.animations.length>0&&t.requestAnimationFrame()}}}},{}],22:[function(t,e,i){"use strict";e.exports=function(t){(t.canvasHelpers={}).drawPoint=function(t,e,i,n,a){var o,r,s,l,c,u;if("object"==typeof e&&("[object HTMLImageElement]"===(o=e.toString())||"[object HTMLCanvasElement]"===o))return void t.drawImage(e,n-e.width/2,a-e.height/2);if(!(isNaN(i)||0>=i)){switch(e){default:t.beginPath(),t.arc(n,a,i,0,2*Math.PI),t.closePath(),t.fill();break;case"triangle":t.beginPath(),r=3*i/Math.sqrt(3),c=r*Math.sqrt(3)/2,t.moveTo(n-r/2,a+c/3),t.lineTo(n+r/2,a+c/3),t.lineTo(n,a-2*c/3),t.closePath(),t.fill();break;case"rect":u=1/Math.SQRT2*i,t.beginPath(),t.fillRect(n-u,a-u,2*u,2*u),t.strokeRect(n-u,a-u,2*u,2*u);break;case"rectRot":u=1/Math.SQRT2*i,t.beginPath(),t.moveTo(n-u,a),t.lineTo(n,a+u),t.lineTo(n+u,a),t.lineTo(n,a-u),t.closePath(),t.fill();break;case"cross":t.beginPath(),t.moveTo(n,a+i),t.lineTo(n,a-i),t.moveTo(n-i,a),t.lineTo(n+i,a),t.closePath();break;case"crossRot":t.beginPath(),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n-s,a+l),t.lineTo(n+s,a-l),t.closePath();break;case"star":t.beginPath(),t.moveTo(n,a+i),t.lineTo(n,a-i),t.moveTo(n-i,a),t.lineTo(n+i,a),s=Math.cos(Math.PI/4)*i,l=Math.sin(Math.PI/4)*i,t.moveTo(n-s,a-l),t.lineTo(n+s,a+l),t.moveTo(n-s,a+l),t.lineTo(n+s,a-l),t.closePath();break;case"line":t.beginPath(),t.moveTo(n-i,a),t.lineTo(n+i,a),t.closePath();break;case"dash":t.beginPath(),t.moveTo(n,a),t.lineTo(n+i,a),t.closePath()}t.stroke()}}}},{}],23:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.types={},t.instances={},t.controllers={},t.Controller=function(i){return this.chart=i,this.config=i.config,this.options=this.config.options=e.configMerge(t.defaults.global,t.defaults[this.config.type],this.config.options||{}),this.id=e.uid(),Object.defineProperty(this,"data",{get:function(){return this.config.data}}),t.instances[this.id]=this,this.options.responsive&&this.resize(!0),this.initialize(),this},e.extend(t.Controller.prototype,{initialize:function(){var e=this;return t.plugins.notify("beforeInit",[e]),e.bindEvents(),e.ensureScalesHaveIDs(),e.buildOrUpdateControllers(),e.buildScales(),e.updateLayout(),e.resetElements(),e.initToolTip(),e.update(),t.plugins.notify("afterInit",[e]),e},clear:function(){return e.clear(this.chart),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(i){var n=this,a=n.chart,o=a.canvas,r=e.getMaximumWidth(o),s=a.aspectRatio,l=n.options.maintainAspectRatio&&!1===isNaN(s)&&isFinite(s)&&0!==s?r/s:e.getMaximumHeight(o);if(a.width===r&&a.height===l)return n;o.width=a.width=r,o.height=a.height=l,e.retinaScale(a);var c={width:r,height:l};return t.plugins.notify("resize",[n,c]),n.options.onResize&&n.options.onResize(n,c),i||(n.stop(),n.update(n.options.responsiveAnimationDuration)),n},ensureScalesHaveIDs:function(){var t=this.options,i=t.scales||{},n=t.scale;e.each(i.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),e.each(i.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var i=this,n=i.options,a=i.scales={},o=[];n.scales&&(o=o.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear"}}))),n.scale&&o.push({options:n.scale,dtype:"radialLinear",isDefault:!0}),e.each(o,function(n){var o=n.options,r=e.getValueOrDefault(o.type,n.dtype),s=t.scaleService.getScaleConstructor(r);if(s){var l=new s({id:o.id,options:o,ctx:i.chart.ctx,chart:i});a[l.id]=l,n.isDefault&&(i.scale=l)}}),t.scaleService.addScalesToLayout(this)},updateLayout:function(){t.layoutService.update(this,this.chart.width,this.chart.height)},buildOrUpdateControllers:function(){var i=this,n=[],a=[];if(e.each(i.data.datasets,function(e,o){var r=i.getDatasetMeta(o);r.type||(r.type=e.type||i.config.type),n.push(r.type),r.controller?r.controller.updateIndex(o):(r.controller=new t.controllers[r.type](i,o),a.push(r.controller))},i),n.length>1)for(var o=1;oe;++e)n.getDatasetMeta(e).controller.update();t.plugins.notify("afterDatasetsUpdate",[n])}},render:function(i,n){var a=this;t.plugins.notify("beforeRender",[a]);var o=a.options.animation;if(o&&(void 0!==i&&0!==i||void 0===i&&0!==o.duration)){var r=new t.Animation;r.numSteps=(i||o.duration)/16.66,r.easing=o.easing,r.render=function(t,i){var n=e.easingEffects[i.easing],a=i.currentStep/i.numSteps,o=n(a);t.draw(o,a,i.currentStep)},r.onAnimationProgress=o.onProgress,r.onAnimationComplete=o.onComplete,t.animationService.addAnimation(a,r,i,n)}else a.draw(),o&&o.onComplete&&o.onComplete.call&&o.onComplete.call(a);return a},draw:function(i){var n=this,a=i||1;n.clear(),t.plugins.notify("beforeDraw",[n,a]),e.each(n.boxes,function(t){t.draw(n.chartArea)},n),n.scale&&n.scale.draw(),t.plugins.notify("beforeDatasetsDraw",[n,a]),e.each(n.data.datasets,function(t,e){n.isDatasetVisible(e)&&n.getDatasetMeta(e).controller.draw(i)},n,!0),t.plugins.notify("afterDatasetsDraw",[n,a]),n.tooltip.transition(a).draw(),t.plugins.notify("afterDraw",[n,a])},getElementAtEvent:function(t){var i=this,n=e.getRelativePosition(t,i.chart),a=[];return e.each(i.data.datasets,function(t,o){if(i.isDatasetVisible(o)){var r=i.getDatasetMeta(o);e.each(r.data,function(t){return t.inRange(n.x,n.y)?(a.push(t),a):void 0})}}),a.slice(0,1)},getElementsAtEvent:function(t){var i=this,n=e.getRelativePosition(t,i.chart),a=[],o=function(){if(i.data.datasets)for(var t=0;t0&&(e=this.getDatasetMeta(e[0]._datasetIndex).data),e},getDatasetMeta:function(t){var e=this,i=e.data.datasets[t];i._meta||(i._meta={});var n=i._meta[e.id];return n||(n=i._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;i>e;++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)},destroy:function(){var i=this;i.stop(),i.clear(),e.unbindEvents(i,i.events),e.removeResizeListener(i.chart.canvas.parentNode);var n=i.chart.canvas;n.width=i.chart.width,n.height=i.chart.height,void 0!==i.chart.originalDevicePixelRatio&&i.chart.ctx.scale(1/i.chart.originalDevicePixelRatio,1/i.chart.originalDevicePixelRatio),n.style.width=i.chart.originalCanvasStyleWidth,n.style.height=i.chart.originalCanvasStyleHeight,t.plugins.notify("destroy",[i]),delete t.instances[i.id]},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e.chart,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this;e.bindEvents(t,t.options.events,function(e){t.eventHandler(e)})},updateHoverStyle:function(t,e,i){var n,a,o,r=i?"setHoverStyle":"removeHoverStyle";switch(e){case"single":t=[t[0]];break;case"label":case"dataset":case"x-axis":break;default:return}for(a=0,o=t.length;o>a;++a)(n=t[a])&&this.getDatasetMeta(n._datasetIndex).controller[r](n)},eventHandler:function(t){var i=this,n=i.tooltip,a=i.options||{},o=a.hover,r=a.tooltips;return i.lastActive=i.lastActive||[],i.lastTooltipActive=i.lastTooltipActive||[],"mouseout"===t.type?(i.active=[],i.tooltipActive=[]):(i.active=i.getElementsAtEventForMode(t,o.mode),i.tooltipActive=i.getElementsAtEventForMode(t,r.mode)),o.onHover&&o.onHover.call(i,i.active),i.legend&&i.legend.handleEvent&&i.legend.handleEvent(t),("mouseup"===t.type||"click"===t.type)&&a.onClick&&a.onClick.call(i,t,i.active),i.lastActive.length&&i.updateHoverStyle(i.lastActive,o.mode,!1),i.active.length&&o.mode&&i.updateHoverStyle(i.active,o.mode,!0),(r.enabled||r.custom)&&(n.initialize(),n._active=i.tooltipActive,n.update(!0)),n.pivot(),i.animating||e.arrayEquals(i.active,i.lastActive)&&e.arrayEquals(i.tooltipActive,i.lastTooltipActive)||(i.stop(),(r.enabled||r.custom)&&n.update(!0),i.render(o.animationDuration,!0)),i.lastActive=i.active,i.lastTooltipActive=i.tooltipActive,i}})}},{}],24:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i=e.noop;t.DatasetController=function(t,e){this.initialize(t,e)},e.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var i=this;i.chart=t,i.index=e,i.linkScales(),i.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.getDataset();null===e.xAxisID&&(e.xAxisID=i.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=i.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,i=e.dataElementType;return i&&new i({_chart:e.chart.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,i=this,n=i.getMeta(),a=i.getDataset().data||[],o=n.data;for(t=0,e=a.length;e>t;++t)o[t]=o[t]||i.createMetaData(n,t);n.dataset=n.dataset||i.createMetaDataset()},addElementAndReset:function(t){var e=this,i=e.createMetaData(t);e.getMeta().data.splice(t,0,i),e.updateElement(i,t,!0)},buildOrUpdateElements:function(){var t=this.getMeta(),e=t.data,i=this.getDataset().data.length,n=e.length;if(n>i)e.splice(i,n-i);else if(i>n)for(var a=n;i>a;++a)this.addElementAndReset(a)},update:i,draw:function(t){var i=t||1;e.each(this.getMeta().data,function(t){t.transition(i).draw()})},removeHoverStyle:function(t,i){var n=this.chart.data.datasets[t._datasetIndex],a=t._index,o=t.custom||{},r=e.getValueAtIndexOrDefault,s=t._model;s.backgroundColor=o.backgroundColor?o.backgroundColor:r(n.backgroundColor,a,i.backgroundColor),s.borderColor=o.borderColor?o.borderColor:r(n.borderColor,a,i.borderColor),s.borderWidth=o.borderWidth?o.borderWidth:r(n.borderWidth,a,i.borderWidth)},setHoverStyle:function(t){var i=this.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},o=e.getValueAtIndexOrDefault,r=e.getHoverColor,s=t._model;s.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:o(i.hoverBackgroundColor,n,r(s.backgroundColor)),s.borderColor=a.hoverBorderColor?a.hoverBorderColor:o(i.hoverBorderColor,n,r(s.borderColor)),s.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:o(i.hoverBorderWidth,n,s.borderWidth)}}),t.DatasetController.extend=e.inherits}},{}],25:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.elements={},t.Element=function(t){e.extend(this,t),this.initialize.apply(this,arguments)},e.extend(t.Element.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=e.clone(t._model)),t._start=e.clone(t._view),t},transition:function(t){var i=this;return i._view||(i._view=e.clone(i._model)),1===t?(i._view=i._model,i._start=null,i):(i._start||i.pivot(),e.each(i._model,function(n,a){if("_"===a[0]);else if(i._view.hasOwnProperty(a))if(n===i._view[a]);else if("string"==typeof n)try{var o=e.color(i._model[a]).mix(e.color(i._start[a]),t);i._view[a]=o.rgbString()}catch(t){i._view[a]=n}else if("number"==typeof n){var r=void 0!==i._start[a]&&!1===isNaN(i._start[a])?i._start[a]:0;i._view[a]=(i._model[a]-r)*t+r}else i._view[a]=n;else"number"!=typeof n||isNaN(i._view[a])?i._view[a]=n:i._view[a]=n*t},i),i)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return e.isNumber(this._model.x)&&e.isNumber(this._model.y)}}),t.Element.extend=e.inherits}},{}],26:[function(t,e,i){"use strict";var n=t(3);e.exports=function(t){function e(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function i(t){return void 0!==t&&null!==t&&"none"!==t}function a(t,n,a){var o=document.defaultView,r=t.parentNode,s=o.getComputedStyle(t)[n],l=o.getComputedStyle(r)[n],c=i(s),u=i(l),d=Number.POSITIVE_INFINITY;return c||u?Math.min(c?e(s,t,a):d,u?e(l,r,a):d):"none"}var o=t.helpers={};o.each=function(t,e,i,n){var a,r;if(o.isArray(t))if(r=t.length,n)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;r>a;a++)e.call(i,t[a],a);else if("object"==typeof t){var s=Object.keys(t);for(r=s.length,a=0;r>a;a++)e.call(i,t[s[a]],s[a])}},o.clone=function(t){var e={};return o.each(t,function(t,i){o.isArray(t)?e[i]=t.slice(0):e[i]="object"==typeof t&&null!==t?o.clone(t):t}),e},o.extend=function(t){for(var e=function(e,i){t[i]=e},i=1,n=arguments.length;n>i;i++)o.each(arguments[i],e);return t},o.configMerge=function(e){var i=o.clone(e);return o.each(Array.prototype.slice.call(arguments,1),function(e){o.each(e,function(e,n){if("scales"===n)i[n]=o.scaleMerge(i.hasOwnProperty(n)?i[n]:{},e);else if("scale"===n)i[n]=o.configMerge(i.hasOwnProperty(n)?i[n]:{},t.scaleService.getScaleDefaults(e.type),e);else if(i.hasOwnProperty(n)&&o.isArray(i[n])&&o.isArray(e)){var a=i[n];o.each(e,function(t,e){e=n[i].length||!n[i][a].type?n[i].push(o.configMerge(s,e)):e.type&&e.type!==n[i][a].type?n[i][a]=o.configMerge(n[i][a],s,e):n[i][a]=o.configMerge(n[i][a],e)}):(n[i]=[],o.each(e,function(e){var a=o.getValueOrDefault(e.type,"xAxes"===i?"category":"linear");n[i].push(o.configMerge(t.scaleService.getScaleDefaults(a),e))})):n.hasOwnProperty(i)&&"object"==typeof n[i]&&null!==n[i]&&"object"==typeof e?n[i]=o.configMerge(n[i],e):n[i]=e}),n},o.getValueAtIndexOrDefault=function(t,e,i){return void 0===t||null===t?i:o.isArray(t)?ei;++i)if(t[i]===e)return i;return-1},o.where=function(t,e){if(o.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return o.each(t,function(t){e(t)&&i.push(t)}),i},o.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var n=0,a=t.length;a>n;++n)if(e.call(i,t[n],n,t))return n;return-1},o.findNextWhere=function(t,e,i){(void 0===i||null===i)&&(i=-1);for(var n=i+1;n=0;n--){var a=t[n];if(e(a))return a}},o.inherits=function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=o.inherits,t&&o.extend(i.prototype,t),i.__super__=e.prototype,i},o.noop=function(){},o.uid=function(){var t=0;return function(){return t++}}(),o.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},o.almostEquals=function(t,e,i){return Math.abs(t-e)0?1:-1},o.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},o.toRadians=function(t){return t*(Math.PI/180)},o.toDegrees=function(t){return t*(180/Math.PI)},o.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,a=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:a}},o.aliasPixel=function(t){return t%2==0?0:.5},o.splineCurve=function(t,e,i,n){var a=t.skip?e:t,o=e,r=i.skip?e:i,s=Math.sqrt(Math.pow(o.x-a.x,2)+Math.pow(o.y-a.y,2)),l=Math.sqrt(Math.pow(r.x-o.x,2)+Math.pow(r.y-o.y,2)),c=s/(s+l),u=l/(s+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;var d=n*c,h=n*u;return{previous:{x:o.x-d*(r.x-a.x),y:o.y-d*(r.y-a.y)},next:{x:o.x+h*(r.x-a.x),y:o.y+h*(r.y-a.y)}}},o.EPSILON=Number.EPSILON||1e-14,o.splineCurveMonotone=function(t){var e,i,n,a,r=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=r.length;for(e=0;s>e;++e)n=r[e],n.model.skip||(i=e>0?r[e-1]:null,a=s-1>e?r[e+1]:null,a&&!a.model.skip&&(n.deltaK=(a.model.y-n.model.y)/(a.model.x-n.model.x)),!i||i.model.skip?n.mK=n.deltaK:!a||a.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2);var l,c,u,d;for(e=0;s-1>e;++e)n=r[e],a=r[e+1],n.model.skip||a.model.skip||(o.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=a.mK=0:(l=n.mK/n.deltaK,c=a.mK/n.deltaK,9>=(d=Math.pow(l,2)+Math.pow(c,2))||(u=3/Math.sqrt(d),n.mK=l*u*n.deltaK,a.mK=c*u*n.deltaK)));var h;for(e=0;s>e;++e)n=r[e],n.model.skip||(i=e>0?r[e-1]:null,a=s-1>e?r[e+1]:null,i&&!i.model.skip&&(h=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-h,n.model.controlPointPreviousY=n.model.y-h*n.mK),a&&!a.model.skip&&(h=(a.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+h,n.model.controlPointNextY=n.model.y+h*n.mK))},o.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},o.previousItem=function(t,e,i){return i?0>=e?t[t.length-1]:t[e-1]:0>=e?t[0]:t[e-1]},o.niceNum=function(t,e){var i=Math.floor(o.log10(t)),n=t/Math.pow(10,i);return(e?1.5>n?1:3>n?2:7>n?5:10:1>=n?1:2>=n?2:5>=n?5:10)*Math.pow(10,i)};var r=o.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*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 1*((t=t/1-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-1*((t=t/1-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 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-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/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(1-Math.pow(2,-10*t/1))},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:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1==(t/=1)?1:(i||(i=.3),nt?n*Math.pow(2,10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((1*t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return 1*(t/=1)*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return 1*((t=t/1-1)*t*((e+1)*t+e)+1)},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-r.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t*1:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*r.easeInBounce(2*t):.5*r.easeOutBounce(2*t-1)+.5}};o.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),o.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),o.getRelativePosition=function(t,e){var i,n,a=t.originalEvent||t,r=t.currentTarget||t.srcElement,s=r.getBoundingClientRect(),l=a.touches;l&&l.length>0?(i=l[0].clientX,n=l[0].clientY):(i=a.clientX,n=a.clientY);var c=parseFloat(o.getStyle(r,"padding-left")),u=parseFloat(o.getStyle(r,"padding-top")),d=parseFloat(o.getStyle(r,"padding-right")),h=parseFloat(o.getStyle(r,"padding-bottom")),p=s.right-s.left-c-d,f=s.bottom-s.top-u-h;return i=Math.round((i-s.left-c)/p*r.width/e.currentDevicePixelRatio),n=Math.round((n-s.top-u)/f*r.height/e.currentDevicePixelRatio),{x:i,y:n}},o.addEvent=function(t,e,i){t.addEventListener?t.addEventListener(e,i):t.attachEvent?t.attachEvent("on"+e,i):t["on"+e]=i},o.removeEvent=function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent?t.detachEvent("on"+e,i):t["on"+e]=o.noop},o.bindEvents=function(t,e,i){var n=t.events=t.events||{};o.each(e,function(e){n[e]=function(){i.apply(t,arguments)},o.addEvent(t.chart.canvas,e,n[e])})},o.unbindEvents=function(t,e){var i=t.chart.canvas;o.each(e,function(t,e){o.removeEvent(i,e,t)})},o.getConstraintWidth=function(t){return a(t,"max-width","clientWidth")},o.getConstraintHeight=function(t){return a(t,"max-height","clientHeight")},o.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(o.getStyle(e,"padding-left"),10),n=parseInt(o.getStyle(e,"padding-right"),10),a=e.clientWidth-i-n,r=o.getConstraintWidth(t);return isNaN(r)?a:Math.min(a,r)},o.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(o.getStyle(e,"padding-top"),10),n=parseInt(o.getStyle(e,"padding-bottom"),10),a=e.clientHeight-i-n,r=o.getConstraintHeight(t);return isNaN(r)?a:Math.min(a,r)},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t){var e=t.ctx,i=t.canvas,n=i.width,a=i.height,o=t.currentDevicePixelRatio=window.devicePixelRatio||1;1!==o&&(i.height=a*o,i.width=n*o,e.scale(o,o),t.originalDevicePixelRatio=t.originalDevicePixelRatio||o),i.style.width=n+"px",i.style.height=a+"px"},o.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},o.fontString=function(t,e,i){return e+" "+t+"px "+i},o.longestText=function(t,e,i,n){n=n||{};var a=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(a=n.data={},r=n.garbageCollect=[],n.font=e),t.font=e;var s=0;o.each(i,function(e){void 0!==e&&null!==e&&!0!==o.isArray(e)?s=o.measureText(t,a,r,s,e):o.isArray(e)&&o.each(e,function(e){void 0===e||null===e||o.isArray(e)||(s=o.measureText(t,a,r,s,e))})});var l=r.length/2;if(l>i.length){for(var c=0;l>c;c++)delete a[r[c]];r.splice(0,l)}return s},o.measureText=function(t,e,i,n,a){var o=e[a];return o||(o=e[a]=t.measureText(a).width,i.push(a)),o>n&&(n=o),n},o.numberOfLabelLines=function(t){var e=1;return o.each(t,function(t){o.isArray(t)&&t.length>e&&(e=t.length)}),e},o.drawRoundedRectangle=function(t,e,i,n,a,o){t.beginPath(),t.moveTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+a-o),t.quadraticCurveTo(e+n,i+a,e+n-o,i+a),t.lineTo(e+o,i+a),t.quadraticCurveTo(e,i+a,e,i+a-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath()},o.color=function(e){return n?n(e instanceof CanvasGradient?t.defaults.global.defaultColor:e):(console.error("Color.js not found!"),e)},o.addResizeListener=function(t,e){var i=document.createElement("iframe"),n="chartjs-hidden-iframe";i.classlist?i.classlist.add(n):i.setAttribute("class",n),i.tabIndex=-1;var a=i.style;a.width="100%",a.display="block",a.border=0,a.height=0,a.margin=0,a.position="absolute",a.left=0,a.right=0,a.top=0,a.bottom=0,t.insertBefore(i,t.firstChild),(i.contentWindow||i).onresize=function(){return e?e():void 0}},o.removeResizeListener=function(t){var e=t.querySelector(".chartjs-hidden-iframe");e&&e.parentNode.removeChild(e)},o.isArray=Array.isArray?function(t){return Array.isArray(t)}:function(t){return"[object Array]"===Object.prototype.toString.call(t)},o.arrayEquals=function(t,e){var i,n,a,r;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;n>i;++i)if(a=t[i],r=e[i],a instanceof Array&&r instanceof Array){if(!o.arrayEquals(a,r))return!1}else if(a!==r)return!1;return!0},o.callCallback=function(t,e,i){t&&"function"==typeof t.call&&t.apply(i,e)},o.getHoverColor=function(t){return t instanceof CanvasPattern?t:o.color(t).saturate(.5).darken(.1).rgbString()}}},{3:3}],27:[function(t,e,i){"use strict";e.exports=function(){var t=function(e,i){var n=this,a=t.helpers;return n.config=i||{data:{datasets:[]}},e.length&&e[0].getContext&&(e=e[0]),e.getContext&&(e=e.getContext("2d")),n.ctx=e,n.canvas=e.canvas,e.canvas.style.display=e.canvas.style.display||"block",n.width=e.canvas.width||parseInt(a.getStyle(e.canvas,"width"),10)||a.getMaximumWidth(e.canvas),n.height=e.canvas.height||parseInt(a.getStyle(e.canvas,"height"),10)||a.getMaximumHeight(e.canvas),n.aspectRatio=n.width/n.height,(isNaN(n.aspectRatio)||!1===isFinite(n.aspectRatio))&&(n.aspectRatio=void 0!==i.aspectRatio?i.aspectRatio:2),n.originalCanvasStyleWidth=e.canvas.style.width,n.originalCanvasStyleHeight=e.canvas.style.height,a.retinaScale(n),n.controller=new t.Controller(n),a.addResizeListener(e.canvas.parentNode,function(){n.controller&&n.controller.config.options.responsive&&n.controller.resize()}),n.controller?n.controller:n};return t.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"single",animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},legendCallback:function(t){var e=[];e.push('
    ');for(var i=0;i'),t.data.datasets[i].label&&e.push(t.data.datasets[i].label),e.push("");return e.push("
"),e.join("")}}},t.Chart=t,t}},{}],28:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),t.boxes.push(e)},removeBox:function(t,e){t.boxes&&t.boxes.splice(t.boxes.indexOf(e),1)},update:function(t,i,n){function a(t){var e,i=t.isHorizontal();i?(e=t.update(t.options.fullWidth?f:w,k),b-=e.height):(e=t.update(y,v),w-=e.width),x.push({horizontal:i,minSize:e,box:t})}function o(t){var i=e.findNextWhere(x,function(e){return e.box===t}) ;if(i)if(t.isHorizontal()){var n={left:D,right:C,top:0,bottom:0};t.update(t.options.fullWidth?f:w,g/2,n)}else t.update(i.minSize.width,b)}function r(t){var i=e.findNextWhere(x,function(e){return e.box===t}),n={left:0,right:0,top:_,bottom:M};i&&t.update(i.minSize.width,b,n)}function s(t){t.isHorizontal()?(t.left=t.options.fullWidth?l:D,t.right=t.options.fullWidth?i-l:D+w,t.top=A,t.bottom=A+t.height,A=t.bottom):(t.left=Y,t.right=Y+t.width,t.top=_,t.bottom=_+b,Y=t.right)}if(t){var l=0,c=e.where(t.boxes,function(t){return"left"===t.options.position}),u=e.where(t.boxes,function(t){return"right"===t.options.position}),d=e.where(t.boxes,function(t){return"top"===t.options.position}),h=e.where(t.boxes,function(t){return"bottom"===t.options.position}),p=e.where(t.boxes,function(t){return"chartArea"===t.options.position});d.sort(function(t,e){return(e.options.fullWidth?1:0)-(t.options.fullWidth?1:0)}),h.sort(function(t,e){return(t.options.fullWidth?1:0)-(e.options.fullWidth?1:0)});var f=i-2*l,g=n-0,m=f/2,v=g/2,y=(i-m)/(c.length+u.length),k=(n-v)/(d.length+h.length),w=f,b=g,x=[];e.each(c.concat(u,d,h),a);var D=l,C=l,_=0,M=0;e.each(c.concat(u),o),e.each(c,function(t){D+=t.width}),e.each(u,function(t){C+=t.width}),e.each(d.concat(h),o),e.each(d,function(t){_+=t.height}),e.each(h,function(t){M+=t.height}),e.each(c.concat(u),r),D=l,C=l,_=0,M=0,e.each(c,function(t){D+=t.width}),e.each(u,function(t){C+=t.width}),e.each(d,function(t){_+=t.height}),e.each(h,function(t){M+=t.height});var S=n-_-M,T=i-D-C;(T!==w||S!==b)&&(e.each(c,function(t){t.height=S}),e.each(u,function(t){t.height=S}),e.each(d,function(t){t.options.fullWidth||(t.width=T)}),e.each(h,function(t){t.options.fullWidth||(t.width=T)}),b=S,w=T);var Y=l,A=0;e.each(c.concat(d),s),Y+=w,A+=b,e.each(u,s),e.each(h,s),t.chartArea={left:D,top:_,right:D+w,bottom:_+b},e.each(p,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(w,b)})}}}}},{}],29:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i=e.noop;t.defaults.global.legend={display:!0,position:"top",fullWidth:!0,reverse:!1,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var i=t.data;return e.isArray(i.datasets)?i.datasets.map(function(i,n){return{text:i.label,fillStyle:e.isArray(i.backgroundColor)?i.backgroundColor[0]:i.backgroundColor,hidden:!t.isDatasetVisible(n),lineCap:i.borderCapStyle,lineDash:i.borderDash,lineDashOffset:i.borderDashOffset,lineJoin:i.borderJoinStyle,lineWidth:i.borderWidth,strokeStyle:i.borderColor,pointStyle:i.pointStyle,datasetIndex:n}},this):[]}}},t.Legend=t.Element.extend({initialize:function(t){e.extend(this,t),this.legendHitBoxes=[],this.doughnutMode=!1},beforeUpdate:i,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate: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;t.legendItems=t.options.labels.generateLabels.call(t,t.chart),t.options.reverse&&t.legendItems.reverse()},afterBuildLabels:i,beforeFit:i,fit:function(){var i=this,n=i.options,a=n.labels,o=n.display,r=i.ctx,s=t.defaults.global,l=e.getValueOrDefault,c=l(a.fontSize,s.defaultFontSize),u=l(a.fontStyle,s.defaultFontStyle),d=l(a.fontFamily,s.defaultFontFamily),h=e.fontString(c,u,d),p=i.legendHitBoxes=[],f=i.minSize,g=i.isHorizontal();if(g?(f.width=i.maxWidth,f.height=o?10:0):(f.width=o?10:0,f.height=i.maxHeight),o)if(r.font=h,g){var m=i.lineWidths=[0],v=i.legendItems.length?c+a.padding:0;r.textAlign="left",r.textBaseline="top",e.each(i.legendItems,function(t,e){var n=a.usePointStyle?c*Math.sqrt(2):a.boxWidth,o=n+c/2+r.measureText(t.text).width;m[m.length-1]+o+a.padding>=i.width&&(v+=c+a.padding,m[m.length]=i.left),p[e]={left:0,top:0,width:o,height:c},m[m.length-1]+=o+a.padding}),f.height+=v}else{var y=a.padding,k=i.columnWidths=[],w=a.padding,b=0,x=0,D=c+y;e.each(i.legendItems,function(t,e){var i=a.usePointStyle?2*a.boxWidth:a.boxWidth,n=i+c/2+r.measureText(t.text).width;x+D>f.height&&(w+=b+a.padding,k.push(b),b=0,x=0),b=Math.max(b,n),x+=D,p[e]={left:0,top:0,width:n,height:c}}),w+=b,k.push(b),f.width+=w}i.width=f.width,i.height=f.height},afterFit:i,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var i=this,n=i.options,a=n.labels,o=t.defaults.global,r=o.elements.line,s=i.width,l=i.lineWidths;if(n.display){var c,u=i.ctx,d=e.getValueOrDefault,h=d(a.fontColor,o.defaultFontColor),p=d(a.fontSize,o.defaultFontSize),f=d(a.fontStyle,o.defaultFontStyle),g=d(a.fontFamily,o.defaultFontFamily),m=e.fontString(p,f,g);u.textAlign="left",u.textBaseline="top",u.lineWidth=.5,u.strokeStyle=h,u.fillStyle=h,u.font=m;var v=a.boxWidth,y=i.legendHitBoxes,k=function(e,i,a){if(!(isNaN(v)||0>=v)){u.save(),u.fillStyle=d(a.fillStyle,o.defaultColor),u.lineCap=d(a.lineCap,r.borderCapStyle),u.lineDashOffset=d(a.lineDashOffset,r.borderDashOffset),u.lineJoin=d(a.lineJoin,r.borderJoinStyle),u.lineWidth=d(a.lineWidth,r.borderWidth),u.strokeStyle=d(a.strokeStyle,o.defaultColor);var s=0===d(a.lineWidth,r.borderWidth);if(u.setLineDash&&u.setLineDash(d(a.lineDash,r.borderDash)),n.labels&&n.labels.usePointStyle){var l=p*Math.SQRT2/2,c=l/Math.SQRT2,h=e+c,f=i+c;t.canvasHelpers.drawPoint(u,a.pointStyle,l,h,f)}else s||u.strokeRect(e,i,v,p),u.fillRect(e,i,v,p);u.restore()}},w=function(t,e,i,n){u.fillText(i.text,v+p/2+t,e),i.hidden&&(u.beginPath(),u.lineWidth=2,u.moveTo(v+p/2+t,e+p/2),u.lineTo(v+p/2+t+n,e+p/2),u.stroke())},b=i.isHorizontal();c=b?{x:i.left+(s-l[0])/2,y:i.top+a.padding,line:0}:{x:i.left+a.padding,y:i.top+a.padding,line:0};var x=p+a.padding;e.each(i.legendItems,function(t,e){var n=u.measureText(t.text).width,o=a.usePointStyle?p+p/2+n:v+p/2+n,r=c.x,d=c.y;b?r+o>=s&&(d=c.y+=x,c.line++,r=c.x=i.left+(s-l[c.line])/2):d+x>i.bottom&&(r=c.x=r+i.columnWidths[c.line]+a.padding,d=c.y=i.top,c.line++),k(r,d,t),y[e].left=r,y[e].top=d,w(r,d,t,n),b?c.x+=o+a.padding:c.y+=x})}},handleEvent:function(t){var i=this,n=i.options,a="mouseup"===t.type?"click":t.type;if("mousemove"===a){if(!n.onHover)return}else{if("click"!==a)return;if(!n.onClick)return}var o=e.getRelativePosition(t,i.chart.chart),r=o.x,s=o.y;if(r>=i.left&&r<=i.right&&s>=i.top&&s<=i.bottom)for(var l=i.legendHitBoxes,c=0;c=u.left&&r<=u.left+u.width&&s>=u.top&&s<=u.top+u.height){if("click"===a){n.onClick.call(i,t,i.legendItems[c]);break}if("mousemove"===a){n.onHover.call(i,t,i.legendItems[c]);break}}}}}),t.plugins.register({beforeInit:function(e){var i=e.options,n=i.legend;n&&(e.legend=new t.Legend({ctx:e.chart.ctx,options:n,chart:e}),t.layoutService.addBox(e,e.legend))}})}},{}],30:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers.noop;t.plugins={_plugins:[],register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)})},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)})},clear:function(){this._plugins=[]},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e){var i,n,a=this._plugins,o=a.length;for(i=0;o>i;++i)if(n=a[i],"function"==typeof n[t]&&!1===n[t].apply(n,e||[]))return!1;return!0}},t.PluginBase=t.Element.extend({beforeInit:e,afterInit:e,beforeUpdate:e,afterUpdate:e,beforeDraw:e,afterDraw:e,destroy:e}),t.pluginService=t.plugins}},{}],31:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers;t.defaults.scale={display:!0,position:"left",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)",offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{labelString:"",display:!1},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:10,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:function(t){return e.isArray(t)?t:""+t}}},t.Scale=t.Element.extend({beforeUpdate:function(){e.callCallback(this.options.beforeUpdate,[this])},update:function(t,i,n){var a=this;return a.beforeUpdate(),a.maxWidth=t,a.maxHeight=i,a.margins=e.extend({left:0,right:0,top:0,bottom:0},n),a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeDataLimits(),a.determineDataLimits(),a.afterDataLimits(),a.beforeBuildTicks(),a.buildTicks(),a.afterBuildTicks(),a.beforeTickToLabelConversion(),a.convertTicksToLabels(),a.afterTickToLabelConversion(),a.beforeCalculateTickRotation(),a.calculateTickRotation(),a.afterCalculateTickRotation(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:function(){e.callCallback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){e.callCallback(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(){e.callCallback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){e.callCallback(this.options.beforeDataLimits,[this])},determineDataLimits:e.noop,afterDataLimits:function(){e.callCallback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){e.callCallback(this.options.beforeBuildTicks,[this])},buildTicks:e.noop,afterBuildTicks:function(){e.callCallback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){e.callCallback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this;t.ticks=t.ticks.map(function(e,i,n){return t.options.ticks.userCallback?t.options.ticks.userCallback(e,i,n):t.options.ticks.callback(e,i,n)},t)},afterTickToLabelConversion:function(){e.callCallback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){e.callCallback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var i=this,n=i.ctx,a=t.defaults.global,o=i.options.ticks,r=e.getValueOrDefault(o.fontSize,a.defaultFontSize),s=e.getValueOrDefault(o.fontStyle,a.defaultFontStyle),l=e.getValueOrDefault(o.fontFamily,a.defaultFontFamily),c=e.fontString(r,s,l);n.font=c;var u,d=n.measureText(i.ticks[0]).width,h=n.measureText(i.ticks[i.ticks.length-1]).width;if(i.labelRotation=o.minRotation||0,i.paddingRight=0,i.paddingLeft=0,i.options.display&&i.isHorizontal()){i.paddingRight=h/2+3,i.paddingLeft=d/2+3,i.longestTextCache||(i.longestTextCache={});for(var p,f,g=e.longestText(n,c,i.ticks,i.longestTextCache),m=g,v=i.getPixelForTick(1)-i.getPixelForTick(0)-6;m>v&&i.labelRotationi.yLabelWidth&&(i.paddingLeft=u+r/2),i.paddingRight=r/2,f*g>i.maxHeight){i.labelRotation--;break}i.labelRotation++,m=p*g}}i.margins&&(i.paddingLeft=Math.max(i.paddingLeft-i.margins.left,0),i.paddingRight=Math.max(i.paddingRight-i.margins.right,0))},afterCalculateTickRotation:function(){e.callCallback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){e.callCallback(this.options.beforeFit,[this])},fit:function(){var i=this,n=i.minSize={width:0,height:0},a=i.options,o=t.defaults.global,r=a.ticks,s=a.scaleLabel,l=a.gridLines,c=a.display,u=i.isHorizontal(),d=e.getValueOrDefault(r.fontSize,o.defaultFontSize),h=e.getValueOrDefault(r.fontStyle,o.defaultFontStyle),p=e.getValueOrDefault(r.fontFamily,o.defaultFontFamily),f=e.fontString(d,h,p),g=e.getValueOrDefault(s.fontSize,o.defaultFontSize),m=a.gridLines.tickMarkLength;if(n.width=u?i.isFullWidth()?i.maxWidth-i.margins.left-i.margins.right:i.maxWidth:c&&l.drawTicks?m:0,n.height=u?c&&l.drawTicks?m:0:i.maxHeight,s.display&&c&&(u?n.height+=1.5*g:n.width+=1.5*g),r.display&&c){i.longestTextCache||(i.longestTextCache={});var v=e.longestText(i.ctx,f,i.ticks,i.longestTextCache),y=e.numberOfLabelLines(i.ticks),k=.5*d;if(u){i.longestLabelWidth=v;var w=Math.sin(e.toRadians(i.labelRotation))*i.longestLabelWidth+d*y+k*y;n.height=Math.min(i.maxHeight,n.height+w),i.ctx.font=f;var b=i.ctx.measureText(i.ticks[0]).width,x=i.ctx.measureText(i.ticks[i.ticks.length-1]).width,D=Math.cos(e.toRadians(i.labelRotation)),C=Math.sin(e.toRadians(i.labelRotation));i.paddingLeft=0!==i.labelRotation?D*b+3:b/2+3,i.paddingRight=0!==i.labelRotation?C*(d/2)+3:x/2+3}else{var _=i.maxWidth-n.width;r.mirror?v=0:v+=i.options.ticks.padding,_>v?n.width+=v:n.width=i.maxWidth,i.paddingTop=d/2,i.paddingBottom=d/2}}i.margins&&(i.paddingLeft=Math.max(i.paddingLeft-i.margins.left,0),i.paddingTop=Math.max(i.paddingTop-i.margins.top,0),i.paddingRight=Math.max(i.paddingRight-i.margins.right,0),i.paddingBottom=Math.max(i.paddingBottom-i.margins.bottom,0)),i.width=n.width,i.height=n.height},afterFit:function(){e.callCallback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){return null===t||void 0===t?NaN:"number"==typeof t&&isNaN(t)?NaN:"object"==typeof t?t instanceof Date||t.isValid?t:this.getRightValue(this.isHorizontal()?t.x:t.y):t},getLabelForIndex:e.noop,getPixelForValue:e.noop,getValueForPixel:e.noop,getPixelForTick:function(t,e){var i=this;if(i.isHorizontal()){var n=i.width-(i.paddingLeft+i.paddingRight),a=n/Math.max(i.ticks.length-(i.options.gridLines.offsetGridLines?0:1),1),o=a*t+i.paddingLeft;e&&(o+=a/2);var r=i.left+Math.round(o);return r+=i.isFullWidth()?i.margins.left:0}var s=i.height-(i.paddingTop+i.paddingBottom);return i.top+t*(s/(i.ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var i=e.width-(e.paddingLeft+e.paddingRight),n=i*t+e.paddingLeft,a=e.left+Math.round(n);return a+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){var t=this,e=t.min,i=t.max;return t.getPixelForValue(t.beginAtZero?0:0>e&&0>i?i:e>0&&i>0?e:0)},draw:function(i){var n=this,a=n.options;if(a.display){var o,r,s=n.ctx,l=t.defaults.global,c=a.ticks,u=a.gridLines,d=a.scaleLabel,h=0!==n.labelRotation,p=c.autoSkip,f=n.isHorizontal();c.maxTicksLimit&&(r=c.maxTicksLimit);var g=e.getValueOrDefault(c.fontColor,l.defaultFontColor),m=e.getValueOrDefault(c.fontSize,l.defaultFontSize),v=e.getValueOrDefault(c.fontStyle,l.defaultFontStyle),y=e.getValueOrDefault(c.fontFamily,l.defaultFontFamily),k=e.fontString(m,v,y),w=u.tickMarkLength,b=e.getValueOrDefault(u.borderDash,l.borderDash),x=e.getValueOrDefault(u.borderDashOffset,l.borderDashOffset),D=e.getValueOrDefault(d.fontColor,l.defaultFontColor),C=e.getValueOrDefault(d.fontSize,l.defaultFontSize),_=e.getValueOrDefault(d.fontStyle,l.defaultFontStyle),M=e.getValueOrDefault(d.fontFamily,l.defaultFontFamily),S=e.fontString(C,_,M),T=e.toRadians(n.labelRotation),Y=Math.cos(T),A=n.longestLabelWidth*Y;s.fillStyle=g;var O=[];if(f){if(o=!1,h&&(A/=2),(A+c.autoSkipPadding)*n.ticks.length>n.width-(n.paddingLeft+n.paddingRight)&&(o=1+Math.floor((A+c.autoSkipPadding)*n.ticks.length/(n.width-(n.paddingLeft+n.paddingRight)))),r&&n.ticks.length>r)for(;!o||n.ticks.length/(o||1)>r;)o||(o=1),o+=1;p||(o=!1)}var $="right"===a.position?n.left:n.right-w,P="right"===a.position?n.left+w:n.right,I="bottom"===a.position?n.top:n.bottom-w,E="bottom"===a.position?n.top+w:n.bottom;if(e.each(n.ticks,function(t,r){if(void 0!==t&&null!==t){var s=n.ticks.length===r+1;if((!(o>1&&r%o>0||r%o==0&&r+o>=n.ticks.length)||s)&&void 0!==t&&null!==t){var l,d;r===(void 0!==n.zeroLineIndex?n.zeroLineIndex:0)?(l=u.zeroLineWidth,d=u.zeroLineColor):(l=e.getValueAtIndexOrDefault(u.lineWidth,r),d=e.getValueAtIndexOrDefault(u.color,r));var p,g,m,v,y,k,D,C,_,M,S="middle",Y="middle";if(f){h||(Y="top"===a.position?"bottom":"top"),S=h?"right":"center";var A=n.getPixelForTick(r)+e.aliasPixel(l);_=n.getPixelForTick(r,u.offsetGridLines)+c.labelOffset,M=h?n.top+12:"top"===a.position?n.bottom-w:n.top+w,p=m=y=D=A,g=I,v=E,k=i.top,C=i.bottom}else{"left"===a.position?c.mirror?(_=n.right+c.padding,S="left"):(_=n.right-c.padding,S="right"):c.mirror?(_=n.left-c.padding,S="right"):(_=n.left+c.padding,S="left");var L=n.getPixelForTick(r);L+=e.aliasPixel(l),M=n.getPixelForTick(r,u.offsetGridLines),p=$,m=P,y=i.left,D=i.right,g=v=k=C=L}O.push({tx1:p,ty1:g,tx2:m,ty2:v,x1:y,y1:k,x2:D,y2:C,labelX:_,labelY:M,glWidth:l,glColor:d,glBorderDash:b,glBorderDashOffset:x,rotation:-1*T,label:t,textBaseline:Y,textAlign:S})}}}),e.each(O,function(t){if(u.display&&(s.save(),s.lineWidth=t.glWidth,s.strokeStyle=t.glColor,s.setLineDash&&(s.setLineDash(t.glBorderDash),s.lineDashOffset=t.glBorderDashOffset),s.beginPath(),u.drawTicks&&(s.moveTo(t.tx1,t.ty1),s.lineTo(t.tx2,t.ty2)),u.drawOnChartArea&&(s.moveTo(t.x1,t.y1),s.lineTo(t.x2,t.y2)),s.stroke(),s.restore()),c.display){s.save(),s.translate(t.labelX,t.labelY),s.rotate(t.rotation),s.font=k,s.textBaseline=t.textBaseline,s.textAlign=t.textAlign;var i=t.label;if(e.isArray(i))for(var n=0,a=-(i.length-1)*m*.75;ne;++e){var o=t[e];if(o&&o.hasValue()){var r=o.tooltipPosition();n.push(r.x),a.push(r.y)}}var s=0,l=0;for(e=0;e0){var o=t[0];o.xLabel?i=o.xLabel:a>0&&o.indexe;++e)f.push(n(c[e]));s.itemSort&&(f=f.sort(function(t,e){return s.itemSort(t,e,u)})),c.length>1&&a.each(f,function(t){h.push(s.callbacks.labelColor.call(r,t,d))}),a.extend(l,{title:r.getTitle(f,u),beforeBody:r.getBeforeBody(f,u),body:r.getBody(f,u),afterBody:r.getAfterBody(f,u),footer:r.getFooter(f,u),x:Math.round(p.x),y:Math.round(p.y),caretPadding:a.getValueOrDefault(p.padding,2),labelColors:h});var g=r.getTooltipSize(l);r.determineAlignment(g),a.extend(l,r.getBackgroundPoint(l,g))}else r._model.opacity=0;return t&&s.custom&&s.custom.call(r,l),r},getTooltipSize:function(t){var e=this._chart.ctx,i={height:2*t.yPadding,width:0},n=t.body,o=n.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);o+=t.beforeBody.length+t.afterBody.length;var r=t.title.length,s=t.footer.length,l=t.titleFontSize,c=t.bodyFontSize,u=t.footerFontSize;i.height+=r*l,i.height+=(r-1)*t.titleSpacing,i.height+=r?t.titleMarginBottom:0,i.height+=o*c,i.height+=o?(o-1)*t.bodySpacing:0,i.height+=s?t.footerMarginTop:0,i.height+=s*u,i.height+=s?(s-1)*t.footerSpacing:0;var d=0,h=function(t){i.width=Math.max(i.width,e.measureText(t).width+d)};return e.font=a.fontString(l,t._titleFontStyle,t._titleFontFamily),a.each(t.title,h),e.font=a.fontString(c,t._bodyFontStyle,t._bodyFontFamily),a.each(t.beforeBody.concat(t.afterBody),h),d=n.length>1?c+2:0,a.each(n,function(t){a.each(t.before,h),a.each(t.lines,h),a.each(t.after,h)}),d=0,e.font=a.fontString(u,t._footerFontStyle,t._footerFontFamily),a.each(t.footer,h),i.width+=2*t.xPadding,i},determineAlignment:function(t){var e=this,i=e._model,n=e._chart,a=e._chartInstance.chartArea;i.yn.height-t.height&&(i.yAlign="bottom");var o,r,s,l,c,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2;"center"===i.yAlign?(o=function(t){return u>=t},r=function(t){return t>u}):(o=function(e){return e<=t.width/2},r=function(e){return e>=n.width-t.width/2}),s=function(e){return e+t.width>n.width},l=function(e){return e-t.width<0},c=function(t){return d>=t?"top":"bottom"},o(i.x)?(i.xAlign="left",s(i.x)&&(i.xAlign="center",i.yAlign=c(i.y))):r(i.x)&&(i.xAlign="right",l(i.x)&&(i.xAlign="center",i.yAlign=c(i.y)))},getBackgroundPoint:function(t,e){var i={x:t.x,y:t.y},n=t.caretSize,a=t.caretPadding,o=t.cornerRadius,r=t.xAlign,s=t.yAlign,l=n+a,c=o+a;return"right"===r?i.x-=e.width:"center"===r&&(i.x-=e.width/2),"top"===s?i.y+=l:i.y-="bottom"===s?e.height+l:e.height/2,"center"===s?"left"===r?i.x+=l:"right"===r&&(i.x-=l):"left"===r?i.x-=c:"right"===r&&(i.x+=c),i},drawCaret:function(t,e,i){var n,o,r,s,l,c,u=this._view,d=this._chart.ctx,h=u.caretSize,p=u.cornerRadius,f=u.xAlign,g=u.yAlign,m=t.x,v=t.y,y=e.width,k=e.height;"center"===g?("left"===f?(n=m,o=n-h,r=n):(n=m+y,o=n+h,r=n),l=v+k/2,s=l-h,c=l+h):("left"===f?(n=m+p,o=n+h,r=o+h):"right"===f?(n=m+y-p,o=n-h,r=o-h):(o=m+y/2,n=o-h,r=o+h),"top"===g?(s=v,l=s-h,c=s):(s=v+k,l=s+h,c=s));var w=a.color(u.backgroundColor);d.fillStyle=w.alpha(i*w.alpha()).rgbString(),d.beginPath(),d.moveTo(n,s),d.lineTo(o,l),d.lineTo(r,c),d.closePath(),d.fill()},drawTitle:function(t,e,i,n){var o=e.title;if(o.length){i.textAlign=e._titleAlign,i.textBaseline="top";var r=e.titleFontSize,s=e.titleSpacing,l=a.color(e.titleFontColor);i.fillStyle=l.alpha(n*l.alpha()).rgbString(),i.font=a.fontString(r,e._titleFontStyle,e._titleFontFamily);var c,u;for(c=0,u=o.length;u>c;++c)i.fillText(o[c],t.x,t.y),t.y+=r+s,c+1===o.length&&(t.y+=e.titleMarginBottom-s)}},drawBody:function(t,e,i,n){var o=e.bodyFontSize,r=e.bodySpacing,s=e.body;i.textAlign=e._bodyAlign,i.textBaseline="top";var l=a.color(e.bodyFontColor),c=l.alpha(n*l.alpha()).rgbString();i.fillStyle=c,i.font=a.fontString(o,e._bodyFontStyle,e._bodyFontFamily);var u=0,d=function(e){i.fillText(e,t.x+u,t.y),t.y+=o+r};a.each(e.beforeBody,d);var h=s.length>1;u=h?o+2:0,a.each(s,function(r,s){a.each(r.before,d),a.each(r.lines,function(r){h&&(i.fillStyle=a.color(e.legendColorBackground).alpha(n).rgbaString(),i.fillRect(t.x,t.y,o,o),i.strokeStyle=a.color(e.labelColors[s].borderColor).alpha(n).rgbaString(),i.strokeRect(t.x,t.y,o,o),i.fillStyle=a.color(e.labelColors[s].backgroundColor).alpha(n).rgbaString(),i.fillRect(t.x+1,t.y+1,o-2,o-2),i.fillStyle=c),d(r)}),a.each(r.after,d)}),u=0,a.each(e.afterBody,d),t.y-=r},drawFooter:function(t,e,i,n){var o=e.footer;if(o.length){t.y+=e.footerMarginTop,i.textAlign=e._footerAlign,i.textBaseline="top";var r=a.color(e.footerFontColor);i.fillStyle=r.alpha(n*r.alpha()).rgbString(),i.font=a.fontString(e.footerFontSize,e._footerFontStyle,e._footerFontFamily),a.each(o,function(n){i.fillText(n,t.x,t.y),t.y+=e.footerFontSize+e.footerSpacing})}},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i=this.getTooltipSize(e),n={x:e.x,y:e.y},o=Math.abs(e.opacity<.001)?0:e.opacity;if(this._options.enabled){var r=a.color(e.backgroundColor);t.fillStyle=r.alpha(o*r.alpha()).rgbString(),a.drawRoundedRectangle(t,n.x,n.y,i.width,i.height,e.cornerRadius),t.fill(),this.drawCaret(n,i,o),n.x+=e.xPadding,n.y+=e.yPadding,this.drawTitle(n,e,t,o),this.drawBody(n,e,t,o),this.drawFooter(n,e,t,o)}}}})}},{}],35:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i=t.defaults.global;i.elements.arc={backgroundColor:i.defaultColor,borderColor:"#fff",borderWidth:2},t.elements.Arc=t.Element.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)l;)l+=2*Math.PI;for(;o>l;)o-=2*Math.PI;for(;s>o;)o+=2*Math.PI;var c=o>=s&&l>=o,u=r>=n.innerRadius&&r<=n.outerRadius;return c&&u}return!1},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t=this._chart.ctx,e=this._view,i=e.startAngle,n=e.endAngle;t.beginPath(),t.arc(e.x,e.y,e.outerRadius,i,n),t.arc(e.x,e.y,e.innerRadius,n,i,!0),t.closePath(),t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,t.fillStyle=e.backgroundColor,t.fill(),t.lineJoin="bevel",e.borderWidth&&t.stroke()}})}},{}],36:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i=t.defaults.global;t.defaults.global.elements.line={tension:.4,backgroundColor:i.defaultColor,borderWidth:3,borderColor:i.defaultColor,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0},t.elements.Line=t.Element.extend({draw:function(){function t(t,e){var i=e._view;!0===e._view.steppedLine?(l.lineTo(i.x,t._view.y),l.lineTo(i.x,i.y)):0===e._view.tension?l.lineTo(i.x,i.y):l.bezierCurveTo(t._view.controlPointNextX,t._view.controlPointNextY,i.controlPointPreviousX,i.controlPointPreviousY,i.x,i.y)} var n=this,a=n._view,o=a.spanGaps,r=a.scaleZero,s=n._loop,l=n._chart.ctx;l.save();var c=n._children.slice(),u=-1;s&&c.length&&c.push(c[0]);var d,h,p,f;if(c.length&&a.fill){for(l.beginPath(),d=0;dd;d++)e.lineTo.apply(e,t(d));e.fill(),i.borderWidth&&e.stroke()},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){var i=this._view;return!!i&&(i.y=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.y&&e<=i.base:t>=i.x-i.width/2&&t<=i.x+i.width/2&&e>=i.base&&e<=i.y)},inLabelRange:function(t){var e=this._view;return!!e&&(t>=e.x-e.width/2&&t<=e.x+e.width/2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}})}},{}],39:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={position:"bottom"},n=t.Scale.extend({getLabels:function(){var t=this.chart.data;return(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels},determineDataLimits:function(){var t=this,i=t.getLabels();t.minIndex=0,t.maxIndex=i.length-1;var n;void 0!==t.options.ticks.min&&(n=e.indexOf(i,t.options.ticks.min),t.minIndex=-1!==n?n:t.minIndex),void 0!==t.options.ticks.max&&(n=e.indexOf(i,t.options.ticks.max),t.maxIndex=-1!==n?n:t.maxIndex),t.min=i[t.minIndex],t.max=i[t.maxIndex]},buildTicks:function(){var t=this,e=t.getLabels();t.ticks=0===t.minIndex&&t.maxIndex===e.length-1?e:e.slice(t.minIndex,t.maxIndex+1)},getLabelForIndex:function(t,e){var i=this,n=i.chart.data,a=i.isHorizontal();return n.xLabels&&a||n.yLabels&&!a?i.getRightValue(n.datasets[e].data[t]):i.ticks[t]},getPixelForValue:function(t,e,i,n){var a=this,o=Math.max(a.maxIndex+1-a.minIndex-(a.options.gridLines.offsetGridLines?0:1),1);if(void 0!==t&&isNaN(e)){var r=a.getLabels(),s=r.indexOf(t);e=-1!==s?s:e}if(a.isHorizontal()){var l=a.width-(a.paddingLeft+a.paddingRight),c=l/o,u=c*(e-a.minIndex)+a.paddingLeft;return(a.options.gridLines.offsetGridLines&&n||a.maxIndex===a.minIndex&&n)&&(u+=c/2),a.left+Math.round(u)}var d=a.height-(a.paddingTop+a.paddingBottom),h=d/o,p=h*(e-a.minIndex)+a.paddingTop;return a.options.gridLines.offsetGridLines&&n&&(p+=h/2),a.top+Math.round(p)},getPixelForTick:function(t,e){return this.getPixelForValue(this.ticks[t],t+this.minIndex,null,e)},getValueForPixel:function(t){var e=this,i=Math.max(e.ticks.length-(e.options.gridLines.offsetGridLines?0:1),1),n=e.isHorizontal(),a=n?e.width-(e.paddingLeft+e.paddingRight):e.height-(e.paddingTop+e.paddingBottom),o=a/i;return t-=n?e.left:e.top,e.options.gridLines.offsetGridLines&&(t-=o/2),t-=n?e.paddingLeft:e.paddingTop,0>=t?0:Math.round(t/o)},getBasePixel:function(){return this.bottom}});t.scaleService.registerScaleType("category",n,i)}},{}],40:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={position:"left",ticks:{callback:function(t,i,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var o=e.log10(Math.abs(a)),r="";if(0!==t){var s=-1*Math.floor(o);s=Math.max(Math.min(s,20),0),r=t.toFixed(s)}else r="0";return r}}},n=t.LinearScaleBase.extend({determineDataLimits:function(){function t(t){return s?t.xAxisID===i.id:t.yAxisID===i.id}var i=this,n=i.options,a=i.chart,o=a.data,r=o.datasets,s=i.isHorizontal();if(i.min=null,i.max=null,n.stacked){var l={};e.each(r,function(o,r){var s=a.getDatasetMeta(r);void 0===l[s.type]&&(l[s.type]={positiveValues:[],negativeValues:[]});var c=l[s.type].positiveValues,u=l[s.type].negativeValues;a.isDatasetVisible(r)&&t(s)&&e.each(o.data,function(t,e){var a=+i.getRightValue(t);isNaN(a)||s.data[e].hidden||(c[e]=c[e]||0,u[e]=u[e]||0,n.relativePoints?c[e]=100:0>a?u[e]+=a:c[e]+=a)})}),e.each(l,function(t){var n=t.positiveValues.concat(t.negativeValues),a=e.min(n),o=e.max(n);i.min=null===i.min?a:Math.min(i.min,a),i.max=null===i.max?o:Math.max(i.max,o)})}else e.each(r,function(n,o){var r=a.getDatasetMeta(o);a.isDatasetVisible(o)&&t(r)&&e.each(n.data,function(t,e){var n=+i.getRightValue(t);isNaN(n)||r.data[e].hidden||(null===i.min?i.min=n:ni.max&&(i.max=n))})});this.handleTickRangeOptions()},getTickLimit:function(){var i,n=this,a=n.options.ticks;if(n.isHorizontal())i=Math.min(a.maxTicksLimit?a.maxTicksLimit:11,Math.ceil(n.width/50));else{var o=e.getValueOrDefault(a.fontSize,t.defaults.global.defaultFontSize);i=Math.min(a.maxTicksLimit?a.maxTicksLimit:11,Math.ceil(n.height/(2*o)))}return i},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e,i,n=this,a=n.paddingLeft,o=n.paddingBottom,r=n.start,s=+n.getRightValue(t),l=n.end-r;return n.isHorizontal()?(i=n.width-(a+n.paddingRight),e=n.left+i/l*(s-r),Math.round(e+a)):(i=n.height-(n.paddingTop+o),e=n.bottom-o-i/l*(s-r),Math.round(e))},getValueForPixel:function(t){var e=this,i=e.isHorizontal(),n=e.paddingLeft,a=e.paddingBottom,o=i?e.width-(n+e.paddingRight):e.height-(e.paddingTop+a),r=(i?t-e.left-n:e.bottom-a-t)/o;return e.start+(e.end-e.start)*r},getPixelForTick:function(t){return this.getPixelForValue(this.ticksAsNumbers[t])}});t.scaleService.registerScaleType("linear",n,i)}},{}],41:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i=e.noop;t.LinearScaleBase=t.Scale.extend({handleTickRangeOptions:function(){var t=this,i=t.options,n=i.ticks;if(n.beginAtZero){var a=e.sign(t.min),o=e.sign(t.max);0>a&&0>o?t.max=0:a>0&&o>0&&(t.min=0)}void 0!==n.min?t.min=n.min:void 0!==n.suggestedMin&&(t.min=Math.min(t.min,n.suggestedMin)),void 0!==n.max?t.max=n.max:void 0!==n.suggestedMax&&(t.max=Math.max(t.max,n.suggestedMax)),t.min===t.max&&(t.max++,n.beginAtZero||t.min--)},getTickLimit:i,handleDirectionalChanges:i,buildTicks:function(){var t=this,i=t.options,n=t.ticks=[],a=i.ticks,o=e.getValueOrDefault,r=t.getTickLimit();r=Math.max(2,r);var s;if(a.fixedStepSize&&a.fixedStepSize>0||a.stepSize&&a.stepSize>0)s=o(a.fixedStepSize,a.stepSize);else{var l=e.niceNum(t.max-t.min,!1);s=e.niceNum(l/(r-1),!0)}var c=Math.floor(t.min/s)*s,u=Math.ceil(t.max/s)*s,d=(u-c)/s;d=e.almostEquals(d,Math.round(d),s/1e3)?Math.round(d):Math.ceil(d),n.push(void 0!==a.min?a.min:c);for(var h=1;d>h;++h)n.push(c+h*s);n.push(void 0!==a.max?a.max:u),t.handleDirectionalChanges(),t.max=e.max(n),t.min=e.min(n),a.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),t.Scale.prototype.convertTicksToLabels.call(e)}})}},{}],42:[function(t,e,i){"use strict";e.exports=function(t){var e=t.helpers,i={position:"left",ticks:{callback:function(t,i,n){var a=t/Math.pow(10,Math.floor(e.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===i||i===n.length-1?t.toExponential():""}}},n=t.Scale.extend({determineDataLimits:function(){function t(t){return c?t.xAxisID===i.id:t.yAxisID===i.id}var i=this,n=i.options,a=n.ticks,o=i.chart,r=o.data,s=r.datasets,l=e.getValueOrDefault,c=i.isHorizontal();if(i.min=null,i.max=null,i.minNotZero=null,n.stacked){var u={};e.each(s,function(a,r){var s=o.getDatasetMeta(r);o.isDatasetVisible(r)&&t(s)&&(void 0===u[s.type]&&(u[s.type]=[]),e.each(a.data,function(t,e){var a=u[s.type],o=+i.getRightValue(t);isNaN(o)||s.data[e].hidden||(a[e]=a[e]||0,n.relativePoints?a[e]=100:a[e]+=o)}))}),e.each(u,function(t){var n=e.min(t),a=e.max(t);i.min=null===i.min?n:Math.min(i.min,n),i.max=null===i.max?a:Math.max(i.max,a)})}else e.each(s,function(n,a){var r=o.getDatasetMeta(a);o.isDatasetVisible(a)&&t(r)&&e.each(n.data,function(t,e){var n=+i.getRightValue(t);isNaN(n)||r.data[e].hidden||(null===i.min?i.min=n:ni.max&&(i.max=n),0!==n&&(null===i.minNotZero||nt.max&&(t.max=n))})}}),t.handleTickRangeOptions()},getTickLimit:function(){var t=this.options.ticks,n=e.getValueOrDefault(t.fontSize,i.defaultFontSize);return Math.min(t.maxTicksLimit?t.maxTicksLimit:11,Math.ceil(this.drawingArea/(1.5*n)))},convertTicksToLabels:function(){var e=this;t.LinearScaleBase.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map(e.options.pointLabels.callback,e)},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t,n,a,o,r,s,l,c,u,d,h,p,f=this.options.pointLabels,g=e.getValueOrDefault(f.fontSize,i.defaultFontSize),m=e.getValueOrDefault(f.fontStyle,i.defaultFontStyle),v=e.getValueOrDefault(f.fontFamily,i.defaultFontFamily),y=e.fontString(g,m,v),k=e.min([this.height/2-g-5,this.width/2]),w=this.width,b=0;for(this.ctx.font=y,n=0;nw&&(w=t.x+o,r=n),t.x-oD?t.x+a>w&&(w=t.x+a,r=n):t.x-ae&&0>i?i:e>0&&i>0?e:0)},draw:function(){var t=this,n=t.options,a=n.gridLines,o=n.ticks,r=n.angleLines,s=n.pointLabels,l=e.getValueOrDefault;if(n.display){var c=t.ctx,u=l(o.fontSize,i.defaultFontSize),d=l(o.fontStyle,i.defaultFontStyle),h=l(o.fontFamily,i.defaultFontFamily),p=e.fontString(u,d,h);if(e.each(t.ticks,function(r,s){if(s>0||n.reverse){var d=t.getDistanceFromCenterForValue(t.ticksAsNumbers[s]),h=t.yCenter-d;if(a.display&&0!==s)if(c.strokeStyle=e.getValueAtIndexOrDefault(a.color,s-1),c.lineWidth=e.getValueAtIndexOrDefault(a.lineWidth,s-1),n.lineArc)c.beginPath(),c.arc(t.xCenter,t.yCenter,d,0,2*Math.PI),c.closePath(),c.stroke();else{c.beginPath();for(var f=0;f=0;k--){if(r.display){var w=t.getPointPosition(k,f);c.beginPath(),c.moveTo(t.xCenter,t.yCenter),c.lineTo(w.x,w.y),c.stroke(),c.closePath()}var b=t.getPointPosition(k,f+5),x=l(s.fontColor,i.defaultFontColor);c.font=y,c.fillStyle=x;var D=t.pointLabels,C=this.getIndexAngle(k)+Math.PI/2,_=360*C/(2*Math.PI)%360;c.textAlign=0===_||180===_?"center":180>_?"left":"right",c.textBaseline=90===_||270===_?"middle":_>270||90>_?"bottom":"top",c.fillText(D[k]?D[k]:"",b.x,b.y)}}}}});t.scaleService.registerScaleType("radialLinear",a,n)}},{}],44:[function(t,e,i){"use strict";var n=t(1);n="function"==typeof n?n:window.moment,e.exports=function(t){var e=t.helpers,i={units:[{name:"millisecond",steps:[1,2,5,10,20,50,100,250,500]},{name:"second",steps:[1,2,5,10,30]},{name:"minute",steps:[1,2,5,10,30]},{name:"hour",steps:[1,2,3,6,12]},{name:"day",steps:[1,2,5]},{name:"week",maxStep:4},{name:"month",maxStep:3},{name:"quarter",maxStep:4},{name:"year",maxStep:!1}]},a={position:"bottom",time:{parser:!1,format:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm:ss a",hour:"MMM D, hA",day:"ll",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"}},ticks:{autoSkip:!1}},o=t.Scale.extend({initialize:function(){if(!n)throw new Error("Chart.js - Moment.js could not be found! You must include it before Chart.js to use the time scale. Download at https://momentjs.com");t.Scale.prototype.initialize.call(this)},getLabelMoment:function(t,e){return null===t||null===e?null:void 0!==this.labelMoments[t]?this.labelMoments[t][e]:null},getLabelDiff:function(t,e){var i=this;return null===t||null===e?null:(void 0===i.labelDiffs&&i.buildLabelDiffs(),void 0!==i.labelDiffs[t]?i.labelDiffs[t][e]:null)},getMomentStartOf:function(t){var e=this;return"week"===e.options.time.unit&&!1!==e.options.time.isoWeekday?t.clone().startOf("isoWeek").isoWeekday(e.options.time.isoWeekday):t.clone().startOf(e.tickUnit)},determineDataLimits:function(){var t=this;t.labelMoments=[];var i=[];t.chart.data.labels&&t.chart.data.labels.length>0?(e.each(t.chart.data.labels,function(e){var n=t.parseTime(e);n.isValid()&&(t.options.time.round&&n.startOf(t.options.time.round),i.push(n))},t),t.firstTick=n.min.call(t,i),t.lastTick=n.max.call(t,i)):(t.firstTick=null,t.lastTick=null),e.each(t.chart.data.datasets,function(a,o){var r=[],s=t.chart.isDatasetVisible(o);"object"==typeof a.data[0]&&null!==a.data[0]?e.each(a.data,function(e){var i=t.parseTime(t.getRightValue(e));i.isValid()&&(t.options.time.round&&i.startOf(t.options.time.round),r.push(i),s&&(t.firstTick=null!==t.firstTick?n.min(t.firstTick,i):i,t.lastTick=null!==t.lastTick?n.max(t.lastTick,i):i))},t):r=i,t.labelMoments.push(r)},t),t.options.time.min&&(t.firstTick=t.parseTime(t.options.time.min)),t.options.time.max&&(t.lastTick=t.parseTime(t.options.time.max)),t.firstTick=(t.firstTick||n()).clone(),t.lastTick=(t.lastTick||n()).clone()},buildLabelDiffs:function(){var t=this;t.labelDiffs=[];var i=[];t.chart.data.labels&&t.chart.data.labels.length>0&&e.each(t.chart.data.labels,function(e){var n=t.parseTime(e);n.isValid()&&(t.options.time.round&&n.startOf(t.options.time.round),i.push(n.diff(t.firstTick,t.tickUnit,!0)))},t),e.each(t.chart.data.datasets,function(n){var a=[];"object"==typeof n.data[0]&&null!==n.data[0]?e.each(n.data,function(e){var i=t.parseTime(t.getRightValue(e));i.isValid()&&(t.options.time.round&&i.startOf(t.options.time.round),a.push(i.diff(t.firstTick,t.tickUnit,!0)))},t):a=i,t.labelDiffs.push(a)},t)},buildTicks:function(){var n=this;n.ctx.save();var a=e.getValueOrDefault(n.options.ticks.fontSize,t.defaults.global.defaultFontSize),o=e.getValueOrDefault(n.options.ticks.fontStyle,t.defaults.global.defaultFontStyle),r=e.getValueOrDefault(n.options.ticks.fontFamily,t.defaults.global.defaultFontFamily),s=e.fontString(a,o,r);if(n.ctx.font=s,n.ticks=[],n.unitScale=1,n.scaleSizeInUnits=0,n.options.time.unit)n.tickUnit=n.options.time.unit||"day",n.displayFormat=n.options.time.displayFormats[n.tickUnit],n.scaleSizeInUnits=n.lastTick.diff(n.firstTick,n.tickUnit,!0),n.unitScale=e.getValueOrDefault(n.options.time.unitStepSize,1);else{var l=n.isHorizontal()?n.width-(n.paddingLeft+n.paddingRight):n.height-(n.paddingTop+n.paddingBottom),c=n.tickFormatFunction(n.firstTick,0,[]),u=n.ctx.measureText(c).width;u=u*Math.cos(e.toRadians(n.options.ticks.maxRotation))+a*Math.sin(e.toRadians(n.options.ticks.maxRotation));var d=l/u;n.tickUnit=n.options.time.minUnit,n.scaleSizeInUnits=n.lastTick.diff(n.firstTick,n.tickUnit,!0),n.displayFormat=n.options.time.displayFormats[n.tickUnit];for(var h=0,p=i.units[h];h=Math.ceil(n.scaleSizeInUnits/d)){n.unitScale=e.getValueOrDefault(n.options.time.unitStepSize,p.steps[f]);break}break}if(!1===p.maxStep||Math.ceil(n.scaleSizeInUnits/d)k?n.lastTick=n.getMomentStartOf(n.lastTick.add(1,n.tickUnit)):k>=0&&(n.lastTick=y),n.scaleSizeInUnits=n.lastTick.diff(n.firstTick,n.tickUnit,!0)}n.options.time.displayFormat&&(n.displayFormat=n.options.time.displayFormat),n.ticks.push(n.firstTick.clone());for(var w=1;w<=n.scaleSizeInUnits;++w){var b=v.clone().add(w,n.tickUnit);if(n.options.time.max&&b.diff(n.lastTick,n.tickUnit,!0)>=0)break;w%n.unitScale==0&&n.ticks.push(b)}(0!==n.ticks[n.ticks.length-1].diff(n.lastTick,n.tickUnit)||0===n.scaleSizeInUnits)&&(n.options.time.max?(n.ticks.push(n.lastTick.clone()),n.scaleSizeInUnits=n.lastTick.diff(n.ticks[0],n.tickUnit,!0)):(n.ticks.push(n.lastTick.clone()),n.scaleSizeInUnits=n.lastTick.diff(n.firstTick,n.tickUnit,!0))),n.ctx.restore(),n.labelDiffs=void 0},getLabelForIndex:function(t,e){var i=this,n=i.chart.data.labels&&t10&&(e.files=e.files.slice(0,10)),i?$("#category_source").prop("checked",!0):$("#file_source").prop("checked",!0),this.setupDataSourceSelector(),this.setInitialChartType(e.category?1:e.files.length),this.getFileInfo(e.files.unique()).then(function(e){var i=Object.keys(e.entities);if(!i.length)return t.resetView(!1,!1);t.setSelect2Defaults(t.underscorePageNames(i))})}},{key:"getFileInfo",value:function(t){var e=this,i=$.Deferred(),n=Object.keys(this.entityInfo.entities);if(t=t.filter(function(t){return!n.includes(t)}),!t.length)return i.resolve({});try{t=t.map(function(t){return encodeURIComponent(decodeURIComponent("File:"+t))})}catch(t){}return $.ajax({url:"https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=mediatype|size|timestamp&formatversion=2&format=json&titles="+t.join("|"),dataType:"jsonp"}).done(function(n){n.query.normalized&&n.query.normalized.forEach(function(e){t[t.indexOf(encodeURIComponent(e.from))]=encodeURIComponent(e.to)});var a={};return t.forEach(function(t){try{t=decodeURIComponent(t)}catch(t){}var i=n.query.pages.find(function(e){return e.title===t});return i.missing?void e.writeMessage(e.getFileLink(t)+": "+$.i18n("api-error-no-data")):(i=i.imageinfo&&i.imageinfo[0]?i.imageinfo[0]:{},["AUDIO","VIDEO"].includes(i.mediatype)?void(a[t.replace(/^File:/,"")]=Object.assign({title:t},i)):void e.toastWarn($.i18n("invalid-media-file",e.getFileLink(t))))}),e.entityInfo={entities:a},i.resolve(e.entityInfo)}).fail(function(){i.resolve({})}),i}},{key:"getCategoryInfo",value:function(t){var e=this,i=$.Deferred();return t=t.replace(/^Category:/,""),$.ajax({url:"https://commons.wikimedia.org/w/api.php?action=query&prop=categoryinfo&titles=Category:"+t+"&format=json&formatversion=2",dataType:"jsonp"}).done(function(a){a.query.normalized&&(t=a.query.normalized[0].to.replace(/^Category:/,""));var o=a.query.pages[0];if(!o||o.missing)return i.reject(e.getCategoryLink(t)+": "+$.i18n("api-error-no-data"));o=o.categoryinfo;var r=n({},t.replace(/^Category:/,""),Object.assign({title:t},o));return e.entityInfo={entities:r},i.resolve(e.entityInfo)}).fail(function(){i.resolve({})}),i}},{key:"getParams",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};return this.specialRange&&t?e.range=this.specialRange.range:(e.start=this.daterangepicker.startDate.format("YYYY-MM-DD"),e.end=this.daterangepicker.endDate.format("YYYY-MM-DD")),this.noLogScale&&(e.autolog="false"),e}},{key:"pushParams",value:function(){var t=this.getEntities(),e=this.isCategory()?"category":"files";window.history&&window.history.replaceState&&window.history.replaceState({},document.title,"?"+$.param(this.getParams())+"&"+e+"="+t.join("|")),$(".permalink").prop("href","?"+$.param(this.getPermaLink())+"&"+e+"="+t.join("%7C"))}},{key:"getEntities",value:function(){return this.isCategory()?[$("#category-input").val().score()]:$(this.config.select2Input).select2("val")||[]}},{key:"setupSelect2",value:function(){var t=this,e=$(this.config.select2Input),i=this.isCategory(),n={ajax:{url:"https://commons.wikimedia.org/w/api.php",dataType:"jsonp",delay:200,jsonpCallback:"fileSuggestionCallback",data:function(e){return{action:"query",list:"prefixsearch",format:"json",pssearch:e.term||"",psnamespace:t.isCategory()?14:6,cirrusUseCompletionSuggester:"yes"}}, -processResults:function(e){var n=e?e.query:{},a=[];if(!n)return{results:a};if(n.prefixsearch.length){var o=n.prefixsearch.map(function(t){return t.title});i||(o=o.filter(function(t){return!/\.(png|jpe?g|gif|svg|pdf|djvu)$/.test(t.toLowerCase())})),a=o.map(function(e){var n=t.stripNamespace(e,i);return{id:n.score(),text:n}})}return{results:a}},cache:!0},placeholder:$.i18n("article-placeholder"),maximumSelectionLength:10,minimumInputLength:1};e.select2(n),e.off("select2:select").on("select2:select",this.processInput.bind(this)),e.off("select2:unselect").on("select2:unselect",function(i){t.processInput(!1,i.params.data.text),e.trigger("select2:close")})}},{key:"setupCategorySearch",value:function(){this.typeahead&&this.typeahead.destroy(),$("#category-input").typeahead({ajax:{url:"https://commons.wikimedia.org/w/api.php",timeout:200,triggerLength:1,method:"get",preDispatch:function(t){return{action:"query",list:"prefixsearch",format:"json",pssearch:t,psnamespace:14}},preProcess:function(t){return t.query.prefixsearch.map(function(t){return t.title.replace(/^Category:/,"")})}}})}},{key:"setState",value:function(t,e){switch($("main").removeClass(this.config.formStates.join(" ")).addClass(t),t){case"initial":this.updateProgressBar(0),this.clearMessages(),this.destroyChart(),$(".output").removeClass("list-mode").removeClass("chart-mode"),$("aside").removeClass("disabled"),$(".data-links").addClass("invisible"),this.typeahead&&this.typeahead.hide(),$(this.config.sourceInput).val("").focus(),"function"==typeof e&&e.call(this);break;case"processing":this.processStarted(),this.clearMessages(),document.activeElement.blur(),$(".progress-bar").addClass("active"),$("aside").addClass("disabled");break;case"complete":this.processEnded(),this.updateProgressBar(0),$(".progress-bar").removeClass("active"),$(".data-links").removeClass("invisible"),$("aside").removeClass("disabled")}}},{key:"setupListeners",value:function(){var t=this;l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setupListeners",this).call(this),$(".sort-link").on("click",function(e){var i=$(e.currentTarget).data("type");t.direction=t.sort===i?-t.direction:1,t.sort=i,t.updateTable()}),$(".clear-pages").on("click",function(){t.resetView(!0),t.focusSelect2()}),$("#pv_form").on("submit",function(e){e.preventDefault(),t.processInput()}),$(".another-query").on("click",function(){t.setState("initial"),t.pushParams(!0)})}},{key:"setupDataSourceSelector",value:function(){var t=this;$(".data-source").on("change",function(e){t.resetView(),"category"===e.target.value?t.setupCategoryInterface():t.setupFileInterface()})}},{key:"setupCategoryInterface",value:function(){this.resetSelect2(!1),$(".num-entities-info").hide(),$(".file-selector").hide(),$(".category-selector").show(),$("#category-input").val("").focus(),this.setupCategorySearch()}},{key:"setupFileInterface",value:function(){$(".num-entities-info").show(),$(".file-selector").show(),$(".category-selector").hide(),this.resetSelect2(),this.focusSelect2()}},{key:"resetView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"resetView",this).call(this,t,i),$(".output-list").html(""),$(".single-entity-stats").html(""),$(".single-entity-legend").html(""),$(".file-selector").removeClass("disabled")}},{key:"processInput",value:function(t,e){this.pushParams(),(t||location.search!==this.params||this.prevChartType!==this.chartType)&&(this.prevChartType&&this.clearMessages(),this.params=location.search,this.isCategory()?this.processCategory():this.processFiles(e))}},{key:"processFiles",value:function(t){var e=this,i=$(c.select2Input).select2("val")||[];if(!i.length)return this.resetView();this.patchUsage(),this.setInitialChartType(i.length),this.prevChartType&&this.clearMessages(),this.prevChartType=this.chartType,this.destroyChart(),this.startSpinny(),t?(this.outputData=this.outputData.filter(function(e){return e.label!==t.descore()}),this.outputData=this.outputData.map(function(t){return Object.assign({},t,e.config.chartConfig[e.chartType].dataset(t.color))}),delete this.entityInfo.entities[t],this.updateChart()):this.getFileInfo(i).then(function(t){e.getPlayCounts(i,!1).done(function(t){var n=i.map(function(t){return"File:"+t});e.getPageViewsData(n).done(function(i){i=e.buildChartData(i.datasets,n,"views"),i.forEach(function(t){var i=t.label.replace(/^File:/,"");e.entityInfo.entities[i]&&Object.assign(e.entityInfo.entities[i],{pageviews:t.sum,pageviewsAvg:t.average})}),e.updateChart(t)})})})}},{key:"processCategory",value:function(){var t=this;this.setState("processing"),this.patchUsage(),this.getCategoryInfo($("#category-input").val()).then(function(){}).fail(function(e){t.setState("initial"),"string"==typeof e?t.writeMessage(e):t.writeMessage($.i18n("api-error-unknown","Wikidata"))})}},{key:"getMPCApiUrl",value:function(t,e,i){arguments.length>3&&void 0!==arguments[3]&&arguments[3];return"/mediaviews/api.php?endpoint=https://partnermetrics.wmflabs.org/mediaplaycounts/api/2/file_playcount/date_range/"+t+"/"+e.format(this.config.mpcDateFormat)+"/"+i.format(this.config.mpcDateFormat)}},{key:"getPlayCounts",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=$.Deferred(),a=t.length,o=[],r=0,s=this.daterangepicker.startDate.startOf("day"),l=this.daterangepicker.endDate.startOf("day"),c={entities:t,labels:[],datasets:new Array(a),errors:[],fatalErrors:[],promises:[]},u=function(t,u){var d=e.getMPCApiUrl(t,s,l,i),h=$.ajax({url:d,dataType:"json"});c.promises.push(h),h.done(function(i){try{var n=c.entities.indexOf(t);c.datasets[n]=i.details,i.details&&!c.labels.length&&(c.labels=i.details.map(function(t){return moment(t.date,e.config.mpcDateFormat).format(e.dateFormat)}))}catch(t){return c.fatalErrors.push(t)}}).fail(function(n){var a=c.entities.indexOf(t);c.entities.splice(a,1),c.datasets.splice(a,1);var o=e.getFileLink(t,i);c.errors.push(o+": "+$.i18n("api-error","Playcounts API")+" - "+n.responseJSON.title)}).always(function(){++r===a&&(n.resolve(c),o.length&&e.writeMessage($.i18n("api-error-timeout","
    "+o.map(function(t){return"
  • "+e.getFileLink(t,i)+"
  • "}).join("")+"
")))})};return t.forEach(function(t,e){return u(t)}),n}},{key:"updateTable",value:function(){var t=this;if(1===this.outputData.length)return this.showSingleEntityLegend();$(".single-entity-stats").html(""),$(".output-list").html("");var e=this.outputData.slice().sort(function(e,i){var n=t.getSortProperty(e,t.sort),a=t.getSortProperty(i,t.sort);return na?-t.direction:0});$(".sort-link .glyphicon").removeClass("glyphicon-sort-by-alphabet-alt glyphicon-sort-by-alphabet").addClass("glyphicon-sort");var i=1===parseInt(this.direction,10)?"glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet";$(".sort-link--"+this.sort+" .glyphicon").addClass(i).removeClass("glyphicon-sort"),e.forEach(function(e,i){$(".output-list").append(t.config.templates.tableRow(t,e))});var n=e.reduce(function(t,e){return t+e.sum},0),a={label:$.i18n("num-files",this.formatNumber(e.length),e.length),sum:n,average:Math.round(n/this.numDaysInRange())};["pageviews","duration","size"].forEach(function(t){a[t]=e.reduce(function(e,i){return e+i[t]},0)}),$(".output-list").append(this.config.templates.tableRow(this,a,!0)),$(".table-view").show()}},{key:"getSortProperty",value:function(t,e){return"file"===e?t.title:"playcounts"===e?t.sum:"date"===e?moment(this.formatTimestamp(t.timestamp),this.dateFormat).unix():"type"===e?t.mediatype:Number(t[e])}},{key:"getFileLink",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getPageLink",this).call(this,this.addNamespace(t,i),"commons.wikimedia.org",t.replace(/^(Category|File):/,""))}},{key:"getCategoryLink",value:function(t){return this.getFileLink(t,!0)}},{key:"formatTimestamp",value:function(t){return moment(t.substring(0,10),"YYYY-MM-DD").format(this.dateFormat)}},{key:"getPageviewsLink",value:function(t,e){var i=this.getParams(!1),n=this.addNamespace(encodeURIComponent(t.score()).replace("'",escape),this.isCategory());return""+e+""}},{key:"isCategory",value:function(){return $("#category_source").is(":checked")}},{key:"stripNamespace",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e?"Category":"File";return t=t.replace(new RegExp("^"+n+":"),""),i?n+":"+t:t}},{key:"addNamespace",value:function(t,e){return this.stripNamespace(t,e,!0)}},{key:"showSingleEntityLegend",value:function(){var t=this.outputData[0],e=this.isCategory();$(".table-view").hide(),$(".single-entity-stats").html("\n "+this.getFileLink(this.addNamespace(t.label,e),e)+"\n ·\n \n "+$(this.config.dateRangeSelector).val()+"\n \n ·\n "+$.i18n("num-playcounts",this.formatNumber(t.sum),t.sum)+"\n \n "),$(".single-entity-legend").html(this.config.templates.chartLegend(this))}},{key:"validateParams",value:function(t){return l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"validateParams",this).call(this,t)}},{key:"typeahead",get:function(){return $("#category-input").data("typeahead")}}]),e}(mix(u).with(d,h));$(document).ready(function(){return document.location.hash&&!document.location.search?document.location.href=document.location.href.replace("#","?"):document.location.hash?document.location.href=document.location.href.replace(/\#.*/,""):void new p})},{"../shared/chart_helpers":4,"../shared/list_helpers":6,"../shared/pv":8,"./config":1}],3:[function(t,e,i){"use strict";function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var a={chartLegend:function(t){var e=function(e){var i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=n({},$.i18n("playcounts"),(i={},n(i,$.i18n("playcounts"),t.formatNumber(e.sum)),n(i,$.i18n("daily-average"),t.formatNumber(e.average)),i));if(e.pageviews){var r,s=a?t.formatNumber(e.pageviews):t.getPageviewsLink(e.label,t.formatNumber(e.pageviews));o[$.i18n("pageviews")]=(r={},n(r,$.i18n("pageviews"),s),n(r,$.i18n("daily-average"),t.formatNumber(e.pageviewsAvg)),r)}var l=$.i18n("statistics");if(o[l]={},t.isCategory())e.files&&(o[l][$.i18n("files")]=t.formatNumber(e.files)),e.subcats&&(o[l][$.i18n("subcategories")]=t.formatNumber(e.subcats));else{if(e.duration){var c=Math.round(e.duration);o[l][$.i18n("duration")]=$.i18n("num-seconds",c,t.formatNumber(c))}e.size&&(o[l][$.i18n("size")]=$.i18n("num-bytes",t.formatNumber(e.size),e.size)),e.timestamp&&(o[l][$.i18n("date")]=t.formatTimestamp(e.timestamp)),e.mediatype&&(o[l][$.i18n("file-type")]=e.mediatype.toLowerCase())}var u="";for(var d in o){u+="
\n
"+d+"

\n
";for(var h in o[d]){var p=o[d][h];p&&(u+='\n
\n '+h+":\n \n "+p+"\n \n
")}u+="
"}return u};if(1===t.outputData.length)return e(t.outputData[0]);var i=t.outputData.reduce(function(t,e){return t+e.sum},0),a=t.outputData.reduce(function(t,e){return t+e.pageviews},0),o=t.outputData.reduce(function(t,e){return t+e.size},0);return e({sum:i,average:Math.round(i/t.numDaysInRange()),pageviews:a,pageviewsAvg:Math.round(a/t.numDaysInRange()),duration:t.outputData.reduce(function(t,e){return t+e.duration},0),size:o,sizeAvg:Math.round(o/t.numDaysInRange())},!0)},tableRow:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=i?"th":"td";$(".sort-link--sum .col-heading").text($.i18n("playcounts"));var a="?";return e.pageviews&&(a=i?t.formatNumber(e.pageviews):t.getPageviewsLink(e.label,t.formatNumber(e.pageviews))),"\n \n <"+n+" class='table-view--color-col'>\n \n \n <"+n+" class='table-view--file'>"+(i?e.label:t.getFileLink("File:"+e.label))+"\n <"+n+" class='table-view--playcounts'>"+t.formatNumber(e.sum)+"\n <"+n+" class='table-view--average'>"+t.formatNumber(e.average)+"\n <"+n+" class='table-view--pageviews'>"+a+"\n <"+n+" class='table-view--duration'>"+t.formatNumber(Math.round(e.duration))+"\n <"+n+" class='table-view--size'>"+t.formatNumber(e.size)+"\n <"+n+" class='table-view--date'>"+(i?"":t.formatTimestamp(e.timestamp))+"\n <"+n+" class='table-view--file-type'>"+(i?"":e.mediatype)+"\n \n "}};e.exports=a},{}],4:[function(t,e,i){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:1;"true"===this.rememberChart?this.chartType=this.getFromLocalStorage("pageviews-chart-preference")||this.config.defaults.chartType(t):this.chartType=this.config.defaults.chartType(t)}},{key:"destroyChart",value:function(){this.chartObj&&(this.chartObj.destroy(),$(".chart-legend").html(""))}},{key:"exportCSV",value:function(){var t="data:text/csv;charset=utf-8,Date,",e=[],i=[],n=this.getDateHeadings(!1);n.forEach(function(t,e){i[e]=[t]}),this.chartObj.data.datasets.forEach(function(t){var a='"'+t.label.replace(/"/g,'""')+'"';e.push(a),n.forEach(function(e,n){i[n].push(t.data[n])})}),t=t+e.join(",")+"\n",i.forEach(function(e){t+=e.join(",")+"\n"}),this.downloadData(t,"csv")}},{key:"exportJSON",value:function(){var t=this,e=[];this.chartObj.data.datasets.forEach(function(i,n){var a={page:i.label.replace(/"/g,'"').replace(/'/g,"'"),color:i.strokeColor,sum:i.sum,daily_average:Math.round(i.sum/t.numDaysInRange())};t.getDateHeadings(!1).forEach(function(t,e){a[t.replace(/\\/,"")]=i.data[e]}),e.push(a)});var i="data:text/json;charset=utf-8,"+JSON.stringify(e);this.downloadData(i,"json")}},{key:"exportPNG",value:function(){this.downloadData(this.chartObj.toBase64Image(),"png")}},{key:"fillInZeros",value:function(t,e,i){var n=this,o={};t.items.forEach(function(t){var e=moment(t.timestamp,n.config.timestampFormat).format("YYYYMMDD");o[e]=t}),t.items=[];for(var r=moment(e);r<=i;r.add(1,"day"))if(o[r.format("YYYYMMDD")])t.items.push(o[r.format("YYYYMMDD")]);else{var s=r.isSame(this.maxDate)||r.isSame(moment(this.maxDate).subtract(1,"days"));t.items.push(a({timestamp:r.format(this.config.timestampFormat)},this.isPageviews()?"views":"devices",s?null:0))}return t}},{key:"buildChartData",value:function(t,e,i){var n=this,a=void 0,o=this.isMonthly()?"YYYY-MM":"YYYY-MM-DD",r=this.getDateHeadings(!1);return a=i||(this.isPageviews()?"views":["metaviews","mediaviews"].includes(this.app)||this.isPagecounts()?"count":"devices"),t.map(function(t,i){var s=new Array(r.length),l=0,c=void 0,u=0;t.forEach(function(t){var e=t[a],i=void 0;i="metaviews"===n.app?t.date:"mediaviews"===n.app?moment(t.date,n.config.mpcDateFormat).format(o):moment(t.timestamp,n.config.timestampFormat).format(o),s[r.indexOf(i)]=e,l+=e||0,e>u&&(u=e),(void 0===c||e";e.toastWarn($.i18n("new-article-warning",n))}});var h="siteviews"===e.app?e.getSiteLink(u):e.getPageLink(u,e.project),p="pageviews";e.isUniqueDevices()?p="unique-devices":e.isPagecounts()&&(p="pagecounts"),c.errors.push(h+": "+$.i18n("api-error",p.upcase()+" API")+" - "+n)}}).always(function(){++n===o&&(e.pageViewsData=c,i.resolve(c),r.length&&e.writeMessage($.i18n("api-error-timeout","
    "+r.map(function(t){return"
  • "+e.getPageLink(t,e.project.escape())+"
  • "}).join("")+"
")))})};return t.forEach(function(t,e){return u(t,e)}),i}},{key:"getPermaLink",value:function(){var t=this.getParams(!1);return delete t.range,t}},{key:"isMonthly",value:function(){return"monthly"===$("#date-type-select").val()}},{key:"isLogarithmic",value:function(){return $(this.config.logarithmicCheckbox).is(":checked")&&this.isLogarithmicCapable()}},{key:"isLogarithmicCapable",value:function(){return["line","bar"].includes(this.chartType)}},{key:"printChart",value:function(){var t=window.open();t.document.write(''),t.print(),t.close()}},{key:"resetView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{this.destroyChart(),t&&this.resetSelect2()}catch(t){}finally{this.stopSpinny(),$("body").addClass("initial"),$(this.config.chart).hide(),e&&this.clearMessages()}}},{key:"setChartPointDetectionRadius",value:function(){if("line"===this.chartType){var t=this.getDateHeadings().length;Chart.defaults.global.elements.point.hitRadius=t>50?3:t>30?5:t>20?10:30}}},{key:"shouldBeLogarithmic",value:function(t){var e;if(!this.isLogarithmicCapable()||this.noLogScale)return!1;var i=[];t.forEach(function(t){i.push(t.map(function(t){return t||0}))});var a=Math.max.apply(Math,n((e=[]).concat.apply(e,i)));if(a<=10)return!1;var o=!1;return i.forEach(function(t){t.push(a);var e=t.reduce(function(t,e){return t+e}),i=e/t.length,n=0;if(t.forEach(function(t){return n+=t?t*Math.log(t/i):0}),n/e>.5)return o=!0}),o}},{key:"setupDateRangeSelector",value:function(){var t=this;if(u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setupDateRangeSelector",this).call(this),this.isChartApp()){var i=$(this.config.dateRangeSelector);$(".date-latest a").on("click",function(e){var i=$(e.target).data("value");t.setSpecialRange("latest-"+i),$(".latest-text").text($.i18n("latest-days",i))}),i.on("change",function(e){t.processInput(),$(".latest-text").text($.i18n("latest")),t.specialRange&&t.specialRange.value!==e.target.value&&(t.specialRange=null)})}}},{key:"setupMonthSelector",value:function(t,e){var i=this;this.monthDatepicker&&this.monthDatepicker.destroy(),$(".month-selector").datepicker({autoclose:!0,format:"M yyyy",viewMode:"months",minViewMode:"months",startDate:this.minDate.toDate(),endDate:this.maxMonth,disableTouchKeyboard:!0}),t=t||this.initialMonthStart,e=e||this.maxMonth;var n=function(t,e){return ti.maxMonth&&(e=i.maxMonth),(ee)&&(t=e),[t,e]},a=n(t,e),o=l(a,2);t=o[0],e=o[1],this.monthStartDatepicker.setDate(t),this.monthEndDatepicker.setDate(e),this.daterangepicker.startDate=moment(t).startOf("month"),this.daterangepicker.setEndDate(moment(e).endOf("month"));var r=function(){var t=n(i.monthStartDatepicker.getDate(),i.monthEndDatepicker.getDate()),e=l(t,2),a=e[0],o=e[1];i.daterangepicker.startDate=moment(a).startOf("month"),i.daterangepicker.setEndDate(moment(o).endOf("month"))};$(".month-selector-start").on("hide",r),$(".month-selector-end").on("hide",r)}},{key:"updateChart",value:function(t){var e=this;$(".chart-legend").html("");var i=t?t.entities:$(this.config.select2Input).val();if(!t||!this.showErrors(t)){if(!i.length)return this.stopSpinny();if(1===i.length?$(".multi-page-chart-node").hide():$(".multi-page-chart-node").show(),t&&(this.outputData=this.buildChartData(t.datasets,i)),"true"===this.autoLogDetection){var a=this.shouldBeLogarithmic(this.outputData.map(function(t){return t.data}));$(this.config.logarithmicCheckbox).prop("checked",a),$(".begin-at-zero").toggleClass("disabled",a)}this.outputData=this.setColorsAndLogValues(this.outputData);var o=Object.assign({scales:{}},this.config.chartConfig[this.chartType].opts,this.config.globalChartOpts);this.isLogarithmic()&&(o.scales=Object.assign({},o.scales,{yAxes:[{type:"logarithmic",ticks:{callback:function(t,i,n){var a=t/Math.pow(10,Math.floor(Chart.helpers.log10(t)));return 1===a||2===a||5===a||0===i||i===n.length-1?e.formatNumber(t):""}}}]})),this.stopSpinny();try{$(".chart-container").html("").append(""),this.setChartPointDetectionRadius();var r=$(this.config.chart)[0].getContext("2d"),s=Math.min.apply(Math,n(this.outputData.map(function(t){return t.min})));if(this.config.linearCharts.includes(this.chartType)){var l={labels:this.getDateHeadings(),datasets:this.outputData,dateFormat:this.dateFormat};"radar"===this.chartType?o.scale.ticks.beginAtZero=0===s||$(".begin-at-zero-option").is(":checked"):(o.scales.yAxes[0].ticks.beginAtZero=0===s||$(".begin-at-zero-option").is(":checked"),o.zoom=["pageviews","siteviews","mediaviews"].includes(this.app)&&this.numDaysInRange()>1&&!this.isMonthly()),$(".show-labels-option").is(":checked")?o=this.showPointLabels(o):(delete o.animation.onComplete,delete o.animation.onProgress),this.chartObj=new Chart(r,{type:this.chartType,data:l,options:o})}else delete o.animation.onComplete,delete o.animation.onProgress,this.chartObj=new Chart(r,{type:this.chartType,data:{labels:this.outputData.map(function(t){return t.label}),datasets:[{data:this.outputData.map(function(t){return t.value}),backgroundColor:this.outputData.map(function(t){return t.backgroundColor}),hoverBackgroundColor:this.outputData.map(function(t){return t.hoverBackgroundColor}),averages:this.outputData.map(function(t){return t.average})}]},options:o})}catch(t){return this.showErrors({errors:[],fatalErrors:[t]})}$(".chart-legend").html(this.chartObj.generateLegend()),$(".data-links").removeClass("invisible"),["metaviews","pageviews","siteviews","mediaviews"].includes(this.app)&&this.updateTable()}}},{key:"showPointLabels",value:function(t){if(["bar","line"].includes(this.chartType)){var e=function(t){return t.textAlign="center",t.textBaseline="bottom",t.fillStyle="#444",t.font=Chart.helpers.fontString(Chart.defaults.global.defaultFontSize,Chart.defaults.global.defaultFontStyle,Chart.defaults.global.defaultFontFamily),t},i=function(t,i){var n=t.chart,a=e(n.ctx);Chart.helpers.each(t.data.datasets.forEach(function(e,o){var r=n.controller.getDatasetMeta(o);Chart.helpers.each(r.data.forEach(function(t,n){a.fillStyle="rgba(68,68,68,"+i+")";var o=e._meta[Object.keys(e._meta)[0]].data[n]._yScale.maxHeight,r=(o-t._model.y)/o>=.93?t._model.y+5:t._model.y-10;a.fillText(e.data[n],t._model.x,r)}),t)}),t)};return t.animation.onComplete=function(){i(this,1)},t.animation.onProgress=function(t){var e=t.animationObject;i(this,e.currentStep/e.numSteps)},t}}},{key:"showErrors",value:function(t){var e=this;if(t.fatalErrors.length){this.resetView(!0);var i=t.fatalErrors.unique();return this.showFatalErrors(i),!0}return t.errors.length&&(!t.entities||t.errors.length!==t.entities.length&&t.entities.length||this.resetView(),t.errors.unique().forEach(function(t){return e.writeMessage(t)})),!1}},{key:"monthDatepicker",get:function(){return $(".month-selector").data("datepicker")}},{key:"monthStartDatepicker",get:function(){return $(".month-selector-start").data("datepicker")}},{key:"monthEndDatepicker",get:function(){return $(".month-selector-end").data("datepicker")}}]),e}(t)};e.exports=d},{"./zoom_plugin":11}],5:[function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var i=0;i":">",'"':""","'":"'","/":"/"};return this.replace(/[&<>"'\/]/g,function(e){return t[e]})},Array.prototype.unique=function(){return this.filter(function(t,e,i){return i.indexOf(t)===e})},window.mix=function(t){return new o(t)};var o=function(){function t(e){n(this,t),this.superclass=e}return a(t,[{key:"with",value:function(){for(var t=arguments.length,e=Array(t),i=0;i0&&void 0!==arguments[0]&&arguments[0],i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"resetView",this).call(this,t,i),$(".output-list").html(""),$(".single-entity-stats").html(""),$(".single-entity-legend").html(""),$(".file-selector").removeClass("disabled")}},{key:"processInput",value:function(t,e){this.pushParams(),(t||location.search!==this.params||this.prevChartType!==this.chartType)&&(this.prevChartType&&this.clearMessages(),this.params=location.search,this.isCategory()?this.processCategory():this.processFiles(e))}},{key:"processFiles",value:function(t){var e=this,i=$(c.select2Input).select2("val")||[];if(!i.length)return this.resetView();this.patchUsage(),this.setInitialChartType(i.length),this.prevChartType&&this.clearMessages(),this.prevChartType=this.chartType,this.destroyChart(),this.startSpinny(),t?(this.outputData=this.outputData.filter(function(e){return e.label!==t.descore()}),this.outputData=this.outputData.map(function(t){return Object.assign({},t,e.config.chartConfig[e.chartType].dataset(t.color))}),delete this.entityInfo.entities[t],this.updateChart()):this.getFileInfo(i).then(function(t){e.getPlayCounts(i,!1).done(function(t){var n=i.map(function(t){return"File:"+t});e.getPageViewsData(n).done(function(i){i=e.buildChartData(i.datasets,n,"views"),i.forEach(function(t){var i=t.label.replace(/^File:/,"");e.entityInfo.entities[i]&&Object.assign(e.entityInfo.entities[i],{pageviews:t.sum,pageviewsAvg:t.average})}),e.updateChart(t)})})})}},{key:"processCategory",value:function(){var t=this;this.setState("processing"),this.patchUsage(),this.getCategoryInfo($("#category-input").val()).then(function(){}).fail(function(e){t.setState("initial"),"string"==typeof e?t.writeMessage(e):t.writeMessage($.i18n("api-error-unknown","Wikidata"))})}},{key:"getMPCApiUrl",value:function(t,e,i){arguments.length>3&&void 0!==arguments[3]&&arguments[3];return"/mediaviews/api.php?endpoint=https://tools.wmflabs.org/mediaviews-api/api/2/file_playcount/date_range/"+t+"/"+e.format(this.config.mpcDateFormat)+"/"+i.format(this.config.mpcDateFormat)}},{key:"getPlayCounts",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=$.Deferred(),a=t.length,o=[],r=0,s=this.daterangepicker.startDate.startOf("day"),l=this.daterangepicker.endDate.startOf("day"),c={entities:t,labels:[],datasets:new Array(a),errors:[],fatalErrors:[],promises:[]},u=function(t,u){var d=e.getMPCApiUrl(t,s,l,i),h=$.ajax({url:d,dataType:"json"});c.promises.push(h),h.done(function(i){try{var n=c.entities.indexOf(t);c.datasets[n]=i.details,i.details&&!c.labels.length&&(c.labels=i.details.map(function(t){return moment(t.date,e.config.mpcDateFormat).format(e.dateFormat)}))}catch(t){return c.fatalErrors.push(t)}}).fail(function(n){var a=c.entities.indexOf(t);c.entities.splice(a,1),c.datasets.splice(a,1);var o=e.getFileLink(t,i);c.errors.push(o+": "+$.i18n("api-error","Playcounts API")+" - "+n.responseJSON.title)}).always(function(){++r===a&&(n.resolve(c),o.length&&e.writeMessage($.i18n("api-error-timeout","
    "+o.map(function(t){return"
  • "+e.getFileLink(t,i)+"
  • "}).join("")+"
")))})};return t.forEach(function(t,e){return u(t)}),n}},{key:"updateTable",value:function(){var t=this;if(1===this.outputData.length)return this.showSingleEntityLegend();$(".single-entity-stats").html(""),$(".output-list").html("");var e=this.outputData.slice().sort(function(e,i){var n=t.getSortProperty(e,t.sort),a=t.getSortProperty(i,t.sort);return na?-t.direction:0});$(".sort-link .glyphicon").removeClass("glyphicon-sort-by-alphabet-alt glyphicon-sort-by-alphabet").addClass("glyphicon-sort");var i=1===parseInt(this.direction,10)?"glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet";$(".sort-link--"+this.sort+" .glyphicon").addClass(i).removeClass("glyphicon-sort"),e.forEach(function(e,i){$(".output-list").append(t.config.templates.tableRow(t,e))});var n=e.reduce(function(t,e){return t+e.sum},0),a={label:$.i18n("num-files",this.formatNumber(e.length),e.length),sum:n,average:Math.round(n/this.numDaysInRange())};["pageviews","duration","size"].forEach(function(t){a[t]=e.reduce(function(e,i){return e+i[t]},0)}),$(".output-list").append(this.config.templates.tableRow(this,a,!0)),$(".table-view").show()}},{key:"getSortProperty",value:function(t,e){return"file"===e?t.title:"playcounts"===e?t.sum:"date"===e?moment(this.formatTimestamp(t.timestamp),this.dateFormat).unix():"type"===e?t.mediatype:Number(t[e])}},{key:"getFileLink",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"getPageLink",this).call(this,this.addNamespace(t,i),"commons.wikimedia.org",t.replace(/^(Category|File):/,""))}},{key:"getCategoryLink",value:function(t){return this.getFileLink(t,!0)}},{key:"formatTimestamp",value:function(t){return moment(t.substring(0,10),"YYYY-MM-DD").format(this.dateFormat)}},{key:"getPageviewsLink",value:function(t,e){var i=this.getParams(!1),n=this.addNamespace(encodeURIComponent(t.score()).replace("'",escape),this.isCategory());return""+e+""}},{key:"isCategory",value:function(){return $("#category_source").is(":checked")}},{key:"stripNamespace",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e?"Category":"File";return t=t.replace(new RegExp("^"+n+":"),""),i?n+":"+t:t}},{key:"addNamespace",value:function(t,e){return this.stripNamespace(t,e,!0)}},{key:"showSingleEntityLegend",value:function(){var t=this.outputData[0],e=this.isCategory();$(".table-view").hide(),$(".single-entity-stats").html("\n "+this.getFileLink(this.addNamespace(t.label,e),e)+"\n ·\n \n "+$(this.config.dateRangeSelector).val()+"\n \n ·\n "+$.i18n("num-playcounts",this.formatNumber(t.sum),t.sum)+"\n \n "),$(".single-entity-legend").html(this.config.templates.chartLegend(this))}},{key:"validateParams",value:function(t){return l(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"validateParams",this).call(this,t)}},{key:"typeahead",get:function(){return $("#category-input").data("typeahead")}}]),e}(mix(u).with(d,h));$(document).ready(function(){return document.location.hash&&!document.location.search?document.location.href=document.location.href.replace("#","?"):document.location.hash?document.location.href=document.location.href.replace(/\#.*/,""):void new p})},{"../shared/chart_helpers":4,"../shared/list_helpers":6,"../shared/pv":8,"./config":1}],3:[function(t,e,i){"use strict";function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var a={chartLegend:function(t){var e=function(e){var i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=n({},$.i18n("playcounts"),(i={},n(i,$.i18n("playcounts"),t.formatNumber(e.sum)),n(i,$.i18n("daily-average"),t.formatNumber(e.average)),i));if(e.pageviews){var r,s=a?t.formatNumber(e.pageviews):t.getPageviewsLink(e.label,t.formatNumber(e.pageviews));o[$.i18n("pageviews")]=(r={},n(r,$.i18n("pageviews"),s),n(r,$.i18n("daily-average"),t.formatNumber(e.pageviewsAvg)),r)}var l=$.i18n("statistics");if(o[l]={},t.isCategory())e.files&&(o[l][$.i18n("files")]=t.formatNumber(e.files)),e.subcats&&(o[l][$.i18n("subcategories")]=t.formatNumber(e.subcats));else{if(e.duration){var c=Math.round(e.duration);o[l][$.i18n("duration")]=$.i18n("num-seconds",c,t.formatNumber(c))}e.size&&(o[l][$.i18n("size")]=$.i18n("num-bytes",t.formatNumber(e.size),e.size)),e.timestamp&&(o[l][$.i18n("date")]=t.formatTimestamp(e.timestamp)),e.mediatype&&(o[l][$.i18n("file-type")]=e.mediatype.toLowerCase())}var u="";for(var d in o){u+="
\n
"+d+"

\n
";for(var h in o[d]){var p=o[d][h];p&&(u+='\n
\n '+h+":\n \n "+p+"\n \n
")}u+="
"}return u};if(1===t.outputData.length)return e(t.outputData[0]);var i=t.outputData.reduce(function(t,e){return t+e.sum},0),a=t.outputData.reduce(function(t,e){return t+e.pageviews},0),o=t.outputData.reduce(function(t,e){return t+e.size},0);return e({sum:i,average:Math.round(i/t.numDaysInRange()),pageviews:a,pageviewsAvg:Math.round(a/t.numDaysInRange()),duration:t.outputData.reduce(function(t,e){return t+e.duration},0),size:o,sizeAvg:Math.round(o/t.numDaysInRange())},!0)},tableRow:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=i?"th":"td";$(".sort-link--sum .col-heading").text($.i18n("playcounts"));var a="?";return e.pageviews&&(a=i?t.formatNumber(e.pageviews):t.getPageviewsLink(e.label,t.formatNumber(e.pageviews))),"\n \n <"+n+" class='table-view--color-col'>\n \n \n <"+n+" class='table-view--file'>"+(i?e.label:t.getFileLink("File:"+e.label))+"\n <"+n+" class='table-view--playcounts'>"+t.formatNumber(e.sum)+"\n <"+n+" class='table-view--average'>"+t.formatNumber(e.average)+"\n <"+n+" class='table-view--pageviews'>"+a+"\n <"+n+" class='table-view--duration'>"+t.formatNumber(Math.round(e.duration))+"\n <"+n+" class='table-view--size'>"+t.formatNumber(e.size)+"\n <"+n+" class='table-view--date'>"+(i?"":t.formatTimestamp(e.timestamp))+"\n <"+n+" class='table-view--file-type'>"+(i?"":e.mediatype)+"\n \n "}};e.exports=a},{}],4:[function(t,e,i){"use strict";function n(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:1;"true"===this.rememberChart?this.chartType=this.getFromLocalStorage("pageviews-chart-preference")||this.config.defaults.chartType(t):this.chartType=this.config.defaults.chartType(t)}},{key:"destroyChart",value:function(){this.chartObj&&(this.chartObj.destroy(),$(".chart-legend").html(""))}},{key:"exportCSV",value:function(){var t="data:text/csv;charset=utf-8,Date,",e=[],i=[],n=this.getDateHeadings(!1);n.forEach(function(t,e){i[e]=[t]}),this.chartObj.data.datasets.forEach(function(t){var a='"'+t.label.replace(/"/g,'""')+'"';e.push(a),n.forEach(function(e,n){i[n].push(t.data[n])})}),t=t+e.join(",")+"\n",i.forEach(function(e){t+=e.join(",")+"\n"}),this.downloadData(t,"csv")}},{key:"exportJSON",value:function(){var t=this,e=[];this.chartObj.data.datasets.forEach(function(i,n){var a={page:i.label.replace(/"/g,'"').replace(/'/g,"'"),color:i.strokeColor,sum:i.sum,daily_average:Math.round(i.sum/t.numDaysInRange())};t.getDateHeadings(!1).forEach(function(t,e){a[t.replace(/\\/,"")]=i.data[e]}),e.push(a)});var i="data:text/json;charset=utf-8,"+JSON.stringify(e);this.downloadData(i,"json")}},{key:"exportPNG",value:function(){this.downloadData(this.chartObj.toBase64Image(),"png")}},{key:"fillInZeros",value:function(t,e,i){var n=this,o={};t.items.forEach(function(t){var e=moment(t.timestamp,n.config.timestampFormat).format("YYYYMMDD");o[e]=t}),t.items=[];for(var r=moment(e);r<=i;r.add(1,"day"))if(o[r.format("YYYYMMDD")])t.items.push(o[r.format("YYYYMMDD")]);else{var s=r.isSame(this.maxDate)||r.isSame(moment(this.maxDate).subtract(1,"days"));t.items.push(a({timestamp:r.format(this.config.timestampFormat)},this.isPageviews()?"views":"devices",s?null:0))}return t}},{key:"buildChartData",value:function(t,e,i){var n=this,a=void 0,o=this.isMonthly()?"YYYY-MM":"YYYY-MM-DD",r=this.getDateHeadings(!1);return a=i||(this.isPageviews()?"views":["metaviews","mediaviews"].includes(this.app)||this.isPagecounts()?"count":"devices"),t.map(function(t,i){var s=new Array(r.length),l=0,c=void 0,u=0;t.forEach(function(t){var e=t[a],i=void 0;i="metaviews"===n.app?t.date:"mediaviews"===n.app?moment(t.date,n.config.mpcDateFormat).format(o):moment(t.timestamp,n.config.timestampFormat).format(o),s[r.indexOf(i)]=e,l+=e||0,e>u&&(u=e),(void 0===c||e";e.toastWarn($.i18n("new-article-warning",n))}});var h="siteviews"===e.app?e.getSiteLink(u):e.getPageLink(u,e.project),p="pageviews";e.isUniqueDevices()?p="unique-devices":e.isPagecounts()&&(p="pagecounts"),c.errors.push(h+": "+$.i18n("api-error",p.upcase()+" API")+" - "+n)}}).always(function(){++n===o&&(e.pageViewsData=c,i.resolve(c),r.length&&e.writeMessage($.i18n("api-error-timeout","
    "+r.map(function(t){return"
  • "+e.getPageLink(t,e.project.escape())+"
  • "}).join("")+"
")))})};return t.forEach(function(t,e){return u(t,e)}),i}},{key:"getPermaLink",value:function(){var t=this.getParams(!1);return delete t.range,t}},{key:"isMonthly",value:function(){return"monthly"===$("#date-type-select").val()}},{key:"isLogarithmic",value:function(){return $(this.config.logarithmicCheckbox).is(":checked")&&this.isLogarithmicCapable()}},{key:"isLogarithmicCapable",value:function(){return["line","bar"].includes(this.chartType)}},{key:"printChart",value:function(){var t=window.open();t.document.write(''),t.print(),t.close()}},{key:"resetView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{this.destroyChart(),t&&this.resetSelect2()}catch(t){}finally{this.stopSpinny(),$("body").addClass("initial"),$(this.config.chart).hide(),e&&this.clearMessages()}}},{key:"setChartPointDetectionRadius",value:function(){if("line"===this.chartType){var t=this.getDateHeadings().length;Chart.defaults.global.elements.point.hitRadius=t>50?3:t>30?5:t>20?10:30}}},{key:"shouldBeLogarithmic",value:function(t){var e;if(!this.isLogarithmicCapable()||this.noLogScale)return!1;var i=[];t.forEach(function(t){i.push(t.map(function(t){return t||0}))});var a=Math.max.apply(Math,n((e=[]).concat.apply(e,i)));if(a<=10)return!1;var o=!1;return i.forEach(function(t){t.push(a);var e=t.reduce(function(t,e){return t+e}),i=e/t.length,n=0;if(t.forEach(function(t){return n+=t?t*Math.log(t/i):0}),n/e>.5)return o=!0}),o}},{key:"setupDateRangeSelector",value:function(){var t=this;if(u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"setupDateRangeSelector",this).call(this),this.isChartApp()){var i=$(this.config.dateRangeSelector);$(".date-latest a").on("click",function(e){var i=$(e.target).data("value");t.setSpecialRange("latest-"+i),$(".latest-text").text($.i18n("latest-days",i))}),i.on("change",function(e){t.processInput(),$(".latest-text").text($.i18n("latest")),t.specialRange&&t.specialRange.value!==e.target.value&&(t.specialRange=null)})}}},{key:"setupMonthSelector",value:function(t,e){var i=this;this.monthDatepicker&&this.monthDatepicker.destroy(),$(".month-selector").datepicker({autoclose:!0,format:"M yyyy",viewMode:"months",minViewMode:"months",startDate:this.minDate.toDate(),endDate:this.maxMonth,disableTouchKeyboard:!0}),t=t||this.initialMonthStart,e=e||this.maxMonth;var n=function(t,e){return ti.maxMonth&&(e=i.maxMonth),(ee)&&(t=e),[t,e]},a=n(t,e),o=l(a,2);t=o[0],e=o[1],this.monthStartDatepicker.setDate(t),this.monthEndDatepicker.setDate(e),this.daterangepicker.startDate=moment(t).startOf("month"),this.daterangepicker.setEndDate(moment(e).endOf("month"));var r=function(){var t=n(i.monthStartDatepicker.getDate(),i.monthEndDatepicker.getDate()),e=l(t,2),a=e[0],o=e[1];i.daterangepicker.startDate=moment(a).startOf("month"),i.daterangepicker.setEndDate(moment(o).endOf("month"))};$(".month-selector-start").on("hide",r),$(".month-selector-end").on("hide",r)}},{key:"updateChart",value:function(t){var e=this;$(".chart-legend").html("");var i=t?t.entities:$(this.config.select2Input).val();if(!t||!this.showErrors(t)){if(!i.length)return this.stopSpinny();if(1===i.length?$(".multi-page-chart-node").hide():$(".multi-page-chart-node").show(),t&&(this.outputData=this.buildChartData(t.datasets,i)),"true"===this.autoLogDetection){var a=this.shouldBeLogarithmic(this.outputData.map(function(t){return t.data}));$(this.config.logarithmicCheckbox).prop("checked",a),$(".begin-at-zero").toggleClass("disabled",a)}this.outputData=this.setColorsAndLogValues(this.outputData);var o=Object.assign({scales:{}},this.config.chartConfig[this.chartType].opts,this.config.globalChartOpts);this.isLogarithmic()&&(o.scales=Object.assign({},o.scales,{yAxes:[{type:"logarithmic",ticks:{callback:function(t,i,n){var a=t/Math.pow(10,Math.floor(Chart.helpers.log10(t)));return 1===a||2===a||5===a||0===i||i===n.length-1?e.formatNumber(t):""}}}]})),this.stopSpinny();try{$(".chart-container").html("").append(""),this.setChartPointDetectionRadius();var r=$(this.config.chart)[0].getContext("2d"),s=Math.min.apply(Math,n(this.outputData.map(function(t){return t.min})));if(this.config.linearCharts.includes(this.chartType)){var l={labels:this.getDateHeadings(),datasets:this.outputData,dateFormat:this.dateFormat};"radar"===this.chartType?o.scale.ticks.beginAtZero=0===s||$(".begin-at-zero-option").is(":checked"):(o.scales.yAxes[0].ticks.beginAtZero=0===s||$(".begin-at-zero-option").is(":checked"),o.zoom=["pageviews","siteviews","mediaviews"].includes(this.app)&&this.numDaysInRange()>1&&!this.isMonthly()),$(".show-labels-option").is(":checked")?o=this.showPointLabels(o):(delete o.animation.onComplete,delete o.animation.onProgress),this.chartObj=new Chart(r,{type:this.chartType,data:l,options:o})}else delete o.animation.onComplete,delete o.animation.onProgress,this.chartObj=new Chart(r,{type:this.chartType,data:{labels:this.outputData.map(function(t){return t.label}),datasets:[{data:this.outputData.map(function(t){return t.value}),backgroundColor:this.outputData.map(function(t){return t.backgroundColor}),hoverBackgroundColor:this.outputData.map(function(t){return t.hoverBackgroundColor}),averages:this.outputData.map(function(t){return t.average})}]},options:o})}catch(t){return this.showErrors({errors:[],fatalErrors:[t]})}$(".chart-legend").html(this.chartObj.generateLegend()),$(".data-links").removeClass("invisible"),["metaviews","pageviews","siteviews","mediaviews"].includes(this.app)&&this.updateTable()}}},{key:"showPointLabels",value:function(t){if(["bar","line"].includes(this.chartType)){var e=function(t){return t.textAlign="center",t.textBaseline="bottom",t.fillStyle="#444",t.font=Chart.helpers.fontString(Chart.defaults.global.defaultFontSize,Chart.defaults.global.defaultFontStyle,Chart.defaults.global.defaultFontFamily),t},i=function(t,i){var n=t.chart,a=e(n.ctx);Chart.helpers.each(t.data.datasets.forEach(function(e,o){var r=n.controller.getDatasetMeta(o);Chart.helpers.each(r.data.forEach(function(t,n){a.fillStyle="rgba(68,68,68,"+i+")";var o=e._meta[Object.keys(e._meta)[0]].data[n]._yScale.maxHeight,r=(o-t._model.y)/o>=.93?t._model.y+5:t._model.y-10;a.fillText(e.data[n],t._model.x,r)}),t)}),t)};return t.animation.onComplete=function(){i(this,1)},t.animation.onProgress=function(t){var e=t.animationObject;i(this,e.currentStep/e.numSteps)},t}}},{key:"showErrors",value:function(t){var e=this;if(t.fatalErrors.length){this.resetView(!0);var i=t.fatalErrors.unique();return this.showFatalErrors(i),!0}return t.errors.length&&(!t.entities||t.errors.length!==t.entities.length&&t.entities.length||this.resetView(),t.errors.unique().forEach(function(t){return e.writeMessage(t)})),!1}},{key:"monthDatepicker",get:function(){return $(".month-selector").data("datepicker")}},{key:"monthStartDatepicker",get:function(){return $(".month-selector-start").data("datepicker")}},{key:"monthEndDatepicker",get:function(){return $(".month-selector-end").data("datepicker")}}]),e}(t)};e.exports=d},{"./zoom_plugin":11}],5:[function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var i=0;i":">",'"':""","'":"'","/":"/"};return this.replace(/[&<>"'\/]/g,function(e){return t[e]})},Array.prototype.unique=function(){return this.filter(function(t,e,i){return i.indexOf(t)===e})},window.mix=function(t){return new o(t)};var o=function(){function t(e){n(this,t),this.superclass=e}return a(t,[{key:"with",value:function(){for(var t=arguments.length,e=Array(t),i=0;ia?-e.direction:0});$(".sort-link .glyphicon").removeClass("glyphicon-sort-by-alphabet-alt glyphicon-sort-by-alphabet").addClass("glyphicon-sort");var a=1===parseInt(this.direction,10)?"glyphicon-sort-by-alphabet-alt":"glyphicon-sort-by-alphabet";$(".sort-link--"+this.sort+" .glyphicon").addClass(a).removeClass("glyphicon-sort");try{t(n)}catch(t){this.setState("complete"),this.showFatalErrors([t])}finally{this.pushParams()}this.toggleView(this.view),"complete"!==this.getState()&&this.setState("complete")}},{key:"toggleView",value:function(t){var e=this;if($(".view-btn").removeClass("active"),$(".view-btn--"+t).addClass("active"),$(".output").removeClass("list-mode").removeClass("chart-mode").addClass(t+"-mode"),"chart"===t){this.destroyChart(),this.config.circularCharts.includes(this.chartType)&&(this.chartType="bar");var i=Object.assign({},this.config.chartConfig[this.chartType].opts,this.config.globalChartOpts);if(this.assignOutputDataChartOpts(),this.setChartPointDetectionRadius(),"true"===this.autoLogDetection){var n=this.shouldBeLogarithmic([this.outputData.datasets[0].data]);$(this.config.logarithmicCheckbox).prop("checked",n)}this.isLogarithmic()&&(i.scales=Object.assign({},i.scales,{yAxes:[{type:"logarithmic",ticks:{callback:function(t,i,n){var a=t/Math.pow(10,Math.floor(Chart.helpers.log10(t)));return 1===a||2===a||5===a||0===i||i===n.length-1?e.formatNumber(t):""}}}]})),$(".show-labels-option").is(":checked")?i=this.showPointLabels(i):(delete i.animation.onComplete,delete i.animation.onProgress),"radar"===this.chartType?i.scale.ticks.beginAtZero=$(".begin-at-zero-option").is(":checked"):i.scales.yAxes[0].ticks.beginAtZero=$(".begin-at-zero-option").is(":checked"),this.outputData.labels=this.getDateHeadings();var a=$(this.config.chart)[0].getContext("2d");this.chartObj=new Chart(a,{type:this.chartType,data:this.outputData,options:i}),$(".chart-specific").show(),$("#chart-legend").html(this.chartObj.generateLegend())}else $(".chart-specific").hide();this.pushParams()}},{key:"updateProgressBar",value:function(t,e){if(!e)return $(".progress-bar").css("width","0%"),$(".progress-counter").text("");var i=t/e*100;$(".progress-bar").css("width",i.toFixed(2)+"%"),t===e?$(".progress-counter").text("Building dataset..."):$(".progress-counter").text($.i18n("processing-page",t,e))}}]),e}(t)};e.exports=s},{}],7:[function(t,e,i){"use strict";Array.prototype.includes||(Array.prototype.includes=function(t){return-1!==this.indexOf(t)}),String.prototype.includes||(String.prototype.includes=function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}),"function"!=typeof Object.assign&&function(){Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i>>0,n=arguments[1],a=void 0,o=0;o>>0,n=arguments[1],a=n>>0,o=a<0?Math.max(i+a,0):Math.min(a,i),r=arguments[2],s=void 0===r?i:r>>0,l=s<0?Math.max(i+s,0):Math.min(s,i);oThis is the staging environment!

\n

To use the staging app, append debug=true to the URL

\n

Otherwise, please update your links to use\n https://"+location.host+s+"\n

\n

\n Redirecting you to the production "+document.title+" in\n 10...\n

\n ");var l=10;return setInterval(function(){if(0==--l)return document.location=s;$(".countdown").text(l)},1e3),o(i)}return i.debug?window.app=i:i.splash(),i.loadTranslations(),$.extend($.i18n.parser.emitter,{link:function(t){return''+t[0].escape()+""}}),toastr.options={closeButton:!0,debug:"localhost"===location.host,newestOnTop:!1,progressBar:!1,positionClass:"toast-top-center",preventDuplicates:!0,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"3000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut",toastClass:"alert",iconClasses:{error:"alert-danger",info:"alert-info",success:"alert-success",warning:"alert-warning"}},i}return r(e,t),l(e,[{key:"loadTranslations",value:function(){var t=n({},i18nLang,appPath+"/"+currentApp+"/messages/"+i18nLang+".json");"en"!==i18nLang&&($.i18n.fallbacks[i18nLang]&&$.i18n.fallbacks[i18nLang].forEach(function(e){t[e]=appPath+"/"+currentApp+"/messages/"+e+".json"}),t.en=appPath+"/"+currentApp+"/messages/en.json"),$.i18n({locale:i18nLang}).load(t).then(this.initialize.bind(this))}},{key:"toast",value:function(t){var e=t.title?""+t.title+" ":"";t=Object.assign({message:e+t.message,level:"warning",timeout:10},t),toastr.options.timeOut=1e3*t.timeout,toastr[t.level](t.message)}},{key:"toastSuccess",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.toast({message:t,level:"success",timeout:e})}},{key:"toastInfo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.toast({message:t,level:"info",timeout:e})}},{key:"toastWarn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.toast({message:t,level:"warning",timeout:e})}},{key:"toastError",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;this.toast({message:t,level:"error",timeout:e})}},{key:"addInvalidParamNotice",value:function(t){var e=""+$.i18n("documentation").toLowerCase()+"";this.toastError("\n "+$.i18n("invalid-params")+"\n "+$.i18n("param-error-3",t,e)+"\n ")}},{key:"validateDateRange",value:function(t){if(t.range)this.setSpecialRange(t.range)||(this.addInvalidParamNotice("range"),this.setSpecialRange(this.config.defaults.dateRange));else if(t.start){var e=/\d{4}-\d{2}-\d{2}$/;t.start&&/^\d{4}-\d{2}$/.test(t.start)&&(t.start=t.start+"-01",t.monthly=!0),t.end&&/^\d{4}-\d{2}$/.test(t.end)?t.end=moment(t.end+"-01").endOf("month").format("YYYY-MM-DD"):t.monthly=!1;var i=void 0,n=void 0;if(!t.start||!e.test(t.start))return this.addInvalidParamNotice("start"),!1;if(i=moment(t.start),!t.end||!e.test(t.end))return this.addInvalidParamNotice("end"),!1;if(n=moment(t.end),i"+$.i18n("invalid-params")+"\n "+$.i18n("param-error-1",moment(this.minDate).format(this.dateFormat))+"\n "),!1;if(i>n)return this.toastError("\n "+$.i18n("param-error-2")+"\n "+$.i18n("invalid-params")+"\n "),!1;t.monthly&&["pageviews","siteviews"].includes(this.app)?($("#date-type-select").val("monthly"),$(".date-selector").hide(),$(".month-selector").show(),this.monthStart=moment(t.start).toDate(),this.monthEnd=moment(t.end).startOf("month").toDate(),this.setupMonthSelector(this.monthStart,this.monthEnd)):(this.daterangepicker.startDate=i,this.daterangepicker.setEndDate(n))}else this.setSpecialRange(this.config.defaults.dateRange);return!0}},{key:"clearMessages",value:function(){$(".message-container").html("")}},{key:"dbName",value:function(t){return Object.keys(u).find(function(e){return u[e]===t.replace(/\.org$/,"")+".org"})}},{key:"downloadData",value:function(t,e){var i=encodeURI(t),n=document.createElement("a");if("string"==typeof n.download){document.body.appendChild(n);var a=this.getExportFilename()+"."+e;n.download=a,n.href=i,n.click(),document.body.removeChild(n)}else window.open(i)}},{key:"fillInSettings",value:function(){var t=this;$.each($("#settings-modal input"),function(e,i){"checkbox"===i.type?i.checked="true"===t[i.name]:i.checked=t[i.name]===i.value})}},{key:"focusSelect2",value:function(){$(".select2-selection").trigger("click"),$(".select2-search__field").focus()}},{key:"formatNumber",value:function(t){return"true"===(this.getFromLocalStorage("pageviews-settings-numericalFormatting")||this.config.defaults.numericalFormatting)?this.n(t):t}},{key:"formatYAxisNumber",value:function(t){return t%1==0?this.formatNumber(t):null}},{key:"getDateHeadings",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=[],i="monthly"===$("#date-type-select").val(),n=moment(this.daterangepicker.endDate).add(i?0:1,"day"),a=i?"month":"day",o=i?"YYYY-MM":"YYYY-MM-DD",r=moment(this.daterangepicker.startDate);r.isBefore(n);r.add(1,a))t?e.push(r.format(this.dateFormat)):e.push(r.format(o));return e}},{key:"getExpandedPageURL",value:function(t){return"//"+this.project+".org/w/index.php?title="+encodeURIComponent(t.score()).replace(/'/,escape)}},{key:"getHistoryLink",value:function(t,e,i,n){var a=this.getExpandedPageURL(t)+"&action=history";return i&&n&&(a+="&offset="+moment(i).format("YYYYMMDD")+"235959&limit="+(n>500?500:n)),''+e+""}},{key:"getExportFilename",value:function(){var t=this.daterangepicker.startDate.startOf("day").format("YYYYMMDD"),e=this.daterangepicker.endDate.startOf("day").format("YYYYMMDD");return this.app+"-"+t+"-"+e}},{key:"getPageLink",value:function(t,e,i,n){var a='target="_blank" href="'+this.getPageURL(t,e)+(n?"#"+n.score():"")+'"';if(this.isMultilangProject(e)){var o=this.getProjectLang(e);a+=" lang="+o+' dir="'+(this.config.rtlLangs.includes(o)?"rtl":"ltr")+'"'}return'"+(i||t.descore().escape())+""}},{key:"getPageURL",value:function(t){return"//"+(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.project).replace(/\.org$/,"").escape()+".org/wiki/"+encodeURIComponent(t.score()).replace(/%3A|%2F/g,unescape)}},{key:"getSiteLink",value:function(t){return''+t+""}},{key:"getProjectLang",value:function(t){return(t||this.project).split(".")[0]}},{key:"getLocaleDateString",value:function(){return navigator.language?{"ar-sa":"DD/MM/YY","bg-bg":"DD.M.YYYY","ca-es":"DD/MM/YYYY","zh-tw":"YYYY/M/D","cs-cz":"D.M.YYYY","da-dk":"DD-MM-YYYY","de-de":"DD.MM.YYYY","el-gr":"D/M/YYYY","en-us":"M/D/YYYY","fi-fi":"D.M.YYYY","fr-fr":"DD/MM/YYYY","he-il":"DD/MM/YYYY","hu-hu":"YYYY. MM. DD.","is-is":"D.M.YYYY","it-it":"DD/MM/YYYY","ja-jp":"YYYY/MM/DD","ko-kr":"YYYY-MM-DD","nl-nl":"D-M-YYYY","nb-no":"DD.MM.YYYY","pl-pl":"YYYY-MM-DD","pt-br":"D/M/YYYY","ro-ro":"DD.MM.YYYY","ru-ru":"DD.MM.YYYY","hr-hr":"D.M.YYYY","sk-sk":"D. M. YYYY","sq-al":"YYYY-MM-DD","sv-se":"YYYY-MM-DD","th-th":"D/M/YYYY","tr-tr":"DD.MM.YYYY","ur-pk":"DD/MM/YYYY","id-id":"DD/MM/YYYY","uk-ua":"DD.MM.YYYY","be-by":"DD.MM.YYYY","sl-si":"D.M.YYYY","et-ee":"D.MM.YYYY","lv-lv":"YYYY.MM.DD.","lt-lt":"YYYY.MM.DD","fa-ir":"MM/DD/YYYY","vi-vn":"DD/MM/YYYY","hy-am":"DD.MM.YYYY","az-latn-az":"DD.MM.YYYY","eu-es":"YYYY/MM/DD","mk-mk":"DD.MM.YYYY","af-za":"YYYY/MM/DD","ka-ge":"DD.MM.YYYY","fo-fo":"DD-MM-YYYY","hi-in":"DD-MM-YYYY","ms-my":"DD/MM/YYYY","kk-kz":"DD.MM.YYYY","ky-kg":"DD.MM.YY","sw-ke":"M/d/YYYY","uz-latn-uz":"DD/MM YYYY","tt-ru":"DD.MM.YYYY","pa-in":"DD-MM-YY","gu-in":"DD-MM-YY","ta-in":"DD-MM-YYYY","te-in":"DD-MM-YY","kn-in":"DD-MM-YY","mr-in":"DD-MM-YYYY","sa-in":"DD-MM-YYYY","mn-mn":"YY.MM.DD","gl-es":"DD/MM/YY","kok-in":"DD-MM-YYYY","syr-sy":"DD/MM/YYYY","dv-mv":"DD/MM/YY","ar-iq":"DD/MM/YYYY","zh-cn":"YYYY/M/D","de-ch":"DD.MM.YYYY","en-gb":"DD/MM/YYYY","es-mx":"DD/MM/YYYY","fr-be":"D/MM/YYYY","it-ch":"DD.MM.YYYY","nl-be":"D/MM/YYYY","nn-no":"DD.MM.YYYY","pt-pt":"DD-MM-YYYY","sr-latn-cs":"D.M.YYYY","sv-fi":"D.M.YYYY","az-cyrl-az":"DD.MM.YYYY","ms-bn":"DD/MM/YYYY","uz-cyrl-uz":"DD.MM.YYYY","ar-eg":"DD/MM/YYYY","zh-hk":"D/M/YYYY","de-at":"DD.MM.YYYY","en-au":"D/MM/YYYY","es-es":"DD/MM/YYYY","fr-ca":"YYYY-MM-DD","sr-cyrl-cs":"D.M.YYYY","ar-ly":"DD/MM/YYYY","zh-sg":"D/M/YYYY","de-lu":"DD.MM.YYYY","en-ca":"DD/MM/YYYY","es-gt":"DD/MM/YYYY","fr-ch":"DD.MM.YYYY","ar-dz":"DD-MM-YYYY","zh-mo":"D/M/YYYY","de-li":"DD.MM.YYYY","en-nz":"D/MM/YYYY","es-cr":"DD/MM/YYYY","fr-lu":"DD/MM/YYYY","ar-ma":"DD-MM-YYYY","en-ie":"DD/MM/YYYY","es-pa":"MM/DD/YYYY","fr-mc":"DD/MM/YYYY","ar-tn":"DD-MM-YYYY","en-za":"YYYY/MM/DD","es-do":"DD/MM/YYYY","ar-om":"DD/MM/YYYY","en-jm":"DD/MM/YYYY","es-ve":"DD/MM/YYYY","ar-ye":"DD/MM/YYYY","en-029":"MM/DD/YYYY","es-co":"DD/MM/YYYY","ar-sy":"DD/MM/YYYY","en-bz":"DD/MM/YYYY","es-pe":"DD/MM/YYYY","ar-jo":"DD/MM/YYYY","en-tt":"DD/MM/YYYY","es-ar":"DD/MM/YYYY","ar-lb":"DD/MM/YYYY","en-zw":"M/D/YYYY","es-ec":"DD/MM/YYYY","ar-kw":"DD/MM/YYYY","en-ph":"M/D/YYYY","es-cl":"DD-MM-YYYY","ar-ae":"DD/MM/YYYY","es-uy":"DD/MM/YYYY","ar-bh":"DD/MM/YYYY","es-py":"DD/MM/YYYY","ar-qa":"DD/MM/YYYY","es-bo":"DD/MM/YYYY","es-sv":"DD/MM/YYYY","es-hn":"DD/MM/YYYY","es-ni":"DD/MM/YYYY","es-pr":"DD/MM/YYYY","am-et":"D/M/YYYY","tzm-latn-dz":"DD-MM-YYYY","iu-latn-ca":"D/MM/YYYY","sma-no":"DD.MM.YYYY","mn-mong-cn":"YYYY/M/D","gd-gb":"DD/MM/YYYY","en-my":"D/M/YYYY","prs-af":"DD/MM/YY","bn-bd":"DD-MM-YY","wo-sn":"DD/MM/YYYY","rw-rw":"M/D/YYYY","qut-gt":"DD/MM/YYYY","sah-ru":"MM.DD.YYYY","gsw-fr":"DD/MM/YYYY","co-fr":"DD/MM/YYYY","oc-fr":"DD/MM/YYYY","mi-nz":"DD/MM/YYYY","ga-ie":"DD/MM/YYYY","se-se":"YYYY-MM-DD","br-fr":"DD/MM/YYYY","smn-fi":"D.M.YYYY","moh-ca":"M/D/YYYY","arn-cl":"DD-MM-YYYY","ii-cn":"YYYY/M/D","dsb-de":"D. M. YYYY","ig-ng":"D/M/YYYY","kl-gl":"DD-MM-YYYY","lb-lu":"DD/MM/YYYY","ba-ru":"DD.MM.YY","nso-za":"YYYY/MM/DD","quz-bo":"DD/MM/YYYY","yo-ng":"D/M/YYYY","ha-latn-ng":"D/M/YYYY","fil-ph":"M/D/YYYY","ps-af":"DD/MM/YY","fy-nl":"D-M-YYYY","ne-np":"M/D/YYYY","se-no":"DD.MM.YYYY","iu-cans-ca":"D/M/YYYY","sr-latn-rs":"D.M.YYYY","si-lk":"YYYY-MM-DD","sr-cyrl-rs":"D.M.YYYY","lo-la":"DD/MM/YYYY","km-kh":"YYYY-MM-DD","cy-gb":"DD/MM/YYYY","bo-cn":"YYYY/M/D","sms-fi":"D.M.YYYY","as-in":"DD-MM-YYYY","ml-in":"DD-MM-YY","en-in":"DD-MM-YYYY","or-in":"DD-MM-YY","bn-in":"DD-MM-YY","tk-tm":"DD.MM.YY","bs-latn-ba":"D.M.YYYY","mt-mt":"DD/MM/YYYY","sr-cyrl-me":"D.M.YYYY","se-fi":"D.M.YYYY","zu-za":"YYYY/MM/DD","xh-za":"YYYY/MM/DD","tn-za":"YYYY/MM/DD","hsb-de":"D. M. YYYY","bs-cyrl-ba":"D.M.YYYY","tg-cyrl-tj":"DD.MM.yy","sr-latn-ba":"D.M.YYYY","smj-no":"DD.MM.YYYY","rm-ch":"DD/MM/YYYY","smj-se":"YYYY-MM-DD","quz-ec":"DD/MM/YYYY","quz-pe":"DD/MM/YYYY","hr-ba":"D.M.YYYY.","sr-latn-me":"D.M.YYYY","sma-se":"YYYY-MM-DD","en-sg":"D/M/YYYY","ug-cn":"YYYY-M-D","sr-cyrl-ba":"D.M.YYYY","es-us":"M/D/YYYY"}[navigator.language.toLowerCase()]||this.config.defaults.dateFormat:this.config.defaults.dateFormat}},{key:"getFromLocalStorage",value:function(t){try{return localStorage.getItem(t)}catch(e){return storage[t]}}},{key:"getBugReportURL",value:function(t,e){var i="https://meta.wikimedia.org/w/index.php?title=Talk:Pageviews_Analysis&action=edit§ion=new&preloadtitle="+(e||this.app.upcase()+" bug report");return t?i+"&preload=Talk:Pageviews_Analysis/Preload&preloadparams[]="+t:i}},{key:"fetchSiteInfo",value:function(t){var e=this;t=t.replace(/\.org$/,"");var i=$.Deferred(),n="pageviews-siteinfo-"+t;return this.siteInfo[t]?i.resolve(this.siteInfo):(simpleStorage.hasKey(n)?(this.siteInfo[t]=simpleStorage.get(n),i.resolve(this.siteInfo)):$.ajax({url:"https://"+t+".org/w/api.php",data:{action:"query",meta:"siteinfo",siprop:"general|namespaces",format:"json"},dataType:"jsonp"}).done(function(a){e.siteInfo[t]=a.query,simpleStorage.set(n,e.siteInfo[t],{TTL:6048e5}),i.resolve(e.siteInfo)}).fail(function(t){i.reject(t)}),i)}},{key:"getEditData",value:function(t){var e=$.Deferred();return $.ajax({url:"/pageviews/api.php",data:{pages:t.join("|"),project:this.project+".org",start:this.daterangepicker.startDate.format("YYYY-MM-DD"),end:this.daterangepicker.endDate.format("YYYY-MM-DD")},timeout:8e3}).done(function(t){return e.resolve(t)}).fail(function(){var i={};t.forEach(function(t){return i[t]={}}),e.resolve({pages:i})}),e}},{key:"getPageAssessments",value:function(t){var e=this,i=$.Deferred();return this.config.pageAssessmentProjects.includes(this.project)?(this.massApi({prop:"pageassessments",titles:t.join("|")},this.project,"pacontinue","pages").done(function(t){if(!t.pages)return i.resolve({});var n={};return t.pages.forEach(function(t){if(t.pageassessments){var i=Object.keys(t.pageassessments),a=t.pageassessments[i[0]];if(a&&a.class.length&&!n[t.title]){var o=e.config.pageAssessmentBadges[e.project][a.class]||"";if(!o.length)return;var r=""+a.class+"";n[t.title]=r}}}),i.resolve(n)}),i):i.resolve({})}},{key:"getAssessmentBadge",value:function(t){return t.assessment?t.assessment_img?""+t.assessment+"":t.assessment:""}},{key:"getSiteInfo",value:function(t){return this.siteInfo[t.replace(/\.org$/,"")]}},{key:"getTopviewsMonth",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=t?"startDate":"endDate",i=moment(this.daterangepicker[e]);return i.month()!==moment().month()&&i.month()!==moment().subtract(2,"days").month()||i.subtract(1,"month"),i}},{key:"getTopviewsMonthURL",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getTopviewsMonth(),i={project:t,platform:"all-access",date:e.startOf("month").format("YYYY-MM")};return"/topviews?"+$.param(i)}},{key:"setLocalStorage",value:function(t,e){try{return localStorage.setItem(t,e)}catch(i){return storage[t]=e}}},{key:"hashCode",value:function(t){return t.split("").reduce(function(t,e){return(t<<5)-t+e.charCodeAt(0)},0)}},{key:"isChartApp",value:function(){return!this.isListApp()}},{key:"isListApp",value:function(){return["langviews","massviews","redirectviews","userviews"].includes(this.app)}},{key:"isPageviews",value:function(){return"pageviews"===this.app||"pageviews"===$(this.config.dataSourceSelector).val()}},{key:"isUniqueDevices",value:function(){return"unique-devices"===$(this.config.dataSourceSelector).val()}},{key:"isPagecounts",value:function(){return"pagecounts"===$(this.config.dataSourceSelector).val()}},{key:"isMultilangProject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.project;return new RegExp(".*?\\.("+e.multilangProjects.join("|")+")").test(t)}},{key:"massApi",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"continue",n=arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.config.apiLimit;/\.org$/.test(e)||(e+=".org");var o=$.Deferred(),r={pages:[]};return function s(l){var c=Object.assign({action:"query",format:"json",formatversion:"2"},t);l&&(c[i]=l),$.ajax({url:"https://"+e+"/w/api.php",jsonp:"callback",dataType:"jsonp",data:c}).done(function(t){if(t.error||!t.query)return o.resolve(t);var e=void 0;"function"==typeof n?(r.pages=r.pages.concat(n(t.query)),e=r.pages.length>=a):(t.query.pages&&(r.pages=r.pages.concat(t.query.pages)),t.query[n]&&(r[n]=(r[n]||[]).concat(t.query[n])),e=r.pages.length>=a||r[n].length>=a),!e&&t.continue&&t.continue[i]?setTimeout(function(){s(t.continue[i])},100):(t.continue&&(r.continue=!0),o.resolve(r))}).fail(function(t){o.reject(t)})}(),o}},{key:"n",value:function(t){return new Number(t).toLocaleString()}},{key:"getPageInfo",value:function(t){var e=$.Deferred();try{t=t.map(function(t){return encodeURIComponent(decodeURIComponent(t))})}catch(t){}return $.ajax({url:"https://"+this.project+".org/w/api.php?action=query&prop=info&inprop=protection|watchers&formatversion=2&format=json&titles="+t.join("|"),dataType:"jsonp"}).then(function(i){i.query.normalized&&i.query.normalized.forEach(function(e){t[t.indexOf(encodeURIComponent(e.from))]=encodeURIComponent(e.to)});var n={};return t.forEach(function(t){try{t=decodeURIComponent(t)}catch(t){}n[t]=i.query.pages.find(function(e){return e.title===t})}),e.resolve(n)})}},{key:"numDaysInRange",value:function(){return this.daterangepicker.endDate.diff(this.daterangepicker.startDate,"days")+1}},{key:"parseQueryString",value:function(t){for(var e=location.search.slice(1).replace(/\+/g,"%20").replace(/%7C/g,"|"),i=e.split("&"),n={},a=0;a0&&void 0!==arguments[0])||arguments[0],e=$(this.config.select2Input);e.data("select2")&&(e.off("change"),e.select2("val",null),e.select2("data",null),e.select2("destroy")),t&&this.setupSelect2()}},{key:"rgba",value:function(t,e){return t.replace(/,\s*\d\)/,", "+e+")")}},{key:"saveSetting",value:function(t,e){this[t]=e,this.setLocalStorage("pageviews-settings-"+t,e)}},{key:"saveSettings",value:function(){var t=this,e="no_autocomplete"===this.autocomplete;$.each($("#settings-modal input"),function(e,i){"checkbox"===i.type?t.saveSetting(i.name,i.checked?"true":"false"):i.checked&&t.saveSetting(i.name,i.value)}),"topviews"!==this.app&&(this.daterangepicker.locale.format=this.dateFormat,this.daterangepicker.updateElement(),this.setupSelect2Colors(),"no_autocomplete"===this.autocomplete!==e&&this.resetSelect2(),"true"===this.beginAtZero&&$(".begin-at-zero-option").prop("checked",!0)),this.processInput(!0)}},{key:"setSelect2Defaults",value:function(t){var e=this;return t.forEach(function(t){var i=$("
").text(t).html();$("").appendTo(e.config.select2Input)}),$(this.config.select2Input).select2("val",t),$(this.config.select2Input).trigger("select2:select"),t}},{key:"setSpecialRange",value:function(t){var e=Object.keys(this.config.specialRanges).indexOf(t),i=void 0,n=void 0,a=void 0;if(t.includes("latest-")){a=parseInt(t.replace("latest-",""),10)||20;var o=this.config.specialRanges.latest(a),r=s(o,2);i=r[0],n=r[1]}else{if(!(e>=0))return;var l="latest"===t?this.config.specialRanges.latest():this.config.specialRanges[t],c=s(l,2);i=c[0],n=c[1],$(".daterangepicker .ranges li").eq(e).trigger("click")}return this.specialRange={range:t,value:i.format(this.dateFormat)+" - "+n.format(this.dateFormat)},this.daterangepicker.startDate=i,this.daterangepicker.setEndDate(n),$(".latest-text").text(a?$.i18n("latest-days",a):$.i18n("latest")),this.specialRange}},{key:"setupSelect2Colors",value:function(){var t=this;return this.colorsStyleEl&&this.colorsStyleEl.remove(),this.colorsStyleEl=document.createElement("style"),this.colorsStyleEl.appendChild(document.createTextNode("")),document.head.appendChild(this.colorsStyleEl),this.config.colors.forEach(function(e,i){t.colorsStyleEl.sheet.insertRule(".select2-selection__choice:nth-of-type("+(i+1)+") { background: "+e+" !important }",0)}),this.colorsStyleEl.sheet}},{key:"setupListeners",value:function(){var t=this;$("a[href='#']").on("click",function(t){return t.preventDefault()}),$(".download-csv").on("click",this.exportCSV.bind(this)),$(".download-json").on("click",this.exportJSON.bind(this)),$(this.config.projectInput).on("focusin",function(){this.dataset.value=this.value}),$(this.config.projectInput).on("change",function(){return t.validateProject()}),$(".permalink").on("click",function(e){$(".permalink-copy").val($(".permalink").prop("href"))[0].select();try{document.execCommand("copy"),t.toastSuccess($.i18n("permalink-copied")),e.preventDefault(),document.activeElement.blur()}catch(e){}})}},{key:"setupSettingsModal",value:function(){this.fillInSettings(),$(".save-settings-btn").on("click",this.saveSettings.bind(this)),$(".cancel-settings-btn").on("click",this.fillInSettings.bind(this))}},{key:"setupDateRangeSelector",value:function(){var t=this,e={},i=void 0;this.isPagecounts()?(e=n({},$.i18n("all-time"),[this.config.minDatePagecounts,this.config.maxDatePagecounts]),i=moment(this.config.maxDatePagecounts).subtract(this.config.daysAgo,"days")):(Object.keys(this.config.specialRanges).forEach(function(i){"latest"!==i&&(e[$.i18n(i)]=t.config.specialRanges[i])}),i=moment().subtract(this.config.daysAgo,"days"));var a={locale:{format:this.dateFormat,applyLabel:$.i18n("apply"),cancelLabel:$.i18n("cancel"),customRangeLabel:$.i18n("custom-range"),daysOfWeek:[$.i18n("su"),$.i18n("mo"),$.i18n("tu"),$.i18n("we"),$.i18n("th"),$.i18n("fr"),$.i18n("sa")],monthNames:[$.i18n("january"),$.i18n("february"),$.i18n("march"),$.i18n("april"),$.i18n("may"),$.i18n("june"),$.i18n("july"),$.i18n("august"),$.i18n("september"),$.i18n("october"),$.i18n("november"),$.i18n("december")]},startDate:i,minDate:this.minDate,maxDate:this.maxDate,ranges:e};if(this.config.dateLimit&&(a.dateLimit={days:this.config.dateLimit}),this.daterangepicker){$(this.config.dateRangeSelector).data("daterangepicker").remove();var o=$(this.config.dateRangeSelector).remove();$(".date-selector").append(o)}$(this.config.dateRangeSelector).daterangepicker(a),this.isPagecounts()||"mediaviews"===this.app||$(".daterangepicker").append($("
").addClass("daterange-notice").html($.i18n("date-notice",$.i18n("pageviews"===this.app?"title":this.app+"-title")))),$(".daterangepicker .ranges li").off("click").on("click",function(e){if(e.target.innerText===$.i18n("custom-range"))return t.specialRange=null,t.daterangepicker.clickApply();var i=t.daterangepicker.container,n=i.find(".daterangepicker_input input"),a=Object.keys(t.config.specialRanges).find(function(t){return $.i18n(t)===e.target.innerText});t.specialRange={range:a,value:n[0].value+" - "+n[1].value}}), $(this.config.dateRangeSelector).off("apply.daterangepicker").on("apply.daterangepicker",function(e,i){i.chosenLabel===$.i18n("custom-range")&&(t.specialRange=null,t.daterangepicker.updateElement())})}},{key:"showFatalErrors",value:function(t){var e=this;this.resetView(),t.forEach(function(t){e.writeMessage(""+$.i18n("fatal-error")+": "+t+"")});if(this.debug)throw t[0];t&&t[0]&&t[0].stack&&function(t){e.toastError("\n "+$.i18n("fatal-error")+": "+$.i18n("error-please-report",e.getBugReportURL(t))+"\n ",0)}()}},{key:"splash",value:function(){var t="background: #eee; color: #555; padding: 4px; font-family:monospace";console.log("%c ___ __ _ _ ",t),console.log("%c | _ \\ __ _ / _` | ___ __ __ (_) ___ __ __ __ ___ ",t),console.log("%c | _/ / _` | \\__, | / -_) \\ V / | | / -_) \\ V V / (_-< ",t),console.log("%c _|_|_ \\__,_| |___/ \\___| _\\_/_ _|_|_ \\___| \\_/\\_/ /__/_ ",t),console.log('%c _| """ |_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""| ',t),console.log("%c \"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-' ",t),console.log("%c ___ _ _ _ _ ",t),console.log("%c o O O / \\ _ _ __ _ | || | | | ___ (_) ___ ",t),console.log("%c o | - | | ' \\ / _` | \\_, | | | (_-< | | (_-< ",t),console.log("%c TS__[O] |_|_| |_||_| \\__,_| _|__/ _|_|_ /__/_ _|_|_ /__/_ ",t),console.log('%c {======|_|"""""|_|"""""|_|"""""|_| """"|_|"""""|_|"""""|_|"""""|_|"""""| ',t),console.log("%c ./o--000'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-'\"`-0-0-' ",t),console.log("%c ",t),console.log("%c Copyright © "+(new Date).getFullYear()+" MusikAnimal, Kaldari, Marcel Ruiz Forns ",t)}},{key:"startSpinny",value:function(){var t=this;$("body").addClass("loading"),setTimeout(function(){return document.activeElement.blur()}),clearTimeout(this.timeout),this.timeout=setTimeout(function(e){t.resetView(),t.toastError("\n "+$.i18n("fatal-error")+":\n "+$.i18n("error-timed-out")+"\n "+$.i18n("error-please-report",t.getBugReportURL())+"\n ")},3e4)}},{key:"stopSpinny",value:function(){$("body").removeClass("loading initial"),clearTimeout(this.timeout)}},{key:"underscorePageNames",value:function(t){return t.map(function(t){return t.score()})}},{key:"updateInterAppLinks",value:function(){var t=this;$(".interapp-link").each(function(e,i){var n=i.href.split("?")[0];i.classList.contains("interapp-link--siteviews")?i.href=n+"?sites="+t.project.escape()+".org":i.href=n+"?project="+t.project.escape()+".org"})}},{key:"validateParams",value:function(t){var e=this;return this.config.validateParams.forEach(function(i){"project"===i&&t.project&&(t.project=t.project.replace(/^www\./,""));var n=e.config.defaults[i],a=t[i];void 0===n||e.config.validParams[i].includes(a)||(a&&e.addInvalidParamNotice(i),t[i]=n)}),t}},{key:"validateProject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=$(this.config.projectInput)[0],i=e.value.replace(/^www\./,""),n=!1;return t&&!this.isMultilangProject()?(this.toastWarn($.i18n("invalid-lang-project",""+i.escape()+"")),i=e.dataset.value):d.includes(i)?(this.updateInterAppLinks(),n=!0):(this.toastWarn($.i18n("invalid-project",""+i.escape()+"")),i=e.dataset.value),n&&$(this.config.projectInput).trigger("updated"),e.value=i,n}},{key:"writeMessage",value:function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&this.clearMessages(),$(".message-container").append("
"+t+"
")}},{key:"minDate",get:function(){return this.isPagecounts()?this.config.minDatePagecounts:this.config.minDate}},{key:"maxDate",get:function(){return this.isPagecounts()?this.config.maxDatePagecounts:this.config.maxDate}},{key:"maxMonth",get:function(){return this.isPagecounts()?this.config.maxMonthPagecounts:this.config.maxMonth}},{key:"initialMonthStart",get:function(){return moment(this.maxMonth).subtract(11,"months").toDate()}},{key:"dateFormat",get:function(){var t="monthly"===$("#date-type-select").val();return"true"===this.localizeDateFormat?t?"MMM YYYY":this.getLocaleDateString():t?"YYYY-MM":this.config.defaults.dateFormat}},{key:"daterangepicker",get:function(){return $(this.config.dateRangeSelector).data("daterangepicker")}},{key:"project",get:function(){var t="mediaviews"===this.app?"commons.wikimedia.org":$(this.config.projectInput).val();return t?t.toLowerCase().replace(/.org$/,""):null}}],[{key:"multilangProjects",get:function(){return["wikipedia","wikibooks","wikinews","wikiquote","wikisource","wikiversity","wikivoyage"]}}]),e}(c);e.exports=h},{"./core_extensions":5,"./polyfills":7,"./pv_config":9,"./site_map":10}],9:[function(t,e,i){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a=function(){function t(t,e){for(var i=0;i1?"line":"bar"},dateFormat:"YYYY-MM-DD",localizeDateFormat:"true",numericalFormatting:"true",bezierCurve:"false",autoLogDetection:"false",beginAtZero:"false",rememberChart:"false",agent:"user",platform:"all-access",project:"en.wikipedia.org"},globalChartOpts:{animation:{duration:500,easing:"easeInOutQuart"},hover:{animationDuration:0},legend:{display:!1}},linearCharts:["line","bar","radar"],linearOpts:{scales:{yAxes:[{ticks:{callback:function(t){return e.formatNumber(t)}}}]},legendCallback:function(t){return e.config.chartLegend(t.data.datasets,i)}},daysAgo:20,minDate:moment("2015-07-01").startOf("day"),minDatePagecounts:moment("2007-12-09").startOf("day"),maxDate:o,maxMonth:s,maxDatePagecounts:l,maxMonthPagecounts:c,specialRanges:{"last-week":[moment().subtract(1,"week").startOf("isoweek"),moment().subtract(1,"week").endOf("isoweek")],"this-month":[moment().startOf("month"),moment().startOf("month").isAfter(o)?moment().startOf("month"):o],"last-month":[moment().subtract(1,"month").startOf("month"),moment().subtract(1,"month").endOf("month")],"this-year":[moment().startOf("year"),moment().startOf("year").isAfter(o)?moment().startOf("year"):o],"last-year":[moment().subtract(1,"year").startOf("year"),moment().subtract(1,"year").endOf("year")],"all-time":[moment("2015-07-01").startOf("day"),o],latest:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.config.daysAgo,e=i.isPagecounts()?l:o;return[moment(e).subtract(t,"days").startOf("day"),e]}},timestampFormat:"YYYYMMDD00",validParams:{agent:["all-agents","user","spider","bot"],platform:["all-access","desktop","mobile-app","mobile-web"],project:r},rtlLangs:["ar","he","fa","ps","ur"]}}return a(t,[{key:"linearTooltips",value:function(t){var e=this;return{mode:t||"x-axis",callbacks:{label:function(t){return Number.isNaN(t.yLabel)?" "+$.i18n("unknown"):" "+e.formatNumber(t.yLabel)}},bodyFontSize:14,bodySpacing:7,caretSize:0,titleFontSize:14}}},{key:"circularTooltips",get:function(){var t=this;return{callbacks:{label:function(e,i){var n=i.datasets[e.datasetIndex].data[e.index],a=i.labels[e.index];return Number.isNaN(n)?a+": "+$.i18n("unknown"):a+": "+t.formatNumber(n)}},bodyFontSize:14,bodySpacing:7,caretSize:0,titleFontSize:14}}}]),t}();e.exports=s},{"./site_map":10}],10:[function(t,e,i){"use strict";var n={aawiki:"aa.wikipedia.org",aawikibooks:"aa.wikibooks.org",aawiktionary:"aa.wiktionary.org",abwiki:"ab.wikipedia.org",abwiktionary:"ab.wiktionary.org",acewiki:"ace.wikipedia.org",adywiki:"ady.wikipedia.org",afwiki:"af.wikipedia.org",afwikibooks:"af.wikibooks.org",afwikiquote:"af.wikiquote.org",afwiktionary:"af.wiktionary.org",akwiki:"ak.wikipedia.org",akwikibooks:"ak.wikibooks.org",akwiktionary:"ak.wiktionary.org",alswiki:"als.wikipedia.org",alswikibooks:"als.wikibooks.org",alswikiquote:"als.wikiquote.org",alswiktionary:"als.wiktionary.org",amwiki:"am.wikipedia.org",amwikimedia:"am.wikimedia.org",amwikiquote:"am.wikiquote.org",amwiktionary:"am.wiktionary.org",angwiki:"ang.wikipedia.org",angwikibooks:"ang.wikibooks.org",angwikiquote:"ang.wikiquote.org",angwikisource:"ang.wikisource.org",angwiktionary:"ang.wiktionary.org",anwiki:"an.wikipedia.org",anwiktionary:"an.wiktionary.org",arcwiki:"arc.wikipedia.org",arwiki:"ar.wikipedia.org",arwikibooks:"ar.wikibooks.org",arwikimedia:"ar.wikimedia.org",arwikinews:"ar.wikinews.org",arwikiquote:"ar.wikiquote.org",arwikisource:"ar.wikisource.org",arwikiversity:"ar.wikiversity.org",arwiktionary:"ar.wiktionary.org",arzwiki:"arz.wikipedia.org",astwiki:"ast.wikipedia.org",astwikibooks:"ast.wikibooks.org",astwikiquote:"ast.wikiquote.org",astwiktionary:"ast.wiktionary.org",aswiki:"as.wikipedia.org",aswikibooks:"as.wikibooks.org",aswikisource:"as.wikisource.org",aswiktionary:"as.wiktionary.org",atjwiki:"atj.wikipedia.org",avwiki:"av.wikipedia.org",avwiktionary:"av.wiktionary.org",aywiki:"ay.wikipedia.org",aywikibooks:"ay.wikibooks.org",aywiktionary:"ay.wiktionary.org",azbwiki:"azb.wikipedia.org",azwiki:"az.wikipedia.org",azwikibooks:"az.wikibooks.org",azwikiquote:"az.wikiquote.org",azwikisource:"az.wikisource.org",azwiktionary:"az.wiktionary.org",barwiki:"bar.wikipedia.org",bat_smgwiki:"bat-smg.wikipedia.org",bawiki:"ba.wikipedia.org",bawikibooks:"ba.wikibooks.org",bclwiki:"bcl.wikipedia.org",bdwikimedia:"bd.wikimedia.org",be_x_oldwiki:"be-tarask.wikipedia.org",betawikiversity:"beta.wikiversity.org",bewiki:"be.wikipedia.org",bewikibooks:"be.wikibooks.org",bewikimedia:"be.wikimedia.org",bewikiquote:"be.wikiquote.org",bewikisource:"be.wikisource.org",bewiktionary:"be.wiktionary.org",bgwiki:"bg.wikipedia.org",bgwikibooks:"bg.wikibooks.org",bgwikinews:"bg.wikinews.org",bgwikiquote:"bg.wikiquote.org",bgwikisource:"bg.wikisource.org",bgwiktionary:"bg.wiktionary.org",bhwiki:"bh.wikipedia.org",bhwiktionary:"bh.wiktionary.org",biwiki:"bi.wikipedia.org",biwikibooks:"bi.wikibooks.org",biwiktionary:"bi.wiktionary.org",bjnwiki:"bjn.wikipedia.org",bmwiki:"bm.wikipedia.org",bmwikibooks:"bm.wikibooks.org",bmwikiquote:"bm.wikiquote.org",bmwiktionary:"bm.wiktionary.org",bnwiki:"bn.wikipedia.org",bnwikibooks:"bn.wikibooks.org",bnwikisource:"bn.wikisource.org",bnwiktionary:"bn.wiktionary.org",bowiki:"bo.wikipedia.org",bowikibooks:"bo.wikibooks.org",bowiktionary:"bo.wiktionary.org",bpywiki:"bpy.wikipedia.org",brwiki:"br.wikipedia.org",brwikimedia:"br.wikimedia.org",brwikiquote:"br.wikiquote.org",brwikisource:"br.wikisource.org",brwiktionary:"br.wiktionary.org",bswiki:"bs.wikipedia.org",bswikibooks:"bs.wikibooks.org",bswikinews:"bs.wikinews.org",bswikiquote:"bs.wikiquote.org",bswikisource:"bs.wikisource.org",bswiktionary:"bs.wiktionary.org",bugwiki:"bug.wikipedia.org",bxrwiki:"bxr.wikipedia.org",cawiki:"ca.wikipedia.org",cawikibooks:"ca.wikibooks.org",cawikimedia:"ca.wikimedia.org",cawikinews:"ca.wikinews.org",cawikiquote:"ca.wikiquote.org",cawikisource:"ca.wikisource.org",cawiktionary:"ca.wiktionary.org",cbk_zamwiki:"cbk-zam.wikipedia.org",cdowiki:"cdo.wikipedia.org",cebwiki:"ceb.wikipedia.org",cewiki:"ce.wikipedia.org",chowiki:"cho.wikipedia.org",chrwiki:"chr.wikipedia.org",chrwiktionary:"chr.wiktionary.org",chwiki:"ch.wikipedia.org",chwikibooks:"ch.wikibooks.org",chwiktionary:"ch.wiktionary.org",chywiki:"chy.wikipedia.org",ckbwiki:"ckb.wikipedia.org",cnwikimedia:"cn.wikimedia.org",commonswiki:"commons.wikimedia.org",cowiki:"co.wikipedia.org",cowikibooks:"co.wikibooks.org",cowikimedia:"co.wikimedia.org",cowikiquote:"co.wikiquote.org",cowiktionary:"co.wiktionary.org",crhwiki:"crh.wikipedia.org",crwiki:"cr.wikipedia.org",crwikiquote:"cr.wikiquote.org",crwiktionary:"cr.wiktionary.org",csbwiki:"csb.wikipedia.org",csbwiktionary:"csb.wiktionary.org",cswiki:"cs.wikipedia.org",cswikibooks:"cs.wikibooks.org",cswikinews:"cs.wikinews.org",cswikiquote:"cs.wikiquote.org",cswikisource:"cs.wikisource.org",cswikiversity:"cs.wikiversity.org",cswiktionary:"cs.wiktionary.org",cuwiki:"cu.wikipedia.org",cvwiki:"cv.wikipedia.org",cvwikibooks:"cv.wikibooks.org",cywiki:"cy.wikipedia.org",cywikibooks:"cy.wikibooks.org",cywikiquote:"cy.wikiquote.org",cywikisource:"cy.wikisource.org",cywiktionary:"cy.wiktionary.org",dawiki:"da.wikipedia.org",dawikibooks:"da.wikibooks.org",dawikiquote:"da.wikiquote.org",dawikisource:"da.wikisource.org",dawiktionary:"da.wiktionary.org",dewiki:"de.wikipedia.org",dewikibooks:"de.wikibooks.org",dewikinews:"de.wikinews.org",dewikiquote:"de.wikiquote.org",dewikisource:"de.wikisource.org",dewikiversity:"de.wikiversity.org",dewikivoyage:"de.wikivoyage.org",dewiktionary:"de.wiktionary.org",dinwiki:"din.wikipedia.org",diqwiki:"diq.wikipedia.org",dkwikimedia:"dk.wikimedia.org",dsbwiki:"dsb.wikipedia.org",dtywiki:"dty.wikipedia.org",dvwiki:"dv.wikipedia.org",dvwiktionary:"dv.wiktionary.org",dzwiki:"dz.wikipedia.org",dzwiktionary:"dz.wiktionary.org",eewiki:"ee.wikipedia.org",elwiki:"el.wikipedia.org",elwikibooks:"el.wikibooks.org",elwikinews:"el.wikinews.org",elwikiquote:"el.wikiquote.org",elwikisource:"el.wikisource.org",elwikiversity:"el.wikiversity.org",elwikivoyage:"el.wikivoyage.org",elwiktionary:"el.wiktionary.org",emlwiki:"eml.wikipedia.org",enwiki:"en.wikipedia.org",enwikibooks:"en.wikibooks.org",enwikinews:"en.wikinews.org",enwikiquote:"en.wikiquote.org",enwikisource:"en.wikisource.org",enwikiversity:"en.wikiversity.org",enwikivoyage:"en.wikivoyage.org",enwiktionary:"en.wiktionary.org",eowiki:"eo.wikipedia.org",eowikibooks:"eo.wikibooks.org",eowikinews:"eo.wikinews.org",eowikiquote:"eo.wikiquote.org",eowikisource:"eo.wikisource.org",eowiktionary:"eo.wiktionary.org",eswiki:"es.wikipedia.org",eswikibooks:"es.wikibooks.org",eswikinews:"es.wikinews.org",eswikiquote:"es.wikiquote.org",eswikisource:"es.wikisource.org",eswikiversity:"es.wikiversity.org",eswikivoyage:"es.wikivoyage.org",eswiktionary:"es.wiktionary.org",etwiki:"et.wikipedia.org",etwikibooks:"et.wikibooks.org",etwikimedia:"ee.wikimedia.org",etwikiquote:"et.wikiquote.org",etwikisource:"et.wikisource.org",etwiktionary:"et.wiktionary.org",euwiki:"eu.wikipedia.org",euwikibooks:"eu.wikibooks.org",euwikiquote:"eu.wikiquote.org",euwikisource:"eu.wikisource.org",euwiktionary:"eu.wiktionary.org",extwiki:"ext.wikipedia.org",fawiki:"fa.wikipedia.org",fawikibooks:"fa.wikibooks.org",fawikinews:"fa.wikinews.org",fawikiquote:"fa.wikiquote.org",fawikisource:"fa.wikisource.org",fawikivoyage:"fa.wikivoyage.org",fawiktionary:"fa.wiktionary.org",ffwiki:"ff.wikipedia.org",fiu_vrowiki:"fiu-vro.wikipedia.org",fiwiki:"fi.wikipedia.org",fiwikibooks:"fi.wikibooks.org",fiwikimedia:"fi.wikimedia.org",fiwikinews:"fi.wikinews.org",fiwikiquote:"fi.wikiquote.org",fiwikisource:"fi.wikisource.org",fiwikiversity:"fi.wikiversity.org",fiwikivoyage:"fi.wikivoyage.org",fiwiktionary:"fi.wiktionary.org",fjwiki:"fj.wikipedia.org",fjwiktionary:"fj.wiktionary.org",foundationwiki:"wikimediafoundation.org",fowiki:"fo.wikipedia.org",fowikisource:"fo.wikisource.org",fowiktionary:"fo.wiktionary.org",frpwiki:"frp.wikipedia.org",frrwiki:"frr.wikipedia.org",frwiki:"fr.wikipedia.org",frwikibooks:"fr.wikibooks.org",frwikinews:"fr.wikinews.org",frwikiquote:"fr.wikiquote.org",frwikisource:"fr.wikisource.org",frwikiversity:"fr.wikiversity.org",frwikivoyage:"fr.wikivoyage.org",frwiktionary:"fr.wiktionary.org",furwiki:"fur.wikipedia.org",fywiki:"fy.wikipedia.org",fywikibooks:"fy.wikibooks.org",fywiktionary:"fy.wiktionary.org",gagwiki:"gag.wikipedia.org",ganwiki:"gan.wikipedia.org",gawiki:"ga.wikipedia.org",gawikibooks:"ga.wikibooks.org",gawikiquote:"ga.wikiquote.org",gawiktionary:"ga.wiktionary.org",gdwiki:"gd.wikipedia.org",gdwiktionary:"gd.wiktionary.org",glkwiki:"glk.wikipedia.org",glwiki:"gl.wikipedia.org",glwikibooks:"gl.wikibooks.org",glwikiquote:"gl.wikiquote.org",glwikisource:"gl.wikisource.org",glwiktionary:"gl.wiktionary.org",gnwiki:"gn.wikipedia.org",gnwikibooks:"gn.wikibooks.org",gnwiktionary:"gn.wiktionary.org",gomwiki:"gom.wikipedia.org",gorwiki:"gor.wikipedia.org",gotwiki:"got.wikipedia.org",gotwikibooks:"got.wikibooks.org",guwiki:"gu.wikipedia.org",guwikibooks:"gu.wikibooks.org",guwikiquote:"gu.wikiquote.org",guwikisource:"gu.wikisource.org",guwiktionary:"gu.wiktionary.org",gvwiki:"gv.wikipedia.org",gvwiktionary:"gv.wiktionary.org",hakwiki:"hak.wikipedia.org",hawiki:"ha.wikipedia.org",hawiktionary:"ha.wiktionary.org",hawwiki:"haw.wikipedia.org",hewiki:"he.wikipedia.org",hewikibooks:"he.wikibooks.org",hewikinews:"he.wikinews.org",hewikiquote:"he.wikiquote.org",hewikisource:"he.wikisource.org",hewikivoyage:"he.wikivoyage.org",hewiktionary:"he.wiktionary.org",hifwiki:"hif.wikipedia.org",hifwiktionary:"hif.wiktionary.org",hiwiki:"hi.wikipedia.org",hiwikimedia:"hi.wikimedia.org",hiwikibooks:"hi.wikibooks.org",hiwikiquote:"hi.wikiquote.org",hiwikiversity:"hi.wikiversity.org",hiwikivoyage:"hi.wikivoyage.org",hiwiktionary:"hi.wiktionary.org",howiki:"ho.wikipedia.org",hrwiki:"hr.wikipedia.org",hrwikibooks:"hr.wikibooks.org",hrwikiquote:"hr.wikiquote.org",hrwikisource:"hr.wikisource.org",hrwiktionary:"hr.wiktionary.org",hsbwiki:"hsb.wikipedia.org",hsbwiktionary:"hsb.wiktionary.org",htwiki:"ht.wikipedia.org",htwikisource:"ht.wikisource.org",huwiki:"hu.wikipedia.org",huwikibooks:"hu.wikibooks.org",huwikinews:"hu.wikinews.org",huwikiquote:"hu.wikiquote.org",huwikisource:"hu.wikisource.org",huwiktionary:"hu.wiktionary.org",hywiki:"hy.wikipedia.org",hywikibooks:"hy.wikibooks.org",hywikiquote:"hy.wikiquote.org",hywikisource:"hy.wikisource.org",hywiktionary:"hy.wiktionary.org",hzwiki:"hz.wikipedia.org",iawiki:"ia.wikipedia.org",iawikibooks:"ia.wikibooks.org",iawiktionary:"ia.wiktionary.org",idwiki:"id.wikipedia.org",idwikibooks:"id.wikibooks.org",idwikiquote:"id.wikiquote.org",idwikisource:"id.wikisource.org",idwiktionary:"id.wiktionary.org",iegcomwiki:"iegcom.wikimedia.org",iewiki:"ie.wikipedia.org",iewikibooks:"ie.wikibooks.org",iewiktionary:"ie.wiktionary.org",igwiki:"ig.wikipedia.org",iiwiki:"ii.wikipedia.org",ikwiki:"ik.wikipedia.org",ikwiktionary:"ik.wiktionary.org",ilowiki:"ilo.wikipedia.org",ilwikimedia:"il.wikimedia.org",incubatorwiki:"incubator.wikimedia.org",inhwiki:"inh.wikipedia.org",iowiki:"io.wikipedia.org",iowiktionary:"io.wiktionary.org",iswiki:"is.wikipedia.org",iswikibooks:"is.wikibooks.org",iswikiquote:"is.wikiquote.org",iswikisource:"is.wikisource.org",iswiktionary:"is.wiktionary.org",itwiki:"it.wikipedia.org",itwikibooks:"it.wikibooks.org",itwikinews:"it.wikinews.org",itwikiquote:"it.wikiquote.org",itwikisource:"it.wikisource.org",itwikiversity:"it.wikiversity.org",itwikivoyage:"it.wikivoyage.org",itwiktionary:"it.wiktionary.org",iuwiki:"iu.wikipedia.org",iuwiktionary:"iu.wiktionary.org",jamwiki:"jam.wikipedia.org",jawiki:"ja.wikipedia.org",jawikibooks:"ja.wikibooks.org",jawikinews:"ja.wikinews.org",jawikiquote:"ja.wikiquote.org",jawikisource:"ja.wikisource.org",jawikiversity:"ja.wikiversity.org",jawiktionary:"ja.wiktionary.org",jbowiki:"jbo.wikipedia.org",jbowiktionary:"jbo.wiktionary.org",jvwiki:"jv.wikipedia.org",jvwiktionary:"jv.wiktionary.org",kaawiki:"kaa.wikipedia.org",kabwiki:"kab.wikipedia.org",kawiki:"ka.wikipedia.org",kawikibooks:"ka.wikibooks.org",kawikiquote:"ka.wikiquote.org",kawiktionary:"ka.wiktionary.org",kbdwiki:"kbd.wikipedia.org",kgwiki:"kg.wikipedia.org",kiwiki:"ki.wikipedia.org",kjwiki:"kj.wikipedia.org",kkwiki:"kk.wikipedia.org",kkwikibooks:"kk.wikibooks.org",kkwikiquote:"kk.wikiquote.org",kkwiktionary:"kk.wiktionary.org",klwiki:"kl.wikipedia.org",klwiktionary:"kl.wiktionary.org",kmwiki:"km.wikipedia.org",kmwikibooks:"km.wikibooks.org",kmwiktionary:"km.wiktionary.org",knwiki:"kn.wikipedia.org",knwikibooks:"kn.wikibooks.org",knwikiquote:"kn.wikiquote.org",knwikisource:"kn.wikisource.org",knwiktionary:"kn.wiktionary.org",koiwiki:"koi.wikipedia.org",kowiki:"ko.wikipedia.org",kowikibooks:"ko.wikibooks.org",kowikinews:"ko.wikinews.org",kowikiquote:"ko.wikiquote.org",kowikisource:"ko.wikisource.org",kowikiversity:"ko.wikiversity.org",kowiktionary:"ko.wiktionary.org",kbpwiki:"kpb.wikipedia.org",krcwiki:"krc.wikipedia.org",krwiki:"kr.wikipedia.org",krwikiquote:"kr.wikiquote.org",kshwiki:"ksh.wikipedia.org",kswiki:"ks.wikipedia.org",kswikibooks:"ks.wikibooks.org",kswikiquote:"ks.wikiquote.org",kswiktionary:"ks.wiktionary.org",kuwiki:"ku.wikipedia.org",kuwikibooks:"ku.wikibooks.org",kuwikiquote:"ku.wikiquote.org",kuwiktionary:"ku.wiktionary.org",kvwiki:"kv.wikipedia.org",kwwiki:"kw.wikipedia.org",kwwikiquote:"kw.wikiquote.org",kwwiktionary:"kw.wiktionary.org",kywiki:"ky.wikipedia.org",kywikibooks:"ky.wikibooks.org",kywikiquote:"ky.wikiquote.org",kywiktionary:"ky.wiktionary.org",labswiki:"wikitech.wikimedia.org",ladwiki:"lad.wikipedia.org",lawiki:"la.wikipedia.org",lawikibooks:"la.wikibooks.org",lawikiquote:"la.wikiquote.org",lawikisource:"la.wikisource.org",lawiktionary:"la.wiktionary.org",lbewiki:"lbe.wikipedia.org",lbwiki:"lb.wikipedia.org",lbwikibooks:"lb.wikibooks.org",lbwikiquote:"lb.wikiquote.org",lbwiktionary:"lb.wiktionary.org",lezwiki:"lez.wikipedia.org",lfnwiki:"lfn.wikipedia.org",lgwiki:"lg.wikipedia.org",lijwiki:"lij.wikipedia.org",liwiki:"li.wikipedia.org",liwikibooks:"li.wikibooks.org",liwikiquote:"li.wikiquote.org",liwikisource:"li.wikisource.org",liwiktionary:"li.wiktionary.org",lmowiki:"lmo.wikipedia.org",lnwiki:"ln.wikipedia.org",lnwikibooks:"ln.wikibooks.org",lnwiktionary:"ln.wiktionary.org",loginwiki:"login.wikimedia.org",lowiki:"lo.wikipedia.org",lowiktionary:"lo.wiktionary.org",lrcwiki:"lrc.wikipedia.org",ltgwiki:"ltg.wikipedia.org",ltwiki:"lt.wikipedia.org",ltwikibooks:"lt.wikibooks.org",ltwikiquote:"lt.wikiquote.org",ltwikisource:"lt.wikisource.org",ltwiktionary:"lt.wiktionary.org",lvwiki:"lv.wikipedia.org",lvwikibooks:"lv.wikibooks.org",lvwiktionary:"lv.wiktionary.org",maiwiki:"mai.wikipedia.org",maiwikimedia:"mai.wikimedia.org",map_bmswiki:"map-bms.wikipedia.org",mdfwiki:"mdf.wikipedia.org",mediawikiwiki:"mediawiki.org",metawiki:"meta.wikimedia.org",mgwiki:"mg.wikipedia.org",mgwikibooks:"mg.wikibooks.org",mgwiktionary:"mg.wiktionary.org",mhrwiki:"mhr.wikipedia.org",mhwiki:"mh.wikipedia.org",mhwiktionary:"mh.wiktionary.org",minwiki:"min.wikipedia.org",miwiki:"mi.wikipedia.org",miwikibooks:"mi.wikibooks.org",miwiktionary:"mi.wiktionary.org",mkwiki:"mk.wikipedia.org",mkwikibooks:"mk.wikibooks.org",mkwikimedia:"mk.wikimedia.org",mkwikisource:"mk.wikisource.org",mkwiktionary:"mk.wiktionary.org",mlwiki:"ml.wikipedia.org",mlwikibooks:"ml.wikibooks.org",mlwikiquote:"ml.wikiquote.org",mlwikisource:"ml.wikisource.org",mlwiktionary:"ml.wiktionary.org",mnwiki:"mn.wikipedia.org",mnwikibooks:"mn.wikibooks.org",mnwiktionary:"mn.wiktionary.org",mowiki:"mo.wikipedia.org",mowiktionary:"mo.wiktionary.org",mrjwiki:"mrj.wikipedia.org",mrwiki:"mr.wikipedia.org",mrwikibooks:"mr.wikibooks.org",mrwikiquote:"mr.wikiquote.org",mrwikisource:"mr.wikisource.org",mrwiktionary:"mr.wiktionary.org",mswiki:"ms.wikipedia.org",mswikibooks:"ms.wikibooks.org",mswiktionary:"ms.wiktionary.org",mtwiki:"mt.wikipedia.org",mtwiktionary:"mt.wiktionary.org",muswiki:"mus.wikipedia.org",mwlwiki:"mwl.wikipedia.org",mxwikimedia:"mx.wikimedia.org",myvwiki:"myv.wikipedia.org",mywiki:"my.wikipedia.org",mywikibooks:"my.wikibooks.org",mywiktionary:"my.wiktionary.org",mznwiki:"mzn.wikipedia.org",nahwiki:"nah.wikipedia.org",nahwikibooks:"nah.wikibooks.org",nahwiktionary:"nah.wiktionary.org",napwiki:"nap.wikipedia.org",nawiki:"na.wikipedia.org",nawikibooks:"na.wikibooks.org",nawikiquote:"na.wikiquote.org",nawiktionary:"na.wiktionary.org",nds_nlwiki:"nds-nl.wikipedia.org",ndswiki:"nds.wikipedia.org",ndswikibooks:"nds.wikibooks.org",ndswikiquote:"nds.wikiquote.org",ndswiktionary:"nds.wiktionary.org",newiki:"ne.wikipedia.org",newikibooks:"ne.wikibooks.org",newiktionary:"ne.wiktionary.org",newwiki:"new.wikipedia.org",ngwiki:"ng.wikipedia.org",nlwiki:"nl.wikipedia.org",nlwikibooks:"nl.wikibooks.org",nlwikimedia:"nl.wikimedia.org",nlwikinews:"nl.wikinews.org",nlwikiquote:"nl.wikiquote.org",nlwikisource:"nl.wikisource.org",nlwikivoyage:"nl.wikivoyage.org",nlwiktionary:"nl.wiktionary.org",nnwiki:"nn.wikipedia.org",nnwikiquote:"nn.wikiquote.org",nnwiktionary:"nn.wiktionary.org",nostalgiawiki:"nostalgia.wikipedia.org",novwiki:"nov.wikipedia.org",nowiki:"no.wikipedia.org",nowikibooks:"no.wikibooks.org",nowikimedia:"no.wikimedia.org",nowikinews:"no.wikinews.org",nowikiquote:"no.wikiquote.org",nowikisource:"no.wikisource.org",nowiktionary:"no.wiktionary.org",nrmwiki:"nrm.wikipedia.org",nsowiki:"nso.wikipedia.org",nvwiki:"nv.wikipedia.org",nycwikimedia:"nyc.wikimedia.org",nywiki:"ny.wikipedia.org",nzwikimedia:"nz.wikimedia.org",ocwiki:"oc.wikipedia.org",ocwikibooks:"oc.wikibooks.org",ocwiktionary:"oc.wiktionary.org",olowiki:"olo.wikipedia.org",omwiki:"om.wikipedia.org",omwiktionary:"om.wiktionary.org",orwiki:"or.wikipedia.org",orwikisource:"or.wikisource.org",orwiktionary:"or.wiktionary.org",oswiki:"os.wikipedia.org",outreachwiki:"outreach.wikimedia.org",pa_uswikimedia:"pa-us.wikimedia.org",pagwiki:"pag.wikipedia.org",pamwiki:"pam.wikipedia.org",papwiki:"pap.wikipedia.org",pawiki:"pa.wikipedia.org",pawikibooks:"pa.wikibooks.org",pawikisource:"pa.wikisource.org",pawiktionary:"pa.wiktionary.org",pcdwiki:"pcd.wikipedia.org",pdcwiki:"pdc.wikipedia.org",pflwiki:"pfl.wikipedia.org",pihwiki:"pih.wikipedia.org",piwiki:"pi.wikipedia.org",piwiktionary:"pi.wiktionary.org",plwiki:"pl.wikipedia.org",plwikibooks:"pl.wikibooks.org",plwikimedia:"pl.wikimedia.org",plwikinews:"pl.wikinews.org",plwikiquote:"pl.wikiquote.org",plwikisource:"pl.wikisource.org",plwikivoyage:"pl.wikivoyage.org",plwiktionary:"pl.wiktionary.org",pmswiki:"pms.wikipedia.org",pnbwiki:"pnb.wikipedia.org",pnbwiktionary:"pnb.wiktionary.org",pntwiki:"pnt.wikipedia.org",pswiki:"ps.wikipedia.org",pswikibooks:"ps.wikibooks.org",pswiktionary:"ps.wiktionary.org",ptwiki:"pt.wikipedia.org",ptwikibooks:"pt.wikibooks.org",ptwikimedia:"pt.wikimedia.org",ptwikinews:"pt.wikinews.org",ptwikiquote:"pt.wikiquote.org",ptwikisource:"pt.wikisource.org",ptwikiversity:"pt.wikiversity.org",ptwikivoyage:"pt.wikivoyage.org",ptwiktionary:"pt.wiktionary.org",quwiki:"qu.wikipedia.org",quwikibooks:"qu.wikibooks.org",quwikiquote:"qu.wikiquote.org",quwiktionary:"qu.wiktionary.org",rmwiki:"rm.wikipedia.org",rmwikibooks:"rm.wikibooks.org",rmwiktionary:"rm.wiktionary.org",rmywiki:"rmy.wikipedia.org",rnwiki:"rn.wikipedia.org",rnwiktionary:"rn.wiktionary.org",roa_rupwiki:"roa-rup.wikipedia.org",roa_rupwiktionary:"roa-rup.wiktionary.org",roa_tarawiki:"roa-tara.wikipedia.org",rowiki:"ro.wikipedia.org",rowikibooks:"ro.wikibooks.org",rowikinews:"ro.wikinews.org",rowikiquote:"ro.wikiquote.org",rowikisource:"ro.wikisource.org",rowikivoyage:"ro.wikivoyage.org",rowiktionary:"ro.wiktionary.org",rswikimedia:"rs.wikimedia.org",ruewiki:"rue.wikipedia.org",ruwiki:"ru.wikipedia.org",ruwikibooks:"ru.wikibooks.org",ruwikimedia:"ru.wikimedia.org",ruwikinews:"ru.wikinews.org",ruwikiquote:"ru.wikiquote.org",ruwikisource:"ru.wikisource.org",ruwikiversity:"ru.wikiversity.org",ruwikivoyage:"ru.wikivoyage.org",ruwiktionary:"ru.wiktionary.org",rwwiki:"rw.wikipedia.org",rwwiktionary:"rw.wiktionary.org",sahwiki:"sah.wikipedia.org",sahwikisource:"sah.wikisource.org",sawiki:"sa.wikipedia.org",sawikibooks:"sa.wikibooks.org",sawikiquote:"sa.wikiquote.org",sawikisource:"sa.wikisource.org",sawiktionary:"sa.wiktionary.org",scnwiki:"scn.wikipedia.org",scnwiktionary:"scn.wiktionary.org",scowiki:"sco.wikipedia.org",scwiki:"sc.wikipedia.org",scwiktionary:"sc.wiktionary.org",sdwiki:"sd.wikipedia.org",sdwikinews:"sd.wikinews.org",sdwiktionary:"sd.wiktionary.org",sewiki:"se.wikipedia.org",sewikibooks:"se.wikibooks.org",sewikimedia:"se.wikimedia.org",sgwiki:"sg.wikipedia.org",sgwiktionary:"sg.wiktionary.org",shwiki:"sh.wikipedia.org",shwiktionary:"sh.wiktionary.org",simplewiki:"simple.wikipedia.org",simplewikibooks:"simple.wikibooks.org",simplewikiquote:"simple.wikiquote.org",simplewiktionary:"simple.wiktionary.org",siwiki:"si.wikipedia.org",siwikibooks:"si.wikibooks.org",siwiktionary:"si.wiktionary.org",skwiki:"sk.wikipedia.org",skwikibooks:"sk.wikibooks.org",skwikiquote:"sk.wikiquote.org",skwikisource:"sk.wikisource.org",skwiktionary:"sk.wiktionary.org",slwiki:"sl.wikipedia.org",slwikibooks:"sl.wikibooks.org",slwikiquote:"sl.wikiquote.org",slwikisource:"sl.wikisource.org",slwikiversity:"sl.wikiversity.org",slwiktionary:"sl.wiktionary.org",smwiki:"sm.wikipedia.org",smwiktionary:"sm.wiktionary.org",snwiki:"sn.wikipedia.org",snwiktionary:"sn.wiktionary.org",sourceswiki:"wikisource.org",sowiki:"so.wikipedia.org",sowiktionary:"so.wiktionary.org",specieswiki:"species.wikimedia.org", sqwiki:"sq.wikipedia.org",sqwikibooks:"sq.wikibooks.org",sqwikinews:"sq.wikinews.org",sqwikiquote:"sq.wikiquote.org",sqwiktionary:"sq.wiktionary.org",srnwiki:"srn.wikipedia.org",srwiki:"sr.wikipedia.org",srwikibooks:"sr.wikibooks.org",srwikinews:"sr.wikinews.org",srwikiquote:"sr.wikiquote.org",srwikisource:"sr.wikisource.org",srwiktionary:"sr.wiktionary.org",sswiki:"ss.wikipedia.org",sswiktionary:"ss.wiktionary.org",stqwiki:"stq.wikipedia.org",stwiki:"st.wikipedia.org",stwiktionary:"st.wiktionary.org",suwiki:"su.wikipedia.org",suwikibooks:"su.wikibooks.org",suwikiquote:"su.wikiquote.org",suwiktionary:"su.wiktionary.org",svwiki:"sv.wikipedia.org",svwikibooks:"sv.wikibooks.org",svwikinews:"sv.wikinews.org",svwikiquote:"sv.wikiquote.org",svwikisource:"sv.wikisource.org",svwikiversity:"sv.wikiversity.org",svwikivoyage:"sv.wikivoyage.org",svwiktionary:"sv.wiktionary.org",swwiki:"sw.wikipedia.org",swwikibooks:"sw.wikibooks.org",swwiktionary:"sw.wiktionary.org",szlwiki:"szl.wikipedia.org",tawiki:"ta.wikipedia.org",tawikibooks:"ta.wikibooks.org",tawikinews:"ta.wikinews.org",tawikiquote:"ta.wikiquote.org",tawikisource:"ta.wikisource.org",tawiktionary:"ta.wiktionary.org",tcywiki:"tcy.wikipedia.org",testwiki:"test.wikipedia.org",test2wiki:"test2.wikipedia.org",tetwiki:"tet.wikipedia.org",tewiki:"te.wikipedia.org",tewikibooks:"te.wikibooks.org",tewikiquote:"te.wikiquote.org",tewikisource:"te.wikisource.org",tewiktionary:"te.wiktionary.org",tgwiki:"tg.wikipedia.org",tgwikibooks:"tg.wikibooks.org",tgwiktionary:"tg.wiktionary.org",thwiki:"th.wikipedia.org",thwikibooks:"th.wikibooks.org",thwikinews:"th.wikinews.org",thwikiquote:"th.wikiquote.org",thwikisource:"th.wikisource.org",thwiktionary:"th.wiktionary.org",tiwiki:"ti.wikipedia.org",tiwiktionary:"ti.wiktionary.org",tkwiki:"tk.wikipedia.org",tkwikibooks:"tk.wikibooks.org",tkwikiquote:"tk.wikiquote.org",tkwiktionary:"tk.wiktionary.org",tlwiki:"tl.wikipedia.org",tlwikibooks:"tl.wikibooks.org",tlwiktionary:"tl.wiktionary.org",tnwiki:"tn.wikipedia.org",tnwiktionary:"tn.wiktionary.org",towiki:"to.wikipedia.org",towiktionary:"to.wiktionary.org",tpiwiki:"tpi.wikipedia.org",tpiwiktionary:"tpi.wiktionary.org",trwiki:"tr.wikipedia.org",trwikibooks:"tr.wikibooks.org",trwikimedia:"tr.wikimedia.org",trwikinews:"tr.wikinews.org",trwikiquote:"tr.wikiquote.org",trwikisource:"tr.wikisource.org",trwiktionary:"tr.wiktionary.org",tswiki:"ts.wikipedia.org",tswiktionary:"ts.wiktionary.org",ttwiki:"tt.wikipedia.org",ttwikibooks:"tt.wikibooks.org",ttwikiquote:"tt.wikiquote.org",ttwiktionary:"tt.wiktionary.org",tumwiki:"tum.wikipedia.org",twwiki:"tw.wikipedia.org",twwiktionary:"tw.wiktionary.org",tyvwiki:"tyv.wikipedia.org",tywiki:"ty.wikipedia.org",uawikimedia:"ua.wikimedia.org",udmwiki:"udm.wikipedia.org",ugwiki:"ug.wikipedia.org",ugwikibooks:"ug.wikibooks.org",ugwikiquote:"ug.wikiquote.org",ugwiktionary:"ug.wiktionary.org",ukwiki:"uk.wikipedia.org",ukwikibooks:"uk.wikibooks.org",ukwikimedia:"uk.wikimedia.org",ukwikinews:"uk.wikinews.org",ukwikiquote:"uk.wikiquote.org",ukwikisource:"uk.wikisource.org",ukwikivoyage:"uk.wikivoyage.org",ukwiktionary:"uk.wiktionary.org",urwiki:"ur.wikipedia.org",urwikibooks:"ur.wikibooks.org",urwikiquote:"ur.wikiquote.org",urwiktionary:"ur.wiktionary.org",uzwiki:"uz.wikipedia.org",uzwikibooks:"uz.wikibooks.org",uzwikiquote:"uz.wikiquote.org",uzwiktionary:"uz.wiktionary.org",vecwiki:"vec.wikipedia.org",vecwikisource:"vec.wikisource.org",vecwiktionary:"vec.wiktionary.org",vepwiki:"vep.wikipedia.org",vewiki:"ve.wikipedia.org",viwiki:"vi.wikipedia.org",viwikibooks:"vi.wikibooks.org",viwikiquote:"vi.wikiquote.org",viwikisource:"vi.wikisource.org",viwikivoyage:"vi.wikivoyage.org",viwiktionary:"vi.wiktionary.org",vlswiki:"vls.wikipedia.org",vowiki:"vo.wikipedia.org",vowikibooks:"vo.wikibooks.org",vowikiquote:"vo.wikiquote.org",vowiktionary:"vo.wiktionary.org",warwiki:"war.wikipedia.org",wawiki:"wa.wikipedia.org",wawikibooks:"wa.wikibooks.org",wawiktionary:"wa.wiktionary.org",wbwikimedia:"wb.wikimedia.org",wg_enwiki:"wg-en.wikipedia.org",wikidatawiki:"wikidata.org",wowiki:"wo.wikipedia.org",wowikiquote:"wo.wikiquote.org",wowiktionary:"wo.wiktionary.org",wuuwiki:"wuu.wikipedia.org",xalwiki:"xal.wikipedia.org",xhwiki:"xh.wikipedia.org",xhwikibooks:"xh.wikibooks.org",xhwiktionary:"xh.wiktionary.org",xmfwiki:"xmf.wikipedia.org",yiwiki:"yi.wikipedia.org",yiwikisource:"yi.wikisource.org",yiwiktionary:"yi.wiktionary.org",yowiki:"yo.wikipedia.org",yowikibooks:"yo.wikibooks.org",yowiktionary:"yo.wiktionary.org",zawiki:"za.wikipedia.org",zawikibooks:"za.wikibooks.org",zawikiquote:"za.wikiquote.org",zawiktionary:"za.wiktionary.org",zeawiki:"zea.wikipedia.org",zh_classicalwiki:"zh-classical.wikipedia.org",zh_min_nanwiki:"zh-min-nan.wikipedia.org",zh_min_nanwikibooks:"zh-min-nan.wikibooks.org",zh_min_nanwikiquote:"zh-min-nan.wikiquote.org",zh_min_nanwikisource:"zh-min-nan.wikisource.org",zh_min_nanwiktionary:"zh-min-nan.wiktionary.org",zh_yuewiki:"zh-yue.wikipedia.org",zhwiki:"zh.wikipedia.org",zhwikibooks:"zh.wikibooks.org",zhwikinews:"zh.wikinews.org",zhwikiquote:"zh.wikiquote.org",zhwikisource:"zh.wikisource.org",zhwikivoyage:"zh.wikivoyage.org",zhwiktionary:"zh.wiktionary.org",zuwiki:"zu.wikipedia.org",zuwikibooks:"zu.wikibooks.org",zuwiktionary:"zu.wiktionary.org"};e.exports=n},{}],11:[function(t,e,i){"use strict";var n=(Chart.Zoom=Chart.Zoom||{},{beforeInit:function(t){if(t.options.zoom){t.zoom={};var e=t.chart.ctx.canvas;t.zoom._mouseDownHandler=function(e){t.zoom._dragZoomStart=e},e.addEventListener("mousedown",t.zoom._mouseDownHandler),t.zoom._mouseMoveHandler=function(e){t.zoom._dragZoomStart&&(t.zoom._dragZoomEnd=e,t.update(0))},e.addEventListener("mousemove",t.zoom._mouseMoveHandler),t.zoom._mouseUpHandler=function(e){if(t.zoom._dragZoomStart){var i=t.zoom._dragZoomStart,n=i.target.getBoundingClientRect().left,a=Math.min(i.clientX,e.clientX)-n,o=Math.max(i.clientX,e.clientX)-n,r=t.scales["x-axis-0"],s=r.getValueForPixel(a),l=r.getValueForPixel(o);if(o-a<=0)return void(t.zoom._dragZoomStart=null);t.zoom._dragZoomStart=null,t.zoom._dragZoomEnd=null;var c=t.data.labels,u=$(".aqs-date-range-selector").data("daterangepicker");if(l-s+1===c.length)return t.update(0);u.startDate=moment(c[s],t.data.dateFormat),u.setEndDate(moment(c[l],t.data.dateFormat)),u.updateElement()}},e.addEventListener("mouseup",t.zoom._mouseUpHandler)}},beforeDatasetsDraw:function(t){if(t.options.zoom&&t.zoom._dragZoomStart&&t.zoom._dragZoomEnd){var e=t.chart.ctx,i=t.chartArea;e.save(),e.beginPath();var n=t.scales["y-axis-0"],a=t.zoom._dragZoomStart,o=t.zoom._dragZoomEnd,r=a.target.getBoundingClientRect().left,s=Math.min(a.clientX,o.clientX)-r,l=Math.max(a.clientX,o.clientX)-r,c=l-s;e.fillStyle="rgba(225,225,225,0.3)",e.lineWidth=5,e.fillRect(s,n.top,c,n.bottom-n.top),e.rect(i.left,i.top,i.right-i.left,i.bottom-i.top),e.clip()}},afterDatasetsDraw:function(t){t.options.zoom&&t.chart.ctx.restore()}});Chart.pluginService.register(n)},{}]},{},[2]); \ No newline at end of file diff --git a/public_html/metaviews/application.css b/public_html/metaviews/application.css index ed9163c8b..a8580534c 100644 --- a/public_html/metaviews/application.css +++ b/public_html/metaviews/application.css @@ -1,3 +1,8 @@ +/*! + * Bootstrap v3.3.5 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css *//*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */.glyphicon-bitcoin:before,.glyphicon-btc:before,.glyphicon-xbt:before{content:"\e227"}.glyphicon-jpy:before,.glyphicon-yen:before{content:"\00a5"}.glyphicon-rub:before,.glyphicon-ruble:before{content:"\20bd"}*,:after,:before{box-sizing:border-box}.list-inline,.list-unstyled{padding-left:0;list-style:none}code,kbd{padding:2px 4px;font-size:90%}caption,th{text-align:left}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}fieldset,legend{padding:0;border:0}.form-control,output{display:block;font-size:14px;line-height:1.42857143;color:#555}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .checkbox label,fieldset[disabled] .radio-inline,fieldset[disabled] .radio label,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.input-group-btn,.input-group-btn>.btn{position:relative}.nav>li,.nav>li>a{position:relative;display:block}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#9d9d9d}.jumbotron,.jumbotron .h1,.jumbotron h1,.panel-heading>.dropdown .dropdown-toggle,.panel-title{color:inherit}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.modal,.modal-open{overflow:hidden}.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.carousel,.carousel-inner{position:relative}.carousel-control.left{background-image:linear-gradient(90deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001))}.carousel-control.right{background-image:linear-gradient(90deg,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5))}.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{background-image:linear-gradient(180deg,#fff 0,#eee 50%)}.daterangepicker.openscenter:after,.daterangepicker.openscenter:before{left:0;right:0;width:0;margin-left:auto;margin-right:auto}.ranges li.active,.ranges li:hover{background-color:#08c;border:1px solid #08c;color:#fff}@media (min-width:564px){.daterangepicker{width:auto}.daterangepicker .ranges ul{width:160px}.daterangepicker.single .ranges ul{width:100%}.daterangepicker.single .calendar.left{clear:none}.daterangepicker.single.ltr .calendar,.daterangepicker.single.ltr .ranges{float:left}.daterangepicker.single.rtl .calendar,.daterangepicker.single.rtl .ranges{float:right}.daterangepicker.ltr{direction:ltr;text-align:left}.daterangepicker.ltr .calendar.left{clear:left;margin-right:0}.daterangepicker.ltr .calendar.left .calendar-table{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.daterangepicker.ltr .calendar.right{margin-left:0}.daterangepicker.ltr .calendar.right .calendar-table{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.daterangepicker.ltr .calendar.left .calendar-table,.daterangepicker.ltr .left .daterangepicker_input{padding-right:12px}.daterangepicker.ltr .calendar,.daterangepicker.ltr .ranges{float:left}.daterangepicker.rtl{direction:rtl;text-align:right}.daterangepicker.rtl .calendar.left{clear:right;margin-left:0}.daterangepicker.rtl .calendar.left .calendar-table{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.daterangepicker.rtl .calendar.right{margin-right:0}.daterangepicker.rtl .calendar.right .calendar-table{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.daterangepicker.rtl .calendar.left .calendar-table,.daterangepicker.rtl .left .daterangepicker_input{padding-left:12px}.daterangepicker.rtl .calendar,.daterangepicker.rtl .ranges{text-align:right;float:right}} /*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. @@ -7,7 +12,7 @@ * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css *//*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */.glyphicon-bitcoin:before,.glyphicon-btc:before,.glyphicon-xbt:before{content:"\e227"}.glyphicon-jpy:before,.glyphicon-yen:before{content:"\00a5"}.glyphicon-rub:before,.glyphicon-ruble:before{content:"\20bd"}*,:after,:before{box-sizing:border-box}.list-inline,.list-unstyled{padding-left:0;list-style:none}code,kbd{padding:2px 4px;font-size:90%}caption,th{text-align:left}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}fieldset,legend{padding:0;border:0}.form-control,output{display:block;font-size:14px;line-height:1.42857143;color:#555}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .checkbox label,fieldset[disabled] .radio-inline,fieldset[disabled] .radio label,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.input-group-btn,.input-group-btn>.btn{position:relative}.nav>li,.nav>li>a{position:relative;display:block}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#9d9d9d}.jumbotron,.jumbotron .h1,.jumbotron h1,.panel-heading>.dropdown .dropdown-toggle,.panel-title{color:inherit}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.modal,.modal-open{overflow:hidden}.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.carousel,.carousel-inner{position:relative}.carousel-control.left{background-image:linear-gradient(90deg,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001))}.carousel-control.right{background-image:linear-gradient(90deg,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5))}.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{background-image:linear-gradient(180deg,#fff 0,#eee 50%)}.daterangepicker.openscenter:after,.daterangepicker.openscenter:before{left:0;right:0;width:0;margin-left:auto;margin-right:auto}.ranges li.active,.ranges li:hover{background-color:#08c;border:1px solid #08c;color:#fff}@media (min-width:564px){.daterangepicker{width:auto}.daterangepicker .ranges ul{width:160px}.daterangepicker.single .ranges ul{width:100%}.daterangepicker.single .calendar.left{clear:none}.daterangepicker.single.ltr .calendar,.daterangepicker.single.ltr .ranges{float:left}.daterangepicker.single.rtl .calendar,.daterangepicker.single.rtl .ranges{float:right}.daterangepicker.ltr{direction:ltr;text-align:left}.daterangepicker.ltr .calendar.left{clear:left;margin-right:0}.daterangepicker.ltr .calendar.left .calendar-table{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.daterangepicker.ltr .calendar.right{margin-left:0}.daterangepicker.ltr .calendar.right .calendar-table{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.daterangepicker.ltr .calendar.left .calendar-table,.daterangepicker.ltr .left .daterangepicker_input{padding-right:12px}.daterangepicker.ltr .calendar,.daterangepicker.ltr .ranges{float:left}.daterangepicker.rtl{direction:rtl;text-align:right}.daterangepicker.rtl .calendar.left{clear:right;margin-left:0}.daterangepicker.rtl .calendar.left .calendar-table{border-left:none;border-top-left-radius:0;border-bottom-left-radius:0}.daterangepicker.rtl .calendar.right{margin-right:0}.daterangepicker.rtl .calendar.right .calendar-table{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}.daterangepicker.rtl .calendar.left .calendar-table,.daterangepicker.rtl .left .daterangepicker_input{padding-left:12px}.daterangepicker.rtl .calendar,.daterangepicker.rtl .ranges{text-align:right;float:right}} + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css *//*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ /*! * Bootstrap v3.3.5 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc.