From b5e591c7d70fe64c5a3d375812d9e1bc20b25558 Mon Sep 17 00:00:00 2001 From: dizzy Date: Tue, 12 Oct 2021 20:55:33 -0700 Subject: [Vue] add promise api to ajaxHelper and deprecate piwikApi service (#18114) * incomplete conversion * get ajax helper migration to work * delete old periods.spec.js * remove global-ajax-queue.js file * migrate piwik service and test (w/ hacks to get it the test to work) * rebuild and remove old files + get tests to pass * unfinished commit * return jqxhr object so promise api can be used * move hasBlockedContent and deprecate piwikApi service * remove alert files * convert piwikHelper.spec.js * in new vue code, use "Matomo" everywhere possible instead of "piwik" and rebuild vue files * add another needed export line in command * include polyfills after vue so we can add to vue engine * Add HTML sanitizer for use w/ migrating ng-bind-html uses. * fix broken merge, rebuild js, fix issue in build command * add sanitize to other components for consistency (will be replaced by utility function eventually) * add output when no plugins to build * update expected screenshot --- .../CoreHome/angularjs/alert/alert.directive.html | 2 - .../CoreHome/angularjs/alert/alert.directive.js | 26 - .../angularjs/common/services/piwik-api.js | 8 +- .../angularjs/common/services/piwik-helper.spec.js | 40 - plugins/CoreHome/vue/dist/CoreHome.umd.js | 2159 +++++++++++--------- plugins/CoreHome/vue/dist/CoreHome.umd.js.map | 2 +- plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 67 +- plugins/CoreHome/vue/dist/CoreHome.umd.min.js.map | 2 +- .../ActivityIndicator/ActivityIndicator.adapter.ts | 1 + plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts | 37 +- plugins/CoreHome/vue/src/Alert/Alert.adapter.ts | 1 + plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts | 22 + plugins/CoreHome/vue/src/Matomo/Matomo.spec.ts | 152 ++ plugins/CoreHome/vue/src/Matomo/Matomo.ts | 78 + .../vue/src/MatomoHelper/MatomoHelper.spec.ts | 29 + .../vue/src/MatomoUrl/MatomoUrl.adapter.ts | 19 + plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts | 32 + plugins/CoreHome/vue/src/Periods/Periods.ts | 10 +- plugins/CoreHome/vue/src/Periods/index.ts | 1 + plugins/CoreHome/vue/src/Periods/utilities.ts | 2 +- plugins/CoreHome/vue/src/index.ts | 13 +- plugins/CoreHome/vue/src/noAdblockFlag.ts | 9 + 22 files changed, 1613 insertions(+), 1099 deletions(-) delete mode 100644 plugins/CoreHome/angularjs/alert/alert.directive.html delete mode 100644 plugins/CoreHome/angularjs/alert/alert.directive.js delete mode 100644 plugins/CoreHome/angularjs/common/services/piwik-helper.spec.js create mode 100644 plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts create mode 100644 plugins/CoreHome/vue/src/Matomo/Matomo.spec.ts create mode 100644 plugins/CoreHome/vue/src/Matomo/Matomo.ts create mode 100644 plugins/CoreHome/vue/src/MatomoHelper/MatomoHelper.spec.ts create mode 100644 plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts create mode 100644 plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts create mode 100644 plugins/CoreHome/vue/src/noAdblockFlag.ts (limited to 'plugins/CoreHome') diff --git a/plugins/CoreHome/angularjs/alert/alert.directive.html b/plugins/CoreHome/angularjs/alert/alert.directive.html deleted file mode 100644 index c45b3713d9..0000000000 --- a/plugins/CoreHome/angularjs/alert/alert.directive.html +++ /dev/null @@ -1,2 +0,0 @@ -
-
\ No newline at end of file diff --git a/plugins/CoreHome/angularjs/alert/alert.directive.js b/plugins/CoreHome/angularjs/alert/alert.directive.js deleted file mode 100644 index 053b3c3835..0000000000 --- a/plugins/CoreHome/angularjs/alert/alert.directive.js +++ /dev/null @@ -1,26 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - *
- */ -(function () { - angular.module('piwikApp').directive('piwikAlert', piwikAlert); - - piwikAlert.$inject = ['piwik']; - - function piwikAlert(piwik){ - - return { - restrict: 'A', - transclude: true, - scope: {severity: '@piwikAlert'}, - templateUrl: 'plugins/CoreHome/angularjs/alert/alert.directive.html?cb=' + piwik.cacheBuster - }; - } -})(); \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/services/piwik-api.js b/plugins/CoreHome/angularjs/common/services/piwik-api.js index b9a8a9fb2f..8436ea5900 100644 --- a/plugins/CoreHome/angularjs/common/services/piwik-api.js +++ b/plugins/CoreHome/angularjs/common/services/piwik-api.js @@ -5,14 +5,14 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -// see https://github.com/piwik/piwik/issues/5094 used to detect an ad blocker -var hasBlockedContent = false; - (function () { angular.module('piwikApp.service').factory('piwikApi', piwikApiService); piwikApiService.$inject = ['$http', '$q', '$rootScope', 'piwik', '$window', 'piwikUrl']; + /** + * @deprecated use AjaxHelper's promise API instead + */ function piwikApiService ($http, $q, $rootScope, piwik, $window, piwikUrl) { var url = 'index.php'; @@ -348,4 +348,4 @@ var hasBlockedContent = false; mixinDefaultGetParams: mixinDefaultGetParams }; } -})(); \ No newline at end of file +})(); diff --git a/plugins/CoreHome/angularjs/common/services/piwik-helper.spec.js b/plugins/CoreHome/angularjs/common/services/piwik-helper.spec.js deleted file mode 100644 index a80546b9d6..0000000000 --- a/plugins/CoreHome/angularjs/common/services/piwik-helper.spec.js +++ /dev/null @@ -1,40 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - describe('piwikHelper', function() { - var piwikHelper; - - beforeEach(module('piwikApp.service')); - beforeEach(inject(function ($injector) { - piwikHelper = $injector.get('piwik').helper; - })); - beforeEach(function () { - delete window._dosomething; - }); - - describe('#htmlDecode', function () { - - it('should correctly decode html entities', function (done) { - var called = false; - window._dosomething = function () { - called = true; - }; - - var encoded = 'str '; - var decoded = piwikHelper.htmlDecode(encoded); - - setTimeout(function () { - expect(called).to.be.false; - expect(decoded).to.equal('str '); - done(); - }, 500); - }); - - }); - }); - -})(); \ No newline at end of file diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 3798c5368b..5e6292b443 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -96,6 +96,23 @@ return /******/ (function(modules) { // webpackBootstrap /************************************************************************/ /******/ ({ +/***/ "2342": +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +// see https://github.com/matomo-org/matomo/issues/5094 used to detect an ad blocker + +window.hasBlockedContent = false; + +/***/ }), + /***/ "8bbf": /***/ (function(module, exports) { @@ -116,14 +133,18 @@ __webpack_require__.d(__webpack_exports__, "ActivityIndicator", function() { ret __webpack_require__.d(__webpack_exports__, "translate", function() { return /* reexport */ translate; }); __webpack_require__.d(__webpack_exports__, "alertAdapter", function() { return /* reexport */ alertAdapter; }); __webpack_require__.d(__webpack_exports__, "AjaxHelper", function() { return /* reexport */ AjaxHelper_AjaxHelper; }); -__webpack_require__.d(__webpack_exports__, "PiwikUrl", function() { return /* reexport */ PiwikUrl_PiwikUrl; }); -__webpack_require__.d(__webpack_exports__, "Piwik", function() { return /* reexport */ Piwik_Piwik; }); +__webpack_require__.d(__webpack_exports__, "MatomoUrl", function() { return /* reexport */ MatomoUrl_MatomoUrl; }); +__webpack_require__.d(__webpack_exports__, "Matomo", function() { return /* reexport */ Matomo_Matomo; }); __webpack_require__.d(__webpack_exports__, "Periods", function() { return /* reexport */ Periods_Periods; }); __webpack_require__.d(__webpack_exports__, "Day", function() { return /* reexport */ Day_DayPeriod; }); __webpack_require__.d(__webpack_exports__, "Week", function() { return /* reexport */ Week_WeekPeriod; }); __webpack_require__.d(__webpack_exports__, "Month", function() { return /* reexport */ Month_MonthPeriod; }); __webpack_require__.d(__webpack_exports__, "Year", function() { return /* reexport */ Year_YearPeriod; }); __webpack_require__.d(__webpack_exports__, "Range", function() { return /* reexport */ Range_RangePeriod; }); +__webpack_require__.d(__webpack_exports__, "format", function() { return /* reexport */ format; }); +__webpack_require__.d(__webpack_exports__, "getToday", function() { return /* reexport */ getToday; }); +__webpack_require__.d(__webpack_exports__, "parseDate", function() { return /* reexport */ parseDate; }); +__webpack_require__.d(__webpack_exports__, "todayIsInRange", function() { return /* reexport */ todayIsInRange; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -141,7 +162,7 @@ if (typeof window !== 'undefined') { // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.ts +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts /*! * Matomo - free/libre analytics platform * @@ -153,7 +174,7 @@ if (typeof window !== 'undefined') { * Similar to angulars $location but works around some limitation. Use it if you need to access * search params */ -const PiwikUrl = { +const MatomoUrl = { getSearchParam(paramName) { const hash = window.location.href.split('#'); const regex = new RegExp(`${paramName}(\\[]|=)`); @@ -170,10 +191,8 @@ const PiwikUrl = { } }; -/* harmony default export */ var PiwikUrl_PiwikUrl = (PiwikUrl); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - +/* harmony default export */ var MatomoUrl_MatomoUrl = (MatomoUrl); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -181,522 +200,480 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -window.globalAjaxQueue = []; -window.globalAjaxQueue.active = 0; - -window.globalAjaxQueue.clean = function globalAjaxQueueClean() { - for (let i = this.length; i >= 0; i -= 1) { - if (!this[i] || this[i].readyState === 4) { - this.splice(i, 1); - } - } -}; - -window.globalAjaxQueue.push = function globalAjaxQueuePush(...args) { - this.active += args.length; // cleanup ajax queue - this.clean(); // call original array push +function piwikUrl() { + const model = { + getSearchParam: MatomoUrl_MatomoUrl.getSearchParam.bind(MatomoUrl_MatomoUrl) + }; + return model; +} - return Array.prototype.push.call(this, ...args); -}; +piwikUrl.$inject = []; +angular.module('piwikApp.service').service('piwikUrl', piwikUrl); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.ts +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -window.globalAjaxQueue.abort = function globalAjaxQueueAbort() { - // abort all queued requests if possible - this.forEach(x => x && x.abort && x.abort()); // remove all elements from array +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - this.splice(0, this.length); - this.active = 0; -}; /** - * error callback to use by default + * Matomo period management service for the frontend. + * + * Usage: + * + * var DayPeriod = matomoPeriods.get('day'); + * var day = new DayPeriod(new Date()); + * + * or + * + * var day = matomoPeriods.parse('day', '2013-04-05'); + * + * Adding custom periods: + * + * To add your own period to the frontend, create a period class for it + * w/ the following methods: + * + * - **getPrettyString()**: returns a human readable display string for the period. + * - **getDateRange()**: returns an array w/ two elements, the first being the start + * Date of the period, the second being the end Date. The dates + * must be Date objects, not strings, and are inclusive. + * - **containsToday()**: returns true if the date period contains today. False if not. + * - (_static_) **parse(strDate)**: creates a new instance of this period from the + * value of the 'date' query parameter. + * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month', + * 'week', etc. + * + * Then call Periods.addCustomPeriod w/ your period class: + * + * Periods.addCustomPeriod('mycustomperiod', MyCustomPeriod); + * + * NOTE: currently only single date periods like day, week, month year can + * be extended. Other types of periods that require a special UI to + * view/edit aren't, since there is currently no way to use a + * custom UI for a custom period. */ +class Periods { + constructor() { + _defineProperty(this, "periods", {}); - -function defaultErrorCallback(deferred, status) { - // do not display error message if request was aborted - if (status === 'abort') { - return; + _defineProperty(this, "periodOrder", []); } - const loadingError = $('#loadingError'); - - if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) { - if (deferred && deferred.status === 500) { - $(document.body).html(piwikHelper.escape(deferred.responseText)); + addCustomPeriod(name, periodClass) { + if (this.periods[name]) { + throw new Error(`The "${name}" period already exists! It cannot be overridden.`); } - } else { - loadingError.show(); - } -} -/** - * Global ajax helper to handle requests within piwik - */ - - -class AjaxHelper_AjaxHelper { - /** - * Format of response - */ - /** - * A timeout for the request which will override any global timeout - */ + this.periods[name] = periodClass; + this.periodOrder.push(name); + } - /** - * Callback function to be executed on success - */ + getAllLabels() { + return Array().concat(this.periodOrder); + } - /** - * Use this.callback if an error is returned - */ + get(strPeriod) { + const periodClass = this.periods[strPeriod]; - /** - * Callback function to be executed on error - */ + if (!periodClass) { + throw new Error(`Invalid period label: ${strPeriod}`); + } - /** - * Callback function to be executed on complete (after error or success) - */ + return periodClass; + } - /** - * Params to be passed as GET params - * @see ajaxHelper.mixinDefaultGetParams - */ + parse(strPeriod, strDate) { + return this.get(strPeriod).parse(strDate); + } - /** - * Base URL used in the AJAX request. Can be set by setUrl. - * - * It is set to '?' rather than 'index.php?' to increase chances that it works - * including for users who have an automatic 301 redirection from index.php? to ? - * POST values are missing when there is such 301 redirection. So by by-passing - * this 301 redirection, we avoid this issue. - * - * @see ajaxHelper.setUrl - */ + isRecognizedPeriod(strPeriod) { + return !!this.periods[strPeriod]; + } - /** - * Params to be passed as GET params - * @see ajaxHelper.mixinDefaultPostParams - */ +} - /** - * Element to be displayed while loading - */ +/* harmony default export */ var Periods_Periods = (new Periods()); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/utilities.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +function format(date) { + return $.datepicker.formatDate('yy-mm-dd', date); +} +function getToday() { + const date = new Date(Date.now()); // undo browser timezone - /** - * Element to be displayed on error - */ + date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000); // apply Matomo site timezone (if it exists) - /** - * Handle for current request - */ - constructor() { - _defineProperty(this, "format", 'json'); + date.setHours(date.getHours() + (window.piwik.timezoneOffset || 0) / 3600); // get rid of hours/minutes/seconds/etc. - _defineProperty(this, "timeout", null); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + date.setMilliseconds(0); + return date; +} +function parseDate(date) { + if (date instanceof Date) { + return date; + } - _defineProperty(this, "callback", null); + const strDate = decodeURIComponent(date); - _defineProperty(this, "useRegularCallbackInCaseOfError", false); + if (strDate === 'today' || strDate === 'now') { + return getToday(); + } - _defineProperty(this, "errorCallback", void 0); + if (strDate === 'yesterday' // note: ignoring the 'same time' part since the frontend doesn't care about the time + || strDate === 'yesterdaySameTime') { + const yesterday = getToday(); + yesterday.setDate(yesterday.getDate() - 1); + return yesterday; + } - _defineProperty(this, "withToken", false); + if (strDate.match(/last[ -]?week/i)) { + const lastWeek = getToday(); + lastWeek.setDate(lastWeek.getDate() - 7); + return lastWeek; + } - _defineProperty(this, "completeCallback", void 0); + if (strDate.match(/last[ -]?month/i)) { + const lastMonth = getToday(); + lastMonth.setDate(1); + lastMonth.setMonth(lastMonth.getMonth() - 1); + return lastMonth; + } - _defineProperty(this, "getParams", {}); + if (strDate.match(/last[ -]?year/i)) { + const lastYear = getToday(); + lastYear.setFullYear(lastYear.getFullYear() - 1); + return lastYear; + } - _defineProperty(this, "getUrl", '?'); + try { + return $.datepicker.parseDate('yy-mm-dd', strDate); + } catch (err) { + // angular swallows this error, so manual console log here + console.error(err.message || err); + throw err; + } +} +function todayIsInRange(dateRange) { + if (dateRange.length !== 2) { + return false; + } - _defineProperty(this, "postParams", {}); + if (getToday() >= dateRange[0] && getToday() <= dateRange[1]) { + return true; + } - _defineProperty(this, "loadingElement", null); + return false; +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - _defineProperty(this, "errorElement", '#ajaxError'); - _defineProperty(this, "requestHandle", null); - _defineProperty(this, "defaultParams", ['idSite', 'period', 'date', 'segment']); +let originalTitle; +const { + piwik, + broadcast: Matomo_broadcast, + piwikHelper: Matomo_piwikHelper +} = window; +piwik.helper = Matomo_piwikHelper; +piwik.broadcast = Matomo_broadcast; - this.errorCallback = defaultErrorCallback; - } - /** - * Adds params to the request. - * If params are given more then once, the latest given value is used for the request - * - * @param params - * @param type type of given parameters (POST or GET) - * @return {void} - */ +function isValidPeriod(periodStr, dateStr) { + try { + Periods_Periods.parse(periodStr, dateStr); + return true; + } catch (e) { + return false; + } +} +piwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() { + let date = MatomoUrl_MatomoUrl.getSearchParam('date'); + const period = MatomoUrl_MatomoUrl.getSearchParam('period'); - addParams(params, type) { - if (typeof params === 'string') { - // TODO: add global types for broadcast (multiple uses below) - params = window['broadcast'].getValuesFromUrl(params); // eslint-disable-line - } + if (!isValidPeriod(period, date)) { + // invalid data in URL + return; + } - const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates']; - Object.keys(params).forEach(key => { - const value = params[key]; + if (piwik.period === period && piwik.currentDateString === date) { + // this period / date is already loaded + return; + } - if (arrayParams.indexOf(key) !== -1 && !value) { - return; - } + piwik.period = period; + const dateRange = Periods_Periods.parse(period, date).getDateRange(); + piwik.startDateString = format(dateRange[0]); + piwik.endDateString = format(dateRange[1]); + piwik.updateDateInTitle(date, period); // do not set anything to previousN/lastN, as it's more useful to plugins + // to have the dates than previousN/lastN. - if (type.toLowerCase() === 'get') { - this.getParams[key] = value; - } else if (type.toLowerCase() === 'post') { - this.postParams[key] = value; - } - }); + if (piwik.period === 'range') { + date = `${piwik.startDateString},${piwik.endDateString}`; } - withTokenInUrl() { - this.withToken = true; - } - /** - * Sets the base URL to use in the AJAX request. - */ + piwik.currentDateString = date; +}; +piwik.updateDateInTitle = function updateDateInTitle(date, period) { + if (!$('.top_controls #periodString').length) { + return; + } // Cache server-rendered page title - setUrl(url) { - this.addParams(broadcast.getValuesFromUrl(url), 'GET'); - } - /** - * Gets this helper instance ready to send a bulk request. Each argument to this - * function is a single request to use. - */ + originalTitle = originalTitle || document.title; - setBulkRequests(...urls) { - const urlsProcessed = urls.map(u => $.param(u)); - this.addParams({ - module: 'API', - method: 'API.getBulkRequest', - urls: urlsProcessed, - format: 'json' - }, 'post'); + if (originalTitle.indexOf(piwik.siteName) === 0) { + const dateString = ` - ${Periods_Periods.parse(period, date).getPrettyString()} `; + document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`; } - /** - * Set a timeout (in milliseconds) for the request. This will override any global timeout. - * - * @param timeout Timeout in milliseconds - */ +}; +piwik.hasUserCapability = function hasUserCapability(capability) { + return window.angular.isArray(piwik.userCapabilities) && piwik.userCapabilities.indexOf(capability) !== -1; +}; - setTimeout(timeout) { - this.timeout = timeout; - } - /** - * Sets the callback called after the request finishes - * - * @param callback Callback function - */ +const Matomo = piwik; +/* harmony default export */ var Matomo_Matomo = (Matomo); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - setCallback(callback) { - this.callback = callback; - } - /** - * Set that the callback passed to setCallback() should be used if an application error (i.e. an - * Exception in PHP) is returned. - */ +function piwikService() { + return Matomo_Matomo; +} +angular.module('piwikApp.service').service('piwik', piwikService); - useCallbackInCaseOfError() { - this.useRegularCallbackInCaseOfError = true; - } - /** - * Set callback to redirect on success handler - * &update=1(+x) will be appended to the current url - * - * @param [params] to modify in redirect url - * @return {void} - */ +function initPiwikService(piwik, $rootScope) { + $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); +} +initPiwikService.$inject = ['piwik', '$rootScope']; +angular.module('piwikApp.service').run(initPiwikService); +// EXTERNAL MODULE: ./plugins/CoreHome/vue/src/noAdblockFlag.ts +var noAdblockFlag = __webpack_require__("2342"); - redirectOnSuccess(params) { - this.setCallback(() => { - piwikHelper.redirect(params); - }); - } - /** - * Sets the callback called in case of an error within the request - */ +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/translate.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +function translate(translationStringId, values = []) { + return window._pk_translate(translationStringId, values); // eslint-disable-line +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Day.ts +function Day_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - setErrorCallback(callback) { - this.errorCallback = callback; - } - /** - * Sets the complete callback which is called after an error or success callback. - */ - setCompleteCallback(callback) { - this.completeCallback = callback; +class Day_DayPeriod { + constructor(dateInPeriod) { + Day_defineProperty(this, "dateInPeriod", void 0); + + this.dateInPeriod = dateInPeriod; } - /** - * Sets the response format for the request - * - * @param format response format (e.g. json, html, ...) - */ + static parse(strDate) { + return new Day_DayPeriod(parseDate(strDate)); + } - setFormat(format) { - this.format = format; + static getDisplayText() { + return translate('Intl_PeriodDay'); } - /** - * Set the div element to show while request is loading - * - * @param [element] selector for the loading element - */ + getPrettyString() { + return format(this.dateInPeriod); + } - setLoadingElement(element) { - this.loadingElement = element || '#ajaxLoadingDiv'; + getDateRange() { + return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())]; } - /** - * Set the div element to show on error - * - * @param element selector for the error element - */ + containsToday() { + return todayIsInRange(this.getDateRange()); + } - setErrorElement(element) { - if (!element) { - return; - } +} +Periods_Periods.addCustomPeriod('day', Day_DayPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Week.ts +function Week_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - this.errorElement = element; - } - /** - * Detect whether are allowed to use the given default parameter or not - */ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - useGETDefaultParameter(parameter) { - if (parameter && this.defaultParams) { - for (let i = 0; i < this.defaultParams.length; i += 1) { - if (this.defaultParams[i] === parameter) { - return true; - } - } - } - return false; +class Week_WeekPeriod { + constructor(dateInPeriod) { + Week_defineProperty(this, "dateInPeriod", void 0); + + this.dateInPeriod = dateInPeriod; } - /** - * Removes a default parameter that is usually send automatically along the request. - * - * @param parameter A name such as "period", "date", "segment". - */ + static parse(strDate) { + return new Week_WeekPeriod(parseDate(strDate)); + } - removeDefaultParameter(parameter) { - if (parameter && this.defaultParams) { - for (let i = 0; i < this.defaultParams.length; i += 1) { - if (this.defaultParams[i] === parameter) { - this.defaultParams.splice(i, 1); - } - } - } + static getDisplayText() { + return translate('Intl_PeriodWeek'); } - /** - * Send the request - */ + getPrettyString() { + const weekDates = this.getDateRange(); + const startWeek = format(weekDates[0]); + const endWeek = format(weekDates[1]); + return translate('General_DateRangeFromTo', [startWeek, endWeek]); + } - send() { - if ($(this.errorElement).length) { - $(this.errorElement).hide(); - } + getDateRange() { + const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7; + const startWeek = new Date(this.dateInPeriod.getTime()); + startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday); + const endWeek = new Date(startWeek.getTime()); + endWeek.setDate(startWeek.getDate() + 6); + return [startWeek, endWeek]; + } - if (this.loadingElement) { - $(this.loadingElement).fadeIn(); - } - - this.requestHandle = this.buildAjaxCall(); - globalAjaxQueue.push(this.requestHandle); + containsToday() { + return todayIsInRange(this.getDateRange()); } - /** - * Aborts the current request if it is (still) running - */ +} +Periods_Periods.addCustomPeriod('week', Week_WeekPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Month.ts +function Month_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - abort() { - if (this.requestHandle && typeof this.requestHandle.abort === 'function') { - this.requestHandle.abort(); - this.requestHandle = null; - } - } - /** - * Builds and sends the ajax requests - */ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - buildAjaxCall() { - const self = this; - const parameters = this.mixinDefaultGetParams(this.getParams); - let url = this.getUrl; - if (url[url.length - 1] !== '?') { - url += '&'; - } // we took care of encoding &segment properly already, so we don't use $.param for it ($.param - // URL encodes the values) +class Month_MonthPeriod { + constructor(dateInPeriod) { + Month_defineProperty(this, "dateInPeriod", void 0); + this.dateInPeriod = dateInPeriod; + } - if (parameters.segment) { - url = `${url}segment=${parameters.segment}&`; - delete parameters.segment; - } + static parse(strDate) { + return new Month_MonthPeriod(parseDate(strDate)); + } - if (parameters.date) { - url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`; - delete parameters.date; - } + static getDisplayText() { + return translate('Intl_PeriodMonth'); + } - url += $.param(parameters); - const ajaxCall = { - type: 'POST', - async: true, - url, - dataType: this.format || 'json', - complete: this.completeCallback, - error: function errorCallback() { - globalAjaxQueue.active -= 1; + getPrettyString() { + const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`); + return `${month} ${this.dateInPeriod.getFullYear()}`; + } - if (self.errorCallback) { - self.errorCallback.apply(this, arguments); // eslint-disable-line - } - }, - success: (response, status, request) => { - if (this.loadingElement) { - $(this.loadingElement).hide(); - } + getDateRange() { + const startMonth = new Date(this.dateInPeriod.getTime()); + startMonth.setDate(1); + const endMonth = new Date(this.dateInPeriod.getTime()); + endMonth.setDate(1); + endMonth.setMonth(endMonth.getMonth() + 1); + endMonth.setDate(0); + return [startMonth, endMonth]; + } - if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) { - let placeAt = null; - let type = 'toast'; + containsToday() { + return todayIsInRange(this.getDateRange()); + } - if ($(this.errorElement).length && response.message) { - $(this.errorElement).show(); - placeAt = this.errorElement; - type = null; - } +} +Periods_Periods.addCustomPeriod('month', Month_MonthPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Year.ts +function Year_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - if (response.message) { - const UI = window['require']('piwik/UI'); // eslint-disable-line +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - const notification = new UI.Notification(); - notification.show(response.message, { - placeat: placeAt, - context: 'error', - type, - id: 'ajaxHelper' - }); - notification.scrollToNotification(); - } - } else if (this.callback) { - this.callback(response, status, request); - } - globalAjaxQueue.active -= 1; - const { - piwik - } = window; - if (piwik && piwik.ajaxRequestFinished) { - piwik.ajaxRequestFinished(); - } - }, - data: this.mixinDefaultPostParams(this.postParams), - timeout: this.timeout !== null ? this.timeout : undefined - }; - return $.ajax(ajaxCall); - } +class Year_YearPeriod { + constructor(dateInPeriod) { + Year_defineProperty(this, "dateInPeriod", void 0); - isRequestToApiMethod() { - return this.getParams && this.getParams.module === 'API' && this.getParams.method || this.postParams && this.postParams.module === 'API' && this.postParams.method; + this.dateInPeriod = dateInPeriod; } - isWidgetizedRequest() { - return broadcast.getValueFromUrl('module') === 'Widgetize'; + static parse(strDate) { + return new Year_YearPeriod(parseDate(strDate)); } - getDefaultPostParams() { - if (this.withToken || this.isRequestToApiMethod() || piwik.shouldPropagateTokenAuth) { - return { - token_auth: piwik.token_auth, - // When viewing a widgetized report there won't be any session that can be used, so don't - // force session usage - force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1 - }; - } - - return {}; + static getDisplayText() { + return translate('Intl_PeriodYear'); } - /** - * Mixin the default parameters to send as POST - * - * @param params parameter object - */ - - mixinDefaultPostParams(params) { - const defaultParams = this.getDefaultPostParams(); - const mergedParams = { ...defaultParams, - ...params - }; - return mergedParams; + getPrettyString() { + return this.dateInPeriod.getFullYear().toString(); } - /** - * Mixin the default parameters to send as GET - * - * @param params parameter object - */ - - - mixinDefaultGetParams(originalParams) { - const segment = PiwikUrl_PiwikUrl.getSearchParam('segment'); - const defaultParams = { - idSite: piwik.idSite || broadcast.getValueFromUrl('idSite'), - period: piwik.period || broadcast.getValueFromUrl('period'), - segment - }; - const params = originalParams; // never append token_auth to url - - if (params.token_auth) { - params.token_auth = null; - delete params.token_auth; - } - - Object.keys(defaultParams).forEach(key => { - if (this.useGETDefaultParameter(key) && !params[key] && !this.postParams[key] && defaultParams[key]) { - params[key] = defaultParams[key]; - } - }); // handle default date & period if not already set - if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) { - params.date = piwik.currentDateString; - } - - return params; + getDateRange() { + const startYear = new Date(this.dateInPeriod.getTime()); + startYear.setMonth(0); + startYear.setDate(1); + const endYear = new Date(this.dateInPeriod.getTime()); + endYear.setMonth(12); + endYear.setDate(0); + return [startYear, endYear]; } -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts - -window.ajaxHelper = AjaxHelper_AjaxHelper; + containsToday() { + return todayIsInRange(this.getDateRange()); + } -function ajaxQueue() { - return globalAjaxQueue; } +Periods_Periods.addCustomPeriod('year', Year_YearPeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Range.ts +function Range_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -angular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -705,182 +682,115 @@ angular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue); */ -function piwikUrl() { - const model = { - getSearchParam: PiwikUrl_PiwikUrl.getSearchParam.bind(PiwikUrl_PiwikUrl) - }; - return model; -} -piwikUrl.$inject = []; -angular.module('piwikApp.service').service('piwikUrl', piwikUrl); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.ts -function Periods_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +class Range_RangePeriod { + constructor(startDate, endDate, childPeriodType) { + Range_defineProperty(this, "startDate", void 0); -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ + Range_defineProperty(this, "endDate", void 0); -/** - * Piwik period management service for the frontend. - * - * Usage: - * - * var DayPeriod = piwikPeriods.get('day'); - * var day = new DayPeriod(new Date()); - * - * or - * - * var day = piwikPeriods.parse('day', '2013-04-05'); - * - * Adding custom periods: - * - * To add your own period to the frontend, create a period class for it - * w/ the following methods: - * - * - **getPrettyString()**: returns a human readable display string for the period. - * - **getDateRange()**: returns an array w/ two elements, the first being the start - * Date of the period, the second being the end Date. The dates - * must be Date objects, not strings, and are inclusive. - * - **containsToday()**: returns true if the date period contains today. False if not. - * - (_static_) **parse(strDate)**: creates a new instance of this period from the - * value of the 'date' query parameter. - * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month', - * 'week', etc. - * - * Then call piwik.addCustomPeriod w/ your period class: - * - * piwik.addCustomPeriod('mycustomperiod', MyCustomPeriod); - * - * NOTE: currently only single date periods like day, week, month year can - * be extended. Other types of periods that require a special UI to - * view/edit aren't, since there is currently no way to use a - * custom UI for a custom period. - */ -class Periods { - constructor() { - Periods_defineProperty(this, "periods", {}); + Range_defineProperty(this, "childPeriodType", void 0); - Periods_defineProperty(this, "periodOrder", []); + this.startDate = startDate; + this.endDate = endDate; + this.childPeriodType = childPeriodType; } + /** + * Returns a range representing the last N childPeriodType periods, including the current one. + */ - addCustomPeriod(name, periodClass) { - if (this.periods[name]) { - throw new Error(`The "${name}" period already exists! It cannot be overridden.`); - } - this.periods[name] = periodClass; - this.periodOrder.push(name); - } + static getLastNRange(childPeriodType, strAmount, strEndDate) { + const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0); - getAllLabels() { - return Array().concat(this.periodOrder); - } + if (Number.isNaN(nAmount)) { + throw new Error('Invalid range strAmount'); + } - get(strPeriod) { - const periodClass = this.periods[strPeriod]; + let endDate = strEndDate ? parseDate(strEndDate) : getToday(); + let startDate = new Date(endDate.getTime()); - if (!periodClass) { - throw new Error(`Invalid period label: ${strPeriod}`); + if (childPeriodType === 'day') { + startDate.setDate(startDate.getDate() - nAmount); + } else if (childPeriodType === 'week') { + startDate.setDate(startDate.getDate() - nAmount * 7); + } else if (childPeriodType === 'month') { + startDate.setDate(1); + startDate.setMonth(startDate.getMonth() - nAmount); + } else if (childPeriodType === 'year') { + startDate.setFullYear(startDate.getFullYear() - nAmount); + } else { + throw new Error(`Unknown period type '${childPeriodType}'.`); } - return periodClass; - } - - parse(strPeriod, strDate) { - return this.get(strPeriod).parse(strDate); - } + if (childPeriodType !== 'day') { + const startPeriod = Periods_Periods.periods[childPeriodType].parse(startDate); + const endPeriod = Periods_Periods.periods[childPeriodType].parse(endDate); + [startDate] = startPeriod.getDateRange(); + [, endDate] = endPeriod.getDateRange(); + } - isRecognizedPeriod(strPeriod) { - return !!this.periods[strPeriod]; - } + const firstWebsiteDate = new Date(1991, 7, 6); -} + if (startDate.getTime() - firstWebsiteDate.getTime() < 0) { + switch (childPeriodType) { + case 'year': + startDate = new Date(1992, 0, 1); + break; -/* harmony default export */ var Periods_Periods = (new Periods()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/utilities.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function format(date) { - return $.datepicker.formatDate('yy-mm-dd', date); -} -function getToday() { - const date = new Date(Date.now()); // undo browser timezone + case 'month': + startDate = new Date(1991, 8, 1); + break; - date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000); // apply piwik site timezone (if it exists) + case 'week': + startDate = new Date(1991, 8, 12); + break; - date.setHours(date.getHours() + (window.piwik.timezoneOffset || 0) / 3600); // get rid of hours/minutes/seconds/etc. + case 'day': + default: + startDate = firstWebsiteDate; + break; + } + } - date.setHours(0); - date.setMinutes(0); - date.setSeconds(0); - date.setMilliseconds(0); - return date; -} -function parseDate(date) { - if (date instanceof Date) { - return date; + return new Range_RangePeriod(startDate, endDate, childPeriodType); } - const strDate = decodeURIComponent(date); - - if (strDate === 'today' || strDate === 'now') { - return getToday(); - } + static parse(strDate, childPeriodType = 'day') { + if (/^previous/.test(strDate)) { + const endDate = Range_RangePeriod.getLastNRange(childPeriodType, '2').startDate; + return Range_RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate); + } - if (strDate === 'yesterday' // note: ignoring the 'same time' part since the frontend doesn't care about the time - || strDate === 'yesterdaySameTime') { - const yesterday = getToday(); - yesterday.setDate(yesterday.getDate() - 1); - return yesterday; - } + if (/^last/.test(strDate)) { + return Range_RangePeriod.getLastNRange(childPeriodType, strDate.substring(4)); + } - if (strDate.match(/last[ -]?week/i)) { - const lastWeek = getToday(); - lastWeek.setDate(lastWeek.getDate() - 7); - return lastWeek; + const parts = decodeURIComponent(strDate).split(','); + return new Range_RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType); } - if (strDate.match(/last[ -]?month/i)) { - const lastMonth = getToday(); - lastMonth.setDate(1); - lastMonth.setMonth(lastMonth.getMonth() - 1); - return lastMonth; + static getDisplayText() { + return translate('General_DateRangeInPeriodList'); } - if (strDate.match(/last[ -]?year/i)) { - const lastYear = getToday(); - lastYear.setFullYear(lastYear.getFullYear() - 1); - return lastYear; + getPrettyString() { + const start = format(this.startDate); + const end = format(this.endDate); + return translate('General_DateRangeFromTo', [start, end]); } - try { - return $.datepicker.parseDate('yy-mm-dd', strDate); - } catch (err) { - // angular swallows this error, so manual console log here - console.error(err.message || err); - throw err; - } -} -function todayIsInRange(dateRange) { - if (dateRange.length !== 2) { - return false; + getDateRange() { + return [this.startDate, this.endDate]; } - if (getToday() >= dateRange[0] && getToday() <= dateRange[1]) { - return true; + containsToday() { + return todayIsInRange(this.getDateRange()); } - return false; } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Piwik/Piwik.ts +Periods_Periods.addCustomPeriod('range', Range_RangePeriod); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -890,392 +800,586 @@ function todayIsInRange(dateRange) { -let originalTitle; -const { - piwik: Piwik_piwik, - broadcast: Piwik_broadcast, - piwikHelper: Piwik_piwikHelper -} = window; -Piwik_piwik.helper = Piwik_piwikHelper; -Piwik_piwik.broadcast = Piwik_broadcast; +window.piwik.addCustomPeriod = Periods_Periods.addCustomPeriod.bind(Periods_Periods); -function isValidPeriod(periodStr, dateStr) { - try { - Periods_Periods.parse(periodStr, dateStr); - return true; - } catch (e) { - return false; - } +function piwikPeriods() { + return { + getAllLabels: Periods_Periods.getAllLabels.bind(Periods_Periods), + isRecognizedPeriod: Periods_Periods.isRecognizedPeriod.bind(Periods_Periods), + get: Periods_Periods.get.bind(Periods_Periods), + parse: Periods_Periods.parse.bind(Periods_Periods), + parseDate: parseDate, + format: format, + RangePeriod: Range_RangePeriod, + todayIsInRange: todayIsInRange + }; } -Piwik_piwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() { - let date = PiwikUrl_PiwikUrl.getSearchParam('date'); - const period = PiwikUrl_PiwikUrl.getSearchParam('period'); +angular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts +function AjaxHelper_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - if (!isValidPeriod(period, date)) { - // invalid data in URL - return; - } +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - if (Piwik_piwik.period === period && Piwik_piwik.currentDateString === date) { - // this period / date is already loaded - return; - } - Piwik_piwik.period = period; - const dateRange = Periods_Periods.parse(period, date).getDateRange(); - Piwik_piwik.startDateString = format(dateRange[0]); - Piwik_piwik.endDateString = format(dateRange[1]); - Piwik_piwik.updateDateInTitle(date, period); // do not set anything to previousN/lastN, as it's more useful to plugins - // to have the dates than previousN/lastN. +window.globalAjaxQueue = []; +window.globalAjaxQueue.active = 0; - if (Piwik_piwik.period === 'range') { - date = `${Piwik_piwik.startDateString},${Piwik_piwik.endDateString}`; +window.globalAjaxQueue.clean = function globalAjaxQueueClean() { + for (let i = this.length; i >= 0; i -= 1) { + if (!this[i] || this[i].readyState === 4) { + this.splice(i, 1); + } } - - Piwik_piwik.currentDateString = date; }; -Piwik_piwik.updateDateInTitle = function updateDateInTitle(date, period) { - if (!$('.top_controls #periodString').length) { - return; - } // Cache server-rendered page title - +window.globalAjaxQueue.push = function globalAjaxQueuePush(...args) { + this.active += args.length; // cleanup ajax queue - originalTitle = originalTitle || document.title; + this.clean(); // call original array push - if (originalTitle.indexOf(Piwik_piwik.siteName) === 0) { - const dateString = ` - ${Periods_Periods.parse(period, date).getPrettyString()} `; - document.title = `${Piwik_piwik.siteName}${dateString}${originalTitle.substr(Piwik_piwik.siteName.length)}`; - } + return Array.prototype.push.call(this, ...args); }; -Piwik_piwik.hasUserCapability = function hasUserCapability(capability) { - return window.angular.isArray(Piwik_piwik.userCapabilities) && Piwik_piwik.userCapabilities.indexOf(capability) !== -1; +window.globalAjaxQueue.abort = function globalAjaxQueueAbort() { + // abort all queued requests if possible + this.forEach(x => x && x.abort && x.abort()); // remove all elements from array + + this.splice(0, this.length); + this.active = 0; }; +/** + * error callback to use by default + */ -const Piwik = Piwik_piwik; -/* harmony default export */ var Piwik_Piwik = (Piwik); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Piwik/Piwik.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ +function defaultErrorCallback(deferred, status) { + // do not display error message if request was aborted + if (status === 'abort') { + return; + } + + const loadingError = $('#loadingError'); -function piwikService() { - return Piwik_Piwik; + if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) { + if (deferred && deferred.status === 500) { + $(document.body).html(piwikHelper.escape(deferred.responseText)); + } + } else { + loadingError.show(); + } } +/** + * Global ajax helper to handle requests within Matomo + */ -angular.module('piwikApp.service').service('piwik', piwikService); -function initPiwikService(piwik, $rootScope) { - $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); -} +class AjaxHelper_AjaxHelper { + /** + * Format of response + */ -initPiwikService.$inject = ['piwik', '$rootScope']; -angular.module('piwikApp.service').run(initPiwikService); -// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} -var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); + /** + * A timeout for the request which will override any global timeout + */ -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=6af4d064 + /** + * Callback function to be executed on success + */ -const _hoisted_1 = { - class: "loadingPiwik" -}; + /** + * Use this.callback if an error is returned + */ -const _hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { - src: "plugins/Morpheus/images/loading-blue.gif", - alt: "" -}, null, -1); + /** + * Callback function to be executed on error + * + * @deprecated use the jquery promise API + */ -function render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.loadingMessage), 1)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loading]]); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=6af4d064 + /** + * Callback function to be executed on complete (after error or success) + * + * @deprecated use the jquery promise API + */ -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/translate.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -function translate(translationStringId, values = []) { - return window._pk_translate(translationStringId, values); // eslint-disable-line -} -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts + /** + * Params to be passed as GET params + * @see ajaxHelper.mixinDefaultGetParams + */ + /** + * Base URL used in the AJAX request. Can be set by setUrl. + * + * It is set to '?' rather than 'index.php?' to increase chances that it works + * including for users who have an automatic 301 redirection from index.php? to ? + * POST values are missing when there is such 301 redirection. So by by-passing + * this 301 redirection, we avoid this issue. + * + * @see ajaxHelper.setUrl + */ -/* harmony default export */ var ActivityIndicatorvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - loading: { - type: Boolean, - required: true, - default: false - }, - loadingMessage: { - type: String, - required: false, - default: translate('General_LoadingData') + /** + * Params to be passed as GET params + * @see ajaxHelper.mixinDefaultPostParams + */ + + /** + * Element to be displayed while loading + */ + + /** + * Element to be displayed on error + */ + + /** + * Handle for current request + */ + constructor() { + AjaxHelper_defineProperty(this, "format", 'json'); + + AjaxHelper_defineProperty(this, "timeout", null); + + AjaxHelper_defineProperty(this, "callback", null); + + AjaxHelper_defineProperty(this, "useRegularCallbackInCaseOfError", false); + + AjaxHelper_defineProperty(this, "errorCallback", void 0); + + AjaxHelper_defineProperty(this, "withToken", false); + + AjaxHelper_defineProperty(this, "completeCallback", void 0); + + AjaxHelper_defineProperty(this, "getParams", {}); + + AjaxHelper_defineProperty(this, "getUrl", '?'); + + AjaxHelper_defineProperty(this, "postParams", {}); + + AjaxHelper_defineProperty(this, "loadingElement", null); + + AjaxHelper_defineProperty(this, "errorElement", '#ajaxError'); + + AjaxHelper_defineProperty(this, "requestHandle", null); + + AjaxHelper_defineProperty(this, "defaultParams", ['idSite', 'period', 'date', 'segment']); + + this.errorCallback = defaultErrorCallback; + } + /** + * Adds params to the request. + * If params are given more then once, the latest given value is used for the request + * + * @param params + * @param type type of given parameters (POST or GET) + * @return {void} + */ + + + addParams(params, type) { + if (typeof params === 'string') { + // TODO: add global types for broadcast (multiple uses below) + params = window['broadcast'].getValuesFromUrl(params); // eslint-disable-line } + + const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates']; + Object.keys(params).forEach(key => { + const value = params[key]; + + if (arrayParams.indexOf(key) !== -1 && !value) { + return; + } + + if (type.toLowerCase() === 'get') { + this.getParams[key] = value; + } else if (type.toLowerCase() === 'post') { + this.postParams[key] = value; + } + }); } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue + withTokenInUrl() { + this.withToken = true; + } + /** + * Sets the base URL to use in the AJAX request. + */ -ActivityIndicatorvue_type_script_lang_ts.render = render + setUrl(url) { + this.addParams(broadcast.getValuesFromUrl(url), 'GET'); + } + /** + * Gets this helper instance ready to send a bulk request. Each argument to this + * function is a single request to use. + */ -/* harmony default export */ var ActivityIndicator = (ActivityIndicatorvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ + setBulkRequests(...urls) { + const urlsProcessed = urls.map(u => $.param(u)); + this.addParams({ + module: 'API', + method: 'API.getBulkRequest', + urls: urlsProcessed, + format: 'json' + }, 'post'); + } + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout. + * + * @param timeout Timeout in milliseconds + */ -function activityIndicatorAdapter() { - return { - restrict: 'A', - scope: { - loading: '<', - loadingMessage: '<' - }, - template: '', - link: function activityIndicatorAdapterLink(scope, element) { - const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ - template: '', + setTimeout(timeout) { + this.timeout = timeout; + } + /** + * Sets the callback called after the request finishes + * + * @param callback Callback function + * @deprecated use the jquery promise API + */ - data() { - return { - loading: scope.loading, - loadingMessage: scope.loadingMessage - }; + + setCallback(callback) { + this.callback = callback; + } + /** + * Set that the callback passed to setCallback() should be used if an application error (i.e. an + * Exception in PHP) is returned. + */ + + + useCallbackInCaseOfError() { + this.useRegularCallbackInCaseOfError = true; + } + /** + * Set callback to redirect on success handler + * &update=1(+x) will be appended to the current url + * + * @param [params] to modify in redirect url + * @return {void} + */ + + + redirectOnSuccess(params) { + this.setCallback(() => { + piwikHelper.redirect(params); + }); + } + /** + * Sets the callback called in case of an error within the request + * + * @deprecated use the jquery promise API + */ + + + setErrorCallback(callback) { + this.errorCallback = callback; + } + /** + * Sets the complete callback which is called after an error or success callback. + * + * @deprecated use the jquery promise API + */ + + + setCompleteCallback(callback) { + this.completeCallback = callback; + } + /** + * Sets the response format for the request + * + * @param format response format (e.g. json, html, ...) + */ + + + setFormat(format) { + this.format = format; + } + /** + * Set the div element to show while request is loading + * + * @param [element] selector for the loading element + */ + + + setLoadingElement(element) { + this.loadingElement = element || '#ajaxLoadingDiv'; + } + /** + * Set the div element to show on error + * + * @param element selector for the error element + */ + + + setErrorElement(element) { + if (!element) { + return; + } + + this.errorElement = element; + } + /** + * Detect whether are allowed to use the given default parameter or not + */ + + + useGETDefaultParameter(parameter) { + if (parameter && this.defaultParams) { + for (let i = 0; i < this.defaultParams.length; i += 1) { + if (this.defaultParams[i] === parameter) { + return true; } + } + } - }); - app.component('activity-indicator', ActivityIndicator); - const vm = app.mount(element[0]); - scope.$watch('loading', newValue => { - vm.loading = newValue; - }); - scope.$watch('loadingMessage', newValue => { - vm.loadingMessage = newValue || translate('General_LoadingData'); - }); + return false; + } + /** + * Removes a default parameter that is usually send automatically along the request. + * + * @param parameter A name such as "period", "date", "segment". + */ + + + removeDefaultParameter(parameter) { + if (parameter && this.defaultParams) { + for (let i = 0; i < this.defaultParams.length; i += 1) { + if (this.defaultParams[i] === parameter) { + this.defaultParams.splice(i, 1); + } + } } - }; -} -activityIndicatorAdapter.$inject = []; -angular.module('piwikApp').directive('piwikActivityIndicator', activityIndicatorAdapter); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 + } + /** + * Send the request + */ -function Alertvue_type_template_id_c3863ae2_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", { - [`alert-${_ctx.severity}`]: true - }]) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); -} -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts + send() { + if ($(this.errorElement).length) { + $(this.errorElement).hide(); + } -/* harmony default export */ var Alertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ - props: { - severity: { - type: String, - required: true + if (this.loadingElement) { + $(this.loadingElement).fadeIn(); } + + this.requestHandle = this.buildAjaxCall(); + globalAjaxQueue.push(this.requestHandle); + return this.requestHandle; } -})); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts - -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue + /** + * Aborts the current request if it is (still) running + */ + abort() { + if (this.requestHandle && typeof this.requestHandle.abort === 'function') { + this.requestHandle.abort(); + this.requestHandle = null; + } + } + /** + * Builds and sends the ajax requests + */ -Alertvue_type_script_lang_ts.render = Alertvue_type_template_id_c3863ae2_render -/* harmony default export */ var Alert = (Alertvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ + buildAjaxCall() { + const self = this; + const parameters = this.mixinDefaultGetParams(this.getParams); + let url = this.getUrl; + if (url[url.length - 1] !== '?') { + url += '&'; + } // we took care of encoding &segment properly already, so we don't use $.param for it ($.param + // URL encodes the values) -function alertAdapter() { - return { - restrict: 'A', - transclude: true, - scope: { - severity: '@piwikAlert' - }, - template: '
', - compile: function alertAdapterCompile() { - return { - post: function alertAdapterPostLink(scope, element) { - const clone = element.find('[ng-transclude]'); - const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ - template: '
', - data() { - return { - severity: scope.severity - }; - }, + if (parameters.segment) { + url = `${url}segment=${parameters.segment}&`; + delete parameters.segment; + } - setup() { - const transcludeTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); - return { - transcludeTarget - }; - } + if (parameters.date) { + url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`; + delete parameters.date; + } - }); - app.component('alert', Alert); - const vm = app.mount(element[0]); - scope.$watch('severity', newValue => { - vm.severity = newValue; - }); - $(vm.transcludeTarget).append(clone); + url += $.param(parameters); + const ajaxCall = { + type: 'POST', + async: true, + url, + dataType: this.format || 'json', + complete: this.completeCallback, + error: function errorCallback() { + globalAjaxQueue.active -= 1; + + if (self.errorCallback) { + self.errorCallback.apply(this, arguments); // eslint-disable-line } - }; - } - }; -} -alertAdapter.$inject = []; -angular.module('piwikApp').directive('piwikAlert', alertAdapter); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Range.ts -function Range_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + }, + success: (response, status, request) => { + if (this.loadingElement) { + $(this.loadingElement).hide(); + } + + if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) { + let placeAt = null; + let type = 'toast'; + + if ($(this.errorElement).length && response.message) { + $(this.errorElement).show(); + placeAt = this.errorElement; + type = null; + } + + if (response.message) { + const UI = window['require']('piwik/UI'); // eslint-disable-line -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ + const notification = new UI.Notification(); + notification.show(response.message, { + placeat: placeAt, + context: 'error', + type, + id: 'ajaxHelper' + }); + notification.scrollToNotification(); + } + } else if (this.callback) { + this.callback(response, status, request); + } + globalAjaxQueue.active -= 1; + if (Matomo_Matomo.ajaxRequestFinished) { + Matomo_Matomo.ajaxRequestFinished(); + } + }, + data: this.mixinDefaultPostParams(this.postParams), + timeout: this.timeout !== null ? this.timeout : undefined + }; + return $.ajax(ajaxCall); + } -class Range_RangePeriod { - constructor(startDate, endDate, childPeriodType) { - Range_defineProperty(this, "startDate", void 0); + isRequestToApiMethod() { + return this.getParams && this.getParams.module === 'API' && this.getParams.method || this.postParams && this.postParams.module === 'API' && this.postParams.method; + } - Range_defineProperty(this, "endDate", void 0); + isWidgetizedRequest() { + return broadcast.getValueFromUrl('module') === 'Widgetize'; + } - Range_defineProperty(this, "childPeriodType", void 0); + getDefaultPostParams() { + if (this.withToken || this.isRequestToApiMethod() || Matomo_Matomo.shouldPropagateTokenAuth) { + return { + token_auth: Matomo_Matomo.token_auth, + // When viewing a widgetized report there won't be any session that can be used, so don't + // force session usage + force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1 + }; + } - this.startDate = startDate; - this.endDate = endDate; - this.childPeriodType = childPeriodType; + return {}; } /** - * Returns a range representing the last N childPeriodType periods, including the current one. + * Mixin the default parameters to send as POST + * + * @param params parameter object */ - static getLastNRange(childPeriodType, strAmount, strEndDate) { - const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0); - - if (Number.isNaN(nAmount)) { - throw new Error('Invalid range strAmount'); - } + mixinDefaultPostParams(params) { + const defaultParams = this.getDefaultPostParams(); + const mergedParams = { ...defaultParams, + ...params + }; + return mergedParams; + } + /** + * Mixin the default parameters to send as GET + * + * @param params parameter object + */ - let endDate = strEndDate ? parseDate(strEndDate) : getToday(); - let startDate = new Date(endDate.getTime()); - if (childPeriodType === 'day') { - startDate.setDate(startDate.getDate() - nAmount); - } else if (childPeriodType === 'week') { - startDate.setDate(startDate.getDate() - nAmount * 7); - } else if (childPeriodType === 'month') { - startDate.setDate(1); - startDate.setMonth(startDate.getMonth() - nAmount); - } else if (childPeriodType === 'year') { - startDate.setFullYear(startDate.getFullYear() - nAmount); - } else { - throw new Error(`Unknown period type '${childPeriodType}'.`); - } + mixinDefaultGetParams(originalParams) { + const segment = MatomoUrl_MatomoUrl.getSearchParam('segment'); + const defaultParams = { + idSite: Matomo_Matomo.idSite || broadcast.getValueFromUrl('idSite'), + period: Matomo_Matomo.period || broadcast.getValueFromUrl('period'), + segment + }; + const params = originalParams; // never append token_auth to url - if (childPeriodType !== 'day') { - const startPeriod = Periods_Periods.periods[childPeriodType].parse(startDate); - const endPeriod = Periods_Periods.periods[childPeriodType].parse(endDate); - [startDate] = startPeriod.getDateRange(); - [, endDate] = endPeriod.getDateRange(); + if (params.token_auth) { + params.token_auth = null; + delete params.token_auth; } - const firstWebsiteDate = new Date(1991, 7, 6); - - if (startDate.getTime() - firstWebsiteDate.getTime() < 0) { - switch (childPeriodType) { - case 'year': - startDate = new Date(1992, 0, 1); - break; - - case 'month': - startDate = new Date(1991, 8, 1); - break; - - case 'week': - startDate = new Date(1991, 8, 12); - break; - - case 'day': - default: - startDate = firstWebsiteDate; - break; + Object.keys(defaultParams).forEach(key => { + if (this.useGETDefaultParameter(key) && !params[key] && !this.postParams[key] && defaultParams[key]) { + params[key] = defaultParams[key]; } + }); // handle default date & period if not already set + + if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) { + params.date = Matomo_Matomo.currentDateString; } - return new Range_RangePeriod(startDate, endDate, childPeriodType); + return params; } - static parse(strDate, childPeriodType = 'day') { - if (/^previous/.test(strDate)) { - const endDate = Range_RangePeriod.getLastNRange(childPeriodType, '2').startDate; - return Range_RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate); - } +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts - if (/^last/.test(strDate)) { - return Range_RangePeriod.getLastNRange(childPeriodType, strDate.substring(4)); - } +window.ajaxHelper = AjaxHelper_AjaxHelper; - const parts = decodeURIComponent(strDate).split(','); - return new Range_RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType); - } +function ajaxQueue() { + return globalAjaxQueue; +} - static getDisplayText() { - return translate('General_DateRangeInPeriodList'); - } +angular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ - getPrettyString() { - const start = format(this.startDate); - const end = format(this.endDate); - return translate('General_DateRangeFromTo', [start, end]); - } +/** + * Similar to angulars $location but works around some limitation. Use it if you need to access + * search params + */ +const PiwikUrl = { + getSearchParam(paramName) { + const hash = window.location.href.split('#'); + const regex = new RegExp(`${paramName}(\\[]|=)`); - getDateRange() { - return [this.startDate, this.endDate]; - } + if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) { + const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href); // for date, period and idsite fall back to parameter from url, if non in hash was provided - containsToday() { - return todayIsInRange(this.getDateRange()); + if (valueFromHash || paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite') { + return valueFromHash; + } + } + + return window.broadcast.getValueFromUrl(paramName, window.location.search); } -} -Periods_Periods.addCustomPeriod('range', Range_RangePeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts +}; +/* harmony default export */ var PiwikUrl_PiwikUrl = (PiwikUrl); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -1284,26 +1388,16 @@ Periods_Periods.addCustomPeriod('range', Range_RangePeriod); */ - -window.piwik.addCustomPeriod = Periods_Periods.addCustomPeriod.bind(Periods_Periods); - -function piwikPeriods() { - return { - getAllLabels: Periods_Periods.getAllLabels.bind(Periods_Periods), - isRecognizedPeriod: Periods_Periods.isRecognizedPeriod.bind(Periods_Periods), - get: Periods_Periods.get.bind(Periods_Periods), - parse: Periods_Periods.parse.bind(Periods_Periods), - parseDate: parseDate, - format: format, - RangePeriod: Range_RangePeriod, - todayIsInRange: todayIsInRange +function PiwikUrl_adapter_piwikUrl() { + const model = { + getSearchParam: PiwikUrl_PiwikUrl.getSearchParam.bind(PiwikUrl_PiwikUrl) }; + return model; } -angular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Day.ts -function Day_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - +PiwikUrl_adapter_piwikUrl.$inject = []; +angular.module('piwikApp.service').service('piwikUrl', PiwikUrl_adapter_piwikUrl); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Piwik/Piwik.ts /*! * Matomo - free/libre analytics platform * @@ -1313,38 +1407,73 @@ function Day_defineProperty(obj, key, value) { if (key in obj) { Object.definePr -class Day_DayPeriod { - constructor(dateInPeriod) { - Day_defineProperty(this, "dateInPeriod", void 0); +let Piwik_originalTitle; +const { + piwik: Piwik_piwik, + broadcast: Piwik_broadcast, + piwikHelper: Piwik_piwikHelper +} = window; +Piwik_piwik.helper = Piwik_piwikHelper; +Piwik_piwik.broadcast = Piwik_broadcast; - this.dateInPeriod = dateInPeriod; +function Piwik_isValidPeriod(periodStr, dateStr) { + try { + Periods_Periods.parse(periodStr, dateStr); + return true; + } catch (e) { + return false; } +} - static parse(strDate) { - return new Day_DayPeriod(parseDate(strDate)); +Piwik_piwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() { + let date = PiwikUrl_PiwikUrl.getSearchParam('date'); + const period = PiwikUrl_PiwikUrl.getSearchParam('period'); + + if (!Piwik_isValidPeriod(period, date)) { + // invalid data in URL + return; } - static getDisplayText() { - return translate('Intl_PeriodDay'); + if (Piwik_piwik.period === period && Piwik_piwik.currentDateString === date) { + // this period / date is already loaded + return; } - getPrettyString() { - return format(this.dateInPeriod); + Piwik_piwik.period = period; + const dateRange = Periods_Periods.parse(period, date).getDateRange(); + Piwik_piwik.startDateString = format(dateRange[0]); + Piwik_piwik.endDateString = format(dateRange[1]); + Piwik_piwik.updateDateInTitle(date, period); // do not set anything to previousN/lastN, as it's more useful to plugins + // to have the dates than previousN/lastN. + + if (Piwik_piwik.period === 'range') { + date = `${Piwik_piwik.startDateString},${Piwik_piwik.endDateString}`; } - getDateRange() { - return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())]; - } + Piwik_piwik.currentDateString = date; +}; + +Piwik_piwik.updateDateInTitle = function updateDateInTitle(date, period) { + if (!$('.top_controls #periodString').length) { + return; + } // Cache server-rendered page title + + + Piwik_originalTitle = Piwik_originalTitle || document.title; - containsToday() { - return todayIsInRange(this.getDateRange()); + if (Piwik_originalTitle.indexOf(Piwik_piwik.siteName) === 0) { + const dateString = ` - ${Periods_Periods.parse(period, date).getPrettyString()} `; + document.title = `${Piwik_piwik.siteName}${dateString}${Piwik_originalTitle.substr(Piwik_piwik.siteName.length)}`; } +}; -} -Periods_Periods.addCustomPeriod('day', Day_DayPeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Week.ts -function Week_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +Piwik_piwik.hasUserCapability = function hasUserCapability(capability) { + return window.angular.isArray(Piwik_piwik.userCapabilities) && Piwik_piwik.userCapabilities.indexOf(capability) !== -1; +}; +const Piwik = Piwik_piwik; +/* harmony default export */ var Piwik_Piwik = (Piwik); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Piwik/Piwik.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -1353,47 +1482,64 @@ function Week_defineProperty(obj, key, value) { if (key in obj) { Object.defineP */ +function Piwik_adapter_piwikService() { + return Piwik_Piwik; +} -class Week_WeekPeriod { - constructor(dateInPeriod) { - Week_defineProperty(this, "dateInPeriod", void 0); +angular.module('piwikApp.service').service('piwik', Piwik_adapter_piwikService); - this.dateInPeriod = dateInPeriod; - } +function Piwik_adapter_initPiwikService(piwik, $rootScope) { + $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); +} - static parse(strDate) { - return new Week_WeekPeriod(parseDate(strDate)); - } +Piwik_adapter_initPiwikService.$inject = ['piwik', '$rootScope']; +angular.module('piwikApp.service').run(Piwik_adapter_initPiwikService); +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); - static getDisplayText() { - return translate('Intl_PeriodWeek'); - } +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=6af4d064 - getPrettyString() { - const weekDates = this.getDateRange(); - const startWeek = format(weekDates[0]); - const endWeek = format(weekDates[1]); - return translate('General_DateRangeFromTo', [startWeek, endWeek]); - } +const _hoisted_1 = { + class: "loadingPiwik" +}; - getDateRange() { - const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7; - const startWeek = new Date(this.dateInPeriod.getTime()); - startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday); - const endWeek = new Date(startWeek.getTime()); - endWeek.setDate(startWeek.getDate() + 6); - return [startWeek, endWeek]; - } +const _hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + src: "plugins/Morpheus/images/loading-blue.gif", + alt: "" +}, null, -1); - containsToday() { - return todayIsInRange(this.getDateRange()); +function render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.loadingMessage), 1)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.loading]]); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=6af4d064 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts + + +/* harmony default export */ var ActivityIndicatorvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + loading: { + type: Boolean, + required: true, + default: false + }, + loadingMessage: { + type: String, + required: false, + default: translate('General_LoadingData') + } } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue -} -Periods_Periods.addCustomPeriod('week', Week_WeekPeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Month.ts -function Month_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +ActivityIndicatorvue_type_script_lang_ts.render = render + +/* harmony default export */ var ActivityIndicator = (ActivityIndicatorvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -1403,45 +1549,71 @@ function Month_defineProperty(obj, key, value) { if (key in obj) { Object.define -class Month_MonthPeriod { - constructor(dateInPeriod) { - Month_defineProperty(this, "dateInPeriod", void 0); +function activityIndicatorAdapter() { + return { + restrict: 'A', + scope: { + loading: '<', + loadingMessage: '<' + }, + template: '', + link: function activityIndicatorAdapterLink(scope, element) { + const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ + template: '', - this.dateInPeriod = dateInPeriod; - } + data() { + return { + loading: scope.loading, + loadingMessage: scope.loadingMessage + }; + } - static parse(strDate) { - return new Month_MonthPeriod(parseDate(strDate)); - } + }); + app.config.globalProperties.$sanitize = window.vueSanitize; + app.component('activity-indicator', ActivityIndicator); + const vm = app.mount(element[0]); + scope.$watch('loading', newValue => { + vm.loading = newValue; + }); + scope.$watch('loadingMessage', newValue => { + vm.loadingMessage = newValue || translate('General_LoadingData'); + }); + } + }; +} +activityIndicatorAdapter.$inject = []; +angular.module('piwikApp').directive('piwikActivityIndicator', activityIndicatorAdapter); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 - static getDisplayText() { - return translate('Intl_PeriodMonth'); - } +function Alertvue_type_template_id_c3863ae2_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", { + [`alert-${_ctx.severity}`]: true + }]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); +} +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 - getPrettyString() { - const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`); - return `${month} ${this.dateInPeriod.getFullYear()}`; - } +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts - getDateRange() { - const startMonth = new Date(this.dateInPeriod.getTime()); - startMonth.setDate(1); - const endMonth = new Date(this.dateInPeriod.getTime()); - endMonth.setDate(1); - endMonth.setMonth(endMonth.getMonth() + 1); - endMonth.setDate(0); - return [startMonth, endMonth]; +/* harmony default export */ var Alertvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + severity: { + type: String, + required: true + } } +})); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue - containsToday() { - return todayIsInRange(this.getDateRange()); - } -} -Periods_Periods.addCustomPeriod('month', Month_MonthPeriod); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Year.ts -function Year_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +Alertvue_type_script_lang_ts.render = Alertvue_type_template_id_c3863ae2_render + +/* harmony default export */ var Alert = (Alertvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts /*! * Matomo - free/libre analytics platform * @@ -1450,42 +1622,49 @@ function Year_defineProperty(obj, key, value) { if (key in obj) { Object.defineP */ +function alertAdapter() { + return { + restrict: 'A', + transclude: true, + scope: { + severity: '@piwikAlert' + }, + template: '
', + compile: function alertAdapterCompile() { + return { + post: function alertAdapterPostLink(scope, element) { + const clone = element.find('[ng-transclude]'); + const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ + template: '
', -class Year_YearPeriod { - constructor(dateInPeriod) { - Year_defineProperty(this, "dateInPeriod", void 0); - - this.dateInPeriod = dateInPeriod; - } - - static parse(strDate) { - return new Year_YearPeriod(parseDate(strDate)); - } - - static getDisplayText() { - return translate('Intl_PeriodYear'); - } - - getPrettyString() { - return this.dateInPeriod.getFullYear().toString(); - } - - getDateRange() { - const startYear = new Date(this.dateInPeriod.getTime()); - startYear.setMonth(0); - startYear.setDate(1); - const endYear = new Date(this.dateInPeriod.getTime()); - endYear.setMonth(12); - endYear.setDate(0); - return [startYear, endYear]; - } + data() { + return { + severity: scope.severity + }; + }, - containsToday() { - return todayIsInRange(this.getDateRange()); - } + setup() { + const transcludeTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); + return { + transcludeTarget + }; + } + }); + app.config.globalProperties.$sanitize = window.vueSanitize; + app.component('alert', Alert); + const vm = app.mount(element[0]); + scope.$watch('severity', newValue => { + vm.severity = newValue; + }); + $(vm.transcludeTarget).append(clone); + } + }; + } + }; } -Periods_Periods.addCustomPeriod('year', Year_YearPeriod); +alertAdapter.$inject = []; +angular.module('piwikApp').directive('piwikAlert', alertAdapter); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/index.ts /*! * Matomo - free/libre analytics platform @@ -1500,6 +1679,7 @@ Periods_Periods.addCustomPeriod('year', Year_YearPeriod); + // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -1518,6 +1698,15 @@ Periods_Periods.addCustomPeriod('year', Year_YearPeriod); + + + + + + + + + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js.map b/plugins/CoreHome/vue/dist/CoreHome.umd.js.map index 3366b12fb1..02f7d028cc 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js.map +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://CoreHome/webpack/universalModuleDefinition","webpack://CoreHome/webpack/bootstrap","webpack://CoreHome/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://CoreHome/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/utilities.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/translate.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?0bf6","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?f42e","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?6f80","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?14a2","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?92a9","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?cc69","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Range.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Day.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Week.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Month.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Year.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/index.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/index.ts","webpack://CoreHome/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA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AV,CAAmB,CAAnB;AACA,aAAS,CAAC,OAAV,CAAkB,CAAlB;AAEA,UAAM,OAAO,GAAG,IAAI,IAAJ,CAAS,KAAK,YAAL,CAAkB,OAAlB,EAAT,CAAhB;AACA,WAAO,CAAC,QAAR,CAAiB,EAAjB;AACA,WAAO,CAAC,OAAR,CAAgB,CAAhB;AAEA,WAAO,CAAC,SAAD,EAAY,OAAZ,CAAP;AACD;;AAED,eAAa;AACX,WAAO,cAAc,CAAC,KAAK,YAAL,EAAD,CAArB;AACD;;AA7B4B;AAgC/B,eAAO,CAAC,eAAR,CAAwB,MAAxB,EAAgC,eAAhC,E;;AC3CA;;;;;AAKG;AACH;AAEA;AACA;AACA;AACA;AACA;;;ACZA;;;;;AAKG;AAEH;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACjBwB;AACF","file":"CoreHome.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CoreHome\"] = factory(require(\"vue\"));\n\telse\n\t\troot[\"CoreHome\"] = factory(root[\"Vue\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n/**\n * Similar to angulars $location but works around some limitation. Use it if you need to access\n * search params\n */\nconst PiwikUrl = {\n getSearchParam(paramName: string): string {\n const hash = window.location.href.split('#');\n\n const regex = new RegExp(`${paramName}(\\\\[]|=)`);\n if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) {\n const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href);\n\n // for date, period and idsite fall back to parameter from url, if non in hash was provided\n if (valueFromHash\n || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite')\n ) {\n return valueFromHash;\n }\n }\n\n return window.broadcast.getValueFromUrl(paramName, window.location.search);\n },\n};\n\nexport default PiwikUrl;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport PiwikUrl from '../PiwikUrl/PiwikUrl';\n\nwindow.globalAjaxQueue = [] as GlobalAjaxQueue;\nwindow.globalAjaxQueue.active = 0;\n\nwindow.globalAjaxQueue.clean = function globalAjaxQueueClean() {\n for (let i = this.length; i >= 0; i -= 1) {\n if (!this[i] || this[i].readyState === 4) {\n this.splice(i, 1);\n }\n }\n};\n\nwindow.globalAjaxQueue.push = function globalAjaxQueuePush(...args: (XMLHttpRequest|null)[]) {\n this.active += args.length;\n\n // cleanup ajax queue\n this.clean();\n\n // call original array push\n return Array.prototype.push.call(this, ...args);\n};\n\nwindow.globalAjaxQueue.abort = function globalAjaxQueueAbort() {\n // abort all queued requests if possible\n this.forEach((x) => x && x.abort && x.abort());\n\n // remove all elements from array\n this.splice(0, this.length);\n\n this.active = 0;\n};\n\ntype ParameterValue = string | number | null | undefined | ParameterValue[];\ntype Parameters = {[name: string]: ParameterValue | Parameters};\ntype AnyFunction = (...params:any[]) => any; // eslint-disable-line\n\n/**\n * error callback to use by default\n */\nfunction defaultErrorCallback(deferred: XMLHttpRequest, status: string): void {\n // do not display error message if request was aborted\n if (status === 'abort') {\n return;\n }\n\n const loadingError = $('#loadingError');\n if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) {\n if (deferred && deferred.status === 500) {\n $(document.body).html(piwikHelper.escape(deferred.responseText));\n }\n } else {\n loadingError.show();\n }\n}\n\n/**\n * Global ajax helper to handle requests within piwik\n */\nexport default class AjaxHelper {\n /**\n * Format of response\n */\n format = 'json';\n\n /**\n * A timeout for the request which will override any global timeout\n */\n timeout = null;\n\n /**\n * Callback function to be executed on success\n */\n callback: AnyFunction = null;\n\n /**\n * Use this.callback if an error is returned\n */\n useRegularCallbackInCaseOfError = false;\n\n /**\n * Callback function to be executed on error\n */\n errorCallback: AnyFunction;\n\n withToken = false;\n\n /**\n * Callback function to be executed on complete (after error or success)\n */\n completeCallback: AnyFunction;\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultGetParams\n */\n getParams: Parameters = {};\n\n /**\n * Base URL used in the AJAX request. Can be set by setUrl.\n *\n * It is set to '?' rather than 'index.php?' to increase chances that it works\n * including for users who have an automatic 301 redirection from index.php? to ?\n * POST values are missing when there is such 301 redirection. So by by-passing\n * this 301 redirection, we avoid this issue.\n *\n * @see ajaxHelper.setUrl\n */\n getUrl = '?';\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultPostParams\n */\n postParams: Parameters = {};\n\n /**\n * Element to be displayed while loading\n */\n loadingElement: HTMLElement|null|JQuery|JQLite|string = null;\n\n /**\n * Element to be displayed on error\n */\n errorElement: HTMLElement|JQuery|JQLite|string = '#ajaxError';\n\n /**\n * Handle for current request\n */\n requestHandle: XMLHttpRequest|JQuery.jqXHR|null = null;\n\n defaultParams = ['idSite', 'period', 'date', 'segment'];\n\n constructor() {\n this.errorCallback = defaultErrorCallback;\n }\n\n /**\n * Adds params to the request.\n * If params are given more then once, the latest given value is used for the request\n *\n * @param params\n * @param type type of given parameters (POST or GET)\n * @return {void}\n */\n addParams(params: Parameters|string, type: string): void {\n if (typeof params === 'string') {\n // TODO: add global types for broadcast (multiple uses below)\n params = window['broadcast'].getValuesFromUrl(params); // eslint-disable-line\n }\n\n const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates'];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n if (arrayParams.indexOf(key) !== -1\n && !value\n ) {\n return;\n }\n\n if (type.toLowerCase() === 'get') {\n this.getParams[key] = value;\n } else if (type.toLowerCase() === 'post') {\n this.postParams[key] = value;\n }\n });\n }\n\n withTokenInUrl(): void {\n this.withToken = true;\n }\n\n /**\n * Sets the base URL to use in the AJAX request.\n */\n setUrl(url: string): void {\n this.addParams(broadcast.getValuesFromUrl(url), 'GET');\n }\n\n /**\n * Gets this helper instance ready to send a bulk request. Each argument to this\n * function is a single request to use.\n */\n setBulkRequests(...urls: string[]): void {\n const urlsProcessed = urls.map((u) => $.param(u));\n\n this.addParams({\n module: 'API',\n method: 'API.getBulkRequest',\n urls: urlsProcessed,\n format: 'json',\n }, 'post');\n }\n\n /**\n * Set a timeout (in milliseconds) for the request. This will override any global timeout.\n *\n * @param timeout Timeout in milliseconds\n */\n setTimeout(timeout: number): void {\n this.timeout = timeout;\n }\n\n /**\n * Sets the callback called after the request finishes\n *\n * @param callback Callback function\n */\n setCallback(callback: AnyFunction): void {\n this.callback = callback;\n }\n\n /**\n * Set that the callback passed to setCallback() should be used if an application error (i.e. an\n * Exception in PHP) is returned.\n */\n useCallbackInCaseOfError(): void {\n this.useRegularCallbackInCaseOfError = true;\n }\n\n /**\n * Set callback to redirect on success handler\n * &update=1(+x) will be appended to the current url\n *\n * @param [params] to modify in redirect url\n * @return {void}\n */\n redirectOnSuccess(params: Parameters): void {\n this.setCallback(() => {\n piwikHelper.redirect(params);\n });\n }\n\n /**\n * Sets the callback called in case of an error within the request\n */\n setErrorCallback(callback: AnyFunction): void {\n this.errorCallback = callback;\n }\n\n /**\n * Sets the complete callback which is called after an error or success callback.\n */\n setCompleteCallback(callback: AnyFunction): void {\n this.completeCallback = callback;\n }\n\n /**\n * Sets the response format for the request\n *\n * @param format response format (e.g. json, html, ...)\n */\n setFormat(format: string): void {\n this.format = format;\n }\n\n /**\n * Set the div element to show while request is loading\n *\n * @param [element] selector for the loading element\n */\n setLoadingElement(element: string|HTMLElement|JQuery): void {\n this.loadingElement = element || '#ajaxLoadingDiv';\n }\n\n /**\n * Set the div element to show on error\n *\n * @param element selector for the error element\n */\n setErrorElement(element: HTMLElement|JQuery|string): void {\n if (!element) {\n return;\n }\n this.errorElement = element;\n }\n\n /**\n * Detect whether are allowed to use the given default parameter or not\n */\n private useGETDefaultParameter(parameter: string): boolean {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Removes a default parameter that is usually send automatically along the request.\n *\n * @param parameter A name such as \"period\", \"date\", \"segment\".\n */\n removeDefaultParameter(parameter: string): void {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n this.defaultParams.splice(i, 1);\n }\n }\n }\n }\n\n /**\n * Send the request\n */\n send(): void {\n if ($(this.errorElement).length) {\n $(this.errorElement).hide();\n }\n\n if (this.loadingElement) {\n $(this.loadingElement).fadeIn();\n }\n\n this.requestHandle = this.buildAjaxCall();\n globalAjaxQueue.push(this.requestHandle);\n }\n\n /**\n * Aborts the current request if it is (still) running\n */\n abort(): void {\n if (this.requestHandle && typeof this.requestHandle.abort === 'function') {\n this.requestHandle.abort();\n this.requestHandle = null;\n }\n }\n\n /**\n * Builds and sends the ajax requests\n */\n private buildAjaxCall(): JQuery.jqXHR {\n const self = this;\n const parameters = this.mixinDefaultGetParams(this.getParams);\n\n let url = this.getUrl;\n if (url[url.length - 1] !== '?') {\n url += '&';\n }\n\n // we took care of encoding &segment properly already, so we don't use $.param for it ($.param\n // URL encodes the values)\n if (parameters.segment) {\n url = `${url}segment=${parameters.segment}&`;\n delete parameters.segment;\n }\n if (parameters.date) {\n url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`;\n delete parameters.date;\n }\n url += $.param(parameters);\n const ajaxCall = {\n type: 'POST',\n async: true,\n url,\n dataType: this.format || 'json',\n complete: this.completeCallback,\n error: function errorCallback() {\n globalAjaxQueue.active -= 1;\n\n if (self.errorCallback) {\n self.errorCallback.apply(this, arguments); // eslint-disable-line\n }\n },\n success: (response, status, request) => {\n if (this.loadingElement) {\n $(this.loadingElement).hide();\n }\n\n if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) {\n let placeAt = null;\n let type = 'toast';\n if ($(this.errorElement).length && response.message) {\n $(this.errorElement).show();\n placeAt = this.errorElement;\n type = null;\n }\n\n if (response.message) {\n const UI = window['require']('piwik/UI'); // eslint-disable-line\n const notification = new UI.Notification();\n notification.show(response.message, {\n placeat: placeAt,\n context: 'error',\n type,\n id: 'ajaxHelper',\n });\n notification.scrollToNotification();\n }\n } else if (this.callback) {\n this.callback(response, status, request);\n }\n\n globalAjaxQueue.active -= 1;\n const { piwik } = window;\n if (piwik\n && piwik.ajaxRequestFinished\n ) {\n piwik.ajaxRequestFinished();\n }\n },\n data: this.mixinDefaultPostParams(this.postParams),\n timeout: this.timeout !== null ? this.timeout : undefined,\n };\n\n return $.ajax(ajaxCall);\n }\n\n private isRequestToApiMethod() {\n return (this.getParams && this.getParams.module === 'API' && this.getParams.method)\n || (this.postParams && this.postParams.module === 'API' && this.postParams.method);\n }\n\n isWidgetizedRequest(): boolean {\n return (broadcast.getValueFromUrl('module') === 'Widgetize');\n }\n\n private getDefaultPostParams() {\n if (this.withToken || this.isRequestToApiMethod() || piwik.shouldPropagateTokenAuth) {\n return {\n token_auth: piwik.token_auth,\n // When viewing a widgetized report there won't be any session that can be used, so don't\n // force session usage\n force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1,\n };\n }\n\n return {};\n }\n\n /**\n * Mixin the default parameters to send as POST\n *\n * @param params parameter object\n */\n private mixinDefaultPostParams(params): Parameters {\n const defaultParams = this.getDefaultPostParams();\n\n const mergedParams = {\n ...defaultParams,\n ...params,\n };\n\n return mergedParams;\n }\n\n /**\n * Mixin the default parameters to send as GET\n *\n * @param params parameter object\n */\n private mixinDefaultGetParams(originalParams): Parameters {\n const segment = PiwikUrl.getSearchParam('segment');\n\n const defaultParams = {\n idSite: piwik.idSite || broadcast.getValueFromUrl('idSite'),\n period: piwik.period || broadcast.getValueFromUrl('period'),\n segment,\n };\n\n const params = originalParams;\n\n // never append token_auth to url\n if (params.token_auth) {\n params.token_auth = null;\n delete params.token_auth;\n }\n\n Object.keys(defaultParams).forEach((key) => {\n if (this.useGETDefaultParameter(key)\n && !params[key]\n && !this.postParams[key]\n && defaultParams[key]\n ) {\n params[key] = defaultParams[key];\n }\n });\n\n // handle default date & period if not already set\n if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) {\n params.date = piwik.currentDateString;\n }\n\n return params;\n }\n}\n","import AjaxHelper from './AjaxHelper';\n\ndeclare global {\n interface Window {\n ajaxHelper: AjaxHelper;\n }\n}\n\nwindow.ajaxHelper = AjaxHelper;\n\nfunction ajaxQueue() {\n return globalAjaxQueue;\n}\n\nangular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport PiwikUrl from './PiwikUrl';\n\nfunction piwikUrl() {\n const model = {\n getSearchParam: PiwikUrl.getSearchParam.bind(PiwikUrl),\n };\n\n return model;\n}\n\npiwikUrl.$inject = [];\n\nangular.module('piwikApp.service').service('piwikUrl', piwikUrl);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\ninterface Period {\n getPrettyString(): string;\n getDateRange(): Date[];\n containsToday(): boolean;\n}\n\ninterface PeriodClass {\n parse(strDate: string|Date): Period;\n getDisplayText(): string;\n}\n\n/**\n * Piwik period management service for the frontend.\n *\n * Usage:\n *\n * var DayPeriod = piwikPeriods.get('day');\n * var day = new DayPeriod(new Date());\n *\n * or\n *\n * var day = piwikPeriods.parse('day', '2013-04-05');\n *\n * Adding custom periods:\n *\n * To add your own period to the frontend, create a period class for it\n * w/ the following methods:\n *\n * - **getPrettyString()**: returns a human readable display string for the period.\n * - **getDateRange()**: returns an array w/ two elements, the first being the start\n * Date of the period, the second being the end Date. The dates\n * must be Date objects, not strings, and are inclusive.\n * - **containsToday()**: returns true if the date period contains today. False if not.\n * - (_static_) **parse(strDate)**: creates a new instance of this period from the\n * value of the 'date' query parameter.\n * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month',\n * 'week', etc.\n *\n * Then call piwik.addCustomPeriod w/ your period class:\n *\n * piwik.addCustomPeriod('mycustomperiod', MyCustomPeriod);\n *\n * NOTE: currently only single date periods like day, week, month year can\n * be extended. Other types of periods that require a special UI to\n * view/edit aren't, since there is currently no way to use a\n * custom UI for a custom period.\n */\nclass Periods {\n periods: {[name: string]: PeriodClass} = {};\n\n periodOrder: string[] = [];\n\n addCustomPeriod(name: string, periodClass: PeriodClass) {\n if (this.periods[name]) {\n throw new Error(`The \"${name}\" period already exists! It cannot be overridden.`);\n }\n\n this.periods[name] = periodClass;\n this.periodOrder.push(name);\n }\n\n getAllLabels(): string[] {\n return Array().concat(this.periodOrder);\n }\n\n get(strPeriod: string): PeriodClass {\n const periodClass = this.periods[strPeriod];\n if (!periodClass) {\n throw new Error(`Invalid period label: ${strPeriod}`);\n }\n return periodClass;\n }\n\n parse(strPeriod: string, strDate: string): Period {\n return this.get(strPeriod).parse(strDate);\n }\n\n isRecognizedPeriod(strPeriod: string): boolean {\n return !!this.periods[strPeriod];\n }\n}\n\nexport default new Periods();\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport function format(date: Date): string {\n return $.datepicker.formatDate('yy-mm-dd', date);\n}\n\nexport function getToday(): Date {\n const date = new Date(Date.now());\n\n // undo browser timezone\n date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n\n // apply piwik site timezone (if it exists)\n date.setHours(date.getHours() + ((window.piwik.timezoneOffset || 0) / 3600));\n\n // get rid of hours/minutes/seconds/etc.\n date.setHours(0);\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return date;\n}\n\nexport function parseDate(date: string|Date): Date {\n if (date instanceof Date) {\n return date;\n }\n\n const strDate = decodeURIComponent(date);\n\n if (strDate === 'today'\n || strDate === 'now'\n ) {\n return getToday();\n }\n\n if (strDate === 'yesterday'\n // note: ignoring the 'same time' part since the frontend doesn't care about the time\n || strDate === 'yesterdaySameTime'\n ) {\n const yesterday = getToday();\n yesterday.setDate(yesterday.getDate() - 1);\n return yesterday;\n }\n\n if (strDate.match(/last[ -]?week/i)) {\n const lastWeek = getToday();\n lastWeek.setDate(lastWeek.getDate() - 7);\n return lastWeek;\n }\n\n if (strDate.match(/last[ -]?month/i)) {\n const lastMonth = getToday();\n lastMonth.setDate(1);\n lastMonth.setMonth(lastMonth.getMonth() - 1);\n return lastMonth;\n }\n\n if (strDate.match(/last[ -]?year/i)) {\n const lastYear = getToday();\n lastYear.setFullYear(lastYear.getFullYear() - 1);\n return lastYear;\n }\n\n try {\n return $.datepicker.parseDate('yy-mm-dd', strDate);\n } catch (err) {\n // angular swallows this error, so manual console log here\n console.error(err.message || err);\n throw err;\n }\n}\n\nexport function todayIsInRange(dateRange: Date[]): boolean {\n if (dateRange.length !== 2) {\n return false;\n }\n\n if (getToday() >= dateRange[0] && getToday() <= dateRange[1]) {\n return true;\n }\n\n return false;\n}\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport PiwikUrl from '../PiwikUrl/PiwikUrl';\nimport Periods from '../Periods/Periods';\nimport { format } from '../Periods/utilities';\n\nlet originalTitle: string;\n\nconst { piwik, broadcast, piwikHelper } = window;\n\npiwik.helper = piwikHelper;\npiwik.broadcast = broadcast;\n\nfunction isValidPeriod(periodStr: string, dateStr: string) {\n try {\n Periods.parse(periodStr, dateStr);\n return true;\n } catch (e) {\n return false;\n }\n}\n\npiwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() {\n let date = PiwikUrl.getSearchParam('date');\n const period = PiwikUrl.getSearchParam('period');\n if (!isValidPeriod(period, date)) {\n // invalid data in URL\n return;\n }\n\n if (piwik.period === period && piwik.currentDateString === date) {\n // this period / date is already loaded\n return;\n }\n\n piwik.period = period;\n\n const dateRange = Periods.parse(period, date).getDateRange();\n piwik.startDateString = format(dateRange[0]);\n piwik.endDateString = format(dateRange[1]);\n\n piwik.updateDateInTitle(date, period);\n\n // do not set anything to previousN/lastN, as it's more useful to plugins\n // to have the dates than previousN/lastN.\n if (piwik.period === 'range') {\n date = `${piwik.startDateString},${piwik.endDateString}`;\n }\n\n piwik.currentDateString = date;\n};\n\npiwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) {\n if (!$('.top_controls #periodString').length) {\n return;\n }\n\n // Cache server-rendered page title\n originalTitle = originalTitle || document.title;\n\n if (originalTitle.indexOf(piwik.siteName) === 0) {\n const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `;\n document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`;\n }\n};\n\npiwik.hasUserCapability = function hasUserCapability(capability: string) {\n return window.angular.isArray(piwik.userCapabilities)\n && piwik.userCapabilities.indexOf(capability) !== -1;\n};\n\nconst Piwik = piwik;\nexport default Piwik;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Piwik from './Piwik';\n\nfunction piwikService() {\n return Piwik;\n}\n\nangular.module('piwikApp.service').service('piwik', piwikService);\n\nfunction initPiwikService(piwik, $rootScope) {\n $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl);\n}\n\ninitPiwikService.$inject = ['piwik', '$rootScope'];\n\nangular.module('piwikApp.service').run(initPiwikService);\n","\n\n\n\n\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport default function translate(translationStringId: string, values: string[] = []): string {\n return window._pk_translate(translationStringId, values); // eslint-disable-line\n}\n","\nimport { defineComponent } from 'vue';\nimport translate from '../translate';\n\nexport default defineComponent({\n props: {\n loading: {\n type: Boolean,\n required: true,\n default: false,\n },\n loadingMessage: {\n type: String,\n required: false,\n default: translate('General_LoadingData'),\n },\n },\n});\n","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./ActivityIndicator.vue?vue&type=script&lang=ts\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./ActivityIndicator.vue?vue&type=script&lang=ts\"","import { render } from \"./ActivityIndicator.vue?vue&type=template&id=6af4d064\"\nimport script from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nexport * from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp } from 'vue';\nimport ActivityIndicator from './ActivityIndicator.vue';\nimport translate from '../translate';\n\ninterface ActivityIndicatorAdapterScope extends ng.IScope {\n loading: boolean;\n loadingMessage: string;\n}\n\nexport default function activityIndicatorAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n scope: {\n loading: '<',\n loadingMessage: '<',\n },\n template: '',\n link: function activityIndicatorAdapterLink(\n scope: ActivityIndicatorAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const app = createApp({\n template: '',\n data() {\n return {\n loading: scope.loading,\n loadingMessage: scope.loadingMessage,\n };\n },\n });\n app.component('activity-indicator', ActivityIndicator);\n const vm = app.mount(element[0]);\n\n scope.$watch('loading', (newValue: boolean) => {\n vm.loading = newValue;\n });\n\n scope.$watch('loadingMessage', (newValue: string) => {\n vm.loadingMessage = newValue || translate('General_LoadingData');\n });\n },\n };\n}\n\nactivityIndicatorAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikActivityIndicator', activityIndicatorAdapter);\n","\n\n\n\n\n","\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n props: {\n severity: {\n type: String,\n required: true,\n },\n },\n});\n","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Alert.vue?vue&type=script&lang=ts\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Alert.vue?vue&type=script&lang=ts\"","import { render } from \"./Alert.vue?vue&type=template&id=c3863ae2\"\nimport script from \"./Alert.vue?vue&type=script&lang=ts\"\nexport * from \"./Alert.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp, ref } from 'vue';\nimport Alert from './Alert.vue';\n\ninterface AlertAdapterScope extends ng.IScope {\n severity: string;\n}\n\nexport default function alertAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n transclude: true,\n scope: {\n severity: '@piwikAlert',\n },\n template: '
',\n compile: function alertAdapterCompile() {\n return {\n post: function alertAdapterPostLink(\n scope: AlertAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const clone = element.find('[ng-transclude]');\n\n const app = createApp({\n template: '
',\n data() {\n return { severity: scope.severity };\n },\n setup() {\n const transcludeTarget = ref(null);\n return {\n transcludeTarget,\n };\n },\n });\n app.component('alert', Alert);\n const vm = app.mount(element[0]);\n\n scope.$watch('severity', (newValue: string) => {\n vm.severity = newValue;\n });\n\n $(vm.transcludeTarget).append(clone);\n },\n };\n },\n };\n}\n\nalertAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikAlert', alertAdapter);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport {\n parseDate,\n format,\n getToday,\n todayIsInRange,\n} from './utilities';\n\nexport default class RangePeriod {\n constructor(\n public readonly startDate: Date,\n public readonly endDate: Date,\n public readonly childPeriodType: string,\n ) {}\n\n /**\n * Returns a range representing the last N childPeriodType periods, including the current one.\n */\n static getLastNRange(\n childPeriodType: string,\n strAmount: string|number,\n strEndDate?: Date|string,\n ): RangePeriod {\n const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0);\n if (Number.isNaN(nAmount)) {\n throw new Error('Invalid range strAmount');\n }\n\n let endDate = strEndDate ? parseDate(strEndDate) : getToday();\n\n let startDate = new Date(endDate.getTime());\n if (childPeriodType === 'day') {\n startDate.setDate(startDate.getDate() - nAmount);\n } else if (childPeriodType === 'week') {\n startDate.setDate(startDate.getDate() - (nAmount * 7));\n } else if (childPeriodType === 'month') {\n startDate.setDate(1);\n startDate.setMonth(startDate.getMonth() - nAmount);\n } else if (childPeriodType === 'year') {\n startDate.setFullYear(startDate.getFullYear() - nAmount);\n } else {\n throw new Error(`Unknown period type '${childPeriodType}'.`);\n }\n\n if (childPeriodType !== 'day') {\n const startPeriod = Periods.periods[childPeriodType].parse(startDate);\n const endPeriod = Periods.periods[childPeriodType].parse(endDate);\n\n [startDate] = startPeriod.getDateRange();\n [, endDate] = endPeriod.getDateRange();\n }\n\n const firstWebsiteDate = new Date(1991, 7, 6);\n if (startDate.getTime() - firstWebsiteDate.getTime() < 0) {\n switch (childPeriodType) {\n case 'year':\n startDate = new Date(1992, 0, 1);\n break;\n case 'month':\n startDate = new Date(1991, 8, 1);\n break;\n case 'week':\n startDate = new Date(1991, 8, 12);\n break;\n case 'day':\n default:\n startDate = firstWebsiteDate;\n break;\n }\n }\n\n return new RangePeriod(startDate, endDate, childPeriodType);\n }\n\n static parse(strDate: string, childPeriodType = 'day'): RangePeriod {\n if (/^previous/.test(strDate)) {\n const endDate = RangePeriod.getLastNRange(childPeriodType, '2').startDate;\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate);\n }\n\n if (/^last/.test(strDate)) {\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(4));\n }\n\n const parts = decodeURIComponent(strDate).split(',');\n return new RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType);\n }\n\n static getDisplayText(): string {\n return translate('General_DateRangeInPeriodList');\n }\n\n getPrettyString(): string {\n const start = format(this.startDate);\n const end = format(this.endDate);\n return translate('General_DateRangeFromTo', [start, end]);\n }\n\n getDateRange(): Date[] {\n return [this.startDate, this.endDate];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('range', RangePeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Periods from './Periods';\nimport RangePeriod from './Range';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nwindow.piwik.addCustomPeriod = Periods.addCustomPeriod.bind(Periods);\n\nfunction piwikPeriods() {\n return {\n getAllLabels: Periods.getAllLabels.bind(Periods),\n isRecognizedPeriod: Periods.isRecognizedPeriod.bind(Periods),\n get: Periods.get.bind(Periods),\n parse: Periods.parse.bind(Periods),\n parseDate,\n format,\n RangePeriod,\n todayIsInRange,\n };\n}\n\nangular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class DayPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): DayPeriod {\n return new DayPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodDay');\n }\n\n getPrettyString(): string {\n return format(this.dateInPeriod);\n }\n\n getDateRange(): Date[] {\n return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('day', DayPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class WeekPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): WeekPeriod {\n return new WeekPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodWeek');\n }\n\n getPrettyString(): string {\n const weekDates = this.getDateRange();\n const startWeek = format(weekDates[0]);\n const endWeek = format(weekDates[1]);\n\n return translate('General_DateRangeFromTo', [startWeek, endWeek]);\n }\n\n getDateRange(): Date[] {\n const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7;\n\n const startWeek = new Date(this.dateInPeriod.getTime());\n startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday);\n\n const endWeek = new Date(startWeek.getTime());\n endWeek.setDate(startWeek.getDate() + 6);\n\n return [startWeek, endWeek];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('week', WeekPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class MonthPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): MonthPeriod {\n return new MonthPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodMonth');\n }\n\n getPrettyString(): string {\n const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`);\n return `${month} ${this.dateInPeriod.getFullYear()}`;\n }\n\n getDateRange(): Date[] {\n const startMonth = new Date(this.dateInPeriod.getTime());\n startMonth.setDate(1);\n\n const endMonth = new Date(this.dateInPeriod.getTime());\n endMonth.setDate(1);\n endMonth.setMonth(endMonth.getMonth() + 1);\n endMonth.setDate(0);\n\n return [startMonth, endMonth];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('month', MonthPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class YearPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): YearPeriod {\n return new YearPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodYear');\n }\n\n getPrettyString(): string {\n return this.dateInPeriod.getFullYear().toString();\n }\n\n getDateRange(): Date[] {\n const startYear = new Date(this.dateInPeriod.getTime());\n startYear.setMonth(0);\n startYear.setDate(1);\n\n const endYear = new Date(this.dateInPeriod.getTime());\n endYear.setMonth(12);\n endYear.setDate(0);\n\n return [startYear, endYear];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('year', YearPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport './Periods.adapter';\n\nexport { default as Periods } from './Periods';\nexport { default as Day } from './Day';\nexport { default as Week } from './Week';\nexport { default as Month } from './Month';\nexport { default as Year } from './Year';\nexport { default as Range } from './Range';\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport './AjaxHelper/AjaxHelper.adapter';\nimport './PiwikUrl/PiwikUrl.adapter';\nimport './Piwik/Piwik.adapter';\n\nexport { default as activityIndicatorAdapter } from './ActivityIndicator/ActivityIndicator.adapter';\nexport { default as ActivityIndicator } from './ActivityIndicator/ActivityIndicator.vue';\nexport { default as translate } from './translate';\nexport { default as alertAdapter } from './Alert/Alert.adapter';\nexport { default as AjaxHelper } from './AjaxHelper/AjaxHelper';\nexport { default as PiwikUrl } from './PiwikUrl/PiwikUrl';\nexport { default as Piwik } from './Piwik/Piwik';\nexport * from './Periods';\n","import './setPublicPath'\nexport * from '~entry'\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://CoreHome/webpack/universalModuleDefinition","webpack://CoreHome/webpack/bootstrap","webpack://CoreHome/./plugins/CoreHome/vue/src/noAdblockFlag.ts","webpack://CoreHome/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://CoreHome/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://CoreHome/./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/utilities.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Matomo/Matomo.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/translate.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Day.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Week.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Month.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Year.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Range.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?0bf6","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?f42e","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?6f80","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?14a2","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?92a9","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?cc69","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/index.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/index.ts","webpack://CoreHome/./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;AClFA;;;;;AAKG;AAEH;;AACA,MAAM,CAAC,iBAAP,GAA2B,KAA3B,C;;;;;;;ACRA,mD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AAEA;AACA;AACA,MAAM,KAAuC,EAAE,yBAQ5C;;AAEH;AACA;AACA,IAAI,qBAAuB;AAC3B;AACA;;AAEA;AACe,sDAAI;;;ACrBnB;;;;;AAKG;;AAEH;;;AAGG;AACH,MAAM,SAAS,GAAG;AAChB,gBAAc,CAAC,SAAD,EAAkB;AAC9B,UAAM,IAAI,GAAG,MAAM,CAAC,QAAP,CAAgB,IAAhB,CAAqB,KAAr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A8BD;AAtCI,GAAP;AAwCD;AAED,YAAY,CAAC,OAAb,GAAuB,EAAvB;AAEA,OAAO,CAAC,MAAR,CAAe,UAAf,EAA2B,SAA3B,CAAqC,YAArC,EAAmD,YAAnD,E;;AC3DA;;;;;AAKG;AACH;AAEA;AACA;AACA;AACA;AACA;AACA;;;ACbA;;;;;AAKG;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1BwB;AACF","file":"CoreHome.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CoreHome\"] = factory(require(\"vue\"));\n\telse\n\t\troot[\"CoreHome\"] = factory(root[\"Vue\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n// see https://github.com/matomo-org/matomo/issues/5094 used to detect an ad blocker\nwindow.hasBlockedContent = false;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n/**\n * Similar to angulars $location but works around some limitation. Use it if you need to access\n * search params\n */\nconst MatomoUrl = {\n getSearchParam(paramName: string): string {\n const hash = window.location.href.split('#');\n\n const regex = new RegExp(`${paramName}(\\\\[]|=)`);\n if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) {\n const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href);\n\n // for date, period and idsite fall back to parameter from url, if non in hash was provided\n if (valueFromHash\n || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite')\n ) {\n return valueFromHash;\n }\n }\n\n return window.broadcast.getValueFromUrl(paramName, window.location.search);\n },\n};\n\nexport default MatomoUrl;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport MatomoUrl from './MatomoUrl';\n\nfunction piwikUrl() {\n const model = {\n getSearchParam: MatomoUrl.getSearchParam.bind(MatomoUrl),\n };\n\n return model;\n}\n\npiwikUrl.$inject = [];\n\nangular.module('piwikApp.service').service('piwikUrl', piwikUrl);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\ninterface Period {\n getPrettyString(): string;\n getDateRange(): Date[];\n containsToday(): boolean;\n}\n\ninterface PeriodClass {\n parse(strDate: string|Date): Period;\n getDisplayText(): string;\n}\n\n/**\n * Matomo period management service for the frontend.\n *\n * Usage:\n *\n * var DayPeriod = matomoPeriods.get('day');\n * var day = new DayPeriod(new Date());\n *\n * or\n *\n * var day = matomoPeriods.parse('day', '2013-04-05');\n *\n * Adding custom periods:\n *\n * To add your own period to the frontend, create a period class for it\n * w/ the following methods:\n *\n * - **getPrettyString()**: returns a human readable display string for the period.\n * - **getDateRange()**: returns an array w/ two elements, the first being the start\n * Date of the period, the second being the end Date. The dates\n * must be Date objects, not strings, and are inclusive.\n * - **containsToday()**: returns true if the date period contains today. False if not.\n * - (_static_) **parse(strDate)**: creates a new instance of this period from the\n * value of the 'date' query parameter.\n * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month',\n * 'week', etc.\n *\n * Then call Periods.addCustomPeriod w/ your period class:\n *\n * Periods.addCustomPeriod('mycustomperiod', MyCustomPeriod);\n *\n * NOTE: currently only single date periods like day, week, month year can\n * be extended. Other types of periods that require a special UI to\n * view/edit aren't, since there is currently no way to use a\n * custom UI for a custom period.\n */\nclass Periods {\n periods: {[name: string]: PeriodClass} = {};\n\n periodOrder: string[] = [];\n\n addCustomPeriod(name: string, periodClass: PeriodClass) {\n if (this.periods[name]) {\n throw new Error(`The \"${name}\" period already exists! It cannot be overridden.`);\n }\n\n this.periods[name] = periodClass;\n this.periodOrder.push(name);\n }\n\n getAllLabels(): string[] {\n return Array().concat(this.periodOrder);\n }\n\n get(strPeriod: string): PeriodClass {\n const periodClass = this.periods[strPeriod];\n if (!periodClass) {\n throw new Error(`Invalid period label: ${strPeriod}`);\n }\n return periodClass;\n }\n\n parse(strPeriod: string, strDate: string): Period {\n return this.get(strPeriod).parse(strDate);\n }\n\n isRecognizedPeriod(strPeriod: string): boolean {\n return !!this.periods[strPeriod];\n }\n}\n\nexport default new Periods();\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport function format(date: Date): string {\n return $.datepicker.formatDate('yy-mm-dd', date);\n}\n\nexport function getToday(): Date {\n const date = new Date(Date.now());\n\n // undo browser timezone\n date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n\n // apply Matomo site timezone (if it exists)\n date.setHours(date.getHours() + ((window.piwik.timezoneOffset || 0) / 3600));\n\n // get rid of hours/minutes/seconds/etc.\n date.setHours(0);\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return date;\n}\n\nexport function parseDate(date: string|Date): Date {\n if (date instanceof Date) {\n return date;\n }\n\n const strDate = decodeURIComponent(date);\n\n if (strDate === 'today'\n || strDate === 'now'\n ) {\n return getToday();\n }\n\n if (strDate === 'yesterday'\n // note: ignoring the 'same time' part since the frontend doesn't care about the time\n || strDate === 'yesterdaySameTime'\n ) {\n const yesterday = getToday();\n yesterday.setDate(yesterday.getDate() - 1);\n return yesterday;\n }\n\n if (strDate.match(/last[ -]?week/i)) {\n const lastWeek = getToday();\n lastWeek.setDate(lastWeek.getDate() - 7);\n return lastWeek;\n }\n\n if (strDate.match(/last[ -]?month/i)) {\n const lastMonth = getToday();\n lastMonth.setDate(1);\n lastMonth.setMonth(lastMonth.getMonth() - 1);\n return lastMonth;\n }\n\n if (strDate.match(/last[ -]?year/i)) {\n const lastYear = getToday();\n lastYear.setFullYear(lastYear.getFullYear() - 1);\n return lastYear;\n }\n\n try {\n return $.datepicker.parseDate('yy-mm-dd', strDate);\n } catch (err) {\n // angular swallows this error, so manual console log here\n console.error(err.message || err);\n throw err;\n }\n}\n\nexport function todayIsInRange(dateRange: Date[]): boolean {\n if (dateRange.length !== 2) {\n return false;\n }\n\n if (getToday() >= dateRange[0] && getToday() <= dateRange[1]) {\n return true;\n }\n\n return false;\n}\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport MatomoUrl from '../MatomoUrl/MatomoUrl';\nimport Periods from '../Periods/Periods';\nimport { format } from '../Periods/utilities';\n\nlet originalTitle: string;\n\nconst { piwik, broadcast, piwikHelper } = window;\n\npiwik.helper = piwikHelper;\npiwik.broadcast = broadcast;\n\nfunction isValidPeriod(periodStr: string, dateStr: string) {\n try {\n Periods.parse(periodStr, dateStr);\n return true;\n } catch (e) {\n return false;\n }\n}\n\npiwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() {\n let date = MatomoUrl.getSearchParam('date');\n const period = MatomoUrl.getSearchParam('period');\n if (!isValidPeriod(period, date)) {\n // invalid data in URL\n return;\n }\n\n if (piwik.period === period && piwik.currentDateString === date) {\n // this period / date is already loaded\n return;\n }\n\n piwik.period = period;\n\n const dateRange = Periods.parse(period, date).getDateRange();\n piwik.startDateString = format(dateRange[0]);\n piwik.endDateString = format(dateRange[1]);\n\n piwik.updateDateInTitle(date, period);\n\n // do not set anything to previousN/lastN, as it's more useful to plugins\n // to have the dates than previousN/lastN.\n if (piwik.period === 'range') {\n date = `${piwik.startDateString},${piwik.endDateString}`;\n }\n\n piwik.currentDateString = date;\n};\n\npiwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) {\n if (!$('.top_controls #periodString').length) {\n return;\n }\n\n // Cache server-rendered page title\n originalTitle = originalTitle || document.title;\n\n if (originalTitle.indexOf(piwik.siteName) === 0) {\n const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `;\n document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`;\n }\n};\n\npiwik.hasUserCapability = function hasUserCapability(capability: string) {\n return window.angular.isArray(piwik.userCapabilities)\n && piwik.userCapabilities.indexOf(capability) !== -1;\n};\n\nconst Matomo = piwik;\nexport default Matomo;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Matomo from './Matomo';\n\nfunction piwikService() {\n return Matomo;\n}\n\nangular.module('piwikApp.service').service('piwik', piwikService);\n\nfunction initPiwikService(piwik, $rootScope) {\n $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl);\n}\n\ninitPiwikService.$inject = ['piwik', '$rootScope'];\n\nangular.module('piwikApp.service').run(initPiwikService);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport default function translate(translationStringId: string, values: string[] = []): string {\n return window._pk_translate(translationStringId, values); // eslint-disable-line\n}\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class DayPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): DayPeriod {\n return new DayPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodDay');\n }\n\n getPrettyString(): string {\n return format(this.dateInPeriod);\n }\n\n getDateRange(): Date[] {\n return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('day', DayPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class WeekPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): WeekPeriod {\n return new WeekPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodWeek');\n }\n\n getPrettyString(): string {\n const weekDates = this.getDateRange();\n const startWeek = format(weekDates[0]);\n const endWeek = format(weekDates[1]);\n\n return translate('General_DateRangeFromTo', [startWeek, endWeek]);\n }\n\n getDateRange(): Date[] {\n const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7;\n\n const startWeek = new Date(this.dateInPeriod.getTime());\n startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday);\n\n const endWeek = new Date(startWeek.getTime());\n endWeek.setDate(startWeek.getDate() + 6);\n\n return [startWeek, endWeek];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('week', WeekPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class MonthPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): MonthPeriod {\n return new MonthPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodMonth');\n }\n\n getPrettyString(): string {\n const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`);\n return `${month} ${this.dateInPeriod.getFullYear()}`;\n }\n\n getDateRange(): Date[] {\n const startMonth = new Date(this.dateInPeriod.getTime());\n startMonth.setDate(1);\n\n const endMonth = new Date(this.dateInPeriod.getTime());\n endMonth.setDate(1);\n endMonth.setMonth(endMonth.getMonth() + 1);\n endMonth.setDate(0);\n\n return [startMonth, endMonth];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('month', MonthPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class YearPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): YearPeriod {\n return new YearPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodYear');\n }\n\n getPrettyString(): string {\n return this.dateInPeriod.getFullYear().toString();\n }\n\n getDateRange(): Date[] {\n const startYear = new Date(this.dateInPeriod.getTime());\n startYear.setMonth(0);\n startYear.setDate(1);\n\n const endYear = new Date(this.dateInPeriod.getTime());\n endYear.setMonth(12);\n endYear.setDate(0);\n\n return [startYear, endYear];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('year', YearPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport {\n parseDate,\n format,\n getToday,\n todayIsInRange,\n} from './utilities';\n\nexport default class RangePeriod {\n constructor(\n public readonly startDate: Date,\n public readonly endDate: Date,\n public readonly childPeriodType: string,\n ) {}\n\n /**\n * Returns a range representing the last N childPeriodType periods, including the current one.\n */\n static getLastNRange(\n childPeriodType: string,\n strAmount: string|number,\n strEndDate?: Date|string,\n ): RangePeriod {\n const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0);\n if (Number.isNaN(nAmount)) {\n throw new Error('Invalid range strAmount');\n }\n\n let endDate = strEndDate ? parseDate(strEndDate) : getToday();\n\n let startDate = new Date(endDate.getTime());\n if (childPeriodType === 'day') {\n startDate.setDate(startDate.getDate() - nAmount);\n } else if (childPeriodType === 'week') {\n startDate.setDate(startDate.getDate() - (nAmount * 7));\n } else if (childPeriodType === 'month') {\n startDate.setDate(1);\n startDate.setMonth(startDate.getMonth() - nAmount);\n } else if (childPeriodType === 'year') {\n startDate.setFullYear(startDate.getFullYear() - nAmount);\n } else {\n throw new Error(`Unknown period type '${childPeriodType}'.`);\n }\n\n if (childPeriodType !== 'day') {\n const startPeriod = Periods.periods[childPeriodType].parse(startDate);\n const endPeriod = Periods.periods[childPeriodType].parse(endDate);\n\n [startDate] = startPeriod.getDateRange();\n [, endDate] = endPeriod.getDateRange();\n }\n\n const firstWebsiteDate = new Date(1991, 7, 6);\n if (startDate.getTime() - firstWebsiteDate.getTime() < 0) {\n switch (childPeriodType) {\n case 'year':\n startDate = new Date(1992, 0, 1);\n break;\n case 'month':\n startDate = new Date(1991, 8, 1);\n break;\n case 'week':\n startDate = new Date(1991, 8, 12);\n break;\n case 'day':\n default:\n startDate = firstWebsiteDate;\n break;\n }\n }\n\n return new RangePeriod(startDate, endDate, childPeriodType);\n }\n\n static parse(strDate: string, childPeriodType = 'day'): RangePeriod {\n if (/^previous/.test(strDate)) {\n const endDate = RangePeriod.getLastNRange(childPeriodType, '2').startDate;\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate);\n }\n\n if (/^last/.test(strDate)) {\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(4));\n }\n\n const parts = decodeURIComponent(strDate).split(',');\n return new RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType);\n }\n\n static getDisplayText(): string {\n return translate('General_DateRangeInPeriodList');\n }\n\n getPrettyString(): string {\n const start = format(this.startDate);\n const end = format(this.endDate);\n return translate('General_DateRangeFromTo', [start, end]);\n }\n\n getDateRange(): Date[] {\n return [this.startDate, this.endDate];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('range', RangePeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Periods from './Periods';\nimport RangePeriod from './Range';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nwindow.piwik.addCustomPeriod = Periods.addCustomPeriod.bind(Periods);\n\nfunction piwikPeriods() {\n return {\n getAllLabels: Periods.getAllLabels.bind(Periods),\n isRecognizedPeriod: Periods.isRecognizedPeriod.bind(Periods),\n get: Periods.get.bind(Periods),\n parse: Periods.parse.bind(Periods),\n parseDate,\n format,\n RangePeriod,\n todayIsInRange,\n };\n}\n\nangular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport MatomoUrl from '../MatomoUrl/MatomoUrl';\nimport Matomo from '../Matomo/Matomo';\n\nwindow.globalAjaxQueue = [] as GlobalAjaxQueue;\nwindow.globalAjaxQueue.active = 0;\n\nwindow.globalAjaxQueue.clean = function globalAjaxQueueClean() {\n for (let i = this.length; i >= 0; i -= 1) {\n if (!this[i] || this[i].readyState === 4) {\n this.splice(i, 1);\n }\n }\n};\n\nwindow.globalAjaxQueue.push = function globalAjaxQueuePush(...args: (XMLHttpRequest|null)[]) {\n this.active += args.length;\n\n // cleanup ajax queue\n this.clean();\n\n // call original array push\n return Array.prototype.push.call(this, ...args);\n};\n\nwindow.globalAjaxQueue.abort = function globalAjaxQueueAbort() {\n // abort all queued requests if possible\n this.forEach((x) => x && x.abort && x.abort());\n\n // remove all elements from array\n this.splice(0, this.length);\n\n this.active = 0;\n};\n\ntype ParameterValue = string | number | null | undefined | ParameterValue[];\ntype Parameters = {[name: string]: ParameterValue | Parameters};\ntype AnyFunction = (...params:any[]) => any; // eslint-disable-line\n\n/**\n * error callback to use by default\n */\nfunction defaultErrorCallback(deferred: XMLHttpRequest, status: string): void {\n // do not display error message if request was aborted\n if (status === 'abort') {\n return;\n }\n\n const loadingError = $('#loadingError');\n if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) {\n if (deferred && deferred.status === 500) {\n $(document.body).html(piwikHelper.escape(deferred.responseText));\n }\n } else {\n loadingError.show();\n }\n}\n\n/**\n * Global ajax helper to handle requests within Matomo\n */\nexport default class AjaxHelper {\n /**\n * Format of response\n */\n format = 'json';\n\n /**\n * A timeout for the request which will override any global timeout\n */\n timeout = null;\n\n /**\n * Callback function to be executed on success\n */\n callback: AnyFunction = null;\n\n /**\n * Use this.callback if an error is returned\n */\n useRegularCallbackInCaseOfError = false;\n\n /**\n * Callback function to be executed on error\n *\n * @deprecated use the jquery promise API\n */\n errorCallback: AnyFunction;\n\n withToken = false;\n\n /**\n * Callback function to be executed on complete (after error or success)\n *\n * @deprecated use the jquery promise API\n */\n completeCallback: AnyFunction;\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultGetParams\n */\n getParams: Parameters = {};\n\n /**\n * Base URL used in the AJAX request. Can be set by setUrl.\n *\n * It is set to '?' rather than 'index.php?' to increase chances that it works\n * including for users who have an automatic 301 redirection from index.php? to ?\n * POST values are missing when there is such 301 redirection. So by by-passing\n * this 301 redirection, we avoid this issue.\n *\n * @see ajaxHelper.setUrl\n */\n getUrl = '?';\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultPostParams\n */\n postParams: Parameters = {};\n\n /**\n * Element to be displayed while loading\n */\n loadingElement: HTMLElement|null|JQuery|JQLite|string = null;\n\n /**\n * Element to be displayed on error\n */\n errorElement: HTMLElement|JQuery|JQLite|string = '#ajaxError';\n\n /**\n * Handle for current request\n */\n requestHandle: XMLHttpRequest|JQuery.jqXHR|null = null;\n\n defaultParams = ['idSite', 'period', 'date', 'segment'];\n\n constructor() {\n this.errorCallback = defaultErrorCallback;\n }\n\n /**\n * Adds params to the request.\n * If params are given more then once, the latest given value is used for the request\n *\n * @param params\n * @param type type of given parameters (POST or GET)\n * @return {void}\n */\n addParams(params: Parameters|string, type: string): void {\n if (typeof params === 'string') {\n // TODO: add global types for broadcast (multiple uses below)\n params = window['broadcast'].getValuesFromUrl(params); // eslint-disable-line\n }\n\n const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates'];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n if (arrayParams.indexOf(key) !== -1\n && !value\n ) {\n return;\n }\n\n if (type.toLowerCase() === 'get') {\n this.getParams[key] = value;\n } else if (type.toLowerCase() === 'post') {\n this.postParams[key] = value;\n }\n });\n }\n\n withTokenInUrl(): void {\n this.withToken = true;\n }\n\n /**\n * Sets the base URL to use in the AJAX request.\n */\n setUrl(url: string): void {\n this.addParams(broadcast.getValuesFromUrl(url), 'GET');\n }\n\n /**\n * Gets this helper instance ready to send a bulk request. Each argument to this\n * function is a single request to use.\n */\n setBulkRequests(...urls: string[]): void {\n const urlsProcessed = urls.map((u) => $.param(u));\n\n this.addParams({\n module: 'API',\n method: 'API.getBulkRequest',\n urls: urlsProcessed,\n format: 'json',\n }, 'post');\n }\n\n /**\n * Set a timeout (in milliseconds) for the request. This will override any global timeout.\n *\n * @param timeout Timeout in milliseconds\n */\n setTimeout(timeout: number): void {\n this.timeout = timeout;\n }\n\n /**\n * Sets the callback called after the request finishes\n *\n * @param callback Callback function\n * @deprecated use the jquery promise API\n */\n setCallback(callback: AnyFunction): void {\n this.callback = callback;\n }\n\n /**\n * Set that the callback passed to setCallback() should be used if an application error (i.e. an\n * Exception in PHP) is returned.\n */\n useCallbackInCaseOfError(): void {\n this.useRegularCallbackInCaseOfError = true;\n }\n\n /**\n * Set callback to redirect on success handler\n * &update=1(+x) will be appended to the current url\n *\n * @param [params] to modify in redirect url\n * @return {void}\n */\n redirectOnSuccess(params: Parameters): void {\n this.setCallback(() => {\n piwikHelper.redirect(params);\n });\n }\n\n /**\n * Sets the callback called in case of an error within the request\n *\n * @deprecated use the jquery promise API\n */\n setErrorCallback(callback: AnyFunction): void {\n this.errorCallback = callback;\n }\n\n /**\n * Sets the complete callback which is called after an error or success callback.\n *\n * @deprecated use the jquery promise API\n */\n setCompleteCallback(callback: AnyFunction): void {\n this.completeCallback = callback;\n }\n\n /**\n * Sets the response format for the request\n *\n * @param format response format (e.g. json, html, ...)\n */\n setFormat(format: string): void {\n this.format = format;\n }\n\n /**\n * Set the div element to show while request is loading\n *\n * @param [element] selector for the loading element\n */\n setLoadingElement(element: string|HTMLElement|JQuery): void {\n this.loadingElement = element || '#ajaxLoadingDiv';\n }\n\n /**\n * Set the div element to show on error\n *\n * @param element selector for the error element\n */\n setErrorElement(element: HTMLElement|JQuery|string): void {\n if (!element) {\n return;\n }\n this.errorElement = element;\n }\n\n /**\n * Detect whether are allowed to use the given default parameter or not\n */\n private useGETDefaultParameter(parameter: string): boolean {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Removes a default parameter that is usually send automatically along the request.\n *\n * @param parameter A name such as \"period\", \"date\", \"segment\".\n */\n removeDefaultParameter(parameter: string): void {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n this.defaultParams.splice(i, 1);\n }\n }\n }\n }\n\n /**\n * Send the request\n */\n send(): JQuery.jqXHR {\n if ($(this.errorElement).length) {\n $(this.errorElement).hide();\n }\n\n if (this.loadingElement) {\n $(this.loadingElement).fadeIn();\n }\n\n this.requestHandle = this.buildAjaxCall();\n globalAjaxQueue.push(this.requestHandle);\n\n return this.requestHandle;\n }\n\n /**\n * Aborts the current request if it is (still) running\n */\n abort(): void {\n if (this.requestHandle && typeof this.requestHandle.abort === 'function') {\n this.requestHandle.abort();\n this.requestHandle = null;\n }\n }\n\n /**\n * Builds and sends the ajax requests\n */\n private buildAjaxCall(): JQuery.jqXHR {\n const self = this;\n const parameters = this.mixinDefaultGetParams(this.getParams);\n\n let url = this.getUrl;\n if (url[url.length - 1] !== '?') {\n url += '&';\n }\n\n // we took care of encoding &segment properly already, so we don't use $.param for it ($.param\n // URL encodes the values)\n if (parameters.segment) {\n url = `${url}segment=${parameters.segment}&`;\n delete parameters.segment;\n }\n if (parameters.date) {\n url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`;\n delete parameters.date;\n }\n url += $.param(parameters);\n const ajaxCall = {\n type: 'POST',\n async: true,\n url,\n dataType: this.format || 'json',\n complete: this.completeCallback,\n error: function errorCallback() {\n globalAjaxQueue.active -= 1;\n\n if (self.errorCallback) {\n self.errorCallback.apply(this, arguments); // eslint-disable-line\n }\n },\n success: (response, status, request) => {\n if (this.loadingElement) {\n $(this.loadingElement).hide();\n }\n\n if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) {\n let placeAt = null;\n let type = 'toast';\n if ($(this.errorElement).length && response.message) {\n $(this.errorElement).show();\n placeAt = this.errorElement;\n type = null;\n }\n\n if (response.message) {\n const UI = window['require']('piwik/UI'); // eslint-disable-line\n const notification = new UI.Notification();\n notification.show(response.message, {\n placeat: placeAt,\n context: 'error',\n type,\n id: 'ajaxHelper',\n });\n notification.scrollToNotification();\n }\n } else if (this.callback) {\n this.callback(response, status, request);\n }\n\n globalAjaxQueue.active -= 1;\n if (Matomo.ajaxRequestFinished) {\n Matomo.ajaxRequestFinished();\n }\n },\n data: this.mixinDefaultPostParams(this.postParams),\n timeout: this.timeout !== null ? this.timeout : undefined,\n };\n\n return $.ajax(ajaxCall);\n }\n\n private isRequestToApiMethod() {\n return (this.getParams && this.getParams.module === 'API' && this.getParams.method)\n || (this.postParams && this.postParams.module === 'API' && this.postParams.method);\n }\n\n isWidgetizedRequest(): boolean {\n return (broadcast.getValueFromUrl('module') === 'Widgetize');\n }\n\n private getDefaultPostParams() {\n if (this.withToken || this.isRequestToApiMethod() || Matomo.shouldPropagateTokenAuth) {\n return {\n token_auth: Matomo.token_auth,\n // When viewing a widgetized report there won't be any session that can be used, so don't\n // force session usage\n force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1,\n };\n }\n\n return {};\n }\n\n /**\n * Mixin the default parameters to send as POST\n *\n * @param params parameter object\n */\n private mixinDefaultPostParams(params): Parameters {\n const defaultParams = this.getDefaultPostParams();\n\n const mergedParams = {\n ...defaultParams,\n ...params,\n };\n\n return mergedParams;\n }\n\n /**\n * Mixin the default parameters to send as GET\n *\n * @param params parameter object\n */\n private mixinDefaultGetParams(originalParams): Parameters {\n const segment = MatomoUrl.getSearchParam('segment');\n\n const defaultParams = {\n idSite: Matomo.idSite || broadcast.getValueFromUrl('idSite'),\n period: Matomo.period || broadcast.getValueFromUrl('period'),\n segment,\n };\n\n const params = originalParams;\n\n // never append token_auth to url\n if (params.token_auth) {\n params.token_auth = null;\n delete params.token_auth;\n }\n\n Object.keys(defaultParams).forEach((key) => {\n if (this.useGETDefaultParameter(key)\n && !params[key]\n && !this.postParams[key]\n && defaultParams[key]\n ) {\n params[key] = defaultParams[key];\n }\n });\n\n // handle default date & period if not already set\n if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) {\n params.date = Matomo.currentDateString;\n }\n\n return params;\n }\n}\n","import AjaxHelper from './AjaxHelper';\n\ndeclare global {\n interface Window {\n ajaxHelper: AjaxHelper;\n }\n}\n\nwindow.ajaxHelper = AjaxHelper;\n\nfunction ajaxQueue() {\n return globalAjaxQueue;\n}\n\nangular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n/**\n * Similar to angulars $location but works around some limitation. Use it if you need to access\n * search params\n */\nconst PiwikUrl = {\n getSearchParam(paramName: string): string {\n const hash = window.location.href.split('#');\n\n const regex = new RegExp(`${paramName}(\\\\[]|=)`);\n if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) {\n const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href);\n\n // for date, period and idsite fall back to parameter from url, if non in hash was provided\n if (valueFromHash\n || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite')\n ) {\n return valueFromHash;\n }\n }\n\n return window.broadcast.getValueFromUrl(paramName, window.location.search);\n },\n};\n\nexport default PiwikUrl;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport PiwikUrl from './PiwikUrl';\n\nfunction piwikUrl() {\n const model = {\n getSearchParam: PiwikUrl.getSearchParam.bind(PiwikUrl),\n };\n\n return model;\n}\n\npiwikUrl.$inject = [];\n\nangular.module('piwikApp.service').service('piwikUrl', piwikUrl);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport PiwikUrl from '../PiwikUrl/PiwikUrl';\nimport Periods from '../Periods/Periods';\nimport { format } from '../Periods/utilities';\n\nlet originalTitle: string;\n\nconst { piwik, broadcast, piwikHelper } = window;\n\npiwik.helper = piwikHelper;\npiwik.broadcast = broadcast;\n\nfunction isValidPeriod(periodStr: string, dateStr: string) {\n try {\n Periods.parse(periodStr, dateStr);\n return true;\n } catch (e) {\n return false;\n }\n}\n\npiwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() {\n let date = PiwikUrl.getSearchParam('date');\n const period = PiwikUrl.getSearchParam('period');\n if (!isValidPeriod(period, date)) {\n // invalid data in URL\n return;\n }\n\n if (piwik.period === period && piwik.currentDateString === date) {\n // this period / date is already loaded\n return;\n }\n\n piwik.period = period;\n\n const dateRange = Periods.parse(period, date).getDateRange();\n piwik.startDateString = format(dateRange[0]);\n piwik.endDateString = format(dateRange[1]);\n\n piwik.updateDateInTitle(date, period);\n\n // do not set anything to previousN/lastN, as it's more useful to plugins\n // to have the dates than previousN/lastN.\n if (piwik.period === 'range') {\n date = `${piwik.startDateString},${piwik.endDateString}`;\n }\n\n piwik.currentDateString = date;\n};\n\npiwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) {\n if (!$('.top_controls #periodString').length) {\n return;\n }\n\n // Cache server-rendered page title\n originalTitle = originalTitle || document.title;\n\n if (originalTitle.indexOf(piwik.siteName) === 0) {\n const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `;\n document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`;\n }\n};\n\npiwik.hasUserCapability = function hasUserCapability(capability: string) {\n return window.angular.isArray(piwik.userCapabilities)\n && piwik.userCapabilities.indexOf(capability) !== -1;\n};\n\nconst Piwik = piwik;\nexport default Piwik;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Piwik from './Piwik';\n\nfunction piwikService() {\n return Piwik;\n}\n\nangular.module('piwikApp.service').service('piwik', piwikService);\n\nfunction initPiwikService(piwik, $rootScope) {\n $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl);\n}\n\ninitPiwikService.$inject = ['piwik', '$rootScope'];\n\nangular.module('piwikApp.service').run(initPiwikService);\n","\n\n\n\n\n","\nimport { defineComponent } from 'vue';\nimport translate from '../translate';\n\nexport default defineComponent({\n props: {\n loading: {\n type: Boolean,\n required: true,\n default: false,\n },\n loadingMessage: {\n type: String,\n required: false,\n default: translate('General_LoadingData'),\n },\n },\n});\n","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./ActivityIndicator.vue?vue&type=script&lang=ts\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./ActivityIndicator.vue?vue&type=script&lang=ts\"","import { render } from \"./ActivityIndicator.vue?vue&type=template&id=6af4d064\"\nimport script from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nexport * from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp } from 'vue';\nimport ActivityIndicator from './ActivityIndicator.vue';\nimport translate from '../translate';\n\ninterface ActivityIndicatorAdapterScope extends ng.IScope {\n loading: boolean;\n loadingMessage: string;\n}\n\nexport default function activityIndicatorAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n scope: {\n loading: '<',\n loadingMessage: '<',\n },\n template: '',\n link: function activityIndicatorAdapterLink(\n scope: ActivityIndicatorAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const app = createApp({\n template: '',\n data() {\n return {\n loading: scope.loading,\n loadingMessage: scope.loadingMessage,\n };\n },\n });\n app.config.globalProperties.$sanitize = window.vueSanitize;\n app.component('activity-indicator', ActivityIndicator);\n const vm = app.mount(element[0]);\n\n scope.$watch('loading', (newValue: boolean) => {\n vm.loading = newValue;\n });\n\n scope.$watch('loadingMessage', (newValue: string) => {\n vm.loadingMessage = newValue || translate('General_LoadingData');\n });\n },\n };\n}\n\nactivityIndicatorAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikActivityIndicator', activityIndicatorAdapter);\n","\n\n\n\n\n","\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n props: {\n severity: {\n type: String,\n required: true,\n },\n },\n});\n","export { default } from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Alert.vue?vue&type=script&lang=ts\"; export * from \"-!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--0-1!./Alert.vue?vue&type=script&lang=ts\"","import { render } from \"./Alert.vue?vue&type=template&id=c3863ae2\"\nimport script from \"./Alert.vue?vue&type=script&lang=ts\"\nexport * from \"./Alert.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp, ref } from 'vue';\nimport Alert from './Alert.vue';\n\ninterface AlertAdapterScope extends ng.IScope {\n severity: string;\n}\n\nexport default function alertAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n transclude: true,\n scope: {\n severity: '@piwikAlert',\n },\n template: '
',\n compile: function alertAdapterCompile() {\n return {\n post: function alertAdapterPostLink(\n scope: AlertAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const clone = element.find('[ng-transclude]');\n\n const app = createApp({\n template: '
',\n data() {\n return { severity: scope.severity };\n },\n setup() {\n const transcludeTarget = ref(null);\n return {\n transcludeTarget,\n };\n },\n });\n app.config.globalProperties.$sanitize = window.vueSanitize;\n app.component('alert', Alert);\n const vm = app.mount(element[0]);\n\n scope.$watch('severity', (newValue: string) => {\n vm.severity = newValue;\n });\n\n $(vm.transcludeTarget).append(clone);\n },\n };\n },\n };\n}\n\nalertAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikAlert', alertAdapter);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport './Periods.adapter';\n\nexport { default as Periods } from './Periods';\nexport { default as Day } from './Day';\nexport { default as Week } from './Week';\nexport { default as Month } from './Month';\nexport { default as Year } from './Year';\nexport { default as Range } from './Range';\nexport * from './utilities';\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport './MatomoUrl/MatomoUrl.adapter';\nimport './Matomo/Matomo.adapter';\nimport './noAdblockFlag';\nimport './Periods/Day';\nimport './Periods/Week';\nimport './Periods/Month';\nimport './Periods/Year';\nimport './Periods/Range';\nimport './Periods/Periods.adapter';\nimport './AjaxHelper/AjaxHelper.adapter';\nimport './PiwikUrl/PiwikUrl.adapter';\nimport './Piwik/Piwik.adapter';\n\nexport { default as activityIndicatorAdapter } from './ActivityIndicator/ActivityIndicator.adapter';\nexport { default as ActivityIndicator } from './ActivityIndicator/ActivityIndicator.vue';\nexport { default as translate } from './translate';\nexport { default as alertAdapter } from './Alert/Alert.adapter';\nexport { default as AjaxHelper } from './AjaxHelper/AjaxHelper';\nexport { default as MatomoUrl } from './MatomoUrl/MatomoUrl';\nexport { default as Matomo } from './Matomo/Matomo';\nexport * from './Periods';\n","import './setPublicPath'\nexport * from '~entry'\n"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 7827d9f24e..e38213d54f 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -1,101 +1,132 @@ -(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])} +(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")}({2342:function(e,t,r){"use strict"; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */window.hasBlockedContent=!1},"8bbf":function(t,r){t.exports=e},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"activityIndicatorAdapter",(function(){return ie})),r.d(t,"ActivityIndicator",(function(){return ne})),r.d(t,"translate",(function(){return S})),r.d(t,"alertAdapter",(function(){return ue})),r.d(t,"AjaxHelper",(function(){return q})),r.d(t,"MatomoUrl",(function(){return o})),r.d(t,"Matomo",(function(){return D})),r.d(t,"Periods",(function(){return d})),r.d(t,"Day",(function(){return I})),r.d(t,"Week",(function(){return C})),r.d(t,"Month",(function(){return A})),r.d(t,"Year",(function(){return R})),r.d(t,"Range",(function(){return M})),r.d(t,"format",(function(){return c})),r.d(t,"getToday",(function(){return g})),r.d(t,"parseDate",(function(){return p})),r.d(t,"todayIsInRange",(function(){return h})),"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} +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; /*! * 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{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} + */function s(){const e={getSearchParam:o.getSearchParam.bind(o)};return e}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 - */ -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} + */s.$inject=[],angular.module("piwikApp.service").service("piwikUrl",s);class u{constructor(){l(this,"periods",{}),l(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 d=new 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 c(e){return $.datepicker.formatDate("yy-mm-dd",e)}function g(){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 p(e){if(e instanceof Date)return e;const t=decodeURIComponent(e);if("today"===t||"now"===t)return g();if("yesterday"===t||"yesterdaySameTime"===t){const e=g();return e.setDate(e.getDate()-1),e}if(t.match(/last[ -]?week/i)){const e=g();return e.setDate(e.getDate()-7),e}if(t.match(/last[ -]?month/i)){const e=g();return e.setDate(1),e.setMonth(e.getMonth()-1),e}if(t.match(/last[ -]?year/i)){const e=g();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 h(e){return 2===e.length&&(g()>=e[0]&&g()<=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 m;const{piwik:f,broadcast:w,piwikHelper:b}=window;function P(e,t){try{return d.parse(e,t),!0}catch(r){return!1}}f.helper=b,f.broadcast=w,f.updatePeriodParamsFromUrl=function(){let e=o.getSearchParam("date");const t=o.getSearchParam("period");if(!P(t,e))return;if(f.period===t&&f.currentDateString===e)return;f.period=t;const r=d.parse(t,e).getDateRange();f.startDateString=c(r[0]),f.endDateString=c(r[1]),f.updateDateInTitle(e,t),"range"===f.period&&(e=`${f.startDateString},${f.endDateString}`),f.currentDateString=e},f.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(m=m||document.title,0===m.indexOf(f.siteName))){const r=` - ${d.parse(t,e).getPrettyString()} `;document.title=`${f.siteName}${r}${m.substr(f.siteName.length)}`}},f.hasUserCapability=function(e){return window.angular.isArray(f.userCapabilities)&&-1!==f.userCapabilities.indexOf(e)};const y=f;var D=y; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function v(){return D}function k(e,t){t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}angular.module("piwikApp.service").service("piwik",v),k.$inject=["piwik","$rootScope"],angular.module("piwikApp.service").run(k);r("2342"); /*! * 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; + */function S(e,t=[]){return window._pk_translate(e,t)}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 - */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])} + */class I{constructor(e){j(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new I(p(e))}static getDisplayText(){return S("Intl_PeriodDay")}getPrettyString(){return c(this.dateInPeriod)}getDateRange(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}containsToday(){return h(this.getDateRange())}}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 - */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; + */d.addCustomPeriod("day",I);class C{constructor(e){T(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new C(p(e))}static getDisplayText(){return S("Intl_PeriodWeek")}getPrettyString(){const e=this.getDateRange(),t=c(e[0]),r=c(e[1]);return S("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 h(this.getDateRange())}}function x(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 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]])} + */d.addCustomPeriod("week",C);class A{constructor(e){x(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new A(p(e))}static getDisplayText(){return S("Intl_PeriodMonth")}getPrettyString(){const e=S("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 h(this.getDateRange())}}function O(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 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; + */d.addCustomPeriod("month",A);class R{constructor(e){O(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new R(p(e))}static getDisplayText(){return S("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 h(this.getDateRange())}}function E(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 _(){return{restrict:"A",scope:{loading:"<",loadingMessage:"<"},template:"",link:function(e,t){const r=Object(x["createApp"])({template:'',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; + */d.addCustomPeriod("year",R);class M{constructor(e,t,r){E(this,"startDate",void 0),E(this,"endDate",void 0),E(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?p(r):g(),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=d.periods[e].parse(i),r=d.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 M(i,n,e)}static parse(e,t="day"){if(/^previous/.test(e)){const r=M.getLastNRange(t,"2").startDate;return M.getLastNRange(t,e.substring(8),r)}if(/^last/.test(e))return M.getLastNRange(t,e.substring(4));const r=decodeURIComponent(e).split(",");return new M(p(r[0]),p(r[1]),t)}static getDisplayText(){return S("General_DateRangeInPeriodList")}getPrettyString(){const e=c(this.startDate),t=c(this.endDate);return S("General_DateRangeFromTo",[e,t])}getDateRange(){return[this.startDate,this.endDate]}containsToday(){return h(this.getDateRange())}}function _(){return{getAllLabels:d.getAllLabels.bind(d),isRecognizedPeriod:d.isRecognizedPeriod.bind(d),get:d.get.bind(d),parse:d.parse.bind(d),parseDate:p,format:c,RangePeriod:M,todayIsInRange:h}}function U(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 H(){return{restrict:"A",transclude:!0,scope:{severity:"@piwikAlert"},template:"
",compile:function(){return{post:function(e,t){const r=t.find("[ng-transclude]"),a=Object(x["createApp"])({template:'
',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} + */function F(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()}d.addCustomPeriod("range",M), /*! * 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} + */ +window.piwik.addCustomPeriod=d.addCustomPeriod.bind(d),angular.module("piwikApp.service").factory("piwikPeriods",_),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 q{constructor(){U(this,"format","json"),U(this,"timeout",null),U(this,"callback",null),U(this,"useRegularCallbackInCaseOfError",!1),U(this,"errorCallback",void 0),U(this,"withToken",!1),U(this,"completeCallback",void 0),U(this,"getParams",{}),U(this,"getUrl","?"),U(this,"postParams",{}),U(this,"loadingElement",null),U(this,"errorElement","#ajaxError"),U(this,"requestHandle",null),U(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=F}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{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,D.ajaxRequestFinished&&D.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()||D.shouldPropagateTokenAuth?{token_auth:D.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:D.idSite||broadcast.getValueFromUrl("idSite"),period:D.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=D.currentDateString),a}}function H(){return globalAjaxQueue}window.ajaxHelper=q,angular.module("piwikApp.service").service("globalAjaxQueue",H); +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +const N={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 L=N; /*! * 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), + */function z(){const e={getSearchParam:L.getSearchParam.bind(L)};return 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.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} +let V;z.$inject=[],angular.module("piwikApp.service").service("piwikUrl",z);const{piwik:G,broadcast:Q,piwikHelper:B}=window;function Y(e,t){try{return d.parse(e,t),!0}catch(r){return!1}}G.helper=B,G.broadcast=Q,G.updatePeriodParamsFromUrl=function(){let e=L.getSearchParam("date");const t=L.getSearchParam("period");if(!Y(t,e))return;if(G.period===t&&G.currentDateString===e)return;G.period=t;const r=d.parse(t,e).getDateRange();G.startDateString=c(r[0]),G.endDateString=c(r[1]),G.updateDateInTitle(e,t),"range"===G.period&&(e=`${G.startDateString},${G.endDateString}`),G.currentDateString=e},G.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(V=V||document.title,0===V.indexOf(G.siteName))){const r=` - ${d.parse(t,e).getPrettyString()} `;document.title=`${G.siteName}${r}${V.substr(G.siteName.length)}`}},G.hasUserCapability=function(e){return window.angular.isArray(G.userCapabilities)&&-1!==G.userCapabilities.indexOf(e)};const W=G;var J=W; /*! * 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} + */function K(){return J}function X(e,t){t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}angular.module("piwikApp.service").service("piwik",K),X.$inject=["piwik","$rootScope"],angular.module("piwikApp.service").run(X);var Z=r("8bbf");const ee={class:"loadingPiwik"},te=Object(Z["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function re(e,t,r,a,n,i){return Object(Z["withDirectives"])((Object(Z["openBlock"])(),Object(Z["createElementBlock"])("div",ee,[te,Object(Z["createElementVNode"])("span",null,Object(Z["toDisplayString"])(e.loadingMessage),1)],512)),[[Z["vShow"],e.loading]])}var ae=Object(Z["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:S("General_LoadingData")}}});ae.render=re;var ne=ae; /*! * 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} + */function ie(){return{restrict:"A",scope:{loading:"<",loadingMessage:"<"},template:"",link:function(e,t){const r=Object(Z["createApp"])({template:'',data(){return{loading:e.loading,loadingMessage:e.loadingMessage}}});r.config.globalProperties.$sanitize=window.vueSanitize,r.component("activity-indicator",ne);const a=r.mount(t[0]);e.$watch("loading",e=>{a.loading=e}),e.$watch("loadingMessage",e=>{a.loadingMessage=e||S("General_LoadingData")})}}}function oe(e,t,r,a,n,i){return Object(Z["openBlock"])(),Object(Z["createElementBlock"])("div",{class:Object(Z["normalizeClass"])(["alert",{["alert-"+e.severity]:!0}])},[Object(Z["renderSlot"])(e.$slots,"default")],2)}ie.$inject=[],angular.module("piwikApp").directive("piwikActivityIndicator",ie);var se=Object(Z["defineComponent"])({props:{severity:{type:String,required:!0}}});se.render=oe;var le=se; /*! * 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)}})})); + */function ue(){return{restrict:"A",transclude:!0,scope:{severity:"@piwikAlert"},template:"
",compile:function(){return{post:function(e,t){const r=t.find("[ng-transclude]"),a=Object(Z["createApp"])({template:'
',data(){return{severity:e.severity}},setup(){const e=Object(Z["ref"])(null);return{transcludeTarget:e}}});a.config.globalProperties.$sanitize=window.vueSanitize,a.component("alert",le);const n=a.mount(t[0]);e.$watch("severity",e=>{n.severity=e}),$(n.transcludeTarget).append(r)}}}}}ue.$inject=[],angular.module("piwikApp").directive("piwikAlert",ue)}})})); //# sourceMappingURL=CoreHome.umd.min.js.map \ No newline at end of file diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js.map b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js.map index 84e80fadec..900c1088ea 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js.map +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://CoreHome/webpack/universalModuleDefinition","webpack://CoreHome/webpack/bootstrap","webpack://CoreHome/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://CoreHome/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/utilities.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/translate.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?0bf6","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?6f80","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?14a2","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?cc69","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Range.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Day.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Week.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Month.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Year.ts"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__8bbf__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","currentScript","document","src","match","PiwikUrl","paramName","hash","location","href","split","regex","RegExp","test","decodeURIComponent","valueFromHash","broadcast","getValueFromHash","getValueFromUrl","search","defaultErrorCallback","deferred","status","loadingError","$","Piwik_Popover","isOpen","body","html","piwikHelper","escape","responseText","show","globalAjaxQueue","active","clean","length","readyState","splice","push","args","Array","abort","forEach","x","errorCallback","params","type","getValuesFromUrl","arrayParams","keys","indexOf","toLowerCase","getParams","postParams","withToken","url","addParams","urls","urlsProcessed","map","u","param","method","format","timeout","callback","useRegularCallbackInCaseOfError","setCallback","redirect","completeCallback","element","loadingElement","errorElement","parameter","defaultParams","hide","fadeIn","requestHandle","buildAjaxCall","parameters","mixinDefaultGetParams","getUrl","segment","date","toString","ajaxCall","async","dataType","complete","error","apply","arguments","success","response","request","result","placeAt","message","UI","notification","Notification","placeat","context","id","scrollToNotification","piwik","ajaxRequestFinished","data","mixinDefaultPostParams","undefined","ajax","isRequestToApiMethod","shouldPropagateTokenAuth","token_auth","force_api_session","isWidgetizeRequestWithoutSession","getDefaultPostParams","mergedParams","originalParams","getSearchParam","idSite","period","useGETDefaultParameter","currentDateString","ajaxQueue","piwikUrl","model","ajaxHelper","angular","service","$inject","Periods","periodClass","periods","Error","periodOrder","concat","strPeriod","strDate","parse","datepicker","formatDate","getToday","Date","now","setTime","getTime","getTimezoneOffset","setHours","getHours","timezoneOffset","setMinutes","setSeconds","setMilliseconds","parseDate","yesterday","setDate","getDate","lastWeek","lastMonth","setMonth","getMonth","lastYear","setFullYear","getFullYear","err","console","todayIsInRange","dateRange","originalTitle","isValidPeriod","periodStr","dateStr","e","helper","updatePeriodParamsFromUrl","getDateRange","startDateString","endDateString","updateDateInTitle","title","siteName","dateString","getPrettyString","substr","hasUserCapability","capability","isArray","userCapabilities","Piwik","piwikService","initPiwikService","$rootScope","$on","run","class","alt","loadingMessage","loading","translate","translationStringId","values","_pk_translate","props","Boolean","required","default","String","render","activityIndicatorAdapter","restrict","scope","template","link","app","component","ActivityIndicator","vm","mount","$watch","newValue","severity","directive","alertAdapter","transclude","compile","post","clone","find","transcludeTarget","Alert","append","startDate","endDate","childPeriodType","strAmount","strEndDate","nAmount","Math","max","parseInt","Number","isNaN","startPeriod","endPeriod","firstWebsiteDate","getLastNRange","substring","parts","start","end","piwikPeriods","getAllLabels","isRecognizedPeriod","RangePeriod","addCustomPeriod","dateInPeriod","weekDates","startWeek","endWeek","daysToMonday","getDay","month","startMonth","endMonth","startYear","endYear"],"mappings":"CAAA,SAA2CA,EAAMC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I,EAAWgB,EAAUhB,IAGb,wBACnB,OAAO6D,EAAU,mBAGnB,kBACE,OAAO7O,KAAKsS,aAAa5F,cAAchF,WAGzC,eACE,MAAMqL,EAAY,IAAI1H,KAAKrL,KAAKsS,aAAa9G,WAC7CuH,EAAUzG,SAAS,GACnByG,EAAU7G,QAAQ,GAElB,MAAM8G,EAAU,IAAI3H,KAAKrL,KAAKsS,aAAa9G,WAI3C,OAHAwH,EAAQ1G,SAAS,IACjB0G,EAAQ9G,QAAQ,GAET,CAAC6G,EAAWC,GAGrB,gBACE,OAAOnG,EAAe7M,KAAKsN,iBAI/B,EAAQ+E,gBAAgB,OAAQ","file":"CoreHome.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CoreHome\"] = factory(require(\"vue\"));\n\telse\n\t\troot[\"CoreHome\"] = factory(root[\"Vue\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n/**\n * Similar to angulars $location but works around some limitation. Use it if you need to access\n * search params\n */\nconst PiwikUrl = {\n getSearchParam(paramName: string): string {\n const hash = window.location.href.split('#');\n\n const regex = new RegExp(`${paramName}(\\\\[]|=)`);\n if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) {\n const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href);\n\n // for date, period and idsite fall back to parameter from url, if non in hash was provided\n if (valueFromHash\n || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite')\n ) {\n return valueFromHash;\n }\n }\n\n return window.broadcast.getValueFromUrl(paramName, window.location.search);\n },\n};\n\nexport default PiwikUrl;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport PiwikUrl from '../PiwikUrl/PiwikUrl';\n\nwindow.globalAjaxQueue = [] as GlobalAjaxQueue;\nwindow.globalAjaxQueue.active = 0;\n\nwindow.globalAjaxQueue.clean = function globalAjaxQueueClean() {\n for (let i = this.length; i >= 0; i -= 1) {\n if (!this[i] || this[i].readyState === 4) {\n this.splice(i, 1);\n }\n }\n};\n\nwindow.globalAjaxQueue.push = function globalAjaxQueuePush(...args: (XMLHttpRequest|null)[]) {\n this.active += args.length;\n\n // cleanup ajax queue\n this.clean();\n\n // call original array push\n return Array.prototype.push.call(this, ...args);\n};\n\nwindow.globalAjaxQueue.abort = function globalAjaxQueueAbort() {\n // abort all queued requests if possible\n this.forEach((x) => x && x.abort && x.abort());\n\n // remove all elements from array\n this.splice(0, this.length);\n\n this.active = 0;\n};\n\ntype ParameterValue = string | number | null | undefined | ParameterValue[];\ntype Parameters = {[name: string]: ParameterValue | Parameters};\ntype AnyFunction = (...params:any[]) => any; // eslint-disable-line\n\n/**\n * error callback to use by default\n */\nfunction defaultErrorCallback(deferred: XMLHttpRequest, status: string): void {\n // do not display error message if request was aborted\n if (status === 'abort') {\n return;\n }\n\n const loadingError = $('#loadingError');\n if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) {\n if (deferred && deferred.status === 500) {\n $(document.body).html(piwikHelper.escape(deferred.responseText));\n }\n } else {\n loadingError.show();\n }\n}\n\n/**\n * Global ajax helper to handle requests within piwik\n */\nexport default class AjaxHelper {\n /**\n * Format of response\n */\n format = 'json';\n\n /**\n * A timeout for the request which will override any global timeout\n */\n timeout = null;\n\n /**\n * Callback function to be executed on success\n */\n callback: AnyFunction = null;\n\n /**\n * Use this.callback if an error is returned\n */\n useRegularCallbackInCaseOfError = false;\n\n /**\n * Callback function to be executed on error\n */\n errorCallback: AnyFunction;\n\n withToken = false;\n\n /**\n * Callback function to be executed on complete (after error or success)\n */\n completeCallback: AnyFunction;\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultGetParams\n */\n getParams: Parameters = {};\n\n /**\n * Base URL used in the AJAX request. Can be set by setUrl.\n *\n * It is set to '?' rather than 'index.php?' to increase chances that it works\n * including for users who have an automatic 301 redirection from index.php? to ?\n * POST values are missing when there is such 301 redirection. So by by-passing\n * this 301 redirection, we avoid this issue.\n *\n * @see ajaxHelper.setUrl\n */\n getUrl = '?';\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultPostParams\n */\n postParams: Parameters = {};\n\n /**\n * Element to be displayed while loading\n */\n loadingElement: HTMLElement|null|JQuery|JQLite|string = null;\n\n /**\n * Element to be displayed on error\n */\n errorElement: HTMLElement|JQuery|JQLite|string = '#ajaxError';\n\n /**\n * Handle for current request\n */\n requestHandle: XMLHttpRequest|JQuery.jqXHR|null = null;\n\n defaultParams = ['idSite', 'period', 'date', 'segment'];\n\n constructor() {\n this.errorCallback = defaultErrorCallback;\n }\n\n /**\n * Adds params to the request.\n * If params are given more then once, the latest given value is used for the request\n *\n * @param params\n * @param type type of given parameters (POST or GET)\n * @return {void}\n */\n addParams(params: Parameters|string, type: string): void {\n if (typeof params === 'string') {\n // TODO: add global types for broadcast (multiple uses below)\n params = window['broadcast'].getValuesFromUrl(params); // eslint-disable-line\n }\n\n const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates'];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n if (arrayParams.indexOf(key) !== -1\n && !value\n ) {\n return;\n }\n\n if (type.toLowerCase() === 'get') {\n this.getParams[key] = value;\n } else if (type.toLowerCase() === 'post') {\n this.postParams[key] = value;\n }\n });\n }\n\n withTokenInUrl(): void {\n this.withToken = true;\n }\n\n /**\n * Sets the base URL to use in the AJAX request.\n */\n setUrl(url: string): void {\n this.addParams(broadcast.getValuesFromUrl(url), 'GET');\n }\n\n /**\n * Gets this helper instance ready to send a bulk request. Each argument to this\n * function is a single request to use.\n */\n setBulkRequests(...urls: string[]): void {\n const urlsProcessed = urls.map((u) => $.param(u));\n\n this.addParams({\n module: 'API',\n method: 'API.getBulkRequest',\n urls: urlsProcessed,\n format: 'json',\n }, 'post');\n }\n\n /**\n * Set a timeout (in milliseconds) for the request. This will override any global timeout.\n *\n * @param timeout Timeout in milliseconds\n */\n setTimeout(timeout: number): void {\n this.timeout = timeout;\n }\n\n /**\n * Sets the callback called after the request finishes\n *\n * @param callback Callback function\n */\n setCallback(callback: AnyFunction): void {\n this.callback = callback;\n }\n\n /**\n * Set that the callback passed to setCallback() should be used if an application error (i.e. an\n * Exception in PHP) is returned.\n */\n useCallbackInCaseOfError(): void {\n this.useRegularCallbackInCaseOfError = true;\n }\n\n /**\n * Set callback to redirect on success handler\n * &update=1(+x) will be appended to the current url\n *\n * @param [params] to modify in redirect url\n * @return {void}\n */\n redirectOnSuccess(params: Parameters): void {\n this.setCallback(() => {\n piwikHelper.redirect(params);\n });\n }\n\n /**\n * Sets the callback called in case of an error within the request\n */\n setErrorCallback(callback: AnyFunction): void {\n this.errorCallback = callback;\n }\n\n /**\n * Sets the complete callback which is called after an error or success callback.\n */\n setCompleteCallback(callback: AnyFunction): void {\n this.completeCallback = callback;\n }\n\n /**\n * Sets the response format for the request\n *\n * @param format response format (e.g. json, html, ...)\n */\n setFormat(format: string): void {\n this.format = format;\n }\n\n /**\n * Set the div element to show while request is loading\n *\n * @param [element] selector for the loading element\n */\n setLoadingElement(element: string|HTMLElement|JQuery): void {\n this.loadingElement = element || '#ajaxLoadingDiv';\n }\n\n /**\n * Set the div element to show on error\n *\n * @param element selector for the error element\n */\n setErrorElement(element: HTMLElement|JQuery|string): void {\n if (!element) {\n return;\n }\n this.errorElement = element;\n }\n\n /**\n * Detect whether are allowed to use the given default parameter or not\n */\n private useGETDefaultParameter(parameter: string): boolean {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Removes a default parameter that is usually send automatically along the request.\n *\n * @param parameter A name such as \"period\", \"date\", \"segment\".\n */\n removeDefaultParameter(parameter: string): void {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n this.defaultParams.splice(i, 1);\n }\n }\n }\n }\n\n /**\n * Send the request\n */\n send(): void {\n if ($(this.errorElement).length) {\n $(this.errorElement).hide();\n }\n\n if (this.loadingElement) {\n $(this.loadingElement).fadeIn();\n }\n\n this.requestHandle = this.buildAjaxCall();\n globalAjaxQueue.push(this.requestHandle);\n }\n\n /**\n * Aborts the current request if it is (still) running\n */\n abort(): void {\n if (this.requestHandle && typeof this.requestHandle.abort === 'function') {\n this.requestHandle.abort();\n this.requestHandle = null;\n }\n }\n\n /**\n * Builds and sends the ajax requests\n */\n private buildAjaxCall(): JQuery.jqXHR {\n const self = this;\n const parameters = this.mixinDefaultGetParams(this.getParams);\n\n let url = this.getUrl;\n if (url[url.length - 1] !== '?') {\n url += '&';\n }\n\n // we took care of encoding &segment properly already, so we don't use $.param for it ($.param\n // URL encodes the values)\n if (parameters.segment) {\n url = `${url}segment=${parameters.segment}&`;\n delete parameters.segment;\n }\n if (parameters.date) {\n url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`;\n delete parameters.date;\n }\n url += $.param(parameters);\n const ajaxCall = {\n type: 'POST',\n async: true,\n url,\n dataType: this.format || 'json',\n complete: this.completeCallback,\n error: function errorCallback() {\n globalAjaxQueue.active -= 1;\n\n if (self.errorCallback) {\n self.errorCallback.apply(this, arguments); // eslint-disable-line\n }\n },\n success: (response, status, request) => {\n if (this.loadingElement) {\n $(this.loadingElement).hide();\n }\n\n if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) {\n let placeAt = null;\n let type = 'toast';\n if ($(this.errorElement).length && response.message) {\n $(this.errorElement).show();\n placeAt = this.errorElement;\n type = null;\n }\n\n if (response.message) {\n const UI = window['require']('piwik/UI'); // eslint-disable-line\n const notification = new UI.Notification();\n notification.show(response.message, {\n placeat: placeAt,\n context: 'error',\n type,\n id: 'ajaxHelper',\n });\n notification.scrollToNotification();\n }\n } else if (this.callback) {\n this.callback(response, status, request);\n }\n\n globalAjaxQueue.active -= 1;\n const { piwik } = window;\n if (piwik\n && piwik.ajaxRequestFinished\n ) {\n piwik.ajaxRequestFinished();\n }\n },\n data: this.mixinDefaultPostParams(this.postParams),\n timeout: this.timeout !== null ? this.timeout : undefined,\n };\n\n return $.ajax(ajaxCall);\n }\n\n private isRequestToApiMethod() {\n return (this.getParams && this.getParams.module === 'API' && this.getParams.method)\n || (this.postParams && this.postParams.module === 'API' && this.postParams.method);\n }\n\n isWidgetizedRequest(): boolean {\n return (broadcast.getValueFromUrl('module') === 'Widgetize');\n }\n\n private getDefaultPostParams() {\n if (this.withToken || this.isRequestToApiMethod() || piwik.shouldPropagateTokenAuth) {\n return {\n token_auth: piwik.token_auth,\n // When viewing a widgetized report there won't be any session that can be used, so don't\n // force session usage\n force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1,\n };\n }\n\n return {};\n }\n\n /**\n * Mixin the default parameters to send as POST\n *\n * @param params parameter object\n */\n private mixinDefaultPostParams(params): Parameters {\n const defaultParams = this.getDefaultPostParams();\n\n const mergedParams = {\n ...defaultParams,\n ...params,\n };\n\n return mergedParams;\n }\n\n /**\n * Mixin the default parameters to send as GET\n *\n * @param params parameter object\n */\n private mixinDefaultGetParams(originalParams): Parameters {\n const segment = PiwikUrl.getSearchParam('segment');\n\n const defaultParams = {\n idSite: piwik.idSite || broadcast.getValueFromUrl('idSite'),\n period: piwik.period || broadcast.getValueFromUrl('period'),\n segment,\n };\n\n const params = originalParams;\n\n // never append token_auth to url\n if (params.token_auth) {\n params.token_auth = null;\n delete params.token_auth;\n }\n\n Object.keys(defaultParams).forEach((key) => {\n if (this.useGETDefaultParameter(key)\n && !params[key]\n && !this.postParams[key]\n && defaultParams[key]\n ) {\n params[key] = defaultParams[key];\n }\n });\n\n // handle default date & period if not already set\n if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) {\n params.date = piwik.currentDateString;\n }\n\n return params;\n }\n}\n","import AjaxHelper from './AjaxHelper';\n\ndeclare global {\n interface Window {\n ajaxHelper: AjaxHelper;\n }\n}\n\nwindow.ajaxHelper = AjaxHelper;\n\nfunction ajaxQueue() {\n return globalAjaxQueue;\n}\n\nangular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport PiwikUrl from './PiwikUrl';\n\nfunction piwikUrl() {\n const model = {\n getSearchParam: PiwikUrl.getSearchParam.bind(PiwikUrl),\n };\n\n return model;\n}\n\npiwikUrl.$inject = [];\n\nangular.module('piwikApp.service').service('piwikUrl', piwikUrl);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\ninterface Period {\n getPrettyString(): string;\n getDateRange(): Date[];\n containsToday(): boolean;\n}\n\ninterface PeriodClass {\n parse(strDate: string|Date): Period;\n getDisplayText(): string;\n}\n\n/**\n * Piwik period management service for the frontend.\n *\n * Usage:\n *\n * var DayPeriod = piwikPeriods.get('day');\n * var day = new DayPeriod(new Date());\n *\n * or\n *\n * var day = piwikPeriods.parse('day', '2013-04-05');\n *\n * Adding custom periods:\n *\n * To add your own period to the frontend, create a period class for it\n * w/ the following methods:\n *\n * - **getPrettyString()**: returns a human readable display string for the period.\n * - **getDateRange()**: returns an array w/ two elements, the first being the start\n * Date of the period, the second being the end Date. The dates\n * must be Date objects, not strings, and are inclusive.\n * - **containsToday()**: returns true if the date period contains today. False if not.\n * - (_static_) **parse(strDate)**: creates a new instance of this period from the\n * value of the 'date' query parameter.\n * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month',\n * 'week', etc.\n *\n * Then call piwik.addCustomPeriod w/ your period class:\n *\n * piwik.addCustomPeriod('mycustomperiod', MyCustomPeriod);\n *\n * NOTE: currently only single date periods like day, week, month year can\n * be extended. Other types of periods that require a special UI to\n * view/edit aren't, since there is currently no way to use a\n * custom UI for a custom period.\n */\nclass Periods {\n periods: {[name: string]: PeriodClass} = {};\n\n periodOrder: string[] = [];\n\n addCustomPeriod(name: string, periodClass: PeriodClass) {\n if (this.periods[name]) {\n throw new Error(`The \"${name}\" period already exists! It cannot be overridden.`);\n }\n\n this.periods[name] = periodClass;\n this.periodOrder.push(name);\n }\n\n getAllLabels(): string[] {\n return Array().concat(this.periodOrder);\n }\n\n get(strPeriod: string): PeriodClass {\n const periodClass = this.periods[strPeriod];\n if (!periodClass) {\n throw new Error(`Invalid period label: ${strPeriod}`);\n }\n return periodClass;\n }\n\n parse(strPeriod: string, strDate: string): Period {\n return this.get(strPeriod).parse(strDate);\n }\n\n isRecognizedPeriod(strPeriod: string): boolean {\n return !!this.periods[strPeriod];\n }\n}\n\nexport default new Periods();\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport function format(date: Date): string {\n return $.datepicker.formatDate('yy-mm-dd', date);\n}\n\nexport function getToday(): Date {\n const date = new Date(Date.now());\n\n // undo browser timezone\n date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n\n // apply piwik site timezone (if it exists)\n date.setHours(date.getHours() + ((window.piwik.timezoneOffset || 0) / 3600));\n\n // get rid of hours/minutes/seconds/etc.\n date.setHours(0);\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return date;\n}\n\nexport function parseDate(date: string|Date): Date {\n if (date instanceof Date) {\n return date;\n }\n\n const strDate = decodeURIComponent(date);\n\n if (strDate === 'today'\n || strDate === 'now'\n ) {\n return getToday();\n }\n\n if (strDate === 'yesterday'\n // note: ignoring the 'same time' part since the frontend doesn't care about the time\n || strDate === 'yesterdaySameTime'\n ) {\n const yesterday = getToday();\n yesterday.setDate(yesterday.getDate() - 1);\n return yesterday;\n }\n\n if (strDate.match(/last[ -]?week/i)) {\n const lastWeek = getToday();\n lastWeek.setDate(lastWeek.getDate() - 7);\n return lastWeek;\n }\n\n if (strDate.match(/last[ -]?month/i)) {\n const lastMonth = getToday();\n lastMonth.setDate(1);\n lastMonth.setMonth(lastMonth.getMonth() - 1);\n return lastMonth;\n }\n\n if (strDate.match(/last[ -]?year/i)) {\n const lastYear = getToday();\n lastYear.setFullYear(lastYear.getFullYear() - 1);\n return lastYear;\n }\n\n try {\n return $.datepicker.parseDate('yy-mm-dd', strDate);\n } catch (err) {\n // angular swallows this error, so manual console log here\n console.error(err.message || err);\n throw err;\n }\n}\n\nexport function todayIsInRange(dateRange: Date[]): boolean {\n if (dateRange.length !== 2) {\n return false;\n }\n\n if (getToday() >= dateRange[0] && getToday() <= dateRange[1]) {\n return true;\n }\n\n return false;\n}\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport PiwikUrl from '../PiwikUrl/PiwikUrl';\nimport Periods from '../Periods/Periods';\nimport { format } from '../Periods/utilities';\n\nlet originalTitle: string;\n\nconst { piwik, broadcast, piwikHelper } = window;\n\npiwik.helper = piwikHelper;\npiwik.broadcast = broadcast;\n\nfunction isValidPeriod(periodStr: string, dateStr: string) {\n try {\n Periods.parse(periodStr, dateStr);\n return true;\n } catch (e) {\n return false;\n }\n}\n\npiwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() {\n let date = PiwikUrl.getSearchParam('date');\n const period = PiwikUrl.getSearchParam('period');\n if (!isValidPeriod(period, date)) {\n // invalid data in URL\n return;\n }\n\n if (piwik.period === period && piwik.currentDateString === date) {\n // this period / date is already loaded\n return;\n }\n\n piwik.period = period;\n\n const dateRange = Periods.parse(period, date).getDateRange();\n piwik.startDateString = format(dateRange[0]);\n piwik.endDateString = format(dateRange[1]);\n\n piwik.updateDateInTitle(date, period);\n\n // do not set anything to previousN/lastN, as it's more useful to plugins\n // to have the dates than previousN/lastN.\n if (piwik.period === 'range') {\n date = `${piwik.startDateString},${piwik.endDateString}`;\n }\n\n piwik.currentDateString = date;\n};\n\npiwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) {\n if (!$('.top_controls #periodString').length) {\n return;\n }\n\n // Cache server-rendered page title\n originalTitle = originalTitle || document.title;\n\n if (originalTitle.indexOf(piwik.siteName) === 0) {\n const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `;\n document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`;\n }\n};\n\npiwik.hasUserCapability = function hasUserCapability(capability: string) {\n return window.angular.isArray(piwik.userCapabilities)\n && piwik.userCapabilities.indexOf(capability) !== -1;\n};\n\nconst Piwik = piwik;\nexport default Piwik;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Piwik from './Piwik';\n\nfunction piwikService() {\n return Piwik;\n}\n\nangular.module('piwikApp.service').service('piwik', piwikService);\n\nfunction initPiwikService(piwik, $rootScope) {\n $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl);\n}\n\ninitPiwikService.$inject = ['piwik', '$rootScope'];\n\nangular.module('piwikApp.service').run(initPiwikService);\n","\n\n\n\n\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport default function translate(translationStringId: string, values: string[] = []): string {\n return window._pk_translate(translationStringId, values); // eslint-disable-line\n}\n","\nimport { defineComponent } from 'vue';\nimport translate from '../translate';\n\nexport default defineComponent({\n props: {\n loading: {\n type: Boolean,\n required: true,\n default: false,\n },\n loadingMessage: {\n type: String,\n required: false,\n default: translate('General_LoadingData'),\n },\n },\n});\n","import { render } from \"./ActivityIndicator.vue?vue&type=template&id=6af4d064\"\nimport script from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nexport * from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp } from 'vue';\nimport ActivityIndicator from './ActivityIndicator.vue';\nimport translate from '../translate';\n\ninterface ActivityIndicatorAdapterScope extends ng.IScope {\n loading: boolean;\n loadingMessage: string;\n}\n\nexport default function activityIndicatorAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n scope: {\n loading: '<',\n loadingMessage: '<',\n },\n template: '',\n link: function activityIndicatorAdapterLink(\n scope: ActivityIndicatorAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const app = createApp({\n template: '',\n data() {\n return {\n loading: scope.loading,\n loadingMessage: scope.loadingMessage,\n };\n },\n });\n app.component('activity-indicator', ActivityIndicator);\n const vm = app.mount(element[0]);\n\n scope.$watch('loading', (newValue: boolean) => {\n vm.loading = newValue;\n });\n\n scope.$watch('loadingMessage', (newValue: string) => {\n vm.loadingMessage = newValue || translate('General_LoadingData');\n });\n },\n };\n}\n\nactivityIndicatorAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikActivityIndicator', activityIndicatorAdapter);\n","\n\n\n\n\n","\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n props: {\n severity: {\n type: String,\n required: true,\n },\n },\n});\n","import { render } from \"./Alert.vue?vue&type=template&id=c3863ae2\"\nimport script from \"./Alert.vue?vue&type=script&lang=ts\"\nexport * from \"./Alert.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp, ref } from 'vue';\nimport Alert from './Alert.vue';\n\ninterface AlertAdapterScope extends ng.IScope {\n severity: string;\n}\n\nexport default function alertAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n transclude: true,\n scope: {\n severity: '@piwikAlert',\n },\n template: '
',\n compile: function alertAdapterCompile() {\n return {\n post: function alertAdapterPostLink(\n scope: AlertAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const clone = element.find('[ng-transclude]');\n\n const app = createApp({\n template: '
',\n data() {\n return { severity: scope.severity };\n },\n setup() {\n const transcludeTarget = ref(null);\n return {\n transcludeTarget,\n };\n },\n });\n app.component('alert', Alert);\n const vm = app.mount(element[0]);\n\n scope.$watch('severity', (newValue: string) => {\n vm.severity = newValue;\n });\n\n $(vm.transcludeTarget).append(clone);\n },\n };\n },\n };\n}\n\nalertAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikAlert', alertAdapter);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport {\n parseDate,\n format,\n getToday,\n todayIsInRange,\n} from './utilities';\n\nexport default class RangePeriod {\n constructor(\n public readonly startDate: Date,\n public readonly endDate: Date,\n public readonly childPeriodType: string,\n ) {}\n\n /**\n * Returns a range representing the last N childPeriodType periods, including the current one.\n */\n static getLastNRange(\n childPeriodType: string,\n strAmount: string|number,\n strEndDate?: Date|string,\n ): RangePeriod {\n const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0);\n if (Number.isNaN(nAmount)) {\n throw new Error('Invalid range strAmount');\n }\n\n let endDate = strEndDate ? parseDate(strEndDate) : getToday();\n\n let startDate = new Date(endDate.getTime());\n if (childPeriodType === 'day') {\n startDate.setDate(startDate.getDate() - nAmount);\n } else if (childPeriodType === 'week') {\n startDate.setDate(startDate.getDate() - (nAmount * 7));\n } else if (childPeriodType === 'month') {\n startDate.setDate(1);\n startDate.setMonth(startDate.getMonth() - nAmount);\n } else if (childPeriodType === 'year') {\n startDate.setFullYear(startDate.getFullYear() - nAmount);\n } else {\n throw new Error(`Unknown period type '${childPeriodType}'.`);\n }\n\n if (childPeriodType !== 'day') {\n const startPeriod = Periods.periods[childPeriodType].parse(startDate);\n const endPeriod = Periods.periods[childPeriodType].parse(endDate);\n\n [startDate] = startPeriod.getDateRange();\n [, endDate] = endPeriod.getDateRange();\n }\n\n const firstWebsiteDate = new Date(1991, 7, 6);\n if (startDate.getTime() - firstWebsiteDate.getTime() < 0) {\n switch (childPeriodType) {\n case 'year':\n startDate = new Date(1992, 0, 1);\n break;\n case 'month':\n startDate = new Date(1991, 8, 1);\n break;\n case 'week':\n startDate = new Date(1991, 8, 12);\n break;\n case 'day':\n default:\n startDate = firstWebsiteDate;\n break;\n }\n }\n\n return new RangePeriod(startDate, endDate, childPeriodType);\n }\n\n static parse(strDate: string, childPeriodType = 'day'): RangePeriod {\n if (/^previous/.test(strDate)) {\n const endDate = RangePeriod.getLastNRange(childPeriodType, '2').startDate;\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate);\n }\n\n if (/^last/.test(strDate)) {\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(4));\n }\n\n const parts = decodeURIComponent(strDate).split(',');\n return new RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType);\n }\n\n static getDisplayText(): string {\n return translate('General_DateRangeInPeriodList');\n }\n\n getPrettyString(): string {\n const start = format(this.startDate);\n const end = format(this.endDate);\n return translate('General_DateRangeFromTo', [start, end]);\n }\n\n getDateRange(): Date[] {\n return [this.startDate, this.endDate];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('range', RangePeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Periods from './Periods';\nimport RangePeriod from './Range';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nwindow.piwik.addCustomPeriod = Periods.addCustomPeriod.bind(Periods);\n\nfunction piwikPeriods() {\n return {\n getAllLabels: Periods.getAllLabels.bind(Periods),\n isRecognizedPeriod: Periods.isRecognizedPeriod.bind(Periods),\n get: Periods.get.bind(Periods),\n parse: Periods.parse.bind(Periods),\n parseDate,\n format,\n RangePeriod,\n todayIsInRange,\n };\n}\n\nangular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class DayPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): DayPeriod {\n return new DayPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodDay');\n }\n\n getPrettyString(): string {\n return format(this.dateInPeriod);\n }\n\n getDateRange(): Date[] {\n return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('day', DayPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class WeekPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): WeekPeriod {\n return new WeekPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodWeek');\n }\n\n getPrettyString(): string {\n const weekDates = this.getDateRange();\n const startWeek = format(weekDates[0]);\n const endWeek = format(weekDates[1]);\n\n return translate('General_DateRangeFromTo', [startWeek, endWeek]);\n }\n\n getDateRange(): Date[] {\n const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7;\n\n const startWeek = new Date(this.dateInPeriod.getTime());\n startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday);\n\n const endWeek = new Date(startWeek.getTime());\n endWeek.setDate(startWeek.getDate() + 6);\n\n return [startWeek, endWeek];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('week', WeekPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class MonthPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): MonthPeriod {\n return new MonthPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodMonth');\n }\n\n getPrettyString(): string {\n const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`);\n return `${month} ${this.dateInPeriod.getFullYear()}`;\n }\n\n getDateRange(): Date[] {\n const startMonth = new Date(this.dateInPeriod.getTime());\n startMonth.setDate(1);\n\n const endMonth = new Date(this.dateInPeriod.getTime());\n endMonth.setDate(1);\n endMonth.setMonth(endMonth.getMonth() + 1);\n endMonth.setDate(0);\n\n return [startMonth, endMonth];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('month', MonthPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class YearPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): YearPeriod {\n return new YearPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodYear');\n }\n\n getPrettyString(): string {\n return this.dateInPeriod.getFullYear().toString();\n }\n\n getDateRange(): Date[] {\n const startYear = new Date(this.dateInPeriod.getTime());\n startYear.setMonth(0);\n startYear.setDate(1);\n\n const endYear = new Date(this.dateInPeriod.getTime());\n endYear.setMonth(12);\n endYear.setDate(0);\n\n return [startYear, endYear];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('year', YearPeriod);\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://CoreHome/webpack/universalModuleDefinition","webpack://CoreHome/webpack/bootstrap","webpack://CoreHome/./plugins/CoreHome/vue/src/noAdblockFlag.ts","webpack://CoreHome/external {\"commonjs\":\"vue\",\"commonjs2\":\"vue\",\"root\":\"Vue\"}","webpack://CoreHome/./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js","webpack://CoreHome/./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/utilities.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Matomo/Matomo.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/translate.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Day.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Week.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Month.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Year.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Range.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/PiwikUrl/PiwikUrl.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Piwik/Piwik.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?0bf6","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?6f80","webpack://CoreHome/./plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?14a2","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.vue?cc69","webpack://CoreHome/./plugins/CoreHome/vue/src/Alert/Alert.adapter.ts"],"names":["root","factory","exports","module","require","define","amd","self","this","__WEBPACK_EXTERNAL_MODULE__8bbf__","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","hasBlockedContent","currentScript","document","src","match","MatomoUrl","paramName","hash","location","href","split","regex","RegExp","test","decodeURIComponent","valueFromHash","broadcast","getValueFromHash","getValueFromUrl","search","piwikUrl","model","getSearchParam","$inject","angular","service","Periods","periodClass","periods","Error","periodOrder","push","Array","concat","strPeriod","strDate","parse","format","date","$","datepicker","formatDate","getToday","Date","now","setTime","getTime","getTimezoneOffset","setHours","getHours","piwik","timezoneOffset","setMinutes","setSeconds","setMilliseconds","parseDate","yesterday","setDate","getDate","lastWeek","lastMonth","setMonth","getMonth","lastYear","setFullYear","getFullYear","err","console","error","message","todayIsInRange","dateRange","length","originalTitle","piwikHelper","isValidPeriod","periodStr","dateStr","e","helper","updatePeriodParamsFromUrl","period","currentDateString","getDateRange","startDateString","endDateString","updateDateInTitle","title","indexOf","siteName","dateString","getPrettyString","substr","hasUserCapability","capability","isArray","userCapabilities","Matomo","piwikService","initPiwikService","$rootScope","$on","run","translate","translationStringId","values","_pk_translate","dateInPeriod","addCustomPeriod","weekDates","startWeek","endWeek","daysToMonday","getDay","month","startMonth","endMonth","toString","startYear","endYear","startDate","endDate","childPeriodType","strAmount","strEndDate","nAmount","Math","max","parseInt","Number","isNaN","startPeriod","endPeriod","firstWebsiteDate","getLastNRange","substring","parts","start","end","piwikPeriods","getAllLabels","isRecognizedPeriod","RangePeriod","defaultErrorCallback","deferred","status","loadingError","Piwik_Popover","isOpen","body","html","escape","responseText","show","globalAjaxQueue","active","clean","readyState","splice","args","abort","forEach","x","errorCallback","params","type","getValuesFromUrl","arrayParams","keys","toLowerCase","getParams","postParams","withToken","url","addParams","urls","urlsProcessed","map","u","param","method","timeout","callback","useRegularCallbackInCaseOfError","setCallback","redirect","completeCallback","element","loadingElement","errorElement","parameter","defaultParams","hide","fadeIn","requestHandle","buildAjaxCall","parameters","mixinDefaultGetParams","getUrl","segment","ajaxCall","async","dataType","complete","apply","arguments","success","response","request","result","placeAt","UI","notification","Notification","placeat","context","id","scrollToNotification","ajaxRequestFinished","data","mixinDefaultPostParams","undefined","ajax","isRequestToApiMethod","shouldPropagateTokenAuth","token_auth","force_api_session","isWidgetizeRequestWithoutSession","getDefaultPostParams","mergedParams","originalParams","idSite","useGETDefaultParameter","ajaxQueue","ajaxHelper","PiwikUrl","Piwik","class","alt","loadingMessage","loading","props","Boolean","required","default","String","render","activityIndicatorAdapter","restrict","scope","template","link","app","config","globalProperties","$sanitize","vueSanitize","component","ActivityIndicator","vm","mount","$watch","newValue","severity","directive","alertAdapter","transclude","compile","post","clone","find","transcludeTarget","Alert","append"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,EAAQG,QAAQ,QACR,oBAAXC,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIJ,GACe,kBAAZC,QACdA,QAAQ,YAAcD,EAAQG,QAAQ,QAEtCJ,EAAK,YAAcC,EAAQD,EAAK,SARlC,CASoB,qBAATO,KAAuBA,KAAOC,MAAO,SAASC,GACzD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUV,QAGnC,IAAIC,EAASO,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHZ,QAAS,IAUV,OANAa,EA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DwCjBhB,GAAyBhO,QAAU,GAEnCC,QAAQnE,OAAO,YAAYmT,UAAU,yBAA0BjB,IEnDhD,oCAAgB,CAC7BN,MAAO,CACLsB,SAAU,CACRlG,KAAMgF,OACNF,UAAU,MCJhB,GAAOG,OAAS,GAED;;;;;;GCSD,SAAUmB,KACtB,MAAO,CACLjB,SAAU,IACVkB,YAAY,EACZjB,MAAO,CACLc,SAAU,eAEZb,SAAU,uBACViB,QAAS,WACP,MAAO,CACLC,KAAM,SACJnB,EACA9D,GAEA,MAAMkF,EAAQlF,EAAQmF,KAAK,mBAErBlB,EAAM,uBAAU,CACpBF,SAAU,oEACV,OACE,MAAO,CAAEa,SAAUd,EAAMc,WAE3B,QACE,MAAMQ,EAAmB,iBAAI,MAC7B,MAAO,CACLA,uBAINnB,EAAIC,OAAOC,iBAAiBC,UAAYhQ,OAAOiQ,YAC/CJ,EAAIK,UAAU,QAASe,IACvB,MAAMb,EAAKP,EAAIQ,MAAMzE,EAAQ,IAE7B8D,EAAMY,OAAO,WAAaC,IACxBH,EAAGI,SAAWD,IAGhB/N,EAAE4N,EAAGY,kBAAkBE,OAAOJ,OAOxCJ,GAAalP,QAAU,GAEvBC,QAAQnE,OAAO,YAAYmT,UAAU,aAAcC","file":"CoreHome.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"vue\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CoreHome\"] = factory(require(\"vue\"));\n\telse\n\t\troot[\"CoreHome\"] = factory(root[\"Vue\"]);\n})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__8bbf__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"fae3\");\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n// see https://github.com/matomo-org/matomo/issues/5094 used to detect an ad blocker\nwindow.hasBlockedContent = false;\n","module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;","// This file is imported into lib/wc client bundles.\n\nif (typeof window !== 'undefined') {\n var currentScript = window.document.currentScript\n if (process.env.NEED_CURRENTSCRIPT_POLYFILL) {\n var getCurrentScript = require('@soda/get-current-script')\n currentScript = getCurrentScript()\n\n // for backward compatibility, because previously we directly included the polyfill\n if (!('currentScript' in document)) {\n Object.defineProperty(document, 'currentScript', { get: getCurrentScript })\n }\n }\n\n var src = currentScript && currentScript.src.match(/(.+\\/)[^/]+\\.js(\\?.*)?$/)\n if (src) {\n __webpack_public_path__ = src[1] // eslint-disable-line\n }\n}\n\n// Indicate to webpack that this file can be concatenated\nexport default null\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n/**\n * Similar to angulars $location but works around some limitation. Use it if you need to access\n * search params\n */\nconst MatomoUrl = {\n getSearchParam(paramName: string): string {\n const hash = window.location.href.split('#');\n\n const regex = new RegExp(`${paramName}(\\\\[]|=)`);\n if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) {\n const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href);\n\n // for date, period and idsite fall back to parameter from url, if non in hash was provided\n if (valueFromHash\n || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite')\n ) {\n return valueFromHash;\n }\n }\n\n return window.broadcast.getValueFromUrl(paramName, window.location.search);\n },\n};\n\nexport default MatomoUrl;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport MatomoUrl from './MatomoUrl';\n\nfunction piwikUrl() {\n const model = {\n getSearchParam: MatomoUrl.getSearchParam.bind(MatomoUrl),\n };\n\n return model;\n}\n\npiwikUrl.$inject = [];\n\nangular.module('piwikApp.service').service('piwikUrl', piwikUrl);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\ninterface Period {\n getPrettyString(): string;\n getDateRange(): Date[];\n containsToday(): boolean;\n}\n\ninterface PeriodClass {\n parse(strDate: string|Date): Period;\n getDisplayText(): string;\n}\n\n/**\n * Matomo period management service for the frontend.\n *\n * Usage:\n *\n * var DayPeriod = matomoPeriods.get('day');\n * var day = new DayPeriod(new Date());\n *\n * or\n *\n * var day = matomoPeriods.parse('day', '2013-04-05');\n *\n * Adding custom periods:\n *\n * To add your own period to the frontend, create a period class for it\n * w/ the following methods:\n *\n * - **getPrettyString()**: returns a human readable display string for the period.\n * - **getDateRange()**: returns an array w/ two elements, the first being the start\n * Date of the period, the second being the end Date. The dates\n * must be Date objects, not strings, and are inclusive.\n * - **containsToday()**: returns true if the date period contains today. False if not.\n * - (_static_) **parse(strDate)**: creates a new instance of this period from the\n * value of the 'date' query parameter.\n * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month',\n * 'week', etc.\n *\n * Then call Periods.addCustomPeriod w/ your period class:\n *\n * Periods.addCustomPeriod('mycustomperiod', MyCustomPeriod);\n *\n * NOTE: currently only single date periods like day, week, month year can\n * be extended. Other types of periods that require a special UI to\n * view/edit aren't, since there is currently no way to use a\n * custom UI for a custom period.\n */\nclass Periods {\n periods: {[name: string]: PeriodClass} = {};\n\n periodOrder: string[] = [];\n\n addCustomPeriod(name: string, periodClass: PeriodClass) {\n if (this.periods[name]) {\n throw new Error(`The \"${name}\" period already exists! It cannot be overridden.`);\n }\n\n this.periods[name] = periodClass;\n this.periodOrder.push(name);\n }\n\n getAllLabels(): string[] {\n return Array().concat(this.periodOrder);\n }\n\n get(strPeriod: string): PeriodClass {\n const periodClass = this.periods[strPeriod];\n if (!periodClass) {\n throw new Error(`Invalid period label: ${strPeriod}`);\n }\n return periodClass;\n }\n\n parse(strPeriod: string, strDate: string): Period {\n return this.get(strPeriod).parse(strDate);\n }\n\n isRecognizedPeriod(strPeriod: string): boolean {\n return !!this.periods[strPeriod];\n }\n}\n\nexport default new Periods();\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport function format(date: Date): string {\n return $.datepicker.formatDate('yy-mm-dd', date);\n}\n\nexport function getToday(): Date {\n const date = new Date(Date.now());\n\n // undo browser timezone\n date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000);\n\n // apply Matomo site timezone (if it exists)\n date.setHours(date.getHours() + ((window.piwik.timezoneOffset || 0) / 3600));\n\n // get rid of hours/minutes/seconds/etc.\n date.setHours(0);\n date.setMinutes(0);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return date;\n}\n\nexport function parseDate(date: string|Date): Date {\n if (date instanceof Date) {\n return date;\n }\n\n const strDate = decodeURIComponent(date);\n\n if (strDate === 'today'\n || strDate === 'now'\n ) {\n return getToday();\n }\n\n if (strDate === 'yesterday'\n // note: ignoring the 'same time' part since the frontend doesn't care about the time\n || strDate === 'yesterdaySameTime'\n ) {\n const yesterday = getToday();\n yesterday.setDate(yesterday.getDate() - 1);\n return yesterday;\n }\n\n if (strDate.match(/last[ -]?week/i)) {\n const lastWeek = getToday();\n lastWeek.setDate(lastWeek.getDate() - 7);\n return lastWeek;\n }\n\n if (strDate.match(/last[ -]?month/i)) {\n const lastMonth = getToday();\n lastMonth.setDate(1);\n lastMonth.setMonth(lastMonth.getMonth() - 1);\n return lastMonth;\n }\n\n if (strDate.match(/last[ -]?year/i)) {\n const lastYear = getToday();\n lastYear.setFullYear(lastYear.getFullYear() - 1);\n return lastYear;\n }\n\n try {\n return $.datepicker.parseDate('yy-mm-dd', strDate);\n } catch (err) {\n // angular swallows this error, so manual console log here\n console.error(err.message || err);\n throw err;\n }\n}\n\nexport function todayIsInRange(dateRange: Date[]): boolean {\n if (dateRange.length !== 2) {\n return false;\n }\n\n if (getToday() >= dateRange[0] && getToday() <= dateRange[1]) {\n return true;\n }\n\n return false;\n}\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport MatomoUrl from '../MatomoUrl/MatomoUrl';\nimport Periods from '../Periods/Periods';\nimport { format } from '../Periods/utilities';\n\nlet originalTitle: string;\n\nconst { piwik, broadcast, piwikHelper } = window;\n\npiwik.helper = piwikHelper;\npiwik.broadcast = broadcast;\n\nfunction isValidPeriod(periodStr: string, dateStr: string) {\n try {\n Periods.parse(periodStr, dateStr);\n return true;\n } catch (e) {\n return false;\n }\n}\n\npiwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() {\n let date = MatomoUrl.getSearchParam('date');\n const period = MatomoUrl.getSearchParam('period');\n if (!isValidPeriod(period, date)) {\n // invalid data in URL\n return;\n }\n\n if (piwik.period === period && piwik.currentDateString === date) {\n // this period / date is already loaded\n return;\n }\n\n piwik.period = period;\n\n const dateRange = Periods.parse(period, date).getDateRange();\n piwik.startDateString = format(dateRange[0]);\n piwik.endDateString = format(dateRange[1]);\n\n piwik.updateDateInTitle(date, period);\n\n // do not set anything to previousN/lastN, as it's more useful to plugins\n // to have the dates than previousN/lastN.\n if (piwik.period === 'range') {\n date = `${piwik.startDateString},${piwik.endDateString}`;\n }\n\n piwik.currentDateString = date;\n};\n\npiwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) {\n if (!$('.top_controls #periodString').length) {\n return;\n }\n\n // Cache server-rendered page title\n originalTitle = originalTitle || document.title;\n\n if (originalTitle.indexOf(piwik.siteName) === 0) {\n const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `;\n document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`;\n }\n};\n\npiwik.hasUserCapability = function hasUserCapability(capability: string) {\n return window.angular.isArray(piwik.userCapabilities)\n && piwik.userCapabilities.indexOf(capability) !== -1;\n};\n\nconst Matomo = piwik;\nexport default Matomo;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Matomo from './Matomo';\n\nfunction piwikService() {\n return Matomo;\n}\n\nangular.module('piwikApp.service').service('piwik', piwikService);\n\nfunction initPiwikService(piwik, $rootScope) {\n $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl);\n}\n\ninitPiwikService.$inject = ['piwik', '$rootScope'];\n\nangular.module('piwikApp.service').run(initPiwikService);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nexport default function translate(translationStringId: string, values: string[] = []): string {\n return window._pk_translate(translationStringId, values); // eslint-disable-line\n}\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class DayPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): DayPeriod {\n return new DayPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodDay');\n }\n\n getPrettyString(): string {\n return format(this.dateInPeriod);\n }\n\n getDateRange(): Date[] {\n return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('day', DayPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nexport default class WeekPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): WeekPeriod {\n return new WeekPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodWeek');\n }\n\n getPrettyString(): string {\n const weekDates = this.getDateRange();\n const startWeek = format(weekDates[0]);\n const endWeek = format(weekDates[1]);\n\n return translate('General_DateRangeFromTo', [startWeek, endWeek]);\n }\n\n getDateRange(): Date[] {\n const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7;\n\n const startWeek = new Date(this.dateInPeriod.getTime());\n startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday);\n\n const endWeek = new Date(startWeek.getTime());\n endWeek.setDate(startWeek.getDate() + 6);\n\n return [startWeek, endWeek];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('week', WeekPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class MonthPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): MonthPeriod {\n return new MonthPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodMonth');\n }\n\n getPrettyString(): string {\n const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`);\n return `${month} ${this.dateInPeriod.getFullYear()}`;\n }\n\n getDateRange(): Date[] {\n const startMonth = new Date(this.dateInPeriod.getTime());\n startMonth.setDate(1);\n\n const endMonth = new Date(this.dateInPeriod.getTime());\n endMonth.setDate(1);\n endMonth.setMonth(endMonth.getMonth() + 1);\n endMonth.setDate(0);\n\n return [startMonth, endMonth];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('month', MonthPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport { parseDate, todayIsInRange } from './utilities';\n\nexport default class YearPeriod {\n constructor(private dateInPeriod: Date) {}\n\n static parse(strDate: string): YearPeriod {\n return new YearPeriod(parseDate(strDate));\n }\n\n static getDisplayText(): string {\n return translate('Intl_PeriodYear');\n }\n\n getPrettyString(): string {\n return this.dateInPeriod.getFullYear().toString();\n }\n\n getDateRange(): Date[] {\n const startYear = new Date(this.dateInPeriod.getTime());\n startYear.setMonth(0);\n startYear.setDate(1);\n\n const endYear = new Date(this.dateInPeriod.getTime());\n endYear.setMonth(12);\n endYear.setDate(0);\n\n return [startYear, endYear];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('year', YearPeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport translate from '../translate';\nimport Periods from './Periods';\nimport {\n parseDate,\n format,\n getToday,\n todayIsInRange,\n} from './utilities';\n\nexport default class RangePeriod {\n constructor(\n public readonly startDate: Date,\n public readonly endDate: Date,\n public readonly childPeriodType: string,\n ) {}\n\n /**\n * Returns a range representing the last N childPeriodType periods, including the current one.\n */\n static getLastNRange(\n childPeriodType: string,\n strAmount: string|number,\n strEndDate?: Date|string,\n ): RangePeriod {\n const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0);\n if (Number.isNaN(nAmount)) {\n throw new Error('Invalid range strAmount');\n }\n\n let endDate = strEndDate ? parseDate(strEndDate) : getToday();\n\n let startDate = new Date(endDate.getTime());\n if (childPeriodType === 'day') {\n startDate.setDate(startDate.getDate() - nAmount);\n } else if (childPeriodType === 'week') {\n startDate.setDate(startDate.getDate() - (nAmount * 7));\n } else if (childPeriodType === 'month') {\n startDate.setDate(1);\n startDate.setMonth(startDate.getMonth() - nAmount);\n } else if (childPeriodType === 'year') {\n startDate.setFullYear(startDate.getFullYear() - nAmount);\n } else {\n throw new Error(`Unknown period type '${childPeriodType}'.`);\n }\n\n if (childPeriodType !== 'day') {\n const startPeriod = Periods.periods[childPeriodType].parse(startDate);\n const endPeriod = Periods.periods[childPeriodType].parse(endDate);\n\n [startDate] = startPeriod.getDateRange();\n [, endDate] = endPeriod.getDateRange();\n }\n\n const firstWebsiteDate = new Date(1991, 7, 6);\n if (startDate.getTime() - firstWebsiteDate.getTime() < 0) {\n switch (childPeriodType) {\n case 'year':\n startDate = new Date(1992, 0, 1);\n break;\n case 'month':\n startDate = new Date(1991, 8, 1);\n break;\n case 'week':\n startDate = new Date(1991, 8, 12);\n break;\n case 'day':\n default:\n startDate = firstWebsiteDate;\n break;\n }\n }\n\n return new RangePeriod(startDate, endDate, childPeriodType);\n }\n\n static parse(strDate: string, childPeriodType = 'day'): RangePeriod {\n if (/^previous/.test(strDate)) {\n const endDate = RangePeriod.getLastNRange(childPeriodType, '2').startDate;\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate);\n }\n\n if (/^last/.test(strDate)) {\n return RangePeriod.getLastNRange(childPeriodType, strDate.substring(4));\n }\n\n const parts = decodeURIComponent(strDate).split(',');\n return new RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType);\n }\n\n static getDisplayText(): string {\n return translate('General_DateRangeInPeriodList');\n }\n\n getPrettyString(): string {\n const start = format(this.startDate);\n const end = format(this.endDate);\n return translate('General_DateRangeFromTo', [start, end]);\n }\n\n getDateRange(): Date[] {\n return [this.startDate, this.endDate];\n }\n\n containsToday(): boolean {\n return todayIsInRange(this.getDateRange());\n }\n}\n\nPeriods.addCustomPeriod('range', RangePeriod);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Periods from './Periods';\nimport RangePeriod from './Range';\nimport { parseDate, format, todayIsInRange } from './utilities';\n\nwindow.piwik.addCustomPeriod = Periods.addCustomPeriod.bind(Periods);\n\nfunction piwikPeriods() {\n return {\n getAllLabels: Periods.getAllLabels.bind(Periods),\n isRecognizedPeriod: Periods.isRecognizedPeriod.bind(Periods),\n get: Periods.get.bind(Periods),\n parse: Periods.parse.bind(Periods),\n parseDate,\n format,\n RangePeriod,\n todayIsInRange,\n };\n}\n\nangular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport MatomoUrl from '../MatomoUrl/MatomoUrl';\nimport Matomo from '../Matomo/Matomo';\n\nwindow.globalAjaxQueue = [] as GlobalAjaxQueue;\nwindow.globalAjaxQueue.active = 0;\n\nwindow.globalAjaxQueue.clean = function globalAjaxQueueClean() {\n for (let i = this.length; i >= 0; i -= 1) {\n if (!this[i] || this[i].readyState === 4) {\n this.splice(i, 1);\n }\n }\n};\n\nwindow.globalAjaxQueue.push = function globalAjaxQueuePush(...args: (XMLHttpRequest|null)[]) {\n this.active += args.length;\n\n // cleanup ajax queue\n this.clean();\n\n // call original array push\n return Array.prototype.push.call(this, ...args);\n};\n\nwindow.globalAjaxQueue.abort = function globalAjaxQueueAbort() {\n // abort all queued requests if possible\n this.forEach((x) => x && x.abort && x.abort());\n\n // remove all elements from array\n this.splice(0, this.length);\n\n this.active = 0;\n};\n\ntype ParameterValue = string | number | null | undefined | ParameterValue[];\ntype Parameters = {[name: string]: ParameterValue | Parameters};\ntype AnyFunction = (...params:any[]) => any; // eslint-disable-line\n\n/**\n * error callback to use by default\n */\nfunction defaultErrorCallback(deferred: XMLHttpRequest, status: string): void {\n // do not display error message if request was aborted\n if (status === 'abort') {\n return;\n }\n\n const loadingError = $('#loadingError');\n if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) {\n if (deferred && deferred.status === 500) {\n $(document.body).html(piwikHelper.escape(deferred.responseText));\n }\n } else {\n loadingError.show();\n }\n}\n\n/**\n * Global ajax helper to handle requests within Matomo\n */\nexport default class AjaxHelper {\n /**\n * Format of response\n */\n format = 'json';\n\n /**\n * A timeout for the request which will override any global timeout\n */\n timeout = null;\n\n /**\n * Callback function to be executed on success\n */\n callback: AnyFunction = null;\n\n /**\n * Use this.callback if an error is returned\n */\n useRegularCallbackInCaseOfError = false;\n\n /**\n * Callback function to be executed on error\n *\n * @deprecated use the jquery promise API\n */\n errorCallback: AnyFunction;\n\n withToken = false;\n\n /**\n * Callback function to be executed on complete (after error or success)\n *\n * @deprecated use the jquery promise API\n */\n completeCallback: AnyFunction;\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultGetParams\n */\n getParams: Parameters = {};\n\n /**\n * Base URL used in the AJAX request. Can be set by setUrl.\n *\n * It is set to '?' rather than 'index.php?' to increase chances that it works\n * including for users who have an automatic 301 redirection from index.php? to ?\n * POST values are missing when there is such 301 redirection. So by by-passing\n * this 301 redirection, we avoid this issue.\n *\n * @see ajaxHelper.setUrl\n */\n getUrl = '?';\n\n /**\n * Params to be passed as GET params\n * @see ajaxHelper.mixinDefaultPostParams\n */\n postParams: Parameters = {};\n\n /**\n * Element to be displayed while loading\n */\n loadingElement: HTMLElement|null|JQuery|JQLite|string = null;\n\n /**\n * Element to be displayed on error\n */\n errorElement: HTMLElement|JQuery|JQLite|string = '#ajaxError';\n\n /**\n * Handle for current request\n */\n requestHandle: XMLHttpRequest|JQuery.jqXHR|null = null;\n\n defaultParams = ['idSite', 'period', 'date', 'segment'];\n\n constructor() {\n this.errorCallback = defaultErrorCallback;\n }\n\n /**\n * Adds params to the request.\n * If params are given more then once, the latest given value is used for the request\n *\n * @param params\n * @param type type of given parameters (POST or GET)\n * @return {void}\n */\n addParams(params: Parameters|string, type: string): void {\n if (typeof params === 'string') {\n // TODO: add global types for broadcast (multiple uses below)\n params = window['broadcast'].getValuesFromUrl(params); // eslint-disable-line\n }\n\n const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates'];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n if (arrayParams.indexOf(key) !== -1\n && !value\n ) {\n return;\n }\n\n if (type.toLowerCase() === 'get') {\n this.getParams[key] = value;\n } else if (type.toLowerCase() === 'post') {\n this.postParams[key] = value;\n }\n });\n }\n\n withTokenInUrl(): void {\n this.withToken = true;\n }\n\n /**\n * Sets the base URL to use in the AJAX request.\n */\n setUrl(url: string): void {\n this.addParams(broadcast.getValuesFromUrl(url), 'GET');\n }\n\n /**\n * Gets this helper instance ready to send a bulk request. Each argument to this\n * function is a single request to use.\n */\n setBulkRequests(...urls: string[]): void {\n const urlsProcessed = urls.map((u) => $.param(u));\n\n this.addParams({\n module: 'API',\n method: 'API.getBulkRequest',\n urls: urlsProcessed,\n format: 'json',\n }, 'post');\n }\n\n /**\n * Set a timeout (in milliseconds) for the request. This will override any global timeout.\n *\n * @param timeout Timeout in milliseconds\n */\n setTimeout(timeout: number): void {\n this.timeout = timeout;\n }\n\n /**\n * Sets the callback called after the request finishes\n *\n * @param callback Callback function\n * @deprecated use the jquery promise API\n */\n setCallback(callback: AnyFunction): void {\n this.callback = callback;\n }\n\n /**\n * Set that the callback passed to setCallback() should be used if an application error (i.e. an\n * Exception in PHP) is returned.\n */\n useCallbackInCaseOfError(): void {\n this.useRegularCallbackInCaseOfError = true;\n }\n\n /**\n * Set callback to redirect on success handler\n * &update=1(+x) will be appended to the current url\n *\n * @param [params] to modify in redirect url\n * @return {void}\n */\n redirectOnSuccess(params: Parameters): void {\n this.setCallback(() => {\n piwikHelper.redirect(params);\n });\n }\n\n /**\n * Sets the callback called in case of an error within the request\n *\n * @deprecated use the jquery promise API\n */\n setErrorCallback(callback: AnyFunction): void {\n this.errorCallback = callback;\n }\n\n /**\n * Sets the complete callback which is called after an error or success callback.\n *\n * @deprecated use the jquery promise API\n */\n setCompleteCallback(callback: AnyFunction): void {\n this.completeCallback = callback;\n }\n\n /**\n * Sets the response format for the request\n *\n * @param format response format (e.g. json, html, ...)\n */\n setFormat(format: string): void {\n this.format = format;\n }\n\n /**\n * Set the div element to show while request is loading\n *\n * @param [element] selector for the loading element\n */\n setLoadingElement(element: string|HTMLElement|JQuery): void {\n this.loadingElement = element || '#ajaxLoadingDiv';\n }\n\n /**\n * Set the div element to show on error\n *\n * @param element selector for the error element\n */\n setErrorElement(element: HTMLElement|JQuery|string): void {\n if (!element) {\n return;\n }\n this.errorElement = element;\n }\n\n /**\n * Detect whether are allowed to use the given default parameter or not\n */\n private useGETDefaultParameter(parameter: string): boolean {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * Removes a default parameter that is usually send automatically along the request.\n *\n * @param parameter A name such as \"period\", \"date\", \"segment\".\n */\n removeDefaultParameter(parameter: string): void {\n if (parameter && this.defaultParams) {\n for (let i = 0; i < this.defaultParams.length; i += 1) {\n if (this.defaultParams[i] === parameter) {\n this.defaultParams.splice(i, 1);\n }\n }\n }\n }\n\n /**\n * Send the request\n */\n send(): JQuery.jqXHR {\n if ($(this.errorElement).length) {\n $(this.errorElement).hide();\n }\n\n if (this.loadingElement) {\n $(this.loadingElement).fadeIn();\n }\n\n this.requestHandle = this.buildAjaxCall();\n globalAjaxQueue.push(this.requestHandle);\n\n return this.requestHandle;\n }\n\n /**\n * Aborts the current request if it is (still) running\n */\n abort(): void {\n if (this.requestHandle && typeof this.requestHandle.abort === 'function') {\n this.requestHandle.abort();\n this.requestHandle = null;\n }\n }\n\n /**\n * Builds and sends the ajax requests\n */\n private buildAjaxCall(): JQuery.jqXHR {\n const self = this;\n const parameters = this.mixinDefaultGetParams(this.getParams);\n\n let url = this.getUrl;\n if (url[url.length - 1] !== '?') {\n url += '&';\n }\n\n // we took care of encoding &segment properly already, so we don't use $.param for it ($.param\n // URL encodes the values)\n if (parameters.segment) {\n url = `${url}segment=${parameters.segment}&`;\n delete parameters.segment;\n }\n if (parameters.date) {\n url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`;\n delete parameters.date;\n }\n url += $.param(parameters);\n const ajaxCall = {\n type: 'POST',\n async: true,\n url,\n dataType: this.format || 'json',\n complete: this.completeCallback,\n error: function errorCallback() {\n globalAjaxQueue.active -= 1;\n\n if (self.errorCallback) {\n self.errorCallback.apply(this, arguments); // eslint-disable-line\n }\n },\n success: (response, status, request) => {\n if (this.loadingElement) {\n $(this.loadingElement).hide();\n }\n\n if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) {\n let placeAt = null;\n let type = 'toast';\n if ($(this.errorElement).length && response.message) {\n $(this.errorElement).show();\n placeAt = this.errorElement;\n type = null;\n }\n\n if (response.message) {\n const UI = window['require']('piwik/UI'); // eslint-disable-line\n const notification = new UI.Notification();\n notification.show(response.message, {\n placeat: placeAt,\n context: 'error',\n type,\n id: 'ajaxHelper',\n });\n notification.scrollToNotification();\n }\n } else if (this.callback) {\n this.callback(response, status, request);\n }\n\n globalAjaxQueue.active -= 1;\n if (Matomo.ajaxRequestFinished) {\n Matomo.ajaxRequestFinished();\n }\n },\n data: this.mixinDefaultPostParams(this.postParams),\n timeout: this.timeout !== null ? this.timeout : undefined,\n };\n\n return $.ajax(ajaxCall);\n }\n\n private isRequestToApiMethod() {\n return (this.getParams && this.getParams.module === 'API' && this.getParams.method)\n || (this.postParams && this.postParams.module === 'API' && this.postParams.method);\n }\n\n isWidgetizedRequest(): boolean {\n return (broadcast.getValueFromUrl('module') === 'Widgetize');\n }\n\n private getDefaultPostParams() {\n if (this.withToken || this.isRequestToApiMethod() || Matomo.shouldPropagateTokenAuth) {\n return {\n token_auth: Matomo.token_auth,\n // When viewing a widgetized report there won't be any session that can be used, so don't\n // force session usage\n force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1,\n };\n }\n\n return {};\n }\n\n /**\n * Mixin the default parameters to send as POST\n *\n * @param params parameter object\n */\n private mixinDefaultPostParams(params): Parameters {\n const defaultParams = this.getDefaultPostParams();\n\n const mergedParams = {\n ...defaultParams,\n ...params,\n };\n\n return mergedParams;\n }\n\n /**\n * Mixin the default parameters to send as GET\n *\n * @param params parameter object\n */\n private mixinDefaultGetParams(originalParams): Parameters {\n const segment = MatomoUrl.getSearchParam('segment');\n\n const defaultParams = {\n idSite: Matomo.idSite || broadcast.getValueFromUrl('idSite'),\n period: Matomo.period || broadcast.getValueFromUrl('period'),\n segment,\n };\n\n const params = originalParams;\n\n // never append token_auth to url\n if (params.token_auth) {\n params.token_auth = null;\n delete params.token_auth;\n }\n\n Object.keys(defaultParams).forEach((key) => {\n if (this.useGETDefaultParameter(key)\n && !params[key]\n && !this.postParams[key]\n && defaultParams[key]\n ) {\n params[key] = defaultParams[key];\n }\n });\n\n // handle default date & period if not already set\n if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) {\n params.date = Matomo.currentDateString;\n }\n\n return params;\n }\n}\n","import AjaxHelper from './AjaxHelper';\n\ndeclare global {\n interface Window {\n ajaxHelper: AjaxHelper;\n }\n}\n\nwindow.ajaxHelper = AjaxHelper;\n\nfunction ajaxQueue() {\n return globalAjaxQueue;\n}\n\nangular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\n/**\n * Similar to angulars $location but works around some limitation. Use it if you need to access\n * search params\n */\nconst PiwikUrl = {\n getSearchParam(paramName: string): string {\n const hash = window.location.href.split('#');\n\n const regex = new RegExp(`${paramName}(\\\\[]|=)`);\n if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) {\n const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href);\n\n // for date, period and idsite fall back to parameter from url, if non in hash was provided\n if (valueFromHash\n || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite')\n ) {\n return valueFromHash;\n }\n }\n\n return window.broadcast.getValueFromUrl(paramName, window.location.search);\n },\n};\n\nexport default PiwikUrl;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\nimport PiwikUrl from './PiwikUrl';\n\nfunction piwikUrl() {\n const model = {\n getSearchParam: PiwikUrl.getSearchParam.bind(PiwikUrl),\n };\n\n return model;\n}\n\npiwikUrl.$inject = [];\n\nangular.module('piwikApp.service').service('piwikUrl', piwikUrl);\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport PiwikUrl from '../PiwikUrl/PiwikUrl';\nimport Periods from '../Periods/Periods';\nimport { format } from '../Periods/utilities';\n\nlet originalTitle: string;\n\nconst { piwik, broadcast, piwikHelper } = window;\n\npiwik.helper = piwikHelper;\npiwik.broadcast = broadcast;\n\nfunction isValidPeriod(periodStr: string, dateStr: string) {\n try {\n Periods.parse(periodStr, dateStr);\n return true;\n } catch (e) {\n return false;\n }\n}\n\npiwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() {\n let date = PiwikUrl.getSearchParam('date');\n const period = PiwikUrl.getSearchParam('period');\n if (!isValidPeriod(period, date)) {\n // invalid data in URL\n return;\n }\n\n if (piwik.period === period && piwik.currentDateString === date) {\n // this period / date is already loaded\n return;\n }\n\n piwik.period = period;\n\n const dateRange = Periods.parse(period, date).getDateRange();\n piwik.startDateString = format(dateRange[0]);\n piwik.endDateString = format(dateRange[1]);\n\n piwik.updateDateInTitle(date, period);\n\n // do not set anything to previousN/lastN, as it's more useful to plugins\n // to have the dates than previousN/lastN.\n if (piwik.period === 'range') {\n date = `${piwik.startDateString},${piwik.endDateString}`;\n }\n\n piwik.currentDateString = date;\n};\n\npiwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) {\n if (!$('.top_controls #periodString').length) {\n return;\n }\n\n // Cache server-rendered page title\n originalTitle = originalTitle || document.title;\n\n if (originalTitle.indexOf(piwik.siteName) === 0) {\n const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `;\n document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`;\n }\n};\n\npiwik.hasUserCapability = function hasUserCapability(capability: string) {\n return window.angular.isArray(piwik.userCapabilities)\n && piwik.userCapabilities.indexOf(capability) !== -1;\n};\n\nconst Piwik = piwik;\nexport default Piwik;\n","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport Piwik from './Piwik';\n\nfunction piwikService() {\n return Piwik;\n}\n\nangular.module('piwikApp.service').service('piwik', piwikService);\n\nfunction initPiwikService(piwik, $rootScope) {\n $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl);\n}\n\ninitPiwikService.$inject = ['piwik', '$rootScope'];\n\nangular.module('piwikApp.service').run(initPiwikService);\n","\n\n\n\n\n","\nimport { defineComponent } from 'vue';\nimport translate from '../translate';\n\nexport default defineComponent({\n props: {\n loading: {\n type: Boolean,\n required: true,\n default: false,\n },\n loadingMessage: {\n type: String,\n required: false,\n default: translate('General_LoadingData'),\n },\n },\n});\n","import { render } from \"./ActivityIndicator.vue?vue&type=template&id=6af4d064\"\nimport script from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nexport * from \"./ActivityIndicator.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp } from 'vue';\nimport ActivityIndicator from './ActivityIndicator.vue';\nimport translate from '../translate';\n\ninterface ActivityIndicatorAdapterScope extends ng.IScope {\n loading: boolean;\n loadingMessage: string;\n}\n\nexport default function activityIndicatorAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n scope: {\n loading: '<',\n loadingMessage: '<',\n },\n template: '',\n link: function activityIndicatorAdapterLink(\n scope: ActivityIndicatorAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const app = createApp({\n template: '',\n data() {\n return {\n loading: scope.loading,\n loadingMessage: scope.loadingMessage,\n };\n },\n });\n app.config.globalProperties.$sanitize = window.vueSanitize;\n app.component('activity-indicator', ActivityIndicator);\n const vm = app.mount(element[0]);\n\n scope.$watch('loading', (newValue: boolean) => {\n vm.loading = newValue;\n });\n\n scope.$watch('loadingMessage', (newValue: string) => {\n vm.loadingMessage = newValue || translate('General_LoadingData');\n });\n },\n };\n}\n\nactivityIndicatorAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikActivityIndicator', activityIndicatorAdapter);\n","\n\n\n\n\n","\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n props: {\n severity: {\n type: String,\n required: true,\n },\n },\n});\n","import { render } from \"./Alert.vue?vue&type=template&id=c3863ae2\"\nimport script from \"./Alert.vue?vue&type=script&lang=ts\"\nexport * from \"./Alert.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","/*!\n * Matomo - free/libre analytics platform\n *\n * @link https://matomo.org\n * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later\n */\n\nimport { createApp, ref } from 'vue';\nimport Alert from './Alert.vue';\n\ninterface AlertAdapterScope extends ng.IScope {\n severity: string;\n}\n\nexport default function alertAdapter(): ng.IDirective {\n return {\n restrict: 'A',\n transclude: true,\n scope: {\n severity: '@piwikAlert',\n },\n template: '
',\n compile: function alertAdapterCompile() {\n return {\n post: function alertAdapterPostLink(\n scope: AlertAdapterScope,\n element: ng.IAugmentedJQuery,\n ) {\n const clone = element.find('[ng-transclude]');\n\n const app = createApp({\n template: '
',\n data() {\n return { severity: scope.severity };\n },\n setup() {\n const transcludeTarget = ref(null);\n return {\n transcludeTarget,\n };\n },\n });\n app.config.globalProperties.$sanitize = window.vueSanitize;\n app.component('alert', Alert);\n const vm = app.mount(element[0]);\n\n scope.$watch('severity', (newValue: string) => {\n vm.severity = newValue;\n });\n\n $(vm.transcludeTarget).append(clone);\n },\n };\n },\n };\n}\n\nalertAdapter.$inject = [];\n\nangular.module('piwikApp').directive('piwikAlert', alertAdapter);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts b/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts index 96ed62b476..0ca0ac8241 100644 --- a/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts +++ b/plugins/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.adapter.ts @@ -35,6 +35,7 @@ export default function activityIndicatorAdapter(): ng.IDirective { }; }, }); + app.config.globalProperties.$sanitize = window.vueSanitize; app.component('activity-indicator', ActivityIndicator); const vm = app.mount(element[0]); diff --git a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts index 788f3a8f45..c4e61b2ad5 100644 --- a/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts +++ b/plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts @@ -5,7 +5,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import PiwikUrl from '../PiwikUrl/PiwikUrl'; +import MatomoUrl from '../MatomoUrl/MatomoUrl'; +import Matomo from '../Matomo/Matomo'; window.globalAjaxQueue = [] as GlobalAjaxQueue; window.globalAjaxQueue.active = 0; @@ -62,7 +63,7 @@ function defaultErrorCallback(deferred: XMLHttpRequest, status: string): void { } /** - * Global ajax helper to handle requests within piwik + * Global ajax helper to handle requests within Matomo */ export default class AjaxHelper { /** @@ -87,6 +88,8 @@ export default class AjaxHelper { /** * Callback function to be executed on error + * + * @deprecated use the jquery promise API */ errorCallback: AnyFunction; @@ -94,6 +97,8 @@ export default class AjaxHelper { /** * Callback function to be executed on complete (after error or success) + * + * @deprecated use the jquery promise API */ completeCallback: AnyFunction; @@ -212,6 +217,7 @@ export default class AjaxHelper { * Sets the callback called after the request finishes * * @param callback Callback function + * @deprecated use the jquery promise API */ setCallback(callback: AnyFunction): void { this.callback = callback; @@ -240,6 +246,8 @@ export default class AjaxHelper { /** * Sets the callback called in case of an error within the request + * + * @deprecated use the jquery promise API */ setErrorCallback(callback: AnyFunction): void { this.errorCallback = callback; @@ -247,6 +255,8 @@ export default class AjaxHelper { /** * Sets the complete callback which is called after an error or success callback. + * + * @deprecated use the jquery promise API */ setCompleteCallback(callback: AnyFunction): void { this.completeCallback = callback; @@ -315,7 +325,7 @@ export default class AjaxHelper { /** * Send the request */ - send(): void { + send(): JQuery.jqXHR { if ($(this.errorElement).length) { $(this.errorElement).hide(); } @@ -326,6 +336,8 @@ export default class AjaxHelper { this.requestHandle = this.buildAjaxCall(); globalAjaxQueue.push(this.requestHandle); + + return this.requestHandle; } /** @@ -404,11 +416,8 @@ export default class AjaxHelper { } globalAjaxQueue.active -= 1; - const { piwik } = window; - if (piwik - && piwik.ajaxRequestFinished - ) { - piwik.ajaxRequestFinished(); + if (Matomo.ajaxRequestFinished) { + Matomo.ajaxRequestFinished(); } }, data: this.mixinDefaultPostParams(this.postParams), @@ -428,9 +437,9 @@ export default class AjaxHelper { } private getDefaultPostParams() { - if (this.withToken || this.isRequestToApiMethod() || piwik.shouldPropagateTokenAuth) { + if (this.withToken || this.isRequestToApiMethod() || Matomo.shouldPropagateTokenAuth) { return { - token_auth: piwik.token_auth, + token_auth: Matomo.token_auth, // When viewing a widgetized report there won't be any session that can be used, so don't // force session usage force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1, @@ -462,11 +471,11 @@ export default class AjaxHelper { * @param params parameter object */ private mixinDefaultGetParams(originalParams): Parameters { - const segment = PiwikUrl.getSearchParam('segment'); + const segment = MatomoUrl.getSearchParam('segment'); const defaultParams = { - idSite: piwik.idSite || broadcast.getValueFromUrl('idSite'), - period: piwik.period || broadcast.getValueFromUrl('period'), + idSite: Matomo.idSite || broadcast.getValueFromUrl('idSite'), + period: Matomo.period || broadcast.getValueFromUrl('period'), segment, }; @@ -490,7 +499,7 @@ export default class AjaxHelper { // handle default date & period if not already set if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) { - params.date = piwik.currentDateString; + params.date = Matomo.currentDateString; } return params; diff --git a/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts b/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts index c1f32e8461..5cecb97a81 100644 --- a/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts +++ b/plugins/CoreHome/vue/src/Alert/Alert.adapter.ts @@ -40,6 +40,7 @@ export default function alertAdapter(): ng.IDirective { }; }, }); + app.config.globalProperties.$sanitize = window.vueSanitize; app.component('alert', Alert); const vm = app.mount(element[0]); diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts new file mode 100644 index 0000000000..e76adb190b --- /dev/null +++ b/plugins/CoreHome/vue/src/Matomo/Matomo.adapter.ts @@ -0,0 +1,22 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import Matomo from './Matomo'; + +function piwikService() { + return Matomo; +} + +angular.module('piwikApp.service').service('piwik', piwikService); + +function initPiwikService(piwik, $rootScope) { + $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); +} + +initPiwikService.$inject = ['piwik', '$rootScope']; + +angular.module('piwikApp.service').run(initPiwikService); diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.spec.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.spec.ts new file mode 100644 index 0000000000..49ab7f5b4a --- /dev/null +++ b/plugins/CoreHome/vue/src/Matomo/Matomo.spec.ts @@ -0,0 +1,152 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +import Matomo from './Matomo'; +import '../Periods/Day'; +import '../Periods/Week'; +import '../Periods/Month'; +import '../Periods/Year'; +import '../Periods/Range'; + +describe('CoreHome/Matomo', () => { + describe('#updatePeriodParamsFromUrl()', () => { + const DATE_PERIODS_TO_TEST = [ + { + date: '2012-01-02', + period: 'day', + expected: { + currentDateString: '2012-01-02', + period: 'day', + startDateString: '2012-01-02', + endDateString: '2012-01-02' + } + }, + { + date: '2012-01-02', + period: 'week', + expected: { + currentDateString: '2012-01-02', + period: 'week', + startDateString: '2012-01-02', + endDateString: '2012-01-08' + } + }, + { + date: '2012-01-02', + period: 'month', + expected: { + currentDateString: '2012-01-02', + period: 'month', + startDateString: '2012-01-01', + endDateString: '2012-01-31' + } + }, + { + date: '2012-01-02', + period: 'year', + expected: { + currentDateString: '2012-01-02', + period: 'year', + startDateString: '2012-01-01', + endDateString: '2012-12-31' + } + }, + { + date: '2012-01-02,2012-02-03', + period: 'range', + expected: { + currentDateString: '2012-01-02,2012-02-03', + period: 'range', + startDateString: '2012-01-02', + endDateString: '2012-02-03' + } + }, + // invalid + { + date: '2012-01-02', + period: 'range', + expected: { + currentDateString: undefined, + period: undefined, + startDateString: undefined, + endDateString: undefined + } + }, + { + date: 'sldfjkdslkfj', + period: 'month', + expected: { + currentDateString: undefined, + period: undefined, + startDateString: undefined, + endDateString: undefined + } + }, + { + date: '2012-01-02', + period: 'sflkjdslkfj', + expected: { + currentDateString: undefined, + period: undefined, + startDateString: undefined, + endDateString: undefined + } + } + ]; + + DATE_PERIODS_TO_TEST.forEach((test) => { + const date = test.date, + period = test.period, + expected = test.expected; + + it(`should parse the period in the URL correctly when date=${date} and period=${period}`, () => { + delete Matomo.currentDateString; + delete Matomo.period; + delete Matomo.startDateString; + delete Matomo.endDateString; + + history.pushState(null, '', '?date=' + date + '&period=' + period); + + Matomo.updatePeriodParamsFromUrl(); + + expect(Matomo.currentDateString).toEqual(expected.currentDateString); + expect(Matomo.period).toEqual(expected.period); + expect(Matomo.startDateString).toEqual(expected.startDateString); + expect(Matomo.endDateString).toEqual(expected.endDateString); + }); + + it('should parse the period in the URL hash correctly when date=' + date + ' and period=' + period, () => { + delete Matomo.currentDateString; + delete Matomo.period; + delete Matomo.startDateString; + delete Matomo.endDateString; + + history.pushState(null, '', '?someparam=somevalue#?date=' + date + '&period=' + period); + + Matomo.updatePeriodParamsFromUrl(); + + expect(Matomo.currentDateString).toEqual(expected.currentDateString); + expect(Matomo.period).toEqual(expected.period); + expect(Matomo.startDateString).toEqual(expected.startDateString); + expect(Matomo.endDateString).toEqual(expected.endDateString); + }); + }); + + it('should not change object values if the current date/period is the same as the URL date/period', () => { + Matomo.period = 'range'; + Matomo.currentDateString = '2012-01-01,2012-01-02'; + Matomo.startDateString = 'shouldnotchange'; + Matomo.endDateString = 'shouldnotchangeeither'; + + history.pushState(null, '', '?someparam=somevalue#?date=' + Matomo.currentDateString + '&period=' + Matomo.period); + + Matomo.updatePeriodParamsFromUrl(); + + expect(Matomo.startDateString).toEqual('shouldnotchange'); + expect(Matomo.endDateString).toEqual('shouldnotchangeeither'); + }); + }); +}); diff --git a/plugins/CoreHome/vue/src/Matomo/Matomo.ts b/plugins/CoreHome/vue/src/Matomo/Matomo.ts new file mode 100644 index 0000000000..2a705f665e --- /dev/null +++ b/plugins/CoreHome/vue/src/Matomo/Matomo.ts @@ -0,0 +1,78 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import MatomoUrl from '../MatomoUrl/MatomoUrl'; +import Periods from '../Periods/Periods'; +import { format } from '../Periods/utilities'; + +let originalTitle: string; + +const { piwik, broadcast, piwikHelper } = window; + +piwik.helper = piwikHelper; +piwik.broadcast = broadcast; + +function isValidPeriod(periodStr: string, dateStr: string) { + try { + Periods.parse(periodStr, dateStr); + return true; + } catch (e) { + return false; + } +} + +piwik.updatePeriodParamsFromUrl = function updatePeriodParamsFromUrl() { + let date = MatomoUrl.getSearchParam('date'); + const period = MatomoUrl.getSearchParam('period'); + if (!isValidPeriod(period, date)) { + // invalid data in URL + return; + } + + if (piwik.period === period && piwik.currentDateString === date) { + // this period / date is already loaded + return; + } + + piwik.period = period; + + const dateRange = Periods.parse(period, date).getDateRange(); + piwik.startDateString = format(dateRange[0]); + piwik.endDateString = format(dateRange[1]); + + piwik.updateDateInTitle(date, period); + + // do not set anything to previousN/lastN, as it's more useful to plugins + // to have the dates than previousN/lastN. + if (piwik.period === 'range') { + date = `${piwik.startDateString},${piwik.endDateString}`; + } + + piwik.currentDateString = date; +}; + +piwik.updateDateInTitle = function updateDateInTitle(date: string, period: string) { + if (!$('.top_controls #periodString').length) { + return; + } + + // Cache server-rendered page title + originalTitle = originalTitle || document.title; + + if (originalTitle.indexOf(piwik.siteName) === 0) { + const dateString = ` - ${Periods.parse(period, date).getPrettyString()} `; + document.title = `${piwik.siteName}${dateString}${originalTitle.substr(piwik.siteName.length)}`; + } +}; + +piwik.hasUserCapability = function hasUserCapability(capability: string) { + return window.angular.isArray(piwik.userCapabilities) + && piwik.userCapabilities.indexOf(capability) !== -1; +}; + +const Matomo = piwik; +export default Matomo; diff --git a/plugins/CoreHome/vue/src/MatomoHelper/MatomoHelper.spec.ts b/plugins/CoreHome/vue/src/MatomoHelper/MatomoHelper.spec.ts new file mode 100644 index 0000000000..c936a6e5ed --- /dev/null +++ b/plugins/CoreHome/vue/src/MatomoHelper/MatomoHelper.spec.ts @@ -0,0 +1,29 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import '../../../../Morpheus/javascripts/piwikHelper'; + +describe('CoreHome/piwikHelper', () => { + describe('#htmlDecode', () => { + + it('should correctly decode html entities', function (done) { + let called = false; + (window as any)._testfunction = () => { + called = true; + }; + + const encoded = 'str '; + const decoded = window.piwikHelper.htmlDecode(encoded); + + setTimeout(() => { + expect(called).toBe(false); + expect(decoded).toEqual('str '); + done(); + }, 500); + }); + }); +}); diff --git a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts new file mode 100644 index 0000000000..b82329739b --- /dev/null +++ b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts @@ -0,0 +1,19 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +import MatomoUrl from './MatomoUrl'; + +function piwikUrl() { + const model = { + getSearchParam: MatomoUrl.getSearchParam.bind(MatomoUrl), + }; + + return model; +} + +piwikUrl.$inject = []; + +angular.module('piwikApp.service').service('piwikUrl', piwikUrl); diff --git a/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts new file mode 100644 index 0000000000..8c69e2834f --- /dev/null +++ b/plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts @@ -0,0 +1,32 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +/** + * Similar to angulars $location but works around some limitation. Use it if you need to access + * search params + */ +const MatomoUrl = { + getSearchParam(paramName: string): string { + const hash = window.location.href.split('#'); + + const regex = new RegExp(`${paramName}(\\[]|=)`); + if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) { + const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href); + + // for date, period and idsite fall back to parameter from url, if non in hash was provided + if (valueFromHash + || (paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite') + ) { + return valueFromHash; + } + } + + return window.broadcast.getValueFromUrl(paramName, window.location.search); + }, +}; + +export default MatomoUrl; diff --git a/plugins/CoreHome/vue/src/Periods/Periods.ts b/plugins/CoreHome/vue/src/Periods/Periods.ts index b832629e26..ca56625212 100644 --- a/plugins/CoreHome/vue/src/Periods/Periods.ts +++ b/plugins/CoreHome/vue/src/Periods/Periods.ts @@ -17,16 +17,16 @@ interface PeriodClass { } /** - * Piwik period management service for the frontend. + * Matomo period management service for the frontend. * * Usage: * - * var DayPeriod = piwikPeriods.get('day'); + * var DayPeriod = matomoPeriods.get('day'); * var day = new DayPeriod(new Date()); * * or * - * var day = piwikPeriods.parse('day', '2013-04-05'); + * var day = matomoPeriods.parse('day', '2013-04-05'); * * Adding custom periods: * @@ -43,9 +43,9 @@ interface PeriodClass { * - (_static_) **getDisplayText**: returns translated text for the period, eg, 'month', * 'week', etc. * - * Then call piwik.addCustomPeriod w/ your period class: + * Then call Periods.addCustomPeriod w/ your period class: * - * piwik.addCustomPeriod('mycustomperiod', MyCustomPeriod); + * Periods.addCustomPeriod('mycustomperiod', MyCustomPeriod); * * NOTE: currently only single date periods like day, week, month year can * be extended. Other types of periods that require a special UI to diff --git a/plugins/CoreHome/vue/src/Periods/index.ts b/plugins/CoreHome/vue/src/Periods/index.ts index e0ec84affb..c1a265b4dc 100644 --- a/plugins/CoreHome/vue/src/Periods/index.ts +++ b/plugins/CoreHome/vue/src/Periods/index.ts @@ -12,3 +12,4 @@ export { default as Week } from './Week'; export { default as Month } from './Month'; export { default as Year } from './Year'; export { default as Range } from './Range'; +export * from './utilities'; diff --git a/plugins/CoreHome/vue/src/Periods/utilities.ts b/plugins/CoreHome/vue/src/Periods/utilities.ts index 167021fe36..b5488b7c01 100644 --- a/plugins/CoreHome/vue/src/Periods/utilities.ts +++ b/plugins/CoreHome/vue/src/Periods/utilities.ts @@ -15,7 +15,7 @@ export function getToday(): Date { // undo browser timezone date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000); - // apply piwik site timezone (if it exists) + // apply Matomo site timezone (if it exists) date.setHours(date.getHours() + ((window.piwik.timezoneOffset || 0) / 3600)); // get rid of hours/minutes/seconds/etc. diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts index 97d056019f..d0b4b8a8fb 100644 --- a/plugins/CoreHome/vue/src/index.ts +++ b/plugins/CoreHome/vue/src/index.ts @@ -5,6 +5,15 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ +import './MatomoUrl/MatomoUrl.adapter'; +import './Matomo/Matomo.adapter'; +import './noAdblockFlag'; +import './Periods/Day'; +import './Periods/Week'; +import './Periods/Month'; +import './Periods/Year'; +import './Periods/Range'; +import './Periods/Periods.adapter'; import './AjaxHelper/AjaxHelper.adapter'; import './PiwikUrl/PiwikUrl.adapter'; import './Piwik/Piwik.adapter'; @@ -14,6 +23,6 @@ export { default as ActivityIndicator } from './ActivityIndicator/ActivityIndica export { default as translate } from './translate'; export { default as alertAdapter } from './Alert/Alert.adapter'; export { default as AjaxHelper } from './AjaxHelper/AjaxHelper'; -export { default as PiwikUrl } from './PiwikUrl/PiwikUrl'; -export { default as Piwik } from './Piwik/Piwik'; +export { default as MatomoUrl } from './MatomoUrl/MatomoUrl'; +export { default as Matomo } from './Matomo/Matomo'; export * from './Periods'; diff --git a/plugins/CoreHome/vue/src/noAdblockFlag.ts b/plugins/CoreHome/vue/src/noAdblockFlag.ts new file mode 100644 index 0000000000..3a5cd0a76e --- /dev/null +++ b/plugins/CoreHome/vue/src/noAdblockFlag.ts @@ -0,0 +1,9 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +// see https://github.com/matomo-org/matomo/issues/5094 used to detect an ad blocker +window.hasBlockedContent = false; -- cgit v1.2.3