From c8650acb5bf2c7665762aa919bd957f3acfc4561 Mon Sep 17 00:00:00 2001 From: dizzy Date: Fri, 31 Dec 2021 20:56:58 -0800 Subject: [Vue] migrate smaller core home common directives and deprecate others (#18446) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * undo screenshot changes * Menus test passing locally * [Vue] date picker viewDate property is not kept up to date (#18385) * viewDate ref is not kept up to date * rebuild corehome * reporting menu subcategory items are meant to be normal links * update some screenshots * use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add * trigger angularjs digest after ajaxhelper request * rebuild vue * update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time * undo box-shadow change for UI tests * fix more issues & update more tests * update some screenshots * fix some tests * rebuild CoreHome * quick fix * built vue files * fix angularjs issue * add comment * update umd files * 4.6.1-rc1 * 4.6.1 * fix field array title * apply some pr feedback * apply more pr feedback * another fix * tweak * fix ng-change not executed before ng-model * fix another set of issues * fix another issue * rebuild vue * better ng-change/ng-model fix * update some screenshots * rebuild vue * remove some TODOs * initiate initial ng-change ONLY for site selectors where this behavior applies * emit/broadcast on correct scope in wrapper * rebuild vue * fix some issues * couple more fixes * fix another title issue * rebuild vue * do not report on ajax errors in notifications if not logged in * migrate reporting page and model * rebuild vue * create sites selector model adapter * fix siteselector vue bug, initial site is only set if there is just one site available * rebuild vue * migrate plugin settings directive * remove TODO * migrate plugin filter directive * migrate two more plugins directives * migrate save button * fix a bunch of bugs * fix another widget bug * allow change event name between angularjs and vue * rebuild vue * migrate plugin form directive * get to work * migrate select-on-focus directive and start migrating report-export directive * finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it * rebuild vue * remove angularjs files and move less contents to vue dir * migrate sparkline component * migrate progressbar component * migrate content intro & content table directives * rebuild vue * migrate piwik-ajax-form component to vue * migrate popover handler directive to service class * migrate dropdownbutton directive though it does not seem to be in use * migrate show sensitive data directive * build vue * built vue files * fix function signature * fix vue warning * fix ajax request race condition * rebuild vue * add new notification type "help" so the help notification is not cleared when clearing transient notifications * fix some bugs and tests * update screenshot * update screenshot & fix a test * allow using unminified jquery ui + fix bug in last fix * fix error when enrichedheadline is used in modal * add polyfill min.js * remove two todos * fix widget url logic * update some screenshots and fix sanitization/escape issue * update screenshots * rebuild vue * fix url location updating regression in MatomoUrl.updateLocation use * submodule * update screenshots and fix possible error in json parse * built vue files * Merge branch 'vue-period-selector-regression' into vue-reporting-menu * rebuild vue * use correct variable * rebuild vue * fix widget url logic * segment parameter can be undefined now for some reason * fix ngmodel binding in siteselector adapter (for last time hopefully) * the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance * fix sitesmanager ui test failure * fix usersettings test failure * rebuild vue * more siteselector tweaks. * build CoreHome * more siteselector tweaks. * another siteselector issue * update screenshots * update screenshot and try to fix random failure * fix some issues in widget.vue when containerid is specified * fix couple tests * fix several test failures * fix string concat * fix test failure * extra change * fix last change and random failure * styling fix * fix last fix * real fix this time * fix stray request * proper fix * update build files * try to fix random failure * do not submit form * check for api errors in promise chain in ajaxhelper.ts * force a digest after a location change * use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure * some UI test fixes * fix some report export issues * several save button fixes + make replace approximation in createAngularJsAdapter better * fix sparkline * apply after manual click triggering in savebutton * css fixes and piwik-content-table was never applied by angularjs in installtion * rebuild vue * add names to divs so they can still be queried as they were in angularjs * rebuild vue * rebuild vue * now that format_metrics checkbox works, need to check it * small delay before processing first popover * fix dropdown class/directive name * fix overlay test * remove unintended changes * remove unintended changes * update screenshots * Show a summary of new features (#18065) * Added "What is new" notification display, populated by a new event * Removed test example event hook * Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items * Updated UI test screenshots * Revert accidental edit * Hide the "What's new" icon if there are no new features to show * Changed to use changes.json, track user last viewed, added ui test * Fix UserManager unit tests broken by new ts_changes_viewed user field * Moved getChanges to separate helper class, added unit test, added user view access check * Updated to add new changes table and populate only on plugin update/install * Added missing fixture class, updated UI screenshots * Updated matomo font to add ringing bell and new releases icons * Fix for integration test * Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups * built vue files * built vue files * Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields * Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements * Revert accidental UI screenshot commit * Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE * Integration test fix, UI screenshot updates * Test fix * Added link styling, show CoreHome changes without plugin prefix in title * Update UI test screenshot * Added styles to the popover, added event for filtering changes * Test fix * UI test screenshot updates Co-authored-by: sgiehl Co-authored-by: bx80 * Update test translation (#18531) update a test failed XML * updates all submodules (#18541) Co-authored-by: diosmosis * Translations update from Hosted Weblate (#18529) * Translated using Weblate (Greek) Currently translated at 100.0% (162 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/ [ci skip] Co-authored-by: Hosted Weblate Co-authored-by: Vasilis Lourdas * Translated using Weblate (Chinese (Simplified)) Currently translated at 83.9% (136 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/ [ci skip] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.6% (620 of 622 strings) Translation: Matomo/Matomo Base Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/ [ci skip] Co-authored-by: Hosted Weblate Co-authored-by: 刘韬 * Update translation files Updated by "Squash Git commits" hook in Weblate. Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/ [ci skip] Co-authored-by: Vasilis Lourdas Co-authored-by: 刘韬 * [Vue] migrate report export directive and popover (#18440) * update files * sidenav start * make getRef a utility method * tweak * add return type * finish converting side-nav directive * starting on reporting menu conversion * remove unused properties * convert reporting pages service * migrate report metadata store * remove angularjs files * migrating reporting pages store * make store adapters more immutable * get service adapters to work * fix a UI test * another html fix * migrate most of reporting menu directive and model * Use themed font family for input forms to override materialize.css styling * rebuild vue * add a missing div * ui test fixes * update styling * get to build * get to load in the UI w/o error * clone result of functions * fix compile issue * migrate widget loader and get to load in UI * rebuild vue * migrate widgetcontainer * migrate widget bydimension container * migrate widget + add tooltips directive * quick fix * Updating version to 4.6.0 * loading in page * update expected screenshot * add wait just in case travis is slow * fix ordering bug * add another wait * rebuild vue * css tweak * fix some bugs and tests * undo screenshot changes * Menus test passing locally * [Vue] date picker viewDate property is not kept up to date (#18385) * viewDate ref is not kept up to date * rebuild corehome * reporting menu subcategory items are meant to be normal links * update some screenshots * use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add * trigger angularjs digest after ajaxhelper request * rebuild vue * update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time * undo box-shadow change for UI tests * fix more issues & update more tests * update some screenshots * fix some tests * rebuild CoreHome * quick fix * built vue files * fix angularjs issue * add comment * update umd files * 4.6.1-rc1 * 4.6.1 * fix field array title * apply some pr feedback * apply more pr feedback * another fix * tweak * fix ng-change not executed before ng-model * fix another set of issues * fix another issue * rebuild vue * better ng-change/ng-model fix * update some screenshots * rebuild vue * remove some TODOs * initiate initial ng-change ONLY for site selectors where this behavior applies * emit/broadcast on correct scope in wrapper * rebuild vue * fix some issues * couple more fixes * fix another title issue * rebuild vue * do not report on ajax errors in notifications if not logged in * migrate reporting page and model * rebuild vue * create sites selector model adapter * fix siteselector vue bug, initial site is only set if there is just one site available * rebuild vue * migrate plugin settings directive * remove TODO * migrate plugin filter directive * migrate two more plugins directives * migrate save button * fix a bunch of bugs * fix another widget bug * allow change event name between angularjs and vue * rebuild vue * migrate plugin form directive * get to work * migrate select-on-focus directive and start migrating report-export directive * finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it * rebuild vue * remove angularjs files and move less contents to vue dir * built vue files * fix function signature * fix vue warning * fix ajax request race condition * rebuild vue * add new notification type "help" so the help notification is not cleared when clearing transient notifications * fix some bugs and tests * update screenshot * update screenshot & fix a test * allow using unminified jquery ui + fix bug in last fix * fix error when enrichedheadline is used in modal * add polyfill min.js * remove two todos * fix widget url logic * update some screenshots and fix sanitization/escape issue * update screenshots * rebuild vue * fix url location updating regression in MatomoUrl.updateLocation use * submodule * update screenshots and fix possible error in json parse * built vue files * Merge branch 'vue-period-selector-regression' into vue-reporting-menu * rebuild vue * use correct variable * rebuild vue * fix widget url logic * segment parameter can be undefined now for some reason * fix ngmodel binding in siteselector adapter (for last time hopefully) * the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance * fix sitesmanager ui test failure * fix usersettings test failure * rebuild vue * more siteselector tweaks. * build CoreHome * more siteselector tweaks. * another siteselector issue * update screenshots * update screenshot and try to fix random failure * fix some issues in widget.vue when containerid is specified * fix couple tests * fix several test failures * fix string concat * fix test failure * extra change * fix last change and random failure * styling fix * fix last fix * real fix this time * fix stray request * proper fix * update build files * try to fix random failure * do not submit form * check for api errors in promise chain in ajaxhelper.ts * force a digest after a location change * use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure * some UI test fixes * fix some report export issues * several save button fixes + make replace approximation in createAngularJsAdapter better * apply after manual click triggering in savebutton * add names to divs so they can still be queried as they were in angularjs * rebuild vue * now that format_metrics checkbox works, need to check it * fix unintended changes * updated expected screenshots * update two more * go back to previous format_metrics behavior in popover Co-authored-by: Justin Velluppillai Co-authored-by: justinvelluppillai Co-authored-by: Matthieu Aubry * [Vue] remove support in vue for FormField.allSettings (#18542) * deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work * built vue files * update screenshots * update screenshot * Show a summary of new features (#18065) * Added "What is new" notification display, populated by a new event * Removed test example event hook * Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items * Updated UI test screenshots * Revert accidental edit * Hide the "What's new" icon if there are no new features to show * Changed to use changes.json, track user last viewed, added ui test * Fix UserManager unit tests broken by new ts_changes_viewed user field * Moved getChanges to separate helper class, added unit test, added user view access check * Updated to add new changes table and populate only on plugin update/install * Added missing fixture class, updated UI screenshots * Updated matomo font to add ringing bell and new releases icons * Fix for integration test * Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups * built vue files * built vue files * Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields * Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements * Revert accidental UI screenshot commit * Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE * Integration test fix, UI screenshot updates * Test fix * Added link styling, show CoreHome changes without plugin prefix in title * Update UI test screenshot * Added styles to the popover, added event for filtering changes * Test fix * UI test screenshot updates Co-authored-by: sgiehl Co-authored-by: bx80 * Update test translation (#18531) update a test failed XML * updates all submodules (#18541) Co-authored-by: diosmosis * Translations update from Hosted Weblate (#18529) * Translated using Weblate (Greek) Currently translated at 100.0% (162 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/ [ci skip] Co-authored-by: Hosted Weblate Co-authored-by: Vasilis Lourdas * Translated using Weblate (Chinese (Simplified)) Currently translated at 83.9% (136 of 162 strings) Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/ [ci skip] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.6% (620 of 622 strings) Translation: Matomo/Matomo Base Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/ [ci skip] Co-authored-by: Hosted Weblate Co-authored-by: 刘韬 * Update translation files Updated by "Squash Git commits" hook in Weblate. Translation: Matomo/Plugin CoreAdminHome Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/ [ci skip] Co-authored-by: Vasilis Lourdas Co-authored-by: 刘韬 * [Vue] migrate report export directive and popover (#18440) * update files * sidenav start * make getRef a utility method * tweak * add return type * finish converting side-nav directive * starting on reporting menu conversion * remove unused properties * convert reporting pages service * migrate report metadata store * remove angularjs files * migrating reporting pages store * make store adapters more immutable * get service adapters to work * fix a UI test * another html fix * migrate most of reporting menu directive and model * Use themed font family for input forms to override materialize.css styling * rebuild vue * add a missing div * ui test fixes * update styling * get to build * get to load in the UI w/o error * clone result of functions * fix compile issue * migrate widget loader and get to load in UI * rebuild vue * migrate widgetcontainer * migrate widget bydimension container * migrate widget + add tooltips directive * quick fix * Updating version to 4.6.0 * loading in page * update expected screenshot * add wait just in case travis is slow * fix ordering bug * add another wait * rebuild vue * css tweak * fix some bugs and tests * undo screenshot changes * Menus test passing locally * [Vue] date picker viewDate property is not kept up to date (#18385) * viewDate ref is not kept up to date * rebuild corehome * reporting menu subcategory items are meant to be normal links * update some screenshots * use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add * trigger angularjs digest after ajaxhelper request * rebuild vue * update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time * undo box-shadow change for UI tests * fix more issues & update more tests * update some screenshots * fix some tests * rebuild CoreHome * quick fix * built vue files * fix angularjs issue * add comment * update umd files * 4.6.1-rc1 * 4.6.1 * fix field array title * apply some pr feedback * apply more pr feedback * another fix * tweak * fix ng-change not executed before ng-model * fix another set of issues * fix another issue * rebuild vue * better ng-change/ng-model fix * update some screenshots * rebuild vue * remove some TODOs * initiate initial ng-change ONLY for site selectors where this behavior applies * emit/broadcast on correct scope in wrapper * rebuild vue * fix some issues * couple more fixes * fix another title issue * rebuild vue * do not report on ajax errors in notifications if not logged in * migrate reporting page and model * rebuild vue * create sites selector model adapter * fix siteselector vue bug, initial site is only set if there is just one site available * rebuild vue * migrate plugin settings directive * remove TODO * migrate plugin filter directive * migrate two more plugins directives * migrate save button * fix a bunch of bugs * fix another widget bug * allow change event name between angularjs and vue * rebuild vue * migrate plugin form directive * get to work * migrate select-on-focus directive and start migrating report-export directive * finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it * rebuild vue * remove angularjs files and move less contents to vue dir * built vue files * fix function signature * fix vue warning * fix ajax request race condition * rebuild vue * add new notification type "help" so the help notification is not cleared when clearing transient notifications * fix some bugs and tests * update screenshot * update screenshot & fix a test * allow using unminified jquery ui + fix bug in last fix * fix error when enrichedheadline is used in modal * add polyfill min.js * remove two todos * fix widget url logic * update some screenshots and fix sanitization/escape issue * update screenshots * rebuild vue * fix url location updating regression in MatomoUrl.updateLocation use * submodule * update screenshots and fix possible error in json parse * built vue files * Merge branch 'vue-period-selector-regression' into vue-reporting-menu * rebuild vue * use correct variable * rebuild vue * fix widget url logic * segment parameter can be undefined now for some reason * fix ngmodel binding in siteselector adapter (for last time hopefully) * the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance * fix sitesmanager ui test failure * fix usersettings test failure * rebuild vue * more siteselector tweaks. * build CoreHome * more siteselector tweaks. * another siteselector issue * update screenshots * update screenshot and try to fix random failure * fix some issues in widget.vue when containerid is specified * fix couple tests * fix several test failures * fix string concat * fix test failure * extra change * fix last change and random failure * styling fix * fix last fix * real fix this time * fix stray request * proper fix * update build files * try to fix random failure * do not submit form * check for api errors in promise chain in ajaxhelper.ts * force a digest after a location change * use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure * some UI test fixes * fix some report export issues * several save button fixes + make replace approximation in createAngularJsAdapter better * apply after manual click triggering in savebutton * add names to divs so they can still be queried as they were in angularjs * rebuild vue * now that format_metrics checkbox works, need to check it * fix unintended changes * updated expected screenshots * update two more * go back to previous format_metrics behavior in popover Co-authored-by: Justin Velluppillai Co-authored-by: justinvelluppillai Co-authored-by: Matthieu Aubry * [Vue] remove support in vue for FormField.allSettings (#18542) * deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work * built vue files * update screenshots Co-authored-by: Justin Velluppillai Co-authored-by: justinvelluppillai Co-authored-by: Matthieu Aubry Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com> Co-authored-by: sgiehl Co-authored-by: bx80 Co-authored-by: Peter Zhang Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Weblate (bot) Co-authored-by: Vasilis Lourdas Co-authored-by: 刘韬 --- plugins/CoreHome/CoreHome.php | 1 - .../angularjs/common/directives/attributes.js | 3 + .../common/directives/autocomplete-matched.js | 3 + .../angularjs/common/directives/dropdown-button.js | 45 ------- .../common/directives/show-sensitive-data.js | 12 +- .../angularjs/common/directives/translate.js | 3 + plugins/CoreHome/vue/dist/CoreHome.umd.js | 145 +++++++++++++++++++- plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 150 ++++++++++++--------- .../src/DropdownButton/DropdownButton.adapter.ts | 22 +++ .../vue/src/DropdownButton/DropdownButton.ts | 32 +++++ .../ShowSensitiveData/ShowSensitiveData.adapter.ts | 34 +++++ .../vue/src/ShowSensitiveData/ShowSensitiveData.ts | 65 +++++++++ plugins/CoreHome/vue/src/index.ts | 4 + tests/UI/specs/EvolutionGraph_spec.js | 2 +- 14 files changed, 400 insertions(+), 121 deletions(-) delete mode 100644 plugins/CoreHome/angularjs/common/directives/dropdown-button.js create mode 100644 plugins/CoreHome/vue/src/DropdownButton/DropdownButton.adapter.ts create mode 100644 plugins/CoreHome/vue/src/DropdownButton/DropdownButton.ts create mode 100644 plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts create mode 100644 plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.ts diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php index f0f7e0707c..a3edba6566 100644 --- a/plugins/CoreHome/CoreHome.php +++ b/plugins/CoreHome/CoreHome.php @@ -218,7 +218,6 @@ class CoreHome extends \Piwik\Plugin $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/ignore-click.js"; $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/onenter.js"; $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/translate.js"; - $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/dropdown-button.js"; $jsFiles[] = "plugins/CoreHome/angularjs/common/directives/string-to-number.js"; $jsFiles[] = "plugins/CoreHome/angularjs/piwikApp.js"; diff --git a/plugins/CoreHome/angularjs/common/directives/attributes.js b/plugins/CoreHome/angularjs/common/directives/attributes.js index 125c28171b..7f4a30b60d 100644 --- a/plugins/CoreHome/angularjs/common/directives/attributes.js +++ b/plugins/CoreHome/angularjs/common/directives/attributes.js @@ -20,6 +20,9 @@ piwikAttributes.$inject = ['$sanitize']; + /** + * @deprecated + */ function piwikAttributes(piwik, $sanitize) { return { diff --git a/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js b/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js index faad0b04da..5bf1a9a6bb 100644 --- a/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js +++ b/plugins/CoreHome/angularjs/common/directives/autocomplete-matched.js @@ -22,6 +22,9 @@ piwikAutocompleteMatched.$inject = ['piwik', '$sanitize']; + /** + * @deprecated + */ function piwikAutocompleteMatched(piwik, $sanitize) { return { diff --git a/plugins/CoreHome/angularjs/common/directives/dropdown-button.js b/plugins/CoreHome/angularjs/common/directives/dropdown-button.js deleted file mode 100644 index 1a0c001007..0000000000 --- a/plugins/CoreHome/angularjs/common/directives/dropdown-button.js +++ /dev/null @@ -1,45 +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').directive('dropdownButton', piwikDropdownButton); - - piwikDropdownButton.$inject = ['piwik']; - - function piwikDropdownButton(piwik){ - - return { - restrict: 'C', - compile: function (element, attrs) { - // BC for materializecss 0.97 => 1.0 - if (!element.attr('data-target') - && element.attr('data-activates') - ) { - element.attr('data-target', element.attr('data-activates')); - } - - if (element.attr('data-target') && $('#' + element.attr('data-target')).length) { - $(element).dropdown({ - inDuration: 300, - outDuration: 225, - constrainWidth: false, // Does not change width of dropdown to that of the activator - // hover: true, // Activate on hover - belowOrigin: true // Displays dropdown below the button - }); - } - - return function (scope, element, attrs) { - - }; - } - }; - } -})(); \ No newline at end of file diff --git a/plugins/CoreHome/angularjs/common/directives/show-sensitive-data.js b/plugins/CoreHome/angularjs/common/directives/show-sensitive-data.js index fc111100bb..8b5b4dfc9d 100644 --- a/plugins/CoreHome/angularjs/common/directives/show-sensitive-data.js +++ b/plugins/CoreHome/angularjs/common/directives/show-sensitive-data.js @@ -5,17 +5,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -/** - * Handles visibility of sensitive data. By default data will be shown replaced with stars (*) - * On click on the element the full data will be shown - * - * Configuration attributes: - * data-show-characters number of characters to show in clear text (defaults to 6) - * data-click-element-selector selector for element that will show the full data on click (defaults to element) - * - * Example: - *
- */ + (function () { angular.module('piwikApp.directive').directive('piwikShowSensitiveData', piwikShowSensitiveData); diff --git a/plugins/CoreHome/angularjs/common/directives/translate.js b/plugins/CoreHome/angularjs/common/directives/translate.js index 49c87f6d4b..badb9208a9 100644 --- a/plugins/CoreHome/angularjs/common/directives/translate.js +++ b/plugins/CoreHome/angularjs/common/directives/translate.js @@ -22,6 +22,9 @@ (function () { angular.module('piwikApp.directive').directive('piwikTranslate', piwikTranslate); + /** + * @deprecated + */ function piwikTranslate() { return { priority: 1, diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 011fd1bd94..322c28fcfb 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -161,6 +161,8 @@ __webpack_require__.d(__webpack_exports__, "FocusIf", function() { return /* ree __webpack_require__.d(__webpack_exports__, "MatomoDialog", function() { return /* reexport */ MatomoDialog; }); __webpack_require__.d(__webpack_exports__, "ExpandOnClick", function() { return /* reexport */ ExpandOnClick; }); __webpack_require__.d(__webpack_exports__, "ExpandOnHover", function() { return /* reexport */ ExpandOnHover; }); +__webpack_require__.d(__webpack_exports__, "ShowSensitiveData", function() { return /* reexport */ ShowSensitiveData; }); +__webpack_require__.d(__webpack_exports__, "DropdownButton", function() { return /* reexport */ DropdownButton; }); __webpack_require__.d(__webpack_exports__, "SelectOnFocus", function() { return /* reexport */ SelectOnFocus; }); __webpack_require__.d(__webpack_exports__, "SideNav", function() { return /* reexport */ SideNav; }); __webpack_require__.d(__webpack_exports__, "EnrichedHeadline", function() { return /* reexport */ EnrichedHeadline; }); @@ -2655,6 +2657,141 @@ function piwikExpandOnHover() { piwikExpandOnHover.$inject = []; angular.module('piwikApp').directive('piwikExpandOnHover', piwikExpandOnHover); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +var ShowSensitiveData_window = window, + ShowSensitiveData_$ = ShowSensitiveData_window.$; +/** + * Handles visibility of sensitive data. By default data will be shown replaced with stars (*) + * On click on the element the full data will be shown + * + * Configuration attributes: + * data-show-characters number of characters to show in clear text (defaults to 6) + * data-click-element-selector selector for element that will show the full data on click + * (defaults to element) + * + * Example: + *
+ */ + +/* harmony default export */ var ShowSensitiveData = ({ + mounted: function mounted(el, binding) { + var element = ShowSensitiveData_$(el); + var sensitiveData = binding.value.sensitiveData; + var showCharacters = binding.value.showCharacters || 6; + var clickElement = binding.value.clickElementSelector || element; + var protectedData = ''; + + if (showCharacters > 0) { + protectedData += sensitiveData.substr(0, showCharacters); + } + + protectedData += sensitiveData.substr(showCharacters).replace(/./g, '*'); + element.html(protectedData); + + function onClickHandler() { + element.html(sensitiveData); + ShowSensitiveData_$(clickElement).css({ + cursor: '' + }); + ShowSensitiveData_$(clickElement).tooltip('destroy'); + } + + ShowSensitiveData_$(clickElement).tooltip({ + content: translate('CoreHome_ClickToSeeFullInformation'), + items: '*', + track: true + }); + ShowSensitiveData_$(clickElement).one('click', onClickHandler); + ShowSensitiveData_$(clickElement).css({ + cursor: 'pointer' + }); + } +}); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.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 piwikShowSensitiveData() { + return { + restrict: 'A', + link: function piwikShowSensitiveDataLink(scope, element, attr) { + var binding = { + instance: null, + value: { + sensitiveData: attr.piwikShowSensitiveData || (attr.text ? attr.text() : ''), + showCharacters: attr.showCharacters ? parseInt(attr.showCharacters, 10) : undefined, + clickElementSelector: attr.clickElementSelector + }, + oldValue: null, + modifiers: {}, + dir: {} + }; + ShowSensitiveData.mounted(element[0], binding); + } + }; +} +piwikShowSensitiveData.$inject = []; +angular.module('piwikApp').directive('piwikShowSensitiveData', piwikShowSensitiveData); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DropdownButton/DropdownButton.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +var DropdownButton_window = window, + DropdownButton_$ = DropdownButton_window.$; +/* harmony default export */ var DropdownButton = ({ + mounted: function mounted(el) { + var element = DropdownButton_$(el); // BC for materializecss 0.97 => 1.0 + + if (!element.attr('data-target') && element.attr('data-activates')) { + element.attr('data-target', element.attr('data-activates')); + } + + var target = element.attr('data-target'); + + if (target && DropdownButton_$("#".concat(target)).length) { + DropdownButton_$(element).dropdown({ + inDuration: 300, + outDuration: 225, + constrainWidth: false, + // hover: true, // Activate on hover + belowOrigin: true // Displays dropdown below the button + + }); + } + } +}); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/DropdownButton/DropdownButton.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 piwikDropdownButton() { + return { + restrict: 'C', + link: function piwikDropdownButtonLink(scope, element) { + DropdownButton.mounted(element[0]); + } + }; +} +piwikDropdownButton.$inject = []; +angular.module('piwikApp').directive('dropdownButton', piwikDropdownButton); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/SelectOnFocus/SelectOnFocus.ts /*! * Matomo - free/libre analytics platform @@ -2669,7 +2806,7 @@ function onFocusHandler(binding, event) { } } -function onClickHandler(event) { +function SelectOnFocus_onClickHandler(event) { // .select() + focus and blur seems to not work on pre elements var range = document.createRange(); range.selectNode(event.target); @@ -2699,7 +2836,7 @@ function onBlurHandler(binding) { el.addEventListener('focus', binding.value.onFocusHandler); el.addEventListener('blur', binding.value.onBlurHandler); } else { - binding.value.onClickHandler = onClickHandler; + binding.value.onClickHandler = SelectOnFocus_onClickHandler; el.addEventListener('click', binding.value.onClickHandler); } }, @@ -11848,6 +11985,10 @@ function deleteCookie(name) { + + + + diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index b791ad861f..b89365d58e 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -4,13 +4,13 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createVueApp",(function(){return qt})),n.d(t,"DirectiveUtilities",(function(){return bt})),n.d(t,"debounce",(function(){return Mo})),n.d(t,"createAngularJsAdapter",(function(){return rn})),n.d(t,"transformAngularJsBoolAttr",(function(){return on})),n.d(t,"transformAngularJsIntAttr",(function(){return an})),n.d(t,"removeAngularJsSpecificProperties",(function(){return nn})),n.d(t,"activityIndicatorAdapter",(function(){return zu})),n.d(t,"ActivityIndicator",(function(){return pa})),n.d(t,"translate",(function(){return C})),n.d(t,"alertAdapter",(function(){return Zu})),n.d(t,"AjaxHelper",(function(){return Qe})),n.d(t,"setCookie",(function(){return ed})),n.d(t,"getCookie",(function(){return td})),n.d(t,"deleteCookie",(function(){return nd})),n.d(t,"MatomoUrl",(function(){return De})),n.d(t,"Matomo",(function(){return S})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return G})),n.d(t,"Week",(function(){return X})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return le})),n.d(t,"Range",(function(){return _})),n.d(t,"format",(function(){return P})),n.d(t,"getToday",(function(){return D})),n.d(t,"parseDate",(function(){return E})),n.d(t,"todayIsInRange",(function(){return V})),n.d(t,"Dropdown",(function(){return ot})),n.d(t,"FocusAnywhereButHere",(function(){return dt})),n.d(t,"FocusIf",(function(){return mt})),n.d(t,"MatomoDialog",(function(){return Wt})),n.d(t,"ExpandOnClick",(function(){return St})),n.d(t,"ExpandOnHover",(function(){return Tt})),n.d(t,"SelectOnFocus",(function(){return Mt})),n.d(t,"SideNav",(function(){return Rt})),n.d(t,"EnrichedHeadline",(function(){return Dn})),n.d(t,"ContentBlock",(function(){return Mn})),n.d(t,"Comparisons",(function(){return kr})),n.d(t,"MenuDropdown",(function(){return Fr})),n.d(t,"DatePicker",(function(){return zr})),n.d(t,"DateRangePicker",(function(){return eo})),n.d(t,"PeriodDatePicker",(function(){return io})),n.d(t,"Notification",(function(){return ic})),n.d(t,"NotificationGroup",(function(){return yc})),n.d(t,"NotificationsStore",(function(){return mc})),n.d(t,"SiteSelector",(function(){return $o})),n.d(t,"QuickAccess",(function(){return ci})),n.d(t,"FieldArray",(function(){return wi})),n.d(t,"MultiPairField",(function(){return _i})),n.d(t,"PeriodSelector",(function(){return Va})),n.d(t,"ReportingMenu",(function(){return el})),n.d(t,"ReportingPagesStore",(function(){return Cc})),n.d(t,"ReportMetadataStore",(function(){return sl})),n.d(t,"WidgetsStore",(function(){return zc})),n.d(t,"WidgetLoader",(function(){return yl})),n.d(t,"WidgetContainer",(function(){return Ml})),n.d(t,"WidgetByDimensionContainer",(function(){return ts})),n.d(t,"Widget",(function(){return ds})),n.d(t,"ReportingPage",(function(){return _s})),n.d(t,"ReportExport",(function(){return wu})),n.d(t,"Sparkline",(function(){return Vu})),n.d(t,"Progressbar",(function(){return Mu})),n.d(t,"ContentIntro",(function(){return Lu})),n.d(t,"ContentTable",(function(){return Ru})),n.d(t,"AjaxForm",(function(){return Ju})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("2342");var i=n("8bbf");function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r=this.getFinalHashParams(t),o=this.stringify(r),i="?".concat(n);o.length&&(i="".concat(i,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,i)}},{key:"getFinalHashParams",value:function(e){return ge({period:this.parsed.value.period,date:this.parsed.value.date,segment:this.parsed.value.segment},"string"!==typeof e?e:ke.getValuesFromUrl("?".concat(e),!0))}},{key:"updateLocation",value:function(e){S.helper.isAngularRenderingThePage()?this.updateHash(e):this.updateUrl(e)}},{key:"getSearchParam",value:function(e){var t=window.location.href.split("#"),n=new RegExp("".concat(e,"(\\[]|=)"));if(t&&t[1]&&n.test(decodeURIComponent(t[1]))){var r=window.broadcast.getValueFromHash(e,window.location.href);if(r||"date"!==e&&"period"!==e&&"idSite"!==e)return r}return window.broadcast.getValueFromUrl(e,window.location.search)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=se(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(Se(t,e)&&(je.period!==t||je.currentDateString!==e)){je.period=t;var n=p.parse(t,e).getDateRange();je.startDateString=P(n[0]),je.endDateString=P(n[1]),je.updateDateInTitle(e,t),"range"===je.period&&(e="".concat(je.startDateString,",").concat(je.endDateString)),je.currentDateString=e}}},{key:"setUrlQuery",value:function(e){this.urlQuery.value=e.replace(/^\?/,"")}},{key:"setHashQuery",value:function(e){this.hashQuery.value=e.replace(/^[#/?]+/,"")}}]),e}(),Pe=new Ce,De=Pe; + */p.addCustomPeriod("year",le);var we=window,je=we.piwik,ke=we.broadcast;function Se(e,t){try{return p.parse(e,t),!0}catch(n){return!1}}var Ce=function(){function e(){var t=this;ve(this,e),Oe(this,"urlQuery",Object(i["ref"])("")),Oe(this,"hashQuery",Object(i["ref"])("")),Oe(this,"urlParsed",Object(i["computed"])((function(){return Object(i["readonly"])(ke.getValuesFromUrl("?".concat(t.urlQuery.value),!0))}))),Oe(this,"hashParsed",Object(i["computed"])((function(){return Object(i["readonly"])(ke.getValuesFromUrl("?".concat(t.hashQuery.value),!0))}))),Oe(this,"parsed",Object(i["computed"])((function(){return Object(i["readonly"])(ge(ge({},t.urlParsed.value),t.hashParsed.value))}))),this.setUrlQuery(window.location.search),this.setHashQuery(window.location.hash),S.on("$locationChangeSuccess",(function(e){var n=new URL(e);t.setUrlQuery(n.search.replace(/^\?/,"")),t.setHashQuery(n.hash.replace(/^#/,""))})),this.updatePeriodParamsFromUrl()}return ye(e,[{key:"updateHash",value:function(e){var t=this.getFinalHashParams(e),n=this.stringify(t),r=S.helper.getAngularDependency("$location");r.search(n);var o=S.helper.getAngularDependency("$timeout");o()}},{key:"updateUrl",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r=this.getFinalHashParams(t),o=this.stringify(r),i="?".concat(n);o.length&&(i="".concat(i,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,i)}},{key:"getFinalHashParams",value:function(e){return ge({period:this.parsed.value.period,date:this.parsed.value.date,segment:this.parsed.value.segment},"string"!==typeof e?e:ke.getValuesFromUrl("?".concat(e),!0))}},{key:"updateLocation",value:function(e){S.helper.isAngularRenderingThePage()?this.updateHash(e):this.updateUrl(e)}},{key:"getSearchParam",value:function(e){var t=window.location.href.split("#"),n=new RegExp("".concat(e,"(\\[]|=)"));if(t&&t[1]&&n.test(decodeURIComponent(t[1]))){var r=window.broadcast.getValueFromHash(e,window.location.href);if(r||"date"!==e&&"period"!==e&&"idSite"!==e)return r}return window.broadcast.getValueFromUrl(e,window.location.search)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=se(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(Se(t,e)&&(je.period!==t||je.currentDateString!==e)){je.period=t;var n=p.parse(t,e).getDateRange();je.startDateString=P(n[0]),je.endDateString=P(n[1]),je.updateDateInTitle(e,t),"range"===je.period&&(e="".concat(je.startDateString,",").concat(je.endDateString)),je.currentDateString=e}}},{key:"setUrlQuery",value:function(e){this.urlQuery.value=e.replace(/^\?/,"")}},{key:"setHashQuery",value:function(e){this.hashQuery.value=e.replace(/^[#/?]+/,"")}}]),e}(),Pe=new Ce,De=Pe; /*! * Matomo - free/libre analytics platform * @@ -146,13 +146,13 @@ function ft(e,t){t.arg&&setTimeout((function(){e.focus(),t.value.afterFocus&&t.v * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function gt(e,t){return e instanceof HTMLElement?e:t.instance.$refs[e]}angular.module("piwikApp.directive").directive("piwikFocusIf",ht);var bt={getRef:gt}; +function gt(e,t){return e instanceof HTMLElement?e:t.instance.$refs[e]}angular.module("piwikApp.directive").directive("piwikFocusIf",ht);var vt={getRef:gt}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function vt(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function yt(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||e.classList.remove("expanded")}function Ot(e){e.value.hasScrolled=!0}function wt(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function jt(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var kt=document.documentElement,St={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=vt.bind(null,e),t.value.onEscapeHandler=jt.bind(null,e,t),t.value.onMouseDown=wt.bind(null,t),t.value.onClickOutsideElement=yt.bind(null,e,t),t.value.onScroll=Ot.bind(null,t),setTimeout((function(){var e=bt.getRef(t.value.expander,t);e.addEventListener("click",t.value.onExpand)})),kt.addEventListener("keyup",t.value.onEscapeHandler),kt.addEventListener("mousedown",t.value.onMouseDown),kt.addEventListener("mouseup",t.value.onClickOutsideElement),kt.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=bt.getRef(t.value.expander,t);n.removeEventListener("click",t.value.onExpand),kt.removeEventListener("keyup",t.value.onEscapeHandler),kt.removeEventListener("mousedown",t.value.onMouseDown),kt.removeEventListener("mouseup",t.value.onClickOutsideElement),kt.removeEventListener("scroll",t.value.onScroll)}}; + */function bt(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function yt(e,t,n){var r=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,r||e.contains(n.target)||e.classList.remove("expanded")}function Ot(e){e.value.hasScrolled=!0}function wt(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function jt(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var kt=document.documentElement,St={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=bt.bind(null,e),t.value.onEscapeHandler=jt.bind(null,e,t),t.value.onMouseDown=wt.bind(null,t),t.value.onClickOutsideElement=yt.bind(null,e,t),t.value.onScroll=Ot.bind(null,t),setTimeout((function(){var e=vt.getRef(t.value.expander,t);e.addEventListener("click",t.value.onExpand)})),kt.addEventListener("keyup",t.value.onEscapeHandler),kt.addEventListener("mousedown",t.value.onMouseDown),kt.addEventListener("mouseup",t.value.onClickOutsideElement),kt.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=vt.getRef(t.value.expander,t);n.removeEventListener("click",t.value.onExpand),kt.removeEventListener("keyup",t.value.onEscapeHandler),kt.removeEventListener("mousedown",t.value.onMouseDown),kt.removeEventListener("mouseup",t.value.onClickOutsideElement),kt.removeEventListener("scroll",t.value.onScroll)}}; /*! * Matomo - free/libre analytics platform * @@ -166,305 +166,333 @@ function Ct(){return{restrict:"A",link:function(e,t){var n={instance:null,value: * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Pt(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function Dt(e){e.classList.remove("expanded")}function Et(e,t){e.contains(t.target)||e.classList.remove("expanded")}function Vt(e,t){27===t.which&&e.classList.remove("expanded")}Ct.$inject=[],angular.module("piwikApp").directive("piwikExpandOnClick",Ct);var Nt=document.documentElement,Tt={mounted:function(e,t){t.value.onMouseEnter=Pt.bind(null,e),t.value.onMouseLeave=Dt.bind(null,e),t.value.onClickOutsideElement=Et.bind(null,e),t.value.onEscapeHandler=Vt.bind(null,e),setTimeout((function(){var e=bt.getRef(t.value.expander,t);e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),Nt.addEventListener("keyup",t.value.onEscapeHandler),Nt.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=bt.getRef(t.value.expander,t);n.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}}; +function Pt(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&S.helper.setMarginLeftToBeInViewport(t)}function Dt(e){e.classList.remove("expanded")}function Et(e,t){e.contains(t.target)||e.classList.remove("expanded")}function Vt(e,t){27===t.which&&e.classList.remove("expanded")}Ct.$inject=[],angular.module("piwikApp").directive("piwikExpandOnClick",Ct);var Nt=document.documentElement,Tt={mounted:function(e,t){t.value.onMouseEnter=Pt.bind(null,e),t.value.onMouseLeave=Dt.bind(null,e),t.value.onClickOutsideElement=Et.bind(null,e),t.value.onEscapeHandler=Vt.bind(null,e),setTimeout((function(){var e=vt.getRef(t.value.expander,t);e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),Nt.addEventListener("keyup",t.value.onEscapeHandler),Nt.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=vt.getRef(t.value.expander,t);n.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function At(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};Tt.mounted(t[0],n),t.on("$destroy",(function(){return Tt.unmounted(t[0],n)}))}}} +function At(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{expander:t.find(".title").first()[0]},oldValue:null,modifiers:{},dir:{}};Tt.mounted(t[0],n),t.on("$destroy",(function(){return Tt.unmounted(t[0],n)}))}}}At.$inject=[],angular.module("piwikApp").directive("piwikExpandOnHover",At); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function It(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,angular.element(t.target).select())}function Bt(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function xt(e){e.value.focusedElement=null}At.$inject=[],angular.module("piwikApp").directive("piwikExpandOnHover",At);var Mt={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=It.bind(null,t),t.value.onBlurHandler=xt.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=Bt,e.addEventListener("click",t.value.onClickHandler))},unmounted:function(e,t){t.value.elementSupportsSelect?(e.removeEventListener("focus",t.value.onFocusHandler),e.removeEventListener("blur",t.value.onBlurHandler)):e.removeEventListener("click",t.value.onClickHandler)}}; +var It=window,Bt=It.$,xt={mounted:function(e,t){var n=Bt(e),r=t.value.sensitiveData,o=t.value.showCharacters||6,i=t.value.clickElementSelector||n,a="";function c(){n.html(r),Bt(i).css({cursor:""}),Bt(i).tooltip("destroy")}o>0&&(a+=r.substr(0,o)),a+=r.substr(o).replace(/./g,"*"),n.html(a),Bt(i).tooltip({content:C("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),Bt(i).one("click",c),Bt(i).css({cursor:"pointer"})}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Lt(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{},oldValue:null,modifiers:{},dir:{}};Mt.mounted(t[0],n),t.on("$destroy",(function(){return Mt.unmounted(t[0],n)}))}}}Lt.$inject=[],angular.module("piwikApp").directive("piwikSelectOnFocus",Lt); + */ +function Mt(){return{restrict:"A",link:function(e,t,n){var r={instance:null,value:{sensitiveData:n.piwikShowSensitiveData||(n.text?n.text():""),showCharacters:n.showCharacters?parseInt(n.showCharacters,10):void 0,clickElementSelector:n.clickElementSelector},oldValue:null,modifiers:{},dir:{}};xt.mounted(t[0],r)}}}Mt.$inject=[],angular.module("piwikApp").directive("piwikShowSensitiveData",Mt); +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +var Lt=window,Ft=Lt.$,Rt={mounted:function(e){var t=Ft(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&Ft("#".concat(n)).length&&Ft(t).dropdown({inDuration:300,outDuration:225,constrainWidth:!1,belowOrigin:!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 _t(){return{restrict:"C",link:function(e,t){Rt.mounted(t[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 $t(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,angular.element(t.target).select())}function Ht(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function Ut(e){e.value.focusedElement=null}_t.$inject=[],angular.module("piwikApp").directive("dropdownButton",_t);var Wt={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=$t.bind(null,t),t.value.onBlurHandler=Ut.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=Ht,e.addEventListener("click",t.value.onClickHandler))},unmounted:function(e,t){t.value.elementSupportsSelect?(e.removeEventListener("focus",t.value.onFocusHandler),e.removeEventListener("blur",t.value.onBlurHandler)):e.removeEventListener("click",t.value.onClickHandler)}}; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function qt(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{},oldValue:null,modifiers:{},dir:{}};Wt.mounted(t[0],n),t.on("$destroy",(function(){return Wt.unmounted(t[0],n)}))}}}qt.$inject=[],angular.module("piwikApp").directive("piwikSelectOnFocus",qt); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -var Ft=!1,Rt={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!Ft){Ft=!0;var n=bt.getRef(t.value.activator,t);n&&window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}}; +var Jt=!1,Gt={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!Jt){Jt=!0;var n=vt.getRef(t.value.activator,t);n&&window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}}; /*! * 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(e){return{restrict:"A",priority:10,link:function(t,n,r){var o={instance:null,value:{activator:$(r.piwikSideNav)[0]},oldValue:null,modifiers:{},dir:{}};e((function(){Rt.mounted(n[0],o)}))}}}_t.$inject=["$timeout"],angular.module("piwikApp.directive").directive("piwikSideNav",_t);var $t={ref:"root"};function Ht(e,t,n,r,o,a){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",$t,[Object(i["renderSlot"])(e.$slots,"default")],512)),[[i["vShow"],e.modelValue]])}var Ut=Object(i["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","validation","update:modelValue"],activated:function(){this.$emit("update:modelValue",!1)},watch:{modelValue:function(e,t){var n=this;if(e){var r=this.element||this.$refs.root.firstElementChild;S.helper.modalConfirm(r,{yes:function(){n.$emit("yes")},no:function(){n.$emit("no")},validation:function(){n.$emit("validation")}},{onCloseEnd:function(){n.element||n.$refs.root.appendChild(r),n.$emit("update:modelValue",!1),n.$emit("closeEnd")}})}else!1===e&&!0===t&&this.$emit("close")}}});Ut.render=Ht;var Wt=Ut; +function zt(e){return{restrict:"A",priority:10,link:function(t,n,r){var o={instance:null,value:{activator:$(r.piwikSideNav)[0]},oldValue:null,modifiers:{},dir:{}};e((function(){Gt.mounted(n[0],o)}))}}}zt.$inject=["$timeout"],angular.module("piwikApp.directive").directive("piwikSideNav",zt);var Yt={ref:"root"};function Qt(e,t,n,r,o,a){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Yt,[Object(i["renderSlot"])(e.$slots,"default")],512)),[[i["vShow"],e.modelValue]])}var Kt=Object(i["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","validation","update:modelValue"],activated:function(){this.$emit("update:modelValue",!1)},watch:{modelValue:function(e,t){var n=this;if(e){var r=this.element||this.$refs.root.firstElementChild;S.helper.modalConfirm(r,{yes:function(){n.$emit("yes")},no:function(){n.$emit("no")},validation:function(){n.$emit("validation")}},{onCloseEnd:function(){n.element||n.$refs.root.appendChild(r),n.$emit("update:modelValue",!1),n.$emit("closeEnd")}})}else!1===e&&!0===t&&this.$emit("close")}}});Kt.render=Qt;var Xt=Kt; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function qt(){var e=i["createApp"].apply(void 0,arguments);return e.config.globalProperties.$sanitize=window.vueSanitize,e.config.globalProperties.translate=C,e}function Jt(e,t){return Kt(e)||Qt(e,t)||zt(e,t)||Gt()}function Gt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zt(e,t){if(e){if("string"===typeof e)return Yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yt(e,t):void 0}}function Yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n')),l}return Object.entries(o).forEach((function(e){var t=Jt(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(O[n]=r.angularJsBind),y[r.vue]=n})),w.$inject=l||[],angular.module("piwikApp").directive(s,w),w}function on(e){if("undefined"!==typeof e)return"true"===e||!!e&&e>0&&"0"!==e}function an(e){if("undefined"!==typeof e)return null===e?null:parseInt(e,10)}function cn(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}function ln(e){var t=cn(e);return S.helper.getAngularDependency("$rootScope").$applyAsync(),t} + */var ln=0;function sn(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/[A-Z]/g,(function(e){return"-".concat(e.toLowerCase())}))}function un(e){return e.substring(0,1).toLowerCase()+e.substring(1).replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function dn(e){return"object"===cn(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype?Object.fromEntries(Object.entries(e).filter((function(e){return!/^\$/.test(e[0])}))):e}function pn(e){var t=e.component,n=e.require,r=e.scope,o=void 0===r?{}:r,a=e.events,c=void 0===a?{}:a,l=e.$inject,s=e.directiveName,u=e.transclude,d=e.mountPointFactory,p=e.postCreate,f=e.noScope,m=e.restrict,h=void 0===m?"A":m,g=e.priority,v=e.replace,b=ln;u&&(ln+=1);var y={},O={};function w(){for(var e=arguments.length,r=new Array(e),a=0;a')),l}return Object.entries(o).forEach((function(e){var t=en(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(O[n]=r.angularJsBind),y[r.vue]=n})),w.$inject=l||[],angular.module("piwikApp").directive(s,w),w}function fn(e){if("undefined"!==typeof e)return"true"===e||!!e&&e>0&&"0"!==e}function mn(e){if("undefined"!==typeof e)return null===e?null:parseInt(e,10)}function hn(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}function gn(e){var t=hn(e);return S.helper.getAngularDependency("$rootScope").$applyAsync(),t} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:Wt,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r,o){o.yes&&(n.$eval(o.yes),setTimeout((function(){n.$apply()}),0))},no:function(e,t,n,r,o){o.no&&(n.$eval(o.no),setTimeout((function(){n.$apply()}),0))},validation:function(e,t,n,r,o){o.no&&(n.$eval(o.no),setTimeout((function(){n.$apply()}),0))},close:function(e,t,n,r,o){o.close&&(n.$eval(o.close),setTimeout((function(){n.$apply()}),0))},"update:modelValue":function(e,t,n,r,o,i,a){setTimeout((function(){n.$apply(a(o.piwikDialog).assign(n,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('
');return n.appendTo(t),n[0]},postCreate:function(e,t,n,r){t.$watch(r.piwikDialog,(function(t,n){n!==t&&(e.modelValue=t||!1)}))},noScope:!0});var sn={key:0,class:"title",tabindex:"6"},un=["href","title"],dn={class:"iconsBar"},pn=["href","title"],fn=Object(i["createElementVNode"])("span",{class:"icon-help"},null,-1),mn=[fn],hn=["title"],gn=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1),bn=[gn],vn={class:"ratingIcons"},yn={class:"inlineHelp"},On=["innerHTML"],wn=["innerHTML"],jn=["href"];function kn(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("RateFeature");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=function(t){return e.showIcons=!0}),onMouseleave:t[2]||(t[2]=function(t){return e.showIcons=!1}),ref:"root"},[e.editUrl?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",sn,[Object(i["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(i["renderSlot"])(e.$slots,"default")],8,un)):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",dn,[e.helpUrl&&!e.actualInlineHelp?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},mn,8,pn)):Object(i["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(i["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},bn,10,hn)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",vn,[Object(i["createVNode"])(c,{title:e.actualFeatureName},null,8,["title"])])],512),[[i["vShow"],e.showIcons||e.showInlineHelp]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",yn,[Object(i["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,On),Object(i["createElementVNode"])("span",{class:"helpDate",innerHTML:e.reportGenerated},null,8,wn),e.helpUrl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(i["toDisplayString"])(e.translate("General_MoreDetails")),9,jn)):Object(i["createCommentVNode"])("",!0)],512),[[i["vShow"],e.showInlineHelp]])],544)} + */pn({component:Xt,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r,o){o.yes&&(n.$eval(o.yes),setTimeout((function(){n.$apply()}),0))},no:function(e,t,n,r,o){o.no&&(n.$eval(o.no),setTimeout((function(){n.$apply()}),0))},validation:function(e,t,n,r,o){o.no&&(n.$eval(o.no),setTimeout((function(){n.$apply()}),0))},close:function(e,t,n,r,o){o.close&&(n.$eval(o.close),setTimeout((function(){n.$apply()}),0))},"update:modelValue":function(e,t,n,r,o,i,a){setTimeout((function(){n.$apply(a(o.piwikDialog).assign(n,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('
');return n.appendTo(t),n[0]},postCreate:function(e,t,n,r){t.$watch(r.piwikDialog,(function(t,n){n!==t&&(e.modelValue=t||!1)}))},noScope:!0});var vn={key:0,class:"title",tabindex:"6"},bn=["href","title"],yn={class:"iconsBar"},On=["href","title"],wn=Object(i["createElementVNode"])("span",{class:"icon-help"},null,-1),jn=[wn],kn=["title"],Sn=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1),Cn=[Sn],Pn={class:"ratingIcons"},Dn={class:"inlineHelp"},En=["innerHTML"],Vn=["innerHTML"],Nn=["href"];function Tn(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("RateFeature");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=function(t){return e.showIcons=!0}),onMouseleave:t[2]||(t[2]=function(t){return e.showIcons=!1}),ref:"root"},[e.editUrl?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",vn,[Object(i["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(i["renderSlot"])(e.$slots,"default")],8,bn)):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",yn,[e.helpUrl&&!e.actualInlineHelp?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},jn,8,On)):Object(i["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(i["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},Cn,10,kn)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",Pn,[Object(i["createVNode"])(c,{title:e.actualFeatureName},null,8,["title"])])],512),[[i["vShow"],e.showIcons||e.showInlineHelp]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Dn,[Object(i["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,En),Object(i["createElementVNode"])("span",{class:"helpDate",innerHTML:e.reportGenerated},null,8,Vn),e.helpUrl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(i["toDisplayString"])(e.translate("General_MoreDetails")),9,Nn)):Object(i["createCommentVNode"])("",!0)],512),[[i["vShow"],e.showInlineHelp]])],544)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Sn(e,t){return Object(i["defineAsyncComponent"])((function(){return new Promise((function(n){window.$(document).ready((function(){window[e]?n(window[e][t]):n(null)}))}))}))}var Cn=Sn("Feedback","RateFeature"),Pn=Object(i["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:Cn},data:function(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp:function(e){this.actualInlineHelp=e},featureName:function(e){this.actualFeatureName=e}},mounted:function(){var e=this,t=this.$refs.root;setTimeout((function(){if(!e.actualInlineHelp){var n,r=t.querySelector(".title .inlineHelp");if(!r&&null!==(n=t.parentElement)&&void 0!==n&&n.nextElementSibling&&(r=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),r){var o=r.getAttribute("data-content").trim();o.length&&(e.actualInlineHelp="

".concat(o,"

"),setTimeout((function(){return r.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(S.period,S.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});Pn.render=kn;var Dn=Pn,En=(rn({component:Dn,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Vn={class:"card-content"},Nn={key:0,class:"card-title"},Tn={key:1,class:"card-title"},An={ref:"content"}; + */function An(e,t){return Object(i["defineAsyncComponent"])((function(){return new Promise((function(n){window.$(document).ready((function(){window[e]?n(window[e][t]):n(null)}))}))}))}var In=An("Feedback","RateFeature"),Bn=Object(i["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:In},data:function(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp:function(e){this.actualInlineHelp=e},featureName:function(e){this.actualFeatureName=e}},mounted:function(){var e=this,t=this.$refs.root;setTimeout((function(){if(!e.actualInlineHelp){var n,r=t.querySelector(".title .inlineHelp");if(!r&&null!==(n=t.parentElement)&&void 0!==n&&n.nextElementSibling&&(r=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),r){var o=r.getAttribute("data-content").trim();o.length&&(e.actualInlineHelp="

".concat(o,"

"),setTimeout((function(){return r.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(S.period,S.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});Bn.render=Tn;var xn=Bn,Mn=(pn({component:xn,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),Ln={class:"card-content"},Fn={key:0,class:"card-title"},Rn={key:1,class:"card-title"},_n={ref:"content"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function In(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("EnrichedHeadline");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",En,[Object(i["createElementVNode"])("div",Vn,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Nn,Object(i["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Tn,[Object(i["createVNode"])(c,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",An,[Object(i["renderSlot"])(e.$slots,"default")],512)])],512)}var Bn=null,xn=Object(i["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:Dn},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e,t=this,n=this.$refs,r=n.root,o=n.content;if(this.anchor){var i=document.createElement("a");i.id=this.anchor,r.parentElement.prepend(i)}if(setTimeout((function(){var e=o.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===Bn&&(Bn=document.querySelector("#content.admin")),Bn&&(e=Bn.offsetTop),e||0===e){var a=r.closest("[piwik-widget-loader]"),c=a?a.offsetTop:r.offsetTop;c-e<17&&(r.style.marginTop=0)}}});xn.render=In;var Mn=xn; + */function $n(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("EnrichedHeadline");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Mn,[Object(i["createElementVNode"])("div",Ln,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Fn,Object(i["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Rn,[Object(i["createVNode"])(c,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",_n,[Object(i["renderSlot"])(e.$slots,"default")],512)])],512)}var Hn=null,Un=Object(i["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:xn},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e,t=this,n=this.$refs,r=n.root,o=n.content;if(this.anchor){var i=document.createElement("a");i.id=this.anchor,r.parentElement.prepend(i)}if(setTimeout((function(){var e=o.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===Hn&&(Hn=document.querySelector("#content.admin")),Hn&&(e=Hn.offsetTop),e||0===e){var a=r.closest("[piwik-widget-loader]"),c=a?a.offsetTop:r.offsetTop;c-e<17&&(r.style.marginTop=0)}}});Un.render=$n;var Wn=Un; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:Mn,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function Ln(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fn(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%tr;if(0===n)return this.colors["series".concat(r)];var o=n%nr;return this.colors["series".concat(r,"-shade").concat(o)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%tr);return t>0&&(n+="-shade".concat(t%nr)),n}},{key:"isComparisonEnabled",value:function(){return this.isEnabled.value}},{key:"getIndividualComparisonRowIndices",value:function(e){var t=this.getSegmentComparisons().length,n=e%t,r=Math.floor(e/t);return{segmentIndex:n,periodIndex:r}}},{key:"getComparisonSeriesIndex",value:function(e,t){var n=this.getSegmentComparisons().length;return e*n+t}},{key:"getAllComparisonSeries",value:function(){var e=this,t=[],n=0;return this.getPeriodComparisons().forEach((function(r){e.getSegmentComparisons().forEach((function(o){t.push({index:n,params:Qn(Qn({},o.params),r.params),color:e.colors["series".concat(n)]}),n+=1}))})),t}},{key:"removeSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=Un(this.segmentComparisons.value);t.splice(e,1);var n={};0===e&&(n.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,n)}},{key:"addSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}},{key:"updateQueryParamsFromComparisons",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},o={},i=!1,a=!1;e.forEach((function(e){i?r[e.params.segment]=!0:i=!0})),t.forEach((function(e){a?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:a=!0}));var c=[],l=[];Object.keys(o).forEach((function(e){var t=e.split("|");c.push(t[0]),l.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:c,compareDates:l},u=S.helper.isAngularRenderingThePage()?De.hashParsed.value:De.urlParsed.value;De.updateLocation(Qn(Qn(Qn({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=S.ColorManager;if(!e)return[];for(var t=[],n=0;n"+decodeURIComponent(t.params.segment)},[Object(i["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(i["toDisplayString"])(t.title),9,sr)],8,lr),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.periodComparisons,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(i["createElementVNode"])("span",{class:"comparison-dot",style:Object(i["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(i["createElementVNode"])("span",dr,Object(i["toDisplayString"])(n.title)+" ("+Object(i["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,ur)})),128)),e.segmentComparisons.length>1?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(i["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,fr)],8,pr)):Object(i["createCommentVNode"])("",!0)])})),128)),Object(i["createElementVNode"])("div",mr,[Object(i["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,hr),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[c,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(i["createCommentVNode"])("",!0)} + */var sr=8,ur=3;function dr(e){return e?Array.isArray(e)?e:[e]:[]}var pr=function(){function e(){var t=this;ir(this,e),lr(this,"privateState",Object(i["reactive"])({comparisonsDisabledFor:[]})),lr(this,"state",Object(i["readonly"])(this.privateState)),lr(this,"colors",{}),lr(this,"segmentComparisons",Object(i["computed"])((function(){return t.parseSegmentComparisons()}))),lr(this,"periodComparisons",Object(i["computed"])((function(){return t.parsePeriodComparisons()}))),lr(this,"isEnabled",Object(i["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(i["watch"])((function(){return t.getComparisons()}),(function(){return S.postEvent("piwikComparisonsChanged")}),{deep:!0})}return cr(e,[{key:"getComparisons",value:function(){return this.getSegmentComparisons().concat(this.getPeriodComparisons())}},{key:"isComparing",value:function(){return this.isComparisonEnabled()&&(this.segmentComparisons.value.length>1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%sr;if(0===n)return this.colors["series".concat(r)];var o=n%ur;return this.colors["series".concat(r,"-shade").concat(o)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%sr);return t>0&&(n+="-shade".concat(t%ur)),n}},{key:"isComparisonEnabled",value:function(){return this.isEnabled.value}},{key:"getIndividualComparisonRowIndices",value:function(e){var t=this.getSegmentComparisons().length,n=e%t,r=Math.floor(e/t);return{segmentIndex:n,periodIndex:r}}},{key:"getComparisonSeriesIndex",value:function(e,t){var n=this.getSegmentComparisons().length;return e*n+t}},{key:"getAllComparisonSeries",value:function(){var e=this,t=[],n=0;return this.getPeriodComparisons().forEach((function(r){e.getSegmentComparisons().forEach((function(o){t.push({index:n,params:or(or({},o.params),r.params),color:e.colors["series".concat(n)]}),n+=1}))})),t}},{key:"removeSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=Kn(this.segmentComparisons.value);t.splice(e,1);var n={};0===e&&(n.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,n)}},{key:"addSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}},{key:"updateQueryParamsFromComparisons",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},o={},i=!1,a=!1;e.forEach((function(e){i?r[e.params.segment]=!0:i=!0})),t.forEach((function(e){a?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:a=!0}));var c=[],l=[];Object.keys(o).forEach((function(e){var t=e.split("|");c.push(t[0]),l.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:c,compareDates:l},u=S.helper.isAngularRenderingThePage()?De.hashParsed.value:De.urlParsed.value;De.updateLocation(or(or(or({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=S.ColorManager;if(!e)return[];for(var t=[],n=0;n"+decodeURIComponent(t.params.segment)},[Object(i["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(i["toDisplayString"])(t.title),9,vr)],8,gr),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.periodComparisons,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(i["createElementVNode"])("span",{class:"comparison-dot",style:Object(i["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(i["createElementVNode"])("span",yr,Object(i["toDisplayString"])(n.title)+" ("+Object(i["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,br)})),128)),e.segmentComparisons.length>1?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(i["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,wr)],8,Or)):Object(i["createCommentVNode"])("",!0)])})),128)),Object(i["createElementVNode"])("div",jr,[Object(i["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,kr),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[c,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(i["createCommentVNode"])("",!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 br(e,t){window.$(e).tooltip({track:!0,content:t.value.content,show:{delay:t.value.delay||700,duration:t.value.duration||200},hide:!1})}var vr={mounted:function(e,t){setTimeout((function(){return br(e,t)}))},updated:function(e,t){setTimeout((function(){return br(e,t)}))},beforeUnmount:function(e){try{window.$(e).tooltip("destroy")}catch(t){}}};function yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t"))}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:o}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),ir.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return C("CoreHome_PeriodRange");var n=C("Intl_Period".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1)));return n.substring(0,1).toUpperCase()+n.substring(1)},getComparisonTooltip:function(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getUrlToSegment:function(e){var t=Or({},De.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(De.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,ir.isComparing()){var t=ir.getPeriodComparisons(),n=ir.getSegmentComparisons();Qe.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:De.getSearchParam("compareSegments"),comparePeriods:De.getSearchParam("comparePeriods"),compareDates:De.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var o=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=o}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=ir.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=ir.getComparisonSeriesIndex(t.index,n.index),a=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],l='
',s=(a.nb_visits/o.nb_visits*100).toFixed(2);return s="".concat(s,"%"),l+=C("General_ComparisonCardTooltip1",["'".concat(a.compareSegmentPretty,"'"),a.comparePeriodPretty,s,a.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(l+="

",l+=C("General_ComparisonCardTooltip2",[a.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),l+="
",l}},mounted:function(){var e=this;S.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});jr.render=gr;var kr=jr; + */function Cr(e,t){window.$(e).tooltip({track:!0,content:t.value.content,show:{delay:t.value.delay||700,duration:t.value.duration||200},hide:!1})}var Pr={mounted:function(e,t){setTimeout((function(){return Cr(e,t)}))},updated:function(e,t){setTimeout((function(){return Cr(e,t)}))},beforeUnmount:function(e){try{window.$(e).tooltip("destroy")}catch(t){}}};function Dr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Er(e){for(var t=1;t"))}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:o}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),fr.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return C("CoreHome_PeriodRange");var n=C("Intl_Period".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1)));return n.substring(0,1).toUpperCase()+n.substring(1)},getComparisonTooltip:function(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getUrlToSegment:function(e){var t=Er({},De.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(De.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,fr.isComparing()){var t=fr.getPeriodComparisons(),n=fr.getSegmentComparisons();Qe.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:De.getSearchParam("compareSegments"),comparePeriods:De.getSearchParam("comparePeriods"),compareDates:De.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var o=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=o}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=fr.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=fr.getComparisonSeriesIndex(t.index,n.index),a=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],l='
',s=(a.nb_visits/o.nb_visits*100).toFixed(2);return s="".concat(s,"%"),l+=C("General_ComparisonCardTooltip1",["'".concat(a.compareSegmentPretty,"'"),a.comparePeriodPretty,s,a.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(l+="

",l+=C("General_ComparisonCardTooltip2",[a.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),l+="
",l}},mounted:function(){var e=this;S.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});Nr.render=Sr;var Tr=Nr; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Sr(){return ir}Sr.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",Sr);rn({component:kr,directiveName:"piwikComparisons",restrict:"E"});var Cr={ref:"root",class:"menuDropdown"},Pr=["title"],Dr=["innerHTML"],Er=Object(i["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Vr={class:"items"},Nr={key:0,class:"search"},Tr=["placeholder"],Ar=["title"],Ir=["title"];function Br(e,t,n,r,o,a){var c=Object(i["resolveDirective"])("focus-if"),l=Object(i["resolveDirective"])("focus-anywhere-but-here");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Cr,[Object(i["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,Dr),Er],8,Pr),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Vr,[e.showSearch&&e.showItems?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Nr,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),onKeydown:t[2]||(t[2]=function(t){return e.onSearchTermKeydown(t)}),placeholder:e.translate("General_Search")},null,40,Tr),[[i["vModelText"],e.searchTerm],[c,{},e.showItems]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,Ar),[[i["vShow"],!e.searchTerm]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("img",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset",src:"plugins/CoreHome/images/reset_search.png",title:e.translate("General_Clear")},null,8,Ir),[[i["vShow"],e.searchTerm]])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(i["renderSlot"])(e.$slots,"default")])],512),[[i["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var xr=window,Mr=xr.$,Lr=Object(i["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:String},directives:{FocusAnywhereButHere:dt,FocusIf:mt},emits:["afterSelect"],watch:{menuTitle:function(){this.actualMenuTitle=this.menuTitle}},data:function(){return{showItems:!1,searchTerm:"",actualMenuTitle:this.menuTitle}},methods:{lostFocus:function(){this.showItems=!1},selectItem:function(e){var t=e.target.classList;!t.contains("item")||t.contains("disabled")||t.contains("separator")||(!1!==this.menuTitleChangeOnClick&&(this.actualMenuTitle=e.target.textContent.replace(/[\u0000-\u2666]/g,(function(e){return"&#".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Mr(this.$slots.default()).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect"))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Mr(this.$refs.root).find(".item").each((function(e,n){var r=Mr(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});Lr.render=Br;var Fr=Lr,Rr=(rn({component:Fr,scope:{menuTitle:{angularJsBind:"@"},tooltip:{angularJsBind:"@"},showSearch:{angularJsBind:"="},menuTitleChangeOnClick:{angularJsBind:"="}},directiveName:"piwikMenudropdown",transclude:!0,events:{"after-select":function(e,t,n){setTimeout((function(){n.$apply()}),0)}}}),{ref:"root"}); + */function Ar(){return fr}Ar.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",Ar);pn({component:Tr,directiveName:"piwikComparisons",restrict:"E"});var Ir={ref:"root",class:"menuDropdown"},Br=["title"],xr=["innerHTML"],Mr=Object(i["createElementVNode"])("span",{class:"icon-arrow-bottom"},null,-1),Lr={class:"items"},Fr={key:0,class:"search"},Rr=["placeholder"],_r=["title"],$r=["title"];function Hr(e,t,n,r,o,a){var c=Object(i["resolveDirective"])("focus-if"),l=Object(i["resolveDirective"])("focus-anywhere-but-here");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ir,[Object(i["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,xr),Mr],8,Br),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Lr,[e.showSearch&&e.showItems?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Fr,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),onKeydown:t[2]||(t[2]=function(t){return e.onSearchTermKeydown(t)}),placeholder:e.translate("General_Search")},null,40,Rr),[[i["vModelText"],e.searchTerm],[c,{},e.showItems]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("img",{class:"search_ico",src:"plugins/Morpheus/images/search_ico.png",title:e.translate("General_Search")},null,8,_r),[[i["vShow"],!e.searchTerm]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("img",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset",src:"plugins/CoreHome/images/reset_search.png",title:e.translate("General_Clear")},null,8,$r),[[i["vShow"],e.searchTerm]])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(i["renderSlot"])(e.$slots,"default")])],512),[[i["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var Ur=window,Wr=Ur.$,qr=Object(i["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:String},directives:{FocusAnywhereButHere:dt,FocusIf:mt},emits:["afterSelect"],watch:{menuTitle:function(){this.actualMenuTitle=this.menuTitle}},data:function(){return{showItems:!1,searchTerm:"",actualMenuTitle:this.menuTitle}},methods:{lostFocus:function(){this.showItems=!1},selectItem:function(e){var t=e.target.classList;!t.contains("item")||t.contains("disabled")||t.contains("separator")||(!1!==this.menuTitleChangeOnClick&&(this.actualMenuTitle=e.target.textContent.replace(/[\u0000-\u2666]/g,(function(e){return"&#".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Wr(this.$slots.default()).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect"))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Wr(this.$refs.root).find(".item").each((function(e,n){var r=Wr(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});qr.render=Hr;var Jr=qr,Gr=(pn({component:Jr,scope:{menuTitle:{angularJsBind:"@"},tooltip:{angularJsBind:"@"},showSearch:{angularJsBind:"="},menuTitleChangeOnClick:{angularJsBind:"="}},directiveName:"piwikMenudropdown",transclude:!0,events:{"after-select":function(e,t,n){setTimeout((function(){n.$apply()}),0)}}}),{ref:"root"}); /*! * 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,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Rr,null,512)}function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hr(e){for(var t=1;t=e.selectedDateStart&&n<=e.selectedDateEnd?t.addClass("ui-datepicker-current-period"):t.removeClass("ui-datepicker-current-period"),e.highlightedDateStart&&e.highlightedDateEnd&&n>=e.highlightedDateStart&&n<=e.highlightedDateEnd){var o=r.length?r:t;o.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function o(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function a(e,t,n){var r,i=e.parent(),a=i.children("td");if(i.is(":first-child")){var c=i.children("td:not(.ui-datepicker-other-month)").first();return r=o(c,t,n),r.setDate(a.index(e)-a.index(c)+1),r}var l=i.children("td:not(.ui-datepicker-other-month)").last();return r=o(l,t,n),r.setDate(r.getDate()+a.index(e)-a.index(l)),r}function c(){var e=Jr(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),o=parseInt(t.attr("data-year"),10);return[r,o]}function l(){var e=Jr(n.value),t=e.find(".ui-datepicker-calendar"),i=c(),a=t.find("td"),l=a.first(),s=o(l,i[0],i[1]);a.each((function(){r(Jr(this),s),s.setDate(s.getDate()+1)}))}function s(){var t=e.viewDate;if(!t)return!1;if(!(t instanceof Date))try{t=E(t)}catch(i){return!1}var r=Jr(n.value),o=c();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=Jr(n.value);e.find("td[data-event]").off("click"),e.find(".ui-state-active").removeClass("ui-state-active"),e.find(".ui-datepicker-current-day").removeClass("ui-datepicker-current-day"),e.find(".ui-datepicker-prev,.ui-datepicker-next").attr("href","")}function d(){var t=Jr(n.value),r=e.stepMonths||Wr;if(t.datepicker("option","stepMonths")===r)return!1;var o=Jr(".ui-datepicker-month",t).val(),i=Jr(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(i,o)),u(),!0}function p(){var t=Jr(n.value);t.find(".ui-datepicker-month").attr("disabled",e.disableMonthDropdown)}function f(){if(Jr(this).hasClass("ui-state-hover")){var e=Jr(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function m(){p(),l()}return Object(i["watch"])((function(){return Hr({},e)}),(function(e,t){var n=!1;["selectedDateStart","selectedDateEnd","highlightedDateStart","highlightedDateEnd"].forEach((function(r){n||(!e[r]&&t[r]&&(n=!0),e[r]&&!t[r]&&(n=!0),e[r]&&t[r]&&e[r].getTime()!==t[r].getTime()&&(n=!0))})),e.viewDate!==t.viewDate&&s()&&(n=!0),e.stepMonths!==t.stepMonths&&d(),e.enableDisableMonthDropdown!==t.enableDisableMonthDropdown&&p(),n&&l()})),Object(i["onMounted"])((function(){var r=Jr(n.value),i=e.options||{},a=Hr(Hr(Hr({},S.getBaseDatePickerOptions()),i),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(a),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=c(),n=Jr(this),r=o(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){l()})),r.on("mouseleave","table",(function(){return t.emit("cellHoverLeave")})).on("mouseenter","thead",(function(){return t.emit("cellHoverLeave")})),r.on("click","tbody td.ui-datepicker-other-month",(function(){return f()})),r.on("click",(function(e){e.preventDefault();var t=Jr(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&m()})),r.on("click","td[data-month]",(function(e){var n=Jr(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),o=parseInt(n.attr("data-year"),10),i=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,i)})}));var h=d();s(),p(),h||u(),l()})),{root:n}}});Gr.render=_r;var zr=Gr,Yr=(rn({component:zr,scope:{selectedDateStart:{angularJsBind:"<"},selectedDateEnd:{angularJsBind:"<"},highlightedDateStart:{angularJsBind:"<"},highlightedDateEnd:{angularJsBind:"<"},viewDate:{angularJsBind:"<"},stepMonths:{angularJsBind:"<"},disableMonthDropdown:{angularJsBind:"<"},options:{angularJsBind:"<"},cellHover:{angularJsBind:"&"},cellHoverLeave:{angularJsBind:"&"},dateSelect:{angularJsBind:"&"}},directiveName:"piwikDatePicker",events:{"cell-hover":function(e,t,n,r,o){o()},"cell-hover-leave":function(e,t,n,r,o){o()},"date-select":function(e,t,n,r,o){o()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),Qr={id:"calendarRangeTo"}; + */function zr(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Gr,null,512)}function Yr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Qr(e){for(var t=1;t=e.selectedDateStart&&n<=e.selectedDateEnd?t.addClass("ui-datepicker-current-period"):t.removeClass("ui-datepicker-current-period"),e.highlightedDateStart&&e.highlightedDateEnd&&n>=e.highlightedDateStart&&n<=e.highlightedDateEnd){var o=r.length?r:t;o.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function o(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function a(e,t,n){var r,i=e.parent(),a=i.children("td");if(i.is(":first-child")){var c=i.children("td:not(.ui-datepicker-other-month)").first();return r=o(c,t,n),r.setDate(a.index(e)-a.index(c)+1),r}var l=i.children("td:not(.ui-datepicker-other-month)").last();return r=o(l,t,n),r.setDate(r.getDate()+a.index(e)-a.index(l)),r}function c(){var e=eo(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),o=parseInt(t.attr("data-year"),10);return[r,o]}function l(){var e=eo(n.value),t=e.find(".ui-datepicker-calendar"),i=c(),a=t.find("td"),l=a.first(),s=o(l,i[0],i[1]);a.each((function(){r(eo(this),s),s.setDate(s.getDate()+1)}))}function s(){var t=e.viewDate;if(!t)return!1;if(!(t instanceof Date))try{t=E(t)}catch(i){return!1}var r=eo(n.value),o=c();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function u(){var e=eo(n.value);e.find("td[data-event]").off("click"),e.find(".ui-state-active").removeClass("ui-state-active"),e.find(".ui-datepicker-current-day").removeClass("ui-datepicker-current-day"),e.find(".ui-datepicker-prev,.ui-datepicker-next").attr("href","")}function d(){var t=eo(n.value),r=e.stepMonths||Xr;if(t.datepicker("option","stepMonths")===r)return!1;var o=eo(".ui-datepicker-month",t).val(),i=eo(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(i,o)),u(),!0}function p(){var t=eo(n.value);t.find(".ui-datepicker-month").attr("disabled",e.disableMonthDropdown)}function f(){if(eo(this).hasClass("ui-state-hover")){var e=eo(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function m(){p(),l()}return Object(i["watch"])((function(){return Qr({},e)}),(function(e,t){var n=!1;["selectedDateStart","selectedDateEnd","highlightedDateStart","highlightedDateEnd"].forEach((function(r){n||(!e[r]&&t[r]&&(n=!0),e[r]&&!t[r]&&(n=!0),e[r]&&t[r]&&e[r].getTime()!==t[r].getTime()&&(n=!0))})),e.viewDate!==t.viewDate&&s()&&(n=!0),e.stepMonths!==t.stepMonths&&d(),e.enableDisableMonthDropdown!==t.enableDisableMonthDropdown&&p(),n&&l()})),Object(i["onMounted"])((function(){var r=eo(n.value),i=e.options||{},a=Qr(Qr(Qr({},S.getBaseDatePickerOptions()),i),{},{onChangeMonthYear:function(){setTimeout((function(){u()}))}});r.datepicker(a),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=c(),n=eo(this),r=o(n,e[0],e[1]);t.emit("cellHover",{date:r,$cell:n})})),r.on("mouseout","tbody td a",(function(){l()})),r.on("mouseleave","table",(function(){return t.emit("cellHoverLeave")})).on("mouseenter","thead",(function(){return t.emit("cellHoverLeave")})),r.on("click","tbody td.ui-datepicker-other-month",(function(){return f()})),r.on("click",(function(e){e.preventDefault();var t=eo(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&m()})),r.on("click","td[data-month]",(function(e){var n=eo(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),o=parseInt(n.attr("data-year"),10),i=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,i)})}));var h=d();s(),p(),h||u(),l()})),{root:n}}});to.render=zr;var no=to,ro=(pn({component:no,scope:{selectedDateStart:{angularJsBind:"<"},selectedDateEnd:{angularJsBind:"<"},highlightedDateStart:{angularJsBind:"<"},highlightedDateEnd:{angularJsBind:"<"},viewDate:{angularJsBind:"<"},stepMonths:{angularJsBind:"<"},disableMonthDropdown:{angularJsBind:"<"},options:{angularJsBind:"<"},cellHover:{angularJsBind:"&"},cellHoverLeave:{angularJsBind:"&"},dateSelect:{angularJsBind:"&"}},directiveName:"piwikDatePicker",events:{"cell-hover":function(e,t,n,r,o){o()},"cell-hover-leave":function(e,t,n,r,o){o()},"date-select":function(e,t,n,r,o){o()}},$inject:["$timeout"]}),{id:"calendarRangeFrom"}),oo={id:"calendarRangeTo"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Kr(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("DatePicker");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",Yr,[Object(i["createElementVNode"])("h6",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateText=t}),onKeydown:t[1]||(t[1]=function(t){return e.onRangeInputChanged("from",t)}),onKeyup:t[2]||(t[2]=function(t){return e.handleEnterPress(t)})},null,544),[[i["vModelText"],e.startDateText]])]),Object(i["createVNode"])(c,{id:"calendarFrom","view-date":e.startDate,"selected-date-start":e.fromPickerSelectedDates[0],"selected-date-end":e.fromPickerSelectedDates[1],"highlighted-date-start":e.fromPickerHighlightedDates[0],"highlighted-date-end":e.fromPickerHighlightedDates[1],onDateSelect:t[3]||(t[3]=function(t){return e.setStartRangeDate(t.date)}),onCellHover:t[4]||(t[4]=function(t){return e.fromPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[5]||(t[5]=function(t){return e.fromPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])]),Object(i["createElementVNode"])("div",Qr,[Object(i["createElementVNode"])("h6",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.endDateText=t}),onKeydown:t[7]||(t[7]=function(t){return e.onRangeInputChanged("to",t)}),onKeyup:t[8]||(t[8]=function(t){return e.handleEnterPress(t)})},null,544),[[i["vModelText"],e.endDateText]])]),Object(i["createVNode"])(c,{id:"calendarTo","view-date":e.endDate,"selected-date-start":e.toPickerSelectedDates[0],"selected-date-end":e.toPickerSelectedDates[1],"highlighted-date-start":e.toPickerHighlightedDates[0],"highlighted-date-end":e.toPickerHighlightedDates[1],onDateSelect:t[9]||(t[9]=function(t){return e.setEndRangeDate(t.date)}),onCellHover:t[10]||(t[10]=function(t){return e.toPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[11]||(t[11]=function(t){return e.toPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])])])}var Xr="YYYY-MM-DD",Zr=Object(i["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:zr},data:function(){var e=null;try{e=E(this.startDate)}catch(n){}var t=null;try{t=E(this.endDate)}catch(n){}return{fromPickerSelectedDates:[e,e],toPickerSelectedDates:[t,t],fromPickerHighlightedDates:[null,null],toPickerHighlightedDates:[null,null],startDateText:this.startDate,endDateText:this.endDate,startDateInvalid:!1,endDateInvalid:!1}},emits:["rangeChange","submit"],watch:{startDate:function(){this.startDateText=this.startDate,this.setStartRangeDateFromStr(this.startDate)},endDate:function(){this.endDateText=this.endDate,this.setEndRangeDateFromStr(this.endDate)}},mounted:function(){this.rangeChanged()},methods:{setStartRangeDate:function(e){this.fromPickerSelectedDates=[e,e],this.rangeChanged()},setEndRangeDate:function(e){this.toPickerSelectedDates=[e,e],this.rangeChanged()},onRangeInputChanged:function(e,t){var n=this;setTimeout((function(){"from"===e?n.setStartRangeDateFromStr(t.target.value):n.setEndRangeDateFromStr(t.target.value)}))},getNewHighlightedDates:function(e,t){return t.hasClass("ui-datepicker-unselectable")?null:[e,e]},handleEnterPress:function(e){13===e.keyCode&&this.$emit("submit",{start:this.startDate,end:this.endDate})},setStartRangeDateFromStr:function(e){var t;this.startDateInvalid=!0;try{e.length===Xr.length&&(t=E(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){var t;this.endDateInvalid=!0;try{e.length===Xr.length&&(t=E(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:P(this.fromPickerSelectedDates[0]),end:P(this.toPickerSelectedDates[0])})}}});Zr.render=Kr;var eo=Zr; + */function io(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("DatePicker");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",ro,[Object(i["createElementVNode"])("h6",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateText=t}),onKeydown:t[1]||(t[1]=function(t){return e.onRangeInputChanged("from",t)}),onKeyup:t[2]||(t[2]=function(t){return e.handleEnterPress(t)})},null,544),[[i["vModelText"],e.startDateText]])]),Object(i["createVNode"])(c,{id:"calendarFrom","view-date":e.startDate,"selected-date-start":e.fromPickerSelectedDates[0],"selected-date-end":e.fromPickerSelectedDates[1],"highlighted-date-start":e.fromPickerHighlightedDates[0],"highlighted-date-end":e.fromPickerHighlightedDates[1],onDateSelect:t[3]||(t[3]=function(t){return e.setStartRangeDate(t.date)}),onCellHover:t[4]||(t[4]=function(t){return e.fromPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[5]||(t[5]=function(t){return e.fromPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])]),Object(i["createElementVNode"])("div",oo,[Object(i["createElementVNode"])("h6",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.endDateText=t}),onKeydown:t[7]||(t[7]=function(t){return e.onRangeInputChanged("to",t)}),onKeyup:t[8]||(t[8]=function(t){return e.handleEnterPress(t)})},null,544),[[i["vModelText"],e.endDateText]])]),Object(i["createVNode"])(c,{id:"calendarTo","view-date":e.endDate,"selected-date-start":e.toPickerSelectedDates[0],"selected-date-end":e.toPickerSelectedDates[1],"highlighted-date-start":e.toPickerHighlightedDates[0],"highlighted-date-end":e.toPickerHighlightedDates[1],onDateSelect:t[9]||(t[9]=function(t){return e.setEndRangeDate(t.date)}),onCellHover:t[10]||(t[10]=function(t){return e.toPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)}),onCellHoverLeave:t[11]||(t[11]=function(t){return e.toPickerHighlightedDates=[null,null]})},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])])])}var ao="YYYY-MM-DD",co=Object(i["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:no},data:function(){var e=null;try{e=E(this.startDate)}catch(n){}var t=null;try{t=E(this.endDate)}catch(n){}return{fromPickerSelectedDates:[e,e],toPickerSelectedDates:[t,t],fromPickerHighlightedDates:[null,null],toPickerHighlightedDates:[null,null],startDateText:this.startDate,endDateText:this.endDate,startDateInvalid:!1,endDateInvalid:!1}},emits:["rangeChange","submit"],watch:{startDate:function(){this.startDateText=this.startDate,this.setStartRangeDateFromStr(this.startDate)},endDate:function(){this.endDateText=this.endDate,this.setEndRangeDateFromStr(this.endDate)}},mounted:function(){this.rangeChanged()},methods:{setStartRangeDate:function(e){this.fromPickerSelectedDates=[e,e],this.rangeChanged()},setEndRangeDate:function(e){this.toPickerSelectedDates=[e,e],this.rangeChanged()},onRangeInputChanged:function(e,t){var n=this;setTimeout((function(){"from"===e?n.setStartRangeDateFromStr(t.target.value):n.setEndRangeDateFromStr(t.target.value)}))},getNewHighlightedDates:function(e,t){return t.hasClass("ui-datepicker-unselectable")?null:[e,e]},handleEnterPress:function(e){13===e.keyCode&&this.$emit("submit",{start:this.startDate,end:this.endDate})},setStartRangeDateFromStr:function(e){var t;this.startDateInvalid=!0;try{e.length===ao.length&&(t=E(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){var t;this.endDateInvalid=!0;try{e.length===ao.length&&(t=E(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:P(this.fromPickerSelectedDates[0]),end:P(this.toPickerSelectedDates[0])})}}});co.render=io;var lo=co; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:eo,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function to(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("DatePicker");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{"selected-date-start":e.selectedDates[0],"selected-date-end":e.selectedDates[1],"highlighted-date-start":e.highlightedDates[0],"highlighted-date-end":e.highlightedDates[1],"view-date":e.viewDate,"step-months":"year"===e.period?12:1,"disable-month-dropdown":"year"===e.period,onCellHover:t[0]||(t[0]=function(t){return e.onHoverNormalCell(t.date,t.$cell)}),onCellHoverLeave:t[1]||(t[1]=function(t){return e.onHoverLeaveNormalCells()}),onDateSelect:t[2]||(t[2]=function(t){return e.onDateSelected(t.date)})},null,8,["selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end","view-date","step-months","disable-month-dropdown"])}var no=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),ro=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay),oo=Object(i["defineComponent"])({props:{period:String,date:[String,Date]},components:{DatePicker:zr},emits:["select"],setup:function(e,t){var n=Object(i["ref"])(e.date),r=Object(i["ref"])([null,null]),o=Object(i["ref"])([null,null]);function a(t){var n=p.get(e.period).parse(t).getDateRange();return n[0]=non[1]?n[1]:ro,n}function c(t,n){var r=tro,i=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);o.value=r||i?[null,null]:a(t)}function l(){o.value=[null,null]}function s(e){t.emit("select",{date:e})}function u(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=E(e.date)}return Object(i["watch"])(e,u),u(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:c,onHoverLeaveNormalCells:l,onDateSelected:s}}});oo.render=to;var io=oo,ao=(rn({component:io,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),["value","name"]),co=["title"],lo=["textContent"],so={key:1,class:"placeholder"},uo={class:"dropdown"},po={class:"custom_select_search"},fo=["placeholder"],mo={key:0},ho={class:"custom_select_container"},go=["onClick"],bo=["innerHTML","href","title"],vo={class:"ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect"},yo={class:"ui-menu-item"},Oo={class:"ui-corner-all",tabindex:"-1"},wo={key:1}; + */pn({component:lo,scope:{startDate:{angularJsBind:"<"},endDate:{angularJsBind:"<"},rangeChange:{angularJsBind:"&"},submit:{angularJsBind:"&"}},directiveName:"piwikDateRangePicker",restrict:"E"});function so(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("DatePicker");return Object(i["openBlock"])(),Object(i["createBlock"])(c,{"selected-date-start":e.selectedDates[0],"selected-date-end":e.selectedDates[1],"highlighted-date-start":e.highlightedDates[0],"highlighted-date-end":e.highlightedDates[1],"view-date":e.viewDate,"step-months":"year"===e.period?12:1,"disable-month-dropdown":"year"===e.period,onCellHover:t[0]||(t[0]=function(t){return e.onHoverNormalCell(t.date,t.$cell)}),onCellHoverLeave:t[1]||(t[1]=function(t){return e.onHoverLeaveNormalCells()}),onDateSelect:t[2]||(t[2]=function(t){return e.onDateSelected(t.date)})},null,8,["selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end","view-date","step-months","disable-month-dropdown"])}var uo=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay),po=new Date(S.maxDateYear,S.maxDateMonth-1,S.maxDateDay),fo=Object(i["defineComponent"])({props:{period:String,date:[String,Date]},components:{DatePicker:no},emits:["select"],setup:function(e,t){var n=Object(i["ref"])(e.date),r=Object(i["ref"])([null,null]),o=Object(i["ref"])([null,null]);function a(t){var n=p.get(e.period).parse(t).getDateRange();return n[0]=uon[1]?n[1]:po,n}function c(t,n){var r=tpo,i=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);o.value=r||i?[null,null]:a(t)}function l(){o.value=[null,null]}function s(e){t.emit("select",{date:e})}function u(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=E(e.date)}return Object(i["watch"])(e,u),u(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:c,onHoverLeaveNormalCells:l,onDateSelected:s}}});fo.render=so;var mo=fo,ho=(pn({component:mo,scope:{period:{angularJsBind:"<"},date:{angularJsBind:"<"},select:{angularJsBind:"&"}},directiveName:"piwikPeriodDatePicker",restrict:"E"}),["value","name"]),go=["title"],vo=["textContent"],bo={key:1,class:"placeholder"},yo={class:"dropdown"},Oo={class:"custom_select_search"},wo=["placeholder"],jo={key:0},ko={class:"custom_select_container"},So=["onClick"],Co=["innerHTML","href","title"],Po={class:"ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all\n siteSelect"},Do={class:"ui-menu-item"},Eo={class:"ui-corner-all",tabindex:"-1"},Vo={key:1}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function jo(e,t,n,r,o,a){var c,l,s,u,d=Object(i["resolveComponent"])("AllSitesLink"),p=Object(i["resolveDirective"])("focus-if"),f=Object(i["resolveDirective"])("focus-anywhere-but-here");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(i["openBlock"])(),Object(i["createElementBlock"])("input",{key:0,type:"hidden",value:null===(c=e.modelValue)||void 0===c?void 0:c.id,name:e.name},null,8,ao)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=function(){return e.onClickSelector&&e.onClickSelector.apply(e,arguments)}),onKeydown:t[1]||(t[1]=function(t){return e.onPressEnter(t)}),href:"javascript:void(0)",class:Object(i["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(i["createElementVNode"])("span",{class:Object(i["normalizeClass"])(["icon icon-arrow-bottom",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(i["createElementVNode"])("span",null,[null!==(l=e.modelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{key:0,textContent:Object(i["toDisplayString"])((null===(s=e.modelValue)||void 0===s?void 0:s.name)||e.firstSiteName)},null,8,lo)):Object(i["createCommentVNode"])("",!0),null!==(u=e.modelValue)&&void 0!==u&&u.name||!e.placeholder?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",so,Object(i["toDisplayString"])(e.placeholder),1))])],42,co),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",uo,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",po,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=function(t){e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,fo),[[i["vModelText"],e.searchTerm],[p,{},e.shouldFocusOnSearch]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=function(t){e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[i["vShow"],e.searchTerm]])],512),[[i["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",mo,[Object(i["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",ho,[Object(i["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.sites,(function(n,r){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{onClick:function(t){return e.switchSite(n,t)},key:r},[Object(i["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.getMatchedSiteName(n.name)),tabindex:"4",href:e.getUrlForSiteId(n.idsite),title:n.name},null,8,bo)],8,go)),[[i["vShow"],!(!e.showSelectedSite&&e.activeSiteId===n.idsite)]])})),128))]),Object(i["withDirectives"])(Object(i["createElementVNode"])("ul",vo,[Object(i["createElementVNode"])("li",yo,[Object(i["createElementVNode"])("a",Oo,Object(i["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[i["vShow"],!e.sites.length&&e.searchTerm]])]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",wo,[Object(i["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=function(t){return e.onAllSitesClick(t)})},null,8,["href","all-sites-text"])])):Object(i["createCommentVNode"])("",!0)],512),[[i["vShow"],e.showSitesList]])],2)),[[f,{blur:e.onBlur}]])}var ko=["innerHTML","href"];function So(e,t,n,r,o,a){var c=this;return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return c.onClick(e)}),class:"custom_select_all"},[Object(i["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,ko)])}var Co=Object(i["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Co.render=So;var Po=Co;function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Eo(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Qe.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(r){var o=r.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Qe.fetch({method:i,limit:o,pattern:e},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites()}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Eo(Eo({},e),{},{name:e.group?"[".concat(e.group,"] ").concat(e.name):e.name})})),t.sort((function(e,t){return e.name.toLowerCase()t.name.toLowerCase()?1:0})),t):[]}}]),e}(),Bo=new Io,xo=300;function Mo(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo;return function(){for(var r=arguments.length,o=new Array(r),i=0;i1},firstSiteName:function(){var e=Bo.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=De.stringify(Fo(Fo({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period}));return"?".concat(e)}},created:function(){this.searchSite=Mo(this.searchSite.bind(this))},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({idsite:"all",name:this.allSitesText},e),this.showSitesList=!1},switchSite:function(e,t){var n=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&n&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.idsite,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.idsite&&Bo.loadSite(e.idsite))},onBlur:function(){this.showSitesList=!1,this.$emit("blur")},onClickSelector:function(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter:function(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName:function(e){var t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return S.helper.htmlEntities(e);var n=S.helper.htmlEntities(e.substring(0,t)),r=S.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'').concat(this.searchTerm,"").concat(r)},loadInitialSites:function(){var e=this;return Bo.loadInitialSites().then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Bo.searchSite(e,this.onlySitesWithAdminAccess).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=De.stringify(Fo(Fo({},De.urlParsed.value),{},{segment:"",idSite:e})),n=De.stringify(Fo(Fo({},De.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});_o.render=jo;var $o=_o; + */var $o=function(){function e(){var t=this;Lo(this,e),_o(this,"state",Object(i["reactive"])({initialSites:[],isInitialized:!1})),_o(this,"currentRequestAbort",void 0),_o(this,"limitRequest",void 0),_o(this,"initialSites",Object(i["computed"])((function(){return Object(i["readonly"])(t.state.initialSites)})))}return Ro(e,[{key:"loadInitialSites",value:function(){var e=this;return this.state.isInitialized?Promise.resolve(Object(i["readonly"])(this.state.initialSites)):this.searchSite("%").then((function(t){return e.state.isInitialized=!0,e.state.initialSites=t,Object(i["readonly"])(t)}))}},{key:"loadSite",value:function(e){"all"===e?De.updateUrl(Mo(Mo({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period})):De.updateUrl(Mo(Mo({},De.urlParsed.value),{},{segment:"",idSite:e}),Mo(Mo({},De.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Qe.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(r){var o=r.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Qe.fetch({method:i,limit:o,pattern:e},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites()}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Mo(Mo({},e),{},{name:e.group?"[".concat(e.group,"] ").concat(e.name):e.name})})),t.sort((function(e,t){return e.name.toLowerCase()t.name.toLowerCase()?1:0})),t):[]}}]),e}(),Ho=new $o,Uo=300;function Wo(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uo;return function(){for(var r=arguments.length,o=new Array(r),i=0;i1},firstSiteName:function(){var e=Ho.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=De.stringify(Jo(Jo({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period}));return"?".concat(e)}},created:function(){this.searchSite=Wo(this.searchSite.bind(this))},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({idsite:"all",name:this.allSitesText},e),this.showSitesList=!1},switchSite:function(e,t){var n=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&n&&t.target&&t.target.href?window.open(t.target.href,"_blank"):(this.$emit("update:modelValue",{id:e.idsite,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.idsite&&Ho.loadSite(e.idsite))},onBlur:function(){this.showSitesList=!1,this.$emit("blur")},onClickSelector:function(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter:function(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName:function(e){var t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return S.helper.htmlEntities(e);var n=S.helper.htmlEntities(e.substring(0,t)),r=S.helper.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'').concat(this.searchTerm,"").concat(r)},loadInitialSites:function(){var e=this;return Ho.loadInitialSites().then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Ho.searchSite(e,this.onlySitesWithAdminAccess).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=De.stringify(Jo(Jo({},De.urlParsed.value),{},{segment:"",idSite:e})),n=De.stringify(Jo(Jo({},De.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)}}});zo.render=No;var Yo=zo; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:$o,require:"?ngModel",scope:{showSelectedSite:{angularJsBind:"="},showAllSitesItem:{angularJsBind:"="},switchSiteOnSelect:{angularJsBind:"="},onlySitesWithAdminAccess:{angularJsBind:"="},name:{angularJsBind:"@"},allSitesText:{angularJsBind:"@"},allSitesLocation:{angularJsBind:"@"},placeholder:{angularJsBind:"@"},modelValue:{default:function(e,t,n){return n.siteid&&n.sitename?{id:n.siteid,name:S.helper.htmlDecode(n.sitename)}:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:void 0}}},$inject:["$timeout"],directiveName:"piwikSiteselector",events:{"update:modelValue":function(e,t,n,r,o,i,a){(e&&!t.modelValue||!e&&t.modelValue||e.id!==t.modelValue.id)&&a((function(){n.value=e,r.attr("siteid",e.id),r.trigger("change",e),i&&(i.$setViewValue(e),i.$render())}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,o){var a=o;t.$watch("value",(function(t){Object(i["nextTick"])((function(){t!==e.modelValue&&(e.modelValue=t)}))})),r.siteid&&r.sitename?e.modelValue={id:r.siteid,name:S.helper.htmlDecode(r.sitename)}:S.idSite&&(e.modelValue={id:S.idSite,name:S.helper.htmlDecode(S.siteName)}),a&&(a.$setViewValue(e.modelValue),a.$render=function(){Object(i["nextTick"])((function(){Object(i["nextTick"])((function(){angular.isString(a.$viewValue)?e.modelValue=JSON.parse(a.$viewValue):e.modelValue=a.$viewValue}))}))})}}); + */pn({component:Yo,require:"?ngModel",scope:{showSelectedSite:{angularJsBind:"="},showAllSitesItem:{angularJsBind:"="},switchSiteOnSelect:{angularJsBind:"="},onlySitesWithAdminAccess:{angularJsBind:"="},name:{angularJsBind:"@"},allSitesText:{angularJsBind:"@"},allSitesLocation:{angularJsBind:"@"},placeholder:{angularJsBind:"@"},modelValue:{default:function(e,t,n){return n.siteid&&n.sitename?{id:n.siteid,name:S.helper.htmlDecode(n.sitename)}:S.idSite?{id:S.idSite,name:S.helper.htmlDecode(S.siteName)}:void 0}}},$inject:["$timeout"],directiveName:"piwikSiteselector",events:{"update:modelValue":function(e,t,n,r,o,i,a){(e&&!t.modelValue||!e&&t.modelValue||e.id!==t.modelValue.id)&&a((function(){n.value=e,r.attr("siteid",e.id),r.trigger("change",e),i&&(i.$setViewValue(e),i.$render())}))},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}},postCreate:function(e,t,n,r,o){var a=o;t.$watch("value",(function(t){Object(i["nextTick"])((function(){t!==e.modelValue&&(e.modelValue=t)}))})),r.siteid&&r.sitename?e.modelValue={id:r.siteid,name:S.helper.htmlDecode(r.sitename)}:S.idSite&&(e.modelValue={id:S.idSite,name:S.helper.htmlDecode(S.siteName)}),a&&(a.$setViewValue(e.modelValue),a.$render=function(){Object(i["nextTick"])((function(){Object(i["nextTick"])((function(){angular.isString(a.$viewValue)?e.modelValue=JSON.parse(a.$viewValue):e.modelValue=a.$viewValue}))}))})}}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Ho(){return{get initialSites(){return Bo.initialSites.value},loadSite:Bo.loadSite.bind(Bo),loadInitialSites:function(){return ln(Bo.loadInitialSites())},searchSite:function(){return ln(Bo.searchSite.apply(Bo,arguments))}}}angular.module("piwikApp.service").factory("siteSelectorModel",Ho);var Uo={ref:"root",class:"quickAccessInside"},Wo=["title"],qo={class:"dropdown"},Jo={class:"no-result"},Go=["onClick"],zo=["onMouseenter","onClick"],Yo={class:"quickAccessMatomoSearch"},Qo=["onMouseenter","onClick"],Ko=["textContent"],Xo={class:"quick-access-category helpCategory"},Zo=["href"];function ei(e,t,n,r,o,a){var c=Object(i["resolveDirective"])("focus-if"),l=Object(i["resolveDirective"])("focus-anywhere-but-here");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Uo,[Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,544),[[i["vShow"],!(e.searchTerm||e.searchActive)]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{class:"s",onKeydown:t[1]||(t[1]=function(t){return e.onKeypress(t)}),onFocus:t[2]||(t[2]=function(t){return e.searchActive=!0}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),type:"text",tabindex:"2",title:e.quickAccessTitle},null,40,Wo),[[i["vModelText"],e.searchTerm],[c,{},e.searchActive]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",qo,[Object(i["withDirectives"])(Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",Jo,Object(i["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[i["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.menuItems,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("ul",{key:t.title},[Object(i["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(i["toDisplayString"])(t.title),9,Go),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.items,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:Object(i["normalizeClass"])(["result",{selected:t.menuIndex===e.searchIndex}]),onMouseenter:function(n){return e.searchIndex=t.menuIndex},onClick:function(n){return e.selectMenuItem(t.index)},key:t.index},[Object(i["createElementVNode"])("a",null,Object(i["toDisplayString"])(t.name.trim()),1)],42,zo)})),128))])})),128)),Object(i["createElementVNode"])("ul",Yo,[Object(i["withDirectives"])(Object(i["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(i["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[i["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("li",{class:"no-result"},Object(i["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[i["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.sites,(function(t,n){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:Object(i["normalizeClass"])(["result",{selected:e.numMenuItems+n===e.searchIndex}]),onMouseenter:function(t){return e.searchIndex=e.numMenuItems+n},onClick:function(n){return e.selectSite(t.idsite)},key:t.idsite},[Object(i["createElementVNode"])("a",{textContent:Object(i["toDisplayString"])(t.name)},null,8,Ko)],42,Qo)),[[i["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",Xo,Object(i["toDisplayString"])(e.translate("General_HelpResources")),1),Object(i["createElementVNode"])("li",{class:Object(i["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(i["createElementVNode"])("a",{href:"https://matomo.org?s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(i["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,Zo)],34)])],512),[[i["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}function ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ni(e){for(var t=1;t=0&&t.left>=0&&t.bottom<=window.$(window).height()&&t.right<=window.$(window).width()}function ii(e){e&&e.scrollIntoView&&e.scrollIntoView()}var ai=Object(i["defineComponent"])({props:{},directives:{FocusAnywhereButHere:dt,FocusIf:mt},watch:{searchActive:function(e){var t=this.$refs.root.parentElement.classList;t.toggle("active",e),t.toggle("expanded",e)}},mounted:function(){var e=this;this.$refs.root.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),S.helper.registerShortcut("f",C("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),ii(e.$refs.root),e.activateSearch())}))},data:function(){var e=!!document.querySelector(".segmentEditorPanel");return{menuItems:[],numMenuItems:0,searchActive:!1,searchTerm:"",searchIndex:0,menuIndexCounter:-1,topMenuItems:null,leftMenuItems:null,segmentItems:null,hasSegmentSelector:e,sites:[],isLoading:!1}},created:function(){this.searchMenu=Mo(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector(".top_controls [piwik-siteselector]")},quickAccessTitle:function(){var e="",t=[C("CoreHome_MenuEntries")];this.hasSegmentSelector&&t.push(C("CoreHome_Segments")),this.hasSitesSelector&&t.push(C("SitesManager_Sites"));while(t.length)e+=t.shift(),t.length>=2?e+=", ":1===t.length&&(e+=" ".concat(C("General_And")," "));return C("CoreHome_QuickAccessTitle",e)}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,o=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||o&&n?this.deactivateSearch():setTimeout((function(){t.searchActive=!0,t.searchMenu(t.searchTerm)}))},highlightPreviousItem:function(){this.searchIndex-1<0?this.searchIndex=0:this.searchIndex-=1,this.makeSureSelectedItemIsInViewport()},highlightNextItem:function(){var e=this.$refs.root.querySelectorAll("li.result").length;e<=this.searchIndex+1?this.searchIndex=e-1:this.searchIndex+=1,this.makeSureSelectedItemIsInViewport()},clickQuickAccessMenuItem:function(){var e=this,t=this.getCurrentlySelectedElement();t&&setTimeout((function(){t.click(),e.$emit("itemSelected",t)}),20)},deactivateSearch:function(){this.searchTerm="",this.searchActive=!1,this.$refs.root.querySelector("input").blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!oi(e)&&ii(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");return e&&e.length&&e.item(this.searchIndex)?e.item(this.searchIndex):null},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},i=[],a=function(e){var t=ni({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(i.push({title:n,items:[]}),o[n]=i.length-1);var a=o[n];i[a].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Bo.searchSite(n).then((function(e){t.sites=e})).finally((function(){t.isLoading=!1})));var c=function(e){return-1!==e.name.toLowerCase().indexOf(n)||-1!==e.category.toLowerCase().indexOf(n)};null===this.topMenuItems&&(this.topMenuItems=this.getTopMenuItems()),null===this.leftMenuItems&&(this.leftMenuItems=this.getLeftMenuItems()),null===this.segmentItems&&(this.segmentItems=this.getSegmentItems());var l=this.topMenuItems.filter(c),s=this.leftMenuItems.filter(c),u=this.segmentItems.filter(c);l.forEach(a),s.forEach(a),u.forEach(a),this.numMenuItems=l.length+s.length+u.length,this.menuItems=i},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Bo.loadSite(e)},selectMenuItem:function(e){var t=document.querySelector("[quick_access='".concat(e,"']"));if(t){this.deactivateSearch();var n=t.getAttribute("href");if(n&&n.length>10&&t&&t.click)try{t.click()}catch(r){window.$(t).click()}else window.$(t).click()}},onBlur:function(){this.searchActive=!1,this.$emit("blur")},activateSearch:function(){this.searchActive=!0},getTopMenuItems:function(){var e=this,t=C("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a").forEach((function(r){var o=r.textContent.trim();o||(o=r.getAttribute("title").trim()),o&&(n.push({name:o,index:e.menuIndexCounter+=1,category:t}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n},getLeftMenuItems:function(){var e=this,t=[];return document.querySelectorAll("#secondNavBar .menuTab").forEach((function(n){var r=window.$(n).find("> .item");r=r[0]?r[0].innerText.trim():"",r&&-1!==r.lastIndexOf("\n")&&(r=r.substr(0,r.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,o){var i=o.textContent.trim();i&&(t.push({name:i,category:r,index:e.menuIndexCounter+=1}),o.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=C("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o=r.querySelector(".segname").textContent.trim();o&&(n.push({name:o,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});ai.render=ei;var ci=ai; +function Qo(){return{get initialSites(){return Ho.initialSites.value},loadSite:Ho.loadSite.bind(Ho),loadInitialSites:function(){return gn(Ho.loadInitialSites())},searchSite:function(){return gn(Ho.searchSite.apply(Ho,arguments))}}}angular.module("piwikApp.service").factory("siteSelectorModel",Qo);var Ko={ref:"root",class:"quickAccessInside"},Xo=["title"],Zo={class:"dropdown"},ei={class:"no-result"},ti=["onClick"],ni=["onMouseenter","onClick"],ri={class:"quickAccessMatomoSearch"},oi=["onMouseenter","onClick"],ii=["textContent"],ai={class:"quick-access-category helpCategory"},ci=["href"];function li(e,t,n,r,o,a){var c=Object(i["resolveDirective"])("focus-if"),l=Object(i["resolveDirective"])("focus-anywhere-but-here");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ko,[Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,544),[[i["vShow"],!(e.searchTerm||e.searchActive)]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{class:"s",onKeydown:t[1]||(t[1]=function(t){return e.onKeypress(t)}),onFocus:t[2]||(t[2]=function(t){return e.searchActive=!0}),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.searchTerm=t}),type:"text",tabindex:"2",title:e.quickAccessTitle},null,40,Xo),[[i["vModelText"],e.searchTerm],[c,{},e.searchActive]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Zo,[Object(i["withDirectives"])(Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",ei,Object(i["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[i["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.menuItems,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("ul",{key:t.title},[Object(i["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(i["toDisplayString"])(t.title),9,ti),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.items,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:Object(i["normalizeClass"])(["result",{selected:t.menuIndex===e.searchIndex}]),onMouseenter:function(n){return e.searchIndex=t.menuIndex},onClick:function(n){return e.selectMenuItem(t.index)},key:t.index},[Object(i["createElementVNode"])("a",null,Object(i["toDisplayString"])(t.name.trim()),1)],42,ni)})),128))])})),128)),Object(i["createElementVNode"])("ul",ri,[Object(i["withDirectives"])(Object(i["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(i["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[i["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("li",{class:"no-result"},Object(i["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[i["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.sites,(function(t,n){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:Object(i["normalizeClass"])(["result",{selected:e.numMenuItems+n===e.searchIndex}]),onMouseenter:function(t){return e.searchIndex=e.numMenuItems+n},onClick:function(n){return e.selectSite(t.idsite)},key:t.idsite},[Object(i["createElementVNode"])("a",{textContent:Object(i["toDisplayString"])(t.name)},null,8,ii)],42,oi)),[[i["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",ai,Object(i["toDisplayString"])(e.translate("General_HelpResources")),1),Object(i["createElementVNode"])("li",{class:Object(i["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(i["createElementVNode"])("a",{href:"https://matomo.org?s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(i["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,ci)],34)])],512),[[i["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t=0&&t.left>=0&&t.bottom<=window.$(window).height()&&t.right<=window.$(window).width()}function fi(e){e&&e.scrollIntoView&&e.scrollIntoView()}var mi=Object(i["defineComponent"])({props:{},directives:{FocusAnywhereButHere:dt,FocusIf:mt},watch:{searchActive:function(e){var t=this.$refs.root.parentElement.classList;t.toggle("active",e),t.toggle("expanded",e)}},mounted:function(){var e=this;this.$refs.root.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),S.helper.registerShortcut("f",C("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),fi(e.$refs.root),e.activateSearch())}))},data:function(){var e=!!document.querySelector(".segmentEditorPanel");return{menuItems:[],numMenuItems:0,searchActive:!1,searchTerm:"",searchIndex:0,menuIndexCounter:-1,topMenuItems:null,leftMenuItems:null,segmentItems:null,hasSegmentSelector:e,sites:[],isLoading:!1}},created:function(){this.searchMenu=Wo(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector(".top_controls [piwik-siteselector]")},quickAccessTitle:function(){var e="",t=[C("CoreHome_MenuEntries")];this.hasSegmentSelector&&t.push(C("CoreHome_Segments")),this.hasSitesSelector&&t.push(C("SitesManager_Sites"));while(t.length)e+=t.shift(),t.length>=2?e+=", ":1===t.length&&(e+=" ".concat(C("General_And")," "));return C("CoreHome_QuickAccessTitle",e)}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,o=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||o&&n?this.deactivateSearch():setTimeout((function(){t.searchActive=!0,t.searchMenu(t.searchTerm)}))},highlightPreviousItem:function(){this.searchIndex-1<0?this.searchIndex=0:this.searchIndex-=1,this.makeSureSelectedItemIsInViewport()},highlightNextItem:function(){var e=this.$refs.root.querySelectorAll("li.result").length;e<=this.searchIndex+1?this.searchIndex=e-1:this.searchIndex+=1,this.makeSureSelectedItemIsInViewport()},clickQuickAccessMenuItem:function(){var e=this,t=this.getCurrentlySelectedElement();t&&setTimeout((function(){t.click(),e.$emit("itemSelected",t)}),20)},deactivateSearch:function(){this.searchTerm="",this.searchActive=!1,this.$refs.root.querySelector("input").blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!pi(e)&&fi(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");return e&&e.length&&e.item(this.searchIndex)?e.item(this.searchIndex):null},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},i=[],a=function(e){var t=ui({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(i.push({title:n,items:[]}),o[n]=i.length-1);var a=o[n];i[a].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Ho.searchSite(n).then((function(e){t.sites=e})).finally((function(){t.isLoading=!1})));var c=function(e){return-1!==e.name.toLowerCase().indexOf(n)||-1!==e.category.toLowerCase().indexOf(n)};null===this.topMenuItems&&(this.topMenuItems=this.getTopMenuItems()),null===this.leftMenuItems&&(this.leftMenuItems=this.getLeftMenuItems()),null===this.segmentItems&&(this.segmentItems=this.getSegmentItems());var l=this.topMenuItems.filter(c),s=this.leftMenuItems.filter(c),u=this.segmentItems.filter(c);l.forEach(a),s.forEach(a),u.forEach(a),this.numMenuItems=l.length+s.length+u.length,this.menuItems=i},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Ho.loadSite(e)},selectMenuItem:function(e){var t=document.querySelector("[quick_access='".concat(e,"']"));if(t){this.deactivateSearch();var n=t.getAttribute("href");if(n&&n.length>10&&t&&t.click)try{t.click()}catch(r){window.$(t).click()}else window.$(t).click()}},onBlur:function(){this.searchActive=!1,this.$emit("blur")},activateSearch:function(){this.searchActive=!0},getTopMenuItems:function(){var e=this,t=C("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a").forEach((function(r){var o=r.textContent.trim();o||(o=r.getAttribute("title").trim()),o&&(n.push({name:o,index:e.menuIndexCounter+=1,category:t}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n},getLeftMenuItems:function(){var e=this,t=[];return document.querySelectorAll("#secondNavBar .menuTab").forEach((function(n){var r=window.$(n).find("> .item");r=r[0]?r[0].innerText.trim():"",r&&-1!==r.lastIndexOf("\n")&&(r=r.substr(0,r.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,o){var i=o.textContent.trim();i&&(t.push({name:i,category:r,index:e.menuIndexCounter+=1}),o.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=C("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o=r.querySelector(".segname").textContent.trim();o&&(n.push({name:o,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});mi.render=li;var hi=mi; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:ci,directiveName:"piwikQuickAccess",events:{itemSelected:function(e,t,n,r,o,i,a){a()},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}}});function li(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var si={class:"fieldArray form-group"},ui={key:0,class:"fieldUiControl"},di=["onClick","title"];function pi(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",si,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.modelValue,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",li({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ui,[Object(i["createVNode"])(c,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n)},null,8,["model-value","options","onUpdate:modelValue","uicontrol","title","name"])])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,di),[[i["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function fi(e){return bi(e)||gi(e)||hi(e)||mi()}function mi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hi(e,t){if(e){if("string"===typeof e)return vi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vi(e,t):void 0}}function gi(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bi(e){if(Array.isArray(e))return vi(e)}function vi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Oi.render=pi;var wi=Oi; + */pn({component:hi,directiveName:"piwikQuickAccess",events:{itemSelected:function(e,t,n,r,o,i,a){a()},blur:function(e,t,n){setTimeout((function(){return n.$apply()}))}}});function gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vi={class:"fieldArray form-group"},bi={key:0,class:"fieldUiControl"},yi=["onClick","title"];function Oi(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",vi,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.modelValue,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",gi({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",bi,[Object(i["createVNode"])(c,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n)},null,8,["model-value","options","onUpdate:modelValue","uicontrol","title","name"])])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,yi),[[i["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function wi(e){return Ci(e)||Si(e)||ki(e)||ji()}function ji(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ki(e,t){if(e){if("string"===typeof e)return Pi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pi(e,t):void 0}}function Si(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ci(e){if(Array.isArray(e))return Pi(e)}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Ei.render=Oi;var Vi=Ei; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:wi,require:"?ngModel",scope:{name:{angularJsBind:"="},field:{angularJsBind:"="}},directiveName:"matomoFieldArray",events:{"update:modelValue":function(e,t,n,r,o,i){e!==t.modelValue&&(r.trigger("change",e),i&&i.$setViewValue(e))}},postCreate:function(e,t,n,r,o){var i=o;i&&(i.$setViewValue(e.modelValue),i.$render=function(){angular.isString(i.$viewValue)?e.modelValue=JSON.parse(i.$viewValue):e.modelValue=i.$viewValue})}});function ji(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ki={class:"multiPairField form-group"},Si={key:1,class:"fieldUiControl fieldUiControl2"},Ci={key:2,class:"fieldUiControl fieldUiControl3"},Pi={key:3,class:"fieldUiControl fieldUiControl4"},Di=["onClick","title"];function Ei(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ki,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.modelValue,(function(t,n){var r;return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},ji(r,"multiPairFieldTable".concat(n),!0),ji(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,class:Object(i["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(i["createVNode"])(c,{"full-width":!0,modelValue:t[e.field1.key],"onUpdate:modelValue":[function(n){return t[e.field1.key]=n},function(t){return e.onEntryChange(n,e.field1.key,t)}],options:e.field1.availableValues,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title},null,8,["modelValue","onUpdate:modelValue","options","uicontrol","name","title"])],2)):Object(i["createCommentVNode"])("",!0),e.field2?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Si,[Object(i["createVNode"])(c,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field2.key,t)},function(n){return t[e.field2.key]=n}],modelValue:t[e.field2.key],placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","name","title"])])):Object(i["createCommentVNode"])("",!0),e.field3?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ci,[Object(i["createVNode"])(c,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field3.key,t)},function(n){return t[e.field3.key]=n}],modelValue:t[e.field3.key],placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(i["createCommentVNode"])("",!0),e.field4?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Pi,[Object(i["createVNode"])(c,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field4.key,t)},function(n){return t[e.field4.key]=n}],modelValue:t[e.field4.key],placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Di),[[i["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function Vi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ni(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}},isEmptyValue:function(e){var t=this.fieldCount;if(4===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key]&&!e[this.field4.key])return!1}else if(3===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key])return!1}else if(2===t){if(!e[this.field1.key]&&!e[this.field2.key])return!1}else if(1===t&&!e[this.field1.key])return!1;return!0},makeEmptyValue:function(){var e={};return this.field1&&this.field1.key&&(e[this.field1.key]=""),this.field2&&this.field2.key&&(e[this.field2.key]=""),this.field3&&this.field3.key&&(e[this.field3.key]=""),this.field4&&this.field4.key&&(e[this.field4.key]=""),e}}});Ri.render=Ei;var _i=Ri,$i=(rn({component:_i,require:"?ngModel",scope:{name:{angularJsBind:"="},field1:{angularJsBind:"="},field2:{angularJsBind:"="},field3:{angularJsBind:"="},field4:{angularJsBind:"="}},directiveName:"matomoMultiPairField",events:{"update:modelValue":function(e,t,n,r,o,i){e!==t.modelValue&&(r.trigger("change",e),i&&i.$setViewValue(e))}},postCreate:function(e,t,n,r,o){var i=o;i&&(i.$setViewValue(e.modelValue),i.$render=function(){angular.isString(i.$viewValue)?e.modelValue=JSON.parse(i.$viewValue):e.modelValue=i.$viewValue})}}),{ref:"root",class:"periodSelector piwikSelector"}),Hi=["title"],Ui=Object(i["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),Wi={id:"periodMore",class:"dropdown"},qi={class:"flex"},Ji={key:0,class:"period-date"},Gi={class:"period-type"},zi={id:"otherPeriods"},Yi=["onDblclick","title"],Qi=["id","checked","onChange","onDblclick"],Ki={key:0,class:"compare-checkbox"},Xi={id:"comparePeriodToDropdown"},Zi={key:1,class:"compare-date-range"},ea={id:"comparePeriodStartDate"},ta=Object(i["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),na={id:"comparePeriodEndDate"},ra={class:"apply-button-container"},oa=["disabled","value"],ia={key:2,id:"ajaxLoadingCalendar"},aa={class:"loadingSegment"}; + */pn({component:Vi,require:"?ngModel",scope:{name:{angularJsBind:"="},field:{angularJsBind:"="}},directiveName:"matomoFieldArray",events:{"update:modelValue":function(e,t,n,r,o,i){e!==t.modelValue&&(r.trigger("change",e),i&&i.$setViewValue(e))}},postCreate:function(e,t,n,r,o){var i=o;i&&(i.$setViewValue(e.modelValue),i.$render=function(){angular.isString(i.$viewValue)?e.modelValue=JSON.parse(i.$viewValue):e.modelValue=i.$viewValue})}});function Ni(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ti={class:"multiPairField form-group"},Ai={key:1,class:"fieldUiControl fieldUiControl2"},Ii={key:2,class:"fieldUiControl fieldUiControl3"},Bi={key:3,class:"fieldUiControl fieldUiControl4"},xi=["onClick","title"];function Mi(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ti,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.modelValue,(function(t,n){var r;return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Ni(r,"multiPairFieldTable".concat(n),!0),Ni(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,class:Object(i["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(i["createVNode"])(c,{"full-width":!0,modelValue:t[e.field1.key],"onUpdate:modelValue":[function(n){return t[e.field1.key]=n},function(t){return e.onEntryChange(n,e.field1.key,t)}],options:e.field1.availableValues,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title},null,8,["modelValue","onUpdate:modelValue","options","uicontrol","name","title"])],2)):Object(i["createCommentVNode"])("",!0),e.field2?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ai,[Object(i["createVNode"])(c,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field2.key,t)},function(n){return t[e.field2.key]=n}],modelValue:t[e.field2.key],placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","name","title"])])):Object(i["createCommentVNode"])("",!0),e.field3?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ii,[Object(i["createVNode"])(c,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field3.key,t)},function(n){return t[e.field3.key]=n}],modelValue:t[e.field3.key],placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(i["createCommentVNode"])("",!0),e.field4?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Bi,[Object(i["createVNode"])(c,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":[function(t){return e.onEntryChange(n,e.field4.key,t)},function(n){return t[e.field4.key]=n}],modelValue:t[e.field4.key],placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title},null,8,["options","onUpdate:modelValue","modelValue","uicontrol","title"])])):Object(i["createCommentVNode"])("",!0),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,xi),[[i["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function Li(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}},isEmptyValue:function(e){var t=this.fieldCount;if(4===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key]&&!e[this.field4.key])return!1}else if(3===t){if(!e[this.field1.key]&&!e[this.field2.key]&&!e[this.field3.key])return!1}else if(2===t){if(!e[this.field1.key]&&!e[this.field2.key])return!1}else if(1===t&&!e[this.field1.key])return!1;return!0},makeEmptyValue:function(){var e={};return this.field1&&this.field1.key&&(e[this.field1.key]=""),this.field2&&this.field2.key&&(e[this.field2.key]=""),this.field3&&this.field3.key&&(e[this.field3.key]=""),this.field4&&this.field4.key&&(e[this.field4.key]=""),e}}});Gi.render=Mi;var zi=Gi,Yi=(pn({component:zi,require:"?ngModel",scope:{name:{angularJsBind:"="},field1:{angularJsBind:"="},field2:{angularJsBind:"="},field3:{angularJsBind:"="},field4:{angularJsBind:"="}},directiveName:"matomoMultiPairField",events:{"update:modelValue":function(e,t,n,r,o,i){e!==t.modelValue&&(r.trigger("change",e),i&&i.$setViewValue(e))}},postCreate:function(e,t,n,r,o){var i=o;i&&(i.$setViewValue(e.modelValue),i.$render=function(){angular.isString(i.$viewValue)?e.modelValue=JSON.parse(i.$viewValue):e.modelValue=i.$viewValue})}}),{ref:"root",class:"periodSelector piwikSelector"}),Qi=["title"],Ki=Object(i["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),Xi={id:"periodMore",class:"dropdown"},Zi={class:"flex"},ea={key:0,class:"period-date"},ta={class:"period-type"},na={id:"otherPeriods"},ra=["onDblclick","title"],oa=["id","checked","onChange","onDblclick"],ia={key:0,class:"compare-checkbox"},aa={id:"comparePeriodToDropdown"},ca={key:1,class:"compare-date-range"},la={id:"comparePeriodStartDate"},sa=Object(i["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ua={id:"comparePeriodEndDate"},da={class:"apply-button-container"},pa=["disabled","value"],fa={key:2,id:"ajaxLoadingCalendar"},ma={class:"loadingSegment"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function ca(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("DateRangePicker"),l=Object(i["resolveComponent"])("PeriodDatePicker"),s=Object(i["resolveComponent"])("Field"),u=Object(i["resolveComponent"])("ActivityIndicator"),d=Object(i["resolveDirective"])("expand-on-click");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",$i,[Object(i["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Ui,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.currentlyViewingText),1)],8,Hi),Object(i["createElementVNode"])("div",Wi,[Object(i["createElementVNode"])("div",qi,[Object(i["createElementVNode"])("div",null,[Object(i["withDirectives"])(Object(i["createVNode"])(c,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[0]||(t[0]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[1]||(t[1]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[i["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ji,[Object(i["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[2]||(t[2]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(i["createCommentVNode"])("",!0)]),Object(i["createElementVNode"])("div",Gi,[Object(i["createElementVNode"])("h6",null,Object(i["toDisplayString"])(e.translate("General_Period")),1),Object(i["createElementVNode"])("div",zi,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.periodsFiltered,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("p",{key:n},[Object(i["createElementVNode"])("label",{class:Object(i["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.selectedPeriod=t}),checked:e.selectedPeriod===n,onChange:function(t){return e.selectedPeriod=n},onDblclick:function(t){return e.changeViewedPeriod(n)}},null,40,Qi),[[i["vModelRadio"],e.selectedPeriod]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,Yi)])})),128))])])]),e.isComparisonEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ki,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.isComparing=t})},null,512),[[i["vModelCheckbox"],e.isComparing]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(i["createElementVNode"])("div",Xi,[Object(i["createVNode"])(s,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.comparePeriodType=t}),style:Object(i["normalizeStyle"])({visibility:e.isComparing?"visible":"hidden"}),name:"comparePeriodToDropdown",uicontrol:"select",options:e.comparePeriodDropdownOptions,"full-width":!0,disabled:!e.isComparing},null,8,["modelValue","style","options","disabled"])])])):Object(i["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Zi,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",ea,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(s,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.compareStartDate=t}),name:"comparePeriodStartDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_StartDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])]),ta,Object(i["createElementVNode"])("div",na,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(s,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.compareEndDate=t}),name:"comparePeriodEndDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_EndDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])])])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",ra,[Object(i["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[8]||(t[8]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,oa)]),e.isLoadingNewPage?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ia,[Object(i["createVNode"])(u,{loading:!0}),Object(i["createElementVNode"])("div",aa,Object(i["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(i["createCommentVNode"])("",!0)])],512)),[[d,{expander:"title"}]])}var la={class:"loadingPiwik"},sa=Object(i["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function ua(e,t,n,r,o,a){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",la,[sa,Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.loadingMessage),1)],512)),[[i["vShow"],e.loading]])}var da=Object(i["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});da.render=ua;var pa=da;function fa(e,t){return va(e)||ba(e,t)||ha(e,t)||ma()}function ma(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ha(e,t){if(e){if("string"===typeof e)return ga(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ga(e,t):void 0}}function ga(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr?(window.$("#alert").find("h2").text(C("General_InvalidDateRange")),S.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return P(this.dateValue)}},methods:{handleZIndexPositionRelativeCompareDropdownIssue:function(){var e=window.$(this.$refs.root);e.on("focus","#comparePeriodToDropdown .select-dropdown",(function(){e.addClass("compare-dropdown-open")})).on("blur","#comparePeriodToDropdown .select-dropdown",(function(){e.removeClass("compare-dropdown-open")}))},changeViewedPeriod:function(){this.period!==this.periodValue&&"range"!==this.period&&this.setPiwikPeriodAndDate(this.period,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=P(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;S.helper.isAngularRenderingThePage()?(this.closePeriodSelector(),n=De.hashParsed.value):(this.isLoadingNewPage=!0,n=De.parsed.value);var o=Oa({},n);delete o.comparePeriods,delete o.compareDates,De.updateLocation(Oa(Oa({},o),{},{date:e,period:t},r))},onApplyClicked:function(){if("range"===this.selectedPeriod){var e=this.selectedDateString;if(!e)return;return this.periodValue="range",void this.propagateNewUrlParams(e,"range")}this.setPiwikPeriodAndDate(this.selectedPeriod,this.dateValue)},updateSelectedValuesFromHash:function(){var e=De.parsed.value,t=e.date,n=e.period;this.periodValue=n,this.selectedPeriod=n,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{p.parse(n,t)}catch(l){return}if("range"===n){var r=p.get(n).parse(t),o=r.getDateRange(),i=fa(o,2),a=i[0],c=i[1];this.dateValue=a,this.startRangeDate=P(a),this.endRangeDate=P(c)}else this.dateValue=E(t),this.setRangeStartEndFromPeriod(n,t)},setRangeStartEndFromPeriod:function(e,t){var n=p.parse(e,t).getDateRange();this.startRangeDate=P(n[0]Pa?Pa:n[1])},getPeriodDisplayText:function(e){return p.get(e).getDisplayText()},onRangeChange:function(e,t){e&&t?(this.isRangeValid=!0,this.startRangeDate=e,this.endRangeDate=t):this.isRangeValid=!1},isApplyEnabled:function(){return!("range"===this.selectedPeriod&&!this.isRangeValid)&&!(this.isComparing&&"custom"===this.comparePeriodType&&!this.isCompareRangeValid())},closePeriodSelector:function(){this.$refs.root.classList.remove("expanded")},isCompareRangeValid:function(){try{E(this.compareStartDate)}catch(e){return!1}try{E(this.compareEndDate)}catch(e){return!1}return!0}}});Ea.render=ca;var Va=Ea,Na=(rn({component:Va,scope:{periods:{angularJsBind:"<"}},directiveName:"piwikPeriodSelector"}),{class:"reportingMenu"}),Ta=["aria-label"],Aa=["onClick"],Ia={class:"hidden"},Ba={role:"menu"},xa=["href","onClick","title"],Ma=["href","onClick"],La=["onClick"],Fa=Object(i["createElementVNode"])("span",{class:"icon-help"},null,-1),Ra=[Fa],_a={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},$a={class:"collapsible collapsible-accordion"},Ha={class:"collapsible-header"},Ua={class:"collapsible-body"},Wa={key:0},qa=["onClick","href"],Ja={key:1},Ga=["onClick","href"]; + */function ha(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("DateRangePicker"),l=Object(i["resolveComponent"])("PeriodDatePicker"),s=Object(i["resolveComponent"])("Field"),u=Object(i["resolveComponent"])("ActivityIndicator"),d=Object(i["resolveDirective"])("expand-on-click");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Yi,[Object(i["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Ki,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.currentlyViewingText),1)],8,Qi),Object(i["createElementVNode"])("div",Xi,[Object(i["createElementVNode"])("div",Zi,[Object(i["createElementVNode"])("div",null,[Object(i["withDirectives"])(Object(i["createVNode"])(c,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[0]||(t[0]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[1]||(t[1]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[i["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ea,[Object(i["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[2]||(t[2]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(i["createCommentVNode"])("",!0)]),Object(i["createElementVNode"])("div",ta,[Object(i["createElementVNode"])("h6",null,Object(i["toDisplayString"])(e.translate("General_Period")),1),Object(i["createElementVNode"])("div",na,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.periodsFiltered,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("p",{key:n},[Object(i["createElementVNode"])("label",{class:Object(i["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.selectedPeriod=t}),checked:e.selectedPeriod===n,onChange:function(t){return e.selectedPeriod=n},onDblclick:function(t){return e.changeViewedPeriod(n)}},null,40,oa),[[i["vModelRadio"],e.selectedPeriod]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,ra)])})),128))])])]),e.isComparisonEnabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ia,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=function(t){return e.isComparing=t})},null,512),[[i["vModelCheckbox"],e.isComparing]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(i["createElementVNode"])("div",aa,[Object(i["createVNode"])(s,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.comparePeriodType=t}),style:Object(i["normalizeStyle"])({visibility:e.isComparing?"visible":"hidden"}),name:"comparePeriodToDropdown",uicontrol:"select",options:e.comparePeriodDropdownOptions,"full-width":!0,disabled:!e.isComparing},null,8,["modelValue","style","options","disabled"])])])):Object(i["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ca,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",la,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(s,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.compareStartDate=t}),name:"comparePeriodStartDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_StartDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])]),sa,Object(i["createElementVNode"])("div",ua,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(s,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.compareEndDate=t}),name:"comparePeriodEndDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_EndDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])])])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",da,[Object(i["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[8]||(t[8]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,pa)]),e.isLoadingNewPage?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",fa,[Object(i["createVNode"])(u,{loading:!0}),Object(i["createElementVNode"])("div",ma,Object(i["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(i["createCommentVNode"])("",!0)])],512)),[[d,{expander:"title"}]])}var ga={class:"loadingPiwik"},va=Object(i["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function ba(e,t,n,r,o,a){return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ga,[va,Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.loadingMessage),1)],512)),[[i["vShow"],e.loading]])}var ya=Object(i["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});ya.render=ba;var Oa=ya;function wa(e,t){return Pa(e)||Ca(e,t)||ka(e,t)||ja()}function ja(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ka(e,t){if(e){if("string"===typeof e)return Sa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sa(e,t):void 0}}function Sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr?(window.$("#alert").find("h2").text(C("General_InvalidDateRange")),S.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return P(this.dateValue)}},methods:{handleZIndexPositionRelativeCompareDropdownIssue:function(){var e=window.$(this.$refs.root);e.on("focus","#comparePeriodToDropdown .select-dropdown",(function(){e.addClass("compare-dropdown-open")})).on("blur","#comparePeriodToDropdown .select-dropdown",(function(){e.removeClass("compare-dropdown-open")}))},changeViewedPeriod:function(){this.period!==this.periodValue&&"range"!==this.period&&this.setPiwikPeriodAndDate(this.period,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=P(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;S.helper.isAngularRenderingThePage()?(this.closePeriodSelector(),n=De.hashParsed.value):(this.isLoadingNewPage=!0,n=De.parsed.value);var o=Ea({},n);delete o.comparePeriods,delete o.compareDates,De.updateLocation(Ea(Ea({},o),{},{date:e,period:t},r))},onApplyClicked:function(){if("range"===this.selectedPeriod){var e=this.selectedDateString;if(!e)return;return this.periodValue="range",void this.propagateNewUrlParams(e,"range")}this.setPiwikPeriodAndDate(this.selectedPeriod,this.dateValue)},updateSelectedValuesFromHash:function(){var e=De.parsed.value,t=e.date,n=e.period;this.periodValue=n,this.selectedPeriod=n,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{p.parse(n,t)}catch(l){return}if("range"===n){var r=p.get(n).parse(t),o=r.getDateRange(),i=wa(o,2),a=i[0],c=i[1];this.dateValue=a,this.startRangeDate=P(a),this.endRangeDate=P(c)}else this.dateValue=E(t),this.setRangeStartEndFromPeriod(n,t)},setRangeStartEndFromPeriod:function(e,t){var n=p.parse(e,t).getDateRange();this.startRangeDate=P(n[0]Ba?Ba:n[1])},getPeriodDisplayText:function(e){return p.get(e).getDisplayText()},onRangeChange:function(e,t){e&&t?(this.isRangeValid=!0,this.startRangeDate=e,this.endRangeDate=t):this.isRangeValid=!1},isApplyEnabled:function(){return!("range"===this.selectedPeriod&&!this.isRangeValid)&&!(this.isComparing&&"custom"===this.comparePeriodType&&!this.isCompareRangeValid())},closePeriodSelector:function(){this.$refs.root.classList.remove("expanded")},isCompareRangeValid:function(){try{E(this.compareStartDate)}catch(e){return!1}try{E(this.compareEndDate)}catch(e){return!1}return!0}}});Ma.render=ha;var La=Ma,Fa=(pn({component:La,scope:{periods:{angularJsBind:"<"}},directiveName:"piwikPeriodSelector"}),{class:"reportingMenu"}),Ra=["aria-label"],_a=["onClick"],$a={class:"hidden"},Ha={role:"menu"},Ua=["href","onClick","title"],Wa=["href","onClick"],qa=["onClick"],Ja=Object(i["createElementVNode"])("span",{class:"icon-help"},null,-1),Ga=[Ja],za={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},Ya={class:"collapsible collapsible-accordion"},Qa={class:"collapsible-header"},Ka={class:"collapsible-body"},Xa={key:0},Za=["onClick","href"],ec={key:1},tc=["onClick","href"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function za(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("MenuDropdown"),l=Object(i["resolveDirective"])("side-nav");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Na,[Object(i["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.menu,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:Object(i["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id},[Object(i["createElementVNode"])("a",{class:"item",tabindex:"5",href:"",onClick:Object(i["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(i["createElementVNode"])("span",{class:Object(i["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:"icon-arrow-right"))},null,2),Object(i["createTextVNode"])(Object(i["toDisplayString"])(t.name)+" ",1),Object(i["createElementVNode"])("span",Ia,Object(i["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,Aa),Object(i["createElementVNode"])("ul",Ba,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.subcategories,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{role:"menuitem",class:Object(i["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(i["withCtx"])((function(){return[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(n.subcategories,(function(r){return Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{class:Object(i["normalizeClass"])(["item",{active:r.id===e.activeSubsubcategory&&n.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,r)),onClick:function(n){return e.loadSubcategory(t,r,n)},title:r.tooltip,key:r.id},Object(i["toDisplayString"])(r.name),11,xa)})),128))]})),_:2},1032,["menu-title"])):Object(i["createCommentVNode"])("",!0),n.isGroup?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(i["toDisplayString"])(n.name),9,Ma)),n.help?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:2,class:Object(i["normalizeClass"])(["item-help-icon",{active:e.helpShownCategory&&e.helpShownCategory.subcategory===n.id&&e.helpShownCategory.category===t.id&&n.help}]),tabindex:"5",href:"javascript:",onClick:function(r){return e.showHelp(t,n,r)}},Ra,10,La)):Object(i["createCommentVNode"])("",!0)],2)})),128))])],2)})),128))],8,Ta),Object(i["createElementVNode"])("ul",_a,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.menu,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:"no-padding",key:t.id},[Object(i["withDirectives"])(Object(i["createElementVNode"])("ul",$a,[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("a",Ha,[Object(i["createElementVNode"])("i",{class:Object(i["normalizeClass"])(t.icon?t.icon:"icon-arrow-bottom")},null,2),Object(i["createTextVNode"])(Object(i["toDisplayString"])(t.name),1)]),Object(i["createElementVNode"])("div",Ua,[Object(i["createElementVNode"])("ul",null,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.subcategories,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Wa,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(n.subcategories,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(i["toDisplayString"])(n.name),9,qa)})),128))])):Object(i["createCommentVNode"])("",!0),n.isGroup?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Ja,[Object(i["createElementVNode"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(i["toDisplayString"])(n.name),9,Ga)]))])})),128))])])])],512),[[l,{activator:e.sideNavActivator}]])])})),128))])])}var Ya={key:0},Qa=["data-notification-instance-id"],Ka={key:1},Xa={class:"notification-body"},Za=["innerHTML"],ec={key:1};function tc(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createBlock"])(i["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(i["withCtx"])((function(){return[e.deleted?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ya,[Object(i["createVNode"])(i["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(i["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",{class:Object(i["normalizeClass"])(["notification system",e.cssClasses]),style:Object(i["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(i["openBlock"])(),Object(i["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(i["createCommentVNode"])("",!0),e.title?(Object(i["openBlock"])(),Object(i["createElementBlock"])("strong",Ka,Object(i["toDisplayString"])(e.title),1)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",Xa,[e.message?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,Za)):Object(i["createCommentVNode"])("",!0),e.message?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ec,[Object(i["renderSlot"])(e.$slots,"default")]))])],14,Qa)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var nc=window,rc=nc.$,oc=Object(i["defineComponent"])({props:{notificationId:String,notificationInstanceId:String,title:String,context:String,type:String,noclear:Boolean,toastLength:{type:Number,default:12e3},style:[String,Object],animate:Boolean,message:String,cssClass:String},computed:{cssClasses:function(){var e={};return this.context&&(e["notification-".concat(this.context)]=!0),this.cssClass&&(e[this.cssClass]=!0),e},canClose:function(){return"persistent"===this.type||!this.noclear}},emits:["closed"],data:function(){return{deleted:!1}},mounted:function(){var e=this,t=function(){setTimeout((function(){e.deleted=!0}),e.toastLength)};"toast"===this.type&&t(),this.style&&rc(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(i["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(i["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Qe.fetch({module:"CoreHome",action:"markNotificationAsRead"},{postParams:{notificationId:this.notificationId}})}}});oc.render=tc;var ic=oc; + */function nc(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("MenuDropdown"),l=Object(i["resolveDirective"])("side-nav");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Fa,[Object(i["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.menu,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:Object(i["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id},[Object(i["createElementVNode"])("a",{class:"item",tabindex:"5",href:"",onClick:Object(i["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(i["createElementVNode"])("span",{class:Object(i["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:"icon-arrow-right"))},null,2),Object(i["createTextVNode"])(Object(i["toDisplayString"])(t.name)+" ",1),Object(i["createElementVNode"])("span",$a,Object(i["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,_a),Object(i["createElementVNode"])("ul",Ha,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.subcategories,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{role:"menuitem",class:Object(i["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(i["withCtx"])((function(){return[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(n.subcategories,(function(r){return Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{class:Object(i["normalizeClass"])(["item",{active:r.id===e.activeSubsubcategory&&n.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,r)),onClick:function(n){return e.loadSubcategory(t,r,n)},title:r.tooltip,key:r.id},Object(i["toDisplayString"])(r.name),11,Ua)})),128))]})),_:2},1032,["menu-title"])):Object(i["createCommentVNode"])("",!0),n.isGroup?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(i["toDisplayString"])(n.name),9,Wa)),n.help?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{key:2,class:Object(i["normalizeClass"])(["item-help-icon",{active:e.helpShownCategory&&e.helpShownCategory.subcategory===n.id&&e.helpShownCategory.category===t.id&&n.help}]),tabindex:"5",href:"javascript:",onClick:function(r){return e.showHelp(t,n,r)}},Ga,10,qa)):Object(i["createCommentVNode"])("",!0)],2)})),128))])],2)})),128))],8,Ra),Object(i["createElementVNode"])("ul",za,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.menu,(function(t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{class:"no-padding",key:t.id},[Object(i["withDirectives"])(Object(i["createElementVNode"])("ul",Ya,[Object(i["createElementVNode"])("li",null,[Object(i["createElementVNode"])("a",Qa,[Object(i["createElementVNode"])("i",{class:Object(i["normalizeClass"])(t.icon?t.icon:"icon-arrow-bottom")},null,2),Object(i["createTextVNode"])(Object(i["toDisplayString"])(t.name),1)]),Object(i["createElementVNode"])("div",Ka,[Object(i["createElementVNode"])("ul",null,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(t.subcategories,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Xa,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(n.subcategories,(function(n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(i["toDisplayString"])(n.name),9,Za)})),128))])):Object(i["createCommentVNode"])("",!0),n.isGroup?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",ec,[Object(i["createElementVNode"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(i["toDisplayString"])(n.name),9,tc)]))])})),128))])])])],512),[[l,{activator:e.sideNavActivator}]])])})),128))])])}var rc={key:0},oc=["data-notification-instance-id"],ic={key:1},ac={class:"notification-body"},cc=["innerHTML"],lc={key:1};function sc(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createBlock"])(i["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(i["withCtx"])((function(){return[e.deleted?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",rc,[Object(i["createVNode"])(i["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(i["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",{class:Object(i["normalizeClass"])(["notification system",e.cssClasses]),style:Object(i["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(i["openBlock"])(),Object(i["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(i["createCommentVNode"])("",!0),e.title?(Object(i["openBlock"])(),Object(i["createElementBlock"])("strong",ic,Object(i["toDisplayString"])(e.title),1)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",ac,[e.message?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,cc)):Object(i["createCommentVNode"])("",!0),e.message?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",lc,[Object(i["renderSlot"])(e.$slots,"default")]))])],14,oc)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var uc=window,dc=uc.$,pc=Object(i["defineComponent"])({props:{notificationId:String,notificationInstanceId:String,title:String,context:String,type:String,noclear:Boolean,toastLength:{type:Number,default:12e3},style:[String,Object],animate:Boolean,message:String,cssClass:String},computed:{cssClasses:function(){var e={};return this.context&&(e["notification-".concat(this.context)]=!0),this.cssClass&&(e[this.cssClass]=!0),e},canClose:function(){return"persistent"===this.type||!this.noclear}},emits:["closed"],data:function(){return{deleted:!1}},mounted:function(){var e=this,t=function(){setTimeout((function(){e.deleted=!0}),e.toastLength)};"toast"===this.type&&t(),this.style&&dc(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(i["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(i["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Qe.fetch({module:"CoreHome",action:"markNotificationAsRead"},{postParams:{notificationId:this.notificationId}})}}});pc.render=sc;var fc=pc; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:ic,scope:{notificationId:{angularJsBind:"@?"},title:{angularJsBind:"@?notificationTitle"},context:{angularJsBind:"@?"},type:{angularJsBind:"@?"},noclear:{angularJsBind:"@?",transform:on},toastLength:{angularJsBind:"@?"}},directiveName:"piwikNotification",transclude:!0});function ac(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function cc(e){for(var t=1;t'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var i=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,i);var a=(this.nextNotificationId+=1).toString();return t.call(this,cc(cc({},e),{},{noclear:!!e.noclear,group:i,notificationId:e.id,notificationInstanceId:a,type:e.type||"transient"})),a}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&S.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=$(e.placeat);if(!t.length)throw new Error("A valid selector is required for the placeat option when using Notification.toast().");var n=document.createElement("div");n.style.position="absolute",n.style.top="".concat(t.offset().top,"px"),n.style.left="".concat(t.offset().left,"px"),n.style.zIndex="1000",document.body.appendChild(n);var r=qt({render:function(){return Object(i["createVNode"])(ic,cc(cc({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){var n=window.$(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=qt({template:'',data:function(){return{group:t}}});o.component("NotificationGroup",r),o.mount(n[0])}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),fc=new pc,mc=fc;$((function(){return fc.parseNotificationDivs()})), + */var Oc=function(){function e(){gc(this,e),yc(this,"privateState",Object(i["reactive"])({notifications:[]})),yc(this,"nextNotificationId",0)}return bc(e,[{key:"state",get:function(){return Object(i["readonly"])(this.privateState)}},{key:"appendNotification",value:function(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.push(e)}},{key:"prependNotification",value:function(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.unshift(e)}},{key:"remove",value:function(e){this.privateState.notifications=this.privateState.notifications.filter((function(t){return t.id!==e}))}},{key:"parseNotificationDivs",value:function(){var e=this,t=$('[data-role="notification"]'),n=[];t.each((function(e,r){var o=$(r),i=o.data(),a=o.html();a&&n.push(hc(hc({},i),{},{message:a,animate:!1})),t.remove()})),n.forEach((function(t){return e.show(t)}))}},{key:"clearTransientNotifications",value:function(){this.privateState.notifications=this.privateState.notifications.filter((function(e){return"transient"!==e.type}))}},{key:"show",value:function(e){this.checkMessage(e.message);var t=e.prepend?this.prependNotification:this.appendNotification,n="#notificationContainer";if(e.placeat)n=e.placeat;else{var r=".modal.open .modal-content",o=document.querySelector(r);o&&(o.querySelector("#modalNotificationContainer")||window.$(o).prepend('
'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var i=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,i);var a=(this.nextNotificationId+=1).toString();return t.call(this,hc(hc({},e),{},{noclear:!!e.noclear,group:i,notificationId:e.id,notificationInstanceId:a,type:e.type||"transient"})),a}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&S.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=$(e.placeat);if(!t.length)throw new Error("A valid selector is required for the placeat option when using Notification.toast().");var n=document.createElement("div");n.style.position="absolute",n.style.top="".concat(t.offset().top,"px"),n.style.left="".concat(t.offset().left,"px"),n.style.zIndex="1000",document.body.appendChild(n);var r=Zt({render:function(){return Object(i["createVNode"])(fc,hc(hc({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){var n=window.$(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=Zt({template:'',data:function(){return{group:t}}});o.component("NotificationGroup",r),o.mount(n[0])}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),wc=new Oc,jc=wc;$((function(){return wc.parseNotificationDivs()})), /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -angular.module("piwikApp").factory("notifications",(function(){return mc}));var hc={class:"notification-group"},gc=["innerHTML"];function bc(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Notification");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",hc,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.notifications,(function(t,n){return Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:t.id||"no-id-".concat(n),"notification-id":t.id,title:t.title,context:t.context,type:t.type,noclear:t.noclear,"toast-length":t.toastLength,style:Object(i["normalizeStyle"])(t.style),animate:t.animate,message:t.message,"notification-instance-id":t.notificationInstanceId,"css-class":t.class,onClosed:function(n){return e.removeNotification(t.id)}},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,gc)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}var vc=Object(i["defineComponent"])({props:{group:String},components:{Notification:ic},computed:{notifications:function(){var e=this;return mc.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){mc.remove(e)}}});vc.render=bc;var yc=vc; +angular.module("piwikApp").factory("notifications",(function(){return jc}));var kc={class:"notification-group"},Sc=["innerHTML"];function Cc(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Notification");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",kc,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.notifications,(function(t,n){return Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:t.id||"no-id-".concat(n),"notification-id":t.id,title:t.title,context:t.context,type:t.type,noclear:t.noclear,"toast-length":t.toastLength,style:Object(i["normalizeStyle"])(t.style),animate:t.animate,message:t.message,"notification-instance-id":t.notificationInstanceId,"css-class":t.class,onClosed:function(n){return e.removeNotification(t.id)}},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,Sc)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}var Pc=Object(i["defineComponent"])({props:{group:String},components:{Notification:fc},computed:{notifications:function(){var e=this;return jc.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){jc.remove(e)}}});Pc.render=Cc;var Dc=Pc; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wc(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.order?1:0})),t}function Ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bc(e){for(var t=1;tt.order?1:0})),t}function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hc(e){for(var t=1;t".concat(a,"
");mc.show({context:"info",id:Xc,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Zc.render=za;var el=Zc; + */var tl=function(){function e(){var t=this;Kc(this,e),el(this,"privateState",Object(i["reactive"])({isFetchedFirstTime:!1,categorizedWidgets:{}})),el(this,"state",Object(i["computed"])((function(){return t.privateState.isFetchedFirstTime||t.fetchAvailableWidgets(),Object(i["readonly"])(t.privateState)}))),el(this,"widgets",Object(i["computed"])((function(){return t.state.value.categorizedWidgets})))}return Zc(e,[{key:"fetchAvailableWidgets",value:function(){var e=this;return De.parsed.value.idSite?(this.privateState.isFetchedFirstTime=!0,new Promise((function(t,n){try{window.widgetsHelper.getAvailableWidgets((function(n){e.privateState.categorizedWidgets=n,t(e.widgets.value)}))}catch(r){n(r)}}))):Promise.resolve(this.widgets.value)}},{key:"reloadAvailableWidgets",value:function(){return"object"===Qc(window.widgetsHelper)&&window.widgetsHelper.availableWidgets&&delete window.widgetsHelper.availableWidgets,this.fetchAvailableWidgets()}}]),e}(),nl=new tl;function rl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ol(e){for(var t=1;t".concat(a,"
");jc.show({context:"info",id:al,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});cl.render=nc;var ll=cl; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:el,directiveName:"piwikReportingMenu"}); + */pn({component:ll,directiveName:"piwikReportingMenu"}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function tl(e){return e.forEach((function(e){e.id===$c.activeCategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===$c.activeSubcategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===$c.activeSubsubcategory.value&&(e.active=!0)})))})))})),e}function nl(){return{get menu(){return $c.menu.value},findSubcategory:$c.findSubcategory.bind($c),reloadMenuItems:function(){return $c.reloadMenuItems().then((function(e){return tl(ln(e))}))},fetchMenuItems:function(){return $c.fetchMenuItems().then((function(e){return tl(ln(e))}))}}} +function sl(e){return e.forEach((function(e){e.id===Yc.activeCategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===Yc.activeSubcategory.value&&(e.active=!0,(e.subcategories||[]).forEach((function(e){e.id===Yc.activeSubsubcategory.value&&(e.active=!0)})))})))})),e}function ul(){return{get menu(){return Yc.menu.value},findSubcategory:Yc.findSubcategory.bind(Yc),reloadMenuItems:function(){return Yc.reloadMenuItems().then((function(e){return sl(gn(e))}))},fetchMenuItems:function(){return Yc.fetchMenuItems().then((function(e){return sl(gn(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 rl(){return{get pages(){return Cc.pages.value},findPageInCategory:function(){return cn(Cc.findPageInCategory.apply(Cc,arguments))},findPage:function(){return cn(Cc.findPage.apply(Cc,arguments))},reloadAllPages:function(){return Cc.reloadAllPages().then((function(e){return ln(e)}))},getAllPages:function(){return Cc.getAllPages().then((function(e){return ln(e)}))}}}function ol(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function il(e,t){for(var n=0;n .card-content .card-title");a.length||(a=i.find("> h2")),a.length&&a.html(S.helper.htmlEntities(n.widgetName))}var c=S.helper.getAngularDependency("$rootScope"),l=c.$new();n.currentScope=l,S.helper.compileAngularComponents(i,{scope:l}),mc.parseNotificationDivs(),setTimeout((function(){S.postEvent("widget:loaded",{parameters:e,element:i})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(n.loadingFailed=!0))}))}}});vl.render=ml;var yl=vl; +angular.module("piwikApp.service").factory("reportMetadataModel",(function(){return{get reports(){return vl.reports.value},findReport:vl.findReport.bind(vl),fetchReportMetadata:function(){return vl.fetchReportMetadata().then((function(e){return gn(e)}))}}}));var bl={key:0},yl={class:"notification system notification-error"},Ol={key:0,rel:"noreferrer noopener",target:"_blank",href:"https://matomo.org/faq/troubleshooting/faq_19489/"},wl={class:"theWidgetContent",ref:"widgetContent"};function jl(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("ActivityIndicator");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.loading},null,8,["loading-message","loading"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[e.widgetName?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",bl,Object(i["toDisplayString"])(e.widgetName),1)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",yl,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),e.hasErrorFaqLink?(Object(i["openBlock"])(),Object(i["createElementBlock"])("a",Ol,Object(i["toDisplayString"])(e.translate("General_ErrorRequestFaqLink")),1)):Object(i["createCommentVNode"])("",!0)])],512),[[i["vShow"],e.loadingFailed]]),Object(i["createElementVNode"])("div",wl,null,512)])}function kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Sl(e){for(var t=1;t .card-content .card-title");a.length||(a=i.find("> h2")),a.length&&a.html(S.helper.htmlEntities(n.widgetName))}var c=S.helper.getAngularDependency("$rootScope"),l=c.$new();n.currentScope=l,S.helper.compileAngularComponents(i,{scope:l}),jc.parseNotificationDivs(),setTimeout((function(){S.postEvent("widget:loaded",{parameters:e,element:i})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(n.loadingFailed=!0))}))}}});Pl.render=jl;var Dl=Pl; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */rn({component:yl,scope:{piwikWidgetLoader:{vue:"widgetParams",angularJsBind:"="},widgetName:{angularJsBind:"@"}},directiveName:"piwikWidgetLoader"});function Ol(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Widget");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.actualContainer,(function(e,t){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:t},[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function wl(e){return Sl(e)||kl(e)||Nl(e)||jl()}function jl(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kl(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Sl(e){if(Array.isArray(e))return Tl(e)}function Cl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;t&&t.middlewareParameters?Qe.fetch(t.middlewareParameters).then((function(t){e.showWidget=!!t})):this.showWidget=!0},computed:{allWidgets:function(){return zc.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=cs({},t);if(t&&t.isReport&&!t.documentation){var r=sl.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=ss(this.allWidgets,this.containerid);if(o){var i=cs({},o);return this.widgetized&&(i.isFirstInPage=!0,i.parameters=cs(cs({},i.parameters),{},{widget:"1"}),i.widgets&&(i.widgets=i.widgets.map((function(t){return cs(cs({},t),{},{parameters:cs(cs({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))),i}}return null}}});us.render=is;var ds=us,ps=(rn({component:ds,scope:{widget:{angularJsBind:"=?piwikWidget"},widgetized:{angularJsBind:"=?"},containerid:{angularJsBind:"@"}},directiveName:"piwikWidget"}),{class:"reporting-page"}),fs={key:1,class:"col s12 l6 leftWidgetColumn"},ms={key:2,class:"col s12 l6 rightWidgetColumn"}; + */function fs(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("WidgetLoader"),l=Object(i["resolveComponent"])("WidgetContainer"),s=Object(i["resolveComponent"])("WidgetByDimensionContainer"),u=Object(i["resolveDirective"])("tooltips");return e.actualWidget?Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:0,class:Object(i["normalizeClass"])(["matomo-widget",{isFirstWidgetInPage:e.actualWidget.isFirstInPage}]),id:e.actualWidget.uniqueId},[!e.actualWidget.isContainer&&e.actualWidget.parameters?(Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:0,"widget-params":e.actualWidget.parameters,"widget-name":e.actualWidget.name},null,8,["widget-params","widget-name"])):Object(i["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"!==e.actualWidget.layout&&!this.preventRecursion?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ds,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(l,{container:e.actualWidget.widgets},null,8,["container"])])])):Object(i["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"===e.actualWidget.layout?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ps,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(s,{widgets:e.actualWidget.widgets},null,8,["widgets"])])])):Object(i["createCommentVNode"])("",!0)],10,us)),[[i["vShow"],e.showWidget],[u,{content:e.tooltipContent}]]):Object(i["createCommentVNode"])("",!0)}function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function hs(e){for(var t=1;t"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;t&&t.middlewareParameters?Qe.fetch(t.middlewareParameters).then((function(t){e.showWidget=!!t})):this.showWidget=!0},computed:{allWidgets:function(){return nl.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=hs({},t);if(t&&t.isReport&&!t.documentation){var r=vl.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=vs(this.allWidgets,this.containerid);if(o){var i=hs({},o);return this.widgetized&&(i.isFirstInPage=!0,i.parameters=hs(hs({},i.parameters),{},{widget:"1"}),i.widgets&&(i.widgets=i.widgets.map((function(t){return hs(hs({},t),{},{parameters:hs(hs({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))),i}}return null}}});bs.render=fs;var ys=bs,Os=(pn({component:ys,scope:{widget:{angularJsBind:"=?piwikWidget"},widgetized:{angularJsBind:"=?"},containerid:{angularJsBind:"@"}},directiveName:"piwikWidget"}),{class:"reporting-page"}),ws={key:1,class:"col s12 l6 leftWidgetColumn"},js={key:2,class:"col s12 l6 rightWidgetColumn"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function hs(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("ActivityIndicator"),l=Object(i["resolveComponent"])("Widget");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ps,[Object(i["createVNode"])(c,{loading:e.loading},null,8,["loading"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[i["vShow"],e.hasNoPage]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.widgets,(function(e){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createBlock"])(l,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",fs,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.left,(function(e){return Object(i["openBlock"])(),Object(i["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(i["createCommentVNode"])("",!0),e.group?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ms,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.right,(function(e){return Object(i["openBlock"])(),Object(i["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(i["createCommentVNode"])("",!0)])})),128))])}function gs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bs(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'),""),type:"transient"})}function Fs(){mc.remove("onlyRawData")}var Rs=Object(i["defineComponent"])({components:{ActivityIndicator:pa,Widget:ds},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;Ts.resetPage(),this.loading=!0,this.renderInitialPage(),Object(i["watch"])((function(){return De.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(Fs(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),S.on("loadPage",(function(t,n){e.renderPage(t,n)}))},computed:{widgets:function(){return Ts.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return Ts.resetPage(),void(this.loading=!1);var r=De.parsed.value,o=r.period,i=r.date;try{p.parse(o,i)}catch(l){return mc.show({id:"invalidDate",animate:!1,context:"error",message:C("CoreHome_DateInvalid"),type:"transient"}),Ts.resetPage(),void(this.loading=!1)}if(mc.remove("invalidDate"),S.postEvent("piwikPageChange",{}),mc.clearTransientNotifications(),p.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired(),"Dashboard_Dashboard"===e&&Ms.isNumeric(t)&&Ms("[piwik-dashboard]").length){this.loading=!0;var a=Ms("[piwik-dashboard]"),c=angular.element(a).scope();c.fetchDashboard(parseInt(t,10)).then((function(){n.loading=!1}),(function(){n.loading=!1}))}else Ts.fetchPage(e,t).then((function(){var t=!Ts.page.value;if(t){var r=Cc.findPageInCategory(e);if(r&&r.subcategory)return void De.updateHash(Is(Is({},De.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=De.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&Ls();var t=De.parsed.value,n=t.segment;if(n)Fs();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],o=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1===r.indexOf(t.subcategory)&&-1===o.indexOf(t.category)&&-1===t.subcategory.toLowerCase().indexOf("manage")){var i=6e4;this.dateLastChecked&&(new Date).getTime()-this.dateLastChecked0?(e.hasNoVisits=!1,void Fs()):(e.hasNoVisits=!0,e.hasRawData?void Ls():Qe.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}))})).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void Fs();e.hasRawData=!0,Ls()}))}else Fs()}}}});Rs.render=hs;var _s=Rs,$s=(rn({component:_s,directiveName:"piwikReportingPage"}),{class:"report-export-popover row",id:"reportExport"}),Hs={class:"col l6"},Us={name:"format"},Ws={name:"option_flat"},qs={name:"option_expanded"},Js={name:"option_format_metrics"},Gs={class:"col l6"},zs={name:"filter_type"},Ys={class:"filter_limit"},Qs={name:"filter_limit_all"},Ks={key:0,name:"filter_limit"},Xs={key:1,name:"filter_limit"},Zs={class:"col l12"},eu=["value"],tu=Object(i["createTextVNode"])("\n "),nu=[tu],ru=["innerHTML"],ou={class:"col l12"},iu=["href","title"]; + */function Ms(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function Ls(e){if(e&&e[0]){var t=Ns(e);return e[0].group?t[0]=Es(Es({},t[0]),{},{left:Ls(e[0].left),right:Ls(e[0].right)}):t[0]=Es(Es({},t[0]),{},{isFirstInPage:!0}),t}return e}var Fs=function(){function e(){var t=this;Ss(this,e),Vs(this,"privateState",Object(i["reactive"])({page:null})),Vs(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),Vs(this,"page",Object(i["computed"])((function(){return t.state.value.page}))),Vs(this,"widgets",Object(i["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},o=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},i=function(e){if(!e.isReport)return[];var t=vl.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){o(e)||(i(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=_c(n),1===n.length)return Ls(n);for(var a=[],c=0;c'),""),type:"transient"})}function Js(){jc.remove("onlyRawData")}var Gs=Object(i["defineComponent"])({components:{ActivityIndicator:Oa,Widget:ys},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;Rs.resetPage(),this.loading=!0,this.renderInitialPage(),Object(i["watch"])((function(){return De.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(Js(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory))})),S.on("loadPage",(function(t,n){e.renderPage(t,n)}))},computed:{widgets:function(){return Rs.widgets.value}},methods:{renderPage:function(e,t){var n=this;if(!e||!t)return Rs.resetPage(),void(this.loading=!1);var r=De.parsed.value,o=r.period,i=r.date;try{p.parse(o,i)}catch(l){return jc.show({id:"invalidDate",animate:!1,context:"error",message:C("CoreHome_DateInvalid"),type:"transient"}),Rs.resetPage(),void(this.loading=!1)}if(jc.remove("invalidDate"),S.postEvent("piwikPageChange",{}),jc.clearTransientNotifications(),p.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired(),"Dashboard_Dashboard"===e&&Ws.isNumeric(t)&&Ws("[piwik-dashboard]").length){this.loading=!0;var a=Ws("[piwik-dashboard]"),c=angular.element(a).scope();c.fetchDashboard(parseInt(t,10)).then((function(){n.loading=!1}),(function(){n.loading=!1}))}else Rs.fetchPage(e,t).then((function(){var t=!Rs.page.value;if(t){var r=Ic.findPageInCategory(e);if(r&&r.subcategory)return void De.updateHash($s($s({},De.hashParsed.value),{},{subcategory:r.subcategory.id}))}n.hasNoPage=t,n.loading=!1}))},renderInitialPage:function(){var e=De.parsed.value;this.renderPage(e.category,e.subcategory)},showOnlyRawDataMessageIfRequired:function(){var e=this;this.hasRawData&&this.hasNoVisits&&qs();var t=De.parsed.value,n=t.segment;if(n)Js();else{var r=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],o=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1===r.indexOf(t.subcategory)&&-1===o.indexOf(t.category)&&-1===t.subcategory.toLowerCase().indexOf("manage")){var i=6e4;this.dateLastChecked&&(new Date).getTime()-this.dateLastChecked0?(e.hasNoVisits=!1,void Js()):(e.hasNoVisits=!0,e.hasRawData?void qs():Qe.fetch({method:"Live.getLastVisitsDetails",filter_limit:1,doNotFetchActions:1}))})).then((function(t){if(!t||0===t.length)return e.hasRawData=!1,void Js();e.hasRawData=!0,qs()}))}else Js()}}}});Gs.render=ks;var zs=Gs,Ys=(pn({component:zs,directiveName:"piwikReportingPage"}),{class:"report-export-popover row",id:"reportExport"}),Qs={class:"col l6"},Ks={name:"format"},Xs={name:"option_flat"},Zs={name:"option_expanded"},eu={name:"option_format_metrics"},tu={class:"col l6"},nu={name:"filter_type"},ru={class:"filter_limit"},ou={name:"filter_limit_all"},iu={key:0,name:"filter_limit"},au={key:1,name:"filter_limit"},cu={class:"col l12"},lu=["value"],su=Object(i["createTextVNode"])("\n "),uu=[su],du=["innerHTML"],pu={class:"col l12"},fu=["href","title"]; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function au(e,t,n,r,o,a){var c=Object(i["resolveComponent"])("Field"),l=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",$s,[Object(i["createElementVNode"])("div",Hs,[Object(i["createElementVNode"])("div",Us,[Object(i["createVNode"])(c,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",Ws,[Object(i["withDirectives"])(Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[i["vShow"],e.hasSubtables]])])]),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",qs,[Object(i["withDirectives"])(Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[i["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",Js,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(i["createElementVNode"])("div",Gs,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",zs,[Object(i["createVNode"])(c,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(i["createElementVNode"])("div",Ys,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Qs,[Object(i["createVNode"])(c,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[i["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ks,[Object(i["createVNode"])(c,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(i["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Xs,[Object(i["createVNode"])(c,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(i["createCommentVNode"])("",!0)])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Zs,[Object(i["withDirectives"])(Object(i["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},nu,8,eu),[[l,{}]]),Object(i["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,ru)],512),[[i["vShow"],e.showUrl]]),Object(i["createElementVNode"])("div",ou,[Object(i["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(i["toDisplayString"])(e.translate("General_Export")),9,iu),Object(i["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[i["vShow"],!e.showUrl]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[i["vShow"],e.showUrl]])])])])}function cu(e,t){return pu(e)||du(e,t)||su(e,t)||lu()}function lu(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function su(e,t){if(e){if("string"===typeof e)return uu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?uu(e,t):void 0}}function uu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&parseInt(e,10)>parseInt(this.maxFilterLimit,10)&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=C("CoreHome_RowLimit"),t=C("General_ComputedMetricMax",this.maxFilterLimit);return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.dataTable,n=this.reportFormat,r=this.apiMethod,o=this.reportType;if(n){var i=this.requestParams,a="yes"===this.reportLimitAll?-1:this.reportLimit;i=i&&"string"===typeof i?JSON.parse(i):{};var c=t.param,l=c.segment,s=c.label,u=c.idGoal,d=c.idDimension,p=c.idSite,f=t.param,m=f.date,h=f.period;"RSS"===n&&(m="last10"),"undefined"!==typeof t.param.dateUsedInGraph&&(m=t.param.dateUsedInGraph);var g=S.config.datatable_export_range_as_day.toLowerCase();-1!==g.indexOf(n.toLowerCase())&&"range"===t.param.period&&(h="day"),"range"===t.param.period&&"graphEvolution"===t.param.viewDataTable&&(h="day");var b={module:"API",format:n,idSite:p,period:h,date:m};if("processed"===o){b.method="API.getProcessedReport";var v=r.split("."),y=cu(v,2);b.apiModule=y[0],b.apiAction=y[1]}else b.method=r;if(t.param.compareDates&&t.param.compareDates.length&&(b.compareDates=t.param.compareDates,b.compare="1"),t.param.comparePeriods&&t.param.comparePeriods.length&&(b.comparePeriods=t.param.comparePeriods,b.compare="1"),t.param.compareSegments&&t.param.compareSegments.length&&(b.compareSegments=t.param.compareSegments,b.compare="1"),"undefined"!==typeof t.param.filter_pattern&&(b.filter_pattern=t.param.filter_pattern),"undefined"!==typeof t.param.filter_pattern_recursive&&(b.filter_pattern_recursive=t.param.filter_pattern_recursive),window.$.isPlainObject(i)&&Object.entries(i).forEach((function(e){var t=cu(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),b[n]=o})),this.optionFlat&&(b.flat=1,"undefined"!==typeof t.param.include_aggregate_rows&&"1"===t.param.include_aggregate_rows&&(b.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(b.expanded=1),this.optionFormatMetrics&&(b.format_metrics=1),t.param.pivotBy&&(b.pivotBy=t.param.pivotBy,b.pivotByColumnLimit=20,t.props.pivot_by_column&&(b.pivotByColumn=t.props.pivot_by_column)),"CSV"!==n&&"TSV"!==n&&"RSS"!==n||(b.translateColumnNames=1,b.language=S.language),"undefined"!==typeof l&&(b.segment=decodeURIComponent(l)),"undefined"!==typeof u&&"-1"!==u&&(b.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(b.idDimension=d),s){var O=s.split(",");if(O.length>1)b.label=O;else{var w=cu(O,1);b.label=w[0]}}b.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(b.token_auth=S.token_auth,b.force_api_session=1),b.filter_limit=a;var j=window.location.href.split("?")[0];return"".concat(j,"?").concat(De.stringify(b))}}}});mu.render=au;var hu=mu;function gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t0?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",au,[Object(i["createVNode"])(c,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(i["createCommentVNode"])("",!0)])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",cu,[Object(i["withDirectives"])(Object(i["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},uu,8,lu),[[l,{}]]),Object(i["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,du)],512),[[i["vShow"],e.showUrl]]),Object(i["createElementVNode"])("div",pu,[Object(i["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(i["toDisplayString"])(e.translate("General_Export")),9,fu),Object(i["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[i["vShow"],!e.showUrl]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[i["vShow"],e.showUrl]])])])])}function hu(e,t){return Ou(e)||yu(e,t)||vu(e,t)||gu()}function gu(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function vu(e,t){if(e){if("string"===typeof e)return bu(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bu(e,t):void 0}}function bu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&parseInt(e,10)>parseInt(this.maxFilterLimit,10)&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=C("CoreHome_RowLimit"),t=C("General_ComputedMetricMax",this.maxFilterLimit);return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.dataTable,n=this.reportFormat,r=this.apiMethod,o=this.reportType;if(n){var i=this.requestParams,a="yes"===this.reportLimitAll?-1:this.reportLimit;i=i&&"string"===typeof i?JSON.parse(i):{};var c=t.param,l=c.segment,s=c.label,u=c.idGoal,d=c.idDimension,p=c.idSite,f=t.param,m=f.date,h=f.period;"RSS"===n&&(m="last10"),"undefined"!==typeof t.param.dateUsedInGraph&&(m=t.param.dateUsedInGraph);var g=S.config.datatable_export_range_as_day.toLowerCase();-1!==g.indexOf(n.toLowerCase())&&"range"===t.param.period&&(h="day"),"range"===t.param.period&&"graphEvolution"===t.param.viewDataTable&&(h="day");var v={module:"API",format:n,idSite:p,period:h,date:m};if("processed"===o){v.method="API.getProcessedReport";var b=r.split("."),y=hu(b,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=r;if(t.param.compareDates&&t.param.compareDates.length&&(v.compareDates=t.param.compareDates,v.compare="1"),t.param.comparePeriods&&t.param.comparePeriods.length&&(v.comparePeriods=t.param.comparePeriods,v.compare="1"),t.param.compareSegments&&t.param.compareSegments.length&&(v.compareSegments=t.param.compareSegments,v.compare="1"),"undefined"!==typeof t.param.filter_pattern&&(v.filter_pattern=t.param.filter_pattern),"undefined"!==typeof t.param.filter_pattern_recursive&&(v.filter_pattern_recursive=t.param.filter_pattern_recursive),window.$.isPlainObject(i)&&Object.entries(i).forEach((function(e){var t=hu(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),v[n]=o})),this.optionFlat&&(v.flat=1,"undefined"!==typeof t.param.include_aggregate_rows&&"1"===t.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),t.param.pivotBy&&(v.pivotBy=t.param.pivotBy,v.pivotByColumnLimit=20,t.props.pivot_by_column&&(v.pivotByColumn=t.props.pivot_by_column)),"CSV"!==n&&"TSV"!==n&&"RSS"!==n||(v.translateColumnNames=1,v.language=S.language),"undefined"!==typeof l&&(v.segment=decodeURIComponent(l)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var O=s.split(",");if(O.length>1)v.label=O;else{var w=hu(O,1);v.label=w[0]}}v.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(v.token_auth=S.token_auth,v.force_api_session=1),v.filter_limit=a;var j=window.location.href.split("?")[0];return"".concat(j,"?").concat(De.stringify(v))}}}});ju.render=mu;var ku=ju;function Su(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t0&&(a=Math.min(a,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,l={initialReportType:"default",initialReportLimit:a>0?a:100,initialReportLimitAll:-1===a?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:C("CoreHome_StandardReport"),processed:C("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:C("General_All"),no:C("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},s=qt({template:'\n ',data:function(){return{bind:l}}});s.component("popover",hu);var u=document.createElement("div");s.mount(u);var d=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(C("General_Export")," ").concat(S.helper.htmlEntities(d))),window.Piwik_Popover.setContent(u),window.Piwik_Popover.onClose((function(){s.unmount(),""!==n&&setTimeout((function(){De.updateHash(bu(bu({},De.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),Ou(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}}; + */var Du=window,Eu=Du.$,Vu={mounted:function(e,t){e.addEventListener("click",(function(){var n=De.hashParsed.value.popover,r=Eu(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,a=r.param.filter_limit;t.value.maxFilterLimit>0&&(a=Math.min(a,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,l={initialReportType:"default",initialReportLimit:a>0?a:100,initialReportLimitAll:-1===a?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:C("CoreHome_StandardReport"),processed:C("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:C("General_All"),no:C("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},s=Zt({template:'\n ',data:function(){return{bind:l}}});s.component("popover",ku);var u=document.createElement("div");s.mount(u);var d=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(C("General_Export")," ").concat(S.helper.htmlEntities(d))),window.Piwik_Popover.setContent(u),window.Piwik_Popover.onClose((function(){s.unmount(),""!==n&&setTimeout((function(){De.updateHash(Cu(Cu({},De.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),Eu(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function ju(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};wu.mounted(n[0],r)}}}ju.$inject=["$timeout"],angular.module("piwikApp").directive("piwikReportExport",ju);var ku=["src"];function Su(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("img",{src:e.sparklineUrl},null,8,ku)}function Cu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pu(e){for(var t=1;t100?100:this.progress<0?0:this.progress}}});xu.render=Bu;var Mu=xu,Lu=(rn({component:Mu,scope:{progress:{angularJsBind:"="},label:{angularJsBind:"="}},directiveName:"piwikProgressbar"}),{mounted:function(e){e.classList.add("piwik-content-intro")}}); + */function Hu(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Fu,[Object(i["createElementVNode"])("div",Ru,[Object(i["createElementVNode"])("div",{class:"determinate",style:Object(i["normalizeStyle"])([{width:"0"},{width:"".concat(e.actualProgress,"%")}])},null,4)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,[_u,Object(i["createElementVNode"])("span",{class:"label",innerHTML:e.$sanitize(e.label)},null,8,$u)],512),[[i["vShow"],!!e.label]])])}var Uu=Object(i["defineComponent"])({props:{progress:Number,label:String},computed:{actualProgress:function(){return this.progress>100?100:this.progress<0?0:this.progress}}});Uu.render=Hu;var Wu=Uu,qu=(pn({component:Wu,scope:{progress:{angularJsBind:"="},label:{angularJsBind:"="}},directiveName:"piwikProgressbar"}),{mounted:function(e){e.classList.add("piwik-content-intro")}}); /*! * Matomo - free/libre analytics platform * @@ -477,37 +505,37 @@ function ju(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",repo * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Fu(){return{restrict:"A",link:function(e,t){Lu.mounted(t[0])}}}Fu.$inject=[],angular.module("piwikApp").directive("piwikContentIntro",Fu); +function Ju(){return{restrict:"A",link:function(e,t){qu.mounted(t[0])}}}Ju.$inject=[],angular.module("piwikApp").directive("piwikContentIntro",Ju); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var Ru={mounted:function(e){e.classList.add("card","card-table","entityTable")}}; + */var Gu={mounted:function(e){e.classList.add("card","card-table","entityTable")}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function _u(){return{restrict:"A",link:function(e,t){Ru.mounted(t[0])}}}_u.$inject=[],angular.module("piwikApp").directive("piwikContentTable",_u);var $u={ref:"root"};function Hu(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",$u,[Object(i["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}var Uu=window,Wu=Uu.$,qu=Object(i["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data:function(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted:function(){var e=this;Wu(this.$refs.root).on("click","input[type=submit]",(function(){e.submitForm()}))},methods:{submitForm:function(){var e=this;this.successfulPostResponse=null,this.errorPostResponse=null;var t=this.formData;this.sendJsonPayload&&(t={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,Qe.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=mc.show({message:C("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});mc.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});qu.render=Hu;var Ju=qu; + */function zu(){return{restrict:"A",link:function(e,t){Gu.mounted(t[0])}}}zu.$inject=[],angular.module("piwikApp").directive("piwikContentTable",zu);var Yu={ref:"root"};function Qu(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Yu,[Object(i["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}var Ku=window,Xu=Ku.$,Zu=Object(i["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data:function(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted:function(){var e=this;Xu(this.$refs.root).on("click","input[type=submit]",(function(){e.submitForm()}))},methods:{submitForm:function(){var e=this;this.successfulPostResponse=null,this.errorPostResponse=null;var t=this.formData;this.sendJsonPayload&&(t={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,Qe.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=jc.show({message:C("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});jc.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});Zu.render=Qu;var ed=Zu; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Gu(e){return{restrict:"A",scope:{submitApiMethod:"=",sendJsonPayload:"=",noErrorNotification:"=",noSuccessNotification:"=",useCustomDataBinding:"="},require:"?ngModel",transclude:!0,compile:function(t,n){return n.noErrorNotification=!!n.noErrorNotification,function(t,n,r,o,a){if(!t.submitApiMethod)throw new Error("submitApiMethod is required");if(t.ajaxForm={},t.ajaxForm.submitApiMethod=t.submitApiMethod,t.ajaxForm.sendJsonPayload=t.sendJsonPayload,t.ajaxForm.noErrorNotification=t.noErrorNotification,t.ajaxForm.noSuccessNotification=t.noSuccessNotification,t.ajaxForm.data={},o){var c=e(r.ngModel);t.ajaxForm.data=c(t.$parent)}var l={mounted:function(e,n){t.ajaxForm.submitForm=n.value.submitForm}},s='\n \n \n ',u=qt({template:s,data:function(){return t.ajaxForm},setup:function(){var e=Object(i["ref"])(null);return{transcludeTarget:e}}});u.component("AjaxForm",Ju),u.directive("SpecialBindDirective",l);var d=u.mount(n[0]);function p(e,n){var r,o=angular.element,i=o(e).attr("name");r="checkbox"===o(e).attr("type")?o(e).is(":checked"):o(e).val(),t.ajaxForm.data[i]=r,n||setTimeout((function(){t.$apply()}),0)}n.on("$destroy",(function(){u.unmount()})),t.useCustomDataBinding||n.on("change","input,select",(function(e){p(e.target)})),a(t,(function(e,t){if(!t.useCustomDataBinding){var n=e.find("input,select").not("[type=submit]");n.each((function(){p(this,!0)}))}$(d.transcludeTarget).append(e)}))}}}}Gu.$inject=["$parse"],angular.module("piwikApp").directive("piwikAjaxForm",Gu); + */function td(e){return{restrict:"A",scope:{submitApiMethod:"=",sendJsonPayload:"=",noErrorNotification:"=",noSuccessNotification:"=",useCustomDataBinding:"="},require:"?ngModel",transclude:!0,compile:function(t,n){return n.noErrorNotification=!!n.noErrorNotification,function(t,n,r,o,a){if(!t.submitApiMethod)throw new Error("submitApiMethod is required");if(t.ajaxForm={},t.ajaxForm.submitApiMethod=t.submitApiMethod,t.ajaxForm.sendJsonPayload=t.sendJsonPayload,t.ajaxForm.noErrorNotification=t.noErrorNotification,t.ajaxForm.noSuccessNotification=t.noSuccessNotification,t.ajaxForm.data={},o){var c=e(r.ngModel);t.ajaxForm.data=c(t.$parent)}var l={mounted:function(e,n){t.ajaxForm.submitForm=n.value.submitForm}},s='\n \n \n ',u=Zt({template:s,data:function(){return t.ajaxForm},setup:function(){var e=Object(i["ref"])(null);return{transcludeTarget:e}}});u.component("AjaxForm",ed),u.directive("SpecialBindDirective",l);var d=u.mount(n[0]);function p(e,n){var r,o=angular.element,i=o(e).attr("name");r="checkbox"===o(e).attr("type")?o(e).is(":checked"):o(e).val(),t.ajaxForm.data[i]=r,n||setTimeout((function(){t.$apply()}),0)}n.on("$destroy",(function(){u.unmount()})),t.useCustomDataBinding||n.on("change","input,select",(function(e){p(e.target)})),a(t,(function(e,t){if(!t.useCustomDataBinding){var n=e.find("input,select").not("[type=submit]");n.each((function(){p(this,!0)}))}$(d.transcludeTarget).append(e)}))}}}}td.$inject=["$parse"],angular.module("piwikApp").directive("piwikAjaxForm",td); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var zu=rn({component:pa,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"});function Yu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qu(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["alert",Yu({},"alert-".concat(e.severity),!0)])},[Object(i["renderSlot"])(e.$slots,"default")],2)}var Ku=Object(i["defineComponent"])({props:{severity:{type:String,required:!0}}});Ku.render=Qu;var Xu=Ku,Zu=rn({component:Xu,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); + */var nd=pn({component:Oa,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"});function rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function od(e,t,n,r,o,a){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])(["alert",rd({},"alert-".concat(e.severity),!0)])},[Object(i["renderSlot"])(e.$slots,"default")],2)}var id=Object(i["defineComponent"])({props:{severity:{type:String,required:!0}}});id.render=od;var ad=id,cd=pn({component:ad,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!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 ed(e,t,n){var r=new Date;n||(n=432e4),r.setTime(r.getTime()+n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/")}function td(e){var t="; ".concat(document.cookie),n=t.split("; ".concat(e,"="));if(2==n.length){var r=n.pop().split(";").shift();if("undefined"!==typeof r)return r}return null}function nd(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} + */function ld(e,t,n){var r=new Date;n||(n=432e4),r.setTime(r.getTime()+n),document.cookie="".concat(e,"=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/")}function sd(e){var t="; ".concat(document.cookie),n=t.split("; ".concat(e,"="));if(2==n.length){var r=n.pop().split(";").shift();if("undefined"!==typeof r)return r}return null}function ud(e){var t=new Date;t.setTime(t.getTime()+-864e5),document.cookie="".concat(e,"=; expires=").concat(t.toUTCString(),"; path=/")} /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.adapter.ts b/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.adapter.ts new file mode 100644 index 0000000000..4f07a5338a --- /dev/null +++ b/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.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 { IDirective, IScope } from 'angular'; +import DropdownButton from './DropdownButton'; + +export default function piwikDropdownButton(): IDirective { + return { + restrict: 'C', + link: function piwikDropdownButtonLink(scope: IScope, element: JQuery) { + DropdownButton.mounted(element[0]); + }, + }; +} + +piwikDropdownButton.$inject = []; + +angular.module('piwikApp').directive('dropdownButton', piwikDropdownButton); diff --git a/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.ts b/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.ts new file mode 100644 index 0000000000..5369039418 --- /dev/null +++ b/plugins/CoreHome/vue/src/DropdownButton/DropdownButton.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 + */ + +const { $ } = window; + +export default { + mounted(el: HTMLElement): void { + const element = $(el); + + // BC for materializecss 0.97 => 1.0 + if (!element.attr('data-target') + && element.attr('data-activates') + ) { + element.attr('data-target', element.attr('data-activates')); + } + + const target = element.attr('data-target'); + if (target && $(`#${target}`).length) { + $(element).dropdown({ + inDuration: 300, + outDuration: 225, + constrainWidth: false, // Does not change width of dropdown to that of the activator + // hover: true, // Activate on hover + belowOrigin: true, // Displays dropdown below the button + }); + } + }, +}; diff --git a/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts b/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts new file mode 100644 index 0000000000..7fa5d1e371 --- /dev/null +++ b/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.adapter.ts @@ -0,0 +1,34 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IAttributes, IDirective, IScope } from 'angular'; +import ShowSensitiveData from './ShowSensitiveData'; + +export default function piwikShowSensitiveData(): IDirective { + return { + restrict: 'A', + link: function piwikShowSensitiveDataLink(scope: IScope, element: JQuery, attr: IAttributes) { + const binding = { + instance: null, + value: { + sensitiveData: attr.piwikShowSensitiveData || (attr.text ? attr.text() : ''), + showCharacters: attr.showCharacters ? parseInt(attr.showCharacters, 10) : undefined, + clickElementSelector: attr.clickElementSelector, + }, + oldValue: null, + modifiers: {}, + dir: {}, + }; + + ShowSensitiveData.mounted(element[0], binding); + }, + }; +} + +piwikShowSensitiveData.$inject = []; + +angular.module('piwikApp').directive('piwikShowSensitiveData', piwikShowSensitiveData); diff --git a/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.ts b/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.ts new file mode 100644 index 0000000000..2d15c417ba --- /dev/null +++ b/plugins/CoreHome/vue/src/ShowSensitiveData/ShowSensitiveData.ts @@ -0,0 +1,65 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { DirectiveBinding } from 'vue'; +import translate from '../translate'; + +interface ShowSensitiveDataArgs { + sensitiveData: string; + showCharacters: number; + clickElementSelector: string|HTMLElement|JQuery; +} + +const { $ } = window; + +/** + * Handles visibility of sensitive data. By default data will be shown replaced with stars (*) + * On click on the element the full data will be shown + * + * Configuration attributes: + * data-show-characters number of characters to show in clear text (defaults to 6) + * data-click-element-selector selector for element that will show the full data on click + * (defaults to element) + * + * Example: + *
+ */ +export default { + mounted(el: HTMLElement, binding: DirectiveBinding): void { + const element = $(el); + + const { sensitiveData } = binding.value; + const showCharacters = binding.value.showCharacters || 6; + const clickElement = binding.value.clickElementSelector || element; + + let protectedData = ''; + if (showCharacters > 0) { + protectedData += sensitiveData.substr(0, showCharacters); + } + protectedData += sensitiveData.substr(showCharacters).replace(/./g, '*'); + element.html(protectedData); + + function onClickHandler() { + element.html(sensitiveData); + $(clickElement).css({ + cursor: '', + }); + $(clickElement).tooltip('destroy'); + } + + $(clickElement).tooltip({ + content: translate('CoreHome_ClickToSeeFullInformation'), + items: '*', + track: true, + }); + + $(clickElement).one('click', onClickHandler); + $(clickElement).css({ + cursor: 'pointer', + }); + }, +}; diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts index 074b1c0125..ca9be63c2c 100644 --- a/plugins/CoreHome/vue/src/index.ts +++ b/plugins/CoreHome/vue/src/index.ts @@ -21,6 +21,8 @@ import './FocusAnywhereButHere/FocusAnywhereButHere.adapter'; import './FocusIf/FocusIf.adapter'; import './ExpandOnClick/ExpandOnClick.adapter'; import './ExpandOnHover/ExpandOnHover.adapter'; +import './ShowSensitiveData/ShowSensitiveData.adapter'; +import './DropdownButton/DropdownButton.adapter'; import './SelectOnFocus/SelectOnFocus.adapter'; import './SideNav/SideNav.adapter'; import './MatomoDialog/MatomoDialog.adapter'; @@ -77,6 +79,8 @@ export { default as FocusIf } from './FocusIf/FocusIf'; export { default as MatomoDialog } from './MatomoDialog/MatomoDialog.vue'; export { default as ExpandOnClick } from './ExpandOnClick/ExpandOnClick'; export { default as ExpandOnHover } from './ExpandOnHover/ExpandOnHover'; +export { default as ShowSensitiveData } from './ShowSensitiveData/ShowSensitiveData'; +export { default as DropdownButton } from './DropdownButton/DropdownButton'; export { default as SelectOnFocus } from './SelectOnFocus/SelectOnFocus'; export { default as SideNav } from './SideNav/SideNav'; export { default as EnrichedHeadline } from './EnrichedHeadline/EnrichedHeadline.vue'; diff --git a/tests/UI/specs/EvolutionGraph_spec.js b/tests/UI/specs/EvolutionGraph_spec.js index 28e24ebd0a..4d87e3cb1d 100644 --- a/tests/UI/specs/EvolutionGraph_spec.js +++ b/tests/UI/specs/EvolutionGraph_spec.js @@ -211,4 +211,4 @@ describe("EvolutionGraph", function () { expect(await page.screenshot({ fullPage: true })).to.matchImage('periods_selected'); }); -}); \ No newline at end of file +}); -- cgit v1.2.3