Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CoreHome.umd.min.js « dist « vue « CoreHome « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7827d9f24e7d58c61a8fb2dbf201dc2d6bf25db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["CoreHome"]=t(require("vue")):e["CoreHome"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="fae3")}({"8bbf":function(t,r){t.exports=e},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"activityIndicatorAdapter",(function(){return _})),r.d(t,"ActivityIndicator",(function(){return M})),r.d(t,"translate",(function(){return R})),r.d(t,"alertAdapter",(function(){return H})),r.d(t,"AjaxHelper",(function(){return u})),r.d(t,"PiwikUrl",(function(){return o})),r.d(t,"Piwik",(function(){return I})),r.d(t,"Periods",(function(){return p})),r.d(t,"Day",(function(){return V})),r.d(t,"Week",(function(){return Y})),r.d(t,"Month",(function(){return W})),r.d(t,"Year",(function(){return K})),r.d(t,"Range",(function(){return N})),"undefined"!==typeof window){var a=window.document.currentScript,n=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
const i={getSearchParam(e){const t=window.location.href.split("#"),r=new RegExp(e+"(\\[]|=)");if(t&&t[1]&&r.test(decodeURIComponent(t[1]))){const t=window.broadcast.getValueFromHash(e,window.location.href);if(t||"date"!==e&&"period"!==e&&"idSite"!==e)return t}return window.broadcast.getValueFromUrl(e,window.location.search)}};var o=i;function s(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function l(e,t){if("abort"===t)return;const r=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):r.show()}window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(let e=this.length;e>=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(...e){return this.active+=e.length,this.clean(),Array.prototype.push.call(this,...e)},window.globalAjaxQueue.abort=function(){this.forEach(e=>e&&e.abort&&e.abort()),this.splice(0,this.length),this.active=0};class u{constructor(){s(this,"format","json"),s(this,"timeout",null),s(this,"callback",null),s(this,"useRegularCallbackInCaseOfError",!1),s(this,"errorCallback",void 0),s(this,"withToken",!1),s(this,"completeCallback",void 0),s(this,"getParams",{}),s(this,"getUrl","?"),s(this,"postParams",{}),s(this,"loadingElement",null),s(this,"errorElement","#ajaxError"),s(this,"requestHandle",null),s(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=l}addParams(e,t){"string"===typeof e&&(e=window["broadcast"].getValuesFromUrl(e));const r=["compareSegments","comparePeriods","compareDates"];Object.keys(e).forEach(a=>{const n=e[a];(-1===r.indexOf(a)||n)&&("get"===t.toLowerCase()?this.getParams[a]=n:"post"===t.toLowerCase()&&(this.postParams[a]=n))})}withTokenInUrl(){this.withToken=!0}setUrl(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}setBulkRequests(...e){const t=e.map(e=>$.param(e));this.addParams({module:"API",method:"API.getBulkRequest",urls:t,format:"json"},"post")}setTimeout(e){this.timeout=e}setCallback(e){this.callback=e}useCallbackInCaseOfError(){this.useRegularCallbackInCaseOfError=!0}redirectOnSuccess(e){this.setCallback(()=>{piwikHelper.redirect(e)})}setErrorCallback(e){this.errorCallback=e}setCompleteCallback(e){this.completeCallback=e}setFormat(e){this.format=e}setLoadingElement(e){this.loadingElement=e||"#ajaxLoadingDiv"}setErrorElement(e){e&&(this.errorElement=e)}useGETDefaultParameter(e){if(e&&this.defaultParams)for(let t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}removeDefaultParameter(e){if(e&&this.defaultParams)for(let t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}send(){$(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),globalAjaxQueue.push(this.requestHandle)}abort(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}buildAjaxCall(){const e=this,t=this.mixinDefaultGetParams(this.getParams);let r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),t.segment&&(r=`${r}segment=${t.segment}&`,delete t.segment),t.date&&(r=`${r}date=${decodeURIComponent(t.date.toString())}&`,delete t.date),r+=$.param(t);const a={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,error:function(){globalAjaxQueue.active-=1,e.errorCallback&&e.errorCallback.apply(this,arguments)},success:(e,t,r)=>{if(this.loadingElement&&$(this.loadingElement).hide(),e&&"error"===e.result&&!this.useRegularCallbackInCaseOfError){let t=null,r="toast";if($(this.errorElement).length&&e.message&&($(this.errorElement).show(),t=this.errorElement,r=null),e.message){const a=window["require"]("piwik/UI"),n=new a.Notification;n.show(e.message,{placeat:t,context:"error",type:r,id:"ajaxHelper"}),n.scrollToNotification()}}else this.callback&&this.callback(e,t,r);globalAjaxQueue.active-=1;const{piwik:a}=window;a&&a.ajaxRequestFinished&&a.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(a)}isRequestToApiMethod(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}isWidgetizedRequest(){return"Widgetize"===broadcast.getValueFromUrl("module")}getDefaultPostParams(){return this.withToken||this.isRequestToApiMethod()||piwik.shouldPropagateTokenAuth?{token_auth:piwik.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}mixinDefaultPostParams(e){const t=this.getDefaultPostParams(),r={...t,...e};return r}mixinDefaultGetParams(e){const t=o.getSearchParam("segment"),r={idSite:piwik.idSite||broadcast.getValueFromUrl("idSite"),period:piwik.period||broadcast.getValueFromUrl("period"),segment:t},a=e;return a.token_auth&&(a.token_auth=null,delete a.token_auth),Object.keys(r).forEach(e=>{this.useGETDefaultParameter(e)&&!a[e]&&!this.postParams[e]&&r[e]&&(a[e]=r[e])}),!this.useGETDefaultParameter("date")||a.date||this.postParams.date||(a.date=piwik.currentDateString),a}}function d(){return globalAjaxQueue}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
function c(){const e={getSearchParam:o.getSearchParam.bind(o)};return e}function g(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */window.ajaxHelper=u,angular.module("piwikApp.service").service("globalAjaxQueue",d),c.$inject=[],angular.module("piwikApp.service").service("piwikUrl",c);class h{constructor(){g(this,"periods",{}),g(this,"periodOrder",[])}addCustomPeriod(e,t){if(this.periods[e])throw new Error(`The "${e}" period already exists! It cannot be overridden.`);this.periods[e]=t,this.periodOrder.push(e)}getAllLabels(){return Array().concat(this.periodOrder)}get(e){const t=this.periods[e];if(!t)throw new Error("Invalid period label: "+e);return t}parse(e,t){return this.get(e).parse(t)}isRecognizedPeriod(e){return!!this.periods[e]}}var p=new h;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function m(e){return $.datepicker.formatDate("yy-mm-dd",e)}function f(){const e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function b(e){if(e instanceof Date)return e;const t=decodeURIComponent(e);if("today"===t||"now"===t)return f();if("yesterday"===t||"yesterdaySameTime"===t){const e=f();return e.setDate(e.getDate()-1),e}if(t.match(/last[ -]?week/i)){const e=f();return e.setDate(e.getDate()-7),e}if(t.match(/last[ -]?month/i)){const e=f();return e.setDate(1),e.setMonth(e.getMonth()-1),e}if(t.match(/last[ -]?year/i)){const e=f();return e.setFullYear(e.getFullYear()-1),e}try{return $.datepicker.parseDate("yy-mm-dd",t)}catch(r){throw console.error(r.message||r),r}}function w(e){return 2===e.length&&(f()>=e[0]&&f()<=e[1])}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */let P;const{piwik:y,broadcast:D,piwikHelper:k}=window;function v(e,t){try{return p.parse(e,t),!0}catch(r){return!1}}y.helper=k,y.broadcast=D,y.updatePeriodParamsFromUrl=function(){let e=o.getSearchParam("date");const t=o.getSearchParam("period");if(!v(t,e))return;if(y.period===t&&y.currentDateString===e)return;y.period=t;const r=p.parse(t,e).getDateRange();y.startDateString=m(r[0]),y.endDateString=m(r[1]),y.updateDateInTitle(e,t),"range"===y.period&&(e=`${y.startDateString},${y.endDateString}`),y.currentDateString=e},y.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(P=P||document.title,0===P.indexOf(y.siteName))){const r=` - ${p.parse(t,e).getPrettyString()} `;document.title=`${y.siteName}${r}${P.substr(y.siteName.length)}`}},y.hasUserCapability=function(e){return window.angular.isArray(y.userCapabilities)&&-1!==y.userCapabilities.indexOf(e)};const j=y;var I=j;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function T(){return I}function S(e,t){t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}angular.module("piwikApp.service").service("piwik",T),S.$inject=["piwik","$rootScope"],angular.module("piwikApp.service").run(S);var x=r("8bbf");const C={class:"loadingPiwik"},O=Object(x["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function A(e,t,r,a,n,i){return Object(x["withDirectives"])((Object(x["openBlock"])(),Object(x["createElementBlock"])("div",C,[O,Object(x["createElementVNode"])("span",null,Object(x["toDisplayString"])(e.loadingMessage),1)],512)),[[x["vShow"],e.loading]])}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function R(e,t=[]){return window._pk_translate(e,t)}var E=Object(x["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:R("General_LoadingData")}}});E.render=A;var M=E;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function _(){return{restrict:"A",scope:{loading:"<",loadingMessage:"<"},template:"",link:function(e,t){const r=Object(x["createApp"])({template:'<activity-indicator :loading="loading" :loadingMessage="loadingMessage"/>',data(){return{loading:e.loading,loadingMessage:e.loadingMessage}}});r.component("activity-indicator",M);const a=r.mount(t[0]);e.$watch("loading",e=>{a.loading=e}),e.$watch("loadingMessage",e=>{a.loadingMessage=e||R("General_LoadingData")})}}}function q(e,t,r,a,n,i){return Object(x["openBlock"])(),Object(x["createElementBlock"])("div",{class:Object(x["normalizeClass"])(["alert",{["alert-"+e.severity]:!0}])},[Object(x["renderSlot"])(e.$slots,"default")],2)}_.$inject=[],angular.module("piwikApp").directive("piwikActivityIndicator",_);var U=Object(x["defineComponent"])({props:{severity:{type:String,required:!0}}});U.render=q;var F=U;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function H(){return{restrict:"A",transclude:!0,scope:{severity:"@piwikAlert"},template:"<div ng-transclude/>",compile:function(){return{post:function(e,t){const r=t.find("[ng-transclude]"),a=Object(x["createApp"])({template:'<alert :severity="severity"><div ref="transcludeTarget"/></alert>',data(){return{severity:e.severity}},setup(){const e=Object(x["ref"])(null);return{transcludeTarget:e}}});a.component("alert",F);const n=a.mount(t[0]);e.$watch("severity",e=>{n.severity=e}),$(n.transcludeTarget).append(r)}}}}}function L(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */H.$inject=[],angular.module("piwikApp").directive("piwikAlert",H);class N{constructor(e,t,r){L(this,"startDate",void 0),L(this,"endDate",void 0),L(this,"childPeriodType",void 0),this.startDate=e,this.endDate=t,this.childPeriodType=r}static getLastNRange(e,t,r){const a=Math.max(parseInt(t.toString(),10)-1,0);if(Number.isNaN(a))throw new Error("Invalid range strAmount");let n=r?b(r):f(),i=new Date(n.getTime());if("day"===e)i.setDate(i.getDate()-a);else if("week"===e)i.setDate(i.getDate()-7*a);else if("month"===e)i.setDate(1),i.setMonth(i.getMonth()-a);else{if("year"!==e)throw new Error(`Unknown period type '${e}'.`);i.setFullYear(i.getFullYear()-a)}if("day"!==e){const t=p.periods[e].parse(i),r=p.periods[e].parse(n);[i]=t.getDateRange(),[,n]=r.getDateRange()}const o=new Date(1991,7,6);if(i.getTime()-o.getTime()<0)switch(e){case"year":i=new Date(1992,0,1);break;case"month":i=new Date(1991,8,1);break;case"week":i=new Date(1991,8,12);break;case"day":default:i=o;break}return new N(i,n,e)}static parse(e,t="day"){if(/^previous/.test(e)){const r=N.getLastNRange(t,"2").startDate;return N.getLastNRange(t,e.substring(8),r)}if(/^last/.test(e))return N.getLastNRange(t,e.substring(4));const r=decodeURIComponent(e).split(",");return new N(b(r[0]),b(r[1]),t)}static getDisplayText(){return R("General_DateRangeInPeriodList")}getPrettyString(){const e=m(this.startDate),t=m(this.endDate);return R("General_DateRangeFromTo",[e,t])}getDateRange(){return[this.startDate,this.endDate]}containsToday(){return w(this.getDateRange())}}function G(){return{getAllLabels:p.getAllLabels.bind(p),isRecognizedPeriod:p.isRecognizedPeriod.bind(p),get:p.get.bind(p),parse:p.parse.bind(p),parseDate:b,format:m,RangePeriod:N,todayIsInRange:w}}function Q(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */p.addCustomPeriod("range",N),
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
window.piwik.addCustomPeriod=p.addCustomPeriod.bind(p),angular.module("piwikApp.service").factory("piwikPeriods",G);class V{constructor(e){Q(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new V(b(e))}static getDisplayText(){return R("Intl_PeriodDay")}getPrettyString(){return m(this.dateInPeriod)}getDateRange(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}containsToday(){return w(this.getDateRange())}}function z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */p.addCustomPeriod("day",V);class Y{constructor(e){z(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new Y(b(e))}static getDisplayText(){return R("Intl_PeriodWeek")}getPrettyString(){const e=this.getDateRange(),t=m(e[0]),r=m(e[1]);return R("General_DateRangeFromTo",[t,r])}getDateRange(){const e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);const r=new Date(t.getTime());return r.setDate(t.getDate()+6),[t,r]}containsToday(){return w(this.getDateRange())}}function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */p.addCustomPeriod("week",Y);class W{constructor(e){B(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new W(b(e))}static getDisplayText(){return R("Intl_PeriodMonth")}getPrettyString(){const e=R("Intl_Month_Long_StandAlone_"+(this.dateInPeriod.getMonth()+1));return`${e} ${this.dateInPeriod.getFullYear()}`}getDateRange(){const e=new Date(this.dateInPeriod.getTime());e.setDate(1);const t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}containsToday(){return w(this.getDateRange())}}function J(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */p.addCustomPeriod("month",W);class K{constructor(e){J(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new K(b(e))}static getDisplayText(){return R("Intl_PeriodYear")}getPrettyString(){return this.dateInPeriod.getFullYear().toString()}getDateRange(){const e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);const t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}containsToday(){return w(this.getDateRange())}}p.addCustomPeriod("year",K)}})}));
//# sourceMappingURL=CoreHome.umd.min.js.map