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: 871029fd20f8c3950c8b7cdd278b44d37766f838 (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
(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 F})),r.d(t,"ActivityIndicator",(function(){return q})),r.d(t,"translate",(function(){return i})),r.d(t,"alertAdapter",(function(){return G})),r.d(t,"Periods",(function(){return l})),r.d(t,"AjaxHelper",(function(){return O})),r.d(t,"PiwikUrl",(function(){return I})),"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
 */
function i(e,t=[]){return _pk_translate(e,t)}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
 */class o{constructor(){s(this,"periods",{}),s(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 l=new o;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function d(e){return $.datepicker.formatDate("yy-mm-dd",e)}function u(){const e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function c(e){if(e instanceof Date)return e;const t=decodeURIComponent(e);if("today"===t||"now"===t)return u();if("yesterday"===t||"yesterdaySameTime"===t){const e=u();return e.setDate(e.getDate()-1),e}if(t.match(/last[ -]?week/i)){const e=u();return e.setDate(e.getDate()-7),e}if(t.match(/last[ -]?month/i)){const e=u();return e.setDate(1),e.setMonth(e.getMonth()-1),e}if(t.match(/last[ -]?year/i)){const e=u();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 g(e){return 2===e.length&&(u()>=e[0]&&u()<=e[1])}function h(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
 */class p{constructor(e){h(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new p(c(e))}static getDisplayText(){return i("Intl_PeriodDay")}getPrettyString(){return d(this.dateInPeriod)}getDateRange(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}containsToday(){return g(this.getDateRange())}}function m(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
 */l.addCustomPeriod("day",p);class f{constructor(e){m(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new f(c(e))}static getDisplayText(){return i("Intl_PeriodWeek")}getPrettyString(){const e=this.getDateRange(),t=d(e[0]),r=d(e[1]);return i("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 g(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
 */l.addCustomPeriod("week",f);class w{constructor(e){b(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new w(c(e))}static getDisplayText(){return i("Intl_PeriodMonth")}getPrettyString(){const e=i("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 g(this.getDateRange())}}function P(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
 */l.addCustomPeriod("month",w);class y{constructor(e){P(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new y(c(e))}static getDisplayText(){return i("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 g(this.getDateRange())}}function D(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
 */l.addCustomPeriod("year",y);class k{constructor(e,t,r){D(this,"startDate",void 0),D(this,"endDate",void 0),D(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?c(r):u(),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=l.periods[e].parse(i),r=l.periods[e].parse(n);[i]=t.getDateRange(),[,n]=r.getDateRange()}const s=new Date(1991,7,6);if(i.getTime()-s.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=s;break}return new k(i,n,e)}static parse(e,t="day"){if(/^previous/.test(e)){const r=k.getLastNRange(t,"2").startDate;return k.getLastNRange(t,e.substring(8),r)}if(/^last/.test(e))return k.getLastNRange(t,e.substring(4));const r=decodeURIComponent(e).split(",");return new k(c(r[0]),c(r[1]),t)}static getDisplayText(){return i("General_DateRangeInPeriodList")}getPrettyString(){const e=d(this.startDate),t=d(this.endDate);return i("General_DateRangeFromTo",[e,t])}getDateRange(){return[this.startDate,this.endDate]}containsToday(){return g(this.getDateRange())}}function v(){return{getAllLabels:l.getAllLabels.bind(l),isRecognizedPeriod:l.isRecognizedPeriod.bind(l),get:l.get.bind(l),parse:l.parse.bind(l),parseDate:c,format:d,RangePeriod:k,todayIsInRange:g}}l.addCustomPeriod("range",k),
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
piwik.addCustomPeriod=l.addCustomPeriod.bind(l),angular.module("piwikApp.service").factory("piwikPeriods",v);
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */
const j={getSearchParam(e){const t=window.location.href.split("#"),r=new RegExp(e+"(\\[]|=)");if(t&&t[1]&&r.test(decodeURIComponent(t[1]))){const t=broadcast.getValueFromHash(e,window.location.href);if(t||"date"!==e&&"period"!==e&&"idSite"!==e)return t}return broadcast.getValueFromUrl(e,window.location.search)}};var I=j;function T(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 x(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 O{constructor(){T(this,"format","json"),T(this,"timeout",null),T(this,"callback",null),T(this,"useRegularCallbackInCaseOfError",!1),T(this,"errorCallback",void 0),T(this,"withToken",!1),T(this,"completeCallback",void 0),T(this,"getParams",{}),T(this,"getUrl","?"),T(this,"postParams",{}),T(this,"loadingElement",null),T(this,"errorElement","#ajaxError"),T(this,"requestHandle",null),T(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=x}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=I.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 A(){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:I.getSearchParam.bind(I)};return e}window.ajaxHelper=O,angular.module("piwikApp.service").service("globalAjaxQueue",A),C.$inject=[],angular.module("piwikApp.service").service("piwikUrl",C);var R=r("8bbf");const E={class:"loadingPiwik"},S=Object(R["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function M(e,t,r,a,n,i){return Object(R["withDirectives"])((Object(R["openBlock"])(),Object(R["createElementBlock"])("div",E,[S,Object(R["createElementVNode"])("span",null,Object(R["toDisplayString"])(e.loadingMessage),1)],512)),[[R["vShow"],e.loading]])}var _=Object(R["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:i("General_LoadingData")}}});_.render=M;var q=_;
/*!
 * Matomo - free/libre analytics platform
 *
 * @link https://matomo.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */function F(){return{restrict:"A",scope:{loading:"<",loadingMessage:"<"},template:"",link:function(e,t){const r=Object(R["createApp"])({template:'<activity-indicator :loading="loading" :loadingMessage="loadingMessage"/>',data(){return{loading:e.loading,loadingMessage:e.loadingMessage}}});r.component("activity-indicator",q);const a=r.mount(t[0]);e.$watch("loading",e=>{a.loading=e}),e.$watch("loadingMessage",e=>{a.loadingMessage=e||i("General_LoadingData")})}}}function H(e,t,r,a,n,i){return Object(R["openBlock"])(),Object(R["createElementBlock"])("div",{class:Object(R["normalizeClass"])(["alert",{["alert-"+e.severity]:!0}])},[Object(R["renderSlot"])(e.$slots,"default")],2)}F.$inject=[],angular.module("piwikApp").directive("piwikActivityIndicator",F);var U=Object(R["defineComponent"])({props:{severity:{type:String,required:!0}}});U.render=H;var L=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 G(){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(R["createApp"])({template:'<alert :severity="severity"><div ref="transcludeTarget"/></alert>',data(){return{severity:e.severity}},setup(){const e=Object(R["ref"])(null);return{transcludeTarget:e}}});a.component("alert",L);const n=a.mount(t[0]);e.$watch("severity",e=>{n.severity=e}),$(n.transcludeTarget).append(r)}}}}}G.$inject=[],angular.module("piwikApp").directive("piwikAlert",G)}})}));
//# sourceMappingURL=CoreHome.umd.min.js.map